/*
THIS IS A GENERATED/BUNDLED FILE BY ESBUILD
if you want to view the source, please visit the github repository of this plugin
*/

(function initCjs() {
  const globalThisRecord = globalThis;
  globalThisRecord["__name"] ??= name;
  const originalRequire = require;
  if (originalRequire && !originalRequire.__isPatched) {
    require = Object.assign(
      (id) => requirePatched(id),
      originalRequire,
      {
        __isPatched: true
      }
    );
  }
  const newFuncs = {
    __extractDefault: () => extractDefault,
    process: () => {
      const browserProcess = {
        browser: true,
        cwd: () => "/",
        env: {},
        platform: "android"
      };
      return browserProcess;
    }
  };
  for (const key of Object.keys(newFuncs)) {
    globalThisRecord[key] ??= newFuncs[key]?.();
  }
  function name(obj) {
    return obj;
  }
  function extractDefault(module2) {
    return module2 && module2.__esModule && module2.default ? module2.default : module2;
  }
  function requirePatched(id) {
    const module2 = originalRequire?.(id);
    if (module2) {
      return extractDefault(module2);
    }
    if (id === "process" || id === "node:process") {
      console.error(`Module not found: ${id}. Fake process object is returned instead.`);
      return globalThis.process;
    }
    console.error(`Module not found: ${id}. Empty object is returned instead.`);
    return {};
  }
})();

"use strict";var ey=Object.create;var Oi=Object.defineProperty;var ty=Object.getOwnPropertyDescriptor;var ny=Object.getOwnPropertyNames;var ry=Object.getPrototypeOf,iy=Object.prototype.hasOwnProperty;var V=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Wu=(t,e)=>{for(var n in e)Oi(t,n,{get:e[n],enumerable:!0})},zu=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of ny(e))!iy.call(t,s)&&s!==n&&Oi(t,s,{get:()=>e[s],enumerable:!(r=ty(e,s))||r.enumerable});return t};var ze=(t,e,n)=>(n=t!=null?ey(ry(t)):{},zu(e||!t||!t.__esModule?Oi(n,"default",{value:t,enumerable:!0}):n,t)),sy=t=>zu(Oi({},"__esModule",{value:!0}),t);var zt=V((Ko,qn)=>{(function(t,e){typeof Ko=="object"&&typeof qn<"u"?qn.exports=e():typeof define=="function"&&define.amd?define(e):t.moment=e()})(Ko,function(){"use strict";var t;function e(){return t.apply(null,arguments)}function n(i){t=i}function r(i){return i instanceof Array||Object.prototype.toString.call(i)==="[object Array]"}function s(i){return i!=null&&Object.prototype.toString.call(i)==="[object Object]"}function o(i,a){return Object.prototype.hasOwnProperty.call(i,a)}function l(i){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(i).length===0;var a;for(a in i)if(o(i,a))return!1;return!0}function u(i){return i===void 0}function f(i){return typeof i=="number"||Object.prototype.toString.call(i)==="[object Number]"}function h(i){return i instanceof Date||Object.prototype.toString.call(i)==="[object Date]"}function m(i,a){var c=[],d,y=i.length;for(d=0;d<y;++d)c.push(a(i[d],d));return c}function p(i,a){for(var c in a)o(a,c)&&(i[c]=a[c]);return o(a,"toString")&&(i.toString=a.toString),o(a,"valueOf")&&(i.valueOf=a.valueOf),i}function g(i,a,c,d){return bu(i,a,c,d,!0).utc()}function w(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidEra:null,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],era:null,meridiem:null,rfc2822:!1,weekdayMismatch:!1}}function E(i){return i._pf==null&&(i._pf=w()),i._pf}var F;Array.prototype.some?F=Array.prototype.some:F=function(i){var a=Object(this),c=a.length>>>0,d;for(d=0;d<c;d++)if(d in a&&i.call(this,a[d],d,a))return!0;return!1};function T(i){var a=null,c=!1,d=i._d&&!isNaN(i._d.getTime());if(d&&(a=E(i),c=F.call(a.parsedDateParts,function(y){return y!=null}),d=a.overflow<0&&!a.empty&&!a.invalidEra&&!a.invalidMonth&&!a.invalidWeekday&&!a.weekdayMismatch&&!a.nullInput&&!a.invalidFormat&&!a.userInvalidated&&(!a.meridiem||a.meridiem&&c),i._strict&&(d=d&&a.charsLeftOver===0&&a.unusedTokens.length===0&&a.bigHour===void 0)),Object.isFrozen==null||!Object.isFrozen(i))i._isValid=d;else return d;return i._isValid}function C(i){var a=g(NaN);return i!=null?p(E(a),i):E(a).userInvalidated=!0,a}var _=e.momentProperties=[],I=!1;function W(i,a){var c,d,y,k=_.length;if(u(a._isAMomentObject)||(i._isAMomentObject=a._isAMomentObject),u(a._i)||(i._i=a._i),u(a._f)||(i._f=a._f),u(a._l)||(i._l=a._l),u(a._strict)||(i._strict=a._strict),u(a._tzm)||(i._tzm=a._tzm),u(a._isUTC)||(i._isUTC=a._isUTC),u(a._offset)||(i._offset=a._offset),u(a._pf)||(i._pf=E(a)),u(a._locale)||(i._locale=a._locale),k>0)for(c=0;c<k;c++)d=_[c],y=a[d],u(y)||(i[d]=y);return i}function H(i){W(this,i),this._d=new Date(i._d!=null?i._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),I===!1&&(I=!0,e.updateOffset(this),I=!1)}function A(i){return i instanceof H||i!=null&&i._isAMomentObject!=null}function te(i){e.suppressDeprecationWarnings===!1&&typeof console<"u"&&console.warn&&console.warn("Deprecation warning: "+i)}function K(i,a){var c=!0;return p(function(){if(e.deprecationHandler!=null&&e.deprecationHandler(null,i),c){var d=[],y,k,v,D=arguments.length;for(k=0;k<D;k++){if(y="",typeof arguments[k]=="object"){y+=`
[`+k+"] ";for(v in arguments[0])o(arguments[0],v)&&(y+=v+": "+arguments[0][v]+", ");y=y.slice(0,-2)}else y=arguments[k];d.push(y)}te(i+`
Arguments: `+Array.prototype.slice.call(d).join("")+`
`+new Error().stack),c=!1}return a.apply(this,arguments)},a)}var J={};function oe(i,a){e.deprecationHandler!=null&&e.deprecationHandler(i,a),J[i]||(te(a),J[i]=!0)}e.suppressDeprecationWarnings=!1,e.deprecationHandler=null;function ue(i){return typeof Function<"u"&&i instanceof Function||Object.prototype.toString.call(i)==="[object Function]"}function re(i){var a,c;for(c in i)o(i,c)&&(a=i[c],ue(a)?this[c]=a:this["_"+c]=a);this._config=i,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)}function Y(i,a){var c=p({},i),d;for(d in a)o(a,d)&&(s(i[d])&&s(a[d])?(c[d]={},p(c[d],i[d]),p(c[d],a[d])):a[d]!=null?c[d]=a[d]:delete c[d]);for(d in i)o(i,d)&&!o(a,d)&&s(i[d])&&(c[d]=p({},c[d]));return c}function j(i){i!=null&&this.set(i)}var z;Object.keys?z=Object.keys:z=function(i){var a,c=[];for(a in i)o(i,a)&&c.push(a);return c};var ie={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"};function he(i,a,c){var d=this._calendar[i]||this._calendar.sameElse;return ue(d)?d.call(a,c):d}function me(i,a,c){var d=""+Math.abs(i),y=a-d.length,k=i>=0;return(k?c?"+":"":"-")+Math.pow(10,Math.max(0,y)).toString().substr(1)+d}var Ge=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,x=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,Pe={},Re={};function b(i,a,c,d){var y=d;typeof d=="string"&&(y=function(){return this[d]()}),i&&(Re[i]=y),a&&(Re[a[0]]=function(){return me(y.apply(this,arguments),a[1],a[2])}),c&&(Re[c]=function(){return this.localeData().ordinal(y.apply(this,arguments),i)})}function $e(i){return i.match(/\[[\s\S]/)?i.replace(/^\[|\]$/g,""):i.replace(/\\/g,"")}function Rt(i){var a=i.match(Ge),c,d;for(c=0,d=a.length;c<d;c++)Re[a[c]]?a[c]=Re[a[c]]:a[c]=$e(a[c]);return function(y){var k="",v;for(v=0;v<d;v++)k+=ue(a[v])?a[v].call(y,i):a[v];return k}}function en(i,a){return i.isValid()?(a=kn(a,i.localeData()),Pe[a]=Pe[a]||Rt(a),Pe[a](i)):i.localeData().invalidDate()}function kn(i,a){var c=5;function d(y){return a.longDateFormat(y)||y}for(x.lastIndex=0;c>=0&&x.test(i);)i=i.replace(x,d),x.lastIndex=0,c-=1;return i}var Ce={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};function xn(i){var a=this._longDateFormat[i],c=this._longDateFormat[i.toUpperCase()];return a||!c?a:(this._longDateFormat[i]=c.match(Ge).map(function(d){return d==="MMMM"||d==="MM"||d==="DD"||d==="dddd"?d.slice(1):d}).join(""),this._longDateFormat[i])}var pt="Invalid date";function Ot(){return this._invalidDate}var tn="%d",Ar=/\d{1,2}/;function To(i){return this._ordinal.replace("%d",i)}var mi={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function pi(i,a,c,d){var y=this._relativeTime[c];return ue(y)?y(i,a,c,d):y.replace(/%d/i,i)}function gi(i,a){var c=this._relativeTime[i>0?"future":"past"];return ue(c)?c(a):c.replace(/%s/i,a)}var wi={D:"date",dates:"date",date:"date",d:"day",days:"day",day:"day",e:"weekday",weekdays:"weekday",weekday:"weekday",E:"isoWeekday",isoweekdays:"isoWeekday",isoweekday:"isoWeekday",DDD:"dayOfYear",dayofyears:"dayOfYear",dayofyear:"dayOfYear",h:"hour",hours:"hour",hour:"hour",ms:"millisecond",milliseconds:"millisecond",millisecond:"millisecond",m:"minute",minutes:"minute",minute:"minute",M:"month",months:"month",month:"month",Q:"quarter",quarters:"quarter",quarter:"quarter",s:"second",seconds:"second",second:"second",gg:"weekYear",weekyears:"weekYear",weekyear:"weekYear",GG:"isoWeekYear",isoweekyears:"isoWeekYear",isoweekyear:"isoWeekYear",w:"week",weeks:"week",week:"week",W:"isoWeek",isoweeks:"isoWeek",isoweek:"isoWeek",y:"year",years:"year",year:"year"};function Ye(i){return typeof i=="string"?wi[i]||wi[i.toLowerCase()]:void 0}function Yn(i){var a={},c,d;for(d in i)o(i,d)&&(c=Ye(d),c&&(a[c]=i[d]));return a}var _o={date:9,day:11,weekday:11,isoWeekday:11,dayOfYear:4,hour:13,millisecond:16,minute:14,month:8,quarter:7,second:15,weekYear:1,isoWeekYear:1,week:5,isoWeek:5,year:1};function Fo(i){var a=[],c;for(c in i)o(i,c)&&a.push({unit:c,priority:_o[c]});return a.sort(function(d,y){return d.priority-y.priority}),a}var yi=/\d/,Be=/\d\d/,bi=/\d{3}/,S=/\d{4}/,R=/[+-]?\d{6}/,O=/\d\d?/,Z=/\d\d\d\d?/,ae=/\d\d\d\d\d\d?/,Oe=/\d{1,3}/,gt=/\d{1,4}/,Xe=/[+-]?\d{1,6}/,at=/\d+/,Et=/[+-]?\d+/,Ve=/Z|[+-]\d\d:?\d\d/gi,wt=/Z|[+-]\d\d(?::?\d\d)?/gi,yt=/[+-]?\d+(\.\d{1,3})?/,Sr=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,Bn=/^[1-9]\d?/,Io=/^([1-9]\d|\d)/,ki;ki={};function N(i,a,c){ki[i]=ue(a)?a:function(d,y){return d&&c?c:a}}function xp(i,a){return o(ki,i)?ki[i](a._strict,a._locale):new RegExp(Ep(i))}function Ep(i){return Dt(i.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(a,c,d,y,k){return c||d||y||k}))}function Dt(i){return i.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function lt(i){return i<0?Math.ceil(i)||0:Math.floor(i)}function Q(i){var a=+i,c=0;return a!==0&&isFinite(a)&&(c=lt(a)),c}var Po={};function le(i,a){var c,d=a,y;for(typeof i=="string"&&(i=[i]),f(a)&&(d=function(k,v){v[a]=Q(k)}),y=i.length,c=0;c<y;c++)Po[i[c]]=d}function Tr(i,a){le(i,function(c,d,y,k){y._w=y._w||{},a(c,y._w,y,k)})}function Cp(i,a,c){a!=null&&o(Po,i)&&Po[i](a,c._a,c,i)}function xi(i){return i%4===0&&i%100!==0||i%400===0}var De=0,Lt=1,Ct=2,ve=3,bt=4,Mt=5,En=6,vp=7,Ap=8;b("Y",0,0,function(){var i=this.year();return i<=9999?me(i,4):"+"+i}),b(0,["YY",2],0,function(){return this.year()%100}),b(0,["YYYY",4],0,"year"),b(0,["YYYYY",5],0,"year"),b(0,["YYYYYY",6,!0],0,"year"),N("Y",Et),N("YY",O,Be),N("YYYY",gt,S),N("YYYYY",Xe,R),N("YYYYYY",Xe,R),le(["YYYYY","YYYYYY"],De),le("YYYY",function(i,a){a[De]=i.length===2?e.parseTwoDigitYear(i):Q(i)}),le("YY",function(i,a){a[De]=e.parseTwoDigitYear(i)}),le("Y",function(i,a){a[De]=parseInt(i,10)});function _r(i){return xi(i)?366:365}e.parseTwoDigitYear=function(i){return Q(i)+(Q(i)>68?1900:2e3)};var ru=Vn("FullYear",!0);function Sp(){return xi(this.year())}function Vn(i,a){return function(c){return c!=null?(iu(this,i,c),e.updateOffset(this,a),this):Fr(this,i)}}function Fr(i,a){if(!i.isValid())return NaN;var c=i._d,d=i._isUTC;switch(a){case"Milliseconds":return d?c.getUTCMilliseconds():c.getMilliseconds();case"Seconds":return d?c.getUTCSeconds():c.getSeconds();case"Minutes":return d?c.getUTCMinutes():c.getMinutes();case"Hours":return d?c.getUTCHours():c.getHours();case"Date":return d?c.getUTCDate():c.getDate();case"Day":return d?c.getUTCDay():c.getDay();case"Month":return d?c.getUTCMonth():c.getMonth();case"FullYear":return d?c.getUTCFullYear():c.getFullYear();default:return NaN}}function iu(i,a,c){var d,y,k,v,D;if(!(!i.isValid()||isNaN(c))){switch(d=i._d,y=i._isUTC,a){case"Milliseconds":return void(y?d.setUTCMilliseconds(c):d.setMilliseconds(c));case"Seconds":return void(y?d.setUTCSeconds(c):d.setSeconds(c));case"Minutes":return void(y?d.setUTCMinutes(c):d.setMinutes(c));case"Hours":return void(y?d.setUTCHours(c):d.setHours(c));case"Date":return void(y?d.setUTCDate(c):d.setDate(c));case"FullYear":break;default:return}k=c,v=i.month(),D=i.date(),D=D===29&&v===1&&!xi(k)?28:D,y?d.setUTCFullYear(k,v,D):d.setFullYear(k,v,D)}}function Tp(i){return i=Ye(i),ue(this[i])?this[i]():this}function _p(i,a){if(typeof i=="object"){i=Yn(i);var c=Fo(i),d,y=c.length;for(d=0;d<y;d++)this[c[d].unit](i[c[d].unit])}else if(i=Ye(i),ue(this[i]))return this[i](a);return this}function Fp(i,a){return(i%a+a)%a}var ge;Array.prototype.indexOf?ge=Array.prototype.indexOf:ge=function(i){var a;for(a=0;a<this.length;++a)if(this[a]===i)return a;return-1};function Ro(i,a){if(isNaN(i)||isNaN(a))return NaN;var c=Fp(a,12);return i+=(a-c)/12,c===1?xi(i)?29:28:31-c%7%2}b("M",["MM",2],"Mo",function(){return this.month()+1}),b("MMM",0,0,function(i){return this.localeData().monthsShort(this,i)}),b("MMMM",0,0,function(i){return this.localeData().months(this,i)}),N("M",O,Bn),N("MM",O,Be),N("MMM",function(i,a){return a.monthsShortRegex(i)}),N("MMMM",function(i,a){return a.monthsRegex(i)}),le(["M","MM"],function(i,a){a[Lt]=Q(i)-1}),le(["MMM","MMMM"],function(i,a,c,d){var y=c._locale.monthsParse(i,d,c._strict);y!=null?a[Lt]=y:E(c).invalidMonth=i});var Ip="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),su="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),ou=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,Pp=Sr,Rp=Sr;function Op(i,a){return i?r(this._months)?this._months[i.month()]:this._months[(this._months.isFormat||ou).test(a)?"format":"standalone"][i.month()]:r(this._months)?this._months:this._months.standalone}function Dp(i,a){return i?r(this._monthsShort)?this._monthsShort[i.month()]:this._monthsShort[ou.test(a)?"format":"standalone"][i.month()]:r(this._monthsShort)?this._monthsShort:this._monthsShort.standalone}function Lp(i,a,c){var d,y,k,v=i.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],d=0;d<12;++d)k=g([2e3,d]),this._shortMonthsParse[d]=this.monthsShort(k,"").toLocaleLowerCase(),this._longMonthsParse[d]=this.months(k,"").toLocaleLowerCase();return c?a==="MMM"?(y=ge.call(this._shortMonthsParse,v),y!==-1?y:null):(y=ge.call(this._longMonthsParse,v),y!==-1?y:null):a==="MMM"?(y=ge.call(this._shortMonthsParse,v),y!==-1?y:(y=ge.call(this._longMonthsParse,v),y!==-1?y:null)):(y=ge.call(this._longMonthsParse,v),y!==-1?y:(y=ge.call(this._shortMonthsParse,v),y!==-1?y:null))}function Mp(i,a,c){var d,y,k;if(this._monthsParseExact)return Lp.call(this,i,a,c);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),d=0;d<12;d++){if(y=g([2e3,d]),c&&!this._longMonthsParse[d]&&(this._longMonthsParse[d]=new RegExp("^"+this.months(y,"").replace(".","")+"$","i"),this._shortMonthsParse[d]=new RegExp("^"+this.monthsShort(y,"").replace(".","")+"$","i")),!c&&!this._monthsParse[d]&&(k="^"+this.months(y,"")+"|^"+this.monthsShort(y,""),this._monthsParse[d]=new RegExp(k.replace(".",""),"i")),c&&a==="MMMM"&&this._longMonthsParse[d].test(i))return d;if(c&&a==="MMM"&&this._shortMonthsParse[d].test(i))return d;if(!c&&this._monthsParse[d].test(i))return d}}function au(i,a){if(!i.isValid())return i;if(typeof a=="string"){if(/^\d+$/.test(a))a=Q(a);else if(a=i.localeData().monthsParse(a),!f(a))return i}var c=a,d=i.date();return d=d<29?d:Math.min(d,Ro(i.year(),c)),i._isUTC?i._d.setUTCMonth(c,d):i._d.setMonth(c,d),i}function lu(i){return i!=null?(au(this,i),e.updateOffset(this,!0),this):Fr(this,"Month")}function Np(){return Ro(this.year(),this.month())}function $p(i){return this._monthsParseExact?(o(this,"_monthsRegex")||uu.call(this),i?this._monthsShortStrictRegex:this._monthsShortRegex):(o(this,"_monthsShortRegex")||(this._monthsShortRegex=Pp),this._monthsShortStrictRegex&&i?this._monthsShortStrictRegex:this._monthsShortRegex)}function Yp(i){return this._monthsParseExact?(o(this,"_monthsRegex")||uu.call(this),i?this._monthsStrictRegex:this._monthsRegex):(o(this,"_monthsRegex")||(this._monthsRegex=Rp),this._monthsStrictRegex&&i?this._monthsStrictRegex:this._monthsRegex)}function uu(){function i(U,ee){return ee.length-U.length}var a=[],c=[],d=[],y,k,v,D;for(y=0;y<12;y++)k=g([2e3,y]),v=Dt(this.monthsShort(k,"")),D=Dt(this.months(k,"")),a.push(v),c.push(D),d.push(D),d.push(v);a.sort(i),c.sort(i),d.sort(i),this._monthsRegex=new RegExp("^("+d.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+c.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+a.join("|")+")","i")}function Bp(i,a,c,d,y,k,v){var D;return i<100&&i>=0?(D=new Date(i+400,a,c,d,y,k,v),isFinite(D.getFullYear())&&D.setFullYear(i)):D=new Date(i,a,c,d,y,k,v),D}function Ir(i){var a,c;return i<100&&i>=0?(c=Array.prototype.slice.call(arguments),c[0]=i+400,a=new Date(Date.UTC.apply(null,c)),isFinite(a.getUTCFullYear())&&a.setUTCFullYear(i)):a=new Date(Date.UTC.apply(null,arguments)),a}function Ei(i,a,c){var d=7+a-c,y=(7+Ir(i,0,d).getUTCDay()-a)%7;return-y+d-1}function cu(i,a,c,d,y){var k=(7+c-d)%7,v=Ei(i,d,y),D=1+7*(a-1)+k+v,U,ee;return D<=0?(U=i-1,ee=_r(U)+D):D>_r(i)?(U=i+1,ee=D-_r(i)):(U=i,ee=D),{year:U,dayOfYear:ee}}function Pr(i,a,c){var d=Ei(i.year(),a,c),y=Math.floor((i.dayOfYear()-d-1)/7)+1,k,v;return y<1?(v=i.year()-1,k=y+Nt(v,a,c)):y>Nt(i.year(),a,c)?(k=y-Nt(i.year(),a,c),v=i.year()+1):(v=i.year(),k=y),{week:k,year:v}}function Nt(i,a,c){var d=Ei(i,a,c),y=Ei(i+1,a,c);return(_r(i)-d+y)/7}b("w",["ww",2],"wo","week"),b("W",["WW",2],"Wo","isoWeek"),N("w",O,Bn),N("ww",O,Be),N("W",O,Bn),N("WW",O,Be),Tr(["w","ww","W","WW"],function(i,a,c,d){a[d.substr(0,1)]=Q(i)});function Vp(i){return Pr(i,this._week.dow,this._week.doy).week}var Wp={dow:0,doy:6};function zp(){return this._week.dow}function Up(){return this._week.doy}function Hp(i){var a=this.localeData().week(this);return i==null?a:this.add((i-a)*7,"d")}function jp(i){var a=Pr(this,1,4).week;return i==null?a:this.add((i-a)*7,"d")}b("d",0,"do","day"),b("dd",0,0,function(i){return this.localeData().weekdaysMin(this,i)}),b("ddd",0,0,function(i){return this.localeData().weekdaysShort(this,i)}),b("dddd",0,0,function(i){return this.localeData().weekdays(this,i)}),b("e",0,0,"weekday"),b("E",0,0,"isoWeekday"),N("d",O),N("e",O),N("E",O),N("dd",function(i,a){return a.weekdaysMinRegex(i)}),N("ddd",function(i,a){return a.weekdaysShortRegex(i)}),N("dddd",function(i,a){return a.weekdaysRegex(i)}),Tr(["dd","ddd","dddd"],function(i,a,c,d){var y=c._locale.weekdaysParse(i,d,c._strict);y!=null?a.d=y:E(c).invalidWeekday=i}),Tr(["d","e","E"],function(i,a,c,d){a[d]=Q(i)});function qp(i,a){return typeof i!="string"?i:isNaN(i)?(i=a.weekdaysParse(i),typeof i=="number"?i:null):parseInt(i,10)}function Gp(i,a){return typeof i=="string"?a.weekdaysParse(i)%7||7:isNaN(i)?null:i}function Oo(i,a){return i.slice(a,7).concat(i.slice(0,a))}var Xp="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),fu="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),Kp="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),Jp=Sr,Zp=Sr,Qp=Sr;function eg(i,a){var c=r(this._weekdays)?this._weekdays:this._weekdays[i&&i!==!0&&this._weekdays.isFormat.test(a)?"format":"standalone"];return i===!0?Oo(c,this._week.dow):i?c[i.day()]:c}function tg(i){return i===!0?Oo(this._weekdaysShort,this._week.dow):i?this._weekdaysShort[i.day()]:this._weekdaysShort}function ng(i){return i===!0?Oo(this._weekdaysMin,this._week.dow):i?this._weekdaysMin[i.day()]:this._weekdaysMin}function rg(i,a,c){var d,y,k,v=i.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],d=0;d<7;++d)k=g([2e3,1]).day(d),this._minWeekdaysParse[d]=this.weekdaysMin(k,"").toLocaleLowerCase(),this._shortWeekdaysParse[d]=this.weekdaysShort(k,"").toLocaleLowerCase(),this._weekdaysParse[d]=this.weekdays(k,"").toLocaleLowerCase();return c?a==="dddd"?(y=ge.call(this._weekdaysParse,v),y!==-1?y:null):a==="ddd"?(y=ge.call(this._shortWeekdaysParse,v),y!==-1?y:null):(y=ge.call(this._minWeekdaysParse,v),y!==-1?y:null):a==="dddd"?(y=ge.call(this._weekdaysParse,v),y!==-1||(y=ge.call(this._shortWeekdaysParse,v),y!==-1)?y:(y=ge.call(this._minWeekdaysParse,v),y!==-1?y:null)):a==="ddd"?(y=ge.call(this._shortWeekdaysParse,v),y!==-1||(y=ge.call(this._weekdaysParse,v),y!==-1)?y:(y=ge.call(this._minWeekdaysParse,v),y!==-1?y:null)):(y=ge.call(this._minWeekdaysParse,v),y!==-1||(y=ge.call(this._weekdaysParse,v),y!==-1)?y:(y=ge.call(this._shortWeekdaysParse,v),y!==-1?y:null))}function ig(i,a,c){var d,y,k;if(this._weekdaysParseExact)return rg.call(this,i,a,c);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),d=0;d<7;d++){if(y=g([2e3,1]).day(d),c&&!this._fullWeekdaysParse[d]&&(this._fullWeekdaysParse[d]=new RegExp("^"+this.weekdays(y,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[d]=new RegExp("^"+this.weekdaysShort(y,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[d]=new RegExp("^"+this.weekdaysMin(y,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[d]||(k="^"+this.weekdays(y,"")+"|^"+this.weekdaysShort(y,"")+"|^"+this.weekdaysMin(y,""),this._weekdaysParse[d]=new RegExp(k.replace(".",""),"i")),c&&a==="dddd"&&this._fullWeekdaysParse[d].test(i))return d;if(c&&a==="ddd"&&this._shortWeekdaysParse[d].test(i))return d;if(c&&a==="dd"&&this._minWeekdaysParse[d].test(i))return d;if(!c&&this._weekdaysParse[d].test(i))return d}}function sg(i){if(!this.isValid())return i!=null?this:NaN;var a=Fr(this,"Day");return i!=null?(i=qp(i,this.localeData()),this.add(i-a,"d")):a}function og(i){if(!this.isValid())return i!=null?this:NaN;var a=(this.day()+7-this.localeData()._week.dow)%7;return i==null?a:this.add(i-a,"d")}function ag(i){if(!this.isValid())return i!=null?this:NaN;if(i!=null){var a=Gp(i,this.localeData());return this.day(this.day()%7?a:a-7)}else return this.day()||7}function lg(i){return this._weekdaysParseExact?(o(this,"_weekdaysRegex")||Do.call(this),i?this._weekdaysStrictRegex:this._weekdaysRegex):(o(this,"_weekdaysRegex")||(this._weekdaysRegex=Jp),this._weekdaysStrictRegex&&i?this._weekdaysStrictRegex:this._weekdaysRegex)}function ug(i){return this._weekdaysParseExact?(o(this,"_weekdaysRegex")||Do.call(this),i?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(o(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=Zp),this._weekdaysShortStrictRegex&&i?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function cg(i){return this._weekdaysParseExact?(o(this,"_weekdaysRegex")||Do.call(this),i?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(o(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=Qp),this._weekdaysMinStrictRegex&&i?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function Do(){function i(We,Wt){return Wt.length-We.length}var a=[],c=[],d=[],y=[],k,v,D,U,ee;for(k=0;k<7;k++)v=g([2e3,1]).day(k),D=Dt(this.weekdaysMin(v,"")),U=Dt(this.weekdaysShort(v,"")),ee=Dt(this.weekdays(v,"")),a.push(D),c.push(U),d.push(ee),y.push(D),y.push(U),y.push(ee);a.sort(i),c.sort(i),d.sort(i),y.sort(i),this._weekdaysRegex=new RegExp("^("+y.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+d.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+c.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+a.join("|")+")","i")}function Lo(){return this.hours()%12||12}function fg(){return this.hours()||24}b("H",["HH",2],0,"hour"),b("h",["hh",2],0,Lo),b("k",["kk",2],0,fg),b("hmm",0,0,function(){return""+Lo.apply(this)+me(this.minutes(),2)}),b("hmmss",0,0,function(){return""+Lo.apply(this)+me(this.minutes(),2)+me(this.seconds(),2)}),b("Hmm",0,0,function(){return""+this.hours()+me(this.minutes(),2)}),b("Hmmss",0,0,function(){return""+this.hours()+me(this.minutes(),2)+me(this.seconds(),2)});function du(i,a){b(i,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),a)})}du("a",!0),du("A",!1);function hu(i,a){return a._meridiemParse}N("a",hu),N("A",hu),N("H",O,Io),N("h",O,Bn),N("k",O,Bn),N("HH",O,Be),N("hh",O,Be),N("kk",O,Be),N("hmm",Z),N("hmmss",ae),N("Hmm",Z),N("Hmmss",ae),le(["H","HH"],ve),le(["k","kk"],function(i,a,c){var d=Q(i);a[ve]=d===24?0:d}),le(["a","A"],function(i,a,c){c._isPm=c._locale.isPM(i),c._meridiem=i}),le(["h","hh"],function(i,a,c){a[ve]=Q(i),E(c).bigHour=!0}),le("hmm",function(i,a,c){var d=i.length-2;a[ve]=Q(i.substr(0,d)),a[bt]=Q(i.substr(d)),E(c).bigHour=!0}),le("hmmss",function(i,a,c){var d=i.length-4,y=i.length-2;a[ve]=Q(i.substr(0,d)),a[bt]=Q(i.substr(d,2)),a[Mt]=Q(i.substr(y)),E(c).bigHour=!0}),le("Hmm",function(i,a,c){var d=i.length-2;a[ve]=Q(i.substr(0,d)),a[bt]=Q(i.substr(d))}),le("Hmmss",function(i,a,c){var d=i.length-4,y=i.length-2;a[ve]=Q(i.substr(0,d)),a[bt]=Q(i.substr(d,2)),a[Mt]=Q(i.substr(y))});function dg(i){return(i+"").toLowerCase().charAt(0)==="p"}var hg=/[ap]\.?m?\.?/i,mg=Vn("Hours",!0);function pg(i,a,c){return i>11?c?"pm":"PM":c?"am":"AM"}var mu={calendar:ie,longDateFormat:Ce,invalidDate:pt,ordinal:tn,dayOfMonthOrdinalParse:Ar,relativeTime:mi,months:Ip,monthsShort:su,week:Wp,weekdays:Xp,weekdaysMin:Kp,weekdaysShort:fu,meridiemParse:hg},de={},Rr={},Or;function gg(i,a){var c,d=Math.min(i.length,a.length);for(c=0;c<d;c+=1)if(i[c]!==a[c])return c;return d}function pu(i){return i&&i.toLowerCase().replace("_","-")}function wg(i){for(var a=0,c,d,y,k;a<i.length;){for(k=pu(i[a]).split("-"),c=k.length,d=pu(i[a+1]),d=d?d.split("-"):null;c>0;){if(y=Ci(k.slice(0,c).join("-")),y)return y;if(d&&d.length>=c&&gg(k,d)>=c-1)break;c--}a++}return Or}function yg(i){return!!(i&&i.match("^[^/\\\\]*$"))}function Ci(i){var a=null,c;if(de[i]===void 0&&typeof qn<"u"&&qn&&qn.exports&&yg(i))try{a=Or._abbr,c=require,c("./locale/"+i),nn(a)}catch{de[i]=null}return de[i]}function nn(i,a){var c;return i&&(u(a)?c=$t(i):c=Mo(i,a),c?Or=c:typeof console<"u"&&console.warn&&console.warn("Locale "+i+" not found. Did you forget to load it?")),Or._abbr}function Mo(i,a){if(a!==null){var c,d=mu;if(a.abbr=i,de[i]!=null)oe("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),d=de[i]._config;else if(a.parentLocale!=null)if(de[a.parentLocale]!=null)d=de[a.parentLocale]._config;else if(c=Ci(a.parentLocale),c!=null)d=c._config;else return Rr[a.parentLocale]||(Rr[a.parentLocale]=[]),Rr[a.parentLocale].push({name:i,config:a}),null;return de[i]=new j(Y(d,a)),Rr[i]&&Rr[i].forEach(function(y){Mo(y.name,y.config)}),nn(i),de[i]}else return delete de[i],null}function bg(i,a){if(a!=null){var c,d,y=mu;de[i]!=null&&de[i].parentLocale!=null?de[i].set(Y(de[i]._config,a)):(d=Ci(i),d!=null&&(y=d._config),a=Y(y,a),d==null&&(a.abbr=i),c=new j(a),c.parentLocale=de[i],de[i]=c),nn(i)}else de[i]!=null&&(de[i].parentLocale!=null?(de[i]=de[i].parentLocale,i===nn()&&nn(i)):de[i]!=null&&delete de[i]);return de[i]}function $t(i){var a;if(i&&i._locale&&i._locale._abbr&&(i=i._locale._abbr),!i)return Or;if(!r(i)){if(a=Ci(i),a)return a;i=[i]}return wg(i)}function kg(){return z(de)}function No(i){var a,c=i._a;return c&&E(i).overflow===-2&&(a=c[Lt]<0||c[Lt]>11?Lt:c[Ct]<1||c[Ct]>Ro(c[De],c[Lt])?Ct:c[ve]<0||c[ve]>24||c[ve]===24&&(c[bt]!==0||c[Mt]!==0||c[En]!==0)?ve:c[bt]<0||c[bt]>59?bt:c[Mt]<0||c[Mt]>59?Mt:c[En]<0||c[En]>999?En:-1,E(i)._overflowDayOfYear&&(a<De||a>Ct)&&(a=Ct),E(i)._overflowWeeks&&a===-1&&(a=vp),E(i)._overflowWeekday&&a===-1&&(a=Ap),E(i).overflow=a),i}var xg=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Eg=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Cg=/Z|[+-]\d\d(?::?\d\d)?/,vi=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],$o=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],vg=/^\/?Date\((-?\d+)/i,Ag=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,Sg={UT:0,GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function gu(i){var a,c,d=i._i,y=xg.exec(d)||Eg.exec(d),k,v,D,U,ee=vi.length,We=$o.length;if(y){for(E(i).iso=!0,a=0,c=ee;a<c;a++)if(vi[a][1].exec(y[1])){v=vi[a][0],k=vi[a][2]!==!1;break}if(v==null){i._isValid=!1;return}if(y[3]){for(a=0,c=We;a<c;a++)if($o[a][1].exec(y[3])){D=(y[2]||" ")+$o[a][0];break}if(D==null){i._isValid=!1;return}}if(!k&&D!=null){i._isValid=!1;return}if(y[4])if(Cg.exec(y[4]))U="Z";else{i._isValid=!1;return}i._f=v+(D||"")+(U||""),Bo(i)}else i._isValid=!1}function Tg(i,a,c,d,y,k){var v=[_g(i),su.indexOf(a),parseInt(c,10),parseInt(d,10),parseInt(y,10)];return k&&v.push(parseInt(k,10)),v}function _g(i){var a=parseInt(i,10);return a<=49?2e3+a:a<=999?1900+a:a}function Fg(i){return i.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function Ig(i,a,c){if(i){var d=fu.indexOf(i),y=new Date(a[0],a[1],a[2]).getDay();if(d!==y)return E(c).weekdayMismatch=!0,c._isValid=!1,!1}return!0}function Pg(i,a,c){if(i)return Sg[i];if(a)return 0;var d=parseInt(c,10),y=d%100,k=(d-y)/100;return k*60+y}function wu(i){var a=Ag.exec(Fg(i._i)),c;if(a){if(c=Tg(a[4],a[3],a[2],a[5],a[6],a[7]),!Ig(a[1],c,i))return;i._a=c,i._tzm=Pg(a[8],a[9],a[10]),i._d=Ir.apply(null,i._a),i._d.setUTCMinutes(i._d.getUTCMinutes()-i._tzm),E(i).rfc2822=!0}else i._isValid=!1}function Rg(i){var a=vg.exec(i._i);if(a!==null){i._d=new Date(+a[1]);return}if(gu(i),i._isValid===!1)delete i._isValid;else return;if(wu(i),i._isValid===!1)delete i._isValid;else return;i._strict?i._isValid=!1:e.createFromInputFallback(i)}e.createFromInputFallback=K("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",function(i){i._d=new Date(i._i+(i._useUTC?" UTC":""))});function Wn(i,a,c){return i??a??c}function Og(i){var a=new Date(e.now());return i._useUTC?[a.getUTCFullYear(),a.getUTCMonth(),a.getUTCDate()]:[a.getFullYear(),a.getMonth(),a.getDate()]}function Yo(i){var a,c,d=[],y,k,v;if(!i._d){for(y=Og(i),i._w&&i._a[Ct]==null&&i._a[Lt]==null&&Dg(i),i._dayOfYear!=null&&(v=Wn(i._a[De],y[De]),(i._dayOfYear>_r(v)||i._dayOfYear===0)&&(E(i)._overflowDayOfYear=!0),c=Ir(v,0,i._dayOfYear),i._a[Lt]=c.getUTCMonth(),i._a[Ct]=c.getUTCDate()),a=0;a<3&&i._a[a]==null;++a)i._a[a]=d[a]=y[a];for(;a<7;a++)i._a[a]=d[a]=i._a[a]==null?a===2?1:0:i._a[a];i._a[ve]===24&&i._a[bt]===0&&i._a[Mt]===0&&i._a[En]===0&&(i._nextDay=!0,i._a[ve]=0),i._d=(i._useUTC?Ir:Bp).apply(null,d),k=i._useUTC?i._d.getUTCDay():i._d.getDay(),i._tzm!=null&&i._d.setUTCMinutes(i._d.getUTCMinutes()-i._tzm),i._nextDay&&(i._a[ve]=24),i._w&&typeof i._w.d<"u"&&i._w.d!==k&&(E(i).weekdayMismatch=!0)}}function Dg(i){var a,c,d,y,k,v,D,U,ee;a=i._w,a.GG!=null||a.W!=null||a.E!=null?(k=1,v=4,c=Wn(a.GG,i._a[De],Pr(ce(),1,4).year),d=Wn(a.W,1),y=Wn(a.E,1),(y<1||y>7)&&(U=!0)):(k=i._locale._week.dow,v=i._locale._week.doy,ee=Pr(ce(),k,v),c=Wn(a.gg,i._a[De],ee.year),d=Wn(a.w,ee.week),a.d!=null?(y=a.d,(y<0||y>6)&&(U=!0)):a.e!=null?(y=a.e+k,(a.e<0||a.e>6)&&(U=!0)):y=k),d<1||d>Nt(c,k,v)?E(i)._overflowWeeks=!0:U!=null?E(i)._overflowWeekday=!0:(D=cu(c,d,y,k,v),i._a[De]=D.year,i._dayOfYear=D.dayOfYear)}e.ISO_8601=function(){},e.RFC_2822=function(){};function Bo(i){if(i._f===e.ISO_8601){gu(i);return}if(i._f===e.RFC_2822){wu(i);return}i._a=[],E(i).empty=!0;var a=""+i._i,c,d,y,k,v,D=a.length,U=0,ee,We;for(y=kn(i._f,i._locale).match(Ge)||[],We=y.length,c=0;c<We;c++)k=y[c],d=(a.match(xp(k,i))||[])[0],d&&(v=a.substr(0,a.indexOf(d)),v.length>0&&E(i).unusedInput.push(v),a=a.slice(a.indexOf(d)+d.length),U+=d.length),Re[k]?(d?E(i).empty=!1:E(i).unusedTokens.push(k),Cp(k,d,i)):i._strict&&!d&&E(i).unusedTokens.push(k);E(i).charsLeftOver=D-U,a.length>0&&E(i).unusedInput.push(a),i._a[ve]<=12&&E(i).bigHour===!0&&i._a[ve]>0&&(E(i).bigHour=void 0),E(i).parsedDateParts=i._a.slice(0),E(i).meridiem=i._meridiem,i._a[ve]=Lg(i._locale,i._a[ve],i._meridiem),ee=E(i).era,ee!==null&&(i._a[De]=i._locale.erasConvertYear(ee,i._a[De])),Yo(i),No(i)}function Lg(i,a,c){var d;return c==null?a:i.meridiemHour!=null?i.meridiemHour(a,c):(i.isPM!=null&&(d=i.isPM(c),d&&a<12&&(a+=12),!d&&a===12&&(a=0)),a)}function Mg(i){var a,c,d,y,k,v,D=!1,U=i._f.length;if(U===0){E(i).invalidFormat=!0,i._d=new Date(NaN);return}for(y=0;y<U;y++)k=0,v=!1,a=W({},i),i._useUTC!=null&&(a._useUTC=i._useUTC),a._f=i._f[y],Bo(a),T(a)&&(v=!0),k+=E(a).charsLeftOver,k+=E(a).unusedTokens.length*10,E(a).score=k,D?k<d&&(d=k,c=a):(d==null||k<d||v)&&(d=k,c=a,v&&(D=!0));p(i,c||a)}function Ng(i){if(!i._d){var a=Yn(i._i),c=a.day===void 0?a.date:a.day;i._a=m([a.year,a.month,c,a.hour,a.minute,a.second,a.millisecond],function(d){return d&&parseInt(d,10)}),Yo(i)}}function $g(i){var a=new H(No(yu(i)));return a._nextDay&&(a.add(1,"d"),a._nextDay=void 0),a}function yu(i){var a=i._i,c=i._f;return i._locale=i._locale||$t(i._l),a===null||c===void 0&&a===""?C({nullInput:!0}):(typeof a=="string"&&(i._i=a=i._locale.preparse(a)),A(a)?new H(No(a)):(h(a)?i._d=a:r(c)?Mg(i):c?Bo(i):Yg(i),T(i)||(i._d=null),i))}function Yg(i){var a=i._i;u(a)?i._d=new Date(e.now()):h(a)?i._d=new Date(a.valueOf()):typeof a=="string"?Rg(i):r(a)?(i._a=m(a.slice(0),function(c){return parseInt(c,10)}),Yo(i)):s(a)?Ng(i):f(a)?i._d=new Date(a):e.createFromInputFallback(i)}function bu(i,a,c,d,y){var k={};return(a===!0||a===!1)&&(d=a,a=void 0),(c===!0||c===!1)&&(d=c,c=void 0),(s(i)&&l(i)||r(i)&&i.length===0)&&(i=void 0),k._isAMomentObject=!0,k._useUTC=k._isUTC=y,k._l=c,k._i=i,k._f=a,k._strict=d,$g(k)}function ce(i,a,c,d){return bu(i,a,c,d,!1)}var Bg=K("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var i=ce.apply(null,arguments);return this.isValid()&&i.isValid()?i<this?this:i:C()}),Vg=K("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var i=ce.apply(null,arguments);return this.isValid()&&i.isValid()?i>this?this:i:C()});function ku(i,a){var c,d;if(a.length===1&&r(a[0])&&(a=a[0]),!a.length)return ce();for(c=a[0],d=1;d<a.length;++d)(!a[d].isValid()||a[d][i](c))&&(c=a[d]);return c}function Wg(){var i=[].slice.call(arguments,0);return ku("isBefore",i)}function zg(){var i=[].slice.call(arguments,0);return ku("isAfter",i)}var Ug=function(){return Date.now?Date.now():+new Date},Dr=["year","quarter","month","week","day","hour","minute","second","millisecond"];function Hg(i){var a,c=!1,d,y=Dr.length;for(a in i)if(o(i,a)&&!(ge.call(Dr,a)!==-1&&(i[a]==null||!isNaN(i[a]))))return!1;for(d=0;d<y;++d)if(i[Dr[d]]){if(c)return!1;parseFloat(i[Dr[d]])!==Q(i[Dr[d]])&&(c=!0)}return!0}function jg(){return this._isValid}function qg(){return kt(NaN)}function Ai(i){var a=Yn(i),c=a.year||0,d=a.quarter||0,y=a.month||0,k=a.week||a.isoWeek||0,v=a.day||0,D=a.hour||0,U=a.minute||0,ee=a.second||0,We=a.millisecond||0;this._isValid=Hg(a),this._milliseconds=+We+ee*1e3+U*6e4+D*1e3*60*60,this._days=+v+k*7,this._months=+y+d*3+c*12,this._data={},this._locale=$t(),this._bubble()}function Si(i){return i instanceof Ai}function Vo(i){return i<0?Math.round(-1*i)*-1:Math.round(i)}function Gg(i,a,c){var d=Math.min(i.length,a.length),y=Math.abs(i.length-a.length),k=0,v;for(v=0;v<d;v++)(c&&i[v]!==a[v]||!c&&Q(i[v])!==Q(a[v]))&&k++;return k+y}function xu(i,a){b(i,0,0,function(){var c=this.utcOffset(),d="+";return c<0&&(c=-c,d="-"),d+me(~~(c/60),2)+a+me(~~c%60,2)})}xu("Z",":"),xu("ZZ",""),N("Z",wt),N("ZZ",wt),le(["Z","ZZ"],function(i,a,c){c._useUTC=!0,c._tzm=Wo(wt,i)});var Xg=/([\+\-]|\d\d)/gi;function Wo(i,a){var c=(a||"").match(i),d,y,k;return c===null?null:(d=c[c.length-1]||[],y=(d+"").match(Xg)||["-",0,0],k=+(y[1]*60)+Q(y[2]),k===0?0:y[0]==="+"?k:-k)}function zo(i,a){var c,d;return a._isUTC?(c=a.clone(),d=(A(i)||h(i)?i.valueOf():ce(i).valueOf())-c.valueOf(),c._d.setTime(c._d.valueOf()+d),e.updateOffset(c,!1),c):ce(i).local()}function Uo(i){return-Math.round(i._d.getTimezoneOffset())}e.updateOffset=function(){};function Kg(i,a,c){var d=this._offset||0,y;if(!this.isValid())return i!=null?this:NaN;if(i!=null){if(typeof i=="string"){if(i=Wo(wt,i),i===null)return this}else Math.abs(i)<16&&!c&&(i=i*60);return!this._isUTC&&a&&(y=Uo(this)),this._offset=i,this._isUTC=!0,y!=null&&this.add(y,"m"),d!==i&&(!a||this._changeInProgress?Au(this,kt(i-d,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,e.updateOffset(this,!0),this._changeInProgress=null)),this}else return this._isUTC?d:Uo(this)}function Jg(i,a){return i!=null?(typeof i!="string"&&(i=-i),this.utcOffset(i,a),this):-this.utcOffset()}function Zg(i){return this.utcOffset(0,i)}function Qg(i){return this._isUTC&&(this.utcOffset(0,i),this._isUTC=!1,i&&this.subtract(Uo(this),"m")),this}function e0(){if(this._tzm!=null)this.utcOffset(this._tzm,!1,!0);else if(typeof this._i=="string"){var i=Wo(Ve,this._i);i!=null?this.utcOffset(i):this.utcOffset(0,!0)}return this}function t0(i){return this.isValid()?(i=i?ce(i).utcOffset():0,(this.utcOffset()-i)%60===0):!1}function n0(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function r0(){if(!u(this._isDSTShifted))return this._isDSTShifted;var i={},a;return W(i,this),i=yu(i),i._a?(a=i._isUTC?g(i._a):ce(i._a),this._isDSTShifted=this.isValid()&&Gg(i._a,a.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function i0(){return this.isValid()?!this._isUTC:!1}function s0(){return this.isValid()?this._isUTC:!1}function Eu(){return this.isValid()?this._isUTC&&this._offset===0:!1}var o0=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,a0=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function kt(i,a){var c=i,d=null,y,k,v;return Si(i)?c={ms:i._milliseconds,d:i._days,M:i._months}:f(i)||!isNaN(+i)?(c={},a?c[a]=+i:c.milliseconds=+i):(d=o0.exec(i))?(y=d[1]==="-"?-1:1,c={y:0,d:Q(d[Ct])*y,h:Q(d[ve])*y,m:Q(d[bt])*y,s:Q(d[Mt])*y,ms:Q(Vo(d[En]*1e3))*y}):(d=a0.exec(i))?(y=d[1]==="-"?-1:1,c={y:Cn(d[2],y),M:Cn(d[3],y),w:Cn(d[4],y),d:Cn(d[5],y),h:Cn(d[6],y),m:Cn(d[7],y),s:Cn(d[8],y)}):c==null?c={}:typeof c=="object"&&("from"in c||"to"in c)&&(v=l0(ce(c.from),ce(c.to)),c={},c.ms=v.milliseconds,c.M=v.months),k=new Ai(c),Si(i)&&o(i,"_locale")&&(k._locale=i._locale),Si(i)&&o(i,"_isValid")&&(k._isValid=i._isValid),k}kt.fn=Ai.prototype,kt.invalid=qg;function Cn(i,a){var c=i&&parseFloat(i.replace(",","."));return(isNaN(c)?0:c)*a}function Cu(i,a){var c={};return c.months=a.month()-i.month()+(a.year()-i.year())*12,i.clone().add(c.months,"M").isAfter(a)&&--c.months,c.milliseconds=+a-+i.clone().add(c.months,"M"),c}function l0(i,a){var c;return i.isValid()&&a.isValid()?(a=zo(a,i),i.isBefore(a)?c=Cu(i,a):(c=Cu(a,i),c.milliseconds=-c.milliseconds,c.months=-c.months),c):{milliseconds:0,months:0}}function vu(i,a){return function(c,d){var y,k;return d!==null&&!isNaN(+d)&&(oe(a,"moment()."+a+"(period, number) is deprecated. Please use moment()."+a+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),k=c,c=d,d=k),y=kt(c,d),Au(this,y,i),this}}function Au(i,a,c,d){var y=a._milliseconds,k=Vo(a._days),v=Vo(a._months);i.isValid()&&(d=d??!0,v&&au(i,Fr(i,"Month")+v*c),k&&iu(i,"Date",Fr(i,"Date")+k*c),y&&i._d.setTime(i._d.valueOf()+y*c),d&&e.updateOffset(i,k||v))}var u0=vu(1,"add"),c0=vu(-1,"subtract");function Su(i){return typeof i=="string"||i instanceof String}function f0(i){return A(i)||h(i)||Su(i)||f(i)||h0(i)||d0(i)||i===null||i===void 0}function d0(i){var a=s(i)&&!l(i),c=!1,d=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],y,k,v=d.length;for(y=0;y<v;y+=1)k=d[y],c=c||o(i,k);return a&&c}function h0(i){var a=r(i),c=!1;return a&&(c=i.filter(function(d){return!f(d)&&Su(i)}).length===0),a&&c}function m0(i){var a=s(i)&&!l(i),c=!1,d=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"],y,k;for(y=0;y<d.length;y+=1)k=d[y],c=c||o(i,k);return a&&c}function p0(i,a){var c=i.diff(a,"days",!0);return c<-6?"sameElse":c<-1?"lastWeek":c<0?"lastDay":c<1?"sameDay":c<2?"nextDay":c<7?"nextWeek":"sameElse"}function g0(i,a){arguments.length===1&&(arguments[0]?f0(arguments[0])?(i=arguments[0],a=void 0):m0(arguments[0])&&(a=arguments[0],i=void 0):(i=void 0,a=void 0));var c=i||ce(),d=zo(c,this).startOf("day"),y=e.calendarFormat(this,d)||"sameElse",k=a&&(ue(a[y])?a[y].call(this,c):a[y]);return this.format(k||this.localeData().calendar(y,this,ce(c)))}function w0(){return new H(this)}function y0(i,a){var c=A(i)?i:ce(i);return this.isValid()&&c.isValid()?(a=Ye(a)||"millisecond",a==="millisecond"?this.valueOf()>c.valueOf():c.valueOf()<this.clone().startOf(a).valueOf()):!1}function b0(i,a){var c=A(i)?i:ce(i);return this.isValid()&&c.isValid()?(a=Ye(a)||"millisecond",a==="millisecond"?this.valueOf()<c.valueOf():this.clone().endOf(a).valueOf()<c.valueOf()):!1}function k0(i,a,c,d){var y=A(i)?i:ce(i),k=A(a)?a:ce(a);return this.isValid()&&y.isValid()&&k.isValid()?(d=d||"()",(d[0]==="("?this.isAfter(y,c):!this.isBefore(y,c))&&(d[1]===")"?this.isBefore(k,c):!this.isAfter(k,c))):!1}function x0(i,a){var c=A(i)?i:ce(i),d;return this.isValid()&&c.isValid()?(a=Ye(a)||"millisecond",a==="millisecond"?this.valueOf()===c.valueOf():(d=c.valueOf(),this.clone().startOf(a).valueOf()<=d&&d<=this.clone().endOf(a).valueOf())):!1}function E0(i,a){return this.isSame(i,a)||this.isAfter(i,a)}function C0(i,a){return this.isSame(i,a)||this.isBefore(i,a)}function v0(i,a,c){var d,y,k;if(!this.isValid())return NaN;if(d=zo(i,this),!d.isValid())return NaN;switch(y=(d.utcOffset()-this.utcOffset())*6e4,a=Ye(a),a){case"year":k=Ti(this,d)/12;break;case"month":k=Ti(this,d);break;case"quarter":k=Ti(this,d)/3;break;case"second":k=(this-d)/1e3;break;case"minute":k=(this-d)/6e4;break;case"hour":k=(this-d)/36e5;break;case"day":k=(this-d-y)/864e5;break;case"week":k=(this-d-y)/6048e5;break;default:k=this-d}return c?k:lt(k)}function Ti(i,a){if(i.date()<a.date())return-Ti(a,i);var c=(a.year()-i.year())*12+(a.month()-i.month()),d=i.clone().add(c,"months"),y,k;return a-d<0?(y=i.clone().add(c-1,"months"),k=(a-d)/(d-y)):(y=i.clone().add(c+1,"months"),k=(a-d)/(y-d)),-(c+k)||0}e.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",e.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";function A0(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function S0(i){if(!this.isValid())return null;var a=i!==!0,c=a?this.clone().utc():this;return c.year()<0||c.year()>9999?en(c,a?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):ue(Date.prototype.toISOString)?a?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",en(c,"Z")):en(c,a?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function T0(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var i="moment",a="",c,d,y,k;return this.isLocal()||(i=this.utcOffset()===0?"moment.utc":"moment.parseZone",a="Z"),c="["+i+'("]',d=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",y="-MM-DD[T]HH:mm:ss.SSS",k=a+'[")]',this.format(c+d+y+k)}function _0(i){i||(i=this.isUtc()?e.defaultFormatUtc:e.defaultFormat);var a=en(this,i);return this.localeData().postformat(a)}function F0(i,a){return this.isValid()&&(A(i)&&i.isValid()||ce(i).isValid())?kt({to:this,from:i}).locale(this.locale()).humanize(!a):this.localeData().invalidDate()}function I0(i){return this.from(ce(),i)}function P0(i,a){return this.isValid()&&(A(i)&&i.isValid()||ce(i).isValid())?kt({from:this,to:i}).locale(this.locale()).humanize(!a):this.localeData().invalidDate()}function R0(i){return this.to(ce(),i)}function Tu(i){var a;return i===void 0?this._locale._abbr:(a=$t(i),a!=null&&(this._locale=a),this)}var _u=K("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(i){return i===void 0?this.localeData():this.locale(i)});function Fu(){return this._locale}var _i=1e3,zn=60*_i,Fi=60*zn,Iu=(365*400+97)*24*Fi;function Un(i,a){return(i%a+a)%a}function Pu(i,a,c){return i<100&&i>=0?new Date(i+400,a,c)-Iu:new Date(i,a,c).valueOf()}function Ru(i,a,c){return i<100&&i>=0?Date.UTC(i+400,a,c)-Iu:Date.UTC(i,a,c)}function O0(i){var a,c;if(i=Ye(i),i===void 0||i==="millisecond"||!this.isValid())return this;switch(c=this._isUTC?Ru:Pu,i){case"year":a=c(this.year(),0,1);break;case"quarter":a=c(this.year(),this.month()-this.month()%3,1);break;case"month":a=c(this.year(),this.month(),1);break;case"week":a=c(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":a=c(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":a=c(this.year(),this.month(),this.date());break;case"hour":a=this._d.valueOf(),a-=Un(a+(this._isUTC?0:this.utcOffset()*zn),Fi);break;case"minute":a=this._d.valueOf(),a-=Un(a,zn);break;case"second":a=this._d.valueOf(),a-=Un(a,_i);break}return this._d.setTime(a),e.updateOffset(this,!0),this}function D0(i){var a,c;if(i=Ye(i),i===void 0||i==="millisecond"||!this.isValid())return this;switch(c=this._isUTC?Ru:Pu,i){case"year":a=c(this.year()+1,0,1)-1;break;case"quarter":a=c(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":a=c(this.year(),this.month()+1,1)-1;break;case"week":a=c(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":a=c(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":a=c(this.year(),this.month(),this.date()+1)-1;break;case"hour":a=this._d.valueOf(),a+=Fi-Un(a+(this._isUTC?0:this.utcOffset()*zn),Fi)-1;break;case"minute":a=this._d.valueOf(),a+=zn-Un(a,zn)-1;break;case"second":a=this._d.valueOf(),a+=_i-Un(a,_i)-1;break}return this._d.setTime(a),e.updateOffset(this,!0),this}function L0(){return this._d.valueOf()-(this._offset||0)*6e4}function M0(){return Math.floor(this.valueOf()/1e3)}function N0(){return new Date(this.valueOf())}function $0(){var i=this;return[i.year(),i.month(),i.date(),i.hour(),i.minute(),i.second(),i.millisecond()]}function Y0(){var i=this;return{years:i.year(),months:i.month(),date:i.date(),hours:i.hours(),minutes:i.minutes(),seconds:i.seconds(),milliseconds:i.milliseconds()}}function B0(){return this.isValid()?this.toISOString():null}function V0(){return T(this)}function W0(){return p({},E(this))}function z0(){return E(this).overflow}function U0(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}b("N",0,0,"eraAbbr"),b("NN",0,0,"eraAbbr"),b("NNN",0,0,"eraAbbr"),b("NNNN",0,0,"eraName"),b("NNNNN",0,0,"eraNarrow"),b("y",["y",1],"yo","eraYear"),b("y",["yy",2],0,"eraYear"),b("y",["yyy",3],0,"eraYear"),b("y",["yyyy",4],0,"eraYear"),N("N",Ho),N("NN",Ho),N("NNN",Ho),N("NNNN",tw),N("NNNNN",nw),le(["N","NN","NNN","NNNN","NNNNN"],function(i,a,c,d){var y=c._locale.erasParse(i,d,c._strict);y?E(c).era=y:E(c).invalidEra=i}),N("y",at),N("yy",at),N("yyy",at),N("yyyy",at),N("yo",rw),le(["y","yy","yyy","yyyy"],De),le(["yo"],function(i,a,c,d){var y;c._locale._eraYearOrdinalRegex&&(y=i.match(c._locale._eraYearOrdinalRegex)),c._locale.eraYearOrdinalParse?a[De]=c._locale.eraYearOrdinalParse(i,y):a[De]=parseInt(i,10)});function H0(i,a){var c,d,y,k=this._eras||$t("en")._eras;for(c=0,d=k.length;c<d;++c){switch(typeof k[c].since){case"string":y=e(k[c].since).startOf("day"),k[c].since=y.valueOf();break}switch(typeof k[c].until){case"undefined":k[c].until=1/0;break;case"string":y=e(k[c].until).startOf("day").valueOf(),k[c].until=y.valueOf();break}}return k}function j0(i,a,c){var d,y,k=this.eras(),v,D,U;for(i=i.toUpperCase(),d=0,y=k.length;d<y;++d)if(v=k[d].name.toUpperCase(),D=k[d].abbr.toUpperCase(),U=k[d].narrow.toUpperCase(),c)switch(a){case"N":case"NN":case"NNN":if(D===i)return k[d];break;case"NNNN":if(v===i)return k[d];break;case"NNNNN":if(U===i)return k[d];break}else if([v,D,U].indexOf(i)>=0)return k[d]}function q0(i,a){var c=i.since<=i.until?1:-1;return a===void 0?e(i.since).year():e(i.since).year()+(a-i.offset)*c}function G0(){var i,a,c,d=this.localeData().eras();for(i=0,a=d.length;i<a;++i)if(c=this.clone().startOf("day").valueOf(),d[i].since<=c&&c<=d[i].until||d[i].until<=c&&c<=d[i].since)return d[i].name;return""}function X0(){var i,a,c,d=this.localeData().eras();for(i=0,a=d.length;i<a;++i)if(c=this.clone().startOf("day").valueOf(),d[i].since<=c&&c<=d[i].until||d[i].until<=c&&c<=d[i].since)return d[i].narrow;return""}function K0(){var i,a,c,d=this.localeData().eras();for(i=0,a=d.length;i<a;++i)if(c=this.clone().startOf("day").valueOf(),d[i].since<=c&&c<=d[i].until||d[i].until<=c&&c<=d[i].since)return d[i].abbr;return""}function J0(){var i,a,c,d,y=this.localeData().eras();for(i=0,a=y.length;i<a;++i)if(c=y[i].since<=y[i].until?1:-1,d=this.clone().startOf("day").valueOf(),y[i].since<=d&&d<=y[i].until||y[i].until<=d&&d<=y[i].since)return(this.year()-e(y[i].since).year())*c+y[i].offset;return this.year()}function Z0(i){return o(this,"_erasNameRegex")||jo.call(this),i?this._erasNameRegex:this._erasRegex}function Q0(i){return o(this,"_erasAbbrRegex")||jo.call(this),i?this._erasAbbrRegex:this._erasRegex}function ew(i){return o(this,"_erasNarrowRegex")||jo.call(this),i?this._erasNarrowRegex:this._erasRegex}function Ho(i,a){return a.erasAbbrRegex(i)}function tw(i,a){return a.erasNameRegex(i)}function nw(i,a){return a.erasNarrowRegex(i)}function rw(i,a){return a._eraYearOrdinalRegex||at}function jo(){var i=[],a=[],c=[],d=[],y,k,v,D,U,ee=this.eras();for(y=0,k=ee.length;y<k;++y)v=Dt(ee[y].name),D=Dt(ee[y].abbr),U=Dt(ee[y].narrow),a.push(v),i.push(D),c.push(U),d.push(v),d.push(D),d.push(U);this._erasRegex=new RegExp("^("+d.join("|")+")","i"),this._erasNameRegex=new RegExp("^("+a.join("|")+")","i"),this._erasAbbrRegex=new RegExp("^("+i.join("|")+")","i"),this._erasNarrowRegex=new RegExp("^("+c.join("|")+")","i")}b(0,["gg",2],0,function(){return this.weekYear()%100}),b(0,["GG",2],0,function(){return this.isoWeekYear()%100});function Ii(i,a){b(0,[i,i.length],0,a)}Ii("gggg","weekYear"),Ii("ggggg","weekYear"),Ii("GGGG","isoWeekYear"),Ii("GGGGG","isoWeekYear"),N("G",Et),N("g",Et),N("GG",O,Be),N("gg",O,Be),N("GGGG",gt,S),N("gggg",gt,S),N("GGGGG",Xe,R),N("ggggg",Xe,R),Tr(["gggg","ggggg","GGGG","GGGGG"],function(i,a,c,d){a[d.substr(0,2)]=Q(i)}),Tr(["gg","GG"],function(i,a,c,d){a[d]=e.parseTwoDigitYear(i)});function iw(i){return Ou.call(this,i,this.week(),this.weekday()+this.localeData()._week.dow,this.localeData()._week.dow,this.localeData()._week.doy)}function sw(i){return Ou.call(this,i,this.isoWeek(),this.isoWeekday(),1,4)}function ow(){return Nt(this.year(),1,4)}function aw(){return Nt(this.isoWeekYear(),1,4)}function lw(){var i=this.localeData()._week;return Nt(this.year(),i.dow,i.doy)}function uw(){var i=this.localeData()._week;return Nt(this.weekYear(),i.dow,i.doy)}function Ou(i,a,c,d,y){var k;return i==null?Pr(this,d,y).year:(k=Nt(i,d,y),a>k&&(a=k),cw.call(this,i,a,c,d,y))}function cw(i,a,c,d,y){var k=cu(i,a,c,d,y),v=Ir(k.year,0,k.dayOfYear);return this.year(v.getUTCFullYear()),this.month(v.getUTCMonth()),this.date(v.getUTCDate()),this}b("Q",0,"Qo","quarter"),N("Q",yi),le("Q",function(i,a){a[Lt]=(Q(i)-1)*3});function fw(i){return i==null?Math.ceil((this.month()+1)/3):this.month((i-1)*3+this.month()%3)}b("D",["DD",2],"Do","date"),N("D",O,Bn),N("DD",O,Be),N("Do",function(i,a){return i?a._dayOfMonthOrdinalParse||a._ordinalParse:a._dayOfMonthOrdinalParseLenient}),le(["D","DD"],Ct),le("Do",function(i,a){a[Ct]=Q(i.match(O)[0])});var Du=Vn("Date",!0);b("DDD",["DDDD",3],"DDDo","dayOfYear"),N("DDD",Oe),N("DDDD",bi),le(["DDD","DDDD"],function(i,a,c){c._dayOfYear=Q(i)});function dw(i){var a=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return i==null?a:this.add(i-a,"d")}b("m",["mm",2],0,"minute"),N("m",O,Io),N("mm",O,Be),le(["m","mm"],bt);var hw=Vn("Minutes",!1);b("s",["ss",2],0,"second"),N("s",O,Io),N("ss",O,Be),le(["s","ss"],Mt);var mw=Vn("Seconds",!1);b("S",0,0,function(){return~~(this.millisecond()/100)}),b(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),b(0,["SSS",3],0,"millisecond"),b(0,["SSSS",4],0,function(){return this.millisecond()*10}),b(0,["SSSSS",5],0,function(){return this.millisecond()*100}),b(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3}),b(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4}),b(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5}),b(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6}),N("S",Oe,yi),N("SS",Oe,Be),N("SSS",Oe,bi);var rn,Lu;for(rn="SSSS";rn.length<=9;rn+="S")N(rn,at);function pw(i,a){a[En]=Q(("0."+i)*1e3)}for(rn="S";rn.length<=9;rn+="S")le(rn,pw);Lu=Vn("Milliseconds",!1),b("z",0,0,"zoneAbbr"),b("zz",0,0,"zoneName");function gw(){return this._isUTC?"UTC":""}function ww(){return this._isUTC?"Coordinated Universal Time":""}var P=H.prototype;P.add=u0,P.calendar=g0,P.clone=w0,P.diff=v0,P.endOf=D0,P.format=_0,P.from=F0,P.fromNow=I0,P.to=P0,P.toNow=R0,P.get=Tp,P.invalidAt=z0,P.isAfter=y0,P.isBefore=b0,P.isBetween=k0,P.isSame=x0,P.isSameOrAfter=E0,P.isSameOrBefore=C0,P.isValid=V0,P.lang=_u,P.locale=Tu,P.localeData=Fu,P.max=Vg,P.min=Bg,P.parsingFlags=W0,P.set=_p,P.startOf=O0,P.subtract=c0,P.toArray=$0,P.toObject=Y0,P.toDate=N0,P.toISOString=S0,P.inspect=T0,typeof Symbol<"u"&&Symbol.for!=null&&(P[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),P.toJSON=B0,P.toString=A0,P.unix=M0,P.valueOf=L0,P.creationData=U0,P.eraName=G0,P.eraNarrow=X0,P.eraAbbr=K0,P.eraYear=J0,P.year=ru,P.isLeapYear=Sp,P.weekYear=iw,P.isoWeekYear=sw,P.quarter=P.quarters=fw,P.month=lu,P.daysInMonth=Np,P.week=P.weeks=Hp,P.isoWeek=P.isoWeeks=jp,P.weeksInYear=lw,P.weeksInWeekYear=uw,P.isoWeeksInYear=ow,P.isoWeeksInISOWeekYear=aw,P.date=Du,P.day=P.days=sg,P.weekday=og,P.isoWeekday=ag,P.dayOfYear=dw,P.hour=P.hours=mg,P.minute=P.minutes=hw,P.second=P.seconds=mw,P.millisecond=P.milliseconds=Lu,P.utcOffset=Kg,P.utc=Zg,P.local=Qg,P.parseZone=e0,P.hasAlignedHourOffset=t0,P.isDST=n0,P.isLocal=i0,P.isUtcOffset=s0,P.isUtc=Eu,P.isUTC=Eu,P.zoneAbbr=gw,P.zoneName=ww,P.dates=K("dates accessor is deprecated. Use date instead.",Du),P.months=K("months accessor is deprecated. Use month instead",lu),P.years=K("years accessor is deprecated. Use year instead",ru),P.zone=K("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",Jg),P.isDSTShifted=K("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",r0);function yw(i){return ce(i*1e3)}function bw(){return ce.apply(null,arguments).parseZone()}function Mu(i){return i}var se=j.prototype;se.calendar=he,se.longDateFormat=xn,se.invalidDate=Ot,se.ordinal=To,se.preparse=Mu,se.postformat=Mu,se.relativeTime=pi,se.pastFuture=gi,se.set=re,se.eras=H0,se.erasParse=j0,se.erasConvertYear=q0,se.erasAbbrRegex=Q0,se.erasNameRegex=Z0,se.erasNarrowRegex=ew,se.months=Op,se.monthsShort=Dp,se.monthsParse=Mp,se.monthsRegex=Yp,se.monthsShortRegex=$p,se.week=Vp,se.firstDayOfYear=Up,se.firstDayOfWeek=zp,se.weekdays=eg,se.weekdaysMin=ng,se.weekdaysShort=tg,se.weekdaysParse=ig,se.weekdaysRegex=lg,se.weekdaysShortRegex=ug,se.weekdaysMinRegex=cg,se.isPM=dg,se.meridiem=pg;function Pi(i,a,c,d){var y=$t(),k=g().set(d,a);return y[c](k,i)}function Nu(i,a,c){if(f(i)&&(a=i,i=void 0),i=i||"",a!=null)return Pi(i,a,c,"month");var d,y=[];for(d=0;d<12;d++)y[d]=Pi(i,d,c,"month");return y}function qo(i,a,c,d){typeof i=="boolean"?(f(a)&&(c=a,a=void 0),a=a||""):(a=i,c=a,i=!1,f(a)&&(c=a,a=void 0),a=a||"");var y=$t(),k=i?y._week.dow:0,v,D=[];if(c!=null)return Pi(a,(c+k)%7,d,"day");for(v=0;v<7;v++)D[v]=Pi(a,(v+k)%7,d,"day");return D}function kw(i,a){return Nu(i,a,"months")}function xw(i,a){return Nu(i,a,"monthsShort")}function Ew(i,a,c){return qo(i,a,c,"weekdays")}function Cw(i,a,c){return qo(i,a,c,"weekdaysShort")}function vw(i,a,c){return qo(i,a,c,"weekdaysMin")}nn("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(i){var a=i%10,c=Q(i%100/10)===1?"th":a===1?"st":a===2?"nd":a===3?"rd":"th";return i+c}}),e.lang=K("moment.lang is deprecated. Use moment.locale instead.",nn),e.langData=K("moment.langData is deprecated. Use moment.localeData instead.",$t);var Yt=Math.abs;function Aw(){var i=this._data;return this._milliseconds=Yt(this._milliseconds),this._days=Yt(this._days),this._months=Yt(this._months),i.milliseconds=Yt(i.milliseconds),i.seconds=Yt(i.seconds),i.minutes=Yt(i.minutes),i.hours=Yt(i.hours),i.months=Yt(i.months),i.years=Yt(i.years),this}function $u(i,a,c,d){var y=kt(a,c);return i._milliseconds+=d*y._milliseconds,i._days+=d*y._days,i._months+=d*y._months,i._bubble()}function Sw(i,a){return $u(this,i,a,1)}function Tw(i,a){return $u(this,i,a,-1)}function Yu(i){return i<0?Math.floor(i):Math.ceil(i)}function _w(){var i=this._milliseconds,a=this._days,c=this._months,d=this._data,y,k,v,D,U;return i>=0&&a>=0&&c>=0||i<=0&&a<=0&&c<=0||(i+=Yu(Go(c)+a)*864e5,a=0,c=0),d.milliseconds=i%1e3,y=lt(i/1e3),d.seconds=y%60,k=lt(y/60),d.minutes=k%60,v=lt(k/60),d.hours=v%24,a+=lt(v/24),U=lt(Bu(a)),c+=U,a-=Yu(Go(U)),D=lt(c/12),c%=12,d.days=a,d.months=c,d.years=D,this}function Bu(i){return i*4800/146097}function Go(i){return i*146097/4800}function Fw(i){if(!this.isValid())return NaN;var a,c,d=this._milliseconds;if(i=Ye(i),i==="month"||i==="quarter"||i==="year")switch(a=this._days+d/864e5,c=this._months+Bu(a),i){case"month":return c;case"quarter":return c/3;case"year":return c/12}else switch(a=this._days+Math.round(Go(this._months)),i){case"week":return a/7+d/6048e5;case"day":return a+d/864e5;case"hour":return a*24+d/36e5;case"minute":return a*1440+d/6e4;case"second":return a*86400+d/1e3;case"millisecond":return Math.floor(a*864e5)+d;default:throw new Error("Unknown unit "+i)}}function Bt(i){return function(){return this.as(i)}}var Vu=Bt("ms"),Iw=Bt("s"),Pw=Bt("m"),Rw=Bt("h"),Ow=Bt("d"),Dw=Bt("w"),Lw=Bt("M"),Mw=Bt("Q"),Nw=Bt("y"),$w=Vu;function Yw(){return kt(this)}function Bw(i){return i=Ye(i),this.isValid()?this[i+"s"]():NaN}function vn(i){return function(){return this.isValid()?this._data[i]:NaN}}var Vw=vn("milliseconds"),Ww=vn("seconds"),zw=vn("minutes"),Uw=vn("hours"),Hw=vn("days"),jw=vn("months"),qw=vn("years");function Gw(){return lt(this.days()/7)}var Vt=Math.round,Hn={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function Xw(i,a,c,d,y){return y.relativeTime(a||1,!!c,i,d)}function Kw(i,a,c,d){var y=kt(i).abs(),k=Vt(y.as("s")),v=Vt(y.as("m")),D=Vt(y.as("h")),U=Vt(y.as("d")),ee=Vt(y.as("M")),We=Vt(y.as("w")),Wt=Vt(y.as("y")),sn=k<=c.ss&&["s",k]||k<c.s&&["ss",k]||v<=1&&["m"]||v<c.m&&["mm",v]||D<=1&&["h"]||D<c.h&&["hh",D]||U<=1&&["d"]||U<c.d&&["dd",U];return c.w!=null&&(sn=sn||We<=1&&["w"]||We<c.w&&["ww",We]),sn=sn||ee<=1&&["M"]||ee<c.M&&["MM",ee]||Wt<=1&&["y"]||["yy",Wt],sn[2]=a,sn[3]=+i>0,sn[4]=d,Xw.apply(null,sn)}function Jw(i){return i===void 0?Vt:typeof i=="function"?(Vt=i,!0):!1}function Zw(i,a){return Hn[i]===void 0?!1:a===void 0?Hn[i]:(Hn[i]=a,i==="s"&&(Hn.ss=a-1),!0)}function Qw(i,a){if(!this.isValid())return this.localeData().invalidDate();var c=!1,d=Hn,y,k;return typeof i=="object"&&(a=i,i=!1),typeof i=="boolean"&&(c=i),typeof a=="object"&&(d=Object.assign({},Hn,a),a.s!=null&&a.ss==null&&(d.ss=a.s-1)),y=this.localeData(),k=Kw(this,!c,d,y),c&&(k=y.pastFuture(+this,k)),y.postformat(k)}var Xo=Math.abs;function jn(i){return(i>0)-(i<0)||+i}function Ri(){if(!this.isValid())return this.localeData().invalidDate();var i=Xo(this._milliseconds)/1e3,a=Xo(this._days),c=Xo(this._months),d,y,k,v,D=this.asSeconds(),U,ee,We,Wt;return D?(d=lt(i/60),y=lt(d/60),i%=60,d%=60,k=lt(c/12),c%=12,v=i?i.toFixed(3).replace(/\.?0+$/,""):"",U=D<0?"-":"",ee=jn(this._months)!==jn(D)?"-":"",We=jn(this._days)!==jn(D)?"-":"",Wt=jn(this._milliseconds)!==jn(D)?"-":"",U+"P"+(k?ee+k+"Y":"")+(c?ee+c+"M":"")+(a?We+a+"D":"")+(y||d||i?"T":"")+(y?Wt+y+"H":"")+(d?Wt+d+"M":"")+(i?Wt+v+"S":"")):"P0D"}var ne=Ai.prototype;ne.isValid=jg,ne.abs=Aw,ne.add=Sw,ne.subtract=Tw,ne.as=Fw,ne.asMilliseconds=Vu,ne.asSeconds=Iw,ne.asMinutes=Pw,ne.asHours=Rw,ne.asDays=Ow,ne.asWeeks=Dw,ne.asMonths=Lw,ne.asQuarters=Mw,ne.asYears=Nw,ne.valueOf=$w,ne._bubble=_w,ne.clone=Yw,ne.get=Bw,ne.milliseconds=Vw,ne.seconds=Ww,ne.minutes=zw,ne.hours=Uw,ne.days=Hw,ne.weeks=Gw,ne.months=jw,ne.years=qw,ne.humanize=Qw,ne.toISOString=Ri,ne.toString=Ri,ne.toJSON=Ri,ne.locale=Tu,ne.localeData=Fu,ne.toIsoString=K("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Ri),ne.lang=_u,b("X",0,0,"unix"),b("x",0,0,"valueOf"),N("x",Et),N("X",yt),le("X",function(i,a,c){c._d=new Date(parseFloat(i)*1e3)}),le("x",function(i,a,c){c._d=new Date(Q(i))});return e.version="2.30.1",n(ce),e.fn=P,e.min=Wg,e.max=zg,e.now=Ug,e.utc=g,e.unix=yw,e.months=kw,e.isDate=h,e.locale=nn,e.invalid=C,e.duration=kt,e.isMoment=A,e.weekdays=Ew,e.parseZone=bw,e.localeData=$t,e.isDuration=Si,e.monthsShort=xw,e.weekdaysMin=vw,e.defineLocale=Mo,e.updateLocale=bg,e.locales=kg,e.weekdaysShort=Cw,e.normalizeUnits=Ye,e.relativeTimeRounding=Jw,e.relativeTimeThreshold=Zw,e.calendarFormat=p0,e.prototype=P,e.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},e})});var Ku=V((wA,Xu)=>{"use strict";function At(t){if(typeof t!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}function Gu(t,e){for(var n="",r=0,s=-1,o=0,l,u=0;u<=t.length;++u){if(u<t.length)l=t.charCodeAt(u);else{if(l===47)break;l=47}if(l===47){if(!(s===u-1||o===1))if(s!==u-1&&o===2){if(n.length<2||r!==2||n.charCodeAt(n.length-1)!==46||n.charCodeAt(n.length-2)!==46){if(n.length>2){var f=n.lastIndexOf("/");if(f!==n.length-1){f===-1?(n="",r=0):(n=n.slice(0,f),r=n.length-1-n.lastIndexOf("/")),s=u,o=0;continue}}else if(n.length===2||n.length===1){n="",r=0,s=u,o=0;continue}}e&&(n.length>0?n+="/..":n="..",r=2)}else n.length>0?n+="/"+t.slice(s+1,u):n=t.slice(s+1,u),r=u-s-1;s=u,o=0}else l===46&&o!==-1?++o:o=-1}return n}function fy(t,e){var n=e.dir||e.root,r=e.base||(e.name||"")+(e.ext||"");return n?n===e.root?n+r:n+t+r:r}var Gn={resolve:function(){for(var e="",n=!1,r,s=arguments.length-1;s>=-1&&!n;s--){var o;s>=0?o=arguments[s]:(r===void 0&&(r=process.cwd()),o=r),At(o),o.length!==0&&(e=o+"/"+e,n=o.charCodeAt(0)===47)}return e=Gu(e,!n),n?e.length>0?"/"+e:"/":e.length>0?e:"."},normalize:function(e){if(At(e),e.length===0)return".";var n=e.charCodeAt(0)===47,r=e.charCodeAt(e.length-1)===47;return e=Gu(e,!n),e.length===0&&!n&&(e="."),e.length>0&&r&&(e+="/"),n?"/"+e:e},isAbsolute:function(e){return At(e),e.length>0&&e.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var e,n=0;n<arguments.length;++n){var r=arguments[n];At(r),r.length>0&&(e===void 0?e=r:e+="/"+r)}return e===void 0?".":Gn.normalize(e)},relative:function(e,n){if(At(e),At(n),e===n||(e=Gn.resolve(e),n=Gn.resolve(n),e===n))return"";for(var r=1;r<e.length&&e.charCodeAt(r)===47;++r);for(var s=e.length,o=s-r,l=1;l<n.length&&n.charCodeAt(l)===47;++l);for(var u=n.length,f=u-l,h=o<f?o:f,m=-1,p=0;p<=h;++p){if(p===h){if(f>h){if(n.charCodeAt(l+p)===47)return n.slice(l+p+1);if(p===0)return n.slice(l+p)}else o>h&&(e.charCodeAt(r+p)===47?m=p:p===0&&(m=0));break}var g=e.charCodeAt(r+p),w=n.charCodeAt(l+p);if(g!==w)break;g===47&&(m=p)}var E="";for(p=r+m+1;p<=s;++p)(p===s||e.charCodeAt(p)===47)&&(E.length===0?E+="..":E+="/..");return E.length>0?E+n.slice(l+m):(l+=m,n.charCodeAt(l)===47&&++l,n.slice(l))},_makeLong:function(e){return e},dirname:function(e){if(At(e),e.length===0)return".";for(var n=e.charCodeAt(0),r=n===47,s=-1,o=!0,l=e.length-1;l>=1;--l)if(n=e.charCodeAt(l),n===47){if(!o){s=l;break}}else o=!1;return s===-1?r?"/":".":r&&s===1?"//":e.slice(0,s)},basename:function(e,n){if(n!==void 0&&typeof n!="string")throw new TypeError('"ext" argument must be a string');At(e);var r=0,s=-1,o=!0,l;if(n!==void 0&&n.length>0&&n.length<=e.length){if(n.length===e.length&&n===e)return"";var u=n.length-1,f=-1;for(l=e.length-1;l>=0;--l){var h=e.charCodeAt(l);if(h===47){if(!o){r=l+1;break}}else f===-1&&(o=!1,f=l+1),u>=0&&(h===n.charCodeAt(u)?--u===-1&&(s=l):(u=-1,s=f))}return r===s?s=f:s===-1&&(s=e.length),e.slice(r,s)}else{for(l=e.length-1;l>=0;--l)if(e.charCodeAt(l)===47){if(!o){r=l+1;break}}else s===-1&&(o=!1,s=l+1);return s===-1?"":e.slice(r,s)}},extname:function(e){At(e);for(var n=-1,r=0,s=-1,o=!0,l=0,u=e.length-1;u>=0;--u){var f=e.charCodeAt(u);if(f===47){if(!o){r=u+1;break}continue}s===-1&&(o=!1,s=u+1),f===46?n===-1?n=u:l!==1&&(l=1):n!==-1&&(l=-1)}return n===-1||s===-1||l===0||l===1&&n===s-1&&n===r+1?"":e.slice(n,s)},format:function(e){if(e===null||typeof e!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof e);return fy("/",e)},parse:function(e){At(e);var n={root:"",dir:"",base:"",ext:"",name:""};if(e.length===0)return n;var r=e.charCodeAt(0),s=r===47,o;s?(n.root="/",o=1):o=0;for(var l=-1,u=0,f=-1,h=!0,m=e.length-1,p=0;m>=o;--m){if(r=e.charCodeAt(m),r===47){if(!h){u=m+1;break}continue}f===-1&&(h=!1,f=m+1),r===46?l===-1?l=m:p!==1&&(p=1):l!==-1&&(p=-1)}return l===-1||f===-1||p===0||p===1&&l===f-1&&l===u+1?f!==-1&&(u===0&&s?n.base=n.name=e.slice(1,f):n.base=n.name=e.slice(u,f)):(u===0&&s?(n.name=e.slice(1,l),n.base=e.slice(1,f)):(n.name=e.slice(u,l),n.base=e.slice(u,f)),n.ext=e.slice(l,f)),u>0?n.dir=e.slice(0,u-1):s&&(n.dir="/"),n},sep:"/",delimiter:":",win32:null,posix:null};Gn.posix=Gn;Xu.exports=Gn});var bc=V((rS,yc)=>{var er=1e3,tr=er*60,nr=tr*60,_n=nr*24,xy=_n*7,Ey=_n*365.25;yc.exports=function(t,e){e=e||{};var n=typeof t;if(n==="string"&&t.length>0)return Cy(t);if(n==="number"&&isFinite(t))return e.long?Ay(t):vy(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function Cy(t){if(t=String(t),!(t.length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(e){var n=parseFloat(e[1]),r=(e[2]||"ms").toLowerCase();switch(r){case"years":case"year":case"yrs":case"yr":case"y":return n*Ey;case"weeks":case"week":case"w":return n*xy;case"days":case"day":case"d":return n*_n;case"hours":case"hour":case"hrs":case"hr":case"h":return n*nr;case"minutes":case"minute":case"mins":case"min":case"m":return n*tr;case"seconds":case"second":case"secs":case"sec":case"s":return n*er;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}}}function vy(t){var e=Math.abs(t);return e>=_n?Math.round(t/_n)+"d":e>=nr?Math.round(t/nr)+"h":e>=tr?Math.round(t/tr)+"m":e>=er?Math.round(t/er)+"s":t+"ms"}function Ay(t){var e=Math.abs(t);return e>=_n?Bi(t,e,_n,"day"):e>=nr?Bi(t,e,nr,"hour"):e>=tr?Bi(t,e,tr,"minute"):e>=er?Bi(t,e,er,"second"):t+" ms"}function Bi(t,e,n,r){var s=e>=n*1.5;return Math.round(t/n)+" "+r+(s?"s":"")}});var aa=V((iS,kc)=>{function Sy(t){n.debug=n,n.default=n,n.coerce=f,n.disable=l,n.enable=s,n.enabled=u,n.humanize=bc(),n.destroy=h,Object.keys(t).forEach(m=>{n[m]=t[m]}),n.names=[],n.skips=[],n.formatters={};function e(m){let p=0;for(let g=0;g<m.length;g++)p=(p<<5)-p+m.charCodeAt(g),p|=0;return n.colors[Math.abs(p)%n.colors.length]}n.selectColor=e;function n(m){let p,g=null,w,E;function F(...T){if(!F.enabled)return;let C=F,_=Number(new Date),I=_-(p||_);C.diff=I,C.prev=p,C.curr=_,p=_,T[0]=n.coerce(T[0]),typeof T[0]!="string"&&T.unshift("%O");let W=0;T[0]=T[0].replace(/%([a-zA-Z%])/g,(A,te)=>{if(A==="%%")return"%";W++;let K=n.formatters[te];if(typeof K=="function"){let J=T[W];A=K.call(C,J),T.splice(W,1),W--}return A}),n.formatArgs.call(C,T),(C.log||n.log).apply(C,T)}return F.namespace=m,F.useColors=n.useColors(),F.color=n.selectColor(m),F.extend=r,F.destroy=n.destroy,Object.defineProperty(F,"enabled",{enumerable:!0,configurable:!1,get:()=>g!==null?g:(w!==n.namespaces&&(w=n.namespaces,E=n.enabled(m)),E),set:T=>{g=T}}),typeof n.init=="function"&&n.init(F),F}function r(m,p){let g=n(this.namespace+(typeof p>"u"?":":p)+m);return g.log=this.log,g}function s(m){n.save(m),n.namespaces=m,n.names=[],n.skips=[];let p=(typeof m=="string"?m:"").trim().replace(" ",",").split(",").filter(Boolean);for(let g of p)g[0]==="-"?n.skips.push(g.slice(1)):n.names.push(g)}function o(m,p){let g=0,w=0,E=-1,F=0;for(;g<m.length;)if(w<p.length&&(p[w]===m[g]||p[w]==="*"))p[w]==="*"?(E=w,F=g,w++):(g++,w++);else if(E!==-1)w=E+1,F++,g=F;else return!1;for(;w<p.length&&p[w]==="*";)w++;return w===p.length}function l(){let m=[...n.names,...n.skips.map(p=>"-"+p)].join(",");return n.enable(""),m}function u(m){for(let p of n.skips)if(o(m,p))return!1;for(let p of n.names)if(o(m,p))return!0;return!1}function f(m){return m instanceof Error?m.stack||m.message:m}function h(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return n.enable(n.load()),n}kc.exports=Sy});var xc=V((rt,Vi)=>{rt.formatArgs=_y;rt.save=Fy;rt.load=Iy;rt.useColors=Ty;rt.storage=Py();rt.destroy=(()=>{let t=!1;return()=>{t||(t=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();rt.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function Ty(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let t;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(t=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(t[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function _y(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+Vi.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;t.splice(1,0,e,"color: inherit");let n=0,r=0;t[0].replace(/%[a-zA-Z%]/g,s=>{s!=="%%"&&(n++,s==="%c"&&(r=n))}),t.splice(r,0,e)}rt.log=console.debug||console.log||(()=>{});function Fy(t){try{t?rt.storage.setItem("debug",t):rt.storage.removeItem("debug")}catch{}}function Iy(){let t;try{t=rt.storage.getItem("debug")}catch{}return!t&&typeof process<"u"&&"env"in process&&(t=process.env.DEBUG),t}function Py(){try{return localStorage}catch{}}Vi.exports=aa()(rt);var{formatters:Ry}=Vi.exports;Ry.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var Cc=V((sS,Ec)=>{"use strict";Ec.exports=(t,e=process.argv)=>{let n=t.startsWith("-")?"":t.length===1?"-":"--",r=e.indexOf(n+t),s=e.indexOf("--");return r!==-1&&(s===-1||r<s)}});var Sc=V((oS,Ac)=>{"use strict";var Oy=require("os"),vc=require("tty"),ft=Cc(),{env:Te}=process,un;ft("no-color")||ft("no-colors")||ft("color=false")||ft("color=never")?un=0:(ft("color")||ft("colors")||ft("color=true")||ft("color=always"))&&(un=1);"FORCE_COLOR"in Te&&(Te.FORCE_COLOR==="true"?un=1:Te.FORCE_COLOR==="false"?un=0:un=Te.FORCE_COLOR.length===0?1:Math.min(parseInt(Te.FORCE_COLOR,10),3));function la(t){return t===0?!1:{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}function ua(t,e){if(un===0)return 0;if(ft("color=16m")||ft("color=full")||ft("color=truecolor"))return 3;if(ft("color=256"))return 2;if(t&&!e&&un===void 0)return 0;let n=un||0;if(Te.TERM==="dumb")return n;if(process.platform==="win32"){let r=Oy.release().split(".");return Number(r[0])>=10&&Number(r[2])>=10586?Number(r[2])>=14931?3:2:1}if("CI"in Te)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(r=>r in Te)||Te.CI_NAME==="codeship"?1:n;if("TEAMCITY_VERSION"in Te)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(Te.TEAMCITY_VERSION)?1:0;if(Te.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in Te){let r=parseInt((Te.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(Te.TERM_PROGRAM){case"iTerm.app":return r>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(Te.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(Te.TERM)||"COLORTERM"in Te?1:n}function Dy(t){let e=ua(t,t&&t.isTTY);return la(e)}Ac.exports={supportsColor:Dy,stdout:la(ua(!0,vc.isatty(1))),stderr:la(ua(!0,vc.isatty(2)))}});var _c=V((_e,zi)=>{var Ly=require("tty"),Wi=require("util");_e.init=Wy;_e.log=Yy;_e.formatArgs=Ny;_e.save=By;_e.load=Vy;_e.useColors=My;_e.destroy=Wi.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");_e.colors=[6,2,3,4,5,1];try{let t=Sc();t&&(t.stderr||t).level>=2&&(_e.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch{}_e.inspectOpts=Object.keys(process.env).filter(t=>/^debug_/i.test(t)).reduce((t,e)=>{let n=e.substring(6).toLowerCase().replace(/_([a-z])/g,(s,o)=>o.toUpperCase()),r=process.env[e];return/^(yes|on|true|enabled)$/i.test(r)?r=!0:/^(no|off|false|disabled)$/i.test(r)?r=!1:r==="null"?r=null:r=Number(r),t[n]=r,t},{});function My(){return"colors"in _e.inspectOpts?!!_e.inspectOpts.colors:Ly.isatty(process.stderr.fd)}function Ny(t){let{namespace:e,useColors:n}=this;if(n){let r=this.color,s="\x1B[3"+(r<8?r:"8;5;"+r),o=`  ${s};1m${e} \x1B[0m`;t[0]=o+t[0].split(`
`).join(`
`+o),t.push(s+"m+"+zi.exports.humanize(this.diff)+"\x1B[0m")}else t[0]=$y()+e+" "+t[0]}function $y(){return _e.inspectOpts.hideDate?"":new Date().toISOString()+" "}function Yy(...t){return process.stderr.write(Wi.formatWithOptions(_e.inspectOpts,...t)+`
`)}function By(t){t?process.env.DEBUG=t:delete process.env.DEBUG}function Vy(){return process.env.DEBUG}function Wy(t){t.inspectOpts={};let e=Object.keys(_e.inspectOpts);for(let n=0;n<e.length;n++)t.inspectOpts[e[n]]=_e.inspectOpts[e[n]]}zi.exports=aa()(_e);var{formatters:Tc}=zi.exports;Tc.o=function(t){return this.inspectOpts.colors=this.useColors,Wi.inspect(t,this.inspectOpts).split(`
`).map(e=>e.trim()).join(" ")};Tc.O=function(t){return this.inspectOpts.colors=this.useColors,Wi.inspect(t,this.inspectOpts)}});var Fc=V((aS,ca)=>{typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?ca.exports=xc():ca.exports=_c()});var Vc=V((Ki,Bc)=>{(function(t,e){typeof Ki=="object"&&typeof Bc<"u"?e(Ki):typeof define=="function"&&define.amd?define(["exports"],e):(t=typeof globalThis<"u"?globalThis:t||self,e(t.compareVersions={}))})(Ki,function(t){"use strict";let e=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,n=T=>{if(typeof T!="string")throw new TypeError("Invalid argument expected string");let C=T.match(e);if(!C)throw new Error(`Invalid argument not valid semver ('${T}' received)`);return C.shift(),C},r=T=>T==="*"||T==="x"||T==="X",s=T=>{let C=parseInt(T,10);return isNaN(C)?T:C},o=(T,C)=>typeof T!=typeof C?[String(T),String(C)]:[T,C],l=(T,C)=>{if(r(T)||r(C))return 0;let[_,I]=o(s(T),s(C));return _>I?1:_<I?-1:0},u=(T,C)=>{for(let _=0;_<Math.max(T.length,C.length);_++){let I=l(T[_]||"0",C[_]||"0");if(I!==0)return I}return 0},f=(T,C)=>{let _=n(T),I=n(C),W=_.pop(),H=I.pop(),A=u(_,I);return A!==0?A:W&&H?u(W.split("."),H.split(".")):W||H?W?-1:1:0},h=(T,C,_)=>{g(_);let I=f(T,C);return m[_].includes(I)},m={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]},p=Object.keys(m),g=T=>{if(typeof T!="string")throw new TypeError(`Invalid operator type, expected string but got ${typeof T}`);if(p.indexOf(T)===-1)throw new Error(`Invalid operator, expected one of ${p.join("|")}`)},w=(T,C)=>{if(C=C.replace(/([><=]+)\s+/g,"$1"),C.includes("||"))return C.split("||").some(ie=>w(T,ie));if(C.includes(" - ")){let[ie,he]=C.split(" - ",2);return w(T,`>=${ie} <=${he}`)}else if(C.includes(" "))return C.trim().replace(/\s{2,}/g," ").split(" ").every(ie=>w(T,ie));let _=C.match(/^([<>=~^]+)/),I=_?_[1]:"=";if(I!=="^"&&I!=="~")return h(T,C,I);let[W,H,A,,te]=n(T),[K,J,oe,,ue]=n(C),re=[W,H,A],Y=[K,J??"x",oe??"x"];if(ue&&(!te||u(re,Y)!==0||u(te.split("."),ue.split("."))===-1))return!1;let j=Y.findIndex(ie=>ie!=="0")+1,z=I==="~"?2:j>1?j:1;return!(u(re.slice(0,z),Y.slice(0,z))!==0||u(re.slice(z),Y.slice(z))===-1)},E=T=>typeof T=="string"&&/^[v\d]/.test(T)&&e.test(T),F=T=>typeof T=="string"&&/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/.test(T);t.compare=h,t.compareVersions=f,t.satisfies=w,t.validate=E,t.validateStrict=F})});var dd=V((MI,fd)=>{"use strict";var bs=Object.prototype.hasOwnProperty,cd=Object.prototype.toString,id=Object.defineProperty,sd=Object.getOwnPropertyDescriptor,od=function(e){return typeof Array.isArray=="function"?Array.isArray(e):cd.call(e)==="[object Array]"},ad=function(e){if(!e||cd.call(e)!=="[object Object]")return!1;var n=bs.call(e,"constructor"),r=e.constructor&&e.constructor.prototype&&bs.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!r)return!1;var s;for(s in e);return typeof s>"u"||bs.call(e,s)},ld=function(e,n){id&&n.name==="__proto__"?id(e,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):e[n.name]=n.newValue},ud=function(e,n){if(n==="__proto__")if(bs.call(e,n)){if(sd)return sd(e,n).value}else return;return e[n]};fd.exports=function t(){var e,n,r,s,o,l,u=arguments[0],f=1,h=arguments.length,m=!1;for(typeof u=="boolean"&&(m=u,u=arguments[1]||{},f=2),(u==null||typeof u!="object"&&typeof u!="function")&&(u={});f<h;++f)if(e=arguments[f],e!=null)for(n in e)r=ud(u,n),s=ud(e,n),u!==s&&(m&&s&&(ad(s)||(o=od(s)))?(o?(o=!1,l=r&&od(r)?r:[]):l=r&&ad(r)?r:{},ld(u,{name:n,newValue:t(m,l,s)})):typeof s<"u"&&ld(u,{name:n,newValue:s}));return u}});var ii=V(($R,Xd)=>{var qx="2.0.0",Gx=Number.MAX_SAFE_INTEGER||9007199254740991,Xx=16,Kx=250,Jx=["major","premajor","minor","preminor","patch","prepatch","prerelease"];Xd.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:Xx,MAX_SAFE_BUILD_LENGTH:Kx,MAX_SAFE_INTEGER:Gx,RELEASE_TYPES:Jx,SEMVER_SPEC_VERSION:qx,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var si=V((YR,Kd)=>{var Zx=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{};Kd.exports=Zx});var br=V((It,Jd)=>{var{MAX_SAFE_COMPONENT_LENGTH:Cl,MAX_SAFE_BUILD_LENGTH:Qx,MAX_LENGTH:eE}=ii(),tE=si();It=Jd.exports={};var nE=It.re=[],rE=It.safeRe=[],L=It.src=[],iE=It.safeSrc=[],M=It.t={},sE=0,vl="[a-zA-Z0-9-]",oE=[["\\s",1],["\\d",eE],[vl,Qx]],aE=t=>{for(let[e,n]of oE)t=t.split(`${e}*`).join(`${e}{0,${n}}`).split(`${e}+`).join(`${e}{1,${n}}`);return t},X=(t,e,n)=>{let r=aE(e),s=sE++;tE(t,s,e),M[t]=s,L[s]=e,iE[s]=r,nE[s]=new RegExp(e,n?"g":void 0),rE[s]=new RegExp(r,n?"g":void 0)};X("NUMERICIDENTIFIER","0|[1-9]\\d*");X("NUMERICIDENTIFIERLOOSE","\\d+");X("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${vl}*`);X("MAINVERSION",`(${L[M.NUMERICIDENTIFIER]})\\.(${L[M.NUMERICIDENTIFIER]})\\.(${L[M.NUMERICIDENTIFIER]})`);X("MAINVERSIONLOOSE",`(${L[M.NUMERICIDENTIFIERLOOSE]})\\.(${L[M.NUMERICIDENTIFIERLOOSE]})\\.(${L[M.NUMERICIDENTIFIERLOOSE]})`);X("PRERELEASEIDENTIFIER",`(?:${L[M.NUMERICIDENTIFIER]}|${L[M.NONNUMERICIDENTIFIER]})`);X("PRERELEASEIDENTIFIERLOOSE",`(?:${L[M.NUMERICIDENTIFIERLOOSE]}|${L[M.NONNUMERICIDENTIFIER]})`);X("PRERELEASE",`(?:-(${L[M.PRERELEASEIDENTIFIER]}(?:\\.${L[M.PRERELEASEIDENTIFIER]})*))`);X("PRERELEASELOOSE",`(?:-?(${L[M.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${L[M.PRERELEASEIDENTIFIERLOOSE]})*))`);X("BUILDIDENTIFIER",`${vl}+`);X("BUILD",`(?:\\+(${L[M.BUILDIDENTIFIER]}(?:\\.${L[M.BUILDIDENTIFIER]})*))`);X("FULLPLAIN",`v?${L[M.MAINVERSION]}${L[M.PRERELEASE]}?${L[M.BUILD]}?`);X("FULL",`^${L[M.FULLPLAIN]}$`);X("LOOSEPLAIN",`[v=\\s]*${L[M.MAINVERSIONLOOSE]}${L[M.PRERELEASELOOSE]}?${L[M.BUILD]}?`);X("LOOSE",`^${L[M.LOOSEPLAIN]}$`);X("GTLT","((?:<|>)?=?)");X("XRANGEIDENTIFIERLOOSE",`${L[M.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);X("XRANGEIDENTIFIER",`${L[M.NUMERICIDENTIFIER]}|x|X|\\*`);X("XRANGEPLAIN",`[v=\\s]*(${L[M.XRANGEIDENTIFIER]})(?:\\.(${L[M.XRANGEIDENTIFIER]})(?:\\.(${L[M.XRANGEIDENTIFIER]})(?:${L[M.PRERELEASE]})?${L[M.BUILD]}?)?)?`);X("XRANGEPLAINLOOSE",`[v=\\s]*(${L[M.XRANGEIDENTIFIERLOOSE]})(?:\\.(${L[M.XRANGEIDENTIFIERLOOSE]})(?:\\.(${L[M.XRANGEIDENTIFIERLOOSE]})(?:${L[M.PRERELEASELOOSE]})?${L[M.BUILD]}?)?)?`);X("XRANGE",`^${L[M.GTLT]}\\s*${L[M.XRANGEPLAIN]}$`);X("XRANGELOOSE",`^${L[M.GTLT]}\\s*${L[M.XRANGEPLAINLOOSE]}$`);X("COERCEPLAIN",`(^|[^\\d])(\\d{1,${Cl}})(?:\\.(\\d{1,${Cl}}))?(?:\\.(\\d{1,${Cl}}))?`);X("COERCE",`${L[M.COERCEPLAIN]}(?:$|[^\\d])`);X("COERCEFULL",L[M.COERCEPLAIN]+`(?:${L[M.PRERELEASE]})?(?:${L[M.BUILD]})?(?:$|[^\\d])`);X("COERCERTL",L[M.COERCE],!0);X("COERCERTLFULL",L[M.COERCEFULL],!0);X("LONETILDE","(?:~>?)");X("TILDETRIM",`(\\s*)${L[M.LONETILDE]}\\s+`,!0);It.tildeTrimReplace="$1~";X("TILDE",`^${L[M.LONETILDE]}${L[M.XRANGEPLAIN]}$`);X("TILDELOOSE",`^${L[M.LONETILDE]}${L[M.XRANGEPLAINLOOSE]}$`);X("LONECARET","(?:\\^)");X("CARETTRIM",`(\\s*)${L[M.LONECARET]}\\s+`,!0);It.caretTrimReplace="$1^";X("CARET",`^${L[M.LONECARET]}${L[M.XRANGEPLAIN]}$`);X("CARETLOOSE",`^${L[M.LONECARET]}${L[M.XRANGEPLAINLOOSE]}$`);X("COMPARATORLOOSE",`^${L[M.GTLT]}\\s*(${L[M.LOOSEPLAIN]})$|^$`);X("COMPARATOR",`^${L[M.GTLT]}\\s*(${L[M.FULLPLAIN]})$|^$`);X("COMPARATORTRIM",`(\\s*)${L[M.GTLT]}\\s*(${L[M.LOOSEPLAIN]}|${L[M.XRANGEPLAIN]})`,!0);It.comparatorTrimReplace="$1$2$3";X("HYPHENRANGE",`^\\s*(${L[M.XRANGEPLAIN]})\\s+-\\s+(${L[M.XRANGEPLAIN]})\\s*$`);X("HYPHENRANGELOOSE",`^\\s*(${L[M.XRANGEPLAINLOOSE]})\\s+-\\s+(${L[M.XRANGEPLAINLOOSE]})\\s*$`);X("STAR","(<|>)?=?\\s*\\*");X("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");X("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var Os=V((BR,Zd)=>{var lE=Object.freeze({loose:!0}),uE=Object.freeze({}),cE=t=>t?typeof t!="object"?lE:t:uE;Zd.exports=cE});var Al=V((VR,th)=>{var Qd=/^[0-9]+$/,eh=(t,e)=>{let n=Qd.test(t),r=Qd.test(e);return n&&r&&(t=+t,e=+e),t===e?0:n&&!r?-1:r&&!n?1:t<e?-1:1},fE=(t,e)=>eh(e,t);th.exports={compareIdentifiers:eh,rcompareIdentifiers:fE}});var Ne=V((WR,sh)=>{var Ds=si(),{MAX_LENGTH:nh,MAX_SAFE_INTEGER:Ls}=ii(),{safeRe:rh,safeSrc:ih,t:Ms}=br(),dE=Os(),{compareIdentifiers:kr}=Al(),Sl=class t{constructor(e,n){if(n=dE(n),e instanceof t){if(e.loose===!!n.loose&&e.includePrerelease===!!n.includePrerelease)return e;e=e.version}else if(typeof e!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>nh)throw new TypeError(`version is longer than ${nh} characters`);Ds("SemVer",e,n),this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease;let r=e.trim().match(n.loose?rh[Ms.LOOSE]:rh[Ms.FULL]);if(!r)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>Ls||this.major<0)throw new TypeError("Invalid major version");if(this.minor>Ls||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>Ls||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map(s=>{if(/^[0-9]+$/.test(s)){let o=+s;if(o>=0&&o<Ls)return o}return s}):this.prerelease=[],this.build=r[5]?r[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(Ds("SemVer.compare",this.version,this.options,e),!(e instanceof t)){if(typeof e=="string"&&e===this.version)return 0;e=new t(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof t||(e=new t(e,this.options)),kr(this.major,e.major)||kr(this.minor,e.minor)||kr(this.patch,e.patch)}comparePre(e){if(e instanceof t||(e=new t(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let n=0;do{let r=this.prerelease[n],s=e.prerelease[n];if(Ds("prerelease compare",n,r,s),r===void 0&&s===void 0)return 0;if(s===void 0)return 1;if(r===void 0)return-1;if(r===s)continue;return kr(r,s)}while(++n)}compareBuild(e){e instanceof t||(e=new t(e,this.options));let n=0;do{let r=this.build[n],s=e.build[n];if(Ds("build compare",n,r,s),r===void 0&&s===void 0)return 0;if(s===void 0)return 1;if(r===void 0)return-1;if(r===s)continue;return kr(r,s)}while(++n)}inc(e,n,r){if(e.startsWith("pre")){if(!n&&r===!1)throw new Error("invalid increment argument: identifier is empty");if(n){let s=new RegExp(`^${this.options.loose?ih[Ms.PRERELEASELOOSE]:ih[Ms.PRERELEASE]}$`),o=`-${n}`.match(s);if(!o||o[1]!==n)throw new Error(`invalid identifier: ${n}`)}}switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",n,r);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",n,r);break;case"prepatch":this.prerelease.length=0,this.inc("patch",n,r),this.inc("pre",n,r);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",n,r),this.inc("pre",n,r);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{let s=Number(r)?1:0;if(this.prerelease.length===0)this.prerelease=[s];else{let o=this.prerelease.length;for(;--o>=0;)typeof this.prerelease[o]=="number"&&(this.prerelease[o]++,o=-2);if(o===-1){if(n===this.prerelease.join(".")&&r===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(s)}}if(n){let o=[n,s];r===!1&&(o=[n]),kr(this.prerelease[0],n)===0?isNaN(this.prerelease[1])&&(this.prerelease=o):this.prerelease=o}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};sh.exports=Sl});var Mn=V((zR,ah)=>{var oh=Ne(),hE=(t,e,n=!1)=>{if(t instanceof oh)return t;try{return new oh(t,e)}catch(r){if(!n)return null;throw r}};ah.exports=hE});var uh=V((UR,lh)=>{var mE=Mn(),pE=(t,e)=>{let n=mE(t,e);return n?n.version:null};lh.exports=pE});var fh=V((HR,ch)=>{var gE=Mn(),wE=(t,e)=>{let n=gE(t.trim().replace(/^[=v]+/,""),e);return n?n.version:null};ch.exports=wE});var mh=V((jR,hh)=>{var dh=Ne(),yE=(t,e,n,r,s)=>{typeof n=="string"&&(s=r,r=n,n=void 0);try{return new dh(t instanceof dh?t.version:t,n).inc(e,r,s).version}catch{return null}};hh.exports=yE});var wh=V((qR,gh)=>{var ph=Mn(),bE=(t,e)=>{let n=ph(t,null,!0),r=ph(e,null,!0),s=n.compare(r);if(s===0)return null;let o=s>0,l=o?n:r,u=o?r:n,f=!!l.prerelease.length;if(!!u.prerelease.length&&!f){if(!u.patch&&!u.minor)return"major";if(u.compareMain(l)===0)return u.minor&&!u.patch?"minor":"patch"}let m=f?"pre":"";return n.major!==r.major?m+"major":n.minor!==r.minor?m+"minor":n.patch!==r.patch?m+"patch":"prerelease"};gh.exports=bE});var bh=V((GR,yh)=>{var kE=Ne(),xE=(t,e)=>new kE(t,e).major;yh.exports=xE});var xh=V((XR,kh)=>{var EE=Ne(),CE=(t,e)=>new EE(t,e).minor;kh.exports=CE});var Ch=V((KR,Eh)=>{var vE=Ne(),AE=(t,e)=>new vE(t,e).patch;Eh.exports=AE});var Ah=V((JR,vh)=>{var SE=Mn(),TE=(t,e)=>{let n=SE(t,e);return n&&n.prerelease.length?n.prerelease:null};vh.exports=TE});var ht=V((ZR,Th)=>{var Sh=Ne(),_E=(t,e,n)=>new Sh(t,n).compare(new Sh(e,n));Th.exports=_E});var Fh=V((QR,_h)=>{var FE=ht(),IE=(t,e,n)=>FE(e,t,n);_h.exports=IE});var Ph=V((eO,Ih)=>{var PE=ht(),RE=(t,e)=>PE(t,e,!0);Ih.exports=RE});var Ns=V((tO,Oh)=>{var Rh=Ne(),OE=(t,e,n)=>{let r=new Rh(t,n),s=new Rh(e,n);return r.compare(s)||r.compareBuild(s)};Oh.exports=OE});var Lh=V((nO,Dh)=>{var DE=Ns(),LE=(t,e)=>t.sort((n,r)=>DE(n,r,e));Dh.exports=LE});var Nh=V((rO,Mh)=>{var ME=Ns(),NE=(t,e)=>t.sort((n,r)=>ME(r,n,e));Mh.exports=NE});var oi=V((iO,$h)=>{var $E=ht(),YE=(t,e,n)=>$E(t,e,n)>0;$h.exports=YE});var $s=V((sO,Yh)=>{var BE=ht(),VE=(t,e,n)=>BE(t,e,n)<0;Yh.exports=VE});var Tl=V((oO,Bh)=>{var WE=ht(),zE=(t,e,n)=>WE(t,e,n)===0;Bh.exports=zE});var _l=V((aO,Vh)=>{var UE=ht(),HE=(t,e,n)=>UE(t,e,n)!==0;Vh.exports=HE});var Ys=V((lO,Wh)=>{var jE=ht(),qE=(t,e,n)=>jE(t,e,n)>=0;Wh.exports=qE});var Bs=V((uO,zh)=>{var GE=ht(),XE=(t,e,n)=>GE(t,e,n)<=0;zh.exports=XE});var Fl=V((cO,Uh)=>{var KE=Tl(),JE=_l(),ZE=oi(),QE=Ys(),eC=$s(),tC=Bs(),nC=(t,e,n,r)=>{switch(e){case"===":return typeof t=="object"&&(t=t.version),typeof n=="object"&&(n=n.version),t===n;case"!==":return typeof t=="object"&&(t=t.version),typeof n=="object"&&(n=n.version),t!==n;case"":case"=":case"==":return KE(t,n,r);case"!=":return JE(t,n,r);case">":return ZE(t,n,r);case">=":return QE(t,n,r);case"<":return eC(t,n,r);case"<=":return tC(t,n,r);default:throw new TypeError(`Invalid operator: ${e}`)}};Uh.exports=nC});var jh=V((fO,Hh)=>{var rC=Ne(),iC=Mn(),{safeRe:Vs,t:Ws}=br(),sC=(t,e)=>{if(t instanceof rC)return t;if(typeof t=="number"&&(t=String(t)),typeof t!="string")return null;e=e||{};let n=null;if(!e.rtl)n=t.match(e.includePrerelease?Vs[Ws.COERCEFULL]:Vs[Ws.COERCE]);else{let f=e.includePrerelease?Vs[Ws.COERCERTLFULL]:Vs[Ws.COERCERTL],h;for(;(h=f.exec(t))&&(!n||n.index+n[0].length!==t.length);)(!n||h.index+h[0].length!==n.index+n[0].length)&&(n=h),f.lastIndex=h.index+h[1].length+h[2].length;f.lastIndex=-1}if(n===null)return null;let r=n[2],s=n[3]||"0",o=n[4]||"0",l=e.includePrerelease&&n[5]?`-${n[5]}`:"",u=e.includePrerelease&&n[6]?`+${n[6]}`:"";return iC(`${r}.${s}.${o}${l}${u}`,e)};Hh.exports=sC});var Gh=V((dO,qh)=>{var Il=class{constructor(){this.max=1e3,this.map=new Map}get(e){let n=this.map.get(e);if(n!==void 0)return this.map.delete(e),this.map.set(e,n),n}delete(e){return this.map.delete(e)}set(e,n){if(!this.delete(e)&&n!==void 0){if(this.map.size>=this.max){let s=this.map.keys().next().value;this.delete(s)}this.map.set(e,n)}return this}};qh.exports=Il});var mt=V((hO,Zh)=>{var oC=/\s+/g,Pl=class t{constructor(e,n){if(n=lC(n),e instanceof t)return e.loose===!!n.loose&&e.includePrerelease===!!n.includePrerelease?e:new t(e.raw,n);if(e instanceof Rl)return this.raw=e.value,this.set=[[e]],this.formatted=void 0,this;if(this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease,this.raw=e.trim().replace(oC," "),this.set=this.raw.split("||").map(r=>this.parseRange(r.trim())).filter(r=>r.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let r=this.set[0];if(this.set=this.set.filter(s=>!Kh(s[0])),this.set.length===0)this.set=[r];else if(this.set.length>1){for(let s of this.set)if(s.length===1&&pC(s[0])){this.set=[s];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let e=0;e<this.set.length;e++){e>0&&(this.formatted+="||");let n=this.set[e];for(let r=0;r<n.length;r++)r>0&&(this.formatted+=" "),this.formatted+=n[r].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){let r=((this.options.includePrerelease&&hC)|(this.options.loose&&mC))+":"+e,s=Xh.get(r);if(s)return s;let o=this.options.loose,l=o?Qe[je.HYPHENRANGELOOSE]:Qe[je.HYPHENRANGE];e=e.replace(l,AC(this.options.includePrerelease)),fe("hyphen replace",e),e=e.replace(Qe[je.COMPARATORTRIM],cC),fe("comparator trim",e),e=e.replace(Qe[je.TILDETRIM],fC),fe("tilde trim",e),e=e.replace(Qe[je.CARETTRIM],dC),fe("caret trim",e);let u=e.split(" ").map(p=>gC(p,this.options)).join(" ").split(/\s+/).map(p=>vC(p,this.options));o&&(u=u.filter(p=>(fe("loose invalid filter",p,this.options),!!p.match(Qe[je.COMPARATORLOOSE])))),fe("range list",u);let f=new Map,h=u.map(p=>new Rl(p,this.options));for(let p of h){if(Kh(p))return[p];f.set(p.value,p)}f.size>1&&f.has("")&&f.delete("");let m=[...f.values()];return Xh.set(r,m),m}intersects(e,n){if(!(e instanceof t))throw new TypeError("a Range is required");return this.set.some(r=>Jh(r,n)&&e.set.some(s=>Jh(s,n)&&r.every(o=>s.every(l=>o.intersects(l,n)))))}test(e){if(!e)return!1;if(typeof e=="string")try{e=new uC(e,this.options)}catch{return!1}for(let n=0;n<this.set.length;n++)if(SC(this.set[n],e,this.options))return!0;return!1}};Zh.exports=Pl;var aC=Gh(),Xh=new aC,lC=Os(),Rl=ai(),fe=si(),uC=Ne(),{safeRe:Qe,t:je,comparatorTrimReplace:cC,tildeTrimReplace:fC,caretTrimReplace:dC}=br(),{FLAG_INCLUDE_PRERELEASE:hC,FLAG_LOOSE:mC}=ii(),Kh=t=>t.value==="<0.0.0-0",pC=t=>t.value==="",Jh=(t,e)=>{let n=!0,r=t.slice(),s=r.pop();for(;n&&r.length;)n=r.every(o=>s.intersects(o,e)),s=r.pop();return n},gC=(t,e)=>(fe("comp",t,e),t=bC(t,e),fe("caret",t),t=wC(t,e),fe("tildes",t),t=xC(t,e),fe("xrange",t),t=CC(t,e),fe("stars",t),t),qe=t=>!t||t.toLowerCase()==="x"||t==="*",wC=(t,e)=>t.trim().split(/\s+/).map(n=>yC(n,e)).join(" "),yC=(t,e)=>{let n=e.loose?Qe[je.TILDELOOSE]:Qe[je.TILDE];return t.replace(n,(r,s,o,l,u)=>{fe("tilde",t,r,s,o,l,u);let f;return qe(s)?f="":qe(o)?f=`>=${s}.0.0 <${+s+1}.0.0-0`:qe(l)?f=`>=${s}.${o}.0 <${s}.${+o+1}.0-0`:u?(fe("replaceTilde pr",u),f=`>=${s}.${o}.${l}-${u} <${s}.${+o+1}.0-0`):f=`>=${s}.${o}.${l} <${s}.${+o+1}.0-0`,fe("tilde return",f),f})},bC=(t,e)=>t.trim().split(/\s+/).map(n=>kC(n,e)).join(" "),kC=(t,e)=>{fe("caret",t,e);let n=e.loose?Qe[je.CARETLOOSE]:Qe[je.CARET],r=e.includePrerelease?"-0":"";return t.replace(n,(s,o,l,u,f)=>{fe("caret",t,s,o,l,u,f);let h;return qe(o)?h="":qe(l)?h=`>=${o}.0.0${r} <${+o+1}.0.0-0`:qe(u)?o==="0"?h=`>=${o}.${l}.0${r} <${o}.${+l+1}.0-0`:h=`>=${o}.${l}.0${r} <${+o+1}.0.0-0`:f?(fe("replaceCaret pr",f),o==="0"?l==="0"?h=`>=${o}.${l}.${u}-${f} <${o}.${l}.${+u+1}-0`:h=`>=${o}.${l}.${u}-${f} <${o}.${+l+1}.0-0`:h=`>=${o}.${l}.${u}-${f} <${+o+1}.0.0-0`):(fe("no pr"),o==="0"?l==="0"?h=`>=${o}.${l}.${u}${r} <${o}.${l}.${+u+1}-0`:h=`>=${o}.${l}.${u}${r} <${o}.${+l+1}.0-0`:h=`>=${o}.${l}.${u} <${+o+1}.0.0-0`),fe("caret return",h),h})},xC=(t,e)=>(fe("replaceXRanges",t,e),t.split(/\s+/).map(n=>EC(n,e)).join(" ")),EC=(t,e)=>{t=t.trim();let n=e.loose?Qe[je.XRANGELOOSE]:Qe[je.XRANGE];return t.replace(n,(r,s,o,l,u,f)=>{fe("xRange",t,r,s,o,l,u,f);let h=qe(o),m=h||qe(l),p=m||qe(u),g=p;return s==="="&&g&&(s=""),f=e.includePrerelease?"-0":"",h?s===">"||s==="<"?r="<0.0.0-0":r="*":s&&g?(m&&(l=0),u=0,s===">"?(s=">=",m?(o=+o+1,l=0,u=0):(l=+l+1,u=0)):s==="<="&&(s="<",m?o=+o+1:l=+l+1),s==="<"&&(f="-0"),r=`${s+o}.${l}.${u}${f}`):m?r=`>=${o}.0.0${f} <${+o+1}.0.0-0`:p&&(r=`>=${o}.${l}.0${f} <${o}.${+l+1}.0-0`),fe("xRange return",r),r})},CC=(t,e)=>(fe("replaceStars",t,e),t.trim().replace(Qe[je.STAR],"")),vC=(t,e)=>(fe("replaceGTE0",t,e),t.trim().replace(Qe[e.includePrerelease?je.GTE0PRE:je.GTE0],"")),AC=t=>(e,n,r,s,o,l,u,f,h,m,p,g)=>(qe(r)?n="":qe(s)?n=`>=${r}.0.0${t?"-0":""}`:qe(o)?n=`>=${r}.${s}.0${t?"-0":""}`:l?n=`>=${n}`:n=`>=${n}${t?"-0":""}`,qe(h)?f="":qe(m)?f=`<${+h+1}.0.0-0`:qe(p)?f=`<${h}.${+m+1}.0-0`:g?f=`<=${h}.${m}.${p}-${g}`:t?f=`<${h}.${m}.${+p+1}-0`:f=`<=${f}`,`${n} ${f}`.trim()),SC=(t,e,n)=>{for(let r=0;r<t.length;r++)if(!t[r].test(e))return!1;if(e.prerelease.length&&!n.includePrerelease){for(let r=0;r<t.length;r++)if(fe(t[r].semver),t[r].semver!==Rl.ANY&&t[r].semver.prerelease.length>0){let s=t[r].semver;if(s.major===e.major&&s.minor===e.minor&&s.patch===e.patch)return!0}return!1}return!0}});var ai=V((mO,im)=>{var li=Symbol("SemVer ANY"),Ll=class t{static get ANY(){return li}constructor(e,n){if(n=Qh(n),e instanceof t){if(e.loose===!!n.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),Dl("comparator",e,n),this.options=n,this.loose=!!n.loose,this.parse(e),this.semver===li?this.value="":this.value=this.operator+this.semver.version,Dl("comp",this)}parse(e){let n=this.options.loose?em[tm.COMPARATORLOOSE]:em[tm.COMPARATOR],r=e.match(n);if(!r)throw new TypeError(`Invalid comparator: ${e}`);this.operator=r[1]!==void 0?r[1]:"",this.operator==="="&&(this.operator=""),r[2]?this.semver=new nm(r[2],this.options.loose):this.semver=li}toString(){return this.value}test(e){if(Dl("Comparator.test",e,this.options.loose),this.semver===li||e===li)return!0;if(typeof e=="string")try{e=new nm(e,this.options)}catch{return!1}return Ol(e,this.operator,this.semver,this.options)}intersects(e,n){if(!(e instanceof t))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new rm(e.value,n).test(this.value):e.operator===""?e.value===""?!0:new rm(this.value,n).test(e.semver):(n=Qh(n),n.includePrerelease&&(this.value==="<0.0.0-0"||e.value==="<0.0.0-0")||!n.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&e.operator.startsWith(">")||this.operator.startsWith("<")&&e.operator.startsWith("<")||this.semver.version===e.semver.version&&this.operator.includes("=")&&e.operator.includes("=")||Ol(this.semver,"<",e.semver,n)&&this.operator.startsWith(">")&&e.operator.startsWith("<")||Ol(this.semver,">",e.semver,n)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}};im.exports=Ll;var Qh=Os(),{safeRe:em,t:tm}=br(),Ol=Fl(),Dl=si(),nm=Ne(),rm=mt()});var ui=V((pO,sm)=>{var TC=mt(),_C=(t,e,n)=>{try{e=new TC(e,n)}catch{return!1}return e.test(t)};sm.exports=_C});var am=V((gO,om)=>{var FC=mt(),IC=(t,e)=>new FC(t,e).set.map(n=>n.map(r=>r.value).join(" ").trim().split(" "));om.exports=IC});var um=V((wO,lm)=>{var PC=Ne(),RC=mt(),OC=(t,e,n)=>{let r=null,s=null,o=null;try{o=new RC(e,n)}catch{return null}return t.forEach(l=>{o.test(l)&&(!r||s.compare(l)===-1)&&(r=l,s=new PC(r,n))}),r};lm.exports=OC});var fm=V((yO,cm)=>{var DC=Ne(),LC=mt(),MC=(t,e,n)=>{let r=null,s=null,o=null;try{o=new LC(e,n)}catch{return null}return t.forEach(l=>{o.test(l)&&(!r||s.compare(l)===1)&&(r=l,s=new DC(r,n))}),r};cm.exports=MC});var mm=V((bO,hm)=>{var Ml=Ne(),NC=mt(),dm=oi(),$C=(t,e)=>{t=new NC(t,e);let n=new Ml("0.0.0");if(t.test(n)||(n=new Ml("0.0.0-0"),t.test(n)))return n;n=null;for(let r=0;r<t.set.length;++r){let s=t.set[r],o=null;s.forEach(l=>{let u=new Ml(l.semver.version);switch(l.operator){case">":u.prerelease.length===0?u.patch++:u.prerelease.push(0),u.raw=u.format();case"":case">=":(!o||dm(u,o))&&(o=u);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${l.operator}`)}}),o&&(!n||dm(n,o))&&(n=o)}return n&&t.test(n)?n:null};hm.exports=$C});var gm=V((kO,pm)=>{var YC=mt(),BC=(t,e)=>{try{return new YC(t,e).range||"*"}catch{return null}};pm.exports=BC});var zs=V((xO,km)=>{var VC=Ne(),bm=ai(),{ANY:WC}=bm,zC=mt(),UC=ui(),wm=oi(),ym=$s(),HC=Bs(),jC=Ys(),qC=(t,e,n,r)=>{t=new VC(t,r),e=new zC(e,r);let s,o,l,u,f;switch(n){case">":s=wm,o=HC,l=ym,u=">",f=">=";break;case"<":s=ym,o=jC,l=wm,u="<",f="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(UC(t,e,r))return!1;for(let h=0;h<e.set.length;++h){let m=e.set[h],p=null,g=null;if(m.forEach(w=>{w.semver===WC&&(w=new bm(">=0.0.0")),p=p||w,g=g||w,s(w.semver,p.semver,r)?p=w:l(w.semver,g.semver,r)&&(g=w)}),p.operator===u||p.operator===f||(!g.operator||g.operator===u)&&o(t,g.semver))return!1;if(g.operator===f&&l(t,g.semver))return!1}return!0};km.exports=qC});var Em=V((EO,xm)=>{var GC=zs(),XC=(t,e,n)=>GC(t,e,">",n);xm.exports=XC});var vm=V((CO,Cm)=>{var KC=zs(),JC=(t,e,n)=>KC(t,e,"<",n);Cm.exports=JC});var Tm=V((vO,Sm)=>{var Am=mt(),ZC=(t,e,n)=>(t=new Am(t,n),e=new Am(e,n),t.intersects(e,n));Sm.exports=ZC});var Fm=V((AO,_m)=>{var QC=ui(),ev=ht();_m.exports=(t,e,n)=>{let r=[],s=null,o=null,l=t.sort((m,p)=>ev(m,p,n));for(let m of l)QC(m,e,n)?(o=m,s||(s=m)):(o&&r.push([s,o]),o=null,s=null);s&&r.push([s,null]);let u=[];for(let[m,p]of r)m===p?u.push(m):!p&&m===l[0]?u.push("*"):p?m===l[0]?u.push(`<=${p}`):u.push(`${m} - ${p}`):u.push(`>=${m}`);let f=u.join(" || "),h=typeof e.raw=="string"?e.raw:String(e);return f.length<h.length?f:e}});var Lm=V((SO,Dm)=>{var Im=mt(),$l=ai(),{ANY:Nl}=$l,ci=ui(),Yl=ht(),tv=(t,e,n={})=>{if(t===e)return!0;t=new Im(t,n),e=new Im(e,n);let r=!1;e:for(let s of t.set){for(let o of e.set){let l=rv(s,o,n);if(r=r||l!==null,l)continue e}if(r)return!1}return!0},nv=[new $l(">=0.0.0-0")],Pm=[new $l(">=0.0.0")],rv=(t,e,n)=>{if(t===e)return!0;if(t.length===1&&t[0].semver===Nl){if(e.length===1&&e[0].semver===Nl)return!0;n.includePrerelease?t=nv:t=Pm}if(e.length===1&&e[0].semver===Nl){if(n.includePrerelease)return!0;e=Pm}let r=new Set,s,o;for(let w of t)w.operator===">"||w.operator===">="?s=Rm(s,w,n):w.operator==="<"||w.operator==="<="?o=Om(o,w,n):r.add(w.semver);if(r.size>1)return null;let l;if(s&&o){if(l=Yl(s.semver,o.semver,n),l>0)return null;if(l===0&&(s.operator!==">="||o.operator!=="<="))return null}for(let w of r){if(s&&!ci(w,String(s),n)||o&&!ci(w,String(o),n))return null;for(let E of e)if(!ci(w,String(E),n))return!1;return!0}let u,f,h,m,p=o&&!n.includePrerelease&&o.semver.prerelease.length?o.semver:!1,g=s&&!n.includePrerelease&&s.semver.prerelease.length?s.semver:!1;p&&p.prerelease.length===1&&o.operator==="<"&&p.prerelease[0]===0&&(p=!1);for(let w of e){if(m=m||w.operator===">"||w.operator===">=",h=h||w.operator==="<"||w.operator==="<=",s){if(g&&w.semver.prerelease&&w.semver.prerelease.length&&w.semver.major===g.major&&w.semver.minor===g.minor&&w.semver.patch===g.patch&&(g=!1),w.operator===">"||w.operator===">="){if(u=Rm(s,w,n),u===w&&u!==s)return!1}else if(s.operator===">="&&!ci(s.semver,String(w),n))return!1}if(o){if(p&&w.semver.prerelease&&w.semver.prerelease.length&&w.semver.major===p.major&&w.semver.minor===p.minor&&w.semver.patch===p.patch&&(p=!1),w.operator==="<"||w.operator==="<="){if(f=Om(o,w,n),f===w&&f!==o)return!1}else if(o.operator==="<="&&!ci(o.semver,String(w),n))return!1}if(!w.operator&&(o||s)&&l!==0)return!1}return!(s&&h&&!o&&l!==0||o&&m&&!s&&l!==0||g||p)},Rm=(t,e,n)=>{if(!t)return e;let r=Yl(t.semver,e.semver,n);return r>0?t:r<0||e.operator===">"&&t.operator===">="?e:t},Om=(t,e,n)=>{if(!t)return e;let r=Yl(t.semver,e.semver,n);return r<0?t:r>0||e.operator==="<"&&t.operator==="<="?e:t};Dm.exports=tv});var Ym=V((TO,$m)=>{var Bl=br(),Mm=ii(),iv=Ne(),Nm=Al(),sv=Mn(),ov=uh(),av=fh(),lv=mh(),uv=wh(),cv=bh(),fv=xh(),dv=Ch(),hv=Ah(),mv=ht(),pv=Fh(),gv=Ph(),wv=Ns(),yv=Lh(),bv=Nh(),kv=oi(),xv=$s(),Ev=Tl(),Cv=_l(),vv=Ys(),Av=Bs(),Sv=Fl(),Tv=jh(),_v=ai(),Fv=mt(),Iv=ui(),Pv=am(),Rv=um(),Ov=fm(),Dv=mm(),Lv=gm(),Mv=zs(),Nv=Em(),$v=vm(),Yv=Tm(),Bv=Fm(),Vv=Lm();$m.exports={parse:sv,valid:ov,clean:av,inc:lv,diff:uv,major:cv,minor:fv,patch:dv,prerelease:hv,compare:mv,rcompare:pv,compareLoose:gv,compareBuild:wv,sort:yv,rsort:bv,gt:kv,lt:xv,eq:Ev,neq:Cv,gte:vv,lte:Av,cmp:Sv,coerce:Tv,Comparator:_v,Range:Fv,satisfies:Iv,toComparators:Pv,maxSatisfying:Rv,minSatisfying:Ov,minVersion:Dv,validRange:Lv,outside:Mv,gtr:Nv,ltr:$v,intersects:Yv,simplifyRange:Bv,subset:Vv,SemVer:iv,re:Bl.re,src:Bl.src,tokens:Bl.t,SEMVER_SPEC_VERSION:Mm.SEMVER_SPEC_VERSION,RELEASE_TYPES:Mm.RELEASE_TYPES,compareIdentifiers:Nm.compareIdentifiers,rcompareIdentifiers:Nm.rcompareIdentifiers}});var cA={};Wu(cA,{default:()=>uA});module.exports=sy(cA);var tu=require("electron"),nu=ze(zt(),1),bp=require("obsidian");(function(){if(globalThis.process)return;let e={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=e})();async function oy(t){return await new Promise(e=>{let n=new FileReader;n.addEventListener("loadend",r),n.readAsDataURL(t);function r(){e(n.result)}})}async function Uu(t,e){let n=await oy(t);return new Promise(r=>{let s=new Image;s.addEventListener("load",o),s.src=n;function o(){let l=document.createElement("canvas"),u=l.getContext("2d");if(!u)throw new Error("Could not get 2D context.");let f=s.width,h=s.height;l.width=f,l.height=h,u.fillStyle="#fff",u.fillRect(0,0,f,h),u.save();let m=.5;u.translate(f*m,h*m),u.drawImage(s,0,0,f,h,-f*m,-h*m,f,h),u.restore();let p=l.toDataURL("image/jpeg",e),g=ay(p);r(g)}})}function ay(t){let n=t.split(";base64,")[1];if(!n)throw new Error("Invalid data URL");let r=window.atob(n),s=r.length,o=new Uint8Array(s);for(let l=0;l<s;l++)o[l]=r.charCodeAt(l);return o.buffer}var ly=require("obsidian"),Hu=require("obsidian"),ju=require("obsidian"),mA=require("obsidian"),pA=require("obsidian");var Ut={AudioRecorder:"audio-recorder",Backlink:"backlink",Bookmarks:"bookmarks",Browser:"browser",Canvas:"canvas",CommandPalette:"command-palette",DailyNotes:"daily-notes",EditorStatus:"editor-status",FileExplorer:"file-explorer",FileRecovery:"file-recovery",GlobalSearch:"global-search",Graph:"graph",MarkdownImporter:"markdown-importer",NoteComposer:"note-composer",OutgoingLink:"outgoing-link",Outline:"outline",PagePreview:"page-preview",Properties:"properties",Publish:"publish",RandomNote:"random-note",SlashCommand:"slash-command",Slides:"slides",Switcher:"switcher",Sync:"sync",TagPane:"tag-pane",Templates:"templates",WordCount:"word-count",Workspaces:"workspaces",ZkPrefixer:"zk-prefixer"},hA={AllProperties:"all-properties",Audio:"audio",Backlink:Ut.Backlink,Bookmarks:Ut.Bookmarks,Browser:"browser",BrowserHistory:"browser-history",Canvas:Ut.Canvas,Empty:"empty",FileExplorer:Ut.FileExplorer,FileProperties:"file-properties",Graph:Ut.Graph,Image:"image",LocalGraph:"localgraph",Markdown:"markdown",OutgoingLink:Ut.OutgoingLink,Outline:Ut.Outline,Pdf:"pdf",ReleaseNotes:"release-notes",Search:"search",Sync:"sync",Tag:"tag",Video:"video"};function uy(){return Hu.TFile}function cy(){return ju.TFolder}function ut(t){return t.replace(/\/?[^\/]*$/,"")||"/"}function Di(t,e){let n=t.vault.getFolderByPath(e);return n||(n=new(cy())(t.vault,e),n.parent=Di(t,ut(e)),n.deleted=!0,n)}function qu(t,e){let n=t.vault.getFileByPath(e);return n||(n=new(uy())(t.vault,e),n.parent=Di(t,ut(e)),n.deleted=!0,n)}function on(t){return!!t.position}function vt(t){return!!t.key}var ta=ze(Ku(),1);(function(){if(globalThis.process)return;let e={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=e})();function Jo(t,e){let n=0;for(let r=0;r<t.length;r++){if(!(r in t))continue;let s=t[r];e(s,r,t)&&(t[n++]=s)}t.length=n}(function(){if(globalThis.process)return;let e={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=e})();var St=class{eventRefsMap=new Map;off(e,n){let r=this.eventRefsMap.get(e);r&&(Jo(r,s=>s.callback!==n),r.length===0&&this.eventRefsMap.delete(e))}offref(e){let n=this.eventRefsMap.get(e.name);n&&(Jo(n,r=>r!==e),n.length===0&&this.eventRefsMap.delete(e.name))}on(e,n,r){let s=this.eventRefsMap.get(e);s||(s=[],this.eventRefsMap.set(e,s));let o={asyncEvents:this,callback:n,name:e,thisArg:r};return s.push(o),o}once(e,n,r){let s=this.on(e,n,r),o=this.on(e,()=>{this.offref(s),this.offref(o)});return s}trigger(e,...n){let r=this.eventRefsMap.get(e)??[];for(let s of r.slice())this.tryTrigger(s,n)}async triggerAsync(e,...n){let r=this.eventRefsMap.get(e)??[];for(let s of r.slice())await this.tryTriggerAsync(s,n)}tryTrigger(e,n){try{e.callback.apply(e.thisArg,n)}catch(r){setTimeout(()=>{throw r},0)}}async tryTriggerAsync(e,n){try{await e.callback.call(e.thisArg,...n)}catch(r){setTimeout(()=>{throw r},0)}}};(function(){if(globalThis.process)return;let e={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=e})();var Qo="asyncError",Zo=`Error stack:
`,Mi="An unhandled error occurred executing async operation",Li=new St;Li.on(Qo,dy);function Ni(t){Li.trigger(Qo,t)}function Ju(t){return ea(t).map(e=>"  ".repeat(e.level)+(e.message.startsWith(Zo)?e.message.slice(Zo.length):e.message)).join(`
`)}function An(t=0){return(new Error().stack??"").split(`
`).slice(t+2).join(`
`)}function Lr(t,e){e??=globalThis.console;let n=ea(t);for(let r of n)r.shouldClearAnsiSequence?e.error(`\x1B[0m${r.message}\x1B[0m`):e.error(r.message)}function Zu(t){let e=Li.on(Qo,t);return()=>{Li.offref(e)}}function Ht(t){throw t}function dy(t){Lr(t)}function ea(t,e=0,n=[]){if(t===void 0)return n;if(!(t instanceof Error)){let s;return t===null?s="(null)":typeof t=="string"?s=t:s=JSON.stringify(t)??"undefined",n.push({level:e,message:s}),n}let r=`${t.name}: ${t.message}`;if(n.push({level:e,message:r,shouldClearAnsiSequence:!0}),t.stack){let s=t.stack.startsWith(r)?t.stack.slice(r.length+1):t.stack;n.push({level:e,message:`${Zo}${s}`})}return t.cause!==void 0&&(n.push({level:e,message:"Caused by:"}),ea(t.cause,e+1,n)),n}(function(){if(globalThis.process)return;let e={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=e})();function Xn(t){return t.replaceAll(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Qu(t){try{return new RegExp(t),!0}catch{return!1}}(function(){if(globalThis.process)return;let e={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=e})();async function Sn(t,...e){return hy(t)?await t(...e):t}function hy(t){return typeof t=="function"}(function(){if(globalThis.process)return;let e={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=e})();var my={"\n":"\\n","\r":"\\r","	":"\\t","\b":"\\b","\f":"\\f","'":"\\'",'"':'\\"',"\\":"\\\\"},py={};for(let[t,e]of Object.entries(my))py[e]=t;function ec(t,e,n,r){return r??=n,t.slice(0,n)+e+t.slice(r)}function Mr(t){return Ae(t,/\u00A0|\u202F/g," ").normalize("NFC")}function Ae(t,e,n){return typeof n>"u"?t:(e instanceof RegExp&&!e.global&&(e=new RegExp(e.source,`${e.flags}g`)),typeof n=="string"?t.replaceAll(e,n):t.replaceAll(e,(r,...s)=>{let l=typeof s.at(-1)=="object",u=l?s.length-2:s.length-1,f={groups:l?s.at(-1):void 0,offset:s.at(u-1),source:s.at(u),substring:r},h=s.slice(0,u-1);return n(f,...h)??f.substring}))}async function tc(t,e,n){if(typeof n=="string")return Ae(t,e,n);let r=[];Ae(t,e,(o,...l)=>(r.push(Sn(n,o,...l)),""));let s=await Promise.all(r);return Ae(t,e,o=>s.shift()??o.substring)}function $i(t,e,n){if(t.endsWith(e))return t.slice(0,-e.length);if(n)throw new Error(`String ${t} does not end with suffix ${e}`);return t}function Kn(t,e,n){if(t.startsWith(e))return t.slice(e.length);if(n)throw new Error(`String ${t} does not start with prefix ${e}`);return t}(function(){if(globalThis.process)return;let e={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=e})();var gy=/[a-zA-Z]:\/[^:]*$/,Tt=ta.default.posix,PA=Tt.delimiter,RA=ta.default.posix.sep,pe=Tt.basename,be=Tt.dirname,Se=Tt.extname,OA=Tt.format;var ke=Tt.join,DA=Tt.normalize,LA=Tt.parse,Jn=Tt.relative;function an(t,e){return e?`${t}.${e}`:t}function nc(...t){let e=Tt.resolve(...t);return e=wy(e),gy.exec(e)?.[0]??e}function wy(t){return Ae(t,"\\","/")}var jt=require("obsidian");(function(){if(globalThis.process)return;let e={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=e})();var ic="md",yy="canvas";function sc(t,e,n){if(ct(e))return e.extension===n;if(typeof e=="string"){let r=Ke(t,e);return r?r.extension===n:Se(e).slice(1)===n}return!1}function Tn(t,e,n){if(e===null)return null;if(oc(e))return e;let r=rc(t,e,n);if(r)return r;let s=lc(e);return s===e?null:rc(t,s,n)}function Le(t,e,n,r){let s=Ke(t,e,r);if(!s)if(n)s=qu(t,e);else throw new Error(`File not found: ${e}`);return s}function Ke(t,e,n){let r=Tn(t,e,n);return ct(r)?r:null}function Nr(t,e,n,r){let s=_t(t,e,r);if(!s)if(n)s=Di(t,e);else throw new Error(`Folder not found: ${e}`);return s}function _t(t,e,n){let r=Tn(t,e,n);return na(r)?r:null}function we(t,e){if(oc(e))return e.path;let n=Tn(t,e);return n?n.path:lc(e)}function oc(t){return t instanceof jt.TAbstractFile}function qt(t,e){return sc(t,e,yy)}function ct(t){return t instanceof jt.TFile}function na(t){return t instanceof jt.TFolder}function Gt(t,e){return sc(t,e,ic)}function Je(t,e){return Gt(t,e)||qt(t,e)}function ac(t,e){return Gt(t,e)?$i(e.path,`.${ic}`):e.path}function rc(t,e,n){return n?t.vault.getAbstractFileByPathInsensitive(e):t.vault.getAbstractFileByPath(e)}function lc(t){return(0,jt.normalizePath)(nc("/",t))}(function(){if(globalThis.process)return;let e={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=e})();async function by(t,e,n){let r=we(t,e),s=we(t,n),o=Le(t,s,!0),l=Se(r),u=pe(r,l),f=t.vault.getAvailablePathForAttachments;return f.isExtended?f(u,l.slice(1),o,!0):await ra(t,u,l.slice(1),o,!0)}async function Zn(t,e){return ut(await by(t,"DUMMY_FILE.pdf",e))}async function ra(t,e,n,r,s){let o=t.vault.getConfig("attachmentFolderPath"),l=o==="."||o==="./",u=null;o.startsWith("./")&&(u=Kn(o,"./")),l?o=r?r.parent?.path??"":"":u&&(o=(r?r.parent?.getParentPrefix()??"":"")+u),o=Mr(uc(o)),e=Mr(uc(e));let f=_t(t,o,!0);!f&&u&&(s?f=Nr(t,o,!0):f=await t.vault.createFolder(o));let h=f?.getParentPrefix()??"";return t.vault.getAvailablePath(h+e,n)}async function ia(t,e){let n=await Zn(t,e),r=await Zn(t,ke(be(e),"DUMMY_FILE.md"));return n!==r}function uc(t){return t=Ae(t,/(?:[\\/])+/g,"/"),t=Ae(t,/^\/+|\/+$/g,""),t||"/"}var hc=require("obsidian");(function(){if(globalThis.process)return;let e={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=e})();var B=(t=>(t.AlertModal="alert-modal",t.CancelButton="cancel-button",t.CheckboxComponent="checkbox-component",t.ConfirmModal="confirm-modal",t.DateComponent="date-component",t.DateTimeComponent="datetime-component",t.EmailComponent="email-component",t.FileComponent="file-component",t.LibraryName="obsidian-dev-utils",t.MonthComponent="month-component",t.MultipleDropdownComponent="multiple-dropdown-component",t.MultipleEmailComponent="multiple-email-component",t.MultipleFileComponent="multiple-file-component",t.MultipleTextComponent="multiple-text-component",t.NumberComponent="number-component",t.OkButton="ok-button",t.PluginSettingsTab="plugin-settings-tab",t.PromptModal="prompt-modal",t.SelectItemModal="select-item-modal",t.TextBox="text-box",t.TimeComponent="time-component",t.TriStateCheckboxComponent="tri-state-checkbox-component",t.TypedDropdownComponent="typed-dropdown-component",t.TypedMultipleDropdownComponent="typed-multiple-dropdown-component",t.UrlComponent="url-component",t.WeekComponent="week-component",t))(B||{});var dc=require("obsidian");(function(){if(globalThis.process)return;let e={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=e})();var sa="__no-plugin-id-initialized__",cc=sa;function xe(){return cc}function fc(t){t&&(cc=t)}(function(){if(globalThis.process)return;let e={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=e})();var ln=class extends dc.Modal{constructor(e,n,r){super(e.app),this.resolve=n,this.containerEl.addClass(B.LibraryName,xe(),r),e.cssClass&&this.containerEl.addClass(e.cssClass)}};async function Qn(t){return await new Promise(e=>{t(e).open()})}(function(){if(globalThis.process)return;let e={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=e})();var oa=class extends ln{options;constructor(e,n){super(e,n,B.AlertModal);let r={app:e.app,cssClass:"",message:e.message,okButtonText:"OK",title:""};this.options={...r,...e}}onClose(){super.onClose(),this.resolve()}onOpen(){super.onOpen(),this.titleEl.setText(this.options.title),this.contentEl.createEl("p",{text:this.options.message});let e=new hc.ButtonComponent(this.contentEl);e.setButtonText(this.options.okButtonText),e.setCta(),e.onClick(this.close.bind(this)),e.setClass(B.OkButton)}};async function mc(t){await Qn(e=>new oa(t,e))}function pc(t,e){let n=Object.keys(e).map(r=>ky(t,r,e[r]));return n.length===1?n[0]:function(){n.forEach(r=>r())}}function ky(t,e,n){let r=t[e],s=t.hasOwnProperty(e),o=s?r:function(){return Object.getPrototypeOf(t)[e].apply(this,arguments)},l=n(o);return r&&Object.setPrototypeOf(l,r),Object.setPrototypeOf(u,l),t[e]=u,f;function u(...h){return l===o&&t[e]===u&&f(),l.apply(this,h)}function f(){t[e]===u&&(s?t[e]=o:delete t[e]),l!==o&&(l=o,Object.setPrototypeOf(u,r||Function))}}(function(){if(globalThis.process)return;let e={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=e})();function gc(t,e){return pc(t,e)}async function wc(t,e,n){let r=gc(t,e);try{return await n()}finally{r()}}function Yi(t,e,n){let r=gc(e,n),s=!1;function o(){if(!s)try{r()}finally{s=!0}}return t.register(o),r}var Zi=require("obsidian");var ha=ze(Fc(),1);(function(){if(globalThis.process)return;let e={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=e})();var fa="26.1.2",Ui="obsidian-dev-utils",Ic=`.obsidian-dev-utils input[type=url] {
  height: var(--input-height);
}
.obsidian-dev-utils input[type=month],
.obsidian-dev-utils input[type=time],
.obsidian-dev-utils input[type=url],
.obsidian-dev-utils input[type=week] {
  -webkit-app-region: no-drag;
  background: var(--background-modifier-form-field);
  border: var(--input-border-width) solid var(--background-modifier-border);
  color: var(--text-normal);
  font-family: inherit;
  padding: var(--size-4-1) var(--size-4-2);
  font-size: var(--font-ui-small);
  border-radius: var(--input-radius);
  outline: none;
}
@media (hover: hover) {
  .obsidian-dev-utils input[type=month]:hover,
  .obsidian-dev-utils input[type=time]:hover,
  .obsidian-dev-utils input[type=url]:hover,
  .obsidian-dev-utils input[type=week]:hover {
    border-color: var(--background-modifier-border-hover);
    transition: box-shadow 0.15s ease-in-out, border 0.15s ease-in-out;
  }
}
.obsidian-dev-utils input[type=month]:active, .obsidian-dev-utils input[type=month]:focus,
.obsidian-dev-utils input[type=time]:active,
.obsidian-dev-utils input[type=time]:focus,
.obsidian-dev-utils input[type=url]:active,
.obsidian-dev-utils input[type=url]:focus,
.obsidian-dev-utils input[type=week]:active,
.obsidian-dev-utils input[type=week]:focus {
  border-color: var(--background-modifier-border-focus);
  transition: box-shadow 0.15s ease-in-out, border 0.15s ease-in-out;
}
.obsidian-dev-utils input[type=month]:active, .obsidian-dev-utils input[type=month]:focus, .obsidian-dev-utils input[type=month]:focus-visible,
.obsidian-dev-utils input[type=time]:active,
.obsidian-dev-utils input[type=time]:focus,
.obsidian-dev-utils input[type=time]:focus-visible,
.obsidian-dev-utils input[type=url]:active,
.obsidian-dev-utils input[type=url]:focus,
.obsidian-dev-utils input[type=url]:focus-visible,
.obsidian-dev-utils input[type=week]:active,
.obsidian-dev-utils input[type=week]:focus,
.obsidian-dev-utils input[type=week]:focus-visible {
  box-shadow: 0 0 0 2px var(--background-modifier-border-focus);
}
.obsidian-dev-utils input[type=month]::placeholder,
.obsidian-dev-utils input[type=time]::placeholder,
.obsidian-dev-utils input[type=url]::placeholder,
.obsidian-dev-utils input[type=week]::placeholder {
  color: var(--text-faint);
}
.mod-rtl input[type=month],
.mod-rtl input[type=time],
.mod-rtl input[type=week],
.is-rtl input[type=month],
.is-rtl input[type=time],
.is-rtl input[type=week],
.rtl input[type=month],
.rtl input[type=time],
.rtl input[type=week] {
  direction: rtl;
}
.mod-rtl input[type=month]::-webkit-calendar-picker-indicator,
.mod-rtl input[type=time]::-webkit-calendar-picker-indicator,
.mod-rtl input[type=week]::-webkit-calendar-picker-indicator,
.is-rtl input[type=month]::-webkit-calendar-picker-indicator,
.is-rtl input[type=time]::-webkit-calendar-picker-indicator,
.is-rtl input[type=week]::-webkit-calendar-picker-indicator,
.rtl input[type=month]::-webkit-calendar-picker-indicator,
.rtl input[type=time]::-webkit-calendar-picker-indicator,
.rtl input[type=week]::-webkit-calendar-picker-indicator {
  right: var(--size-4-1);
  left: auto;
}

.obsidian-dev-utils input[type=month],
.obsidian-dev-utils input[type=time],
.obsidian-dev-utils input[type=week] {
  font-variant-numeric: tabular-nums;
  position: relative;
}
.obsidian-dev-utils input[type=month]::-webkit-datetime-edit-text,
.obsidian-dev-utils input[type=time]::-webkit-datetime-edit-text,
.obsidian-dev-utils input[type=week]::-webkit-datetime-edit-text {
  color: var(--text-faint);
  padding-inline-end: 0;
}
.obsidian-dev-utils input[type=month]::-webkit-calendar-picker-indicator,
.obsidian-dev-utils input[type=time]::-webkit-calendar-picker-indicator,
.obsidian-dev-utils input[type=week]::-webkit-calendar-picker-indicator {
  position: absolute;
  left: var(--size-4-1);
  right: auto;
  opacity: 0.5;
}
.obsidian-dev-utils input[type=month]::-webkit-datetime-edit-month-field:active, .obsidian-dev-utils input[type=month]::-webkit-datetime-edit-month-field:focus, .obsidian-dev-utils input[type=month]::-webkit-datetime-edit-day-field:active, .obsidian-dev-utils input[type=month]::-webkit-datetime-edit-day-field:focus, .obsidian-dev-utils input[type=month]::-webkit-datetime-edit-year-field:active, .obsidian-dev-utils input[type=month]::-webkit-datetime-edit-year-field:focus,
.obsidian-dev-utils input[type=time]::-webkit-datetime-edit-month-field:active,
.obsidian-dev-utils input[type=time]::-webkit-datetime-edit-month-field:focus,
.obsidian-dev-utils input[type=time]::-webkit-datetime-edit-day-field:active,
.obsidian-dev-utils input[type=time]::-webkit-datetime-edit-day-field:focus,
.obsidian-dev-utils input[type=time]::-webkit-datetime-edit-year-field:active,
.obsidian-dev-utils input[type=time]::-webkit-datetime-edit-year-field:focus,
.obsidian-dev-utils input[type=week]::-webkit-datetime-edit-month-field:active,
.obsidian-dev-utils input[type=week]::-webkit-datetime-edit-month-field:focus,
.obsidian-dev-utils input[type=week]::-webkit-datetime-edit-day-field:active,
.obsidian-dev-utils input[type=week]::-webkit-datetime-edit-day-field:focus,
.obsidian-dev-utils input[type=week]::-webkit-datetime-edit-year-field:active,
.obsidian-dev-utils input[type=week]::-webkit-datetime-edit-year-field:focus {
  background-color: var(--text-selection);
  color: var(--text-normal);
  cursor: text;
}
.mod-rtl .obsidian-dev-utils input[type=month], .is-rtl .obsidian-dev-utils input[type=month], .rtl .obsidian-dev-utils input[type=month],
.mod-rtl .obsidian-dev-utils input[type=time],
.is-rtl .obsidian-dev-utils input[type=time],
.rtl .obsidian-dev-utils input[type=time],
.mod-rtl .obsidian-dev-utils input[type=week],
.is-rtl .obsidian-dev-utils input[type=week],
.rtl .obsidian-dev-utils input[type=week] {
  direction: rtl;
}
.mod-rtl .obsidian-dev-utils input[type=month]::-webkit-calendar-picker-indicator, .is-rtl .obsidian-dev-utils input[type=month]::-webkit-calendar-picker-indicator, .rtl .obsidian-dev-utils input[type=month]::-webkit-calendar-picker-indicator,
.mod-rtl .obsidian-dev-utils input[type=time]::-webkit-calendar-picker-indicator,
.is-rtl .obsidian-dev-utils input[type=time]::-webkit-calendar-picker-indicator,
.rtl .obsidian-dev-utils input[type=time]::-webkit-calendar-picker-indicator,
.mod-rtl .obsidian-dev-utils input[type=week]::-webkit-calendar-picker-indicator,
.is-rtl .obsidian-dev-utils input[type=week]::-webkit-calendar-picker-indicator,
.rtl .obsidian-dev-utils input[type=week]::-webkit-calendar-picker-indicator {
  left: auto;
  right: var(--size-4-1);
}

body:not(.is-ios):not(.is-android) .obsidian-dev-utils input[type=month],
body:not(.is-ios):not(.is-android) .obsidian-dev-utils input[type=time],
body:not(.is-ios):not(.is-android) .obsidian-dev-utils input[type=week] {
  padding-inline-start: var(--size-4-6);
}

.obsidian-dev-utils input[type=time]::-webkit-calendar-picker-indicator {
  margin-inline-start: 0;
}

.obsidian-dev-utils.modal-container .ok-button {
  margin-right: 10px;
  margin-top: 20px;
}

.obsidian-dev-utils .multiple-dropdown-component select,
.obsidian-dev-utils .multiple-dropdown-component select:focus,
.obsidian-dev-utils .multiple-dropdown-component .dropdown {
  height: auto;
  padding-top: 3px;
}
.obsidian-dev-utils .multiple-dropdown-component select option:checked,
.obsidian-dev-utils .multiple-dropdown-component select:focus option:checked,
.obsidian-dev-utils .multiple-dropdown-component .dropdown option:checked {
  background-color: #1967d2;
  color: #fff;
}

.obsidian-dev-utils.prompt-modal .text-box {
  width: 100%;
}

.obsidian-dev-utils.tri-state-checkbox-component input[type=checkbox]:indeterminate {
  appearance: checkbox;
}

.obsidian-dev-utils :invalid {
  box-shadow: 0 0 0 2px var(--text-error);
}

/*# sourceMappingURL=data:application/json;charset=utf-8,%7B%22version%22:3,%22sourceRoot%22:%22%22,%22sources%22:%5B%22../src/styles/input.scss%22,%22../src/styles/input-time.scss%22,%22../src/styles/modal-container.scss%22,%22../src/styles/multiple-dropdown-component.scss%22,%22../src/styles/prompt-modal.scss%22,%22../src/styles/tri-state-checkbox-component.scss%22,%22../src/styles/validation.scss%22%5D,%22names%22:%5B%5D,%22mappings%22:%22AACE;EACE;;AAGF;AAAA;AAAA;AAAA;EAIE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAGE;EACE;AAAA;AAAA;AAAA;IACE;IACA,YACE;;;AAMR;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;EAEE;EACA,YACE;;AAIJ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;EAGE;;AAGF;AAAA;AAAA;AAAA;EACE;;AASE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;EAGE;;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;EACE;EACA;;;AC5DV;AAAA;AAAA;EAGE;EACA;;AAEA;AAAA;AAAA;EACE;EACA;;AAGF;AAAA;AAAA;EACE;EACA;EACA;EACA;;AAMA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;EAEE;EACA;EACA;;AAIK;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;EAGP;;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;EACE;EACA;;;AAKF;AAAA;AAAA;EACE;;;AAMJ;EACE;;;AChDF;EACE;EACA;;;ACFF;AAAA;AAAA;EAGE;EACA;;AAEA;AAAA;AAAA;EACE;EACA;;;ACRJ;EACE;;;ACDF;EACE;;;ACFJ;EACE%22,%22file%22:%22styles.css%22,%22sourcesContent%22:%5B%22.obsidian-dev-utils%20%7B%5Cn%20%20input%5Btype='url'%5D%20%7B%5Cn%20%20%20%20height:%20var(--input-height)%5Cn%20%20%7D%5Cn%5Cn%20%20input%5Btype='month'%5D,%5Cn%20%20input%5Btype='time'%5D,%5Cn%20%20input%5Btype='url'%5D,%5Cn%20%20input%5Btype='week'%5D%20%7B%5Cn%20%20%20%20-webkit-app-region:%20no-drag;%5Cn%20%20%20%20background:%20var(--background-modifier-form-field);%5Cn%20%20%20%20border:%20var(--input-border-width)%20solid%20var(--background-modifier-border);%5Cn%20%20%20%20color:%20var(--text-normal);%5Cn%20%20%20%20font-family:%20inherit;%5Cn%20%20%20%20padding:%20var(--size-4-1)%20var(--size-4-2);%5Cn%20%20%20%20font-size:%20var(--font-ui-small);%5Cn%20%20%20%20border-radius:%20var(--input-radius);%5Cn%20%20%20%20outline:%20none;%5Cn%5Cn%20%20%20%20@at-root%20%7B%5Cn%20%20%20%20%20%20@media%20(hover:%20hover)%20%7B%5Cn%20%20%20%20%20%20%20%20&:hover%20%7B%5Cn%20%20%20%20%20%20%20%20%20%20border-color:%20var(--background-modifier-border-hover);%5Cn%20%20%20%20%20%20%20%20%20%20transition:%5Cn%20%20%20%20%20%20%20%20%20%20%20%20box-shadow%200.15s%20ease-in-out,%5Cn%20%20%20%20%20%20%20%20%20%20%20%20border%200.15s%20ease-in-out;%5Cn%20%20%20%20%20%20%20%20%7D%5Cn%20%20%20%20%20%20%7D%5Cn%20%20%20%20%7D%5Cn%5Cn%20%20%20%20&:active,%5Cn%20%20%20%20&:focus%20%7B%5Cn%20%20%20%20%20%20border-color:%20var(--background-modifier-border-focus);%5Cn%20%20%20%20%20%20transition:%5Cn%20%20%20%20%20%20%20%20box-shadow%200.15s%20ease-in-out,%5Cn%20%20%20%20%20%20%20%20border%200.15s%20ease-in-out;%5Cn%20%20%20%20%7D%5Cn%5Cn%20%20%20%20&:active,%5Cn%20%20%20%20&:focus,%5Cn%20%20%20%20&:focus-visible%20%7B%5Cn%20%20%20%20%20%20box-shadow:%200%200%200%202px%20var(--background-modifier-border-focus);%5Cn%20%20%20%20%7D%5Cn%5Cn%20%20%20%20&::placeholder%20%7B%5Cn%20%20%20%20%20%20color:%20var(--text-faint);%5Cn%20%20%20%20%7D%5Cn%20%20%7D%5Cn%5Cn%20%20@at-root%20%7B%5Cn%20%20%20%20.mod-rtl,%5Cn%20%20%20%20.is-rtl,%5Cn%20%20%20%20.rtl%20%7B%5Cn%20%20%20%20%20%20&%20%7B%5Cn%20%20%20%20%20%20%20%20input%5Btype='month'%5D,%5Cn%20%20%20%20%20%20%20%20input%5Btype='time'%5D,%5Cn%20%20%20%20%20%20%20%20input%5Btype='week'%5D%20%7B%5Cn%20%20%20%20%20%20%20%20%20%20direction:%20rtl;%5Cn%5Cn%20%20%20%20%20%20%20%20%20%20&::-webkit-calendar-picker-indicator%20%7B%5Cn%20%20%20%20%20%20%20%20%20%20%20%20right:%20var(--size-4-1);%5Cn%20%20%20%20%20%20%20%20%20%20%20%20left:%20auto;%5Cn%20%20%20%20%20%20%20%20%20%20%7D%5Cn%20%20%20%20%20%20%20%20%7D%5Cn%20%20%20%20%20%20%7D%5Cn%20%20%20%20%7D%5Cn%20%20%7D%5Cn%7D%5Cn%22,%22.obsidian-dev-utils%20%7B%5Cn%20%20input%5Btype='month'%5D,%5Cn%20%20input%5Btype='time'%5D,%5Cn%20%20input%5Btype='week'%5D%20%7B%5Cn%20%20%20%20font-variant-numeric:%20tabular-nums;%5Cn%20%20%20%20position:%20relative;%5Cn%5Cn%20%20%20%20&::-webkit-datetime-edit-text%20%7B%5Cn%20%20%20%20%20%20color:%20var(--text-faint);%5Cn%20%20%20%20%20%20padding-inline-end:%200;%5Cn%20%20%20%20%7D%5Cn%5Cn%20%20%20%20&::-webkit-calendar-picker-indicator%20%7B%5Cn%20%20%20%20%20%20position:%20absolute;%5Cn%20%20%20%20%20%20left:%20var(--size-4-1);%5Cn%20%20%20%20%20%20right:%20auto;%5Cn%20%20%20%20%20%20opacity:%200.5;%5Cn%20%20%20%20%7D%5Cn%5Cn%20%20%20%20&::-webkit-datetime-edit-month-field,%5Cn%20%20%20%20&::-webkit-datetime-edit-day-field,%5Cn%20%20%20%20&::-webkit-datetime-edit-year-field%20%7B%5Cn%20%20%20%20%20%20&:active,%5Cn%20%20%20%20%20%20&:focus%20%7B%5Cn%20%20%20%20%20%20%20%20background-color:%20var(--text-selection);%5Cn%20%20%20%20%20%20%20%20color:%20var(--text-normal);%5Cn%20%20%20%20%20%20%20%20cursor:%20text;%5Cn%20%20%20%20%20%20%7D%5Cn%20%20%20%20%7D%5Cn%5Cn%20%20%20%20@at-root%20.mod-rtl%20&,%5Cn%20%20%20%20%20%20.is-rtl%20&,%5Cn%20%20%20%20%20%20.rtl%20&%20%7B%5Cn%20%20%20%20%20%20direction:%20rtl;%5Cn%5Cn%20%20%20%20%20%20&::-webkit-calendar-picker-indicator%20%7B%5Cn%20%20%20%20%20%20%20%20left:%20auto;%5Cn%20%20%20%20%20%20%20%20right:%20var(--size-4-1);%5Cn%20%20%20%20%20%20%7D%5Cn%20%20%20%20%7D%5Cn%5Cn%20%20%20%20@at-root%20%7B%5Cn%20%20%20%20%20%20body:not(.is-ios):not(.is-android)%20&%20%7B%5Cn%20%20%20%20%20%20%20%20padding-inline-start:%20var(--size-4-6);%5Cn%20%20%20%20%20%20%7D%5Cn%20%20%20%20%7D%5Cn%20%20%7D%5Cn%5Cn%20%20input%5Btype='time'%5D%20%7B%5Cn%20%20%20%20&::-webkit-calendar-picker-indicator%20%7B%5Cn%20%20%20%20%20%20margin-inline-start:%200;%5Cn%20%20%20%20%7D%5Cn%20%20%7D%5Cn%7D%5Cn%22,%22.obsidian-dev-utils%20%7B%5Cn%20%20&.modal-container%20%7B%5Cn%20%20%20%20.ok-button%20%7B%5Cn%20%20%20%20%20%20margin-right:%2010px;%5Cn%20%20%20%20%20%20margin-top:%2020px;%5Cn%20%20%20%20%7D%5Cn%20%20%7D%5Cn%7D%5Cn%22,%22.obsidian-dev-utils%20%7B%5Cn%20%20.multiple-dropdown-component%20%7B%5Cn%20%20%20%20select,%5Cn%20%20%20%20select:focus,%5Cn%20%20%20%20.dropdown%20%7B%5Cn%20%20%20%20%20%20height:%20auto;%5Cn%20%20%20%20%20%20padding-top:%203px;%5Cn%5Cn%20%20%20%20%20%20option:checked%20%7B%5Cn%20%20%20%20%20%20%20%20background-color:%20%231967d2;%5Cn%20%20%20%20%20%20%20%20color:%20%23fff;%5Cn%20%20%20%20%20%20%7D%5Cn%20%20%20%20%7D%5Cn%20%20%7D%5Cn%7D%5Cn%22,%22.obsidian-dev-utils%20%7B%5Cn%20%20&.prompt-modal%20%7B%5Cn%20%20%20%20.text-box%20%7B%5Cn%20%20%20%20%20%20width:%20100%25;%5Cn%20%20%20%20%7D%5Cn%20%20%7D%5Cn%7D%5Cn%22,%22.obsidian-dev-utils%20%7B%5Cr%5Cn%20%20&.tri-state-checkbox-component%20%7B%5Cr%5Cn%20%20%20%20input%5Btype='checkbox'%5D:indeterminate%20%7B%5Cr%5Cn%20%20%20%20%20%20appearance:%20checkbox;%5Cr%5Cn%20%20%20%20%7D%5Cr%5Cn%20%20%7D%5Cr%5Cn%7D%5Cr%5Cn%22,%22.obsidian-dev-utils%20%7B%5Cn%20%20:invalid%20%7B%5Cn%20%20%20%20box-shadow:%200%200%200%202px%20var(--text-error);%5Cn%20%20%7D%5Cn%7D%5Cn%22%5D%7D */
`;(function(){if(globalThis.process)return;let e={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=e})();function Xt(){}async function it(){}(function(){if(globalThis.process)return;let e={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=e})();var da=class{constructor(e){this.value=e}};function Pc(){try{return globalThis.require("obsidian/app")}catch{return globalThis.app??Ht(new Error("Obsidian app not found"))}}function cn(t,e,n){let r=t;return r.obsidianDevUtilsState??={},r.obsidianDevUtilsState[e]??=new da(n)}(function(){if(globalThis.process)return;let e={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=e})();var Rc=",",Hi="-";function Oc(){return{disable:zy,enable:Uy,get:qi,set:$r}}function ji(t,e=0){let n=rr()(t);return n.log=(r,...s)=>{Hy(t,e,r,...s)},n.printStackTrace=(r,s)=>{Mc(t,r,s)},n}function Ze(t){let e=xe(),n=e===sa?"":`${e}:`;return ji(`${n}${Ui}:${t}`)}function Dc(t){let e=rr().enabled(t),n=e?"enabled":"disabled",r=e?"disable":"enable",s=qi();$r(t),ji(t)(`Debug messages for plugin ${t} are ${n}. See https://github.com/mnaoumov/obsidian-dev-utils/?tab=readme-ov-file#debugging how to ${r} them.`),$r(s)}function zy(t){let e=new Set(qi());for(let n of Yr(t)){if(n.startsWith(Hi))continue;let r=Hi+n;e.has(n)&&e.delete(n),e.add(r)}$r(Array.from(e))}function Uy(t){let e=new Set(qi());for(let n of Yr(t)){if(!n.startsWith(Hi)){let r=Hi+n;e.has(r)&&e.delete(r)}e.add(n)}$r(Array.from(e))}function qi(){return Yr(rr().load()??"")}function rr(){if(typeof window>"u")return ha.default;let t=Pc();return cn(t,"debug",ha.default).value}function Lc(){return typeof window<"u"}function Hy(t,e,n,...r){if(!rr().enabled(t))return;let l=(new Error().stack?.split(`
`)??[])[4+e]??"";console.debug(n,...r),Lc()&&Mc(t,l,"Debug message caller")}function Mc(t,e,n){let r=rr()(t);if(!r.enabled)return;e||(e="(unavailable)"),(n??"")||(n="Caller stack trace"),r(n);let s=Lc()?`StackTraceFakeError
`:"";console.debug(`${s}${e}`)}function $r(t){rr().enable(Yr(t).join(Rc))}function Yr(t){return typeof t=="string"?t.split(Rc).filter(Boolean):t.flatMap(Yr)}(function(){if(globalThis.process)return;let e={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=e})();async function ma(t){let e=new Error(Mi);try{await t()}catch(n){e.cause=n,Ni(e)}}function fn(t){return(...e)=>{Kt(()=>t(...e))}}function Kt(t){ma(t)}function Nc(t,e=0){setTimeout(fn(async()=>await t()),e)}async function Br(t,e,n){let r=Ze("Async:retryWithTimeout");n??=An(1);let o={...{retryDelayInMilliseconds:100,shouldRetryOnError:!1,timeoutInMilliseconds:5e3},...e};await pa(o.timeoutInMilliseconds,async()=>{let l=0;for(;;){o.abortSignal?.throwIfAborted(),l++;let u;try{u=await t()}catch(f){if(!o.shouldRetryOnError||f.__terminateRetry)throw f;Lr(f),u=!1}if(u){l>1&&(r(`Retry completed successfully after ${l.toString()} attempts`),r.printStackTrace(n));return}r(`Retry attempt ${l.toString()} completed unsuccessfully. Trying again in ${o.retryDelayInMilliseconds.toString()} milliseconds`,{fn:t}),r.printStackTrace(n),await $c(o.retryDelayInMilliseconds)}})}async function pa(t,e){let n=!0,r=null,s=performance.now();if(await Promise.race([o(),l()]),n)throw new Error("Timed out");return r;async function o(){r=await e(),n=!1;let u=performance.now()-s;Ze("Async:runWithTimeout")(`Execution time: ${u.toString()} milliseconds`,{fn:e})}async function l(){if(!n||(await $c(t),!n))return;let u=performance.now()-s;console.warn(`Timed out in ${u.toString()} milliseconds`,{fn:e});let f=Ze("Async:runWithTimeout:timeout");f.enabled&&(f(`The execution is not terminated because debugger ${f.namespace} is enabled. See https://github.com/mnaoumov/obsidian-dev-utils/?tab=readme-ov-file#debugging for more information`),await l())}}async function $c(t){await new Promise(e=>{setTimeout(e,t)})}var Yc=require("obsidian");(function(){if(globalThis.process)return;let e={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=e})();var Gi=class extends Yc.Component{registerAsyncEvent(e){Xi(this,e)}};function Xi(t,e){t.register(()=>{e.asyncEvents.offref(e)})}var zc=ze(Vc(),1);(function(){if(globalThis.process)return;let e={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=e})();var Wc=`${Ui}-styles`;function Uc(t,e){fc(e),Dc(e);let n=cn(t,"lastLibraryVersion","0.0.0");if((0,zc.compareVersions)(fa,n.value)<=0)return;n.value=fa;let r=jy();r.DEBUG=Oc(),document.head.querySelector(`#${Wc}`)?.remove(),document.head.createEl("style",{attr:{id:Wc},text:Ic})}function jy(){return window}(function(){if(globalThis.process)return;let e={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=e})();var Ji=class extends Zi.Plugin{events=new St;get abortSignal(){return this._abortSignal}get settings(){return this.settingsManager.settingsWrapper.safeSettings}get settingsManager(){if(!this._settingsManager)throw new Error("Settings manager not defined");return this._settingsManager}get settingsTab(){if(!this._settingsTab)throw new Error("Settings tab not defined");return this._settingsTab}_abortSignal;_settingsManager=null;_settingsTab=null;lifecycleEventNames=new Set;notice;consoleDebug(e,...n){ji(this.manifest.id,1)(e,...n)}async onExternalSettingsChange(){await super.onExternalSettingsChange?.(),await this._settingsManager?.loadFromFile(!1)}async onload(){await super.onload(),await this.onloadImpl(),Nc(this.afterLoad.bind(this))}onunload(){super.onunload(),Kt(async()=>{try{await this.onunloadImpl()}finally{await this.triggerLifecycleEvent("unload")}})}async waitForLifecycleEvent(e){this.lifecycleEventNames.has(e)||await new Promise(n=>{this.events.once(e,()=>{n()})})}createSettingsManager(){return null}createSettingsTab(){return null}async onLayoutReady(){await it()}async onloadImpl(){Uc(this.app,this.manifest.id),this.register(Zu(()=>{this.showNotice("An unhandled error occurred. Please check the console for more information.")})),this._settingsManager=this.createSettingsManager(),this._settingsManager&&(Xi(this,this._settingsManager.on("loadSettings",this.onLoadSettings.bind(this))),Xi(this,this._settingsManager.on("saveSettings",this.onSaveSettings.bind(this)))),await this._settingsManager?.loadFromFile(!0),this._settingsTab=this.createSettingsTab(),this._settingsTab&&this.addSettingTab(this._settingsTab);let e=new AbortController;this._abortSignal=e.signal,this.register(()=>{e.abort()})}async onLoadSettings(e,n){await it()}async onSaveSettings(e,n,r){await it()}async onunloadImpl(){await it()}showNotice(e){this.notice&&this.notice.hide(),this.notice=new Zi.Notice(`${this.manifest.name}
${e}`)}async afterLoad(){await this.triggerLifecycleEvent("load"),this.app.workspace.onLayoutReady(fn(this.onLayoutReadyBase.bind(this)))}async onLayoutReadyBase(){try{await this.onLayoutReady()}finally{await this.triggerLifecycleEvent("layoutReady")}}async triggerLifecycleEvent(e){this.lifecycleEventNames.add(e),await this.events.triggerAsync(e)}};var Hd=require("obsidian");(function(){if(globalThis.process)return;let e={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=e})();var Hc=".";function dn(t,e){if(t===e)return!0;if(typeof t!="object"||typeof e!="object"||t===null||e===null)return!1;let n=ir(t),r=ir(e);if(n.length!==r.length)return!1;let s=t,o=e;for(let l of n)if(!r.includes(l)||!dn(s[l],o[l]))return!1;return!0}function ir(t){let e=[],n=t;for(;n;){let r=Object.getOwnPropertyDescriptors(n);for(let[s,o]of Object.entries(r)){if(s==="__proto__"||typeof o.value=="function")continue;let l=typeof o.get=="function",u=typeof o.set=="function";if(l||u){l&&u&&e.push(s);continue}o.enumerable&&o.writable&&e.push(s)}n=Object.getPrototypeOf(n)}return e.sort()}function sr(t,e){let n=t,r=e.split(Hc);for(let s of r){if(n===void 0)return;n=n[s]}return n}function jc(t,e,n){let r=new Error(`Property path ${e} not found`),s=t,o=e.split(Hc);for(let u of o.slice(0,-1)){if(s===void 0)throw r;s=s[u]}let l=o.at(-1);if(s===void 0||l===void 0)throw r;s[l]=n}function or(t,e={}){let n={functionHandlingMode:"exclude",maxDepth:-1,shouldCatchToJSONErrors:!1,shouldHandleCircularReferences:!1,shouldHandleErrors:!1,shouldHandleUndefined:!1,shouldSortKeys:!1,space:2,tokenSubstitutions:{circularReference:ga("CircularReference"),maxDepthLimitReached:ga("MaxDepthLimitReached"),toJSONFailed:ga("ToJSONFailed")}},r={...n,...e,tokenSubstitutions:{...n.tokenSubstitutions,...e.tokenSubstitutions}};r.maxDepth===-1&&(r.maxDepth=1/0);let s=[],l=Qi(t,"",0,!0,r,s,new WeakSet),u=JSON.stringify(l,null,r.space)??"";return u=Ae(u,/"\[\[(?<Key>[A-Za-z]+)(?<Index>\d*)\]\]"/g,(f,h,m)=>qy({functionTexts:s,index:m?parseInt(m,10):0,key:h,substitutions:r.tokenSubstitutions})),u}function qy(t){switch(t.key){case"CircularReference":return t.substitutions.circularReference;case"Function":return t.functionTexts[t.index]??Ht(new Error(`Function with index ${t.index.toString()} not found`));case"MaxDepthLimitReached":return t.substitutions.maxDepthLimitReached;case"MaxDepthLimitReachedArray":return`Array(${t.index.toString()})`;case"ToJSONFailed":return t.substitutions.toJSONFailed;case"Undefined":return"undefined";default:break}}function Gy(t,e,n,r,s,o){return e>r.maxDepth?ar("MaxDepthLimitReachedArray",t.length):t.map((l,u)=>Qi(l,u.toString(),e+1,n,r,s,o))}function Xy(t,e,n){if(n.shouldHandleCircularReferences)return ar("CircularReference");let r=t.constructor.name||"Object";throw new TypeError(`Converting circular structure to JSON
--> starting at object with constructor '${r}'
--- property '${e}' closes the circle`)}function Ky(t,e,n){if(n.functionHandlingMode==="exclude")return;let r=e.length,s=n.functionHandlingMode==="full"?t.toString():`function ${t.name||"anonymous"}() { /* ... */ }`;return e.push(s),ar("Function",r)}function Jy(t,e,n,r,s,o,l){if(l.has(t))return Xy(t,e,s);if(l.add(t),r){let u=Qy(t,e,n,s,o,l);if(u!==void 0)return u}return Array.isArray(t)?Gy(t,n,r,s,o,l):n>s.maxDepth?ar("MaxDepthLimitReached"):t instanceof Error&&s.shouldHandleErrors?Ju(t):Zy(t,n,r,s,o,l)}function Zy(t,e,n,r,s,o){let l=Object.entries(t);return r.shouldSortKeys&&l.sort(([u],[f])=>u.localeCompare(f)),Object.fromEntries(l.map(([u,f])=>[u,Qi(f,u,e+1,n,r,s,o)]))}function ga(t){return`{ "[[${t}]]": null }`}function ar(t,e){return`[[${t}${e?.toString()??""}]]`}function Qi(t,e,n,r,s,o,l){return t===void 0?n===0||s.shouldHandleUndefined?ar("Undefined"):void 0:typeof t=="function"?Ky(t,o,s):typeof t!="object"||t===null?t:Jy(t,e,n,r,s,o,l)}function Qy(t,e,n,r,s,o){let l=t.toJSON;if(typeof l=="function")try{let u=l.call(t,e);return Qi(u,e,n,!1,r,s,o)}catch(u){if(r.shouldCatchToJSONErrors)return ar("ToJSONFailed");throw u}}var Fs=require("obsidian");var eb={};function Fn(t,e){let n=e||eb,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,s=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return Gc(t,r,s)}function Gc(t,e,n){if(tb(t)){if("value"in t)return t.type==="html"&&!n?"":t.value;if(e&&"alt"in t&&t.alt)return t.alt;if("children"in t)return qc(t.children,e,n)}return Array.isArray(t)?qc(t,e,n):""}function qc(t,e,n){let r=[],s=-1;for(;++s<t.length;)r[s]=Gc(t[s],e,n);return r.join("")}function tb(t){return!!(t&&typeof t=="object")}var Xc=document.createElement("i");function lr(t){let e="&"+t+";";Xc.innerHTML=e;let n=Xc.textContent;return n.charCodeAt(n.length-1)===59&&t!=="semi"||n===e?!1:n}function Ie(t,e,n,r){let s=t.length,o=0,l;if(e<0?e=-e>s?0:s+e:e=e>s?s:e,n=n>0?n:0,r.length<1e4)l=Array.from(r),l.unshift(e,n),t.splice(...l);else for(n&&t.splice(e,n);o<r.length;)l=r.slice(o,o+1e4),l.unshift(e,0),t.splice(...l),o+=1e4,e+=1e4}function Ue(t,e){return t.length>0?(Ie(t,t.length,0,e),t):e}var Kc={}.hasOwnProperty;function Jc(t){let e={},n=-1;for(;++n<t.length;)nb(e,t[n]);return e}function nb(t,e){let n;for(n in e){let s=(Kc.call(t,n)?t[n]:void 0)||(t[n]={}),o=e[n],l;if(o)for(l in o){Kc.call(s,l)||(s[l]=[]);let u=o[l];rb(s[l],Array.isArray(u)?u:u?[u]:[])}}}function rb(t,e){let n=-1,r=[];for(;++n<e.length;)(e[n].add==="after"?t:r).push(e[n]);Ie(t,0,0,r)}function es(t,e){let n=Number.parseInt(t,e);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"\uFFFD":String.fromCodePoint(n)}function Jt(t){return t.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}var st=hn(/[A-Za-z]/),He=hn(/[\dA-Za-z]/),Zc=hn(/[#-'*+\--9=?A-Z^-~]/);function Vr(t){return t!==null&&(t<32||t===127)}var Wr=hn(/\d/),Qc=hn(/[\dA-Fa-f]/),ef=hn(/[!-/:-@[-`{-~]/);function $(t){return t!==null&&t<-2}function ye(t){return t!==null&&(t<0||t===32)}function q(t){return t===-2||t===-1||t===32}var tf=hn(/\p{P}|\p{S}/u),nf=hn(/\s/);function hn(t){return e;function e(n){return n!==null&&n>-1&&t.test(String.fromCharCode(n))}}function G(t,e,n,r){let s=r?r-1:Number.POSITIVE_INFINITY,o=0;return l;function l(f){return q(f)?(t.enter(n),u(f)):e(f)}function u(f){return q(f)&&o++<s?(t.consume(f),u):(t.exit(n),e(f))}}var rf={tokenize:ib};function ib(t){let e=t.attempt(this.parser.constructs.contentInitial,r,s),n;return e;function r(u){if(u===null){t.consume(u);return}return t.enter("lineEnding"),t.consume(u),t.exit("lineEnding"),G(t,e,"linePrefix")}function s(u){return t.enter("paragraph"),o(u)}function o(u){let f=t.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=f),n=f,l(u)}function l(u){if(u===null){t.exit("chunkText"),t.exit("paragraph"),t.consume(u);return}return $(u)?(t.consume(u),t.exit("chunkText"),o):(t.consume(u),l)}}var of={tokenize:sb},sf={tokenize:ob};function sb(t){let e=this,n=[],r=0,s,o,l;return u;function u(I){if(r<n.length){let W=n[r];return e.containerState=W[1],t.attempt(W[0].continuation,f,h)(I)}return h(I)}function f(I){if(r++,e.containerState._closeFlow){e.containerState._closeFlow=void 0,s&&_();let W=e.events.length,H=W,A;for(;H--;)if(e.events[H][0]==="exit"&&e.events[H][1].type==="chunkFlow"){A=e.events[H][1].end;break}C(r);let te=W;for(;te<e.events.length;)e.events[te][1].end={...A},te++;return Ie(e.events,H+1,0,e.events.slice(W)),e.events.length=te,h(I)}return u(I)}function h(I){if(r===n.length){if(!s)return g(I);if(s.currentConstruct&&s.currentConstruct.concrete)return E(I);e.interrupt=!!(s.currentConstruct&&!s._gfmTableDynamicInterruptHack)}return e.containerState={},t.check(sf,m,p)(I)}function m(I){return s&&_(),C(r),g(I)}function p(I){return e.parser.lazy[e.now().line]=r!==n.length,l=e.now().offset,E(I)}function g(I){return e.containerState={},t.attempt(sf,w,E)(I)}function w(I){return r++,n.push([e.currentConstruct,e.containerState]),g(I)}function E(I){if(I===null){s&&_(),C(0),t.consume(I);return}return s=s||e.parser.flow(e.now()),t.enter("chunkFlow",{_tokenizer:s,contentType:"flow",previous:o}),F(I)}function F(I){if(I===null){T(t.exit("chunkFlow"),!0),C(0),t.consume(I);return}return $(I)?(t.consume(I),T(t.exit("chunkFlow")),r=0,e.interrupt=void 0,u):(t.consume(I),F)}function T(I,W){let H=e.sliceStream(I);if(W&&H.push(null),I.previous=o,o&&(o.next=I),o=I,s.defineSkip(I.start),s.write(H),e.parser.lazy[I.start.line]){let A=s.events.length;for(;A--;)if(s.events[A][1].start.offset<l&&(!s.events[A][1].end||s.events[A][1].end.offset>l))return;let te=e.events.length,K=te,J,oe;for(;K--;)if(e.events[K][0]==="exit"&&e.events[K][1].type==="chunkFlow"){if(J){oe=e.events[K][1].end;break}J=!0}for(C(r),A=te;A<e.events.length;)e.events[A][1].end={...oe},A++;Ie(e.events,K+1,0,e.events.slice(te)),e.events.length=A}}function C(I){let W=n.length;for(;W-- >I;){let H=n[W];e.containerState=H[1],H[0].exit.call(e,t)}n.length=I}function _(){s.write([null]),o=void 0,s=void 0,e.containerState._closeFlow=void 0}}function ob(t,e,n){return G(t,t.attempt(this.parser.constructs.document,e,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function ur(t){if(t===null||ye(t)||nf(t))return 1;if(tf(t))return 2}function cr(t,e,n){let r=[],s=-1;for(;++s<t.length;){let o=t[s].resolveAll;o&&!r.includes(o)&&(e=o(e,n),r.push(o))}return e}var zr={name:"attention",resolveAll:ab,tokenize:lb};function ab(t,e){let n=-1,r,s,o,l,u,f,h,m;for(;++n<t.length;)if(t[n][0]==="enter"&&t[n][1].type==="attentionSequence"&&t[n][1]._close){for(r=n;r--;)if(t[r][0]==="exit"&&t[r][1].type==="attentionSequence"&&t[r][1]._open&&e.sliceSerialize(t[r][1]).charCodeAt(0)===e.sliceSerialize(t[n][1]).charCodeAt(0)){if((t[r][1]._close||t[n][1]._open)&&(t[n][1].end.offset-t[n][1].start.offset)%3&&!((t[r][1].end.offset-t[r][1].start.offset+t[n][1].end.offset-t[n][1].start.offset)%3))continue;f=t[r][1].end.offset-t[r][1].start.offset>1&&t[n][1].end.offset-t[n][1].start.offset>1?2:1;let p={...t[r][1].end},g={...t[n][1].start};af(p,-f),af(g,f),l={type:f>1?"strongSequence":"emphasisSequence",start:p,end:{...t[r][1].end}},u={type:f>1?"strongSequence":"emphasisSequence",start:{...t[n][1].start},end:g},o={type:f>1?"strongText":"emphasisText",start:{...t[r][1].end},end:{...t[n][1].start}},s={type:f>1?"strong":"emphasis",start:{...l.start},end:{...u.end}},t[r][1].end={...l.start},t[n][1].start={...u.end},h=[],t[r][1].end.offset-t[r][1].start.offset&&(h=Ue(h,[["enter",t[r][1],e],["exit",t[r][1],e]])),h=Ue(h,[["enter",s,e],["enter",l,e],["exit",l,e],["enter",o,e]]),h=Ue(h,cr(e.parser.constructs.insideSpan.null,t.slice(r+1,n),e)),h=Ue(h,[["exit",o,e],["enter",u,e],["exit",u,e],["exit",s,e]]),t[n][1].end.offset-t[n][1].start.offset?(m=2,h=Ue(h,[["enter",t[n][1],e],["exit",t[n][1],e]])):m=0,Ie(t,r-1,n-r+3,h),n=r+h.length-m-2;break}}for(n=-1;++n<t.length;)t[n][1].type==="attentionSequence"&&(t[n][1].type="data");return t}function lb(t,e){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,s=ur(r),o;return l;function l(f){return o=f,t.enter("attentionSequence"),u(f)}function u(f){if(f===o)return t.consume(f),u;let h=t.exit("attentionSequence"),m=ur(f),p=!m||m===2&&s||n.includes(f),g=!s||s===2&&m||n.includes(r);return h._open=!!(o===42?p:p&&(s||!g)),h._close=!!(o===42?g:g&&(m||!p)),e(f)}}function af(t,e){t.column+=e,t.offset+=e,t._bufferIndex+=e}var wa={name:"autolink",tokenize:ub};function ub(t,e,n){let r=0;return s;function s(w){return t.enter("autolink"),t.enter("autolinkMarker"),t.consume(w),t.exit("autolinkMarker"),t.enter("autolinkProtocol"),o}function o(w){return st(w)?(t.consume(w),l):w===64?n(w):h(w)}function l(w){return w===43||w===45||w===46||He(w)?(r=1,u(w)):h(w)}function u(w){return w===58?(t.consume(w),r=0,f):(w===43||w===45||w===46||He(w))&&r++<32?(t.consume(w),u):(r=0,h(w))}function f(w){return w===62?(t.exit("autolinkProtocol"),t.enter("autolinkMarker"),t.consume(w),t.exit("autolinkMarker"),t.exit("autolink"),e):w===null||w===32||w===60||Vr(w)?n(w):(t.consume(w),f)}function h(w){return w===64?(t.consume(w),m):Zc(w)?(t.consume(w),h):n(w)}function m(w){return He(w)?p(w):n(w)}function p(w){return w===46?(t.consume(w),r=0,m):w===62?(t.exit("autolinkProtocol").type="autolinkEmail",t.enter("autolinkMarker"),t.consume(w),t.exit("autolinkMarker"),t.exit("autolink"),e):g(w)}function g(w){if((w===45||He(w))&&r++<63){let E=w===45?g:p;return t.consume(w),E}return n(w)}}var mn={partial:!0,tokenize:cb};function cb(t,e,n){return r;function r(o){return q(o)?G(t,s,"linePrefix")(o):s(o)}function s(o){return o===null||$(o)?e(o):n(o)}}var ts={continuation:{tokenize:db},exit:hb,name:"blockQuote",tokenize:fb};function fb(t,e,n){let r=this;return s;function s(l){if(l===62){let u=r.containerState;return u.open||(t.enter("blockQuote",{_container:!0}),u.open=!0),t.enter("blockQuotePrefix"),t.enter("blockQuoteMarker"),t.consume(l),t.exit("blockQuoteMarker"),o}return n(l)}function o(l){return q(l)?(t.enter("blockQuotePrefixWhitespace"),t.consume(l),t.exit("blockQuotePrefixWhitespace"),t.exit("blockQuotePrefix"),e):(t.exit("blockQuotePrefix"),e(l))}}function db(t,e,n){let r=this;return s;function s(l){return q(l)?G(t,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l):o(l)}function o(l){return t.attempt(ts,e,n)(l)}}function hb(t){t.exit("blockQuote")}var ns={name:"characterEscape",tokenize:mb};function mb(t,e,n){return r;function r(o){return t.enter("characterEscape"),t.enter("escapeMarker"),t.consume(o),t.exit("escapeMarker"),s}function s(o){return ef(o)?(t.enter("characterEscapeValue"),t.consume(o),t.exit("characterEscapeValue"),t.exit("characterEscape"),e):n(o)}}var rs={name:"characterReference",tokenize:pb};function pb(t,e,n){let r=this,s=0,o,l;return u;function u(p){return t.enter("characterReference"),t.enter("characterReferenceMarker"),t.consume(p),t.exit("characterReferenceMarker"),f}function f(p){return p===35?(t.enter("characterReferenceMarkerNumeric"),t.consume(p),t.exit("characterReferenceMarkerNumeric"),h):(t.enter("characterReferenceValue"),o=31,l=He,m(p))}function h(p){return p===88||p===120?(t.enter("characterReferenceMarkerHexadecimal"),t.consume(p),t.exit("characterReferenceMarkerHexadecimal"),t.enter("characterReferenceValue"),o=6,l=Qc,m):(t.enter("characterReferenceValue"),o=7,l=Wr,m(p))}function m(p){if(p===59&&s){let g=t.exit("characterReferenceValue");return l===He&&!lr(r.sliceSerialize(g))?n(p):(t.enter("characterReferenceMarker"),t.consume(p),t.exit("characterReferenceMarker"),t.exit("characterReference"),e)}return l(p)&&s++<o?(t.consume(p),m):n(p)}}var lf={partial:!0,tokenize:wb},is={concrete:!0,name:"codeFenced",tokenize:gb};function gb(t,e,n){let r=this,s={partial:!0,tokenize:H},o=0,l=0,u;return f;function f(A){return h(A)}function h(A){let te=r.events[r.events.length-1];return o=te&&te[1].type==="linePrefix"?te[2].sliceSerialize(te[1],!0).length:0,u=A,t.enter("codeFenced"),t.enter("codeFencedFence"),t.enter("codeFencedFenceSequence"),m(A)}function m(A){return A===u?(l++,t.consume(A),m):l<3?n(A):(t.exit("codeFencedFenceSequence"),q(A)?G(t,p,"whitespace")(A):p(A))}function p(A){return A===null||$(A)?(t.exit("codeFencedFence"),r.interrupt?e(A):t.check(lf,F,W)(A)):(t.enter("codeFencedFenceInfo"),t.enter("chunkString",{contentType:"string"}),g(A))}function g(A){return A===null||$(A)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),p(A)):q(A)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),G(t,w,"whitespace")(A)):A===96&&A===u?n(A):(t.consume(A),g)}function w(A){return A===null||$(A)?p(A):(t.enter("codeFencedFenceMeta"),t.enter("chunkString",{contentType:"string"}),E(A))}function E(A){return A===null||$(A)?(t.exit("chunkString"),t.exit("codeFencedFenceMeta"),p(A)):A===96&&A===u?n(A):(t.consume(A),E)}function F(A){return t.attempt(s,W,T)(A)}function T(A){return t.enter("lineEnding"),t.consume(A),t.exit("lineEnding"),C}function C(A){return o>0&&q(A)?G(t,_,"linePrefix",o+1)(A):_(A)}function _(A){return A===null||$(A)?t.check(lf,F,W)(A):(t.enter("codeFlowValue"),I(A))}function I(A){return A===null||$(A)?(t.exit("codeFlowValue"),_(A)):(t.consume(A),I)}function W(A){return t.exit("codeFenced"),e(A)}function H(A,te,K){let J=0;return oe;function oe(z){return A.enter("lineEnding"),A.consume(z),A.exit("lineEnding"),ue}function ue(z){return A.enter("codeFencedFence"),q(z)?G(A,re,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(z):re(z)}function re(z){return z===u?(A.enter("codeFencedFenceSequence"),Y(z)):K(z)}function Y(z){return z===u?(J++,A.consume(z),Y):J>=l?(A.exit("codeFencedFenceSequence"),q(z)?G(A,j,"whitespace")(z):j(z)):K(z)}function j(z){return z===null||$(z)?(A.exit("codeFencedFence"),te(z)):K(z)}}}function wb(t,e,n){let r=this;return s;function s(l){return l===null?n(l):(t.enter("lineEnding"),t.consume(l),t.exit("lineEnding"),o)}function o(l){return r.parser.lazy[r.now().line]?n(l):e(l)}}var Ur={name:"codeIndented",tokenize:bb},yb={partial:!0,tokenize:kb};function bb(t,e,n){let r=this;return s;function s(h){return t.enter("codeIndented"),G(t,o,"linePrefix",5)(h)}function o(h){let m=r.events[r.events.length-1];return m&&m[1].type==="linePrefix"&&m[2].sliceSerialize(m[1],!0).length>=4?l(h):n(h)}function l(h){return h===null?f(h):$(h)?t.attempt(yb,l,f)(h):(t.enter("codeFlowValue"),u(h))}function u(h){return h===null||$(h)?(t.exit("codeFlowValue"),l(h)):(t.consume(h),u)}function f(h){return t.exit("codeIndented"),e(h)}}function kb(t,e,n){let r=this;return s;function s(l){return r.parser.lazy[r.now().line]?n(l):$(l)?(t.enter("lineEnding"),t.consume(l),t.exit("lineEnding"),s):G(t,o,"linePrefix",5)(l)}function o(l){let u=r.events[r.events.length-1];return u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?e(l):$(l)?s(l):n(l)}}var ya={name:"codeText",previous:Eb,resolve:xb,tokenize:Cb};function xb(t){let e=t.length-4,n=3,r,s;if((t[n][1].type==="lineEnding"||t[n][1].type==="space")&&(t[e][1].type==="lineEnding"||t[e][1].type==="space")){for(r=n;++r<e;)if(t[r][1].type==="codeTextData"){t[n][1].type="codeTextPadding",t[e][1].type="codeTextPadding",n+=2,e-=2;break}}for(r=n-1,e++;++r<=e;)s===void 0?r!==e&&t[r][1].type!=="lineEnding"&&(s=r):(r===e||t[r][1].type==="lineEnding")&&(t[s][1].type="codeTextData",r!==s+2&&(t[s][1].end=t[r-1][1].end,t.splice(s+2,r-s-2),e-=r-s-2,r=s+2),s=void 0);return t}function Eb(t){return t!==96||this.events[this.events.length-1][1].type==="characterEscape"}function Cb(t,e,n){let r=this,s=0,o,l;return u;function u(g){return t.enter("codeText"),t.enter("codeTextSequence"),f(g)}function f(g){return g===96?(t.consume(g),s++,f):(t.exit("codeTextSequence"),h(g))}function h(g){return g===null?n(g):g===32?(t.enter("space"),t.consume(g),t.exit("space"),h):g===96?(l=t.enter("codeTextSequence"),o=0,p(g)):$(g)?(t.enter("lineEnding"),t.consume(g),t.exit("lineEnding"),h):(t.enter("codeTextData"),m(g))}function m(g){return g===null||g===32||g===96||$(g)?(t.exit("codeTextData"),h(g)):(t.consume(g),m)}function p(g){return g===96?(t.consume(g),o++,p):o===s?(t.exit("codeTextSequence"),t.exit("codeText"),e(g)):(l.type="codeTextData",m(g))}}var ss=class{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,n){let r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(e,r):e>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(e,n,r){let s=n||0;this.setCursor(Math.trunc(e));let o=this.right.splice(this.right.length-s,Number.POSITIVE_INFINITY);return r&&Hr(this.left,r),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(e){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(e)}pushMany(e){this.setCursor(Number.POSITIVE_INFINITY),Hr(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),Hr(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0))if(e<this.left.length){let n=this.left.splice(e,Number.POSITIVE_INFINITY);Hr(this.right,n.reverse())}else{let n=this.right.splice(this.left.length+this.right.length-e,Number.POSITIVE_INFINITY);Hr(this.left,n.reverse())}}};function Hr(t,e){let n=0;if(e.length<1e4)t.push(...e);else for(;n<e.length;)t.push(...e.slice(n,n+1e4)),n+=1e4}function os(t){let e={},n=-1,r,s,o,l,u,f,h,m=new ss(t);for(;++n<m.length;){for(;n in e;)n=e[n];if(r=m.get(n),n&&r[1].type==="chunkFlow"&&m.get(n-1)[1].type==="listItemPrefix"&&(f=r[1]._tokenizer.events,o=0,o<f.length&&f[o][1].type==="lineEndingBlank"&&(o+=2),o<f.length&&f[o][1].type==="content"))for(;++o<f.length&&f[o][1].type!=="content";)f[o][1].type==="chunkText"&&(f[o][1]._isInFirstContentOfListItem=!0,o++);if(r[0]==="enter")r[1].contentType&&(Object.assign(e,vb(m,n)),n=e[n],h=!0);else if(r[1]._container){for(o=n,s=void 0;o--&&(l=m.get(o),l[1].type==="lineEnding"||l[1].type==="lineEndingBlank");)l[0]==="enter"&&(s&&(m.get(s)[1].type="lineEndingBlank"),l[1].type="lineEnding",s=o);s&&(r[1].end={...m.get(s)[1].start},u=m.slice(s,n),u.unshift(r),m.splice(s,n-s+1,u))}}return Ie(t,0,Number.POSITIVE_INFINITY,m.slice(0)),!h}function vb(t,e){let n=t.get(e)[1],r=t.get(e)[2],s=e-1,o=[],l=n._tokenizer||r.parser[n.contentType](n.start),u=l.events,f=[],h={},m,p,g=-1,w=n,E=0,F=0,T=[F];for(;w;){for(;t.get(++s)[1]!==w;);o.push(s),w._tokenizer||(m=r.sliceStream(w),w.next||m.push(null),p&&l.defineSkip(w.start),w._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=!0),l.write(m),w._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=void 0)),p=w,w=w.next}for(w=n;++g<u.length;)u[g][0]==="exit"&&u[g-1][0]==="enter"&&u[g][1].type===u[g-1][1].type&&u[g][1].start.line!==u[g][1].end.line&&(F=g+1,T.push(F),w._tokenizer=void 0,w.previous=void 0,w=w.next);for(l.events=[],w?(w._tokenizer=void 0,w.previous=void 0):T.pop(),g=T.length;g--;){let C=u.slice(T[g],T[g+1]),_=o.pop();f.push([_,_+C.length-1]),t.splice(_,2,C)}for(f.reverse(),g=-1;++g<f.length;)h[E+f[g][0]]=E+f[g][1],E+=f[g][1]-f[g][0]-1;return h}var ba={resolve:Sb,tokenize:Tb},Ab={partial:!0,tokenize:_b};function Sb(t){return os(t),t}function Tb(t,e){let n;return r;function r(u){return t.enter("content"),n=t.enter("chunkContent",{contentType:"content"}),s(u)}function s(u){return u===null?o(u):$(u)?t.check(Ab,l,o)(u):(t.consume(u),s)}function o(u){return t.exit("chunkContent"),t.exit("content"),e(u)}function l(u){return t.consume(u),t.exit("chunkContent"),n.next=t.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,s}}function _b(t,e,n){let r=this;return s;function s(l){return t.exit("chunkContent"),t.enter("lineEnding"),t.consume(l),t.exit("lineEnding"),G(t,o,"linePrefix")}function o(l){if(l===null||$(l))return n(l);let u=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?e(l):t.interrupt(r.parser.constructs.flow,n,e)(l)}}function as(t,e,n,r,s,o,l,u,f){let h=f||Number.POSITIVE_INFINITY,m=0;return p;function p(C){return C===60?(t.enter(r),t.enter(s),t.enter(o),t.consume(C),t.exit(o),g):C===null||C===32||C===41||Vr(C)?n(C):(t.enter(r),t.enter(l),t.enter(u),t.enter("chunkString",{contentType:"string"}),F(C))}function g(C){return C===62?(t.enter(o),t.consume(C),t.exit(o),t.exit(s),t.exit(r),e):(t.enter(u),t.enter("chunkString",{contentType:"string"}),w(C))}function w(C){return C===62?(t.exit("chunkString"),t.exit(u),g(C)):C===null||C===60||$(C)?n(C):(t.consume(C),C===92?E:w)}function E(C){return C===60||C===62||C===92?(t.consume(C),w):w(C)}function F(C){return!m&&(C===null||C===41||ye(C))?(t.exit("chunkString"),t.exit(u),t.exit(l),t.exit(r),e(C)):m<h&&C===40?(t.consume(C),m++,F):C===41?(t.consume(C),m--,F):C===null||C===32||C===40||Vr(C)?n(C):(t.consume(C),C===92?T:F)}function T(C){return C===40||C===41||C===92?(t.consume(C),F):F(C)}}function ls(t,e,n,r,s,o){let l=this,u=0,f;return h;function h(w){return t.enter(r),t.enter(s),t.consume(w),t.exit(s),t.enter(o),m}function m(w){return u>999||w===null||w===91||w===93&&!f||w===94&&!u&&"_hiddenFootnoteSupport"in l.parser.constructs?n(w):w===93?(t.exit(o),t.enter(s),t.consume(w),t.exit(s),t.exit(r),e):$(w)?(t.enter("lineEnding"),t.consume(w),t.exit("lineEnding"),m):(t.enter("chunkString",{contentType:"string"}),p(w))}function p(w){return w===null||w===91||w===93||$(w)||u++>999?(t.exit("chunkString"),m(w)):(t.consume(w),f||(f=!q(w)),w===92?g:p)}function g(w){return w===91||w===92||w===93?(t.consume(w),u++,p):p(w)}}function us(t,e,n,r,s,o){let l;return u;function u(g){return g===34||g===39||g===40?(t.enter(r),t.enter(s),t.consume(g),t.exit(s),l=g===40?41:g,f):n(g)}function f(g){return g===l?(t.enter(s),t.consume(g),t.exit(s),t.exit(r),e):(t.enter(o),h(g))}function h(g){return g===l?(t.exit(o),f(l)):g===null?n(g):$(g)?(t.enter("lineEnding"),t.consume(g),t.exit("lineEnding"),G(t,h,"linePrefix")):(t.enter("chunkString",{contentType:"string"}),m(g))}function m(g){return g===l||g===null||$(g)?(t.exit("chunkString"),h(g)):(t.consume(g),g===92?p:m)}function p(g){return g===l||g===92?(t.consume(g),m):m(g)}}function In(t,e){let n;return r;function r(s){return $(s)?(t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),n=!0,r):q(s)?G(t,r,n?"linePrefix":"lineSuffix")(s):e(s)}}var ka={name:"definition",tokenize:Ib},Fb={partial:!0,tokenize:Pb};function Ib(t,e,n){let r=this,s;return o;function o(w){return t.enter("definition"),l(w)}function l(w){return ls.call(r,t,u,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(w)}function u(w){return s=Jt(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),w===58?(t.enter("definitionMarker"),t.consume(w),t.exit("definitionMarker"),f):n(w)}function f(w){return ye(w)?In(t,h)(w):h(w)}function h(w){return as(t,m,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(w)}function m(w){return t.attempt(Fb,p,p)(w)}function p(w){return q(w)?G(t,g,"whitespace")(w):g(w)}function g(w){return w===null||$(w)?(t.exit("definition"),r.parser.defined.push(s),e(w)):n(w)}}function Pb(t,e,n){return r;function r(u){return ye(u)?In(t,s)(u):n(u)}function s(u){return us(t,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(u)}function o(u){return q(u)?G(t,l,"whitespace")(u):l(u)}function l(u){return u===null||$(u)?e(u):n(u)}}var xa={name:"hardBreakEscape",tokenize:Rb};function Rb(t,e,n){return r;function r(o){return t.enter("hardBreakEscape"),t.consume(o),s}function s(o){return $(o)?(t.exit("hardBreakEscape"),e(o)):n(o)}}var Ea={name:"headingAtx",resolve:Ob,tokenize:Db};function Ob(t,e){let n=t.length-2,r=3,s,o;return t[r][1].type==="whitespace"&&(r+=2),n-2>r&&t[n][1].type==="whitespace"&&(n-=2),t[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&t[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(s={type:"atxHeadingText",start:t[r][1].start,end:t[n][1].end},o={type:"chunkText",start:t[r][1].start,end:t[n][1].end,contentType:"text"},Ie(t,r,n-r+1,[["enter",s,e],["enter",o,e],["exit",o,e],["exit",s,e]])),t}function Db(t,e,n){let r=0;return s;function s(m){return t.enter("atxHeading"),o(m)}function o(m){return t.enter("atxHeadingSequence"),l(m)}function l(m){return m===35&&r++<6?(t.consume(m),l):m===null||ye(m)?(t.exit("atxHeadingSequence"),u(m)):n(m)}function u(m){return m===35?(t.enter("atxHeadingSequence"),f(m)):m===null||$(m)?(t.exit("atxHeading"),e(m)):q(m)?G(t,u,"whitespace")(m):(t.enter("atxHeadingText"),h(m))}function f(m){return m===35?(t.consume(m),f):(t.exit("atxHeadingSequence"),u(m))}function h(m){return m===null||m===35||ye(m)?(t.exit("atxHeadingText"),u(m)):(t.consume(m),h)}}var uf=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Ca=["pre","script","style","textarea"];var va={concrete:!0,name:"htmlFlow",resolveTo:Nb,tokenize:$b},Lb={partial:!0,tokenize:Bb},Mb={partial:!0,tokenize:Yb};function Nb(t){let e=t.length;for(;e--&&!(t[e][0]==="enter"&&t[e][1].type==="htmlFlow"););return e>1&&t[e-2][1].type==="linePrefix"&&(t[e][1].start=t[e-2][1].start,t[e+1][1].start=t[e-2][1].start,t.splice(e-2,2)),t}function $b(t,e,n){let r=this,s,o,l,u,f;return h;function h(b){return m(b)}function m(b){return t.enter("htmlFlow"),t.enter("htmlFlowData"),t.consume(b),p}function p(b){return b===33?(t.consume(b),g):b===47?(t.consume(b),o=!0,F):b===63?(t.consume(b),s=3,r.interrupt?e:x):st(b)?(t.consume(b),l=String.fromCharCode(b),T):n(b)}function g(b){return b===45?(t.consume(b),s=2,w):b===91?(t.consume(b),s=5,u=0,E):st(b)?(t.consume(b),s=4,r.interrupt?e:x):n(b)}function w(b){return b===45?(t.consume(b),r.interrupt?e:x):n(b)}function E(b){let $e="CDATA[";return b===$e.charCodeAt(u++)?(t.consume(b),u===$e.length?r.interrupt?e:re:E):n(b)}function F(b){return st(b)?(t.consume(b),l=String.fromCharCode(b),T):n(b)}function T(b){if(b===null||b===47||b===62||ye(b)){let $e=b===47,Rt=l.toLowerCase();return!$e&&!o&&Ca.includes(Rt)?(s=1,r.interrupt?e(b):re(b)):uf.includes(l.toLowerCase())?(s=6,$e?(t.consume(b),C):r.interrupt?e(b):re(b)):(s=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(b):o?_(b):I(b))}return b===45||He(b)?(t.consume(b),l+=String.fromCharCode(b),T):n(b)}function C(b){return b===62?(t.consume(b),r.interrupt?e:re):n(b)}function _(b){return q(b)?(t.consume(b),_):oe(b)}function I(b){return b===47?(t.consume(b),oe):b===58||b===95||st(b)?(t.consume(b),W):q(b)?(t.consume(b),I):oe(b)}function W(b){return b===45||b===46||b===58||b===95||He(b)?(t.consume(b),W):H(b)}function H(b){return b===61?(t.consume(b),A):q(b)?(t.consume(b),H):I(b)}function A(b){return b===null||b===60||b===61||b===62||b===96?n(b):b===34||b===39?(t.consume(b),f=b,te):q(b)?(t.consume(b),A):K(b)}function te(b){return b===f?(t.consume(b),f=null,J):b===null||$(b)?n(b):(t.consume(b),te)}function K(b){return b===null||b===34||b===39||b===47||b===60||b===61||b===62||b===96||ye(b)?H(b):(t.consume(b),K)}function J(b){return b===47||b===62||q(b)?I(b):n(b)}function oe(b){return b===62?(t.consume(b),ue):n(b)}function ue(b){return b===null||$(b)?re(b):q(b)?(t.consume(b),ue):n(b)}function re(b){return b===45&&s===2?(t.consume(b),ie):b===60&&s===1?(t.consume(b),he):b===62&&s===4?(t.consume(b),Pe):b===63&&s===3?(t.consume(b),x):b===93&&s===5?(t.consume(b),Ge):$(b)&&(s===6||s===7)?(t.exit("htmlFlowData"),t.check(Lb,Re,Y)(b)):b===null||$(b)?(t.exit("htmlFlowData"),Y(b)):(t.consume(b),re)}function Y(b){return t.check(Mb,j,Re)(b)}function j(b){return t.enter("lineEnding"),t.consume(b),t.exit("lineEnding"),z}function z(b){return b===null||$(b)?Y(b):(t.enter("htmlFlowData"),re(b))}function ie(b){return b===45?(t.consume(b),x):re(b)}function he(b){return b===47?(t.consume(b),l="",me):re(b)}function me(b){if(b===62){let $e=l.toLowerCase();return Ca.includes($e)?(t.consume(b),Pe):re(b)}return st(b)&&l.length<8?(t.consume(b),l+=String.fromCharCode(b),me):re(b)}function Ge(b){return b===93?(t.consume(b),x):re(b)}function x(b){return b===62?(t.consume(b),Pe):b===45&&s===2?(t.consume(b),x):re(b)}function Pe(b){return b===null||$(b)?(t.exit("htmlFlowData"),Re(b)):(t.consume(b),Pe)}function Re(b){return t.exit("htmlFlow"),e(b)}}function Yb(t,e,n){let r=this;return s;function s(l){return $(l)?(t.enter("lineEnding"),t.consume(l),t.exit("lineEnding"),o):n(l)}function o(l){return r.parser.lazy[r.now().line]?n(l):e(l)}}function Bb(t,e,n){return r;function r(s){return t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),t.attempt(mn,e,n)}}var Aa={name:"htmlText",tokenize:Vb};function Vb(t,e,n){let r=this,s,o,l;return u;function u(x){return t.enter("htmlText"),t.enter("htmlTextData"),t.consume(x),f}function f(x){return x===33?(t.consume(x),h):x===47?(t.consume(x),H):x===63?(t.consume(x),I):st(x)?(t.consume(x),K):n(x)}function h(x){return x===45?(t.consume(x),m):x===91?(t.consume(x),o=0,E):st(x)?(t.consume(x),_):n(x)}function m(x){return x===45?(t.consume(x),w):n(x)}function p(x){return x===null?n(x):x===45?(t.consume(x),g):$(x)?(l=p,he(x)):(t.consume(x),p)}function g(x){return x===45?(t.consume(x),w):p(x)}function w(x){return x===62?ie(x):x===45?g(x):p(x)}function E(x){let Pe="CDATA[";return x===Pe.charCodeAt(o++)?(t.consume(x),o===Pe.length?F:E):n(x)}function F(x){return x===null?n(x):x===93?(t.consume(x),T):$(x)?(l=F,he(x)):(t.consume(x),F)}function T(x){return x===93?(t.consume(x),C):F(x)}function C(x){return x===62?ie(x):x===93?(t.consume(x),C):F(x)}function _(x){return x===null||x===62?ie(x):$(x)?(l=_,he(x)):(t.consume(x),_)}function I(x){return x===null?n(x):x===63?(t.consume(x),W):$(x)?(l=I,he(x)):(t.consume(x),I)}function W(x){return x===62?ie(x):I(x)}function H(x){return st(x)?(t.consume(x),A):n(x)}function A(x){return x===45||He(x)?(t.consume(x),A):te(x)}function te(x){return $(x)?(l=te,he(x)):q(x)?(t.consume(x),te):ie(x)}function K(x){return x===45||He(x)?(t.consume(x),K):x===47||x===62||ye(x)?J(x):n(x)}function J(x){return x===47?(t.consume(x),ie):x===58||x===95||st(x)?(t.consume(x),oe):$(x)?(l=J,he(x)):q(x)?(t.consume(x),J):ie(x)}function oe(x){return x===45||x===46||x===58||x===95||He(x)?(t.consume(x),oe):ue(x)}function ue(x){return x===61?(t.consume(x),re):$(x)?(l=ue,he(x)):q(x)?(t.consume(x),ue):J(x)}function re(x){return x===null||x===60||x===61||x===62||x===96?n(x):x===34||x===39?(t.consume(x),s=x,Y):$(x)?(l=re,he(x)):q(x)?(t.consume(x),re):(t.consume(x),j)}function Y(x){return x===s?(t.consume(x),s=void 0,z):x===null?n(x):$(x)?(l=Y,he(x)):(t.consume(x),Y)}function j(x){return x===null||x===34||x===39||x===60||x===61||x===96?n(x):x===47||x===62||ye(x)?J(x):(t.consume(x),j)}function z(x){return x===47||x===62||ye(x)?J(x):n(x)}function ie(x){return x===62?(t.consume(x),t.exit("htmlTextData"),t.exit("htmlText"),e):n(x)}function he(x){return t.exit("htmlTextData"),t.enter("lineEnding"),t.consume(x),t.exit("lineEnding"),me}function me(x){return q(x)?G(t,Ge,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(x):Ge(x)}function Ge(x){return t.enter("htmlTextData"),l(x)}}var Pn={name:"labelEnd",resolveAll:Hb,resolveTo:jb,tokenize:qb},Wb={tokenize:Gb},zb={tokenize:Xb},Ub={tokenize:Kb};function Hb(t){let e=-1,n=[];for(;++e<t.length;){let r=t[e][1];if(n.push(t[e]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){let s=r.type==="labelImage"?4:2;r.type="data",e+=s}}return t.length!==n.length&&Ie(t,0,t.length,n),t}function jb(t,e){let n=t.length,r=0,s,o,l,u;for(;n--;)if(s=t[n][1],o){if(s.type==="link"||s.type==="labelLink"&&s._inactive)break;t[n][0]==="enter"&&s.type==="labelLink"&&(s._inactive=!0)}else if(l){if(t[n][0]==="enter"&&(s.type==="labelImage"||s.type==="labelLink")&&!s._balanced&&(o=n,s.type!=="labelLink")){r=2;break}}else s.type==="labelEnd"&&(l=n);let f={type:t[o][1].type==="labelLink"?"link":"image",start:{...t[o][1].start},end:{...t[t.length-1][1].end}},h={type:"label",start:{...t[o][1].start},end:{...t[l][1].end}},m={type:"labelText",start:{...t[o+r+2][1].end},end:{...t[l-2][1].start}};return u=[["enter",f,e],["enter",h,e]],u=Ue(u,t.slice(o+1,o+r+3)),u=Ue(u,[["enter",m,e]]),u=Ue(u,cr(e.parser.constructs.insideSpan.null,t.slice(o+r+4,l-3),e)),u=Ue(u,[["exit",m,e],t[l-2],t[l-1],["exit",h,e]]),u=Ue(u,t.slice(l+1)),u=Ue(u,[["exit",f,e]]),Ie(t,o,t.length,u),t}function qb(t,e,n){let r=this,s=r.events.length,o,l;for(;s--;)if((r.events[s][1].type==="labelImage"||r.events[s][1].type==="labelLink")&&!r.events[s][1]._balanced){o=r.events[s][1];break}return u;function u(g){return o?o._inactive?p(g):(l=r.parser.defined.includes(Jt(r.sliceSerialize({start:o.end,end:r.now()}))),t.enter("labelEnd"),t.enter("labelMarker"),t.consume(g),t.exit("labelMarker"),t.exit("labelEnd"),f):n(g)}function f(g){return g===40?t.attempt(Wb,m,l?m:p)(g):g===91?t.attempt(zb,m,l?h:p)(g):l?m(g):p(g)}function h(g){return t.attempt(Ub,m,p)(g)}function m(g){return e(g)}function p(g){return o._balanced=!0,n(g)}}function Gb(t,e,n){return r;function r(p){return t.enter("resource"),t.enter("resourceMarker"),t.consume(p),t.exit("resourceMarker"),s}function s(p){return ye(p)?In(t,o)(p):o(p)}function o(p){return p===41?m(p):as(t,l,u,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(p)}function l(p){return ye(p)?In(t,f)(p):m(p)}function u(p){return n(p)}function f(p){return p===34||p===39||p===40?us(t,h,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(p):m(p)}function h(p){return ye(p)?In(t,m)(p):m(p)}function m(p){return p===41?(t.enter("resourceMarker"),t.consume(p),t.exit("resourceMarker"),t.exit("resource"),e):n(p)}}function Xb(t,e,n){let r=this;return s;function s(u){return ls.call(r,t,o,l,"reference","referenceMarker","referenceString")(u)}function o(u){return r.parser.defined.includes(Jt(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?e(u):n(u)}function l(u){return n(u)}}function Kb(t,e,n){return r;function r(o){return t.enter("reference"),t.enter("referenceMarker"),t.consume(o),t.exit("referenceMarker"),s}function s(o){return o===93?(t.enter("referenceMarker"),t.consume(o),t.exit("referenceMarker"),t.exit("reference"),e):n(o)}}var Sa={name:"labelStartImage",resolveAll:Pn.resolveAll,tokenize:Jb};function Jb(t,e,n){let r=this;return s;function s(u){return t.enter("labelImage"),t.enter("labelImageMarker"),t.consume(u),t.exit("labelImageMarker"),o}function o(u){return u===91?(t.enter("labelMarker"),t.consume(u),t.exit("labelMarker"),t.exit("labelImage"),l):n(u)}function l(u){return u===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(u):e(u)}}var Ta={name:"labelStartLink",resolveAll:Pn.resolveAll,tokenize:Zb};function Zb(t,e,n){let r=this;return s;function s(l){return t.enter("labelLink"),t.enter("labelMarker"),t.consume(l),t.exit("labelMarker"),t.exit("labelLink"),o}function o(l){return l===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(l):e(l)}}var jr={name:"lineEnding",tokenize:Qb};function Qb(t,e){return n;function n(r){return t.enter("lineEnding"),t.consume(r),t.exit("lineEnding"),G(t,e,"linePrefix")}}var Rn={name:"thematicBreak",tokenize:ek};function ek(t,e,n){let r=0,s;return o;function o(h){return t.enter("thematicBreak"),l(h)}function l(h){return s=h,u(h)}function u(h){return h===s?(t.enter("thematicBreakSequence"),f(h)):r>=3&&(h===null||$(h))?(t.exit("thematicBreak"),e(h)):n(h)}function f(h){return h===s?(t.consume(h),r++,f):(t.exit("thematicBreakSequence"),q(h)?G(t,u,"whitespace")(h):u(h))}}var Me={continuation:{tokenize:ik},exit:ok,name:"list",tokenize:rk},tk={partial:!0,tokenize:ak},nk={partial:!0,tokenize:sk};function rk(t,e,n){let r=this,s=r.events[r.events.length-1],o=s&&s[1].type==="linePrefix"?s[2].sliceSerialize(s[1],!0).length:0,l=0;return u;function u(w){let E=r.containerState.type||(w===42||w===43||w===45?"listUnordered":"listOrdered");if(E==="listUnordered"?!r.containerState.marker||w===r.containerState.marker:Wr(w)){if(r.containerState.type||(r.containerState.type=E,t.enter(E,{_container:!0})),E==="listUnordered")return t.enter("listItemPrefix"),w===42||w===45?t.check(Rn,n,h)(w):h(w);if(!r.interrupt||w===49)return t.enter("listItemPrefix"),t.enter("listItemValue"),f(w)}return n(w)}function f(w){return Wr(w)&&++l<10?(t.consume(w),f):(!r.interrupt||l<2)&&(r.containerState.marker?w===r.containerState.marker:w===41||w===46)?(t.exit("listItemValue"),h(w)):n(w)}function h(w){return t.enter("listItemMarker"),t.consume(w),t.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||w,t.check(mn,r.interrupt?n:m,t.attempt(tk,g,p))}function m(w){return r.containerState.initialBlankLine=!0,o++,g(w)}function p(w){return q(w)?(t.enter("listItemPrefixWhitespace"),t.consume(w),t.exit("listItemPrefixWhitespace"),g):n(w)}function g(w){return r.containerState.size=o+r.sliceSerialize(t.exit("listItemPrefix"),!0).length,e(w)}}function ik(t,e,n){let r=this;return r.containerState._closeFlow=void 0,t.check(mn,s,o);function s(u){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,G(t,e,"listItemIndent",r.containerState.size+1)(u)}function o(u){return r.containerState.furtherBlankLines||!q(u)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,l(u)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,t.attempt(nk,e,l)(u))}function l(u){return r.containerState._closeFlow=!0,r.interrupt=void 0,G(t,t.attempt(Me,e,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(u)}}function sk(t,e,n){let r=this;return G(t,s,"listItemIndent",r.containerState.size+1);function s(o){let l=r.events[r.events.length-1];return l&&l[1].type==="listItemIndent"&&l[2].sliceSerialize(l[1],!0).length===r.containerState.size?e(o):n(o)}}function ok(t){t.exit(this.containerState.type)}function ak(t,e,n){let r=this;return G(t,s,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function s(o){let l=r.events[r.events.length-1];return!q(o)&&l&&l[1].type==="listItemPrefixWhitespace"?e(o):n(o)}}var cs={name:"setextUnderline",resolveTo:lk,tokenize:uk};function lk(t,e){let n=t.length,r,s,o;for(;n--;)if(t[n][0]==="enter"){if(t[n][1].type==="content"){r=n;break}t[n][1].type==="paragraph"&&(s=n)}else t[n][1].type==="content"&&t.splice(n,1),!o&&t[n][1].type==="definition"&&(o=n);let l={type:"setextHeading",start:{...t[s][1].start},end:{...t[t.length-1][1].end}};return t[s][1].type="setextHeadingText",o?(t.splice(s,0,["enter",l,e]),t.splice(o+1,0,["exit",t[r][1],e]),t[r][1].end={...t[o][1].end}):t[r][1]=l,t.push(["exit",l,e]),t}function uk(t,e,n){let r=this,s;return o;function o(h){let m=r.events.length,p;for(;m--;)if(r.events[m][1].type!=="lineEnding"&&r.events[m][1].type!=="linePrefix"&&r.events[m][1].type!=="content"){p=r.events[m][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||p)?(t.enter("setextHeadingLine"),s=h,l(h)):n(h)}function l(h){return t.enter("setextHeadingLineSequence"),u(h)}function u(h){return h===s?(t.consume(h),u):(t.exit("setextHeadingLineSequence"),q(h)?G(t,f,"lineSuffix")(h):f(h))}function f(h){return h===null||$(h)?(t.exit("setextHeadingLine"),e(h)):n(h)}}var cf={tokenize:ck};function ck(t){let e=this,n=t.attempt(mn,r,t.attempt(this.parser.constructs.flowInitial,s,G(t,t.attempt(this.parser.constructs.flow,s,t.attempt(ba,s)),"linePrefix")));return n;function r(o){if(o===null){t.consume(o);return}return t.enter("lineEndingBlank"),t.consume(o),t.exit("lineEndingBlank"),e.currentConstruct=void 0,n}function s(o){if(o===null){t.consume(o);return}return t.enter("lineEnding"),t.consume(o),t.exit("lineEnding"),e.currentConstruct=void 0,n}}var ff={resolveAll:pf()},df=mf("string"),hf=mf("text");function mf(t){return{resolveAll:pf(t==="text"?fk:void 0),tokenize:e};function e(n){let r=this,s=this.parser.constructs[t],o=n.attempt(s,l,u);return l;function l(m){return h(m)?o(m):u(m)}function u(m){if(m===null){n.consume(m);return}return n.enter("data"),n.consume(m),f}function f(m){return h(m)?(n.exit("data"),o(m)):(n.consume(m),f)}function h(m){if(m===null)return!0;let p=s[m],g=-1;if(p)for(;++g<p.length;){let w=p[g];if(!w.previous||w.previous.call(r,r.previous))return!0}return!1}}}function pf(t){return e;function e(n,r){let s=-1,o;for(;++s<=n.length;)o===void 0?n[s]&&n[s][1].type==="data"&&(o=s,s++):(!n[s]||n[s][1].type!=="data")&&(s!==o+2&&(n[o][1].end=n[s-1][1].end,n.splice(o+2,s-o-2),s=o+2),o=void 0);return t?t(n,r):n}}function fk(t,e){let n=0;for(;++n<=t.length;)if((n===t.length||t[n][1].type==="lineEnding")&&t[n-1][1].type==="data"){let r=t[n-1][1],s=e.sliceStream(r),o=s.length,l=-1,u=0,f;for(;o--;){let h=s[o];if(typeof h=="string"){for(l=h.length;h.charCodeAt(l-1)===32;)u++,l--;if(l)break;l=-1}else if(h===-2)f=!0,u++;else if(h!==-1){o++;break}}if(u){let h={type:n===t.length||f||u<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?l:r.start._bufferIndex+l,_index:r.start._index+o,line:r.end.line,column:r.end.column-u,offset:r.end.offset-u},end:{...r.end}};r.end={...h.start},r.start.offset===r.end.offset?Object.assign(r,h):(t.splice(n,0,["enter",h,e],["exit",h,e]),n+=2)}n++}return t}var _a={};Wu(_a,{attentionMarkers:()=>bk,contentInitial:()=>hk,disable:()=>kk,document:()=>dk,flow:()=>pk,flowInitial:()=>mk,insideSpan:()=>yk,string:()=>gk,text:()=>wk});var dk={42:Me,43:Me,45:Me,48:Me,49:Me,50:Me,51:Me,52:Me,53:Me,54:Me,55:Me,56:Me,57:Me,62:ts},hk={91:ka},mk={[-2]:Ur,[-1]:Ur,32:Ur},pk={35:Ea,42:Rn,45:[cs,Rn],60:va,61:cs,95:Rn,96:is,126:is},gk={38:rs,92:ns},wk={[-5]:jr,[-4]:jr,[-3]:jr,33:Sa,38:rs,42:zr,60:[wa,Aa],91:Ta,92:[xa,ns],93:Pn,95:zr,96:ya},yk={null:[zr,ff]},bk={null:[42,95]},kk={null:[]};function gf(t,e,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},s={},o=[],l=[],u=[],f=!0,h={attempt:J(te),check:J(K),consume:W,enter:H,exit:A,interrupt:J(K,{interrupt:!0})},m={code:null,containerState:{},defineSkip:C,events:[],now:T,parser:t,previous:null,sliceSerialize:E,sliceStream:F,write:w},p=e.tokenize.call(m,h),g;return e.resolveAll&&o.push(e),m;function w(Y){return l=Ue(l,Y),_(),l[l.length-1]!==null?[]:(oe(e,0),m.events=cr(o,m.events,m),m.events)}function E(Y,j){return Ek(F(Y),j)}function F(Y){return xk(l,Y)}function T(){let{_bufferIndex:Y,_index:j,line:z,column:ie,offset:he}=r;return{_bufferIndex:Y,_index:j,line:z,column:ie,offset:he}}function C(Y){s[Y.line]=Y.column,re()}function _(){let Y;for(;r._index<l.length;){let j=l[r._index];if(typeof j=="string")for(Y=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===Y&&r._bufferIndex<j.length;)I(j.charCodeAt(r._bufferIndex));else I(j)}}function I(Y){f=void 0,g=Y,p=p(Y)}function W(Y){$(Y)?(r.line++,r.column=1,r.offset+=Y===-3?2:1,re()):Y!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===l[r._index].length&&(r._bufferIndex=-1,r._index++)),m.previous=Y,f=!0}function H(Y,j){let z=j||{};return z.type=Y,z.start=T(),m.events.push(["enter",z,m]),u.push(z),z}function A(Y){let j=u.pop();return j.end=T(),m.events.push(["exit",j,m]),j}function te(Y,j){oe(Y,j.from)}function K(Y,j){j.restore()}function J(Y,j){return z;function z(ie,he,me){let Ge,x,Pe,Re;return Array.isArray(ie)?$e(ie):"tokenize"in ie?$e([ie]):b(ie);function b(Ce){return xn;function xn(pt){let Ot=pt!==null&&Ce[pt],tn=pt!==null&&Ce.null,Ar=[...Array.isArray(Ot)?Ot:Ot?[Ot]:[],...Array.isArray(tn)?tn:tn?[tn]:[]];return $e(Ar)(pt)}}function $e(Ce){return Ge=Ce,x=0,Ce.length===0?me:Rt(Ce[x])}function Rt(Ce){return xn;function xn(pt){return Re=ue(),Pe=Ce,Ce.partial||(m.currentConstruct=Ce),Ce.name&&m.parser.constructs.disable.null.includes(Ce.name)?kn(pt):Ce.tokenize.call(j?Object.assign(Object.create(m),j):m,h,en,kn)(pt)}}function en(Ce){return f=!0,Y(Pe,Re),he}function kn(Ce){return f=!0,Re.restore(),++x<Ge.length?Rt(Ge[x]):me}}}function oe(Y,j){Y.resolveAll&&!o.includes(Y)&&o.push(Y),Y.resolve&&Ie(m.events,j,m.events.length-j,Y.resolve(m.events.slice(j),m)),Y.resolveTo&&(m.events=Y.resolveTo(m.events,m))}function ue(){let Y=T(),j=m.previous,z=m.currentConstruct,ie=m.events.length,he=Array.from(u);return{from:ie,restore:me};function me(){r=Y,m.previous=j,m.currentConstruct=z,m.events.length=ie,u=he,re()}}function re(){r.line in s&&r.column<2&&(r.column=s[r.line],r.offset+=s[r.line]-1)}}function xk(t,e){let n=e.start._index,r=e.start._bufferIndex,s=e.end._index,o=e.end._bufferIndex,l;if(n===s)l=[t[n].slice(r,o)];else{if(l=t.slice(n,s),r>-1){let u=l[0];typeof u=="string"?l[0]=u.slice(r):l.shift()}o>0&&l.push(t[s].slice(0,o))}return l}function Ek(t,e){let n=-1,r=[],s;for(;++n<t.length;){let o=t[n],l;if(typeof o=="string")l=o;else switch(o){case-5:{l="\r";break}case-4:{l=`
`;break}case-3:{l=`\r
`;break}case-2:{l=e?" ":"	";break}case-1:{if(!e&&s)continue;l=" ";break}default:l=String.fromCharCode(o)}s=o===-2,r.push(l)}return r.join("")}function Fa(t){let r={constructs:Jc([_a,...(t||{}).extensions||[]]),content:s(rf),defined:[],document:s(of),flow:s(cf),lazy:{},string:s(df),text:s(hf)};return r;function s(o){return l;function l(u){return gf(r,o,u)}}}function Ia(t){for(;!os(t););return t}var wf=/[\0\t\n\r]/g;function Pa(){let t=1,e="",n=!0,r;return s;function s(o,l,u){let f=[],h,m,p,g,w;for(o=e+(typeof o=="string"?o.toString():new TextDecoder(l||void 0).decode(o)),p=0,e="",n&&(o.charCodeAt(0)===65279&&p++,n=void 0);p<o.length;){if(wf.lastIndex=p,h=wf.exec(o),g=h&&h.index!==void 0?h.index:o.length,w=o.charCodeAt(g),!h){e=o.slice(p);break}if(w===10&&p===g&&r)f.push(-3),r=void 0;else switch(r&&(f.push(-5),r=void 0),p<g&&(f.push(o.slice(p,g)),t+=g-p),w){case 0:{f.push(65533),t++;break}case 9:{for(m=Math.ceil(t/4)*4,f.push(-2);t++<m;)f.push(-1);break}case 10:{f.push(-4),t=1;break}default:r=!0,t=1}p=g+1}return u&&(r&&f.push(-5),e&&f.push(e),f.push(null)),f}}var Ck=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function fs(t){return t.replace(Ck,vk)}function vk(t,e,n){if(e)return e;if(n.charCodeAt(0)===35){let s=n.charCodeAt(1),o=s===120||s===88;return es(n.slice(o?2:1),o?16:10)}return lr(n)||t}function pn(t){return!t||typeof t!="object"?"":"position"in t||"type"in t?yf(t.position):"start"in t||"end"in t?yf(t):"line"in t||"column"in t?Ra(t):""}function Ra(t){return bf(t&&t.line)+":"+bf(t&&t.column)}function yf(t){return Ra(t&&t.start)+"-"+Ra(t&&t.end)}function bf(t){return t&&typeof t=="number"?t:1}var xf={}.hasOwnProperty;function Oa(t,e,n){return typeof e!="string"&&(n=e,e=void 0),Ak(n)(Ia(Fa(n).document().write(Pa()(t,e,!0))))}function Ak(t){let e={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(Ye),autolinkProtocol:J,autolinkEmail:J,atxHeading:o(mi),blockQuote:o(pt),characterEscape:J,characterReference:J,codeFenced:o(Ot),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:o(Ot,l),codeText:o(tn,l),codeTextData:J,data:J,codeFlowValue:J,definition:o(Ar),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:o(To),hardBreakEscape:o(pi),hardBreakTrailing:o(pi),htmlFlow:o(gi,l),htmlFlowData:J,htmlText:o(gi,l),htmlTextData:J,image:o(wi),label:l,link:o(Ye),listItem:o(_o),listItemValue:g,listOrdered:o(Yn,p),listUnordered:o(Yn),paragraph:o(Fo),reference:b,referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:o(mi),strong:o(yi),thematicBreak:o(bi)},exit:{atxHeading:f(),atxHeadingSequence:H,autolink:f(),autolinkEmail:xn,autolinkProtocol:Ce,blockQuote:f(),characterEscapeValue:oe,characterReferenceMarkerHexadecimal:Rt,characterReferenceMarkerNumeric:Rt,characterReferenceValue:en,characterReference:kn,codeFenced:f(T),codeFencedFence:F,codeFencedFenceInfo:w,codeFencedFenceMeta:E,codeFlowValue:oe,codeIndented:f(C),codeText:f(z),codeTextData:oe,data:oe,definition:f(),definitionDestinationString:W,definitionLabelString:_,definitionTitleString:I,emphasis:f(),hardBreakEscape:f(re),hardBreakTrailing:f(re),htmlFlow:f(Y),htmlFlowData:oe,htmlText:f(j),htmlTextData:oe,image:f(he),label:Ge,labelText:me,lineEnding:ue,link:f(ie),listItem:f(),listOrdered:f(),listUnordered:f(),paragraph:f(),referenceString:$e,resourceDestinationString:x,resourceTitleString:Pe,resource:Re,setextHeading:f(K),setextHeadingLineSequence:te,setextHeadingText:A,strong:f(),thematicBreak:f()}};Ef(e,(t||{}).mdastExtensions||[]);let n={};return r;function r(S){let R={type:"root",children:[]},O={stack:[R],tokenStack:[],config:e,enter:u,exit:h,buffer:l,resume:m,data:n},Z=[],ae=-1;for(;++ae<S.length;)if(S[ae][1].type==="listOrdered"||S[ae][1].type==="listUnordered")if(S[ae][0]==="enter")Z.push(ae);else{let Oe=Z.pop();ae=s(S,Oe,ae)}for(ae=-1;++ae<S.length;){let Oe=e[S[ae][0]];xf.call(Oe,S[ae][1].type)&&Oe[S[ae][1].type].call(Object.assign({sliceSerialize:S[ae][2].sliceSerialize},O),S[ae][1])}if(O.tokenStack.length>0){let Oe=O.tokenStack[O.tokenStack.length-1];(Oe[1]||kf).call(O,void 0,Oe[0])}for(R.position={start:gn(S.length>0?S[0][1].start:{line:1,column:1,offset:0}),end:gn(S.length>0?S[S.length-2][1].end:{line:1,column:1,offset:0})},ae=-1;++ae<e.transforms.length;)R=e.transforms[ae](R)||R;return R}function s(S,R,O){let Z=R-1,ae=-1,Oe=!1,gt,Xe,at,Et;for(;++Z<=O;){let Ve=S[Z];switch(Ve[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Ve[0]==="enter"?ae++:ae--,Et=void 0;break}case"lineEndingBlank":{Ve[0]==="enter"&&(gt&&!Et&&!ae&&!at&&(at=Z),Et=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Et=void 0}if(!ae&&Ve[0]==="enter"&&Ve[1].type==="listItemPrefix"||ae===-1&&Ve[0]==="exit"&&(Ve[1].type==="listUnordered"||Ve[1].type==="listOrdered")){if(gt){let wt=Z;for(Xe=void 0;wt--;){let yt=S[wt];if(yt[1].type==="lineEnding"||yt[1].type==="lineEndingBlank"){if(yt[0]==="exit")continue;Xe&&(S[Xe][1].type="lineEndingBlank",Oe=!0),yt[1].type="lineEnding",Xe=wt}else if(!(yt[1].type==="linePrefix"||yt[1].type==="blockQuotePrefix"||yt[1].type==="blockQuotePrefixWhitespace"||yt[1].type==="blockQuoteMarker"||yt[1].type==="listItemIndent"))break}at&&(!Xe||at<Xe)&&(gt._spread=!0),gt.end=Object.assign({},Xe?S[Xe][1].start:Ve[1].end),S.splice(Xe||Z,0,["exit",gt,Ve[2]]),Z++,O++}if(Ve[1].type==="listItemPrefix"){let wt={type:"listItem",_spread:!1,start:Object.assign({},Ve[1].start),end:void 0};gt=wt,S.splice(Z,0,["enter",wt,Ve[2]]),Z++,O++,at=void 0,Et=!0}}}return S[R][1]._spread=Oe,O}function o(S,R){return O;function O(Z){u.call(this,S(Z),Z),R&&R.call(this,Z)}}function l(){this.stack.push({type:"fragment",children:[]})}function u(S,R,O){this.stack[this.stack.length-1].children.push(S),this.stack.push(S),this.tokenStack.push([R,O||void 0]),S.position={start:gn(R.start),end:void 0}}function f(S){return R;function R(O){S&&S.call(this,O),h.call(this,O)}}function h(S,R){let O=this.stack.pop(),Z=this.tokenStack.pop();if(Z)Z[0].type!==S.type&&(R?R.call(this,S,Z[0]):(Z[1]||kf).call(this,S,Z[0]));else throw new Error("Cannot close `"+S.type+"` ("+pn({start:S.start,end:S.end})+"): it\u2019s not open");O.position.end=gn(S.end)}function m(){return Fn(this.stack.pop())}function p(){this.data.expectingFirstListItemValue=!0}function g(S){if(this.data.expectingFirstListItemValue){let R=this.stack[this.stack.length-2];R.start=Number.parseInt(this.sliceSerialize(S),10),this.data.expectingFirstListItemValue=void 0}}function w(){let S=this.resume(),R=this.stack[this.stack.length-1];R.lang=S}function E(){let S=this.resume(),R=this.stack[this.stack.length-1];R.meta=S}function F(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function T(){let S=this.resume(),R=this.stack[this.stack.length-1];R.value=S.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function C(){let S=this.resume(),R=this.stack[this.stack.length-1];R.value=S.replace(/(\r?\n|\r)$/g,"")}function _(S){let R=this.resume(),O=this.stack[this.stack.length-1];O.label=R,O.identifier=Jt(this.sliceSerialize(S)).toLowerCase()}function I(){let S=this.resume(),R=this.stack[this.stack.length-1];R.title=S}function W(){let S=this.resume(),R=this.stack[this.stack.length-1];R.url=S}function H(S){let R=this.stack[this.stack.length-1];if(!R.depth){let O=this.sliceSerialize(S).length;R.depth=O}}function A(){this.data.setextHeadingSlurpLineEnding=!0}function te(S){let R=this.stack[this.stack.length-1];R.depth=this.sliceSerialize(S).codePointAt(0)===61?1:2}function K(){this.data.setextHeadingSlurpLineEnding=void 0}function J(S){let O=this.stack[this.stack.length-1].children,Z=O[O.length-1];(!Z||Z.type!=="text")&&(Z=Be(),Z.position={start:gn(S.start),end:void 0},O.push(Z)),this.stack.push(Z)}function oe(S){let R=this.stack.pop();R.value+=this.sliceSerialize(S),R.position.end=gn(S.end)}function ue(S){let R=this.stack[this.stack.length-1];if(this.data.atHardBreak){let O=R.children[R.children.length-1];O.position.end=gn(S.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&e.canContainEols.includes(R.type)&&(J.call(this,S),oe.call(this,S))}function re(){this.data.atHardBreak=!0}function Y(){let S=this.resume(),R=this.stack[this.stack.length-1];R.value=S}function j(){let S=this.resume(),R=this.stack[this.stack.length-1];R.value=S}function z(){let S=this.resume(),R=this.stack[this.stack.length-1];R.value=S}function ie(){let S=this.stack[this.stack.length-1];if(this.data.inReference){let R=this.data.referenceType||"shortcut";S.type+="Reference",S.referenceType=R,delete S.url,delete S.title}else delete S.identifier,delete S.label;this.data.referenceType=void 0}function he(){let S=this.stack[this.stack.length-1];if(this.data.inReference){let R=this.data.referenceType||"shortcut";S.type+="Reference",S.referenceType=R,delete S.url,delete S.title}else delete S.identifier,delete S.label;this.data.referenceType=void 0}function me(S){let R=this.sliceSerialize(S),O=this.stack[this.stack.length-2];O.label=fs(R),O.identifier=Jt(R).toLowerCase()}function Ge(){let S=this.stack[this.stack.length-1],R=this.resume(),O=this.stack[this.stack.length-1];if(this.data.inReference=!0,O.type==="link"){let Z=S.children;O.children=Z}else O.alt=R}function x(){let S=this.resume(),R=this.stack[this.stack.length-1];R.url=S}function Pe(){let S=this.resume(),R=this.stack[this.stack.length-1];R.title=S}function Re(){this.data.inReference=void 0}function b(){this.data.referenceType="collapsed"}function $e(S){let R=this.resume(),O=this.stack[this.stack.length-1];O.label=R,O.identifier=Jt(this.sliceSerialize(S)).toLowerCase(),this.data.referenceType="full"}function Rt(S){this.data.characterReferenceType=S.type}function en(S){let R=this.sliceSerialize(S),O=this.data.characterReferenceType,Z;O?(Z=es(R,O==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Z=lr(R);let ae=this.stack[this.stack.length-1];ae.value+=Z}function kn(S){let R=this.stack.pop();R.position.end=gn(S.end)}function Ce(S){oe.call(this,S);let R=this.stack[this.stack.length-1];R.url=this.sliceSerialize(S)}function xn(S){oe.call(this,S);let R=this.stack[this.stack.length-1];R.url="mailto:"+this.sliceSerialize(S)}function pt(){return{type:"blockquote",children:[]}}function Ot(){return{type:"code",lang:null,meta:null,value:""}}function tn(){return{type:"inlineCode",value:""}}function Ar(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function To(){return{type:"emphasis",children:[]}}function mi(){return{type:"heading",depth:0,children:[]}}function pi(){return{type:"break"}}function gi(){return{type:"html",value:""}}function wi(){return{type:"image",title:null,url:"",alt:null}}function Ye(){return{type:"link",title:null,url:"",children:[]}}function Yn(S){return{type:"list",ordered:S.type==="listOrdered",start:null,spread:S._spread,children:[]}}function _o(S){return{type:"listItem",spread:S._spread,checked:null,children:[]}}function Fo(){return{type:"paragraph",children:[]}}function yi(){return{type:"strong",children:[]}}function Be(){return{type:"text",value:""}}function bi(){return{type:"thematicBreak"}}}function gn(t){return{line:t.line,column:t.column,offset:t.offset}}function Ef(t,e){let n=-1;for(;++n<e.length;){let r=e[n];Array.isArray(r)?Ef(t,r):Sk(t,r)}}function Sk(t,e){let n;for(n in e)if(xf.call(e,n))switch(n){case"canContainEols":{let r=e[n];r&&t[n].push(...r);break}case"transforms":{let r=e[n];r&&t[n].push(...r);break}case"enter":case"exit":{let r=e[n];r&&Object.assign(t[n],r);break}}}function kf(t,e){throw t?new Error("Cannot close `"+t.type+"` ("+pn({start:t.start,end:t.end})+"): a different token (`"+e.type+"`, "+pn({start:e.start,end:e.end})+") is open"):new Error("Cannot close document, a token (`"+e.type+"`, "+pn({start:e.start,end:e.end})+") is still open")}function fr(t){let e=this;e.parser=n;function n(r){return Oa(r,{...e.data("settings"),...t,extensions:e.data("micromarkExtensions")||[],mdastExtensions:e.data("fromMarkdownExtensions")||[]})}}var Cf={}.hasOwnProperty;function vf(t,e){let n=e||{};function r(s,...o){let l=r.invalid,u=r.handlers;if(s&&Cf.call(s,t)){let f=String(s[t]);l=Cf.call(u,f)?u[f]:r.unknown}if(l)return l.call(this,s,...o)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}var Tk={}.hasOwnProperty;function Da(t,e){let n=-1,r;if(e.extensions)for(;++n<e.extensions.length;)Da(t,e.extensions[n]);for(r in e)if(Tk.call(e,r))switch(r){case"extensions":break;case"unsafe":{Af(t[r],e[r]);break}case"join":{Af(t[r],e[r]);break}case"handlers":{_k(t[r],e[r]);break}default:t.options[r]=e[r]}return t}function Af(t,e){e&&t.push(...e)}function _k(t,e){e&&Object.assign(t,e)}function Sf(t,e,n,r){let s=n.enter("blockquote"),o=n.createTracker(r);o.move("> "),o.shift(2);let l=n.indentLines(n.containerFlow(t,o.current()),Fk);return s(),l}function Fk(t,e,n){return">"+(n?"":" ")+t}function ds(t,e){return Tf(t,e.inConstruct,!0)&&!Tf(t,e.notInConstruct,!1)}function Tf(t,e,n){if(typeof e=="string"&&(e=[e]),!e||e.length===0)return n;let r=-1;for(;++r<e.length;)if(t.includes(e[r]))return!0;return!1}function La(t,e,n,r){let s=-1;for(;++s<n.unsafe.length;)if(n.unsafe[s].character===`
`&&ds(n.stack,n.unsafe[s]))return/[ \t]/.test(r.before)?"":" ";return`\\
`}function _f(t,e){let n=String(t),r=n.indexOf(e),s=r,o=0,l=0;if(typeof e!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===s?++o>l&&(l=o):o=1,s=r+e.length,r=n.indexOf(e,s);return l}function qr(t,e){return!!(e.options.fences===!1&&t.value&&!t.lang&&/[^ \r\n]/.test(t.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(t.value))}function Ff(t){let e=t.options.fence||"`";if(e!=="`"&&e!=="~")throw new Error("Cannot serialize code with `"+e+"` for `options.fence`, expected `` ` `` or `~`");return e}function If(t,e,n,r){let s=Ff(n),o=t.value||"",l=s==="`"?"GraveAccent":"Tilde";if(qr(t,n)){let p=n.enter("codeIndented"),g=n.indentLines(o,Ik);return p(),g}let u=n.createTracker(r),f=s.repeat(Math.max(_f(o,s)+1,3)),h=n.enter("codeFenced"),m=u.move(f);if(t.lang){let p=n.enter(`codeFencedLang${l}`);m+=u.move(n.safe(t.lang,{before:m,after:" ",encode:["`"],...u.current()})),p()}if(t.lang&&t.meta){let p=n.enter(`codeFencedMeta${l}`);m+=u.move(" "),m+=u.move(n.safe(t.meta,{before:m,after:`
`,encode:["`"],...u.current()})),p()}return m+=u.move(`
`),o&&(m+=u.move(o+`
`)),m+=u.move(f),h(),m}function Ik(t,e,n){return(n?"":"    ")+t}function dr(t){let e=t.options.quote||'"';if(e!=='"'&&e!=="'")throw new Error("Cannot serialize title with `"+e+"` for `options.quote`, expected `\"`, or `'`");return e}function Pf(t,e,n,r){let s=dr(n),o=s==='"'?"Quote":"Apostrophe",l=n.enter("definition"),u=n.enter("label"),f=n.createTracker(r),h=f.move("[");return h+=f.move(n.safe(n.associationId(t),{before:h,after:"]",...f.current()})),h+=f.move("]: "),u(),!t.url||/[\0- \u007F]/.test(t.url)?(u=n.enter("destinationLiteral"),h+=f.move("<"),h+=f.move(n.safe(t.url,{before:h,after:">",...f.current()})),h+=f.move(">")):(u=n.enter("destinationRaw"),h+=f.move(n.safe(t.url,{before:h,after:t.title?" ":`
`,...f.current()}))),u(),t.title&&(u=n.enter(`title${o}`),h+=f.move(" "+s),h+=f.move(n.safe(t.title,{before:h,after:s,...f.current()})),h+=f.move(s),u()),l(),h}function Rf(t){let e=t.options.emphasis||"*";if(e!=="*"&&e!=="_")throw new Error("Cannot serialize emphasis with `"+e+"` for `options.emphasis`, expected `*`, or `_`");return e}function ot(t){return"&#x"+t.toString(16).toUpperCase()+";"}function hr(t,e,n){let r=ur(t),s=ur(e);return r===void 0?s===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?s===void 0?{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===void 0?{inside:!1,outside:!1}:s===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}Ma.peek=Pk;function Ma(t,e,n,r){let s=Rf(n),o=n.enter("emphasis"),l=n.createTracker(r),u=l.move(s),f=l.move(n.containerPhrasing(t,{after:s,before:u,...l.current()})),h=f.charCodeAt(0),m=hr(r.before.charCodeAt(r.before.length-1),h,s);m.inside&&(f=ot(h)+f.slice(1));let p=f.charCodeAt(f.length-1),g=hr(r.after.charCodeAt(0),p,s);g.inside&&(f=f.slice(0,-1)+ot(p));let w=l.move(s);return o(),n.attentionEncodeSurroundingInfo={after:g.outside,before:m.outside},u+f+w}function Pk(t,e,n){return n.options.emphasis||"*"}var mr=function(t){if(t==null)return Lk;if(typeof t=="function")return hs(t);if(typeof t=="object")return Array.isArray(t)?Rk(t):Ok(t);if(typeof t=="string")return Dk(t);throw new Error("Expected function, string, or object as test")};function Rk(t){let e=[],n=-1;for(;++n<t.length;)e[n]=mr(t[n]);return hs(r);function r(...s){let o=-1;for(;++o<e.length;)if(e[o].apply(this,s))return!0;return!1}}function Ok(t){let e=t;return hs(n);function n(r){let s=r,o;for(o in t)if(s[o]!==e[o])return!1;return!0}}function Dk(t){return hs(e);function e(n){return n&&n.type===t}}function hs(t){return e;function e(n,r,s){return!!(Mk(n)&&t.call(this,n,typeof r=="number"?r:void 0,s||void 0))}}function Lk(){return!0}function Mk(t){return t!==null&&typeof t=="object"&&"type"in t}function Of(t){return"\x1B[33m"+t+"\x1B[39m"}var Df=[],ms=!0,On=!1,ps="skip";function Na(t,e,n,r){let s;typeof e=="function"&&typeof n!="function"?(r=n,n=e):s=e;let o=mr(s),l=r?-1:1;u(t,void 0,[])();function u(f,h,m){let p=f&&typeof f=="object"?f:{};if(typeof p.type=="string"){let w=typeof p.tagName=="string"?p.tagName:typeof p.name=="string"?p.name:void 0;Object.defineProperty(g,"name",{value:"node ("+Of(f.type+(w?"<"+w+">":""))+")"})}return g;function g(){let w=Df,E,F,T;if((!e||o(f,h,m[m.length-1]||void 0))&&(w=Nk(n(f,m)),w[0]===On))return w;if("children"in f&&f.children){let C=f;if(C.children&&w[0]!==ps)for(F=(r?C.children.length:-1)+l,T=m.concat(C);F>-1&&F<C.children.length;){let _=C.children[F];if(E=u(_,F,T)(),E[0]===On)return E;F=typeof E[1]=="number"?E[1]:F+l}}return w}}}function Nk(t){return Array.isArray(t)?t:typeof t=="number"?[ms,t]:t==null?Df:[t]}function $a(t,e,n,r){let s,o,l;typeof e=="function"&&typeof n!="function"?(o=void 0,l=e,s=n):(o=e,l=n,s=r),Na(t,o,u,s);function u(f,h){let m=h[h.length-1],p=m?m.children.indexOf(f):void 0;return l(f,p,m)}}function gs(t,e){let n=!1;return $a(t,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,On}),!!((!t.depth||t.depth<3)&&Fn(t)&&(e.options.setext||n))}function Lf(t,e,n,r){let s=Math.max(Math.min(6,t.depth||1),1),o=n.createTracker(r);if(gs(t,n)){let m=n.enter("headingSetext"),p=n.enter("phrasing"),g=n.containerPhrasing(t,{...o.current(),before:`
`,after:`
`});return p(),m(),g+`
`+(s===1?"=":"-").repeat(g.length-(Math.max(g.lastIndexOf("\r"),g.lastIndexOf(`
`))+1))}let l="#".repeat(s),u=n.enter("headingAtx"),f=n.enter("phrasing");o.move(l+" ");let h=n.containerPhrasing(t,{before:"# ",after:`
`,...o.current()});return/^[\t ]/.test(h)&&(h=ot(h.charCodeAt(0))+h.slice(1)),h=h?l+" "+h:l,n.options.closeAtx&&(h+=" "+l),f(),u(),h}Ya.peek=$k;function Ya(t){return t.value||""}function $k(){return"<"}Ba.peek=Yk;function Ba(t,e,n,r){let s=dr(n),o=s==='"'?"Quote":"Apostrophe",l=n.enter("image"),u=n.enter("label"),f=n.createTracker(r),h=f.move("![");return h+=f.move(n.safe(t.alt,{before:h,after:"]",...f.current()})),h+=f.move("]("),u(),!t.url&&t.title||/[\0- \u007F]/.test(t.url)?(u=n.enter("destinationLiteral"),h+=f.move("<"),h+=f.move(n.safe(t.url,{before:h,after:">",...f.current()})),h+=f.move(">")):(u=n.enter("destinationRaw"),h+=f.move(n.safe(t.url,{before:h,after:t.title?" ":")",...f.current()}))),u(),t.title&&(u=n.enter(`title${o}`),h+=f.move(" "+s),h+=f.move(n.safe(t.title,{before:h,after:s,...f.current()})),h+=f.move(s),u()),h+=f.move(")"),l(),h}function Yk(){return"!"}Va.peek=Bk;function Va(t,e,n,r){let s=t.referenceType,o=n.enter("imageReference"),l=n.enter("label"),u=n.createTracker(r),f=u.move("!["),h=n.safe(t.alt,{before:f,after:"]",...u.current()});f+=u.move(h+"]["),l();let m=n.stack;n.stack=[],l=n.enter("reference");let p=n.safe(n.associationId(t),{before:f,after:"]",...u.current()});return l(),n.stack=m,o(),s==="full"||!h||h!==p?f+=u.move(p+"]"):s==="shortcut"?f=f.slice(0,-1):f+=u.move("]"),f}function Bk(){return"!"}Wa.peek=Vk;function Wa(t,e,n){let r=t.value||"",s="`",o=-1;for(;new RegExp("(^|[^`])"+s+"([^`]|$)").test(r);)s+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++o<n.unsafe.length;){let l=n.unsafe[o],u=n.compilePattern(l),f;if(l.atBreak)for(;f=u.exec(r);){let h=f.index;r.charCodeAt(h)===10&&r.charCodeAt(h-1)===13&&h--,r=r.slice(0,h)+" "+r.slice(f.index+1)}}return s+r+s}function Vk(){return"`"}function za(t,e){let n=Fn(t);return!!(!e.options.resourceLink&&t.url&&!t.title&&t.children&&t.children.length===1&&t.children[0].type==="text"&&(n===t.url||"mailto:"+n===t.url)&&/^[a-z][a-z+.-]+:/i.test(t.url)&&!/[\0- <>\u007F]/.test(t.url))}Ua.peek=Wk;function Ua(t,e,n,r){let s=dr(n),o=s==='"'?"Quote":"Apostrophe",l=n.createTracker(r),u,f;if(za(t,n)){let m=n.stack;n.stack=[],u=n.enter("autolink");let p=l.move("<");return p+=l.move(n.containerPhrasing(t,{before:p,after:">",...l.current()})),p+=l.move(">"),u(),n.stack=m,p}u=n.enter("link"),f=n.enter("label");let h=l.move("[");return h+=l.move(n.containerPhrasing(t,{before:h,after:"](",...l.current()})),h+=l.move("]("),f(),!t.url&&t.title||/[\0- \u007F]/.test(t.url)?(f=n.enter("destinationLiteral"),h+=l.move("<"),h+=l.move(n.safe(t.url,{before:h,after:">",...l.current()})),h+=l.move(">")):(f=n.enter("destinationRaw"),h+=l.move(n.safe(t.url,{before:h,after:t.title?" ":")",...l.current()}))),f(),t.title&&(f=n.enter(`title${o}`),h+=l.move(" "+s),h+=l.move(n.safe(t.title,{before:h,after:s,...l.current()})),h+=l.move(s),f()),h+=l.move(")"),u(),h}function Wk(t,e,n){return za(t,n)?"<":"["}Ha.peek=zk;function Ha(t,e,n,r){let s=t.referenceType,o=n.enter("linkReference"),l=n.enter("label"),u=n.createTracker(r),f=u.move("["),h=n.containerPhrasing(t,{before:f,after:"]",...u.current()});f+=u.move(h+"]["),l();let m=n.stack;n.stack=[],l=n.enter("reference");let p=n.safe(n.associationId(t),{before:f,after:"]",...u.current()});return l(),n.stack=m,o(),s==="full"||!h||h!==p?f+=u.move(p+"]"):s==="shortcut"?f=f.slice(0,-1):f+=u.move("]"),f}function zk(){return"["}function pr(t){let e=t.options.bullet||"*";if(e!=="*"&&e!=="+"&&e!=="-")throw new Error("Cannot serialize items with `"+e+"` for `options.bullet`, expected `*`, `+`, or `-`");return e}function Mf(t){let e=pr(t),n=t.options.bulletOther;if(!n)return e==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===e)throw new Error("Expected `bullet` (`"+e+"`) and `bulletOther` (`"+n+"`) to be different");return n}function Nf(t){let e=t.options.bulletOrdered||".";if(e!=="."&&e!==")")throw new Error("Cannot serialize items with `"+e+"` for `options.bulletOrdered`, expected `.` or `)`");return e}function ws(t){let e=t.options.rule||"*";if(e!=="*"&&e!=="-"&&e!=="_")throw new Error("Cannot serialize rules with `"+e+"` for `options.rule`, expected `*`, `-`, or `_`");return e}function $f(t,e,n,r){let s=n.enter("list"),o=n.bulletCurrent,l=t.ordered?Nf(n):pr(n),u=t.ordered?l==="."?")":".":Mf(n),f=e&&n.bulletLastUsed?l===n.bulletLastUsed:!1;if(!t.ordered){let m=t.children?t.children[0]:void 0;if((l==="*"||l==="-")&&m&&(!m.children||!m.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(f=!0),ws(n)===l&&m){let p=-1;for(;++p<t.children.length;){let g=t.children[p];if(g&&g.type==="listItem"&&g.children&&g.children[0]&&g.children[0].type==="thematicBreak"){f=!0;break}}}}f&&(l=u),n.bulletCurrent=l;let h=n.containerFlow(t,r);return n.bulletLastUsed=l,n.bulletCurrent=o,s(),h}function Yf(t){let e=t.options.listItemIndent||"one";if(e!=="tab"&&e!=="one"&&e!=="mixed")throw new Error("Cannot serialize items with `"+e+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return e}function Bf(t,e,n,r){let s=Yf(n),o=n.bulletCurrent||pr(n);e&&e.type==="list"&&e.ordered&&(o=(typeof e.start=="number"&&e.start>-1?e.start:1)+(n.options.incrementListMarker===!1?0:e.children.indexOf(t))+o);let l=o.length+1;(s==="tab"||s==="mixed"&&(e&&e.type==="list"&&e.spread||t.spread))&&(l=Math.ceil(l/4)*4);let u=n.createTracker(r);u.move(o+" ".repeat(l-o.length)),u.shift(l);let f=n.enter("listItem"),h=n.indentLines(n.containerFlow(t,u.current()),m);return f(),h;function m(p,g,w){return g?(w?"":" ".repeat(l))+p:(w?o:o+" ".repeat(l-o.length))+p}}function Vf(t,e,n,r){let s=n.enter("paragraph"),o=n.enter("phrasing"),l=n.containerPhrasing(t,r);return o(),s(),l}var ja=mr(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function Wf(t,e,n,r){return(t.children.some(function(l){return ja(l)})?n.containerPhrasing:n.containerFlow).call(n,t,r)}function zf(t){let e=t.options.strong||"*";if(e!=="*"&&e!=="_")throw new Error("Cannot serialize strong with `"+e+"` for `options.strong`, expected `*`, or `_`");return e}qa.peek=Uk;function qa(t,e,n,r){let s=zf(n),o=n.enter("strong"),l=n.createTracker(r),u=l.move(s+s),f=l.move(n.containerPhrasing(t,{after:s,before:u,...l.current()})),h=f.charCodeAt(0),m=hr(r.before.charCodeAt(r.before.length-1),h,s);m.inside&&(f=ot(h)+f.slice(1));let p=f.charCodeAt(f.length-1),g=hr(r.after.charCodeAt(0),p,s);g.inside&&(f=f.slice(0,-1)+ot(p));let w=l.move(s+s);return o(),n.attentionEncodeSurroundingInfo={after:g.outside,before:m.outside},u+f+w}function Uk(t,e,n){return n.options.strong||"*"}function Uf(t,e,n,r){return n.safe(t.value,r)}function Hf(t){let e=t.options.ruleRepetition||3;if(e<3)throw new Error("Cannot serialize rules with repetition `"+e+"` for `options.ruleRepetition`, expected `3` or more");return e}function jf(t,e,n){let r=(ws(n)+(n.options.ruleSpaces?" ":"")).repeat(Hf(n));return n.options.ruleSpaces?r.slice(0,-1):r}var qf={blockquote:Sf,break:La,code:If,definition:Pf,emphasis:Ma,hardBreak:La,heading:Lf,html:Ya,image:Ba,imageReference:Va,inlineCode:Wa,link:Ua,linkReference:Ha,list:$f,listItem:Bf,paragraph:Vf,root:Wf,strong:qa,text:Uf,thematicBreak:jf};var Gf=[Hk];function Hk(t,e,n,r){if(e.type==="code"&&qr(e,r)&&(t.type==="list"||t.type===e.type&&qr(t,r)))return!1;if("spread"in n&&typeof n.spread=="boolean")return t.type==="paragraph"&&(t.type===e.type||e.type==="definition"||e.type==="heading"&&gs(e,r))?void 0:n.spread?1:0}var Dn=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"],Xf=[{character:"	",after:"[\\r\\n]",inConstruct:"phrasing"},{character:"	",before:"[\\r\\n]",inConstruct:"phrasing"},{character:"	",inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde"]},{character:"\r",inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde","codeFencedMetaGraveAccent","codeFencedMetaTilde","destinationLiteral","headingAtx"]},{character:`
`,inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde","codeFencedMetaGraveAccent","codeFencedMetaTilde","destinationLiteral","headingAtx"]},{character:" ",after:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",before:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde"]},{character:"!",after:"\\[",inConstruct:"phrasing",notInConstruct:Dn},{character:'"',inConstruct:"titleQuote"},{atBreak:!0,character:"#"},{character:"#",inConstruct:"headingAtx",after:`(?:[\r
]|$)`},{character:"&",after:"[#A-Za-z]",inConstruct:"phrasing"},{character:"'",inConstruct:"titleApostrophe"},{character:"(",inConstruct:"destinationRaw"},{before:"\\]",character:"(",inConstruct:"phrasing",notInConstruct:Dn},{atBreak:!0,before:"\\d+",character:")"},{character:")",inConstruct:"destinationRaw"},{atBreak:!0,character:"*",after:`(?:[ 	\r
*])`},{character:"*",inConstruct:"phrasing",notInConstruct:Dn},{atBreak:!0,character:"+",after:`(?:[ 	\r
])`},{atBreak:!0,character:"-",after:`(?:[ 	\r
-])`},{atBreak:!0,before:"\\d+",character:".",after:`(?:[ 	\r
]|$)`},{atBreak:!0,character:"<",after:"[!/?A-Za-z]"},{character:"<",after:"[!/?A-Za-z]",inConstruct:"phrasing",notInConstruct:Dn},{character:"<",inConstruct:"destinationLiteral"},{atBreak:!0,character:"="},{atBreak:!0,character:">"},{character:">",inConstruct:"destinationLiteral"},{atBreak:!0,character:"["},{character:"[",inConstruct:"phrasing",notInConstruct:Dn},{character:"[",inConstruct:["label","reference"]},{character:"\\",after:"[\\r\\n]",inConstruct:"phrasing"},{character:"]",inConstruct:["label","reference"]},{atBreak:!0,character:"_"},{character:"_",inConstruct:"phrasing",notInConstruct:Dn},{atBreak:!0,character:"`"},{character:"`",inConstruct:["codeFencedLangGraveAccent","codeFencedMetaGraveAccent"]},{character:"`",inConstruct:"phrasing",notInConstruct:Dn},{atBreak:!0,character:"~"}];function Kf(t){return t.label||!t.identifier?t.label||"":fs(t.identifier)}function Jf(t){if(!t._compiled){let e=(t.atBreak?"[\\r\\n][\\t ]*":"")+(t.before?"(?:"+t.before+")":"");t._compiled=new RegExp((e?"("+e+")":"")+(/[|\\{}()[\]^$+*?.-]/.test(t.character)?"\\":"")+t.character+(t.after?"(?:"+t.after+")":""),"g")}return t._compiled}function Zf(t,e,n){let r=e.indexStack,s=t.children||[],o=[],l=-1,u=n.before,f;r.push(-1);let h=e.createTracker(n);for(;++l<s.length;){let m=s[l],p;if(r[r.length-1]=l,l+1<s.length){let E=e.handle.handlers[s[l+1].type];E&&E.peek&&(E=E.peek),p=E?E(s[l+1],t,e,{before:"",after:"",...h.current()}).charAt(0):""}else p=n.after;o.length>0&&(u==="\r"||u===`
`)&&m.type==="html"&&(o[o.length-1]=o[o.length-1].replace(/(\r?\n|\r)$/," "),u=" ",h=e.createTracker(n),h.move(o.join("")));let g=e.handle(m,t,e,{...h.current(),after:p,before:u});f&&f===g.slice(0,1)&&(g=ot(f.charCodeAt(0))+g.slice(1));let w=e.attentionEncodeSurroundingInfo;e.attentionEncodeSurroundingInfo=void 0,f=void 0,w&&(o.length>0&&w.before&&u===o[o.length-1].slice(-1)&&(o[o.length-1]=o[o.length-1].slice(0,-1)+ot(u.charCodeAt(0))),w.after&&(f=p)),h.move(g),o.push(g),u=g.slice(-1)}return r.pop(),o.join("")}function Qf(t,e,n){let r=e.indexStack,s=t.children||[],o=e.createTracker(n),l=[],u=-1;for(r.push(-1);++u<s.length;){let f=s[u];r[r.length-1]=u,l.push(o.move(e.handle(f,t,e,{before:`
`,after:`
`,...o.current()}))),f.type!=="list"&&(e.bulletLastUsed=void 0),u<s.length-1&&l.push(o.move(jk(f,s[u+1],t,e)))}return r.pop(),l.join("")}function jk(t,e,n,r){let s=r.join.length;for(;s--;){let o=r.join[s](t,e,n,r);if(o===!0||o===1)break;if(typeof o=="number")return`
`.repeat(1+o);if(o===!1)return`

<!---->

`}return`

`}var qk=/\r?\n|\r/g;function ed(t,e){let n=[],r=0,s=0,o;for(;o=qk.exec(t);)l(t.slice(r,o.index)),n.push(o[0]),r=o.index+o[0].length,s++;return l(t.slice(r)),n.join("");function l(u){n.push(e(u,s,!u))}}function nd(t,e,n){let r=(n.before||"")+(e||"")+(n.after||""),s=[],o=[],l={},u=-1;for(;++u<t.unsafe.length;){let m=t.unsafe[u];if(!ds(t.stack,m))continue;let p=t.compilePattern(m),g;for(;g=p.exec(r);){let w="before"in m||!!m.atBreak,E="after"in m,F=g.index+(w?g[1].length:0);s.includes(F)?(l[F].before&&!w&&(l[F].before=!1),l[F].after&&!E&&(l[F].after=!1)):(s.push(F),l[F]={before:w,after:E})}}s.sort(Gk);let f=n.before?n.before.length:0,h=r.length-(n.after?n.after.length:0);for(u=-1;++u<s.length;){let m=s[u];m<f||m>=h||m+1<h&&s[u+1]===m+1&&l[m].after&&!l[m+1].before&&!l[m+1].after||s[u-1]===m-1&&l[m].before&&!l[m-1].before&&!l[m-1].after||(f!==m&&o.push(td(r.slice(f,m),"\\")),f=m,/[!-/:-@[-`{-~]/.test(r.charAt(m))&&(!n.encode||!n.encode.includes(r.charAt(m)))?o.push("\\"):(o.push(ot(r.charCodeAt(m))),f++))}return o.push(td(r.slice(f,h),n.after)),o.join("")}function Gk(t,e){return t-e}function td(t,e){let n=/\\(?=[!-/:-@[-`{-~])/g,r=[],s=[],o=t+e,l=-1,u=0,f;for(;f=n.exec(o);)r.push(f.index);for(;++l<r.length;)u!==r[l]&&s.push(t.slice(u,r[l])),s.push("\\"),u=r[l];return s.push(t.slice(u)),s.join("")}function rd(t){let e=t||{},n=e.now||{},r=e.lineShift||0,s=n.line||1,o=n.column||1;return{move:f,current:l,shift:u};function l(){return{now:{line:s,column:o},lineShift:r}}function u(h){r+=h}function f(h){let m=h||"",p=m.split(/\r?\n|\r/g),g=p[p.length-1];return s+=p.length-1,o=p.length===1?o+g.length:1+g.length+r,m}}function Ga(t,e){let n=e||{},r={associationId:Kf,containerPhrasing:Zk,containerFlow:Qk,createTracker:rd,compilePattern:Jf,enter:o,handlers:{...qf},handle:void 0,indentLines:ed,indexStack:[],join:[...Gf],options:{},safe:ex,stack:[],unsafe:[...Xf]};Da(r,n),r.options.tightDefinitions&&r.join.push(Jk),r.handle=vf("type",{invalid:Xk,unknown:Kk,handlers:r.handlers});let s=r.handle(t,void 0,r,{before:`
`,after:`
`,now:{line:1,column:1},lineShift:0});return s&&s.charCodeAt(s.length-1)!==10&&s.charCodeAt(s.length-1)!==13&&(s+=`
`),s;function o(l){return r.stack.push(l),u;function u(){r.stack.pop()}}}function Xk(t){throw new Error("Cannot handle value `"+t+"`, expected node")}function Kk(t){let e=t;throw new Error("Cannot handle unknown node `"+e.type+"`")}function Jk(t,e){if(t.type==="definition"&&t.type===e.type)return 0}function Zk(t,e){return Zf(t,this,e)}function Qk(t,e){return Qf(t,this,e)}function ex(t,e){return nd(this,t,e)}function ys(t){let e=this;e.compiler=n;function n(r){return Ga(r,{...e.data("settings"),...t,extensions:e.data("toMarkdownExtensions")||[]})}}function Xa(t){if(t)throw t}var Es=ze(dd(),1);function Gr(t){if(typeof t!="object"||t===null)return!1;let e=Object.getPrototypeOf(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)}function Ka(){let t=[],e={run:n,use:r};return e;function n(...s){let o=-1,l=s.pop();if(typeof l!="function")throw new TypeError("Expected function as last argument, not "+l);u(null,...s);function u(f,...h){let m=t[++o],p=-1;if(f){l(f);return}for(;++p<s.length;)(h[p]===null||h[p]===void 0)&&(h[p]=s[p]);s=h,m?hd(m,u)(...h):l(null,...h)}}function r(s){if(typeof s!="function")throw new TypeError("Expected `middelware` to be a function, not "+s);return t.push(s),e}}function hd(t,e){let n;return r;function r(...l){let u=t.length>l.length,f;u&&l.push(s);try{f=t.apply(this,l)}catch(h){let m=h;if(u&&n)throw m;return s(m)}u||(f&&f.then&&typeof f.then=="function"?f.then(o,s):f instanceof Error?s(f):o(f))}function s(l,...u){n||(n=!0,e(l,...u))}function o(l){s(null,l)}}var Fe=class extends Error{constructor(e,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let s="",o={},l=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof e=="string"?s=e:!o.cause&&e&&(l=!0,s=e.message,o.cause=e),!o.ruleId&&!o.source&&typeof r=="string"){let f=r.indexOf(":");f===-1?o.ruleId=r:(o.source=r.slice(0,f),o.ruleId=r.slice(f+1))}if(!o.place&&o.ancestors&&o.ancestors){let f=o.ancestors[o.ancestors.length-1];f&&(o.place=f.position)}let u=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=u?u.column:void 0,this.fatal=void 0,this.file,this.message=s,this.line=u?u.line:void 0,this.name=pn(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=l&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual,this.expected,this.note,this.url}};Fe.prototype.file="";Fe.prototype.name="";Fe.prototype.reason="";Fe.prototype.message="";Fe.prototype.stack="";Fe.prototype.column=void 0;Fe.prototype.line=void 0;Fe.prototype.ancestors=void 0;Fe.prototype.cause=void 0;Fe.prototype.fatal=void 0;Fe.prototype.place=void 0;Fe.prototype.ruleId=void 0;Fe.prototype.source=void 0;var dt=ze(require("node:path"),1);var Ja=ze(require("node:process"),1);var Za=require("node:url");function ks(t){return!!(t!==null&&typeof t=="object"&&"href"in t&&t.href&&"protocol"in t&&t.protocol&&t.auth===void 0)}var Qa=["history","path","basename","stem","extname","dirname"],Xr=class{constructor(e){let n;e?ks(e)?n={path:e}:typeof e=="string"||tx(e)?n={value:e}:n=e:n={},this.cwd="cwd"in n?"":Ja.default.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Qa.length;){let o=Qa[r];o in n&&n[o]!==void 0&&n[o]!==null&&(this[o]=o==="history"?[...n[o]]:n[o])}let s;for(s in n)Qa.includes(s)||(this[s]=n[s])}get basename(){return typeof this.path=="string"?dt.default.basename(this.path):void 0}set basename(e){tl(e,"basename"),el(e,"basename"),this.path=dt.default.join(this.dirname||"",e)}get dirname(){return typeof this.path=="string"?dt.default.dirname(this.path):void 0}set dirname(e){md(this.basename,"dirname"),this.path=dt.default.join(e||"",this.basename)}get extname(){return typeof this.path=="string"?dt.default.extname(this.path):void 0}set extname(e){if(el(e,"extname"),md(this.dirname,"extname"),e){if(e.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(e.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=dt.default.join(this.dirname,this.stem+(e||""))}get path(){return this.history[this.history.length-1]}set path(e){ks(e)&&(e=(0,Za.fileURLToPath)(e)),tl(e,"path"),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path=="string"?dt.default.basename(this.path,this.extname):void 0}set stem(e){tl(e,"stem"),el(e,"stem"),this.path=dt.default.join(this.dirname||"",e+(this.extname||""))}fail(e,n,r){let s=this.message(e,n,r);throw s.fatal=!0,s}info(e,n,r){let s=this.message(e,n,r);return s.fatal=void 0,s}message(e,n,r){let s=new Fe(e,n,r);return this.path&&(s.name=this.path+":"+s.name,s.file=this.path),s.fatal=!1,this.messages.push(s),s}toString(e){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(e||void 0).decode(this.value)}};function el(t,e){if(t&&t.includes(dt.default.sep))throw new Error("`"+e+"` cannot be a path: did not expect `"+dt.default.sep+"`")}function tl(t,e){if(!t)throw new Error("`"+e+"` cannot be empty")}function md(t,e){if(!t)throw new Error("Setting `"+e+"` requires `path` to be set too")}function tx(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}var pd=function(t){let r=this.constructor.prototype,s=r[t],o=function(){return s.apply(o,arguments)};return Object.setPrototypeOf(o,r),o};var nx={}.hasOwnProperty,sl=class t extends pd{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=Ka()}copy(){let e=new t,n=-1;for(;++n<this.attachers.length;){let r=this.attachers[n];e.use(...r)}return e.data((0,Es.default)(!0,{},this.namespace)),e}data(e,n){return typeof e=="string"?arguments.length===2?(il("data",this.frozen),this.namespace[e]=n,this):nx.call(this.namespace,e)&&this.namespace[e]||void 0:e?(il("data",this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;let e=this;for(;++this.freezeIndex<this.attachers.length;){let[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);let s=n.call(e,...r);typeof s=="function"&&this.transformers.use(s)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(e){this.freeze();let n=xs(e),r=this.parser||this.Parser;return nl("parse",r),r(String(n),n)}process(e,n){let r=this;return this.freeze(),nl("process",this.parser||this.Parser),rl("process",this.compiler||this.Compiler),n?s(void 0,n):new Promise(s);function s(o,l){let u=xs(e),f=r.parse(u);r.run(f,u,function(m,p,g){if(m||!p||!g)return h(m);let w=p,E=r.stringify(w,g);ix(E)?g.value=E:g.result=E,h(m,g)});function h(m,p){m||!p?l(m):o?o(p):n(void 0,p)}}}processSync(e){let n=!1,r;return this.freeze(),nl("processSync",this.parser||this.Parser),rl("processSync",this.compiler||this.Compiler),this.process(e,s),wd("processSync","process",n),r;function s(o,l){n=!0,Xa(o),r=l}}run(e,n,r){gd(e),this.freeze();let s=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?o(void 0,r):new Promise(o);function o(l,u){let f=xs(n);s.run(e,f,h);function h(m,p,g){let w=p||e;m?u(m):l?l(w):r(void 0,w,g)}}}runSync(e,n){let r=!1,s;return this.run(e,n,o),wd("runSync","run",r),s;function o(l,u){Xa(l),s=u,r=!0}}stringify(e,n){this.freeze();let r=xs(n),s=this.compiler||this.Compiler;return rl("stringify",s),gd(e),s(e,r)}use(e,...n){let r=this.attachers,s=this.namespace;if(il("use",this.frozen),e!=null)if(typeof e=="function")f(e,n);else if(typeof e=="object")Array.isArray(e)?u(e):l(e);else throw new TypeError("Expected usable value, not `"+e+"`");return this;function o(h){if(typeof h=="function")f(h,[]);else if(typeof h=="object")if(Array.isArray(h)){let[m,...p]=h;f(m,p)}else l(h);else throw new TypeError("Expected usable value, not `"+h+"`")}function l(h){if(!("plugins"in h)&&!("settings"in h))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");u(h.plugins),h.settings&&(s.settings=(0,Es.default)(!0,s.settings,h.settings))}function u(h){let m=-1;if(h!=null)if(Array.isArray(h))for(;++m<h.length;){let p=h[m];o(p)}else throw new TypeError("Expected a list of plugins, not `"+h+"`")}function f(h,m){let p=-1,g=-1;for(;++p<r.length;)if(r[p][0]===h){g=p;break}if(g===-1)r.push([h,...m]);else if(m.length>0){let[w,...E]=m,F=r[g][1];Gr(F)&&Gr(w)&&(w=(0,Es.default)(!0,F,w)),r[g]=[h,w,...E]}}}},ol=new sl().freeze();function nl(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `parser`")}function rl(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `compiler`")}function il(t,e){if(e)throw new Error("Cannot call `"+t+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function gd(t){if(!Gr(t)||typeof t.type!="string")throw new TypeError("Expected node, got `"+t+"`")}function wd(t,e,n){if(!n)throw new Error("`"+t+"` finished async. Use `"+e+"` instead")}function xs(t){return rx(t)?t:new Xr(t)}function rx(t){return!!(t&&typeof t=="object"&&"message"in t&&"messages"in t)}function ix(t){return typeof t=="string"||sx(t)}function sx(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}var yd=ol().use(fr).use(ys).freeze();var ll={d:(t,e)=>{for(var n in e)ll.o(e,n)&&!ll.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)},ul={};ll.d(ul,{Z:()=>ux,$:()=>Ed});var gr={horizontalTab:-2,virtualSpace:-1,nul:0,eof:null,space:32};function bd(t){return t<gr.nul||t===gr.space}function al(t){return t<gr.horizontalTab}var ox={553:t=>{t.exports=function(e){var n,r;return e._compiled||(n=e.before?"(?:"+e.before+")":"",r=e.after?"(?:"+e.after+")":"",e.atBreak&&(n="[\\r\\n][\\t ]*"+n),e._compiled=new RegExp((n?"("+n+")":"")+(/[|\\{}()[\]^$+*?.-]/.test(e.character)?"\\":"")+e.character+(r||""),"g")),e._compiled}},112:t=>{function e(n,r,s){var o;if(!r)return s;for(typeof r=="string"&&(r=[r]),o=-1;++o<r.length;)if(n.indexOf(r[o])!==-1)return!0;return!1}t.exports=function(n,r){return e(n,r.inConstruct,!0)&&!e(n,r.notInConstruct)}},113:(t,e,n)=>{t.exports=function(u,f,h){for(var m,p,g,w,E,F,T,C,_=(h.before||"")+(f||"")+(h.after||""),I=[],W=[],H={},A=-1;++A<u.unsafe.length;)if(w=u.unsafe[A],s(u.stack,w))for(E=r(w);F=E.exec(_);)m="before"in w||w.atBreak,p="after"in w,g=F.index+(m?F[1].length:0),I.indexOf(g)===-1?(I.push(g),H[g]={before:m,after:p}):(H[g].before&&!m&&(H[g].before=!1),H[g].after&&!p&&(H[g].after=!1));for(I.sort(o),T=h.before?h.before.length:0,C=_.length-(h.after?h.after.length:0),A=-1;++A<I.length;)(g=I[A])<T||g>=C||g+1<C&&I[A+1]===g+1&&H[g].after&&!H[g+1].before&&!H[g+1].after||(T!==g&&W.push(l(_.slice(T,g),"\\")),T=g,!/[!-/:-@[-`{-~]/.test(_.charAt(g))||h.encode&&h.encode.indexOf(_.charAt(g))!==-1?(W.push("&#x"+_.charCodeAt(g).toString(16).toUpperCase()+";"),T++):W.push("\\"));return W.push(l(_.slice(T,C),h.after)),W.join("")};var r=n(553),s=n(112);function o(u,f){return u-f}function l(u,f){for(var h,m=/\\(?=[!-/:-@[-`{-~])/g,p=[],g=[],w=-1,E=0,F=u+f;h=m.exec(F);)p.push(h.index);for(;++w<p.length;)E!==p[w]&&g.push(u.slice(E,p[w])),g.push("\\"),E=p[w];return g.push(u.slice(E)),g.join("")}}},kd={};function Ft(t){var e=kd[t];if(e!==void 0)return e.exports;var n=kd[t]={exports:{}};return ox[t](n,n.exports,Ft),n.exports}Ft.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return Ft.d(e,{a:e}),e},Ft.d=(t,e)=>{for(var n in e)Ft.o(e,n)&&!Ft.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},Ft.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var cl={};(()=>{function t(s={}){let o=s.permalinks||[],l=s.pageResolver||(g=>[g.replace(/ /g,"_").toLowerCase()]),u=s.newClassName||"new",f=s.wikiLinkClassName||"internal",h=s.hrefTemplate||(g=>`#/page/${g}`),m;function p(g){return g[g.length-1]}return{enter:{wikiLink:function(g){m={type:"wikiLink",value:null,data:{alias:null,permalink:null,exists:null}},this.enter(m,g)}},exit:{wikiLinkTarget:function(g){let w=this.sliceSerialize(g);p(this.stack).value=w},wikiLinkAlias:function(g){let w=this.sliceSerialize(g);p(this.stack).data.alias=w},wikiLink:function(g){this.exit(g);let w=m,E=l(w.value),F=E.find(W=>o.indexOf(W)!==-1),T=F!==void 0,C;C=T?F:E[0]||"";let _=w.value;w.data.alias&&(_=w.data.alias);let I=f;T||(I+=" "+u),w.data.alias=_,w.data.permalink=C,w.data.exists=T,w.data.hName="a",w.data.hProperties={className:I,href:h(C)},w.data.hChildren=[{type:"text",value:_}]}}}}Ft.d(cl,{V:()=>t,x:()=>r});var e=Ft(113),n=Ft.n(e);function r(s={}){let o=s.aliasDivider||":";return{unsafe:[{character:"[",inConstruct:["phrasing","label","reference"]},{character:"]",inConstruct:["label","reference"]}],handlers:{wikiLink:function(l,u,f){let h=f.enter("wikiLink"),m=n()(f,l.value,{before:"[",after:"]"}),p=n()(f,l.data.alias,{before:"[",after:"]"}),g;return g=p!==m?`[[${m}${o}${p}]]`:`[[${m}]]`,h(),g}}}}})();var ax=cl.V,lx=cl.x,xd=!1;function Ed(t={}){let e=this.data();function n(r,s){e[r]?e[r].push(s):e[r]=[s]}!xd&&(this.Parser&&this.Parser.prototype&&this.Parser.prototype.blockTokenizers||this.Compiler&&this.Compiler.prototype&&this.Compiler.prototype.visitors)&&(xd=!0,console.warn("[remark-wiki-link] Warning: please upgrade to remark 13 to use this plugin")),n("micromarkExtensions",function(){var r=(arguments.length>0&&arguments[0]!==void 0?arguments[0]:{}).aliasDivider||":",s="]]";return{text:{91:{tokenize:function(o,l,u){var f,h,m=0,p=0,g=0;return function(_){return _!=="[[".charCodeAt(p)?u(_):(o.enter("wikiLink"),o.enter("wikiLinkMarker"),w(_))};function w(_){return p===2?(o.exit("wikiLinkMarker"),function(I){return al(I)||I===gr.eof?u(I):(o.enter("wikiLinkData"),o.enter("wikiLinkTarget"),E(I))}(_)):_!=="[[".charCodeAt(p)?u(_):(o.consume(_),p++,w)}function E(_){return _===r.charCodeAt(m)?f?(o.exit("wikiLinkTarget"),o.enter("wikiLinkAliasMarker"),F(_)):u(_):_===s.charCodeAt(g)?f?(o.exit("wikiLinkTarget"),o.exit("wikiLinkData"),o.enter("wikiLinkMarker"),C(_)):u(_):al(_)||_===gr.eof?u(_):(bd(_)||(f=!0),o.consume(_),E)}function F(_){return m===r.length?(o.exit("wikiLinkAliasMarker"),o.enter("wikiLinkAlias"),T(_)):_!==r.charCodeAt(m)?u(_):(o.consume(_),m++,F)}function T(_){return _===s.charCodeAt(g)?h?(o.exit("wikiLinkAlias"),o.exit("wikiLinkData"),o.enter("wikiLinkMarker"),C(_)):u(_):al(_)||_===gr.eof?u(_):(bd(_)||(h=!0),o.consume(_),T)}function C(_){return g===2?(o.exit("wikiLinkMarker"),o.exit("wikiLink"),l(_)):_!==s.charCodeAt(g)?u(_):(o.consume(_),g++,C)}}}}}}(t)),n("fromMarkdownExtensions",ax(t)),n("toMarkdownExtensions",lx(t))}var ux=Ed,gP=ul.Z,Cd=ul.$;(function(){if(globalThis.process)return;let e={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=e})();function fl(t){try{return!t.includes("://")||t.trim()!==t?!1:(new URL(t),!0)}catch{return!1}}var Ln=require("obsidian");(function(){if(globalThis.process)return;let e={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=e})();function Cs(t){let e=(0,Ln.getFrontMatterInfo)(t);return(0,Ln.parseYaml)(e.frontmatter)??{}}function vd(t,e){let n=(0,Ln.getFrontMatterInfo)(t);if(Object.keys(e).length===0)return t.slice(n.contentStart);let r=(0,Ln.stringifyYaml)(e);return n.exists?ec(t,r,n.from,n.to):`---
${r}---
${t}`}(function(){if(globalThis.process)return;let e={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=e})();function dl(t){return Ad(t)&&t.type==="file"}function Ad(t){return vt(t)&&!!t.isCanvas}function cx(t){return Ad(t)&&t.type==="text"}function wr(t,e){if(on(t))return{endIndex:t.position.end.offset,newContent:e,oldContent:t.original,startIndex:t.position.start.offset};if(dl(t))return{isCanvas:!0,newContent:e,nodeIndex:t.nodeIndex,oldContent:t.original,type:"file"};if(cx(t))return{isCanvas:!0,newContent:e,nodeIndex:t.nodeIndex,oldContent:t.original,originalReference:t.originalReference,type:"text"};if(vt(t))return{frontmatterKey:t.key,newContent:e,oldContent:t.original};throw new Error("Unknown link type")}function Sd(t){return t.sort((e,n)=>vt(e)&&vt(n)?e.key.localeCompare(n.key):on(e)&&on(n)?e.position.start.offset-n.position.start.offset:vt(e)?1:-1)}(function(){if(globalThis.process)return;let e={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=e})();async function Td(t,e,n){let r=Le(t,e),s=ut(n);await vs(t,s);let o=_d(t,n);try{await t.vault.copy(r,o)}catch(l){if(!await t.vault.exists(o))throw l}return o}async function vs(t,e){if(await t.vault.adapter.exists(e))return!1;try{return await t.vault.createFolder(e),!0}catch(n){if(!await t.vault.exists(e))throw n;return!0}}function _d(t,e){let n=Se(e);return t.vault.getAvailablePath(ke(be(e),pe(e,n)),n.slice(1))}function hl(t,e,n){let r=we(t,e);if(t.vault.adapter.insensitive){let s=be(n),o=pe(n),l;for(;l=_t(t,s,!0),!l;)o=ke(pe(s),o),s=be(s);n=ke(l.getParentPrefix(),o)}return r.toLowerCase()===n.toLowerCase()?n:_d(t,n)}async function ml(t,e){let n=await pl(t,we(t,e));return n.files.length===0&&n.folders.length===0}async function pl(t,e){let n=we(t,e),r={files:[],folders:[]};if((await t.vault.adapter.stat(n))?.type!=="folder")return r;try{return await t.vault.adapter.list(n)}catch(s){if(await t.vault.exists(n))throw s;return r}}async function As(t,e,n,r={}){let o={...{shouldFailOnMissingFile:!0},...r};await Br(async()=>{let l=await gl(t,e);if(l===null)return m();let u=await Sn(n,l);if(u===null)return!1;let f=!0;if(!await Fd(t,e,async p=>{await t.vault.process(p,g=>g!==l?(console.warn("Content has changed since it was read. Retrying...",{actualContent:g,expectedContent:l,path:p.path}),f=!1,g):u)}))return m();return f;function m(){if(o.shouldFailOnMissingFile){let p=we(t,e);throw new Error(`File '${p}' not found`)}return!0}},o)}async function gl(t,e){let n=null;return await Fd(t,e,async r=>{n=await t.vault.read(r)}),n}async function Ss(t,e,n){let r=Le(t,e,!1,!0),s=hl(t,e,n);if(r.path.toLowerCase()===s.toLowerCase())return r.path!==n&&await t.vault.rename(r,s),s;let o=ut(s);await vs(t,o);try{await t.vault.rename(r,s)}catch(l){if(!await t.vault.exists(s)||await t.vault.exists(r.path))throw l}return s}async function Fd(t,e,n){let r=we(t,e),s=Ke(t,r);if(!s||s.deleted)return!1;try{return await n(s),!0}catch(o){if(s=Ke(t,r),!s||s.deleted)return!1;throw o}}(function(){if(globalThis.process)return;let e={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=e})();async function wl(t,e,n){let r=await Sn(n),s={},o=!1;try{s=Cs(t)}catch(h){console.error(new Error(`Frontmatter parsing failed in ${e}`,{cause:h})),o=!0}for(let h of r)if(Zt(h)){let m=t.slice(h.startIndex,h.endIndex);if(m!==h.oldContent)return console.warn("Content mismatch",{actualContent:m,endIndex:h.endIndex,expectedContent:h.oldContent,path:e,startIndex:h.startIndex}),null}else if(Ts(h)){let m=sr(s,h.frontmatterKey);if(m!==h.oldContent)return console.warn("Content mismatch",{actualContent:m,expectedContent:h.oldContent,frontmatterKey:h.frontmatterKey,path:e}),null}r.sort((h,m)=>Zt(h)&&Zt(m)?h.startIndex-m.startIndex:Ts(h)&&Ts(m)?h.frontmatterKey.localeCompare(m.frontmatterKey):Zt(h)?-1:1),r=r.filter((h,m)=>h.oldContent===h.newContent?!1:m===0?!0:!dn(h,r[m-1]));for(let h=1;h<r.length;h++){let m=r[h];if(!m)continue;let p=r[h-1];if(p&&Zt(p)&&Zt(m)&&p.endIndex&&m.startIndex&&p.endIndex>m.startIndex)return console.warn("Overlapping changes",{change:m,previousChange:p}),null}let l="",u=0,f=!1;for(let h of r)Zt(h)?(l+=t.slice(u,h.startIndex),l+=h.newContent,u=h.endIndex):Ts(h)&&(o?console.error(`Cannot apply frontmatter change in ${e}, because frontmatter parsing failed`,{change:h}):(jc(s,h.frontmatterKey,h.newContent),f=!0));return l+=t.slice(u),f&&(l=vd(l,s)),l}async function _s(t,e,n,r={}){await As(t,e,async s=>qt(t,e)?hx(s,we(t,e),n):await wl(s,we(t,e),n),r)}function Kr(t){return!!t.isCanvas}function fx(t){return Kr(t)&&t.type==="file"}function dx(t){return Kr(t)&&t.type==="text"}function Zt(t){return t.startIndex!==void 0}function Ts(t){return t.frontmatterKey!==void 0}async function hx(t,e,n){let r=await Sn(n),s=mx(t),o=new Map;for(let l of r){if(!Kr(l))return console.warn("Only canvas changes are supported for canvas files",{change:l,path:e}),null;let u=s.nodes[l.nodeIndex];if(!u)return console.warn("Node not found",{nodeIndex:l.nodeIndex,path:e}),null;if(fx(l)){if(u.file!==l.oldContent)return console.warn("Content mismatch",{actualContent:u.file,expectedContent:l.oldContent,nodeIndex:l.nodeIndex,path:e,type:"file"}),null;u.file=l.newContent}else if(dx(l)){let f=o.get(l.nodeIndex);f||(f=[],o.set(l.nodeIndex,f)),f.push(l)}}for(let[l,u]of o.entries()){let f=s.nodes[l];if(!f)return console.warn("Node not found",{nodeIndex:l,path:e}),null;if(typeof f.text!="string")return console.warn("Node text is not a string",{nodeIndex:l,path:e}),null;let h=u.map(m=>wr(m.originalReference,m.newContent));f.text=await wl(f.text,`${e}.node${l.toString()}.VIRTUAL_FILE.md`,h)}return JSON.stringify(s,null,"	")}function mx(t){let e;try{e=JSON.parse(t)}catch{e=null}return(e===null||typeof e!="object")&&(e={}),e}var Id=require("obsidian");(function(){if(globalThis.process)return;let e={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=e})();async function px(t){for(let[e,n]of Object.entries(t.metadataCache.fileCache))n.hash&&(t.metadataCache.metadataCache[n.hash]||await Jr(t,e))}function wn(t){let e=[];return t.links&&e.push(...t.links),t.embeds&&e.push(...t.embeds),t.frontmatterLinks&&e.push(...t.frontmatterLinks),Sd(e),e=e.filter((n,r)=>{if(r===0)return!0;let s=e[r-1];return s?on(n)&&on(s)?n.position.start.offset!==s.position.start.offset:vt(n)&&vt(s)?n.key!==s.key:!0:!0}),e}function yl(t,e){let n=Le(t,e,!0);return Zr(t,n,()=>t.metadataCache.getBacklinksForFile(n))}async function Qt(t,e,n={}){let r=t.metadataCache.getBacklinksForFile.safe;if(r)return r(e);let s=null;return await Br(async()=>{let o=Le(t,e);await px(t),s=yl(t,o);for(let l of s.keys()){let u=Ke(t,l);if(!u)return!1;await Pd(t,u);let f=await gl(t,u);if(!f)return!1;let h=Cs(f),m=s.get(l);if(!m)return!1;for(let p of m){let g;if(on(p))g=f.slice(p.position.start.offset,p.position.end.offset);else if(vt(p)){let w=sr(h,p.key);if(typeof w!="string")return!1;g=w}else return!0;if(g!==p.original)return!1}}return!0},n),s}async function Jr(t,e,n={}){let r=Ze("MetadataCache:getCacheSafe"),s=null;return await Br(async()=>{let o=Ke(t,e);if(!o||o.deleted)return s=null,!0;await Pd(t,o);let l=t.metadataCache.getFileInfo(o.path),u=await t.vault.adapter.stat(o.path);return l?u?o.stat.mtime<u.mtime?(t.vault.onChange("modified",o.path,void 0,u),r(`Cached timestamp for ${o.path} is from ${new Date(o.stat.mtime).toString()} which is older than the file system modification timestamp ${new Date(u.mtime).toString()}`),!1):l.mtime<u.mtime?(r(`File cache info for ${o.path} is from ${new Date(l.mtime).toString()} which is older than the file modification timestamp ${new Date(u.mtime).toString()}`),!1):(s=t.metadataCache.getFileCache(o),s?!0:(r(`File cache for ${o.path} is missing`),!1)):(r(`File stat for ${o.path} is missing`),!1):(r(`File cache info for ${o.path} is missing`),!1)},n),s}function gx(t,e){if(!e.deleted)return Xt;let n=[],r=e;for(;r.deleted;)n.push(r.path),t.vault.fileMap[r.path]=r,r=r.parent??Nr(t,ut(r.path),!0);return ct(e)&&t.metadataCache.uniqueFileLookup.add(e.name.toLowerCase(),e),()=>{for(let s of n)delete t.vault.fileMap[s];ct(e)&&t.metadataCache.uniqueFileLookup.remove(e.name.toLowerCase(),e)}}function Zr(t,e,n){let r=gx(t,e);try{return n()}finally{r()}}async function Pd(t,e){if(!Gt(t,e))return;let n=we(t,e);for(let r of t.workspace.getLeavesOfType("markdown"))r.view instanceof Id.MarkdownView&&r.view.file?.path===n&&await r.view.save()}(function(){if(globalThis.process)return;let e={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=e})();function Rd(t){return t.vault.getConfig("newLinkFormat")==="relative"}function Od(t){return!t.vault.getConfig("useMarkdownLinks")}(function(){if(globalThis.process)return;let e={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=e})();var yx="\\|",bx=/[\\\x00\x08\x0B\x0C\x0E-\x1F ]/g,kx=/[\\[\]<>_*~=`$]/g,Dd=/(?<!\\)\|/g,Ld="|";function xx(t){let e=yr(t.app,t.link,t.oldSourcePathOrFile??t.newSourcePathOrFile);return e?ei({app:t.app,link:t.link,newSourcePathOrFile:t.newSourcePathOrFile,newTargetPathOrFile:e,oldSourcePathOrFile:t.oldSourcePathOrFile,shouldForceMarkdownLinks:t.shouldForceMarkdownLinks,shouldUpdateFilenameAlias:t.shouldUpdateFilenameAlias}):t.link.original}async function bl(t,e,n,r={}){await _s(t,e,async()=>{let s=await Jr(t,e);return await Ix(s,qt(t,e),n)},r)}function yr(t,e,n){let{linkPath:r}=Md(e.link);return t.metadataCache.getFirstLinkpathDest(r,we(t,n))}function Ex(t){let{app:e}=t,r=(e.fileManager.generateMarkdownLink.defaultOptionsFn??(()=>({})))();t={...{isEmptyEmbedAliasAllowed:!0},...r,...t};let o=Le(e,t.targetPathOrFile,t.isNonExistingFileAllowed);return Zr(e,o,()=>Tx(t))}function Qr(t){let e=Ox(t);if(e)return e;let n="!",r=t.startsWith(n);r&&(t=Kn(t,n));let o=yd().use(fr).use(Cd,{aliasDivider:Ld}).parse(t);if(o.children.length!==1)return null;let l=o.children[0];if(l?.type!=="paragraph"||l.children.length!==1)return null;let u=l.children[0];if(u?.position?.start.offset!==0||u.position.end.offset!==t.length)return null;switch(u.type){case"link":return Rx(u,t,r);case"wikiLink":return Dx(u,t,r);default:return null}}function Cx(t){let{app:e,displayText:n,isWikilink:r,newSourcePathOrFile:s,oldSourcePathOrFile:o,oldTargetPath:l,targetPathOrFile:u}=t;if(r===!1)return!1;if(!n)return!0;let f=Le(e,u,!0),h=we(e,s),m=we(e,o??s),p=be(h),g=be(m),w=new Set;for(let F of[f.path,l]){if(!F)continue;let T=we(e,F);w.add(T),w.add(pe(T)),w.add(Jn(p,T)),w.add(Jn(g,T))}for(let F of[m,h])w.add(e.metadataCache.fileToLinktext(f,F,!1));let E=Ae((0,Fs.normalizePath)(n.split(" > ")[0]??""),/^\.\//g,"").toLowerCase();for(let F of w){if(F.toLowerCase()===E)return!0;let T=be(F),C=pe(F,Se(F));if(ke(T,C).toLowerCase()===E)return!0}return!1}function Md(t){let e=(0,Fs.parseLinktext)(Mr(t));return{linkPath:e.path,subpath:e.subpath}}function vx(t){return Qr(t)?.hasAngleBrackets??!1}function Nd(t){return Qr(t)?.isEmbed??!1}function Ax(t){return Qr(t)?.url.startsWith("./")??!1}function $d(t){return Qr(t)?.isWikilink??!1}function ei(t){let{app:e,link:n,newSourcePathOrFile:r,newTargetPathOrFile:s,oldSourcePathOrFile:o,oldTargetPathOrFile:l,shouldForceMarkdownLinks:u,shouldUpdateFilenameAlias:f}=t;if(!s)return n.original;let h=Le(e,s,!0),m=we(e,l??s),p=$d(n.original)&&u!==!0,{subpath:g}=Md(n.link),w=!f;if(qt(e,r)&&dl(n))return h.path+g;let E;if(p){let T=Qr(n.original);T?.alias&&(E=T.alias,w=!0)}return E??=Cx({app:e,displayText:n.displayText,isWikilink:p,newSourcePathOrFile:r,oldSourcePathOrFile:o,oldTargetPath:m,targetPathOrFile:h})?void 0:n.displayText,w||(E===pe(m,Se(m))?E=h.basename:E===pe(m)&&(E=h.name)),Ex({alias:E,app:e,isWikilink:u?!1:void 0,originalLink:n.original,sourcePathOrFile:r,subpath:g,targetPathOrFile:h})}async function Yd(t){let{app:e,newSourcePathOrFile:n,oldSourcePathOrFile:r,shouldForceMarkdownLinks:s,shouldUpdateEmbedOnlyLinks:o,shouldUpdateFilenameAlias:l}=t;qt(e,n)&&!e.internalPlugins.getEnabledPluginById(Ut.Canvas)||await bl(e,n,u=>{let f=Nd(u.original);if(!(o!==void 0&&o!==f))return xx({app:e,link:u,newSourcePathOrFile:n,oldSourcePathOrFile:r,shouldForceMarkdownLinks:s,shouldUpdateFilenameAlias:l})},t)}function Sx(t,e,n,r,s){let o;return e.path===n&&r?o=r:s.shouldForceRelativePath?o=Jn(be(n),s.isWikilink?ac(t,e):e.path)+r:o=t.metadataCache.fileToLinktext(e,n,s.isWikilink)+r,s.shouldForceRelativePath&&s.shouldUseLeadingDot&&!o.startsWith(".")&&!o.startsWith("#")&&(o=`./${o}`),o}function Tx(t){let{app:e}=t,n=Le(e,t.targetPathOrFile,t.isNonExistingFileAllowed),r=we(e,t.sourcePathOrFile),s=t.subpath??"",o=Px(t,n),l=Sx(e,n,r,s,o);return o.isWikilink?Fx(l,t.alias,o.isEmbed):_x(l,n,t,o)}function _x(t,e,n,r){let{app:s}=n,o=r.isEmbed?"!":"",l=r.shouldUseAngleBrackets?`<${t}>`:Ae(t,bx,({substring:h})=>encodeURIComponent(h)),u=n.alias??"";!u&&(!r.isEmbed||!n.isEmptyEmbedAliasAllowed)&&(u=!n.shouldIncludeAttachmentExtensionToEmbedAlias||Gt(s,e)?e.basename:e.name);let f=Ae(u,kx,"\\$&");return`${o}[${f}](${l})`}function Fx(t,e,n){let r=n?"!":"",s=e??"";if(s&&s.toLowerCase()===t.toLowerCase())return`${r}[[${s}]]`;let o=s?`|${s}`:"";return`${r}[[${t}${o}]]`}async function Ix(t,e,n){if(!t)return[];let r=[],s=(t.sections??[]).filter(o=>o.type==="table").map(o=>({end:o.position.end.offset,start:o.position.start.offset}));for(let o of wn(t)){let l=await n(o);if(l===void 0)continue;let u=wr(o,l);e?Kr(u)?r.push(u):console.warn("Unsupported file change",u):(Lx(u,s)&&(u.newContent=u.newContent.replaceAll(Dd,yx)),r.push(u))}return r}function Px(t,e){let{app:n}=t;return{isEmbed:t.isEmbed??(t.originalLink?Nd(t.originalLink):void 0)??!Gt(n,e),isWikilink:t.isWikilink??(t.originalLink?$d(t.originalLink):void 0)??Od(n),shouldForceRelativePath:t.shouldForceRelativePath??Rd(n),shouldUseAngleBrackets:t.shouldUseAngleBrackets??(t.originalLink?vx(t.originalLink):void 0)??!1,shouldUseLeadingDot:t.shouldUseLeadingDot??(t.originalLink?Ax(t.originalLink):void 0)??!1}}function Rx(t,e,n){let r="<",s="](",o=")",l=t.children[0],u=e.slice((l?.position?.end.offset??1)+s.length,(t.position?.end.offset??0)-o.length),f=e.startsWith(r)||u.startsWith(r),h=fl(t.url),m=t.url;if(!h&&!f)try{m=decodeURIComponent(m)}catch(p){console.error(`Failed to decode URL ${m}`,p)}return{alias:l?.value,hasAngleBrackets:f,isEmbed:n,isExternal:h,isWikilink:!1,title:t.title??void 0,url:m}}function Ox(t){return fl(t)?{isEmbed:!1,isExternal:!0,isWikilink:!1,url:t}:null}function Dx(t,e,n){return{alias:e.includes(Ld)?t.data.alias:void 0,isEmbed:n,isExternal:!1,isWikilink:!0,url:t.value}}function Lx(t,e){return!Zt(t)||!Dd.test(t.newContent)?!1:e.some(n=>n.start<=t.startIndex&&t.endIndex<=n.end)}(function(){if(globalThis.process)return;let e={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=e})();async function Bd(t,e,n){let r=Ze("Logger:invokeAsyncAndLog"),s=performance.now();n??=An(1),r(`${t}:start`,{fn:e,timestampStart:s}),r.printStackTrace(n);try{await e();let o=performance.now();r(`${t}:end`,{duration:o-s,fn:e,timestampEnd:o,timestampStart:s}),r.printStackTrace(n)}catch(o){let l=performance.now();throw r(`${t}:error`,{duration:l-s,error:o,fn:e,timestampEnd:l,timestampStart:s}),r.printStackTrace(n),o}}(function(){if(globalThis.process)return;let e={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=e})();function yn(t,e,n,r){r??=An(1),Kt(()=>Mx(t,e,n,r))}async function Mx(t,e,n,r){n??=6e4,r??=An(1);let o=Vd(t).value;o.items.push({fn:e,stackTrace:r,timeoutInMilliseconds:n}),o.promise=o.promise.then(()=>Wd(t)),await o.promise}function Vd(t){return cn(t,"queue",{items:[],promise:Promise.resolve()})}async function Wd(t){let e=Vd(t).value,n=e.items[0];n&&(await ma(()=>pa(n.timeoutInMilliseconds,()=>Bd(Wd.name,n.fn,n.stackTrace))),e.items.shift())}(function(){if(globalThis.process)return;let e={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=e})();async function Is(t,e){let n=_t(t,e);for(;n;){if(!await ml(t,n))return;let r=n.parent;await ti(t,n.path),n=r}}async function ti(t,e,n,r,s){let o=Tn(t,e);if(!o)return!1;let l=ct(o)||(s??!0);if(ct(o)){let u=await Qt(t,o);n&&u.clear(n),u.count()!==0&&(r&&new Notice(`Attachment ${o.path} is still used by other notes. It will not be deleted.`),l=!1)}else if(na(o)){let u=await pl(t,o);for(let f of[...u.files,...u.folders])l&&=await ti(t,f,n,r);l&&=await ml(t,o)}if(l)try{await t.fileManager.trashFile(o)}catch(u){await t.vault.exists(o.path)&&(Lr(new Error(`Failed to delete ${o.path}`,{cause:u})),l=!1)}return l}(function(){if(globalThis.process)return;let e={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=e})();var kl=new Map,ni=new Set,Ps=new Map;function jd(t,e){let n=Rs(t.app),r=t.manifest.id;n.set(r,e),Ud(t.app),t.register(()=>{n.delete(r),Ud(t.app)});let s=t.app;t.registerEvent(s.vault.on("delete",o=>{Vx(t,o)})),t.registerEvent(s.vault.on("rename",(o,l)=>{Hx(t,o,l)})),t.registerEvent(s.metadataCache.on("deleted",(o,l)=>{zx(t,o,l)}))}async function Nx(t,e,n,r,s){let o=Ps.get(e);if(o){Ps.delete(e);for(let l of o)await xl(t,l.oldPath,n,r,s,l.combinedBacklinksMap)}}async function $x(t,e,n,r,s){if(r.set(e,n),!Je(t,e))return;let o=ri(t),l=await Zn(t,e),u=o.shouldRenameAttachmentFolder?await Zn(t,n):l,f=_t(t,l);if(!f||l===u&&!o.shouldRenameAttachmentFiles)return;let h=[];if(await ia(t,e))Hd.Vault.recurseChildren(f,g=>{ct(g)&&h.push(g)});else for(let g of s){let w=yr(t,g,e);w&&w.path.startsWith(l)&&(await Qt(t,w)).keys().length===1&&h.push(w)}let m=pe(e,Se(e)),p=pe(n,Se(n));for(let g of h){if(Je(t,g))continue;let w=Jn(l,g.path),E=ke(u,be(w)),F=o.shouldRenameAttachmentFiles?Ae(g.basename,m,p):g.basename,T=ke(E,an(F,g.extension));if(g.path!==T){if(o.shouldDeleteConflictingAttachments){let C=Ke(t,T);C&&await t.fileManager.trashFile(C)}else T=t.vault.getAvailablePath(ke(E,F),g.extension);r.set(g.path,T)}}}function Rs(t){return cn(t,"renameDeleteHandlersMap",new Map).value}function ri(t){let e=Rs(t),n=Array.from(e.values()).reverse(),r={};for(let s of n){let o=s();r.shouldDeleteConflictingAttachments||=o.shouldDeleteConflictingAttachments??!1,r.shouldDeleteEmptyFolders||=o.shouldDeleteEmptyFolders??!1,r.shouldHandleDeletions||=o.shouldHandleDeletions??!1,r.shouldHandleRenames||=o.shouldHandleRenames??!1,r.shouldRenameAttachmentFiles||=o.shouldRenameAttachmentFiles??!1,r.shouldRenameAttachmentFolder||=o.shouldRenameAttachmentFolder??!1,r.shouldUpdateFilenameAliases||=o.shouldUpdateFilenameAliases??!1;let l=r.isPathIgnored;r.isPathIgnored=u=>l?.(u)??o.isPathIgnored?.(u)??!1}return r}async function Yx(t,e,n,r,s){if(!t.vault.adapter.insensitive||e.toLowerCase()!==n.toLowerCase())return!1;let o=ke(be(n),`__temp__${pe(n)}`);return await Gd(t,n,o),await xl(t,e,o,r,s),await t.vault.rename(Le(t,o),n),!0}async function Bx(t,e){if(Ze("RenameDeleteHandler:handleDelete")(`Handle Delete ${e}`),!Je(t,e))return;let n=ri(t);if(!n.shouldHandleDeletions||n.isPathIgnored?.(e))return;let r=kl.get(e);if(kl.delete(e),r){let l=wn(r);for(let u of l){let f=yr(t,u,e);f&&(Je(t,f)||await ti(t,f,e,n.shouldDeleteEmptyFolders))}}let s=await Zn(t,e),o=_t(t,s);o&&await ia(t,e)&&await ti(t,o,e,!1,n.shouldDeleteEmptyFolders)}function Vx(t,e){let n=t.app;if(!El(t))return;let r=e.path;yn(n,()=>Bx(n,r))}function Wx(t,e,n){let r=ri(t);r.isPathIgnored?.(e.path)||r.shouldHandleDeletions&&Gt(t,e)&&n&&kl.set(e.path,n)}function zx(t,e,n){El(t)&&Wx(t.app,e,n)}function Ux(t,e,n){let r=qd(e,n);if(Ze("RenameDeleteHandler:handleRename")(`Handle Rename ${r}`),ni.has(r)){ni.delete(r);return}let s=ri(t);if(!s.shouldHandleRenames||s.isPathIgnored?.(e)||s.isPathIgnored?.(n))return;let o=t.metadataCache.getCache(e)??t.metadataCache.getCache(n),l=o?wn(o):[],u=yl(t,e).data;yn(t,()=>xl(t,e,n,u,l))}async function xl(t,e,n,r,s,o){await Nx(t,e,n,r,s),await jx(t,e,n,r,s),!await Yx(t,e,n,r,s)&&await wc(t.fileManager,{updateAllLinks:()=>it},async()=>{try{let l=new Map;await $x(t,e,n,l,s);let u=new Map;zd(r,l,u,e);for(let m of l.keys()){if(m===e)continue;let p=(await Qt(t,m)).data;zd(p,l,u,m)}let f=new Set;for(let[m,p]of l.entries()){if(m===e)continue;let g=await Gd(t,m,p);l.set(m,g),f.add(be(m))}let h=ri(t);if(h.shouldDeleteEmptyFolders)for(let m of f)await Is(t,m);for(let[m,p]of Array.from(u.entries()).concat(Array.from(o?.entries()??[])))await bl(t,m,g=>{let w=p.get(or(g));if(!w)return;let E=l.get(w);if(E)return ei({app:t,link:g,newSourcePathOrFile:m,newTargetPathOrFile:E,oldTargetPathOrFile:w,shouldUpdateFilenameAlias:h.shouldUpdateFilenameAliases})},{shouldFailOnMissingFile:!1});if(Je(t,n)&&await Yd({app:t,newSourcePathOrFile:n,oldSourcePathOrFile:e,shouldFailOnMissingFile:!1,shouldUpdateFilenameAlias:h.shouldUpdateFilenameAliases}),!Ke(t,n)){let m=Ps.get(n);m||(m=[],Ps.set(n,m)),m.push({combinedBacklinksMap:u,oldPath:e})}}finally{let l=Array.from(ni);yn(t,()=>{for(let u of l)ni.delete(u)})}})}function Hx(t,e,n){if(!El(t)||!ct(e))return;let r=e.path;Ux(t.app,n,r)}function zd(t,e,n,r){for(let[s,o]of t.entries()){let l=e.get(s)??s,u=n.get(l)??new Map;n.set(l,u);for(let f of o)u.set(or(f),r)}}function Ud(t){let e=Rs(t);Ze("RenameDeleteHandler:logRegisteredHandlers")(`Plugins with registered rename/delete handlers: ${JSON.stringify(Array.from(e.keys()))}`)}function qd(t,e){return`${t} -> ${e}`}async function jx(t,e,n,r,s){let o=t.metadataCache.getCache(e)??t.metadataCache.getCache(n),l=o?wn(o):[],u=Le(t,e,!0),f=new Map;await Zr(t,u,async()=>{f=(await Qt(t,u)).data});for(let h of l)s.includes(h)||s.push(h);for(let[h,m]of f.entries()){let p=r.get(h);p||(p=[],r.set(h,p));for(let g of m)p.includes(g)||p.push(g)}}async function Gd(t,e,n){if(n=hl(t,e,n),e===n)return n;let r=qd(e,n);return ni.add(r),n=await Ss(t,e,n),n}function El(t){let e=t.app,n=t.manifest.id,r=Rs(e);return Array.from(r.keys())[0]===n}var kp=ze(Ym(),1);var Nn=require("obsidian");(function(){if(globalThis.process)return;let e={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=e})();function et(t,e){t.createEl("strong",{cls:"markdown-rendered code"},n=>{n.createEl("code",{text:e})})}(function(){if(globalThis.process)return;let e={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=e})();async function Bm(t){let e=t.items,n=0,r=new Notice("",0),o=sleep(t.noticeMinTimeoutInMilliseconds??2e3),l=createEl("progress");if(l.max=e.length,t.shouldShowProgressBar){let u=createFragment();t.progressBarTitle&&u.appendText(t.progressBarTitle),u.appendChild(l),r.setMessage(u)}for(let u of e){if(t.abortSignal?.aborted){r.hide();return}n++;let f=`# ${n.toString()} / ${e.length.toString()}`,h=t.buildNoticeMessage(u,f);t.shouldShowProgressBar||r.setMessage(h),Ze("Loop")(h);let m=new Error(Mi);try{await t.processItem(u)}catch(p){if(console.error("Error processing item",u),!t.shouldContinueOnError)throw r.hide(),p;m.cause=p,Ni(m)}l.value++}await o,r.hide()}var Vl=require("obsidian");(function(){if(globalThis.process)return;let e={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=e})();var Wl=class extends ln{isConfirmed=!1;options;constructor(e,n){super(e,n,B.ConfirmModal);let r={app:e.app,cancelButtonText:"Cancel",cssClass:"",message:e.message,okButtonText:"OK",title:""};this.options={...r,...e}}onClose(){super.onClose(),this.resolve(this.isConfirmed)}onOpen(){super.onOpen(),this.titleEl.setText(this.options.title),this.contentEl.createEl("p",{text:this.options.message});let e=new Vl.ButtonComponent(this.contentEl);e.setButtonText(this.options.okButtonText),e.setCta(),e.onClick(()=>{this.isConfirmed=!0,this.close()}),e.setClass(B.OkButton);let n=new Vl.ButtonComponent(this.contentEl);n.setButtonText(this.options.cancelButtonText),n.onClick(this.close.bind(this)),n.setClass(B.CancelButton)}};async function Vm(t){return await Qn(e=>new Wl(t,e))}var jm=require("obsidian");var Ul=ze(zt(),1);var fi=require("obsidian");(function(){if(globalThis.process)return;let e={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=e})();var zl=class extends ln{isOkClicked=!1;options;value;constructor(e,n){super(e,n,B.PromptModal);let r={app:e.app,cancelButtonText:"Cancel",defaultValue:"",okButtonText:"OK",placeholder:"",title:"",valueValidator:Xt};this.options={...r,...e},this.value=e.defaultValue??""}onClose(){super.onClose(),this.resolve(this.isOkClicked?this.value:null)}onOpen(){super.onOpen(),this.titleEl.setText(this.options.title);let e=new fi.TextComponent(this.contentEl),n=e.inputEl,r=async()=>{let l=await this.options.valueValidator(n.value);n.setCustomValidity(l??""),n.reportValidity()};e.setValue(this.value),e.setPlaceholder(this.options.placeholder),n.addClass(B.TextBox),e.onChange(l=>{this.value=l}),n.addEventListener("keydown",l=>{l.key==="Enter"?this.handleOk(l,e):l.key==="Escape"&&this.close()}),n.addEventListener("input",fn(r)),n.addEventListener("focus",fn(r)),Kt(r);let s=new fi.ButtonComponent(this.contentEl);s.setButtonText(this.options.okButtonText),s.setCta(),s.onClick(l=>{this.handleOk(l,e)}),s.setClass(B.OkButton);let o=new fi.ButtonComponent(this.contentEl);o.setButtonText(this.options.cancelButtonText),o.onClick(this.close.bind(this)),o.setClass(B.CancelButton)}handleOk(e,n){e.preventDefault(),n.inputEl.checkValidity()&&(this.isOkClicked=!0,this.close())}};async function Wm(t){return await Qn(e=>new zl(t,e))}var Wv=/^\.{3,}$/,zv=/[. ]+$/,Hl=/[\\/:*?"<>|]/,di=/\${(?<Token>.+?)(?::(?<Format>.+?))?}/g;function jl(t){let e=new Map;try{let n=new Function("exports",t),r={};n(r);for(let[s,o]of Object.entries(r))e.set(s,o);return e}catch(n){throw new Error("Error initializing custom token formatters",{cause:n})}}function Uv(t){return(0,Ul.default)().format(t)}function zm(t,e,n,r){let s=Ke(t,e);return s?(0,Ul.default)(r(s)).format(n):""}function Hv(){return ql("0123456789")}function jv(){return ql("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ")}function qv(){return ql("ABCDEFGHIJKLMNOPQRSTUVWXYZ")}function Gv(){return crypto.randomUUID()}function Xv(t,e,n){let r=Ke(t,e);if(!r)return"";let s=t.metadataCache.getFileCache(r);if(!s?.frontmatter)return"";let o=sr(s.frontmatter,n)??"";return String(o)}var xt=class t{constructor(e,n,r=""){this.app=e;this.filePath=n;this.originalCopiedFileName=r;this.fileName=pe(n,Se(n)),this.folderName=pe(be(n)),this.folderPath=be(n);let s=Se(r);this.originalCopiedFileName=pe(r,s),this.originalCopiedFileExtension=s.slice(1)}static formatters=new Map;static{this.registerCustomFormatters("")}fileName;folderName;folderPath;originalCopiedFileExtension;static isRegisteredToken(e){return t.formatters.has(e.toLowerCase())}static registerCustomFormatters(e){this.formatters.clear(),this.registerFormatter("date",(r,s)=>Uv(s)),this.registerFormatter("fileCreationDate",(r,s)=>zm(r.app,r.filePath,s,o=>o.stat.ctime)),this.registerFormatter("fileModificationDate",(r,s)=>zm(r.app,r.filePath,s,o=>o.stat.mtime)),this.registerFormatter("fileName",r=>r.fileName),this.registerFormatter("filePath",r=>r.filePath),this.registerFormatter("folderName",r=>r.folderName),this.registerFormatter("folderPath",r=>r.folderPath),this.registerFormatter("frontmatter",(r,s)=>Xv(r.app,r.filePath,s)),this.registerFormatter("originalCopiedFileExtension",r=>r.originalCopiedFileExtension),this.registerFormatter("originalCopiedFileName",r=>r.originalCopiedFileName),this.registerFormatter("prompt",r=>r.prompt()),this.registerFormatter("randomDigit",()=>Hv()),this.registerFormatter("randomDigitOrLetter",()=>jv()),this.registerFormatter("randomLetter",()=>qv()),this.registerFormatter("uuid",()=>Gv());let n=jl(e)??new Map;for(let[r,s]of n.entries())this.registerFormatter(r,s)}static registerFormatter(e,n){this.formatters.set(e.toLowerCase(),n)}async fillTemplate(e){return await tc(e,di,async(n,r,s)=>{let o=t.formatters.get(r.toLowerCase());if(!o)throw new Error(`Invalid token: ${r}`);try{return String(await o(this,s)??"")}catch(l){throw new Error(`Error formatting token \${${r}}`,{cause:l})}})}async prompt(){let e=await Wm({app:this.app,defaultValue:this.originalCopiedFileName,title:"Provide a value for ${prompt} template",valueValidator:n=>Us(n,!1)});if(e===null)throw new Error("Prompt cancelled");return e}};function Us(t,e=!0){if(e){t=Um(t);let n=Hm(t);if(n)return`Unknown token: ${n}`}else if(t.match(di))return"Tokens are not allowed in file name";return t==="."||t===".."?"":t?Hl.test(t)?`File name "${t}" contains invalid symbols`:Wv.test(t)?`File name "${t}" contains more than two dots`:zv.test(t)?`File name "${t}" contains trailing dots or spaces`:"":"File name is empty"}function hi(t,e=!0){if(e){t=Um(t);let r=Hm(t);if(r)return`Unknown token: ${r}`}else if(t.match(di))return"Tokens are not allowed in path";if(t=Kn(t,"/"),t=$i(t,"/"),t==="")return"";let n=t.split("/");for(let r of n){let s=Us(r);if(s)return s}return""}function ql(t){return t[Math.floor(Math.random()*t.length)]??""}function Um(t){return Ae(t,di,(e,n)=>`\${${n}}`)}function Hm(t){let e=t.matchAll(di);for(let n of e){let r=n[1]??"";if(!xt.isRegisteredToken(r))return r}return null}async function Hs(t,e,n){return await Jv(t,new xt(t.app,e,n))}async function js(t,e){return await qm(t,t.settings.generatedAttachmentFilename,e)}function Kv(t,e){if(!t.settings.specialCharacters)return e;e=e.replace(t.settings.specialCharactersRegExp,t.settings.specialCharactersReplacement);let n=Xn(t.settings.specialCharactersReplacement);return e=e.replace(new RegExp(`${n}{2,}`,"g"),t.settings.specialCharactersReplacement),e}async function Jv(t,e){return await qm(t,t.settings.attachmentFolderPath,e)}async function qm(t,e,n){let r=await n.fillTemplate(e),s=hi(r,!1);if(s)throw new Error(`Resolved path ${r} is invalid: ${s}`);return t.settings.shouldRenameAttachmentsToLowerCase&&(r=r.toLowerCase()),r=Kv(t,r),(r.startsWith("./")||r.startsWith("../"))&&(r=ke(n.folderPath,r)),r=(0,jm.normalizePath)(r),r}async function Gm(t,e,n,r){let s=t.app;n??=e.path,r??=()=>!0;let o=new Nn.Notice(`Collecting attachments for ${e.path}`),l=new Map,u=qt(s,e);await _s(s,e,async()=>{let f=await Jr(s,e);if(!f)return[];let h=u?await Zv(s,e):wn(f),m=[];for(let p of h){let g=await Qv(t,p,e.path,n);if(!g||!r(g.oldAttachmentPath))continue;if((await Qt(s,g.oldAttachmentPath)).count()>1?g.newAttachmentPath=await Td(s,g.oldAttachmentPath,g.newAttachmentPath):(g.newAttachmentPath=await Ss(s,g.oldAttachmentPath,g.newAttachmentPath),await Is(s,be(g.oldAttachmentPath))),l.set(g.oldAttachmentPath,g.newAttachmentPath),!u){let E=ei({app:s,link:p,newSourcePathOrFile:e,newTargetPathOrFile:g.newAttachmentPath,oldTargetPathOrFile:g.oldAttachmentPath});m.push(wr(p,E))}}return m}),u&&await As(s,e,f=>{let h=JSON.parse(f);for(let m of h.nodes){if(m.type!=="file")continue;let p=l.get(m.file);p&&(m.file=p)}return or(h)}),o.hide()}function Xm(t,e){let n=t.app.workspace.getActiveFile();return Je(t.app,n)?(e||yn(t.app,()=>qs(t,n?.parent??Ht(new Error("Parent folder not found")))),!0):!1}function Km(t,e){let n=t.app.workspace.getActiveFile();if(!n||!Je(t.app,n))return!1;if(!e){if(t.settings.isPathIgnored(n.path))return new Nn.Notice("Note path is ignored"),!0;yn(t.app,()=>Gm(t,n))}return!0}function Jm(t){yn(t.app,()=>qs(t,t.app.vault.getRoot()))}async function qs(t,e){if(!await Vm({app:t.app,message:createFragment(r=>{r.appendText("Do you want to collect attachments for all notes in folder: "),et(r,e.path),r.appendText(" and all its subfolders?"),r.createEl("br"),r.appendText("This operation cannot be undone.")}),title:createFragment(r=>{(0,Nn.setIcon)(r.createSpan(),"lucide-alert-triangle"),r.appendText(" Collect attachments in folder")})}))return;t.consoleDebug(`Collect attachments in folder: ${e.path}`);let n=[];Nn.Vault.recurseChildren(e,r=>{Je(t.app,r)&&n.push(r)}),n.sort((r,s)=>r.path.localeCompare(s.path)),await Bm({abortSignal:t.abortSignal,buildNoticeMessage:(r,s)=>`Collecting attachments ${s} - ${r.path}`,items:n,processItem:async r=>{t.settings.isPathIgnored(r.path)||await Gm(t,r)},progressBarTitle:"Custom Attachment Location: Collecting attachments...",shouldContinueOnError:!0,shouldShowProgressBar:!0})}async function Zv(t,e){return(await t.vault.readJson(e.path)).nodes.filter(s=>s.type==="file").map(s=>s.file).map(s=>({link:s,original:s,position:{end:{col:0,line:0,loc:0,offset:0},start:{col:0,line:0,loc:0,offset:0}}}))}async function Qv(t,e,n,r){let s=t.app,o=yr(s,e,r);if(!o||Je(t.app,o))return null;let l=o.path,u=o.name,f=pe(r,Se(r)),h=pe(n,Se(n)),m;t.settings.shouldRenameCollectedAttachments?m=an(await js(t,new xt(t.app,n,o.name)),o.extension):t.settings.shouldRenameAttachmentFiles?m=u.replaceAll(f,h):m=u;let p=await Hs(t,n,m),g=ke(p,m);return l===g?null:{newAttachmentPath:g,oldAttachmentPath:l}}var Zm=/(?:)/,Qm=/$./,xr=(r=>(r.None="None",r.OnlyPastedImages="Only pasted images",r.All="All",r))(xr||{}),Gs=class{attachmentFolderPath="./assets/${filename}";attachmentRenameMode="Only pasted images";duplicateNameSeparator=" ";generatedAttachmentFilename="file-${date:YYYYMMDDHHmmssSSS}";jpegQuality=.8;shouldConvertPastedImagesToJpeg=!1;shouldDeleteOrphanAttachments=!1;shouldKeepEmptyAttachmentFolders=!1;shouldRenameAttachmentFiles=!1;shouldRenameAttachmentFolder=!0;shouldRenameAttachmentsToLowerCase=!1;shouldRenameCollectedAttachments=!1;specialCharacters="#^[]|*\\<>:?";specialCharactersReplacement="-";warningVersion="0.0.0";get customTokensStr(){return this._customTokensStr}set customTokensStr(e){this._customTokensStr=e,xt.registerCustomFormatters(this._customTokensStr)}get excludePaths(){return this._excludePaths}set excludePaths(e){this._excludePaths=e.filter(Boolean),this._excludePathsRegExp=ep(this._excludePaths,Qm)}get includePaths(){return this._includePaths}set includePaths(e){this._includePaths=e.filter(Boolean),this._includePathsRegExp=ep(this._includePaths,Zm)}get specialCharactersRegExp(){return new RegExp(`[${Xn(this.specialCharacters)}]`,"g")}_customTokensStr="";_excludePaths=[];_excludePathsRegExp=Qm;_includePaths=[];_includePathsRegExp=Zm;isPathIgnored(e){return!this._includePathsRegExp.test(e)||this._excludePathsRegExp.test(e)}};function ep(t,e){if(t.length===0)return e;let n=t.map(r=>r.startsWith("/")&&r.endsWith("/")?r.slice(1,-1):`^${Xn(r)}`).map(r=>`(${r})`).join("|");return new RegExp(n)}(function(){if(globalThis.process)return;let e={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=e})();var bn=class{getTransformer(e){if(e===this.id)return this;throw new Error(`Transformer with id ${e} not found`)}transformObjectRecursively(e){return this.transformValueRecursively(e,"")}getTransformerId(e,n){return this.canTransform(e,n)?this.id:null}transformValueRecursively(e,n){let r=this.getTransformerId(e,n);if(r){let l=this.transformValue(e,n);return l===void 0?void 0:{__transformerId:r,transformedValue:l}}if(e===null)return null;if(typeof e!="object")return e;if(Array.isArray(e))return e.map((l,u)=>this.transformValueRecursively(l,u.toString()));let s=e;if(s.__transformerId)return this.getTransformer(s.__transformerId).restoreValue(s.transformedValue,n);let o={};for(let l of ir(e)){let u=e[l],f=this.transformValueRecursively(u,l);o[l]=f}return o}};(function(){if(globalThis.process)return;let e={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=e})();var Er=class extends bn{};(function(){if(globalThis.process)return;let e={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=e})();var Xs=class extends Er{get id(){return"date"}canTransform(e){return e instanceof Date}restoreValue(e){return new Date(e)}transformValue(e){return e.toISOString()}};var tp=ze(zt(),1);(function(){if(globalThis.process)return;let e={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=e})();var Ks=class extends Er{get id(){return"duration"}canTransform(e){let n=e??{};return!!n.asHours&&!!n.asMinutes&&!!n.asSeconds&&!!n.asMilliseconds}restoreValue(e){return(0,tp.duration)(e)}transformValue(e){return e.toISOString()}};(function(){if(globalThis.process)return;let e={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=e})();var Js=class extends bn{constructor(e){super(),this.transformers=e}get id(){return"group"}canTransform(e,n){return this.getFirstTransformerThatCanTransform(e,n)!==null}getTransformer(e){return this.transformers.find(n=>n.id===e)??Ht(`No transformer with id ${e} found`)}transformValue(e,n){let r=this.getFirstTransformerThatCanTransform(e,n);if(r===null)throw new Error("No transformer can transform the value");return r.transformValue(e,n)}getTransformerId(e,n){let r=this.getFirstTransformerThatCanTransform(e,n);return r===null?null:r.id}restoreValue(){throw new Error("GroupTransformer does not support restoring values")}getFirstTransformerThatCanTransform(e,n){return this.transformers.find(r=>r.canTransform(e,n))??null}};(function(){if(globalThis.process)return;let e={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=e})();var eA="_",Zs=class extends bn{get id(){return"skip-private-property"}canTransform(e,n){return n.startsWith(eA)}transformValue(){}restoreValue(){throw new Error("SkipPrivatePropertyTransformer does not support restoring values")}};(function(){if(globalThis.process)return;let e={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=e})();var tA=new Js([new Zs,new Xs,new Ks]),Qs=class extends St{constructor(e){super(),this.plugin=e,this.app=e.app,this.defaultSettings=this.createDefaultSettings(),this.currentSettingsWrapper=this.createDefaultSettingsWrapper(),this.lastSavedSettingsWrapper=this.createDefaultSettingsWrapper(),this.propertyNames=ir(this.currentSettingsWrapper.settings),this.registerValidators()}app;defaultSettings;get settingsWrapper(){return this.currentSettingsWrapper}currentSettingsWrapper;lastSavedSettingsWrapper;propertyNames;validators=new Map;async editAndSave(e,n){await this.edit(e),await this.saveToFile(n)}async ensureSafe(e){let n=await this.validate(e);for(let r of this.propertyNames)n[r]&&(e[r]=this.defaultSettings[r])}async getSafeCopy(e){let n=await this.cloneSettings(e);return await this.ensureSafe(n),n}async loadFromFile(e){let n=await this.plugin.loadData();if(this.lastSavedSettingsWrapper=this.createDefaultSettingsWrapper(),this.currentSettingsWrapper=this.createDefaultSettingsWrapper(),n==null)return;if(typeof n!="object"){console.error(`Invalid settings from data.json. Expected Object, got: ${typeof n}`);return}let r=n,s=await this.rawRecordToSettings(r),o=await this.validate(s);for(let u of this.propertyNames)this.setPropertyImpl(u,s[u],o[u]);this.lastSavedSettingsWrapper=await this.cloneSettingsWrapper(this.currentSettingsWrapper);let l=await this.settingsToRawRecord(this.currentSettingsWrapper.settings);dn(l,n)||await this.saveToFileImpl(),await this.triggerAsync("loadSettings",this.currentSettingsWrapper,e)}on(e,n,r){return super.on(e,n,r)}async saveToFile(e){dn(this.lastSavedSettingsWrapper.settings,this.currentSettingsWrapper.settings)||(await this.saveToFileImpl(),await this.triggerAsync("saveSettings",this.currentSettingsWrapper,this.lastSavedSettingsWrapper,e),this.lastSavedSettingsWrapper=await this.cloneSettingsWrapper(this.currentSettingsWrapper))}async setProperty(e,n){return await this.edit(r=>{r[e]=n}),this.currentSettingsWrapper.validationMessages[e]}async validate(e){let n={};for(let[r,s]of this.validators.entries()){let o=await s(e[r],e);o&&(n[r]=o)}return n}getTransformer(){return tA}async onLoadRecord(e){await it()}async onSavingRecord(e){await it()}registerValidator(e,n){this.validators.set(e,n)}registerValidators(){}async cloneSettings(e){let n=await this.settingsToRawRecord(e),r=JSON.stringify(n),s=JSON.parse(r);return await this.rawRecordToSettings(s)}async cloneSettingsWrapper(e){return{safeSettings:await this.cloneSettings(e.safeSettings),settings:await this.cloneSettings(e.settings),validationMessages:{...e.validationMessages}}}createDefaultSettingsWrapper(){return{safeSettings:this.createDefaultSettings(),settings:this.createDefaultSettings(),validationMessages:{}}}async edit(e){try{await e(this.currentSettingsWrapper.settings)}finally{let n=await this.validate(this.currentSettingsWrapper.settings);for(let r of this.propertyNames){let s=n[r]??"";this.currentSettingsWrapper.validationMessages[r]=s,this.currentSettingsWrapper.safeSettings[r]=s?this.defaultSettings[r]:this.currentSettingsWrapper.settings[r]}}}isValidPropertyName(e){return typeof e!="string"?!1:this.propertyNames.includes(e)}async rawRecordToSettings(e){e=this.getTransformer().transformObjectRecursively(e),await this.onLoadRecord(e);let n=this.createDefaultSettings();for(let[r,s]of Object.entries(e)){if(!this.isValidPropertyName(r)){console.warn(`Unknown property: ${r}`);continue}typeof s!=typeof this.defaultSettings[r]&&console.warn("Possible invalid value type. It might lead to an unexpected behavior of the plugin. There is also a chance it is a false-negative warning, as we are unable to determine the exact type of the value in runtime.",{defaultValue:this.defaultSettings[r],propertyName:r,value:s}),n[r]=s}return n}async saveToFileImpl(){await this.plugin.saveData(await this.settingsToRawRecord(this.currentSettingsWrapper.settings))}setPropertyImpl(e,n,r){this.currentSettingsWrapper.settings[e]=n,this.currentSettingsWrapper.validationMessages[e]=r??"",this.currentSettingsWrapper.safeSettings[e]=r?this.defaultSettings[e]:n}async settingsToRawRecord(e){let n={};for(let r of this.propertyNames)n[r]=e[r];return await this.onSavingRecord(n),this.getTransformer().transformObjectRecursively(n)}};var eo=class extends Qs{createDefaultSettings(){return new Gs}async onLoadRecord(e){await super.onLoadRecord(e);let n=e,r=n.dateTimeFormat??"YYYYMMDDHHmmssSSS";n.attachmentFolderPath=np(n.attachmentFolderPath??"",r),n.generatedAttachmentFilename=np(n.generatedAttachmentFilename??n.pastedFileName??n.pastedImageFileName??"file-${date}",r),n.replaceWhitespace!==void 0&&(n.whitespaceReplacement=n.replaceWhitespace?"-":""),n.autoRenameFiles!==void 0&&(n.shouldRenameAttachmentFiles=n.autoRenameFiles),n.autoRenameFolder!==void 0&&(n.shouldRenameAttachmentFolder=n.autoRenameFolder),n.deleteOrphanAttachments!==void 0&&(n.shouldDeleteOrphanAttachments=n.deleteOrphanAttachments),n.keepEmptyAttachmentFolders!==void 0&&(n.shouldKeepEmptyAttachmentFolders=n.keepEmptyAttachmentFolders),n.renameCollectedFiles!==void 0&&(n.shouldRenameCollectedAttachments=n.renameCollectedFiles),n.toLowerCase!==void 0&&(n.shouldRenameAttachmentsToLowerCase=n.toLowerCase),n.convertImagesToJpeg!==void 0&&(n.shouldConvertPastedImagesToJpeg=n.convertImagesToJpeg),n.whitespaceReplacement&&(n.specialCharacters=`${n.specialCharacters??""} `,n.specialCharactersReplacement=n.whitespaceReplacement)}registerValidators(){this.registerValidator("attachmentFolderPath",e=>hi(e)),this.registerValidator("generatedAttachmentFilename",e=>hi(e)),this.registerValidator("specialCharacters",e=>{if(e.includes("/"))return"Special characters must not contain /"}),this.registerValidator("specialCharactersReplacement",e=>{if(Hl.exec(e))return"Special character replacement must not contain invalid filename path characters."}),this.registerValidator("duplicateNameSeparator",e=>Us(`filename${e}1`,!1)),this.registerValidator("includePaths",e=>rp(e)),this.registerValidator("excludePaths",e=>rp(e)),this.registerValidator("customTokensStr",e=>{nA(e)})}};function np(t,e){return t.replaceAll("${date}",`\${date:${e}}`)}function nA(t){if(jl(t)===null)return"Invalid custom tokens code"}function rp(t){for(let e of t)if(e.startsWith("/")&&e.endsWith("/")){let n=e.slice(1,-1);if(!Qu(n))return`Invalid regular expression ${e}`}}var yp=require("obsidian");(function(){if(globalThis.process)return;let e={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=e})();function ip(t,e){let n=Object.keys(t).find(r=>t[r]===e);if(n===void 0)throw new Error(`Invalid enum value: ${e}`);return n}function sp(t,e){let n=t[e];if(n===void 0)throw new Error(`Invalid enum key: ${e}`);return n}var Cr=require("obsidian");var op=require("obsidian");(function(){if(globalThis.process)return;let e={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=e})();var Gl=class{constructor(e){this.abstractTextComponent=e}empty(){this.abstractTextComponent.setValue("")}isEmpty(){return this.abstractTextComponent.getValue()===""}setPlaceholderValue(e){return this.abstractTextComponent.setPlaceholder(e),this}};function ap(t){return rA(t)?t:t instanceof op.AbstractTextComponent?new Gl(t):null}function rA(t){let e=t;return typeof e.setPlaceholderValue=="function"&&typeof e.isEmpty=="function"}var Pt=require("obsidian");(function(){if(globalThis.process)return;let e={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=e})();var $n=class{constructor(e){this.validatorEl=e}};function lp(t){return iA(t)?t:t instanceof Pt.DropdownComponent?new $n(t.selectEl):t instanceof Pt.SliderComponent?new $n(t.sliderEl):t instanceof Pt.TextAreaComponent?new $n(t.inputEl):t instanceof Pt.TextComponent?new $n(t.inputEl):t instanceof Pt.ToggleComponent?new $n(t.toggleEl.find("input[type=checkbox]")):null}function iA(t){return!!t.validatorEl}(function(){if(globalThis.process)return;let e={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=e})();function up(t){return t.validationMessage!==void 0}(function(){if(globalThis.process)return;let e={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=e})();var Xl="PluginSettingsTab",to=class extends Cr.PluginSettingTab{constructor(e){super(e.app,e),this.plugin=e,this.containerEl.addClass(B.LibraryName,xe(),B.PluginSettingsTab),this.saveSettingsDebounced=(0,Cr.debounce)(fn(()=>this.plugin.settingsManager.saveToFile(Xl)),this.saveSettingsDebounceTimeoutInMilliseconds),this.asyncEventsComponent=new Gi,this.asyncEvents=new St}get isOpen(){return this._isOpen}get saveSettingsDebounceTimeoutInMilliseconds(){return 2e3}_isOpen=!1;asyncEvents;asyncEventsComponent;saveSettingsDebounced;get pluginSettings(){return this.plugin.settingsManager.settingsWrapper.settings}bind(e,n,r){let o={...{componentToPluginSettingsValueConverter:p=>p,onChanged:Xt,pluginSettingsToComponentValueConverter:p=>p,shouldResetSettingWhenComponentIsEmpty:!1,shouldShowValidationMessage:!0},...r},l=lp(e)?.validatorEl,u=ap(e),f=this.pluginSettings[n],h=this.plugin.settingsManager.defaultSettings[n];return u?.setPlaceholderValue(o.pluginSettingsToComponentValueConverter(h)),this.asyncEventsComponent.registerAsyncEvent(this.on("validationMessageChanged",(p,g)=>{n===p&&m(g)})),u&&o.shouldResetSettingWhenComponentIsEmpty&&dn(f,h)?u.empty():e.setValue(o.pluginSettingsToComponentValueConverter(f)),e.onChange(async p=>{let g=this.pluginSettings[n],w,E;if(u?.isEmpty()&&o.shouldResetSettingWhenComponentIsEmpty)w=h,E="";else{let F=o.componentToPluginSettingsValueConverter(p);up(F)?E=F.validationMessage:(w=F,E=await this.plugin.settingsManager.setProperty(n,w))}m(E),w!==void 0&&await o.onChanged(w,g),this.saveSettingsDebounced()}),l?.addEventListener("focus",()=>{m()}),l?.addEventListener("blur",()=>{m()}),m(this.plugin.settingsManager.settingsWrapper.validationMessages[n]),e;function m(p){l&&(p===""&&(l.setCustomValidity(""),l.checkValidity(),p=l.validationMessage),p!==void 0&&(l.setCustomValidity(p),(0,Cr.setTooltip)(l,p)),l.isActiveElement()&&o.shouldShowValidationMessage&&l.reportValidity())}}display(){this._isOpen=!0,this.asyncEventsComponent.load(),this.asyncEventsComponent.registerAsyncEvent(this.plugin.settingsManager.on("loadSettings",this.onLoadSettings.bind(this))),this.asyncEventsComponent.registerAsyncEvent(this.plugin.settingsManager.on("saveSettings",this.onSaveSettings.bind(this)))}hide(){super.hide(),this.saveSettingsDebounced.cancel(),this.containerEl.empty(),this._isOpen=!1,this.asyncEventsComponent.unload(),this.asyncEventsComponent.load(),Kt(()=>this.plugin.settingsManager.saveToFile(Xl))}show(){this.app.setting.openTab(this)}async onLoadSettings(e,n){this.refresh(),await it()}on(e,n,r){return this.asyncEvents.on(e,n,r)}async onSaveSettings(e,n,r){if(r===Xl){for(let[s,o]of Object.entries(e.validationMessages))await this.asyncEvents.triggerAsync("validationMessageChanged",s,o);return}this.refresh()}refresh(){this.containerEl.empty(),this.display()}};var wp=require("obsidian");var cp=require("obsidian");(function(){if(globalThis.process)return;let e={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=e})();var no=class extends cp.ValueComponent{inputEl;get validatorEl(){return this.inputEl}changeCallback;constructor(e){super(),e.addClass(B.LibraryName,xe(),B.CheckboxComponent),this.inputEl=e.createEl("input",{type:"checkbox"}),this.inputEl.addEventListener("change",this.onChanged.bind(this))}getValue(){return this.inputEl.checked}onChange(e){return this.changeCallback=e,this}onChanged(){this.changeCallback?.(this.getValue())}setDisabled(e){return super.setDisabled(e),this.inputEl.disabled=e,this}setValue(e){return this.inputEl.checked=e,this}};var Kl=ze(zt(),1);var ro=require("obsidian");(function(){if(globalThis.process)return;let e={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=e})();var tt=class extends ro.ValueComponent{inputEl;get validatorEl(){return this.inputEl}textComponent;constructor(e,n,r){super(),this.textComponent=new ro.TextComponent(e),this.inputEl=this.textComponent.inputEl,this.inputEl.type=n,e.addClass(B.LibraryName,xe(),r)}empty(){this.textComponent.setValue("")}getValue(){return this.valueFromString(this.textComponent.getValue())}isEmpty(){return this.textComponent.getValue()===""}onChange(e){return this.textComponent.onChange(()=>e(this.getValue())),this}onChanged(){this.textComponent.onChanged()}setDisabled(e){return super.setDisabled(e),this.textComponent.setDisabled(e),this}setPlaceholder(e){return this.textComponent.setPlaceholder(e),this}setPlaceholderValue(e){return this.setPlaceholder(this.valueToString(e)),this}setValue(e){return this.textComponent.setValue(this.valueToString(e)),this}valueToString(e){return String(e)}};(function(){if(globalThis.process)return;let e={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=e})();var nt=class extends tt{setMax(e){return this.inputEl.max=this.valueToString(e),this}setMin(e){return this.inputEl.min=this.valueToString(e),this}setStep(e){return this.inputEl.step=e.toString(),this}};(function(){if(globalThis.process)return;let e={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=e})();var fp="YYYY-MM-DD",io=class extends nt{constructor(e){super(e,"date",B.DateComponent)}valueFromString(e){return(0,Kl.default)(e,fp).toDate()}valueToString(e){return(0,Kl.default)(e).format(fp)}};var Jl=ze(zt(),1);(function(){if(globalThis.process)return;let e={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=e})();var dp="YYYY-MM-DDTHH:mm",so=class extends nt{constructor(e){super(e,"datetime-local",B.DateTimeComponent)}valueFromString(e){return(0,Jl.default)(e,dp).toDate()}valueToString(e){return(0,Jl.default)(e).format(dp)}};(function(){if(globalThis.process)return;let e={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=e})();var oo=class extends tt{constructor(e){super(e,"email",B.EmailComponent)}valueFromString(e){return e}};(function(){if(globalThis.process)return;let e={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=e})();var ao=class extends tt{constructor(e){super(e,"file",B.FileComponent)}getValue(){return this.inputEl.files?.[0]??null}valueFromString(){return this.getValue()}valueToString(e){return e?.name??""}};var Zl=ze(zt(),1);(function(){if(globalThis.process)return;let e={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=e})();var hp="YYYY-MM",lo=class extends nt{constructor(e){super(e,"month",B.MonthComponent)}valueFromString(e){let n=(0,Zl.default)(e,hp);if(!n.isValid())throw new Error("Invalid month");return{month:n.month()+1,year:n.year()}}valueToString(e){return(0,Zl.default)().year(e.year).month(e.month-1).format(hp)}};var uo=require("obsidian");(function(){if(globalThis.process)return;let e={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=e})();var vr=class extends uo.ValueComponent{get validatorEl(){return this.dropdownComponent.selectEl}dropdownComponent;constructor(e){super(),this.dropdownComponent=new uo.DropdownComponent(e),this.dropdownComponent.selectEl.multiple=!0,e.addClass(B.LibraryName,xe(),B.MultipleDropdownComponent)}addOption(e,n){return this.dropdownComponent.addOption(e,n),this}addOptions(e){return this.dropdownComponent.addOptions(e),this}getValue(){return Array.from(this.dropdownComponent.selectEl.selectedOptions).map(e=>e.value)}onChange(e){return this.dropdownComponent.onChange(()=>e(this.getValue())),this}setDisabled(e){return super.setDisabled(e),this.dropdownComponent.setDisabled(e),this}setValue(e){for(let n of Array.from(this.dropdownComponent.selectEl.options))n.selected=e.includes(n.value);return this}};(function(){if(globalThis.process)return;let e={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=e})();var co=class extends tt{constructor(e){super(e,"email",B.MultipleEmailComponent),this.inputEl.multiple=!0}valueFromString(e){return e.split(",").map(n=>n.trim())}valueToString(e){return e.join(", ")}};(function(){if(globalThis.process)return;let e={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=e})();var fo=class extends tt{constructor(e){super(e,"file",B.MultipleFileComponent),this.inputEl.multiple=!0}getValue(){return Array.from(this.inputEl.files??[])}valueFromString(){return this.getValue()}valueToString(e){return e[0]?.name??""}};var mo=require("obsidian");(function(){if(globalThis.process)return;let e={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=e})();var ho=class extends mo.ValueComponent{get validatorEl(){return this.textAreaComponent.inputEl}textAreaComponent;constructor(e){super(),this.textAreaComponent=new mo.TextAreaComponent(e),e.addClass(B.LibraryName,xe(),B.MultipleTextComponent)}empty(){this.textAreaComponent.setValue("")}getValue(){return this.textAreaComponent.getValue().split(`
`)}isEmpty(){return this.textAreaComponent.getValue()===""}onChange(e){return this.textAreaComponent.onChange(()=>e(this.getValue())),this}setDisabled(e){return super.setDisabled(e),this.textAreaComponent.setDisabled(e),this}setPlaceholder(e){return this.textAreaComponent.setPlaceholder(e),this}setPlaceholderValue(e){return this.setPlaceholder(this.valueToString(e)),this}setValue(e){return this.textAreaComponent.setValue(this.valueToString(e)),this}valueToString(e){return e.join(`
`)}};(function(){if(globalThis.process)return;let e={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=e})();var po=class extends nt{constructor(e){super(e,"number",B.NumberComponent)}valueFromString(e){return parseInt(e,10)}};var wo=ze(zt(),1);(function(){if(globalThis.process)return;let e={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=e})();var go=class extends nt{constructor(e){super(e,"time",B.TimeComponent)}valueFromString(e){return(0,wo.duration)(e)}valueToString(e){let n;return e.milliseconds()>0?n="HH:mm:ss.SSS":e.seconds()>0?n="HH:mm:ss":n="HH:mm",(0,wo.utc)(e.asMilliseconds()).format(n)}};var mp=require("obsidian");(function(){if(globalThis.process)return;let e={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=e})();var yo=class extends mp.ValueComponent{inputEl;get validatorEl(){return this.inputEl}changeCallback;constructor(e){super(),e.addClass(B.LibraryName,xe(),B.TriStateCheckboxComponent),this.inputEl=e.createEl("input",{type:"checkbox"}),this.inputEl.addEventListener("change",this.onChanged.bind(this))}getValue(){return this.inputEl.indeterminate?null:this.inputEl.checked}onChange(e){return this.changeCallback=e,this}onChanged(){this.changeCallback?.(this.getValue())}setDisabled(e){return super.setDisabled(e),this.inputEl.disabled=e,this}setValue(e){return this.inputEl.indeterminate=e===null,this.inputEl.checked=e??!1,this}};var ko=require("obsidian");(function(){if(globalThis.process)return;let e={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=e})();var bo=class extends ko.ValueComponent{get validatorEl(){return this.dropdownComponent.selectEl}dropdownComponent;values=[];constructor(e){super(),this.dropdownComponent=new ko.DropdownComponent(e),e.addClass(B.LibraryName,xe(),B.TypedDropdownComponent)}addOption(e,n){let r=this.values.indexOf(e);return r===-1&&(this.values.push(e),r=this.values.length-1),this.dropdownComponent.addOption(r.toString(),n),this}addOptions(e){for(let[n,r]of e.entries())this.addOption(n,r);return this}getValue(){return this.values[this.dropdownComponent.selectEl.selectedIndex]??null}onChange(e){return this.dropdownComponent.onChange(()=>e(this.getValue())),this}setDisabled(e){return super.setDisabled(e),this.dropdownComponent.setDisabled(e),this}setValue(e){let n=e===null?-1:this.values.indexOf(e);return this.dropdownComponent.selectEl.selectedIndex=n,this}};var pp=require("obsidian");(function(){if(globalThis.process)return;let e={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=e})();var xo=class extends pp.ValueComponent{get validatorEl(){return this.multipleDropdownComponent.validatorEl}multipleDropdownComponent;values=[];constructor(e){super(),this.multipleDropdownComponent=new vr(e),e.addClass(B.LibraryName,xe(),B.TypedMultipleDropdownComponent)}addOption(e,n){let r=this.values.indexOf(e);return r===-1&&(this.values.push(e),r=this.values.length-1),this.multipleDropdownComponent.addOption(r.toString(),n),this}addOptions(e){for(let[n,r]of e.entries())this.addOption(n,r);return this}getValue(){return this.multipleDropdownComponent.getValue().map(n=>parseInt(n,10)).map(n=>this.values[n]).filter(n=>n!==void 0)}onChange(e){return this.multipleDropdownComponent.onChange(()=>e(this.getValue())),this}setDisabled(e){return super.setDisabled(e),this.multipleDropdownComponent.setDisabled(e),this}setValue(e){let n=e.map(r=>this.values.indexOf(r)).filter(r=>r!==-1);return this.multipleDropdownComponent.setValue(n.map(r=>r.toString())),this}};(function(){if(globalThis.process)return;let e={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=e})();var Eo=class extends tt{constructor(e){super(e,"url",B.UrlComponent)}valueFromString(e){return e}};var Ql=ze(zt(),1);(function(){if(globalThis.process)return;let e={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=e})();var gp="YYYY-[W]WW",Co=class extends nt{constructor(e){super(e,"week",B.WeekComponent)}valueFromString(e){let n=(0,Ql.default)(e,gp);if(!n.isValid())throw new Error("Invalid week");return{weekNumber:n.isoWeek(),year:n.year()}}valueToString(e){return(0,Ql.default)().year(e.year).isoWeek(e.weekNumber).format(gp)}};(function(){if(globalThis.process)return;let e={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=e})();var Ee=class extends wp.Setting{addCheckbox(e){return this.addComponent(no,e)}addComponent(e,n){let r=new e(this.controlEl);return this.components.push(r),n(r),this}addDate(e){return this.addComponent(io,e)}addDateTime(e){return this.addComponent(so,e)}addEmail(e){return this.addComponent(oo,e)}addFile(e){return this.addComponent(ao,e)}addMonth(e){return this.addComponent(lo,e)}addMultipleDropdown(e){return this.addComponent(vr,e)}addMultipleEmail(e){return this.addComponent(co,e)}addMultipleFile(e){return this.addComponent(fo,e)}addMultipleText(e){return this.addComponent(ho,e)}addNumber(e){return this.addComponent(po,e)}addTime(e){return this.addComponent(go,e)}addTriStateCheckbox(e){return this.addComponent(yo,e)}addTypedDropdown(e){return this.addComponent(bo,e)}addTypedMultipleDropdown(e){return this.addComponent(xo,e)}addUrl(e){return this.addComponent(Eo,e)}addWeek(e){return this.addComponent(Co,e)}};var vo="\u2423",Ao=class extends to{display(){super.display(),this.containerEl.empty(),new Ee(this.containerEl).setName("Location for new attachments").setDesc(createFragment(e=>{e.appendText("Start with "),et(e,"."),e.appendText(" to use relative path."),e.createEl("br"),e.appendText("See available "),e.createEl("a",{href:"https://github.com/RainCat1998/obsidian-custom-attachment-location?tab=readme-ov-file#tokens",text:"tokens"}),e.appendChild(createEl("br")),e.appendText("Dot-folders like "),et(e,".attachments"),e.appendText(" are not recommended, because Obsidian doesn't track them. You might need to use "),e.createEl("a",{href:"https://github.com/polyipseity/obsidian-show-hidden-files/",text:"Show Hidden Files"}),e.appendText(" Plugin to manage them.")})).addText(e=>this.bind(e,"attachmentFolderPath",{componentToPluginSettingsValueConverter(n){return(0,yp.normalizePath)(n)},pluginSettingsToComponentValueConverter(n){return n}})),new Ee(this.containerEl).setName("Generated attachment filename").setDesc(createFragment(e=>{e.appendText("See available "),e.createEl("a",{href:"https://github.com/RainCat1998/obsidian-custom-attachment-location?tab=readme-ov-file#tokens",text:"tokens"})})).addText(e=>{this.bind(e,"generatedAttachmentFilename")}),new Ee(this.containerEl).setName("Attachment rename mode").addDropdown(e=>{e.addOptions(xr),this.bind(e,"attachmentRenameMode",{componentToPluginSettingsValueConverter:n=>sp(xr,n),pluginSettingsToComponentValueConverter:n=>ip(xr,n)})}),new Ee(this.containerEl).setName("Should rename attachment folder").setDesc(createFragment(e=>{e.appendText("When renaming md files, automatically rename attachment folder if folder name contains "),et(e,"${filename}"),e.appendText(".")})).addToggle(e=>{this.bind(e,"shouldRenameAttachmentFolder")}),new Ee(this.containerEl).setName("Should rename attachment files").setDesc(createFragment(e=>{e.appendText("When renaming md files, automatically rename attachment files if file name contains "),et(e,"${filename}"),e.appendText(".")})).addToggle(e=>{this.bind(e,"shouldRenameAttachmentFiles")}),new Ee(this.containerEl).setName("Special characters").setDesc(createFragment(e=>{e.appendText("Special characters in attachment folder and file name to be replaced or removed."),e.createEl("br"),e.appendText("Leave blank to preserve special characters.")})).addText(e=>{this.bind(e,"specialCharacters",{componentToPluginSettingsValueConverter:n=>n.replaceAll(vo,""),pluginSettingsToComponentValueConverter:n=>n.replaceAll(" ",vo),shouldResetSettingWhenComponentIsEmpty:!1}),e.inputEl.addEventListener("input",()=>{e.inputEl.value=eu(e.inputEl.value)})}),new Ee(this.containerEl).setName("Special characters replacement").setDesc(createFragment(e=>{e.appendText("Replacement string for special characters in attachment folder and file name."),e.createEl("br"),e.appendText("Leave blank to remove special characters.")})).addText(e=>{this.bind(e,"specialCharactersReplacement",{shouldResetSettingWhenComponentIsEmpty:!1})}),new Ee(this.containerEl).setName("Should rename attachments to lowercase").setDesc("Automatically set all characters in folder name and pasted image name to be lowercase.").addToggle(e=>{this.bind(e,"shouldRenameAttachmentsToLowerCase")}),new Ee(this.containerEl).setName("Should convert pasted images to JPEG").setDesc("Paste images from clipboard converting them to JPEG.").addToggle(e=>{this.bind(e,"shouldConvertPastedImagesToJpeg")}),new Ee(this.containerEl).setName("JPEG Quality").setDesc("The smaller the quality, the greater the compression ratio.").addDropdown(e=>{e.addOptions(sA()),this.bind(e,"jpegQuality",{componentToPluginSettingsValueConverter:n=>Number(n),pluginSettingsToComponentValueConverter:n=>n.toString()})}),new Ee(this.containerEl).setName("Should rename collected attachments").setDesc(createFragment(e=>{e.appendText("If enabled, attachments processed via "),et(e,"Collect attachments"),e.appendText(" commands will be renamed according to the "),et(e,"Pasted File Name"),e.appendText(" setting.")})).addToggle(e=>{this.bind(e,"shouldRenameCollectedAttachments")}),new Ee(this.containerEl).setName("Duplicate name separator").setDesc(createFragment(e=>{e.appendText("When you are pasting/dragging a file with the same name as an existing file, this separator will be added to the file name."),e.appendChild(createEl("br")),e.appendText("E.g., when you are dragging file "),et(e,"existingFile.pdf"),e.appendText(", it will be renamed to "),et(e,"existingFile 1.pdf"),e.appendText(", "),et(e,"existingFile 2.pdf"),e.appendText(", etc, getting the first name available.")})).addText(e=>{this.bind(e,"duplicateNameSeparator",{componentToPluginSettingsValueConverter:n=>n.replaceAll(vo," "),pluginSettingsToComponentValueConverter:eu}),e.inputEl.addEventListener("input",()=>{e.inputEl.value=eu(e.inputEl.value)})}),new Ee(this.containerEl).setName("Should keep empty attachment folders").setDesc("If enabled, empty attachment folders will be preserved, useful for source control purposes.").addToggle(e=>{this.bind(e,"shouldKeepEmptyAttachmentFolders")}),new Ee(this.containerEl).setName("Should delete orphan attachments").setDesc("If enabled, when the note is deleted, its orphan attachments are deleted as well.").addToggle(e=>{this.bind(e,"shouldDeleteOrphanAttachments")}),new Ee(this.containerEl).setName("Include paths").setDesc(createFragment(e=>{e.appendText("Include notes from the following paths"),e.createEl("br"),e.appendText("Insert each path on a new line"),e.createEl("br"),e.appendText("You can use path string or "),et(e,"/regular expression/"),e.createEl("br"),e.appendText("If the setting is empty, all notes are included")})).addMultipleText(e=>{this.bind(e,"includePaths")}),new Ee(this.containerEl).setName("Exclude paths").setDesc(createFragment(e=>{e.appendText("Exclude notes from the following paths"),e.createEl("br"),e.appendText("Insert each path on a new line"),e.createEl("br"),e.appendText("You can use path string or "),et(e,"/regular expression/"),e.createEl("br"),e.appendText("If the setting is empty, no notes are excluded")})).addMultipleText(e=>{this.bind(e,"excludePaths")}),new Ee(this.containerEl).setName("Custom tokens").setDesc(createFragment(e=>{e.appendText("Custom tokens to be used in the attachment folder path and pasted file name."),e.appendChild(createEl("br")),e.appendText("See "),e.createEl("a",{href:"https://github.com/RainCat1998/obsidian-custom-attachment-location?tab=readme-ov-file#custom-tokens",text:"documentation"}),e.appendText(" for more information.")})).addTextArea(e=>{this.bind(e,"customTokensStr")})}};function sA(){let e={};for(let n=1;n<=10;n++){let r=(n/10).toFixed(1);e[r]=r}return e}function eu(t){return t.replaceAll(" ",vo)}var oA=/Pasted image (?<Timestamp>\d{14})/,aA="YYYYMMDDHHmmss",lA=10,So=class extends Ji{createSettingsManager(){return new eo(this)}createSettingsTab(){return new Ao(this)}async onLayoutReady(){Yi(this,this.app.vault,{getAvailablePath:()=>this.getAvailablePath.bind(this),getAvailablePathForAttachments:()=>{let e={isExtended:!0};return Object.assign(this.getAvailablePathForAttachments.bind(this),e)}}),tu.webUtils&&Yi(this,tu.webUtils,{getPathForFile:e=>n=>this.getPathForFile(n,e)}),(0,kp.compare)(this.settings.warningVersion,"7.0.0")<0&&(this.settings.customTokensStr&&await mc({app:this.app,message:createFragment(e=>{e.appendText("In plugin version 7.0.0, the format for custom tokens has changed. Please update your custom tokens accordingly. Refer to the "),e.createEl("a",{href:"https://github.com/RainCat1998/obsidian-custom-attachment-location?tab=readme-ov-file#custom-tokens",text:"documentation"}),e.appendText(" for more information.")})}),await this.settingsManager.editAndSave(e=>{e.warningVersion=this.manifest.version}))}async onloadImpl(){await super.onloadImpl(),jd(this,()=>({isPathIgnored:n=>this.settings.isPathIgnored(n),shouldDeleteEmptyFolders:!this.settings.shouldKeepEmptyAttachmentFolders,shouldHandleDeletions:this.settings.shouldDeleteOrphanAttachments,shouldHandleRenames:!0,shouldRenameAttachmentFiles:this.settings.shouldRenameAttachmentFiles,shouldRenameAttachmentFolder:this.settings.shouldRenameAttachmentFolder,shouldUpdateFilenameAliases:!0})),this.addCommand({checkCallback:e=>Km(this,e),id:"collect-attachments-current-note",name:"Collect attachments in current note"}),this.addCommand({checkCallback:e=>Xm(this,e),id:"collect-attachments-current-folder",name:"Collect attachments in current folder"}),this.addCommand({callback:()=>{Jm(this)},id:"collect-attachments-entire-vault",name:"Collect attachments in entire vault"}),this.registerEvent(this.app.workspace.on("file-menu",this.handleFileMenu.bind(this))),Yi(this,this.app,{saveAttachment:e=>(n,r,s)=>this.saveAttachment(e,n,r,s)})}getAvailablePath(e,n){let r=0;for(;;){let s=an(r===0?e:`${e}${this.settings.duplicateNameSeparator}${r.toString()}`,n);if(!Tn(this.app,s,!0))return s;r++}}async getAvailablePathForAttachments(e,n,r,s){let o;if(!r||!Je(this.app,r))o=await ra(this.app,e,n,r,!0);else{let l=await Hs(this,r.path,an(e,n));o=this.app.vault.getAvailablePath(ke(l,e),n)}if(!s){let l=ut(o);await this.app.vault.exists(l)||(await vs(this.app,l),this.settings.shouldKeepEmptyAttachmentFolders&&await this.app.vault.create(ke(l,".gitkeep"),""))}return o}getPathForFile(e,n){return e.path||n(e)}handleFileMenu(e,n){n instanceof bp.TFolder&&e.addItem(r=>{r.setTitle("Collect attachments in folder").setIcon("download").onClick(()=>qs(this,n))})}async saveAttachment(e,n,r,s){let o=this.app.workspace.getActiveFile();if(!o||this.settings.isPathIgnored(o.path))return e.call(this.app,n,r,s);let l=!1,u=oA.exec(n);if(u){let h=u.groups?.Timestamp;if(h){let m=(0,nu.default)(h,aA);m.isValid()&&(0,nu.default)().diff(m,"seconds")<lA&&(l=!0)}}l&&r==="png"&&this.settings.shouldConvertPastedImagesToJpeg&&(r="jpg",s=await Uu(new Blob([s],{type:"image/png"}),this.settings.jpegQuality));let f=!1;switch(this.settings.attachmentRenameMode){case"All":f=!0;break;case"None":break;case"Only pasted images":f=l;break;default:throw new Error("Invalid attachment rename mode")}return f&&(n=await js(this,new xt(this.app,o.path,an(n,r)))),await e.call(this.app,n,r,s)}};var uA=So;
/*! Bundled license information:

moment/moment.js:
  (*! moment.js *)
  (*! version : 2.30.1 *)
  (*! authors : Tim Wood, Iskren Chernev, Moment.js contributors *)
  (*! license : MIT *)
  (*! momentjs.com *)
*/

/* nosourcemap */