ripplepush 0.3.1 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -0
- package/index.js +70 -70
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1,123 +1,123 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
var
|
|
3
|
-
`)}displayWidth(t){return
|
|
2
|
+
var ox=Object.defineProperty;var em=(e,t)=>{for(var n in t)ox(e,n,{get:t[n],enumerable:!0})};import{fstatSync as xC}from"node:fs";import{createInterface as bC}from"node:readline";import{setTimeout as kC}from"node:timers/promises";var et=class extends Error{constructor(t,n,r){super(r),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=n,this.exitCode=t,this.nestedError=void 0}},ze=class extends et{constructor(t){super(1,"commander.invalidArgument",t),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};var jt=class{constructor(t,n){switch(this.description=n||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,t[0]){case"<":this.required=!0,this._name=t.slice(1,-1);break;case"[":this.required=!1,this._name=t.slice(1,-1);break;default:this.required=!0,this._name=t;break}this._name.endsWith("...")&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_collectValue(t,n){return n===this.defaultValue||!Array.isArray(n)?[t]:(n.push(t),n)}default(t,n){return this.defaultValue=t,this.defaultValueDescription=n,this}argParser(t){return this.parseArg=t,this}choices(t){return this.argChoices=t.slice(),this.parseArg=(n,r)=>{if(!this.argChoices.includes(n))throw new ze(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._collectValue(n,r):n},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function rs(e){let t=e.name()+(e.variadic===!0?"...":"");return e.required?"<"+t+">":"["+t+"]"}import{EventEmitter as ux}from"node:events";import Ga from"node:child_process";import Ht from"node:path";import os from"node:fs";import Y from"node:process";import{stripVTControlCharacters as cx}from"node:util";import{stripVTControlCharacters as sx}from"node:util";var bi=class{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(t){this.helpWidth=this.helpWidth??t.helpWidth??80}visibleCommands(t){let n=t.commands.filter(i=>!i._hidden),r=t._getHelpCommand();return r&&!r._hidden&&n.push(r),this.sortSubcommands&&n.sort((i,o)=>i.name().localeCompare(o.name())),n}compareOptions(t,n){let r=i=>i.short?i.short.replace(/^-/,""):i.long.replace(/^--/,"");return r(t).localeCompare(r(n))}visibleOptions(t){let n=t.options.filter(i=>!i.hidden),r=t._getHelpOption();if(r&&!r.hidden){let i=r.short&&t._findOption(r.short),o=r.long&&t._findOption(r.long);!i&&!o?n.push(r):r.long&&!o?n.push(t.createOption(r.long,r.description)):r.short&&!i&&n.push(t.createOption(r.short,r.description))}return this.sortOptions&&n.sort(this.compareOptions),n}visibleGlobalOptions(t){if(!this.showGlobalOptions)return[];let n=[];for(let r=t.parent;r;r=r.parent){let i=r.options.filter(o=>!o.hidden);n.push(...i)}return this.sortOptions&&n.sort(this.compareOptions),n}visibleArguments(t){return t._argsDescription&&t.registeredArguments.forEach(n=>{n.description=n.description||t._argsDescription[n.name()]||""}),t.registeredArguments.find(n=>n.description)?t.registeredArguments:[]}subcommandTerm(t){let n=t.registeredArguments.map(r=>rs(r)).join(" ");return t._name+(t._aliases[0]?"|"+t._aliases[0]:"")+(t.options.length?" [options]":"")+(n?" "+n:"")}optionTerm(t){return t.flags}argumentTerm(t){return t.name()}longestSubcommandTermLength(t,n){return n.visibleCommands(t).reduce((r,i)=>Math.max(r,this.displayWidth(n.styleSubcommandTerm(n.subcommandTerm(i)))),0)}longestOptionTermLength(t,n){return n.visibleOptions(t).reduce((r,i)=>Math.max(r,this.displayWidth(n.styleOptionTerm(n.optionTerm(i)))),0)}longestGlobalOptionTermLength(t,n){return n.visibleGlobalOptions(t).reduce((r,i)=>Math.max(r,this.displayWidth(n.styleOptionTerm(n.optionTerm(i)))),0)}longestArgumentTermLength(t,n){return n.visibleArguments(t).reduce((r,i)=>Math.max(r,this.displayWidth(n.styleArgumentTerm(n.argumentTerm(i)))),0)}commandUsage(t){let n=t._name;t._aliases[0]&&(n=n+"|"+t._aliases[0]);let r="";for(let i=t.parent;i;i=i.parent)r=i.name()+" "+r;return r+n+" "+t.usage()}commandDescription(t){return t.description()}subcommandDescription(t){return t.summary()||t.description()}optionDescription(t){let n=[];if(t.argChoices&&n.push(`choices: ${t.argChoices.map(r=>JSON.stringify(r)).join(", ")}`),t.defaultValue!==void 0&&(t.required||t.optional||t.isBoolean()&&typeof t.defaultValue=="boolean")&&n.push(`default: ${t.defaultValueDescription||JSON.stringify(t.defaultValue)}`),t.presetArg!==void 0&&t.optional&&n.push(`preset: ${JSON.stringify(t.presetArg)}`),t.envVar!==void 0&&n.push(`env: ${t.envVar}`),n.length>0){let r=`(${n.join(", ")})`;return t.description?`${t.description} ${r}`:r}return t.description}argumentDescription(t){let n=[];if(t.argChoices&&n.push(`choices: ${t.argChoices.map(r=>JSON.stringify(r)).join(", ")}`),t.defaultValue!==void 0&&n.push(`default: ${t.defaultValueDescription||JSON.stringify(t.defaultValue)}`),n.length>0){let r=`(${n.join(", ")})`;return t.description?`${t.description} ${r}`:r}return t.description}formatItemList(t,n,r){return n.length===0?[]:[r.styleTitle(t),...n,""]}groupItems(t,n,r){let i=new Map;return t.forEach(o=>{let s=r(o);i.has(s)||i.set(s,[])}),n.forEach(o=>{let s=r(o);i.has(s)||i.set(s,[]),i.get(s).push(o)}),i}formatHelp(t,n){let r=n.padWidth(t,n),i=n.helpWidth??80;function o(c,m){return n.formatItem(c,r,m,n)}let s=[`${n.styleTitle("Usage:")} ${n.styleUsage(n.commandUsage(t))}`,""],a=n.commandDescription(t);a.length>0&&(s=s.concat([n.boxWrap(n.styleCommandDescription(a),i),""]));let l=n.visibleArguments(t).map(c=>o(n.styleArgumentTerm(n.argumentTerm(c)),n.styleArgumentDescription(n.argumentDescription(c))));if(s=s.concat(this.formatItemList("Arguments:",l,n)),this.groupItems(t.options,n.visibleOptions(t),c=>c.helpGroupHeading??"Options:").forEach((c,m)=>{let p=c.map(f=>o(n.styleOptionTerm(n.optionTerm(f)),n.styleOptionDescription(n.optionDescription(f))));s=s.concat(this.formatItemList(m,p,n))}),n.showGlobalOptions){let c=n.visibleGlobalOptions(t).map(m=>o(n.styleOptionTerm(n.optionTerm(m)),n.styleOptionDescription(n.optionDescription(m))));s=s.concat(this.formatItemList("Global Options:",c,n))}return this.groupItems(t.commands,n.visibleCommands(t),c=>c.helpGroup()||"Commands:").forEach((c,m)=>{let p=c.map(f=>o(n.styleSubcommandTerm(n.subcommandTerm(f)),n.styleSubcommandDescription(n.subcommandDescription(f))));s=s.concat(this.formatItemList(m,p,n))}),s.join(`
|
|
3
|
+
`)}displayWidth(t){return sx(t).length}styleTitle(t){return t}styleUsage(t){return t.split(" ").map(n=>n==="[options]"?this.styleOptionText(n):n==="[command]"?this.styleSubcommandText(n):n[0]==="["||n[0]==="<"?this.styleArgumentText(n):this.styleCommandText(n)).join(" ")}styleCommandDescription(t){return this.styleDescriptionText(t)}styleOptionDescription(t){return this.styleDescriptionText(t)}styleSubcommandDescription(t){return this.styleDescriptionText(t)}styleArgumentDescription(t){return this.styleDescriptionText(t)}styleDescriptionText(t){return t}styleOptionTerm(t){return this.styleOptionText(t)}styleSubcommandTerm(t){return t.split(" ").map(n=>n==="[options]"?this.styleOptionText(n):n[0]==="["||n[0]==="<"?this.styleArgumentText(n):this.styleSubcommandText(n)).join(" ")}styleArgumentTerm(t){return this.styleArgumentText(t)}styleOptionText(t){return t}styleArgumentText(t){return t}styleSubcommandText(t){return t}styleCommandText(t){return t}padWidth(t,n){return Math.max(n.longestOptionTermLength(t,n),n.longestGlobalOptionTermLength(t,n),n.longestSubcommandTermLength(t,n),n.longestArgumentTermLength(t,n))}preformatted(t){return/\n[^\S\r\n]/.test(t)}formatItem(t,n,r,i){let s=" ".repeat(2);if(!r)return s+t;let a=t.padEnd(n+t.length-i.displayWidth(t)),l=2,d=(this.helpWidth??80)-n-l-2,c;return d<this.minWidthToWrap||i.preformatted(r)?c=r:c=i.boxWrap(r,d).replace(/\n/g,`
|
|
4
4
|
`+" ".repeat(n+l)),s+a+" ".repeat(l)+c.replace(/\n/g,`
|
|
5
5
|
${s}`)}boxWrap(t,n){if(n<this.minWidthToWrap)return t;let r=t.split(/\r\n|\n/),i=/[\s]*[^\s]+/g,o=[];return r.forEach(s=>{let a=s.match(i);if(a===null){o.push("");return}let l=[a.shift()],u=this.displayWidth(l[0]);a.forEach(d=>{let c=this.displayWidth(d);if(u+c<=n){l.push(d),u+=c;return}o.push(l.join(""));let m=d.trimStart();l=[m],u=this.displayWidth(m)}),o.push(l.join(""))}),o.join(`
|
|
6
|
-
`)}};var
|
|
6
|
+
`)}};var oe=class{constructor(t,n){this.flags=t,this.description=n||"",this.required=t.includes("<"),this.optional=t.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(t),this.mandatory=!1;let r=ax(t);this.short=r.shortFlag,this.long=r.longFlag,this.negate=!1,this.long&&(this.negate=this.long.startsWith("--no-")),this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0,this.helpGroupHeading=void 0}default(t,n){return this.defaultValue=t,this.defaultValueDescription=n,this}preset(t){return this.presetArg=t,this}conflicts(t){return this.conflictsWith=this.conflictsWith.concat(t),this}implies(t){let n=t;return typeof t=="string"&&(n={[t]:!0}),this.implied=Object.assign(this.implied||{},n),this}env(t){return this.envVar=t,this}argParser(t){return this.parseArg=t,this}makeOptionMandatory(t=!0){return this.mandatory=!!t,this}hideHelp(t=!0){return this.hidden=!!t,this}_collectValue(t,n){return n===this.defaultValue||!Array.isArray(n)?[t]:(n.push(t),n)}choices(t){return this.argChoices=t.slice(),this.parseArg=(n,r)=>{if(!this.argChoices.includes(n))throw new ze(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._collectValue(n,r):n},this}name(){return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){return this.negate?tm(this.name().replace(/^no-/,"")):tm(this.name())}helpGroup(t){return this.helpGroupHeading=t,this}is(t){return this.short===t||this.long===t}isBoolean(){return!this.required&&!this.optional&&!this.negate}},is=class{constructor(t){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,t.forEach(n=>{n.negate?this.negativeOptions.set(n.attributeName(),n):this.positiveOptions.set(n.attributeName(),n)}),this.negativeOptions.forEach((n,r)=>{this.positiveOptions.has(r)&&this.dualOptions.add(r)})}valueFromOption(t,n){let r=n.attributeName();if(!this.dualOptions.has(r))return!0;let i=this.negativeOptions.get(r).presetArg,o=i!==void 0?i:!1;return n.negate===(o===t)}};function tm(e){return e.split("-").reduce((t,n)=>t+n[0].toUpperCase()+n.slice(1))}function ax(e){let t,n,r=/^-[^-]$/,i=/^--[^-]/,o=e.split(/[ |,]+/).concat("guard");if(r.test(o[0])&&(t=o.shift()),i.test(o[0])&&(n=o.shift()),!t&&r.test(o[0])&&(t=o.shift()),!t&&i.test(o[0])&&(t=n,n=o.shift()),o[0].startsWith("-")){let s=o[0],a=`option creation failed due to '${s}' in option flags '${e}'`;throw/^-[^-][^-]/.test(s)?new Error(`${a}
|
|
7
7
|
- a short flag is a single dash and a single character
|
|
8
8
|
- either use a single dash and a single character (for a short flag)
|
|
9
9
|
- or use a double dash for a long option (and can have two, like '--ws, --workspace')`):r.test(s)?new Error(`${a}
|
|
10
10
|
- too many short flags`):i.test(s)?new Error(`${a}
|
|
11
11
|
- too many long flags`):new Error(`${a}
|
|
12
|
-
- unrecognised flag format`)}if(t===void 0&&n===void 0)throw new Error(`option creation failed due to no flags found in '${e}'.`);return{shortFlag:t,longFlag:n}}function
|
|
12
|
+
- unrecognised flag format`)}if(t===void 0&&n===void 0)throw new Error(`option creation failed due to no flags found in '${e}'.`);return{shortFlag:t,longFlag:n}}function lx(e,t){if(Math.abs(e.length-t.length)>3)return Math.max(e.length,t.length);let n=[];for(let r=0;r<=e.length;r++)n[r]=[r];for(let r=0;r<=t.length;r++)n[0][r]=r;for(let r=1;r<=t.length;r++)for(let i=1;i<=e.length;i++){let o;e[i-1]===t[r-1]?o=0:o=1,n[i][r]=Math.min(n[i-1][r]+1,n[i][r-1]+1,n[i-1][r-1]+o),i>1&&r>1&&e[i-1]===t[r-2]&&e[i-2]===t[r-1]&&(n[i][r]=Math.min(n[i][r],n[i-2][r-2]+1))}return n[e.length][t.length]}function Wa(e,t){if(!t||t.length===0)return"";t=Array.from(new Set(t));let n=e.startsWith("--");n&&(e=e.slice(2),t=t.map(s=>s.slice(2)));let r=[],i=3,o=.4;return t.forEach(s=>{if(s.length<=1)return;let a=lx(e,s),l=Math.max(e.length,s.length);(l-a)/l>o&&(a<i?(i=a,r=[s]):a===i&&r.push(s))}),r.sort((s,a)=>s.localeCompare(a)),n&&(r=r.map(s=>`--${s}`)),r.length>1?`
|
|
13
13
|
(Did you mean one of ${r.join(", ")}?)`:r.length===1?`
|
|
14
|
-
(Did you mean ${r[0]}?)`:""}var
|
|
15
|
-
- specify the name in Command constructor or using .name()`);return n=n||{},n.isDefault&&(this._defaultCommandName=t._name),(n.noHelp||n.hidden)&&(t._hidden=!0),this._registerCommand(t),t.parent=this,t._checkForBrokenPassThrough(),this}createArgument(t,n){return new
|
|
16
|
-
Expecting one of '${r.join("', '")}'`);return this._lifeCycleHooks[t]?this._lifeCycleHooks[t].push(n):this._lifeCycleHooks[t]=[n],this}exitOverride(t){return t?this._exitCallback=t:this._exitCallback=n=>{if(n.code!=="commander.executeSubCommandAsync")throw n},this}_exit(t,n,r){this._exitCallback&&this._exitCallback(new et(t,n,r)),Y.exit(t)}action(t){let n=r=>{let i=this.registeredArguments.length,o=r.slice(0,i);return this._storeOptionsAsProperties?o[i]=this:o[i]=this.opts(),o.push(this),t.apply(this,o)};return this._actionHandler=n,this}createOption(t,n){return new
|
|
17
|
-
- already used by option '${n.flags}'`)}this._initOptionGroup(t),this.options.push(t)}_registerCommand(t){let n=i=>[i.name()].concat(i.aliases()),r=n(t).find(i=>this._findCommand(i));if(r){let i=n(this._findCommand(r)).join("|"),o=n(t).join("|");throw new Error(`cannot add command '${o}' as already have command '${i}'`)}this._initCommandGroup(t),this.commands.push(t)}addOption(t){this._registerOption(t);let n=t.name(),r=t.attributeName();t.defaultValue!==void 0&&this.setOptionValueWithSource(r,t.defaultValue,"default");let i=(o,s,a)=>{o==null&&t.presetArg!==void 0&&(o=t.presetArg);let l=this.getOptionValue(r);o!==null&&t.parseArg?o=this._callParseArg(t,o,l,s):o!==null&&t.variadic&&(o=t._collectValue(o,l)),o==null&&(t.negate?o=!1:t.isBoolean()||t.optional?o=!0:o=""),this.setOptionValueWithSource(r,o,a)};return this.on("option:"+n,o=>{let s=`error: option '${t.flags}' argument '${o}' is invalid.`;i(o,s,"cli")}),t.envVar&&this.on("optionEnv:"+n,o=>{let s=`error: option '${t.flags}' value '${o}' from env '${t.envVar}' is invalid.`;i(o,s,"env")}),this}_optionEx(t,n,r,i,o){if(typeof n=="object"&&n instanceof
|
|
18
|
-
- either make a new Command for each call to parse, or stop storing options as properties`);this._name=this._savedState._name,this._scriptPath=null,this.rawArgs=[],this._optionValues={...this._savedState._optionValues},this._optionValueSources={...this._savedState._optionValueSources},this.args=[],this.processedArgs=[]}_checkForMissingExecutable(t,n,r){if(
|
|
14
|
+
(Did you mean ${r[0]}?)`:""}var Cr=class e extends ux{constructor(t){super(),this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!1,this.registeredArguments=[],this._args=this.registeredArguments,this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=t||"",this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description="",this._summary="",this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._savedState=null,this._outputConfiguration={writeOut:n=>Y.stdout.write(n),writeErr:n=>Y.stderr.write(n),outputError:(n,r)=>r(n),getOutHelpWidth:()=>Y.stdout.isTTY?Y.stdout.columns:void 0,getErrHelpWidth:()=>Y.stderr.isTTY?Y.stderr.columns:void 0,getOutHasColors:()=>rm()??(Y.stdout.isTTY&&Y.stdout.hasColors?.()),getErrHasColors:()=>rm()??(Y.stderr.isTTY&&Y.stderr.hasColors?.()),stripColor:n=>cx(n)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={},this._helpGroupHeading=void 0,this._defaultCommandGroup=void 0,this._defaultOptionGroup=void 0}copyInheritedSettings(t){return this._outputConfiguration=t._outputConfiguration,this._helpOption=t._helpOption,this._helpCommand=t._helpCommand,this._helpConfiguration=t._helpConfiguration,this._exitCallback=t._exitCallback,this._storeOptionsAsProperties=t._storeOptionsAsProperties,this._combineFlagAndOptionalValue=t._combineFlagAndOptionalValue,this._allowExcessArguments=t._allowExcessArguments,this._enablePositionalOptions=t._enablePositionalOptions,this._showHelpAfterError=t._showHelpAfterError,this._showSuggestionAfterError=t._showSuggestionAfterError,this}_getCommandAndAncestors(){let t=[];for(let n=this;n;n=n.parent)t.push(n);return t}command(t,n,r){let i=n,o=r;typeof i=="object"&&i!==null&&(o=i,i=null),o=o||{};let[,s,a]=t.match(/([^ ]+) *(.*)/),l=this.createCommand(s);return i&&(l.description(i),l._executableHandler=!0),o.isDefault&&(this._defaultCommandName=l._name),l._hidden=!!(o.noHelp||o.hidden),l._executableFile=o.executableFile||null,a&&l.arguments(a),this._registerCommand(l),l.parent=this,l.copyInheritedSettings(this),i?this:l}createCommand(t){return new e(t)}createHelp(){return Object.assign(new bi,this.configureHelp())}configureHelp(t){return t===void 0?this._helpConfiguration:(this._helpConfiguration=t,this)}configureOutput(t){return t===void 0?this._outputConfiguration:(this._outputConfiguration={...this._outputConfiguration,...t},this)}showHelpAfterError(t=!0){return typeof t!="string"&&(t=!!t),this._showHelpAfterError=t,this}showSuggestionAfterError(t=!0){return this._showSuggestionAfterError=!!t,this}addCommand(t,n){if(!t._name)throw new Error(`Command passed to .addCommand() must have a name
|
|
15
|
+
- specify the name in Command constructor or using .name()`);return n=n||{},n.isDefault&&(this._defaultCommandName=t._name),(n.noHelp||n.hidden)&&(t._hidden=!0),this._registerCommand(t),t.parent=this,t._checkForBrokenPassThrough(),this}createArgument(t,n){return new jt(t,n)}argument(t,n,r,i){let o=this.createArgument(t,n);return typeof r=="function"?o.default(i).argParser(r):o.default(r),this.addArgument(o),this}arguments(t){return t.trim().split(/ +/).forEach(n=>{this.argument(n)}),this}addArgument(t){let n=this.registeredArguments.slice(-1)[0];if(n?.variadic)throw new Error(`only the last argument can be variadic '${n.name()}'`);if(t.required&&t.defaultValue!==void 0&&t.parseArg===void 0)throw new Error(`a default value for a required argument is never used: '${t.name()}'`);return this.registeredArguments.push(t),this}helpCommand(t,n){if(typeof t=="boolean")return this._addImplicitHelpCommand=t,t&&this._defaultCommandGroup&&this._initCommandGroup(this._getHelpCommand()),this;let r=t??"help [command]",[,i,o]=r.match(/([^ ]+) *(.*)/),s=n??"display help for command",a=this.createCommand(i);return a.helpOption(!1),o&&a.arguments(o),s&&a.description(s),this._addImplicitHelpCommand=!0,this._helpCommand=a,(t||n)&&this._initCommandGroup(a),this}addHelpCommand(t,n){return typeof t!="object"?(this.helpCommand(t,n),this):(this._addImplicitHelpCommand=!0,this._helpCommand=t,this._initCommandGroup(t),this)}_getHelpCommand(){return this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand("help"))?(this._helpCommand===void 0&&this.helpCommand(void 0,void 0),this._helpCommand):null}hook(t,n){let r=["preSubcommand","preAction","postAction"];if(!r.includes(t))throw new Error(`Unexpected value for event passed to hook : '${t}'.
|
|
16
|
+
Expecting one of '${r.join("', '")}'`);return this._lifeCycleHooks[t]?this._lifeCycleHooks[t].push(n):this._lifeCycleHooks[t]=[n],this}exitOverride(t){return t?this._exitCallback=t:this._exitCallback=n=>{if(n.code!=="commander.executeSubCommandAsync")throw n},this}_exit(t,n,r){this._exitCallback&&this._exitCallback(new et(t,n,r)),Y.exit(t)}action(t){let n=r=>{let i=this.registeredArguments.length,o=r.slice(0,i);return this._storeOptionsAsProperties?o[i]=this:o[i]=this.opts(),o.push(this),t.apply(this,o)};return this._actionHandler=n,this}createOption(t,n){return new oe(t,n)}_callParseArg(t,n,r,i){try{return t.parseArg(n,r)}catch(o){if(o.code==="commander.invalidArgument"){let s=`${i} ${o.message}`;this.error(s,{exitCode:o.exitCode,code:o.code})}throw o}}_registerOption(t){let n=t.short&&this._findOption(t.short)||t.long&&this._findOption(t.long);if(n){let r=t.long&&this._findOption(t.long)?t.long:t.short;throw new Error(`Cannot add option '${t.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${r}'
|
|
17
|
+
- already used by option '${n.flags}'`)}this._initOptionGroup(t),this.options.push(t)}_registerCommand(t){let n=i=>[i.name()].concat(i.aliases()),r=n(t).find(i=>this._findCommand(i));if(r){let i=n(this._findCommand(r)).join("|"),o=n(t).join("|");throw new Error(`cannot add command '${o}' as already have command '${i}'`)}this._initCommandGroup(t),this.commands.push(t)}addOption(t){this._registerOption(t);let n=t.name(),r=t.attributeName();t.defaultValue!==void 0&&this.setOptionValueWithSource(r,t.defaultValue,"default");let i=(o,s,a)=>{o==null&&t.presetArg!==void 0&&(o=t.presetArg);let l=this.getOptionValue(r);o!==null&&t.parseArg?o=this._callParseArg(t,o,l,s):o!==null&&t.variadic&&(o=t._collectValue(o,l)),o==null&&(t.negate?o=!1:t.isBoolean()||t.optional?o=!0:o=""),this.setOptionValueWithSource(r,o,a)};return this.on("option:"+n,o=>{let s=`error: option '${t.flags}' argument '${o}' is invalid.`;i(o,s,"cli")}),t.envVar&&this.on("optionEnv:"+n,o=>{let s=`error: option '${t.flags}' value '${o}' from env '${t.envVar}' is invalid.`;i(o,s,"env")}),this}_optionEx(t,n,r,i,o){if(typeof n=="object"&&n instanceof oe)throw new Error("To add an Option object use addOption() instead of option() or requiredOption()");let s=this.createOption(n,r);if(s.makeOptionMandatory(!!t.mandatory),typeof i=="function")s.default(o).argParser(i);else if(i instanceof RegExp){let a=i;i=(l,u)=>{let d=a.exec(l);return d?d[0]:u},s.default(o).argParser(i)}else s.default(i);return this.addOption(s)}option(t,n,r,i){return this._optionEx({},t,n,r,i)}requiredOption(t,n,r,i){return this._optionEx({mandatory:!0},t,n,r,i)}combineFlagAndOptionalValue(t=!0){return this._combineFlagAndOptionalValue=!!t,this}allowUnknownOption(t=!0){return this._allowUnknownOption=!!t,this}allowExcessArguments(t=!0){return this._allowExcessArguments=!!t,this}enablePositionalOptions(t=!0){return this._enablePositionalOptions=!!t,this}passThroughOptions(t=!0){return this._passThroughOptions=!!t,this._checkForBrokenPassThrough(),this}_checkForBrokenPassThrough(){if(this.parent&&this._passThroughOptions&&!this.parent._enablePositionalOptions)throw new Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`)}storeOptionsAsProperties(t=!0){if(this.options.length)throw new Error("call .storeOptionsAsProperties() before adding options");if(Object.keys(this._optionValues).length)throw new Error("call .storeOptionsAsProperties() before setting option values");return this._storeOptionsAsProperties=!!t,this}getOptionValue(t){return this._storeOptionsAsProperties?this[t]:this._optionValues[t]}setOptionValue(t,n){return this.setOptionValueWithSource(t,n,void 0)}setOptionValueWithSource(t,n,r){return this._storeOptionsAsProperties?this[t]=n:this._optionValues[t]=n,this._optionValueSources[t]=r,this}getOptionValueSource(t){return this._optionValueSources[t]}getOptionValueSourceWithGlobals(t){let n;return this._getCommandAndAncestors().forEach(r=>{r.getOptionValueSource(t)!==void 0&&(n=r.getOptionValueSource(t))}),n}_prepareUserArgs(t,n){if(t!==void 0&&!Array.isArray(t))throw new Error("first parameter to parse must be array or undefined");if(n=n||{},t===void 0&&n.from===void 0){Y.versions?.electron&&(n.from="electron");let i=Y.execArgv??[];(i.includes("-e")||i.includes("--eval")||i.includes("-p")||i.includes("--print"))&&(n.from="eval")}t===void 0&&(t=Y.argv),this.rawArgs=t.slice();let r;switch(n.from){case void 0:case"node":this._scriptPath=t[1],r=t.slice(2);break;case"electron":Y.defaultApp?(this._scriptPath=t[1],r=t.slice(2)):r=t.slice(1);break;case"user":r=t.slice(0);break;case"eval":r=t.slice(1);break;default:throw new Error(`unexpected parse option { from: '${n.from}' }`)}return!this._name&&this._scriptPath&&this.nameFromFilename(this._scriptPath),this._name=this._name||"program",r}parse(t,n){this._prepareForParse();let r=this._prepareUserArgs(t,n);return this._parseCommand([],r),this}async parseAsync(t,n){this._prepareForParse();let r=this._prepareUserArgs(t,n);return await this._parseCommand([],r),this}_prepareForParse(){this._savedState===null?(this.options.filter(t=>t.negate&&t.defaultValue===void 0&&this.getOptionValue(t.attributeName())===void 0).forEach(t=>{let n=t.long.replace(/^--no-/,"--");this._findOption(n)||this.setOptionValueWithSource(t.attributeName(),!0,"default")}),this.saveStateBeforeParse()):this.restoreStateBeforeParse()}saveStateBeforeParse(){this._savedState={_name:this._name,_optionValues:{...this._optionValues},_optionValueSources:{...this._optionValueSources}}}restoreStateBeforeParse(){if(this._storeOptionsAsProperties)throw new Error(`Can not call parse again when storeOptionsAsProperties is true.
|
|
18
|
+
- either make a new Command for each call to parse, or stop storing options as properties`);this._name=this._savedState._name,this._scriptPath=null,this.rawArgs=[],this._optionValues={...this._savedState._optionValues},this._optionValueSources={...this._savedState._optionValueSources},this.args=[],this.processedArgs=[]}_checkForMissingExecutable(t,n,r){if(os.existsSync(t))return;let i=n?`searched for local subcommand relative to directory '${n}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",o=`'${t}' does not exist
|
|
19
19
|
- if '${r}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
|
|
20
20
|
- if the default executable name is not suitable, use the executableFile option to supply a custom name or path
|
|
21
|
-
- ${i}`;throw new Error(o)}_executeSubCommand(t,n){n=n.slice();let r=[".js",".ts",".tsx",".mjs",".cjs"];function i(d,c){let m=
|
|
21
|
+
- ${i}`;throw new Error(o)}_executeSubCommand(t,n){n=n.slice();let r=[".js",".ts",".tsx",".mjs",".cjs"];function i(d,c){let m=Ht.resolve(d,c);if(os.existsSync(m))return m;if(r.includes(Ht.extname(c)))return;let p=r.find(f=>os.existsSync(`${m}${f}`));if(p)return`${m}${p}`}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let o=t._executableFile||`${this._name}-${t._name}`,s=this._executableDir||"";if(this._scriptPath){let d;try{d=os.realpathSync(this._scriptPath)}catch{d=this._scriptPath}s=Ht.resolve(Ht.dirname(d),s)}if(s){let d=i(s,o);if(!d&&!t._executableFile&&this._scriptPath){let c=Ht.basename(this._scriptPath,Ht.extname(this._scriptPath));c!==this._name&&(d=i(s,`${c}-${t._name}`))}o=d||o}let a=r.includes(Ht.extname(o)),l;Y.platform!=="win32"?a?(n.unshift(o),n=nm(Y.execArgv).concat(n),l=Ga.spawn(Y.argv[0],n,{stdio:"inherit"})):l=Ga.spawn(o,n,{stdio:"inherit"}):(this._checkForMissingExecutable(o,s,t._name),n.unshift(o),n=nm(Y.execArgv).concat(n),l=Ga.spawn(Y.execPath,n,{stdio:"inherit"})),l.killed||["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach(c=>{Y.on(c,()=>{l.killed===!1&&l.exitCode===null&&l.kill(c)})});let u=this._exitCallback;l.on("close",d=>{d=d??1,u?u(new et(d,"commander.executeSubCommandAsync","(close)")):Y.exit(d)}),l.on("error",d=>{if(d.code==="ENOENT")this._checkForMissingExecutable(o,s,t._name);else if(d.code==="EACCES")throw new Error(`'${o}' not executable`);if(!u)Y.exit(1);else{let c=new et(1,"commander.executeSubCommandAsync","(error)");c.nestedError=d,u(c)}}),this.runningCommand=l}_dispatchSubcommand(t,n,r){let i=this._findCommand(t);i||this.help({error:!0}),i._prepareForParse();let o;return o=this._chainOrCallSubCommandHook(o,i,"preSubcommand"),o=this._chainOrCall(o,()=>{if(i._executableHandler)this._executeSubCommand(i,n.concat(r));else return i._parseCommand(n,r)}),o}_dispatchHelpCommand(t){t||this.help();let n=this._findCommand(t);return n&&!n._executableHandler&&n.help(),this._dispatchSubcommand(t,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){this.registeredArguments.forEach((t,n)=>{t.required&&this.args[n]==null&&this.missingArgument(t.name())}),!(this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic)&&this.args.length>this.registeredArguments.length&&this._excessArguments(this.args)}_processArguments(){let t=(r,i,o)=>{let s=i;if(i!==null&&r.parseArg){let a=`error: command-argument value '${i}' is invalid for argument '${r.name()}'.`;s=this._callParseArg(r,i,o,a)}return s};this._checkNumberOfArguments();let n=[];this.registeredArguments.forEach((r,i)=>{let o=r.defaultValue;r.variadic?i<this.args.length?(o=this.args.slice(i),r.parseArg&&(o=o.reduce((s,a)=>t(r,a,s),r.defaultValue))):o===void 0&&(o=[]):i<this.args.length&&(o=this.args[i],r.parseArg&&(o=t(r,o,r.defaultValue))),n[i]=o}),this.processedArgs=n}_chainOrCall(t,n){return t?.then&&typeof t.then=="function"?t.then(()=>n()):n()}_chainOrCallHooks(t,n){let r=t,i=[];return this._getCommandAndAncestors().reverse().filter(o=>o._lifeCycleHooks[n]!==void 0).forEach(o=>{o._lifeCycleHooks[n].forEach(s=>{i.push({hookedCommand:o,callback:s})})}),n==="postAction"&&i.reverse(),i.forEach(o=>{r=this._chainOrCall(r,()=>o.callback(o.hookedCommand,this))}),r}_chainOrCallSubCommandHook(t,n,r){let i=t;return this._lifeCycleHooks[r]!==void 0&&this._lifeCycleHooks[r].forEach(o=>{i=this._chainOrCall(i,()=>o(this,n))}),i}_parseCommand(t,n){let r=this.parseOptions(n);if(this._parseOptionsEnv(),this._parseOptionsImplied(),t=t.concat(r.operands),n=r.unknown,this.args=t.concat(n),t&&this._findCommand(t[0]))return this._dispatchSubcommand(t[0],t.slice(1),n);if(this._getHelpCommand()&&t[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(t[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(n),this._dispatchSubcommand(this._defaultCommandName,t,n);this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName&&this.help({error:!0}),this._outputHelpIfRequested(r.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let i=()=>{r.unknown.length>0&&this.unknownOption(r.unknown[0])},o=`command:${this.name()}`;if(this._actionHandler){i(),this._processArguments();let s;return s=this._chainOrCallHooks(s,"preAction"),s=this._chainOrCall(s,()=>this._actionHandler(this.processedArgs)),this.parent&&(s=this._chainOrCall(s,()=>{this.parent.emit(o,t,n)})),s=this._chainOrCallHooks(s,"postAction"),s}if(this.parent?.listenerCount(o))i(),this._processArguments(),this.parent.emit(o,t,n);else if(t.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",t,n);this.listenerCount("command:*")?this.emit("command:*",t,n):this.commands.length?this.unknownCommand():(i(),this._processArguments())}else this.commands.length?(i(),this.help({error:!0})):(i(),this._processArguments())}_findCommand(t){if(t)return this.commands.find(n=>n._name===t||n._aliases.includes(t))}_findOption(t){return this.options.find(n=>n.is(t))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach(t=>{t.options.forEach(n=>{n.mandatory&&t.getOptionValue(n.attributeName())===void 0&&t.missingMandatoryOptionValue(n)})})}_checkForConflictingLocalOptions(){let t=this.options.filter(r=>{let i=r.attributeName();return this.getOptionValue(i)===void 0?!1:this.getOptionValueSource(i)!=="default"});t.filter(r=>r.conflictsWith.length>0).forEach(r=>{let i=t.find(o=>r.conflictsWith.includes(o.attributeName()));i&&this._conflictingOption(r,i)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach(t=>{t._checkForConflictingLocalOptions()})}parseOptions(t){let n=[],r=[],i=n;function o(d){return d.length>1&&d[0]==="-"}let s=d=>/^-(\d+|\d*\.\d+)(e[+-]?\d+)?$/.test(d)?!this._getCommandAndAncestors().some(c=>c.options.map(m=>m.short).some(m=>/^-\d$/.test(m))):!1,a=null,l=null,u=0;for(;u<t.length||l;){let d=l??t[u++];if(l=null,d==="--"){i===r&&i.push(d),i.push(...t.slice(u));break}if(a&&(!o(d)||s(d))){this.emit(`option:${a.name()}`,d);continue}if(a=null,o(d)){let c=this._findOption(d);if(c){if(c.required){let m=t[u++];m===void 0&&this.optionMissingArgument(c),this.emit(`option:${c.name()}`,m)}else if(c.optional){let m=null;u<t.length&&(!o(t[u])||s(t[u]))&&(m=t[u++]),this.emit(`option:${c.name()}`,m)}else this.emit(`option:${c.name()}`);a=c.variadic?c:null;continue}}if(d.length>2&&d[0]==="-"&&d[1]!=="-"){let c=this._findOption(`-${d[1]}`);if(c){c.required||c.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${c.name()}`,d.slice(2)):(this.emit(`option:${c.name()}`),l=`-${d.slice(2)}`);continue}}if(/^--[^=]+=/.test(d)){let c=d.indexOf("="),m=this._findOption(d.slice(0,c));if(m&&(m.required||m.optional)){this.emit(`option:${m.name()}`,d.slice(c+1));continue}}if(i===n&&o(d)&&!(this.commands.length===0&&s(d))&&(i=r),(this._enablePositionalOptions||this._passThroughOptions)&&n.length===0&&r.length===0){if(this._findCommand(d)){n.push(d),r.push(...t.slice(u));break}else if(this._getHelpCommand()&&d===this._getHelpCommand().name()){n.push(d,...t.slice(u));break}else if(this._defaultCommandName){r.push(d,...t.slice(u));break}}if(this._passThroughOptions){i.push(d,...t.slice(u));break}i.push(d)}return{operands:n,unknown:r}}opts(){if(this._storeOptionsAsProperties){let t={},n=this.options.length;for(let r=0;r<n;r++){let i=this.options[r].attributeName();t[i]=i===this._versionOptionName?this._version:this[i]}return t}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce((t,n)=>Object.assign(t,n.opts()),{})}error(t,n){this._outputConfiguration.outputError(`${t}
|
|
22
22
|
`,this._outputConfiguration.writeErr),typeof this._showHelpAfterError=="string"?this._outputConfiguration.writeErr(`${this._showHelpAfterError}
|
|
23
23
|
`):this._showHelpAfterError&&(this._outputConfiguration.writeErr(`
|
|
24
|
-
`),this.outputHelp({error:!0}));let r=n||{},i=r.exitCode||1,o=r.code||"commander.error";this._exit(i,o,t)}_parseOptionsEnv(){this.options.forEach(t=>{if(t.envVar&&t.envVar in Y.env){let n=t.attributeName();(this.getOptionValue(n)===void 0||["default","config","env"].includes(this.getOptionValueSource(n)))&&(t.required||t.optional?this.emit(`optionEnv:${t.name()}`,Y.env[t.envVar]):this.emit(`optionEnv:${t.name()}`))}})}_parseOptionsImplied(){let t=new
|
|
25
|
-
`),this._exit(0,"commander.version",t)}),this}description(t,n){return t===void 0&&n===void 0?this._description:(this._description=t,n&&(this._argsDescription=n),this)}summary(t){return t===void 0?this._summary:(this._summary=t,this)}alias(t){if(t===void 0)return this._aliases[0];let n=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler&&(n=this.commands[this.commands.length-1]),t===n._name)throw new Error("Command alias can't be the same as its name");let r=this.parent?._findCommand(t);if(r){let i=[r.name()].concat(r.aliases()).join("|");throw new Error(`cannot add alias '${t}' to command '${this.name()}' as already have command '${i}'`)}return n._aliases.push(t),this}aliases(t){return t===void 0?this._aliases:(t.forEach(n=>this.alias(n)),this)}usage(t){if(t===void 0){if(this._usage)return this._usage;let n=this.registeredArguments.map(r=>
|
|
24
|
+
`),this.outputHelp({error:!0}));let r=n||{},i=r.exitCode||1,o=r.code||"commander.error";this._exit(i,o,t)}_parseOptionsEnv(){this.options.forEach(t=>{if(t.envVar&&t.envVar in Y.env){let n=t.attributeName();(this.getOptionValue(n)===void 0||["default","config","env"].includes(this.getOptionValueSource(n)))&&(t.required||t.optional?this.emit(`optionEnv:${t.name()}`,Y.env[t.envVar]):this.emit(`optionEnv:${t.name()}`))}})}_parseOptionsImplied(){let t=new is(this.options),n=r=>this.getOptionValue(r)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(r));this.options.filter(r=>r.implied!==void 0&&n(r.attributeName())&&t.valueFromOption(this.getOptionValue(r.attributeName()),r)).forEach(r=>{Object.keys(r.implied).filter(i=>!n(i)).forEach(i=>{this.setOptionValueWithSource(i,r.implied[i],"implied")})})}missingArgument(t){let n=`error: missing required argument '${t}'`;this.error(n,{code:"commander.missingArgument"})}optionMissingArgument(t){let n=`error: option '${t.flags}' argument missing`;this.error(n,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(t){let n=`error: required option '${t.flags}' not specified`;this.error(n,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(t,n){let r=s=>{let a=s.attributeName(),l=this.getOptionValue(a),u=this.options.find(c=>c.negate&&a===c.attributeName()),d=this.options.find(c=>!c.negate&&a===c.attributeName());return u&&(u.presetArg===void 0&&l===!1||u.presetArg!==void 0&&l===u.presetArg)?u:d||s},i=s=>{let a=r(s),l=a.attributeName();return this.getOptionValueSource(l)==="env"?`environment variable '${a.envVar}'`:`option '${a.flags}'`},o=`error: ${i(t)} cannot be used with ${i(n)}`;this.error(o,{code:"commander.conflictingOption"})}unknownOption(t){if(this._allowUnknownOption)return;let n="";if(t.startsWith("--")&&this._showSuggestionAfterError){let i=[],o=this;do{let s=o.createHelp().visibleOptions(o).filter(a=>a.long).map(a=>a.long);i=i.concat(s),o=o.parent}while(o&&!o._enablePositionalOptions);n=Wa(t,i)}let r=`error: unknown option '${t}'${n}`;this.error(r,{code:"commander.unknownOption"})}_excessArguments(t){if(this._allowExcessArguments)return;let n=this.registeredArguments.length,r=n===1?"":"s",i=t.length,o=this.parent?` for '${this.name()}'`:"",s=t.join(", "),a=`error: too many arguments${o}. Expected ${n} argument${r} but got ${i}: ${s}.`;this.error(a,{code:"commander.excessArguments"})}unknownCommand(){let t=this.args[0],n="";if(this._showSuggestionAfterError){let i=[];this.createHelp().visibleCommands(this).forEach(o=>{i.push(o.name()),o.alias()&&i.push(o.alias())}),n=Wa(t,i)}let r=`error: unknown command '${t}'${n}`;this.error(r,{code:"commander.unknownCommand"})}version(t,n,r){if(t===void 0)return this._version;this._version=t,n=n||"-V, --version",r=r||"output the version number";let i=this.createOption(n,r);return this._versionOptionName=i.attributeName(),this._registerOption(i),this.on("option:"+i.name(),()=>{this._outputConfiguration.writeOut(`${t}
|
|
25
|
+
`),this._exit(0,"commander.version",t)}),this}description(t,n){return t===void 0&&n===void 0?this._description:(this._description=t,n&&(this._argsDescription=n),this)}summary(t){return t===void 0?this._summary:(this._summary=t,this)}alias(t){if(t===void 0)return this._aliases[0];let n=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler&&(n=this.commands[this.commands.length-1]),t===n._name)throw new Error("Command alias can't be the same as its name");let r=this.parent?._findCommand(t);if(r){let i=[r.name()].concat(r.aliases()).join("|");throw new Error(`cannot add alias '${t}' to command '${this.name()}' as already have command '${i}'`)}return n._aliases.push(t),this}aliases(t){return t===void 0?this._aliases:(t.forEach(n=>this.alias(n)),this)}usage(t){if(t===void 0){if(this._usage)return this._usage;let n=this.registeredArguments.map(r=>rs(r));return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?n:[]).join(" ")}return this._usage=t,this}name(t){return t===void 0?this._name:(this._name=t,this)}helpGroup(t){return t===void 0?this._helpGroupHeading??"":(this._helpGroupHeading=t,this)}commandsGroup(t){return t===void 0?this._defaultCommandGroup??"":(this._defaultCommandGroup=t,this)}optionsGroup(t){return t===void 0?this._defaultOptionGroup??"":(this._defaultOptionGroup=t,this)}_initOptionGroup(t){this._defaultOptionGroup&&!t.helpGroupHeading&&t.helpGroup(this._defaultOptionGroup)}_initCommandGroup(t){this._defaultCommandGroup&&!t.helpGroup()&&t.helpGroup(this._defaultCommandGroup)}nameFromFilename(t){return this._name=Ht.basename(t,Ht.extname(t)),this}executableDir(t){return t===void 0?this._executableDir:(this._executableDir=t,this)}helpInformation(t){let n=this.createHelp(),r=this._getOutputContext(t);n.prepareContext({error:r.error,helpWidth:r.helpWidth,outputHasColors:r.hasColors});let i=n.formatHelp(this,n);return r.hasColors?i:this._outputConfiguration.stripColor(i)}_getOutputContext(t){t=t||{};let n=!!t.error,r,i,o;return n?(r=a=>this._outputConfiguration.writeErr(a),i=this._outputConfiguration.getErrHasColors(),o=this._outputConfiguration.getErrHelpWidth()):(r=a=>this._outputConfiguration.writeOut(a),i=this._outputConfiguration.getOutHasColors(),o=this._outputConfiguration.getOutHelpWidth()),{error:n,write:a=>(i||(a=this._outputConfiguration.stripColor(a)),r(a)),hasColors:i,helpWidth:o}}outputHelp(t){let n;typeof t=="function"&&(n=t,t=void 0);let r=this._getOutputContext(t),i={error:r.error,write:r.write,command:this};this._getCommandAndAncestors().reverse().forEach(s=>s.emit("beforeAllHelp",i)),this.emit("beforeHelp",i);let o=this.helpInformation({error:r.error});if(n&&(o=n(o),typeof o!="string"&&!Buffer.isBuffer(o)))throw new Error("outputHelp callback must return a string or a Buffer");r.write(o),this._getHelpOption()?.long&&this.emit(this._getHelpOption().long),this.emit("afterHelp",i),this._getCommandAndAncestors().forEach(s=>s.emit("afterAllHelp",i))}helpOption(t,n){return typeof t=="boolean"?(t?(this._helpOption===null&&(this._helpOption=void 0),this._defaultOptionGroup&&this._initOptionGroup(this._getHelpOption())):this._helpOption=null,this):(this._helpOption=this.createOption(t??"-h, --help",n??"display help for command"),(t||n)&&this._initOptionGroup(this._helpOption),this)}_getHelpOption(){return this._helpOption===void 0&&this.helpOption(void 0,void 0),this._helpOption}addHelpOption(t){return this._helpOption=t,this._initOptionGroup(t),this}help(t){this.outputHelp(t);let n=Number(Y.exitCode??0);n===0&&t&&typeof t!="function"&&t.error&&(n=1),this._exit(n,"commander.help","(outputHelp)")}addHelpText(t,n){let r=["beforeAll","before","after","afterAll"];if(!r.includes(t))throw new Error(`Unexpected value for position to addHelpText.
|
|
26
26
|
Expecting one of '${r.join("', '")}'`);let i=`${t}Help`;return this.on(i,o=>{let s;typeof n=="function"?s=n({error:o.error,command:o.command}):s=n,s&&o.write(`${s}
|
|
27
|
-
`)}),this}_outputHelpIfRequested(t){let n=this._getHelpOption();n&&t.find(i=>n.is(i))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};function
|
|
27
|
+
`)}),this}_outputHelpIfRequested(t){let n=this._getHelpOption();n&&t.find(i=>n.is(i))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};function nm(e){return e.map(t=>{if(!t.startsWith("--inspect"))return t;let n,r="127.0.0.1",i="9229",o;return(o=t.match(/^(--inspect(-brk)?)$/))!==null?n=o[1]:(o=t.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(n=o[1],/^\d+$/.test(o[3])?i=o[3]:r=o[3]):(o=t.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(n=o[1],r=o[3],i=o[4]),n&&i!=="0"?`${n}=${r}:${parseInt(i)+1}`:t})}function rm(){if(Y.env.NO_COLOR||Y.env.FORCE_COLOR==="0"||Y.env.FORCE_COLOR==="false")return!1;if(Y.env.FORCE_COLOR||Y.env.CLICOLOR_FORCE!==void 0)return!0}var sI=new Cr;var ss="en-US",dx={and:new Intl.ListFormat(ss,{type:"conjunction"}),or:new Intl.ListFormat(ss,{type:"disjunction"})};function St(e,t="and"){return dx[t].format(e)}var im={read_only:["read"],send_only:["send"],read_and_send:["send","read","tidy"],everything:["send","read","tidy","manage"]},Va={read_only:"Read only",send_only:"Send only",read_and_send:"Read and send",everything:"Everything"};function om(e){return typeof e=="string"&&Object.hasOwn(im,e)}function mx(e,t){return im[e].includes(t)}function sm(e){return St(e.map(t=>Va[t]),"or")}function am(e){return mx(e,"read")}function lm(e){return e==="all"?"All sources":e.length===1?e[0]:e.length?`${e.length} sources`:"No sources"}var um=[{method:"GET",path:"/v1/access",access:["send","read"],sendKey:!0},{method:"POST",path:"/v1/send",access:["send"],sendKey:!0},{method:"GET",path:"/v1/messages",access:["read"]},{method:"GET",path:"/v1/messages/stream",access:["read"]},{method:"GET",path:"/v1/messages/{messageId}",access:["read"]},{method:"POST",path:"/v1/messages/read",access:["tidy"]},{method:"POST",path:"/v1/messages/unread",access:["tidy"]},{method:"POST",path:"/v1/messages/archive",access:["tidy"]},{method:"POST",path:"/v1/messages/unarchive",access:["tidy"]},{method:"POST",path:"/v1/messages/trash",access:["manage"]},{method:"POST",path:"/v1/messages/search",access:["read"]},{method:"POST",path:"/v1/messages/move",access:["tidy"]},{method:"PUT",path:"/v1/messages/{messageId}/snooze",access:["tidy"]},{method:"DELETE",path:"/v1/messages/{messageId}/snooze",access:["tidy"]},{method:"GET",path:"/v1/threads/{threadId}",access:["read"]},{method:"GET",path:"/v1/message-images/{imageId}/{variant}",access:["read"]},{method:"GET",path:"/v1/sources",access:["send","read"]},{method:"POST",path:"/v1/sources",access:["manage"]},{method:"GET",path:"/v1/sources/{sourceId}",access:["read"]},{method:"PATCH",path:"/v1/sources/{sourceId}",access:["manage"]},{method:"DELETE",path:"/v1/sources/{sourceId}",access:["manage"]},{method:"POST",path:"/v1/sources/{sourceId}/mute",access:["manage"]},{method:"POST",path:"/v1/sources/{sourceId}/unmute",access:["manage"]},{method:"POST",path:"/v1/sources/{sourceId}/disable",access:["manage"]},{method:"POST",path:"/v1/sources/{sourceId}/enable",access:["manage"]},{method:"POST",path:"/v1/sources/{sourceId}/read",access:["tidy"]},{method:"POST",path:"/v1/sources/{sourceId}/send-key",access:["manage"]},{method:"POST",path:"/v1/sources/{sourceId}/send-key/reset",access:["manage"]},{method:"GET",path:"/v1/trash",access:["read"]},{method:"POST",path:"/v1/trash/search",access:["read"]},{method:"GET",path:"/v1/trash/messages/{messageId}",access:["read"]},{method:"DELETE",path:"/v1/trash/messages/{messageId}",access:["manage"]},{method:"POST",path:"/v1/trash/messages/{messageId}/restore",access:["manage"]},{method:"GET",path:"/v1/trash/threads/{threadId}",access:["read"]},{method:"DELETE",path:"/v1/trash/threads/{threadId}",access:["manage"]},{method:"POST",path:"/v1/trash/threads/{threadId}/restore",access:["manage"]},{method:"DELETE",path:"/v1/trash/sources/{sourceId}",access:["manage"]},{method:"POST",path:"/v1/trash/sources/{sourceId}/restore",access:["manage"]}];var re={rejected:1,usage:2,notFound:3,access:4,tryLater:5,unknownOutcome:6},fx={invalid_arguments:re.usage,invalid_base_url:re.usage,insecure_base_url:re.usage,invalid_config:re.usage,invalid_source:re.rejected,not_found:re.notFound,missing_key:re.access,invalid_key:re.access,send_key_only:re.access,signed_out:re.access,login_cancelled:re.rejected,login_failed:re.rejected,update_failed:re.rejected,request_timeout:re.unknownOutcome,network_error:re.unknownOutcome,empty_response:re.unknownOutcome,unexpected_error:re.rejected},$=class extends Error{constructor(n,r,i){super(r);this.code=n;this.hint=i;this.exitCode=fx[n]}exitCode},U=class extends Error{};function Gt(e){return e instanceof Error?e.message:String(e)}var Wt=class extends Error{constructor(n,r){super(r.message);this.reason=n;this.undone=r}};function H(e,t,{params:n={},...r}={}){let i=um.find(s=>s.path===t&&s.method===e);if(!i)throw new Error(`${e} ${t} is not a published operation.`);let o=t.replace(/\{([^}]+)\}/g,(s,a)=>{let l=n[a];if(!l?.trim()||l==="."||l==="..")throw new U(`"${l??""}" is not a valid ID.`);return encodeURIComponent(l)});return{method:e,path:o,..."sendKey"in i?{sendKey:!0}:{},...r}}function as(e,t="reach"){return new $("network_error",`Could not ${t} Ripple at ${e}. Check your network connection.`)}function ls(e="reach"){return new $("invalid_base_url",`Could not ${e} Ripple. RIPPLE_BASE_URL must be a valid URL.`)}function Ya(e,{baseUrl:t,key:n,signal:r}){let i=new URL(t.replace(/\/$/,"")+e.path);for(let[s,a]of Object.entries(e.query??{}))a!==void 0&&i.searchParams.set(s,String(a));let o=e.body!==void 0&&!(e.body instanceof FormData);return new Request(i,{method:e.method,headers:{authorization:`Bearer ${n}`,...e.headers,...o?{"content-type":"application/json"}:{}},...e.body===void 0?{}:{body:o?JSON.stringify(e.body):e.body},signal:r})}function Za(e){return e.headers.get("x-ripple-latest-cli-version")??void 0}async function Ka(e,t){let n=await fetch(Ya(e,t)),r=Za(n);return{...await Ja(n,e.file),...r?{latestRelease:r}:{}}}async function Ja(e,t=!1){let{status:n}=e;if(n===204)return{status:n};if(t&&e.ok)return{status:n,data:new Uint8Array(await e.arrayBuffer())};let r=e.ok?void 0:Number(e.headers.get("retry-after"))||void 0,i=await e.text(),o;try{o=JSON.parse(i)}catch{return{status:n,unreadable:!0,retryAfter:r,error:{code:"invalid_response",message:`Ripple returned HTTP ${n} without a JSON response. The operation may have completed; reconcile before retrying.`}}}return e.ok?typeof o!="object"||o===null?{status:n,unreadable:!0,error:{code:"invalid_response",message:"Ripple returned an invalid JSON response."}}:{status:n,data:o}:{status:n,retryAfter:r,error:typeof o=="object"&&o!==null?o:{code:"http_error",message:`Ripple returned HTTP ${n}.`}}}async function*cm(e){let t=new TextDecoder,n="",r,i="",o=[];for await(let s of e){n+=t.decode(s,{stream:!0});for(let a=n.indexOf(`
|
|
28
28
|
`);a>=0;a=n.indexOf(`
|
|
29
29
|
`)){let l=n.slice(0,a).replace(/\r$/,"");if(n=n.slice(a+1),l===""){yield{event:i||"message",...o.length?{data:o.join(`
|
|
30
|
-
`)}:{},...r===void 0?{}:{id:r}},i="",o=[];continue}let u=l.indexOf(":");if(u===0)continue;let d=u<0?l:l.slice(0,u),c=u<0?"":l.slice(u+1).replace(/^ /,"");d==="id"?r=c:d==="event"?i=c:d==="data"&&o.push(c)}}}import{existsSync as
|
|
31
|
-
`)})}var
|
|
32
|
-
`,{mode:384,flag:"wx"}),await
|
|
33
|
-
`)}function
|
|
30
|
+
`)}:{},...r===void 0?{}:{id:r}},i="",o=[];continue}let u=l.indexOf(":");if(u===0)continue;let d=u<0?l:l.slice(0,u),c=u<0?"":l.slice(u+1).replace(/^ /,"");d==="id"?r=c:d==="event"?i=c:d==="data"&&o.push(c)}}}import{existsSync as gx,readFileSync as yx,statSync as wx}from"node:fs";import{homedir as xx}from"node:os";import{join as bx}from"node:path";var dm="[0-9a-hjkmnp-tv-z]";function us(e){return new RegExp(`^${e}_${dm}{16}$`)}function cs(e){return new RegExp(`^${e}_${dm}{26}$`)}var mm={send:"rpl_send",api:"rpl_api",access:"rpl_at",refresh:"rpl_rt"},yI=`${mm.send}_`,hx=Object.entries(mm).map(([e,t])=>[e,cs(t)]);function pm(e){return hx.find(([,t])=>t.test(e))?.[0]??null}var Xa="https://api.ripple.do";function kx(){return bx(xx(),".config","ripple","config.json")}function Sx(e){if(!gx(e))return;let{baseUrl:t}=JSON.parse(yx(e,"utf8"));if(t){if(process.platform!=="win32"&&(wx(e).mode&18)!==0)throw new Error("Refusing to use CLI config file because it is writable by other users. Run `chmod 600` on the file.");return t}}function Tx(e){let t=e.RIPPLE_KEY?.trim();if(!t)return{};let n=pm(t);if(n!=="send"&&n!=="api")throw new $("invalid_key","RIPPLE_KEY isn't a Ripple key. Keys start with rpl_send_ or rpl_api_.","Copy it again from Ripple, then run: export RIPPLE_KEY=<key>");return{key:t,kind:n}}function fm({env:e,flags:t,configPath:n=kx()}){let r=Tx(e),i=t.baseUrl||e.RIPPLE_BASE_URL||Sx(n)||Xa;if(!Qa(i))throw new $("insecure_base_url","Ripple's address must start with https://, so your key isn't sent unencrypted.","Plain http:// works only for localhost.");return{baseUrl:i,...r}}function Qa(e){let t;try{t=new URL(e)}catch{return!0}return t.protocol==="https:"||t.protocol==="http:"&&["localhost","127.0.0.1","[::1]"].includes(t.hostname)}import{spawn as Ex}from"node:child_process";import{randomBytes as Cx}from"node:crypto";import{existsSync as Ix}from"node:fs";import{chmod as hm,mkdir as _x,readFile as Ax,rename as Ox,rm as gm,writeFile as Dx}from"node:fs/promises";import{homedir as ym}from"node:os";import{dirname as vx,join as Mx}from"node:path";var Rx="Ripple CLI",wm="/usr/bin/security";function xm(e){if(typeof e!="object"||e===null)return null;let{accessToken:t,refreshToken:n,expiresAt:r,tokenEndpoint:i,revocationEndpoint:o}=e;return typeof t=="string"&&typeof n=="string"&&typeof r=="number"&&typeof i=="string"&&typeof o=="string"?{accessToken:t,refreshToken:n,expiresAt:r,tokenEndpoint:i,revocationEndpoint:o}:null}function el(e){return new Promise((t,n)=>{let r=Ex(wm,["-i"],{stdio:["pipe","pipe","ignore"]}),i="";r.stdout.on("data",o=>{i+=o.toString()}),r.once("error",n),r.once("close",o=>t({status:o??1,output:i})),r.stdin.end(`${e}
|
|
31
|
+
`)})}var tl=e=>`"${e.replace(/["\\]/g,"")}"`;function Nx(){let e=t=>`-a ${tl(t)} -s ${tl(Rx)}`;return{description:"the macOS Keychain",async load(t){let{status:n,output:r}=await el(`find-generic-password ${e(t)} -w`);if(n!==0)return null;try{return xm(JSON.parse(Buffer.from(r.trim(),"base64").toString("utf8")))}catch{return null}},async save(t,n){let r=Buffer.from(JSON.stringify(n)).toString("base64"),{status:i}=await el(`add-generic-password -U ${e(t)} -w ${tl(r)}`);if(i!==0)throw new Error(`Could not save the sign-in in the Keychain (security exited with ${i}).`)},async delete(t){await el(`delete-generic-password ${e(t)}`)}}}function Px(e=Mx(ym(),".config","ripple","credentials.json")){async function t(){try{await hm(e,384);let r=JSON.parse(await Ax(e,"utf8"));return typeof r=="object"&&r!==null&&!Array.isArray(r)?r:{}}catch{return{}}}async function n(r){if(Object.keys(r).length===0){await gm(e,{force:!0});return}await _x(vx(e),{recursive:!0,mode:448});let i=`${e}.${Cx(6).toString("hex")}.tmp`;try{await Dx(i,`${JSON.stringify(r,null,2)}
|
|
32
|
+
`,{mode:384,flag:"wx"}),await hm(i,384),await Ox(i,e)}catch(o){throw await gm(i,{force:!0}),o}}return{description:e.replace(ym(),"~"),async load(r){return xm((await t())[r])},async save(r,i){await n({...await t(),[r]:i})},async delete(r){let{[r]:i,...o}=await t();await n(o)}}}var nl=e=>!!(e.SSH_CONNECTION||e.SSH_CLIENT||e.SSH_TTY);function bm(e){return process.platform==="darwin"&&!nl(e)&&Ix(wm)?Nx():Px()}import{styleText as Yx}from"node:util";function ki(e){return/\u0000|[\uD800-\uDFFF]/u.test(e)}var Lx=/\x1b(?:\[[0-?]*[ -/]*[@-~]|\][^\x07\x1b]*(?:\x07|\x1b\\)|[ -/]*[0-~]?)/g;function Si(e){return e.replace(Lx,"")}var Fx=new Intl.Segmenter("en",{granularity:"grapheme"});function Ti(e,t,n){if(!n&&e.length<=t)return e;let r=0;for(let{index:i,segment:o}of Fx.segment(e))if(r+=n?n(o):o.length,r>t)return e.slice(0,i);return e}var ds=[161,161,164,164,167,168,170,170,173,174,176,180,182,186,188,191,198,198,208,208,215,216,222,225,230,230,232,234,236,237,240,240,242,243,247,250,252,252,254,254,257,257,273,273,275,275,283,283,294,295,299,299,305,307,312,312,319,322,324,324,328,331,333,333,338,339,358,359,363,363,462,462,464,464,466,466,468,468,470,470,472,472,474,474,476,476,593,593,609,609,708,708,711,711,713,715,717,717,720,720,728,731,733,733,735,735,768,879,913,929,931,937,945,961,963,969,1025,1025,1040,1103,1105,1105,8208,8208,8211,8214,8216,8217,8220,8221,8224,8226,8228,8231,8240,8240,8242,8243,8245,8245,8251,8251,8254,8254,8308,8308,8319,8319,8321,8324,8364,8364,8451,8451,8453,8453,8457,8457,8467,8467,8470,8470,8481,8482,8486,8486,8491,8491,8531,8532,8539,8542,8544,8555,8560,8569,8585,8585,8592,8601,8632,8633,8658,8658,8660,8660,8679,8679,8704,8704,8706,8707,8711,8712,8715,8715,8719,8719,8721,8721,8725,8725,8730,8730,8733,8736,8739,8739,8741,8741,8743,8748,8750,8750,8756,8759,8764,8765,8776,8776,8780,8780,8786,8786,8800,8801,8804,8807,8810,8811,8814,8815,8834,8835,8838,8839,8853,8853,8857,8857,8869,8869,8895,8895,8978,8978,9312,9449,9451,9547,9552,9587,9600,9615,9618,9621,9632,9633,9635,9641,9650,9651,9654,9655,9660,9661,9664,9665,9670,9672,9675,9675,9678,9681,9698,9701,9711,9711,9733,9734,9737,9737,9742,9743,9756,9756,9758,9758,9792,9792,9794,9794,9824,9825,9827,9829,9831,9834,9836,9837,9839,9839,9886,9887,9919,9919,9926,9933,9935,9939,9941,9953,9955,9955,9960,9961,9963,9969,9972,9972,9974,9977,9979,9980,9982,9983,10045,10045,10102,10111,11094,11097,12872,12879,57344,63743,65024,65039,65533,65533,127232,127242,127248,127277,127280,127337,127344,127373,127375,127376,127387,127404,917760,917999,983040,1048573,1048576,1114109],ms=[12288,12288,65281,65376,65504,65510],rl=[8361,8361,65377,65470,65474,65479,65482,65487,65490,65495,65498,65500,65512,65518],il=[32,126,162,163,165,166,172,172,175,175,10214,10221,10629,10630],Ei=[4352,4447,8986,8987,9001,9002,9193,9196,9200,9200,9203,9203,9725,9726,9748,9749,9776,9783,9800,9811,9855,9855,9866,9871,9875,9875,9889,9889,9898,9899,9917,9918,9924,9925,9934,9934,9940,9940,9962,9962,9970,9971,9973,9973,9978,9978,9981,9981,9989,9989,9994,9995,10024,10024,10060,10060,10062,10062,10067,10069,10071,10071,10133,10135,10160,10160,10175,10175,11035,11036,11088,11088,11093,11093,11904,11929,11931,12019,12032,12245,12272,12287,12289,12350,12353,12438,12441,12543,12549,12591,12593,12686,12688,12773,12783,12830,12832,12871,12880,42124,42128,42182,43360,43388,44032,55203,63744,64255,65040,65049,65072,65106,65108,65126,65128,65131,94176,94180,94192,94198,94208,101589,101631,101662,101760,101874,110576,110579,110581,110587,110589,110590,110592,110882,110898,110898,110928,110930,110933,110933,110948,110951,110960,111355,119552,119638,119648,119670,126980,126980,127183,127183,127374,127374,127377,127386,127488,127490,127504,127547,127552,127560,127568,127569,127584,127589,127744,127776,127789,127797,127799,127868,127870,127891,127904,127946,127951,127955,127968,127984,127988,127988,127992,128062,128064,128064,128066,128252,128255,128317,128331,128334,128336,128359,128378,128378,128405,128406,128420,128420,128507,128591,128640,128709,128716,128716,128720,128722,128725,128728,128732,128735,128747,128748,128756,128764,128992,129003,129008,129008,129292,129338,129340,129349,129351,129535,129648,129660,129664,129674,129678,129734,129736,129736,129741,129756,129759,129770,129775,129784,131072,196605,196608,262141];var ps=(e,t)=>{let n=0,r=Math.floor(e.length/2)-1;for(;n<=r;){let i=Math.floor((n+r)/2),o=i*2;if(t<e[o])r=i-1;else if(t>e[o+1])n=i+1;else return!0}return!1};var $x=ds[0],Ux=ds.at(-1),zx=ms[0],Bx=ms.at(-1),FI=rl[0],$I=rl.at(-1),UI=il[0],zI=il.at(-1),qx=Ei[0],jx=Ei.at(-1),km=19968,[Hx,Wx]=Gx(Ei);function Gx(e){let t=e[0],n=e[1];for(let r=0;r<e.length;r+=2){let i=e[r],o=e[r+1];if(km>=i&&km<=o)return[i,o];o-i>n-t&&(t=i,n=o)}return[t,n]}var Sm=e=>e<$x||e>Ux?!1:ps(ds,e),Tm=e=>e<zx||e>Bx?!1:ps(ms,e);var Em=e=>e>=Hx&&e<=Wx?!0:e<qx||e>jx?!1:ps(Ei,e);function Vx(e){if(!Number.isSafeInteger(e))throw new TypeError(`Expected a code point, got \`${typeof e}\`.`)}function Cm(e,{ambiguousAsWide:t=!1}={}){return Vx(e),Tm(e)||Em(e)||t&&Sm(e)?2:1}function Am(e){let t=n=>r=>e?Yx(n,r,{validateStream:!1}):r;return{color:e,bold:t("bold"),dim:t("dim"),accent:t("blue"),error:t("red"),warning:t("yellow")}}function Pe(e,t){return`${e} ${t}${e===1?"":"s"}`}function Tt(e){return e.charAt(0).toUpperCase()+e.slice(1)}function Im(e){return e.replace(/\s+/g," ").trim()}var Zx=new Intl.Segmenter("en",{granularity:"grapheme"}),Kx=new RegExp("^\\p{RGI_Emoji}$","v"),Jx=/^[\p{Control}\p{Mark}\p{Default_Ignorable_Code_Point}]/u;function Om(e){return Kx.test(e)?2:Jx.test(e)?0:Cm(e.codePointAt(0))}function Ir(e){let t=0;for(let{segment:n}of Zx.segment(e))t+=Om(n);return t}function Dm(e,t){return e+" ".repeat(Math.max(0,t-Ir(e)))}function _m(e,t){return Ir(e)<=t?e:`${Ti(e,Math.max(0,t-1),Om).trimEnd()}\u2026`}function mn(e,t,n){return new Intl.DateTimeFormat(ss,{timeZone:t.timeZone,...n}).format(new Date(e)).replace(/ /g," ")}var ol={hour:"numeric",minute:"2-digit"};function Ci(e,t){let n=t.now.toISOString(),r=i=>mn(i,t,{year:"numeric",month:"numeric",day:"numeric"});return r(e)===r(n)?mn(e,t,ol):mn(e,t,{year:"numeric"})===mn(n,t,{year:"numeric"})?mn(e,t,{month:"short",day:"numeric",...ol}):Bn(e,t)}function Vt(e,t){return`${mn(e,t,{weekday:"short",month:"short",day:"numeric",year:"numeric"})} at ${mn(e,t,ol)}`}function Bn(e,t){return mn(e,t,{month:"short",day:"numeric",year:"numeric"})}function Ii(e,{unread:t=!1,title:n,detail:r,facts:i,extra:o}){let{style:s}=e,a=(e.width??1/0)-2,l=_m(Im(n),a),u=a-Ir(l)-2,d=r&&u>=12?` ${s.dim(_m(Im(r),u))}`:"";return[`${t?s.accent("\u25CF"):" "} ${t?s.bold(l):l}${d}`,` ${s.dim(i.filter(Boolean).join(" \xB7 "))}`,...o?[` ${s.dim(o)}`]:[]].join(`
|
|
33
|
+
`)}function _i(e,t,n,r=[]){let i=r.filter(s=>!!s).map(e.style.dim);return[t.length?t.join(`
|
|
34
34
|
|
|
35
35
|
`):n,...i.length?["",...i]:[]].join(`
|
|
36
36
|
`)+`
|
|
37
|
-
`}function
|
|
38
|
-
${" ".repeat(r+2)}`;return n.map(([o,s])=>`${e.style.dim(
|
|
37
|
+
`}function _r(e,t){let n=t.filter(o=>!!o[1]),r=Math.max(...n.map(([o])=>Ir(o))),i=`
|
|
38
|
+
${" ".repeat(r+2)}`;return n.map(([o,s])=>`${e.style.dim(Dm(o,r))} ${s.replaceAll(`
|
|
39
39
|
`,i)}`).join(`
|
|
40
|
-
`)}function
|
|
40
|
+
`)}function sl(e,t,n){let r=t.map((o,s)=>Math.max(Ir(o),...n.map(a=>Ir(a[s])))),i=o=>o.map((s,a)=>a===o.length-1?s:Dm(s,r[a])).join(" ");return[e.style.dim(i(t)),...n.map(i)].join(`
|
|
41
41
|
`)+`
|
|
42
|
-
`}function
|
|
42
|
+
`}function vm(e,t,n){return`${e.style.error("Error:")} ${t}
|
|
43
43
|
${n?`${e.style.dim(n)}
|
|
44
|
-
`:""}`}function
|
|
45
|
-
`));let u=AbortSignal.timeout(
|
|
46
|
-
`));;){let a=await n("Code: ");if(a===null)throw ul();if(!a.trim())continue;let l=$m(a);if(!l){i(r.warning("Codes have 8 letters and numbers, like 7QK2-M9XD."));continue}let u=await dl(e,{grant_type:"authorization_code",code:l,redirect_uri:s,code_verifier:o.verifier},t);if("credential"in u)return u.credential;if(u.error!=="invalid_grant")throw ps(`Ripple refused the code (${u.error})`);i(r.warning("That code didn't work. Check it, or open the link again for a new one."))}}async function Vm(e,{browser:t}){let{ask:n}=e;if(!t&&!n)throw new $("login_failed","Connecting without a browser needs a terminal to type the code in.","Run ripple login at a terminal, or set RIPPLE_KEY to an API token instead.");let r=await lb(e),i=t?await cb(r,e):await db(r,e,n),o=await e.store.load(e.baseUrl).catch(()=>null);return await e.store.save(e.baseUrl,i),o&&!await ml(o,e)&&e.say(e.style.warning("Could not reach Ripple to end this terminal's previous sign-in. Sign out the older one in Settings \u2192 Account \u2192 Signed in.")),{credential:i,replaced:o!==null}}import{randomUUID as gb}from"node:crypto";import{readFile as yb}from"node:fs/promises";import wb from"node:path";var mb=5*1024*1024;var T_=`Choose an image up to ${mb/(1024*1024)} MB.`;var Ym=["red","orange","yellow","green","teal","blue","indigo","purple","pink"];function Zm(e,t){let n=t?.name.trim();return n&&Gt(n)!==Gt(e)?n:null}var E_=ss("pic");function Gt(e){return e.trim().replace(/\s+/g," ").toLowerCase()}function pb(e){return t=>{let n=Number(t);if(!Number.isSafeInteger(n)||n<1||n>e)throw new Ye(`must be a whole number from 1 to ${e}.`);return n}}function hs(e){if(!e.trim())throw new Ye("needs a value.");return e}function fl(e){return/T.*(?:Z|[+-]\d{2}:\d{2})$/.test(e)&&Number.isFinite(Date.parse(e))}function fb(e){if(!fl(e))throw new Ye("must be a time like 2026-10-17T09:00:00Z, with Z or an offset such as -04:00.");return e}var ue=(e,t)=>new se(e,t).argParser(hs),Km=(e,t)=>new se(e,t).argParser(fb),hl=(e,t,n)=>new se(e,t).argParser(pb(n)),Ze=(e,t,n)=>new se(e,t).choices(n),fs=100,_i=25;function qn(e,t){let n=hl("--limit <count>",`How many ${e} a page holds, up to ${fs}${t?` (default ${t})`:""}`,fs);return t===void 0?n:n.default(t)}var jn=()=>ue("--cursor <cursor>","Continue from where the last page ended"),Ai=e=>Ze("-a, --alert <level>",e,ds),Hn=()=>new se("--all",`Show every page; without --limit, each holds ${fs}`).conflicts("cursor").implies({limit:fs}),gl=()=>[new se("--unread","Only unread messages").conflicts("read"),new se("--read","Only read messages")];function yl({unread:e,read:t}){return e?!0:t?!1:void 0}async function Vt(e,t,{many:n=!1,named:r=i=>wl(e,i)}={}){if(t===void 0)return;let i=(n?t.split(","):[t]).map(a=>a.trim());if(i.some(a=>!a))throw new B("--source needs sources separated by commas, with none left empty.");let o=i.filter(a=>!Jm(a)),s=o.length?await r(o):[];return[...new Set(i.flatMap(a=>{let l=Jm(a)?a:s[o.indexOf(a)];return l===void 0?[]:[l]}))]}var hb=os("src"),Jm=e=>hb.test(e);async function wl(e,t){let{items:n}=await e.call(H("GET","/v1/sources"));return t.map(r=>{let i=n.find(o=>Gt(o.name)===Gt(r));if(!i)throw new $("not_found",`You have no source named ${r}.`,'Run "ripple sources" to see your sources.');return i.sourceId})}function mn({limit:e,cursor:t,all:n},r){return i=>{let o=i.at(-1);if(!o)return r({limit:e,cursor:t});let s=n&&"nextCursor"in o?o.nextCursor:void 0;return typeof s=="string"&&s?r({limit:e,cursor:s}):void 0}}function gs(){return[ue("-s, --source <sources>","Only messages from these sources, by name or ID, separated by commas"),...gl(),Km("--after <time>","Only messages received after this time"),Km("--before <time>","Only messages received before this time"),Ai("Only messages with this alert level"),Ze("--sort <order>","Best matches first, or newest first",["relevance","newest"]),qn("results",_i),jn(),Hn()]}async function ys(e,t,n){return{query:t.length?t.join(" "):void 0,unread:yl(n),sourceIds:await Vt(e,n.source,{many:!0}),after:n.after,before:n.before,alert:n.alert,sort:n.sort}}var Bn=100;async function Xm(e,t){if(!e.includes("-")){if(e.length>Bn)throw new B(`Give at most ${Bn} message IDs as arguments; got ${e.length}. For more, use - and pipe them in.`);return e}if(e.length>1)throw new B("Use - on its own to pipe message IDs in.");let n=await ws(t,{asked:!0});if(n===void 0)throw new B("Pipe the message IDs in when using -.");let r=[...new Set(n.split(/\s+/).filter(Boolean))];if(!r.length)throw new B("No message IDs were piped in.");return r}async function ws(e,{asked:t}){if(!e||!(t||e.piped))return;let n=[];for await(let r of e.stream)n.push(Buffer.from(r));return Buffer.concat(n).toString("utf8")}function Qm(e,t){let n=[];e.command("send").description("Send a message. A send key sends to its own source; an API token sends to Inbox or the source you choose. With no message text, ripple send uses what you pipe in, shown exactly as printed unless you add --markdown or --html. When Ripple can't take it, ripple send keeps trying for 5 minutes, and never sends it twice.").summary("Send a message").argument("[message...]").addOption(ue("-t, --title <text>","A title shown above the message (by default its first line, or a field that names its JSON)")).addOption(ue("-s, --source <source>","Send to this source, by name or ID, instead of Inbox; a send key sends only to its own")).addOption(ue("--thread <key>","Add to the source's thread with this key, such as a deploy or ticket ID, starting it if there's none")).addOption(ue("--thread-title <text>","The name a thread --thread starts is shown by, instead of its key")).addOption(ue("--thread-id <id>","Add to the thread with this ID, as an earlier send returned it")).addOption(Ai("How strongly to alert")).addOption(Ze("--sound <name>","Which sound it plays, instead of the source's or your account's",Ii)).addOption(new se("--link <url>",`A link to open from the message: https, email, phone, or another app's; repeat for up to ${Am}, the first leading`).argParser(r=>(n.push(hs(r)),n))).addOption(new se("--link-title <text>","A label for the --link before it, instead of its domain").argParser(r=>{let i=n.at(-1);if(typeof i!="string")throw new Ye("must follow the --link it names.");return n[n.length-1]={url:i,title:hs(r)},n})).addOption(ue("--body <text>","Same as the message argument")).option("--markdown","Format the message as Markdown, such as headings, lists, links, and code").option("--html","Turn the message from HTML, such as an email, into formatted text; its <title> becomes the title").addOption(ue("--json-file <path>","Send a full request from a JSON file, or - to pipe it in")).addOption(ue("--idempotency-key <key>","Send only once, however often it runs with this key within 24 hours")).example('ripple send "Deploy finished"','make test 2>&1 | tail -20 | ripple send --title "Test results"','ripple send --markdown --title "Release notes" < notes.md',"ripple send --html < digest.html",'ripple send --source Deploys --thread deploy-42 --thread-title "Deploy #42" --title "Tests passed" "All 312 green"','ripple send --source Deploys --thread-id thr_06gm53wzxakqgkm4 "Shipped"','ripple send --title "Disk almost full" --alert important "Only 2 GB left on /data"','ripple send --title "Deploy failed" --sound tick "Build 42 failed"','ripple send --link https://ci.example.com/runs/42 --link-title "Open run" --link https://example.com/logs "Deploy failed"').action(async(r,i)=>{let o=H("POST","/v1/send",{body:await xb(r,n,i,t),headers:{"Idempotency-Key":i.idempotencyKey??gb()}});await t.run(o,s=>bl(s,t.display))})}async function xb(e,t,n,r){let{title:i,alert:o,sound:s,jsonFile:a,markdown:l,html:u}=n;if(n.body!==void 0&&e.length)throw new B("Give the message text once, either as an argument or with --body.");let d=n.body??(e.length?e.join(" "):void 0);if(l&&u)throw new B("Choose either --markdown or --html, not both.");let c=kb(n);if(a!==void 0){if(t.length||[i,d,n.source,c,o,s,l,u].some(f=>f!==void 0))throw new B("--json-file holds the whole message, so use it without other message options or text.");return Tb(await Sb(a,r),a)}let m=d??((await ws(r.input,{asked:!1}))?.trimEnd()||void 0);if(i===void 0&&m===void 0)throw new B('Add a message, for example: ripple send "Deploy finished"');let[p]=await Vt(r,n.source,{named:async f=>await r.keyKind()==="send"?bb(r,f):wl(r,f)})??[];return{title:i,body:m,format:l?"markdown":u?"html":void 0,links:t.length?t:void 0,alert:o,sound:s,source:p,thread:c}}var xl="Leave out --source: a send key always sends to its own source.";async function bb(e,t){let{source:n}=await e.call(H("GET","/v1/access"));return t.map(r=>{if(Gt(r)!==Gt(n.name))throw new $("invalid_source",Dm(n.name),xl);return n.sourceId})}function kb({thread:e,threadTitle:t,threadId:n}){let r=`a non-empty text of ${ms} characters or fewer`;if(n!==void 0){if(e!==void 0||t!==void 0)throw new B("--thread-id names its thread, so leave out --thread and --thread-title.");if(!vm(n.trim()))throw new B("--thread-id must be a thread ID Ripple returned, such as thr_06gm53wzxakqgkm4.");return{id:n.trim()}}if(e===void 0){if(t!==void 0)throw new B("--thread-title names the thread --thread starts, so add --thread.");return}let i=il(e);if(!i)throw new B(`--thread must be ${r}.`);if(t===void 0)return i;let o=il(t);if(!o)throw new B(`--thread-title must be ${r}.`);return{key:i,title:o}}async function Sb(e,t){if(e==="-"){let n=await ws(t.input,{asked:!0});if(n===void 0)throw new B("Pipe the JSON in when using --json-file -.");return n}try{return await yb(wb.resolve(t.env.INIT_CWD??process.cwd(),e),"utf8")}catch(n){throw new B(`Could not read ${e}: ${n instanceof Error?n.message:String(n)}`)}}function Tb(e,t){let n;try{n=JSON.parse(e)}catch(r){throw new B(`Could not parse JSON from ${t}: ${r instanceof Error?r.message:String(r)}`)}if(!n||typeof n!="object"||Array.isArray(n))throw new B("The JSON must be an object shaped like the /v1/send request body.");return n}function bl(e,t){let{style:n}=t,r=e.thread?` in "${e.thread.title}" (message ${e.thread.messageNumber})`:"",i=(e.warnings??[]).map(o=>`${n.warning("Warning:")} ${o.message}
|
|
44
|
+
`:""}`}function al(e){return e?`Next page: --cursor ${e}`:void 0}function fs(e){let{nextCursor:t,total:n}=e.at(-1),r=e.reduce((i,o)=>i+o.items.length,0);return t?`Showing ${r} of ${n}. ${al(t)}`:void 0}import{randomUUID as Fb}from"node:crypto";var Ar=4,ll=10*1024*1024,ul=20*1024*1024;var hs=["jpeg","png","webp","gif"],Xx={jpeg:"JPEG",png:"PNG",webp:"WebP",gif:"GIF"},cl=St(hs.map(e=>Xx[e]),"or"),XI=[...hs,"svg"];var QI=us("img");function Mm(e,t){return`ripple-${e.slice(-8)}${t==="thumbnail"?"-thumbnail":""}.webp`}var Qx=[{id:"hop",name:"Hop"},{id:"arcade",name:"Arcade"},{id:"clink",name:"Clink"},{id:"drop",name:"Drop"},{id:"echo",name:"Echo"},{id:"glow",name:"Glow"},{id:"lift",name:"Lift"},{id:"sparkle",name:"Sparkle"},{id:"swoop",name:"Swoop"},{id:"tick",name:"Tick"}],Ai=Qx.map(e=>e.id),Rm=St(Ai,"or");var gs=["quiet","standard","important"];var nb=["text","markdown"],c_=[...nb,"html"];var Nm=64e3;var Pm=4;var ys=120,Lm={title:"Hello from Ripple",body:"The first of many."};var Fm=e=>`This key sends only to ${e}.`;function rb(e){return e.replace(/\s+/g," ").trim()}var ib=/^thr_[0-9a-hjkmnp-tv-z]{16}$/;function $m(e){return typeof e=="string"&&ib.test(e)}var d_=`a non-empty string of ${ys} characters or fewer`;function dl(e){if(typeof e!="string"||ki(e))return null;let t=rb(e);return t.length>0&&t.length<=ys?t:null}import{spawn as cb,spawnSync as db}from"node:child_process";import{createHash as mb,randomBytes as Gm}from"node:crypto";import{createServer as pb}from"node:http";import{hostname as fb}from"node:os";function ml(e){let t=(e??"").replace(/[\p{Cc}\p{Cf}]/gu,"").replace(/\s+/g," ").trim();return t?t.slice(0,64):null}var pl="ripple-cli",zm="offline_access";var fl=10,Bm="computer_name",hl={approve:"/connect",code:"/connect/code",done:"/connect/done"};var qm="http://127.0.0.1/callback",ob="Unknown computer";function jm(e){return ml(ml(e)?.replace(/\.local$/i,""))??ob}var sb=["amber","autumn","bold","brave","bright","brisk","calm","clear","clever","cosmic","crisp","dapper","eager","early","fancy","gentle","giant","golden","grand","happy","hidden","honest","humble","jolly","kind","lively","lucky","lunar","mellow","merry","misty","modest","noble","olive","patient","plucky","polar","proud","quick","quiet","rapid","rosy","royal","rustic","silent","silver","simple","sleepy","smooth","snowy","solar","steady","sunny","swift","tidy","tranquil","velvet","vivid","warm","wild","windy","wise","witty","young"],Um=["acorn","anchor","apple","arrow","aspen","badger","basin","beacon","birch","bison","blossom","bridge","brook","button","cabin","canyon","candle","canoe","castle","cedar","cello","cherry","cloud","clover","comet","compass","coral","cove","crane","creek","dawn","delta","desert","dune","eagle","echo","ember","falcon","fern","field","finch","fjord","forest","fox","garden","geyser","glacier","harbor","hazel","heron","hill","island","ivy","jasmine","kayak","kettle","lagoon","lantern","lark","lemon","lily","lotus","maple","marble","meadow","meteor","mint","moon","moss","mountain","nectar","nest","oak","ocean","orbit","orchid","otter","owl","palm","panda","pebble","pine","planet","plum","pond","poppy","prairie","quartz","rabbit","raven","reef","ridge","river","robin","rocket","saddle","sage","sail","shell","shore","sparrow","spruce","star","stone","summit","sunset","swan","thistle","tiger","trail","tulip","tundra","valley","violet","walnut","whale","willow","wind","wren","yarrow","zephyr","lake","bay","glade","grove","peak","spring","tide"],ab="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";function Hm(e){let t=[...(e??"").slice(0,5)].map(o=>ab.indexOf(o));if(t.length<5||t.some(o=>o<0))return null;let[n,...r]=t,i=(o,s)=>Um[(o*64+s)%Um.length];return`${sb[n]}-${i(r[0],r[1])}-${i(r[2],r[3])}`}var lb="0123456789ABCDEFGHJKMNPQRSTVWXYZ",ub=8;function Wm(e){let t=e.toUpperCase().replace(/[\s-]/g,"").replace(/O/g,"0").replace(/[IL]/g,"1");return t.length===ub&&[...t].every(n=>lb.includes(n))?t:null}var hb=6e4;async function yl(e,t,n){try{return await fetch(new Request(e,{headers:{accept:"application/json",...n&&{"content-type":"application/x-www-form-urlencoded"}},...n&&{method:"POST",body:new URLSearchParams({client_id:pl,...n})},signal:AbortSignal.timeout(t.timeoutMs)}))}catch{throw as(t.baseUrl)}}async function Vm(e,t){let n=await yl(e,t),r=n.ok?await n.json().catch(()=>null):null;if(!r)throw new $("login_failed","This Ripple server doesn't offer signing in from the CLI.","Set RIPPLE_KEY to an API token from Settings \u2192 Developer \u2192 API tokens instead.");return r}async function gb(e){let t="/.well-known/oauth-protected-resource";if(!URL.canParse(t,e.baseUrl))throw ls();let n=await Vm(new URL(t,e.baseUrl),e),r=Array.isArray(n.authorization_servers)?n.authorization_servers[0]:void 0,i=new $("login_failed","Ripple's sign-in server described itself in a way the CLI can't use.");if(typeof r!="string"||!URL.canParse(r))throw i;let o=new URL(r),s=await Vm(new URL(`/.well-known/oauth-authorization-server${o.pathname.replace(/\/$/,"")}`,o.origin),e),a={issuer:r,authorizationEndpoint:s.authorization_endpoint,tokenEndpoint:s.token_endpoint,revocationEndpoint:s.revocation_endpoint},l=[r,a.authorizationEndpoint,a.tokenEndpoint,a.revocationEndpoint];if(s.issuer!==r||!l.every(u=>typeof u=="string"&&URL.canParse(u)&&Qa(u)))throw i;return a}async function wl(e,t,n){let r=await yl(e.tokenEndpoint,n,t),i=await r.json().catch(()=>({})),{access_token:o,refresh_token:s,expires_in:a}=i;return r.ok&&typeof o=="string"&&typeof s=="string"&&typeof a=="number"?{credential:{accessToken:o,refreshToken:s,expiresAt:Date.now()+a*1e3,tokenEndpoint:e.tokenEndpoint,revocationEndpoint:e.revocationEndpoint}}:{error:typeof i.error=="string"?i.error:`http_${r.status}`}}function xl(e,t){return yl(e.revocationEndpoint,t,{token:e.refreshToken,token_type_hint:"refresh_token"}).then(n=>n.ok,()=>!1)}var bl=e=>e.expiresAt-hb>Date.now();async function Ym(e,{refused:t}={}){let n=await e.store.load(e.baseUrl);if(!n||n.accessToken!==t&&bl(n))return n;let r=await wl(n,{grant_type:"refresh_token",refresh_token:n.refreshToken},e);if("credential"in r)return await e.store.save(e.baseUrl,r.credential),r.credential;if(r.error!=="invalid_grant")throw new $("login_failed",`Ripple couldn't renew this terminal's sign-in (${r.error}).`,"Try again in a moment.");let i=await e.store.load(e.baseUrl);if(i&&i.refreshToken!==n.refreshToken)return i;throw await e.store.delete(e.baseUrl),new $("signed_out","This terminal's sign-in has ended.","Run ripple login to sign in again.")}function Zm(){if(process.platform==="darwin"){let e=db("/usr/sbin/scutil",["--get","ComputerName"],{encoding:"utf8"});if(e.status===0&&e.stdout.trim())return e.stdout.trim()}return fb()}function Km(e){return nl(e)||process.platform==="linux"&&!e.DISPLAY&&!e.WAYLAND_DISPLAY}function Jm(e){let[t,n]=process.platform==="darwin"?["open",[e]]:process.platform==="win32"?["rundll32",["url.dll,FileProtocolHandler",e]]:["xdg-open",[e]];return new Promise(r=>{let i=cb(t,n,{stdio:"ignore",detached:!0});i.once("error",()=>r(!1)),i.once("exit",o=>r(o===0)),i.unref()})}async function yb(e,t){let n=pb(),r=new URL(qm);await new Promise((a,l)=>{n.once("error",l),n.listen(0,r.hostname,a)}),r.port=String(n.address().port);let i=r.toString(),o=()=>{n.close(),n.closeAllConnections?.()},s=new Promise(a=>{n.on("request",(l,u)=>{let d=new URL(l.url??"/",i).searchParams;if(!l.url?.startsWith(`${r.pathname}?`)||d.get("state")!==e){u.writeHead(404,{connection:"close"}).end();return}a({params:d,finish(c){u.writeHead(303,{location:`${t}?result=${c}`,"cache-control":"no-store",connection:"close"}).end()}})})});return{redirectUri:i,approval:s,close:o}}function Xm(){let e=Gm(32).toString("base64url"),t=mb("sha256").update(e).digest("base64url");return{verifier:e,challenge:t,state:Gm(16).toString("base64url"),phrase:Hm(t)}}function Qm(e,t,n,r){let i=new URL(e.authorizationEndpoint);return i.search=new URLSearchParams({response_type:"code",client_id:pl,redirect_uri:n,scope:zm,state:t.state,code_challenge:t.challenge,code_challenge_method:"S256",[Bm]:jm(r)}).toString(),i.toString()}var gl=()=>new $("login_cancelled","Not connected: the request was canceled."),ws=e=>new $("login_failed",`Not connected: ${e}.`,"Run ripple login to try again.");async function wb(e,t){let{style:n,say:r}=t,i=Xm(),o=new URL(e.issuer).origin,s=await yb(i.state,`${o}${hl.done}`);try{let a=Qm(e,i,s.redirectUri,t.computerName),l=await t.openBrowser(a);r([l?"Opening your browser to connect this terminal.":"Open this link to connect this terminal:",...l?[]:[a],`Connect only if the page shows ${n.bold(i.phrase)}`,...l?["",n.dim(`Didn't open? Go to ${a}`)]:[],""].join(`
|
|
45
|
+
`));let u=AbortSignal.timeout(fl*6e4),d=AbortSignal.any([u,...t.signal?[t.signal]:[]]),{params:c,finish:m}=await new Promise((S,w)=>{d.addEventListener("abort",()=>w(u.aborted?ws(`the request expired after ${fl} minutes`):gl()),{once:!0}),s.approval.then(S)}),p=c.get("code"),f=c.get("iss");if(!p||f!==null&&f!==e.issuer){let S=c.get("error")==="access_denied";throw m(S?"cancelled":"failed"),S?gl():ws("Ripple didn't approve the request")}let x=await wl(e,{grant_type:"authorization_code",code:p,redirect_uri:s.redirectUri,code_verifier:i.verifier},t).catch(S=>{throw m("failed"),S});if(m("credential"in x?"connected":"failed"),"credential"in x)return x.credential;throw ws(`Ripple refused the approval (${x.error})`)}finally{s.close()}}async function xb(e,t,n){let{style:r,say:i}=t,o=Xm(),s=`${new URL(e.issuer).origin}${hl.code}`;for(i(["To connect this terminal, open this link on any device:",Qm(e,o,s,t.computerName),"",`Connect only if the page shows ${r.bold(o.phrase)}, then enter the code it gives you.`,""].join(`
|
|
46
|
+
`));;){let a=await n("Code: ");if(a===null)throw gl();if(!a.trim())continue;let l=Wm(a);if(!l){i(r.warning("Codes have 8 letters and numbers, like 7QK2-M9XD."));continue}let u=await wl(e,{grant_type:"authorization_code",code:l,redirect_uri:s,code_verifier:o.verifier},t);if("credential"in u)return u.credential;if(u.error!=="invalid_grant")throw ws(`Ripple refused the code (${u.error})`);i(r.warning("That code didn't work. Check it, or open the link again for a new one."))}}async function ep(e,{browser:t}){let{ask:n}=e;if(!t&&!n)throw new $("login_failed","Connecting without a browser needs a terminal to type the code in.","Run ripple login at a terminal, or set RIPPLE_KEY to an API token instead.");let r=await gb(e),i=t?await wb(r,e):await xb(r,e,n),o=await e.store.load(e.baseUrl).catch(()=>null);return await e.store.save(e.baseUrl,i),o&&!await xl(o,e)&&e.say(e.style.warning("Could not reach Ripple to end this terminal's previous sign-in. Sign out the older one in Settings \u2192 Account \u2192 Signed in.")),{credential:i,replaced:o!==null}}import{randomUUID as Cb}from"node:crypto";import{readFile as ap,stat as Ib}from"node:fs/promises";import _b from"node:path";var bb=5*1024*1024;var N_=`Choose an image up to ${bb/(1024*1024)} MB.`;var tp=["red","orange","yellow","green","teal","blue","indigo","purple","pink"];function np(e,t){let n=t?.name.trim();return n&&Yt(n)!==Yt(e)?n:null}var P_=cs("pic");function Yt(e){return e.trim().replace(/\s+/g," ").toLowerCase()}import kb from"node:path";function Sb(e){return t=>{let n=Number(t);if(!Number.isSafeInteger(n)||n<1||n>e)throw new ze(`must be a whole number from 1 to ${e}.`);return n}}function Oi(e,t){return kb.resolve(e.env.INIT_CWD??process.cwd(),t)}function Di(e){if(!e.trim())throw new ze("needs a value.");return e}function kl(e){return/T.*(?:Z|[+-]\d{2}:\d{2})$/.test(e)&&Number.isFinite(Date.parse(e))}function Tb(e){if(!kl(e))throw new ze("must be a time like 2026-10-17T09:00:00Z, with Z or an offset such as -04:00.");return e}var ue=(e,t)=>new oe(e,t).argParser(Di),rp=(e,t)=>new oe(e,t).argParser(Tb),Sl=(e,t,n)=>new oe(e,t).argParser(Sb(n)),Ze=(e,t,n)=>new oe(e,t).choices(n),xs=100,vi=25;function jn(e,t){let n=Sl("--limit <count>",`How many ${e} a page holds, up to ${xs}${t?` (default ${t})`:""}`,xs);return t===void 0?n:n.default(t)}var Hn=()=>ue("--cursor <cursor>","Continue from where the last page ended"),Mi=e=>Ze("-a, --alert <level>",e,gs),Wn=()=>new oe("--all",`Show every page; without --limit, each holds ${xs}`).conflicts("cursor").implies({limit:xs}),Tl=()=>[new oe("--unread","Only unread messages").conflicts("read"),new oe("--read","Only read messages")];function El({unread:e,read:t}){return e?!0:t?!1:void 0}async function Zt(e,t,{many:n=!1,named:r=i=>Cl(e,i)}={}){if(t===void 0)return;let i=(n?t.split(","):[t]).map(a=>a.trim());if(i.some(a=>!a))throw new U("--source needs sources separated by commas, with none left empty.");let o=i.filter(a=>!ip(a)),s=o.length?await r(o):[];return[...new Set(i.flatMap(a=>{let l=ip(a)?a:s[o.indexOf(a)];return l===void 0?[]:[l]}))]}var Eb=us("src"),ip=e=>Eb.test(e);async function Cl(e,t){let{items:n}=await e.call(H("GET","/v1/sources"));return t.map(r=>{let i=n.find(o=>Yt(o.name)===Yt(r));if(!i)throw new $("not_found",`You have no source named ${r}.`,'Run "ripple sources" to see your sources.');return i.sourceId})}function pn({limit:e,cursor:t,all:n},r){return i=>{let o=i.at(-1);if(!o)return r({limit:e,cursor:t});let s=n&&"nextCursor"in o?o.nextCursor:void 0;return typeof s=="string"&&s?r({limit:e,cursor:s}):void 0}}function bs(){return[ue("-s, --source <sources>","Only messages from these sources, by name or ID, separated by commas"),...Tl(),rp("--after <time>","Only messages received after this time"),rp("--before <time>","Only messages received before this time"),Mi("Only messages with this alert level"),Ze("--sort <order>","Best matches first, or newest first",["relevance","newest"]),jn("results",vi),Hn(),Wn()]}async function ks(e,t,n){return{query:t.length?t.join(" "):void 0,unread:El(n),sourceIds:await Zt(e,n.source,{many:!0}),after:n.after,before:n.before,alert:n.alert,sort:n.sort}}var qn=100;async function op(e,t){if(!e.includes("-")){if(e.length>qn)throw new U(`Give at most ${qn} message IDs as arguments; got ${e.length}. For more, use - and pipe them in.`);return e}if(e.length>1)throw new U("Use - on its own to pipe message IDs in.");let n=await Ss(t,{asked:!0});if(n===void 0)throw new U("Pipe the message IDs in when using -.");let r=[...new Set(n.split(/\s+/).filter(Boolean))];if(!r.length)throw new U("No message IDs were piped in.");return r}async function Ss(e,{asked:t}){if(!e||!(t||e.piped))return;let n=[];for await(let r of e.stream)n.push(Buffer.from(r));return Buffer.concat(n).toString("utf8")}function lp(e,t){let n=[];e.command("send").description("Send a message. A send key sends to its own source; an API token sends to Inbox or the source you choose. With no message text, ripple send uses what you pipe in, shown exactly as printed unless you add --markdown or --html. When Ripple can't take it, ripple send keeps trying for 5 minutes, and never sends it twice.").summary("Send a message").argument("[message...]").addOption(ue("-t, --title <text>","A title shown above the message (by default its first line, or a field that names its JSON)")).addOption(ue("-s, --source <source>","Send to this source, by name or ID, instead of Inbox; a send key sends only to its own")).addOption(ue("--thread <key>","Add to the source's thread with this key, such as a deploy or ticket ID, starting it if there's none")).addOption(ue("--thread-title <text>","The name a thread --thread starts is shown by, instead of its key")).addOption(ue("--thread-id <id>","Add to the thread with this ID, as an earlier send returned it")).addOption(Mi("How strongly to alert")).addOption(Ze("--sound <name>","Which sound it plays, instead of the source's or your account's",Ai)).addOption(new oe("--link <url>",`A link to open from the message: https, email, phone, or another app's; repeat for up to ${Pm}, the first leading`).argParser(r=>(n.push(Di(r)),n))).addOption(new oe("--link-title <text>","A label for the --link before it, instead of its domain").argParser(r=>{let i=n.at(-1);if(typeof i!="string")throw new ze("must follow the --link it names.");return n[n.length-1]={url:i,title:Di(r)},n})).addOption(new oe("--image <file|url>",`An image to show: a ${cl} file, or an https:// link to one; repeat for up to ${Ar}`).argParser((r,i=[])=>{if(i.length===Ar)throw new ze(`can repeat up to ${Ar} times, as a message holds ${Ar} images.`);return[...i,Di(r)]})).addOption(ue("--body <text>","Same as the message argument")).option("--markdown","Format the message as Markdown, such as headings, lists, links, and code").option("--html","Turn the message from HTML, such as an email, into formatted text; its <title> becomes the title").addOption(ue("--json-file <path>","Send a full request from a JSON file, or - to pipe it in")).addOption(ue("--idempotency-key <key>","Send only once, however often it runs with this key within 24 hours")).example('ripple send "Deploy finished"','make test 2>&1 | tail -20 | ripple send --title "Test results"','ripple send --markdown --title "Release notes" < notes.md',"ripple send --html < digest.html",'ripple send --source Deploys --thread deploy-42 --thread-title "Deploy #42" --title "Tests passed" "All 312 green"','ripple send --source Deploys --thread-id thr_06gm53wzxakqgkm4 "Shipped"','ripple send --title "Disk almost full" --alert important "Only 2 GB left on /data"','ripple send --title "Deploy failed" --sound tick "Build 42 failed"','ripple send --link https://ci.example.com/runs/42 --link-title "Open run" --link https://example.com/logs "Deploy failed"','ripple send --image chart.png --title "Build 42 failed" "Coverage dropped to 71%"','ripple send --image https://camera.example.com/snapshots/front.jpg --image porch.jpg "Motion at the front door"').action(async(r,i)=>{let o=H("POST","/v1/send",{body:await Ab(r,n,i,t),headers:{"Idempotency-Key":i.idempotencyKey??Cb()}});await t.run(o,s=>_l(s,t.display))})}async function Ab(e,t,n,r){let{title:i,alert:o,sound:s,jsonFile:a,markdown:l,html:u,image:d=[]}=n;if(n.body!==void 0&&e.length)throw new U("Give the message text once, either as an argument or with --body.");let c=n.body??(e.length?e.join(" "):void 0);if(l&&u)throw new U("Choose either --markdown or --html, not both.");let m=Nb(n);if(a!==void 0){if(t.length||d.length||[i,c,n.source,m,o,s,l,u].some(w=>w!==void 0))throw new U("--json-file holds the whole message, so use it without other message options or text.");return Lb(await Pb(a,r),a)}let p=c??((await Ss(r.input,{asked:!1}))?.trimEnd()||void 0);if(i===void 0&&p===void 0&&!d.length)throw new U('Add a message, for example: ripple send "Deploy finished"');let f=await vb(d,r),[x]=await Zt(r,n.source,{named:async w=>await r.keyKind()==="send"?Rb(r,w):Cl(r,w)})??[],S={title:i,body:p,format:l?"markdown":u?"html":void 0,links:t.length?t:void 0,alert:o,sound:s,source:x,thread:m};return f.every(w=>typeof w=="string")?{...S,images:f.length?f:void 0}:Mb(S,f)}var Ob=e=>/^[a-z][a-z\d+.-]*:\/\//i.test(e),Db={jpeg:/^\xff\xd8\xff/,png:/^\x89PNG\r\n\x1a\n/,webp:/^RIFF[^]{4}WEBP/,gif:/^GIF8/},sp=e=>`${e/(1024*1024)} MB`;async function vb(e,t){let n=[],r=0;for(let i of e){if(Ob(i)){n.push(i);continue}let o=Oi(t,i),s=(await Ib(o).catch(()=>null))?.size;if(s===void 0)throw new U(`Could not find ${i}.`);if(s>ll)throw new U(`${i} is over ${sp(ll)}. Send a smaller image.`);if(r+=s,r>ul)throw new U(`The images are over ${sp(ul)} in all. Send fewer or smaller ones.`);let a=await ap(o).catch(d=>{throw new U(`Could not read ${i}: ${Gt(d)}`)}),l=a.toString("latin1",0,12),u=hs.find(d=>Db[d].test(l));if(!u)throw new U(`${i} isn't a ${cl}. Convert it to one first.`);n.push(new File([a],_b.basename(o),{type:`image/${u}`}))}return n}function Mb({links:e,thread:t,...n},r){let i=new FormData;for(let[o,s]of Object.entries(n))typeof s=="string"&&i.append(o,s);for(let o of e??[])i.append("link",typeof o=="string"?o:o.url),typeof o!="string"&&i.append("linkTitle",o.title);typeof t=="string"?i.append("thread",t):t&&"id"in t?i.append("threadId",t.id):t&&(i.append("thread",t.key),t.title&&i.append("threadTitle",t.title));for(let o of r)i.append("image",o);return i}var Il="Leave out --source: a send key always sends to its own source.";async function Rb(e,t){let{source:n}=await e.call(H("GET","/v1/access"));return t.map(r=>{if(Yt(r)!==Yt(n.name))throw new $("invalid_source",Fm(n.name),Il);return n.sourceId})}function Nb({thread:e,threadTitle:t,threadId:n}){let r=`a non-empty text of ${ys} characters or fewer`;if(n!==void 0){if(e!==void 0||t!==void 0)throw new U("--thread-id names its thread, so leave out --thread and --thread-title.");if(!$m(n.trim()))throw new U("--thread-id must be a thread ID Ripple returned, such as thr_06gm53wzxakqgkm4.");return{id:n.trim()}}if(e===void 0){if(t!==void 0)throw new U("--thread-title names the thread --thread starts, so add --thread.");return}let i=dl(e);if(!i)throw new U(`--thread must be ${r}.`);if(t===void 0)return i;let o=dl(t);if(!o)throw new U(`--thread-title must be ${r}.`);return{key:i,title:o}}async function Pb(e,t){if(e==="-"){let n=await Ss(t.input,{asked:!0});if(n===void 0)throw new U("Pipe the JSON in when using --json-file -.");return n}try{return await ap(Oi(t,e),"utf8")}catch(n){throw new U(`Could not read ${e}: ${Gt(n)}`)}}function Lb(e,t){let n;try{n=JSON.parse(e)}catch(r){throw new U(`Could not parse JSON from ${t}: ${Gt(r)}`)}if(!n||typeof n!="object"||Array.isArray(n))throw new U("The JSON must be an object shaped like the /v1/send request body.");return n}function _l(e,t){let{style:n}=t,r=e.thread?` in "${e.thread.title}" (message ${e.thread.messageNumber})`:"",i=(e.warnings??[]).map(o=>`${n.warning("Warning:")} ${o.message}
|
|
47
47
|
`).join("");return`Sent to ${e.source.name}${r} ${n.dim(e.messageId)}
|
|
48
|
-
${i}`}async function
|
|
49
|
-
`;async function
|
|
50
|
-
`);return}let i=await
|
|
51
|
-
`),t.env.RIPPLE_KEY?.trim()&&t.hint("RIPPLE_KEY is still set, so commands keep using it.")})}import{spawn as
|
|
52
|
-
`)}var
|
|
48
|
+
${i}`}async function up(e,t){let n=await e(`${t} [Y/n] `);return n!==null&&!/^\s*no?\s*$/i.test(n)}async function cp(e,{browser:t=!0}={}){let n=e.loginContext();return{...await ep(n,{browser:t&&!Km(e.env)}),savedIn:n.store.description}}var dp=e=>`Connected. Your sign-in is saved in ${e}.
|
|
49
|
+
`;async function mp(e){let{ask:t}=e;if(!t||!await up(t,"This terminal isn't connected to Ripple. Sign in now?"))return null;let{credential:n,savedIn:r}=await cp(e);return e.loginContext().say(dp(r)),n}function pp(e,t){e.command("login").description("Connect this terminal to your Ripple account. Your browser opens to approve it, with one click when you're signed in. Over SSH, or with --no-browser, ripple login gives you a link to open on any device, which shows a code to type here. The sign-in is kept in the macOS Keychain, or elsewhere in ~/.config/ripple/credentials.json, which only you can read. RIPPLE_KEY, when set, takes its place.").summary("Connect this terminal to your account").option("--no-browser","Open the link on another device and type the code it shows").example("ripple login","ripple login --no-browser").action(async({browser:n})=>{let{replaced:r,savedIn:i}=await cp(t,{browser:n});if(t.print({status:"connected",savedIn:i},()=>dp(i)),t.env.RIPPLE_KEY?.trim())t.hint("RIPPLE_KEY is set, so commands keep using it until you unset it.");else if(!r&&t.ask&&await up(t.ask,"Send a first message now?")){let o=await t.call(H("POST","/v1/send",{body:Lm,headers:{"Idempotency-Key":Fb()}}));t.print(o,s=>_l(s,t.display))}}),e.command("logout").description("Sign this terminal out of Ripple. Its sign-in ends on Ripple and is removed from this computer. RIPPLE_KEY, when set, keeps working.").summary("Sign this terminal out").example("ripple logout").action(async()=>{let n=t.loginContext(),r=await n.store.load(n.baseUrl);if(!r){t.print({status:"signed_out"},()=>`This terminal isn't signed in.
|
|
50
|
+
`);return}let i=await xl(r,n);if(await n.store.delete(n.baseUrl),!i)throw new $("network_error","Signed out on this computer, but couldn't reach Ripple to end the sign-in there.","Sign this terminal out in Settings \u2192 Account \u2192 Signed in.");t.print({status:"signed_out"},()=>`Signed out. This terminal's sign-in has ended.
|
|
51
|
+
`),t.env.RIPPLE_KEY?.trim()&&t.hint("RIPPLE_KEY is still set, so commands keep using it.")})}import{spawn as Ub}from"node:child_process";import{mkdirSync as zb,realpathSync as Bb,statSync as qb,utimesSync as jb,writeFileSync as Hb}from"node:fs";import{homedir as Wb}from"node:os";import Ol from"node:path";var Or={name:"@ripple/cli",version:"0.4.0",description:"Send notifications to your devices and manage your messages",private:!0,type:"module",bin:{ripple:"./dist/index.js"},scripts:{build:"pnpm run lint && pnpm run build:bin","build:bin":"node scripts/build.mjs",lint:"tsc --noEmit -p tsconfig.json",test:"vitest run tests",release:"node scripts/release.mjs"},devDependencies:{"@types/node":"25.5.0",esbuild:"0.25.12",typescript:"^5.8.2",vitest:"^3.2.6"},dependencies:{"@ripple/contract":"workspace:*","@ripple/domain":"workspace:*",commander:"15.0.0","get-east-asian-width":"1.5.0"}};var fp="https://ripple.do/install",hp={script:"ripple update",homebrew:"brew upgrade ripple",npm:"npm install -g ripplepush@latest"};function Al(e){try{return Bb(e).replaceAll("\\","/")}catch{return e}}function gp(){if(process.versions.bun)return Al(process.execPath).includes("/Cellar/")?"homebrew":"script";let e=Al(process.argv[1]??"");return e.includes("/_npx/")?"npx":e.includes("/node_modules/")?"npm":"source"}function Gb(e){let[t,n]=[e,Or.version].map(i=>i.split(".").map(Number)),r=t.findIndex((i,o)=>i!==n[o]);return r!==-1&&t[r]>n[r]}function yp(e,t){let n=hp[t];if(!(!e||!n||!/^\d+\.\d+\.\d+$/.test(e)||!Gb(e)))return[`Ripple ${e} is out (you have ${Or.version}). Update with: ${n}`,`What's new: https://github.com/ripplepush/cli/releases/tag/v${e}`].join(`
|
|
52
|
+
`)}var Vb=1440*60*1e3,wp=()=>Ol.join(Wb(),".cache","ripple","update-notice");function xp(e,t){try{if(t.getTime()-qb(e).mtimeMs<Vb)return!1}catch{}try{zb(Ol.dirname(e),{recursive:!0}),Hb(e,""),jb(e,t,t)}catch{}return!0}function bp(e,t){e.command("update").description("Update Ripple to the newest release. A copy from Homebrew or npm shows the command that updates it.").summary("Update Ripple to the newest release").example("ripple update").action(async()=>{let n=t.installMethod;if(n!=="script"){let a=hp[n];t.print({installedWith:n,...a?{command:a}:{}},()=>n==="npx"?`npx runs the newest Ripple each time, so there's nothing to update.
|
|
53
53
|
`:n==="source"?`This copy runs from Ripple's source code. Pull and rebuild it to update.
|
|
54
54
|
`:`This copy came from ${n==="homebrew"?"Homebrew":"npm"}. Update it with: ${a}
|
|
55
|
-
`);return}let r;try{let a=await fetch(new Request(
|
|
56
|
-
`,Nfr:"\u{1D511}",NoBreak:"\u2060",NonBreakingSpace:"\xA0",Nopf:"\u2115",Not:"\u2AEC",NotCongruent:"\u2262",NotCupCap:"\u226D",NotDoubleVerticalBar:"\u2226",NotElement:"\u2209",NotEqual:"\u2260",NotEqualTilde:"\u2242\u0338",NotExists:"\u2204",NotGreater:"\u226F",NotGreaterEqual:"\u2271",NotGreaterFullEqual:"\u2267\u0338",NotGreaterGreater:"\u226B\u0338",NotGreaterLess:"\u2279",NotGreaterSlantEqual:"\u2A7E\u0338",NotGreaterTilde:"\u2275",NotHumpDownHump:"\u224E\u0338",NotHumpEqual:"\u224F\u0338",NotLeftTriangle:"\u22EA",NotLeftTriangleBar:"\u29CF\u0338",NotLeftTriangleEqual:"\u22EC",NotLess:"\u226E",NotLessEqual:"\u2270",NotLessGreater:"\u2278",NotLessLess:"\u226A\u0338",NotLessSlantEqual:"\u2A7D\u0338",NotLessTilde:"\u2274",NotNestedGreaterGreater:"\u2AA2\u0338",NotNestedLessLess:"\u2AA1\u0338",NotPrecedes:"\u2280",NotPrecedesEqual:"\u2AAF\u0338",NotPrecedesSlantEqual:"\u22E0",NotReverseElement:"\u220C",NotRightTriangle:"\u22EB",NotRightTriangleBar:"\u29D0\u0338",NotRightTriangleEqual:"\u22ED",NotSquareSubset:"\u228F\u0338",NotSquareSubsetEqual:"\u22E2",NotSquareSuperset:"\u2290\u0338",NotSquareSupersetEqual:"\u22E3",NotSubset:"\u2282\u20D2",NotSubsetEqual:"\u2288",NotSucceeds:"\u2281",NotSucceedsEqual:"\u2AB0\u0338",NotSucceedsSlantEqual:"\u22E1",NotSucceedsTilde:"\u227F\u0338",NotSuperset:"\u2283\u20D2",NotSupersetEqual:"\u2289",NotTilde:"\u2241",NotTildeEqual:"\u2244",NotTildeFullEqual:"\u2247",NotTildeTilde:"\u2249",NotVerticalBar:"\u2224",Nscr:"\u{1D4A9}",Ntilde:"\xD1",Nu:"\u039D",OElig:"\u0152",Oacute:"\xD3",Ocirc:"\xD4",Ocy:"\u041E",Odblac:"\u0150",Ofr:"\u{1D512}",Ograve:"\xD2",Omacr:"\u014C",Omega:"\u03A9",Omicron:"\u039F",Oopf:"\u{1D546}",OpenCurlyDoubleQuote:"\u201C",OpenCurlyQuote:"\u2018",Or:"\u2A54",Oscr:"\u{1D4AA}",Oslash:"\xD8",Otilde:"\xD5",Otimes:"\u2A37",Ouml:"\xD6",OverBar:"\u203E",OverBrace:"\u23DE",OverBracket:"\u23B4",OverParenthesis:"\u23DC",PartialD:"\u2202",Pcy:"\u041F",Pfr:"\u{1D513}",Phi:"\u03A6",Pi:"\u03A0",PlusMinus:"\xB1",Poincareplane:"\u210C",Popf:"\u2119",Pr:"\u2ABB",Precedes:"\u227A",PrecedesEqual:"\u2AAF",PrecedesSlantEqual:"\u227C",PrecedesTilde:"\u227E",Prime:"\u2033",Product:"\u220F",Proportion:"\u2237",Proportional:"\u221D",Pscr:"\u{1D4AB}",Psi:"\u03A8",QUOT:'"',Qfr:"\u{1D514}",Qopf:"\u211A",Qscr:"\u{1D4AC}",RBarr:"\u2910",REG:"\xAE",Racute:"\u0154",Rang:"\u27EB",Rarr:"\u21A0",Rarrtl:"\u2916",Rcaron:"\u0158",Rcedil:"\u0156",Rcy:"\u0420",Re:"\u211C",ReverseElement:"\u220B",ReverseEquilibrium:"\u21CB",ReverseUpEquilibrium:"\u296F",Rfr:"\u211C",Rho:"\u03A1",RightAngleBracket:"\u27E9",RightArrow:"\u2192",RightArrowBar:"\u21E5",RightArrowLeftArrow:"\u21C4",RightCeiling:"\u2309",RightDoubleBracket:"\u27E7",RightDownTeeVector:"\u295D",RightDownVector:"\u21C2",RightDownVectorBar:"\u2955",RightFloor:"\u230B",RightTee:"\u22A2",RightTeeArrow:"\u21A6",RightTeeVector:"\u295B",RightTriangle:"\u22B3",RightTriangleBar:"\u29D0",RightTriangleEqual:"\u22B5",RightUpDownVector:"\u294F",RightUpTeeVector:"\u295C",RightUpVector:"\u21BE",RightUpVectorBar:"\u2954",RightVector:"\u21C0",RightVectorBar:"\u2953",Rightarrow:"\u21D2",Ropf:"\u211D",RoundImplies:"\u2970",Rrightarrow:"\u21DB",Rscr:"\u211B",Rsh:"\u21B1",RuleDelayed:"\u29F4",SHCHcy:"\u0429",SHcy:"\u0428",SOFTcy:"\u042C",Sacute:"\u015A",Sc:"\u2ABC",Scaron:"\u0160",Scedil:"\u015E",Scirc:"\u015C",Scy:"\u0421",Sfr:"\u{1D516}",ShortDownArrow:"\u2193",ShortLeftArrow:"\u2190",ShortRightArrow:"\u2192",ShortUpArrow:"\u2191",Sigma:"\u03A3",SmallCircle:"\u2218",Sopf:"\u{1D54A}",Sqrt:"\u221A",Square:"\u25A1",SquareIntersection:"\u2293",SquareSubset:"\u228F",SquareSubsetEqual:"\u2291",SquareSuperset:"\u2290",SquareSupersetEqual:"\u2292",SquareUnion:"\u2294",Sscr:"\u{1D4AE}",Star:"\u22C6",Sub:"\u22D0",Subset:"\u22D0",SubsetEqual:"\u2286",Succeeds:"\u227B",SucceedsEqual:"\u2AB0",SucceedsSlantEqual:"\u227D",SucceedsTilde:"\u227F",SuchThat:"\u220B",Sum:"\u2211",Sup:"\u22D1",Superset:"\u2283",SupersetEqual:"\u2287",Supset:"\u22D1",THORN:"\xDE",TRADE:"\u2122",TSHcy:"\u040B",TScy:"\u0426",Tab:" ",Tau:"\u03A4",Tcaron:"\u0164",Tcedil:"\u0162",Tcy:"\u0422",Tfr:"\u{1D517}",Therefore:"\u2234",Theta:"\u0398",ThickSpace:"\u205F\u200A",ThinSpace:"\u2009",Tilde:"\u223C",TildeEqual:"\u2243",TildeFullEqual:"\u2245",TildeTilde:"\u2248",Topf:"\u{1D54B}",TripleDot:"\u20DB",Tscr:"\u{1D4AF}",Tstrok:"\u0166",Uacute:"\xDA",Uarr:"\u219F",Uarrocir:"\u2949",Ubrcy:"\u040E",Ubreve:"\u016C",Ucirc:"\xDB",Ucy:"\u0423",Udblac:"\u0170",Ufr:"\u{1D518}",Ugrave:"\xD9",Umacr:"\u016A",UnderBar:"_",UnderBrace:"\u23DF",UnderBracket:"\u23B5",UnderParenthesis:"\u23DD",Union:"\u22C3",UnionPlus:"\u228E",Uogon:"\u0172",Uopf:"\u{1D54C}",UpArrow:"\u2191",UpArrowBar:"\u2912",UpArrowDownArrow:"\u21C5",UpDownArrow:"\u2195",UpEquilibrium:"\u296E",UpTee:"\u22A5",UpTeeArrow:"\u21A5",Uparrow:"\u21D1",Updownarrow:"\u21D5",UpperLeftArrow:"\u2196",UpperRightArrow:"\u2197",Upsi:"\u03D2",Upsilon:"\u03A5",Uring:"\u016E",Uscr:"\u{1D4B0}",Utilde:"\u0168",Uuml:"\xDC",VDash:"\u22AB",Vbar:"\u2AEB",Vcy:"\u0412",Vdash:"\u22A9",Vdashl:"\u2AE6",Vee:"\u22C1",Verbar:"\u2016",Vert:"\u2016",VerticalBar:"\u2223",VerticalLine:"|",VerticalSeparator:"\u2758",VerticalTilde:"\u2240",VeryThinSpace:"\u200A",Vfr:"\u{1D519}",Vopf:"\u{1D54D}",Vscr:"\u{1D4B1}",Vvdash:"\u22AA",Wcirc:"\u0174",Wedge:"\u22C0",Wfr:"\u{1D51A}",Wopf:"\u{1D54E}",Wscr:"\u{1D4B2}",Xfr:"\u{1D51B}",Xi:"\u039E",Xopf:"\u{1D54F}",Xscr:"\u{1D4B3}",YAcy:"\u042F",YIcy:"\u0407",YUcy:"\u042E",Yacute:"\xDD",Ycirc:"\u0176",Ycy:"\u042B",Yfr:"\u{1D51C}",Yopf:"\u{1D550}",Yscr:"\u{1D4B4}",Yuml:"\u0178",ZHcy:"\u0416",Zacute:"\u0179",Zcaron:"\u017D",Zcy:"\u0417",Zdot:"\u017B",ZeroWidthSpace:"\u200B",Zeta:"\u0396",Zfr:"\u2128",Zopf:"\u2124",Zscr:"\u{1D4B5}",aacute:"\xE1",abreve:"\u0103",ac:"\u223E",acE:"\u223E\u0333",acd:"\u223F",acirc:"\xE2",acute:"\xB4",acy:"\u0430",aelig:"\xE6",af:"\u2061",afr:"\u{1D51E}",agrave:"\xE0",alefsym:"\u2135",aleph:"\u2135",alpha:"\u03B1",amacr:"\u0101",amalg:"\u2A3F",amp:"&",and:"\u2227",andand:"\u2A55",andd:"\u2A5C",andslope:"\u2A58",andv:"\u2A5A",ang:"\u2220",ange:"\u29A4",angle:"\u2220",angmsd:"\u2221",angmsdaa:"\u29A8",angmsdab:"\u29A9",angmsdac:"\u29AA",angmsdad:"\u29AB",angmsdae:"\u29AC",angmsdaf:"\u29AD",angmsdag:"\u29AE",angmsdah:"\u29AF",angrt:"\u221F",angrtvb:"\u22BE",angrtvbd:"\u299D",angsph:"\u2222",angst:"\xC5",angzarr:"\u237C",aogon:"\u0105",aopf:"\u{1D552}",ap:"\u2248",apE:"\u2A70",apacir:"\u2A6F",ape:"\u224A",apid:"\u224B",apos:"'",approx:"\u2248",approxeq:"\u224A",aring:"\xE5",ascr:"\u{1D4B6}",ast:"*",asymp:"\u2248",asympeq:"\u224D",atilde:"\xE3",auml:"\xE4",awconint:"\u2233",awint:"\u2A11",bNot:"\u2AED",backcong:"\u224C",backepsilon:"\u03F6",backprime:"\u2035",backsim:"\u223D",backsimeq:"\u22CD",barvee:"\u22BD",barwed:"\u2305",barwedge:"\u2305",bbrk:"\u23B5",bbrktbrk:"\u23B6",bcong:"\u224C",bcy:"\u0431",bdquo:"\u201E",becaus:"\u2235",because:"\u2235",bemptyv:"\u29B0",bepsi:"\u03F6",bernou:"\u212C",beta:"\u03B2",beth:"\u2136",between:"\u226C",bfr:"\u{1D51F}",bigcap:"\u22C2",bigcirc:"\u25EF",bigcup:"\u22C3",bigodot:"\u2A00",bigoplus:"\u2A01",bigotimes:"\u2A02",bigsqcup:"\u2A06",bigstar:"\u2605",bigtriangledown:"\u25BD",bigtriangleup:"\u25B3",biguplus:"\u2A04",bigvee:"\u22C1",bigwedge:"\u22C0",bkarow:"\u290D",blacklozenge:"\u29EB",blacksquare:"\u25AA",blacktriangle:"\u25B4",blacktriangledown:"\u25BE",blacktriangleleft:"\u25C2",blacktriangleright:"\u25B8",blank:"\u2423",blk12:"\u2592",blk14:"\u2591",blk34:"\u2593",block:"\u2588",bne:"=\u20E5",bnequiv:"\u2261\u20E5",bnot:"\u2310",bopf:"\u{1D553}",bot:"\u22A5",bottom:"\u22A5",bowtie:"\u22C8",boxDL:"\u2557",boxDR:"\u2554",boxDl:"\u2556",boxDr:"\u2553",boxH:"\u2550",boxHD:"\u2566",boxHU:"\u2569",boxHd:"\u2564",boxHu:"\u2567",boxUL:"\u255D",boxUR:"\u255A",boxUl:"\u255C",boxUr:"\u2559",boxV:"\u2551",boxVH:"\u256C",boxVL:"\u2563",boxVR:"\u2560",boxVh:"\u256B",boxVl:"\u2562",boxVr:"\u255F",boxbox:"\u29C9",boxdL:"\u2555",boxdR:"\u2552",boxdl:"\u2510",boxdr:"\u250C",boxh:"\u2500",boxhD:"\u2565",boxhU:"\u2568",boxhd:"\u252C",boxhu:"\u2534",boxminus:"\u229F",boxplus:"\u229E",boxtimes:"\u22A0",boxuL:"\u255B",boxuR:"\u2558",boxul:"\u2518",boxur:"\u2514",boxv:"\u2502",boxvH:"\u256A",boxvL:"\u2561",boxvR:"\u255E",boxvh:"\u253C",boxvl:"\u2524",boxvr:"\u251C",bprime:"\u2035",breve:"\u02D8",brvbar:"\xA6",bscr:"\u{1D4B7}",bsemi:"\u204F",bsim:"\u223D",bsime:"\u22CD",bsol:"\\",bsolb:"\u29C5",bsolhsub:"\u27C8",bull:"\u2022",bullet:"\u2022",bump:"\u224E",bumpE:"\u2AAE",bumpe:"\u224F",bumpeq:"\u224F",cacute:"\u0107",cap:"\u2229",capand:"\u2A44",capbrcup:"\u2A49",capcap:"\u2A4B",capcup:"\u2A47",capdot:"\u2A40",caps:"\u2229\uFE00",caret:"\u2041",caron:"\u02C7",ccaps:"\u2A4D",ccaron:"\u010D",ccedil:"\xE7",ccirc:"\u0109",ccups:"\u2A4C",ccupssm:"\u2A50",cdot:"\u010B",cedil:"\xB8",cemptyv:"\u29B2",cent:"\xA2",centerdot:"\xB7",cfr:"\u{1D520}",chcy:"\u0447",check:"\u2713",checkmark:"\u2713",chi:"\u03C7",cir:"\u25CB",cirE:"\u29C3",circ:"\u02C6",circeq:"\u2257",circlearrowleft:"\u21BA",circlearrowright:"\u21BB",circledR:"\xAE",circledS:"\u24C8",circledast:"\u229B",circledcirc:"\u229A",circleddash:"\u229D",cire:"\u2257",cirfnint:"\u2A10",cirmid:"\u2AEF",cirscir:"\u29C2",clubs:"\u2663",clubsuit:"\u2663",colon:":",colone:"\u2254",coloneq:"\u2254",comma:",",commat:"@",comp:"\u2201",compfn:"\u2218",complement:"\u2201",complexes:"\u2102",cong:"\u2245",congdot:"\u2A6D",conint:"\u222E",copf:"\u{1D554}",coprod:"\u2210",copy:"\xA9",copysr:"\u2117",crarr:"\u21B5",cross:"\u2717",cscr:"\u{1D4B8}",csub:"\u2ACF",csube:"\u2AD1",csup:"\u2AD0",csupe:"\u2AD2",ctdot:"\u22EF",cudarrl:"\u2938",cudarrr:"\u2935",cuepr:"\u22DE",cuesc:"\u22DF",cularr:"\u21B6",cularrp:"\u293D",cup:"\u222A",cupbrcap:"\u2A48",cupcap:"\u2A46",cupcup:"\u2A4A",cupdot:"\u228D",cupor:"\u2A45",cups:"\u222A\uFE00",curarr:"\u21B7",curarrm:"\u293C",curlyeqprec:"\u22DE",curlyeqsucc:"\u22DF",curlyvee:"\u22CE",curlywedge:"\u22CF",curren:"\xA4",curvearrowleft:"\u21B6",curvearrowright:"\u21B7",cuvee:"\u22CE",cuwed:"\u22CF",cwconint:"\u2232",cwint:"\u2231",cylcty:"\u232D",dArr:"\u21D3",dHar:"\u2965",dagger:"\u2020",daleth:"\u2138",darr:"\u2193",dash:"\u2010",dashv:"\u22A3",dbkarow:"\u290F",dblac:"\u02DD",dcaron:"\u010F",dcy:"\u0434",dd:"\u2146",ddagger:"\u2021",ddarr:"\u21CA",ddotseq:"\u2A77",deg:"\xB0",delta:"\u03B4",demptyv:"\u29B1",dfisht:"\u297F",dfr:"\u{1D521}",dharl:"\u21C3",dharr:"\u21C2",diam:"\u22C4",diamond:"\u22C4",diamondsuit:"\u2666",diams:"\u2666",die:"\xA8",digamma:"\u03DD",disin:"\u22F2",div:"\xF7",divide:"\xF7",divideontimes:"\u22C7",divonx:"\u22C7",djcy:"\u0452",dlcorn:"\u231E",dlcrop:"\u230D",dollar:"$",dopf:"\u{1D555}",dot:"\u02D9",doteq:"\u2250",doteqdot:"\u2251",dotminus:"\u2238",dotplus:"\u2214",dotsquare:"\u22A1",doublebarwedge:"\u2306",downarrow:"\u2193",downdownarrows:"\u21CA",downharpoonleft:"\u21C3",downharpoonright:"\u21C2",drbkarow:"\u2910",drcorn:"\u231F",drcrop:"\u230C",dscr:"\u{1D4B9}",dscy:"\u0455",dsol:"\u29F6",dstrok:"\u0111",dtdot:"\u22F1",dtri:"\u25BF",dtrif:"\u25BE",duarr:"\u21F5",duhar:"\u296F",dwangle:"\u29A6",dzcy:"\u045F",dzigrarr:"\u27FF",eDDot:"\u2A77",eDot:"\u2251",eacute:"\xE9",easter:"\u2A6E",ecaron:"\u011B",ecir:"\u2256",ecirc:"\xEA",ecolon:"\u2255",ecy:"\u044D",edot:"\u0117",ee:"\u2147",efDot:"\u2252",efr:"\u{1D522}",eg:"\u2A9A",egrave:"\xE8",egs:"\u2A96",egsdot:"\u2A98",el:"\u2A99",elinters:"\u23E7",ell:"\u2113",els:"\u2A95",elsdot:"\u2A97",emacr:"\u0113",empty:"\u2205",emptyset:"\u2205",emptyv:"\u2205",emsp13:"\u2004",emsp14:"\u2005",emsp:"\u2003",eng:"\u014B",ensp:"\u2002",eogon:"\u0119",eopf:"\u{1D556}",epar:"\u22D5",eparsl:"\u29E3",eplus:"\u2A71",epsi:"\u03B5",epsilon:"\u03B5",epsiv:"\u03F5",eqcirc:"\u2256",eqcolon:"\u2255",eqsim:"\u2242",eqslantgtr:"\u2A96",eqslantless:"\u2A95",equals:"=",equest:"\u225F",equiv:"\u2261",equivDD:"\u2A78",eqvparsl:"\u29E5",erDot:"\u2253",erarr:"\u2971",escr:"\u212F",esdot:"\u2250",esim:"\u2242",eta:"\u03B7",eth:"\xF0",euml:"\xEB",euro:"\u20AC",excl:"!",exist:"\u2203",expectation:"\u2130",exponentiale:"\u2147",fallingdotseq:"\u2252",fcy:"\u0444",female:"\u2640",ffilig:"\uFB03",fflig:"\uFB00",ffllig:"\uFB04",ffr:"\u{1D523}",filig:"\uFB01",fjlig:"fj",flat:"\u266D",fllig:"\uFB02",fltns:"\u25B1",fnof:"\u0192",fopf:"\u{1D557}",forall:"\u2200",fork:"\u22D4",forkv:"\u2AD9",fpartint:"\u2A0D",frac12:"\xBD",frac13:"\u2153",frac14:"\xBC",frac15:"\u2155",frac16:"\u2159",frac18:"\u215B",frac23:"\u2154",frac25:"\u2156",frac34:"\xBE",frac35:"\u2157",frac38:"\u215C",frac45:"\u2158",frac56:"\u215A",frac58:"\u215D",frac78:"\u215E",frasl:"\u2044",frown:"\u2322",fscr:"\u{1D4BB}",gE:"\u2267",gEl:"\u2A8C",gacute:"\u01F5",gamma:"\u03B3",gammad:"\u03DD",gap:"\u2A86",gbreve:"\u011F",gcirc:"\u011D",gcy:"\u0433",gdot:"\u0121",ge:"\u2265",gel:"\u22DB",geq:"\u2265",geqq:"\u2267",geqslant:"\u2A7E",ges:"\u2A7E",gescc:"\u2AA9",gesdot:"\u2A80",gesdoto:"\u2A82",gesdotol:"\u2A84",gesl:"\u22DB\uFE00",gesles:"\u2A94",gfr:"\u{1D524}",gg:"\u226B",ggg:"\u22D9",gimel:"\u2137",gjcy:"\u0453",gl:"\u2277",glE:"\u2A92",gla:"\u2AA5",glj:"\u2AA4",gnE:"\u2269",gnap:"\u2A8A",gnapprox:"\u2A8A",gne:"\u2A88",gneq:"\u2A88",gneqq:"\u2269",gnsim:"\u22E7",gopf:"\u{1D558}",grave:"`",gscr:"\u210A",gsim:"\u2273",gsime:"\u2A8E",gsiml:"\u2A90",gt:">",gtcc:"\u2AA7",gtcir:"\u2A7A",gtdot:"\u22D7",gtlPar:"\u2995",gtquest:"\u2A7C",gtrapprox:"\u2A86",gtrarr:"\u2978",gtrdot:"\u22D7",gtreqless:"\u22DB",gtreqqless:"\u2A8C",gtrless:"\u2277",gtrsim:"\u2273",gvertneqq:"\u2269\uFE00",gvnE:"\u2269\uFE00",hArr:"\u21D4",hairsp:"\u200A",half:"\xBD",hamilt:"\u210B",hardcy:"\u044A",harr:"\u2194",harrcir:"\u2948",harrw:"\u21AD",hbar:"\u210F",hcirc:"\u0125",hearts:"\u2665",heartsuit:"\u2665",hellip:"\u2026",hercon:"\u22B9",hfr:"\u{1D525}",hksearow:"\u2925",hkswarow:"\u2926",hoarr:"\u21FF",homtht:"\u223B",hookleftarrow:"\u21A9",hookrightarrow:"\u21AA",hopf:"\u{1D559}",horbar:"\u2015",hscr:"\u{1D4BD}",hslash:"\u210F",hstrok:"\u0127",hybull:"\u2043",hyphen:"\u2010",iacute:"\xED",ic:"\u2063",icirc:"\xEE",icy:"\u0438",iecy:"\u0435",iexcl:"\xA1",iff:"\u21D4",ifr:"\u{1D526}",igrave:"\xEC",ii:"\u2148",iiiint:"\u2A0C",iiint:"\u222D",iinfin:"\u29DC",iiota:"\u2129",ijlig:"\u0133",imacr:"\u012B",image:"\u2111",imagline:"\u2110",imagpart:"\u2111",imath:"\u0131",imof:"\u22B7",imped:"\u01B5",in:"\u2208",incare:"\u2105",infin:"\u221E",infintie:"\u29DD",inodot:"\u0131",int:"\u222B",intcal:"\u22BA",integers:"\u2124",intercal:"\u22BA",intlarhk:"\u2A17",intprod:"\u2A3C",iocy:"\u0451",iogon:"\u012F",iopf:"\u{1D55A}",iota:"\u03B9",iprod:"\u2A3C",iquest:"\xBF",iscr:"\u{1D4BE}",isin:"\u2208",isinE:"\u22F9",isindot:"\u22F5",isins:"\u22F4",isinsv:"\u22F3",isinv:"\u2208",it:"\u2062",itilde:"\u0129",iukcy:"\u0456",iuml:"\xEF",jcirc:"\u0135",jcy:"\u0439",jfr:"\u{1D527}",jmath:"\u0237",jopf:"\u{1D55B}",jscr:"\u{1D4BF}",jsercy:"\u0458",jukcy:"\u0454",kappa:"\u03BA",kappav:"\u03F0",kcedil:"\u0137",kcy:"\u043A",kfr:"\u{1D528}",kgreen:"\u0138",khcy:"\u0445",kjcy:"\u045C",kopf:"\u{1D55C}",kscr:"\u{1D4C0}",lAarr:"\u21DA",lArr:"\u21D0",lAtail:"\u291B",lBarr:"\u290E",lE:"\u2266",lEg:"\u2A8B",lHar:"\u2962",lacute:"\u013A",laemptyv:"\u29B4",lagran:"\u2112",lambda:"\u03BB",lang:"\u27E8",langd:"\u2991",langle:"\u27E8",lap:"\u2A85",laquo:"\xAB",larr:"\u2190",larrb:"\u21E4",larrbfs:"\u291F",larrfs:"\u291D",larrhk:"\u21A9",larrlp:"\u21AB",larrpl:"\u2939",larrsim:"\u2973",larrtl:"\u21A2",lat:"\u2AAB",latail:"\u2919",late:"\u2AAD",lates:"\u2AAD\uFE00",lbarr:"\u290C",lbbrk:"\u2772",lbrace:"{",lbrack:"[",lbrke:"\u298B",lbrksld:"\u298F",lbrkslu:"\u298D",lcaron:"\u013E",lcedil:"\u013C",lceil:"\u2308",lcub:"{",lcy:"\u043B",ldca:"\u2936",ldquo:"\u201C",ldquor:"\u201E",ldrdhar:"\u2967",ldrushar:"\u294B",ldsh:"\u21B2",le:"\u2264",leftarrow:"\u2190",leftarrowtail:"\u21A2",leftharpoondown:"\u21BD",leftharpoonup:"\u21BC",leftleftarrows:"\u21C7",leftrightarrow:"\u2194",leftrightarrows:"\u21C6",leftrightharpoons:"\u21CB",leftrightsquigarrow:"\u21AD",leftthreetimes:"\u22CB",leg:"\u22DA",leq:"\u2264",leqq:"\u2266",leqslant:"\u2A7D",les:"\u2A7D",lescc:"\u2AA8",lesdot:"\u2A7F",lesdoto:"\u2A81",lesdotor:"\u2A83",lesg:"\u22DA\uFE00",lesges:"\u2A93",lessapprox:"\u2A85",lessdot:"\u22D6",lesseqgtr:"\u22DA",lesseqqgtr:"\u2A8B",lessgtr:"\u2276",lesssim:"\u2272",lfisht:"\u297C",lfloor:"\u230A",lfr:"\u{1D529}",lg:"\u2276",lgE:"\u2A91",lhard:"\u21BD",lharu:"\u21BC",lharul:"\u296A",lhblk:"\u2584",ljcy:"\u0459",ll:"\u226A",llarr:"\u21C7",llcorner:"\u231E",llhard:"\u296B",lltri:"\u25FA",lmidot:"\u0140",lmoust:"\u23B0",lmoustache:"\u23B0",lnE:"\u2268",lnap:"\u2A89",lnapprox:"\u2A89",lne:"\u2A87",lneq:"\u2A87",lneqq:"\u2268",lnsim:"\u22E6",loang:"\u27EC",loarr:"\u21FD",lobrk:"\u27E6",longleftarrow:"\u27F5",longleftrightarrow:"\u27F7",longmapsto:"\u27FC",longrightarrow:"\u27F6",looparrowleft:"\u21AB",looparrowright:"\u21AC",lopar:"\u2985",lopf:"\u{1D55D}",loplus:"\u2A2D",lotimes:"\u2A34",lowast:"\u2217",lowbar:"_",loz:"\u25CA",lozenge:"\u25CA",lozf:"\u29EB",lpar:"(",lparlt:"\u2993",lrarr:"\u21C6",lrcorner:"\u231F",lrhar:"\u21CB",lrhard:"\u296D",lrm:"\u200E",lrtri:"\u22BF",lsaquo:"\u2039",lscr:"\u{1D4C1}",lsh:"\u21B0",lsim:"\u2272",lsime:"\u2A8D",lsimg:"\u2A8F",lsqb:"[",lsquo:"\u2018",lsquor:"\u201A",lstrok:"\u0142",lt:"<",ltcc:"\u2AA6",ltcir:"\u2A79",ltdot:"\u22D6",lthree:"\u22CB",ltimes:"\u22C9",ltlarr:"\u2976",ltquest:"\u2A7B",ltrPar:"\u2996",ltri:"\u25C3",ltrie:"\u22B4",ltrif:"\u25C2",lurdshar:"\u294A",luruhar:"\u2966",lvertneqq:"\u2268\uFE00",lvnE:"\u2268\uFE00",mDDot:"\u223A",macr:"\xAF",male:"\u2642",malt:"\u2720",maltese:"\u2720",map:"\u21A6",mapsto:"\u21A6",mapstodown:"\u21A7",mapstoleft:"\u21A4",mapstoup:"\u21A5",marker:"\u25AE",mcomma:"\u2A29",mcy:"\u043C",mdash:"\u2014",measuredangle:"\u2221",mfr:"\u{1D52A}",mho:"\u2127",micro:"\xB5",mid:"\u2223",midast:"*",midcir:"\u2AF0",middot:"\xB7",minus:"\u2212",minusb:"\u229F",minusd:"\u2238",minusdu:"\u2A2A",mlcp:"\u2ADB",mldr:"\u2026",mnplus:"\u2213",models:"\u22A7",mopf:"\u{1D55E}",mp:"\u2213",mscr:"\u{1D4C2}",mstpos:"\u223E",mu:"\u03BC",multimap:"\u22B8",mumap:"\u22B8",nGg:"\u22D9\u0338",nGt:"\u226B\u20D2",nGtv:"\u226B\u0338",nLeftarrow:"\u21CD",nLeftrightarrow:"\u21CE",nLl:"\u22D8\u0338",nLt:"\u226A\u20D2",nLtv:"\u226A\u0338",nRightarrow:"\u21CF",nVDash:"\u22AF",nVdash:"\u22AE",nabla:"\u2207",nacute:"\u0144",nang:"\u2220\u20D2",nap:"\u2249",napE:"\u2A70\u0338",napid:"\u224B\u0338",napos:"\u0149",napprox:"\u2249",natur:"\u266E",natural:"\u266E",naturals:"\u2115",nbsp:"\xA0",nbump:"\u224E\u0338",nbumpe:"\u224F\u0338",ncap:"\u2A43",ncaron:"\u0148",ncedil:"\u0146",ncong:"\u2247",ncongdot:"\u2A6D\u0338",ncup:"\u2A42",ncy:"\u043D",ndash:"\u2013",ne:"\u2260",neArr:"\u21D7",nearhk:"\u2924",nearr:"\u2197",nearrow:"\u2197",nedot:"\u2250\u0338",nequiv:"\u2262",nesear:"\u2928",nesim:"\u2242\u0338",nexist:"\u2204",nexists:"\u2204",nfr:"\u{1D52B}",ngE:"\u2267\u0338",nge:"\u2271",ngeq:"\u2271",ngeqq:"\u2267\u0338",ngeqslant:"\u2A7E\u0338",nges:"\u2A7E\u0338",ngsim:"\u2275",ngt:"\u226F",ngtr:"\u226F",nhArr:"\u21CE",nharr:"\u21AE",nhpar:"\u2AF2",ni:"\u220B",nis:"\u22FC",nisd:"\u22FA",niv:"\u220B",njcy:"\u045A",nlArr:"\u21CD",nlE:"\u2266\u0338",nlarr:"\u219A",nldr:"\u2025",nle:"\u2270",nleftarrow:"\u219A",nleftrightarrow:"\u21AE",nleq:"\u2270",nleqq:"\u2266\u0338",nleqslant:"\u2A7D\u0338",nles:"\u2A7D\u0338",nless:"\u226E",nlsim:"\u2274",nlt:"\u226E",nltri:"\u22EA",nltrie:"\u22EC",nmid:"\u2224",nopf:"\u{1D55F}",not:"\xAC",notin:"\u2209",notinE:"\u22F9\u0338",notindot:"\u22F5\u0338",notinva:"\u2209",notinvb:"\u22F7",notinvc:"\u22F6",notni:"\u220C",notniva:"\u220C",notnivb:"\u22FE",notnivc:"\u22FD",npar:"\u2226",nparallel:"\u2226",nparsl:"\u2AFD\u20E5",npart:"\u2202\u0338",npolint:"\u2A14",npr:"\u2280",nprcue:"\u22E0",npre:"\u2AAF\u0338",nprec:"\u2280",npreceq:"\u2AAF\u0338",nrArr:"\u21CF",nrarr:"\u219B",nrarrc:"\u2933\u0338",nrarrw:"\u219D\u0338",nrightarrow:"\u219B",nrtri:"\u22EB",nrtrie:"\u22ED",nsc:"\u2281",nsccue:"\u22E1",nsce:"\u2AB0\u0338",nscr:"\u{1D4C3}",nshortmid:"\u2224",nshortparallel:"\u2226",nsim:"\u2241",nsime:"\u2244",nsimeq:"\u2244",nsmid:"\u2224",nspar:"\u2226",nsqsube:"\u22E2",nsqsupe:"\u22E3",nsub:"\u2284",nsubE:"\u2AC5\u0338",nsube:"\u2288",nsubset:"\u2282\u20D2",nsubseteq:"\u2288",nsubseteqq:"\u2AC5\u0338",nsucc:"\u2281",nsucceq:"\u2AB0\u0338",nsup:"\u2285",nsupE:"\u2AC6\u0338",nsupe:"\u2289",nsupset:"\u2283\u20D2",nsupseteq:"\u2289",nsupseteqq:"\u2AC6\u0338",ntgl:"\u2279",ntilde:"\xF1",ntlg:"\u2278",ntriangleleft:"\u22EA",ntrianglelefteq:"\u22EC",ntriangleright:"\u22EB",ntrianglerighteq:"\u22ED",nu:"\u03BD",num:"#",numero:"\u2116",numsp:"\u2007",nvDash:"\u22AD",nvHarr:"\u2904",nvap:"\u224D\u20D2",nvdash:"\u22AC",nvge:"\u2265\u20D2",nvgt:">\u20D2",nvinfin:"\u29DE",nvlArr:"\u2902",nvle:"\u2264\u20D2",nvlt:"<\u20D2",nvltrie:"\u22B4\u20D2",nvrArr:"\u2903",nvrtrie:"\u22B5\u20D2",nvsim:"\u223C\u20D2",nwArr:"\u21D6",nwarhk:"\u2923",nwarr:"\u2196",nwarrow:"\u2196",nwnear:"\u2927",oS:"\u24C8",oacute:"\xF3",oast:"\u229B",ocir:"\u229A",ocirc:"\xF4",ocy:"\u043E",odash:"\u229D",odblac:"\u0151",odiv:"\u2A38",odot:"\u2299",odsold:"\u29BC",oelig:"\u0153",ofcir:"\u29BF",ofr:"\u{1D52C}",ogon:"\u02DB",ograve:"\xF2",ogt:"\u29C1",ohbar:"\u29B5",ohm:"\u03A9",oint:"\u222E",olarr:"\u21BA",olcir:"\u29BE",olcross:"\u29BB",oline:"\u203E",olt:"\u29C0",omacr:"\u014D",omega:"\u03C9",omicron:"\u03BF",omid:"\u29B6",ominus:"\u2296",oopf:"\u{1D560}",opar:"\u29B7",operp:"\u29B9",oplus:"\u2295",or:"\u2228",orarr:"\u21BB",ord:"\u2A5D",order:"\u2134",orderof:"\u2134",ordf:"\xAA",ordm:"\xBA",origof:"\u22B6",oror:"\u2A56",orslope:"\u2A57",orv:"\u2A5B",oscr:"\u2134",oslash:"\xF8",osol:"\u2298",otilde:"\xF5",otimes:"\u2297",otimesas:"\u2A36",ouml:"\xF6",ovbar:"\u233D",par:"\u2225",para:"\xB6",parallel:"\u2225",parsim:"\u2AF3",parsl:"\u2AFD",part:"\u2202",pcy:"\u043F",percnt:"%",period:".",permil:"\u2030",perp:"\u22A5",pertenk:"\u2031",pfr:"\u{1D52D}",phi:"\u03C6",phiv:"\u03D5",phmmat:"\u2133",phone:"\u260E",pi:"\u03C0",pitchfork:"\u22D4",piv:"\u03D6",planck:"\u210F",planckh:"\u210E",plankv:"\u210F",plus:"+",plusacir:"\u2A23",plusb:"\u229E",pluscir:"\u2A22",plusdo:"\u2214",plusdu:"\u2A25",pluse:"\u2A72",plusmn:"\xB1",plussim:"\u2A26",plustwo:"\u2A27",pm:"\xB1",pointint:"\u2A15",popf:"\u{1D561}",pound:"\xA3",pr:"\u227A",prE:"\u2AB3",prap:"\u2AB7",prcue:"\u227C",pre:"\u2AAF",prec:"\u227A",precapprox:"\u2AB7",preccurlyeq:"\u227C",preceq:"\u2AAF",precnapprox:"\u2AB9",precneqq:"\u2AB5",precnsim:"\u22E8",precsim:"\u227E",prime:"\u2032",primes:"\u2119",prnE:"\u2AB5",prnap:"\u2AB9",prnsim:"\u22E8",prod:"\u220F",profalar:"\u232E",profline:"\u2312",profsurf:"\u2313",prop:"\u221D",propto:"\u221D",prsim:"\u227E",prurel:"\u22B0",pscr:"\u{1D4C5}",psi:"\u03C8",puncsp:"\u2008",qfr:"\u{1D52E}",qint:"\u2A0C",qopf:"\u{1D562}",qprime:"\u2057",qscr:"\u{1D4C6}",quaternions:"\u210D",quatint:"\u2A16",quest:"?",questeq:"\u225F",quot:'"',rAarr:"\u21DB",rArr:"\u21D2",rAtail:"\u291C",rBarr:"\u290F",rHar:"\u2964",race:"\u223D\u0331",racute:"\u0155",radic:"\u221A",raemptyv:"\u29B3",rang:"\u27E9",rangd:"\u2992",range:"\u29A5",rangle:"\u27E9",raquo:"\xBB",rarr:"\u2192",rarrap:"\u2975",rarrb:"\u21E5",rarrbfs:"\u2920",rarrc:"\u2933",rarrfs:"\u291E",rarrhk:"\u21AA",rarrlp:"\u21AC",rarrpl:"\u2945",rarrsim:"\u2974",rarrtl:"\u21A3",rarrw:"\u219D",ratail:"\u291A",ratio:"\u2236",rationals:"\u211A",rbarr:"\u290D",rbbrk:"\u2773",rbrace:"}",rbrack:"]",rbrke:"\u298C",rbrksld:"\u298E",rbrkslu:"\u2990",rcaron:"\u0159",rcedil:"\u0157",rceil:"\u2309",rcub:"}",rcy:"\u0440",rdca:"\u2937",rdldhar:"\u2969",rdquo:"\u201D",rdquor:"\u201D",rdsh:"\u21B3",real:"\u211C",realine:"\u211B",realpart:"\u211C",reals:"\u211D",rect:"\u25AD",reg:"\xAE",rfisht:"\u297D",rfloor:"\u230B",rfr:"\u{1D52F}",rhard:"\u21C1",rharu:"\u21C0",rharul:"\u296C",rho:"\u03C1",rhov:"\u03F1",rightarrow:"\u2192",rightarrowtail:"\u21A3",rightharpoondown:"\u21C1",rightharpoonup:"\u21C0",rightleftarrows:"\u21C4",rightleftharpoons:"\u21CC",rightrightarrows:"\u21C9",rightsquigarrow:"\u219D",rightthreetimes:"\u22CC",ring:"\u02DA",risingdotseq:"\u2253",rlarr:"\u21C4",rlhar:"\u21CC",rlm:"\u200F",rmoust:"\u23B1",rmoustache:"\u23B1",rnmid:"\u2AEE",roang:"\u27ED",roarr:"\u21FE",robrk:"\u27E7",ropar:"\u2986",ropf:"\u{1D563}",roplus:"\u2A2E",rotimes:"\u2A35",rpar:")",rpargt:"\u2994",rppolint:"\u2A12",rrarr:"\u21C9",rsaquo:"\u203A",rscr:"\u{1D4C7}",rsh:"\u21B1",rsqb:"]",rsquo:"\u2019",rsquor:"\u2019",rthree:"\u22CC",rtimes:"\u22CA",rtri:"\u25B9",rtrie:"\u22B5",rtrif:"\u25B8",rtriltri:"\u29CE",ruluhar:"\u2968",rx:"\u211E",sacute:"\u015B",sbquo:"\u201A",sc:"\u227B",scE:"\u2AB4",scap:"\u2AB8",scaron:"\u0161",sccue:"\u227D",sce:"\u2AB0",scedil:"\u015F",scirc:"\u015D",scnE:"\u2AB6",scnap:"\u2ABA",scnsim:"\u22E9",scpolint:"\u2A13",scsim:"\u227F",scy:"\u0441",sdot:"\u22C5",sdotb:"\u22A1",sdote:"\u2A66",seArr:"\u21D8",searhk:"\u2925",searr:"\u2198",searrow:"\u2198",sect:"\xA7",semi:";",seswar:"\u2929",setminus:"\u2216",setmn:"\u2216",sext:"\u2736",sfr:"\u{1D530}",sfrown:"\u2322",sharp:"\u266F",shchcy:"\u0449",shcy:"\u0448",shortmid:"\u2223",shortparallel:"\u2225",shy:"\xAD",sigma:"\u03C3",sigmaf:"\u03C2",sigmav:"\u03C2",sim:"\u223C",simdot:"\u2A6A",sime:"\u2243",simeq:"\u2243",simg:"\u2A9E",simgE:"\u2AA0",siml:"\u2A9D",simlE:"\u2A9F",simne:"\u2246",simplus:"\u2A24",simrarr:"\u2972",slarr:"\u2190",smallsetminus:"\u2216",smashp:"\u2A33",smeparsl:"\u29E4",smid:"\u2223",smile:"\u2323",smt:"\u2AAA",smte:"\u2AAC",smtes:"\u2AAC\uFE00",softcy:"\u044C",sol:"/",solb:"\u29C4",solbar:"\u233F",sopf:"\u{1D564}",spades:"\u2660",spadesuit:"\u2660",spar:"\u2225",sqcap:"\u2293",sqcaps:"\u2293\uFE00",sqcup:"\u2294",sqcups:"\u2294\uFE00",sqsub:"\u228F",sqsube:"\u2291",sqsubset:"\u228F",sqsubseteq:"\u2291",sqsup:"\u2290",sqsupe:"\u2292",sqsupset:"\u2290",sqsupseteq:"\u2292",squ:"\u25A1",square:"\u25A1",squarf:"\u25AA",squf:"\u25AA",srarr:"\u2192",sscr:"\u{1D4C8}",ssetmn:"\u2216",ssmile:"\u2323",sstarf:"\u22C6",star:"\u2606",starf:"\u2605",straightepsilon:"\u03F5",straightphi:"\u03D5",strns:"\xAF",sub:"\u2282",subE:"\u2AC5",subdot:"\u2ABD",sube:"\u2286",subedot:"\u2AC3",submult:"\u2AC1",subnE:"\u2ACB",subne:"\u228A",subplus:"\u2ABF",subrarr:"\u2979",subset:"\u2282",subseteq:"\u2286",subseteqq:"\u2AC5",subsetneq:"\u228A",subsetneqq:"\u2ACB",subsim:"\u2AC7",subsub:"\u2AD5",subsup:"\u2AD3",succ:"\u227B",succapprox:"\u2AB8",succcurlyeq:"\u227D",succeq:"\u2AB0",succnapprox:"\u2ABA",succneqq:"\u2AB6",succnsim:"\u22E9",succsim:"\u227F",sum:"\u2211",sung:"\u266A",sup1:"\xB9",sup2:"\xB2",sup3:"\xB3",sup:"\u2283",supE:"\u2AC6",supdot:"\u2ABE",supdsub:"\u2AD8",supe:"\u2287",supedot:"\u2AC4",suphsol:"\u27C9",suphsub:"\u2AD7",suplarr:"\u297B",supmult:"\u2AC2",supnE:"\u2ACC",supne:"\u228B",supplus:"\u2AC0",supset:"\u2283",supseteq:"\u2287",supseteqq:"\u2AC6",supsetneq:"\u228B",supsetneqq:"\u2ACC",supsim:"\u2AC8",supsub:"\u2AD4",supsup:"\u2AD6",swArr:"\u21D9",swarhk:"\u2926",swarr:"\u2199",swarrow:"\u2199",swnwar:"\u292A",szlig:"\xDF",target:"\u2316",tau:"\u03C4",tbrk:"\u23B4",tcaron:"\u0165",tcedil:"\u0163",tcy:"\u0442",tdot:"\u20DB",telrec:"\u2315",tfr:"\u{1D531}",there4:"\u2234",therefore:"\u2234",theta:"\u03B8",thetasym:"\u03D1",thetav:"\u03D1",thickapprox:"\u2248",thicksim:"\u223C",thinsp:"\u2009",thkap:"\u2248",thksim:"\u223C",thorn:"\xFE",tilde:"\u02DC",times:"\xD7",timesb:"\u22A0",timesbar:"\u2A31",timesd:"\u2A30",tint:"\u222D",toea:"\u2928",top:"\u22A4",topbot:"\u2336",topcir:"\u2AF1",topf:"\u{1D565}",topfork:"\u2ADA",tosa:"\u2929",tprime:"\u2034",trade:"\u2122",triangle:"\u25B5",triangledown:"\u25BF",triangleleft:"\u25C3",trianglelefteq:"\u22B4",triangleq:"\u225C",triangleright:"\u25B9",trianglerighteq:"\u22B5",tridot:"\u25EC",trie:"\u225C",triminus:"\u2A3A",triplus:"\u2A39",trisb:"\u29CD",tritime:"\u2A3B",trpezium:"\u23E2",tscr:"\u{1D4C9}",tscy:"\u0446",tshcy:"\u045B",tstrok:"\u0167",twixt:"\u226C",twoheadleftarrow:"\u219E",twoheadrightarrow:"\u21A0",uArr:"\u21D1",uHar:"\u2963",uacute:"\xFA",uarr:"\u2191",ubrcy:"\u045E",ubreve:"\u016D",ucirc:"\xFB",ucy:"\u0443",udarr:"\u21C5",udblac:"\u0171",udhar:"\u296E",ufisht:"\u297E",ufr:"\u{1D532}",ugrave:"\xF9",uharl:"\u21BF",uharr:"\u21BE",uhblk:"\u2580",ulcorn:"\u231C",ulcorner:"\u231C",ulcrop:"\u230F",ultri:"\u25F8",umacr:"\u016B",uml:"\xA8",uogon:"\u0173",uopf:"\u{1D566}",uparrow:"\u2191",updownarrow:"\u2195",upharpoonleft:"\u21BF",upharpoonright:"\u21BE",uplus:"\u228E",upsi:"\u03C5",upsih:"\u03D2",upsilon:"\u03C5",upuparrows:"\u21C8",urcorn:"\u231D",urcorner:"\u231D",urcrop:"\u230E",uring:"\u016F",urtri:"\u25F9",uscr:"\u{1D4CA}",utdot:"\u22F0",utilde:"\u0169",utri:"\u25B5",utrif:"\u25B4",uuarr:"\u21C8",uuml:"\xFC",uwangle:"\u29A7",vArr:"\u21D5",vBar:"\u2AE8",vBarv:"\u2AE9",vDash:"\u22A8",vangrt:"\u299C",varepsilon:"\u03F5",varkappa:"\u03F0",varnothing:"\u2205",varphi:"\u03D5",varpi:"\u03D6",varpropto:"\u221D",varr:"\u2195",varrho:"\u03F1",varsigma:"\u03C2",varsubsetneq:"\u228A\uFE00",varsubsetneqq:"\u2ACB\uFE00",varsupsetneq:"\u228B\uFE00",varsupsetneqq:"\u2ACC\uFE00",vartheta:"\u03D1",vartriangleleft:"\u22B2",vartriangleright:"\u22B3",vcy:"\u0432",vdash:"\u22A2",vee:"\u2228",veebar:"\u22BB",veeeq:"\u225A",vellip:"\u22EE",verbar:"|",vert:"|",vfr:"\u{1D533}",vltri:"\u22B2",vnsub:"\u2282\u20D2",vnsup:"\u2283\u20D2",vopf:"\u{1D567}",vprop:"\u221D",vrtri:"\u22B3",vscr:"\u{1D4CB}",vsubnE:"\u2ACB\uFE00",vsubne:"\u228A\uFE00",vsupnE:"\u2ACC\uFE00",vsupne:"\u228B\uFE00",vzigzag:"\u299A",wcirc:"\u0175",wedbar:"\u2A5F",wedge:"\u2227",wedgeq:"\u2259",weierp:"\u2118",wfr:"\u{1D534}",wopf:"\u{1D568}",wp:"\u2118",wr:"\u2240",wreath:"\u2240",wscr:"\u{1D4CC}",xcap:"\u22C2",xcirc:"\u25EF",xcup:"\u22C3",xdtri:"\u25BD",xfr:"\u{1D535}",xhArr:"\u27FA",xharr:"\u27F7",xi:"\u03BE",xlArr:"\u27F8",xlarr:"\u27F5",xmap:"\u27FC",xnis:"\u22FB",xodot:"\u2A00",xopf:"\u{1D569}",xoplus:"\u2A01",xotime:"\u2A02",xrArr:"\u27F9",xrarr:"\u27F6",xscr:"\u{1D4CD}",xsqcup:"\u2A06",xuplus:"\u2A04",xutri:"\u25B3",xvee:"\u22C1",xwedge:"\u22C0",yacute:"\xFD",yacy:"\u044F",ycirc:"\u0177",ycy:"\u044B",yen:"\xA5",yfr:"\u{1D536}",yicy:"\u0457",yopf:"\u{1D56A}",yscr:"\u{1D4CE}",yucy:"\u044E",yuml:"\xFF",zacute:"\u017A",zcaron:"\u017E",zcy:"\u0437",zdot:"\u017C",zeetrf:"\u2128",zeta:"\u03B6",zfr:"\u{1D537}",zhcy:"\u0436",zigrarr:"\u21DD",zopf:"\u{1D56B}",zscr:"\u{1D4CF}",zwj:"\u200D",zwnj:"\u200C"};var Pb={}.hasOwnProperty;function Ar(e){return Pb.call(Tl,e)?Tl[e]:!1}function xs(e,t){let n=Number.parseInt(e,t);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)}var Lb=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function bs(e){return e.replace(Lb,Fb)}function Fb(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){let i=n.charCodeAt(1),o=i===120||i===88;return xs(n.slice(o?2:1),o?16:10)}return Ar(n)||e}var $b={};function El(e,t){let n=t||$b,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return pp(e,r,i)}function pp(e,t,n){if(Ub(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return mp(e.children,t,n)}return Array.isArray(e)?mp(e,t,n):""}function mp(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=pp(e[i],t,n);return r.join("")}function Ub(e){return!!(e&&typeof e=="object")}function me(e,t,n,r){let i=e.length,o=0,s;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)s=Array.from(r),s.unshift(t,n),e.splice(...s);else for(n&&e.splice(t,n);o<r.length;)s=r.slice(o,o+1e4),s.unshift(t,0),e.splice(...s),o+=1e4,t+=1e4}function Le(e,t){return e.length>0?(me(e,e.length,0,t),e):t}var fp={}.hasOwnProperty;function ks(e){let t={},n=-1;for(;++n<e.length;)zb(t,e[n]);return t}function zb(e,t){let n;for(n in t){let i=(fp.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n],s;if(o)for(s in o){fp.call(i,s)||(i[s]=[]);let a=o[s];Bb(i[s],Array.isArray(a)?a:a?[a]:[])}}}function Bb(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);me(e,0,0,r)}function Oe(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}var fe=pn(/[A-Za-z]/),he=pn(/[\dA-Za-z]/),hp=pn(/[#-'*+\--9=?A-Z^-~]/);function Wn(e){return e!==null&&(e<32||e===127)}var Oi=pn(/\d/),gp=pn(/[\dA-Fa-f]/),yp=pn(/[!-/:-@[-`{-~]/);function _(e){return e!==null&&e<-2}function q(e){return e!==null&&(e<0||e===32)}function L(e){return e===-2||e===-1||e===32}var Gn=pn(new RegExp("\\p{P}|\\p{S}","u")),Tt=pn(/\s/);function pn(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function P(e,t,n,r){let i=r?r-1:Number.POSITIVE_INFINITY,o=0;return s;function s(l){return L(l)?(e.enter(n),a(l)):t(l)}function a(l){return L(l)&&o++<i?(e.consume(l),a):(e.exit(n),t(l))}}var wp={tokenize:qb};function qb(e){let t=e.attempt(this.parser.constructs.contentInitial,r,i),n;return t;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),P(e,t,"linePrefix")}function i(a){return e.enter("paragraph"),o(a)}function o(a){let l=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=l),n=l,s(a)}function s(a){if(a===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(a);return}return _(a)?(e.consume(a),e.exit("chunkText"),o):(e.consume(a),s)}}var bp={tokenize:jb},xp={tokenize:Hb};function jb(e){let t=this,n=[],r=0,i,o,s;return a;function a(T){if(r<n.length){let R=n[r];return t.containerState=R[1],e.attempt(R[0].continuation,l,u)(T)}return u(T)}function l(T){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&D();let R=t.events.length,O=R,b;for(;O--;)if(t.events[O][0]==="exit"&&t.events[O][1].type==="chunkFlow"){b=t.events[O][1].end;break}w(r);let E=R;for(;E<t.events.length;)t.events[E][1].end={...b},E++;return me(t.events,O+1,0,t.events.slice(R)),t.events.length=E,u(T)}return a(T)}function u(T){if(r===n.length){if(!i)return m(T);if(i.currentConstruct&&i.currentConstruct.concrete)return f(T);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(xp,d,c)(T)}function d(T){return i&&D(),w(r),m(T)}function c(T){return t.parser.lazy[t.now().line]=r!==n.length,s=t.now().offset,f(T)}function m(T){return t.containerState={},e.attempt(xp,p,f)(T)}function p(T){return r++,n.push([t.currentConstruct,t.containerState]),m(T)}function f(T){if(T===null){i&&D(),w(0),e.consume(T);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:o}),x(T)}function x(T){if(T===null){S(e.exit("chunkFlow"),!0),w(0),e.consume(T);return}return _(T)?(e.consume(T),S(e.exit("chunkFlow")),r=0,t.interrupt=void 0,a):(e.consume(T),x)}function S(T,R){let O=t.sliceStream(T);if(R&&O.push(null),T.previous=o,o&&(o.next=T),o=T,i.defineSkip(T.start),i.write(O),t.parser.lazy[T.start.line]){let b=i.events.length;for(;b--;)if(i.events[b][1].start.offset<s&&(!i.events[b][1].end||i.events[b][1].end.offset>s))return;let E=t.events.length,M=E,C,y;for(;M--;)if(t.events[M][0]==="exit"&&t.events[M][1].type==="chunkFlow"){if(C){y=t.events[M][1].end;break}C=!0}for(w(r),b=E;b<t.events.length;)t.events[b][1].end={...y},b++;me(t.events,M+1,0,t.events.slice(E)),t.events.length=b}}function w(T){let R=n.length;for(;R-- >T;){let O=n[R];t.containerState=O[1],O[0].exit.call(t,e)}n.length=T}function D(){i.write([null]),o=void 0,i=void 0,t.containerState._closeFlow=void 0}}function Hb(e,t,n){return P(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Or(e){if(e===null||q(e)||Tt(e))return 1;if(Gn(e))return 2}function fn(e,t,n){let r=[],i=-1;for(;++i<e.length;){let o=e[i].resolveAll;o&&!r.includes(o)&&(t=o(t,n),r.push(o))}return t}var Di={name:"attention",resolveAll:Wb,tokenize:Gb};function Wb(e,t){let n=-1,r,i,o,s,a,l,u,d;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;l=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;let c={...e[r][1].end},m={...e[n][1].start};kp(c,-l),kp(m,l),s={type:l>1?"strongSequence":"emphasisSequence",start:c,end:{...e[r][1].end}},a={type:l>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:m},o={type:l>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:l>1?"strong":"emphasis",start:{...s.start},end:{...a.end}},e[r][1].end={...s.start},e[n][1].start={...a.end},u=[],e[r][1].end.offset-e[r][1].start.offset&&(u=Le(u,[["enter",e[r][1],t],["exit",e[r][1],t]])),u=Le(u,[["enter",i,t],["enter",s,t],["exit",s,t],["enter",o,t]]),u=Le(u,fn(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),u=Le(u,[["exit",o,t],["enter",a,t],["exit",a,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(d=2,u=Le(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):d=0,me(e,r-1,n-r+3,u),n=r+u.length-d-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function Gb(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Or(r),o;return s;function s(l){return o=l,e.enter("attentionSequence"),a(l)}function a(l){if(l===o)return e.consume(l),a;let u=e.exit("attentionSequence"),d=Or(l),c=!d||d===2&&i||n.includes(l),m=!i||i===2&&d||n.includes(r);return u._open=!!(o===42?c:c&&(i||!m)),u._close=!!(o===42?m:m&&(d||!c)),t(l)}}function kp(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var Cl={name:"autolink",tokenize:Vb};function Vb(e,t,n){let r=0;return i;function i(p){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(p){return fe(p)?(e.consume(p),s):p===64?n(p):u(p)}function s(p){return p===43||p===45||p===46||he(p)?(r=1,a(p)):u(p)}function a(p){return p===58?(e.consume(p),r=0,l):(p===43||p===45||p===46||he(p))&&r++<32?(e.consume(p),a):(r=0,u(p))}function l(p){return p===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):p===null||p===32||p===60||Wn(p)?n(p):(e.consume(p),l)}function u(p){return p===64?(e.consume(p),d):hp(p)?(e.consume(p),u):n(p)}function d(p){return he(p)?c(p):n(p)}function c(p){return p===46?(e.consume(p),r=0,d):p===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):m(p)}function m(p){if((p===45||he(p))&&r++<63){let f=p===45?m:c;return e.consume(p),f}return n(p)}}var Et={partial:!0,tokenize:Yb};function Yb(e,t,n){return r;function r(o){return L(o)?P(e,i,"linePrefix")(o):i(o)}function i(o){return o===null||_(o)?t(o):n(o)}}var Ss={continuation:{tokenize:Kb},exit:Jb,name:"blockQuote",tokenize:Zb};function Zb(e,t,n){let r=this;return i;function i(s){if(s===62){let a=r.containerState;return a.open||(e.enter("blockQuote",{_container:!0}),a.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(s),e.exit("blockQuoteMarker"),o}return n(s)}function o(s){return L(s)?(e.enter("blockQuotePrefixWhitespace"),e.consume(s),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(s))}}function Kb(e,t,n){let r=this;return i;function i(s){return L(s)?P(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s):o(s)}function o(s){return e.attempt(Ss,t,n)(s)}}function Jb(e){e.exit("blockQuote")}var Ts={name:"characterEscape",tokenize:Xb};function Xb(e,t,n){return r;function r(o){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(o),e.exit("escapeMarker"),i}function i(o){return yp(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(o)}}var Es={name:"characterReference",tokenize:Qb};function Qb(e,t,n){let r=this,i=0,o,s;return a;function a(c){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(c),e.exit("characterReferenceMarker"),l}function l(c){return c===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(c),e.exit("characterReferenceMarkerNumeric"),u):(e.enter("characterReferenceValue"),o=31,s=he,d(c))}function u(c){return c===88||c===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(c),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,s=gp,d):(e.enter("characterReferenceValue"),o=7,s=Oi,d(c))}function d(c){if(c===59&&i){let m=e.exit("characterReferenceValue");return s===he&&!Ar(r.sliceSerialize(m))?n(c):(e.enter("characterReferenceMarker"),e.consume(c),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return s(c)&&i++<o?(e.consume(c),d):n(c)}}var Sp={partial:!0,tokenize:tk},Cs={concrete:!0,name:"codeFenced",tokenize:ek};function ek(e,t,n){let r=this,i={partial:!0,tokenize:O},o=0,s=0,a;return l;function l(b){return u(b)}function u(b){let E=r.events[r.events.length-1];return o=E&&E[1].type==="linePrefix"?E[2].sliceSerialize(E[1],!0).length:0,a=b,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),d(b)}function d(b){return b===a?(s++,e.consume(b),d):s<3?n(b):(e.exit("codeFencedFenceSequence"),L(b)?P(e,c,"whitespace")(b):c(b))}function c(b){return b===null||_(b)?(e.exit("codeFencedFence"),r.interrupt?t(b):e.check(Sp,x,R)(b)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),m(b))}function m(b){return b===null||_(b)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),c(b)):L(b)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),P(e,p,"whitespace")(b)):b===96&&b===a?n(b):(e.consume(b),m)}function p(b){return b===null||_(b)?c(b):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),f(b))}function f(b){return b===null||_(b)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),c(b)):b===96&&b===a?n(b):(e.consume(b),f)}function x(b){return e.attempt(i,R,S)(b)}function S(b){return e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),w}function w(b){return o>0&&L(b)?P(e,D,"linePrefix",o+1)(b):D(b)}function D(b){return b===null||_(b)?e.check(Sp,x,R)(b):(e.enter("codeFlowValue"),T(b))}function T(b){return b===null||_(b)?(e.exit("codeFlowValue"),D(b)):(e.consume(b),T)}function R(b){return e.exit("codeFenced"),t(b)}function O(b,E,M){let C=0;return y;function y(U){return b.enter("lineEnding"),b.consume(U),b.exit("lineEnding"),Z}function Z(U){return b.enter("codeFencedFence"),L(U)?P(b,F,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(U):F(U)}function F(U){return U===a?(b.enter("codeFencedFenceSequence"),A(U)):M(U)}function A(U){return U===a?(C++,b.consume(U),A):C>=s?(b.exit("codeFencedFenceSequence"),L(U)?P(b,N,"whitespace")(U):N(U)):M(U)}function N(U){return U===null||_(U)?(b.exit("codeFencedFence"),E(U)):M(U)}}}function tk(e,t,n){let r=this;return i;function i(s){return s===null?n(s):(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),o)}function o(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}var vi={name:"codeIndented",tokenize:rk},nk={partial:!0,tokenize:ik};function rk(e,t,n){let r=this;return i;function i(u){return e.enter("codeIndented"),P(e,o,"linePrefix",5)(u)}function o(u){let d=r.events[r.events.length-1];return d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?s(u):n(u)}function s(u){return u===null?l(u):_(u)?e.attempt(nk,s,l)(u):(e.enter("codeFlowValue"),a(u))}function a(u){return u===null||_(u)?(e.exit("codeFlowValue"),s(u)):(e.consume(u),a)}function l(u){return e.exit("codeIndented"),t(u)}}function ik(e,t,n){let r=this;return i;function i(s){return r.parser.lazy[r.now().line]?n(s):_(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),i):P(e,o,"linePrefix",5)(s)}function o(s){let a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(s):_(s)?i(s):n(s)}}var Il={name:"codeText",previous:sk,resolve:ok,tokenize:ak};function ok(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(i=r):(r===t||e[r][1].type==="lineEnding")&&(e[i][1].type="codeTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function sk(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function ak(e,t,n){let r=this,i=0,o,s;return a;function a(m){return e.enter("codeText"),e.enter("codeTextSequence"),l(m)}function l(m){return m===96?(e.consume(m),i++,l):(e.exit("codeTextSequence"),u(m))}function u(m){return m===null?n(m):m===32?(e.enter("space"),e.consume(m),e.exit("space"),u):m===96?(s=e.enter("codeTextSequence"),o=0,c(m)):_(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),u):(e.enter("codeTextData"),d(m))}function d(m){return m===null||m===32||m===96||_(m)?(e.exit("codeTextData"),u(m)):(e.consume(m),d)}function c(m){return m===96?(e.consume(m),o++,c):o===i?(e.exit("codeTextSequence"),e.exit("codeText"),t(m)):(s.type="codeTextData",d(m))}}var Is=class{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){let r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){let i=n||0;this.setCursor(Math.trunc(t));let o=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&Ri(this.left,r),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),Ri(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Ri(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){let n=this.left.splice(t,Number.POSITIVE_INFINITY);Ri(this.right,n.reverse())}else{let n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Ri(this.left,n.reverse())}}};function Ri(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function _s(e){let t={},n=-1,r,i,o,s,a,l,u,d=new Is(e);for(;++n<d.length;){for(;n in t;)n=t[n];if(r=d.get(n),n&&r[1].type==="chunkFlow"&&d.get(n-1)[1].type==="listItemPrefix"&&(l=r[1]._tokenizer.events,o=0,o<l.length&&l[o][1].type==="lineEndingBlank"&&(o+=2),o<l.length&&l[o][1].type==="content"))for(;++o<l.length&&l[o][1].type!=="content";)l[o][1].type==="chunkText"&&(l[o][1]._isInFirstContentOfListItem=!0,o++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,lk(d,n)),n=t[n],u=!0);else if(r[1]._container){for(o=n,i=void 0;o--;)if(s=d.get(o),s[1].type==="lineEnding"||s[1].type==="lineEndingBlank")s[0]==="enter"&&(i&&(d.get(i)[1].type="lineEndingBlank"),s[1].type="lineEnding",i=o);else if(!(s[1].type==="linePrefix"||s[1].type==="listItemIndent"))break;i&&(r[1].end={...d.get(i)[1].start},a=d.slice(i,n),a.unshift(r),d.splice(i,n-i+1,a))}}return me(e,0,Number.POSITIVE_INFINITY,d.slice(0)),!u}function lk(e,t){let n=e.get(t)[1],r=e.get(t)[2],i=t-1,o=[],s=n._tokenizer;s||(s=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(s._contentTypeTextTrailing=!0));let a=s.events,l=[],u={},d,c,m=-1,p=n,f=0,x=0,S=[x];for(;p;){for(;e.get(++i)[1]!==p;);o.push(i),p._tokenizer||(d=r.sliceStream(p),p.next||d.push(null),c&&s.defineSkip(p.start),p._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=!0),s.write(d),p._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=void 0)),c=p,p=p.next}for(p=n;++m<a.length;)a[m][0]==="exit"&&a[m-1][0]==="enter"&&a[m][1].type===a[m-1][1].type&&a[m][1].start.line!==a[m][1].end.line&&(x=m+1,S.push(x),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(s.events=[],p?(p._tokenizer=void 0,p.previous=void 0):S.pop(),m=S.length;m--;){let w=a.slice(S[m],S[m+1]),D=o.pop();l.push([D,D+w.length-1]),e.splice(D,2,w)}for(l.reverse(),m=-1;++m<l.length;)u[f+l[m][0]]=f+l[m][1],f+=l[m][1]-l[m][0]-1;return u}var _l={resolve:ck,tokenize:dk},uk={partial:!0,tokenize:mk};function ck(e){return _s(e),e}function dk(e,t){let n;return r;function r(a){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(a)}function i(a){return a===null?o(a):_(a)?e.check(uk,s,o)(a):(e.consume(a),i)}function o(a){return e.exit("chunkContent"),e.exit("content"),t(a)}function s(a){return e.consume(a),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function mk(e,t,n){let r=this;return i;function i(s){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),P(e,o,"linePrefix")}function o(s){if(s===null||_(s))return n(s);let a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(s):e.interrupt(r.parser.constructs.flow,n,t)(s)}}function As(e,t,n,r,i,o,s,a,l){let u=l||Number.POSITIVE_INFINITY,d=0;return c;function c(w){return w===60?(e.enter(r),e.enter(i),e.enter(o),e.consume(w),e.exit(o),m):w===null||w===32||w===41||Wn(w)?n(w):(e.enter(r),e.enter(s),e.enter(a),e.enter("chunkString",{contentType:"string"}),x(w))}function m(w){return w===62?(e.enter(o),e.consume(w),e.exit(o),e.exit(i),e.exit(r),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),p(w))}function p(w){return w===62?(e.exit("chunkString"),e.exit(a),m(w)):w===null||w===60||_(w)?n(w):(e.consume(w),w===92?f:p)}function f(w){return w===60||w===62||w===92?(e.consume(w),p):p(w)}function x(w){return!d&&(w===null||w===41||q(w))?(e.exit("chunkString"),e.exit(a),e.exit(s),e.exit(r),t(w)):d<u&&w===40?(e.consume(w),d++,x):w===41?(e.consume(w),d--,x):w===null||w===32||w===40||Wn(w)?n(w):(e.consume(w),w===92?S:x)}function S(w){return w===40||w===41||w===92?(e.consume(w),x):x(w)}}function Os(e,t,n,r,i,o){let s=this,a=0,l;return u;function u(p){return e.enter(r),e.enter(i),e.consume(p),e.exit(i),e.enter(o),d}function d(p){return a>999||p===null||p===91||p===93&&!l||p===94&&!a&&"_hiddenFootnoteSupport"in s.parser.constructs?n(p):p===93?(e.exit(o),e.enter(i),e.consume(p),e.exit(i),e.exit(r),t):_(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),d):(e.enter("chunkString",{contentType:"string"}),c(p))}function c(p){return p===null||p===91||p===93||_(p)||a++>999?(e.exit("chunkString"),d(p)):(e.consume(p),l||(l=!L(p)),p===92?m:c)}function m(p){return p===91||p===92||p===93?(e.consume(p),a++,c):c(p)}}function Ds(e,t,n,r,i,o){let s;return a;function a(m){return m===34||m===39||m===40?(e.enter(r),e.enter(i),e.consume(m),e.exit(i),s=m===40?41:m,l):n(m)}function l(m){return m===s?(e.enter(i),e.consume(m),e.exit(i),e.exit(r),t):(e.enter(o),u(m))}function u(m){return m===s?(e.exit(o),l(s)):m===null?n(m):_(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),P(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),d(m))}function d(m){return m===s||m===null||_(m)?(e.exit("chunkString"),u(m)):(e.consume(m),m===92?c:d)}function c(m){return m===s||m===92?(e.consume(m),d):d(m)}}function Vn(e,t){let n;return r;function r(i){return _(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):L(i)?P(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}var Al={name:"definition",tokenize:fk},pk={partial:!0,tokenize:hk};function fk(e,t,n){let r=this,i;return o;function o(p){return e.enter("definition"),s(p)}function s(p){return Os.call(r,e,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function a(p){return i=Oe(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),p===58?(e.enter("definitionMarker"),e.consume(p),e.exit("definitionMarker"),l):n(p)}function l(p){return q(p)?Vn(e,u)(p):u(p)}function u(p){return As(e,d,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function d(p){return e.attempt(pk,c,c)(p)}function c(p){return L(p)?P(e,m,"whitespace")(p):m(p)}function m(p){return p===null||_(p)?(e.exit("definition"),r.parser.defined.push(i),t(p)):n(p)}}function hk(e,t,n){return r;function r(a){return q(a)?Vn(e,i)(a):n(a)}function i(a){return Ds(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function o(a){return L(a)?P(e,s,"whitespace")(a):s(a)}function s(a){return a===null||_(a)?t(a):n(a)}}var Ol={name:"hardBreakEscape",tokenize:gk};function gk(e,t,n){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),i}function i(o){return _(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}var Dl={name:"headingAtx",resolve:yk,tokenize:wk};function yk(e,t){let n=e.length-2,r=3,i,o;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},o={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},me(e,r,n-r+1,[["enter",i,t],["enter",o,t],["exit",o,t],["exit",i,t]])),e}function wk(e,t,n){let r=0;return i;function i(d){return e.enter("atxHeading"),o(d)}function o(d){return e.enter("atxHeadingSequence"),s(d)}function s(d){return d===35&&r++<6?(e.consume(d),s):d===null||q(d)?(e.exit("atxHeadingSequence"),a(d)):n(d)}function a(d){return d===35?(e.enter("atxHeadingSequence"),l(d)):d===null||_(d)?(e.exit("atxHeading"),t(d)):L(d)?P(e,a,"whitespace")(d):(e.enter("atxHeadingText"),u(d))}function l(d){return d===35?(e.consume(d),l):(e.exit("atxHeadingSequence"),a(d))}function u(d){return d===null||d===35||q(d)?(e.exit("atxHeadingText"),a(d)):(e.consume(d),u)}}var Tp=["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"],vl=["pre","script","style","textarea"];var Rl={concrete:!0,name:"htmlFlow",resolveTo:kk,tokenize:Sk},xk={partial:!0,tokenize:Ek},bk={partial:!0,tokenize:Tk};function kk(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function Sk(e,t,n){let r=this,i,o,s,a,l;return u;function u(g){return d(g)}function d(g){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(g),c}function c(g){return g===33?(e.consume(g),m):g===47?(e.consume(g),o=!0,x):g===63?(e.consume(g),i=3,r.interrupt?t:h):fe(g)?(e.consume(g),s=String.fromCharCode(g),S):n(g)}function m(g){return g===45?(e.consume(g),i=2,p):g===91?(e.consume(g),i=5,a=0,f):fe(g)?(e.consume(g),i=4,r.interrupt?t:h):n(g)}function p(g){return g===45?(e.consume(g),r.interrupt?t:h):n(g)}function f(g){let Ge="CDATA[";return g===Ge.charCodeAt(a++)?(e.consume(g),a===Ge.length?r.interrupt?t:F:f):n(g)}function x(g){return fe(g)?(e.consume(g),s=String.fromCharCode(g),S):n(g)}function S(g){if(g===null||g===47||g===62||q(g)){let Ge=g===47,Fn=s.toLowerCase();return!Ge&&!o&&vl.includes(Fn)?(i=1,r.interrupt?t(g):F(g)):Tp.includes(s.toLowerCase())?(i=6,Ge?(e.consume(g),w):r.interrupt?t(g):F(g)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(g):o?D(g):T(g))}return g===45||he(g)?(e.consume(g),s+=String.fromCharCode(g),S):n(g)}function w(g){return g===62?(e.consume(g),r.interrupt?t:F):n(g)}function D(g){return L(g)?(e.consume(g),D):y(g)}function T(g){return g===47?(e.consume(g),y):g===58||g===95||fe(g)?(e.consume(g),R):L(g)?(e.consume(g),T):y(g)}function R(g){return g===45||g===46||g===58||g===95||he(g)?(e.consume(g),R):O(g)}function O(g){return g===61?(e.consume(g),b):L(g)?(e.consume(g),O):T(g)}function b(g){return g===null||g===60||g===61||g===62||g===96?n(g):g===34||g===39?(e.consume(g),l=g,E):L(g)?(e.consume(g),b):M(g)}function E(g){return g===l?(e.consume(g),l=null,C):g===null||_(g)?n(g):(e.consume(g),E)}function M(g){return g===null||g===34||g===39||g===47||g===60||g===61||g===62||g===96||q(g)?O(g):(e.consume(g),M)}function C(g){return g===47||g===62||L(g)?T(g):n(g)}function y(g){return g===62?(e.consume(g),Z):n(g)}function Z(g){return g===null||_(g)?F(g):L(g)?(e.consume(g),Z):n(g)}function F(g){return g===45&&i===2?(e.consume(g),te):g===60&&i===1?(e.consume(g),oe):g===62&&i===4?(e.consume(g),Qe):g===63&&i===3?(e.consume(g),h):g===93&&i===5?(e.consume(g),J):_(g)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(xk,$t,A)(g)):g===null||_(g)?(e.exit("htmlFlowData"),A(g)):(e.consume(g),F)}function A(g){return e.check(bk,N,$t)(g)}function N(g){return e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),U}function U(g){return g===null||_(g)?A(g):(e.enter("htmlFlowData"),F(g))}function te(g){return g===45?(e.consume(g),h):F(g)}function oe(g){return g===47?(e.consume(g),s="",Ne):F(g)}function Ne(g){if(g===62){let Ge=s.toLowerCase();return vl.includes(Ge)?(e.consume(g),Qe):F(g)}return fe(g)&&s.length<8?(e.consume(g),s+=String.fromCharCode(g),Ne):F(g)}function J(g){return g===93?(e.consume(g),h):F(g)}function h(g){return g===62?(e.consume(g),Qe):g===45&&i===2?(e.consume(g),h):F(g)}function Qe(g){return g===null||_(g)?(e.exit("htmlFlowData"),$t(g)):(e.consume(g),Qe)}function $t(g){return e.exit("htmlFlow"),t(g)}}function Tk(e,t,n){let r=this;return i;function i(s){return _(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),o):n(s)}function o(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}function Ek(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(Et,t,n)}}var Ml={name:"htmlText",tokenize:Ck};function Ck(e,t,n){let r=this,i,o,s;return a;function a(h){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(h),l}function l(h){return h===33?(e.consume(h),u):h===47?(e.consume(h),O):h===63?(e.consume(h),T):fe(h)?(e.consume(h),M):n(h)}function u(h){return h===45?(e.consume(h),d):h===91?(e.consume(h),o=0,f):fe(h)?(e.consume(h),D):n(h)}function d(h){return h===45?(e.consume(h),p):n(h)}function c(h){return h===null?n(h):h===45?(e.consume(h),m):_(h)?(s=c,oe(h)):(e.consume(h),c)}function m(h){return h===45?(e.consume(h),p):c(h)}function p(h){return h===62?te(h):h===45?m(h):c(h)}function f(h){let Qe="CDATA[";return h===Qe.charCodeAt(o++)?(e.consume(h),o===Qe.length?x:f):n(h)}function x(h){return h===null?n(h):h===93?(e.consume(h),S):_(h)?(s=x,oe(h)):(e.consume(h),x)}function S(h){return h===93?(e.consume(h),w):x(h)}function w(h){return h===62?te(h):h===93?(e.consume(h),w):x(h)}function D(h){return h===null||h===62?te(h):_(h)?(s=D,oe(h)):(e.consume(h),D)}function T(h){return h===null?n(h):h===63?(e.consume(h),R):_(h)?(s=T,oe(h)):(e.consume(h),T)}function R(h){return h===62?te(h):T(h)}function O(h){return fe(h)?(e.consume(h),b):n(h)}function b(h){return h===45||he(h)?(e.consume(h),b):E(h)}function E(h){return _(h)?(s=E,oe(h)):L(h)?(e.consume(h),E):te(h)}function M(h){return h===45||he(h)?(e.consume(h),M):h===47||h===62||q(h)?C(h):n(h)}function C(h){return h===47?(e.consume(h),te):h===58||h===95||fe(h)?(e.consume(h),y):_(h)?(s=C,oe(h)):L(h)?(e.consume(h),C):te(h)}function y(h){return h===45||h===46||h===58||h===95||he(h)?(e.consume(h),y):Z(h)}function Z(h){return h===61?(e.consume(h),F):_(h)?(s=Z,oe(h)):L(h)?(e.consume(h),Z):C(h)}function F(h){return h===null||h===60||h===61||h===62||h===96?n(h):h===34||h===39?(e.consume(h),i=h,A):_(h)?(s=F,oe(h)):L(h)?(e.consume(h),F):(e.consume(h),N)}function A(h){return h===i?(e.consume(h),i=void 0,U):h===null?n(h):_(h)?(s=A,oe(h)):(e.consume(h),A)}function N(h){return h===null||h===34||h===39||h===60||h===61||h===96?n(h):h===47||h===62||q(h)?C(h):(e.consume(h),N)}function U(h){return h===47||h===62||q(h)?C(h):n(h)}function te(h){return h===62?(e.consume(h),e.exit("htmlTextData"),e.exit("htmlText"),t):n(h)}function oe(h){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),Ne}function Ne(h){return L(h)?P(e,J,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(h):J(h)}function J(h){return e.enter("htmlTextData"),s(h)}}var Yn={name:"labelEnd",resolveAll:Ok,resolveTo:Dk,tokenize:vk},Ik={tokenize:Rk},_k={tokenize:Mk},Ak={tokenize:Nk};function Ok(e){let t=-1,n=[];for(;++t<e.length;){let r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){let i=r.type==="labelImage"?4:2;r.type="data",t+=i}}return e.length!==n.length&&me(e,0,e.length,n),e}function Dk(e,t){let n=e.length,r=0,i,o,s,a;for(;n--;)if(i=e[n][1],o){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(s){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(o=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(s=n);let l={type:e[o][1].type==="labelLink"?"link":"image",start:{...e[o][1].start},end:{...e[e.length-1][1].end}},u={type:"label",start:{...e[o][1].start},end:{...e[s][1].end}},d={type:"labelText",start:{...e[o+r+2][1].end},end:{...e[s-2][1].start}};return a=[["enter",l,t],["enter",u,t]],a=Le(a,e.slice(o+1,o+r+3)),a=Le(a,[["enter",d,t]]),a=Le(a,fn(t.parser.constructs.insideSpan.null,e.slice(o+r+4,s-3),t)),a=Le(a,[["exit",d,t],e[s-2],e[s-1],["exit",u,t]]),a=Le(a,e.slice(s+1)),a=Le(a,[["exit",l,t]]),me(e,o,e.length,a),e}function vk(e,t,n){let r=this,i=r.events.length,o,s;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){o=r.events[i][1];break}return a;function a(m){return o?o._inactive?c(m):(s=r.parser.defined.includes(Oe(r.sliceSerialize({start:o.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(m),e.exit("labelMarker"),e.exit("labelEnd"),l):n(m)}function l(m){return m===40?e.attempt(Ik,d,s?d:c)(m):m===91?e.attempt(_k,d,s?u:c)(m):s?d(m):c(m)}function u(m){return e.attempt(Ak,d,c)(m)}function d(m){return t(m)}function c(m){return o._balanced=!0,n(m)}}function Rk(e,t,n){return r;function r(c){return e.enter("resource"),e.enter("resourceMarker"),e.consume(c),e.exit("resourceMarker"),i}function i(c){return q(c)?Vn(e,o)(c):o(c)}function o(c){return c===41?d(c):As(e,s,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(c)}function s(c){return q(c)?Vn(e,l)(c):d(c)}function a(c){return n(c)}function l(c){return c===34||c===39||c===40?Ds(e,u,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(c):d(c)}function u(c){return q(c)?Vn(e,d)(c):d(c)}function d(c){return c===41?(e.enter("resourceMarker"),e.consume(c),e.exit("resourceMarker"),e.exit("resource"),t):n(c)}}function Mk(e,t,n){let r=this;return i;function i(a){return Os.call(r,e,o,s,"reference","referenceMarker","referenceString")(a)}function o(a){return r.parser.defined.includes(Oe(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(a):n(a)}function s(a){return n(a)}}function Nk(e,t,n){return r;function r(o){return e.enter("reference"),e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),i}function i(o){return o===93?(e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),e.exit("reference"),t):n(o)}}var Nl={name:"labelStartImage",resolveAll:Yn.resolveAll,tokenize:Pk};function Pk(e,t,n){let r=this;return i;function i(a){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(a),e.exit("labelImageMarker"),o}function o(a){return a===91?(e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelImage"),s):n(a)}function s(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):t(a)}}var Pl={name:"labelStartLink",resolveAll:Yn.resolveAll,tokenize:Lk};function Lk(e,t,n){let r=this;return i;function i(s){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(s),e.exit("labelMarker"),e.exit("labelLink"),o}function o(s){return s===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(s):t(s)}}var Mi={name:"lineEnding",tokenize:Fk};function Fk(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),P(e,t,"linePrefix")}}var Zn={name:"thematicBreak",tokenize:$k};function $k(e,t,n){let r=0,i;return o;function o(u){return e.enter("thematicBreak"),s(u)}function s(u){return i=u,a(u)}function a(u){return u===i?(e.enter("thematicBreakSequence"),l(u)):r>=3&&(u===null||_(u))?(e.exit("thematicBreak"),t(u)):n(u)}function l(u){return u===i?(e.consume(u),r++,l):(e.exit("thematicBreakSequence"),L(u)?P(e,a,"whitespace")(u):a(u))}}var De={continuation:{tokenize:qk},exit:Hk,name:"list",tokenize:Bk},Uk={partial:!0,tokenize:Wk},zk={partial:!0,tokenize:jk};function Bk(e,t,n){let r=this,i=r.events[r.events.length-1],o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,s=0;return a;function a(p){let f=r.containerState.type||(p===42||p===43||p===45?"listUnordered":"listOrdered");if(f==="listUnordered"?!r.containerState.marker||p===r.containerState.marker:Oi(p)){if(r.containerState.type||(r.containerState.type=f,e.enter(f,{_container:!0})),f==="listUnordered")return e.enter("listItemPrefix"),p===42||p===45?e.check(Zn,n,u)(p):u(p);if(!r.interrupt||p===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(p)}return n(p)}function l(p){return Oi(p)&&++s<10?(e.consume(p),l):(!r.interrupt||s<2)&&(r.containerState.marker?p===r.containerState.marker:p===41||p===46)?(e.exit("listItemValue"),u(p)):n(p)}function u(p){return e.enter("listItemMarker"),e.consume(p),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||p,e.check(Et,r.interrupt?n:d,e.attempt(Uk,m,c))}function d(p){return r.containerState.initialBlankLine=!0,o++,m(p)}function c(p){return L(p)?(e.enter("listItemPrefixWhitespace"),e.consume(p),e.exit("listItemPrefixWhitespace"),m):n(p)}function m(p){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(p)}}function qk(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(Et,i,o);function i(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,P(e,t,"listItemIndent",r.containerState.size+1)(a)}function o(a){return r.containerState.furtherBlankLines||!L(a)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,s(a)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(zk,t,s)(a))}function s(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,P(e,e.attempt(De,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function jk(e,t,n){let r=this;return P(e,i,"listItemIndent",r.containerState.size+1);function i(o){let s=r.events[r.events.length-1];return s&&s[1].type==="listItemIndent"&&s[2].sliceSerialize(s[1],!0).length===r.containerState.size?t(o):n(o)}}function Hk(e){e.exit(this.containerState.type)}function Wk(e,t,n){let r=this;return P(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(o){let s=r.events[r.events.length-1];return!L(o)&&s&&s[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}var vs={name:"setextUnderline",resolveTo:Gk,tokenize:Vk};function Gk(e,t){let n=e.length,r,i,o;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!o&&e[n][1].type==="definition"&&(o=n);let s={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",o?(e.splice(i,0,["enter",s,t]),e.splice(o+1,0,["exit",e[r][1],t]),e[r][1].end={...e[o][1].end}):e[r][1]=s,e.push(["exit",s,t]),e}function Vk(e,t,n){let r=this,i;return o;function o(u){let d=r.events.length,c;for(;d--;)if(r.events[d][1].type!=="lineEnding"&&r.events[d][1].type!=="linePrefix"&&r.events[d][1].type!=="content"){c=r.events[d][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||c)?(e.enter("setextHeadingLine"),i=u,s(u)):n(u)}function s(u){return e.enter("setextHeadingLineSequence"),a(u)}function a(u){return u===i?(e.consume(u),a):(e.exit("setextHeadingLineSequence"),L(u)?P(e,l,"lineSuffix")(u):l(u))}function l(u){return u===null||_(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}var Ep={tokenize:Yk};function Yk(e){let t=this,n=e.attempt(Et,r,e.attempt(this.parser.constructs.flowInitial,i,P(e,e.attempt(this.parser.constructs.flow,i,e.attempt(_l,i)),"linePrefix")));return n;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,n}}var Cp={resolveAll:Op()},Ip=Ap("string"),_p=Ap("text");function Ap(e){return{resolveAll:Op(e==="text"?Zk:void 0),tokenize:t};function t(n){let r=this,i=this.parser.constructs[e],o=n.attempt(i,s,a);return s;function s(d){return u(d)?o(d):a(d)}function a(d){if(d===null){n.consume(d);return}return n.enter("data"),n.consume(d),l}function l(d){return u(d)?(n.exit("data"),o(d)):(n.consume(d),l)}function u(d){if(d===null)return!0;let c=i[d],m=-1;if(c)for(;++m<c.length;){let p=c[m];if(!p.previous||p.previous.call(r,r.previous))return!0}return!1}}}function Op(e){return t;function t(n,r){let i=-1,o;for(;++i<=n.length;)o===void 0?n[i]&&n[i][1].type==="data"&&(o=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==o+2&&(n[o][1].end=n[i-1][1].end,n.splice(o+2,i-o-2),i=o+2),o=void 0);return e?e(n,r):n}}function Zk(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){let r=e[n-1][1],i=t.sliceStream(r),o=i.length,s=-1,a=0,l;for(;o--;){let u=i[o];if(typeof u=="string"){for(s=u.length;u.charCodeAt(s-1)===32;)a++,s--;if(s)break;s=-1}else if(u===-2)l=!0,a++;else if(u!==-1){o++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(a=0),a){let u={type:n===e.length||l||a<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?s:r.start._bufferIndex+s,_index:r.start._index+o,line:r.end.line,column:r.end.column-a,offset:r.end.offset-a},end:{...r.end}};r.end={...u.start},r.start.offset===r.end.offset?Object.assign(r,u):(e.splice(n,0,["enter",u,t],["exit",u,t]),n+=2)}n++}return e}var Ll={};Vd(Ll,{attentionMarkers:()=>r0,contentInitial:()=>Jk,disable:()=>i0,document:()=>Kk,flow:()=>Qk,flowInitial:()=>Xk,insideSpan:()=>n0,string:()=>e0,text:()=>t0});var Kk={42:De,43:De,45:De,48:De,49:De,50:De,51:De,52:De,53:De,54:De,55:De,56:De,57:De,62:Ss},Jk={91:Al},Xk={[-2]:vi,[-1]:vi,32:vi},Qk={35:Dl,42:Zn,45:[vs,Zn],60:Rl,61:vs,95:Zn,96:Cs,126:Cs},e0={38:Es,92:Ts},t0={[-5]:Mi,[-4]:Mi,[-3]:Mi,33:Nl,38:Es,42:Di,60:[Cl,Ml],91:Pl,92:[Ol,Ts],93:Yn,95:Di,96:Il},n0={null:[Di,Cp]},r0={null:[42,95]},i0={null:[]};function Dp(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},i={},o=[],s=[],a=[],l=!0,u={attempt:C(E),check:C(M),consume:R,enter:O,exit:b,interrupt:C(M,{interrupt:!0})},d={code:null,containerState:{},defineSkip:w,events:[],now:S,parser:e,previous:null,sliceSerialize:f,sliceStream:x,write:p},c=t.tokenize.call(d,u),m;return t.resolveAll&&o.push(t),d;function p(A){return s=Le(s,A),D(),s[s.length-1]!==null?[]:(y(t,0),d.events=fn(o,d.events,d),d.events)}function f(A,N){return s0(x(A),N)}function x(A){return o0(s,A)}function S(){let{_bufferIndex:A,_index:N,line:U,column:te,offset:oe}=r;return{_bufferIndex:A,_index:N,line:U,column:te,offset:oe}}function w(A){i[A.line]=A.column,F()}function D(){let A;for(;r._index<s.length;){let N=s[r._index];if(typeof N=="string")for(A=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===A&&r._bufferIndex<N.length;)T(N.charCodeAt(r._bufferIndex));else T(N)}}function T(A){l=void 0,m=A,c=c(A)}function R(A){_(A)?(r.line++,r.column=1,r.offset+=A===-3?2:1,F()):A!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===s[r._index].length&&(r._bufferIndex=-1,r._index++)),d.previous=A,l=!0}function O(A,N){let U=N||{};return U.type=A,U.start=S(),d.events.push(["enter",U,d]),a.push(U),U}function b(A){let N=a.pop();return N.end=S(),d.events.push(["exit",N,d]),N}function E(A,N){y(A,N.from)}function M(A,N){N.restore()}function C(A,N){return U;function U(te,oe,Ne){let J,h,Qe,$t;return Array.isArray(te)?Ge(te):"tokenize"in te?Ge([te]):g(te);function g(Ee){return hi;function hi(Ut){let $n=Ut!==null&&Ee[Ut],Sr=Ut!==null&&Ee.null,za=[...Array.isArray($n)?$n:$n?[$n]:[],...Array.isArray(Sr)?Sr:Sr?[Sr]:[]];return Ge(za)(Ut)}}function Ge(Ee){return J=Ee,h=0,Ee.length===0?Ne:Fn(Ee[h])}function Fn(Ee){return hi;function hi(Ut){return $t=Z(),Qe=Ee,Ee.partial||(d.currentConstruct=Ee),Ee.name&&d.parser.constructs.disable.null.includes(Ee.name)?Xo(Ut):Ee.tokenize.call(N?Object.assign(Object.create(d),N):d,u,Ua,Xo)(Ut)}}function Ua(Ee){return l=!0,A(Qe,$t),oe}function Xo(Ee){return l=!0,$t.restore(),++h<J.length?Fn(J[h]):Ne}}}function y(A,N){A.resolveAll&&!o.includes(A)&&o.push(A),A.resolve&&me(d.events,N,d.events.length-N,A.resolve(d.events.slice(N),d)),A.resolveTo&&(d.events=A.resolveTo(d.events,d))}function Z(){let A=S(),N=d.previous,U=d.currentConstruct,te=d.events.length,oe=Array.from(a);return{from:te,restore:Ne};function Ne(){r=A,d.previous=N,d.currentConstruct=U,d.events.length=te,a=oe,F()}}function F(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function o0(e,t){let n=t.start._index,r=t.start._bufferIndex,i=t.end._index,o=t.end._bufferIndex,s;if(n===i)s=[e[n].slice(r,o)];else{if(s=e.slice(n,i),r>-1){let a=s[0];typeof a=="string"?s[0]=a.slice(r):s.shift()}o>0&&s.push(e[i].slice(0,o))}return s}function s0(e,t){let n=-1,r=[],i;for(;++n<e.length;){let o=e[n],s;if(typeof o=="string")s=o;else switch(o){case-5:{s="\r";break}case-4:{s=`
|
|
55
|
+
`);return}let r;try{let a=await fetch(new Request(fp,{signal:AbortSignal.timeout(3e4)}));if(!a.ok)throw new Error(`HTTP ${a.status}`);r=await a.text()}catch{throw new $("network_error",`Could not download Ripple's installer from ${fp}. Check your network connection.`)}let i=!!e.opts().json,o="";if(await new Promise((a,l)=>{let u=Ub("sh",[],{env:{...t.env,RIPPLE_INSTALL_DIR:Ol.dirname(Al(process.execPath))},stdio:["pipe",i?"ignore":"inherit",i?"pipe":"inherit"]});u.stderr?.on("data",d=>{o+=d.toString()}),u.on("error",l),u.on("close",a),u.stdin.end(r)})!==0)throw new $("update_failed",/^Error: (.+)$/m.exec(o)?.[1]??"Ripple wasn't updated.");t.print({installedWith:n},()=>"")})}import{writeFile as iC}from"node:fs/promises";var Dl={AElig:"\xC6",AMP:"&",Aacute:"\xC1",Abreve:"\u0102",Acirc:"\xC2",Acy:"\u0410",Afr:"\u{1D504}",Agrave:"\xC0",Alpha:"\u0391",Amacr:"\u0100",And:"\u2A53",Aogon:"\u0104",Aopf:"\u{1D538}",ApplyFunction:"\u2061",Aring:"\xC5",Ascr:"\u{1D49C}",Assign:"\u2254",Atilde:"\xC3",Auml:"\xC4",Backslash:"\u2216",Barv:"\u2AE7",Barwed:"\u2306",Bcy:"\u0411",Because:"\u2235",Bernoullis:"\u212C",Beta:"\u0392",Bfr:"\u{1D505}",Bopf:"\u{1D539}",Breve:"\u02D8",Bscr:"\u212C",Bumpeq:"\u224E",CHcy:"\u0427",COPY:"\xA9",Cacute:"\u0106",Cap:"\u22D2",CapitalDifferentialD:"\u2145",Cayleys:"\u212D",Ccaron:"\u010C",Ccedil:"\xC7",Ccirc:"\u0108",Cconint:"\u2230",Cdot:"\u010A",Cedilla:"\xB8",CenterDot:"\xB7",Cfr:"\u212D",Chi:"\u03A7",CircleDot:"\u2299",CircleMinus:"\u2296",CirclePlus:"\u2295",CircleTimes:"\u2297",ClockwiseContourIntegral:"\u2232",CloseCurlyDoubleQuote:"\u201D",CloseCurlyQuote:"\u2019",Colon:"\u2237",Colone:"\u2A74",Congruent:"\u2261",Conint:"\u222F",ContourIntegral:"\u222E",Copf:"\u2102",Coproduct:"\u2210",CounterClockwiseContourIntegral:"\u2233",Cross:"\u2A2F",Cscr:"\u{1D49E}",Cup:"\u22D3",CupCap:"\u224D",DD:"\u2145",DDotrahd:"\u2911",DJcy:"\u0402",DScy:"\u0405",DZcy:"\u040F",Dagger:"\u2021",Darr:"\u21A1",Dashv:"\u2AE4",Dcaron:"\u010E",Dcy:"\u0414",Del:"\u2207",Delta:"\u0394",Dfr:"\u{1D507}",DiacriticalAcute:"\xB4",DiacriticalDot:"\u02D9",DiacriticalDoubleAcute:"\u02DD",DiacriticalGrave:"`",DiacriticalTilde:"\u02DC",Diamond:"\u22C4",DifferentialD:"\u2146",Dopf:"\u{1D53B}",Dot:"\xA8",DotDot:"\u20DC",DotEqual:"\u2250",DoubleContourIntegral:"\u222F",DoubleDot:"\xA8",DoubleDownArrow:"\u21D3",DoubleLeftArrow:"\u21D0",DoubleLeftRightArrow:"\u21D4",DoubleLeftTee:"\u2AE4",DoubleLongLeftArrow:"\u27F8",DoubleLongLeftRightArrow:"\u27FA",DoubleLongRightArrow:"\u27F9",DoubleRightArrow:"\u21D2",DoubleRightTee:"\u22A8",DoubleUpArrow:"\u21D1",DoubleUpDownArrow:"\u21D5",DoubleVerticalBar:"\u2225",DownArrow:"\u2193",DownArrowBar:"\u2913",DownArrowUpArrow:"\u21F5",DownBreve:"\u0311",DownLeftRightVector:"\u2950",DownLeftTeeVector:"\u295E",DownLeftVector:"\u21BD",DownLeftVectorBar:"\u2956",DownRightTeeVector:"\u295F",DownRightVector:"\u21C1",DownRightVectorBar:"\u2957",DownTee:"\u22A4",DownTeeArrow:"\u21A7",Downarrow:"\u21D3",Dscr:"\u{1D49F}",Dstrok:"\u0110",ENG:"\u014A",ETH:"\xD0",Eacute:"\xC9",Ecaron:"\u011A",Ecirc:"\xCA",Ecy:"\u042D",Edot:"\u0116",Efr:"\u{1D508}",Egrave:"\xC8",Element:"\u2208",Emacr:"\u0112",EmptySmallSquare:"\u25FB",EmptyVerySmallSquare:"\u25AB",Eogon:"\u0118",Eopf:"\u{1D53C}",Epsilon:"\u0395",Equal:"\u2A75",EqualTilde:"\u2242",Equilibrium:"\u21CC",Escr:"\u2130",Esim:"\u2A73",Eta:"\u0397",Euml:"\xCB",Exists:"\u2203",ExponentialE:"\u2147",Fcy:"\u0424",Ffr:"\u{1D509}",FilledSmallSquare:"\u25FC",FilledVerySmallSquare:"\u25AA",Fopf:"\u{1D53D}",ForAll:"\u2200",Fouriertrf:"\u2131",Fscr:"\u2131",GJcy:"\u0403",GT:">",Gamma:"\u0393",Gammad:"\u03DC",Gbreve:"\u011E",Gcedil:"\u0122",Gcirc:"\u011C",Gcy:"\u0413",Gdot:"\u0120",Gfr:"\u{1D50A}",Gg:"\u22D9",Gopf:"\u{1D53E}",GreaterEqual:"\u2265",GreaterEqualLess:"\u22DB",GreaterFullEqual:"\u2267",GreaterGreater:"\u2AA2",GreaterLess:"\u2277",GreaterSlantEqual:"\u2A7E",GreaterTilde:"\u2273",Gscr:"\u{1D4A2}",Gt:"\u226B",HARDcy:"\u042A",Hacek:"\u02C7",Hat:"^",Hcirc:"\u0124",Hfr:"\u210C",HilbertSpace:"\u210B",Hopf:"\u210D",HorizontalLine:"\u2500",Hscr:"\u210B",Hstrok:"\u0126",HumpDownHump:"\u224E",HumpEqual:"\u224F",IEcy:"\u0415",IJlig:"\u0132",IOcy:"\u0401",Iacute:"\xCD",Icirc:"\xCE",Icy:"\u0418",Idot:"\u0130",Ifr:"\u2111",Igrave:"\xCC",Im:"\u2111",Imacr:"\u012A",ImaginaryI:"\u2148",Implies:"\u21D2",Int:"\u222C",Integral:"\u222B",Intersection:"\u22C2",InvisibleComma:"\u2063",InvisibleTimes:"\u2062",Iogon:"\u012E",Iopf:"\u{1D540}",Iota:"\u0399",Iscr:"\u2110",Itilde:"\u0128",Iukcy:"\u0406",Iuml:"\xCF",Jcirc:"\u0134",Jcy:"\u0419",Jfr:"\u{1D50D}",Jopf:"\u{1D541}",Jscr:"\u{1D4A5}",Jsercy:"\u0408",Jukcy:"\u0404",KHcy:"\u0425",KJcy:"\u040C",Kappa:"\u039A",Kcedil:"\u0136",Kcy:"\u041A",Kfr:"\u{1D50E}",Kopf:"\u{1D542}",Kscr:"\u{1D4A6}",LJcy:"\u0409",LT:"<",Lacute:"\u0139",Lambda:"\u039B",Lang:"\u27EA",Laplacetrf:"\u2112",Larr:"\u219E",Lcaron:"\u013D",Lcedil:"\u013B",Lcy:"\u041B",LeftAngleBracket:"\u27E8",LeftArrow:"\u2190",LeftArrowBar:"\u21E4",LeftArrowRightArrow:"\u21C6",LeftCeiling:"\u2308",LeftDoubleBracket:"\u27E6",LeftDownTeeVector:"\u2961",LeftDownVector:"\u21C3",LeftDownVectorBar:"\u2959",LeftFloor:"\u230A",LeftRightArrow:"\u2194",LeftRightVector:"\u294E",LeftTee:"\u22A3",LeftTeeArrow:"\u21A4",LeftTeeVector:"\u295A",LeftTriangle:"\u22B2",LeftTriangleBar:"\u29CF",LeftTriangleEqual:"\u22B4",LeftUpDownVector:"\u2951",LeftUpTeeVector:"\u2960",LeftUpVector:"\u21BF",LeftUpVectorBar:"\u2958",LeftVector:"\u21BC",LeftVectorBar:"\u2952",Leftarrow:"\u21D0",Leftrightarrow:"\u21D4",LessEqualGreater:"\u22DA",LessFullEqual:"\u2266",LessGreater:"\u2276",LessLess:"\u2AA1",LessSlantEqual:"\u2A7D",LessTilde:"\u2272",Lfr:"\u{1D50F}",Ll:"\u22D8",Lleftarrow:"\u21DA",Lmidot:"\u013F",LongLeftArrow:"\u27F5",LongLeftRightArrow:"\u27F7",LongRightArrow:"\u27F6",Longleftarrow:"\u27F8",Longleftrightarrow:"\u27FA",Longrightarrow:"\u27F9",Lopf:"\u{1D543}",LowerLeftArrow:"\u2199",LowerRightArrow:"\u2198",Lscr:"\u2112",Lsh:"\u21B0",Lstrok:"\u0141",Lt:"\u226A",Map:"\u2905",Mcy:"\u041C",MediumSpace:"\u205F",Mellintrf:"\u2133",Mfr:"\u{1D510}",MinusPlus:"\u2213",Mopf:"\u{1D544}",Mscr:"\u2133",Mu:"\u039C",NJcy:"\u040A",Nacute:"\u0143",Ncaron:"\u0147",Ncedil:"\u0145",Ncy:"\u041D",NegativeMediumSpace:"\u200B",NegativeThickSpace:"\u200B",NegativeThinSpace:"\u200B",NegativeVeryThinSpace:"\u200B",NestedGreaterGreater:"\u226B",NestedLessLess:"\u226A",NewLine:`
|
|
56
|
+
`,Nfr:"\u{1D511}",NoBreak:"\u2060",NonBreakingSpace:"\xA0",Nopf:"\u2115",Not:"\u2AEC",NotCongruent:"\u2262",NotCupCap:"\u226D",NotDoubleVerticalBar:"\u2226",NotElement:"\u2209",NotEqual:"\u2260",NotEqualTilde:"\u2242\u0338",NotExists:"\u2204",NotGreater:"\u226F",NotGreaterEqual:"\u2271",NotGreaterFullEqual:"\u2267\u0338",NotGreaterGreater:"\u226B\u0338",NotGreaterLess:"\u2279",NotGreaterSlantEqual:"\u2A7E\u0338",NotGreaterTilde:"\u2275",NotHumpDownHump:"\u224E\u0338",NotHumpEqual:"\u224F\u0338",NotLeftTriangle:"\u22EA",NotLeftTriangleBar:"\u29CF\u0338",NotLeftTriangleEqual:"\u22EC",NotLess:"\u226E",NotLessEqual:"\u2270",NotLessGreater:"\u2278",NotLessLess:"\u226A\u0338",NotLessSlantEqual:"\u2A7D\u0338",NotLessTilde:"\u2274",NotNestedGreaterGreater:"\u2AA2\u0338",NotNestedLessLess:"\u2AA1\u0338",NotPrecedes:"\u2280",NotPrecedesEqual:"\u2AAF\u0338",NotPrecedesSlantEqual:"\u22E0",NotReverseElement:"\u220C",NotRightTriangle:"\u22EB",NotRightTriangleBar:"\u29D0\u0338",NotRightTriangleEqual:"\u22ED",NotSquareSubset:"\u228F\u0338",NotSquareSubsetEqual:"\u22E2",NotSquareSuperset:"\u2290\u0338",NotSquareSupersetEqual:"\u22E3",NotSubset:"\u2282\u20D2",NotSubsetEqual:"\u2288",NotSucceeds:"\u2281",NotSucceedsEqual:"\u2AB0\u0338",NotSucceedsSlantEqual:"\u22E1",NotSucceedsTilde:"\u227F\u0338",NotSuperset:"\u2283\u20D2",NotSupersetEqual:"\u2289",NotTilde:"\u2241",NotTildeEqual:"\u2244",NotTildeFullEqual:"\u2247",NotTildeTilde:"\u2249",NotVerticalBar:"\u2224",Nscr:"\u{1D4A9}",Ntilde:"\xD1",Nu:"\u039D",OElig:"\u0152",Oacute:"\xD3",Ocirc:"\xD4",Ocy:"\u041E",Odblac:"\u0150",Ofr:"\u{1D512}",Ograve:"\xD2",Omacr:"\u014C",Omega:"\u03A9",Omicron:"\u039F",Oopf:"\u{1D546}",OpenCurlyDoubleQuote:"\u201C",OpenCurlyQuote:"\u2018",Or:"\u2A54",Oscr:"\u{1D4AA}",Oslash:"\xD8",Otilde:"\xD5",Otimes:"\u2A37",Ouml:"\xD6",OverBar:"\u203E",OverBrace:"\u23DE",OverBracket:"\u23B4",OverParenthesis:"\u23DC",PartialD:"\u2202",Pcy:"\u041F",Pfr:"\u{1D513}",Phi:"\u03A6",Pi:"\u03A0",PlusMinus:"\xB1",Poincareplane:"\u210C",Popf:"\u2119",Pr:"\u2ABB",Precedes:"\u227A",PrecedesEqual:"\u2AAF",PrecedesSlantEqual:"\u227C",PrecedesTilde:"\u227E",Prime:"\u2033",Product:"\u220F",Proportion:"\u2237",Proportional:"\u221D",Pscr:"\u{1D4AB}",Psi:"\u03A8",QUOT:'"',Qfr:"\u{1D514}",Qopf:"\u211A",Qscr:"\u{1D4AC}",RBarr:"\u2910",REG:"\xAE",Racute:"\u0154",Rang:"\u27EB",Rarr:"\u21A0",Rarrtl:"\u2916",Rcaron:"\u0158",Rcedil:"\u0156",Rcy:"\u0420",Re:"\u211C",ReverseElement:"\u220B",ReverseEquilibrium:"\u21CB",ReverseUpEquilibrium:"\u296F",Rfr:"\u211C",Rho:"\u03A1",RightAngleBracket:"\u27E9",RightArrow:"\u2192",RightArrowBar:"\u21E5",RightArrowLeftArrow:"\u21C4",RightCeiling:"\u2309",RightDoubleBracket:"\u27E7",RightDownTeeVector:"\u295D",RightDownVector:"\u21C2",RightDownVectorBar:"\u2955",RightFloor:"\u230B",RightTee:"\u22A2",RightTeeArrow:"\u21A6",RightTeeVector:"\u295B",RightTriangle:"\u22B3",RightTriangleBar:"\u29D0",RightTriangleEqual:"\u22B5",RightUpDownVector:"\u294F",RightUpTeeVector:"\u295C",RightUpVector:"\u21BE",RightUpVectorBar:"\u2954",RightVector:"\u21C0",RightVectorBar:"\u2953",Rightarrow:"\u21D2",Ropf:"\u211D",RoundImplies:"\u2970",Rrightarrow:"\u21DB",Rscr:"\u211B",Rsh:"\u21B1",RuleDelayed:"\u29F4",SHCHcy:"\u0429",SHcy:"\u0428",SOFTcy:"\u042C",Sacute:"\u015A",Sc:"\u2ABC",Scaron:"\u0160",Scedil:"\u015E",Scirc:"\u015C",Scy:"\u0421",Sfr:"\u{1D516}",ShortDownArrow:"\u2193",ShortLeftArrow:"\u2190",ShortRightArrow:"\u2192",ShortUpArrow:"\u2191",Sigma:"\u03A3",SmallCircle:"\u2218",Sopf:"\u{1D54A}",Sqrt:"\u221A",Square:"\u25A1",SquareIntersection:"\u2293",SquareSubset:"\u228F",SquareSubsetEqual:"\u2291",SquareSuperset:"\u2290",SquareSupersetEqual:"\u2292",SquareUnion:"\u2294",Sscr:"\u{1D4AE}",Star:"\u22C6",Sub:"\u22D0",Subset:"\u22D0",SubsetEqual:"\u2286",Succeeds:"\u227B",SucceedsEqual:"\u2AB0",SucceedsSlantEqual:"\u227D",SucceedsTilde:"\u227F",SuchThat:"\u220B",Sum:"\u2211",Sup:"\u22D1",Superset:"\u2283",SupersetEqual:"\u2287",Supset:"\u22D1",THORN:"\xDE",TRADE:"\u2122",TSHcy:"\u040B",TScy:"\u0426",Tab:" ",Tau:"\u03A4",Tcaron:"\u0164",Tcedil:"\u0162",Tcy:"\u0422",Tfr:"\u{1D517}",Therefore:"\u2234",Theta:"\u0398",ThickSpace:"\u205F\u200A",ThinSpace:"\u2009",Tilde:"\u223C",TildeEqual:"\u2243",TildeFullEqual:"\u2245",TildeTilde:"\u2248",Topf:"\u{1D54B}",TripleDot:"\u20DB",Tscr:"\u{1D4AF}",Tstrok:"\u0166",Uacute:"\xDA",Uarr:"\u219F",Uarrocir:"\u2949",Ubrcy:"\u040E",Ubreve:"\u016C",Ucirc:"\xDB",Ucy:"\u0423",Udblac:"\u0170",Ufr:"\u{1D518}",Ugrave:"\xD9",Umacr:"\u016A",UnderBar:"_",UnderBrace:"\u23DF",UnderBracket:"\u23B5",UnderParenthesis:"\u23DD",Union:"\u22C3",UnionPlus:"\u228E",Uogon:"\u0172",Uopf:"\u{1D54C}",UpArrow:"\u2191",UpArrowBar:"\u2912",UpArrowDownArrow:"\u21C5",UpDownArrow:"\u2195",UpEquilibrium:"\u296E",UpTee:"\u22A5",UpTeeArrow:"\u21A5",Uparrow:"\u21D1",Updownarrow:"\u21D5",UpperLeftArrow:"\u2196",UpperRightArrow:"\u2197",Upsi:"\u03D2",Upsilon:"\u03A5",Uring:"\u016E",Uscr:"\u{1D4B0}",Utilde:"\u0168",Uuml:"\xDC",VDash:"\u22AB",Vbar:"\u2AEB",Vcy:"\u0412",Vdash:"\u22A9",Vdashl:"\u2AE6",Vee:"\u22C1",Verbar:"\u2016",Vert:"\u2016",VerticalBar:"\u2223",VerticalLine:"|",VerticalSeparator:"\u2758",VerticalTilde:"\u2240",VeryThinSpace:"\u200A",Vfr:"\u{1D519}",Vopf:"\u{1D54D}",Vscr:"\u{1D4B1}",Vvdash:"\u22AA",Wcirc:"\u0174",Wedge:"\u22C0",Wfr:"\u{1D51A}",Wopf:"\u{1D54E}",Wscr:"\u{1D4B2}",Xfr:"\u{1D51B}",Xi:"\u039E",Xopf:"\u{1D54F}",Xscr:"\u{1D4B3}",YAcy:"\u042F",YIcy:"\u0407",YUcy:"\u042E",Yacute:"\xDD",Ycirc:"\u0176",Ycy:"\u042B",Yfr:"\u{1D51C}",Yopf:"\u{1D550}",Yscr:"\u{1D4B4}",Yuml:"\u0178",ZHcy:"\u0416",Zacute:"\u0179",Zcaron:"\u017D",Zcy:"\u0417",Zdot:"\u017B",ZeroWidthSpace:"\u200B",Zeta:"\u0396",Zfr:"\u2128",Zopf:"\u2124",Zscr:"\u{1D4B5}",aacute:"\xE1",abreve:"\u0103",ac:"\u223E",acE:"\u223E\u0333",acd:"\u223F",acirc:"\xE2",acute:"\xB4",acy:"\u0430",aelig:"\xE6",af:"\u2061",afr:"\u{1D51E}",agrave:"\xE0",alefsym:"\u2135",aleph:"\u2135",alpha:"\u03B1",amacr:"\u0101",amalg:"\u2A3F",amp:"&",and:"\u2227",andand:"\u2A55",andd:"\u2A5C",andslope:"\u2A58",andv:"\u2A5A",ang:"\u2220",ange:"\u29A4",angle:"\u2220",angmsd:"\u2221",angmsdaa:"\u29A8",angmsdab:"\u29A9",angmsdac:"\u29AA",angmsdad:"\u29AB",angmsdae:"\u29AC",angmsdaf:"\u29AD",angmsdag:"\u29AE",angmsdah:"\u29AF",angrt:"\u221F",angrtvb:"\u22BE",angrtvbd:"\u299D",angsph:"\u2222",angst:"\xC5",angzarr:"\u237C",aogon:"\u0105",aopf:"\u{1D552}",ap:"\u2248",apE:"\u2A70",apacir:"\u2A6F",ape:"\u224A",apid:"\u224B",apos:"'",approx:"\u2248",approxeq:"\u224A",aring:"\xE5",ascr:"\u{1D4B6}",ast:"*",asymp:"\u2248",asympeq:"\u224D",atilde:"\xE3",auml:"\xE4",awconint:"\u2233",awint:"\u2A11",bNot:"\u2AED",backcong:"\u224C",backepsilon:"\u03F6",backprime:"\u2035",backsim:"\u223D",backsimeq:"\u22CD",barvee:"\u22BD",barwed:"\u2305",barwedge:"\u2305",bbrk:"\u23B5",bbrktbrk:"\u23B6",bcong:"\u224C",bcy:"\u0431",bdquo:"\u201E",becaus:"\u2235",because:"\u2235",bemptyv:"\u29B0",bepsi:"\u03F6",bernou:"\u212C",beta:"\u03B2",beth:"\u2136",between:"\u226C",bfr:"\u{1D51F}",bigcap:"\u22C2",bigcirc:"\u25EF",bigcup:"\u22C3",bigodot:"\u2A00",bigoplus:"\u2A01",bigotimes:"\u2A02",bigsqcup:"\u2A06",bigstar:"\u2605",bigtriangledown:"\u25BD",bigtriangleup:"\u25B3",biguplus:"\u2A04",bigvee:"\u22C1",bigwedge:"\u22C0",bkarow:"\u290D",blacklozenge:"\u29EB",blacksquare:"\u25AA",blacktriangle:"\u25B4",blacktriangledown:"\u25BE",blacktriangleleft:"\u25C2",blacktriangleright:"\u25B8",blank:"\u2423",blk12:"\u2592",blk14:"\u2591",blk34:"\u2593",block:"\u2588",bne:"=\u20E5",bnequiv:"\u2261\u20E5",bnot:"\u2310",bopf:"\u{1D553}",bot:"\u22A5",bottom:"\u22A5",bowtie:"\u22C8",boxDL:"\u2557",boxDR:"\u2554",boxDl:"\u2556",boxDr:"\u2553",boxH:"\u2550",boxHD:"\u2566",boxHU:"\u2569",boxHd:"\u2564",boxHu:"\u2567",boxUL:"\u255D",boxUR:"\u255A",boxUl:"\u255C",boxUr:"\u2559",boxV:"\u2551",boxVH:"\u256C",boxVL:"\u2563",boxVR:"\u2560",boxVh:"\u256B",boxVl:"\u2562",boxVr:"\u255F",boxbox:"\u29C9",boxdL:"\u2555",boxdR:"\u2552",boxdl:"\u2510",boxdr:"\u250C",boxh:"\u2500",boxhD:"\u2565",boxhU:"\u2568",boxhd:"\u252C",boxhu:"\u2534",boxminus:"\u229F",boxplus:"\u229E",boxtimes:"\u22A0",boxuL:"\u255B",boxuR:"\u2558",boxul:"\u2518",boxur:"\u2514",boxv:"\u2502",boxvH:"\u256A",boxvL:"\u2561",boxvR:"\u255E",boxvh:"\u253C",boxvl:"\u2524",boxvr:"\u251C",bprime:"\u2035",breve:"\u02D8",brvbar:"\xA6",bscr:"\u{1D4B7}",bsemi:"\u204F",bsim:"\u223D",bsime:"\u22CD",bsol:"\\",bsolb:"\u29C5",bsolhsub:"\u27C8",bull:"\u2022",bullet:"\u2022",bump:"\u224E",bumpE:"\u2AAE",bumpe:"\u224F",bumpeq:"\u224F",cacute:"\u0107",cap:"\u2229",capand:"\u2A44",capbrcup:"\u2A49",capcap:"\u2A4B",capcup:"\u2A47",capdot:"\u2A40",caps:"\u2229\uFE00",caret:"\u2041",caron:"\u02C7",ccaps:"\u2A4D",ccaron:"\u010D",ccedil:"\xE7",ccirc:"\u0109",ccups:"\u2A4C",ccupssm:"\u2A50",cdot:"\u010B",cedil:"\xB8",cemptyv:"\u29B2",cent:"\xA2",centerdot:"\xB7",cfr:"\u{1D520}",chcy:"\u0447",check:"\u2713",checkmark:"\u2713",chi:"\u03C7",cir:"\u25CB",cirE:"\u29C3",circ:"\u02C6",circeq:"\u2257",circlearrowleft:"\u21BA",circlearrowright:"\u21BB",circledR:"\xAE",circledS:"\u24C8",circledast:"\u229B",circledcirc:"\u229A",circleddash:"\u229D",cire:"\u2257",cirfnint:"\u2A10",cirmid:"\u2AEF",cirscir:"\u29C2",clubs:"\u2663",clubsuit:"\u2663",colon:":",colone:"\u2254",coloneq:"\u2254",comma:",",commat:"@",comp:"\u2201",compfn:"\u2218",complement:"\u2201",complexes:"\u2102",cong:"\u2245",congdot:"\u2A6D",conint:"\u222E",copf:"\u{1D554}",coprod:"\u2210",copy:"\xA9",copysr:"\u2117",crarr:"\u21B5",cross:"\u2717",cscr:"\u{1D4B8}",csub:"\u2ACF",csube:"\u2AD1",csup:"\u2AD0",csupe:"\u2AD2",ctdot:"\u22EF",cudarrl:"\u2938",cudarrr:"\u2935",cuepr:"\u22DE",cuesc:"\u22DF",cularr:"\u21B6",cularrp:"\u293D",cup:"\u222A",cupbrcap:"\u2A48",cupcap:"\u2A46",cupcup:"\u2A4A",cupdot:"\u228D",cupor:"\u2A45",cups:"\u222A\uFE00",curarr:"\u21B7",curarrm:"\u293C",curlyeqprec:"\u22DE",curlyeqsucc:"\u22DF",curlyvee:"\u22CE",curlywedge:"\u22CF",curren:"\xA4",curvearrowleft:"\u21B6",curvearrowright:"\u21B7",cuvee:"\u22CE",cuwed:"\u22CF",cwconint:"\u2232",cwint:"\u2231",cylcty:"\u232D",dArr:"\u21D3",dHar:"\u2965",dagger:"\u2020",daleth:"\u2138",darr:"\u2193",dash:"\u2010",dashv:"\u22A3",dbkarow:"\u290F",dblac:"\u02DD",dcaron:"\u010F",dcy:"\u0434",dd:"\u2146",ddagger:"\u2021",ddarr:"\u21CA",ddotseq:"\u2A77",deg:"\xB0",delta:"\u03B4",demptyv:"\u29B1",dfisht:"\u297F",dfr:"\u{1D521}",dharl:"\u21C3",dharr:"\u21C2",diam:"\u22C4",diamond:"\u22C4",diamondsuit:"\u2666",diams:"\u2666",die:"\xA8",digamma:"\u03DD",disin:"\u22F2",div:"\xF7",divide:"\xF7",divideontimes:"\u22C7",divonx:"\u22C7",djcy:"\u0452",dlcorn:"\u231E",dlcrop:"\u230D",dollar:"$",dopf:"\u{1D555}",dot:"\u02D9",doteq:"\u2250",doteqdot:"\u2251",dotminus:"\u2238",dotplus:"\u2214",dotsquare:"\u22A1",doublebarwedge:"\u2306",downarrow:"\u2193",downdownarrows:"\u21CA",downharpoonleft:"\u21C3",downharpoonright:"\u21C2",drbkarow:"\u2910",drcorn:"\u231F",drcrop:"\u230C",dscr:"\u{1D4B9}",dscy:"\u0455",dsol:"\u29F6",dstrok:"\u0111",dtdot:"\u22F1",dtri:"\u25BF",dtrif:"\u25BE",duarr:"\u21F5",duhar:"\u296F",dwangle:"\u29A6",dzcy:"\u045F",dzigrarr:"\u27FF",eDDot:"\u2A77",eDot:"\u2251",eacute:"\xE9",easter:"\u2A6E",ecaron:"\u011B",ecir:"\u2256",ecirc:"\xEA",ecolon:"\u2255",ecy:"\u044D",edot:"\u0117",ee:"\u2147",efDot:"\u2252",efr:"\u{1D522}",eg:"\u2A9A",egrave:"\xE8",egs:"\u2A96",egsdot:"\u2A98",el:"\u2A99",elinters:"\u23E7",ell:"\u2113",els:"\u2A95",elsdot:"\u2A97",emacr:"\u0113",empty:"\u2205",emptyset:"\u2205",emptyv:"\u2205",emsp13:"\u2004",emsp14:"\u2005",emsp:"\u2003",eng:"\u014B",ensp:"\u2002",eogon:"\u0119",eopf:"\u{1D556}",epar:"\u22D5",eparsl:"\u29E3",eplus:"\u2A71",epsi:"\u03B5",epsilon:"\u03B5",epsiv:"\u03F5",eqcirc:"\u2256",eqcolon:"\u2255",eqsim:"\u2242",eqslantgtr:"\u2A96",eqslantless:"\u2A95",equals:"=",equest:"\u225F",equiv:"\u2261",equivDD:"\u2A78",eqvparsl:"\u29E5",erDot:"\u2253",erarr:"\u2971",escr:"\u212F",esdot:"\u2250",esim:"\u2242",eta:"\u03B7",eth:"\xF0",euml:"\xEB",euro:"\u20AC",excl:"!",exist:"\u2203",expectation:"\u2130",exponentiale:"\u2147",fallingdotseq:"\u2252",fcy:"\u0444",female:"\u2640",ffilig:"\uFB03",fflig:"\uFB00",ffllig:"\uFB04",ffr:"\u{1D523}",filig:"\uFB01",fjlig:"fj",flat:"\u266D",fllig:"\uFB02",fltns:"\u25B1",fnof:"\u0192",fopf:"\u{1D557}",forall:"\u2200",fork:"\u22D4",forkv:"\u2AD9",fpartint:"\u2A0D",frac12:"\xBD",frac13:"\u2153",frac14:"\xBC",frac15:"\u2155",frac16:"\u2159",frac18:"\u215B",frac23:"\u2154",frac25:"\u2156",frac34:"\xBE",frac35:"\u2157",frac38:"\u215C",frac45:"\u2158",frac56:"\u215A",frac58:"\u215D",frac78:"\u215E",frasl:"\u2044",frown:"\u2322",fscr:"\u{1D4BB}",gE:"\u2267",gEl:"\u2A8C",gacute:"\u01F5",gamma:"\u03B3",gammad:"\u03DD",gap:"\u2A86",gbreve:"\u011F",gcirc:"\u011D",gcy:"\u0433",gdot:"\u0121",ge:"\u2265",gel:"\u22DB",geq:"\u2265",geqq:"\u2267",geqslant:"\u2A7E",ges:"\u2A7E",gescc:"\u2AA9",gesdot:"\u2A80",gesdoto:"\u2A82",gesdotol:"\u2A84",gesl:"\u22DB\uFE00",gesles:"\u2A94",gfr:"\u{1D524}",gg:"\u226B",ggg:"\u22D9",gimel:"\u2137",gjcy:"\u0453",gl:"\u2277",glE:"\u2A92",gla:"\u2AA5",glj:"\u2AA4",gnE:"\u2269",gnap:"\u2A8A",gnapprox:"\u2A8A",gne:"\u2A88",gneq:"\u2A88",gneqq:"\u2269",gnsim:"\u22E7",gopf:"\u{1D558}",grave:"`",gscr:"\u210A",gsim:"\u2273",gsime:"\u2A8E",gsiml:"\u2A90",gt:">",gtcc:"\u2AA7",gtcir:"\u2A7A",gtdot:"\u22D7",gtlPar:"\u2995",gtquest:"\u2A7C",gtrapprox:"\u2A86",gtrarr:"\u2978",gtrdot:"\u22D7",gtreqless:"\u22DB",gtreqqless:"\u2A8C",gtrless:"\u2277",gtrsim:"\u2273",gvertneqq:"\u2269\uFE00",gvnE:"\u2269\uFE00",hArr:"\u21D4",hairsp:"\u200A",half:"\xBD",hamilt:"\u210B",hardcy:"\u044A",harr:"\u2194",harrcir:"\u2948",harrw:"\u21AD",hbar:"\u210F",hcirc:"\u0125",hearts:"\u2665",heartsuit:"\u2665",hellip:"\u2026",hercon:"\u22B9",hfr:"\u{1D525}",hksearow:"\u2925",hkswarow:"\u2926",hoarr:"\u21FF",homtht:"\u223B",hookleftarrow:"\u21A9",hookrightarrow:"\u21AA",hopf:"\u{1D559}",horbar:"\u2015",hscr:"\u{1D4BD}",hslash:"\u210F",hstrok:"\u0127",hybull:"\u2043",hyphen:"\u2010",iacute:"\xED",ic:"\u2063",icirc:"\xEE",icy:"\u0438",iecy:"\u0435",iexcl:"\xA1",iff:"\u21D4",ifr:"\u{1D526}",igrave:"\xEC",ii:"\u2148",iiiint:"\u2A0C",iiint:"\u222D",iinfin:"\u29DC",iiota:"\u2129",ijlig:"\u0133",imacr:"\u012B",image:"\u2111",imagline:"\u2110",imagpart:"\u2111",imath:"\u0131",imof:"\u22B7",imped:"\u01B5",in:"\u2208",incare:"\u2105",infin:"\u221E",infintie:"\u29DD",inodot:"\u0131",int:"\u222B",intcal:"\u22BA",integers:"\u2124",intercal:"\u22BA",intlarhk:"\u2A17",intprod:"\u2A3C",iocy:"\u0451",iogon:"\u012F",iopf:"\u{1D55A}",iota:"\u03B9",iprod:"\u2A3C",iquest:"\xBF",iscr:"\u{1D4BE}",isin:"\u2208",isinE:"\u22F9",isindot:"\u22F5",isins:"\u22F4",isinsv:"\u22F3",isinv:"\u2208",it:"\u2062",itilde:"\u0129",iukcy:"\u0456",iuml:"\xEF",jcirc:"\u0135",jcy:"\u0439",jfr:"\u{1D527}",jmath:"\u0237",jopf:"\u{1D55B}",jscr:"\u{1D4BF}",jsercy:"\u0458",jukcy:"\u0454",kappa:"\u03BA",kappav:"\u03F0",kcedil:"\u0137",kcy:"\u043A",kfr:"\u{1D528}",kgreen:"\u0138",khcy:"\u0445",kjcy:"\u045C",kopf:"\u{1D55C}",kscr:"\u{1D4C0}",lAarr:"\u21DA",lArr:"\u21D0",lAtail:"\u291B",lBarr:"\u290E",lE:"\u2266",lEg:"\u2A8B",lHar:"\u2962",lacute:"\u013A",laemptyv:"\u29B4",lagran:"\u2112",lambda:"\u03BB",lang:"\u27E8",langd:"\u2991",langle:"\u27E8",lap:"\u2A85",laquo:"\xAB",larr:"\u2190",larrb:"\u21E4",larrbfs:"\u291F",larrfs:"\u291D",larrhk:"\u21A9",larrlp:"\u21AB",larrpl:"\u2939",larrsim:"\u2973",larrtl:"\u21A2",lat:"\u2AAB",latail:"\u2919",late:"\u2AAD",lates:"\u2AAD\uFE00",lbarr:"\u290C",lbbrk:"\u2772",lbrace:"{",lbrack:"[",lbrke:"\u298B",lbrksld:"\u298F",lbrkslu:"\u298D",lcaron:"\u013E",lcedil:"\u013C",lceil:"\u2308",lcub:"{",lcy:"\u043B",ldca:"\u2936",ldquo:"\u201C",ldquor:"\u201E",ldrdhar:"\u2967",ldrushar:"\u294B",ldsh:"\u21B2",le:"\u2264",leftarrow:"\u2190",leftarrowtail:"\u21A2",leftharpoondown:"\u21BD",leftharpoonup:"\u21BC",leftleftarrows:"\u21C7",leftrightarrow:"\u2194",leftrightarrows:"\u21C6",leftrightharpoons:"\u21CB",leftrightsquigarrow:"\u21AD",leftthreetimes:"\u22CB",leg:"\u22DA",leq:"\u2264",leqq:"\u2266",leqslant:"\u2A7D",les:"\u2A7D",lescc:"\u2AA8",lesdot:"\u2A7F",lesdoto:"\u2A81",lesdotor:"\u2A83",lesg:"\u22DA\uFE00",lesges:"\u2A93",lessapprox:"\u2A85",lessdot:"\u22D6",lesseqgtr:"\u22DA",lesseqqgtr:"\u2A8B",lessgtr:"\u2276",lesssim:"\u2272",lfisht:"\u297C",lfloor:"\u230A",lfr:"\u{1D529}",lg:"\u2276",lgE:"\u2A91",lhard:"\u21BD",lharu:"\u21BC",lharul:"\u296A",lhblk:"\u2584",ljcy:"\u0459",ll:"\u226A",llarr:"\u21C7",llcorner:"\u231E",llhard:"\u296B",lltri:"\u25FA",lmidot:"\u0140",lmoust:"\u23B0",lmoustache:"\u23B0",lnE:"\u2268",lnap:"\u2A89",lnapprox:"\u2A89",lne:"\u2A87",lneq:"\u2A87",lneqq:"\u2268",lnsim:"\u22E6",loang:"\u27EC",loarr:"\u21FD",lobrk:"\u27E6",longleftarrow:"\u27F5",longleftrightarrow:"\u27F7",longmapsto:"\u27FC",longrightarrow:"\u27F6",looparrowleft:"\u21AB",looparrowright:"\u21AC",lopar:"\u2985",lopf:"\u{1D55D}",loplus:"\u2A2D",lotimes:"\u2A34",lowast:"\u2217",lowbar:"_",loz:"\u25CA",lozenge:"\u25CA",lozf:"\u29EB",lpar:"(",lparlt:"\u2993",lrarr:"\u21C6",lrcorner:"\u231F",lrhar:"\u21CB",lrhard:"\u296D",lrm:"\u200E",lrtri:"\u22BF",lsaquo:"\u2039",lscr:"\u{1D4C1}",lsh:"\u21B0",lsim:"\u2272",lsime:"\u2A8D",lsimg:"\u2A8F",lsqb:"[",lsquo:"\u2018",lsquor:"\u201A",lstrok:"\u0142",lt:"<",ltcc:"\u2AA6",ltcir:"\u2A79",ltdot:"\u22D6",lthree:"\u22CB",ltimes:"\u22C9",ltlarr:"\u2976",ltquest:"\u2A7B",ltrPar:"\u2996",ltri:"\u25C3",ltrie:"\u22B4",ltrif:"\u25C2",lurdshar:"\u294A",luruhar:"\u2966",lvertneqq:"\u2268\uFE00",lvnE:"\u2268\uFE00",mDDot:"\u223A",macr:"\xAF",male:"\u2642",malt:"\u2720",maltese:"\u2720",map:"\u21A6",mapsto:"\u21A6",mapstodown:"\u21A7",mapstoleft:"\u21A4",mapstoup:"\u21A5",marker:"\u25AE",mcomma:"\u2A29",mcy:"\u043C",mdash:"\u2014",measuredangle:"\u2221",mfr:"\u{1D52A}",mho:"\u2127",micro:"\xB5",mid:"\u2223",midast:"*",midcir:"\u2AF0",middot:"\xB7",minus:"\u2212",minusb:"\u229F",minusd:"\u2238",minusdu:"\u2A2A",mlcp:"\u2ADB",mldr:"\u2026",mnplus:"\u2213",models:"\u22A7",mopf:"\u{1D55E}",mp:"\u2213",mscr:"\u{1D4C2}",mstpos:"\u223E",mu:"\u03BC",multimap:"\u22B8",mumap:"\u22B8",nGg:"\u22D9\u0338",nGt:"\u226B\u20D2",nGtv:"\u226B\u0338",nLeftarrow:"\u21CD",nLeftrightarrow:"\u21CE",nLl:"\u22D8\u0338",nLt:"\u226A\u20D2",nLtv:"\u226A\u0338",nRightarrow:"\u21CF",nVDash:"\u22AF",nVdash:"\u22AE",nabla:"\u2207",nacute:"\u0144",nang:"\u2220\u20D2",nap:"\u2249",napE:"\u2A70\u0338",napid:"\u224B\u0338",napos:"\u0149",napprox:"\u2249",natur:"\u266E",natural:"\u266E",naturals:"\u2115",nbsp:"\xA0",nbump:"\u224E\u0338",nbumpe:"\u224F\u0338",ncap:"\u2A43",ncaron:"\u0148",ncedil:"\u0146",ncong:"\u2247",ncongdot:"\u2A6D\u0338",ncup:"\u2A42",ncy:"\u043D",ndash:"\u2013",ne:"\u2260",neArr:"\u21D7",nearhk:"\u2924",nearr:"\u2197",nearrow:"\u2197",nedot:"\u2250\u0338",nequiv:"\u2262",nesear:"\u2928",nesim:"\u2242\u0338",nexist:"\u2204",nexists:"\u2204",nfr:"\u{1D52B}",ngE:"\u2267\u0338",nge:"\u2271",ngeq:"\u2271",ngeqq:"\u2267\u0338",ngeqslant:"\u2A7E\u0338",nges:"\u2A7E\u0338",ngsim:"\u2275",ngt:"\u226F",ngtr:"\u226F",nhArr:"\u21CE",nharr:"\u21AE",nhpar:"\u2AF2",ni:"\u220B",nis:"\u22FC",nisd:"\u22FA",niv:"\u220B",njcy:"\u045A",nlArr:"\u21CD",nlE:"\u2266\u0338",nlarr:"\u219A",nldr:"\u2025",nle:"\u2270",nleftarrow:"\u219A",nleftrightarrow:"\u21AE",nleq:"\u2270",nleqq:"\u2266\u0338",nleqslant:"\u2A7D\u0338",nles:"\u2A7D\u0338",nless:"\u226E",nlsim:"\u2274",nlt:"\u226E",nltri:"\u22EA",nltrie:"\u22EC",nmid:"\u2224",nopf:"\u{1D55F}",not:"\xAC",notin:"\u2209",notinE:"\u22F9\u0338",notindot:"\u22F5\u0338",notinva:"\u2209",notinvb:"\u22F7",notinvc:"\u22F6",notni:"\u220C",notniva:"\u220C",notnivb:"\u22FE",notnivc:"\u22FD",npar:"\u2226",nparallel:"\u2226",nparsl:"\u2AFD\u20E5",npart:"\u2202\u0338",npolint:"\u2A14",npr:"\u2280",nprcue:"\u22E0",npre:"\u2AAF\u0338",nprec:"\u2280",npreceq:"\u2AAF\u0338",nrArr:"\u21CF",nrarr:"\u219B",nrarrc:"\u2933\u0338",nrarrw:"\u219D\u0338",nrightarrow:"\u219B",nrtri:"\u22EB",nrtrie:"\u22ED",nsc:"\u2281",nsccue:"\u22E1",nsce:"\u2AB0\u0338",nscr:"\u{1D4C3}",nshortmid:"\u2224",nshortparallel:"\u2226",nsim:"\u2241",nsime:"\u2244",nsimeq:"\u2244",nsmid:"\u2224",nspar:"\u2226",nsqsube:"\u22E2",nsqsupe:"\u22E3",nsub:"\u2284",nsubE:"\u2AC5\u0338",nsube:"\u2288",nsubset:"\u2282\u20D2",nsubseteq:"\u2288",nsubseteqq:"\u2AC5\u0338",nsucc:"\u2281",nsucceq:"\u2AB0\u0338",nsup:"\u2285",nsupE:"\u2AC6\u0338",nsupe:"\u2289",nsupset:"\u2283\u20D2",nsupseteq:"\u2289",nsupseteqq:"\u2AC6\u0338",ntgl:"\u2279",ntilde:"\xF1",ntlg:"\u2278",ntriangleleft:"\u22EA",ntrianglelefteq:"\u22EC",ntriangleright:"\u22EB",ntrianglerighteq:"\u22ED",nu:"\u03BD",num:"#",numero:"\u2116",numsp:"\u2007",nvDash:"\u22AD",nvHarr:"\u2904",nvap:"\u224D\u20D2",nvdash:"\u22AC",nvge:"\u2265\u20D2",nvgt:">\u20D2",nvinfin:"\u29DE",nvlArr:"\u2902",nvle:"\u2264\u20D2",nvlt:"<\u20D2",nvltrie:"\u22B4\u20D2",nvrArr:"\u2903",nvrtrie:"\u22B5\u20D2",nvsim:"\u223C\u20D2",nwArr:"\u21D6",nwarhk:"\u2923",nwarr:"\u2196",nwarrow:"\u2196",nwnear:"\u2927",oS:"\u24C8",oacute:"\xF3",oast:"\u229B",ocir:"\u229A",ocirc:"\xF4",ocy:"\u043E",odash:"\u229D",odblac:"\u0151",odiv:"\u2A38",odot:"\u2299",odsold:"\u29BC",oelig:"\u0153",ofcir:"\u29BF",ofr:"\u{1D52C}",ogon:"\u02DB",ograve:"\xF2",ogt:"\u29C1",ohbar:"\u29B5",ohm:"\u03A9",oint:"\u222E",olarr:"\u21BA",olcir:"\u29BE",olcross:"\u29BB",oline:"\u203E",olt:"\u29C0",omacr:"\u014D",omega:"\u03C9",omicron:"\u03BF",omid:"\u29B6",ominus:"\u2296",oopf:"\u{1D560}",opar:"\u29B7",operp:"\u29B9",oplus:"\u2295",or:"\u2228",orarr:"\u21BB",ord:"\u2A5D",order:"\u2134",orderof:"\u2134",ordf:"\xAA",ordm:"\xBA",origof:"\u22B6",oror:"\u2A56",orslope:"\u2A57",orv:"\u2A5B",oscr:"\u2134",oslash:"\xF8",osol:"\u2298",otilde:"\xF5",otimes:"\u2297",otimesas:"\u2A36",ouml:"\xF6",ovbar:"\u233D",par:"\u2225",para:"\xB6",parallel:"\u2225",parsim:"\u2AF3",parsl:"\u2AFD",part:"\u2202",pcy:"\u043F",percnt:"%",period:".",permil:"\u2030",perp:"\u22A5",pertenk:"\u2031",pfr:"\u{1D52D}",phi:"\u03C6",phiv:"\u03D5",phmmat:"\u2133",phone:"\u260E",pi:"\u03C0",pitchfork:"\u22D4",piv:"\u03D6",planck:"\u210F",planckh:"\u210E",plankv:"\u210F",plus:"+",plusacir:"\u2A23",plusb:"\u229E",pluscir:"\u2A22",plusdo:"\u2214",plusdu:"\u2A25",pluse:"\u2A72",plusmn:"\xB1",plussim:"\u2A26",plustwo:"\u2A27",pm:"\xB1",pointint:"\u2A15",popf:"\u{1D561}",pound:"\xA3",pr:"\u227A",prE:"\u2AB3",prap:"\u2AB7",prcue:"\u227C",pre:"\u2AAF",prec:"\u227A",precapprox:"\u2AB7",preccurlyeq:"\u227C",preceq:"\u2AAF",precnapprox:"\u2AB9",precneqq:"\u2AB5",precnsim:"\u22E8",precsim:"\u227E",prime:"\u2032",primes:"\u2119",prnE:"\u2AB5",prnap:"\u2AB9",prnsim:"\u22E8",prod:"\u220F",profalar:"\u232E",profline:"\u2312",profsurf:"\u2313",prop:"\u221D",propto:"\u221D",prsim:"\u227E",prurel:"\u22B0",pscr:"\u{1D4C5}",psi:"\u03C8",puncsp:"\u2008",qfr:"\u{1D52E}",qint:"\u2A0C",qopf:"\u{1D562}",qprime:"\u2057",qscr:"\u{1D4C6}",quaternions:"\u210D",quatint:"\u2A16",quest:"?",questeq:"\u225F",quot:'"',rAarr:"\u21DB",rArr:"\u21D2",rAtail:"\u291C",rBarr:"\u290F",rHar:"\u2964",race:"\u223D\u0331",racute:"\u0155",radic:"\u221A",raemptyv:"\u29B3",rang:"\u27E9",rangd:"\u2992",range:"\u29A5",rangle:"\u27E9",raquo:"\xBB",rarr:"\u2192",rarrap:"\u2975",rarrb:"\u21E5",rarrbfs:"\u2920",rarrc:"\u2933",rarrfs:"\u291E",rarrhk:"\u21AA",rarrlp:"\u21AC",rarrpl:"\u2945",rarrsim:"\u2974",rarrtl:"\u21A3",rarrw:"\u219D",ratail:"\u291A",ratio:"\u2236",rationals:"\u211A",rbarr:"\u290D",rbbrk:"\u2773",rbrace:"}",rbrack:"]",rbrke:"\u298C",rbrksld:"\u298E",rbrkslu:"\u2990",rcaron:"\u0159",rcedil:"\u0157",rceil:"\u2309",rcub:"}",rcy:"\u0440",rdca:"\u2937",rdldhar:"\u2969",rdquo:"\u201D",rdquor:"\u201D",rdsh:"\u21B3",real:"\u211C",realine:"\u211B",realpart:"\u211C",reals:"\u211D",rect:"\u25AD",reg:"\xAE",rfisht:"\u297D",rfloor:"\u230B",rfr:"\u{1D52F}",rhard:"\u21C1",rharu:"\u21C0",rharul:"\u296C",rho:"\u03C1",rhov:"\u03F1",rightarrow:"\u2192",rightarrowtail:"\u21A3",rightharpoondown:"\u21C1",rightharpoonup:"\u21C0",rightleftarrows:"\u21C4",rightleftharpoons:"\u21CC",rightrightarrows:"\u21C9",rightsquigarrow:"\u219D",rightthreetimes:"\u22CC",ring:"\u02DA",risingdotseq:"\u2253",rlarr:"\u21C4",rlhar:"\u21CC",rlm:"\u200F",rmoust:"\u23B1",rmoustache:"\u23B1",rnmid:"\u2AEE",roang:"\u27ED",roarr:"\u21FE",robrk:"\u27E7",ropar:"\u2986",ropf:"\u{1D563}",roplus:"\u2A2E",rotimes:"\u2A35",rpar:")",rpargt:"\u2994",rppolint:"\u2A12",rrarr:"\u21C9",rsaquo:"\u203A",rscr:"\u{1D4C7}",rsh:"\u21B1",rsqb:"]",rsquo:"\u2019",rsquor:"\u2019",rthree:"\u22CC",rtimes:"\u22CA",rtri:"\u25B9",rtrie:"\u22B5",rtrif:"\u25B8",rtriltri:"\u29CE",ruluhar:"\u2968",rx:"\u211E",sacute:"\u015B",sbquo:"\u201A",sc:"\u227B",scE:"\u2AB4",scap:"\u2AB8",scaron:"\u0161",sccue:"\u227D",sce:"\u2AB0",scedil:"\u015F",scirc:"\u015D",scnE:"\u2AB6",scnap:"\u2ABA",scnsim:"\u22E9",scpolint:"\u2A13",scsim:"\u227F",scy:"\u0441",sdot:"\u22C5",sdotb:"\u22A1",sdote:"\u2A66",seArr:"\u21D8",searhk:"\u2925",searr:"\u2198",searrow:"\u2198",sect:"\xA7",semi:";",seswar:"\u2929",setminus:"\u2216",setmn:"\u2216",sext:"\u2736",sfr:"\u{1D530}",sfrown:"\u2322",sharp:"\u266F",shchcy:"\u0449",shcy:"\u0448",shortmid:"\u2223",shortparallel:"\u2225",shy:"\xAD",sigma:"\u03C3",sigmaf:"\u03C2",sigmav:"\u03C2",sim:"\u223C",simdot:"\u2A6A",sime:"\u2243",simeq:"\u2243",simg:"\u2A9E",simgE:"\u2AA0",siml:"\u2A9D",simlE:"\u2A9F",simne:"\u2246",simplus:"\u2A24",simrarr:"\u2972",slarr:"\u2190",smallsetminus:"\u2216",smashp:"\u2A33",smeparsl:"\u29E4",smid:"\u2223",smile:"\u2323",smt:"\u2AAA",smte:"\u2AAC",smtes:"\u2AAC\uFE00",softcy:"\u044C",sol:"/",solb:"\u29C4",solbar:"\u233F",sopf:"\u{1D564}",spades:"\u2660",spadesuit:"\u2660",spar:"\u2225",sqcap:"\u2293",sqcaps:"\u2293\uFE00",sqcup:"\u2294",sqcups:"\u2294\uFE00",sqsub:"\u228F",sqsube:"\u2291",sqsubset:"\u228F",sqsubseteq:"\u2291",sqsup:"\u2290",sqsupe:"\u2292",sqsupset:"\u2290",sqsupseteq:"\u2292",squ:"\u25A1",square:"\u25A1",squarf:"\u25AA",squf:"\u25AA",srarr:"\u2192",sscr:"\u{1D4C8}",ssetmn:"\u2216",ssmile:"\u2323",sstarf:"\u22C6",star:"\u2606",starf:"\u2605",straightepsilon:"\u03F5",straightphi:"\u03D5",strns:"\xAF",sub:"\u2282",subE:"\u2AC5",subdot:"\u2ABD",sube:"\u2286",subedot:"\u2AC3",submult:"\u2AC1",subnE:"\u2ACB",subne:"\u228A",subplus:"\u2ABF",subrarr:"\u2979",subset:"\u2282",subseteq:"\u2286",subseteqq:"\u2AC5",subsetneq:"\u228A",subsetneqq:"\u2ACB",subsim:"\u2AC7",subsub:"\u2AD5",subsup:"\u2AD3",succ:"\u227B",succapprox:"\u2AB8",succcurlyeq:"\u227D",succeq:"\u2AB0",succnapprox:"\u2ABA",succneqq:"\u2AB6",succnsim:"\u22E9",succsim:"\u227F",sum:"\u2211",sung:"\u266A",sup1:"\xB9",sup2:"\xB2",sup3:"\xB3",sup:"\u2283",supE:"\u2AC6",supdot:"\u2ABE",supdsub:"\u2AD8",supe:"\u2287",supedot:"\u2AC4",suphsol:"\u27C9",suphsub:"\u2AD7",suplarr:"\u297B",supmult:"\u2AC2",supnE:"\u2ACC",supne:"\u228B",supplus:"\u2AC0",supset:"\u2283",supseteq:"\u2287",supseteqq:"\u2AC6",supsetneq:"\u228B",supsetneqq:"\u2ACC",supsim:"\u2AC8",supsub:"\u2AD4",supsup:"\u2AD6",swArr:"\u21D9",swarhk:"\u2926",swarr:"\u2199",swarrow:"\u2199",swnwar:"\u292A",szlig:"\xDF",target:"\u2316",tau:"\u03C4",tbrk:"\u23B4",tcaron:"\u0165",tcedil:"\u0163",tcy:"\u0442",tdot:"\u20DB",telrec:"\u2315",tfr:"\u{1D531}",there4:"\u2234",therefore:"\u2234",theta:"\u03B8",thetasym:"\u03D1",thetav:"\u03D1",thickapprox:"\u2248",thicksim:"\u223C",thinsp:"\u2009",thkap:"\u2248",thksim:"\u223C",thorn:"\xFE",tilde:"\u02DC",times:"\xD7",timesb:"\u22A0",timesbar:"\u2A31",timesd:"\u2A30",tint:"\u222D",toea:"\u2928",top:"\u22A4",topbot:"\u2336",topcir:"\u2AF1",topf:"\u{1D565}",topfork:"\u2ADA",tosa:"\u2929",tprime:"\u2034",trade:"\u2122",triangle:"\u25B5",triangledown:"\u25BF",triangleleft:"\u25C3",trianglelefteq:"\u22B4",triangleq:"\u225C",triangleright:"\u25B9",trianglerighteq:"\u22B5",tridot:"\u25EC",trie:"\u225C",triminus:"\u2A3A",triplus:"\u2A39",trisb:"\u29CD",tritime:"\u2A3B",trpezium:"\u23E2",tscr:"\u{1D4C9}",tscy:"\u0446",tshcy:"\u045B",tstrok:"\u0167",twixt:"\u226C",twoheadleftarrow:"\u219E",twoheadrightarrow:"\u21A0",uArr:"\u21D1",uHar:"\u2963",uacute:"\xFA",uarr:"\u2191",ubrcy:"\u045E",ubreve:"\u016D",ucirc:"\xFB",ucy:"\u0443",udarr:"\u21C5",udblac:"\u0171",udhar:"\u296E",ufisht:"\u297E",ufr:"\u{1D532}",ugrave:"\xF9",uharl:"\u21BF",uharr:"\u21BE",uhblk:"\u2580",ulcorn:"\u231C",ulcorner:"\u231C",ulcrop:"\u230F",ultri:"\u25F8",umacr:"\u016B",uml:"\xA8",uogon:"\u0173",uopf:"\u{1D566}",uparrow:"\u2191",updownarrow:"\u2195",upharpoonleft:"\u21BF",upharpoonright:"\u21BE",uplus:"\u228E",upsi:"\u03C5",upsih:"\u03D2",upsilon:"\u03C5",upuparrows:"\u21C8",urcorn:"\u231D",urcorner:"\u231D",urcrop:"\u230E",uring:"\u016F",urtri:"\u25F9",uscr:"\u{1D4CA}",utdot:"\u22F0",utilde:"\u0169",utri:"\u25B5",utrif:"\u25B4",uuarr:"\u21C8",uuml:"\xFC",uwangle:"\u29A7",vArr:"\u21D5",vBar:"\u2AE8",vBarv:"\u2AE9",vDash:"\u22A8",vangrt:"\u299C",varepsilon:"\u03F5",varkappa:"\u03F0",varnothing:"\u2205",varphi:"\u03D5",varpi:"\u03D6",varpropto:"\u221D",varr:"\u2195",varrho:"\u03F1",varsigma:"\u03C2",varsubsetneq:"\u228A\uFE00",varsubsetneqq:"\u2ACB\uFE00",varsupsetneq:"\u228B\uFE00",varsupsetneqq:"\u2ACC\uFE00",vartheta:"\u03D1",vartriangleleft:"\u22B2",vartriangleright:"\u22B3",vcy:"\u0432",vdash:"\u22A2",vee:"\u2228",veebar:"\u22BB",veeeq:"\u225A",vellip:"\u22EE",verbar:"|",vert:"|",vfr:"\u{1D533}",vltri:"\u22B2",vnsub:"\u2282\u20D2",vnsup:"\u2283\u20D2",vopf:"\u{1D567}",vprop:"\u221D",vrtri:"\u22B3",vscr:"\u{1D4CB}",vsubnE:"\u2ACB\uFE00",vsubne:"\u228A\uFE00",vsupnE:"\u2ACC\uFE00",vsupne:"\u228B\uFE00",vzigzag:"\u299A",wcirc:"\u0175",wedbar:"\u2A5F",wedge:"\u2227",wedgeq:"\u2259",weierp:"\u2118",wfr:"\u{1D534}",wopf:"\u{1D568}",wp:"\u2118",wr:"\u2240",wreath:"\u2240",wscr:"\u{1D4CC}",xcap:"\u22C2",xcirc:"\u25EF",xcup:"\u22C3",xdtri:"\u25BD",xfr:"\u{1D535}",xhArr:"\u27FA",xharr:"\u27F7",xi:"\u03BE",xlArr:"\u27F8",xlarr:"\u27F5",xmap:"\u27FC",xnis:"\u22FB",xodot:"\u2A00",xopf:"\u{1D569}",xoplus:"\u2A01",xotime:"\u2A02",xrArr:"\u27F9",xrarr:"\u27F6",xscr:"\u{1D4CD}",xsqcup:"\u2A06",xuplus:"\u2A04",xutri:"\u25B3",xvee:"\u22C1",xwedge:"\u22C0",yacute:"\xFD",yacy:"\u044F",ycirc:"\u0177",ycy:"\u044B",yen:"\xA5",yfr:"\u{1D536}",yicy:"\u0457",yopf:"\u{1D56A}",yscr:"\u{1D4CE}",yucy:"\u044E",yuml:"\xFF",zacute:"\u017A",zcaron:"\u017E",zcy:"\u0437",zdot:"\u017C",zeetrf:"\u2128",zeta:"\u03B6",zfr:"\u{1D537}",zhcy:"\u0436",zigrarr:"\u21DD",zopf:"\u{1D56B}",zscr:"\u{1D4CF}",zwj:"\u200D",zwnj:"\u200C"};var Yb={}.hasOwnProperty;function Dr(e){return Yb.call(Dl,e)?Dl[e]:!1}function Ts(e,t){let n=Number.parseInt(e,t);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)}var Zb=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Es(e){return e.replace(Zb,Kb)}function Kb(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){let i=n.charCodeAt(1),o=i===120||i===88;return Ts(n.slice(o?2:1),o?16:10)}return Dr(n)||e}var Jb={};function vl(e,t){let n=t||Jb,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return Sp(e,r,i)}function Sp(e,t,n){if(Xb(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return kp(e.children,t,n)}return Array.isArray(e)?kp(e,t,n):""}function kp(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=Sp(e[i],t,n);return r.join("")}function Xb(e){return!!(e&&typeof e=="object")}function me(e,t,n,r){let i=e.length,o=0,s;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)s=Array.from(r),s.unshift(t,n),e.splice(...s);else for(n&&e.splice(t,n);o<r.length;)s=r.slice(o,o+1e4),s.unshift(t,0),e.splice(...s),o+=1e4,t+=1e4}function Le(e,t){return e.length>0?(me(e,e.length,0,t),e):t}var Tp={}.hasOwnProperty;function Cs(e){let t={},n=-1;for(;++n<e.length;)Qb(t,e[n]);return t}function Qb(e,t){let n;for(n in t){let i=(Tp.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n],s;if(o)for(s in o){Tp.call(i,s)||(i[s]=[]);let a=o[s];ek(i[s],Array.isArray(a)?a:a?[a]:[])}}}function ek(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);me(e,0,0,r)}function Oe(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}var fe=fn(/[A-Za-z]/),he=fn(/[\dA-Za-z]/),Ep=fn(/[#-'*+\--9=?A-Z^-~]/);function Gn(e){return e!==null&&(e<32||e===127)}var Ri=fn(/\d/),Cp=fn(/[\dA-Fa-f]/),Ip=fn(/[!-/:-@[-`{-~]/);function _(e){return e!==null&&e<-2}function q(e){return e!==null&&(e<0||e===32)}function L(e){return e===-2||e===-1||e===32}var Vn=fn(new RegExp("\\p{P}|\\p{S}","u")),Et=fn(/\s/);function fn(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function P(e,t,n,r){let i=r?r-1:Number.POSITIVE_INFINITY,o=0;return s;function s(l){return L(l)?(e.enter(n),a(l)):t(l)}function a(l){return L(l)&&o++<i?(e.consume(l),a):(e.exit(n),t(l))}}var _p={tokenize:tk};function tk(e){let t=e.attempt(this.parser.constructs.contentInitial,r,i),n;return t;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),P(e,t,"linePrefix")}function i(a){return e.enter("paragraph"),o(a)}function o(a){let l=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=l),n=l,s(a)}function s(a){if(a===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(a);return}return _(a)?(e.consume(a),e.exit("chunkText"),o):(e.consume(a),s)}}var Op={tokenize:nk},Ap={tokenize:rk};function nk(e){let t=this,n=[],r=0,i,o,s;return a;function a(T){if(r<n.length){let M=n[r];return t.containerState=M[1],e.attempt(M[0].continuation,l,u)(T)}return u(T)}function l(T){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&D();let M=t.events.length,O=M,b;for(;O--;)if(t.events[O][0]==="exit"&&t.events[O][1].type==="chunkFlow"){b=t.events[O][1].end;break}w(r);let E=M;for(;E<t.events.length;)t.events[E][1].end={...b},E++;return me(t.events,O+1,0,t.events.slice(M)),t.events.length=E,u(T)}return a(T)}function u(T){if(r===n.length){if(!i)return m(T);if(i.currentConstruct&&i.currentConstruct.concrete)return f(T);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Ap,d,c)(T)}function d(T){return i&&D(),w(r),m(T)}function c(T){return t.parser.lazy[t.now().line]=r!==n.length,s=t.now().offset,f(T)}function m(T){return t.containerState={},e.attempt(Ap,p,f)(T)}function p(T){return r++,n.push([t.currentConstruct,t.containerState]),m(T)}function f(T){if(T===null){i&&D(),w(0),e.consume(T);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:o}),x(T)}function x(T){if(T===null){S(e.exit("chunkFlow"),!0),w(0),e.consume(T);return}return _(T)?(e.consume(T),S(e.exit("chunkFlow")),r=0,t.interrupt=void 0,a):(e.consume(T),x)}function S(T,M){let O=t.sliceStream(T);if(M&&O.push(null),T.previous=o,o&&(o.next=T),o=T,i.defineSkip(T.start),i.write(O),t.parser.lazy[T.start.line]){let b=i.events.length;for(;b--;)if(i.events[b][1].start.offset<s&&(!i.events[b][1].end||i.events[b][1].end.offset>s))return;let E=t.events.length,R=E,C,y;for(;R--;)if(t.events[R][0]==="exit"&&t.events[R][1].type==="chunkFlow"){if(C){y=t.events[R][1].end;break}C=!0}for(w(r),b=E;b<t.events.length;)t.events[b][1].end={...y},b++;me(t.events,R+1,0,t.events.slice(E)),t.events.length=b}}function w(T){let M=n.length;for(;M-- >T;){let O=n[M];t.containerState=O[1],O[0].exit.call(t,e)}n.length=T}function D(){i.write([null]),o=void 0,i=void 0,t.containerState._closeFlow=void 0}}function rk(e,t,n){return P(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function vr(e){if(e===null||q(e)||Et(e))return 1;if(Vn(e))return 2}function hn(e,t,n){let r=[],i=-1;for(;++i<e.length;){let o=e[i].resolveAll;o&&!r.includes(o)&&(t=o(t,n),r.push(o))}return t}var Ni={name:"attention",resolveAll:ik,tokenize:ok};function ik(e,t){let n=-1,r,i,o,s,a,l,u,d;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;l=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;let c={...e[r][1].end},m={...e[n][1].start};Dp(c,-l),Dp(m,l),s={type:l>1?"strongSequence":"emphasisSequence",start:c,end:{...e[r][1].end}},a={type:l>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:m},o={type:l>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:l>1?"strong":"emphasis",start:{...s.start},end:{...a.end}},e[r][1].end={...s.start},e[n][1].start={...a.end},u=[],e[r][1].end.offset-e[r][1].start.offset&&(u=Le(u,[["enter",e[r][1],t],["exit",e[r][1],t]])),u=Le(u,[["enter",i,t],["enter",s,t],["exit",s,t],["enter",o,t]]),u=Le(u,hn(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),u=Le(u,[["exit",o,t],["enter",a,t],["exit",a,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(d=2,u=Le(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):d=0,me(e,r-1,n-r+3,u),n=r+u.length-d-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function ok(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=vr(r),o;return s;function s(l){return o=l,e.enter("attentionSequence"),a(l)}function a(l){if(l===o)return e.consume(l),a;let u=e.exit("attentionSequence"),d=vr(l),c=!d||d===2&&i||n.includes(l),m=!i||i===2&&d||n.includes(r);return u._open=!!(o===42?c:c&&(i||!m)),u._close=!!(o===42?m:m&&(d||!c)),t(l)}}function Dp(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var Ml={name:"autolink",tokenize:sk};function sk(e,t,n){let r=0;return i;function i(p){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(p){return fe(p)?(e.consume(p),s):p===64?n(p):u(p)}function s(p){return p===43||p===45||p===46||he(p)?(r=1,a(p)):u(p)}function a(p){return p===58?(e.consume(p),r=0,l):(p===43||p===45||p===46||he(p))&&r++<32?(e.consume(p),a):(r=0,u(p))}function l(p){return p===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):p===null||p===32||p===60||Gn(p)?n(p):(e.consume(p),l)}function u(p){return p===64?(e.consume(p),d):Ep(p)?(e.consume(p),u):n(p)}function d(p){return he(p)?c(p):n(p)}function c(p){return p===46?(e.consume(p),r=0,d):p===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):m(p)}function m(p){if((p===45||he(p))&&r++<63){let f=p===45?m:c;return e.consume(p),f}return n(p)}}var Ct={partial:!0,tokenize:ak};function ak(e,t,n){return r;function r(o){return L(o)?P(e,i,"linePrefix")(o):i(o)}function i(o){return o===null||_(o)?t(o):n(o)}}var Is={continuation:{tokenize:uk},exit:ck,name:"blockQuote",tokenize:lk};function lk(e,t,n){let r=this;return i;function i(s){if(s===62){let a=r.containerState;return a.open||(e.enter("blockQuote",{_container:!0}),a.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(s),e.exit("blockQuoteMarker"),o}return n(s)}function o(s){return L(s)?(e.enter("blockQuotePrefixWhitespace"),e.consume(s),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(s))}}function uk(e,t,n){let r=this;return i;function i(s){return L(s)?P(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s):o(s)}function o(s){return e.attempt(Is,t,n)(s)}}function ck(e){e.exit("blockQuote")}var _s={name:"characterEscape",tokenize:dk};function dk(e,t,n){return r;function r(o){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(o),e.exit("escapeMarker"),i}function i(o){return Ip(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(o)}}var As={name:"characterReference",tokenize:mk};function mk(e,t,n){let r=this,i=0,o,s;return a;function a(c){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(c),e.exit("characterReferenceMarker"),l}function l(c){return c===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(c),e.exit("characterReferenceMarkerNumeric"),u):(e.enter("characterReferenceValue"),o=31,s=he,d(c))}function u(c){return c===88||c===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(c),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,s=Cp,d):(e.enter("characterReferenceValue"),o=7,s=Ri,d(c))}function d(c){if(c===59&&i){let m=e.exit("characterReferenceValue");return s===he&&!Dr(r.sliceSerialize(m))?n(c):(e.enter("characterReferenceMarker"),e.consume(c),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return s(c)&&i++<o?(e.consume(c),d):n(c)}}var vp={partial:!0,tokenize:fk},Os={concrete:!0,name:"codeFenced",tokenize:pk};function pk(e,t,n){let r=this,i={partial:!0,tokenize:O},o=0,s=0,a;return l;function l(b){return u(b)}function u(b){let E=r.events[r.events.length-1];return o=E&&E[1].type==="linePrefix"?E[2].sliceSerialize(E[1],!0).length:0,a=b,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),d(b)}function d(b){return b===a?(s++,e.consume(b),d):s<3?n(b):(e.exit("codeFencedFenceSequence"),L(b)?P(e,c,"whitespace")(b):c(b))}function c(b){return b===null||_(b)?(e.exit("codeFencedFence"),r.interrupt?t(b):e.check(vp,x,M)(b)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),m(b))}function m(b){return b===null||_(b)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),c(b)):L(b)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),P(e,p,"whitespace")(b)):b===96&&b===a?n(b):(e.consume(b),m)}function p(b){return b===null||_(b)?c(b):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),f(b))}function f(b){return b===null||_(b)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),c(b)):b===96&&b===a?n(b):(e.consume(b),f)}function x(b){return e.attempt(i,M,S)(b)}function S(b){return e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),w}function w(b){return o>0&&L(b)?P(e,D,"linePrefix",o+1)(b):D(b)}function D(b){return b===null||_(b)?e.check(vp,x,M)(b):(e.enter("codeFlowValue"),T(b))}function T(b){return b===null||_(b)?(e.exit("codeFlowValue"),D(b)):(e.consume(b),T)}function M(b){return e.exit("codeFenced"),t(b)}function O(b,E,R){let C=0;return y;function y(z){return b.enter("lineEnding"),b.consume(z),b.exit("lineEnding"),Z}function Z(z){return b.enter("codeFencedFence"),L(z)?P(b,F,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(z):F(z)}function F(z){return z===a?(b.enter("codeFencedFenceSequence"),A(z)):R(z)}function A(z){return z===a?(C++,b.consume(z),A):C>=s?(b.exit("codeFencedFenceSequence"),L(z)?P(b,N,"whitespace")(z):N(z)):R(z)}function N(z){return z===null||_(z)?(b.exit("codeFencedFence"),E(z)):R(z)}}}function fk(e,t,n){let r=this;return i;function i(s){return s===null?n(s):(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),o)}function o(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}var Pi={name:"codeIndented",tokenize:gk},hk={partial:!0,tokenize:yk};function gk(e,t,n){let r=this;return i;function i(u){return e.enter("codeIndented"),P(e,o,"linePrefix",5)(u)}function o(u){let d=r.events[r.events.length-1];return d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?s(u):n(u)}function s(u){return u===null?l(u):_(u)?e.attempt(hk,s,l)(u):(e.enter("codeFlowValue"),a(u))}function a(u){return u===null||_(u)?(e.exit("codeFlowValue"),s(u)):(e.consume(u),a)}function l(u){return e.exit("codeIndented"),t(u)}}function yk(e,t,n){let r=this;return i;function i(s){return r.parser.lazy[r.now().line]?n(s):_(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),i):P(e,o,"linePrefix",5)(s)}function o(s){let a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(s):_(s)?i(s):n(s)}}var Rl={name:"codeText",previous:xk,resolve:wk,tokenize:bk};function wk(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(i=r):(r===t||e[r][1].type==="lineEnding")&&(e[i][1].type="codeTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function xk(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function bk(e,t,n){let r=this,i=0,o,s;return a;function a(m){return e.enter("codeText"),e.enter("codeTextSequence"),l(m)}function l(m){return m===96?(e.consume(m),i++,l):(e.exit("codeTextSequence"),u(m))}function u(m){return m===null?n(m):m===32?(e.enter("space"),e.consume(m),e.exit("space"),u):m===96?(s=e.enter("codeTextSequence"),o=0,c(m)):_(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),u):(e.enter("codeTextData"),d(m))}function d(m){return m===null||m===32||m===96||_(m)?(e.exit("codeTextData"),u(m)):(e.consume(m),d)}function c(m){return m===96?(e.consume(m),o++,c):o===i?(e.exit("codeTextSequence"),e.exit("codeText"),t(m)):(s.type="codeTextData",d(m))}}var Ds=class{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){let r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){let i=n||0;this.setCursor(Math.trunc(t));let o=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&Li(this.left,r),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),Li(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Li(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){let n=this.left.splice(t,Number.POSITIVE_INFINITY);Li(this.right,n.reverse())}else{let n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Li(this.left,n.reverse())}}};function Li(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function vs(e){let t={},n=-1,r,i,o,s,a,l,u,d=new Ds(e);for(;++n<d.length;){for(;n in t;)n=t[n];if(r=d.get(n),n&&r[1].type==="chunkFlow"&&d.get(n-1)[1].type==="listItemPrefix"&&(l=r[1]._tokenizer.events,o=0,o<l.length&&l[o][1].type==="lineEndingBlank"&&(o+=2),o<l.length&&l[o][1].type==="content"))for(;++o<l.length&&l[o][1].type!=="content";)l[o][1].type==="chunkText"&&(l[o][1]._isInFirstContentOfListItem=!0,o++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,kk(d,n)),n=t[n],u=!0);else if(r[1]._container){for(o=n,i=void 0;o--;)if(s=d.get(o),s[1].type==="lineEnding"||s[1].type==="lineEndingBlank")s[0]==="enter"&&(i&&(d.get(i)[1].type="lineEndingBlank"),s[1].type="lineEnding",i=o);else if(!(s[1].type==="linePrefix"||s[1].type==="listItemIndent"))break;i&&(r[1].end={...d.get(i)[1].start},a=d.slice(i,n),a.unshift(r),d.splice(i,n-i+1,a))}}return me(e,0,Number.POSITIVE_INFINITY,d.slice(0)),!u}function kk(e,t){let n=e.get(t)[1],r=e.get(t)[2],i=t-1,o=[],s=n._tokenizer;s||(s=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(s._contentTypeTextTrailing=!0));let a=s.events,l=[],u={},d,c,m=-1,p=n,f=0,x=0,S=[x];for(;p;){for(;e.get(++i)[1]!==p;);o.push(i),p._tokenizer||(d=r.sliceStream(p),p.next||d.push(null),c&&s.defineSkip(p.start),p._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=!0),s.write(d),p._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=void 0)),c=p,p=p.next}for(p=n;++m<a.length;)a[m][0]==="exit"&&a[m-1][0]==="enter"&&a[m][1].type===a[m-1][1].type&&a[m][1].start.line!==a[m][1].end.line&&(x=m+1,S.push(x),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(s.events=[],p?(p._tokenizer=void 0,p.previous=void 0):S.pop(),m=S.length;m--;){let w=a.slice(S[m],S[m+1]),D=o.pop();l.push([D,D+w.length-1]),e.splice(D,2,w)}for(l.reverse(),m=-1;++m<l.length;)u[f+l[m][0]]=f+l[m][1],f+=l[m][1]-l[m][0]-1;return u}var Nl={resolve:Tk,tokenize:Ek},Sk={partial:!0,tokenize:Ck};function Tk(e){return vs(e),e}function Ek(e,t){let n;return r;function r(a){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(a)}function i(a){return a===null?o(a):_(a)?e.check(Sk,s,o)(a):(e.consume(a),i)}function o(a){return e.exit("chunkContent"),e.exit("content"),t(a)}function s(a){return e.consume(a),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function Ck(e,t,n){let r=this;return i;function i(s){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),P(e,o,"linePrefix")}function o(s){if(s===null||_(s))return n(s);let a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(s):e.interrupt(r.parser.constructs.flow,n,t)(s)}}function Ms(e,t,n,r,i,o,s,a,l){let u=l||Number.POSITIVE_INFINITY,d=0;return c;function c(w){return w===60?(e.enter(r),e.enter(i),e.enter(o),e.consume(w),e.exit(o),m):w===null||w===32||w===41||Gn(w)?n(w):(e.enter(r),e.enter(s),e.enter(a),e.enter("chunkString",{contentType:"string"}),x(w))}function m(w){return w===62?(e.enter(o),e.consume(w),e.exit(o),e.exit(i),e.exit(r),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),p(w))}function p(w){return w===62?(e.exit("chunkString"),e.exit(a),m(w)):w===null||w===60||_(w)?n(w):(e.consume(w),w===92?f:p)}function f(w){return w===60||w===62||w===92?(e.consume(w),p):p(w)}function x(w){return!d&&(w===null||w===41||q(w))?(e.exit("chunkString"),e.exit(a),e.exit(s),e.exit(r),t(w)):d<u&&w===40?(e.consume(w),d++,x):w===41?(e.consume(w),d--,x):w===null||w===32||w===40||Gn(w)?n(w):(e.consume(w),w===92?S:x)}function S(w){return w===40||w===41||w===92?(e.consume(w),x):x(w)}}function Rs(e,t,n,r,i,o){let s=this,a=0,l;return u;function u(p){return e.enter(r),e.enter(i),e.consume(p),e.exit(i),e.enter(o),d}function d(p){return a>999||p===null||p===91||p===93&&!l||p===94&&!a&&"_hiddenFootnoteSupport"in s.parser.constructs?n(p):p===93?(e.exit(o),e.enter(i),e.consume(p),e.exit(i),e.exit(r),t):_(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),d):(e.enter("chunkString",{contentType:"string"}),c(p))}function c(p){return p===null||p===91||p===93||_(p)||a++>999?(e.exit("chunkString"),d(p)):(e.consume(p),l||(l=!L(p)),p===92?m:c)}function m(p){return p===91||p===92||p===93?(e.consume(p),a++,c):c(p)}}function Ns(e,t,n,r,i,o){let s;return a;function a(m){return m===34||m===39||m===40?(e.enter(r),e.enter(i),e.consume(m),e.exit(i),s=m===40?41:m,l):n(m)}function l(m){return m===s?(e.enter(i),e.consume(m),e.exit(i),e.exit(r),t):(e.enter(o),u(m))}function u(m){return m===s?(e.exit(o),l(s)):m===null?n(m):_(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),P(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),d(m))}function d(m){return m===s||m===null||_(m)?(e.exit("chunkString"),u(m)):(e.consume(m),m===92?c:d)}function c(m){return m===s||m===92?(e.consume(m),d):d(m)}}function Yn(e,t){let n;return r;function r(i){return _(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):L(i)?P(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}var Pl={name:"definition",tokenize:_k},Ik={partial:!0,tokenize:Ak};function _k(e,t,n){let r=this,i;return o;function o(p){return e.enter("definition"),s(p)}function s(p){return Rs.call(r,e,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function a(p){return i=Oe(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),p===58?(e.enter("definitionMarker"),e.consume(p),e.exit("definitionMarker"),l):n(p)}function l(p){return q(p)?Yn(e,u)(p):u(p)}function u(p){return Ms(e,d,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function d(p){return e.attempt(Ik,c,c)(p)}function c(p){return L(p)?P(e,m,"whitespace")(p):m(p)}function m(p){return p===null||_(p)?(e.exit("definition"),r.parser.defined.push(i),t(p)):n(p)}}function Ak(e,t,n){return r;function r(a){return q(a)?Yn(e,i)(a):n(a)}function i(a){return Ns(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function o(a){return L(a)?P(e,s,"whitespace")(a):s(a)}function s(a){return a===null||_(a)?t(a):n(a)}}var Ll={name:"hardBreakEscape",tokenize:Ok};function Ok(e,t,n){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),i}function i(o){return _(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}var Fl={name:"headingAtx",resolve:Dk,tokenize:vk};function Dk(e,t){let n=e.length-2,r=3,i,o;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},o={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},me(e,r,n-r+1,[["enter",i,t],["enter",o,t],["exit",o,t],["exit",i,t]])),e}function vk(e,t,n){let r=0;return i;function i(d){return e.enter("atxHeading"),o(d)}function o(d){return e.enter("atxHeadingSequence"),s(d)}function s(d){return d===35&&r++<6?(e.consume(d),s):d===null||q(d)?(e.exit("atxHeadingSequence"),a(d)):n(d)}function a(d){return d===35?(e.enter("atxHeadingSequence"),l(d)):d===null||_(d)?(e.exit("atxHeading"),t(d)):L(d)?P(e,a,"whitespace")(d):(e.enter("atxHeadingText"),u(d))}function l(d){return d===35?(e.consume(d),l):(e.exit("atxHeadingSequence"),a(d))}function u(d){return d===null||d===35||q(d)?(e.exit("atxHeadingText"),a(d)):(e.consume(d),u)}}var Mp=["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"],$l=["pre","script","style","textarea"];var Ul={concrete:!0,name:"htmlFlow",resolveTo:Nk,tokenize:Pk},Mk={partial:!0,tokenize:Fk},Rk={partial:!0,tokenize:Lk};function Nk(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function Pk(e,t,n){let r=this,i,o,s,a,l;return u;function u(g){return d(g)}function d(g){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(g),c}function c(g){return g===33?(e.consume(g),m):g===47?(e.consume(g),o=!0,x):g===63?(e.consume(g),i=3,r.interrupt?t:h):fe(g)?(e.consume(g),s=String.fromCharCode(g),S):n(g)}function m(g){return g===45?(e.consume(g),i=2,p):g===91?(e.consume(g),i=5,a=0,f):fe(g)?(e.consume(g),i=4,r.interrupt?t:h):n(g)}function p(g){return g===45?(e.consume(g),r.interrupt?t:h):n(g)}function f(g){let Ve="CDATA[";return g===Ve.charCodeAt(a++)?(e.consume(g),a===Ve.length?r.interrupt?t:F:f):n(g)}function x(g){return fe(g)?(e.consume(g),s=String.fromCharCode(g),S):n(g)}function S(g){if(g===null||g===47||g===62||q(g)){let Ve=g===47,$n=s.toLowerCase();return!Ve&&!o&&$l.includes($n)?(i=1,r.interrupt?t(g):F(g)):Mp.includes(s.toLowerCase())?(i=6,Ve?(e.consume(g),w):r.interrupt?t(g):F(g)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(g):o?D(g):T(g))}return g===45||he(g)?(e.consume(g),s+=String.fromCharCode(g),S):n(g)}function w(g){return g===62?(e.consume(g),r.interrupt?t:F):n(g)}function D(g){return L(g)?(e.consume(g),D):y(g)}function T(g){return g===47?(e.consume(g),y):g===58||g===95||fe(g)?(e.consume(g),M):L(g)?(e.consume(g),T):y(g)}function M(g){return g===45||g===46||g===58||g===95||he(g)?(e.consume(g),M):O(g)}function O(g){return g===61?(e.consume(g),b):L(g)?(e.consume(g),O):T(g)}function b(g){return g===null||g===60||g===61||g===62||g===96?n(g):g===34||g===39?(e.consume(g),l=g,E):L(g)?(e.consume(g),b):R(g)}function E(g){return g===l?(e.consume(g),l=null,C):g===null||_(g)?n(g):(e.consume(g),E)}function R(g){return g===null||g===34||g===39||g===47||g===60||g===61||g===62||g===96||q(g)?O(g):(e.consume(g),R)}function C(g){return g===47||g===62||L(g)?T(g):n(g)}function y(g){return g===62?(e.consume(g),Z):n(g)}function Z(g){return g===null||_(g)?F(g):L(g)?(e.consume(g),Z):n(g)}function F(g){return g===45&&i===2?(e.consume(g),te):g===60&&i===1?(e.consume(g),se):g===62&&i===4?(e.consume(g),Qe):g===63&&i===3?(e.consume(g),h):g===93&&i===5?(e.consume(g),J):_(g)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(Mk,Ut,A)(g)):g===null||_(g)?(e.exit("htmlFlowData"),A(g)):(e.consume(g),F)}function A(g){return e.check(Rk,N,Ut)(g)}function N(g){return e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),z}function z(g){return g===null||_(g)?A(g):(e.enter("htmlFlowData"),F(g))}function te(g){return g===45?(e.consume(g),h):F(g)}function se(g){return g===47?(e.consume(g),s="",Ne):F(g)}function Ne(g){if(g===62){let Ve=s.toLowerCase();return $l.includes(Ve)?(e.consume(g),Qe):F(g)}return fe(g)&&s.length<8?(e.consume(g),s+=String.fromCharCode(g),Ne):F(g)}function J(g){return g===93?(e.consume(g),h):F(g)}function h(g){return g===62?(e.consume(g),Qe):g===45&&i===2?(e.consume(g),h):F(g)}function Qe(g){return g===null||_(g)?(e.exit("htmlFlowData"),Ut(g)):(e.consume(g),Qe)}function Ut(g){return e.exit("htmlFlow"),t(g)}}function Lk(e,t,n){let r=this;return i;function i(s){return _(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),o):n(s)}function o(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}function Fk(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(Ct,t,n)}}var zl={name:"htmlText",tokenize:$k};function $k(e,t,n){let r=this,i,o,s;return a;function a(h){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(h),l}function l(h){return h===33?(e.consume(h),u):h===47?(e.consume(h),O):h===63?(e.consume(h),T):fe(h)?(e.consume(h),R):n(h)}function u(h){return h===45?(e.consume(h),d):h===91?(e.consume(h),o=0,f):fe(h)?(e.consume(h),D):n(h)}function d(h){return h===45?(e.consume(h),p):n(h)}function c(h){return h===null?n(h):h===45?(e.consume(h),m):_(h)?(s=c,se(h)):(e.consume(h),c)}function m(h){return h===45?(e.consume(h),p):c(h)}function p(h){return h===62?te(h):h===45?m(h):c(h)}function f(h){let Qe="CDATA[";return h===Qe.charCodeAt(o++)?(e.consume(h),o===Qe.length?x:f):n(h)}function x(h){return h===null?n(h):h===93?(e.consume(h),S):_(h)?(s=x,se(h)):(e.consume(h),x)}function S(h){return h===93?(e.consume(h),w):x(h)}function w(h){return h===62?te(h):h===93?(e.consume(h),w):x(h)}function D(h){return h===null||h===62?te(h):_(h)?(s=D,se(h)):(e.consume(h),D)}function T(h){return h===null?n(h):h===63?(e.consume(h),M):_(h)?(s=T,se(h)):(e.consume(h),T)}function M(h){return h===62?te(h):T(h)}function O(h){return fe(h)?(e.consume(h),b):n(h)}function b(h){return h===45||he(h)?(e.consume(h),b):E(h)}function E(h){return _(h)?(s=E,se(h)):L(h)?(e.consume(h),E):te(h)}function R(h){return h===45||he(h)?(e.consume(h),R):h===47||h===62||q(h)?C(h):n(h)}function C(h){return h===47?(e.consume(h),te):h===58||h===95||fe(h)?(e.consume(h),y):_(h)?(s=C,se(h)):L(h)?(e.consume(h),C):te(h)}function y(h){return h===45||h===46||h===58||h===95||he(h)?(e.consume(h),y):Z(h)}function Z(h){return h===61?(e.consume(h),F):_(h)?(s=Z,se(h)):L(h)?(e.consume(h),Z):C(h)}function F(h){return h===null||h===60||h===61||h===62||h===96?n(h):h===34||h===39?(e.consume(h),i=h,A):_(h)?(s=F,se(h)):L(h)?(e.consume(h),F):(e.consume(h),N)}function A(h){return h===i?(e.consume(h),i=void 0,z):h===null?n(h):_(h)?(s=A,se(h)):(e.consume(h),A)}function N(h){return h===null||h===34||h===39||h===60||h===61||h===96?n(h):h===47||h===62||q(h)?C(h):(e.consume(h),N)}function z(h){return h===47||h===62||q(h)?C(h):n(h)}function te(h){return h===62?(e.consume(h),e.exit("htmlTextData"),e.exit("htmlText"),t):n(h)}function se(h){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),Ne}function Ne(h){return L(h)?P(e,J,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(h):J(h)}function J(h){return e.enter("htmlTextData"),s(h)}}var Zn={name:"labelEnd",resolveAll:qk,resolveTo:jk,tokenize:Hk},Uk={tokenize:Wk},zk={tokenize:Gk},Bk={tokenize:Vk};function qk(e){let t=-1,n=[];for(;++t<e.length;){let r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){let i=r.type==="labelImage"?4:2;r.type="data",t+=i}}return e.length!==n.length&&me(e,0,e.length,n),e}function jk(e,t){let n=e.length,r=0,i,o,s,a;for(;n--;)if(i=e[n][1],o){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(s){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(o=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(s=n);let l={type:e[o][1].type==="labelLink"?"link":"image",start:{...e[o][1].start},end:{...e[e.length-1][1].end}},u={type:"label",start:{...e[o][1].start},end:{...e[s][1].end}},d={type:"labelText",start:{...e[o+r+2][1].end},end:{...e[s-2][1].start}};return a=[["enter",l,t],["enter",u,t]],a=Le(a,e.slice(o+1,o+r+3)),a=Le(a,[["enter",d,t]]),a=Le(a,hn(t.parser.constructs.insideSpan.null,e.slice(o+r+4,s-3),t)),a=Le(a,[["exit",d,t],e[s-2],e[s-1],["exit",u,t]]),a=Le(a,e.slice(s+1)),a=Le(a,[["exit",l,t]]),me(e,o,e.length,a),e}function Hk(e,t,n){let r=this,i=r.events.length,o,s;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){o=r.events[i][1];break}return a;function a(m){return o?o._inactive?c(m):(s=r.parser.defined.includes(Oe(r.sliceSerialize({start:o.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(m),e.exit("labelMarker"),e.exit("labelEnd"),l):n(m)}function l(m){return m===40?e.attempt(Uk,d,s?d:c)(m):m===91?e.attempt(zk,d,s?u:c)(m):s?d(m):c(m)}function u(m){return e.attempt(Bk,d,c)(m)}function d(m){return t(m)}function c(m){return o._balanced=!0,n(m)}}function Wk(e,t,n){return r;function r(c){return e.enter("resource"),e.enter("resourceMarker"),e.consume(c),e.exit("resourceMarker"),i}function i(c){return q(c)?Yn(e,o)(c):o(c)}function o(c){return c===41?d(c):Ms(e,s,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(c)}function s(c){return q(c)?Yn(e,l)(c):d(c)}function a(c){return n(c)}function l(c){return c===34||c===39||c===40?Ns(e,u,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(c):d(c)}function u(c){return q(c)?Yn(e,d)(c):d(c)}function d(c){return c===41?(e.enter("resourceMarker"),e.consume(c),e.exit("resourceMarker"),e.exit("resource"),t):n(c)}}function Gk(e,t,n){let r=this;return i;function i(a){return Rs.call(r,e,o,s,"reference","referenceMarker","referenceString")(a)}function o(a){return r.parser.defined.includes(Oe(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(a):n(a)}function s(a){return n(a)}}function Vk(e,t,n){return r;function r(o){return e.enter("reference"),e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),i}function i(o){return o===93?(e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),e.exit("reference"),t):n(o)}}var Bl={name:"labelStartImage",resolveAll:Zn.resolveAll,tokenize:Yk};function Yk(e,t,n){let r=this;return i;function i(a){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(a),e.exit("labelImageMarker"),o}function o(a){return a===91?(e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelImage"),s):n(a)}function s(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):t(a)}}var ql={name:"labelStartLink",resolveAll:Zn.resolveAll,tokenize:Zk};function Zk(e,t,n){let r=this;return i;function i(s){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(s),e.exit("labelMarker"),e.exit("labelLink"),o}function o(s){return s===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(s):t(s)}}var Fi={name:"lineEnding",tokenize:Kk};function Kk(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),P(e,t,"linePrefix")}}var Kn={name:"thematicBreak",tokenize:Jk};function Jk(e,t,n){let r=0,i;return o;function o(u){return e.enter("thematicBreak"),s(u)}function s(u){return i=u,a(u)}function a(u){return u===i?(e.enter("thematicBreakSequence"),l(u)):r>=3&&(u===null||_(u))?(e.exit("thematicBreak"),t(u)):n(u)}function l(u){return u===i?(e.consume(u),r++,l):(e.exit("thematicBreakSequence"),L(u)?P(e,a,"whitespace")(u):a(u))}}var De={continuation:{tokenize:tS},exit:rS,name:"list",tokenize:eS},Xk={partial:!0,tokenize:iS},Qk={partial:!0,tokenize:nS};function eS(e,t,n){let r=this,i=r.events[r.events.length-1],o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,s=0;return a;function a(p){let f=r.containerState.type||(p===42||p===43||p===45?"listUnordered":"listOrdered");if(f==="listUnordered"?!r.containerState.marker||p===r.containerState.marker:Ri(p)){if(r.containerState.type||(r.containerState.type=f,e.enter(f,{_container:!0})),f==="listUnordered")return e.enter("listItemPrefix"),p===42||p===45?e.check(Kn,n,u)(p):u(p);if(!r.interrupt||p===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(p)}return n(p)}function l(p){return Ri(p)&&++s<10?(e.consume(p),l):(!r.interrupt||s<2)&&(r.containerState.marker?p===r.containerState.marker:p===41||p===46)?(e.exit("listItemValue"),u(p)):n(p)}function u(p){return e.enter("listItemMarker"),e.consume(p),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||p,e.check(Ct,r.interrupt?n:d,e.attempt(Xk,m,c))}function d(p){return r.containerState.initialBlankLine=!0,o++,m(p)}function c(p){return L(p)?(e.enter("listItemPrefixWhitespace"),e.consume(p),e.exit("listItemPrefixWhitespace"),m):n(p)}function m(p){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(p)}}function tS(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(Ct,i,o);function i(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,P(e,t,"listItemIndent",r.containerState.size+1)(a)}function o(a){return r.containerState.furtherBlankLines||!L(a)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,s(a)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(Qk,t,s)(a))}function s(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,P(e,e.attempt(De,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function nS(e,t,n){let r=this;return P(e,i,"listItemIndent",r.containerState.size+1);function i(o){let s=r.events[r.events.length-1];return s&&s[1].type==="listItemIndent"&&s[2].sliceSerialize(s[1],!0).length===r.containerState.size?t(o):n(o)}}function rS(e){e.exit(this.containerState.type)}function iS(e,t,n){let r=this;return P(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(o){let s=r.events[r.events.length-1];return!L(o)&&s&&s[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}var Ps={name:"setextUnderline",resolveTo:oS,tokenize:sS};function oS(e,t){let n=e.length,r,i,o;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!o&&e[n][1].type==="definition"&&(o=n);let s={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",o?(e.splice(i,0,["enter",s,t]),e.splice(o+1,0,["exit",e[r][1],t]),e[r][1].end={...e[o][1].end}):e[r][1]=s,e.push(["exit",s,t]),e}function sS(e,t,n){let r=this,i;return o;function o(u){let d=r.events.length,c;for(;d--;)if(r.events[d][1].type!=="lineEnding"&&r.events[d][1].type!=="linePrefix"&&r.events[d][1].type!=="content"){c=r.events[d][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||c)?(e.enter("setextHeadingLine"),i=u,s(u)):n(u)}function s(u){return e.enter("setextHeadingLineSequence"),a(u)}function a(u){return u===i?(e.consume(u),a):(e.exit("setextHeadingLineSequence"),L(u)?P(e,l,"lineSuffix")(u):l(u))}function l(u){return u===null||_(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}var Rp={tokenize:aS};function aS(e){let t=this,n=e.attempt(Ct,r,e.attempt(this.parser.constructs.flowInitial,i,P(e,e.attempt(this.parser.constructs.flow,i,e.attempt(Nl,i)),"linePrefix")));return n;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,n}}var Np={resolveAll:$p()},Pp=Fp("string"),Lp=Fp("text");function Fp(e){return{resolveAll:$p(e==="text"?lS:void 0),tokenize:t};function t(n){let r=this,i=this.parser.constructs[e],o=n.attempt(i,s,a);return s;function s(d){return u(d)?o(d):a(d)}function a(d){if(d===null){n.consume(d);return}return n.enter("data"),n.consume(d),l}function l(d){return u(d)?(n.exit("data"),o(d)):(n.consume(d),l)}function u(d){if(d===null)return!0;let c=i[d],m=-1;if(c)for(;++m<c.length;){let p=c[m];if(!p.previous||p.previous.call(r,r.previous))return!0}return!1}}}function $p(e){return t;function t(n,r){let i=-1,o;for(;++i<=n.length;)o===void 0?n[i]&&n[i][1].type==="data"&&(o=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==o+2&&(n[o][1].end=n[i-1][1].end,n.splice(o+2,i-o-2),i=o+2),o=void 0);return e?e(n,r):n}}function lS(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){let r=e[n-1][1],i=t.sliceStream(r),o=i.length,s=-1,a=0,l;for(;o--;){let u=i[o];if(typeof u=="string"){for(s=u.length;u.charCodeAt(s-1)===32;)a++,s--;if(s)break;s=-1}else if(u===-2)l=!0,a++;else if(u!==-1){o++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(a=0),a){let u={type:n===e.length||l||a<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?s:r.start._bufferIndex+s,_index:r.start._index+o,line:r.end.line,column:r.end.column-a,offset:r.end.offset-a},end:{...r.end}};r.end={...u.start},r.start.offset===r.end.offset?Object.assign(r,u):(e.splice(n,0,["enter",u,t],["exit",u,t]),n+=2)}n++}return e}var jl={};em(jl,{attentionMarkers:()=>gS,contentInitial:()=>cS,disable:()=>yS,document:()=>uS,flow:()=>mS,flowInitial:()=>dS,insideSpan:()=>hS,string:()=>pS,text:()=>fS});var uS={42:De,43:De,45:De,48:De,49:De,50:De,51:De,52:De,53:De,54:De,55:De,56:De,57:De,62:Is},cS={91:Pl},dS={[-2]:Pi,[-1]:Pi,32:Pi},mS={35:Fl,42:Kn,45:[Ps,Kn],60:Ul,61:Ps,95:Kn,96:Os,126:Os},pS={38:As,92:_s},fS={[-5]:Fi,[-4]:Fi,[-3]:Fi,33:Bl,38:As,42:Ni,60:[Ml,zl],91:ql,92:[Ll,_s],93:Zn,95:Ni,96:Rl},hS={null:[Ni,Np]},gS={null:[42,95]},yS={null:[]};function Up(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},i={},o=[],s=[],a=[],l=!0,u={attempt:C(E),check:C(R),consume:M,enter:O,exit:b,interrupt:C(R,{interrupt:!0})},d={code:null,containerState:{},defineSkip:w,events:[],now:S,parser:e,previous:null,sliceSerialize:f,sliceStream:x,write:p},c=t.tokenize.call(d,u),m;return t.resolveAll&&o.push(t),d;function p(A){return s=Le(s,A),D(),s[s.length-1]!==null?[]:(y(t,0),d.events=hn(o,d.events,d),d.events)}function f(A,N){return xS(x(A),N)}function x(A){return wS(s,A)}function S(){let{_bufferIndex:A,_index:N,line:z,column:te,offset:se}=r;return{_bufferIndex:A,_index:N,line:z,column:te,offset:se}}function w(A){i[A.line]=A.column,F()}function D(){let A;for(;r._index<s.length;){let N=s[r._index];if(typeof N=="string")for(A=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===A&&r._bufferIndex<N.length;)T(N.charCodeAt(r._bufferIndex));else T(N)}}function T(A){l=void 0,m=A,c=c(A)}function M(A){_(A)?(r.line++,r.column=1,r.offset+=A===-3?2:1,F()):A!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===s[r._index].length&&(r._bufferIndex=-1,r._index++)),d.previous=A,l=!0}function O(A,N){let z=N||{};return z.type=A,z.start=S(),d.events.push(["enter",z,d]),a.push(z),z}function b(A){let N=a.pop();return N.end=S(),d.events.push(["exit",N,d]),N}function E(A,N){y(A,N.from)}function R(A,N){N.restore()}function C(A,N){return z;function z(te,se,Ne){let J,h,Qe,Ut;return Array.isArray(te)?Ve(te):"tokenize"in te?Ve([te]):g(te);function g(Ee){return yi;function yi(zt){let Un=zt!==null&&Ee[zt],Tr=zt!==null&&Ee.null,Ha=[...Array.isArray(Un)?Un:Un?[Un]:[],...Array.isArray(Tr)?Tr:Tr?[Tr]:[]];return Ve(Ha)(zt)}}function Ve(Ee){return J=Ee,h=0,Ee.length===0?Ne:$n(Ee[h])}function $n(Ee){return yi;function yi(zt){return Ut=Z(),Qe=Ee,Ee.partial||(d.currentConstruct=Ee),Ee.name&&d.parser.constructs.disable.null.includes(Ee.name)?ns(zt):Ee.tokenize.call(N?Object.assign(Object.create(d),N):d,u,ja,ns)(zt)}}function ja(Ee){return l=!0,A(Qe,Ut),se}function ns(Ee){return l=!0,Ut.restore(),++h<J.length?$n(J[h]):Ne}}}function y(A,N){A.resolveAll&&!o.includes(A)&&o.push(A),A.resolve&&me(d.events,N,d.events.length-N,A.resolve(d.events.slice(N),d)),A.resolveTo&&(d.events=A.resolveTo(d.events,d))}function Z(){let A=S(),N=d.previous,z=d.currentConstruct,te=d.events.length,se=Array.from(a);return{from:te,restore:Ne};function Ne(){r=A,d.previous=N,d.currentConstruct=z,d.events.length=te,a=se,F()}}function F(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function wS(e,t){let n=t.start._index,r=t.start._bufferIndex,i=t.end._index,o=t.end._bufferIndex,s;if(n===i)s=[e[n].slice(r,o)];else{if(s=e.slice(n,i),r>-1){let a=s[0];typeof a=="string"?s[0]=a.slice(r):s.shift()}o>0&&s.push(e[i].slice(0,o))}return s}function xS(e,t){let n=-1,r=[],i;for(;++n<e.length;){let o=e[n],s;if(typeof o=="string")s=o;else switch(o){case-5:{s="\r";break}case-4:{s=`
|
|
57
57
|
`;break}case-3:{s=`\r
|
|
58
|
-
`;break}case-2:{s=t?" ":" ";break}case-1:{if(!t&&i)continue;s=" ";break}default:s=String.fromCharCode(o)}i=o===-2,r.push(s)}return r.join("")}function Fl(e){let r={constructs:ks([Ll,...(e||{}).extensions||[]]),content:i(wp),defined:[],document:i(bp),flow:i(Ep),lazy:{},string:i(Ip),text:i(_p)};return r;function i(o){return s;function s(a){return Dp(r,o,a)}}}function $l(e){for(;!_s(e););return e}var vp=/[\0\t\n\r]/g;function Ul(){let e=1,t="",n=!0,r;return i;function i(o,s,a){let l=[],u,d,c,m,p;for(o=t+(typeof o=="string"?o.toString():new TextDecoder(s||void 0).decode(o)),c=0,t="",n&&(o.charCodeAt(0)===65279&&c++,n=void 0);c<o.length;){if(vp.lastIndex=c,u=vp.exec(o),m=u&&u.index!==void 0?u.index:o.length,p=o.charCodeAt(m),!u){t=o.slice(c);break}if(p===10&&c===m&&r)l.push(-3),r=void 0;else switch(r&&(l.push(-5),r=void 0),c<m&&(l.push(o.slice(c,m)),e+=m-c),p){case 0:{l.push(65533),e++;break}case 9:{for(d=Math.ceil(e/4)*4,l.push(-2);e++<d;)l.push(-1);break}case 10:{l.push(-4),e=1;break}default:r=!0,e=1}c=m+1}return a&&(r&&l.push(-5),t&&l.push(t),l.push(null)),l}}function Dr(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Rp(e.position):"start"in e||"end"in e?Rp(e):"line"in e||"column"in e?zl(e):""}function zl(e){return Mp(e&&e.line)+":"+Mp(e&&e.column)}function Rp(e){return zl(e&&e.start)+"-"+zl(e&&e.end)}function Mp(e){return e&&typeof e=="number"?e:1}var Pp={}.hasOwnProperty;function Bl(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),a0(n)($l(Fl(n).document().write(Ul()(e,t,!0))))}function a0(e){let t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(Wd),autolinkProtocol:C,autolinkEmail:C,atxHeading:o(qd),blockQuote:o(Ut),characterEscape:C,characterReference:C,codeFenced:o($n),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:o($n,s),codeText:o(Sr,s),codeTextData:C,data:C,codeFlowValue:C,definition:o(za),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:o(Hw),hardBreakEscape:o(jd),hardBreakTrailing:o(jd),htmlFlow:o(Hd,s),htmlFlowData:C,htmlText:o(Hd,s),htmlTextData:C,image:o(Ww),label:s,link:o(Wd),listItem:o(Gw),listItemValue:m,listOrdered:o(Gd,c),listUnordered:o(Gd),paragraph:o(Vw),reference:g,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:o(qd),strong:o(Yw),thematicBreak:o(Kw)},exit:{atxHeading:l(),atxHeadingSequence:O,autolink:l(),autolinkEmail:hi,autolinkProtocol:Ee,blockQuote:l(),characterEscapeValue:y,characterReferenceMarkerHexadecimal:Fn,characterReferenceMarkerNumeric:Fn,characterReferenceValue:Ua,characterReference:Xo,codeFenced:l(S),codeFencedFence:x,codeFencedFenceInfo:p,codeFencedFenceMeta:f,codeFlowValue:y,codeIndented:l(w),codeText:l(U),codeTextData:y,data:y,definition:l(),definitionDestinationString:R,definitionLabelString:D,definitionTitleString:T,emphasis:l(),hardBreakEscape:l(F),hardBreakTrailing:l(F),htmlFlow:l(A),htmlFlowData:y,htmlText:l(N),htmlTextData:y,image:l(oe),label:J,labelText:Ne,lineEnding:Z,link:l(te),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:Ge,resourceDestinationString:h,resourceTitleString:Qe,resource:$t,setextHeading:l(M),setextHeadingLineSequence:E,setextHeadingText:b,strong:l(),thematicBreak:l()}};Lp(t,(e||{}).mdastExtensions||[]);let n={};return r;function r(k){let I={type:"root",children:[]},z={stack:[I],tokenStack:[],config:t,enter:a,exit:u,buffer:s,resume:d,data:n},G=[],Q=-1;for(;++Q<k.length;)if(k[Q][1].type==="listOrdered"||k[Q][1].type==="listUnordered")if(k[Q][0]==="enter")G.push(Q);else{let mt=G.pop();Q=i(k,mt,Q)}for(Q=-1;++Q<k.length;){let mt=t[k[Q][0]];Pp.call(mt,k[Q][1].type)&&mt[k[Q][1].type].call(Object.assign({sliceSerialize:k[Q][2].sliceSerialize},z),k[Q][1])}if(z.tokenStack.length>0){let mt=z.tokenStack[z.tokenStack.length-1];(mt[1]||Np).call(z,void 0,mt[0])}for(I.position={start:hn(k.length>0?k[0][1].start:{line:1,column:1,offset:0}),end:hn(k.length>0?k[k.length-2][1].end:{line:1,column:1,offset:0})},Q=-1;++Q<t.transforms.length;)I=t.transforms[Q](I)||I;return I}function i(k,I,z){let G=I-1,Q=-1,mt=!1,Un,zt,gi,yi;for(;++G<=z;){let Ve=k[G];switch(Ve[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Ve[0]==="enter"?Q++:Q--,yi=void 0;break}case"lineEndingBlank":{Ve[0]==="enter"&&(Un&&!yi&&!Q&&!gi&&(gi=G),yi=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:yi=void 0}if(!Q&&Ve[0]==="enter"&&Ve[1].type==="listItemPrefix"||Q===-1&&Ve[0]==="exit"&&(Ve[1].type==="listUnordered"||Ve[1].type==="listOrdered")){if(Un){let Tr=G;for(zt=void 0;Tr--;){let Bt=k[Tr];if(Bt[1].type==="lineEnding"||Bt[1].type==="lineEndingBlank"){if(Bt[0]==="exit")continue;zt&&(k[zt][1].type="lineEndingBlank",mt=!0),Bt[1].type="lineEnding",zt=Tr}else if(!(Bt[1].type==="linePrefix"||Bt[1].type==="blockQuotePrefix"||Bt[1].type==="blockQuotePrefixWhitespace"||Bt[1].type==="blockQuoteMarker"||Bt[1].type==="listItemIndent"))break}gi&&(!zt||gi<zt)&&(Un._spread=!0),Un.end=Object.assign({},zt?k[zt][1].start:Ve[1].end),k.splice(zt||G,0,["exit",Un,Ve[2]]),G++,z++}if(Ve[1].type==="listItemPrefix"){let Tr={type:"listItem",_spread:!1,start:Object.assign({},Ve[1].start),end:void 0};Un=Tr,k.splice(G,0,["enter",Tr,Ve[2]]),G++,z++,gi=void 0,yi=!0}}}return k[I][1]._spread=mt,z}function o(k,I){return z;function z(G){a.call(this,k(G),G),I&&I.call(this,G)}}function s(){this.stack.push({type:"fragment",children:[]})}function a(k,I,z){this.stack[this.stack.length-1].children.push(k),this.stack.push(k),this.tokenStack.push([I,z||void 0]),k.position={start:hn(I.start),end:void 0}}function l(k){return I;function I(z){k&&k.call(this,z),u.call(this,z)}}function u(k,I){let z=this.stack.pop(),G=this.tokenStack.pop();if(G)G[0].type!==k.type&&(I?I.call(this,k,G[0]):(G[1]||Np).call(this,k,G[0]));else throw new Error("Cannot close `"+k.type+"` ("+Dr({start:k.start,end:k.end})+"): it\u2019s not open");z.position.end=hn(k.end)}function d(){return El(this.stack.pop())}function c(){this.data.expectingFirstListItemValue=!0}function m(k){if(this.data.expectingFirstListItemValue){let I=this.stack[this.stack.length-2];I.start=Number.parseInt(this.sliceSerialize(k),10),this.data.expectingFirstListItemValue=void 0}}function p(){let k=this.resume(),I=this.stack[this.stack.length-1];I.lang=k}function f(){let k=this.resume(),I=this.stack[this.stack.length-1];I.meta=k}function x(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function S(){let k=this.resume(),I=this.stack[this.stack.length-1];I.value=k.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function w(){let k=this.resume(),I=this.stack[this.stack.length-1];I.value=k.replace(/(\r?\n|\r)$/g,"")}function D(k){let I=this.resume(),z=this.stack[this.stack.length-1];z.label=I,z.identifier=Oe(this.sliceSerialize(k)).toLowerCase()}function T(){let k=this.resume(),I=this.stack[this.stack.length-1];I.title=k}function R(){let k=this.resume(),I=this.stack[this.stack.length-1];I.url=k}function O(k){let I=this.stack[this.stack.length-1];if(!I.depth){let z=this.sliceSerialize(k).length;I.depth=z}}function b(){this.data.setextHeadingSlurpLineEnding=!0}function E(k){let I=this.stack[this.stack.length-1];I.depth=this.sliceSerialize(k).codePointAt(0)===61?1:2}function M(){this.data.setextHeadingSlurpLineEnding=void 0}function C(k){let z=this.stack[this.stack.length-1].children,G=z[z.length-1];(!G||G.type!=="text")&&(G=Zw(),G.position={start:hn(k.start),end:void 0},z.push(G)),this.stack.push(G)}function y(k){let I=this.stack.pop();I.value+=this.sliceSerialize(k),I.position.end=hn(k.end)}function Z(k){let I=this.stack[this.stack.length-1];if(this.data.atHardBreak){let z=I.children[I.children.length-1];z.position.end=hn(k.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(I.type)&&(C.call(this,k),y.call(this,k))}function F(){this.data.atHardBreak=!0}function A(){let k=this.resume(),I=this.stack[this.stack.length-1];I.value=k}function N(){let k=this.resume(),I=this.stack[this.stack.length-1];I.value=k}function U(){let k=this.resume(),I=this.stack[this.stack.length-1];I.value=k}function te(){let k=this.stack[this.stack.length-1];if(this.data.inReference){let I=this.data.referenceType||"shortcut";k.type+="Reference",k.referenceType=I,delete k.url,delete k.title}else delete k.identifier,delete k.label;this.data.referenceType=void 0}function oe(){let k=this.stack[this.stack.length-1];if(this.data.inReference){let I=this.data.referenceType||"shortcut";k.type+="Reference",k.referenceType=I,delete k.url,delete k.title}else delete k.identifier,delete k.label;this.data.referenceType=void 0}function Ne(k){let I=this.sliceSerialize(k),z=this.stack[this.stack.length-2];z.label=bs(I),z.identifier=Oe(I).toLowerCase()}function J(){let k=this.stack[this.stack.length-1],I=this.resume(),z=this.stack[this.stack.length-1];if(this.data.inReference=!0,z.type==="link"){let G=k.children;z.children=G}else z.alt=I}function h(){let k=this.resume(),I=this.stack[this.stack.length-1];I.url=k}function Qe(){let k=this.resume(),I=this.stack[this.stack.length-1];I.title=k}function $t(){this.data.inReference=void 0}function g(){this.data.referenceType="collapsed"}function Ge(k){let I=this.resume(),z=this.stack[this.stack.length-1];z.label=I,z.identifier=Oe(this.sliceSerialize(k)).toLowerCase(),this.data.referenceType="full"}function Fn(k){this.data.characterReferenceType=k.type}function Ua(k){let I=this.sliceSerialize(k),z=this.data.characterReferenceType,G;z?(G=xs(I,z==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):G=Ar(I);let Q=this.stack[this.stack.length-1];Q.value+=G}function Xo(k){let I=this.stack.pop();I.position.end=hn(k.end)}function Ee(k){y.call(this,k);let I=this.stack[this.stack.length-1];I.url=this.sliceSerialize(k)}function hi(k){y.call(this,k);let I=this.stack[this.stack.length-1];I.url="mailto:"+this.sliceSerialize(k)}function Ut(){return{type:"blockquote",children:[]}}function $n(){return{type:"code",lang:null,meta:null,value:""}}function Sr(){return{type:"inlineCode",value:""}}function za(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Hw(){return{type:"emphasis",children:[]}}function qd(){return{type:"heading",depth:0,children:[]}}function jd(){return{type:"break"}}function Hd(){return{type:"html",value:""}}function Ww(){return{type:"image",title:null,url:"",alt:null}}function Wd(){return{type:"link",title:null,url:"",children:[]}}function Gd(k){return{type:"list",ordered:k.type==="listOrdered",start:null,spread:k._spread,children:[]}}function Gw(k){return{type:"listItem",spread:k._spread,checked:null,children:[]}}function Vw(){return{type:"paragraph",children:[]}}function Yw(){return{type:"strong",children:[]}}function Zw(){return{type:"text",value:""}}function Kw(){return{type:"thematicBreak"}}}function hn(e){return{line:e.line,column:e.column,offset:e.offset}}function Lp(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?Lp(e,r):l0(e,r)}}function l0(e,t){let n;for(n in t)if(Pp.call(t,n))switch(n){case"canContainEols":{let r=t[n];r&&e[n].push(...r);break}case"transforms":{let r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{let r=t[n];r&&Object.assign(e[n],r);break}}}function Np(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Dr({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Dr({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Dr({start:t.start,end:t.end})+") is still open")}function ql(e,t){let n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function jl(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}var vr=(function(e){if(e==null)return m0;if(typeof e=="function")return Rs(e);if(typeof e=="object")return Array.isArray(e)?u0(e):c0(e);if(typeof e=="string")return d0(e);throw new Error("Expected function, string, or object as test")});function u0(e){let t=[],n=-1;for(;++n<e.length;)t[n]=vr(e[n]);return Rs(r);function r(...i){let o=-1;for(;++o<t.length;)if(t[o].apply(this,i))return!0;return!1}}function c0(e){let t=e;return Rs(n);function n(r){let i=r,o;for(o in e)if(i[o]!==t[o])return!1;return!0}}function d0(e){return Rs(t);function t(n){return n&&n.type===e}}function Rs(e){return t;function t(n,r,i){return!!(p0(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function m0(){return!0}function p0(e){return e!==null&&typeof e=="object"&&"type"in e}function Fp(e){return"\x1B[33m"+e+"\x1B[39m"}var $p=[],Up=!0,Hl=!1,zp="skip";function Wl(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;let o=vr(i),s=r?-1:1;a(e,void 0,[])();function a(l,u,d){let c=l&&typeof l=="object"?l:{};if(typeof c.type=="string"){let p=typeof c.tagName=="string"?c.tagName:typeof c.name=="string"?c.name:void 0;Object.defineProperty(m,"name",{value:"node ("+Fp(l.type+(p?"<"+p+">":""))+")"})}return m;function m(){let p=$p,f,x,S;if((!t||o(l,u,d[d.length-1]||void 0))&&(p=f0(n(l,d)),p[0]===Hl))return p;if("children"in l&&l.children){let w=l;if(w.children&&p[0]!==zp)for(x=(r?w.children.length:-1)+s,S=d.concat(w);x>-1&&x<w.children.length;){let D=w.children[x];if(f=a(D,x,S)(),f[0]===Hl)return f;x=typeof f[1]=="number"?f[1]:x+s}}return p}}}function f0(e){return Array.isArray(e)?e:typeof e=="number"?[Up,e]:e==null?$p:[e]}function Gl(e,t,n){let i=vr((n||{}).ignore||[]),o=h0(t),s=-1;for(;++s<o.length;)Wl(e,"text",a);function a(u,d){let c=-1,m;for(;++c<d.length;){let p=d[c],f=m?m.children:void 0;if(i(p,f?f.indexOf(p):void 0,m))return;m=p}if(m)return l(u,d)}function l(u,d){let c=d[d.length-1],m=o[s][0],p=o[s][1],f=0,S=c.children.indexOf(u),w=!1,D=[];m.lastIndex=0;let T=m.exec(u.value);for(;T;){let R=T.index,O={index:T.index,input:T.input,stack:[...d,u]},b=p(...T,O);if(typeof b=="string"&&(b=b.length>0?{type:"text",value:b}:void 0),b===!1?m.lastIndex=R+1:(f!==R&&D.push({type:"text",value:u.value.slice(f,R)}),Array.isArray(b)?D.push(...b):b&&D.push(b),f=R+T[0].length,w=!0),!m.global)break;T=m.exec(u.value)}return w?(f<u.value.length&&D.push({type:"text",value:u.value.slice(f)}),c.children.splice(S,1,...D)):D=[u],S+D.length}}function h0(e){let t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");let n=!e[0]||Array.isArray(e[0])?e:[e],r=-1;for(;++r<n.length;){let i=n[r];t.push([g0(i[0]),y0(i[1])])}return t}function g0(e){return typeof e=="string"?new RegExp(jl(e),"g"):e}function y0(e){return typeof e=="function"?e:function(){return e}}function Yl(){return{transforms:[T0],enter:{literalAutolink:w0,literalAutolinkEmail:Vl,literalAutolinkHttp:Vl,literalAutolinkWww:Vl},exit:{literalAutolink:S0,literalAutolinkEmail:k0,literalAutolinkHttp:x0,literalAutolinkWww:b0}}}function w0(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Vl(e){this.config.enter.autolinkProtocol.call(this,e)}function x0(e){this.config.exit.autolinkProtocol.call(this,e)}function b0(e){this.config.exit.data.call(this,e);let t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function k0(e){this.config.exit.autolinkEmail.call(this,e)}function S0(e){this.exit(e)}function T0(e){Gl(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,E0],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),C0]],{ignore:["link","linkReference"]})}function E0(e,t,n,r,i){let o="";if(!Bp(i)||(/^w/i.test(t)&&(n=t+n,t="",o="http://"),!I0(n)))return!1;let s=_0(n+r);if(!s[0])return!1;let a={type:"link",title:null,url:o+t+s[0],children:[{type:"text",value:t+s[0]}]};return s[1]?[a,{type:"text",value:s[1]}]:a}function C0(e,t,n,r){return!Bp(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function I0(e){let t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function _0(e){let t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")"),i=ql(e,"("),o=ql(e,")");for(;r!==-1&&i>o;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),o++;return[e,n]}function Bp(e,t){let n=e.input.charCodeAt(e.index-1);return(e.index===0||Tt(n)||Gn(n))&&(!t||n!==47)}$0.peek=F0;function O0(){this.buffer()}function D0(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function v0(){this.buffer()}function R0(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function M0(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Oe(this.sliceSerialize(e)).toLowerCase(),n.label=t}function N0(e){this.exit(e)}function P0(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Oe(this.sliceSerialize(e)).toLowerCase(),n.label=t}function L0(e){this.exit(e)}function F0(){return"["}function $0(e,t,n,r){let i=n.createTracker(r),o=i.move("[^"),s=n.enter("footnoteReference"),a=n.enter("reference");return o+=i.move(n.safe(n.associationId(e),{after:"]",before:o})),a(),s(),o+=i.move("]"),o}function Zl(){return{enter:{gfmFootnoteCallString:O0,gfmFootnoteCall:D0,gfmFootnoteDefinitionLabelString:v0,gfmFootnoteDefinition:R0},exit:{gfmFootnoteCallString:M0,gfmFootnoteCall:N0,gfmFootnoteDefinitionLabelString:P0,gfmFootnoteDefinition:L0}}}q0.peek=j0;function Kl(){return{canContainEols:["delete"],enter:{strikethrough:z0},exit:{strikethrough:B0}}}function z0(e){this.enter({type:"delete",children:[]},e)}function B0(e){this.exit(e)}function q0(e,t,n,r){let i=n.createTracker(r),o=n.enter("strikethrough"),s=i.move("~~");return s+=n.containerPhrasing(e,{...i.current(),before:s,after:"~"}),s+=i.move("~~"),o(),s}function j0(){return"~"}function Xl(){return{enter:{table:W0,tableData:qp,tableHeader:qp,tableRow:V0},exit:{codeText:Y0,table:G0,tableData:Jl,tableHeader:Jl,tableRow:Jl}}}function W0(e){let t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function G0(e){this.exit(e),this.data.inTable=void 0}function V0(e){this.enter({type:"tableRow",children:[]},e)}function Jl(e){this.exit(e)}function qp(e){this.enter({type:"tableCell",children:[]},e)}function Y0(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,Z0));let n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function Z0(e,t){return t==="|"?t:e}function Ql(){return{exit:{taskListCheckValueChecked:jp,taskListCheckValueUnchecked:jp,paragraph:J0}}}function jp(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function J0(e){let t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){let n=this.stack[this.stack.length-1];n.type;let r=n.children[0];if(r&&r.type==="text"){let i=t.children,o=-1,s;for(;++o<i.length;){let a=i[o];if(a.type==="paragraph"){s=a;break}}s===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function eu(){return[Yl(),Zl(),Kl(),Xl(),Ql()]}var Q0={tokenize:iS,partial:!0},Hp={tokenize:oS,partial:!0},Wp={tokenize:sS,partial:!0},Gp={tokenize:aS,partial:!0},eS={tokenize:lS,partial:!0},Vp={name:"wwwAutolink",tokenize:nS,previous:Zp},Yp={name:"protocolAutolink",tokenize:rS,previous:Kp},Yt={name:"emailAutolink",tokenize:tS,previous:Jp},Ct={};function nu(){return{text:Ct}}var Kn=48;for(;Kn<123;)Ct[Kn]=Yt,Kn++,Kn===58?Kn=65:Kn===91&&(Kn=97);Ct[43]=Yt;Ct[45]=Yt;Ct[46]=Yt;Ct[95]=Yt;Ct[72]=[Yt,Yp];Ct[104]=[Yt,Yp];Ct[87]=[Yt,Vp];Ct[119]=[Yt,Vp];function tS(e,t,n){let r=this,i,o;return s;function s(c){return!tu(c)||!Jp.call(r,r.previous)||ru(r.events)?n(c):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),a(c))}function a(c){return tu(c)?(e.consume(c),a):c===64?(e.consume(c),l):n(c)}function l(c){return c===46?e.check(eS,d,u)(c):c===45||c===95||he(c)?(o=!0,e.consume(c),l):d(c)}function u(c){return e.consume(c),i=!0,l}function d(c){return o&&i&&fe(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(c)):n(c)}}function nS(e,t,n){let r=this;return i;function i(s){return s!==87&&s!==119||!Zp.call(r,r.previous)||ru(r.events)?n(s):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(Q0,e.attempt(Hp,e.attempt(Wp,o),n),n)(s))}function o(s){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(s)}}function rS(e,t,n){let r=this,i="",o=!1;return s;function s(c){return(c===72||c===104)&&Kp.call(r,r.previous)&&!ru(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(c),e.consume(c),a):n(c)}function a(c){if(fe(c)&&i.length<5)return i+=String.fromCodePoint(c),e.consume(c),a;if(c===58){let m=i.toLowerCase();if(m==="http"||m==="https")return e.consume(c),l}return n(c)}function l(c){return c===47?(e.consume(c),o?u:(o=!0,l)):n(c)}function u(c){return c===null||Wn(c)||q(c)||Tt(c)||Gn(c)?n(c):e.attempt(Hp,e.attempt(Wp,d),n)(c)}function d(c){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(c)}}function iS(e,t,n){let r=0;return i;function i(s){return(s===87||s===119)&&r<3?(r++,e.consume(s),i):s===46&&r===3?(e.consume(s),o):n(s)}function o(s){return s===null?n(s):t(s)}}function oS(e,t,n){let r,i,o;return s;function s(u){return u===46||u===95?e.check(Gp,l,a)(u):u===null||q(u)||Tt(u)||u!==45&&Gn(u)?l(u):(o=!0,e.consume(u),s)}function a(u){return u===95?r=!0:(i=r,r=void 0),e.consume(u),s}function l(u){return i||r||!o?n(u):t(u)}}function sS(e,t){let n=0,r=0;return i;function i(s){return s===40?(n++,e.consume(s),i):s===41&&r<n?o(s):s===33||s===34||s===38||s===39||s===41||s===42||s===44||s===46||s===58||s===59||s===60||s===63||s===93||s===95||s===126?e.check(Gp,t,o)(s):s===null||q(s)||Tt(s)?t(s):(e.consume(s),i)}function o(s){return s===41&&r++,e.consume(s),i}}function aS(e,t,n){return r;function r(a){return a===33||a===34||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===63||a===95||a===126?(e.consume(a),r):a===38?(e.consume(a),o):a===93?(e.consume(a),i):a===60||a===null||q(a)||Tt(a)?t(a):n(a)}function i(a){return a===null||a===40||a===91||q(a)||Tt(a)?t(a):r(a)}function o(a){return fe(a)?s(a):n(a)}function s(a){return a===59?(e.consume(a),r):fe(a)?(e.consume(a),s):n(a)}}function lS(e,t,n){return r;function r(o){return e.consume(o),i}function i(o){return he(o)?n(o):t(o)}}function Zp(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||q(e)}function Kp(e){return!fe(e)}function Jp(e){return!(e===47||tu(e))}function tu(e){return e===43||e===45||e===46||e===95||he(e)}function ru(e){let t=e.length,n=!1;for(;t--;){let r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}var uS={tokenize:gS,partial:!0};function iu(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:pS,continuation:{tokenize:fS},exit:hS}},text:{91:{name:"gfmFootnoteCall",tokenize:mS},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:cS,resolveTo:dS}}}}function cS(e,t,n){let r=this,i=r.events.length,o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),s;for(;i--;){let l=r.events[i][1];if(l.type==="labelImage"){s=l;break}if(l.type==="gfmFootnoteCall"||l.type==="labelLink"||l.type==="label"||l.type==="image"||l.type==="link")break}return a;function a(l){if(!s||!s._balanced)return n(l);let u=Oe(r.sliceSerialize({start:s.end,end:r.now()}));return u.codePointAt(0)!==94||!o.includes(u.slice(1))?n(l):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(l),e.exit("gfmFootnoteCallLabelMarker"),t(l))}}function dS(e,t){let n=e.length,r;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){r=e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";let i={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},o={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};o.end.column++,o.end.offset++,o.end._bufferIndex++;let s={type:"gfmFootnoteCallString",start:Object.assign({},o.end),end:Object.assign({},e[e.length-1][1].start)},a={type:"chunkString",contentType:"string",start:Object.assign({},s.start),end:Object.assign({},s.end)},l=[e[n+1],e[n+2],["enter",i,t],e[n+3],e[n+4],["enter",o,t],["exit",o,t],["enter",s,t],["enter",a,t],["exit",a,t],["exit",s,t],e[e.length-2],e[e.length-1],["exit",i,t]];return e.splice(n,e.length-n+1,...l),e}function mS(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),o=0,s;return a;function a(c){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),l}function l(c){return c!==94?n(c):(e.enter("gfmFootnoteCallMarker"),e.consume(c),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",u)}function u(c){if(o>999||c===93&&!s||c===null||c===91||q(c))return n(c);if(c===93){e.exit("chunkString");let m=e.exit("gfmFootnoteCallString");return i.includes(Oe(r.sliceSerialize(m)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(c)}return q(c)||(s=!0),o++,e.consume(c),c===92?d:u}function d(c){return c===91||c===92||c===93?(e.consume(c),o++,u):u(c)}}function pS(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),o,s=0,a;return l;function l(f){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(f),e.exit("gfmFootnoteDefinitionLabelMarker"),u}function u(f){return f===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(f),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",d):n(f)}function d(f){if(s>999||f===93&&!a||f===null||f===91||q(f))return n(f);if(f===93){e.exit("chunkString");let x=e.exit("gfmFootnoteDefinitionLabelString");return o=Oe(r.sliceSerialize(x)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(f),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),m}return q(f)||(a=!0),s++,e.consume(f),f===92?c:d}function c(f){return f===91||f===92||f===93?(e.consume(f),s++,d):d(f)}function m(f){return f===58?(e.enter("definitionMarker"),e.consume(f),e.exit("definitionMarker"),i.includes(o)||i.push(o),P(e,p,"gfmFootnoteDefinitionWhitespace")):n(f)}function p(f){return t(f)}}function fS(e,t,n){return e.check(Et,t,e.attempt(uS,t,n))}function hS(e){e.exit("gfmFootnoteDefinition")}function gS(e,t,n){let r=this;return P(e,i,"gfmFootnoteDefinitionIndent",5);function i(o){let s=r.events[r.events.length-1];return s&&s[1].type==="gfmFootnoteDefinitionIndent"&&s[2].sliceSerialize(s[1],!0).length===4?t(o):n(o)}}function ou(e){let n=(e||{}).singleTilde,r={name:"strikethrough",tokenize:o,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(s,a){let l=-1;for(;++l<s.length;)if(s[l][0]==="enter"&&s[l][1].type==="strikethroughSequenceTemporary"&&s[l][1]._close){let u=l;for(;u--;)if(s[u][0]==="exit"&&s[u][1].type==="strikethroughSequenceTemporary"&&s[u][1]._open&&s[l][1].end.offset-s[l][1].start.offset===s[u][1].end.offset-s[u][1].start.offset){s[l][1].type="strikethroughSequence",s[u][1].type="strikethroughSequence";let d={type:"strikethrough",start:Object.assign({},s[u][1].start),end:Object.assign({},s[l][1].end)},c={type:"strikethroughText",start:Object.assign({},s[u][1].end),end:Object.assign({},s[l][1].start)},m=[["enter",d,a],["enter",s[u][1],a],["exit",s[u][1],a],["enter",c,a]],p=a.parser.constructs.insideSpan.null;p&&me(m,m.length,0,fn(p,s.slice(u+1,l),a)),me(m,m.length,0,[["exit",c,a],["enter",s[l][1],a],["exit",s[l][1],a],["exit",d,a]]),me(s,u-1,l-u+3,m),l=u+m.length-2;break}}for(l=-1;++l<s.length;)s[l][1].type==="strikethroughSequenceTemporary"&&(s[l][1].type="data");return s}function o(s,a,l){let u=this.previous,d=this.events,c=0;return m;function m(f){return u===126&&d[d.length-1][1].type!=="characterEscape"?l(f):(s.enter("strikethroughSequenceTemporary"),p(f))}function p(f){let x=Or(u);if(f===126)return c>1?l(f):(s.consume(f),c++,p);if(c<2&&!n)return l(f);let S=s.exit("strikethroughSequenceTemporary"),w=Or(f);return S._open=!w||w===2&&!!x,S._close=!x||x===2&&!!w,a(f)}}}var Ms=class{constructor(){this.map=[]}add(t,n,r){yS(this,t,n,r)}consume(t){if(this.map.sort(function(o,s){return o[0]-s[0]}),this.map.length===0)return;let n=this.map.length,r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let i=r.pop();for(;i;){for(let o of i)t.push(o);i=r.pop()}this.map.length=0}};function yS(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function Xp(e,t){let n=!1,r=[];for(;t<e.length;){let i=e[t];if(n){if(i[0]==="enter")i[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){let o=r.length-1;r[o]=r[o]==="left"?"center":"right"}}else if(i[1].type==="tableDelimiterRow")break}else i[0]==="enter"&&i[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function su(){return{flow:{null:{name:"table",tokenize:wS,resolveAll:xS}}}}function wS(e,t,n){let r=this,i=0,o=0,s;return a;function a(y){let Z=r.events.length-1;for(;Z>-1;){let N=r.events[Z][1].type;if(N==="lineEnding"||N==="linePrefix")Z--;else break}let F=Z>-1?r.events[Z][1].type:null,A=F==="tableHead"||F==="tableRow"?b:l;return A===b&&r.parser.lazy[r.now().line]?n(y):A(y)}function l(y){return e.enter("tableHead"),e.enter("tableRow"),u(y)}function u(y){return y===124||(s=!0,o+=1),d(y)}function d(y){return y===null?n(y):_(y)?o>1?(o=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),p):n(y):L(y)?P(e,d,"whitespace")(y):(o+=1,s&&(s=!1,i+=1),y===124?(e.enter("tableCellDivider"),e.consume(y),e.exit("tableCellDivider"),s=!0,d):(e.enter("data"),c(y)))}function c(y){return y===null||y===124||q(y)?(e.exit("data"),d(y)):(e.consume(y),y===92?m:c)}function m(y){return y===92||y===124?(e.consume(y),c):c(y)}function p(y){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(y):(e.enter("tableDelimiterRow"),s=!1,L(y)?P(e,f,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(y):f(y))}function f(y){return y===45||y===58?S(y):y===124?(s=!0,e.enter("tableCellDivider"),e.consume(y),e.exit("tableCellDivider"),x):O(y)}function x(y){return L(y)?P(e,S,"whitespace")(y):S(y)}function S(y){return y===58?(o+=1,s=!0,e.enter("tableDelimiterMarker"),e.consume(y),e.exit("tableDelimiterMarker"),w):y===45?(o+=1,w(y)):y===null||_(y)?R(y):O(y)}function w(y){return y===45?(e.enter("tableDelimiterFiller"),D(y)):O(y)}function D(y){return y===45?(e.consume(y),D):y===58?(s=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(y),e.exit("tableDelimiterMarker"),T):(e.exit("tableDelimiterFiller"),T(y))}function T(y){return L(y)?P(e,R,"whitespace")(y):R(y)}function R(y){return y===124?f(y):y===null||_(y)?!s||i!==o?O(y):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(y)):O(y)}function O(y){return n(y)}function b(y){return e.enter("tableRow"),E(y)}function E(y){return y===124?(e.enter("tableCellDivider"),e.consume(y),e.exit("tableCellDivider"),E):y===null||_(y)?(e.exit("tableRow"),t(y)):L(y)?P(e,E,"whitespace")(y):(e.enter("data"),M(y))}function M(y){return y===null||y===124||q(y)?(e.exit("data"),E(y)):(e.consume(y),y===92?C:M)}function C(y){return y===92||y===124?(e.consume(y),M):M(y)}}function xS(e,t){let n=-1,r=!0,i=0,o=[0,0,0,0],s=[0,0,0,0],a=!1,l=0,u,d,c,m=new Ms;for(;++n<e.length;){let p=e[n],f=p[1];p[0]==="enter"?f.type==="tableHead"?(a=!1,l!==0&&(Qp(m,t,l,u,d),d=void 0,l=0),u={type:"table",start:Object.assign({},f.start),end:Object.assign({},f.end)},m.add(n,0,[["enter",u,t]])):f.type==="tableRow"||f.type==="tableDelimiterRow"?(r=!0,c=void 0,o=[0,0,0,0],s=[0,n+1,0,0],a&&(a=!1,d={type:"tableBody",start:Object.assign({},f.start),end:Object.assign({},f.end)},m.add(n,0,[["enter",d,t]])),i=f.type==="tableDelimiterRow"?2:d?3:1):i&&(f.type==="data"||f.type==="tableDelimiterMarker"||f.type==="tableDelimiterFiller")?(r=!1,s[2]===0&&(o[1]!==0&&(s[0]=s[1],c=Ns(m,t,o,i,void 0,c),o=[0,0,0,0]),s[2]=n)):f.type==="tableCellDivider"&&(r?r=!1:(o[1]!==0&&(s[0]=s[1],c=Ns(m,t,o,i,void 0,c)),o=s,s=[o[1],n,0,0])):f.type==="tableHead"?(a=!0,l=n):f.type==="tableRow"||f.type==="tableDelimiterRow"?(l=n,o[1]!==0?(s[0]=s[1],c=Ns(m,t,o,i,n,c)):s[1]!==0&&(c=Ns(m,t,s,i,n,c)),i=0):i&&(f.type==="data"||f.type==="tableDelimiterMarker"||f.type==="tableDelimiterFiller")&&(s[3]=n)}for(l!==0&&Qp(m,t,l,u,d),m.consume(t.events),n=-1;++n<t.events.length;){let p=t.events[n];p[0]==="enter"&&p[1].type==="table"&&(p[1]._align=Xp(t.events,n))}return e}function Ns(e,t,n,r,i,o){let s=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",a="tableContent";n[0]!==0&&(o.end=Object.assign({},Rr(t.events,n[0])),e.add(n[0],0,[["exit",o,t]]));let l=Rr(t.events,n[1]);if(o={type:s,start:Object.assign({},l),end:Object.assign({},l)},e.add(n[1],0,[["enter",o,t]]),n[2]!==0){let u=Rr(t.events,n[2]),d=Rr(t.events,n[3]),c={type:a,start:Object.assign({},u),end:Object.assign({},d)};if(e.add(n[2],0,[["enter",c,t]]),r!==2){let m=t.events[n[2]],p=t.events[n[3]];if(m[1].end=Object.assign({},p[1].end),m[1].type="chunkText",m[1].contentType="text",n[3]>n[2]+1){let f=n[2]+1,x=n[3]-n[2]-1;e.add(f,x,[])}}e.add(n[3]+1,0,[["exit",c,t]])}return i!==void 0&&(o.end=Object.assign({},Rr(t.events,i)),e.add(i,0,[["exit",o,t]]),o=void 0),o}function Qp(e,t,n,r,i){let o=[],s=Rr(t.events,n);i&&(i.end=Object.assign({},s),o.push(["exit",i,t])),r.end=Object.assign({},s),o.push(["exit",r,t]),e.add(n+1,0,o)}function Rr(e,t){let n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}var bS={name:"tasklistCheck",tokenize:kS};function au(){return{text:{91:bS}}}function kS(e,t,n){let r=this;return i;function i(l){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(l):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),o)}function o(l){return q(l)?(e.enter("taskListCheckValueUnchecked"),e.consume(l),e.exit("taskListCheckValueUnchecked"),s):l===88||l===120?(e.enter("taskListCheckValueChecked"),e.consume(l),e.exit("taskListCheckValueChecked"),s):n(l)}function s(l){return l===93?(e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),a):n(l)}function a(l){return _(l)?t(l):L(l)?e.check({tokenize:SS},t,n)(l):n(l)}}function SS(e,t,n){return P(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function ef(e){return ks([nu(),iu(),ou(e),su(),au()])}var TS=new Set("*_~`[]<>|!\\-+"),ES=new Set("*_[]|"),CS=new Set(".-+_"),IS=/[\w.+-]/,tf=1e7;function _S(e){if(e.length>_m)return!1;let t=0,n=1,r=0,i=!0,o=!0,s=0,a="",l=0,u=0,d=0;for(let c of e){if(IS.test(c))l+=1,CS.has(a)&&(u+=1);else if(u>0){if(d+=u*l,d>tf)return!1;l=u=0}else l=0;if(c===`
|
|
59
|
-
`){if(++n>4e3)return!1;i=!0,o=!0,r=0,s=0,a="";continue}if(i&&(c===" "||c===" ")){if(r+=c===" "?4:1,r>128)return!1}else i=!1;let m=o&&(c==="."||c===")")&&a>="0"&&a<="9";if(o&&=m||" >-+*0123456789".includes(c),(m||
|
|
60
|
-
`))return null;let a=s?0:i?.type==="break"?2:1;return n.length===a&&e.children.length===1?null:(r.value=s,n.splice(0,a),n.length||e.children.shift(),o[1].toLowerCase())}var
|
|
61
|
-
`),i=
|
|
62
|
-
`))
|
|
63
|
-
`).replace(/^(?:[ \t]*\n)+/,"")}function $S(e,t){return US(e,t,n=>n.value)}function US(e,t,n){let r=bi(e),i=t==="markdown"&&!cu(r)?nf(r):null;return i?GS(zS(i,n)):Ps(r)}function zS(e,t){let n=[],r=null,i=!1,o=null,s=of(e),a=new Set(e.children),l=[{node:e}];for(;l.length;){let{node:u,number:d}=l.pop();switch(a.has(u)&&(o=null),u.type){case"paragraph":case"heading":case"tableCell":case"code":case"html":{let c=u.type==="html"?HS(u.value):[{kind:u.type==="heading"?"heading":u.type==="tableCell"?"cell":"other",text:u.type==="code"?t(u):BS(u)}];for(let m of c){let p=m.text;o&&(p=`${o}: ${p}`);let f=m.kind==="other"&&r?"item":m.kind;r?.number!==void 0&&(p=`${r.number}. ${p}`);let x=i||m.rowStart;n.push({kind:f,text:p,...r?.number!==void 0?{number:r.number}:{},...x?{rowStart:x}:{}}),r=null,i=!1,o=null}break}case"list":for(let c=u.children.length-1;c>=0;c--)l.push({node:u.children[c],...u.ordered?{number:(u.start??1)+c}:{}});break;case"listItem":r=d===void 0?{}:{number:d},Mr(l,u);break;case"tableRow":i=!0,Mr(l,u);break;case"blockquote":{let c=s.get(u);c&&(o=rf[c]),Mr(l,u);break}case"definition":case"thematicBreak":break;default:"children"in u&&Mr(l,u)}}return n}function Mr(e,t){for(let n=t.children.length-1;n>=0;n--)e.push({node:t.children[n]})}function BS(e){let t="",n=[];for(Mr(n,e);n.length;){let{node:r}=n.pop();r.type==="text"||r.type==="inlineCode"?t+=r.value:r.type==="image"||r.type==="imageReference"?t+=r.alt??"":r.type==="break"?t+=" ":r.type==="html"?t+=cf(r.value):"children"in r&&Mr(n,r)}return t}var qS=/<\/?(?:a|abbr|b|bdi|bdo|cite|code|data|del|dfn|em|font|i|ins|kbd|mark|q|s|samp|small|span|strike|strong|sub|sup|time|u|var|wbr)\b[^<>]*>/giu,uf=e=>e.replace(/<!--[\s\S]*?(?:-->|$)/gu," ").replace(/<(script|style)\b[\s\S]*?(?:<\/\1\s*>|$)/giu," ");function cf(e){return bs(uf(e).replace(/<img\b[^<>]*?\balt\s*=\s*(?:"([^"<>]*)"|'([^'<>]*)')[^<>]*>/giu," $1$2 ").replace(qS,"").replace(/<[^<>]*>/gu," "))}var jS=/<(\/?)(h[1-6]|li|t[dh]|tr|p|div|ul|ol|table|blockquote|pre|hr|section|article|header|footer)\b[^<>]*>/giu;function HS(e){let t=[],n=uf(e),r="other",i=!1,o=0,s=a=>{let l=cf(n.slice(o,a));l.trim()&&(t.push({kind:r,text:l,...i?{rowStart:i}:{}}),i=!1)};for(let a of n.matchAll(jS)){s(a.index),o=a.index+a[0].length;let[,l,u]=a,d=u.toLowerCase();d==="tr"?i=!l:r=l?"other":/^h\d$/u.test(d)?"heading":d==="li"?"item":/^t[dh]$/u.test(d)?"cell":"other"}return s(n.length),t}var WS=/[\p{Terminal_Punctuation}…][\p{Pe}\p{Pf}"']*$/u;function GS(e){let t="",n=null;for(let r of e){let i=Ps(r.text);i&&(n&&(t+=VS(n,r,t)),t+=i,n=r)}return t}function VS(e,t,n){return WS.test(n)?" ":e.kind==="heading"?" \u2014 ":t.kind==="heading"?". ":e.kind==="cell"&&t.kind==="cell"?t.rowStart?"; ":", ":e.kind==="item"&&t.kind==="item"?t.number===void 0?", ":" ":". "}var Gs={};Vd(Gs,{Chrono:()=>er,GB:()=>s1,Meridiem:()=>j,ParsingComponents:()=>W,ParsingResult:()=>ft,ReferenceWithTimezone:()=>It,Weekday:()=>K,casual:()=>Ws,configuration:()=>Hs,parse:()=>a1,parseDate:()=>l1,strict:()=>Yf});var j;(function(e){e[e.AM=0]="AM",e[e.PM=1]="PM"})(j||(j={}));var K;(function(e){e[e.SUNDAY=0]="SUNDAY",e[e.MONDAY=1]="MONDAY",e[e.TUESDAY=2]="TUESDAY",e[e.WEDNESDAY=3]="WEDNESDAY",e[e.THURSDAY=4]="THURSDAY",e[e.FRIDAY=5]="FRIDAY",e[e.SATURDAY=6]="SATURDAY"})(K||(K={}));var Ke;(function(e){e[e.JANUARY=1]="JANUARY",e[e.FEBRUARY=2]="FEBRUARY",e[e.MARCH=3]="MARCH",e[e.APRIL=4]="APRIL",e[e.MAY=5]="MAY",e[e.JUNE=6]="JUNE",e[e.JULY=7]="JULY",e[e.AUGUST=8]="AUGUST",e[e.SEPTEMBER=9]="SEPTEMBER",e[e.OCTOBER=10]="OCTOBER",e[e.NOVEMBER=11]="NOVEMBER",e[e.DECEMBER=12]="DECEMBER"})(Ke||(Ke={}));function pt(e,t){e.assign("day",t.getDate()),e.assign("month",t.getMonth()+1),e.assign("year",t.getFullYear())}function Ls(e,t){e.assign("hour",t.getHours()),e.assign("minute",t.getMinutes()),e.assign("second",t.getSeconds()),e.assign("millisecond",t.getMilliseconds()),e.assign("meridiem",t.getHours()<12?j.AM:j.PM)}function Zt(e,t){e.imply("day",t.getDate()),e.imply("month",t.getMonth()+1),e.imply("year",t.getFullYear())}function Pi(e,t){e.imply("hour",t.getHours()),e.imply("minute",t.getMinutes()),e.imply("second",t.getSeconds()),e.imply("millisecond",t.getMilliseconds()),e.imply("meridiem",t.getHours()<12?j.AM:j.PM)}var ZS={ACDT:630,ACST:570,ADT:-180,AEDT:660,AEST:600,AFT:270,AKDT:-480,AKST:-540,ALMT:360,AMST:-180,AMT:-240,ANAST:720,ANAT:720,AQTT:300,ART:-180,AST:-240,AWDT:540,AWST:480,AZOST:0,AZOT:-60,AZST:300,AZT:240,BNT:480,BOT:-240,BRST:-120,BRT:-180,BST:60,BTT:360,CAST:480,CAT:120,CCT:390,CDT:-300,CEST:120,CET:{timezoneOffsetDuringDst:120,timezoneOffsetNonDst:60,dstStart:e=>df(e,Ke.MARCH,K.SUNDAY,2),dstEnd:e=>df(e,Ke.OCTOBER,K.SUNDAY,3)},CHADT:825,CHAST:765,CKT:-600,CLST:-180,CLT:-240,COT:-300,CST:-360,CT:{timezoneOffsetDuringDst:-300,timezoneOffsetNonDst:-360,dstStart:e=>gn(e,Ke.MARCH,K.SUNDAY,2,2),dstEnd:e=>gn(e,Ke.NOVEMBER,K.SUNDAY,1,2)},CVT:-60,CXT:420,ChST:600,DAVT:420,EASST:-300,EAST:-360,EAT:180,ECT:-300,EDT:-240,EEST:180,EET:120,EGST:0,EGT:-60,EST:-300,ET:{timezoneOffsetDuringDst:-240,timezoneOffsetNonDst:-300,dstStart:e=>gn(e,Ke.MARCH,K.SUNDAY,2,2),dstEnd:e=>gn(e,Ke.NOVEMBER,K.SUNDAY,1,2)},FJST:780,FJT:720,FKST:-180,FKT:-240,FNT:-120,GALT:-360,GAMT:-540,GET:240,GFT:-180,GILT:720,GMT:0,GST:240,GYT:-240,HAA:-180,HAC:-300,HADT:-540,HAE:-240,HAP:-420,HAR:-360,HAST:-600,HAT:-90,HAY:-480,HKT:480,HLV:-210,HNA:-240,HNC:-360,HNE:-300,HNP:-480,HNR:-420,HNT:-150,HNY:-540,HOVT:420,ICT:420,IDT:180,IOT:360,IRDT:270,IRKST:540,IRKT:540,IRST:210,IST:330,JST:540,KGT:360,KRAST:480,KRAT:480,KST:540,KUYT:240,LHDT:660,LHST:630,LINT:840,MAGST:720,MAGT:720,MART:-510,MAWT:300,MDT:-360,MESZ:120,MEZ:60,MHT:720,MMT:390,MSD:240,MSK:180,MST:-420,MT:{timezoneOffsetDuringDst:-360,timezoneOffsetNonDst:-420,dstStart:e=>gn(e,Ke.MARCH,K.SUNDAY,2,2),dstEnd:e=>gn(e,Ke.NOVEMBER,K.SUNDAY,1,2)},MUT:240,MVT:300,MYT:480,NCT:660,NDT:-90,NFT:690,NOVST:420,NOVT:360,NPT:345,NST:-150,NUT:-660,NZDT:780,NZST:720,OMSST:420,OMST:420,PDT:-420,PET:-300,PETST:720,PETT:720,PGT:600,PHOT:780,PHT:480,PKT:300,PMDT:-120,PMST:-180,PONT:660,PST:-480,PT:{timezoneOffsetDuringDst:-420,timezoneOffsetNonDst:-480,dstStart:e=>gn(e,Ke.MARCH,K.SUNDAY,2,2),dstEnd:e=>gn(e,Ke.NOVEMBER,K.SUNDAY,1,2)},PWT:540,PYST:-180,PYT:-240,RET:240,SAMT:240,SAST:120,SBT:660,SCT:240,SGT:480,SRT:-180,SST:-660,TAHT:-600,TFT:300,TJT:300,TKT:780,TLT:540,TMT:300,TVT:720,ULAT:480,UTC:0,UYST:-120,UYT:-180,UZT:300,VET:-210,VLAST:660,VLAT:660,VUT:660,WAST:120,WAT:60,WEST:60,WESZ:60,WET:0,WEZ:0,WFT:720,WGST:-120,WGT:-180,WIB:420,WIT:540,WITA:480,WST:780,WT:0,YAKST:600,YAKT:600,YAPT:600,YEKST:360,YEKT:360};function gn(e,t,n,r,i=0){let o=0,s=0;for(;s<r;)o++,new Date(e,t-1,o).getDay()===n&&s++;return new Date(e,t-1,o,i)}function df(e,t,n,r=0){let i=n===0?7:n,o=new Date(e,t-1+1,1,12),s=o.getDay()===0?7:o.getDay(),a;return s===i?a=7:s<i?a=7+s-i:a=s-i,o.setDate(o.getDate()-a),new Date(e,t-1,o.getDate(),r)}function Fs(e,t,n={}){if(e==null)return null;if(typeof e=="number")return e;let r=n[e]??ZS[e];return r==null?null:typeof r=="number"?r:t==null?null:t>r.dstStart(t.getFullYear())&&!(t>r.dstEnd(t.getFullYear()))?r.timezoneOffsetDuringDst:r.timezoneOffsetNonDst}var mf={day:0,second:0,millisecond:0};function ke(e,t){let n=new Date(e);if(t.y&&(t.year=t.y,delete t.y),t.mo&&(t.month=t.mo,delete t.mo),t.M&&(t.month=t.M,delete t.M),t.w&&(t.week=t.w,delete t.w),t.d&&(t.day=t.d,delete t.d),t.h&&(t.hour=t.h,delete t.h),t.m&&(t.minute=t.m,delete t.m),t.s&&(t.second=t.s,delete t.s),t.ms&&(t.millisecond=t.ms,delete t.ms),"year"in t){let r=Math.floor(t.year);n.setFullYear(n.getFullYear()+r);let i=t.year-r;i>0&&(t.month=t?.month??0,t.month+=i*12)}if("quarter"in t){let r=Math.floor(t.quarter);n.setMonth(n.getMonth()+r*3)}if("month"in t){let r=Math.floor(t.month);n.setMonth(n.getMonth()+r);let i=t.month-r;i>0&&(t.week=t?.week??0,t.week+=i*4)}if("week"in t){let r=Math.floor(t.week);n.setDate(n.getDate()+r*7);let i=t.week-r;i>0&&(t.day=t?.day??0,t.day+=Math.round(i*7))}if("day"in t){let r=Math.floor(t.day);n.setDate(n.getDate()+r);let i=t.day-r;i>0&&(t.hour=t?.hour??0,t.hour+=Math.round(i*24))}if("hour"in t){let r=Math.floor(t.hour);n.setHours(n.getHours()+r);let i=t.hour-r;i>0&&(t.minute=t?.minute??0,t.minute+=Math.round(i*60))}if("minute"in t){let r=Math.floor(t.minute);n.setMinutes(n.getMinutes()+r);let i=t.minute-r;i>0&&(t.second=t?.second??0,t.second+=Math.round(i*60))}if("second"in t){let r=Math.floor(t.second);n.setSeconds(n.getSeconds()+r);let i=t.second-r;i>0&&(t.millisecond=t?.millisecond??0,t.millisecond+=Math.round(i*1e3))}if("millisecond"in t){let r=Math.floor(t.millisecond);n.setMilliseconds(n.getMilliseconds()+r)}return n}function yn(e){let t={};for(let n in e)t[n]=-e[n];return t}var It=class e{instant;timezoneOffset;constructor(t,n){this.instant=t??new Date,this.timezoneOffset=n??null}static fromDate(t){return new e(t)}static fromInput(t,n){if(t instanceof Date)return e.fromDate(t);let r=t?.instant??new Date,i=Fs(t?.timezone,r,n);return new e(r,i)}getDateWithAdjustedTimezone(){let t=new Date(this.instant);return this.timezoneOffset!==null&&t.setMinutes(t.getMinutes()-this.getSystemTimezoneAdjustmentMinute(this.instant)),t}getSystemTimezoneAdjustmentMinute(t,n){t||(t=new Date);let r=-t.getTimezoneOffset(),i=n??this.timezoneOffset??r;return r-i}getTimezoneOffset(){return this.timezoneOffset??-this.instant.getTimezoneOffset()}},W=class e{knownValues;impliedValues;reference;_tags=new Set;constructor(t,n){if(this.reference=t,this.knownValues={},this.impliedValues={},n)for(let i in n)this.knownValues[i]=n[i];let r=t.getDateWithAdjustedTimezone();this.imply("day",r.getDate()),this.imply("month",r.getMonth()+1),this.imply("year",r.getFullYear()),this.imply("hour",12),this.imply("minute",0),this.imply("second",0),this.imply("millisecond",0)}static createRelativeFromReference(t,n=mf){let r=ke(t.getDateWithAdjustedTimezone(),n),i=new e(t);return i.addTag("result/relativeDate"),"hour"in n||"minute"in n||"second"in n||"millisecond"in n?(i.addTag("result/relativeDateAndTime"),Ls(i,r),pt(i,r),i.assign("timezoneOffset",t.getTimezoneOffset())):(Pi(i,r),i.imply("timezoneOffset",t.getTimezoneOffset()),"day"in n?(i.assign("day",r.getDate()),i.assign("month",r.getMonth()+1),i.assign("year",r.getFullYear()),i.assign("weekday",r.getDay())):"week"in n?(i.assign("day",r.getDate()),i.assign("month",r.getMonth()+1),i.assign("year",r.getFullYear()),i.imply("weekday",r.getDay())):(i.imply("day",r.getDate()),"month"in n?(i.assign("month",r.getMonth()+1),i.assign("year",r.getFullYear())):(i.imply("month",r.getMonth()+1),"year"in n?i.assign("year",r.getFullYear()):i.imply("year",r.getFullYear())))),i}get(t){return t in this.knownValues?this.knownValues[t]:t in this.impliedValues?this.impliedValues[t]:null}isCertain(t){return t in this.knownValues}getCertainComponents(){return Object.keys(this.knownValues)}imply(t,n){return t in this.knownValues?this:(this.impliedValues[t]=n,this)}assign(t,n){return this.knownValues[t]=n,delete this.impliedValues[t],this}addDurationAsImplied(t){let n=this.dateWithoutTimezoneAdjustment(),r=ke(n,t);return("day"in t||"week"in t||"month"in t||"year"in t)&&(this.delete(["day","weekday","month","year"]),this.imply("day",r.getDate()),this.imply("weekday",r.getDay()),this.imply("month",r.getMonth()+1),this.imply("year",r.getFullYear())),("second"in t||"minute"in t||"hour"in t)&&(this.delete(["second","minute","hour"]),this.imply("second",r.getSeconds()),this.imply("minute",r.getMinutes()),this.imply("hour",r.getHours())),this}delete(t){typeof t=="string"&&(t=[t]);for(let n of t)delete this.knownValues[n],delete this.impliedValues[n]}clone(){let t=new e(this.reference);t.knownValues={},t.impliedValues={};for(let n in this.knownValues)t.knownValues[n]=this.knownValues[n];for(let n in this.impliedValues)t.impliedValues[n]=this.impliedValues[n];return t}isOnlyDate(){return!this.isCertain("hour")&&!this.isCertain("minute")&&!this.isCertain("second")}isOnlyTime(){return!this.isCertain("weekday")&&!this.isCertain("day")&&!this.isCertain("month")&&!this.isCertain("year")}isOnlyWeekdayComponent(){return this.isCertain("weekday")&&!this.isCertain("day")&&!this.isCertain("month")}isDateWithUnknownYear(){return this.isCertain("month")&&!this.isCertain("year")}isValidDate(){let t=new Date(Date.UTC(this.get("year"),this.get("month")-1,this.get("day"),this.get("hour"),this.get("minute"),this.get("second"),this.get("millisecond")));return t.setUTCFullYear(this.get("year")),!(t.getUTCFullYear()!==this.get("year")||t.getUTCMonth()!==this.get("month")-1||t.getUTCDate()!==this.get("day")||this.get("hour")!=null&&t.getUTCHours()!=this.get("hour")||this.get("minute")!=null&&t.getUTCMinutes()!=this.get("minute"))}toString(){return`[ParsingComponents {
|
|
58
|
+
`;break}case-2:{s=t?" ":" ";break}case-1:{if(!t&&i)continue;s=" ";break}default:s=String.fromCharCode(o)}i=o===-2,r.push(s)}return r.join("")}function Hl(e){let r={constructs:Cs([jl,...(e||{}).extensions||[]]),content:i(_p),defined:[],document:i(Op),flow:i(Rp),lazy:{},string:i(Pp),text:i(Lp)};return r;function i(o){return s;function s(a){return Up(r,o,a)}}}function Wl(e){for(;!vs(e););return e}var zp=/[\0\t\n\r]/g;function Gl(){let e=1,t="",n=!0,r;return i;function i(o,s,a){let l=[],u,d,c,m,p;for(o=t+(typeof o=="string"?o.toString():new TextDecoder(s||void 0).decode(o)),c=0,t="",n&&(o.charCodeAt(0)===65279&&c++,n=void 0);c<o.length;){if(zp.lastIndex=c,u=zp.exec(o),m=u&&u.index!==void 0?u.index:o.length,p=o.charCodeAt(m),!u){t=o.slice(c);break}if(p===10&&c===m&&r)l.push(-3),r=void 0;else switch(r&&(l.push(-5),r=void 0),c<m&&(l.push(o.slice(c,m)),e+=m-c),p){case 0:{l.push(65533),e++;break}case 9:{for(d=Math.ceil(e/4)*4,l.push(-2);e++<d;)l.push(-1);break}case 10:{l.push(-4),e=1;break}default:r=!0,e=1}c=m+1}return a&&(r&&l.push(-5),t&&l.push(t),l.push(null)),l}}function Mr(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Bp(e.position):"start"in e||"end"in e?Bp(e):"line"in e||"column"in e?Vl(e):""}function Vl(e){return qp(e&&e.line)+":"+qp(e&&e.column)}function Bp(e){return Vl(e&&e.start)+"-"+Vl(e&&e.end)}function qp(e){return e&&typeof e=="number"?e:1}var Hp={}.hasOwnProperty;function Yl(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),bS(n)(Wl(Hl(n).document().write(Gl()(e,t,!0))))}function bS(e){let t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(Xd),autolinkProtocol:C,autolinkEmail:C,atxHeading:o(Zd),blockQuote:o(zt),characterEscape:C,characterReference:C,codeFenced:o(Un),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:o(Un,s),codeText:o(Tr,s),codeTextData:C,data:C,codeFlowValue:C,definition:o(Ha),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:o(Xw),hardBreakEscape:o(Kd),hardBreakTrailing:o(Kd),htmlFlow:o(Jd,s),htmlFlowData:C,htmlText:o(Jd,s),htmlTextData:C,image:o(Qw),label:s,link:o(Xd),listItem:o(ex),listItemValue:m,listOrdered:o(Qd,c),listUnordered:o(Qd),paragraph:o(tx),reference:g,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:o(Zd),strong:o(nx),thematicBreak:o(ix)},exit:{atxHeading:l(),atxHeadingSequence:O,autolink:l(),autolinkEmail:yi,autolinkProtocol:Ee,blockQuote:l(),characterEscapeValue:y,characterReferenceMarkerHexadecimal:$n,characterReferenceMarkerNumeric:$n,characterReferenceValue:ja,characterReference:ns,codeFenced:l(S),codeFencedFence:x,codeFencedFenceInfo:p,codeFencedFenceMeta:f,codeFlowValue:y,codeIndented:l(w),codeText:l(z),codeTextData:y,data:y,definition:l(),definitionDestinationString:M,definitionLabelString:D,definitionTitleString:T,emphasis:l(),hardBreakEscape:l(F),hardBreakTrailing:l(F),htmlFlow:l(A),htmlFlowData:y,htmlText:l(N),htmlTextData:y,image:l(se),label:J,labelText:Ne,lineEnding:Z,link:l(te),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:Ve,resourceDestinationString:h,resourceTitleString:Qe,resource:Ut,setextHeading:l(R),setextHeadingLineSequence:E,setextHeadingText:b,strong:l(),thematicBreak:l()}};Wp(t,(e||{}).mdastExtensions||[]);let n={};return r;function r(k){let I={type:"root",children:[]},B={stack:[I],tokenStack:[],config:t,enter:a,exit:u,buffer:s,resume:d,data:n},G=[],Q=-1;for(;++Q<k.length;)if(k[Q][1].type==="listOrdered"||k[Q][1].type==="listUnordered")if(k[Q][0]==="enter")G.push(Q);else{let mt=G.pop();Q=i(k,mt,Q)}for(Q=-1;++Q<k.length;){let mt=t[k[Q][0]];Hp.call(mt,k[Q][1].type)&&mt[k[Q][1].type].call(Object.assign({sliceSerialize:k[Q][2].sliceSerialize},B),k[Q][1])}if(B.tokenStack.length>0){let mt=B.tokenStack[B.tokenStack.length-1];(mt[1]||jp).call(B,void 0,mt[0])}for(I.position={start:gn(k.length>0?k[0][1].start:{line:1,column:1,offset:0}),end:gn(k.length>0?k[k.length-2][1].end:{line:1,column:1,offset:0})},Q=-1;++Q<t.transforms.length;)I=t.transforms[Q](I)||I;return I}function i(k,I,B){let G=I-1,Q=-1,mt=!1,zn,Bt,wi,xi;for(;++G<=B;){let Ye=k[G];switch(Ye[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Ye[0]==="enter"?Q++:Q--,xi=void 0;break}case"lineEndingBlank":{Ye[0]==="enter"&&(zn&&!xi&&!Q&&!wi&&(wi=G),xi=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:xi=void 0}if(!Q&&Ye[0]==="enter"&&Ye[1].type==="listItemPrefix"||Q===-1&&Ye[0]==="exit"&&(Ye[1].type==="listUnordered"||Ye[1].type==="listOrdered")){if(zn){let Er=G;for(Bt=void 0;Er--;){let qt=k[Er];if(qt[1].type==="lineEnding"||qt[1].type==="lineEndingBlank"){if(qt[0]==="exit")continue;Bt&&(k[Bt][1].type="lineEndingBlank",mt=!0),qt[1].type="lineEnding",Bt=Er}else if(!(qt[1].type==="linePrefix"||qt[1].type==="blockQuotePrefix"||qt[1].type==="blockQuotePrefixWhitespace"||qt[1].type==="blockQuoteMarker"||qt[1].type==="listItemIndent"))break}wi&&(!Bt||wi<Bt)&&(zn._spread=!0),zn.end=Object.assign({},Bt?k[Bt][1].start:Ye[1].end),k.splice(Bt||G,0,["exit",zn,Ye[2]]),G++,B++}if(Ye[1].type==="listItemPrefix"){let Er={type:"listItem",_spread:!1,start:Object.assign({},Ye[1].start),end:void 0};zn=Er,k.splice(G,0,["enter",Er,Ye[2]]),G++,B++,wi=void 0,xi=!0}}}return k[I][1]._spread=mt,B}function o(k,I){return B;function B(G){a.call(this,k(G),G),I&&I.call(this,G)}}function s(){this.stack.push({type:"fragment",children:[]})}function a(k,I,B){this.stack[this.stack.length-1].children.push(k),this.stack.push(k),this.tokenStack.push([I,B||void 0]),k.position={start:gn(I.start),end:void 0}}function l(k){return I;function I(B){k&&k.call(this,B),u.call(this,B)}}function u(k,I){let B=this.stack.pop(),G=this.tokenStack.pop();if(G)G[0].type!==k.type&&(I?I.call(this,k,G[0]):(G[1]||jp).call(this,k,G[0]));else throw new Error("Cannot close `"+k.type+"` ("+Mr({start:k.start,end:k.end})+"): it\u2019s not open");B.position.end=gn(k.end)}function d(){return vl(this.stack.pop())}function c(){this.data.expectingFirstListItemValue=!0}function m(k){if(this.data.expectingFirstListItemValue){let I=this.stack[this.stack.length-2];I.start=Number.parseInt(this.sliceSerialize(k),10),this.data.expectingFirstListItemValue=void 0}}function p(){let k=this.resume(),I=this.stack[this.stack.length-1];I.lang=k}function f(){let k=this.resume(),I=this.stack[this.stack.length-1];I.meta=k}function x(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function S(){let k=this.resume(),I=this.stack[this.stack.length-1];I.value=k.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function w(){let k=this.resume(),I=this.stack[this.stack.length-1];I.value=k.replace(/(\r?\n|\r)$/g,"")}function D(k){let I=this.resume(),B=this.stack[this.stack.length-1];B.label=I,B.identifier=Oe(this.sliceSerialize(k)).toLowerCase()}function T(){let k=this.resume(),I=this.stack[this.stack.length-1];I.title=k}function M(){let k=this.resume(),I=this.stack[this.stack.length-1];I.url=k}function O(k){let I=this.stack[this.stack.length-1];if(!I.depth){let B=this.sliceSerialize(k).length;I.depth=B}}function b(){this.data.setextHeadingSlurpLineEnding=!0}function E(k){let I=this.stack[this.stack.length-1];I.depth=this.sliceSerialize(k).codePointAt(0)===61?1:2}function R(){this.data.setextHeadingSlurpLineEnding=void 0}function C(k){let B=this.stack[this.stack.length-1].children,G=B[B.length-1];(!G||G.type!=="text")&&(G=rx(),G.position={start:gn(k.start),end:void 0},B.push(G)),this.stack.push(G)}function y(k){let I=this.stack.pop();I.value+=this.sliceSerialize(k),I.position.end=gn(k.end)}function Z(k){let I=this.stack[this.stack.length-1];if(this.data.atHardBreak){let B=I.children[I.children.length-1];B.position.end=gn(k.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(I.type)&&(C.call(this,k),y.call(this,k))}function F(){this.data.atHardBreak=!0}function A(){let k=this.resume(),I=this.stack[this.stack.length-1];I.value=k}function N(){let k=this.resume(),I=this.stack[this.stack.length-1];I.value=k}function z(){let k=this.resume(),I=this.stack[this.stack.length-1];I.value=k}function te(){let k=this.stack[this.stack.length-1];if(this.data.inReference){let I=this.data.referenceType||"shortcut";k.type+="Reference",k.referenceType=I,delete k.url,delete k.title}else delete k.identifier,delete k.label;this.data.referenceType=void 0}function se(){let k=this.stack[this.stack.length-1];if(this.data.inReference){let I=this.data.referenceType||"shortcut";k.type+="Reference",k.referenceType=I,delete k.url,delete k.title}else delete k.identifier,delete k.label;this.data.referenceType=void 0}function Ne(k){let I=this.sliceSerialize(k),B=this.stack[this.stack.length-2];B.label=Es(I),B.identifier=Oe(I).toLowerCase()}function J(){let k=this.stack[this.stack.length-1],I=this.resume(),B=this.stack[this.stack.length-1];if(this.data.inReference=!0,B.type==="link"){let G=k.children;B.children=G}else B.alt=I}function h(){let k=this.resume(),I=this.stack[this.stack.length-1];I.url=k}function Qe(){let k=this.resume(),I=this.stack[this.stack.length-1];I.title=k}function Ut(){this.data.inReference=void 0}function g(){this.data.referenceType="collapsed"}function Ve(k){let I=this.resume(),B=this.stack[this.stack.length-1];B.label=I,B.identifier=Oe(this.sliceSerialize(k)).toLowerCase(),this.data.referenceType="full"}function $n(k){this.data.characterReferenceType=k.type}function ja(k){let I=this.sliceSerialize(k),B=this.data.characterReferenceType,G;B?(G=Ts(I,B==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):G=Dr(I);let Q=this.stack[this.stack.length-1];Q.value+=G}function ns(k){let I=this.stack.pop();I.position.end=gn(k.end)}function Ee(k){y.call(this,k);let I=this.stack[this.stack.length-1];I.url=this.sliceSerialize(k)}function yi(k){y.call(this,k);let I=this.stack[this.stack.length-1];I.url="mailto:"+this.sliceSerialize(k)}function zt(){return{type:"blockquote",children:[]}}function Un(){return{type:"code",lang:null,meta:null,value:""}}function Tr(){return{type:"inlineCode",value:""}}function Ha(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Xw(){return{type:"emphasis",children:[]}}function Zd(){return{type:"heading",depth:0,children:[]}}function Kd(){return{type:"break"}}function Jd(){return{type:"html",value:""}}function Qw(){return{type:"image",title:null,url:"",alt:null}}function Xd(){return{type:"link",title:null,url:"",children:[]}}function Qd(k){return{type:"list",ordered:k.type==="listOrdered",start:null,spread:k._spread,children:[]}}function ex(k){return{type:"listItem",spread:k._spread,checked:null,children:[]}}function tx(){return{type:"paragraph",children:[]}}function nx(){return{type:"strong",children:[]}}function rx(){return{type:"text",value:""}}function ix(){return{type:"thematicBreak"}}}function gn(e){return{line:e.line,column:e.column,offset:e.offset}}function Wp(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?Wp(e,r):kS(e,r)}}function kS(e,t){let n;for(n in t)if(Hp.call(t,n))switch(n){case"canContainEols":{let r=t[n];r&&e[n].push(...r);break}case"transforms":{let r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{let r=t[n];r&&Object.assign(e[n],r);break}}}function jp(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Mr({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Mr({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Mr({start:t.start,end:t.end})+") is still open")}function Zl(e,t){let n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function Kl(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}var Rr=(function(e){if(e==null)return CS;if(typeof e=="function")return Ls(e);if(typeof e=="object")return Array.isArray(e)?SS(e):TS(e);if(typeof e=="string")return ES(e);throw new Error("Expected function, string, or object as test")});function SS(e){let t=[],n=-1;for(;++n<e.length;)t[n]=Rr(e[n]);return Ls(r);function r(...i){let o=-1;for(;++o<t.length;)if(t[o].apply(this,i))return!0;return!1}}function TS(e){let t=e;return Ls(n);function n(r){let i=r,o;for(o in e)if(i[o]!==t[o])return!1;return!0}}function ES(e){return Ls(t);function t(n){return n&&n.type===e}}function Ls(e){return t;function t(n,r,i){return!!(IS(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function CS(){return!0}function IS(e){return e!==null&&typeof e=="object"&&"type"in e}function Gp(e){return"\x1B[33m"+e+"\x1B[39m"}var Vp=[],Yp=!0,Jl=!1,Zp="skip";function Xl(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;let o=Rr(i),s=r?-1:1;a(e,void 0,[])();function a(l,u,d){let c=l&&typeof l=="object"?l:{};if(typeof c.type=="string"){let p=typeof c.tagName=="string"?c.tagName:typeof c.name=="string"?c.name:void 0;Object.defineProperty(m,"name",{value:"node ("+Gp(l.type+(p?"<"+p+">":""))+")"})}return m;function m(){let p=Vp,f,x,S;if((!t||o(l,u,d[d.length-1]||void 0))&&(p=_S(n(l,d)),p[0]===Jl))return p;if("children"in l&&l.children){let w=l;if(w.children&&p[0]!==Zp)for(x=(r?w.children.length:-1)+s,S=d.concat(w);x>-1&&x<w.children.length;){let D=w.children[x];if(f=a(D,x,S)(),f[0]===Jl)return f;x=typeof f[1]=="number"?f[1]:x+s}}return p}}}function _S(e){return Array.isArray(e)?e:typeof e=="number"?[Yp,e]:e==null?Vp:[e]}function Ql(e,t,n){let i=Rr((n||{}).ignore||[]),o=AS(t),s=-1;for(;++s<o.length;)Xl(e,"text",a);function a(u,d){let c=-1,m;for(;++c<d.length;){let p=d[c],f=m?m.children:void 0;if(i(p,f?f.indexOf(p):void 0,m))return;m=p}if(m)return l(u,d)}function l(u,d){let c=d[d.length-1],m=o[s][0],p=o[s][1],f=0,S=c.children.indexOf(u),w=!1,D=[];m.lastIndex=0;let T=m.exec(u.value);for(;T;){let M=T.index,O={index:T.index,input:T.input,stack:[...d,u]},b=p(...T,O);if(typeof b=="string"&&(b=b.length>0?{type:"text",value:b}:void 0),b===!1?m.lastIndex=M+1:(f!==M&&D.push({type:"text",value:u.value.slice(f,M)}),Array.isArray(b)?D.push(...b):b&&D.push(b),f=M+T[0].length,w=!0),!m.global)break;T=m.exec(u.value)}return w?(f<u.value.length&&D.push({type:"text",value:u.value.slice(f)}),c.children.splice(S,1,...D)):D=[u],S+D.length}}function AS(e){let t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");let n=!e[0]||Array.isArray(e[0])?e:[e],r=-1;for(;++r<n.length;){let i=n[r];t.push([OS(i[0]),DS(i[1])])}return t}function OS(e){return typeof e=="string"?new RegExp(Kl(e),"g"):e}function DS(e){return typeof e=="function"?e:function(){return e}}function tu(){return{transforms:[LS],enter:{literalAutolink:vS,literalAutolinkEmail:eu,literalAutolinkHttp:eu,literalAutolinkWww:eu},exit:{literalAutolink:PS,literalAutolinkEmail:NS,literalAutolinkHttp:MS,literalAutolinkWww:RS}}}function vS(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function eu(e){this.config.enter.autolinkProtocol.call(this,e)}function MS(e){this.config.exit.autolinkProtocol.call(this,e)}function RS(e){this.config.exit.data.call(this,e);let t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function NS(e){this.config.exit.autolinkEmail.call(this,e)}function PS(e){this.exit(e)}function LS(e){Ql(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,FS],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),$S]],{ignore:["link","linkReference"]})}function FS(e,t,n,r,i){let o="";if(!Kp(i)||(/^w/i.test(t)&&(n=t+n,t="",o="http://"),!US(n)))return!1;let s=zS(n+r);if(!s[0])return!1;let a={type:"link",title:null,url:o+t+s[0],children:[{type:"text",value:t+s[0]}]};return s[1]?[a,{type:"text",value:s[1]}]:a}function $S(e,t,n,r){return!Kp(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function US(e){let t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function zS(e){let t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")"),i=Zl(e,"("),o=Zl(e,")");for(;r!==-1&&i>o;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),o++;return[e,n]}function Kp(e,t){let n=e.input.charCodeAt(e.index-1);return(e.index===0||Et(n)||Vn(n))&&(!t||n!==47)}JS.peek=KS;function qS(){this.buffer()}function jS(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function HS(){this.buffer()}function WS(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function GS(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Oe(this.sliceSerialize(e)).toLowerCase(),n.label=t}function VS(e){this.exit(e)}function YS(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Oe(this.sliceSerialize(e)).toLowerCase(),n.label=t}function ZS(e){this.exit(e)}function KS(){return"["}function JS(e,t,n,r){let i=n.createTracker(r),o=i.move("[^"),s=n.enter("footnoteReference"),a=n.enter("reference");return o+=i.move(n.safe(n.associationId(e),{after:"]",before:o})),a(),s(),o+=i.move("]"),o}function nu(){return{enter:{gfmFootnoteCallString:qS,gfmFootnoteCall:jS,gfmFootnoteDefinitionLabelString:HS,gfmFootnoteDefinition:WS},exit:{gfmFootnoteCallString:GS,gfmFootnoteCall:VS,gfmFootnoteDefinitionLabelString:YS,gfmFootnoteDefinition:ZS}}}t0.peek=n0;function ru(){return{canContainEols:["delete"],enter:{strikethrough:QS},exit:{strikethrough:e0}}}function QS(e){this.enter({type:"delete",children:[]},e)}function e0(e){this.exit(e)}function t0(e,t,n,r){let i=n.createTracker(r),o=n.enter("strikethrough"),s=i.move("~~");return s+=n.containerPhrasing(e,{...i.current(),before:s,after:"~"}),s+=i.move("~~"),o(),s}function n0(){return"~"}function ou(){return{enter:{table:i0,tableData:Jp,tableHeader:Jp,tableRow:s0},exit:{codeText:a0,table:o0,tableData:iu,tableHeader:iu,tableRow:iu}}}function i0(e){let t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function o0(e){this.exit(e),this.data.inTable=void 0}function s0(e){this.enter({type:"tableRow",children:[]},e)}function iu(e){this.exit(e)}function Jp(e){this.enter({type:"tableCell",children:[]},e)}function a0(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,l0));let n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function l0(e,t){return t==="|"?t:e}function su(){return{exit:{taskListCheckValueChecked:Xp,taskListCheckValueUnchecked:Xp,paragraph:c0}}}function Xp(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function c0(e){let t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){let n=this.stack[this.stack.length-1];n.type;let r=n.children[0];if(r&&r.type==="text"){let i=t.children,o=-1,s;for(;++o<i.length;){let a=i[o];if(a.type==="paragraph"){s=a;break}}s===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function au(){return[tu(),nu(),ru(),ou(),su()]}var m0={tokenize:y0,partial:!0},Qp={tokenize:w0,partial:!0},ef={tokenize:x0,partial:!0},tf={tokenize:b0,partial:!0},p0={tokenize:k0,partial:!0},nf={name:"wwwAutolink",tokenize:h0,previous:of},rf={name:"protocolAutolink",tokenize:g0,previous:sf},Kt={name:"emailAutolink",tokenize:f0,previous:af},It={};function uu(){return{text:It}}var Jn=48;for(;Jn<123;)It[Jn]=Kt,Jn++,Jn===58?Jn=65:Jn===91&&(Jn=97);It[43]=Kt;It[45]=Kt;It[46]=Kt;It[95]=Kt;It[72]=[Kt,rf];It[104]=[Kt,rf];It[87]=[Kt,nf];It[119]=[Kt,nf];function f0(e,t,n){let r=this,i,o;return s;function s(c){return!lu(c)||!af.call(r,r.previous)||cu(r.events)?n(c):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),a(c))}function a(c){return lu(c)?(e.consume(c),a):c===64?(e.consume(c),l):n(c)}function l(c){return c===46?e.check(p0,d,u)(c):c===45||c===95||he(c)?(o=!0,e.consume(c),l):d(c)}function u(c){return e.consume(c),i=!0,l}function d(c){return o&&i&&fe(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(c)):n(c)}}function h0(e,t,n){let r=this;return i;function i(s){return s!==87&&s!==119||!of.call(r,r.previous)||cu(r.events)?n(s):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(m0,e.attempt(Qp,e.attempt(ef,o),n),n)(s))}function o(s){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(s)}}function g0(e,t,n){let r=this,i="",o=!1;return s;function s(c){return(c===72||c===104)&&sf.call(r,r.previous)&&!cu(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(c),e.consume(c),a):n(c)}function a(c){if(fe(c)&&i.length<5)return i+=String.fromCodePoint(c),e.consume(c),a;if(c===58){let m=i.toLowerCase();if(m==="http"||m==="https")return e.consume(c),l}return n(c)}function l(c){return c===47?(e.consume(c),o?u:(o=!0,l)):n(c)}function u(c){return c===null||Gn(c)||q(c)||Et(c)||Vn(c)?n(c):e.attempt(Qp,e.attempt(ef,d),n)(c)}function d(c){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(c)}}function y0(e,t,n){let r=0;return i;function i(s){return(s===87||s===119)&&r<3?(r++,e.consume(s),i):s===46&&r===3?(e.consume(s),o):n(s)}function o(s){return s===null?n(s):t(s)}}function w0(e,t,n){let r,i,o;return s;function s(u){return u===46||u===95?e.check(tf,l,a)(u):u===null||q(u)||Et(u)||u!==45&&Vn(u)?l(u):(o=!0,e.consume(u),s)}function a(u){return u===95?r=!0:(i=r,r=void 0),e.consume(u),s}function l(u){return i||r||!o?n(u):t(u)}}function x0(e,t){let n=0,r=0;return i;function i(s){return s===40?(n++,e.consume(s),i):s===41&&r<n?o(s):s===33||s===34||s===38||s===39||s===41||s===42||s===44||s===46||s===58||s===59||s===60||s===63||s===93||s===95||s===126?e.check(tf,t,o)(s):s===null||q(s)||Et(s)?t(s):(e.consume(s),i)}function o(s){return s===41&&r++,e.consume(s),i}}function b0(e,t,n){return r;function r(a){return a===33||a===34||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===63||a===95||a===126?(e.consume(a),r):a===38?(e.consume(a),o):a===93?(e.consume(a),i):a===60||a===null||q(a)||Et(a)?t(a):n(a)}function i(a){return a===null||a===40||a===91||q(a)||Et(a)?t(a):r(a)}function o(a){return fe(a)?s(a):n(a)}function s(a){return a===59?(e.consume(a),r):fe(a)?(e.consume(a),s):n(a)}}function k0(e,t,n){return r;function r(o){return e.consume(o),i}function i(o){return he(o)?n(o):t(o)}}function of(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||q(e)}function sf(e){return!fe(e)}function af(e){return!(e===47||lu(e))}function lu(e){return e===43||e===45||e===46||e===95||he(e)}function cu(e){let t=e.length,n=!1;for(;t--;){let r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}var S0={tokenize:O0,partial:!0};function du(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:I0,continuation:{tokenize:_0},exit:A0}},text:{91:{name:"gfmFootnoteCall",tokenize:C0},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:T0,resolveTo:E0}}}}function T0(e,t,n){let r=this,i=r.events.length,o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),s;for(;i--;){let l=r.events[i][1];if(l.type==="labelImage"){s=l;break}if(l.type==="gfmFootnoteCall"||l.type==="labelLink"||l.type==="label"||l.type==="image"||l.type==="link")break}return a;function a(l){if(!s||!s._balanced)return n(l);let u=Oe(r.sliceSerialize({start:s.end,end:r.now()}));return u.codePointAt(0)!==94||!o.includes(u.slice(1))?n(l):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(l),e.exit("gfmFootnoteCallLabelMarker"),t(l))}}function E0(e,t){let n=e.length,r;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){r=e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";let i={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},o={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};o.end.column++,o.end.offset++,o.end._bufferIndex++;let s={type:"gfmFootnoteCallString",start:Object.assign({},o.end),end:Object.assign({},e[e.length-1][1].start)},a={type:"chunkString",contentType:"string",start:Object.assign({},s.start),end:Object.assign({},s.end)},l=[e[n+1],e[n+2],["enter",i,t],e[n+3],e[n+4],["enter",o,t],["exit",o,t],["enter",s,t],["enter",a,t],["exit",a,t],["exit",s,t],e[e.length-2],e[e.length-1],["exit",i,t]];return e.splice(n,e.length-n+1,...l),e}function C0(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),o=0,s;return a;function a(c){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),l}function l(c){return c!==94?n(c):(e.enter("gfmFootnoteCallMarker"),e.consume(c),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",u)}function u(c){if(o>999||c===93&&!s||c===null||c===91||q(c))return n(c);if(c===93){e.exit("chunkString");let m=e.exit("gfmFootnoteCallString");return i.includes(Oe(r.sliceSerialize(m)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(c)}return q(c)||(s=!0),o++,e.consume(c),c===92?d:u}function d(c){return c===91||c===92||c===93?(e.consume(c),o++,u):u(c)}}function I0(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),o,s=0,a;return l;function l(f){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(f),e.exit("gfmFootnoteDefinitionLabelMarker"),u}function u(f){return f===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(f),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",d):n(f)}function d(f){if(s>999||f===93&&!a||f===null||f===91||q(f))return n(f);if(f===93){e.exit("chunkString");let x=e.exit("gfmFootnoteDefinitionLabelString");return o=Oe(r.sliceSerialize(x)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(f),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),m}return q(f)||(a=!0),s++,e.consume(f),f===92?c:d}function c(f){return f===91||f===92||f===93?(e.consume(f),s++,d):d(f)}function m(f){return f===58?(e.enter("definitionMarker"),e.consume(f),e.exit("definitionMarker"),i.includes(o)||i.push(o),P(e,p,"gfmFootnoteDefinitionWhitespace")):n(f)}function p(f){return t(f)}}function _0(e,t,n){return e.check(Ct,t,e.attempt(S0,t,n))}function A0(e){e.exit("gfmFootnoteDefinition")}function O0(e,t,n){let r=this;return P(e,i,"gfmFootnoteDefinitionIndent",5);function i(o){let s=r.events[r.events.length-1];return s&&s[1].type==="gfmFootnoteDefinitionIndent"&&s[2].sliceSerialize(s[1],!0).length===4?t(o):n(o)}}function mu(e){let n=(e||{}).singleTilde,r={name:"strikethrough",tokenize:o,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(s,a){let l=-1;for(;++l<s.length;)if(s[l][0]==="enter"&&s[l][1].type==="strikethroughSequenceTemporary"&&s[l][1]._close){let u=l;for(;u--;)if(s[u][0]==="exit"&&s[u][1].type==="strikethroughSequenceTemporary"&&s[u][1]._open&&s[l][1].end.offset-s[l][1].start.offset===s[u][1].end.offset-s[u][1].start.offset){s[l][1].type="strikethroughSequence",s[u][1].type="strikethroughSequence";let d={type:"strikethrough",start:Object.assign({},s[u][1].start),end:Object.assign({},s[l][1].end)},c={type:"strikethroughText",start:Object.assign({},s[u][1].end),end:Object.assign({},s[l][1].start)},m=[["enter",d,a],["enter",s[u][1],a],["exit",s[u][1],a],["enter",c,a]],p=a.parser.constructs.insideSpan.null;p&&me(m,m.length,0,hn(p,s.slice(u+1,l),a)),me(m,m.length,0,[["exit",c,a],["enter",s[l][1],a],["exit",s[l][1],a],["exit",d,a]]),me(s,u-1,l-u+3,m),l=u+m.length-2;break}}for(l=-1;++l<s.length;)s[l][1].type==="strikethroughSequenceTemporary"&&(s[l][1].type="data");return s}function o(s,a,l){let u=this.previous,d=this.events,c=0;return m;function m(f){return u===126&&d[d.length-1][1].type!=="characterEscape"?l(f):(s.enter("strikethroughSequenceTemporary"),p(f))}function p(f){let x=vr(u);if(f===126)return c>1?l(f):(s.consume(f),c++,p);if(c<2&&!n)return l(f);let S=s.exit("strikethroughSequenceTemporary"),w=vr(f);return S._open=!w||w===2&&!!x,S._close=!x||x===2&&!!w,a(f)}}}var Fs=class{constructor(){this.map=[]}add(t,n,r){D0(this,t,n,r)}consume(t){if(this.map.sort(function(o,s){return o[0]-s[0]}),this.map.length===0)return;let n=this.map.length,r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let i=r.pop();for(;i;){for(let o of i)t.push(o);i=r.pop()}this.map.length=0}};function D0(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function lf(e,t){let n=!1,r=[];for(;t<e.length;){let i=e[t];if(n){if(i[0]==="enter")i[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){let o=r.length-1;r[o]=r[o]==="left"?"center":"right"}}else if(i[1].type==="tableDelimiterRow")break}else i[0]==="enter"&&i[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function pu(){return{flow:{null:{name:"table",tokenize:v0,resolveAll:M0}}}}function v0(e,t,n){let r=this,i=0,o=0,s;return a;function a(y){let Z=r.events.length-1;for(;Z>-1;){let N=r.events[Z][1].type;if(N==="lineEnding"||N==="linePrefix")Z--;else break}let F=Z>-1?r.events[Z][1].type:null,A=F==="tableHead"||F==="tableRow"?b:l;return A===b&&r.parser.lazy[r.now().line]?n(y):A(y)}function l(y){return e.enter("tableHead"),e.enter("tableRow"),u(y)}function u(y){return y===124||(s=!0,o+=1),d(y)}function d(y){return y===null?n(y):_(y)?o>1?(o=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),p):n(y):L(y)?P(e,d,"whitespace")(y):(o+=1,s&&(s=!1,i+=1),y===124?(e.enter("tableCellDivider"),e.consume(y),e.exit("tableCellDivider"),s=!0,d):(e.enter("data"),c(y)))}function c(y){return y===null||y===124||q(y)?(e.exit("data"),d(y)):(e.consume(y),y===92?m:c)}function m(y){return y===92||y===124?(e.consume(y),c):c(y)}function p(y){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(y):(e.enter("tableDelimiterRow"),s=!1,L(y)?P(e,f,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(y):f(y))}function f(y){return y===45||y===58?S(y):y===124?(s=!0,e.enter("tableCellDivider"),e.consume(y),e.exit("tableCellDivider"),x):O(y)}function x(y){return L(y)?P(e,S,"whitespace")(y):S(y)}function S(y){return y===58?(o+=1,s=!0,e.enter("tableDelimiterMarker"),e.consume(y),e.exit("tableDelimiterMarker"),w):y===45?(o+=1,w(y)):y===null||_(y)?M(y):O(y)}function w(y){return y===45?(e.enter("tableDelimiterFiller"),D(y)):O(y)}function D(y){return y===45?(e.consume(y),D):y===58?(s=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(y),e.exit("tableDelimiterMarker"),T):(e.exit("tableDelimiterFiller"),T(y))}function T(y){return L(y)?P(e,M,"whitespace")(y):M(y)}function M(y){return y===124?f(y):y===null||_(y)?!s||i!==o?O(y):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(y)):O(y)}function O(y){return n(y)}function b(y){return e.enter("tableRow"),E(y)}function E(y){return y===124?(e.enter("tableCellDivider"),e.consume(y),e.exit("tableCellDivider"),E):y===null||_(y)?(e.exit("tableRow"),t(y)):L(y)?P(e,E,"whitespace")(y):(e.enter("data"),R(y))}function R(y){return y===null||y===124||q(y)?(e.exit("data"),E(y)):(e.consume(y),y===92?C:R)}function C(y){return y===92||y===124?(e.consume(y),R):R(y)}}function M0(e,t){let n=-1,r=!0,i=0,o=[0,0,0,0],s=[0,0,0,0],a=!1,l=0,u,d,c,m=new Fs;for(;++n<e.length;){let p=e[n],f=p[1];p[0]==="enter"?f.type==="tableHead"?(a=!1,l!==0&&(uf(m,t,l,u,d),d=void 0,l=0),u={type:"table",start:Object.assign({},f.start),end:Object.assign({},f.end)},m.add(n,0,[["enter",u,t]])):f.type==="tableRow"||f.type==="tableDelimiterRow"?(r=!0,c=void 0,o=[0,0,0,0],s=[0,n+1,0,0],a&&(a=!1,d={type:"tableBody",start:Object.assign({},f.start),end:Object.assign({},f.end)},m.add(n,0,[["enter",d,t]])),i=f.type==="tableDelimiterRow"?2:d?3:1):i&&(f.type==="data"||f.type==="tableDelimiterMarker"||f.type==="tableDelimiterFiller")?(r=!1,s[2]===0&&(o[1]!==0&&(s[0]=s[1],c=$s(m,t,o,i,void 0,c),o=[0,0,0,0]),s[2]=n)):f.type==="tableCellDivider"&&(r?r=!1:(o[1]!==0&&(s[0]=s[1],c=$s(m,t,o,i,void 0,c)),o=s,s=[o[1],n,0,0])):f.type==="tableHead"?(a=!0,l=n):f.type==="tableRow"||f.type==="tableDelimiterRow"?(l=n,o[1]!==0?(s[0]=s[1],c=$s(m,t,o,i,n,c)):s[1]!==0&&(c=$s(m,t,s,i,n,c)),i=0):i&&(f.type==="data"||f.type==="tableDelimiterMarker"||f.type==="tableDelimiterFiller")&&(s[3]=n)}for(l!==0&&uf(m,t,l,u,d),m.consume(t.events),n=-1;++n<t.events.length;){let p=t.events[n];p[0]==="enter"&&p[1].type==="table"&&(p[1]._align=lf(t.events,n))}return e}function $s(e,t,n,r,i,o){let s=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",a="tableContent";n[0]!==0&&(o.end=Object.assign({},Nr(t.events,n[0])),e.add(n[0],0,[["exit",o,t]]));let l=Nr(t.events,n[1]);if(o={type:s,start:Object.assign({},l),end:Object.assign({},l)},e.add(n[1],0,[["enter",o,t]]),n[2]!==0){let u=Nr(t.events,n[2]),d=Nr(t.events,n[3]),c={type:a,start:Object.assign({},u),end:Object.assign({},d)};if(e.add(n[2],0,[["enter",c,t]]),r!==2){let m=t.events[n[2]],p=t.events[n[3]];if(m[1].end=Object.assign({},p[1].end),m[1].type="chunkText",m[1].contentType="text",n[3]>n[2]+1){let f=n[2]+1,x=n[3]-n[2]-1;e.add(f,x,[])}}e.add(n[3]+1,0,[["exit",c,t]])}return i!==void 0&&(o.end=Object.assign({},Nr(t.events,i)),e.add(i,0,[["exit",o,t]]),o=void 0),o}function uf(e,t,n,r,i){let o=[],s=Nr(t.events,n);i&&(i.end=Object.assign({},s),o.push(["exit",i,t])),r.end=Object.assign({},s),o.push(["exit",r,t]),e.add(n+1,0,o)}function Nr(e,t){let n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}var R0={name:"tasklistCheck",tokenize:N0};function fu(){return{text:{91:R0}}}function N0(e,t,n){let r=this;return i;function i(l){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(l):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),o)}function o(l){return q(l)?(e.enter("taskListCheckValueUnchecked"),e.consume(l),e.exit("taskListCheckValueUnchecked"),s):l===88||l===120?(e.enter("taskListCheckValueChecked"),e.consume(l),e.exit("taskListCheckValueChecked"),s):n(l)}function s(l){return l===93?(e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),a):n(l)}function a(l){return _(l)?t(l):L(l)?e.check({tokenize:P0},t,n)(l):n(l)}}function P0(e,t,n){return P(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function cf(e){return Cs([uu(),du(),mu(e),pu(),fu()])}var L0=new Set("*_~`[]<>|!\\-+"),F0=new Set("*_[]|"),$0=new Set(".-+_"),U0=/[\w.+-]/,df=1e7;function z0(e){if(e.length>Nm)return!1;let t=0,n=1,r=0,i=!0,o=!0,s=0,a="",l=0,u=0,d=0;for(let c of e){if(U0.test(c))l+=1,$0.has(a)&&(u+=1);else if(u>0){if(d+=u*l,d>df)return!1;l=u=0}else l=0;if(c===`
|
|
59
|
+
`){if(++n>4e3)return!1;i=!0,o=!0,r=0,s=0,a="";continue}if(i&&(c===" "||c===" ")){if(r+=c===" "?4:1,r>128)return!1}else i=!1;let m=o&&(c==="."||c===")")&&a>="0"&&a<="9";if(o&&=m||" >-+*0123456789".includes(c),(m||L0.has(c)&&(c!==a||F0.has(c)||o&&c===">"))&&(++s>128||++t>2e3))return!1;a=c}return d+u*l<=df}var hu=4e3;function B0(e){let t=[{node:e,depth:0}],n=0;for(;t.length;){let{node:r,depth:i}=t.pop();if(n+=1,r.type==="table"&&(n+=(r.children?.length??0)*(r.children?.[0]?.children?.length??0)),i>32||n>hu)return!1;for(let o of r.children??[])t.push({node:o,depth:i+1})}return!0}function mf(e){if(!z0(e))return null;let t=Yl(e,{extensions:[cf()],mdastExtensions:[au()]});return B0(t)?t:null}var pf={note:"Note",tip:"Tip",important:"Important",warning:"Warning",caution:"Caution"};var q0=/^\[!(note|tip|important|warning|caution)\][ \t]*(?:\r?\n|$)/i;function ff(e){let t=new Map;for(let n of e.children??[]){let r=n.type==="blockquote"?j0(n):null;r&&t.set(n,r)}return t}function j0(e){let t=e.children?.[0],n=t?.type==="paragraph"?t.children??[]:[],[r,i]=n,o=r?.type==="text"?q0.exec(r.value??""):null;if(!t||!r||!o)return null;let s=r.value.slice(o[0].length);if(!s&&i&&i.type!=="break"&&!o[0].endsWith(`
|
|
60
|
+
`))return null;let a=s?0:i?.type==="break"?2:1;return n.length===a&&e.children.length===1?null:(r.value=s,n.splice(0,a),n.length||e.children.shift(),o[1].toLowerCase())}var H0=64,gu=/[ \t\n\r]*/y,hf=/"(?:[^"\\]|\\.)*"/y,W0=/-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?|true|false|null/y;function yu(e){if(!/^[ \t\n\r]*[[{]/.test(e))return null;try{JSON.parse(e)}catch{return null}let t=0,n=()=>{gu.lastIndex=t,gu.exec(e),t=gu.lastIndex},r=a=>{let l=JSON.parse(a);return ki(l)?null:l},i=a=>{a.lastIndex=t;let l=a.exec(e)[0];return t=a.lastIndex,l},o=0,s=a=>{if(++o>hu)return null;n();let l=e[t];if(l==="{"||l==="["){if(a>=H0)return null;t++,n();let d=l==="{"?{kind:"object",entries:[]}:{kind:"array",items:[]};for(;e[t]!==(l==="{"?"}":"]");){if(e[t]===","&&t++,d.kind==="object"){n();let c=i(hf),m=r(c);n(),t++;let p=s(a+1);if(m===null||!p)return null;d.entries.push({key:m,keyText:c,value:p})}else{let c=s(a+1);if(!c)return null;d.items.push(c)}n()}return t++,d}if(l==='"'){let d=i(hf),c=r(d);return c===null?null:{kind:"string",text:d,value:c}}let u=i(W0);return{kind:u==="null"?"null":u==="true"||u==="false"?"boolean":"number",text:u}};return s(0)}var Us=e=>e.replace(/\s+/gu," ").trim(),G0=/^\s*(?:```|~~~)|^\s{0,3}(?:([-*_])(?:\s*\1){2,}|=+)\s*$|^\s*\|?(?:\s*:?-+:?\s*\|)+\s*(?::?-+:?\s*)?$/,V0=/^\s{0,3}(?:>\s?)*\s*(?:#{1,6}\s+|(?:[-*+]|\d{1,9}[.)])\s+(?:\[[ xX]\]\s+)?)?/,Y0=[[/\\\r?$/,""],[/!?\[([^\]]*)\]\([^)]*\)/g,"$1"],[/<((?:https?|mailto):[^>\s]+)>/g,"$1"],[/`+([^`]+)`+/g,"$1"],[/\*\*([^*]+)\*\*/g,"$1"],[/__([^_]+)__/g,"$1"],[/~~([^~]+)~~/g,"$1"],[/\*([^*\s](?:[^*]*[^*\s])?)\*/g,"$1"],[/(?<![\p{L}\p{N}_])_([^_\s](?:[^_]*[^_\s])?)_(?![\p{L}\p{N}_])/gu,"$1"],[/\\([!-/:-@[-`{-~])/g,"$1"]];function gf(e,t){let n=Si(e);if(t!=="markdown")return Us(n);if(G0.test(n))return"";let r=n.replace(V0,"");for(let[i,o]of Y0)r=r.replace(i,o);return Us(r)}var yf=e=>e.replace(/[\s.!?…:;,]+$/u,"");function $i(e,t){let n=yf(Si(e));return n!==""&&n===yf(Si(t))}function Z0(e,t,n){let r=t.findIndex(o=>gf(o,n)!=="");if(!e||r===-1)return-1;let i=t[r];return $i(gf(i,n),e)||$i(J0(i,n),e)?r:-1}var K0=/^\s*(?:```|~~~)|\]\(|<(?:https?|mailto):|https?:\/\/|www\./im;function wu(e,t,n){if(!t)return"";let r=t.split(`
|
|
61
|
+
`),i=Z0(e,r,n);return i===-1||yu(t)||(n==="markdown"?K0.test(r.slice(0,i+1).join(`
|
|
62
|
+
`)):!$i(r[i],e))?t:r.slice(i+1).join(`
|
|
63
|
+
`).replace(/^(?:[ \t]*\n)+/,"")}function J0(e,t){return X0(e,t,n=>n.value)}function X0(e,t,n){let r=Si(e),i=t==="markdown"&&!yu(r)?mf(r):null;return i?oT(Q0(i,n)):Us(r)}function Q0(e,t){let n=[],r=null,i=!1,o=null,s=ff(e),a=new Set(e.children),l=[{node:e}];for(;l.length;){let{node:u,number:d}=l.pop();switch(a.has(u)&&(o=null),u.type){case"paragraph":case"heading":case"tableCell":case"code":case"html":{let c=u.type==="html"?rT(u.value):[{kind:u.type==="heading"?"heading":u.type==="tableCell"?"cell":"other",text:u.type==="code"?t(u):eT(u)}];for(let m of c){let p=m.text;o&&(p=`${o}: ${p}`);let f=m.kind==="other"&&r?"item":m.kind;r?.number!==void 0&&(p=`${r.number}. ${p}`);let x=i||m.rowStart;n.push({kind:f,text:p,...r?.number!==void 0?{number:r.number}:{},...x?{rowStart:x}:{}}),r=null,i=!1,o=null}break}case"list":for(let c=u.children.length-1;c>=0;c--)l.push({node:u.children[c],...u.ordered?{number:(u.start??1)+c}:{}});break;case"listItem":r=d===void 0?{}:{number:d},Pr(l,u);break;case"tableRow":i=!0,Pr(l,u);break;case"blockquote":{let c=s.get(u);c&&(o=pf[c]),Pr(l,u);break}case"definition":case"thematicBreak":break;default:"children"in u&&Pr(l,u)}}return n}function Pr(e,t){for(let n=t.children.length-1;n>=0;n--)e.push({node:t.children[n]})}function eT(e){let t="",n=[];for(Pr(n,e);n.length;){let{node:r}=n.pop();r.type==="text"||r.type==="inlineCode"?t+=r.value:r.type==="image"||r.type==="imageReference"?t+=r.alt??"":r.type==="break"?t+=" ":r.type==="html"?t+=xf(r.value):"children"in r&&Pr(n,r)}return t}var tT=/<\/?(?:a|abbr|b|bdi|bdo|cite|code|data|del|dfn|em|font|i|ins|kbd|mark|q|s|samp|small|span|strike|strong|sub|sup|time|u|var|wbr)\b[^<>]*>/giu,wf=e=>e.replace(/<!--[\s\S]*?(?:-->|$)/gu," ").replace(/<(script|style)\b[\s\S]*?(?:<\/\1\s*>|$)/giu," ");function xf(e){return Es(wf(e).replace(/<img\b[^<>]*?\balt\s*=\s*(?:"([^"<>]*)"|'([^'<>]*)')[^<>]*>/giu," $1$2 ").replace(tT,"").replace(/<[^<>]*>/gu," "))}var nT=/<(\/?)(h[1-6]|li|t[dh]|tr|p|div|ul|ol|table|blockquote|pre|hr|section|article|header|footer)\b[^<>]*>/giu;function rT(e){let t=[],n=wf(e),r="other",i=!1,o=0,s=a=>{let l=xf(n.slice(o,a));l.trim()&&(t.push({kind:r,text:l,...i?{rowStart:i}:{}}),i=!1)};for(let a of n.matchAll(nT)){s(a.index),o=a.index+a[0].length;let[,l,u]=a,d=u.toLowerCase();d==="tr"?i=!l:r=l?"other":/^h\d$/u.test(d)?"heading":d==="li"?"item":/^t[dh]$/u.test(d)?"cell":"other"}return s(n.length),t}var iT=/[\p{Terminal_Punctuation}…][\p{Pe}\p{Pf}"']*$/u;function oT(e){let t="",n=null;for(let r of e){let i=Us(r.text);i&&(n&&(t+=sT(n,r,t)),t+=i,n=r)}return t}function sT(e,t,n){return iT.test(n)?" ":e.kind==="heading"?" \u2014 ":t.kind==="heading"?". ":e.kind==="cell"&&t.kind==="cell"?t.rowStart?"; ":", ":e.kind==="item"&&t.kind==="item"?t.number===void 0?", ":" ":". "}var Ks={};em(Ks,{Chrono:()=>tr,GB:()=>x1,Meridiem:()=>j,ParsingComponents:()=>W,ParsingResult:()=>ft,ReferenceWithTimezone:()=>_t,Weekday:()=>K,casual:()=>Zs,configuration:()=>Ys,parse:()=>b1,parseDate:()=>k1,strict:()=>rh});var j;(function(e){e[e.AM=0]="AM",e[e.PM=1]="PM"})(j||(j={}));var K;(function(e){e[e.SUNDAY=0]="SUNDAY",e[e.MONDAY=1]="MONDAY",e[e.TUESDAY=2]="TUESDAY",e[e.WEDNESDAY=3]="WEDNESDAY",e[e.THURSDAY=4]="THURSDAY",e[e.FRIDAY=5]="FRIDAY",e[e.SATURDAY=6]="SATURDAY"})(K||(K={}));var Ke;(function(e){e[e.JANUARY=1]="JANUARY",e[e.FEBRUARY=2]="FEBRUARY",e[e.MARCH=3]="MARCH",e[e.APRIL=4]="APRIL",e[e.MAY=5]="MAY",e[e.JUNE=6]="JUNE",e[e.JULY=7]="JULY",e[e.AUGUST=8]="AUGUST",e[e.SEPTEMBER=9]="SEPTEMBER",e[e.OCTOBER=10]="OCTOBER",e[e.NOVEMBER=11]="NOVEMBER",e[e.DECEMBER=12]="DECEMBER"})(Ke||(Ke={}));function pt(e,t){e.assign("day",t.getDate()),e.assign("month",t.getMonth()+1),e.assign("year",t.getFullYear())}function zs(e,t){e.assign("hour",t.getHours()),e.assign("minute",t.getMinutes()),e.assign("second",t.getSeconds()),e.assign("millisecond",t.getMilliseconds()),e.assign("meridiem",t.getHours()<12?j.AM:j.PM)}function Jt(e,t){e.imply("day",t.getDate()),e.imply("month",t.getMonth()+1),e.imply("year",t.getFullYear())}function Ui(e,t){e.imply("hour",t.getHours()),e.imply("minute",t.getMinutes()),e.imply("second",t.getSeconds()),e.imply("millisecond",t.getMilliseconds()),e.imply("meridiem",t.getHours()<12?j.AM:j.PM)}var lT={ACDT:630,ACST:570,ADT:-180,AEDT:660,AEST:600,AFT:270,AKDT:-480,AKST:-540,ALMT:360,AMST:-180,AMT:-240,ANAST:720,ANAT:720,AQTT:300,ART:-180,AST:-240,AWDT:540,AWST:480,AZOST:0,AZOT:-60,AZST:300,AZT:240,BNT:480,BOT:-240,BRST:-120,BRT:-180,BST:60,BTT:360,CAST:480,CAT:120,CCT:390,CDT:-300,CEST:120,CET:{timezoneOffsetDuringDst:120,timezoneOffsetNonDst:60,dstStart:e=>bf(e,Ke.MARCH,K.SUNDAY,2),dstEnd:e=>bf(e,Ke.OCTOBER,K.SUNDAY,3)},CHADT:825,CHAST:765,CKT:-600,CLST:-180,CLT:-240,COT:-300,CST:-360,CT:{timezoneOffsetDuringDst:-300,timezoneOffsetNonDst:-360,dstStart:e=>yn(e,Ke.MARCH,K.SUNDAY,2,2),dstEnd:e=>yn(e,Ke.NOVEMBER,K.SUNDAY,1,2)},CVT:-60,CXT:420,ChST:600,DAVT:420,EASST:-300,EAST:-360,EAT:180,ECT:-300,EDT:-240,EEST:180,EET:120,EGST:0,EGT:-60,EST:-300,ET:{timezoneOffsetDuringDst:-240,timezoneOffsetNonDst:-300,dstStart:e=>yn(e,Ke.MARCH,K.SUNDAY,2,2),dstEnd:e=>yn(e,Ke.NOVEMBER,K.SUNDAY,1,2)},FJST:780,FJT:720,FKST:-180,FKT:-240,FNT:-120,GALT:-360,GAMT:-540,GET:240,GFT:-180,GILT:720,GMT:0,GST:240,GYT:-240,HAA:-180,HAC:-300,HADT:-540,HAE:-240,HAP:-420,HAR:-360,HAST:-600,HAT:-90,HAY:-480,HKT:480,HLV:-210,HNA:-240,HNC:-360,HNE:-300,HNP:-480,HNR:-420,HNT:-150,HNY:-540,HOVT:420,ICT:420,IDT:180,IOT:360,IRDT:270,IRKST:540,IRKT:540,IRST:210,IST:330,JST:540,KGT:360,KRAST:480,KRAT:480,KST:540,KUYT:240,LHDT:660,LHST:630,LINT:840,MAGST:720,MAGT:720,MART:-510,MAWT:300,MDT:-360,MESZ:120,MEZ:60,MHT:720,MMT:390,MSD:240,MSK:180,MST:-420,MT:{timezoneOffsetDuringDst:-360,timezoneOffsetNonDst:-420,dstStart:e=>yn(e,Ke.MARCH,K.SUNDAY,2,2),dstEnd:e=>yn(e,Ke.NOVEMBER,K.SUNDAY,1,2)},MUT:240,MVT:300,MYT:480,NCT:660,NDT:-90,NFT:690,NOVST:420,NOVT:360,NPT:345,NST:-150,NUT:-660,NZDT:780,NZST:720,OMSST:420,OMST:420,PDT:-420,PET:-300,PETST:720,PETT:720,PGT:600,PHOT:780,PHT:480,PKT:300,PMDT:-120,PMST:-180,PONT:660,PST:-480,PT:{timezoneOffsetDuringDst:-420,timezoneOffsetNonDst:-480,dstStart:e=>yn(e,Ke.MARCH,K.SUNDAY,2,2),dstEnd:e=>yn(e,Ke.NOVEMBER,K.SUNDAY,1,2)},PWT:540,PYST:-180,PYT:-240,RET:240,SAMT:240,SAST:120,SBT:660,SCT:240,SGT:480,SRT:-180,SST:-660,TAHT:-600,TFT:300,TJT:300,TKT:780,TLT:540,TMT:300,TVT:720,ULAT:480,UTC:0,UYST:-120,UYT:-180,UZT:300,VET:-210,VLAST:660,VLAT:660,VUT:660,WAST:120,WAT:60,WEST:60,WESZ:60,WET:0,WEZ:0,WFT:720,WGST:-120,WGT:-180,WIB:420,WIT:540,WITA:480,WST:780,WT:0,YAKST:600,YAKT:600,YAPT:600,YEKST:360,YEKT:360};function yn(e,t,n,r,i=0){let o=0,s=0;for(;s<r;)o++,new Date(e,t-1,o).getDay()===n&&s++;return new Date(e,t-1,o,i)}function bf(e,t,n,r=0){let i=n===0?7:n,o=new Date(e,t-1+1,1,12),s=o.getDay()===0?7:o.getDay(),a;return s===i?a=7:s<i?a=7+s-i:a=s-i,o.setDate(o.getDate()-a),new Date(e,t-1,o.getDate(),r)}function Bs(e,t,n={}){if(e==null)return null;if(typeof e=="number")return e;let r=n[e]??lT[e];return r==null?null:typeof r=="number"?r:t==null?null:t>r.dstStart(t.getFullYear())&&!(t>r.dstEnd(t.getFullYear()))?r.timezoneOffsetDuringDst:r.timezoneOffsetNonDst}var kf={day:0,second:0,millisecond:0};function ke(e,t){let n=new Date(e);if(t.y&&(t.year=t.y,delete t.y),t.mo&&(t.month=t.mo,delete t.mo),t.M&&(t.month=t.M,delete t.M),t.w&&(t.week=t.w,delete t.w),t.d&&(t.day=t.d,delete t.d),t.h&&(t.hour=t.h,delete t.h),t.m&&(t.minute=t.m,delete t.m),t.s&&(t.second=t.s,delete t.s),t.ms&&(t.millisecond=t.ms,delete t.ms),"year"in t){let r=Math.floor(t.year);n.setFullYear(n.getFullYear()+r);let i=t.year-r;i>0&&(t.month=t?.month??0,t.month+=i*12)}if("quarter"in t){let r=Math.floor(t.quarter);n.setMonth(n.getMonth()+r*3)}if("month"in t){let r=Math.floor(t.month);n.setMonth(n.getMonth()+r);let i=t.month-r;i>0&&(t.week=t?.week??0,t.week+=i*4)}if("week"in t){let r=Math.floor(t.week);n.setDate(n.getDate()+r*7);let i=t.week-r;i>0&&(t.day=t?.day??0,t.day+=Math.round(i*7))}if("day"in t){let r=Math.floor(t.day);n.setDate(n.getDate()+r);let i=t.day-r;i>0&&(t.hour=t?.hour??0,t.hour+=Math.round(i*24))}if("hour"in t){let r=Math.floor(t.hour);n.setHours(n.getHours()+r);let i=t.hour-r;i>0&&(t.minute=t?.minute??0,t.minute+=Math.round(i*60))}if("minute"in t){let r=Math.floor(t.minute);n.setMinutes(n.getMinutes()+r);let i=t.minute-r;i>0&&(t.second=t?.second??0,t.second+=Math.round(i*60))}if("second"in t){let r=Math.floor(t.second);n.setSeconds(n.getSeconds()+r);let i=t.second-r;i>0&&(t.millisecond=t?.millisecond??0,t.millisecond+=Math.round(i*1e3))}if("millisecond"in t){let r=Math.floor(t.millisecond);n.setMilliseconds(n.getMilliseconds()+r)}return n}function wn(e){let t={};for(let n in e)t[n]=-e[n];return t}var _t=class e{instant;timezoneOffset;constructor(t,n){this.instant=t??new Date,this.timezoneOffset=n??null}static fromDate(t){return new e(t)}static fromInput(t,n){if(t instanceof Date)return e.fromDate(t);let r=t?.instant??new Date,i=Bs(t?.timezone,r,n);return new e(r,i)}getDateWithAdjustedTimezone(){let t=new Date(this.instant);return this.timezoneOffset!==null&&t.setMinutes(t.getMinutes()-this.getSystemTimezoneAdjustmentMinute(this.instant)),t}getSystemTimezoneAdjustmentMinute(t,n){t||(t=new Date);let r=-t.getTimezoneOffset(),i=n??this.timezoneOffset??r;return r-i}getTimezoneOffset(){return this.timezoneOffset??-this.instant.getTimezoneOffset()}},W=class e{knownValues;impliedValues;reference;_tags=new Set;constructor(t,n){if(this.reference=t,this.knownValues={},this.impliedValues={},n)for(let i in n)this.knownValues[i]=n[i];let r=t.getDateWithAdjustedTimezone();this.imply("day",r.getDate()),this.imply("month",r.getMonth()+1),this.imply("year",r.getFullYear()),this.imply("hour",12),this.imply("minute",0),this.imply("second",0),this.imply("millisecond",0)}static createRelativeFromReference(t,n=kf){let r=ke(t.getDateWithAdjustedTimezone(),n),i=new e(t);return i.addTag("result/relativeDate"),"hour"in n||"minute"in n||"second"in n||"millisecond"in n?(i.addTag("result/relativeDateAndTime"),zs(i,r),pt(i,r),i.assign("timezoneOffset",t.getTimezoneOffset())):(Ui(i,r),i.imply("timezoneOffset",t.getTimezoneOffset()),"day"in n?(i.assign("day",r.getDate()),i.assign("month",r.getMonth()+1),i.assign("year",r.getFullYear()),i.assign("weekday",r.getDay())):"week"in n?(i.assign("day",r.getDate()),i.assign("month",r.getMonth()+1),i.assign("year",r.getFullYear()),i.imply("weekday",r.getDay())):(i.imply("day",r.getDate()),"month"in n?(i.assign("month",r.getMonth()+1),i.assign("year",r.getFullYear())):(i.imply("month",r.getMonth()+1),"year"in n?i.assign("year",r.getFullYear()):i.imply("year",r.getFullYear())))),i}get(t){return t in this.knownValues?this.knownValues[t]:t in this.impliedValues?this.impliedValues[t]:null}isCertain(t){return t in this.knownValues}getCertainComponents(){return Object.keys(this.knownValues)}imply(t,n){return t in this.knownValues?this:(this.impliedValues[t]=n,this)}assign(t,n){return this.knownValues[t]=n,delete this.impliedValues[t],this}addDurationAsImplied(t){let n=this.dateWithoutTimezoneAdjustment(),r=ke(n,t);return("day"in t||"week"in t||"month"in t||"year"in t)&&(this.delete(["day","weekday","month","year"]),this.imply("day",r.getDate()),this.imply("weekday",r.getDay()),this.imply("month",r.getMonth()+1),this.imply("year",r.getFullYear())),("second"in t||"minute"in t||"hour"in t)&&(this.delete(["second","minute","hour"]),this.imply("second",r.getSeconds()),this.imply("minute",r.getMinutes()),this.imply("hour",r.getHours())),this}delete(t){typeof t=="string"&&(t=[t]);for(let n of t)delete this.knownValues[n],delete this.impliedValues[n]}clone(){let t=new e(this.reference);t.knownValues={},t.impliedValues={};for(let n in this.knownValues)t.knownValues[n]=this.knownValues[n];for(let n in this.impliedValues)t.impliedValues[n]=this.impliedValues[n];return t}isOnlyDate(){return!this.isCertain("hour")&&!this.isCertain("minute")&&!this.isCertain("second")}isOnlyTime(){return!this.isCertain("weekday")&&!this.isCertain("day")&&!this.isCertain("month")&&!this.isCertain("year")}isOnlyWeekdayComponent(){return this.isCertain("weekday")&&!this.isCertain("day")&&!this.isCertain("month")}isDateWithUnknownYear(){return this.isCertain("month")&&!this.isCertain("year")}isValidDate(){let t=new Date(Date.UTC(this.get("year"),this.get("month")-1,this.get("day"),this.get("hour"),this.get("minute"),this.get("second"),this.get("millisecond")));return t.setUTCFullYear(this.get("year")),!(t.getUTCFullYear()!==this.get("year")||t.getUTCMonth()!==this.get("month")-1||t.getUTCDate()!==this.get("day")||this.get("hour")!=null&&t.getUTCHours()!=this.get("hour")||this.get("minute")!=null&&t.getUTCMinutes()!=this.get("minute"))}toString(){return`[ParsingComponents {
|
|
64
64
|
tags: ${JSON.stringify(Array.from(this._tags).sort())},
|
|
65
65
|
knownValues: ${JSON.stringify(this.knownValues)},
|
|
66
66
|
impliedValues: ${JSON.stringify(this.impliedValues)}},
|
|
67
|
-
reference: ${JSON.stringify(this.reference)}]`}date(){let t=this.get("timezoneOffset")??this.reference.timezoneOffset;if(t==null)return this.dateWithoutTimezoneAdjustment();let n=new Date(Date.UTC(this.get("year"),this.get("month")-1,this.get("day"),this.get("hour"),this.get("minute"),this.get("second"),this.get("millisecond")));return n.setUTCFullYear(this.get("year")),new Date(n.getTime()-t*6e4)}addTag(t){return this._tags.add(t),this}addTags(t){for(let n of t)this._tags.add(n);return this}tags(){return new Set(this._tags)}dateWithoutTimezoneAdjustment(){let t=new Date(this.get("year"),this.get("month")-1,this.get("day"),this.get("hour"),this.get("minute"),this.get("second"),this.get("millisecond"));return t.setFullYear(this.get("year")),t}},ft=class e{refDate;index;text;reference;start;end;constructor(t,n,r,i,o){this.reference=t,this.refDate=t.instant,this.index=n,this.text=r,this.start=i||new W(t),this.end=o}clone(){let t=new e(this.reference,this.index,this.text);return t.start=this.start?this.start.clone():null,t.end=this.end?this.end.clone():null,t}date(){return this.start.date()}addTag(t){return this.start.addTag(t),this.end&&this.end.addTag(t),this}addTags(t){return this.start.addTags(t),this.end&&this.end.addTags(t),this}tags(){let t=new Set(this.start.tags());if(this.end)for(let n of this.end.tags())t.add(n);return t}toString(){let t=Array.from(this.tags()).sort();return`[ParsingResult {index: ${this.index}, text: '${this.text}', tags: ${JSON.stringify(t)} ...}]`}};function mu(e,t,n="\\s{0,5},?\\s{0,5}"){let r=t.replace(/\((?!\?)/g,"(?:");return`${e}${r}(?:${n}${r}){0,10}`}function KS(e){let t;return e instanceof Array?t=[...e]:e instanceof Map?t=Array.from(e.keys()):t=Object.keys(e),t}function ge(e){return`(?:${KS(e).sort((n,r)=>r.length-n.length).join("|").replace(/\./g,"\\.")})`}function $s(e){return e<100&&(e>50?e=e+1900:e=e+2e3),e}function wn(e,t,n){let r=new Date(e);r.setMonth(n-1),r.setDate(t);let i=ke(r,{year:1}),o=ke(r,{year:-1});return Math.abs(i.getTime()-e.getTime())<Math.abs(r.getTime()-e.getTime())?r=i:Math.abs(o.getTime()-e.getTime())<Math.abs(r.getTime()-e.getTime())&&(r=o),r.getFullYear()}var Us={sunday:0,sun:0,"sun.":0,monday:1,mon:1,"mon.":1,tuesday:2,tue:2,"tue.":2,wednesday:3,wed:3,"wed.":3,thursday:4,thurs:4,"thurs.":4,thur:4,"thur.":4,thu:4,"thu.":4,friday:5,fri:5,"fri.":5,saturday:6,sat:6,"sat.":6},hu={january:1,february:2,march:3,april:4,may:5,june:6,july:7,august:8,september:9,october:10,november:11,december:12},Fe={...hu,jan:1,"jan.":1,feb:2,"feb.":2,mar:3,"mar.":3,apr:4,"apr.":4,jun:6,"jun.":6,jul:7,"jul.":7,aug:8,"aug.":8,sep:9,"sep.":9,sept:9,"sept.":9,oct:10,"oct.":10,nov:11,"nov.":11,dec:12,"dec.":12},pu={one:1,two:2,three:3,four:4,five:5,six:6,seven:7,eight:8,nine:9,ten:10,eleven:11,twelve:12},fu={first:1,second:2,third:3,fourth:4,fifth:5,sixth:6,seventh:7,eighth:8,ninth:9,tenth:10,eleventh:11,twelfth:12,thirteenth:13,fourteenth:14,fifteenth:15,sixteenth:16,seventeenth:17,eighteenth:18,nineteenth:19,twentieth:20,"twenty first":21,"twenty-first":21,"twenty second":22,"twenty-second":22,"twenty third":23,"twenty-third":23,"twenty fourth":24,"twenty-fourth":24,"twenty fifth":25,"twenty-fifth":25,"twenty sixth":26,"twenty-sixth":26,"twenty seventh":27,"twenty-seventh":27,"twenty eighth":28,"twenty-eighth":28,"twenty ninth":29,"twenty-ninth":29,thirtieth:30,"thirty first":31,"thirty-first":31},ff={second:"second",seconds:"second",minute:"minute",minutes:"minute",hour:"hour",hours:"hour",day:"day",days:"day",week:"week",weeks:"week",month:"month",months:"month",quarter:"quarter",quarters:"quarter",year:"year",years:"year"},Li={s:"second",sec:"second",second:"second",seconds:"second",m:"minute",min:"minute",mins:"minute",minute:"minute",minutes:"minute",h:"hour",hr:"hour",hrs:"hour",hour:"hour",hours:"hour",d:"day",day:"day",days:"day",w:"week",week:"week",weeks:"week",mo:"month",mon:"month",mos:"month",month:"month",months:"month",qtr:"quarter",quarter:"quarter",quarters:"quarter",y:"year",yr:"year",year:"year",years:"year",...ff},hf=`(?:${ge(pu)}|[0-9]+|[0-9]+\\.[0-9]+|half(?:\\s{0,2}an?)?|an?\\b(?:\\s{0,2}few)?|few|several|the|a?\\s{0,2}couple\\s{0,2}(?:of)?)`;function JS(e){let t=e.toLowerCase();return pu[t]!==void 0?pu[t]:t==="a"||t==="an"||t=="the"?1:t.match(/few/)?3:t.match(/half/)?.5:t.match(/couple/)?2:t.match(/several/)?7:parseFloat(t)}var Nr=`(?:${ge(fu)}|[0-9]{1,2}(?:st|nd|rd|th)?)`;function Pr(e){let t=e.toLowerCase();return fu[t]!==void 0?fu[t]:(t=t.replace(/(?:st|nd|rd|th)$/i,""),parseInt(t))}var xn="(?:[1-9][0-9]{0,3}\\s{0,2}(?:BE|AD|BC|BCE|CE)|[1-9][0-9]{3}|[0-9]{2}(?!\\w|:\\d|\\s+(?:am|pm|o\\s*clock|jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)))";function _t(e){if(/BE/i.test(e))return e=e.replace(/BE/i,""),parseInt(e)-543;if(/BCE?/i.test(e))return e=e.replace(/BCE?/i,""),-parseInt(e);if(/(AD|CE)/i.test(e))return e=e.replace(/(AD|CE)/i,""),parseInt(e);let t=parseInt(e);return $s(t)}var gf=`(${hf})\\s{0,3}(${ge(Li)})`,pf=new RegExp(gf,"i"),XS=`(${hf})\\s{0,3}(${ge(ff)})`,yf="\\s{0,5},?(?:\\s*and)?\\s{0,5}",Kt=mu("(?:(?:about|around)\\s{0,3})?",gf,yf),bn=mu("(?:(?:about|around)\\s{0,3})?",XS,yf);function tt(e){let t={},n=e,r=pf.exec(n);for(;r;)QS(t,r),n=n.substring(r[0].length).trim(),r=pf.exec(n);return Object.keys(t).length==0?null:t}function QS(e,t){if(t[0].match(/^[a-zA-Z]+$/))return;let n=JS(t[1]),r=Li[t[2].toLowerCase()];e[r]=n}var V=class{innerPatternHasChange(t,n){return this.innerPattern(t)!==n}patternLeftBoundary(){return"(\\W|^)"}cachedInnerPattern=null;cachedPattern=null;pattern(t){return this.cachedInnerPattern&&!this.innerPatternHasChange(t,this.cachedInnerPattern)?this.cachedPattern:(this.cachedInnerPattern=this.innerPattern(t),this.cachedPattern=new RegExp(`${this.patternLeftBoundary()}${this.cachedInnerPattern.source}`,this.cachedInnerPattern.flags),this.cachedPattern)}extract(t,n){let r=n[1]??"";n.index=n.index+r.length,n[0]=n[0].substring(r.length);for(let i=2;i<n.length;i++)n[i-1]=n[i];return this.innerExtract(t,n)}};var eT=new RegExp(`(?:(?:within|in|for)\\s*)?(?:(?:about|around|roughly|approximately|just)\\s*(?:~\\s*)?)?(${Kt})(?=\\W|$)`,"i"),tT=new RegExp(`(?:within|in|for)\\s*(?:(?:about|around|roughly|approximately|just)\\s*(?:~\\s*)?)?(${Kt})(?=\\W|$)`,"i"),nT=new RegExp(`(?:within|in|for)\\s*(?:(?:about|around|roughly|approximately|just)\\s*(?:~\\s*)?)?(${bn})(?=\\W|$)`,"i"),Fi=class extends V{strictMode;constructor(t){super(),this.strictMode=t}innerPattern(t){return this.strictMode?nT:t.option.forwardDate?eT:tT}innerExtract(t,n){if(n[0].match(/^for\s*the\s*\w+/))return null;let r=tt(n[1]);return r?W.createRelativeFromReference(t.reference,r):null}};var rT=new RegExp(`(?:on\\s{0,3})?(${Nr})(?:\\s{0,3}(?:to|\\-|\\\u2013|until|through|till)\\s{0,3}(${Nr}))?(?:-|/|\\s{0,3}(?:of)?\\s{0,3})(${ge(Fe)})(?:(?:-|/|,?\\s{0,3})(${xn}(?!\\w)))?(?=\\W|$)`,"i"),wf=1,xf=2,iT=3,bf=4,$i=class extends V{innerPattern(){return rT}innerExtract(t,n){let r=t.createParsingResult(n.index,n[0]),i=Fe[n[iT].toLowerCase()],o=Pr(n[wf]);if(o>31)return n.index=n.index+n[wf].length,null;if(r.start.assign("month",i),r.start.assign("day",o),n[bf]){let s=_t(n[bf]);r.start.assign("year",s)}else{let s=wn(t.refDate,o,i);r.start.imply("year",s)}if(n[xf]){let s=Pr(n[xf]);r.end=r.start.clone(),r.end.assign("day",s)}return r}};var oT=new RegExp(`(${ge(Fe)})(?:-|/|\\s*,?\\s*)(${Nr})(?!\\s*(?:am|pm))\\s*(?:(?:to|\\-)\\s*(${Nr})\\s*)?(?:(?:-|/|\\s*,\\s*|\\s+)(${xn}))?(?=\\W|$)(?!\\:\\d)`,"i"),sT=1,kf=2,gu=3,yu=4,Ui=class extends V{shouldSkipYearLikeDate;constructor(t){super(),this.shouldSkipYearLikeDate=t}innerPattern(){return oT}innerExtract(t,n){let r=Fe[n[sT].toLowerCase()],i=Pr(n[kf]);if(i>31||this.shouldSkipYearLikeDate&&!n[gu]&&!n[yu]&&n[kf].match(/^\d{2}$/))return null;let o=t.createParsingComponents({day:i,month:r}).addTag("parser/ENMonthNameMiddleEndianParser");if(n[yu]){let l=_t(n[yu]);o.assign("year",l)}else{let l=wn(t.refDate,i,r);o.imply("year",l)}if(!n[gu])return o;let s=Pr(n[gu]),a=t.createParsingResult(n.index,n[0]);return a.start=o,a.end=o.clone(),a.end.assign("day",s),a}};var aT=new RegExp(`((?:in)\\s*)?(${ge(Fe)})\\s*(?:(?:,|-|of)?\\s*(${xn})?)?(?=[^\\s\\w]|\\s+[^0-9]|\\s+$|$)`,"i"),lT=1,uT=2,Sf=3,zi=class extends V{innerPattern(){return aT}innerExtract(t,n){let r=n[uT].toLowerCase();if(n[0].length<=3&&!hu[r])return null;let i=t.createParsingResult(n.index+(n[lT]||"").length,n.index+n[0].length);i.start.imply("day",1),i.start.addTag("parser/ENMonthNameParser");let o=Fe[r];if(i.start.assign("month",o),n[Sf]){let s=_t(n[Sf]);i.start.assign("year",s)}else{let s=wn(t.refDate,1,o);i.start.imply("year",s)}return i}};var cT=new RegExp(`([0-9]{4})[-\\.\\/\\s](?:(${ge(Fe)})|([0-9]{1,2}))[-\\.\\/\\s]([0-9]{1,2})(?=\\W|$)`,"i"),dT=1,mT=2,Tf=3,pT=4,Bi=class extends V{strictMonthDateOrder;constructor(t){super(),this.strictMonthDateOrder=t}innerPattern(){return cT}innerExtract(t,n){let r=parseInt(n[dT]),i=parseInt(n[pT]),o=n[Tf]?parseInt(n[Tf]):Fe[n[mT].toLowerCase()];if(o<1||o>12){if(this.strictMonthDateOrder)return null;i>=1&&i<=12&&([o,i]=[i,o])}return i<1||i>31?null:{day:i,month:o,year:r}}};var fT="(?:[1-9][0-9]{0,3}\\s{0,2}(?:BE|AD|BC|BCE|CE)|[1-9][0-9]{3})",hT=new RegExp(`(${fT})(?:\\s*[-.\\/,]?\\s*|\\s+of\\s+)(${ge(Fe)})(?=[^\\s\\w]|\\s+[^0-9]|\\s+$|$)`,"i"),gT=1,yT=2,qi=class extends V{innerPattern(){return hT}innerExtract(t,n){let r=_t(n[gT]),i=n[yT].toLowerCase(),o=Fe[i],s=t.createParsingResult(n.index,n[0]);return s.start.imply("day",1),s.start.assign("month",o),s.start.assign("year",r),s.start.addTag("parser/ENYearMonthNameParser"),s}};var wT=new RegExp("([0-9]|0[1-9]|1[012])/([0-9]{4})","i"),xT=1,bT=2,ji=class extends V{innerPattern(){return wT}innerExtract(t,n){let r=parseInt(n[bT]),i=parseInt(n[xT]);return t.createParsingComponents().imply("day",1).assign("month",i).assign("year",r)}};function kT(e,t,n,r){return new RegExp(`${e}${t}(\\d{1,4})(?:(?:\\.|:|\uFF1A)(\\d{1,2})(?:(?::|\uFF1A)(\\d{2})(?:\\.(\\d{1,6}))?)?)?(?:\\s*(a\\.m\\.|p\\.m\\.|am?|pm?))?${n}`,r)}function ST(e,t){return new RegExp(`^(${e})(\\d{1,4})(?:(?:\\.|\\:|\\\uFF1A)(\\d{1,2})(?:(?:\\.|\\:|\\\uFF1A)(\\d{1,2})(?:\\.(\\d{1,6}))?)?)?(?:\\s*(a\\.m\\.|p\\.m\\.|am?|pm?))?${t}`,"i")}var wu=2,Jn=3,zs=4,Bs=5,Lr=6,qs=class{strictMode;constructor(t=!1){this.strictMode=t}patternFlags(){return"i"}primaryPatternLeftBoundary(){return"(^|\\s|T|\\b)"}primarySuffix(){return"(?!/)(?=\\W|$)"}followingSuffix(){return"(?!/)(?=\\W|$)"}pattern(t){return this.getPrimaryTimePatternThroughCache()}extract(t,n){let r=this.extractPrimaryTimeComponents(t,n);if(!r)return n[0].match(/^\d{4}/)?(n.index+=4,null):(n.index+=n[0].length,null);let i=n.index+n[1].length,o=n[0].substring(n[1].length),s=t.createParsingResult(i,o,r);n.index+=n[0].length;let a=t.text.substring(n.index),u=this.getFollowingTimePatternThroughCache().exec(a);return o.match(/^\d{3,4}/)&&u&&(u[0].match(/^\s*([+-])\s*\d{2,4}$/)||u[0].match(/^\s*([+-])\s*\d{2}\W\d{2}/))?null:!u||u[0].match(/^\s*([+-])\s*\d{3,4}$/)?this.checkAndReturnWithoutFollowingPattern(s):(s.end=this.extractFollowingTimeComponents(t,u,s),s.end&&(s.text+=u[0]),this.checkAndReturnWithFollowingPattern(s))}extractPrimaryTimeComponents(t,n,r=!1){let i=t.createParsingComponents(),o=0,s=null,a=parseInt(n[wu]);if(a>100){if(n[wu].length==4&&n[Jn]==null&&!n[Lr]||this.strictMode||n[Jn]!=null)return null;o=a%100,a=Math.floor(a/100)}if(a>24)return null;if(n[Jn]!=null){if(n[Jn].length==1&&!n[Lr])return null;o=parseInt(n[Jn])}if(o>=60)return null;if(a>12&&(s=j.PM),n[Lr]!=null){if(a>12)return null;let l=n[Lr][0].toLowerCase();l=="a"&&(s=j.AM,a==12&&(a=0)),l=="p"&&(s=j.PM,a!=12&&(a+=12))}if(i.assign("hour",a),i.assign("minute",o),s!==null?i.assign("meridiem",s):a<12?i.imply("meridiem",j.AM):i.imply("meridiem",j.PM),n[Bs]!=null){let l=parseInt(n[Bs].substring(0,3));if(l>=1e3)return null;i.assign("millisecond",l)}if(n[zs]!=null){let l=parseInt(n[zs]);if(l>=60)return null;i.assign("second",l)}return i}extractFollowingTimeComponents(t,n,r){let i=t.createParsingComponents();if(n[Bs]!=null){let l=parseInt(n[Bs].substring(0,3));if(l>=1e3)return null;i.assign("millisecond",l)}if(n[zs]!=null){let l=parseInt(n[zs]);if(l>=60)return null;i.assign("second",l)}let o=parseInt(n[wu]),s=0,a=-1;if(n[Jn]!=null?s=parseInt(n[Jn]):o>100&&(s=o%100,o=Math.floor(o/100)),s>=60||o>24)return null;if(o>=12&&(a=j.PM),n[Lr]!=null){if(o>12)return null;let l=n[Lr][0].toLowerCase();l=="a"&&(a=j.AM,o==12&&(o=0,i.isCertain("day")||i.imply("day",i.get("day")+1))),l=="p"&&(a=j.PM,o!=12&&(o+=12)),r.start.isCertain("meridiem")||(a==j.AM?(r.start.imply("meridiem",j.AM),r.start.get("hour")==12&&r.start.assign("hour",0)):(r.start.imply("meridiem",j.PM),r.start.get("hour")!=12&&r.start.assign("hour",r.start.get("hour")+12)))}return i.assign("hour",o),i.assign("minute",s),a>=0?i.assign("meridiem",a):r.start.isCertain("meridiem")&&r.start.get("hour")>12?r.start.get("hour")-12>o?i.imply("meridiem",j.AM):o<=12&&(i.assign("hour",o+12),i.assign("meridiem",j.PM)):o>12?i.imply("meridiem",j.PM):o<=12&&i.imply("meridiem",j.AM),i.date().getTime()<r.start.date().getTime()&&i.imply("day",i.get("day")+1),i}checkAndReturnWithoutFollowingPattern(t){if(t.text.match(/^\d$/)||t.text.match(/^\d\d\d+$/)||t.text.match(/\d[apAP]$/))return null;let n=t.text.match(/[^\d:.](\d[\d.]+)$/);if(n){let r=n[1];if(this.strictMode||r.includes(".")&&!r.match(/\d(\.\d{2})+$/)||parseInt(r)>24)return null}return t}checkAndReturnWithFollowingPattern(t){if(t.text.match(/^\d+-\d+$/))return null;let n=t.text.match(/[^\d:.](\d[\d.]+)\s*-\s*(\d[\d.]+)$/);if(n){if(this.strictMode)return null;let r=n[1],i=n[2];if(i.includes(".")&&!i.match(/\d(\.\d{2})+$/))return null;let o=parseInt(i),s=parseInt(r);if(o>24||s>24)return null}return t}cachedPrimaryPrefix=null;cachedPrimarySuffix=null;cachedPrimaryTimePattern=null;getPrimaryTimePatternThroughCache(){let t=this.primaryPrefix(),n=this.primarySuffix();return this.cachedPrimaryPrefix===t&&this.cachedPrimarySuffix===n?this.cachedPrimaryTimePattern:(this.cachedPrimaryTimePattern=kT(this.primaryPatternLeftBoundary(),t,n,this.patternFlags()),this.cachedPrimaryPrefix=t,this.cachedPrimarySuffix=n,this.cachedPrimaryTimePattern)}cachedFollowingPhase=null;cachedFollowingSuffix=null;cachedFollowingTimePatten=null;getFollowingTimePatternThroughCache(){let t=this.followingPhase(),n=this.followingSuffix();return this.cachedFollowingPhase===t&&this.cachedFollowingSuffix===n?this.cachedFollowingTimePatten:(this.cachedFollowingTimePatten=ST(t,n),this.cachedFollowingPhase=t,this.cachedFollowingSuffix=n,this.cachedFollowingTimePatten)}};var Hi=class extends qs{constructor(t){super(t)}followingPhase(){return"\\s*(?:\\-|\\\u2013|\\~|\\\u301C|to|until|through|till|\\?)\\s*"}primaryPrefix(){return"(?:(?:at|from)\\s*)??"}primarySuffix(){return"(?:\\s*(?:o\\W*clock|at\\s*night|in\\s*the\\s*(?:morning|afternoon)))?(?!/)(?=\\W|$)"}extractPrimaryTimeComponents(t,n){let r=super.extractPrimaryTimeComponents(t,n);if(!r)return r;if(n[0].endsWith("night")){let i=r.get("hour");i>=6&&i<12?(r.assign("hour",r.get("hour")+12),r.assign("meridiem",j.PM)):i<6&&r.assign("meridiem",j.AM)}if(n[0].endsWith("afternoon")){r.assign("meridiem",j.PM);let i=r.get("hour");i>=0&&i<=6&&r.assign("hour",r.get("hour")+12)}return n[0].endsWith("morning")&&(r.assign("meridiem",j.AM),r.get("hour")<12&&r.assign("hour",r.get("hour"))),r.addTag("parser/ENTimeExpressionParser")}extractFollowingTimeComponents(t,n,r){let i=super.extractFollowingTimeComponents(t,n,r);return i&&i.addTag("parser/ENTimeExpressionParser"),i}};var TT=new RegExp(`(${Kt})\\s{0,5}(?:ago|before|earlier)(?=\\W|$)`,"i"),ET=new RegExp(`(${bn})\\s{0,5}(?:ago|before|earlier)(?=\\W|$)`,"i"),Wi=class extends V{strictMode;constructor(t){super(),this.strictMode=t}innerPattern(){return this.strictMode?ET:TT}innerExtract(t,n){let r=tt(n[1]);return r?W.createRelativeFromReference(t.reference,yn(r)):null}};var CT=new RegExp(`(${Kt})\\s{0,5}(?:later|after|from now|henceforth|forward|out)(?=(?:\\W|$))`,"i"),IT=new RegExp(`(${bn})\\s{0,5}(later|after|from now)(?=\\W|$)`,"i"),_T=1,Gi=class extends V{strictMode;constructor(t){super(),this.strictMode=t}innerPattern(){return this.strictMode?IT:CT}innerExtract(t,n){let r=tt(n[_T]);return r?W.createRelativeFromReference(t.reference,r):null}};var Fr=class{refine(t,n){return n.filter(r=>this.isValid(t,r))}},nt=class{refine(t,n){if(n.length<2)return n;let r=[],i=n[0],o=null;for(let s=1;s<n.length;s++){o=n[s];let a=t.text.substring(i.index+i.text.length,o.index);if(!this.shouldMergeResults(a,i,o,t))r.push(i),i=o;else{let l=i,u=o,d=this.mergeResults(a,l,u,t);t.debug(()=>{console.log(`${this.constructor.name} merged ${l} and ${u} into ${d}`)}),i=d}}return i!=null&&r.push(i),r}};var Vi=class extends nt{shouldMergeResults(t,n,r){return!n.end&&!r.end&&t.match(this.patternBetween())!=null}mergeResults(t,n,r){if(!n.start.isOnlyWeekdayComponent()&&!r.start.isOnlyWeekdayComponent()&&(r.start.getCertainComponents().forEach(o=>{n.start.isCertain(o)||n.start.imply(o,r.start.get(o))}),n.start.getCertainComponents().forEach(o=>{r.start.isCertain(o)||r.start.imply(o,n.start.get(o))})),n.start.date()>r.start.date()){let o=n.start.date(),s=r.start.date();r.start.isOnlyWeekdayComponent()&&ke(s,{day:7})>o?(s=ke(s,{day:7}),r.start.imply("day",s.getDate()),r.start.imply("month",s.getMonth()+1),r.start.imply("year",s.getFullYear())):n.start.isOnlyWeekdayComponent()&&ke(o,{day:-7})<s?(o=ke(o,{day:-7}),n.start.imply("day",o.getDate()),n.start.imply("month",o.getMonth()+1),n.start.imply("year",o.getFullYear())):r.start.isDateWithUnknownYear()&&ke(s,{year:1})>o?(s=ke(s,{year:1}),r.start.imply("year",s.getFullYear())):n.start.isDateWithUnknownYear()&&ke(o,{year:-1})<s?(o=ke(o,{year:-1}),n.start.imply("year",o.getFullYear())):[r,n]=[n,r]}let i=n.clone();return i.start=n.start,i.end=r.start,i.index=Math.min(n.index,r.index),n.index<r.index?i.text=n.text+t+r.text:i.text=r.text+t+n.text,i}};var Yi=class extends Vi{patternBetween(){return/^\s*(to|-|–|until|through|till)\s*$/i}};function xu(e,t){let n=e.clone(),r=e.start,i=t.start;if(n.start=Ef(r,i),e.end!=null||t.end!=null){let o=e.end==null?e.start:e.end,s=t.end==null?t.start:t.end,a=Ef(o,s);if(e.end==null&&a.date().getTime()<n.start.date().getTime()){let l=new Date(a.date().getTime());l.setDate(l.getDate()+1),a.isCertain("day")?pt(a,l):Zt(a,l)}n.end=a}return n}function Ef(e,t){let n=e.clone();t.isCertain("hour")?(n.assign("hour",t.get("hour")),n.assign("minute",t.get("minute")),t.isCertain("second")?(n.assign("second",t.get("second")),t.isCertain("millisecond")?n.assign("millisecond",t.get("millisecond")):n.imply("millisecond",t.get("millisecond"))):(n.imply("second",t.get("second")),n.imply("millisecond",t.get("millisecond")))):(n.imply("hour",t.get("hour")),n.imply("minute",t.get("minute")),n.imply("second",t.get("second")),n.imply("millisecond",t.get("millisecond"))),t.isCertain("timezoneOffset")&&n.assign("timezoneOffset",t.get("timezoneOffset"));let r=e.get("meridiem")!=null&&(e.isCertain("meridiem")||Array.from(e.tags()).some(i=>i.startsWith("casualReference/")));return t.isCertain("meridiem")?n.assign("meridiem",t.get("meridiem")):t.get("meridiem")!=null&&!r&&n.imply("meridiem",t.get("meridiem")),n.get("meridiem")==j.PM&&n.get("hour")<12&&(t.isCertain("hour")?n.assign("hour",n.get("hour")+12):n.imply("hour",n.get("hour")+12)),n.addTags(e.tags()),n.addTags(t.tags()),n}var Zi=class extends nt{shouldMergeResults(t,n,r){return(n.start.isOnlyDate()&&r.start.isOnlyTime()||r.start.isOnlyDate()&&n.start.isOnlyTime())&&t.match(this.patternBetween())!=null}mergeResults(t,n,r){let i=n.start.isOnlyDate()?xu(n,r):xu(r,n);return i.index=n.index,i.text=n.text+t+r.text,i}};var $r=class extends Zi{patternBetween(){return new RegExp("^\\s*(T|at|after|before|on|of|,|-|\\.|\u2219|:)?\\s*$")}};var AT=new RegExp("^\\s*,?\\s*\\(?([A-Z]{2,4})\\)?(?=\\W|$)","i"),Ki=class{timezoneOverrides;constructor(t){this.timezoneOverrides=t}refine(t,n){let r=t.option.timezones??{};return n.forEach(i=>{let o=t.text.substring(i.index+i.text.length),s=AT.exec(o);if(!s)return;let a=s[1].toUpperCase(),l=i.start.date()??i.refDate??new Date,u={...this.timezoneOverrides,...r},d=Fs(a,l,u);if(d==null)return;t.debug(()=>{console.log(`Extracting timezone: '${a}' into: ${d} for: ${i.start}`)});let c=i.start.get("timezoneOffset");c!==null&&d!=c&&(i.start.isCertain("timezoneOffset")||a!=s[1])||i.start.isOnlyDate()&&a!=s[1]||(i.text+=s[0],i.start.isCertain("timezoneOffset")||i.start.assign("timezoneOffset",d),i.end!=null&&!i.end.isCertain("timezoneOffset")&&i.end.assign("timezoneOffset",d))}),n}};var OT=new RegExp("^\\s*(?:\\(?(?:GMT|UTC)\\s?)?([+-])(\\d{1,2})(?::?(\\d{2}))?\\)?","i"),DT=1,vT=2,RT=3,Ji=class{refine(t,n){return n.forEach(function(r){if(r.start.isCertain("timezoneOffset"))return;let i=t.text.substring(r.index+r.text.length),o=OT.exec(i);if(!o)return;t.debug(()=>{console.log(`Extracting timezone: '${o[0]}' into : ${r}`)});let s=parseInt(o[vT]),a=parseInt(o[RT]||"0"),l=s*60+a;l>840||(o[DT]==="-"&&(l=-l),r.end!=null&&r.end.assign("timezoneOffset",l),r.start.assign("timezoneOffset",l),r.text+=o[0])}),n}};var kn=class{refine(t,n){if(n.length<2)return n;let r=[],i=n[0];for(let o=1;o<n.length;o++){let s=n[o];if(s.index>=i.index+i.text.length){r.push(i),i=s;continue}let a=null,l=null;s.text.length>i.text.length?(a=s,l=i):(a=i,l=s),t.debug(()=>{console.log(`${this.constructor.name} remove ${l} by ${a}`)}),i=a}return i!=null&&r.push(i),r}};function Cf(e,t,n){let r=e.getDateWithAdjustedTimezone(),i=MT(r,t,n),o=new W(e);return o=o.addDurationAsImplied({day:i}),o.assign("weekday",t),o}function MT(e,t,n){let r=e.getDay();switch(n){case"this":return Xn(e,t);case"last":return If(e,t);case"next":return r==K.SUNDAY?t==K.SUNDAY?7:t:r==K.SATURDAY?t==K.SATURDAY?7:t==K.SUNDAY?8:1+t:t<r&&t!=K.SUNDAY?Xn(e,t):Xn(e,t)+7}return NT(e,t)}function NT(e,t){let n=If(e,t),r=Xn(e,t);return r<-n?r:n}function Xn(e,t){let n=e.getDay(),r=t-n;return r<0&&(r+=7),r}function If(e,t){let n=e.getDay(),r=t-n;return r>=0&&(r-=7),r}var Xi=class{refine(t,n){return t.option.forwardDate&&n.forEach(r=>{let i=t.reference.getDateWithAdjustedTimezone();if(r.start.isOnlyTime()&&t.reference.instant>r.start.date()){let o=t.reference.getDateWithAdjustedTimezone(),s=new Date(o);s.setDate(s.getDate()+1),Zt(r.start,s),t.debug(()=>{console.log(`${this.constructor.name} adjusted ${r} time from the ref date (${o}) to the following day (${s})`)}),r.end&&r.end.isOnlyTime()&&(Zt(r.end,s),r.start.date()>r.end.date()&&(s.setDate(s.getDate()+1),Zt(r.end,s)))}if(r.start.isOnlyWeekdayComponent()&&i>r.start.date()){let o=Xn(i,r.start.get("weekday"))||7,s=ke(i,{day:o});if(Zt(r.start,s),t.debug(()=>{console.log(`${this.constructor.name} adjusted ${r} weekday (${r.start})`)}),r.end&&r.start.date()>r.end.date()){let a=Xn(i,r.start.get("weekday"))||7,l=ke(i,{day:a});Zt(r.end,l),t.debug(()=>{console.log(`${this.constructor.name} adjusted ${r} weekday (${r.end})`)})}}if(r.start.isDateWithUnknownYear()&&i>r.start.date())for(let o=0;o<3&&i>r.start.date();o++)r.start.imply("year",r.start.get("year")+1),t.debug(()=>{console.log(`${this.constructor.name} adjusted ${r} year (${r.start})`)}),r.end&&!r.end.isCertain("year")&&(r.end.imply("year",r.end.get("year")+1),t.debug(()=>{console.log(`${this.constructor.name} adjusted ${r} month (${r.start})`)}))}),n}};var Qi=class extends Fr{strictMode;constructor(t){super(),this.strictMode=t}isValid(t,n){return n.text.replace(" ","").match(/^\d*(\.\d*)?$/)?(t.debug(()=>{console.log(`Removing unlikely result '${n.text}'`)}),!1):n.start.isValidDate()?n.end&&!n.end.isValidDate()?(t.debug(()=>{console.log(`Removing invalid result: ${n} (${n.end})`)}),!1):this.strictMode?this.isStrictModeValid(t,n):!0:(t.debug(()=>{console.log(`Removing invalid result: ${n} (${n.start})`)}),!1)}isStrictModeValid(t,n){return n.start.isOnlyWeekdayComponent()?(t.debug(()=>{console.log(`(Strict) Removing weekday only component: ${n} (${n.end})`)}),!1):!0}};var PT=new RegExp("([0-9]{4})\\-([0-9]{1,2})\\-([0-9]{1,2})(?:T([0-9]{1,2}):([0-9]{1,2})(?::([0-9]{1,2})(?:\\.(\\d{1,4}))?)?(Z|([+-]\\d{2}):?(\\d{2})?)?)?(?=\\W|$)","i"),LT=1,FT=2,$T=3,_f=4,UT=5,Af=6,Of=7,zT=8,Df=9,vf=10,eo=class extends V{innerPattern(){return PT}innerExtract(t,n){let r=t.createParsingComponents({year:parseInt(n[LT]),month:parseInt(n[FT]),day:parseInt(n[$T])});if(n[_f]!=null&&(r.assign("hour",parseInt(n[_f])),r.assign("minute",parseInt(n[UT])),n[Af]!=null&&r.assign("second",parseInt(n[Af])),n[Of]!=null&&r.assign("millisecond",parseInt(n[Of])),n[zT]!=null)){let i=0;if(n[Df]){let o=parseInt(n[Df]),s=0;n[vf]!=null&&(s=parseInt(n[vf])),i=o*60,i<0?i-=s:i+=s}r.assign("timezoneOffset",i)}return r.addTag("parser/ISOFormatParser")}};var to=class extends nt{mergeResults(t,n,r){let i=r.clone();return i.index=n.index,i.text=n.text+t+i.text,i.start.assign("weekday",n.start.get("weekday")),i.end&&i.end.assign("weekday",n.start.get("weekday")),i}shouldMergeResults(t,n,r){return n.start.isOnlyWeekdayComponent()&&!n.start.isCertain("hour")&&r.start.isCertain("day")&&t.match(/^,?\s*$/)!=null}};function Rf(e,t=!1){return e.parsers.unshift(new eo),e.refiners.unshift(new to),e.refiners.unshift(new Ji),e.refiners.unshift(new kn),e.refiners.push(new Ki),e.refiners.push(new kn),e.refiners.push(new Xi),e.refiners.push(new Qi(t)),e}function Mf(e){let t=e.getDateWithAdjustedTimezone(),n=new W(e,{});return pt(n,t),Ls(n,t),n.assign("timezoneOffset",e.getTimezoneOffset()),n.addTag("casualReference/now"),n}function Nf(e){let t=e.getDateWithAdjustedTimezone(),n=new W(e,{});return pt(n,t),Pi(n,t),n.delete("meridiem"),n.addTag("casualReference/today"),n}function Pf(e){return BT(e,1).addTag("casualReference/yesterday")}function Lf(e){return js(e,1).addTag("casualReference/tomorrow")}function BT(e,t){return js(e,-t)}function js(e,t){let n=e.getDateWithAdjustedTimezone(),r=new W(e,{}),i=new Date(n.getTime());return i.setDate(i.getDate()+t),pt(r,i),Pi(r,i),r.delete("meridiem"),r}function Ff(e,t=22){let n=e.getDateWithAdjustedTimezone(),r=new W(e,{});return pt(r,n),r.imply("hour",t),r.imply("meridiem",j.PM),r.addTag("casualReference/tonight"),r}function $f(e,t=20){let n=new W(e,{});return n.imply("meridiem",j.PM),n.imply("hour",t),n.addTag("casualReference/evening"),n}function Uf(e){let t=new W(e,{});return e.getDateWithAdjustedTimezone().getHours()>2&&t.addDurationAsImplied({day:1}),t.assign("hour",0),t.imply("minute",0),t.imply("second",0),t.imply("millisecond",0),t.addTag("casualReference/midnight"),t}function zf(e,t=6){let n=new W(e,{});return n.imply("meridiem",j.AM),n.imply("hour",t),n.imply("minute",0),n.imply("second",0),n.imply("millisecond",0),n.addTag("casualReference/morning"),n}function Bf(e,t=15){let n=new W(e,{});return n.imply("meridiem",j.PM),n.imply("hour",t),n.imply("minute",0),n.imply("second",0),n.imply("millisecond",0),n.addTag("casualReference/afternoon"),n}function qf(e){let t=new W(e,{});return t.imply("meridiem",j.AM),t.assign("hour",12),t.imply("minute",0),t.imply("second",0),t.imply("millisecond",0),t.addTag("casualReference/noon"),t}var qT=/(now|today|tonight|tomorrow|overmorrow|tmr|tmrw|yesterday|last\s*night)(?=\W|$)/i,no=class extends V{innerPattern(t){return qT}innerExtract(t,n){let r=t.refDate,i=n[0].toLowerCase(),o=t.createParsingComponents();switch(i){case"now":o=Mf(t.reference);break;case"today":o=Nf(t.reference);break;case"yesterday":o=Pf(t.reference);break;case"tomorrow":case"tmr":case"tmrw":o=Lf(t.reference);break;case"tonight":o=Ff(t.reference);break;case"overmorrow":o=js(t.reference,2);break;default:if(i.match(/last\s*night/)){if(r.getHours()>6){let s=new Date(r.getTime());s.setDate(s.getDate()-1),r=s}pt(o,r),o.imply("hour",0)}break}return o.addTag("parser/ENCasualDateParser"),o}};var jT=/(?:this)?\s{0,3}(morning|afternoon|evening|night|midnight|midday|noon)(?=\W|$)/i,ro=class extends V{innerPattern(){return jT}innerExtract(t,n){let r=null;switch(n[1].toLowerCase()){case"afternoon":r=Bf(t.reference);break;case"evening":case"night":r=$f(t.reference);break;case"midnight":r=Uf(t.reference);break;case"morning":r=zf(t.reference);break;case"noon":case"midday":r=qf(t.reference);break}return r&&r.addTag("parser/ENCasualTimeParser"),r}};var HT=new RegExp(`(?:(?:\\,|\\(|\\\uFF08)\\s*)?(?:on\\s*?)?(?:(this|last|past|next)\\s*)?(${ge(Us)}|weekend|weekday)(?:\\s*(?:\\,|\\)|\\\uFF09))?(?:\\s*(?:of\\s*)?(this|last|past|next)\\s*week)?(?=\\W|$)`,"i"),WT=1,GT=2,VT=3,io=class extends V{innerPattern(){return HT}innerExtract(t,n){let r=n[WT],i=n[VT],o=r||i;o=o||"",o=o.toLowerCase();let s=null;o=="last"||o=="past"?s="last":o=="next"?s="next":o=="this"&&(s="this");let a=n[GT].toLowerCase(),l;if(Us[a]!==void 0)l=Us[a];else if(a=="weekend")l=s=="last"?K.SUNDAY:K.SATURDAY;else if(a=="weekday"){let u=t.reference.getDateWithAdjustedTimezone().getDay();u==K.SUNDAY||u==K.SATURDAY?l=s=="last"?K.FRIDAY:K.MONDAY:(l=u-1,l=s=="last"?l-1:l+1,l=l%5+1)}else return null;return Cf(t.reference,l,s)}};var YT=new RegExp(`(this|last|past|next|after\\s*this)\\s*(${ge(Li)})(?=\\s*)(?=\\W|$)`,"i"),ZT=1,KT=2,oo=class extends V{innerPattern(){return YT}innerExtract(t,n){let r=n[ZT].toLowerCase(),i=n[KT].toLowerCase(),o=Li[i];if(r=="next"||r.startsWith("after")){let l={};return l[o]=1,W.createRelativeFromReference(t.reference,l)}if(r=="last"||r=="past"){let l={};return l[o]=-1,W.createRelativeFromReference(t.reference,l)}let s=t.createParsingComponents(),a=new Date(t.reference.instant.getTime());return i.match(/week/i)?(a.setDate(a.getDate()-a.getDay()),s.imply("day",a.getDate()),s.imply("month",a.getMonth()+1),s.imply("year",a.getFullYear())):i.match(/month/i)?(a.setDate(1),s.imply("day",a.getDate()),s.assign("year",a.getFullYear()),s.assign("month",a.getMonth()+1)):i.match(/year/i)&&(a.setDate(1),a.setMonth(0),s.imply("day",a.getDate()),s.imply("month",a.getMonth()+1),s.assign("year",a.getFullYear())),s}};var JT=new RegExp("([^\\d]|^)([0-3]{0,1}[0-9]{1})[\\/\\.\\-]([0-3]{0,1}[0-9]{1})(?:[\\/\\.\\-]([0-9]{4}|[0-9]{2}))?(\\W|$)","i"),XT=1,QT=5,Hf=2,Wf=3,bu=4,so=class{groupNumberMonth;groupNumberDay;constructor(t){this.groupNumberMonth=t?Wf:Hf,this.groupNumberDay=t?Hf:Wf}pattern(){return JT}extract(t,n){let r=n.index+n[XT].length,i=n.index+n[0].length-n[QT].length;if(r>0&&t.text.substring(0,r).match("\\d/?$")||i<t.text.length&&t.text.substring(i).match("^/?\\d"))return;let o=t.text.substring(r,i);if(o.match(/^\d\.\d$/)||o.match(/^\d\.\d{1,2}\.\d{1,2}\s*$/)||!n[bu]&&o.indexOf("/")<0)return;let s=t.createParsingResult(r,o),a=parseInt(n[this.groupNumberMonth]),l=parseInt(n[this.groupNumberDay]);if((a<1||a>12)&&a>12)if(l>=1&&l<=12&&a<=31)[l,a]=[a,l];else return null;if(l<1||l>31)return null;if(s.start.assign("day",l),s.start.assign("month",a),n[bu]){let u=parseInt(n[bu]),d=$s(u);s.start.assign("year",d)}else{let u=wn(t.refDate,l,a);s.start.imply("year",u)}return s.addTag("parser/SlashDateFormatParser")}};var e1=new RegExp(`(this|last|past|next|after|\\+|-)\\s*(${Kt})(?=\\W|$)`,"i"),t1=new RegExp(`(this|last|past|next|after|\\+|-)\\s*(${bn})(?=\\W|$)`,"i"),ao=class extends V{allowAbbreviations;constructor(t=!0){super(),this.allowAbbreviations=t}innerPattern(){return this.allowAbbreviations?e1:t1}innerExtract(t,n){let r=n[1].toLowerCase(),i=tt(n[2]);if(!i)return null;switch(r){case"last":case"past":case"-":i=yn(i);break}return W.createRelativeFromReference(t.reference,i)}};function n1(e){return e.text.match(/^[+-]/i)!=null}function Gf(e){return e.text.match(/^-/i)!=null}var lo=class extends nt{shouldMergeResults(t,n,r){return t.match(/^\s*$/i)?n1(r)||Gf(r):!1}mergeResults(t,n,r,i){let o=tt(r.text);Gf(r)&&(o=yn(o));let s=W.createRelativeFromReference(It.fromDate(n.start.date()),o);return new ft(n.reference,n.index,`${n.text}${t}${r.text}`,s)}};function Vf(e){return e.text.match(/\s+(before|from)$/i)!=null}function r1(e){return e.text.match(/\s+(after|since)$/i)!=null}var uo=class extends nt{patternBetween(){return/^\s*$/i}shouldMergeResults(t,n,r){return!t.match(this.patternBetween())||!Vf(n)&&!r1(n)?!1:!!r.start.get("day")&&!!r.start.get("month")&&!!r.start.get("year")}mergeResults(t,n,r){let i=tt(n.text);Vf(n)&&(i=yn(i));let o=W.createRelativeFromReference(It.fromDate(r.start.date()),i);return new ft(r.reference,n.index,`${n.text}${t}${r.text}`,o)}};var i1=new RegExp(`^\\s*(${xn})`,"i"),o1=1,co=class{refine(t,n){return n.forEach(function(r){if(!r.start.isDateWithUnknownYear())return;let i=t.text.substring(r.index+r.text.length),o=i1.exec(i);if(!o||o[0].trim().length<=3)return;t.debug(()=>{console.log(`Extracting year: '${o[0]}' into : ${r}`)});let s=_t(o[o1]);r.end!=null&&r.end.assign("year",s),r.start.assign("year",s),r.text+=o[0]}),n}};var mo=class extends Fr{constructor(){super()}isValid(t,n){let r=n.text.trim();return r===t.text.trim()?!0:r.toLowerCase()==="may"&&!t.text.substring(0,n.index).trim().match(/\b(in)$/i)?(t.debug(()=>{console.log(`Removing unlikely result: ${n}`)}),!1):r.toLowerCase().endsWith("the second")?(t.text.substring(n.index+n.text.length).trim().length>0&&t.debug(()=>{console.log(`Removing unlikely result: ${n}`)}),!1):!0}};var Qn=class{createCasualConfiguration(t=!1){let n=this.createConfiguration(!1,t);return n.parsers.push(new no),n.parsers.push(new ro),n.parsers.push(new zi),n.parsers.push(new oo),n.parsers.push(new ao),n.refiners.push(new mo),n}createConfiguration(t=!0,n=!1){let r=Rf({parsers:[new so(n),new Fi(t),new $i,new Ui(n),new io,new ji,new Hi(t),new Wi(t),new Gi(t),new qi],refiners:[new $r]},t);return r.parsers.unshift(new Bi(t)),r.refiners.unshift(new uo),r.refiners.unshift(new lo),r.refiners.unshift(new kn),r.refiners.push(new $r),r.refiners.push(new co),r.refiners.push(new Yi),r}};var er=class e{parsers;refiners;defaultConfig=new Qn;constructor(t){t=t||this.defaultConfig.createCasualConfiguration(),this.parsers=[...t.parsers],this.refiners=[...t.refiners]}clone(){return new e({parsers:[...this.parsers],refiners:[...this.refiners]})}parseDate(t,n,r){let i=this.parse(t,n,r);return i.length>0?i[0].start.date():null}parse(t,n,r){let i=new ku(t,n,r),o=[];return this.parsers.forEach(s=>{let a=e.executeParser(i,s);o=o.concat(a)}),o.sort((s,a)=>s.index-a.index),this.refiners.forEach(function(s){o=s.refine(i,o)}),o}static executeParser(t,n){let r=[],i=n.pattern(t),o=t.text,s=t.text,a=i.exec(s);for(;a;){let l=a.index+o.length-s.length;a.index=l;let u=n.extract(t,a);if(!u){s=o.substring(a.index+1),a=i.exec(s);continue}let d=null;u instanceof ft?d=u:u instanceof W?(d=t.createParsingResult(a.index,a[0]),d.start=u):d=t.createParsingResult(a.index,a[0],u);let c=d.index,m=d.text;t.debug(()=>console.log(`${n.constructor.name} extracted (at index=${c}) '${m}'`)),r.push(d),s=o.substring(c+m.length),a=i.exec(s)}return r}},ku=class{text;option;reference;refDate;constructor(t,n,r){this.text=t,this.option=r??{},this.reference=It.fromInput(n,this.option.timezones),this.refDate=this.reference.instant}createParsingComponents(t){return t instanceof W?t:new W(this.reference,t)}createParsingResult(t,n,r,i){let o=typeof n=="string"?n:this.text.substring(t,n),s=r?this.createParsingComponents(r):null,a=i?this.createParsingComponents(i):null;return new ft(this.reference,t,o,s,a)}debug(t){this.option.debug&&(this.option.debug instanceof Function?this.option.debug(t):this.option.debug.debug(t))}};var Hs=new Qn,Ws=new er(Hs.createCasualConfiguration(!1)),Yf=new er(Hs.createConfiguration(!0,!1)),s1=new er(Hs.createCasualConfiguration(!0));function a1(e,t,n){return Ws.parse(e,t,n)}function l1(e,t,n){return Ws.parseDate(e,t,n)}var Su=globalThis.Temporal;var Zf=(e,t)=>`Non-positive ${e}: ${t}`,Kf=(e,t)=>`Non-finite ${e}: ${t}`,Jf=e=>`Cannot convert bigint to ${e}`,Xf="Invalid object",po=(e,t,n,r)=>tr(e,t)+`; must be between ${n}-${r}`,tr=(e,t)=>`Invalid ${e}: ${t}`;var Tu=1e3,Eu=1e6,Cu=1e9,Iu=6e10,_u=36e11;function rt(e){return e===void 0?Object.create(null):nr(e)}function Vs(e,t="number"){if(typeof e=="bigint")throw new TypeError(Jf(t));if(e=Number(e),!Number.isFinite(e))throw new RangeError(Kf(t,e));return e}function Ce(e,t){return Math.trunc(Vs(e,t))||0}function Ys(e,t){return Qf(Ce(e,t),t)}function Qf(e,t="number"){if(e<=0)throw new RangeError(Zf(t,e));return e}function Au(e,t,n){return Math.min(Math.max(e,t),n)}function Ur(e){return e!==null&&(typeof e=="object"||typeof e=="function")}function nr(e){if(!Ur(e))throw new TypeError(Xf);return e}var ra=tr;var xo=e=>`Missing ${e}`,uh=e=>"No valid fields: "+e.join(),ch="Invalid bag",dh=(e,t,n)=>tr(e,t)+"; must be "+Object.keys(n).join(),mh="Cannot use valueOf",ph="Invalid calling context",ia=e=>"Missing year"+(e?"/era/eraYear":""),ir="Invalid leap month",fh=e=>tr("Calendar",e),hh=(e,t)=>`Unknown calendar ${e}; might need ${t}`,Hu=e=>tr("TimeZone",e),Sn="Out-of-bounds date";var gh=e=>`Cannot parse: ${e}`,Jt=e=>`Invalid substring: ${e}`;var Wu=Au,qe=Ur;function v(e){throw new RangeError(e)}function ne(e){throw new TypeError(e)}function Ru(e,t,n,r,i){return Ot(t,((o,s)=>{let a=o[s];return a===void 0&&ne(xo(s)),a})(e,t),n,r,i)}function Ot(e,t,n,r,i,o){let s=Wu(t,n,r);return i&&t!==s&&v(((a,l,u,d,c)=>c?po(a,c[l],c[u],c[d]):po(a,l,u,d))(e,t,n,r,o)),s}function qr(e,t=Map){let n=new t;return(r,...i)=>{if(n.has(r))return n.get(r);let o=e(r,...i);return n.set(r,o),o}}var yh=e=>oa({name:e},1),oa=(e,t)=>_n(n=>({value:n,configurable:1,writable:!t}),e),bo=e=>({[Symbol.toStringTag]:{value:e,configurable:1}});function _n(e,t){let n={};for(let r in t)n[r]=e(t[r],r);return n}function ko(e,t){let n={};for(let r of e)n[r]=t;return n}function sa(e){let t={};for(let n of e)t[n]=r=>r[n];return t}function Dt(e,t,n=Object.create(null)){for(let r of e)n[r]=t[r];return n}function wh(e,t,n){for(let r of e)if(t[r]!==n[r])return 0;return 1}function p1(e,t,n){let r={...n};for(let i=0;i<t;i++)r[e[i]]=0;return r}function je(e,...t){return(...n)=>e(...t,...n)}function Gu(){}function eh(e){return e[0].toUpperCase()+e.substring(1)}function Te(...e){return[].concat(...e).sort()}function Gr(e){return new RegExp(`^${e}$`,"i")}function Vu(e){return parseInt(e.padEnd(9,"0"))}function Yu(e){return e&&e!=="+"?-1:1}function zr(e){return e===void 0?0:parseInt(e)}function Xs(e,t){return String(t).padStart(e,"0")}var ht=je(Xs,2);function Xt(e,t){return Math.sign(e-t)}function ye(e,t){return e<t?-1:e>t?1:0}function xh(e,t){let n=e/t;return e%t<0n?n-1n:n}function Zu(e,t){let n=xh(e,t);return[n,e-n*t]}function At(e,t){return[Math.floor(e/t),aa(e,t)]}function aa(e,t){return(e%t+t)%t}function Vr(e,t){return Math.trunc(e/t)||0}function Ku(e,t){return e%t||0}function bh(e,t=1){return t*(.5+e/5)}function Zs(e){return Math.abs(e%1)===.5}var Ju="iso8601",kh="gregory",f1={bce:-1,ce:0};function Sh(e){let t=e.normalize("NFD").toLowerCase().replace(/[^a-z0-9]/g,"");return t==="bc"||t==="b"?"bce":t==="ad"||t==="a"?"ce":t}var it=void 0,Th=0;function yt(e){return e===it?"iso8601":e===0?"gregory":e.id}var h1=/^M(\d{2})(L?)$/;function Eh(e){let t=h1.exec(e);return t||v((n=>`Invalid monthCode: ${n}`)(e)),[parseInt(t[1]),!!t[2]]}function Ch(e,t){return"M"+ht(e)+(t?"L":"")}function Mu(e,t,n){return e+(t||n&&e>=n?1:0)}var Nu={nanosecond:0,microsecond:1,millisecond:2,second:3,minute:4,hour:5,day:6,week:7,month:8,year:9},Xu=Object.keys(Nu);var So=Tu,To=Eu,An=Cu,Eo=Iu,Co=_u,tn=864e11,wt=[1,So,To,An,Eo,Co,tn],g1=BigInt(So),Yr=BigInt(To),or=BigInt(An),y1=BigInt(Eo),w1=BigInt(Co),ce=BigInt(tn);function Ih(e,t){let n=Number(e/ce),r=Number(e%ce);return n*(tn/t)+(Math.trunc(r/t)+r%t/t)}var $e=Xu.slice(0,6),Io=sa($e),la=["year"],dr=["day"],Qu=["day","month","year"],ua=["offset"],ec=["timeZone"],Zr=["era","eraYear"],x1=["era","eraYear","year"],_h=["month","monthCode"],b1=["day","month","monthCode"],Pu=Te($e),k1=Te(Zr,la),_o=Te(_h,la),Ah=Te(Zr,_o),Ao=Te(["monthCode"],la),Oh=Te(Zr,Ao),Dh=Te(dr,["monthCode"]),mr=Te(dr,_o),pr=Te(dr,Zr,_o),vh=Te(mr,$e),Rh=Te(pr,$e),S1=Te(mr,$e,ua),T1=Te(pr,$e,ua),Mh=Te(mr,$e,ua,ec),Nh=Te(pr,$e,ua,ec),E1=Te(dr,Ao),C1=Te(dr,Zr,Ao),ze=ko($e,0);function Oo(e){return ca(e,1),e}var I1={hour:23,minute:59,second:59};function ca(e,t){let n={};for(let r of $e)n[r]=Ot(r,e[r],0,I1[r]||999,t);return n}function Je(e){return nc(e)*An+Ph(e)}function tc(e){return 1e3*nc(e)+e.millisecond}function nc(e){return 3600*e.hour+60*e.minute+e.second}function Ph(e){return e.millisecond*To+e.microsecond*So+e.nanosecond}function rc(e){let[t,n]=At(e,tn);return[Lh(n),t]}function Lh(e){let[t,n]=At(e,To),[r,i]=At(n,So);return _1(t,r,i)}function _1(e,t=0,n=0){let[r,i]=At(e,36e5),[o,s]=At(i,6e4),[a,l]=At(s,1e3);return{hour:r,minute:o,second:a,millisecond:l,microsecond:t,nanosecond:n}}function th(e){let[t,n]=Zu(e,or);return[Number(t),Number(n)]}function ot(e){return Tn(e)+BigInt(Je(e))}function Fh(e){return Do(e)+tc(e)}function Tn(e){return BigInt(vt(e))*ce}function Do(e){return 864e5*vt(e)}function vt(e){return fo(e.year,e.month,e.day)}function fo(e,t=1,n=1){let r=t-1;return e+=Math.floor(r/12),t=aa(r,12),Date.UTC(e%400-400,t,0)/864e5+146097*(Vr(e,400)+1)+n}function vo(e){let[t,n]=Zu(e,ce);return{...$h(Number(t)),...Lh(Number(n))}}function $h(e){let t=new Date(864e5*aa(e,146097));return{year:t.getUTCFullYear()+400*Math.floor(e/146097),month:t.getUTCMonth()+1,day:t.getUTCDate()}}var Uh=1972;function A1(e){return[e,0]}function Lu(e,t){if(!t)return{year:1972,month:e}}function O1(e,t,n){return{year:e,month:t,day:n}}function zh(e,t){switch(t){case 2:return da(e)?29:28;case 4:case 6:case 9:case 11:return 30}return 31}function D1(e){return da(e)?366:365}function da(e){return e%4==0&&(e%100!=0||e%400==0)}function Bh(e,t,n){return e+=Vr(n,12),(t+=Ku(n,12))<1?(e--,t+=12):t>12&&(e++,t-=12),{year:e,month:t}}function v1(e,t,n,r){return 12*(n-e)+r-t}function ma(e){return aa(fo(e.year,e.month,e.day)+4,7)||7}function qh(e){return fo(e.year,e.month,e.day)-fo(e.year)+1}function jh(e){let t=e.year,n=Math.floor((qh(e)-ma(e)+10)/7),r=Ou(t);return n<1?n=r=Ou(--t):n>r&&(n=1,r=Ou(++t)),{weekOfYear:n,yearOfWeek:t,Be:r}}function Ou(e){let t=ma({year:e,month:1,day:1});return t===4||t===3&&da(e)?53:52}function R1({year:e}){return e<1?{era:"bce",eraYear:1-e}:{era:"ce",eraYear:e}}function Ro(e){return nn(e),Oo(e)}function nn(e){return Hh(e,1),e}function nh(e){return wh(Qu,e,Hh(e))}function Hh(e,t){let{year:n}=e,r=Ru(e,"month",1,12,t);return{year:n,month:r,day:Ru(e,"day",1,zh(n,r),t)}}function ae(e,t){return e?e.ae(t):t}function sr(e,t,n){return e?e.L(t,n):A1(n)}function Mo(e,t){return e===0?R1(t):e&&e.h?.(t)||{}}function ar(e,t,n,r){return e?e.de(t,n,r):O1(t,n,r)}function ho(e,t){return e?e.j(t):12}function go(e,t,n){return e?e.o(t,n):zh(t,n)}function pa(e,t){let{year:n,month:r}=ae(e,t),[i,o]=sr(e,n,r);return Ch(i,o)}function ic(e,t){let{year:n}=ae(e,t);return e?e.q(n):da(n)}function oc(e,t){let{year:n}=ae(e,t);return ho(e,n)}function sc(e,t){let{year:n,month:r}=ae(e,t);return go(e,n,r)}function ac(e,t){let{year:n}=ae(e,t);return e?e.i(n):D1(n)}function Wh(e,t){if(!e)return qh(t);let{year:n}=ae(e,t),r=ar(e,n,1,1);return vt(t)-vt(r)+1}function Gh(e,t){return e===it?jh(t).weekOfYear:void 0}function Vh(e,t){return e===it?jh(t).yearOfWeek:void 0}var de=Xu.map(e=>e+"s"),lc=sa(de),Yh=Te(de),M1=de.slice(0,6),Zh=de.slice(6),N1=Zh.slice(1),we=ko(de,0),uc=ko(M1,0),cc=je(p1,de);function Kh(e,t){return t==null&&v(xo(e)),t}var ve=je(P1,"string");function P1(e,t,n=e){return typeof t!==e&&ne(ra(n,t)),t}function dc(e,t="number"){return Number.isInteger(e)||v(((n,r)=>`Non-integer ${n}: ${r}`)(t,e)),e||0}function mc(e){return typeof e=="symbol"&&ne("Cannot convert Symbol to string"),String(e)}function pc(e,t){return Ur(e)?String(e):ve(e,t)}function fa(e){return typeof e=="boolean"?BigInt(e?1:0):typeof e=="string"?BigInt(e):(typeof e!="bigint"&&ne(`Invalid bigint: ${e}`),e)}function ha(e,t){return dc(Vs(e,t),t)}function ga(e,t){return typeof e=="string"?((n,r)=>{let i=Object.create(null);return i[n]=r,i})(t,e):nr(e)}var Qt="smallestUnit";var L1={constrain:0,reject:1},F1={compatible:0,reject:1,earlier:2,later:3},$1={reject:0,use:1,prefer:2,ignore:3},U1={auto:0,never:1,critical:2,always:3},z1={auto:0,never:1,critical:2},B1={auto:0,never:1},q1={floor:0,halfFloor:1,ceil:2,halfCeil:3,trunc:4,halfTrunc:5,expand:6,halfExpand:7,halfEven:8},j1=[Math.floor,e=>Zs(e)?Math.floor(e):Math.round(e),Math.ceil,e=>Zs(e)?Math.ceil(e):Math.round(e),Math.trunc,e=>Zs(e)?Math.trunc(e)||0:Math.round(e),e=>e<0?Math.floor(e):Math.ceil(e),e=>Math.sign(e)*Math.round(Math.abs(e))||0,e=>Zs(e)?(e=Math.trunc(e)||0)+e%2:Math.round(e)],H1={previous:-1,next:1};function fc(e){let t=e.roundingIncrement;return t===void 0?1:Ce(t,"roundingIncrement")}function hc(e){let t=e.fractionalSecondDigits;if(t!==void 0){if(typeof t!="number"){if(mc(t)==="auto")return;v(ra("fractionalSecondDigits",t))}t=Ot("fractionalSecondDigits",Math.floor(t),0,9,1)}return t}function gc(e,t,n=0,r){let i=t[e];if(i===void 0)return r?n:void 0;if(i=mc(i),i==="auto")return r?n:null;let o=Nu[i];return o===void 0&&(o=de.indexOf(i)),o<0&&v(dh(e,i,Nu)),o}function On(e,t,n,r=0){let i=n[e];if(i===void 0)return r;let o=mc(i),s=t[o];return s===void 0&&v(dh(e,o,t)),s}var Kr=je(gc,Qt),Jh=je(gc,"largestUnit"),W1=je(gc,"unit"),Xh=je(On,"overflow",L1),Qh=je(On,"disambiguation",F1),G1=je(On,"offset",$1),yc=je(On,"calendarName",U1),V1=je(On,"timeZoneName",z1),Y1=je(On,"offset",B1),Jr=je(On,"roundingMode",q1),Z1=je(On,"direction",H1);function wc(e,t,n,r){let i=r?tn:wt[t+1];if(i){let o=wt[t];i%((e=Ot("roundingIncrement",e,1,i/o-(r?0:1),1))*o)&&v(ra("roundingIncrement",e))}else e=Ot("roundingIncrement",e,1,n?10**9:1,1);return e}function jr(e,t,n,r){return t!=null&&Ot(e,t,n,r,1,Xu),t}function eg(e,t){t>e&&v("smallestUnit > largestUnit")}function Xr(e,t,n,r=9,i=0,o=4){t=rt(t);let s=Jh(t,i),a=fc(t),l=Jr(t,o),u=Kr(t,i,1);return s=jr("largestUnit",s,i,r),u=jr(Qt,u,i,r),s==null?s=Math.max(n,u):eg(s,u),a=wc(a,u,1),e&&(l=(d=>d<4?(d+2)%4:d)(l)),[s,u,a,l]}function No(e,t=6,n){let r=fc(e=ga(e,Qt)),i=Jr(e,7),o=Kr(e);return o=Kh(Qt,o),o=jr(Qt,o,0,t),r=wc(r,o,void 0,n),[o,r,i]}function ie(e,t){return Dt(Qu,e,Dt($e,t))}function X(e){return e===void 0?0:Xh(nr(e))}function Hr(e,t=0){e=rt(e);let n=Qh(e),r=G1(e,t);return[Xh(e),r,n]}var tg=BigInt(1e8)*ce,xc=BigInt(-1e8)*ce,ng=xc-ce,rg=-3261848;function ya(e){let t=12*e.year+e.month;return(t<rg||t>3309129)&&v(Sn),e}function Be(e,t=1){return ig(Tn(e),t),e}function fr(e){let t=Tn(e);return ig(t),t!==ng||Je(e)||v(Sn),e}function ig(e,t=1){(e<(t?ng:xc)||e>tg)&&v(Sn)}function xt(e){return(e<xc||e>tg)&&v(Sn),e}function bc(e,t){return xt(Tn(e)+BigInt(Je(e)-t))}function st(e){return{epochNanoseconds:e}}function bt(e,t,n){return{calendar:n,timeZone:t,epochNanoseconds:e}}function Rt(e,t){return Dt($e,e,le(e,t))}function le(e,t){return Dt(Qu,e,{calendar:t})}function hr(e){return Dt($e,e)}function Se(e){return Dt(de,e,{sign:Ca(e)})}function Po(e){return t=e.epochNanoseconds,Number(xh(t,Yr));var t}function kc(e){return e.epochNanoseconds}function og(e,t,n){let r=In(t),[i,o]=((c,m)=>{let p=m((c=ga(c,"unit")).relativeTo),f=W1(c);return f=Kh("unit",f),[f,p]})(n,e),s=Math.max(i,r),a=o&&cr(o);if(!o&&Br(s,a))return rh(t,i);if(o||v("Missing relativeTo"),!t.sign&&Br(i,a))return 0;let[l,u,d]=bg(o,t,i);return Br(i,a)?rh(l,i):K1(l,u,i,d)}function K1(e,t,n,r){let i=Ca(e)||1,o=Sc(cc(n,e),n,i,r,t),s=o.ee,a=o.te,l=Number(a-s),u=Number(t-s);return o.pe[de[n]]+u/l*i}function rh(e,t){return Ih(en(e),wt[t])}function Sc(e,t,n,r,i){let o=de[t],s=e,a=0,l=ih(s,o,n,r);return i&&!((u,d,c,m)=>m>0?ye(d,u)<=0&&ye(u,c)<=0:ye(c,u)<=0&&ye(u,d)<=0)(i,l.ee,l.te,Math.sign(n))&&(s={...e,[o]:e[o]+n},a=1,l=ih(s,o,n,r)),{...l,pe:s,Ae:a}}function ih(e,t,n,r){let i={...e,[t]:e[t]+n};return{ee:Uu(r,e),te:Uu(r,i),se:i}}function sg(e,t,n){let r=n-t,i=e-t;if(!i)return 0;let o=i<0n?-i:i,s=r<0n?-r:r,a=ye(i,0n)===ye(r,0n)?1:-1;return ye(o,s)<=0?o===s?a:bh(ye(2n*o,s),a):Number(i)/Number(r)}function ag(e,t,n,r){let{epochNanoseconds:i}=e,{timeZone:o,calendar:s}=e;if(t===0&&n===1)return{epochNanoseconds:i,timeZone:o,calendar:s};if(t===6){let a=ie(xe(e),ze),l=ie(Dn(a,1),ze),u=En(o,a),d=En(o,l);i=Tc(J1(i,u,d),r)?d:u}else{let a=xe(e),l=a.offsetNanoseconds;i=ei(o,wa(a,Qr(t,n),r),l,2,0,1)}return{epochNanoseconds:i,timeZone:o,calendar:s}}function lg(e){let{timeZone:t}=e,n=ie(xe(e),ze),r=ie(Dn(n,1),ze),i=En(t,n);return Ih(En(t,r)-i,Co)}function ug(e){let{timeZone:t,calendar:n}=e;return bt(En(t,ie(xe(e),ze)),t,n)}function J1(e,t,n){return sg(e<n?e:n-1n,t,n)}function wa(e,t,n){let[r,i]=xa(e,t,n),o=ie(Dn(e,i),r);return fr(o),o}function xa(e,t,n){return rc(Wr(Je(e),t,n))}function Qs(e){return Wr(e,Eo,7)}function Qr(e,t){return wt[e]*t}function Lo(e,t){return BigInt(wt[e])*BigInt(t)}function X1(e,t,n){let r=Math.min(In(e),6);return Cn(ka(en(e),BigInt(t),n),r)}function ba(e,t,n,r,i,o,s,a){if(r===0&&i===1)return e;let l=Ca(e)||1,u=Br(r,a)?a&&r<6&&n>=6?eE:Q1:tE,[d,c,m]=u(l,e,t,n,r,i,o,s);return m&&r!==7&&(d=((p,f,x,S,w,D)=>{for(let T=S+1;T<=x;T++){if(T===7&&x!==7)continue;let R=cc(T,p);R[de[T]]+=w;let O=ye(f,Uu(D,R));if(O&&O!==w)break;p=R}return p})(d,c,n,Math.max(6,r),l,s)),d}function ka(e,t,n){return cg(e,t,n,e/t%2n)}function Sa(e,t,n){let[r,i]=Zu(e,ce),o=r*ce;return o+cg(i,t,n,(o/t+i/t)%2n)}function cg(e,t,n,r){let i=e/t,o=e%t,s=0;o&&(s=bh(ye(2n*(o<0n?-o:o),t),Math.sign(Number(o))));let a=Tc(Number(r)+s,n);return(i-r+BigInt(a))*t}function Wr(e,t,n){return Tc(e/t,n)*t}function Tc(e,t){return j1[t](e)}function Q1(e,t,n,r,i,o,s){let a=en(t),l=ka(a,Lo(i,o),s),u=l-a,d=Math.sign(Number(l/ce)-Number(a/ce))===e,c=Cn(l,Math.min(r,6));return[{...t,...c},n+u,d]}function eE(e,t,n,r,i,o,s,a){let l=Number(gr(t)),u=Qr(i,o),d=Wr(l,u,s),c=Sc({...t,...uc},6,e,a,n),m=c.ee,p=c.te,f=d-Number(p-m),x=0;f&&Math.sign(f)!==e?n=m+BigInt(d):(x+=e,d=Wr(f,u,s),n=p+BigInt(d));let S=Ia(d);return[{...t,...S,days:t.days+x},n,!!x]}function tE(e,t,n,r,i,o,s,a){let l=de[i],u=cc(i,t);i===7&&(t={...t,weeks:t.weeks+Math.trunc(t.days/7)});let d=Vr(t[l],o)*o;u[l]=d;let c=Sc(u,i,o*e,a,n),m=c.ee,p=c.te,f=sg(n,m,p),x=c.pe[l],S=c.se[l],w=Wr(x+f*e*o,o,s),D=w===S;return u[l]=w,[u,D?p:m,c.Ae||D]}function dg(e,t){return e.timeZone.O(e.epochNanoseconds,(n=>{let r=ga(n,"direction"),i=Z1(r,0);return i||v(ra("direction",i)),i})(t))}var xe=qr(nE,WeakMap);function nE(e){let{epochNanoseconds:t,timeZone:n}=e,r=n.B(t);return{...vo(t+BigInt(r)),offsetNanoseconds:r}}function ei(e,t,n,r=0,i=0,o,s){if(n!==void 0&&r===1&&(r===1||s))return bc(t,n);r!==2&&r!==0||Be(t,0);let a=e.N(t);if(n!==void 0&&r!==3){let l=((u,d,c,m)=>{let p=ot(d);m&&(c=Qs(c));for(let f of u){let x=Number(p-f);if(m&&(x=Qs(x)),x===c)return f}})(a,t,n,o);if(l!==void 0)return l;r===0&&v("Invalid TimeZone offset")}return s?ot(t):ti(e,t,i,a)}function ti(e,t,n=0,r=e.N(t)){if(r.length===1)return r[0];if(n===1&&v("Ambiguous offset"),r.length)return r[n===3?1:0];let i=ot(t),o=((a,l)=>{let u=a.B(l-ce);return(d=>(d>tn&&v("Out-of-bounds TimeZone gap"),d))(a.B(l+ce)-u)})(e,i),s=vo(i+BigInt(o*(n===2?-1:1)));return(r=e.N(s))[n===2?0:r.length-1]}function En(e,t){let n=e.N(t);if(n.length)return n[0];let r=ot(t)-ce;return e.O(r,1)}function Ec(e,t,n,r,i){let o=X(i);r.sign&&In(r)<8&&v("Cannot use small units");let s=Be(yo(t,n));return yo(t,mg(t,s,e?Re(r):r,o))}function Cc(e,t){return xt(e+(Fc(n=t)&&v("Cannot use large units"),gr(n)));var n}function lr(e,t,n){let{calendar:r,epochNanoseconds:i,timeZone:o}=e,s=gr(t),a=i;if(Fc(t)){let l=xe(e);a=ti(o,ie(ni(r,l,{...t,...uc},n),l))+s}else a+=s,X(n);return{...e,epochNanoseconds:xt(a)}}function ur(e,t,n,r){let[i,o]=Ta(t,n);return fr(ie(ni(e,t,{...n,...uc,days:n.days+o},r),i))}function ni(e,t,n,r){if(n.years||n.months||n.weeks)return mg(e,t,n,X(r));X(r);let i=n.days+Number(gr(n)/ce);return i?Be(Dn(t,i)):t}function yo(e,t){return Dn(t,1-ae(e,t).day)}function Ta(e,t){let n=gr(t),r=Number(n/ce),i=Number(n%ce),[o,s]=rc(Je(e)+i);return[o,r+s]}function Dn(e,t){return t?$h(vt(e)+t):e}function mg(e,t,n,r){let{years:i,months:o,weeks:s,days:a}=n,l;if(a+=Number(gr(n)/ce),i||o)l=Fu(e,t,i,o,r);else{if(!s&&!a)return t;l=t}return(s||a)&&(l=Dn(l,7*s+a)),Be(l)}function Fu(e,t,n,r,i){let o=ae(e,t),{year:s,month:a,day:l}=o;if(n){let[u,d]=sr(e,s,a);s+=n,a=$u(e,u,d,e?e.p(s):void 0,i),a=Ot("month",a,1,ho(e,s),i)}return r&&({year:s,month:a}=e?e.K(s,a,r):Bh(s,a,r)),l=Ot("day",l,1,go(e,s,a),i),ar(e,s,a,l)}function $u(e,t,n,r,i){if(n){let o=e?e.l:void 0;return r!==void 0&&(o<0||r===t+1)?r:(i===1&&v(ir),o<0?-o:t)}return Mu(t,0,r)}function rn(e,t){return yt(e)!==yt(t)&&v("Mismatching Calendars"),e}function rE(e,t){return e.m!==t.m&&v("Mismatching TimeZones"),e}function pg(e){return e.timeZone.id}function Ic(e,t,n,r){let[i,o,s,a]=Xr(e,r,3,5),l=Ea(t.epochNanoseconds,n.epochNanoseconds,i,o,s,a);return Se(e?Re(l):l)}function _c(e,t,n,r,i){let[o,s,a,l]=Xr(e,i,5),u=n.epochNanoseconds,d=r.epochNanoseconds,c;if(ye(d,u))if(o<6)c=Ea(u,d,o,s,a,l);else{let m=rE(n.timeZone,r.timeZone);c=Rc(m,t,n,r,o),c=ba(c,d,o,s,a,l,xg(t,m,n),1)}else c=we;return Se(e?Re(c):c)}function Ac(e,t,n,r,i){let[o,s,a,l]=Xr(e,i,6),u=ot(n),d=ot(r),c=ye(d,u),m;return c?o<=6?m=Ea(u,d,o,s,a,l):(m=gg(t,n,r,c,o),m=ba(m,d,o,s,a,l,oE(t,n))):m=we,Se(e?Re(m):m)}function Oc(e,t,n,r,i){let[o,s,a,l]=Xr(e,i,6,9,6);return fg(e,t,n,r,o,s,a,l)}function Dc(e,t,n,r,i){let[o,s,a,l]=Xr(e,i,9,9,8),u=yo(t,n),d=yo(t,r);return yg(u,d)?fg(e,t,Be(u),Be(d),o,s,a,l,8):Se(we)}function fg(e,t,n,r,i,o,s,a,l=6){let u=Tn(n),d=Tn(r),c;return ye(d,u)?i===6?c=Ea(u,d,i,o,s,a):(c=Mc(t,n,r,i),o===l&&s===1||(c=ba(c,d,i,o,s,a,wg(t,n)))):c=we,Se(e?Re(c):c)}function vc(e,t,n,r){let[i,o,s,a]=Xr(e,r,5,5),l=Wr(Je(n)-Je(t),Qr(o,s),a),u={...we,...Ia(l,i)};return Se(e?Re(u):u)}function Rc(e,t,n,r,i){let o=ye(r.epochNanoseconds,n.epochNanoseconds);if(!o)return we;if(i<6)return{...we,...Cn(r.epochNanoseconds-n.epochNanoseconds,i)};if(!yg(xe(n),xe(r)))return{...we,...Cn(r.epochNanoseconds-n.epochNanoseconds,5)};let[s,a,l]=iE(e,n,r,o);return{...i===6?{...we,days:Js(s,a)}:Mc(t,s,a,i),...Ia(l)}}function hg(e,t,n,r){let i=ot(t),o=ot(n),s=ye(o,i);return s?r<=6?{...we,...Cn(o-i,r)}:gg(e,t,n,s,r):we}function gg(e,t,n,r,i){let o=n,s=Je(n)-Je(t);return Math.sign(s)===-r&&(o=Dn(n,-r),s+=tn*r),{...Mc(e,t,o,i),...Ia(s)}}function Mc(e,t,n,r){if(r<=7){let x=Js(t,n);return r===7?{...we,weeks:Vr(x,7),days:Ku(x,7)}:{...we,days:x}}let i=ae(e,t),o=ae(e,n);if(r===8){let{year:x,month:S,day:w}=i,{year:D,month:T,day:R}=o,O=Math.sign(Xt(D,x)||Xt(T,S)||Js(t,n)),b=0,E=0;if(O){b=e?e._(x,S,D,T):v1(x,S,D,T);let M=Fu(e,t,0,b,0);O*Xt(w,R)>0&&(b-=O,M=Fu(e,t,0,b,0)),E=Js(M,n)}return{...we,months:b,days:E}}let{year:s,month:a,day:l}=i,{year:u,month:d,day:c}=o,m=u-s,p=d-a,f=c-l;if(m||p){let x=Math.sign(m||p),S=go(e,u,d),w=0;if(Math.sign(c-l)===-x){let D=S;({year:u,month:d}=e?e.K(u,d,-x):Bh(u,d,-x)),m=u-s,p=d-a,S=go(e,u,d),w=x<0?-D:S}if(f=c-Math.min(l,S)+w,m){let[D,T]=sr(e,s,a),[R,O]=sr(e,u,d),b=e?e.l:void 0;if(p=b!==void 0&&T&&!O&&(b<0?x>0&&R===-b:x<0&&R===D)?0:R-D||Number(O)-Number(T),Math.sign(p)===-x){let E=x<0&&-ho(e,u);u-=x,m=u-s,p=d-$u(e,D,T,e?e.p(u):void 0,0)+(E||ho(e,u))}else if(e){let E=$u(e,D,T,e.p(u),0);p=e._(u,E,u,d)}}}return{...we,years:m,months:p,days:f}}function yg(e,t){return Xt(e.year,t.year)||Xt(e.month,t.month)||Xt(e.day,t.day)}function iE(e,t,n,r){let i=xe(t),o=xe(n),s=n.epochNanoseconds,a=0,l=Je(o)-Je(i);Math.sign(l)===-r&&a++;let u=a+(r>0?1:0);for(;a<=u;a++){let d=Dn(o,a*-r),c=ti(e,ie(d,i));if(ye(s,c)!==-r)return[i,d,Number(s-c)]}}function Ea(e,t,n,r,i,o){return{...we,...Cn(ka(t-e,Lo(r,i),o),n)}}function Js(e,t){return vt(t)-vt(e)}function wg(e,t){return{origin:t,ie:Tn(t),calendar:e,he:Tn}}function oE(e,t){return{origin:t,ie:ot(t),calendar:e,he:n=>ot(ie(n,t))}}function xg(e,t,n){let r=xe(n);return{origin:r,ie:n.epochNanoseconds,calendar:e,he:i=>ti(t,ie(i,r))}}function Uu(e,t){return Fc(t)?e.he(ni(e.calendar,e.origin,t)):e.ie}function bg(e,t,n){let{calendar:r}=e;if(cr(e)){let{timeZone:s}=e,a=lr(e,t);return[Rc(s,r,e,a,n),a.epochNanoseconds,xg(r,s,e)]}let i=fr(ie(e,ze)),o=ur(r,i,t);return[hg(r,i,o,n),ot(o),wg(r,e)]}function oh(e,t){return cr(e)?lr(e,t).epochNanoseconds:ot(ur(e.calendar,ie(e,ze),t))}function cr(e){return"timeZone"in e}function Br(e,t){return e<=6-(t?1:0)}function Nc(e,t,n){let r={};for(let i=t;i>=0;i--){let o=wt[i];r[n[i]]=Vr(e,o),e=Ku(e,o)}return r}var sE=2**53;function Pc(e,t,n,r,i){let o=e(rt(i).relativeTo),s=Math.max(In(n),In(r));return Br(s,o&&cr(o))?aE(t,n,r,s):(o||v("Missing relativeTo"),t&&(r=Re(r)),Se(((a,l,u,d)=>{let{calendar:c}=a;if(cr(a)){let{timeZone:f}=a,x=lr(a,l);return Rc(f,c,a,lr(x,u),d)}let m=ie(a,ze),p=ur(c,m,l);return hg(c,m,ur(c,p,u),d)})(o,n,r,s)))}function aE(e,t,n,r){return Se(vn(((i,o,s,a)=>{let l=en(i)+en(o)*BigInt(a?-1:1);return Number.isFinite(Number(l/ce))||v(Sn),{...we,...Cn(l,s)}})(t,n,r,e)))}function kg(e,t,n){let r=In(t),[i,o,s,a,l]=((f,x,S)=>{f=ga(f,Qt);let w=Jh(f),D=S(f.relativeTo),T=fc(f),R=Jr(f,7),O=Kr(f);return w===void 0&&O===void 0&&v("Required smallestUnit or largestUnit"),O==null&&(O=0),w==null&&(w=Math.max(O,x)),eg(w,O),T=wc(T,O,1),T>1&&O>5&&w!==O&&v("For calendar units with roundingIncrement > 1, use largestUnit = smallestUnit"),[w,O,T,R,D]})(n,r,e);if(!l&&Math.max(r,i)<=6)return Se(vn(((f,x,S,w,D)=>{let T=ka(en(f),Lo(S,w),D);return{...we,...Cn(T,x)}})(t,i,o,s,a)));let u=l&&cr(l),d=u&&i>=6&&o<6;if(!t.sign&&!d)return t;l||v("Missing relativeTo");let[c,m,p]=bg(l,t,i);return Se(ba(c,m,i,o,s,a,p,u))}function Sg(e){return e.sign===-1?Lc(e):e}function Lc(e){return Se(Re(e))}function Re(e){let t={};for(let n of de)t[n]=-1*e[n]||0;return t}function Ca(e,t=de){let n=0;for(let r of t){let i=Math.sign(e[r]);i&&(n&&n!==i&&v("Cannot mix duration signs"),n=i)}return n}function vn(e){for(let n of N1)Ot(n,e[n],-4294967295,4294967295,1);let t=en(e);return Tg(Number(t/or)),e}function Tg(e){Number.isSafeInteger(e)||v("Out-of-bounds duration")}function en(e){return BigInt(e.days)*ce+gr(e)}function gr(e){return BigInt(e.hours)*w1+BigInt(e.minutes)*y1+Eg(e)}function Eg(e){return BigInt(e.seconds)*or+BigInt(e.milliseconds)*Yr+BigInt(e.microseconds)*g1+BigInt(e.nanoseconds)}function Cn(e,t=6){let n=Number(e/ce),r=Number(e%ce),i=wt[t],o=t<=3?Number(e/BigInt(i)):n*(tn/i)+Vr(r,i);Number.isFinite(o)||v(Sn),t<=3&&Math.abs(o)/(An/wt[t])>=sE&&v(Sn);let s=Nc(r,t,de);return s[de[t]]=o,s}function Ia(e,t=5){return Nc(e,t,de)}function Fc(e){return!!Ca(e,Zh)}function In(e){let t=9;for(;t>0&&!e[de[t]];t--);return t}function Fo(e,t){return ye(e.epochNanoseconds,t.epochNanoseconds)}function Cg(e,t,n,r){let i=e(rt(r).relativeTo),o=Math.max(In(t),In(n));return wh(de,t,n)?0:Br(o,i&&cr(i))?ye(en(t),en(n)):(i||v("Missing relativeTo"),ye(oh(i,t),oh(i,n)))}function $c(e,t){return yr(e,t)||_a(e,t)}function yr(e,t){return Xt(vt(e),vt(t))}function _a(e,t){return Xt(Je(e),Je(t))}function Ig(e,t){return!Fo(e,t)}function _g(e,t){return!Fo(e,t)&&e.timeZone.m===t.timeZone.m&&e.calendar===t.calendar}function Ag(e,t){return!$c(e,t)&&e.calendar===t.calendar}function Og(e,t){return!yr(e,t)&&e.calendar===t.calendar}function Dg(e,t){return!yr(e,t)&&e.calendar===t.calendar}function vg(e,t){return!yr(e,t)&&e.calendar===t.calendar}function Rg(e,t){return!_a(e,t)}function ri(e){return e===0?f1:e?e.k:void 0}function Ue(e,t,n=t){return ri(e)?n:t}function Uc(e,t){let n=e||void 0,r=ri(e),{era:i,eraYear:o,year:s}=t;if(s!==void 0&&(s=Ce(s,"year")),o!==void 0&&(o=Ce(o,"eraYear")),i!==void 0||o!==void 0){i!==void 0&&o!==void 0||ne("Mismatching era/eraYear"),r||v("Forbidden era/eraYear");let a=Sh(i),l=r[a];l===void 0&&v((d=>`Invalid era: ${d}`)(i));let u=n?.$?n.$(o,a,l):lE(o,l);s!==void 0&&s!==u&&v("Mismatching year/eraYear"),s=u}else s===void 0&&ne(ia(r));return s}function ea(e,t,n,r,i){let{month:o,monthCode:s}=t;if(s!==void 0){let a=((l,u,d,c,m=Eh(u))=>{let p=l?l.p(d):void 0,[f,x]=m,S=Mu(f,x,p);if(x){let w=l?l.l:void 0;w===void 0&&v(ir),w>0?(S>w&&v(ir),p!==S&&(c===1&&v(ir),S=Mu(f,0,p))):(S!==-w&&v(ir),p===void 0&&c===1&&v(ir))}return S})(e,s,n,r,i);o!==void 0&&o!==a&&v("Mismatching month/monthCode"),o=a,r=1}else o===void 0&&ne("Missing month/monthCode");return Ot("month",o,1,ho(e,n),r)}function zu(e,t,n,r,i){return Ru(t,"day",1,go(e,r,n),i)}function lE(e,t){return(t+e)*(Math.sign(t)||1)||0}function $o(e,t){return ca(Dt($e,{...ze,...e}),t)}var uE=Gr("([+-])(\\d{2})(?::?(\\d{2})(?::?(\\d{2})(?:[.,](\\d{1,9}))?)?)?");function Aa(e){let t=zc(e);return t===void 0&&v(gh(e)),t}function zc(e,t){let n=uE.exec(e);if(n&&(r=>(i=>{i[0]!=="T"&&i[0]!=="t"||(i=i.slice(1));let o=i.search(/[.,]/),s=o<0?i:i.slice(0,o),a=s.split(":");return a.length===1?/^(?:\d{2}|\d{4}|\d{6})$/i.test(s):(a.length===2||a.length===3)&&a.every(l=>l.length===2&&/^\d{2}$/i.test(l))})(r.slice(1)))(n[0]))return((r,i)=>{let o=r[4]||r[5];return i&&o&&v(Jt(o)),a=(zr(r[2])*Co+zr(r[3])*Eo+zr(r[4])*An+Vu(r[5]||""))*Yu(r[1]),Math.abs(a)>=tn&&v("Out-of-bounds offset"),a;var a})(n,t)}var at={era:pc,month:Ys,monthCode(e,t){if(typeof e=="string")return e;if(e&&typeof e=="object"){let n=e.toString;if(typeof n=="function")return ve(n.call(e),t)}return ve(e,t)},day:Ys},Bc=ko($e,Ce),Mg=ko(de,ha),qc=Object.assign({},at,Bc),jc={offset(e){return Aa(pc(e))},...qc};function pe(e,t,n,r,i=!r){let o={},s=0;for(let a of t){let l=e[a];if(l!==void 0){s=1;let u=n[a];u&&(l=u(l,a)),o[a]=l}else r&&r.includes(a)&&ne(xo(a))}return i&&!s&&ne(uh(t)),o}function Uo(e,t=ze,n){let r=ie(e,t);return fr(r),Rt(r,n)}function wo(e,t,n){return Ng(e,t,Pg(e,t),X(n))}function Oa(e,t,n){let r=Pg(e,t),i=n();return[Ng(e,t,r,i[0]),...i]}function Ng(e,t,n,r){let i=n[1],o=ea(e,t,i,r,n[0]);return le(Be(ar(e,i,o,zu(e,t,o,i,r))),e)}function Hc(e){if(e.monthCode!==void 0)return Eh(e.monthCode)}function Pg(e,t){let n=ri(e);return t.year!==void 0||t.era!==void 0&&t.eraYear!==void 0||ne(ia(n)),t.monthCode===void 0&&t.month===void 0&&ne("Missing month/monthCode"),t.day===void 0&&ne(xo("day")),[Hc(t),Uc(e,t)]}function Wc(e,t,n){let r=ri(e);t.year!==void 0||t.era!==void 0&&t.eraYear!==void 0||ne(ia(r)),t.monthCode===void 0&&t.month===void 0&&ne("Missing month/monthCode");let i=Hc(t),o=Uc(e,t);return le(ya(ar(e,o,ea(e,t,o,X(n),i),1)),e)}function Gc(e,t,n){let r=e===it,i=ri(e);t.day===void 0&&ne(xo("day")),r||t.month===void 0||t.year!==void 0||t.era!==void 0&&t.eraYear!==void 0||ne(ia(i));let o=Hc(t),s=t.eraYear!==void 0||t.year!==void 0?Uc(e,t):void 0,a=X(n),l,u,d;if(s===void 0&&r&&(s=1972),s!==void 0){r||Be(ar(e,s,1,1));let f=ea(e,t,s,a,o);l=zu(e,t,f,s,a),[u,d]=sr(e,s,f)}else{t.monthCode===void 0&&ne("Missing month/monthCode"),[u,d]=o;let f=e?e.ne:1972;if(f!==void 0)l=zu(e,t,ea(e,t,f,a,o),f,a);else{let x=a===0&&e?e.fe?.(u,d,t.day):void 0;l=x!==void 0?x:t.day}}d&&((e&&e.U?.[u])??1/0)<t.day&&(a===1&&v(ir),d=0,l=Wu(t.day,1,(e&&e.R)??1/0));let c=e?e.u(u,!!d,l):Lu(u,!!d);for(;!c&&a===0&&l>1;)l--,c=e?e.u(u,!!d,l):Lu(u,!!d);c||v("Cannot guess year");let{year:m,month:p}=c;return le(Be(ar(e,m,p,l)),e)}var Mt=Intl.DateTimeFormat;function cE(e,t){t<-864e13&&v(Sn);let n=e.formatToParts(t),r={};for(let i of n)r[i.type]=i.value;return r}var dE={El_Aaiun:17,Tucuman:12,Tirane:11,Riga:10,Simferopol:9,Vienna:9,Tunis:8,Boa_Vista:6,Fortaleza:6,Maceio:6,Noronha:6,Recife:6,Gaza:6,Hebron:6,DeNoronha:6},Du=-388152e4;function Lg(e,t=4){let n=hc(e),r=Jr(e,4),i=Kr(e);return[r,...Yc(jr(Qt,i,0,t),n)]}function Vc(e){return yc(rt(e))}function Fg(e,t){return Lg(rt(e),t)}function Yc(e,t){return e!=null?[wt[e],e<4?9-3*e:-1]:[t===void 0?1:10**(9-t),t]}function Zc(e,t,n){let[r,i,o,s]=(l=>{let u=hc(l=rt(l)),d=Jr(l,4),c=Kr(l);return[l.timeZone,d,...Yc(jr(Qt,c,0,4),u)]})(n),a=r!==void 0;return((l,u,d,c,m,p)=>{d=Sa(d,BigInt(m),c);let f=u.B(d);return nd(vo(d+BigInt(f)),p)+(l?zo(Qs(f)):"Z")})(a,He(a?e(r):"UTC"),t.epochNanoseconds,i,o,s)}function Kc(e,t){let n=(r=>{r=rt(r);let i=yc(r),o=hc(r),s=Y1(r),a=Jr(r,4),l=Kr(r);return[i,V1(r),s,a,...Yc(jr(Qt,l,0,4),o)]})(t);return((r,i,o,s,a,l,u,d,c,m)=>{s=Sa(s,BigInt(c),d);let p=o.B(s);return nd(vo(s+BigInt(p)),m)+zo(Qs(p),u)+fE(i,l)+rd(r,a)})(e.calendar,e.timeZone.id,e.timeZone,e.epochNanoseconds,...n)}function Jc(e,t){let n=(r=>(r=rt(r),[yc(r),...Lg(r)]))(t);return((r,i,o,s,a,l)=>nd(wa(i,a,s),l)+rd(r,o))(e.calendar,e,...n)}function Xc(e,t){return n=e.calendar,r=e,i=Vc(t),ta(r)+rd(n,i);var n,r,i}function Qc(e,t){return $g(e.calendar,Ug,e,Vc(t))}function ed(e,t){return $g(e.calendar,pE,e,Vc(t))}function $g(e,t,n,r){let i=r>1||r===0&&e!==it;return r===1?e===it?t(n):ta(n):i?ta(n)+Bg(yt(e),r===2):t(n)}function td(e,t){return((n,r,i,o)=>zg(xa(n,i,r)[0],o))(e,...Fg(t))}function Da(e,t){let[n,r,i]=Fg(t,3);return r>1&&vn(e={...e,...X1(e,r,n)}),mE(e,i)}function mE(e,t){let{sign:n}=e,r=n===-1?Re(e):e,{hours:i,minutes:o}=r,s=Eg(r),a=Number(s/or),l=Number(s%or);Tg(a);let u=id(l,t),d=t>=0||!n||u;return(n<0?"-":"")+"P"+sh({Y:rr(r.years),M:rr(r.months),W:rr(r.weeks),D:rr(r.days)})+(i||o||a||d?"T"+sh({H:rr(i),M:rr(o),S:rr(a,d)+u}):"")}function sh(e){let t=[];for(let n in e){let r=e[n];r&&t.push(r,n)}return t.join("")}function rr(e,t){if(!e&&!t)return"";let n=Object.create(null);return n.useGrouping=0,e.toLocaleString("fullwide",n)}function nd(e,t){return ta(e)+"T"+zg(e,t)}function ta(e){return Ug(e)+"-"+ht(e.day)}function Ug(e){let{year:t}=e;return(t<0||t>9999?qg(t)+Xs(6,Math.abs(t)):Xs(4,t))+"-"+ht(e.month)}function pE(e){return ht(e.month)+"-"+ht(e.day)}function zg(e,t){let n=[ht(e.hour),ht(e.minute)];return t!==-1&&n.push(ht(e.second)+((r,i,o,s)=>id(r*To+i*So+o,s))(e.millisecond,e.microsecond,e.nanosecond,t)),n.join(":")}function zo(e,t=0){if(t===1)return"";let[n,r]=At(Math.abs(e),Co),[i,o]=At(r,Eo),[s,a]=At(o,An);return qg(e)+ht(n)+":"+ht(i)+(s||a?":"+ht(s)+id(a):"")}function fE(e,t){return t!==1?"["+(t===2?"!":"")+e+"]":""}function rd(e,t){return t>1||t===0&&e!==it?Bg(yt(e),t===2):""}function Bg(e,t){return"["+(t?"!":"")+"u-ca="+e+"]"}var hE=/0+$/;function id(e,t){let n=Xs(9,e);return n=t===void 0?n.replace(hE,""):n.slice(0,t),n?"."+n:""}function qg(e){return e<0?"-":"+"}var gE=/^(AC|AE|AG|AR|AS|BE|BS|CA|CN|CS|CT|EA|EC|IE|IS|JS|MI|NE|NS|PL|PN|PR|PS|SS|VS)T$/,yE=/[^\w\/:+-]+/;function jg(e){return va(ve(e))}function va(e){return Hg(e).id}function Hg(e){let t=e.toUpperCase(),n=(i=>{let o=zc(i,1);if(o!==void 0)return{id:zo(o),X:o,m:o}})(t);if(n)return{kind:"fixed",...n};let r=t==="UTC"?"UTC":(i=>(yE.test(i)&&v(Hu(i)),gE.test(i)&&v("Forbidden ICU TimeZone"),i.toLowerCase().split("/").map((o,s)=>(o.length<=3||/\d/.test(o))&&!/etc|yap/.test(o)?o.toUpperCase():o.replace(/baja|dumont|[a-z]+/g,(a,l)=>a.length<=2&&!s||a==="in"||a==="chat"?a.toUpperCase():a.length>2||!l?eh(a).replace(/island|noronha|murdo|rivadavia|urville/,eh):a)).join("/")))(e);return wE(r)}var wE=qr(e=>{if(e==="UTC")return{kind:"utc",id:e,m:e};let t=e.toUpperCase(),n=xE(t);return{kind:"named",id:e,format:n,m:n.resolvedOptions().timeZone}}),xE=qr(e=>new Mt("en-u-hc-h23",{calendar:"iso8601",timeZone:e,era:"short",year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"}));function He(e){let t=Hg(e);return bE(t.id,t)}var bE=qr((e,t)=>t.kind==="named"?new qu(e,t.m,t.format):new Bu(e,t.m,t.kind==="fixed"?t.X:0)),Bu=class{constructor(t,n,r){this.id=t,this.m=n,this.X=r}B(){return this.X}N(t){return[bc(t,this.X)]}O(){}},qu=class{constructor(t,n,r){this.id=t,this.m=n,this.ke=((i,o)=>{let s=qr(i),a=qr(kE),l=86400*o;function u(c){let[m,p]=lh(c,l),f=Ks(m),x=Ks(p),S=s(f),w=s(x);return S===w?S:d(a(f,x),S,w,c)}function d(c,m,p,f){let x,S;for(;(f===void 0||(x=f<c[0]?m:f>=c[1]?p:void 0)===void 0)&&(S=c[1]-c[0]);){let w=c[0]+Math.floor(S/2);i(w)===p?c[1]=w:c[0]=w+1}return x}return{xe(c){let m=u(c-86400),p=u(c+86400),f=c-m,x=c-p;if(m===p)return[f];let S=u(f);return S===u(x)?[c-S]:m>p?[f,x]:[]},we:u,O:function c(m,p){if(p>0&&m>=864e10)return;if(p<0){if(m<=Du)return;let R=ah()+94867200;if(m>R)return c(R,-1)}let f=p>0?Math.max(m,Du):m,[x,S]=lh(f,l),w=l*p,D=p>0?Math.max(m,ah())+94867200:Du,T=()=>p<0?S>D:x<D;for(;T();){let R=Ks(x),O=Ks(S),b=s(R),E=s(O);if(b!==E){let M=a(R,O);d(M,b,E);let C=M[0];if((Xt(C,m)||1)===p)return C}x+=w,S+=w}}}})((i=>o=>{let s=cE(i,1e3*o);return 86400*fo((a=>{let l=a.relatedYear;if(l!==void 0)return parseInt(l);let u=parseInt(a.year);return a.era!==void 0&&Sh(a.era)==="bce"?1-u:u})(s),parseInt(s.month),parseInt(s.day))+3600*parseInt(s.hour)+60*parseInt(s.minute)+parseInt(s.second)-o})(r),(i=>{let o=i.split("/").pop();return dE[o]||60})(t))}B(t){return this.ke.we((n=>th(n)[0])(t))*An}N(t){let n=86400*vt(t)+nc(t),r=Ph(t);return this.ke.xe(n).map(i=>xt(BigInt(i)*or+BigInt(r)))}O(t,n){let[r,i]=th(t),o=this.ke.O(r+(n>0||i?1:0),n);if(o!==void 0)return BigInt(o)*or}};function ah(){return Math.floor(Date.now()/1e3)}function kE(e,t){return[e,t]}function lh(e,t){let n=Math.floor(e/t)*t;return[n,n+t]}function Ks(e){return Wu(e,-1e10,864e10)}function Wg(e,t,n){let r=pe(n,Ue(t,Mh,Nh),jc,[],0);if(r.timeZone!==void 0){let i=wo(t,r),o=$o(r),s=He(e(r.timeZone));return{epochNanoseconds:ei(s,ie(i,o),r.offset),timeZone:s,calendar:t}}return wo(t,r)}function Gg(e,t,n,r){let i=pe(n,Ue(t,Mh,Nh),jc,ec,0),o=e(i.timeZone),[s,a,l,u]=Oa(t,i,()=>Hr(r)),d=$o(i,a),c=He(o);return bt(ei(c,ie(s,d),i.offset,l,u),c,t)}function Vg(e,t,n){let r=pe(t,Ue(e,vh,Rh),qc,[],0),[i,o]=Oa(e,r,()=>[X(n)]);return Uo(i,$o(r,o),e)}function Yg(e,t,n,r=[]){return wo(e,pe(t,Ue(e,mr,pr),at,r),n)}function Zg(e,t,n,r){return Wc(e,pe(t,Ue(e,_o,Ah),at,r),n)}function Kg(e,t,n,r){let i=pe(n,Ue(e,mr,pr),at,dr,0);return t&&i.month!==void 0&&i.monthCode===void 0&&i.year===void 0&&(i.year=1972),Gc(e,i,r)}function Jg(e,t){return $o(pe(e,Pu,Bc,[],1),X(t))}function Xg(e){let t=pe(e,Yh,Mg);return Se(vn({...we,...t}))}function gt(e){v(gh(e))}function Qg(e){let t=Rn(e=pc(e)),n;return t||gt(e),t.C?n=0:t.offset?n=Aa(t.offset):gt(e),t.timeZoneId&&zc(t.timeZoneId,1),Ro(t),st(bc(t,n))}function ey(e,t){let n=Rn(ve(e));return n||gt(e),n.timeZoneId?cy(n,t,void 0):(n.C&>(e),ju(n,t))}function ty(e,t,n){let r=Rn(ve(e));return r&&r.timeZoneId||gt(e),cy(r,t,n)}function ny(e,t){let n=Rn(ve(e));return n&&!n.C||gt(e),dy(n,t)}function ry(e,t){let n=ad(sd(ve(e)),void 0,t);return le(n,n.calendar)}function iy(e,t){let n=ld(ve(e));if(n)return od(n),le(ya(nn(n)),t(n.calendarId));let r=ad(sd(e),SE,t),{calendar:i}=r;return le(yo(i,r),i)}function od(e){e.calendarId!=="iso8601"&&v(Jt(e.calendarId))}function oy(e,t){let n=ud(ve(e));if(n)return od(n),le(nn(n),t(n.calendarId));let r=ad(sd(e),TE,t),{calendar:i}=r,{year:o,month:s,day:a}=ae(i,r),[l,u]=sr(i,o,s),{year:d,month:c}=((m,p,f,x)=>{let S=m?m.u(p,f,x):Lu(p,f);return S||v("Cannot guess year"),S})(i,l,u,a);return le(Be(ar(i,d,c,a)),i)}function sy(e){let t=(r=>{let i=my(r);return i?(Bo(i[13]),py(i,1)):void 0})(e=ve(e));if(!t){let r=Rn(e);r&&r.re||gt(e),r.C&&v(Jt("Z")),od(r),t=r}let n;return(n=ld(e))&&nh(n)&>(e),(n=ud(e))&&nh(n)&>(e),hr(Oo(t))}function ay(e){let t=DE.exec(ve(e));return t||gt(e),Se(vn((n=>{let r=0,i=0,o=0,s={years:a(n[2]),months:a(n[3]),weeks:a(n[4]),days:a(n[5]),hours:a(n[6],n[7],5),minutes:a(n[8],n[9],4),seconds:a(n[10],n[11],3),...Nc(o,2,de)};return r||v(uh(de)),Yu(n[1])<0&&(s=Re(s)),s;function a(l,u,d){let c=0,m=0;return d&&([c,o]=At(o,wt[d])),l!==void 0&&(i&&v(Jt(l)),m=(p=>{let f=parseInt(p);return Number.isFinite(f)||v(Jt(p)),f})(l),r=1,u&&(o=Vu(u)*(wt[d]/An),i=1)),c+m}})(t)))}function ly(e){let t=Rn(e)||ld(e)||ud(e);if(t)return t.calendarId;let n=my(e);return n?Bo(n[13]).calendarId:e}function uy(e){let t=Rn(e);return t&&(t.timeZoneId||t.C&&"UTC"||t.offset)||e}function sd(e){let t=Rn(e);return t&&!t.C||gt(e),t}function ad(e,t,n){return t&&e.calendarId==="iso8601"?(nn(e),e.re&&Oo(e),ju(t(e),n)):e.re?dy(e,n):ju(e,n)}function SE(e){let t=12*e.year+e.month===rg?20:1;return{...e,day:t}}function TE(e){return{...e,year:1972}}function cy(e,t,n){let r=He(va(e.timeZoneId)),i;if(Ro(e),e.re){let s=e.offset?Aa(e.offset):void 0,[,a,l]=Hr(n);i=ei(r,e,s,a,l,!(r.X||e.offset===void 0||(o=e.offset,o.replace(/\D/g,"").length>4)),e.C)}else Hr(n),i=En(r,e);var o;return xt(i),bt(i,r,t(e.calendarId))}function dy(e,t){return Ro(e),fr(e),{...ie(e,e),calendar:t(e.calendarId)}}function ju(e,t){return nn(e),Be(e),{calendar:t(e.calendarId),year:e.year,month:e.month,day:e.day}}function na(e){return`(\\d{2})(?:(:?)(\\d{2})(?:\\${e}(\\d{2})(?:[.,](\\d{1,9}))?)?)?`}var EE="(?:(?:([+-])(\\d{6}))|(\\d{4}))(-?)(\\d{2})\\4(\\d{2})(?:[T ]"+na(8)+"(Z|([+-])"+na(15)+")?)?",CE=Gr("(?:(?:([+-])(\\d{6}))|(\\d{4}))-?(\\d{2})((?:\\[(!?)([^\\]]*)\\]){0,9})"),IE=Gr("(?:--)?(\\d{2})-?(\\d{2})((?:\\[(!?)([^\\]]*)\\]){0,9})"),_E=Gr(EE+"((?:\\[(!?)([^\\]]*)\\]){0,9})"),AE=Gr("T?"+na(2)+`(([+-])${na(9)})?((?:\\[(!?)([^\\]]*)\\]){0,9})`),OE=new RegExp("\\[(!?)([^\\]]*)\\]","g"),DE=Gr("([+-])?P(\\d+Y)?(\\d+M)?(\\d+W)?(\\d+D)?(?:T(?!$)(?:(\\d+)(?:[.,](\\d{1,9}))?H)?(?:(\\d+)(?:[.,](\\d{1,9}))?M)?(?:(\\d+)(?:[.,](\\d{1,9}))?S)?)?");function Rn(e){let t=_E.exec(e);return t?(n=>{let r=n[12],i=(r||"").toUpperCase()==="Z";return{year:fy(n),month:parseInt(n[5]),day:parseInt(n[6]),...py(n,7),...Bo(n[19]),re:!!n[7],C:i,offset:i?void 0:r}})(t):void 0}function ld(e){let t=CE.exec(e);if(t)return(n=>({year:fy(n),month:parseInt(n[4]),day:1,...Bo(n[5])}))(t)}function ud(e){let t=IE.exec(e);return t?(n=>({year:1972,month:parseInt(n[1]),day:parseInt(n[2]),...Bo(n[3])}))(t):void 0}function my(e){let t=AE.exec(e);if(t)return t[6]&&Aa(t[6]),t}function py(e,t){let n=zr(e[t+3]);return{...rc(Vu(e[t+4]||""))[0],hour:zr(e[t]),minute:zr(e[t+2]),second:n===60?59:n}}function fy(e){let t=Yu(e[1]),n=parseInt(e[2]||e[3]);return t<0&&!n&&v(Jt(-0)),t*n}function Bo(e){let t,n,r=[];return e.replace(OE,(i,o,s)=>{let a=!!o,[l,u]=s.split("=").reverse();return u?u==="u-ca"?(r.push(l.toLowerCase()),t||(t=a)):(a||/[A-Z]/.test(u))&&v(Jt(i)):(n&&v(Jt(i)),n=l),""}),r.length>1&&t&&v(Jt(e)),{timeZoneId:n,calendarId:r[0]||"iso8601"}}function ii(e,t,n){let r=Object.assign(Object.create(null),t);return vu(r,n,_h),ri(e)&&(vu(r,n,x1),e&&e.ge&&vu(r,n,b1,Zr)),r}function vu(e,t,n,r){let i=0,o=[];for(let s of n)t[s]!==void 0?i=1:o.push(s);if(Object.assign(e,t),i)for(let s of r||o)delete e[s]}function hy(e,t,n){let{calendar:r,timeZone:i}=e,o=Ue(r,S1,T1),s=xe(e),{year:a,month:l,day:u}=ae(r,s),d={year:a,monthCode:qo(r,a,l),day:u,hour:s.hour,minute:s.minute,second:s.second,millisecond:s.millisecond,microsecond:s.microsecond,nanosecond:s.nanosecond,offset:s.offsetNanoseconds},c=pe(t,o,jc),m=ii(r,d,c),p={...d,...c},[f,x,S,w]=Oa(r,m,()=>Hr(n,2));return bt(ei(i,ie(f,ca(p,x)),p.offset,S,w),i,r)}function gy(e,t,n){let{calendar:r}=e,i=Ue(r,vh,Rh),{year:o,month:s,day:a}=ae(r,e),l={year:o,monthCode:qo(r,o,s),day:a,hour:e.hour,minute:e.minute,second:e.second,millisecond:e.millisecond,microsecond:e.microsecond,nanosecond:e.nanosecond},u=pe(t,i,qc),d=ii(r,l,u),c={...l,...u},[m,p]=Oa(r,d,()=>[X(n)]);return Uo(m,ca(c,p),r)}function yy(e,t,n){let{calendar:r}=e,i=Ue(r,mr,pr),{year:o,month:s,day:a}=ae(r,e);return wo(r,ii(r,{year:o,monthCode:qo(r,o,s),day:a},pe(t,i,at)),n)}function wy(e,t,n){let{calendar:r}=e,i=Ue(r,_o,Ah),{year:o,month:s}=ae(r,e);return Wc(r,ii(r,{year:o,monthCode:qo(r,o,s)},pe(t,i,at)),n)}function xy(e,t,n){let{calendar:r}=e,i=Ue(r,mr,pr),{year:o,month:s,day:a}=ae(r,e);return Gc(r,ii(r,{monthCode:qo(r,o,s),day:a},pe(t,i,at)),n)}function by(e,t,n){return((r,i,o)=>$o({...Dt(Pu,r),...pe(i,Pu,Bc)},X(o)))(e,t,n)}function ky(e,t){return Se((n=e,r=t,vn({...n,...pe(r,Yh,Mg)})));var n,r}function qo(e,t,n){let[r,i]=sr(e,t,n);return Ch(r,i)}function Sy(e,t,n){return bt(e.epochNanoseconds,t,n)}function Ty(e){return st(e.epochNanoseconds)}function cd(e){return Rt(xe(e),e.calendar)}function dd(e){return le(xe(e),e.calendar)}function md(e){return hr(xe(e))}function Ey(e,t,n){let r=ti(t,e,(i=>Qh(rt(i)))(n));return bt(xt(r),t,e.calendar)}function Cy(e,t,n,r){let i=e(r.timeZone),o=r.plainTime,s=o!==void 0?t(o):void 0,a=He(i),l;return l=s?ti(a,ie(n,s)):En(a,ie(n,ze)),bt(l,a,n.calendar)}function Iy(e,t,n){return Dy(e,Dt(Ue(e,Ao,Oh),t),pe(nr(n),dr,at,[]))}function _y(e,t,n){let r=Ue(e,la,k1);return Dy(e,Dt(Dh,t),pe(nr(n),r,at,[]))}function Ay(e,t){return Gc(e,pe(t,Dh,at))}function Oy(e,t,n){return Wc(e,pe(t,Ue(e,Ao,Oh),at),n)}function Dy(e,t,n){let r=Ue(e,E1,C1),i=ii(e,t,n);return i=pe(i,r,at,[]),wo(e,i)}function vy(e){return st(xt(BigInt(ha(e))*Yr))}function Ry(e){return st(xt(fa(e)))}function oi(e){return e.timeZone="UTC",["full","long"].includes(e.timeStyle)&&(e.timeStyle="medium"),e}function My(e,t){return e.timeZone!==void 0&&ne("Cannot specify TimeZone"),e.timeZone=t,e}function si(e,t,n){let r=e.resolvedOptions().calendar;!n&&t.calendar===it||yt(t.calendar)===r||v("Mismatching Calendars")}function wr(e,t,n,r,i){let o=new Set(e),s=new Set(t),a=new Set(n);return(l,u)=>{let d,c,m={},p={},f={},x=0,S=0;for(let C of Object.keys(l)){let y=l[C];y===void 0||a.has(C)||(o.has(C)?C==="dateStyle"?d=y:C==="timeStyle"?c=y:m[C]=y:C==="era"?p[C]=y:s.has(C)?C==="dateStyle"||C==="timeStyle"?S=1:x=1:f[C]=y)}let w=d!==void 0,D=c!==void 0,T=w||D,R=Object.keys(m).length>0,O=x||S,b=R||w||D,E=Object.keys(p).length>0;(!u&&O||u&&O&&!b||T&&(R||E||x))&&ne("Invalid formatting options");let M={};return T||b||Object.assign(M,r),Object.assign(M,m,p,f),w&&(i?Object.assign(M,i[d]):M.dateStyle=d),D&&(M.timeStyle=c),M}}var Ny={year:"numeric",month:"numeric",day:"numeric"},Py={hour:"numeric",minute:"numeric",second:"numeric"},pd=Object.assign({},Ny,Py),fd=["weekday","year","month","day","dateStyle"],jo=["dayPeriod","hour","minute","second","fractionalSecondDigits","timeStyle"],hd=fd.concat(jo),vE=["weekday","day"].concat(jo),RE=["weekday","year"].concat(jo),Ly=wr(hd,[],[],pd),Fy=wr(hd,[],[],{...pd,timeZoneName:"short"}),$y=wr(hd,[],["timeZoneName"],pd),Uy=wr(fd,jo,["timeZoneName"],Ny),zy=wr(jo,fd,["timeZoneName","era"],Py),By=wr(["year","month","dateStyle"],vE,["timeZoneName"],{year:"numeric",month:"numeric"},{full:{year:"numeric",month:"long"},long:{year:"numeric",month:"long"},medium:{year:"numeric",month:"short"},short:{year:"2-digit",month:"numeric"}}),qy=wr(["month","day","dateStyle"],RE,["timeZoneName","era"],{month:"numeric",day:"numeric"},{full:{month:"long",day:"numeric"},long:{month:"long",day:"numeric"},medium:{month:"short",day:"numeric"},short:{month:"numeric",day:"numeric"}});function jy(e,t){let{timeZone:n}=e,r=xe(e),{offsetNanoseconds:i}=r,o=t||ze,s;return s=t?ei(n,ie(r,o),i,2):En(n,ie(r,o)),bt(s,n,e.calendar)}function Ra(e){let t=Ma(),n=e.B(t);return vo(t+BigInt(n))}function Ma(){return BigInt(Date.now())*Yr}function ai(){return new Mt().resolvedOptions().timeZone}var gd="PlainYearMonth",yd="PlainMonthDay",wd="PlainDate",xd="PlainDateTime",bd="PlainTime",kd="ZonedDateTime",Sd="Instant",Td="Duration";function on(e,t,n,...r){return Object.defineProperties(t,yh(e)),Object.defineProperties(t.prototype,bo("Temporal."+e)),Object.defineProperties(t.prototype,_n(i=>({get(){return i(n(this))},configurable:1}),Object.assign({},...r))),t}var sn=Gu.name==="noop"?e=>{Object.defineProperty(e,"_str_",{value:e.toJSON()})}:Gu;function an(){ne(ph)}function ln(){ne(mh)}var Wy={era(e){return Mo(e.calendar,e).era},eraYear(e){return Mo(e.calendar,e).eraYear},year(e){return ae(e.calendar,e).year},month(e){return ae(e.calendar,e).month},monthCode(e){return pa(e.calendar,e)}},Na={era(e){return Mo(e.calendar,e).era},eraYear(e){return Mo(e.calendar,e).eraYear},year(e){return ae(e.calendar,e).year},month(e){return ae(e.calendar,e).month},monthCode(e){return pa(e.calendar,e)},day(e){return ae(e.calendar,e).day}},Gy={monthCode(e){return pa(e.calendar,e)},day(e){return ae(e.calendar,e).day}},Ed={daysInMonth(e){return sc(e.calendar,e)},daysInYear(e){return ac(e.calendar,e)},monthsInYear(e){return oc(e.calendar,e)},inLeapYear(e){return ic(e.calendar,e)}},Ho={dayOfWeek(e){return ma(e)},dayOfYear(e){return Wh(e.calendar,e)},weekOfYear(e){return Gh(e.calendar,e)},yearOfWeek(e){return Vh(e.calendar,e)},daysInWeek(){return 7},daysInMonth(e){return sc(e.calendar,e)},daysInYear(e){return ac(e.calendar,e)},monthsInYear(e){return oc(e.calendar,e)},inLeapYear(e){return ic(e.calendar,e)}};function Hy(e){return sa(Object.keys(e))}Hy(Ed),Hy(Ho);function Ln(e){let t=ve(e).toLowerCase();return t===Ju?it:t===kh?Th:void v(hh(e,"temporal-polyfill/full"))}function Vo(e=Ju){return Ln(e)}var Yy=new WeakMap,Zy=on(kd,class{constructor(e,t,n=void 0){let r=xt(fa(e)),i=He(jg(t)),o=Vo(n);Ky(this,bt(r,i,o))}static from(e,t=void 0){return We(li(e,t))}static compare(e,t){return Fo(li(e),li(t))}get calendarId(){return yt(ee(this).calendar)}get timeZoneId(){return ee(this).timeZone.id}get epochMilliseconds(){return Po(ee(this))}get epochNanoseconds(){return kc(ee(this))}get offset(){return zo(xe(ee(this)).offsetNanoseconds)}get offsetNanoseconds(){return xe(ee(this)).offsetNanoseconds}get hoursInDay(){return lg(ee(this))}with(e,t=void 0){return We(hy(ee(this),pi(e),t))}withCalendar(e){return We({...ee(this),calendar:Fa(e)})}withTimeZone(e){return We({...ee(this),timeZone:He(ct(e))})}withPlainTime(e=void 0){return We(jy(ee(this),Ad(e)))}add(e,t=void 0){let n=ee(this);return We(lr(n,_e(e),t))}subtract(e,t=void 0){let n=ee(this);return We(lr(n,Re(_e(e)),t))}until(e,t=void 0){let n=ee(this),r=li(e),i=rn(n.calendar,r.calendar);return be(Se(_c(0,i,n,r,t)))}since(e,t=void 0){let n=ee(this),r=li(e),i=rn(n.calendar,r.calendar);return be(Se(_c(1,i,n,r,t)))}round(e){let t=ee(this),[n,r,i]=No(e);return We(ag(t,n,r,i))}startOfDay(){return We(ug(ee(this)))}equals(e){return _g(ee(this),li(e))}toInstant(){return un(Ty(ee(this)))}toPlainDateTime(){return Nt(cd(ee(this)))}toPlainDate(){return Pt(dd(ee(this)))}toPlainTime(){return Pn(md(ee(this)))}toLocaleString(e=void 0,t={}){let n=ee(this),r=new Mt(e,My(Fy(t),pg(n)));return si(r,n),r.format(Po(n))}toString(e=void 0){return Kc(ee(this),e)}toJSON(){return Kc(ee(this))}getTimeZoneTransition(e){let t=ee(this),n=dg(t,e);return n?We({...t,epochNanoseconds:n}):null}valueOf(){return ln()}},ME,Na,Ho,Io);function We(e){return Ky(Object.create(Zy.prototype),e)}function ee(e){return Lt(e)||an()}function ME(e){let t=ee(e);return{...xe(t),calendar:t.calendar}}function Lt(e){return Yy.get(e)}function li(e,t){if(qe(e)){let n=Lt(e);if(n)return Hr(t),n;let r=Yo(e);return Gg(ct,r,e,t)}return ty(e,Ln,t)}function Ky(e,t){return Yy.set(e,t),sn(e),e}function ct(e){if(qe(e)){let t=Lt(e);return t||ne(Hu(e)),t.timeZone.id}return(t=>va(uy(ve(t))))(e)}var Jy=new WeakMap,Xy=on(Sd,class{constructor(e){let t=xt(fa(e));ew(this,st(t))}static from(e){return un(ui(e))}static fromEpochMilliseconds(e){return un(vy(e))}static fromEpochNanoseconds(e){return un(Ry(e))}static compare(e,t){return Fo(ui(e),ui(t))}get epochMilliseconds(){return Po(lt(this))}get epochNanoseconds(){return kc(lt(this))}add(e){let t=lt(this);return un(st(Cc(t.epochNanoseconds,_e(e))))}subtract(e){let t=lt(this);return un(st(Cc(t.epochNanoseconds,Re(_e(e)))))}until(e,t=void 0){return be(Ic(0,lt(this),ui(e),t))}since(e,t=void 0){return be(Ic(1,lt(this),ui(e),t))}round(e){let t=lt(this),[n,r,i]=No(e,5,1);return un(st(Sa(t.epochNanoseconds,Lo(n,r),i)))}equals(e){return Ig(lt(this),ui(e))}toZonedDateTimeISO(e){return We(Sy(lt(this),He(ct(e))))}toLocaleString(e=void 0,t={}){let n=lt(this);return new Mt(e,Ly(t)).format(Po(n))}toString(e=void 0){return Zc(ct,lt(this),e)}toJSON(){return Zc(ct,lt(this))}valueOf(){return ln()}});function un(e){return ew(Object.create(Xy.prototype),e)}function lt(e){return Id(e)||an()}function Id(e){return Jy.get(e)}function ui(e){if(qe(e)){let t=Id(e);if(t)return t;let n=Lt(e);if(n)return st(n.epochNanoseconds)}return Qg(e)}var{toTemporalInstant:Qy}={toTemporalInstant(){let e=Date.prototype.valueOf.call(this);return un(st(BigInt(dc(e))*Yr))}};function ew(e,t){return Jy.set(e,t),sn(e),e}var tw=new WeakMap,nw=on(yd,class{constructor(e,t,n=void 0,r){let i=Ce(e),o=Ce(t),s=Vo(n),a=Ce(r??Uh),l=Be(nn({year:a,month:i,day:o}));rw(this,le(l,s))}static from(e,t=void 0){return Cd(Vy(e,t))}get calendarId(){return yt(Mn(this).calendar)}with(e,t=void 0){return Cd(xy(Mn(this),pi(e),t))}equals(e){return vg(Mn(this),Vy(e))}toPlainDate(e){let t=Mn(this);return Pt(_y(t.calendar,this,e))}toLocaleString(e=void 0,t={}){let n=Mn(this),r=new Mt(e,oi(qy(t)));return si(r,n,1),r.format(Do(n))}toString(e=void 0){return ed(Mn(this),e)}toJSON(){return ed(Mn(this))}valueOf(){return ln()}},Mn,Gy);function Cd(e){return rw(Object.create(nw.prototype),e)}function Mn(e){return Pa(e)||an()}function Pa(e){return tw.get(e)}function Vy(e,t){if(qe(e)){let r=Pa(e);if(r)return X(t),r;let i=gw(e);return Kg(i===void 0?it:i,i===void 0,e,t)}let n=oy(e,Ln);return X(t),n}function rw(e,t){return tw.set(e,t),sn(e),e}var iw=new WeakMap,ow=on(gd,class{constructor(e,t,n=void 0,r){let i=Ce(e),o=Ce(t),s=Vo(n),a=Ce(r??1),l=ya(nn({year:i,month:o,day:a}));sw(this,le(l,s))}static from(e,t=void 0){return Go(ci(e,t))}static compare(e,t){return yr(ci(e),ci(t))}get calendarId(){return yt(ut(this).calendar)}with(e,t=void 0){return Go(wy(ut(this),pi(e),t))}add(e,t=void 0){let n=ut(this);return Go(le(Ec(0,n.calendar,n,_e(e),t),n.calendar))}subtract(e,t=void 0){let n=ut(this);return Go(le(Ec(1,n.calendar,n,_e(e),t),n.calendar))}until(e,t=void 0){let n=ut(this),r=ci(e),i=rn(n.calendar,r.calendar);return be(Dc(0,i,n,r,t))}since(e,t=void 0){let n=ut(this),r=ci(e),i=rn(n.calendar,r.calendar);return be(Dc(1,i,n,r,t))}equals(e){return Dg(ut(this),ci(e))}toPlainDate(e){let t=ut(this);return Pt(Iy(t.calendar,this,e))}toLocaleString(e=void 0,t={}){let n=ut(this),r=new Mt(e,oi(By(t)));return si(r,n,1),r.format(Do(n))}toString(e=void 0){return Qc(ut(this),e)}toJSON(){return Qc(ut(this))}valueOf(){return ln()}},ut,Wy,Ed);function Go(e){return sw(Object.create(ow.prototype),e)}function ut(e){return La(e)||an()}function La(e){return iw.get(e)}function ci(e,t){if(qe(e)){let r=La(e);if(r)return X(t),r;let i=Yo(e);return Zg(i,e,t)}let n=iy(e,Ln);return X(t),n}function sw(e,t){return iw.set(e,t),sn(e),e}function NE(e){if(!qe(e))return;let t=Id(e);return t?[Sd,t]:(t=Lt(e),t?[kd,t]:(t=xr(e),t?[xd,t]:(t=fi(e),t?[wd,t]:(t=_d(e),t?[bd,t]:(t=La(e),t?[gd,t]:(t=Pa(e),t?[yd,t]:(t=Od(e),t?[Td,t]:void 0)))))))}function pi(e){return(NE(e)||e.calendar!==void 0||e.timeZone!==void 0)&&ne(ch),e}var aw=new WeakMap,lw=on(bd,class{constructor(e=0,t=0,n=0,r=0,i=0,o=0){let s=Oo(_n(Ce,{hour:e,minute:t,second:n,millisecond:r,microsecond:i,nanosecond:o}));uw(this,hr(s))}static from(e,t=void 0){return Pn(Nn(e,t))}static compare(e,t){return _a(Nn(e),Nn(t))}with(e,t=void 0){return Pn(by(kt(this),pi(e),t))}add(e){let t=kt(this);return Pn(Ta(t,_e(e))[0])}subtract(e){let t=kt(this);return Pn(Ta(t,Re(_e(e)))[0])}until(e,t=void 0){return be(vc(0,kt(this),Nn(e),t))}since(e,t=void 0){return be(vc(1,kt(this),Nn(e),t))}round(e){let t=kt(this),[n,r,i]=No(e,5);return Pn(xa(t,Qr(n,r),i)[0])}equals(e){return Rg(kt(this),Nn(e))}toLocaleString(e=void 0,t={}){let n=kt(this);return new Mt(e,oi(zy(t))).format(tc(n))}toString(e=void 0){return td(kt(this),e)}toJSON(){return td(kt(this))}valueOf(){return ln()}},kt,Io);function Pn(e){return uw(Object.create(lw.prototype),e)}function kt(e){return _d(e)||an()}function _d(e){return aw.get(e)}function Nn(e,t){if(qe(e)){let r=_d(e);if(r)return X(t),r;let i=xr(e);if(i)return X(t),hr(i);let o=Lt(e);return o?(X(t),md(o)):Jg(e,t)}let n=sy(e);return X(t),n}function Ad(e){return e===void 0?void 0:Nn(e)}function uw(e,t){return aw.set(e,t),sn(e),e}var cw=new WeakMap,dw=on(xd,class{constructor(e,t,n,r=0,i=0,o=0,s=0,a=0,l=0,u=void 0){let d=fr(Ro(_n(Ce,{year:e,month:t,day:n,hour:r,minute:i,second:o,millisecond:s,microsecond:a,nanosecond:l}))),c=Vo(u);mw(this,Rt(d,c))}static from(e,t=void 0){return Nt(di(e,t))}static compare(e,t){let n=di(e),r=di(t);return $c(n,r)}get calendarId(){return yt(Ie(this).calendar)}with(e,t=void 0){return Nt(gy(Ie(this),pi(e),t))}withCalendar(e){let t=Ie(this);return Nt(Rt(t,Fa(e)))}withPlainTime(e=void 0){let t=Ie(this);return Nt(Uo(t,Ad(e),t.calendar))}add(e,t=void 0){let n=Ie(this);return Nt(Rt(ur(n.calendar,n,_e(e),t),n.calendar))}subtract(e,t=void 0){let n=Ie(this);return Nt(Rt(ur(n.calendar,n,Re(_e(e)),t),n.calendar))}until(e,t=void 0){let n=Ie(this),r=di(e),i=rn(n.calendar,r.calendar);return be(Ac(0,i,n,r,t))}since(e,t=void 0){let n=Ie(this),r=di(e),i=rn(n.calendar,r.calendar);return be(Ac(1,i,n,r,t))}round(e){let t=Ie(this),[n,r,i]=No(e);return Nt(Rt(wa(t,Qr(n,r),i),t.calendar))}equals(e){return Ag(Ie(this),di(e))}toZonedDateTime(e,t=void 0){return We(Ey(Ie(this),He(ct(e)),t))}toPlainDate(){let e=Ie(this);return Pt(le(e,e.calendar))}toPlainTime(){return Pn(hr(Ie(this)))}toLocaleString(e=void 0,t={}){let n=Ie(this),r=new Mt(e,oi($y(t)));return si(r,n),r.format(Fh(n))}toString(e=void 0){return Jc(Ie(this),e)}toJSON(){return Jc(Ie(this))}valueOf(){return ln()}},Ie,Na,Ho,Io);function Nt(e){return mw(Object.create(dw.prototype),e)}function Ie(e){return xr(e)||an()}function xr(e){return cw.get(e)}function di(e,t){if(qe(e)){let r=xr(e);if(r)return X(t),r;let i=fi(e);if(i)return X(t),Rt(ie(i,ze),i.calendar);let o=Lt(e);if(o)return X(t),cd(o);let s=Yo(e);return Vg(s,e,t)}let n=ny(e,Ln);return X(t),n}function mw(e,t){return cw.set(e,t),sn(e),e}var pw=new WeakMap,fw=on(wd,class{constructor(e,t,n,r=void 0){let i=Be(nn(_n(Ce,{year:e,month:t,day:n}))),o=Vo(r);hw(this,le(i,o))}static from(e,t=void 0){return Pt(mi(e,t))}static compare(e,t){return yr(mi(e),mi(t))}get calendarId(){return yt(Me(this).calendar)}with(e,t=void 0){let n=Me(this);return Pt(yy(n,pi(e),t))}withCalendar(e){let t=Me(this);return Pt(le(t,Fa(e)))}add(e,t=void 0){let n=Me(this);return Pt(le(ni(n.calendar,n,_e(e),t),n.calendar))}subtract(e,t=void 0){let n=Me(this);return Pt(le(ni(n.calendar,n,Re(_e(e)),t),n.calendar))}until(e,t=void 0){let n=Me(this),r=mi(e),i=rn(n.calendar,r.calendar);return be(Oc(0,i,n,r,t))}since(e,t=void 0){let n=Me(this),r=mi(e),i=rn(n.calendar,r.calendar);return be(Oc(1,i,n,r,t))}equals(e){return Og(Me(this),mi(e))}toZonedDateTime(e){let t=qe(e)?{timeZone:e.timeZone,plainTime:e.plainTime}:{timeZone:e};return We(Cy(ct,Nn,Me(this),t))}toPlainDateTime(e=void 0){let t=Me(this);return Nt(Uo(t,Ad(e),t.calendar))}toPlainYearMonth(){let e=Me(this);return Go(Oy(e.calendar,this))}toPlainMonthDay(){let e=Me(this);return Cd(Ay(e.calendar,this))}toLocaleString(e=void 0,t={}){let n=Me(this),r=new Mt(e,oi(Uy(t)));return si(r,n),r.format(Do(n))}toString(e=void 0){return Xc(Me(this),e)}toJSON(){return Xc(Me(this))}valueOf(){return ln()}},Me,Na,Ho);function Pt(e){return hw(Object.create(fw.prototype),e)}function Me(e){return fi(e)||an()}function fi(e){return pw.get(e)}function mi(e,t){if(qe(e)){let r=fi(e);if(r)return X(t),r;let i=xr(e);if(i)return X(t),le(i,i.calendar);let o=Lt(e);if(o)return X(t),dd(o);let s=Yo(e);return Yg(s,e,t)}let n=ry(e,Ln);return X(t),n}function hw(e,t){return pw.set(e,t),sn(e),e}function Yo(e){let t=gw(e);return t===void 0?it:t}function gw(e){let{calendar:t}=e;if(t!==void 0)return Fa(t)}function Fa(e){if(qe(e)){let t=fi(e)||xr(e)||Lt(e)||Pa(e)||La(e);return t||ne(fh(e)),t.calendar}return(t=>Ln(ly(ve(t))))(e)}var yw=new WeakMap,ww=on(Td,class{constructor(e=0,t=0,n=0,r=0,i=0,o=0,s=0,a=0,l=0,u=0){let d=vn(_n(ha,{years:e,months:t,weeks:n,days:r,hours:i,minutes:o,seconds:s,milliseconds:a,microseconds:l,nanoseconds:u}));xw(this,Se(d))}static from(e){return be(_e(e))}static compare(e,t,n=void 0){return Cg(Wo,_e(e),_e(t),n)}get sign(){return Xe(this).sign}get blank(){return!Xe(this).sign}with(e){return be(ky(Xe(this),e))}negated(){return be(Lc(Xe(this)))}abs(){return be(Sg(Xe(this)))}add(e,t=void 0){return be(Pc(Wo,0,Xe(this),_e(e),t))}subtract(e,t=void 0){return be(Pc(Wo,1,Xe(this),_e(e),t))}round(e){return be(kg(Wo,Xe(this),e))}total(e){return og(Wo,Xe(this),e)}toLocaleString(e=void 0,t){let n=Xe(this);return Intl.DurationFormat?new Intl.DurationFormat(e,t).format(n):Da(n,t)}toString(e=void 0){return Da(Xe(this),e)}toJSON(){return Da(Xe(this))}valueOf(){return ln()}},Xe,lc);function be(e){return xw(Object.create(ww.prototype),e)}function Xe(e){return Od(e)||an()}function Od(e){return yw.get(e)}function _e(e){return qe(e)?Od(e)||Xg(e):ay(e)}function Wo(e){if(e!==void 0){if(qe(e)){let t=Lt(e);if(t)return t;let n=fi(e);if(n)return n;let r=xr(e);if(r)return le(r,r.calendar);let i=Yo(e);return Wg(ct,i,e)}return ey(e,Ln)}}function xw(e,t){return yw.set(e,t),sn(e),e}var PE=Object.defineProperties({},{...bo("Temporal.Now"),...oa({timeZoneId(){return ai()},instant(){return un(st(Ma()))},zonedDateTimeISO(e=ai()){let t=He(ct(e));return We(bt(Ma(),t))},plainDateTimeISO(e=ai()){let t=Ra(He(ct(e)));return Nt(Rt(t))},plainDateISO(e=ai()){let t=Ra(He(ct(e)));return Pt(le(t))},plainTimeISO(e=ai()){let t=Ra(He(ct(e)));return Pn(hr(t))}})}),bw=Object.defineProperties({},{...bo("Temporal"),...oa({PlainYearMonth:ow,PlainMonthDay:nw,PlainDate:fw,PlainTime:lw,PlainDateTime:dw,ZonedDateTime:Zy,Instant:Xy,Duration:ww,Now:PE})});var Zo=Su||bw;var uL=Su?Date.prototype.toTemporalInstant:Qy;var LE=120,Dd=365*24*60*60*1e3;var kw=/^[\s,.;:!?()[\]{}]*$/u;function Ae(e){return{ok:!1,reason:e}}function FE(e){let t=e.now instanceof Date?e.now.getTime():Number.NaN;if(!Number.isFinite(t))return Ae("invalid_reference_time");let n=typeof e.timeZone=="string"?e.timeZone.trim():"";if(n.length===0)return Ae("invalid_time_zone");try{new Intl.DateTimeFormat("en-US",{timeZone:n}).format(e.now);let r=Zo.Instant.fromEpochMilliseconds(t),i=r.toZonedDateTimeISO(n);return{nowMs:t,timeZone:n,nowInstant:r,nowZoned:i}}catch{return Ae("invalid_time_zone")}}function $E(e){return"ok"in e&&e.ok===!1}function br(e,t=2){return String(e).padStart(t,"0")}function UE(e){return[`${br(e.year,4)}-${br(e.month)}-${br(e.day)}`,`${br(e.hour)}:${br(e.minute)}:${br(e.second)}.${br(e.millisecond,3)}`].join("T")}function zE(e){let t=Number(e.instant.epochMilliseconds);if(t<=e.context.nowMs)return Ae("time_in_past");if(t-e.context.nowMs>Dd)return Ae("time_too_far");let n=e.instant.toZonedDateTimeISO(e.context.timeZone);return{ok:!0,schedule:{returnAt:new Date(t).toISOString(),timeZone:e.context.timeZone,localDateTime:UE(n),source:e.source,...e.preset?{preset:e.preset}:{},...e.matchedText?{matchedText:e.matchedText}:{}}}}function BE(e,t,n){let r=e.slice(0,t),i=e.slice(t+n.length);return kw.test(r)&&kw.test(i)}function Ft(e,t){let n=e.get(t);if(n==null)throw new RangeError(`Missing parsed ${t}`);return n}function qE(e,t){let n;try{n=Zo.PlainDateTime.from({year:Ft(e.start,"year"),month:Ft(e.start,"month"),day:Ft(e.start,"day"),hour:Ft(e.start,"hour"),minute:Ft(e.start,"minute"),second:Ft(e.start,"second"),millisecond:Ft(e.start,"millisecond")},{overflow:"reject"})}catch{return null}try{return n.toZonedDateTime(t.timeZone,{disambiguation:"reject"}).toInstant()}catch{return null}}function jE(e,t){let n=Ft(e.start,"year"),r=Ft(e.start,"month"),i=Ft(e.start,"day"),o=n===t.nowZoned.year&&r===t.nowZoned.month&&i===t.nowZoned.day;if(o&&t.nowZoned.hour>=23)return"no_time_left_today";let s=o?t.nowZoned.hour+1:t.nowZoned.hour,a=o?0:t.nowZoned.minute;try{return Zo.PlainDateTime.from({year:n,month:r,day:i,hour:s,minute:a,second:0,millisecond:0},{overflow:"reject"}).toZonedDateTime(t.timeZone,{disambiguation:"reject"}).toInstant()}catch{return null}}function HE(e,t){let n=Number(t.nowZoned.offsetNanoseconds)/6e10;return Gs.casual.parse(e,{instant:new Date(t.nowMs),timezone:n},{forwardDate:!0})}function Sw(e,t){let n=typeof e=="string"?e.trim():"";if(n.length===0)return Ae("empty");if(n.length>LE)return Ae("input_too_long");let r=FE(t);if($E(r))return r;let i=HE(n,r);if(i.length===0)return Ae("not_recognized");if(i.length>1)return Ae("multiple_results");let o=i[0];if(o.end)return Ae("range_not_supported");if(!BE(n,o.index,o.text))return Ae("partial_match");let s=o.tags(),a=s.has("result/relativeDateAndTime"),l=s.has("result/relativeDate"),u=s.has("parser/ENCasualTimeParser"),d=!o.start.isCertain("hour")&&!u&&!l&&!a;if(o.start.isCertain("timezoneOffset")&&!a)return Ae("explicit_time_zone_not_supported");if(o.start.isCertain("hour")&&!o.start.isCertain("meridiem")&&!u&&!l&&!a)return Ae("meridiem_required");let c;if(d){let m=jE(o,r);if(m==="no_time_left_today")return Ae("no_time_left_today");if(!m)return Ae("clock_change_time");c=m}else if(a){let m=o.date();if(!Number.isFinite(m.getTime()))return Ae("not_recognized");c=Zo.Instant.fromEpochMilliseconds(m.getTime())}else{let m=qE(o,r);if(!m)return Ae("clock_change_time");c=m}return zE({instant:c,context:r,source:"natural_language",matchedText:o.text})}var VE=[{name:"read",description:"Mark messages read.",done:"Marked {n} read"},{name:"unread",description:"Mark messages unread.",done:"Marked {n} unread"},{name:"archive",description:"Archive messages.",done:"Archived {n}"},{name:"unarchive",description:"Move messages out of the archive.",done:"Unarchived {n}"},{name:"trash",description:"Move messages to the trash.",done:"Moved {n} to the trash",unchanged:"already in the trash"}],Tw=["all","archive","snoozed"];function Iw(e,t){let{display:n}=t,r=kr(e,"messages","Read, search, and organize messages.").example("ripple messages","ripple messages --unread","ripple messages search invoice","ripple messages archive msg_06gp035p55zrz46e msg_06gjy0yyqzns5kta","ripple messages image img_06gh9kxn7m5q0ynq"),i=r.command("list").description("List messages, most recently updated first, or with --in snoozed, soonest to return. Plain `ripple messages` does the same.").summary("List messages").addOption(Ze("--in <view>","Where to look; all, the default, leaves out archived and snoozed messages",Tw)).addOption(ue("-s, --source <source>","Only this source's messages, by name or ID"));for(let a of gl())i.addOption(a);i.addOption(qn("messages",_i)).addOption(jn()).addOption(Hn()).example("ripple messages list --in snoozed","ripple messages list --source inbox --unread","ripple messages list --source Deploys --in archive --all").action(async a=>{let[l]=await Vt(t,a.source)??[],u=yl(a),d=mn(a,c=>H("GET","/v1/messages",{query:{in:a.in,sourceId:l,unread:u?.toString(),...c}}));await t.runEach(d,c=>Ci(n,c.flatMap(m=>m.items).map(m=>vd(m,n)),YE(a.in,u),[cs(c)]))}),r.command("watch").description("Show each new message as it arrives, until you stop it with Control-C. If the connection drops, it reconnects and catches up.").summary("Show new messages as they arrive").addOption(ue("-s, --source <source>","Only this source's messages, by name or ID")).example("ripple messages watch","ripple messages watch --source inbox",`ripple messages watch --json | jq --unbuffered -r 'select(.alert == "important") | .title'`).action(async a=>{let[l]=await Vt(t,a.source)??[];t.hint("Watching for new messages. Press Control-C to stop.");let u=0;await t.watch(H("GET","/v1/messages/stream",{query:{sourceId:l}}),({event:d,data:c})=>{d==="message"&&t.print(JSON.parse(c),({images:m,...p})=>{let f=m?.length?{imageId:m[0].id,count:m.length}:void 0;return`${u++?`
|
|
68
|
-
`:""}${
|
|
69
|
-
`})})}),r.command("get").description("Show a message in full.").argument("<id>").action(async a=>{await t.run(
|
|
70
|
-
`)});let o=r.command("search").description("Search your messages. With no words, it lists every message the filters allow, newest first.").summary("Search messages").argument("[words...]").addOption(Ze("--in <view>","Where to look; without it, everywhere except the trash",
|
|
71
|
-
`)}catch(m){let p=d.slice(c+1).flat().length;throw p?new
|
|
67
|
+
reference: ${JSON.stringify(this.reference)}]`}date(){let t=this.get("timezoneOffset")??this.reference.timezoneOffset;if(t==null)return this.dateWithoutTimezoneAdjustment();let n=new Date(Date.UTC(this.get("year"),this.get("month")-1,this.get("day"),this.get("hour"),this.get("minute"),this.get("second"),this.get("millisecond")));return n.setUTCFullYear(this.get("year")),new Date(n.getTime()-t*6e4)}addTag(t){return this._tags.add(t),this}addTags(t){for(let n of t)this._tags.add(n);return this}tags(){return new Set(this._tags)}dateWithoutTimezoneAdjustment(){let t=new Date(this.get("year"),this.get("month")-1,this.get("day"),this.get("hour"),this.get("minute"),this.get("second"),this.get("millisecond"));return t.setFullYear(this.get("year")),t}},ft=class e{refDate;index;text;reference;start;end;constructor(t,n,r,i,o){this.reference=t,this.refDate=t.instant,this.index=n,this.text=r,this.start=i||new W(t),this.end=o}clone(){let t=new e(this.reference,this.index,this.text);return t.start=this.start?this.start.clone():null,t.end=this.end?this.end.clone():null,t}date(){return this.start.date()}addTag(t){return this.start.addTag(t),this.end&&this.end.addTag(t),this}addTags(t){return this.start.addTags(t),this.end&&this.end.addTags(t),this}tags(){let t=new Set(this.start.tags());if(this.end)for(let n of this.end.tags())t.add(n);return t}toString(){let t=Array.from(this.tags()).sort();return`[ParsingResult {index: ${this.index}, text: '${this.text}', tags: ${JSON.stringify(t)} ...}]`}};function xu(e,t,n="\\s{0,5},?\\s{0,5}"){let r=t.replace(/\((?!\?)/g,"(?:");return`${e}${r}(?:${n}${r}){0,10}`}function uT(e){let t;return e instanceof Array?t=[...e]:e instanceof Map?t=Array.from(e.keys()):t=Object.keys(e),t}function ge(e){return`(?:${uT(e).sort((n,r)=>r.length-n.length).join("|").replace(/\./g,"\\.")})`}function qs(e){return e<100&&(e>50?e=e+1900:e=e+2e3),e}function xn(e,t,n){let r=new Date(e);r.setMonth(n-1),r.setDate(t);let i=ke(r,{year:1}),o=ke(r,{year:-1});return Math.abs(i.getTime()-e.getTime())<Math.abs(r.getTime()-e.getTime())?r=i:Math.abs(o.getTime()-e.getTime())<Math.abs(r.getTime()-e.getTime())&&(r=o),r.getFullYear()}var js={sunday:0,sun:0,"sun.":0,monday:1,mon:1,"mon.":1,tuesday:2,tue:2,"tue.":2,wednesday:3,wed:3,"wed.":3,thursday:4,thurs:4,"thurs.":4,thur:4,"thur.":4,thu:4,"thu.":4,friday:5,fri:5,"fri.":5,saturday:6,sat:6,"sat.":6},Su={january:1,february:2,march:3,april:4,may:5,june:6,july:7,august:8,september:9,october:10,november:11,december:12},Fe={...Su,jan:1,"jan.":1,feb:2,"feb.":2,mar:3,"mar.":3,apr:4,"apr.":4,jun:6,"jun.":6,jul:7,"jul.":7,aug:8,"aug.":8,sep:9,"sep.":9,sept:9,"sept.":9,oct:10,"oct.":10,nov:11,"nov.":11,dec:12,"dec.":12},bu={one:1,two:2,three:3,four:4,five:5,six:6,seven:7,eight:8,nine:9,ten:10,eleven:11,twelve:12},ku={first:1,second:2,third:3,fourth:4,fifth:5,sixth:6,seventh:7,eighth:8,ninth:9,tenth:10,eleventh:11,twelfth:12,thirteenth:13,fourteenth:14,fifteenth:15,sixteenth:16,seventeenth:17,eighteenth:18,nineteenth:19,twentieth:20,"twenty first":21,"twenty-first":21,"twenty second":22,"twenty-second":22,"twenty third":23,"twenty-third":23,"twenty fourth":24,"twenty-fourth":24,"twenty fifth":25,"twenty-fifth":25,"twenty sixth":26,"twenty-sixth":26,"twenty seventh":27,"twenty-seventh":27,"twenty eighth":28,"twenty-eighth":28,"twenty ninth":29,"twenty-ninth":29,thirtieth:30,"thirty first":31,"thirty-first":31},Tf={second:"second",seconds:"second",minute:"minute",minutes:"minute",hour:"hour",hours:"hour",day:"day",days:"day",week:"week",weeks:"week",month:"month",months:"month",quarter:"quarter",quarters:"quarter",year:"year",years:"year"},zi={s:"second",sec:"second",second:"second",seconds:"second",m:"minute",min:"minute",mins:"minute",minute:"minute",minutes:"minute",h:"hour",hr:"hour",hrs:"hour",hour:"hour",hours:"hour",d:"day",day:"day",days:"day",w:"week",week:"week",weeks:"week",mo:"month",mon:"month",mos:"month",month:"month",months:"month",qtr:"quarter",quarter:"quarter",quarters:"quarter",y:"year",yr:"year",year:"year",years:"year",...Tf},Ef=`(?:${ge(bu)}|[0-9]+|[0-9]+\\.[0-9]+|half(?:\\s{0,2}an?)?|an?\\b(?:\\s{0,2}few)?|few|several|the|a?\\s{0,2}couple\\s{0,2}(?:of)?)`;function cT(e){let t=e.toLowerCase();return bu[t]!==void 0?bu[t]:t==="a"||t==="an"||t=="the"?1:t.match(/few/)?3:t.match(/half/)?.5:t.match(/couple/)?2:t.match(/several/)?7:parseFloat(t)}var Lr=`(?:${ge(ku)}|[0-9]{1,2}(?:st|nd|rd|th)?)`;function Fr(e){let t=e.toLowerCase();return ku[t]!==void 0?ku[t]:(t=t.replace(/(?:st|nd|rd|th)$/i,""),parseInt(t))}var bn="(?:[1-9][0-9]{0,3}\\s{0,2}(?:BE|AD|BC|BCE|CE)|[1-9][0-9]{3}|[0-9]{2}(?!\\w|:\\d|\\s+(?:am|pm|o\\s*clock|jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)))";function At(e){if(/BE/i.test(e))return e=e.replace(/BE/i,""),parseInt(e)-543;if(/BCE?/i.test(e))return e=e.replace(/BCE?/i,""),-parseInt(e);if(/(AD|CE)/i.test(e))return e=e.replace(/(AD|CE)/i,""),parseInt(e);let t=parseInt(e);return qs(t)}var Cf=`(${Ef})\\s{0,3}(${ge(zi)})`,Sf=new RegExp(Cf,"i"),dT=`(${Ef})\\s{0,3}(${ge(Tf)})`,If="\\s{0,5},?(?:\\s*and)?\\s{0,5}",Xt=xu("(?:(?:about|around)\\s{0,3})?",Cf,If),kn=xu("(?:(?:about|around)\\s{0,3})?",dT,If);function tt(e){let t={},n=e,r=Sf.exec(n);for(;r;)mT(t,r),n=n.substring(r[0].length).trim(),r=Sf.exec(n);return Object.keys(t).length==0?null:t}function mT(e,t){if(t[0].match(/^[a-zA-Z]+$/))return;let n=cT(t[1]),r=zi[t[2].toLowerCase()];e[r]=n}var V=class{innerPatternHasChange(t,n){return this.innerPattern(t)!==n}patternLeftBoundary(){return"(\\W|^)"}cachedInnerPattern=null;cachedPattern=null;pattern(t){return this.cachedInnerPattern&&!this.innerPatternHasChange(t,this.cachedInnerPattern)?this.cachedPattern:(this.cachedInnerPattern=this.innerPattern(t),this.cachedPattern=new RegExp(`${this.patternLeftBoundary()}${this.cachedInnerPattern.source}`,this.cachedInnerPattern.flags),this.cachedPattern)}extract(t,n){let r=n[1]??"";n.index=n.index+r.length,n[0]=n[0].substring(r.length);for(let i=2;i<n.length;i++)n[i-1]=n[i];return this.innerExtract(t,n)}};var pT=new RegExp(`(?:(?:within|in|for)\\s*)?(?:(?:about|around|roughly|approximately|just)\\s*(?:~\\s*)?)?(${Xt})(?=\\W|$)`,"i"),fT=new RegExp(`(?:within|in|for)\\s*(?:(?:about|around|roughly|approximately|just)\\s*(?:~\\s*)?)?(${Xt})(?=\\W|$)`,"i"),hT=new RegExp(`(?:within|in|for)\\s*(?:(?:about|around|roughly|approximately|just)\\s*(?:~\\s*)?)?(${kn})(?=\\W|$)`,"i"),Bi=class extends V{strictMode;constructor(t){super(),this.strictMode=t}innerPattern(t){return this.strictMode?hT:t.option.forwardDate?pT:fT}innerExtract(t,n){if(n[0].match(/^for\s*the\s*\w+/))return null;let r=tt(n[1]);return r?W.createRelativeFromReference(t.reference,r):null}};var gT=new RegExp(`(?:on\\s{0,3})?(${Lr})(?:\\s{0,3}(?:to|\\-|\\\u2013|until|through|till)\\s{0,3}(${Lr}))?(?:-|/|\\s{0,3}(?:of)?\\s{0,3})(${ge(Fe)})(?:(?:-|/|,?\\s{0,3})(${bn}(?!\\w)))?(?=\\W|$)`,"i"),_f=1,Af=2,yT=3,Of=4,qi=class extends V{innerPattern(){return gT}innerExtract(t,n){let r=t.createParsingResult(n.index,n[0]),i=Fe[n[yT].toLowerCase()],o=Fr(n[_f]);if(o>31)return n.index=n.index+n[_f].length,null;if(r.start.assign("month",i),r.start.assign("day",o),n[Of]){let s=At(n[Of]);r.start.assign("year",s)}else{let s=xn(t.refDate,o,i);r.start.imply("year",s)}if(n[Af]){let s=Fr(n[Af]);r.end=r.start.clone(),r.end.assign("day",s)}return r}};var wT=new RegExp(`(${ge(Fe)})(?:-|/|\\s*,?\\s*)(${Lr})(?!\\s*(?:am|pm))\\s*(?:(?:to|\\-)\\s*(${Lr})\\s*)?(?:(?:-|/|\\s*,\\s*|\\s+)(${bn}))?(?=\\W|$)(?!\\:\\d)`,"i"),xT=1,Df=2,Tu=3,Eu=4,ji=class extends V{shouldSkipYearLikeDate;constructor(t){super(),this.shouldSkipYearLikeDate=t}innerPattern(){return wT}innerExtract(t,n){let r=Fe[n[xT].toLowerCase()],i=Fr(n[Df]);if(i>31||this.shouldSkipYearLikeDate&&!n[Tu]&&!n[Eu]&&n[Df].match(/^\d{2}$/))return null;let o=t.createParsingComponents({day:i,month:r}).addTag("parser/ENMonthNameMiddleEndianParser");if(n[Eu]){let l=At(n[Eu]);o.assign("year",l)}else{let l=xn(t.refDate,i,r);o.imply("year",l)}if(!n[Tu])return o;let s=Fr(n[Tu]),a=t.createParsingResult(n.index,n[0]);return a.start=o,a.end=o.clone(),a.end.assign("day",s),a}};var bT=new RegExp(`((?:in)\\s*)?(${ge(Fe)})\\s*(?:(?:,|-|of)?\\s*(${bn})?)?(?=[^\\s\\w]|\\s+[^0-9]|\\s+$|$)`,"i"),kT=1,ST=2,vf=3,Hi=class extends V{innerPattern(){return bT}innerExtract(t,n){let r=n[ST].toLowerCase();if(n[0].length<=3&&!Su[r])return null;let i=t.createParsingResult(n.index+(n[kT]||"").length,n.index+n[0].length);i.start.imply("day",1),i.start.addTag("parser/ENMonthNameParser");let o=Fe[r];if(i.start.assign("month",o),n[vf]){let s=At(n[vf]);i.start.assign("year",s)}else{let s=xn(t.refDate,1,o);i.start.imply("year",s)}return i}};var TT=new RegExp(`([0-9]{4})[-\\.\\/\\s](?:(${ge(Fe)})|([0-9]{1,2}))[-\\.\\/\\s]([0-9]{1,2})(?=\\W|$)`,"i"),ET=1,CT=2,Mf=3,IT=4,Wi=class extends V{strictMonthDateOrder;constructor(t){super(),this.strictMonthDateOrder=t}innerPattern(){return TT}innerExtract(t,n){let r=parseInt(n[ET]),i=parseInt(n[IT]),o=n[Mf]?parseInt(n[Mf]):Fe[n[CT].toLowerCase()];if(o<1||o>12){if(this.strictMonthDateOrder)return null;i>=1&&i<=12&&([o,i]=[i,o])}return i<1||i>31?null:{day:i,month:o,year:r}}};var _T="(?:[1-9][0-9]{0,3}\\s{0,2}(?:BE|AD|BC|BCE|CE)|[1-9][0-9]{3})",AT=new RegExp(`(${_T})(?:\\s*[-.\\/,]?\\s*|\\s+of\\s+)(${ge(Fe)})(?=[^\\s\\w]|\\s+[^0-9]|\\s+$|$)`,"i"),OT=1,DT=2,Gi=class extends V{innerPattern(){return AT}innerExtract(t,n){let r=At(n[OT]),i=n[DT].toLowerCase(),o=Fe[i],s=t.createParsingResult(n.index,n[0]);return s.start.imply("day",1),s.start.assign("month",o),s.start.assign("year",r),s.start.addTag("parser/ENYearMonthNameParser"),s}};var vT=new RegExp("([0-9]|0[1-9]|1[012])/([0-9]{4})","i"),MT=1,RT=2,Vi=class extends V{innerPattern(){return vT}innerExtract(t,n){let r=parseInt(n[RT]),i=parseInt(n[MT]);return t.createParsingComponents().imply("day",1).assign("month",i).assign("year",r)}};function NT(e,t,n,r){return new RegExp(`${e}${t}(\\d{1,4})(?:(?:\\.|:|\uFF1A)(\\d{1,2})(?:(?::|\uFF1A)(\\d{2})(?:\\.(\\d{1,6}))?)?)?(?:\\s*(a\\.m\\.|p\\.m\\.|am?|pm?))?${n}`,r)}function PT(e,t){return new RegExp(`^(${e})(\\d{1,4})(?:(?:\\.|\\:|\\\uFF1A)(\\d{1,2})(?:(?:\\.|\\:|\\\uFF1A)(\\d{1,2})(?:\\.(\\d{1,6}))?)?)?(?:\\s*(a\\.m\\.|p\\.m\\.|am?|pm?))?${t}`,"i")}var Cu=2,Xn=3,Hs=4,Ws=5,$r=6,Gs=class{strictMode;constructor(t=!1){this.strictMode=t}patternFlags(){return"i"}primaryPatternLeftBoundary(){return"(^|\\s|T|\\b)"}primarySuffix(){return"(?!/)(?=\\W|$)"}followingSuffix(){return"(?!/)(?=\\W|$)"}pattern(t){return this.getPrimaryTimePatternThroughCache()}extract(t,n){let r=this.extractPrimaryTimeComponents(t,n);if(!r)return n[0].match(/^\d{4}/)?(n.index+=4,null):(n.index+=n[0].length,null);let i=n.index+n[1].length,o=n[0].substring(n[1].length),s=t.createParsingResult(i,o,r);n.index+=n[0].length;let a=t.text.substring(n.index),u=this.getFollowingTimePatternThroughCache().exec(a);return o.match(/^\d{3,4}/)&&u&&(u[0].match(/^\s*([+-])\s*\d{2,4}$/)||u[0].match(/^\s*([+-])\s*\d{2}\W\d{2}/))?null:!u||u[0].match(/^\s*([+-])\s*\d{3,4}$/)?this.checkAndReturnWithoutFollowingPattern(s):(s.end=this.extractFollowingTimeComponents(t,u,s),s.end&&(s.text+=u[0]),this.checkAndReturnWithFollowingPattern(s))}extractPrimaryTimeComponents(t,n,r=!1){let i=t.createParsingComponents(),o=0,s=null,a=parseInt(n[Cu]);if(a>100){if(n[Cu].length==4&&n[Xn]==null&&!n[$r]||this.strictMode||n[Xn]!=null)return null;o=a%100,a=Math.floor(a/100)}if(a>24)return null;if(n[Xn]!=null){if(n[Xn].length==1&&!n[$r])return null;o=parseInt(n[Xn])}if(o>=60)return null;if(a>12&&(s=j.PM),n[$r]!=null){if(a>12)return null;let l=n[$r][0].toLowerCase();l=="a"&&(s=j.AM,a==12&&(a=0)),l=="p"&&(s=j.PM,a!=12&&(a+=12))}if(i.assign("hour",a),i.assign("minute",o),s!==null?i.assign("meridiem",s):a<12?i.imply("meridiem",j.AM):i.imply("meridiem",j.PM),n[Ws]!=null){let l=parseInt(n[Ws].substring(0,3));if(l>=1e3)return null;i.assign("millisecond",l)}if(n[Hs]!=null){let l=parseInt(n[Hs]);if(l>=60)return null;i.assign("second",l)}return i}extractFollowingTimeComponents(t,n,r){let i=t.createParsingComponents();if(n[Ws]!=null){let l=parseInt(n[Ws].substring(0,3));if(l>=1e3)return null;i.assign("millisecond",l)}if(n[Hs]!=null){let l=parseInt(n[Hs]);if(l>=60)return null;i.assign("second",l)}let o=parseInt(n[Cu]),s=0,a=-1;if(n[Xn]!=null?s=parseInt(n[Xn]):o>100&&(s=o%100,o=Math.floor(o/100)),s>=60||o>24)return null;if(o>=12&&(a=j.PM),n[$r]!=null){if(o>12)return null;let l=n[$r][0].toLowerCase();l=="a"&&(a=j.AM,o==12&&(o=0,i.isCertain("day")||i.imply("day",i.get("day")+1))),l=="p"&&(a=j.PM,o!=12&&(o+=12)),r.start.isCertain("meridiem")||(a==j.AM?(r.start.imply("meridiem",j.AM),r.start.get("hour")==12&&r.start.assign("hour",0)):(r.start.imply("meridiem",j.PM),r.start.get("hour")!=12&&r.start.assign("hour",r.start.get("hour")+12)))}return i.assign("hour",o),i.assign("minute",s),a>=0?i.assign("meridiem",a):r.start.isCertain("meridiem")&&r.start.get("hour")>12?r.start.get("hour")-12>o?i.imply("meridiem",j.AM):o<=12&&(i.assign("hour",o+12),i.assign("meridiem",j.PM)):o>12?i.imply("meridiem",j.PM):o<=12&&i.imply("meridiem",j.AM),i.date().getTime()<r.start.date().getTime()&&i.imply("day",i.get("day")+1),i}checkAndReturnWithoutFollowingPattern(t){if(t.text.match(/^\d$/)||t.text.match(/^\d\d\d+$/)||t.text.match(/\d[apAP]$/))return null;let n=t.text.match(/[^\d:.](\d[\d.]+)$/);if(n){let r=n[1];if(this.strictMode||r.includes(".")&&!r.match(/\d(\.\d{2})+$/)||parseInt(r)>24)return null}return t}checkAndReturnWithFollowingPattern(t){if(t.text.match(/^\d+-\d+$/))return null;let n=t.text.match(/[^\d:.](\d[\d.]+)\s*-\s*(\d[\d.]+)$/);if(n){if(this.strictMode)return null;let r=n[1],i=n[2];if(i.includes(".")&&!i.match(/\d(\.\d{2})+$/))return null;let o=parseInt(i),s=parseInt(r);if(o>24||s>24)return null}return t}cachedPrimaryPrefix=null;cachedPrimarySuffix=null;cachedPrimaryTimePattern=null;getPrimaryTimePatternThroughCache(){let t=this.primaryPrefix(),n=this.primarySuffix();return this.cachedPrimaryPrefix===t&&this.cachedPrimarySuffix===n?this.cachedPrimaryTimePattern:(this.cachedPrimaryTimePattern=NT(this.primaryPatternLeftBoundary(),t,n,this.patternFlags()),this.cachedPrimaryPrefix=t,this.cachedPrimarySuffix=n,this.cachedPrimaryTimePattern)}cachedFollowingPhase=null;cachedFollowingSuffix=null;cachedFollowingTimePatten=null;getFollowingTimePatternThroughCache(){let t=this.followingPhase(),n=this.followingSuffix();return this.cachedFollowingPhase===t&&this.cachedFollowingSuffix===n?this.cachedFollowingTimePatten:(this.cachedFollowingTimePatten=PT(t,n),this.cachedFollowingPhase=t,this.cachedFollowingSuffix=n,this.cachedFollowingTimePatten)}};var Yi=class extends Gs{constructor(t){super(t)}followingPhase(){return"\\s*(?:\\-|\\\u2013|\\~|\\\u301C|to|until|through|till|\\?)\\s*"}primaryPrefix(){return"(?:(?:at|from)\\s*)??"}primarySuffix(){return"(?:\\s*(?:o\\W*clock|at\\s*night|in\\s*the\\s*(?:morning|afternoon)))?(?!/)(?=\\W|$)"}extractPrimaryTimeComponents(t,n){let r=super.extractPrimaryTimeComponents(t,n);if(!r)return r;if(n[0].endsWith("night")){let i=r.get("hour");i>=6&&i<12?(r.assign("hour",r.get("hour")+12),r.assign("meridiem",j.PM)):i<6&&r.assign("meridiem",j.AM)}if(n[0].endsWith("afternoon")){r.assign("meridiem",j.PM);let i=r.get("hour");i>=0&&i<=6&&r.assign("hour",r.get("hour")+12)}return n[0].endsWith("morning")&&(r.assign("meridiem",j.AM),r.get("hour")<12&&r.assign("hour",r.get("hour"))),r.addTag("parser/ENTimeExpressionParser")}extractFollowingTimeComponents(t,n,r){let i=super.extractFollowingTimeComponents(t,n,r);return i&&i.addTag("parser/ENTimeExpressionParser"),i}};var LT=new RegExp(`(${Xt})\\s{0,5}(?:ago|before|earlier)(?=\\W|$)`,"i"),FT=new RegExp(`(${kn})\\s{0,5}(?:ago|before|earlier)(?=\\W|$)`,"i"),Zi=class extends V{strictMode;constructor(t){super(),this.strictMode=t}innerPattern(){return this.strictMode?FT:LT}innerExtract(t,n){let r=tt(n[1]);return r?W.createRelativeFromReference(t.reference,wn(r)):null}};var $T=new RegExp(`(${Xt})\\s{0,5}(?:later|after|from now|henceforth|forward|out)(?=(?:\\W|$))`,"i"),UT=new RegExp(`(${kn})\\s{0,5}(later|after|from now)(?=\\W|$)`,"i"),zT=1,Ki=class extends V{strictMode;constructor(t){super(),this.strictMode=t}innerPattern(){return this.strictMode?UT:$T}innerExtract(t,n){let r=tt(n[zT]);return r?W.createRelativeFromReference(t.reference,r):null}};var Ur=class{refine(t,n){return n.filter(r=>this.isValid(t,r))}},nt=class{refine(t,n){if(n.length<2)return n;let r=[],i=n[0],o=null;for(let s=1;s<n.length;s++){o=n[s];let a=t.text.substring(i.index+i.text.length,o.index);if(!this.shouldMergeResults(a,i,o,t))r.push(i),i=o;else{let l=i,u=o,d=this.mergeResults(a,l,u,t);t.debug(()=>{console.log(`${this.constructor.name} merged ${l} and ${u} into ${d}`)}),i=d}}return i!=null&&r.push(i),r}};var Ji=class extends nt{shouldMergeResults(t,n,r){return!n.end&&!r.end&&t.match(this.patternBetween())!=null}mergeResults(t,n,r){if(!n.start.isOnlyWeekdayComponent()&&!r.start.isOnlyWeekdayComponent()&&(r.start.getCertainComponents().forEach(o=>{n.start.isCertain(o)||n.start.imply(o,r.start.get(o))}),n.start.getCertainComponents().forEach(o=>{r.start.isCertain(o)||r.start.imply(o,n.start.get(o))})),n.start.date()>r.start.date()){let o=n.start.date(),s=r.start.date();r.start.isOnlyWeekdayComponent()&&ke(s,{day:7})>o?(s=ke(s,{day:7}),r.start.imply("day",s.getDate()),r.start.imply("month",s.getMonth()+1),r.start.imply("year",s.getFullYear())):n.start.isOnlyWeekdayComponent()&&ke(o,{day:-7})<s?(o=ke(o,{day:-7}),n.start.imply("day",o.getDate()),n.start.imply("month",o.getMonth()+1),n.start.imply("year",o.getFullYear())):r.start.isDateWithUnknownYear()&&ke(s,{year:1})>o?(s=ke(s,{year:1}),r.start.imply("year",s.getFullYear())):n.start.isDateWithUnknownYear()&&ke(o,{year:-1})<s?(o=ke(o,{year:-1}),n.start.imply("year",o.getFullYear())):[r,n]=[n,r]}let i=n.clone();return i.start=n.start,i.end=r.start,i.index=Math.min(n.index,r.index),n.index<r.index?i.text=n.text+t+r.text:i.text=r.text+t+n.text,i}};var Xi=class extends Ji{patternBetween(){return/^\s*(to|-|–|until|through|till)\s*$/i}};function Iu(e,t){let n=e.clone(),r=e.start,i=t.start;if(n.start=Rf(r,i),e.end!=null||t.end!=null){let o=e.end==null?e.start:e.end,s=t.end==null?t.start:t.end,a=Rf(o,s);if(e.end==null&&a.date().getTime()<n.start.date().getTime()){let l=new Date(a.date().getTime());l.setDate(l.getDate()+1),a.isCertain("day")?pt(a,l):Jt(a,l)}n.end=a}return n}function Rf(e,t){let n=e.clone();t.isCertain("hour")?(n.assign("hour",t.get("hour")),n.assign("minute",t.get("minute")),t.isCertain("second")?(n.assign("second",t.get("second")),t.isCertain("millisecond")?n.assign("millisecond",t.get("millisecond")):n.imply("millisecond",t.get("millisecond"))):(n.imply("second",t.get("second")),n.imply("millisecond",t.get("millisecond")))):(n.imply("hour",t.get("hour")),n.imply("minute",t.get("minute")),n.imply("second",t.get("second")),n.imply("millisecond",t.get("millisecond"))),t.isCertain("timezoneOffset")&&n.assign("timezoneOffset",t.get("timezoneOffset"));let r=e.get("meridiem")!=null&&(e.isCertain("meridiem")||Array.from(e.tags()).some(i=>i.startsWith("casualReference/")));return t.isCertain("meridiem")?n.assign("meridiem",t.get("meridiem")):t.get("meridiem")!=null&&!r&&n.imply("meridiem",t.get("meridiem")),n.get("meridiem")==j.PM&&n.get("hour")<12&&(t.isCertain("hour")?n.assign("hour",n.get("hour")+12):n.imply("hour",n.get("hour")+12)),n.addTags(e.tags()),n.addTags(t.tags()),n}var Qi=class extends nt{shouldMergeResults(t,n,r){return(n.start.isOnlyDate()&&r.start.isOnlyTime()||r.start.isOnlyDate()&&n.start.isOnlyTime())&&t.match(this.patternBetween())!=null}mergeResults(t,n,r){let i=n.start.isOnlyDate()?Iu(n,r):Iu(r,n);return i.index=n.index,i.text=n.text+t+r.text,i}};var zr=class extends Qi{patternBetween(){return new RegExp("^\\s*(T|at|after|before|on|of|,|-|\\.|\u2219|:)?\\s*$")}};var BT=new RegExp("^\\s*,?\\s*\\(?([A-Z]{2,4})\\)?(?=\\W|$)","i"),eo=class{timezoneOverrides;constructor(t){this.timezoneOverrides=t}refine(t,n){let r=t.option.timezones??{};return n.forEach(i=>{let o=t.text.substring(i.index+i.text.length),s=BT.exec(o);if(!s)return;let a=s[1].toUpperCase(),l=i.start.date()??i.refDate??new Date,u={...this.timezoneOverrides,...r},d=Bs(a,l,u);if(d==null)return;t.debug(()=>{console.log(`Extracting timezone: '${a}' into: ${d} for: ${i.start}`)});let c=i.start.get("timezoneOffset");c!==null&&d!=c&&(i.start.isCertain("timezoneOffset")||a!=s[1])||i.start.isOnlyDate()&&a!=s[1]||(i.text+=s[0],i.start.isCertain("timezoneOffset")||i.start.assign("timezoneOffset",d),i.end!=null&&!i.end.isCertain("timezoneOffset")&&i.end.assign("timezoneOffset",d))}),n}};var qT=new RegExp("^\\s*(?:\\(?(?:GMT|UTC)\\s?)?([+-])(\\d{1,2})(?::?(\\d{2}))?\\)?","i"),jT=1,HT=2,WT=3,to=class{refine(t,n){return n.forEach(function(r){if(r.start.isCertain("timezoneOffset"))return;let i=t.text.substring(r.index+r.text.length),o=qT.exec(i);if(!o)return;t.debug(()=>{console.log(`Extracting timezone: '${o[0]}' into : ${r}`)});let s=parseInt(o[HT]),a=parseInt(o[WT]||"0"),l=s*60+a;l>840||(o[jT]==="-"&&(l=-l),r.end!=null&&r.end.assign("timezoneOffset",l),r.start.assign("timezoneOffset",l),r.text+=o[0])}),n}};var Sn=class{refine(t,n){if(n.length<2)return n;let r=[],i=n[0];for(let o=1;o<n.length;o++){let s=n[o];if(s.index>=i.index+i.text.length){r.push(i),i=s;continue}let a=null,l=null;s.text.length>i.text.length?(a=s,l=i):(a=i,l=s),t.debug(()=>{console.log(`${this.constructor.name} remove ${l} by ${a}`)}),i=a}return i!=null&&r.push(i),r}};function Nf(e,t,n){let r=e.getDateWithAdjustedTimezone(),i=GT(r,t,n),o=new W(e);return o=o.addDurationAsImplied({day:i}),o.assign("weekday",t),o}function GT(e,t,n){let r=e.getDay();switch(n){case"this":return Qn(e,t);case"last":return Pf(e,t);case"next":return r==K.SUNDAY?t==K.SUNDAY?7:t:r==K.SATURDAY?t==K.SATURDAY?7:t==K.SUNDAY?8:1+t:t<r&&t!=K.SUNDAY?Qn(e,t):Qn(e,t)+7}return VT(e,t)}function VT(e,t){let n=Pf(e,t),r=Qn(e,t);return r<-n?r:n}function Qn(e,t){let n=e.getDay(),r=t-n;return r<0&&(r+=7),r}function Pf(e,t){let n=e.getDay(),r=t-n;return r>=0&&(r-=7),r}var no=class{refine(t,n){return t.option.forwardDate&&n.forEach(r=>{let i=t.reference.getDateWithAdjustedTimezone();if(r.start.isOnlyTime()&&t.reference.instant>r.start.date()){let o=t.reference.getDateWithAdjustedTimezone(),s=new Date(o);s.setDate(s.getDate()+1),Jt(r.start,s),t.debug(()=>{console.log(`${this.constructor.name} adjusted ${r} time from the ref date (${o}) to the following day (${s})`)}),r.end&&r.end.isOnlyTime()&&(Jt(r.end,s),r.start.date()>r.end.date()&&(s.setDate(s.getDate()+1),Jt(r.end,s)))}if(r.start.isOnlyWeekdayComponent()&&i>r.start.date()){let o=Qn(i,r.start.get("weekday"))||7,s=ke(i,{day:o});if(Jt(r.start,s),t.debug(()=>{console.log(`${this.constructor.name} adjusted ${r} weekday (${r.start})`)}),r.end&&r.start.date()>r.end.date()){let a=Qn(i,r.start.get("weekday"))||7,l=ke(i,{day:a});Jt(r.end,l),t.debug(()=>{console.log(`${this.constructor.name} adjusted ${r} weekday (${r.end})`)})}}if(r.start.isDateWithUnknownYear()&&i>r.start.date())for(let o=0;o<3&&i>r.start.date();o++)r.start.imply("year",r.start.get("year")+1),t.debug(()=>{console.log(`${this.constructor.name} adjusted ${r} year (${r.start})`)}),r.end&&!r.end.isCertain("year")&&(r.end.imply("year",r.end.get("year")+1),t.debug(()=>{console.log(`${this.constructor.name} adjusted ${r} month (${r.start})`)}))}),n}};var ro=class extends Ur{strictMode;constructor(t){super(),this.strictMode=t}isValid(t,n){return n.text.replace(" ","").match(/^\d*(\.\d*)?$/)?(t.debug(()=>{console.log(`Removing unlikely result '${n.text}'`)}),!1):n.start.isValidDate()?n.end&&!n.end.isValidDate()?(t.debug(()=>{console.log(`Removing invalid result: ${n} (${n.end})`)}),!1):this.strictMode?this.isStrictModeValid(t,n):!0:(t.debug(()=>{console.log(`Removing invalid result: ${n} (${n.start})`)}),!1)}isStrictModeValid(t,n){return n.start.isOnlyWeekdayComponent()?(t.debug(()=>{console.log(`(Strict) Removing weekday only component: ${n} (${n.end})`)}),!1):!0}};var YT=new RegExp("([0-9]{4})\\-([0-9]{1,2})\\-([0-9]{1,2})(?:T([0-9]{1,2}):([0-9]{1,2})(?::([0-9]{1,2})(?:\\.(\\d{1,4}))?)?(Z|([+-]\\d{2}):?(\\d{2})?)?)?(?=\\W|$)","i"),ZT=1,KT=2,JT=3,Lf=4,XT=5,Ff=6,$f=7,QT=8,Uf=9,zf=10,io=class extends V{innerPattern(){return YT}innerExtract(t,n){let r=t.createParsingComponents({year:parseInt(n[ZT]),month:parseInt(n[KT]),day:parseInt(n[JT])});if(n[Lf]!=null&&(r.assign("hour",parseInt(n[Lf])),r.assign("minute",parseInt(n[XT])),n[Ff]!=null&&r.assign("second",parseInt(n[Ff])),n[$f]!=null&&r.assign("millisecond",parseInt(n[$f])),n[QT]!=null)){let i=0;if(n[Uf]){let o=parseInt(n[Uf]),s=0;n[zf]!=null&&(s=parseInt(n[zf])),i=o*60,i<0?i-=s:i+=s}r.assign("timezoneOffset",i)}return r.addTag("parser/ISOFormatParser")}};var oo=class extends nt{mergeResults(t,n,r){let i=r.clone();return i.index=n.index,i.text=n.text+t+i.text,i.start.assign("weekday",n.start.get("weekday")),i.end&&i.end.assign("weekday",n.start.get("weekday")),i}shouldMergeResults(t,n,r){return n.start.isOnlyWeekdayComponent()&&!n.start.isCertain("hour")&&r.start.isCertain("day")&&t.match(/^,?\s*$/)!=null}};function Bf(e,t=!1){return e.parsers.unshift(new io),e.refiners.unshift(new oo),e.refiners.unshift(new to),e.refiners.unshift(new Sn),e.refiners.push(new eo),e.refiners.push(new Sn),e.refiners.push(new no),e.refiners.push(new ro(t)),e}function qf(e){let t=e.getDateWithAdjustedTimezone(),n=new W(e,{});return pt(n,t),zs(n,t),n.assign("timezoneOffset",e.getTimezoneOffset()),n.addTag("casualReference/now"),n}function jf(e){let t=e.getDateWithAdjustedTimezone(),n=new W(e,{});return pt(n,t),Ui(n,t),n.delete("meridiem"),n.addTag("casualReference/today"),n}function Hf(e){return e1(e,1).addTag("casualReference/yesterday")}function Wf(e){return Vs(e,1).addTag("casualReference/tomorrow")}function e1(e,t){return Vs(e,-t)}function Vs(e,t){let n=e.getDateWithAdjustedTimezone(),r=new W(e,{}),i=new Date(n.getTime());return i.setDate(i.getDate()+t),pt(r,i),Ui(r,i),r.delete("meridiem"),r}function Gf(e,t=22){let n=e.getDateWithAdjustedTimezone(),r=new W(e,{});return pt(r,n),r.imply("hour",t),r.imply("meridiem",j.PM),r.addTag("casualReference/tonight"),r}function Vf(e,t=20){let n=new W(e,{});return n.imply("meridiem",j.PM),n.imply("hour",t),n.addTag("casualReference/evening"),n}function Yf(e){let t=new W(e,{});return e.getDateWithAdjustedTimezone().getHours()>2&&t.addDurationAsImplied({day:1}),t.assign("hour",0),t.imply("minute",0),t.imply("second",0),t.imply("millisecond",0),t.addTag("casualReference/midnight"),t}function Zf(e,t=6){let n=new W(e,{});return n.imply("meridiem",j.AM),n.imply("hour",t),n.imply("minute",0),n.imply("second",0),n.imply("millisecond",0),n.addTag("casualReference/morning"),n}function Kf(e,t=15){let n=new W(e,{});return n.imply("meridiem",j.PM),n.imply("hour",t),n.imply("minute",0),n.imply("second",0),n.imply("millisecond",0),n.addTag("casualReference/afternoon"),n}function Jf(e){let t=new W(e,{});return t.imply("meridiem",j.AM),t.assign("hour",12),t.imply("minute",0),t.imply("second",0),t.imply("millisecond",0),t.addTag("casualReference/noon"),t}var t1=/(now|today|tonight|tomorrow|overmorrow|tmr|tmrw|yesterday|last\s*night)(?=\W|$)/i,so=class extends V{innerPattern(t){return t1}innerExtract(t,n){let r=t.refDate,i=n[0].toLowerCase(),o=t.createParsingComponents();switch(i){case"now":o=qf(t.reference);break;case"today":o=jf(t.reference);break;case"yesterday":o=Hf(t.reference);break;case"tomorrow":case"tmr":case"tmrw":o=Wf(t.reference);break;case"tonight":o=Gf(t.reference);break;case"overmorrow":o=Vs(t.reference,2);break;default:if(i.match(/last\s*night/)){if(r.getHours()>6){let s=new Date(r.getTime());s.setDate(s.getDate()-1),r=s}pt(o,r),o.imply("hour",0)}break}return o.addTag("parser/ENCasualDateParser"),o}};var n1=/(?:this)?\s{0,3}(morning|afternoon|evening|night|midnight|midday|noon)(?=\W|$)/i,ao=class extends V{innerPattern(){return n1}innerExtract(t,n){let r=null;switch(n[1].toLowerCase()){case"afternoon":r=Kf(t.reference);break;case"evening":case"night":r=Vf(t.reference);break;case"midnight":r=Yf(t.reference);break;case"morning":r=Zf(t.reference);break;case"noon":case"midday":r=Jf(t.reference);break}return r&&r.addTag("parser/ENCasualTimeParser"),r}};var r1=new RegExp(`(?:(?:\\,|\\(|\\\uFF08)\\s*)?(?:on\\s*?)?(?:(this|last|past|next)\\s*)?(${ge(js)}|weekend|weekday)(?:\\s*(?:\\,|\\)|\\\uFF09))?(?:\\s*(?:of\\s*)?(this|last|past|next)\\s*week)?(?=\\W|$)`,"i"),i1=1,o1=2,s1=3,lo=class extends V{innerPattern(){return r1}innerExtract(t,n){let r=n[i1],i=n[s1],o=r||i;o=o||"",o=o.toLowerCase();let s=null;o=="last"||o=="past"?s="last":o=="next"?s="next":o=="this"&&(s="this");let a=n[o1].toLowerCase(),l;if(js[a]!==void 0)l=js[a];else if(a=="weekend")l=s=="last"?K.SUNDAY:K.SATURDAY;else if(a=="weekday"){let u=t.reference.getDateWithAdjustedTimezone().getDay();u==K.SUNDAY||u==K.SATURDAY?l=s=="last"?K.FRIDAY:K.MONDAY:(l=u-1,l=s=="last"?l-1:l+1,l=l%5+1)}else return null;return Nf(t.reference,l,s)}};var a1=new RegExp(`(this|last|past|next|after\\s*this)\\s*(${ge(zi)})(?=\\s*)(?=\\W|$)`,"i"),l1=1,u1=2,uo=class extends V{innerPattern(){return a1}innerExtract(t,n){let r=n[l1].toLowerCase(),i=n[u1].toLowerCase(),o=zi[i];if(r=="next"||r.startsWith("after")){let l={};return l[o]=1,W.createRelativeFromReference(t.reference,l)}if(r=="last"||r=="past"){let l={};return l[o]=-1,W.createRelativeFromReference(t.reference,l)}let s=t.createParsingComponents(),a=new Date(t.reference.instant.getTime());return i.match(/week/i)?(a.setDate(a.getDate()-a.getDay()),s.imply("day",a.getDate()),s.imply("month",a.getMonth()+1),s.imply("year",a.getFullYear())):i.match(/month/i)?(a.setDate(1),s.imply("day",a.getDate()),s.assign("year",a.getFullYear()),s.assign("month",a.getMonth()+1)):i.match(/year/i)&&(a.setDate(1),a.setMonth(0),s.imply("day",a.getDate()),s.imply("month",a.getMonth()+1),s.assign("year",a.getFullYear())),s}};var c1=new RegExp("([^\\d]|^)([0-3]{0,1}[0-9]{1})[\\/\\.\\-]([0-3]{0,1}[0-9]{1})(?:[\\/\\.\\-]([0-9]{4}|[0-9]{2}))?(\\W|$)","i"),d1=1,m1=5,Qf=2,eh=3,_u=4,co=class{groupNumberMonth;groupNumberDay;constructor(t){this.groupNumberMonth=t?eh:Qf,this.groupNumberDay=t?Qf:eh}pattern(){return c1}extract(t,n){let r=n.index+n[d1].length,i=n.index+n[0].length-n[m1].length;if(r>0&&t.text.substring(0,r).match("\\d/?$")||i<t.text.length&&t.text.substring(i).match("^/?\\d"))return;let o=t.text.substring(r,i);if(o.match(/^\d\.\d$/)||o.match(/^\d\.\d{1,2}\.\d{1,2}\s*$/)||!n[_u]&&o.indexOf("/")<0)return;let s=t.createParsingResult(r,o),a=parseInt(n[this.groupNumberMonth]),l=parseInt(n[this.groupNumberDay]);if((a<1||a>12)&&a>12)if(l>=1&&l<=12&&a<=31)[l,a]=[a,l];else return null;if(l<1||l>31)return null;if(s.start.assign("day",l),s.start.assign("month",a),n[_u]){let u=parseInt(n[_u]),d=qs(u);s.start.assign("year",d)}else{let u=xn(t.refDate,l,a);s.start.imply("year",u)}return s.addTag("parser/SlashDateFormatParser")}};var p1=new RegExp(`(this|last|past|next|after|\\+|-)\\s*(${Xt})(?=\\W|$)`,"i"),f1=new RegExp(`(this|last|past|next|after|\\+|-)\\s*(${kn})(?=\\W|$)`,"i"),mo=class extends V{allowAbbreviations;constructor(t=!0){super(),this.allowAbbreviations=t}innerPattern(){return this.allowAbbreviations?p1:f1}innerExtract(t,n){let r=n[1].toLowerCase(),i=tt(n[2]);if(!i)return null;switch(r){case"last":case"past":case"-":i=wn(i);break}return W.createRelativeFromReference(t.reference,i)}};function h1(e){return e.text.match(/^[+-]/i)!=null}function th(e){return e.text.match(/^-/i)!=null}var po=class extends nt{shouldMergeResults(t,n,r){return t.match(/^\s*$/i)?h1(r)||th(r):!1}mergeResults(t,n,r,i){let o=tt(r.text);th(r)&&(o=wn(o));let s=W.createRelativeFromReference(_t.fromDate(n.start.date()),o);return new ft(n.reference,n.index,`${n.text}${t}${r.text}`,s)}};function nh(e){return e.text.match(/\s+(before|from)$/i)!=null}function g1(e){return e.text.match(/\s+(after|since)$/i)!=null}var fo=class extends nt{patternBetween(){return/^\s*$/i}shouldMergeResults(t,n,r){return!t.match(this.patternBetween())||!nh(n)&&!g1(n)?!1:!!r.start.get("day")&&!!r.start.get("month")&&!!r.start.get("year")}mergeResults(t,n,r){let i=tt(n.text);nh(n)&&(i=wn(i));let o=W.createRelativeFromReference(_t.fromDate(r.start.date()),i);return new ft(r.reference,n.index,`${n.text}${t}${r.text}`,o)}};var y1=new RegExp(`^\\s*(${bn})`,"i"),w1=1,ho=class{refine(t,n){return n.forEach(function(r){if(!r.start.isDateWithUnknownYear())return;let i=t.text.substring(r.index+r.text.length),o=y1.exec(i);if(!o||o[0].trim().length<=3)return;t.debug(()=>{console.log(`Extracting year: '${o[0]}' into : ${r}`)});let s=At(o[w1]);r.end!=null&&r.end.assign("year",s),r.start.assign("year",s),r.text+=o[0]}),n}};var go=class extends Ur{constructor(){super()}isValid(t,n){let r=n.text.trim();return r===t.text.trim()?!0:r.toLowerCase()==="may"&&!t.text.substring(0,n.index).trim().match(/\b(in)$/i)?(t.debug(()=>{console.log(`Removing unlikely result: ${n}`)}),!1):r.toLowerCase().endsWith("the second")?(t.text.substring(n.index+n.text.length).trim().length>0&&t.debug(()=>{console.log(`Removing unlikely result: ${n}`)}),!1):!0}};var er=class{createCasualConfiguration(t=!1){let n=this.createConfiguration(!1,t);return n.parsers.push(new so),n.parsers.push(new ao),n.parsers.push(new Hi),n.parsers.push(new uo),n.parsers.push(new mo),n.refiners.push(new go),n}createConfiguration(t=!0,n=!1){let r=Bf({parsers:[new co(n),new Bi(t),new qi,new ji(n),new lo,new Vi,new Yi(t),new Zi(t),new Ki(t),new Gi],refiners:[new zr]},t);return r.parsers.unshift(new Wi(t)),r.refiners.unshift(new fo),r.refiners.unshift(new po),r.refiners.unshift(new Sn),r.refiners.push(new zr),r.refiners.push(new ho),r.refiners.push(new Xi),r}};var tr=class e{parsers;refiners;defaultConfig=new er;constructor(t){t=t||this.defaultConfig.createCasualConfiguration(),this.parsers=[...t.parsers],this.refiners=[...t.refiners]}clone(){return new e({parsers:[...this.parsers],refiners:[...this.refiners]})}parseDate(t,n,r){let i=this.parse(t,n,r);return i.length>0?i[0].start.date():null}parse(t,n,r){let i=new Au(t,n,r),o=[];return this.parsers.forEach(s=>{let a=e.executeParser(i,s);o=o.concat(a)}),o.sort((s,a)=>s.index-a.index),this.refiners.forEach(function(s){o=s.refine(i,o)}),o}static executeParser(t,n){let r=[],i=n.pattern(t),o=t.text,s=t.text,a=i.exec(s);for(;a;){let l=a.index+o.length-s.length;a.index=l;let u=n.extract(t,a);if(!u){s=o.substring(a.index+1),a=i.exec(s);continue}let d=null;u instanceof ft?d=u:u instanceof W?(d=t.createParsingResult(a.index,a[0]),d.start=u):d=t.createParsingResult(a.index,a[0],u);let c=d.index,m=d.text;t.debug(()=>console.log(`${n.constructor.name} extracted (at index=${c}) '${m}'`)),r.push(d),s=o.substring(c+m.length),a=i.exec(s)}return r}},Au=class{text;option;reference;refDate;constructor(t,n,r){this.text=t,this.option=r??{},this.reference=_t.fromInput(n,this.option.timezones),this.refDate=this.reference.instant}createParsingComponents(t){return t instanceof W?t:new W(this.reference,t)}createParsingResult(t,n,r,i){let o=typeof n=="string"?n:this.text.substring(t,n),s=r?this.createParsingComponents(r):null,a=i?this.createParsingComponents(i):null;return new ft(this.reference,t,o,s,a)}debug(t){this.option.debug&&(this.option.debug instanceof Function?this.option.debug(t):this.option.debug.debug(t))}};var Ys=new er,Zs=new tr(Ys.createCasualConfiguration(!1)),rh=new tr(Ys.createConfiguration(!0,!1)),x1=new tr(Ys.createCasualConfiguration(!0));function b1(e,t,n){return Zs.parse(e,t,n)}function k1(e,t,n){return Zs.parseDate(e,t,n)}var Ou=globalThis.Temporal;var ih=(e,t)=>`Non-positive ${e}: ${t}`,oh=(e,t)=>`Non-finite ${e}: ${t}`,sh=e=>`Cannot convert bigint to ${e}`,ah="Invalid object",yo=(e,t,n,r)=>nr(e,t)+`; must be between ${n}-${r}`,nr=(e,t)=>`Invalid ${e}: ${t}`;var Du=1e3,vu=1e6,Mu=1e9,Ru=6e10,Nu=36e11;function rt(e){return e===void 0?Object.create(null):rr(e)}function Js(e,t="number"){if(typeof e=="bigint")throw new TypeError(sh(t));if(e=Number(e),!Number.isFinite(e))throw new RangeError(oh(t,e));return e}function Ce(e,t){return Math.trunc(Js(e,t))||0}function Xs(e,t){return lh(Ce(e,t),t)}function lh(e,t="number"){if(e<=0)throw new RangeError(ih(t,e));return e}function Pu(e,t,n){return Math.min(Math.max(e,t),n)}function Br(e){return e!==null&&(typeof e=="object"||typeof e=="function")}function rr(e){if(!Br(e))throw new TypeError(ah);return e}var aa=nr;var To=e=>`Missing ${e}`,wh=e=>"No valid fields: "+e.join(),xh="Invalid bag",bh=(e,t,n)=>nr(e,t)+"; must be "+Object.keys(n).join(),kh="Cannot use valueOf",Sh="Invalid calling context",la=e=>"Missing year"+(e?"/era/eraYear":""),or="Invalid leap month",Th=e=>nr("Calendar",e),Eh=(e,t)=>`Unknown calendar ${e}; might need ${t}`,Ju=e=>nr("TimeZone",e),Tn="Out-of-bounds date";var Ch=e=>`Cannot parse: ${e}`,Qt=e=>`Invalid substring: ${e}`;var Xu=Pu,je=Br;function v(e){throw new RangeError(e)}function ne(e){throw new TypeError(e)}function Uu(e,t,n,r,i){return Dt(t,((o,s)=>{let a=o[s];return a===void 0&&ne(To(s)),a})(e,t),n,r,i)}function Dt(e,t,n,r,i,o){let s=Xu(t,n,r);return i&&t!==s&&v(((a,l,u,d,c)=>c?yo(a,c[l],c[u],c[d]):yo(a,l,u,d))(e,t,n,r,o)),s}function Hr(e,t=Map){let n=new t;return(r,...i)=>{if(n.has(r))return n.get(r);let o=e(r,...i);return n.set(r,o),o}}var Ih=e=>ua({name:e},1),ua=(e,t)=>An(n=>({value:n,configurable:1,writable:!t}),e),Eo=e=>({[Symbol.toStringTag]:{value:e,configurable:1}});function An(e,t){let n={};for(let r in t)n[r]=e(t[r],r);return n}function Co(e,t){let n={};for(let r of e)n[r]=t;return n}function ca(e){let t={};for(let n of e)t[n]=r=>r[n];return t}function vt(e,t,n=Object.create(null)){for(let r of e)n[r]=t[r];return n}function _h(e,t,n){for(let r of e)if(t[r]!==n[r])return 0;return 1}function I1(e,t,n){let r={...n};for(let i=0;i<t;i++)r[e[i]]=0;return r}function He(e,...t){return(...n)=>e(...t,...n)}function Qu(){}function uh(e){return e[0].toUpperCase()+e.substring(1)}function Te(...e){return[].concat(...e).sort()}function Yr(e){return new RegExp(`^${e}$`,"i")}function ec(e){return parseInt(e.padEnd(9,"0"))}function tc(e){return e&&e!=="+"?-1:1}function qr(e){return e===void 0?0:parseInt(e)}function na(e,t){return String(t).padStart(e,"0")}var ht=He(na,2);function en(e,t){return Math.sign(e-t)}function ye(e,t){return e<t?-1:e>t?1:0}function Ah(e,t){let n=e/t;return e%t<0n?n-1n:n}function nc(e,t){let n=Ah(e,t);return[n,e-n*t]}function Ot(e,t){return[Math.floor(e/t),da(e,t)]}function da(e,t){return(e%t+t)%t}function Zr(e,t){return Math.trunc(e/t)||0}function rc(e,t){return e%t||0}function Oh(e,t=1){return t*(.5+e/5)}function Qs(e){return Math.abs(e%1)===.5}var ic="iso8601",Dh="gregory",_1={bce:-1,ce:0};function vh(e){let t=e.normalize("NFD").toLowerCase().replace(/[^a-z0-9]/g,"");return t==="bc"||t==="b"?"bce":t==="ad"||t==="a"?"ce":t}var it=void 0,Mh=0;function yt(e){return e===it?"iso8601":e===0?"gregory":e.id}var A1=/^M(\d{2})(L?)$/;function Rh(e){let t=A1.exec(e);return t||v((n=>`Invalid monthCode: ${n}`)(e)),[parseInt(t[1]),!!t[2]]}function Nh(e,t){return"M"+ht(e)+(t?"L":"")}function zu(e,t,n){return e+(t||n&&e>=n?1:0)}var Bu={nanosecond:0,microsecond:1,millisecond:2,second:3,minute:4,hour:5,day:6,week:7,month:8,year:9},oc=Object.keys(Bu);var Io=Du,_o=vu,On=Mu,Ao=Ru,Oo=Nu,rn=864e11,wt=[1,Io,_o,On,Ao,Oo,rn],O1=BigInt(Io),Kr=BigInt(_o),sr=BigInt(On),D1=BigInt(Ao),v1=BigInt(Oo),ce=BigInt(rn);function Ph(e,t){let n=Number(e/ce),r=Number(e%ce);return n*(rn/t)+(Math.trunc(r/t)+r%t/t)}var $e=oc.slice(0,6),Do=ca($e),ma=["year"],mr=["day"],sc=["day","month","year"],pa=["offset"],ac=["timeZone"],Jr=["era","eraYear"],M1=["era","eraYear","year"],Lh=["month","monthCode"],R1=["day","month","monthCode"],qu=Te($e),N1=Te(Jr,ma),vo=Te(Lh,ma),Fh=Te(Jr,vo),Mo=Te(["monthCode"],ma),$h=Te(Jr,Mo),Uh=Te(mr,["monthCode"]),pr=Te(mr,vo),fr=Te(mr,Jr,vo),zh=Te(pr,$e),Bh=Te(fr,$e),P1=Te(pr,$e,pa),L1=Te(fr,$e,pa),qh=Te(pr,$e,pa,ac),jh=Te(fr,$e,pa,ac),F1=Te(mr,Mo),$1=Te(mr,Jr,Mo),Be=Co($e,0);function Ro(e){return fa(e,1),e}var U1={hour:23,minute:59,second:59};function fa(e,t){let n={};for(let r of $e)n[r]=Dt(r,e[r],0,U1[r]||999,t);return n}function Je(e){return uc(e)*On+Hh(e)}function lc(e){return 1e3*uc(e)+e.millisecond}function uc(e){return 3600*e.hour+60*e.minute+e.second}function Hh(e){return e.millisecond*_o+e.microsecond*Io+e.nanosecond}function cc(e){let[t,n]=Ot(e,rn);return[Wh(n),t]}function Wh(e){let[t,n]=Ot(e,_o),[r,i]=Ot(n,Io);return z1(t,r,i)}function z1(e,t=0,n=0){let[r,i]=Ot(e,36e5),[o,s]=Ot(i,6e4),[a,l]=Ot(s,1e3);return{hour:r,minute:o,second:a,millisecond:l,microsecond:t,nanosecond:n}}function ch(e){let[t,n]=nc(e,sr);return[Number(t),Number(n)]}function ot(e){return En(e)+BigInt(Je(e))}function Gh(e){return No(e)+lc(e)}function En(e){return BigInt(Mt(e))*ce}function No(e){return 864e5*Mt(e)}function Mt(e){return wo(e.year,e.month,e.day)}function wo(e,t=1,n=1){let r=t-1;return e+=Math.floor(r/12),t=da(r,12),Date.UTC(e%400-400,t,0)/864e5+146097*(Zr(e,400)+1)+n}function Po(e){let[t,n]=nc(e,ce);return{...Vh(Number(t)),...Wh(Number(n))}}function Vh(e){let t=new Date(864e5*da(e,146097));return{year:t.getUTCFullYear()+400*Math.floor(e/146097),month:t.getUTCMonth()+1,day:t.getUTCDate()}}var Yh=1972;function B1(e){return[e,0]}function ju(e,t){if(!t)return{year:1972,month:e}}function q1(e,t,n){return{year:e,month:t,day:n}}function Zh(e,t){switch(t){case 2:return ha(e)?29:28;case 4:case 6:case 9:case 11:return 30}return 31}function j1(e){return ha(e)?366:365}function ha(e){return e%4==0&&(e%100!=0||e%400==0)}function Kh(e,t,n){return e+=Zr(n,12),(t+=rc(n,12))<1?(e--,t+=12):t>12&&(e++,t-=12),{year:e,month:t}}function H1(e,t,n,r){return 12*(n-e)+r-t}function ga(e){return da(wo(e.year,e.month,e.day)+4,7)||7}function Jh(e){return wo(e.year,e.month,e.day)-wo(e.year)+1}function Xh(e){let t=e.year,n=Math.floor((Jh(e)-ga(e)+10)/7),r=Lu(t);return n<1?n=r=Lu(--t):n>r&&(n=1,r=Lu(++t)),{weekOfYear:n,yearOfWeek:t,Be:r}}function Lu(e){let t=ga({year:e,month:1,day:1});return t===4||t===3&&ha(e)?53:52}function W1({year:e}){return e<1?{era:"bce",eraYear:1-e}:{era:"ce",eraYear:e}}function Lo(e){return on(e),Ro(e)}function on(e){return Qh(e,1),e}function dh(e){return _h(sc,e,Qh(e))}function Qh(e,t){let{year:n}=e,r=Uu(e,"month",1,12,t);return{year:n,month:r,day:Uu(e,"day",1,Zh(n,r),t)}}function ae(e,t){return e?e.ae(t):t}function ar(e,t,n){return e?e.L(t,n):B1(n)}function Fo(e,t){return e===0?W1(t):e&&e.h?.(t)||{}}function lr(e,t,n,r){return e?e.de(t,n,r):q1(t,n,r)}function xo(e,t){return e?e.j(t):12}function bo(e,t,n){return e?e.o(t,n):Zh(t,n)}function ya(e,t){let{year:n,month:r}=ae(e,t),[i,o]=ar(e,n,r);return Nh(i,o)}function dc(e,t){let{year:n}=ae(e,t);return e?e.q(n):ha(n)}function mc(e,t){let{year:n}=ae(e,t);return xo(e,n)}function pc(e,t){let{year:n,month:r}=ae(e,t);return bo(e,n,r)}function fc(e,t){let{year:n}=ae(e,t);return e?e.i(n):j1(n)}function eg(e,t){if(!e)return Jh(t);let{year:n}=ae(e,t),r=lr(e,n,1,1);return Mt(t)-Mt(r)+1}function tg(e,t){return e===it?Xh(t).weekOfYear:void 0}function ng(e,t){return e===it?Xh(t).yearOfWeek:void 0}var de=oc.map(e=>e+"s"),hc=ca(de),rg=Te(de),G1=de.slice(0,6),ig=de.slice(6),V1=ig.slice(1),we=Co(de,0),gc=Co(G1,0),yc=He(I1,de);function og(e,t){return t==null&&v(To(e)),t}var ve=He(Y1,"string");function Y1(e,t,n=e){return typeof t!==e&&ne(aa(n,t)),t}function wc(e,t="number"){return Number.isInteger(e)||v(((n,r)=>`Non-integer ${n}: ${r}`)(t,e)),e||0}function xc(e){return typeof e=="symbol"&&ne("Cannot convert Symbol to string"),String(e)}function bc(e,t){return Br(e)?String(e):ve(e,t)}function wa(e){return typeof e=="boolean"?BigInt(e?1:0):typeof e=="string"?BigInt(e):(typeof e!="bigint"&&ne(`Invalid bigint: ${e}`),e)}function xa(e,t){return wc(Js(e,t),t)}function ba(e,t){return typeof e=="string"?((n,r)=>{let i=Object.create(null);return i[n]=r,i})(t,e):rr(e)}var tn="smallestUnit";var Z1={constrain:0,reject:1},K1={compatible:0,reject:1,earlier:2,later:3},J1={reject:0,use:1,prefer:2,ignore:3},X1={auto:0,never:1,critical:2,always:3},Q1={auto:0,never:1,critical:2},eE={auto:0,never:1},tE={floor:0,halfFloor:1,ceil:2,halfCeil:3,trunc:4,halfTrunc:5,expand:6,halfExpand:7,halfEven:8},nE=[Math.floor,e=>Qs(e)?Math.floor(e):Math.round(e),Math.ceil,e=>Qs(e)?Math.ceil(e):Math.round(e),Math.trunc,e=>Qs(e)?Math.trunc(e)||0:Math.round(e),e=>e<0?Math.floor(e):Math.ceil(e),e=>Math.sign(e)*Math.round(Math.abs(e))||0,e=>Qs(e)?(e=Math.trunc(e)||0)+e%2:Math.round(e)],rE={previous:-1,next:1};function kc(e){let t=e.roundingIncrement;return t===void 0?1:Ce(t,"roundingIncrement")}function Sc(e){let t=e.fractionalSecondDigits;if(t!==void 0){if(typeof t!="number"){if(xc(t)==="auto")return;v(aa("fractionalSecondDigits",t))}t=Dt("fractionalSecondDigits",Math.floor(t),0,9,1)}return t}function Tc(e,t,n=0,r){let i=t[e];if(i===void 0)return r?n:void 0;if(i=xc(i),i==="auto")return r?n:null;let o=Bu[i];return o===void 0&&(o=de.indexOf(i)),o<0&&v(bh(e,i,Bu)),o}function Dn(e,t,n,r=0){let i=n[e];if(i===void 0)return r;let o=xc(i),s=t[o];return s===void 0&&v(bh(e,o,t)),s}var Xr=He(Tc,tn),sg=He(Tc,"largestUnit"),iE=He(Tc,"unit"),ag=He(Dn,"overflow",Z1),lg=He(Dn,"disambiguation",K1),oE=He(Dn,"offset",J1),Ec=He(Dn,"calendarName",X1),sE=He(Dn,"timeZoneName",Q1),aE=He(Dn,"offset",eE),Qr=He(Dn,"roundingMode",tE),lE=He(Dn,"direction",rE);function Cc(e,t,n,r){let i=r?rn:wt[t+1];if(i){let o=wt[t];i%((e=Dt("roundingIncrement",e,1,i/o-(r?0:1),1))*o)&&v(aa("roundingIncrement",e))}else e=Dt("roundingIncrement",e,1,n?10**9:1,1);return e}function Wr(e,t,n,r){return t!=null&&Dt(e,t,n,r,1,oc),t}function ug(e,t){t>e&&v("smallestUnit > largestUnit")}function ei(e,t,n,r=9,i=0,o=4){t=rt(t);let s=sg(t,i),a=kc(t),l=Qr(t,o),u=Xr(t,i,1);return s=Wr("largestUnit",s,i,r),u=Wr(tn,u,i,r),s==null?s=Math.max(n,u):ug(s,u),a=Cc(a,u,1),e&&(l=(d=>d<4?(d+2)%4:d)(l)),[s,u,a,l]}function $o(e,t=6,n){let r=kc(e=ba(e,tn)),i=Qr(e,7),o=Xr(e);return o=og(tn,o),o=Wr(tn,o,0,t),r=Cc(r,o,void 0,n),[o,r,i]}function ie(e,t){return vt(sc,e,vt($e,t))}function X(e){return e===void 0?0:ag(rr(e))}function Gr(e,t=0){e=rt(e);let n=lg(e),r=oE(e,t);return[ag(e),r,n]}var cg=BigInt(1e8)*ce,Ic=BigInt(-1e8)*ce,dg=Ic-ce,mg=-3261848;function ka(e){let t=12*e.year+e.month;return(t<mg||t>3309129)&&v(Tn),e}function qe(e,t=1){return pg(En(e),t),e}function hr(e){let t=En(e);return pg(t),t!==dg||Je(e)||v(Tn),e}function pg(e,t=1){(e<(t?dg:Ic)||e>cg)&&v(Tn)}function xt(e){return(e<Ic||e>cg)&&v(Tn),e}function _c(e,t){return xt(En(e)+BigInt(Je(e)-t))}function st(e){return{epochNanoseconds:e}}function bt(e,t,n){return{calendar:n,timeZone:t,epochNanoseconds:e}}function Rt(e,t){return vt($e,e,le(e,t))}function le(e,t){return vt(sc,e,{calendar:t})}function gr(e){return vt($e,e)}function Se(e){return vt(de,e,{sign:Oa(e)})}function Uo(e){return t=e.epochNanoseconds,Number(Ah(t,Kr));var t}function Ac(e){return e.epochNanoseconds}function fg(e,t,n){let r=_n(t),[i,o]=((c,m)=>{let p=m((c=ba(c,"unit")).relativeTo),f=iE(c);return f=og("unit",f),[f,p]})(n,e),s=Math.max(i,r),a=o&&dr(o);if(!o&&jr(s,a))return mh(t,i);if(o||v("Missing relativeTo"),!t.sign&&jr(i,a))return 0;let[l,u,d]=Og(o,t,i);return jr(i,a)?mh(l,i):uE(l,u,i,d)}function uE(e,t,n,r){let i=Oa(e)||1,o=Oc(yc(n,e),n,i,r,t),s=o.ee,a=o.te,l=Number(a-s),u=Number(t-s);return o.pe[de[n]]+u/l*i}function mh(e,t){return Ph(nn(e),wt[t])}function Oc(e,t,n,r,i){let o=de[t],s=e,a=0,l=ph(s,o,n,r);return i&&!((u,d,c,m)=>m>0?ye(d,u)<=0&&ye(u,c)<=0:ye(c,u)<=0&&ye(u,d)<=0)(i,l.ee,l.te,Math.sign(n))&&(s={...e,[o]:e[o]+n},a=1,l=ph(s,o,n,r)),{...l,pe:s,Ae:a}}function ph(e,t,n,r){let i={...e,[t]:e[t]+n};return{ee:Gu(r,e),te:Gu(r,i),se:i}}function hg(e,t,n){let r=n-t,i=e-t;if(!i)return 0;let o=i<0n?-i:i,s=r<0n?-r:r,a=ye(i,0n)===ye(r,0n)?1:-1;return ye(o,s)<=0?o===s?a:Oh(ye(2n*o,s),a):Number(i)/Number(r)}function gg(e,t,n,r){let{epochNanoseconds:i}=e,{timeZone:o,calendar:s}=e;if(t===0&&n===1)return{epochNanoseconds:i,timeZone:o,calendar:s};if(t===6){let a=ie(xe(e),Be),l=ie(vn(a,1),Be),u=Cn(o,a),d=Cn(o,l);i=Dc(cE(i,u,d),r)?d:u}else{let a=xe(e),l=a.offsetNanoseconds;i=ni(o,Sa(a,ti(t,n),r),l,2,0,1)}return{epochNanoseconds:i,timeZone:o,calendar:s}}function yg(e){let{timeZone:t}=e,n=ie(xe(e),Be),r=ie(vn(n,1),Be),i=Cn(t,n);return Ph(Cn(t,r)-i,Oo)}function wg(e){let{timeZone:t,calendar:n}=e;return bt(Cn(t,ie(xe(e),Be)),t,n)}function cE(e,t,n){return hg(e<n?e:n-1n,t,n)}function Sa(e,t,n){let[r,i]=Ta(e,t,n),o=ie(vn(e,i),r);return hr(o),o}function Ta(e,t,n){return cc(Vr(Je(e),t,n))}function ra(e){return Vr(e,Ao,7)}function ti(e,t){return wt[e]*t}function zo(e,t){return BigInt(wt[e])*BigInt(t)}function dE(e,t,n){let r=Math.min(_n(e),6);return In(Ca(nn(e),BigInt(t),n),r)}function Ea(e,t,n,r,i,o,s,a){if(r===0&&i===1)return e;let l=Oa(e)||1,u=jr(r,a)?a&&r<6&&n>=6?pE:mE:fE,[d,c,m]=u(l,e,t,n,r,i,o,s);return m&&r!==7&&(d=((p,f,x,S,w,D)=>{for(let T=S+1;T<=x;T++){if(T===7&&x!==7)continue;let M=yc(T,p);M[de[T]]+=w;let O=ye(f,Gu(D,M));if(O&&O!==w)break;p=M}return p})(d,c,n,Math.max(6,r),l,s)),d}function Ca(e,t,n){return xg(e,t,n,e/t%2n)}function Ia(e,t,n){let[r,i]=nc(e,ce),o=r*ce;return o+xg(i,t,n,(o/t+i/t)%2n)}function xg(e,t,n,r){let i=e/t,o=e%t,s=0;o&&(s=Oh(ye(2n*(o<0n?-o:o),t),Math.sign(Number(o))));let a=Dc(Number(r)+s,n);return(i-r+BigInt(a))*t}function Vr(e,t,n){return Dc(e/t,n)*t}function Dc(e,t){return nE[t](e)}function mE(e,t,n,r,i,o,s){let a=nn(t),l=Ca(a,zo(i,o),s),u=l-a,d=Math.sign(Number(l/ce)-Number(a/ce))===e,c=In(l,Math.min(r,6));return[{...t,...c},n+u,d]}function pE(e,t,n,r,i,o,s,a){let l=Number(yr(t)),u=ti(i,o),d=Vr(l,u,s),c=Oc({...t,...gc},6,e,a,n),m=c.ee,p=c.te,f=d-Number(p-m),x=0;f&&Math.sign(f)!==e?n=m+BigInt(d):(x+=e,d=Vr(f,u,s),n=p+BigInt(d));let S=Da(d);return[{...t,...S,days:t.days+x},n,!!x]}function fE(e,t,n,r,i,o,s,a){let l=de[i],u=yc(i,t);i===7&&(t={...t,weeks:t.weeks+Math.trunc(t.days/7)});let d=Zr(t[l],o)*o;u[l]=d;let c=Oc(u,i,o*e,a,n),m=c.ee,p=c.te,f=hg(n,m,p),x=c.pe[l],S=c.se[l],w=Vr(x+f*e*o,o,s),D=w===S;return u[l]=w,[u,D?p:m,c.Ae||D]}function bg(e,t){return e.timeZone.O(e.epochNanoseconds,(n=>{let r=ba(n,"direction"),i=lE(r,0);return i||v(aa("direction",i)),i})(t))}var xe=Hr(hE,WeakMap);function hE(e){let{epochNanoseconds:t,timeZone:n}=e,r=n.B(t);return{...Po(t+BigInt(r)),offsetNanoseconds:r}}function ni(e,t,n,r=0,i=0,o,s){if(n!==void 0&&r===1&&(r===1||s))return _c(t,n);r!==2&&r!==0||qe(t,0);let a=e.N(t);if(n!==void 0&&r!==3){let l=((u,d,c,m)=>{let p=ot(d);m&&(c=ra(c));for(let f of u){let x=Number(p-f);if(m&&(x=ra(x)),x===c)return f}})(a,t,n,o);if(l!==void 0)return l;r===0&&v("Invalid TimeZone offset")}return s?ot(t):ri(e,t,i,a)}function ri(e,t,n=0,r=e.N(t)){if(r.length===1)return r[0];if(n===1&&v("Ambiguous offset"),r.length)return r[n===3?1:0];let i=ot(t),o=((a,l)=>{let u=a.B(l-ce);return(d=>(d>rn&&v("Out-of-bounds TimeZone gap"),d))(a.B(l+ce)-u)})(e,i),s=Po(i+BigInt(o*(n===2?-1:1)));return(r=e.N(s))[n===2?0:r.length-1]}function Cn(e,t){let n=e.N(t);if(n.length)return n[0];let r=ot(t)-ce;return e.O(r,1)}function vc(e,t,n,r,i){let o=X(i);r.sign&&_n(r)<8&&v("Cannot use small units");let s=qe(ko(t,n));return ko(t,kg(t,s,e?Me(r):r,o))}function Mc(e,t){return xt(e+(Hc(n=t)&&v("Cannot use large units"),yr(n)));var n}function ur(e,t,n){let{calendar:r,epochNanoseconds:i,timeZone:o}=e,s=yr(t),a=i;if(Hc(t)){let l=xe(e);a=ri(o,ie(ii(r,l,{...t,...gc},n),l))+s}else a+=s,X(n);return{...e,epochNanoseconds:xt(a)}}function cr(e,t,n,r){let[i,o]=_a(t,n);return hr(ie(ii(e,t,{...n,...gc,days:n.days+o},r),i))}function ii(e,t,n,r){if(n.years||n.months||n.weeks)return kg(e,t,n,X(r));X(r);let i=n.days+Number(yr(n)/ce);return i?qe(vn(t,i)):t}function ko(e,t){return vn(t,1-ae(e,t).day)}function _a(e,t){let n=yr(t),r=Number(n/ce),i=Number(n%ce),[o,s]=cc(Je(e)+i);return[o,r+s]}function vn(e,t){return t?Vh(Mt(e)+t):e}function kg(e,t,n,r){let{years:i,months:o,weeks:s,days:a}=n,l;if(a+=Number(yr(n)/ce),i||o)l=Hu(e,t,i,o,r);else{if(!s&&!a)return t;l=t}return(s||a)&&(l=vn(l,7*s+a)),qe(l)}function Hu(e,t,n,r,i){let o=ae(e,t),{year:s,month:a,day:l}=o;if(n){let[u,d]=ar(e,s,a);s+=n,a=Wu(e,u,d,e?e.p(s):void 0,i),a=Dt("month",a,1,xo(e,s),i)}return r&&({year:s,month:a}=e?e.K(s,a,r):Kh(s,a,r)),l=Dt("day",l,1,bo(e,s,a),i),lr(e,s,a,l)}function Wu(e,t,n,r,i){if(n){let o=e?e.l:void 0;return r!==void 0&&(o<0||r===t+1)?r:(i===1&&v(or),o<0?-o:t)}return zu(t,0,r)}function sn(e,t){return yt(e)!==yt(t)&&v("Mismatching Calendars"),e}function gE(e,t){return e.m!==t.m&&v("Mismatching TimeZones"),e}function Sg(e){return e.timeZone.id}function Rc(e,t,n,r){let[i,o,s,a]=ei(e,r,3,5),l=Aa(t.epochNanoseconds,n.epochNanoseconds,i,o,s,a);return Se(e?Me(l):l)}function Nc(e,t,n,r,i){let[o,s,a,l]=ei(e,i,5),u=n.epochNanoseconds,d=r.epochNanoseconds,c;if(ye(d,u))if(o<6)c=Aa(u,d,o,s,a,l);else{let m=gE(n.timeZone,r.timeZone);c=Uc(m,t,n,r,o),c=Ea(c,d,o,s,a,l,Ag(t,m,n),1)}else c=we;return Se(e?Me(c):c)}function Pc(e,t,n,r,i){let[o,s,a,l]=ei(e,i,6),u=ot(n),d=ot(r),c=ye(d,u),m;return c?o<=6?m=Aa(u,d,o,s,a,l):(m=Cg(t,n,r,c,o),m=Ea(m,d,o,s,a,l,wE(t,n))):m=we,Se(e?Me(m):m)}function Lc(e,t,n,r,i){let[o,s,a,l]=ei(e,i,6,9,6);return Tg(e,t,n,r,o,s,a,l)}function Fc(e,t,n,r,i){let[o,s,a,l]=ei(e,i,9,9,8),u=ko(t,n),d=ko(t,r);return Ig(u,d)?Tg(e,t,qe(u),qe(d),o,s,a,l,8):Se(we)}function Tg(e,t,n,r,i,o,s,a,l=6){let u=En(n),d=En(r),c;return ye(d,u)?i===6?c=Aa(u,d,i,o,s,a):(c=zc(t,n,r,i),o===l&&s===1||(c=Ea(c,d,i,o,s,a,_g(t,n)))):c=we,Se(e?Me(c):c)}function $c(e,t,n,r){let[i,o,s,a]=ei(e,r,5,5),l=Vr(Je(n)-Je(t),ti(o,s),a),u={...we,...Da(l,i)};return Se(e?Me(u):u)}function Uc(e,t,n,r,i){let o=ye(r.epochNanoseconds,n.epochNanoseconds);if(!o)return we;if(i<6)return{...we,...In(r.epochNanoseconds-n.epochNanoseconds,i)};if(!Ig(xe(n),xe(r)))return{...we,...In(r.epochNanoseconds-n.epochNanoseconds,5)};let[s,a,l]=yE(e,n,r,o);return{...i===6?{...we,days:ta(s,a)}:zc(t,s,a,i),...Da(l)}}function Eg(e,t,n,r){let i=ot(t),o=ot(n),s=ye(o,i);return s?r<=6?{...we,...In(o-i,r)}:Cg(e,t,n,s,r):we}function Cg(e,t,n,r,i){let o=n,s=Je(n)-Je(t);return Math.sign(s)===-r&&(o=vn(n,-r),s+=rn*r),{...zc(e,t,o,i),...Da(s)}}function zc(e,t,n,r){if(r<=7){let x=ta(t,n);return r===7?{...we,weeks:Zr(x,7),days:rc(x,7)}:{...we,days:x}}let i=ae(e,t),o=ae(e,n);if(r===8){let{year:x,month:S,day:w}=i,{year:D,month:T,day:M}=o,O=Math.sign(en(D,x)||en(T,S)||ta(t,n)),b=0,E=0;if(O){b=e?e._(x,S,D,T):H1(x,S,D,T);let R=Hu(e,t,0,b,0);O*en(w,M)>0&&(b-=O,R=Hu(e,t,0,b,0)),E=ta(R,n)}return{...we,months:b,days:E}}let{year:s,month:a,day:l}=i,{year:u,month:d,day:c}=o,m=u-s,p=d-a,f=c-l;if(m||p){let x=Math.sign(m||p),S=bo(e,u,d),w=0;if(Math.sign(c-l)===-x){let D=S;({year:u,month:d}=e?e.K(u,d,-x):Kh(u,d,-x)),m=u-s,p=d-a,S=bo(e,u,d),w=x<0?-D:S}if(f=c-Math.min(l,S)+w,m){let[D,T]=ar(e,s,a),[M,O]=ar(e,u,d),b=e?e.l:void 0;if(p=b!==void 0&&T&&!O&&(b<0?x>0&&M===-b:x<0&&M===D)?0:M-D||Number(O)-Number(T),Math.sign(p)===-x){let E=x<0&&-xo(e,u);u-=x,m=u-s,p=d-Wu(e,D,T,e?e.p(u):void 0,0)+(E||xo(e,u))}else if(e){let E=Wu(e,D,T,e.p(u),0);p=e._(u,E,u,d)}}}return{...we,years:m,months:p,days:f}}function Ig(e,t){return en(e.year,t.year)||en(e.month,t.month)||en(e.day,t.day)}function yE(e,t,n,r){let i=xe(t),o=xe(n),s=n.epochNanoseconds,a=0,l=Je(o)-Je(i);Math.sign(l)===-r&&a++;let u=a+(r>0?1:0);for(;a<=u;a++){let d=vn(o,a*-r),c=ri(e,ie(d,i));if(ye(s,c)!==-r)return[i,d,Number(s-c)]}}function Aa(e,t,n,r,i,o){return{...we,...In(Ca(t-e,zo(r,i),o),n)}}function ta(e,t){return Mt(t)-Mt(e)}function _g(e,t){return{origin:t,ie:En(t),calendar:e,he:En}}function wE(e,t){return{origin:t,ie:ot(t),calendar:e,he:n=>ot(ie(n,t))}}function Ag(e,t,n){let r=xe(n);return{origin:r,ie:n.epochNanoseconds,calendar:e,he:i=>ri(t,ie(i,r))}}function Gu(e,t){return Hc(t)?e.he(ii(e.calendar,e.origin,t)):e.ie}function Og(e,t,n){let{calendar:r}=e;if(dr(e)){let{timeZone:s}=e,a=ur(e,t);return[Uc(s,r,e,a,n),a.epochNanoseconds,Ag(r,s,e)]}let i=hr(ie(e,Be)),o=cr(r,i,t);return[Eg(r,i,o,n),ot(o),_g(r,e)]}function fh(e,t){return dr(e)?ur(e,t).epochNanoseconds:ot(cr(e.calendar,ie(e,Be),t))}function dr(e){return"timeZone"in e}function jr(e,t){return e<=6-(t?1:0)}function Bc(e,t,n){let r={};for(let i=t;i>=0;i--){let o=wt[i];r[n[i]]=Zr(e,o),e=rc(e,o)}return r}var xE=2**53;function qc(e,t,n,r,i){let o=e(rt(i).relativeTo),s=Math.max(_n(n),_n(r));return jr(s,o&&dr(o))?bE(t,n,r,s):(o||v("Missing relativeTo"),t&&(r=Me(r)),Se(((a,l,u,d)=>{let{calendar:c}=a;if(dr(a)){let{timeZone:f}=a,x=ur(a,l);return Uc(f,c,a,ur(x,u),d)}let m=ie(a,Be),p=cr(c,m,l);return Eg(c,m,cr(c,p,u),d)})(o,n,r,s)))}function bE(e,t,n,r){return Se(Mn(((i,o,s,a)=>{let l=nn(i)+nn(o)*BigInt(a?-1:1);return Number.isFinite(Number(l/ce))||v(Tn),{...we,...In(l,s)}})(t,n,r,e)))}function Dg(e,t,n){let r=_n(t),[i,o,s,a,l]=((f,x,S)=>{f=ba(f,tn);let w=sg(f),D=S(f.relativeTo),T=kc(f),M=Qr(f,7),O=Xr(f);return w===void 0&&O===void 0&&v("Required smallestUnit or largestUnit"),O==null&&(O=0),w==null&&(w=Math.max(O,x)),ug(w,O),T=Cc(T,O,1),T>1&&O>5&&w!==O&&v("For calendar units with roundingIncrement > 1, use largestUnit = smallestUnit"),[w,O,T,M,D]})(n,r,e);if(!l&&Math.max(r,i)<=6)return Se(Mn(((f,x,S,w,D)=>{let T=Ca(nn(f),zo(S,w),D);return{...we,...In(T,x)}})(t,i,o,s,a)));let u=l&&dr(l),d=u&&i>=6&&o<6;if(!t.sign&&!d)return t;l||v("Missing relativeTo");let[c,m,p]=Og(l,t,i);return Se(Ea(c,m,i,o,s,a,p,u))}function vg(e){return e.sign===-1?jc(e):e}function jc(e){return Se(Me(e))}function Me(e){let t={};for(let n of de)t[n]=-1*e[n]||0;return t}function Oa(e,t=de){let n=0;for(let r of t){let i=Math.sign(e[r]);i&&(n&&n!==i&&v("Cannot mix duration signs"),n=i)}return n}function Mn(e){for(let n of V1)Dt(n,e[n],-4294967295,4294967295,1);let t=nn(e);return Mg(Number(t/sr)),e}function Mg(e){Number.isSafeInteger(e)||v("Out-of-bounds duration")}function nn(e){return BigInt(e.days)*ce+yr(e)}function yr(e){return BigInt(e.hours)*v1+BigInt(e.minutes)*D1+Rg(e)}function Rg(e){return BigInt(e.seconds)*sr+BigInt(e.milliseconds)*Kr+BigInt(e.microseconds)*O1+BigInt(e.nanoseconds)}function In(e,t=6){let n=Number(e/ce),r=Number(e%ce),i=wt[t],o=t<=3?Number(e/BigInt(i)):n*(rn/i)+Zr(r,i);Number.isFinite(o)||v(Tn),t<=3&&Math.abs(o)/(On/wt[t])>=xE&&v(Tn);let s=Bc(r,t,de);return s[de[t]]=o,s}function Da(e,t=5){return Bc(e,t,de)}function Hc(e){return!!Oa(e,ig)}function _n(e){let t=9;for(;t>0&&!e[de[t]];t--);return t}function Bo(e,t){return ye(e.epochNanoseconds,t.epochNanoseconds)}function Ng(e,t,n,r){let i=e(rt(r).relativeTo),o=Math.max(_n(t),_n(n));return _h(de,t,n)?0:jr(o,i&&dr(i))?ye(nn(t),nn(n)):(i||v("Missing relativeTo"),ye(fh(i,t),fh(i,n)))}function Wc(e,t){return wr(e,t)||va(e,t)}function wr(e,t){return en(Mt(e),Mt(t))}function va(e,t){return en(Je(e),Je(t))}function Pg(e,t){return!Bo(e,t)}function Lg(e,t){return!Bo(e,t)&&e.timeZone.m===t.timeZone.m&&e.calendar===t.calendar}function Fg(e,t){return!Wc(e,t)&&e.calendar===t.calendar}function $g(e,t){return!wr(e,t)&&e.calendar===t.calendar}function Ug(e,t){return!wr(e,t)&&e.calendar===t.calendar}function zg(e,t){return!wr(e,t)&&e.calendar===t.calendar}function Bg(e,t){return!va(e,t)}function oi(e){return e===0?_1:e?e.k:void 0}function Ue(e,t,n=t){return oi(e)?n:t}function Gc(e,t){let n=e||void 0,r=oi(e),{era:i,eraYear:o,year:s}=t;if(s!==void 0&&(s=Ce(s,"year")),o!==void 0&&(o=Ce(o,"eraYear")),i!==void 0||o!==void 0){i!==void 0&&o!==void 0||ne("Mismatching era/eraYear"),r||v("Forbidden era/eraYear");let a=vh(i),l=r[a];l===void 0&&v((d=>`Invalid era: ${d}`)(i));let u=n?.$?n.$(o,a,l):kE(o,l);s!==void 0&&s!==u&&v("Mismatching year/eraYear"),s=u}else s===void 0&&ne(la(r));return s}function ia(e,t,n,r,i){let{month:o,monthCode:s}=t;if(s!==void 0){let a=((l,u,d,c,m=Rh(u))=>{let p=l?l.p(d):void 0,[f,x]=m,S=zu(f,x,p);if(x){let w=l?l.l:void 0;w===void 0&&v(or),w>0?(S>w&&v(or),p!==S&&(c===1&&v(or),S=zu(f,0,p))):(S!==-w&&v(or),p===void 0&&c===1&&v(or))}return S})(e,s,n,r,i);o!==void 0&&o!==a&&v("Mismatching month/monthCode"),o=a,r=1}else o===void 0&&ne("Missing month/monthCode");return Dt("month",o,1,xo(e,n),r)}function Vu(e,t,n,r,i){return Uu(t,"day",1,bo(e,r,n),i)}function kE(e,t){return(t+e)*(Math.sign(t)||1)||0}function qo(e,t){return fa(vt($e,{...Be,...e}),t)}var SE=Yr("([+-])(\\d{2})(?::?(\\d{2})(?::?(\\d{2})(?:[.,](\\d{1,9}))?)?)?");function Ma(e){let t=Vc(e);return t===void 0&&v(Ch(e)),t}function Vc(e,t){let n=SE.exec(e);if(n&&(r=>(i=>{i[0]!=="T"&&i[0]!=="t"||(i=i.slice(1));let o=i.search(/[.,]/),s=o<0?i:i.slice(0,o),a=s.split(":");return a.length===1?/^(?:\d{2}|\d{4}|\d{6})$/i.test(s):(a.length===2||a.length===3)&&a.every(l=>l.length===2&&/^\d{2}$/i.test(l))})(r.slice(1)))(n[0]))return((r,i)=>{let o=r[4]||r[5];return i&&o&&v(Qt(o)),a=(qr(r[2])*Oo+qr(r[3])*Ao+qr(r[4])*On+ec(r[5]||""))*tc(r[1]),Math.abs(a)>=rn&&v("Out-of-bounds offset"),a;var a})(n,t)}var at={era:bc,month:Xs,monthCode(e,t){if(typeof e=="string")return e;if(e&&typeof e=="object"){let n=e.toString;if(typeof n=="function")return ve(n.call(e),t)}return ve(e,t)},day:Xs},Yc=Co($e,Ce),qg=Co(de,xa),Zc=Object.assign({},at,Yc),Kc={offset(e){return Ma(bc(e))},...Zc};function pe(e,t,n,r,i=!r){let o={},s=0;for(let a of t){let l=e[a];if(l!==void 0){s=1;let u=n[a];u&&(l=u(l,a)),o[a]=l}else r&&r.includes(a)&&ne(To(a))}return i&&!s&&ne(wh(t)),o}function jo(e,t=Be,n){let r=ie(e,t);return hr(r),Rt(r,n)}function So(e,t,n){return jg(e,t,Hg(e,t),X(n))}function Ra(e,t,n){let r=Hg(e,t),i=n();return[jg(e,t,r,i[0]),...i]}function jg(e,t,n,r){let i=n[1],o=ia(e,t,i,r,n[0]);return le(qe(lr(e,i,o,Vu(e,t,o,i,r))),e)}function Jc(e){if(e.monthCode!==void 0)return Rh(e.monthCode)}function Hg(e,t){let n=oi(e);return t.year!==void 0||t.era!==void 0&&t.eraYear!==void 0||ne(la(n)),t.monthCode===void 0&&t.month===void 0&&ne("Missing month/monthCode"),t.day===void 0&&ne(To("day")),[Jc(t),Gc(e,t)]}function Xc(e,t,n){let r=oi(e);t.year!==void 0||t.era!==void 0&&t.eraYear!==void 0||ne(la(r)),t.monthCode===void 0&&t.month===void 0&&ne("Missing month/monthCode");let i=Jc(t),o=Gc(e,t);return le(ka(lr(e,o,ia(e,t,o,X(n),i),1)),e)}function Qc(e,t,n){let r=e===it,i=oi(e);t.day===void 0&&ne(To("day")),r||t.month===void 0||t.year!==void 0||t.era!==void 0&&t.eraYear!==void 0||ne(la(i));let o=Jc(t),s=t.eraYear!==void 0||t.year!==void 0?Gc(e,t):void 0,a=X(n),l,u,d;if(s===void 0&&r&&(s=1972),s!==void 0){r||qe(lr(e,s,1,1));let f=ia(e,t,s,a,o);l=Vu(e,t,f,s,a),[u,d]=ar(e,s,f)}else{t.monthCode===void 0&&ne("Missing month/monthCode"),[u,d]=o;let f=e?e.ne:1972;if(f!==void 0)l=Vu(e,t,ia(e,t,f,a,o),f,a);else{let x=a===0&&e?e.fe?.(u,d,t.day):void 0;l=x!==void 0?x:t.day}}d&&((e&&e.U?.[u])??1/0)<t.day&&(a===1&&v(or),d=0,l=Xu(t.day,1,(e&&e.R)??1/0));let c=e?e.u(u,!!d,l):ju(u,!!d);for(;!c&&a===0&&l>1;)l--,c=e?e.u(u,!!d,l):ju(u,!!d);c||v("Cannot guess year");let{year:m,month:p}=c;return le(qe(lr(e,m,p,l)),e)}var Nt=Intl.DateTimeFormat;function TE(e,t){t<-864e13&&v(Tn);let n=e.formatToParts(t),r={};for(let i of n)r[i.type]=i.value;return r}var EE={El_Aaiun:17,Tucuman:12,Tirane:11,Riga:10,Simferopol:9,Vienna:9,Tunis:8,Boa_Vista:6,Fortaleza:6,Maceio:6,Noronha:6,Recife:6,Gaza:6,Hebron:6,DeNoronha:6},Fu=-388152e4;function Wg(e,t=4){let n=Sc(e),r=Qr(e,4),i=Xr(e);return[r,...td(Wr(tn,i,0,t),n)]}function ed(e){return Ec(rt(e))}function Gg(e,t){return Wg(rt(e),t)}function td(e,t){return e!=null?[wt[e],e<4?9-3*e:-1]:[t===void 0?1:10**(9-t),t]}function nd(e,t,n){let[r,i,o,s]=(l=>{let u=Sc(l=rt(l)),d=Qr(l,4),c=Xr(l);return[l.timeZone,d,...td(Wr(tn,c,0,4),u)]})(n),a=r!==void 0;return((l,u,d,c,m,p)=>{d=Ia(d,BigInt(m),c);let f=u.B(d);return ud(Po(d+BigInt(f)),p)+(l?Ho(ra(f)):"Z")})(a,We(a?e(r):"UTC"),t.epochNanoseconds,i,o,s)}function rd(e,t){let n=(r=>{r=rt(r);let i=Ec(r),o=Sc(r),s=aE(r),a=Qr(r,4),l=Xr(r);return[i,sE(r),s,a,...td(Wr(tn,l,0,4),o)]})(t);return((r,i,o,s,a,l,u,d,c,m)=>{s=Ia(s,BigInt(c),d);let p=o.B(s);return ud(Po(s+BigInt(p)),m)+Ho(ra(p),u)+_E(i,l)+cd(r,a)})(e.calendar,e.timeZone.id,e.timeZone,e.epochNanoseconds,...n)}function id(e,t){let n=(r=>(r=rt(r),[Ec(r),...Wg(r)]))(t);return((r,i,o,s,a,l)=>ud(Sa(i,a,s),l)+cd(r,o))(e.calendar,e,...n)}function od(e,t){return n=e.calendar,r=e,i=ed(t),oa(r)+cd(n,i);var n,r,i}function sd(e,t){return Vg(e.calendar,Yg,e,ed(t))}function ad(e,t){return Vg(e.calendar,IE,e,ed(t))}function Vg(e,t,n,r){let i=r>1||r===0&&e!==it;return r===1?e===it?t(n):oa(n):i?oa(n)+Kg(yt(e),r===2):t(n)}function ld(e,t){return((n,r,i,o)=>Zg(Ta(n,i,r)[0],o))(e,...Gg(t))}function Na(e,t){let[n,r,i]=Gg(t,3);return r>1&&Mn(e={...e,...dE(e,r,n)}),CE(e,i)}function CE(e,t){let{sign:n}=e,r=n===-1?Me(e):e,{hours:i,minutes:o}=r,s=Rg(r),a=Number(s/sr),l=Number(s%sr);Mg(a);let u=dd(l,t),d=t>=0||!n||u;return(n<0?"-":"")+"P"+hh({Y:ir(r.years),M:ir(r.months),W:ir(r.weeks),D:ir(r.days)})+(i||o||a||d?"T"+hh({H:ir(i),M:ir(o),S:ir(a,d)+u}):"")}function hh(e){let t=[];for(let n in e){let r=e[n];r&&t.push(r,n)}return t.join("")}function ir(e,t){if(!e&&!t)return"";let n=Object.create(null);return n.useGrouping=0,e.toLocaleString("fullwide",n)}function ud(e,t){return oa(e)+"T"+Zg(e,t)}function oa(e){return Yg(e)+"-"+ht(e.day)}function Yg(e){let{year:t}=e;return(t<0||t>9999?Jg(t)+na(6,Math.abs(t)):na(4,t))+"-"+ht(e.month)}function IE(e){return ht(e.month)+"-"+ht(e.day)}function Zg(e,t){let n=[ht(e.hour),ht(e.minute)];return t!==-1&&n.push(ht(e.second)+((r,i,o,s)=>dd(r*_o+i*Io+o,s))(e.millisecond,e.microsecond,e.nanosecond,t)),n.join(":")}function Ho(e,t=0){if(t===1)return"";let[n,r]=Ot(Math.abs(e),Oo),[i,o]=Ot(r,Ao),[s,a]=Ot(o,On);return Jg(e)+ht(n)+":"+ht(i)+(s||a?":"+ht(s)+dd(a):"")}function _E(e,t){return t!==1?"["+(t===2?"!":"")+e+"]":""}function cd(e,t){return t>1||t===0&&e!==it?Kg(yt(e),t===2):""}function Kg(e,t){return"["+(t?"!":"")+"u-ca="+e+"]"}var AE=/0+$/;function dd(e,t){let n=na(9,e);return n=t===void 0?n.replace(AE,""):n.slice(0,t),n?"."+n:""}function Jg(e){return e<0?"-":"+"}var OE=/^(AC|AE|AG|AR|AS|BE|BS|CA|CN|CS|CT|EA|EC|IE|IS|JS|MI|NE|NS|PL|PN|PR|PS|SS|VS)T$/,DE=/[^\w\/:+-]+/;function Xg(e){return Pa(ve(e))}function Pa(e){return Qg(e).id}function Qg(e){let t=e.toUpperCase(),n=(i=>{let o=Vc(i,1);if(o!==void 0)return{id:Ho(o),X:o,m:o}})(t);if(n)return{kind:"fixed",...n};let r=t==="UTC"?"UTC":(i=>(DE.test(i)&&v(Ju(i)),OE.test(i)&&v("Forbidden ICU TimeZone"),i.toLowerCase().split("/").map((o,s)=>(o.length<=3||/\d/.test(o))&&!/etc|yap/.test(o)?o.toUpperCase():o.replace(/baja|dumont|[a-z]+/g,(a,l)=>a.length<=2&&!s||a==="in"||a==="chat"?a.toUpperCase():a.length>2||!l?uh(a).replace(/island|noronha|murdo|rivadavia|urville/,uh):a)).join("/")))(e);return vE(r)}var vE=Hr(e=>{if(e==="UTC")return{kind:"utc",id:e,m:e};let t=e.toUpperCase(),n=ME(t);return{kind:"named",id:e,format:n,m:n.resolvedOptions().timeZone}}),ME=Hr(e=>new Nt("en-u-hc-h23",{calendar:"iso8601",timeZone:e,era:"short",year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"}));function We(e){let t=Qg(e);return RE(t.id,t)}var RE=Hr((e,t)=>t.kind==="named"?new Zu(e,t.m,t.format):new Yu(e,t.m,t.kind==="fixed"?t.X:0)),Yu=class{constructor(t,n,r){this.id=t,this.m=n,this.X=r}B(){return this.X}N(t){return[_c(t,this.X)]}O(){}},Zu=class{constructor(t,n,r){this.id=t,this.m=n,this.ke=((i,o)=>{let s=Hr(i),a=Hr(NE),l=86400*o;function u(c){let[m,p]=yh(c,l),f=ea(m),x=ea(p),S=s(f),w=s(x);return S===w?S:d(a(f,x),S,w,c)}function d(c,m,p,f){let x,S;for(;(f===void 0||(x=f<c[0]?m:f>=c[1]?p:void 0)===void 0)&&(S=c[1]-c[0]);){let w=c[0]+Math.floor(S/2);i(w)===p?c[1]=w:c[0]=w+1}return x}return{xe(c){let m=u(c-86400),p=u(c+86400),f=c-m,x=c-p;if(m===p)return[f];let S=u(f);return S===u(x)?[c-S]:m>p?[f,x]:[]},we:u,O:function c(m,p){if(p>0&&m>=864e10)return;if(p<0){if(m<=Fu)return;let M=gh()+94867200;if(m>M)return c(M,-1)}let f=p>0?Math.max(m,Fu):m,[x,S]=yh(f,l),w=l*p,D=p>0?Math.max(m,gh())+94867200:Fu,T=()=>p<0?S>D:x<D;for(;T();){let M=ea(x),O=ea(S),b=s(M),E=s(O);if(b!==E){let R=a(M,O);d(R,b,E);let C=R[0];if((en(C,m)||1)===p)return C}x+=w,S+=w}}}})((i=>o=>{let s=TE(i,1e3*o);return 86400*wo((a=>{let l=a.relatedYear;if(l!==void 0)return parseInt(l);let u=parseInt(a.year);return a.era!==void 0&&vh(a.era)==="bce"?1-u:u})(s),parseInt(s.month),parseInt(s.day))+3600*parseInt(s.hour)+60*parseInt(s.minute)+parseInt(s.second)-o})(r),(i=>{let o=i.split("/").pop();return EE[o]||60})(t))}B(t){return this.ke.we((n=>ch(n)[0])(t))*On}N(t){let n=86400*Mt(t)+uc(t),r=Hh(t);return this.ke.xe(n).map(i=>xt(BigInt(i)*sr+BigInt(r)))}O(t,n){let[r,i]=ch(t),o=this.ke.O(r+(n>0||i?1:0),n);if(o!==void 0)return BigInt(o)*sr}};function gh(){return Math.floor(Date.now()/1e3)}function NE(e,t){return[e,t]}function yh(e,t){let n=Math.floor(e/t)*t;return[n,n+t]}function ea(e){return Xu(e,-1e10,864e10)}function ey(e,t,n){let r=pe(n,Ue(t,qh,jh),Kc,[],0);if(r.timeZone!==void 0){let i=So(t,r),o=qo(r),s=We(e(r.timeZone));return{epochNanoseconds:ni(s,ie(i,o),r.offset),timeZone:s,calendar:t}}return So(t,r)}function ty(e,t,n,r){let i=pe(n,Ue(t,qh,jh),Kc,ac,0),o=e(i.timeZone),[s,a,l,u]=Ra(t,i,()=>Gr(r)),d=qo(i,a),c=We(o);return bt(ni(c,ie(s,d),i.offset,l,u),c,t)}function ny(e,t,n){let r=pe(t,Ue(e,zh,Bh),Zc,[],0),[i,o]=Ra(e,r,()=>[X(n)]);return jo(i,qo(r,o),e)}function ry(e,t,n,r=[]){return So(e,pe(t,Ue(e,pr,fr),at,r),n)}function iy(e,t,n,r){return Xc(e,pe(t,Ue(e,vo,Fh),at,r),n)}function oy(e,t,n,r){let i=pe(n,Ue(e,pr,fr),at,mr,0);return t&&i.month!==void 0&&i.monthCode===void 0&&i.year===void 0&&(i.year=1972),Qc(e,i,r)}function sy(e,t){return qo(pe(e,qu,Yc,[],1),X(t))}function ay(e){let t=pe(e,rg,qg);return Se(Mn({...we,...t}))}function gt(e){v(Ch(e))}function ly(e){let t=Rn(e=bc(e)),n;return t||gt(e),t.C?n=0:t.offset?n=Ma(t.offset):gt(e),t.timeZoneId&&Vc(t.timeZoneId,1),Lo(t),st(_c(t,n))}function uy(e,t){let n=Rn(ve(e));return n||gt(e),n.timeZoneId?xy(n,t,void 0):(n.C&>(e),Ku(n,t))}function cy(e,t,n){let r=Rn(ve(e));return r&&r.timeZoneId||gt(e),xy(r,t,n)}function dy(e,t){let n=Rn(ve(e));return n&&!n.C||gt(e),by(n,t)}function my(e,t){let n=fd(pd(ve(e)),void 0,t);return le(n,n.calendar)}function py(e,t){let n=hd(ve(e));if(n)return md(n),le(ka(on(n)),t(n.calendarId));let r=fd(pd(e),PE,t),{calendar:i}=r;return le(ko(i,r),i)}function md(e){e.calendarId!=="iso8601"&&v(Qt(e.calendarId))}function fy(e,t){let n=gd(ve(e));if(n)return md(n),le(on(n),t(n.calendarId));let r=fd(pd(e),LE,t),{calendar:i}=r,{year:o,month:s,day:a}=ae(i,r),[l,u]=ar(i,o,s),{year:d,month:c}=((m,p,f,x)=>{let S=m?m.u(p,f,x):ju(p,f);return S||v("Cannot guess year"),S})(i,l,u,a);return le(qe(lr(i,d,c,a)),i)}function hy(e){let t=(r=>{let i=ky(r);return i?(Wo(i[13]),Sy(i,1)):void 0})(e=ve(e));if(!t){let r=Rn(e);r&&r.re||gt(e),r.C&&v(Qt("Z")),md(r),t=r}let n;return(n=hd(e))&&dh(n)&>(e),(n=gd(e))&&dh(n)&>(e),gr(Ro(t))}function gy(e){let t=jE.exec(ve(e));return t||gt(e),Se(Mn((n=>{let r=0,i=0,o=0,s={years:a(n[2]),months:a(n[3]),weeks:a(n[4]),days:a(n[5]),hours:a(n[6],n[7],5),minutes:a(n[8],n[9],4),seconds:a(n[10],n[11],3),...Bc(o,2,de)};return r||v(wh(de)),tc(n[1])<0&&(s=Me(s)),s;function a(l,u,d){let c=0,m=0;return d&&([c,o]=Ot(o,wt[d])),l!==void 0&&(i&&v(Qt(l)),m=(p=>{let f=parseInt(p);return Number.isFinite(f)||v(Qt(p)),f})(l),r=1,u&&(o=ec(u)*(wt[d]/On),i=1)),c+m}})(t)))}function yy(e){let t=Rn(e)||hd(e)||gd(e);if(t)return t.calendarId;let n=ky(e);return n?Wo(n[13]).calendarId:e}function wy(e){let t=Rn(e);return t&&(t.timeZoneId||t.C&&"UTC"||t.offset)||e}function pd(e){let t=Rn(e);return t&&!t.C||gt(e),t}function fd(e,t,n){return t&&e.calendarId==="iso8601"?(on(e),e.re&&Ro(e),Ku(t(e),n)):e.re?by(e,n):Ku(e,n)}function PE(e){let t=12*e.year+e.month===mg?20:1;return{...e,day:t}}function LE(e){return{...e,year:1972}}function xy(e,t,n){let r=We(Pa(e.timeZoneId)),i;if(Lo(e),e.re){let s=e.offset?Ma(e.offset):void 0,[,a,l]=Gr(n);i=ni(r,e,s,a,l,!(r.X||e.offset===void 0||(o=e.offset,o.replace(/\D/g,"").length>4)),e.C)}else Gr(n),i=Cn(r,e);var o;return xt(i),bt(i,r,t(e.calendarId))}function by(e,t){return Lo(e),hr(e),{...ie(e,e),calendar:t(e.calendarId)}}function Ku(e,t){return on(e),qe(e),{calendar:t(e.calendarId),year:e.year,month:e.month,day:e.day}}function sa(e){return`(\\d{2})(?:(:?)(\\d{2})(?:\\${e}(\\d{2})(?:[.,](\\d{1,9}))?)?)?`}var FE="(?:(?:([+-])(\\d{6}))|(\\d{4}))(-?)(\\d{2})\\4(\\d{2})(?:[T ]"+sa(8)+"(Z|([+-])"+sa(15)+")?)?",$E=Yr("(?:(?:([+-])(\\d{6}))|(\\d{4}))-?(\\d{2})((?:\\[(!?)([^\\]]*)\\]){0,9})"),UE=Yr("(?:--)?(\\d{2})-?(\\d{2})((?:\\[(!?)([^\\]]*)\\]){0,9})"),zE=Yr(FE+"((?:\\[(!?)([^\\]]*)\\]){0,9})"),BE=Yr("T?"+sa(2)+`(([+-])${sa(9)})?((?:\\[(!?)([^\\]]*)\\]){0,9})`),qE=new RegExp("\\[(!?)([^\\]]*)\\]","g"),jE=Yr("([+-])?P(\\d+Y)?(\\d+M)?(\\d+W)?(\\d+D)?(?:T(?!$)(?:(\\d+)(?:[.,](\\d{1,9}))?H)?(?:(\\d+)(?:[.,](\\d{1,9}))?M)?(?:(\\d+)(?:[.,](\\d{1,9}))?S)?)?");function Rn(e){let t=zE.exec(e);return t?(n=>{let r=n[12],i=(r||"").toUpperCase()==="Z";return{year:Ty(n),month:parseInt(n[5]),day:parseInt(n[6]),...Sy(n,7),...Wo(n[19]),re:!!n[7],C:i,offset:i?void 0:r}})(t):void 0}function hd(e){let t=$E.exec(e);if(t)return(n=>({year:Ty(n),month:parseInt(n[4]),day:1,...Wo(n[5])}))(t)}function gd(e){let t=UE.exec(e);return t?(n=>({year:1972,month:parseInt(n[1]),day:parseInt(n[2]),...Wo(n[3])}))(t):void 0}function ky(e){let t=BE.exec(e);if(t)return t[6]&&Ma(t[6]),t}function Sy(e,t){let n=qr(e[t+3]);return{...cc(ec(e[t+4]||""))[0],hour:qr(e[t]),minute:qr(e[t+2]),second:n===60?59:n}}function Ty(e){let t=tc(e[1]),n=parseInt(e[2]||e[3]);return t<0&&!n&&v(Qt(-0)),t*n}function Wo(e){let t,n,r=[];return e.replace(qE,(i,o,s)=>{let a=!!o,[l,u]=s.split("=").reverse();return u?u==="u-ca"?(r.push(l.toLowerCase()),t||(t=a)):(a||/[A-Z]/.test(u))&&v(Qt(i)):(n&&v(Qt(i)),n=l),""}),r.length>1&&t&&v(Qt(e)),{timeZoneId:n,calendarId:r[0]||"iso8601"}}function si(e,t,n){let r=Object.assign(Object.create(null),t);return $u(r,n,Lh),oi(e)&&($u(r,n,M1),e&&e.ge&&$u(r,n,R1,Jr)),r}function $u(e,t,n,r){let i=0,o=[];for(let s of n)t[s]!==void 0?i=1:o.push(s);if(Object.assign(e,t),i)for(let s of r||o)delete e[s]}function Ey(e,t,n){let{calendar:r,timeZone:i}=e,o=Ue(r,P1,L1),s=xe(e),{year:a,month:l,day:u}=ae(r,s),d={year:a,monthCode:Go(r,a,l),day:u,hour:s.hour,minute:s.minute,second:s.second,millisecond:s.millisecond,microsecond:s.microsecond,nanosecond:s.nanosecond,offset:s.offsetNanoseconds},c=pe(t,o,Kc),m=si(r,d,c),p={...d,...c},[f,x,S,w]=Ra(r,m,()=>Gr(n,2));return bt(ni(i,ie(f,fa(p,x)),p.offset,S,w),i,r)}function Cy(e,t,n){let{calendar:r}=e,i=Ue(r,zh,Bh),{year:o,month:s,day:a}=ae(r,e),l={year:o,monthCode:Go(r,o,s),day:a,hour:e.hour,minute:e.minute,second:e.second,millisecond:e.millisecond,microsecond:e.microsecond,nanosecond:e.nanosecond},u=pe(t,i,Zc),d=si(r,l,u),c={...l,...u},[m,p]=Ra(r,d,()=>[X(n)]);return jo(m,fa(c,p),r)}function Iy(e,t,n){let{calendar:r}=e,i=Ue(r,pr,fr),{year:o,month:s,day:a}=ae(r,e);return So(r,si(r,{year:o,monthCode:Go(r,o,s),day:a},pe(t,i,at)),n)}function _y(e,t,n){let{calendar:r}=e,i=Ue(r,vo,Fh),{year:o,month:s}=ae(r,e);return Xc(r,si(r,{year:o,monthCode:Go(r,o,s)},pe(t,i,at)),n)}function Ay(e,t,n){let{calendar:r}=e,i=Ue(r,pr,fr),{year:o,month:s,day:a}=ae(r,e);return Qc(r,si(r,{monthCode:Go(r,o,s),day:a},pe(t,i,at)),n)}function Oy(e,t,n){return((r,i,o)=>qo({...vt(qu,r),...pe(i,qu,Yc)},X(o)))(e,t,n)}function Dy(e,t){return Se((n=e,r=t,Mn({...n,...pe(r,rg,qg)})));var n,r}function Go(e,t,n){let[r,i]=ar(e,t,n);return Nh(r,i)}function vy(e,t,n){return bt(e.epochNanoseconds,t,n)}function My(e){return st(e.epochNanoseconds)}function yd(e){return Rt(xe(e),e.calendar)}function wd(e){return le(xe(e),e.calendar)}function xd(e){return gr(xe(e))}function Ry(e,t,n){let r=ri(t,e,(i=>lg(rt(i)))(n));return bt(xt(r),t,e.calendar)}function Ny(e,t,n,r){let i=e(r.timeZone),o=r.plainTime,s=o!==void 0?t(o):void 0,a=We(i),l;return l=s?ri(a,ie(n,s)):Cn(a,ie(n,Be)),bt(l,a,n.calendar)}function Py(e,t,n){return Uy(e,vt(Ue(e,Mo,$h),t),pe(rr(n),mr,at,[]))}function Ly(e,t,n){let r=Ue(e,ma,N1);return Uy(e,vt(Uh,t),pe(rr(n),r,at,[]))}function Fy(e,t){return Qc(e,pe(t,Uh,at))}function $y(e,t,n){return Xc(e,pe(t,Ue(e,Mo,$h),at),n)}function Uy(e,t,n){let r=Ue(e,F1,$1),i=si(e,t,n);return i=pe(i,r,at,[]),So(e,i)}function zy(e){return st(xt(BigInt(xa(e))*Kr))}function By(e){return st(xt(wa(e)))}function ai(e){return e.timeZone="UTC",["full","long"].includes(e.timeStyle)&&(e.timeStyle="medium"),e}function qy(e,t){return e.timeZone!==void 0&&ne("Cannot specify TimeZone"),e.timeZone=t,e}function li(e,t,n){let r=e.resolvedOptions().calendar;!n&&t.calendar===it||yt(t.calendar)===r||v("Mismatching Calendars")}function xr(e,t,n,r,i){let o=new Set(e),s=new Set(t),a=new Set(n);return(l,u)=>{let d,c,m={},p={},f={},x=0,S=0;for(let C of Object.keys(l)){let y=l[C];y===void 0||a.has(C)||(o.has(C)?C==="dateStyle"?d=y:C==="timeStyle"?c=y:m[C]=y:C==="era"?p[C]=y:s.has(C)?C==="dateStyle"||C==="timeStyle"?S=1:x=1:f[C]=y)}let w=d!==void 0,D=c!==void 0,T=w||D,M=Object.keys(m).length>0,O=x||S,b=M||w||D,E=Object.keys(p).length>0;(!u&&O||u&&O&&!b||T&&(M||E||x))&&ne("Invalid formatting options");let R={};return T||b||Object.assign(R,r),Object.assign(R,m,p,f),w&&(i?Object.assign(R,i[d]):R.dateStyle=d),D&&(R.timeStyle=c),R}}var jy={year:"numeric",month:"numeric",day:"numeric"},Hy={hour:"numeric",minute:"numeric",second:"numeric"},bd=Object.assign({},jy,Hy),kd=["weekday","year","month","day","dateStyle"],Vo=["dayPeriod","hour","minute","second","fractionalSecondDigits","timeStyle"],Sd=kd.concat(Vo),HE=["weekday","day"].concat(Vo),WE=["weekday","year"].concat(Vo),Wy=xr(Sd,[],[],bd),Gy=xr(Sd,[],[],{...bd,timeZoneName:"short"}),Vy=xr(Sd,[],["timeZoneName"],bd),Yy=xr(kd,Vo,["timeZoneName"],jy),Zy=xr(Vo,kd,["timeZoneName","era"],Hy),Ky=xr(["year","month","dateStyle"],HE,["timeZoneName"],{year:"numeric",month:"numeric"},{full:{year:"numeric",month:"long"},long:{year:"numeric",month:"long"},medium:{year:"numeric",month:"short"},short:{year:"2-digit",month:"numeric"}}),Jy=xr(["month","day","dateStyle"],WE,["timeZoneName","era"],{month:"numeric",day:"numeric"},{full:{month:"long",day:"numeric"},long:{month:"long",day:"numeric"},medium:{month:"short",day:"numeric"},short:{month:"numeric",day:"numeric"}});function Xy(e,t){let{timeZone:n}=e,r=xe(e),{offsetNanoseconds:i}=r,o=t||Be,s;return s=t?ni(n,ie(r,o),i,2):Cn(n,ie(r,o)),bt(s,n,e.calendar)}function La(e){let t=Fa(),n=e.B(t);return Po(t+BigInt(n))}function Fa(){return BigInt(Date.now())*Kr}function ui(){return new Nt().resolvedOptions().timeZone}var Td="PlainYearMonth",Ed="PlainMonthDay",Cd="PlainDate",Id="PlainDateTime",_d="PlainTime",Ad="ZonedDateTime",Od="Instant",Dd="Duration";function an(e,t,n,...r){return Object.defineProperties(t,Ih(e)),Object.defineProperties(t.prototype,Eo("Temporal."+e)),Object.defineProperties(t.prototype,An(i=>({get(){return i(n(this))},configurable:1}),Object.assign({},...r))),t}var ln=Qu.name==="noop"?e=>{Object.defineProperty(e,"_str_",{value:e.toJSON()})}:Qu;function un(){ne(Sh)}function cn(){ne(kh)}var ew={era(e){return Fo(e.calendar,e).era},eraYear(e){return Fo(e.calendar,e).eraYear},year(e){return ae(e.calendar,e).year},month(e){return ae(e.calendar,e).month},monthCode(e){return ya(e.calendar,e)}},$a={era(e){return Fo(e.calendar,e).era},eraYear(e){return Fo(e.calendar,e).eraYear},year(e){return ae(e.calendar,e).year},month(e){return ae(e.calendar,e).month},monthCode(e){return ya(e.calendar,e)},day(e){return ae(e.calendar,e).day}},tw={monthCode(e){return ya(e.calendar,e)},day(e){return ae(e.calendar,e).day}},vd={daysInMonth(e){return pc(e.calendar,e)},daysInYear(e){return fc(e.calendar,e)},monthsInYear(e){return mc(e.calendar,e)},inLeapYear(e){return dc(e.calendar,e)}},Yo={dayOfWeek(e){return ga(e)},dayOfYear(e){return eg(e.calendar,e)},weekOfYear(e){return tg(e.calendar,e)},yearOfWeek(e){return ng(e.calendar,e)},daysInWeek(){return 7},daysInMonth(e){return pc(e.calendar,e)},daysInYear(e){return fc(e.calendar,e)},monthsInYear(e){return mc(e.calendar,e)},inLeapYear(e){return dc(e.calendar,e)}};function Qy(e){return ca(Object.keys(e))}Qy(vd),Qy(Yo);function Fn(e){let t=ve(e).toLowerCase();return t===ic?it:t===Dh?Mh:void v(Eh(e,"temporal-polyfill/full"))}function Jo(e=ic){return Fn(e)}var rw=new WeakMap,iw=an(Ad,class{constructor(e,t,n=void 0){let r=xt(wa(e)),i=We(Xg(t)),o=Jo(n);ow(this,bt(r,i,o))}static from(e,t=void 0){return Ge(ci(e,t))}static compare(e,t){return Bo(ci(e),ci(t))}get calendarId(){return yt(ee(this).calendar)}get timeZoneId(){return ee(this).timeZone.id}get epochMilliseconds(){return Uo(ee(this))}get epochNanoseconds(){return Ac(ee(this))}get offset(){return Ho(xe(ee(this)).offsetNanoseconds)}get offsetNanoseconds(){return xe(ee(this)).offsetNanoseconds}get hoursInDay(){return yg(ee(this))}with(e,t=void 0){return Ge(Ey(ee(this),hi(e),t))}withCalendar(e){return Ge({...ee(this),calendar:Ba(e)})}withTimeZone(e){return Ge({...ee(this),timeZone:We(ct(e))})}withPlainTime(e=void 0){return Ge(Xy(ee(this),Pd(e)))}add(e,t=void 0){let n=ee(this);return Ge(ur(n,_e(e),t))}subtract(e,t=void 0){let n=ee(this);return Ge(ur(n,Me(_e(e)),t))}until(e,t=void 0){let n=ee(this),r=ci(e),i=sn(n.calendar,r.calendar);return be(Se(Nc(0,i,n,r,t)))}since(e,t=void 0){let n=ee(this),r=ci(e),i=sn(n.calendar,r.calendar);return be(Se(Nc(1,i,n,r,t)))}round(e){let t=ee(this),[n,r,i]=$o(e);return Ge(gg(t,n,r,i))}startOfDay(){return Ge(wg(ee(this)))}equals(e){return Lg(ee(this),ci(e))}toInstant(){return dn(My(ee(this)))}toPlainDateTime(){return Pt(yd(ee(this)))}toPlainDate(){return Lt(wd(ee(this)))}toPlainTime(){return Ln(xd(ee(this)))}toLocaleString(e=void 0,t={}){let n=ee(this),r=new Nt(e,qy(Gy(t),Sg(n)));return li(r,n),r.format(Uo(n))}toString(e=void 0){return rd(ee(this),e)}toJSON(){return rd(ee(this))}getTimeZoneTransition(e){let t=ee(this),n=bg(t,e);return n?Ge({...t,epochNanoseconds:n}):null}valueOf(){return cn()}},GE,$a,Yo,Do);function Ge(e){return ow(Object.create(iw.prototype),e)}function ee(e){return Ft(e)||un()}function GE(e){let t=ee(e);return{...xe(t),calendar:t.calendar}}function Ft(e){return rw.get(e)}function ci(e,t){if(je(e)){let n=Ft(e);if(n)return Gr(t),n;let r=Xo(e);return ty(ct,r,e,t)}return cy(e,Fn,t)}function ow(e,t){return rw.set(e,t),ln(e),e}function ct(e){if(je(e)){let t=Ft(e);return t||ne(Ju(e)),t.timeZone.id}return(t=>Pa(wy(ve(t))))(e)}var sw=new WeakMap,aw=an(Od,class{constructor(e){let t=xt(wa(e));uw(this,st(t))}static from(e){return dn(di(e))}static fromEpochMilliseconds(e){return dn(zy(e))}static fromEpochNanoseconds(e){return dn(By(e))}static compare(e,t){return Bo(di(e),di(t))}get epochMilliseconds(){return Uo(lt(this))}get epochNanoseconds(){return Ac(lt(this))}add(e){let t=lt(this);return dn(st(Mc(t.epochNanoseconds,_e(e))))}subtract(e){let t=lt(this);return dn(st(Mc(t.epochNanoseconds,Me(_e(e)))))}until(e,t=void 0){return be(Rc(0,lt(this),di(e),t))}since(e,t=void 0){return be(Rc(1,lt(this),di(e),t))}round(e){let t=lt(this),[n,r,i]=$o(e,5,1);return dn(st(Ia(t.epochNanoseconds,zo(n,r),i)))}equals(e){return Pg(lt(this),di(e))}toZonedDateTimeISO(e){return Ge(vy(lt(this),We(ct(e))))}toLocaleString(e=void 0,t={}){let n=lt(this);return new Nt(e,Wy(t)).format(Uo(n))}toString(e=void 0){return nd(ct,lt(this),e)}toJSON(){return nd(ct,lt(this))}valueOf(){return cn()}});function dn(e){return uw(Object.create(aw.prototype),e)}function lt(e){return Rd(e)||un()}function Rd(e){return sw.get(e)}function di(e){if(je(e)){let t=Rd(e);if(t)return t;let n=Ft(e);if(n)return st(n.epochNanoseconds)}return ly(e)}var{toTemporalInstant:lw}={toTemporalInstant(){let e=Date.prototype.valueOf.call(this);return dn(st(BigInt(wc(e))*Kr))}};function uw(e,t){return sw.set(e,t),ln(e),e}var cw=new WeakMap,dw=an(Ed,class{constructor(e,t,n=void 0,r){let i=Ce(e),o=Ce(t),s=Jo(n),a=Ce(r??Yh),l=qe(on({year:a,month:i,day:o}));mw(this,le(l,s))}static from(e,t=void 0){return Md(nw(e,t))}get calendarId(){return yt(Nn(this).calendar)}with(e,t=void 0){return Md(Ay(Nn(this),hi(e),t))}equals(e){return zg(Nn(this),nw(e))}toPlainDate(e){let t=Nn(this);return Lt(Ly(t.calendar,this,e))}toLocaleString(e=void 0,t={}){let n=Nn(this),r=new Nt(e,ai(Jy(t)));return li(r,n,1),r.format(No(n))}toString(e=void 0){return ad(Nn(this),e)}toJSON(){return ad(Nn(this))}valueOf(){return cn()}},Nn,tw);function Md(e){return mw(Object.create(dw.prototype),e)}function Nn(e){return Ua(e)||un()}function Ua(e){return cw.get(e)}function nw(e,t){if(je(e)){let r=Ua(e);if(r)return X(t),r;let i=Cw(e);return oy(i===void 0?it:i,i===void 0,e,t)}let n=fy(e,Fn);return X(t),n}function mw(e,t){return cw.set(e,t),ln(e),e}var pw=new WeakMap,fw=an(Td,class{constructor(e,t,n=void 0,r){let i=Ce(e),o=Ce(t),s=Jo(n),a=Ce(r??1),l=ka(on({year:i,month:o,day:a}));hw(this,le(l,s))}static from(e,t=void 0){return Ko(mi(e,t))}static compare(e,t){return wr(mi(e),mi(t))}get calendarId(){return yt(ut(this).calendar)}with(e,t=void 0){return Ko(_y(ut(this),hi(e),t))}add(e,t=void 0){let n=ut(this);return Ko(le(vc(0,n.calendar,n,_e(e),t),n.calendar))}subtract(e,t=void 0){let n=ut(this);return Ko(le(vc(1,n.calendar,n,_e(e),t),n.calendar))}until(e,t=void 0){let n=ut(this),r=mi(e),i=sn(n.calendar,r.calendar);return be(Fc(0,i,n,r,t))}since(e,t=void 0){let n=ut(this),r=mi(e),i=sn(n.calendar,r.calendar);return be(Fc(1,i,n,r,t))}equals(e){return Ug(ut(this),mi(e))}toPlainDate(e){let t=ut(this);return Lt(Py(t.calendar,this,e))}toLocaleString(e=void 0,t={}){let n=ut(this),r=new Nt(e,ai(Ky(t)));return li(r,n,1),r.format(No(n))}toString(e=void 0){return sd(ut(this),e)}toJSON(){return sd(ut(this))}valueOf(){return cn()}},ut,ew,vd);function Ko(e){return hw(Object.create(fw.prototype),e)}function ut(e){return za(e)||un()}function za(e){return pw.get(e)}function mi(e,t){if(je(e)){let r=za(e);if(r)return X(t),r;let i=Xo(e);return iy(i,e,t)}let n=py(e,Fn);return X(t),n}function hw(e,t){return pw.set(e,t),ln(e),e}function VE(e){if(!je(e))return;let t=Rd(e);return t?[Od,t]:(t=Ft(e),t?[Ad,t]:(t=br(e),t?[Id,t]:(t=gi(e),t?[Cd,t]:(t=Nd(e),t?[_d,t]:(t=za(e),t?[Td,t]:(t=Ua(e),t?[Ed,t]:(t=Ld(e),t?[Dd,t]:void 0)))))))}function hi(e){return(VE(e)||e.calendar!==void 0||e.timeZone!==void 0)&&ne(xh),e}var gw=new WeakMap,yw=an(_d,class{constructor(e=0,t=0,n=0,r=0,i=0,o=0){let s=Ro(An(Ce,{hour:e,minute:t,second:n,millisecond:r,microsecond:i,nanosecond:o}));ww(this,gr(s))}static from(e,t=void 0){return Ln(Pn(e,t))}static compare(e,t){return va(Pn(e),Pn(t))}with(e,t=void 0){return Ln(Oy(kt(this),hi(e),t))}add(e){let t=kt(this);return Ln(_a(t,_e(e))[0])}subtract(e){let t=kt(this);return Ln(_a(t,Me(_e(e)))[0])}until(e,t=void 0){return be($c(0,kt(this),Pn(e),t))}since(e,t=void 0){return be($c(1,kt(this),Pn(e),t))}round(e){let t=kt(this),[n,r,i]=$o(e,5);return Ln(Ta(t,ti(n,r),i)[0])}equals(e){return Bg(kt(this),Pn(e))}toLocaleString(e=void 0,t={}){let n=kt(this);return new Nt(e,ai(Zy(t))).format(lc(n))}toString(e=void 0){return ld(kt(this),e)}toJSON(){return ld(kt(this))}valueOf(){return cn()}},kt,Do);function Ln(e){return ww(Object.create(yw.prototype),e)}function kt(e){return Nd(e)||un()}function Nd(e){return gw.get(e)}function Pn(e,t){if(je(e)){let r=Nd(e);if(r)return X(t),r;let i=br(e);if(i)return X(t),gr(i);let o=Ft(e);return o?(X(t),xd(o)):sy(e,t)}let n=hy(e);return X(t),n}function Pd(e){return e===void 0?void 0:Pn(e)}function ww(e,t){return gw.set(e,t),ln(e),e}var xw=new WeakMap,bw=an(Id,class{constructor(e,t,n,r=0,i=0,o=0,s=0,a=0,l=0,u=void 0){let d=hr(Lo(An(Ce,{year:e,month:t,day:n,hour:r,minute:i,second:o,millisecond:s,microsecond:a,nanosecond:l}))),c=Jo(u);kw(this,Rt(d,c))}static from(e,t=void 0){return Pt(pi(e,t))}static compare(e,t){let n=pi(e),r=pi(t);return Wc(n,r)}get calendarId(){return yt(Ie(this).calendar)}with(e,t=void 0){return Pt(Cy(Ie(this),hi(e),t))}withCalendar(e){let t=Ie(this);return Pt(Rt(t,Ba(e)))}withPlainTime(e=void 0){let t=Ie(this);return Pt(jo(t,Pd(e),t.calendar))}add(e,t=void 0){let n=Ie(this);return Pt(Rt(cr(n.calendar,n,_e(e),t),n.calendar))}subtract(e,t=void 0){let n=Ie(this);return Pt(Rt(cr(n.calendar,n,Me(_e(e)),t),n.calendar))}until(e,t=void 0){let n=Ie(this),r=pi(e),i=sn(n.calendar,r.calendar);return be(Pc(0,i,n,r,t))}since(e,t=void 0){let n=Ie(this),r=pi(e),i=sn(n.calendar,r.calendar);return be(Pc(1,i,n,r,t))}round(e){let t=Ie(this),[n,r,i]=$o(e);return Pt(Rt(Sa(t,ti(n,r),i),t.calendar))}equals(e){return Fg(Ie(this),pi(e))}toZonedDateTime(e,t=void 0){return Ge(Ry(Ie(this),We(ct(e)),t))}toPlainDate(){let e=Ie(this);return Lt(le(e,e.calendar))}toPlainTime(){return Ln(gr(Ie(this)))}toLocaleString(e=void 0,t={}){let n=Ie(this),r=new Nt(e,ai(Vy(t)));return li(r,n),r.format(Gh(n))}toString(e=void 0){return id(Ie(this),e)}toJSON(){return id(Ie(this))}valueOf(){return cn()}},Ie,$a,Yo,Do);function Pt(e){return kw(Object.create(bw.prototype),e)}function Ie(e){return br(e)||un()}function br(e){return xw.get(e)}function pi(e,t){if(je(e)){let r=br(e);if(r)return X(t),r;let i=gi(e);if(i)return X(t),Rt(ie(i,Be),i.calendar);let o=Ft(e);if(o)return X(t),yd(o);let s=Xo(e);return ny(s,e,t)}let n=dy(e,Fn);return X(t),n}function kw(e,t){return xw.set(e,t),ln(e),e}var Sw=new WeakMap,Tw=an(Cd,class{constructor(e,t,n,r=void 0){let i=qe(on(An(Ce,{year:e,month:t,day:n}))),o=Jo(r);Ew(this,le(i,o))}static from(e,t=void 0){return Lt(fi(e,t))}static compare(e,t){return wr(fi(e),fi(t))}get calendarId(){return yt(Re(this).calendar)}with(e,t=void 0){let n=Re(this);return Lt(Iy(n,hi(e),t))}withCalendar(e){let t=Re(this);return Lt(le(t,Ba(e)))}add(e,t=void 0){let n=Re(this);return Lt(le(ii(n.calendar,n,_e(e),t),n.calendar))}subtract(e,t=void 0){let n=Re(this);return Lt(le(ii(n.calendar,n,Me(_e(e)),t),n.calendar))}until(e,t=void 0){let n=Re(this),r=fi(e),i=sn(n.calendar,r.calendar);return be(Lc(0,i,n,r,t))}since(e,t=void 0){let n=Re(this),r=fi(e),i=sn(n.calendar,r.calendar);return be(Lc(1,i,n,r,t))}equals(e){return $g(Re(this),fi(e))}toZonedDateTime(e){let t=je(e)?{timeZone:e.timeZone,plainTime:e.plainTime}:{timeZone:e};return Ge(Ny(ct,Pn,Re(this),t))}toPlainDateTime(e=void 0){let t=Re(this);return Pt(jo(t,Pd(e),t.calendar))}toPlainYearMonth(){let e=Re(this);return Ko($y(e.calendar,this))}toPlainMonthDay(){let e=Re(this);return Md(Fy(e.calendar,this))}toLocaleString(e=void 0,t={}){let n=Re(this),r=new Nt(e,ai(Yy(t)));return li(r,n),r.format(No(n))}toString(e=void 0){return od(Re(this),e)}toJSON(){return od(Re(this))}valueOf(){return cn()}},Re,$a,Yo);function Lt(e){return Ew(Object.create(Tw.prototype),e)}function Re(e){return gi(e)||un()}function gi(e){return Sw.get(e)}function fi(e,t){if(je(e)){let r=gi(e);if(r)return X(t),r;let i=br(e);if(i)return X(t),le(i,i.calendar);let o=Ft(e);if(o)return X(t),wd(o);let s=Xo(e);return ry(s,e,t)}let n=my(e,Fn);return X(t),n}function Ew(e,t){return Sw.set(e,t),ln(e),e}function Xo(e){let t=Cw(e);return t===void 0?it:t}function Cw(e){let{calendar:t}=e;if(t!==void 0)return Ba(t)}function Ba(e){if(je(e)){let t=gi(e)||br(e)||Ft(e)||Ua(e)||za(e);return t||ne(Th(e)),t.calendar}return(t=>Fn(yy(ve(t))))(e)}var Iw=new WeakMap,_w=an(Dd,class{constructor(e=0,t=0,n=0,r=0,i=0,o=0,s=0,a=0,l=0,u=0){let d=Mn(An(xa,{years:e,months:t,weeks:n,days:r,hours:i,minutes:o,seconds:s,milliseconds:a,microseconds:l,nanoseconds:u}));Aw(this,Se(d))}static from(e){return be(_e(e))}static compare(e,t,n=void 0){return Ng(Zo,_e(e),_e(t),n)}get sign(){return Xe(this).sign}get blank(){return!Xe(this).sign}with(e){return be(Dy(Xe(this),e))}negated(){return be(jc(Xe(this)))}abs(){return be(vg(Xe(this)))}add(e,t=void 0){return be(qc(Zo,0,Xe(this),_e(e),t))}subtract(e,t=void 0){return be(qc(Zo,1,Xe(this),_e(e),t))}round(e){return be(Dg(Zo,Xe(this),e))}total(e){return fg(Zo,Xe(this),e)}toLocaleString(e=void 0,t){let n=Xe(this);return Intl.DurationFormat?new Intl.DurationFormat(e,t).format(n):Na(n,t)}toString(e=void 0){return Na(Xe(this),e)}toJSON(){return Na(Xe(this))}valueOf(){return cn()}},Xe,hc);function be(e){return Aw(Object.create(_w.prototype),e)}function Xe(e){return Ld(e)||un()}function Ld(e){return Iw.get(e)}function _e(e){return je(e)?Ld(e)||ay(e):gy(e)}function Zo(e){if(e!==void 0){if(je(e)){let t=Ft(e);if(t)return t;let n=gi(e);if(n)return n;let r=br(e);if(r)return le(r,r.calendar);let i=Xo(e);return ey(ct,i,e)}return uy(e,Fn)}}function Aw(e,t){return Iw.set(e,t),ln(e),e}var YE=Object.defineProperties({},{...Eo("Temporal.Now"),...ua({timeZoneId(){return ui()},instant(){return dn(st(Fa()))},zonedDateTimeISO(e=ui()){let t=We(ct(e));return Ge(bt(Fa(),t))},plainDateTimeISO(e=ui()){let t=La(We(ct(e)));return Pt(Rt(t))},plainDateISO(e=ui()){let t=La(We(ct(e)));return Lt(le(t))},plainTimeISO(e=ui()){let t=La(We(ct(e)));return Ln(gr(t))}})}),Ow=Object.defineProperties({},{...Eo("Temporal"),...ua({PlainYearMonth:fw,PlainMonthDay:dw,PlainDate:Tw,PlainTime:yw,PlainDateTime:bw,ZonedDateTime:iw,Instant:aw,Duration:_w,Now:YE})});var Qo=Ou||Ow;var SL=Ou?Date.prototype.toTemporalInstant:lw;var ZE=120,Fd=365*24*60*60*1e3;var Dw=/^[\s,.;:!?()[\]{}]*$/u;function Ae(e){return{ok:!1,reason:e}}function KE(e){let t=e.now instanceof Date?e.now.getTime():Number.NaN;if(!Number.isFinite(t))return Ae("invalid_reference_time");let n=typeof e.timeZone=="string"?e.timeZone.trim():"";if(n.length===0)return Ae("invalid_time_zone");try{new Intl.DateTimeFormat("en-US",{timeZone:n}).format(e.now);let r=Qo.Instant.fromEpochMilliseconds(t),i=r.toZonedDateTimeISO(n);return{nowMs:t,timeZone:n,nowInstant:r,nowZoned:i}}catch{return Ae("invalid_time_zone")}}function JE(e){return"ok"in e&&e.ok===!1}function kr(e,t=2){return String(e).padStart(t,"0")}function XE(e){return[`${kr(e.year,4)}-${kr(e.month)}-${kr(e.day)}`,`${kr(e.hour)}:${kr(e.minute)}:${kr(e.second)}.${kr(e.millisecond,3)}`].join("T")}function QE(e){let t=Number(e.instant.epochMilliseconds);if(t<=e.context.nowMs)return Ae("time_in_past");if(t-e.context.nowMs>Fd)return Ae("time_too_far");let n=e.instant.toZonedDateTimeISO(e.context.timeZone);return{ok:!0,schedule:{returnAt:new Date(t).toISOString(),timeZone:e.context.timeZone,localDateTime:XE(n),source:e.source,...e.preset?{preset:e.preset}:{},...e.matchedText?{matchedText:e.matchedText}:{}}}}function eC(e,t,n){let r=e.slice(0,t),i=e.slice(t+n.length);return Dw.test(r)&&Dw.test(i)}function $t(e,t){let n=e.get(t);if(n==null)throw new RangeError(`Missing parsed ${t}`);return n}function tC(e,t){let n;try{n=Qo.PlainDateTime.from({year:$t(e.start,"year"),month:$t(e.start,"month"),day:$t(e.start,"day"),hour:$t(e.start,"hour"),minute:$t(e.start,"minute"),second:$t(e.start,"second"),millisecond:$t(e.start,"millisecond")},{overflow:"reject"})}catch{return null}try{return n.toZonedDateTime(t.timeZone,{disambiguation:"reject"}).toInstant()}catch{return null}}function nC(e,t){let n=$t(e.start,"year"),r=$t(e.start,"month"),i=$t(e.start,"day"),o=n===t.nowZoned.year&&r===t.nowZoned.month&&i===t.nowZoned.day;if(o&&t.nowZoned.hour>=23)return"no_time_left_today";let s=o?t.nowZoned.hour+1:t.nowZoned.hour,a=o?0:t.nowZoned.minute;try{return Qo.PlainDateTime.from({year:n,month:r,day:i,hour:s,minute:a,second:0,millisecond:0},{overflow:"reject"}).toZonedDateTime(t.timeZone,{disambiguation:"reject"}).toInstant()}catch{return null}}function rC(e,t){let n=Number(t.nowZoned.offsetNanoseconds)/6e10;return Ks.casual.parse(e,{instant:new Date(t.nowMs),timezone:n},{forwardDate:!0})}function vw(e,t){let n=typeof e=="string"?e.trim():"";if(n.length===0)return Ae("empty");if(n.length>ZE)return Ae("input_too_long");let r=KE(t);if(JE(r))return r;let i=rC(n,r);if(i.length===0)return Ae("not_recognized");if(i.length>1)return Ae("multiple_results");let o=i[0];if(o.end)return Ae("range_not_supported");if(!eC(n,o.index,o.text))return Ae("partial_match");let s=o.tags(),a=s.has("result/relativeDateAndTime"),l=s.has("result/relativeDate"),u=s.has("parser/ENCasualTimeParser"),d=!o.start.isCertain("hour")&&!u&&!l&&!a;if(o.start.isCertain("timezoneOffset")&&!a)return Ae("explicit_time_zone_not_supported");if(o.start.isCertain("hour")&&!o.start.isCertain("meridiem")&&!u&&!l&&!a)return Ae("meridiem_required");let c;if(d){let m=nC(o,r);if(m==="no_time_left_today")return Ae("no_time_left_today");if(!m)return Ae("clock_change_time");c=m}else if(a){let m=o.date();if(!Number.isFinite(m.getTime()))return Ae("not_recognized");c=Qo.Instant.fromEpochMilliseconds(m.getTime())}else{let m=tC(o,r);if(!m)return Ae("clock_change_time");c=m}return QE({instant:c,context:r,source:"natural_language",matchedText:o.text})}var oC=[{name:"read",description:"Mark messages read.",done:"Marked {n} read"},{name:"unread",description:"Mark messages unread.",done:"Marked {n} unread"},{name:"archive",description:"Archive messages.",done:"Archived {n}"},{name:"unarchive",description:"Move messages out of the archive.",done:"Unarchived {n}"},{name:"trash",description:"Move messages to the trash.",done:"Moved {n} to the trash",unchanged:"already in the trash"}],Mw=["all","archive","snoozed"];function Pw(e,t){let{display:n}=t,r=Sr(e,"messages","Read, search, and organize messages.").example("ripple messages","ripple messages --unread","ripple messages search invoice","ripple messages archive msg_06gp035p55zrz46e msg_06gjy0yyqzns5kta","ripple messages image img_06gh9kxn7m5q0ynq"),i=r.command("list").description("List messages, most recently updated first, or with --in snoozed, soonest to return. Plain `ripple messages` does the same.").summary("List messages").addOption(Ze("--in <view>","Where to look; all, the default, leaves out archived and snoozed messages",Mw)).addOption(ue("-s, --source <source>","Only this source's messages, by name or ID"));for(let a of Tl())i.addOption(a);i.addOption(jn("messages",vi)).addOption(Hn()).addOption(Wn()).example("ripple messages list --in snoozed","ripple messages list --source inbox --unread","ripple messages list --source Deploys --in archive --all").action(async a=>{let[l]=await Zt(t,a.source)??[],u=El(a),d=pn(a,c=>H("GET","/v1/messages",{query:{in:a.in,sourceId:l,unread:u?.toString(),...c}}));await t.runEach(d,c=>_i(n,c.flatMap(m=>m.items).map(m=>$d(m,n)),sC(a.in,u),[fs(c)]))}),r.command("watch").description("Show each new message as it arrives, until you stop it with Control-C. If the connection drops, it reconnects and catches up.").summary("Show new messages as they arrive").addOption(ue("-s, --source <source>","Only this source's messages, by name or ID")).example("ripple messages watch","ripple messages watch --source inbox",`ripple messages watch --json | jq --unbuffered -r 'select(.alert == "important") | .title'`).action(async a=>{let[l]=await Zt(t,a.source)??[];t.hint("Watching for new messages. Press Control-C to stop.");let u=0;await t.watch(H("GET","/v1/messages/stream",{query:{sourceId:l}}),({event:d,data:c})=>{d==="message"&&t.print(JSON.parse(c),({images:m,...p})=>{let f=m?.length?{imageId:m[0].id,count:m.length}:void 0;return`${u++?`
|
|
68
|
+
`:""}${$d({...p,preview:p.body??"",imagePreview:f},n)}
|
|
69
|
+
`})})}),r.command("get").description("Show a message in full.").argument("<id>").action(async a=>{await t.run(Rw(a),({message:l})=>zd(l,n))}),r.command("image").description("Save one of a message's images as a WebP file. `ripple messages get` lists a message's image IDs.").summary("Save a message's image").argument("<id>","The image's ID").addOption(ue("-o, --output <file>","Where to save it; without it, ripple-<last 8 characters of the ID>.webp (or -thumbnail.webp) in this folder, never replacing a file")).option("--thumbnail","Save the 256-pixel square lists show instead").example("ripple messages image img_06gh9kxn7m5q0ynq","ripple messages image img_06gh9kxn7m5q0ynq -o porch.webp --thumbnail").action(async(a,l)=>{let u=l.thumbnail?"thumbnail":"display",d=await t.call(H("GET","/v1/message-images/{imageId}/{variant}",{params:{imageId:a,variant:u},file:!0})),c=l.output??Mm(a,u);try{await iC(Oi(t,c),d,{flag:l.output?"w":"wx"})}catch(m){throw m.code==="EEXIST"?new U(`${c} already exists. Choose another name with --output.`):new U(`Could not save ${c}: ${Gt(m)}`)}t.print({file:c,bytes:d.byteLength},()=>`Saved to ${c}.
|
|
70
|
+
`)});let o=r.command("search").description("Search your messages. With no words, it lists every message the filters allow, newest first.").summary("Search messages").argument("[words...]").addOption(Ze("--in <view>","Where to look; without it, everywhere except the trash",Mw));for(let a of bs())o.addOption(a);o.example("ripple messages search invoice",'ripple messages search "release notes" --in archive --sort newest',"ripple messages search --source inbox --unread --after 2026-10-01T00:00:00Z").action(async(a,l)=>{let u={...await ks(t,a,l),in:l.in},d=pn(l,c=>H("POST","/v1/messages/search",{body:{...u,...c}}));await t.runEach(d,c=>qd(n,c,c.flatMap(m=>m.items).map(({message:m,excerpt:p})=>$d(m,n,Ud(p))),a.length?`No messages match "${a.join(" ")}".`:"No messages match these filters."))});for(let a of oC)r.command(a.name).description(a.description).argument("<ids...>",`Message IDs, up to ${qn}, or - to pipe in any number`).example(`ripple messages ${a.name} msg_06gp035p55zrz46e msg_06gjy0yyqzns5kta`,`ripple messages ${a.name} - < ids.txt`).action(async l=>{let u=await op(l,t.input),d=Array.from({length:Math.ceil(u.length/qn)},(m,p)=>u.slice(p*qn,(p+1)*qn)),c=0;try{await t.runEach(m=>(c=m.length,c<d.length?H("POST",`/v1/messages/${a.name}`,{body:{messageIds:d[c]}}):void 0),m=>`${uC(a,new Set(u).size,m)}
|
|
71
|
+
`)}catch(m){let p=d.slice(c+1).flat().length;throw p?new Wt(m,{code:"not_attempted",message:p===1?"The last message ID wasn't sent.":`The last ${p} message IDs weren't sent.`}):m}});r.command("move").description("Move a message to another source. A message in a thread moves with its whole thread.").summary("Move a message or its thread to another source").argument("<id>").addOption(ue("-s, --source <source>","The source to move it to, by name or ID").makeOptionMandatory()).example("ripple messages move msg_06gp035p55zrz46e --source Deploys","ripple messages move msg_06gp035p55zrz46e --source inbox").action(async(a,l)=>{let[u]=await Zt(t,l.source),d=H("POST","/v1/messages/move",{body:{moves:[{messageId:a,sourceId:u}]}});await t.run(d,({results:[c]})=>c?c.changed?`Moved to ${c.toSource.name}.
|
|
72
72
|
`:`Already in ${c.toSource.name}.
|
|
73
73
|
`:`Moved.
|
|
74
|
-
`)}),r.command("snooze").description("Hide a message until a set time, when it comes back with an alert. Times are read in your computer's time zone.").summary("Hide a message until later").argument("<id>","The message's ID").argument("<when...>","When it comes back, like 2h, tomorrow 9am, or friday at 5pm").addOption(
|
|
75
|
-
`)}),r.command("unsnooze").description("Bring a snoozed message back now.").argument("<id>").action(async a=>{let{message:l}=await t.call(
|
|
74
|
+
`)}),r.command("snooze").description("Hide a message until a set time, when it comes back with an alert. Times are read in your computer's time zone.").summary("Hide a message until later").argument("<id>","The message's ID").argument("<when...>","When it comes back, like 2h, tomorrow 9am, or friday at 5pm").addOption(Mi("How to alert when it comes back; standard unless the message is important")).example("ripple messages snooze msg_06gp035p55zrz46e 2h","ripple messages snooze msg_06gp035p55zrz46e tomorrow 9am --alert quiet","ripple messages snooze msg_06gp035p55zrz46e 2026-10-17T09:00:00-04:00").action(async(a,l,u)=>{let d=aC(l.join(" "),n.timeZone,n.now),c=H("PUT","/v1/messages/{messageId}/snooze",{params:{messageId:a},body:{returnAt:d,timeZone:n.timeZone,alert:u.alert}});await t.run(c,({message:m})=>`Snoozed until ${Vt(m.snooze?.returnAt??d,n)}.
|
|
75
|
+
`)}),r.command("unsnooze").description("Bring a snoozed message back now.").argument("<id>").action(async a=>{let{message:l}=await t.call(Rw(a)),u=H("DELETE","/v1/messages/{messageId}/snooze",{params:{messageId:a},query:{expectedRevision:l.revision}});await t.run(u,()=>l.snooze?`Unsnoozed.
|
|
76
76
|
`:`No change: the message wasn't snoozed.
|
|
77
|
-
`)}),
|
|
78
|
-
`)],["Thread",e.thread&&`${e.thread.title} \xB7 ${Pe(e.thread.messageCount,"message")} \xB7 ${e.thread.id}`],["Alert",e.alert&&
|
|
77
|
+
`)}),Sr(e,"threads","Read a thread's messages.").command("get").description("Show a thread's messages, oldest first.").argument("<id>").addOption(jn("messages")).addOption(Hn()).addOption(Wn()).example("ripple threads get thr_06gm53wzxakqgkm4","ripple threads get thr_06gm53wzxakqgkm4 --limit 20","ripple threads get thr_06gm53wzxakqgkm4 --all").action(async(a,l)=>{let u=pn(l,d=>H("GET","/v1/threads/{threadId}",{params:{threadId:a},query:d}));await t.runEach(u,d=>{let[{thread:c,latestMessage:m}]=d;return Bd(n,{...c,source:m.source.name},d.flatMap(p=>p.messages),d.at(-1).nextCursor)})})}function Rw(e){return H("GET","/v1/messages/{messageId}",{params:{messageId:e}})}function sC(e,t){if(t===void 0)return{archive:"Nothing in the archive.",snoozed:"Nothing is snoozed."}[e??""]??"No messages.";let n=t?"unread":"read";return{archive:`No ${n} messages in the archive.`,snoozed:`No ${n} messages are snoozed.`}[e??""]??`No ${n} messages.`}var Nw={time_in_past:"That time has passed.",time_too_far:"Choose a time within one year.",no_time_left_today:"Add a time later today.",meridiem_required:"Add AM or PM, like 9am.",multiple_results:"Choose one date and time.",range_not_supported:"Choose one date and time.",explicit_time_zone_not_supported:"Remove the time zone. Times are read in your computer's time zone.",clock_change_time:"A clock change skips that time. Choose another.",invalid_time_zone:"Your computer's time zone isn't available. Set TZ to one like America/New_York.",input_too_long:"Try a shorter date and time."};function aC(e,t,n){if(kl(e)){let i=Date.parse(e)-n.getTime();if(i<=0||i>Fd)throw new U(Nw[i<=0?"time_in_past":"time_too_far"]);return e}let r=vw(e,{now:n,timeZone:t});if(r.ok)return r.schedule.returnAt;throw new U(Nw[r.reason]??`Could not read "${e}" as a time. Try 2h, tomorrow 9am, or friday at 5pm.`)}function lC(e){let t=new Map;for(let r of e){let i="results"in r?r.results:r.messages.map(({messageId:o,thread:s})=>({messageId:o,threadId:s?.id??null}));for(let{messageId:o,threadId:s}of i)t.set(s?`thread:${s}`:o,s?"thread":"message")}let n=[...t.values()].filter(r=>r==="thread").length;return{messages:t.size-n,threads:n}}function uC(e,t,n){let{messages:r,threads:i}=lC(n);if(!r&&!i)return e.unchanged?`No change: ${t===1?"the message was":`all ${t} were`} ${e.unchanged}.`:"No change.";let o=[r&&Pe(r,"message"),i&&Pe(i,"thread")].filter(Boolean).join(" and "),s=`${e.done.replace("{n}",o)}.`,a=e.unchanged&&!i?t-r:0;return a>0?`${s} ${a} ${a===1?"was":"were"} ${e.unchanged}.`:s}function Ud(e){return`${e.truncatedStart?"\u2026":""}${e.text}${e.truncatedEnd?"\u2026":""}`}function Lw(e){return e.sourceState==="trash"&&"Source in the trash"}function cC(e){let t=np(e.source.name,e.sender);return t&&`via ${t}`}function $d(e,t,n=e.preview){let r=e.thread?.messageCount??0,i=e.thread?.title??e.title;return Ii(t,{unread:e.readAt===null,title:i??n,detail:i?e.thread&&e.title?[e.title,n].filter(Boolean).join(": "):n:void 0,facts:[e.source.name,Ci(e.receivedAt,t),r>1&&`${Pe(r,"message")} in thread`,e.imagePreview&&Pe(e.imagePreview.count,"image"),e.snooze&&`Snoozed until ${Ci(e.snooze.returnAt,t)}`,e.archivedAt&&"Archived",Lw(e),e.messageId]})}function zd(e,t,n=[]){let{style:r}=t,i=[e.readAt===null&&"Unread",e.archivedAt&&"Archived",e.snooze&&`Snoozed until ${Vt(e.snooze.returnAt,t)}`,Lw(e)],o=e.title??e.thread?.title,s=wu(o,e.body,e.format);return[...o?[r.bold(o)]:[],r.dim([e.source.name,cC(e),Vt(e.receivedAt,t),...i].filter(Boolean).join(" \xB7 ")),...s?["",s]:[],"",_r(t,[[e.links?.length===1?"Link":"Links",e.links?.map(({url:a,title:l})=>l?`${l} ${r.dim(a)}`:a).join(`
|
|
78
|
+
`)],["Thread",e.thread&&`${e.thread.title} \xB7 ${Pe(e.thread.messageCount,"message")} \xB7 ${e.thread.id}`],["Alert",e.alert&&Tt(e.alert)],["Sound",e.sound&&Tt(e.sound)],["Format",e.format==="markdown"&&"Markdown"],["Images",e.images?.map(({id:a})=>a).join(" ")],["Body images",e.bodyImages?.map(({id:a})=>a).join(" ")],["ID",e.messageId],...n])].join(`
|
|
79
79
|
`)+`
|
|
80
|
-
`}function
|
|
80
|
+
`}function Bd(e,t,n,r,i=[]){let{style:o}=e,s=l=>l.replace(/^/gm," "),a=[...n].sort((l,u)=>l.messageNumber-u.messageNumber).map(l=>{let u=wu(l.title??t.title,l.body,l.format);return[o.dim([`#${l.messageNumber}`,Vt(l.receivedAt,e),l.title&&!$i(l.title,t.title)&&l.title,l.sound&&`${Tt(l.sound)} sound`,l.images?.length&&Pe(l.images.length,"image")].filter(Boolean).join(" \xB7 ")),...u?[s(u)]:[]].join(`
|
|
81
81
|
`)});return[o.bold(t.title),o.dim([t.source,Pe(t.messageCount,"message"),t.id].join(" \xB7 ")),"",a.join(`
|
|
82
82
|
|
|
83
83
|
`),...[r&&`Earlier messages: --cursor ${r}`,...i].filter(Boolean).map(l=>`
|
|
84
84
|
${o.dim(l)}`)].join(`
|
|
85
85
|
`)+`
|
|
86
|
-
`}function
|
|
86
|
+
`}function qd(e,t,n,r){let[i]=t,o=t.at(-1),s=i.corrections.map(a=>e.style.dim(`Searched for ${St(a.alternatives,"or")} instead of ${a.original}.`));return(s.length?`${s.join(`
|
|
87
87
|
`)}
|
|
88
88
|
|
|
89
|
-
`:"")+
|
|
90
|
-
${
|
|
91
|
-
`);return}let d;try{d=await t.call(
|
|
89
|
+
`:"")+_i(e,n,r,[o.truncated&&"There are more matches than one search returns. Narrow the search to see the rest.",t.some(a=>a.coverage==="indexing")&&"Search is still catching up, so the newest messages may be missing.",al(o.nextCursor)])}function qa(e){if(!URL.canParse(e))return e;let{host:t,pathname:n,search:r}=new URL(e);return`${t.replace(/^www\./,"")}${n==="/"?"":n}${r}`}function Fw(e,t){let n=URL.canParse(t)?new URL(t).host.replace(/^www\./,""):t;switch(e){case"unreachable":return`Ripple can\u2019t reach ${n} right now. It keeps trying.`;case"refused":return`${n} is turning Ripple away. It keeps trying.`;case"not_found":return`${n} no longer has this feed. Ripple keeps trying.`;case"gone":return`${n} has removed this feed.`;case"not_a_feed":return"This address no longer holds a feed. Ripple keeps trying.";case"too_large":return"This feed has grown too large for Ripple to read."}}var dC=[["icon","clearIcon","iconSymbol"],["iconColor","clearIconColor","iconColor"],["imageUrl","clearImage","imageUrl"],["defaultAlert","clearDefaultAlert","defaultAlert"],["defaultSound","clearDefaultSound","defaultSound"],["defaultLink","clearDefaultLink","defaultLink"],["feed","clearFeed","feed"]],$w=e=>`--${e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}`;function Uw(){return[ue("--icon <name>","An icon from the app's icon picker, such as rocket, or a brand's logo, such as brand:github. A new source gets one that suits its name"),Ze("--icon-color <color>","The icon's color",tp),ue("--image-url <url>","An image to show instead of the icon"),Ze("--default-alert <level>","The alert for messages that don't choose one",gs),Ze("--default-sound <name>","The sound its messages play in Ripple instead of your account's",Ai),ue("--default-link <url>","The link for messages that don't include one"),new oe("--email-threads","Group emails with the same subject into a thread, as a new source does"),new oe("--no-email-threads","Keep each email its own message"),ue("--feed <address>","A feed to follow, or a page that names one, such as status.example.com or a GitHub repository. Its new posts arrive as messages")]}function zw(e){let t={};for(let[n,r,i]of dC){if(e[n]!==void 0&&e[r])throw new U(`Choose ${$w(n)} or ${$w(r)}, not both.`);e[r]?t[i]=null:e[n]!==void 0&&(t[i]=e[n])}return typeof e.emailThreads=="boolean"&&(t.emailThreads=e.emailThreads),t}var mC=[{name:"mute",description:"Turn off a source's notifications but keep its messages.",done:e=>`Muted ${e}. New messages arrive without notifications.`},{name:"unmute",description:"Turn a source's notifications back on.",done:e=>`Unmuted ${e}.`},{name:"disable",description:"Stop a source from accepting new messages.",done:e=>`Disabled ${e}. It won't accept new messages.`},{name:"enable",description:"Let a disabled source accept messages again.",done:e=>`Enabled ${e}. It accepts new messages again.`}];function Hw(e,t){let{display:n}=t,r=Sr(e,"sources","Manage where messages come from. Name a source by its name or its ID.").example("ripple sources",'ripple sources create "GitHub Alerts"',"ripple sources create --feed status.openai.com",'ripple sources key "GitHub Alerts"','ripple sources update "GitHub Alerts" --name "GitHub Deploys"'),i=async a=>(await Zt(t,a))[0];r.command("list").description("List your sources. Plain `ripple sources` does the same.").summary("List sources").action(async()=>{await t.run(H("GET","/v1/sources"),({items:a})=>pC(a,n))}),r.command("get").description("Show a source's settings.").argument("<source>").action(async a=>{await t.run(H("GET","/v1/sources/{sourceId}",{params:{sourceId:await i(a)}}),l=>fC(l,n))});let o=r.command("create").description("Create a source and show its send key, or follow a feed with --feed, which names the source unless you do.").argument("[name]");for(let a of Uw())o.addOption(a);o.example('ripple sources create "GitHub Alerts"','ripple sources create "Deploys" --icon-color green --default-alert quiet',"ripple sources create --feed status.openai.com",'ripple sources create "Next.js releases" --feed github.com/vercel/next.js').action(async(a,l)=>{if(a===void 0&&l.feed===void 0)throw new U("Give the source a name, or a feed to follow with --feed.");let u=await t.call(H("POST","/v1/sources",{body:{...a!==void 0?{name:a}:{},...zw(l)}}));if(u.feed){t.print(u,()=>`Created ${u.name} ${n.style.dim(u.sourceId)}
|
|
90
|
+
${Bw(u.feed)}
|
|
91
|
+
`);return}let d;try{d=await t.call(qw(u.sourceId))}catch(c){throw new Wt(c,{code:"send_key_unavailable",message:`Created ${u.name} (${u.sourceId}), but couldn't get its send key.`,hint:`Run "ripple sources key ${u.sourceId}" to get it.`})}t.print({...u,sendKey:d.key,webhookUrl:d.webhookUrl,emailAddress:d.emailAddress},()=>`Created ${u.name} ${n.style.dim(u.sourceId)}
|
|
92
92
|
${d.key}
|
|
93
|
-
`),t.hint(
|
|
94
|
-
`),l.reset&&t.hint("Replaced the send key, with its webhook URL and email address. The old ones stopped working."),!l.email&&!l.webhookUrl&&t.hint(
|
|
93
|
+
`),t.hint(jw(u.sourceId))}),r.command("key").description("Show a source's send key, which sends only to that source. --webhook-url and --email show the same key as a webhook URL or an email address. Add --reset to replace it; the old one stops working at once.").summary("Show or replace a source's send key").argument("<source>").addOption(new oe("--webhook-url","Show the key as a webhook URL").conflicts("email")).option("--email","Show the key as an email address").option("--reset","Replace the key; the old one stops working at once").option("--yes","Confirm the reset").example('ripple sources key "GitHub Alerts"','ripple sources key "NAS" --email',"ripple sources key src_06gh81f7x0xmzj8z --reset --yes").action(async(a,l)=>{if(l.reset&&!l.yes)throw new U("Resetting stops the current key at once. Add --yes to confirm.");let u=await i(a);await t.run(qw(u,l.reset),d=>`${l.email?d.emailAddress:l.webhookUrl?d.webhookUrl:d.key}
|
|
94
|
+
`),l.reset&&t.hint("Replaced the send key, with its webhook URL and email address. The old ones stopped working."),!l.email&&!l.webhookUrl&&t.hint(jw(u))});let s=r.command("update").description("Rename a source or change its settings.").argument("<source>").addOption(ue("--name <name>","A new name"));for(let a of Uw())s.addOption(a);s.option("--clear-feed","Stop following its feed").option("--clear-icon","Remove the icon").option("--clear-icon-color","Remove the icon color").option("--clear-image","Remove the image").option("--clear-default-alert","Remove the default alert").option("--clear-default-sound","Remove the default sound").option("--clear-default-link","Remove the default link").example('ripple sources update "GitHub Alerts" --name "GitHub Deploys"',"ripple sources update Deploys --icon database --icon-color blue","ripple sources update src_06gh81f7x0xmzj8z --default-sound glow","ripple sources update NAS --no-email-threads","ripple sources update Vercel --feed vercel-status.com","ripple sources update Vercel --clear-feed").action(async(a,l)=>{let u={...l.name!==void 0?{name:l.name}:{},...zw(l)},d=Object.keys(u);if(!d.length)throw new U("Give at least one setting to change, such as --name.");await t.run(H("PATCH","/v1/sources/{sourceId}",{params:{sourceId:await i(a)},body:u}),c=>d.length>1?`Updated ${c.name}.
|
|
95
95
|
`:"name"in u?`Renamed to ${c.name}.
|
|
96
|
-
`:c.feed&&u.feed?`${
|
|
96
|
+
`:c.feed&&u.feed?`${Bw(c.feed)}
|
|
97
97
|
`:"feed"in u?`${c.name} stopped following its feed.
|
|
98
98
|
`:`Updated ${c.name}.
|
|
99
|
-
`)});for(let a of
|
|
99
|
+
`)});for(let a of mC)r.command(a.name).description(a.description).argument("<source>").action(async l=>{await t.run(H("POST",`/v1/sources/{sourceId}/${a.name}`,{params:{sourceId:await i(l)}}),u=>`${a.done(u.name)}
|
|
100
100
|
`)});r.command("read").description("Mark all of a source's messages read.").argument("<source>").action(async a=>{await t.run(H("POST","/v1/sources/{sourceId}/read",{params:{sourceId:await i(a)}}),({source:l,markedReadCount:u})=>u?`Marked ${Pe(u,"message")} read in ${l.name}.
|
|
101
101
|
`:`Everything in ${l.name} was already read.
|
|
102
|
-
`)}),r.command("trash").description("Move a source to the trash. Its messages stay unless you add --delete-messages.").summary("Move a source to the trash").argument("<source>").option("--delete-messages","Also move its messages to the trash").action(async(a,l)=>{let u=H("DELETE","/v1/sources/{sourceId}",{params:{sourceId:await i(a)},query:{deleteMessages:l.deleteMessages?"true":void 0}});await t.run(u,d=>`Moved the source to the trash${d.deletedMessageCount?`, with ${Pe(d.deletedMessageCount,"message")}`:""}. It's deleted for good on ${
|
|
103
|
-
`)})}function
|
|
102
|
+
`)}),r.command("trash").description("Move a source to the trash. Its messages stay unless you add --delete-messages.").summary("Move a source to the trash").argument("<source>").option("--delete-messages","Also move its messages to the trash").action(async(a,l)=>{let u=H("DELETE","/v1/sources/{sourceId}",{params:{sourceId:await i(a)},query:{deleteMessages:l.deleteMessages?"true":void 0}});await t.run(u,d=>`Moved the source to the trash${d.deletedMessageCount?`, with ${Pe(d.deletedMessageCount,"message")}`:""}. It's deleted for good on ${Bn(d.purgeAt,n)}.
|
|
103
|
+
`)})}function Bw(e){return`Following ${qa(e.url)}. Its newest post arrives in a moment.`}function qw(e,t=!1){return H("POST",t?"/v1/sources/{sourceId}/send-key/reset":"/v1/sources/{sourceId}/send-key",{params:{sourceId:e}})}function jw(e){return`Try it: RIPPLE_KEY=$(ripple sources key ${e}) ripple send "Hello"`}function pC(e,t){let n=e.filter(i=>"status"in i),r=n.length===e.length?sl(t,["Name","Status","Unread","ID"],n.map(i=>[i.name,Tt(i.status),String(i.unreadCount),i.sourceId])):sl(t,["Name","ID"],e.map(i=>[i.name,i.sourceId]));return e.some(i=>i.kind==="custom")?r:`${r}
|
|
104
104
|
${t.style.dim('Add a source with: ripple sources create "Name"')}
|
|
105
|
-
`}function
|
|
105
|
+
`}function fC(e,t){let{style:n}=t;return[n.bold(e.name),n.dim([Tt(e.status),`${e.unreadCount} unread`,e.snoozedCount?`${e.snoozedCount} snoozed`:null,e.sourceId].filter(Boolean).join(" \xB7 ")),"",_r(t,[["Default alert",e.defaultAlert&&Tt(e.defaultAlert)],["Default sound",e.defaultSound&&Tt(e.defaultSound)],["Feed",e.feed&&(e.feed.problem?`${qa(e.feed.url)}. ${Fw(e.feed.problem,e.feed.url)}`:qa(e.feed.url))],["Default link",e.defaultLink],["Email threads",e.emailThreads?"By subject":"Off"],["Icon",[e.iconSymbol,e.iconColor&&Tt(e.iconColor)].filter(Boolean).join(", ")],["Image",e.imageUrl],["Contained until",e.autoContainedUntil&&Vt(e.autoContainedUntil,t)],["Created",Bn(e.createdAt,t)]])].join(`
|
|
106
106
|
`)+`
|
|
107
|
-
`}function
|
|
107
|
+
`}function Ww(e,t){e.command("status").description("Show what this terminal reaches Ripple with, and check that it works: your sign-in from ripple login, or the send key or API token in RIPPLE_KEY, which takes its place. It shows whose it is, what it may do, and Ripple's address.").summary("Show what this terminal is connected as").example("ripple status","ripple status --json").action(async()=>{let n=await t.call(H("GET","/v1/access")),r=n.kind==="send_key"||n.sources==="all"?[]:(await t.call(H("GET","/v1/sources"))).items.map(s=>s.name),{baseUrl:i,store:o}=t.loginContext();t.print(n,s=>hC(s,r,i,t.display)),n.kind!=="sign_in"&&await o.load(i)&&t.hint("This terminal is also signed in. Unset RIPPLE_KEY to use its sign-in.")})}function hC(e,t,n,r){let i=e.kind==="send_key"?`Using the ${e.source.name} send key from RIPPLE_KEY`:e.kind==="api_token"?`Using the API token "${e.label}" from RIPPLE_KEY`:`Signed in as ${e.email}`,o=e.kind!=="send_key"&&am(e.access);return[r.style.bold(i),"",_r(r,[["Access",e.kind==="send_key"?`Sends only to ${e.source.name}`:Va[e.access]],["Sources",o&&(t.length>1?St(t):lm(e.sources==="all"?"all":t))],["Address",n]])].join(`
|
|
108
108
|
`)+`
|
|
109
|
-
`}var
|
|
109
|
+
`}var gC="To restore an item, run ripple trash restore followed by its last line.";function Vw(e,t){let{display:n}=t,r=Sr(e,"trash","Restore or permanently delete items.").example("ripple trash","ripple trash restore message msg_06gp035p55zrz46e");r.command("list").description("List what's in the trash. Plain `ripple trash` does the same.").summary("List what's in the trash").addOption(Ze("--type <type>","Only one kind of item; content means messages and threads",["message","thread","source","content"])).addOption(jn("items",vi)).addOption(Hn()).addOption(Wn()).action(async o=>{let s=pn(o,a=>H("GET","/v1/trash",{query:{type:o.type,...a}}));await t.runEach(s,a=>{let l=a.flatMap(u=>u.items);return _i(n,l.map(u=>Gw(u,n)),"The trash is empty.",[l.length>0&&gC,fs(a)])})}),r.command("get").description("Show a message or thread in the trash.").addArgument(new jt("<type>","What kind of item").choices(["message","thread"])).argument("<id>","Its ID, shown by ripple trash").addOption(jn("thread messages")).addOption(Hn()).addOption(Wn()).example("ripple trash get thread thr_06gm53wzxakqgkm4","ripple trash get thread thr_06gm53wzxakqgkm4 --all").action(async(o,s,a)=>{if(o==="message"&&(a.limit!==void 0||a.cursor!==void 0||a.all))throw new U("--limit, --cursor, and --all only apply to threads.");let l=pn(a,u=>H("GET",`/v1/trash/${o}s/{${o}Id}`,{params:{[`${o}Id`]:s},query:u}));await t.runEach(l,u=>yC(u,n))});let i=r.command("search").description("Search messages and threads in the trash. With no words, it lists everything the filters allow, newest first.").summary("Search the trash").argument("[words...]");for(let o of bs())i.addOption(o);i.action(async(o,s)=>{let a=await ks(t,o,s),l=pn(s,u=>H("POST","/v1/trash/search",{body:{...a,...u}}));await t.runEach(l,u=>qd(n,u,u.flatMap(d=>d.items).map(({item:d,excerpt:c})=>Gw(d,n,Ud(c))),o.length?`Nothing in the trash matches "${o.join(" ")}".`:"Nothing in the trash matches these filters."))}),r.command("restore").description("Restore a message, thread, or source from the trash.").summary("Restore an item").addArgument(new jt("<type>","What kind of item").choices(["message","thread","source"])).argument("<id>","Its ID, shown by ripple trash").example("ripple trash restore message msg_06gp035p55zrz46e").action(async(o,s)=>{let a=H("POST",`/v1/trash/${o}s/{${o}Id}/restore`,{params:{[`${o}Id`]:s}});await t.run(a,l=>{if("source"in l)return`Restored ${l.source.name}.
|
|
110
110
|
`;let u=l.message.title??l.message.thread?.title;return`Restored ${u?`"${u}"`:"the message"}.
|
|
111
|
-
`})}),r.command("delete").description("Delete a message, thread, or source for good. This can't be undone.").summary("Delete an item for good").addArgument(new
|
|
112
|
-
`)})}function
|
|
113
|
-
`)).exitOverride().configureOutput({...t,outputError:()=>{},getOutHelpWidth:()=>r??80,getErrHelpWidth:()=>r??80,getOutHasColors:()=>n.color,getErrHasColors:()=>n.color}).configureHelp({showGlobalOptions:!0,formatHelp:(o,s)=>
|
|
114
|
-
`)}var
|
|
115
|
-
`),process.exit(130)}),t.question(e,r=>{n(r),t.close()})})}function
|
|
116
|
-
`)},S=()=>({baseUrl:f().baseUrl,store:d,timeoutMs:O.opts().timeout}),w=async({refused:E}={})=>{let{baseUrl:
|
|
117
|
-
`),ask:c,openBrowser:e.openBrowser??
|
|
118
|
-
`}function
|
|
111
|
+
`})}),r.command("delete").description("Delete a message, thread, or source for good. This can't be undone.").summary("Delete an item for good").addArgument(new jt("<type>","What kind of item").choices(["message","thread","source"])).argument("<id>","Its ID, shown by ripple trash").option("--yes","Confirm that this can't be undone").example("ripple trash delete message msg_06gp035p55zrz46e --yes").action(async(o,s,a)=>{if(!a.yes)throw new U("Deleting for good can't be undone. Add --yes to confirm.");let l=H("DELETE",`/v1/trash/${o}s/{${o}Id}`,{params:{[`${o}Id`]:s},noContent:!0});await t.run(l,()=>`Deleted for good.
|
|
112
|
+
`)})}function Gw(e,t,n){let r=[`Trashed ${Ci(e.deletedAt,t)}`,`Deleted for good ${Bn(e.purgeAt,t)}`],i=`${e.type} ${e.id}`;if(e.type==="source")return Ii(t,{title:e.source.name,facts:["Source",...r],extra:i});let o=n??e.preview;return Ii(t,{title:e.title??o,detail:e.title?o:void 0,facts:[e.type==="thread"?`Thread of ${Pe(e.thread.messageCount,"message")}`:"Message",e.source.name,...r],extra:i})}function yC(e,t){let[n]=e,{item:r}=n,i=`Trashed ${Vt(r.deletedAt,t)} \xB7 deleted for good ${Bn(r.purgeAt,t)}`,o=`ripple trash restore ${r.type} ${r.id}`;if(n.item.type==="message")return zd({...n.item,thread:void 0},t,[["Trash",i],["Restore",o]]);let s=e;return Bd(t,{...n.item.thread,source:n.item.source.name},s.flatMap(a=>a.messages),s.at(-1).nextCursor,[i,`Restore: ${o}`])}var jd=class e extends Cr{examples=[];example(...t){return this.examples.push(...t),this}createCommand(t){return new e(t)}};function Sr(e,t,n){return e.command(t).description(n).helpCommand(!1)}function Yw(e,t){let{style:n,width:r}=e.display,i=new jd("ripple").description(`${Or.description}.`).option("--json","Print raw JSON, for scripts").version(Or.version,"--version","Show the version").helpOption("-h, --help","Show help").helpCommand("help [command]","Show help for a command").addOption(new oe("--base-url <url>").hideHelp()).addOption(Sl("--timeout <ms>","Request deadline in milliseconds",2147483647).hideHelp().default(3e4)).example("ripple login",'ripple send "Deploy finished"',"ripple messages",'ripple messages search "invoice"',"ripple help send").addHelpText("after",()=>["",n.bold("Connecting")," Run ripple login to connect this terminal to your account."," Scripts and servers can set RIPPLE_KEY instead, which wins over"," a sign-in. A send key only sends, and only to its source: copy it"," from the source's menu (Copy send key). An API token is Read only,"," Send only, Read and send, or Everything, on all your sources or"," chosen ones; add one under Settings \u2192 Developer \u2192 API tokens."," ripple status shows which one it's using, and checks it works.","",` Commands go to ${Xa}. To use another address, set`," RIPPLE_BASE_URL or save baseUrl in ~/.config/ripple/config.json."," --base-url and --timeout <ms> override these for one command.",""].join(`
|
|
113
|
+
`)).exitOverride().configureOutput({...t,outputError:()=>{},getOutHelpWidth:()=>r??80,getErrHelpWidth:()=>r??80,getOutHasColors:()=>n.color,getErrHasColors:()=>n.color}).configureHelp({showGlobalOptions:!0,formatHelp:(o,s)=>wC(o,s,n),optionTerm:o=>o.short?o.flags:` ${o.flags}`,optionDescription:o=>o.description+(o.argChoices?` (${o.argChoices.join(", ")})`:""),argumentTerm:Hd,argumentDescription:o=>o.description+(o.argChoices?` (${o.argChoices.join(", ")})`:""),subcommandTerm:o=>[o.name(),...o.registeredArguments.map(Hd)].join(" "),subcommandDescription:o=>(o.summary()||o.description()).replace(/\.$/,"")});return lp(i,e),Pw(i,e),Hw(i,e),Vw(i,e),pp(i,e),Ww(i,e),bp(i,e),i}function Hd(e){let t=`${e.name()}${e.variadic?"...":""}`;return e.required?`<${t}>`:`[${t}]`}function es(e){let t=[];for(let n=e;n;n=n.parent)t.unshift(n.name());return t.join(" ")}function wC(e,t,n){let r=t.visibleCommands(e),i=r.length>0&&e.parent!==null,o=t.visibleOptions(e),s=o.filter(f=>f.long==="--help"),a=t.visibleGlobalOptions(e).filter(f=>f.long!=="--version"),l=i?[]:[...o.filter(f=>f.long!=="--help"),...a,...s],u=r.length?`${es(e)} <command>`:[es(e),...e.registeredArguments.map(Hd),"[options]"].join(" "),d={Commands:r.map(f=>[t.subcommandTerm(f),t.subcommandDescription(f)]),Arguments:t.visibleArguments(e).map(f=>[t.argumentTerm(f),t.argumentDescription(f)]),Options:l.map(f=>[t.optionTerm(f),t.optionDescription(f)])},c=Math.max(0,...Object.values(d).flat().map(([f])=>t.displayWidth(f))),m=(f,x)=>x.length?[n.bold(f),...x,""]:[],p=f=>m(f,d[f].map(([x,S])=>t.formatItem(x,c,S,t)));return[t.boxWrap(t.commandDescription(e),t.helpWidth??80),"",...m("Usage",[` ${u}`]),...p("Commands"),...p("Arguments"),...p("Options"),...m("Examples",e.examples.map(f=>` ${f}`)),...i?[n.dim(`Run "${es(e)} <command> --help" for a command's options.`),""]:[]].join(`
|
|
114
|
+
`)}var Zw=45e3,Wd={first:1e3,longest:3e4},dt=class extends Error{constructor(n,r,i,o){super(i);this.response=n;this.exitCode=r;this.hint=o}},ts=class extends Error{constructor(n,r){super(n.message);this.reason=n;this.idempotencyKey=r}},SC=5*6e4;function Vd(e){return e instanceof $?e.code==="network_error"||e.code==="request_timeout":e.status===429||e.status>=500}function TC(e){return e instanceof $?e.code==="request_timeout"?"Ripple didn't answer in time.":"Could not reach Ripple.":e.status!==429?`Ripple is unavailable (HTTP ${e.status}).`:e.error?.code==="invalid_key_rate_limited"?"Ripple is refusing keys from this IP address for a moment.":"Ripple is limiting sends."}async function EC(e,t){let n=Date.now()+SC;for(let r=1;;r++){let i=await e(),o=n-Date.now(),s=i instanceof $?0:(i.retryAfter??0)*1e3;if(!Vd(i)||o<=0||s>o)return i;let a=Math.min(3e4,1e3*2**(r-1)),l=Math.min(Math.max(s,a)*(1+Math.random()/2),o);t(`${TC(i)} Trying again in ${Math.ceil(l/1e3)}s\u2026`),await new Promise(u=>setTimeout(u,l))}}function CC({status:e,unreadable:t,error:n}){return t?re.unknownOutcome:e===404?re.notFound:e===401||e===403&&n?.code==="insufficient_access"?re.access:e===429||e===503?re.tryLater:re.rejected}function IC(e,t){return e instanceof $?e:e instanceof et||e instanceof U?new $("invalid_arguments",e instanceof et?DC(e.message):e.message,`Run "${es(t)} --help" for usage.`):new $("unexpected_error",Gt(e))}function _C(e){let[t,n]=e;return t?t==="help"?[...e.slice(1),"--help"]:["messages","sources","trash"].includes(t)&&(n===void 0||n.startsWith("-")&&n!=="-h"&&n!=="--help")?[t,"list",...e.slice(1)]:e:["--help"]}function AC(e){let t=bC({input:process.stdin,output:process.stderr});return new Promise(n=>{t.once("close",()=>n(null)),t.once("SIGINT",()=>{process.stderr.write(`
|
|
115
|
+
`),process.exit(130)}),t.question(e,r=>{n(r),t.close()})})}function OC(){if(process.stdin.isTTY)return;let e=!1;try{let t=xC(0);e=t.isFIFO()||t.isFile()}catch{}return{stream:process.stdin,piped:e}}async function Jw(e={}){let t=_C(e.argv??process.argv.slice(2)),n=e.env??process.env,r=e.writeStdout??(E=>void process.stdout.write(E)),i=e.writeStderr??(E=>void process.stderr.write(E)),o=!e.writeStdout&&!!process.stdout.isTTY,s={style:Am(e.color??(o&&n.NO_COLOR===void 0)),width:e.width??(o?process.stdout.columns:void 0),timeZone:e.timeZone??Intl.DateTimeFormat().resolvedOptions().timeZone,get now(){return e.now??new Date}},a=t.includes("--json"),l,u=null,d=e.credentials??bm(n),c=a?void 0:e.ask??(e.argv===void 0&&process.stdin.isTTY&&process.stderr.isTTY?AC:void 0),m,p=()=>s.width!==void 0&&!O.opts().json,f=()=>{try{return l??=fm({env:n,flags:{baseUrl:O.opts().baseUrl},configPath:e.configPath})}catch(E){throw E instanceof $?E:new $("invalid_config",Gt(E),'Run "ripple --help" to see how to connect.')}},x=E=>{b()||i(`${s.style.dim(E)}
|
|
116
|
+
`)},S=()=>({baseUrl:f().baseUrl,store:d,timeoutMs:O.opts().timeout}),w=async({refused:E}={})=>{let{baseUrl:R,key:C,kind:y}=f();if(C)return{baseUrl:R,key:C,kind:y};if((!u||E||!bl(u))&&(u=await Ym(S(),{refused:E})??await mp(M)),!u)throw new $("missing_key","This terminal isn't connected to Ripple.","Run ripple login to connect it, or set RIPPLE_KEY to a send key or an API token.");return{baseUrl:R,key:u.accessToken,kind:"access"}},D=async()=>{let E=await w();if(E.kind==="send")throw new $("send_key_only","RIPPLE_KEY is a send key, which only sends. Reading and managing need an API token.","Unset RIPPLE_KEY and run ripple login, or set it to an API token from Settings \u2192 Developer \u2192 API tokens.");return E},T=(E,{baseUrl:R},C="reach")=>MC(E)?ls(C):as(R,C),M={display:s,env:n,installMethod:e.installMethod??gp(),input:e.stdin?{stream:e.stdin,piped:!0}:e.argv?void 0:OC(),keyKind:async()=>(await w()).kind,ask:c,loginContext:()=>({...S(),style:s.style,say:E=>i(`${E}
|
|
117
|
+
`),ask:c,openBrowser:e.openBrowser??Jm,get computerName(){return e.computerName??Zm()},signal:e.signal}),async call(E){let R=E.path==="/v1/send",C=E.sendKey?await w():await D(),y=async()=>{let A=AbortSignal.timeout(O.opts().timeout);try{let N=await Ka(E,{...C,signal:A});return N.status!==401||C.kind!=="access"?N:(Object.assign(C,await w({refused:C.key})),await Ka(E,{...C,signal:A}))}catch(N){return N instanceof $?N:A.aborted?new $("request_timeout",R?"Ripple didn't answer in time, so it's unknown whether the message was sent.":"Ripple didn't answer in time, so the outcome is unknown. Before creating a source again, check ripple sources."):T(N,C,R?"send notification to":void 0)}},Z=E.headers?.["Idempotency-Key"],F=Z?await EC(y,x):await y();if(F instanceof $||(m=F.latestRelease??m),F instanceof $||F.error||F.data===void 0&&!E.noContent){let A=F instanceof $?F:F.error?Gd(F,{sending:R,kind:C.kind}):new $("empty_response","Ripple sent back an empty response."),N=Vd(F)||A.exitCode===re.unknownOutcome;throw Z&&N?new ts(A,Z):A}return F.data},async watch(E,R){let C=await D(),y=e.signal,Z,F=!1,A=!1,N=Wd.first;for(;!y?.aborted;){let z=new AbortController,te=()=>z.abort();y?.addEventListener("abort",te,{once:!0});let se,Ne=J=>{clearTimeout(se),se=setTimeout(te,J)};try{C.kind==="access"&&Object.assign(C,await w()),Ne(O.opts().timeout);let J=await fetch(Ya({...E,headers:{accept:"text/event-stream",...Z===void 0?{}:{"last-event-id":Z}}},{...C,signal:z.signal}));if(m=Za(J)??m,J.ok){if(!J.body||!J.headers.get("content-type")?.startsWith("text/event-stream"))throw Gd({status:J.status,unreadable:!0,error:{code:"invalid_response",message:"Ripple didn't answer with a stream of messages."}},{sending:!1,kind:C.kind});F=!0,A=!1,N=Wd.first,Ne(Zw);for await(let h of cm(J.body))Ne(Zw),h.id!==void 0&&(Z=h.id),h.data!==void 0&&R({event:h.event,data:h.data})}else{let h=await Ja(J);if(h.status===401&&C.kind==="access"&&!A){A=!0,Object.assign(C,await w({refused:C.key}));continue}if(!F||!Vd(h))throw Gd(h,{sending:!1,kind:C.kind});N=Math.max(N,(h.retryAfter??0)*1e3)}}catch(J){if(y?.aborted)break;if(!(F&&J instanceof $&&J.code==="network_error")&&(J instanceof dt||J instanceof $||J instanceof U))throw J;if(!F)throw z.signal.aborted?new $("request_timeout","Ripple didn't answer in time."):T(J,C)}finally{clearTimeout(se),y?.removeEventListener("abort",te)}await kC(N,void 0,{signal:y}).catch(()=>{}),N=Math.min(N*2,Wd.longest)}},print(E,R){r(b()?Yd(E):R(E))},run(E,R){return M.runEach(C=>C.length?void 0:E,([C])=>R(C))},async runEach(E,R){let C=[];for(let y=E(C);y;y=E(C)){let Z=await M.call(y);C.push(Z),b()&&r(Yd(Z))}b()||r(R(C))},hint(E){p()&&x(E)}},O=Yw(M,{writeOut:r,writeErr:i}),b=()=>!!O.opts().json;try{return await O.parseAsync(t,{from:"user"}),0}catch(E){if(E instanceof et&&["commander.helpDisplayed","commander.version","commander.help"].includes(E.code))return E.exitCode===0?0:re.usage;let R=E instanceof Wt?E.undone:void 0,C=E instanceof Wt||E instanceof ts?E.reason:E,y=C instanceof dt?C:IC(C,vC(O,t));return i(Kw(y,s,a,E instanceof ts?E.idempotencyKey:void 0)+(R?Kw(R,s,a):"")),y.exitCode}finally{let E=yp(m,M.installMethod);E&&p()&&xp(e.noticePath??wp(),s.now)&&M.hint(E)}}function Yd(e){return`${JSON.stringify(e??{status:"ok"})}
|
|
118
|
+
`}function Kw(e,t,n,r){if(n){let i=e instanceof dt?e.response:{code:e.code,message:e.message};return Yd(r?{...i,idempotencyKey:r}:i)}if(e instanceof dt||e instanceof $){let i=r&&`Send it again with --idempotency-key ${r} so it can't arrive twice.`;return vm(t,e.message,[e.hint,i].filter(Boolean).join(`
|
|
119
119
|
`))}return`${e.message}
|
|
120
120
|
${e.hint?`${t.style.dim(e.hint)}
|
|
121
|
-
`:""}`}function
|
|
121
|
+
`:""}`}function DC(e){return e.replace(/^error: /,"").replace(/^option '(?:-\w, )?(--[\w-]+)[^']*' argument '[^']*' is invalid\. Allowed choices are (.*)\.$/s,"$1 must be one of: $2.").replace(/^option '(?:-\w, )?(--[\w-]+)[^']*' argument '[^']*' is invalid\. (.*)$/s,"$1 $2").replace(/^option '(?:-\w, )?(--[\w-]+)[^']*' argument missing$/,"$1 needs a value.").replace(/^required option '(?:-\w, )?(--[\w-]+)[^']*' not specified$/,"$1 is required.").replace(/^option '(?:-\w, )?(--[\w-]+)[^']*' cannot be used with option '(?:-\w, )?(--[\w-]+)[^']*'$/,"Choose either $1 or $2, not both.").replace(/^command-argument value '[^']*' is invalid for argument '(\w+)'\. Allowed choices are (.*)\.$/s,"<$1> must be one of: $2.").replace(/^missing required argument '(\w+)'$/,"Missing <$1>.").replace(/^too many arguments(?: for '[^']*')?\. Expected (\d+) arguments? but got \d+: (.*)\.$/s,(t,n,r)=>`Expected ${Pe(Number(n),"argument")} but got ${r}. Put quotes around text with spaces.`).replace(/^unknown (command|option) '([^']*)'/,'Unknown $1 "$2".').replace(/\n\(Did you mean (.+)\?\)$/," Did you mean $1?").replace(/^./,t=>t.toUpperCase())}function vC(e,t){let n=e;for(let r of t){let i=n.commands.find(o=>o.name()===r);if(i)n=i;else if(!r.startsWith("-"))break}return n}function Gd(e,{sending:t,kind:n}){let r=e.error??{},i=CC(e),{code:o}=r,s=typeof r.message=="string"?r.message:void 0;if((o==="invalid_credential"||o==="unauthorized")&&n==="access")return new dt(r,i,s??"Ripple didn't accept this terminal's sign-in.","Run ripple login to sign in again.");if(o==="invalid_credential"||o==="unauthorized")return new dt(r,i,s??"Ripple didn't accept RIPPLE_KEY.",["A send key stops working once it's reset, and an API token after 180 days unused.","Get a new one in Ripple, then export RIPPLE_KEY again."].join(`
|
|
122
122
|
`));if(o==="invalid_key_rate_limited")return new dt(r,i,s??"Too many invalid keys from this IP address.",`After too many invalid keys, Ripple refuses every key from this network for a moment.
|
|
123
|
-
Check that scripts on this network use current keys.`);if(o==="insufficient_access"){let l=Array.isArray(r.neededAccess)?r.neededAccess.filter(
|
|
123
|
+
Check that scripts on this network use current keys.`);if(o==="insufficient_access"){let l=Array.isArray(r.neededAccess)?r.neededAccess.filter(om):[];return new dt(r,i,s??"This API token can't do that.",`Add one${l.length?` with ${sm(l)}`:""} in Settings \u2192 Developer \u2192 API tokens, then run: export RIPPLE_KEY=<token>`)}let a=`Ripple rejected the request${o?` (${String(o)})`:""}.`;return o==="invalid_source"&&t?new dt(r,i,s??a,n==="send"?Il:'Run "ripple sources" to see your sources.'):new dt(r,i,s??a)}function MC(e){return e instanceof Error?("code"in e?e.code:void 0)==="ERR_INVALID_URL"||e.message.includes("Invalid URL")||e.message.includes("Failed to parse URL"):!1}process.stdout.on("error",e=>{if(e.code!=="EPIPE")throw e;process.exit(0)});Jw().then(e=>{process.exitCode=e});
|