@pinc-official/pincjsc 0.0.2 → 0.1.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.
@@ -0,0 +1,513 @@
1
+ #!/usr/bin/env node
2
+ var Je=class extends Error{constructor(n,e,r){super(r),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=e,this.exitCode=n,this.nestedError=void 0}},Cr=class extends Je{constructor(n){super(1,"commander.invalidArgument",n),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};var yi=class{constructor(n,e){switch(this.description=e||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,n[0]){case"<":this.required=!0,this._name=n.slice(1,-1);break;case"[":this.required=!1,this._name=n.slice(1,-1);break;default:this.required=!0,this._name=n;break}this._name.endsWith("...")&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_collectValue(n,e){return e===this.defaultValue||!Array.isArray(e)?[n]:(e.push(n),e)}default(n,e){return this.defaultValue=n,this.defaultValueDescription=e,this}argParser(n){return this.parseArg=n,this}choices(n){return this.argChoices=n.slice(),this.parseArg=(e,r)=>{if(!this.argChoices.includes(e))throw new Cr(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._collectValue(e,r):e},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function _o(t){let n=t.name()+(t.variadic===!0?"...":"");return t.required?"<"+n+">":"["+n+"]"}import{EventEmitter as nm}from"node:events";import X_ from"node:child_process";import Ne from"node:path";import co from"node:fs";import xt from"node:process";import{stripVTControlCharacters as em}from"node:util";import{stripVTControlCharacters as Zf}from"node:util";var Ci=class{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(n){this.helpWidth=this.helpWidth??n.helpWidth??80}visibleCommands(n){let e=n.commands.filter(i=>!i._hidden),r=n._getHelpCommand();return r&&!r._hidden&&e.push(r),this.sortSubcommands&&e.sort((i,o)=>i.name().localeCompare(o.name())),e}compareOptions(n,e){let r=i=>i.short?i.short.replace(/^-/,""):i.long.replace(/^--/,"");return r(n).localeCompare(r(e))}visibleOptions(n){let e=n.options.filter(i=>!i.hidden),r=n._getHelpOption();if(r&&!r.hidden){let i=r.short&&n._findOption(r.short),o=r.long&&n._findOption(r.long);!i&&!o?e.push(r):r.long&&!o?e.push(n.createOption(r.long,r.description)):r.short&&!i&&e.push(n.createOption(r.short,r.description))}return this.sortOptions&&e.sort(this.compareOptions),e}visibleGlobalOptions(n){if(!this.showGlobalOptions)return[];let e=[];for(let r=n.parent;r;r=r.parent){let i=r.options.filter(o=>!o.hidden);e.push(...i)}return this.sortOptions&&e.sort(this.compareOptions),e}visibleArguments(n){return n._argsDescription&&n.registeredArguments.forEach(e=>{e.description=e.description||n._argsDescription[e.name()]||""}),n.registeredArguments.find(e=>e.description)?n.registeredArguments:[]}subcommandTerm(n){let e=n.registeredArguments.map(r=>_o(r)).join(" ");return n._name+(n._aliases[0]?"|"+n._aliases[0]:"")+(n.options.length?" [options]":"")+(e?" "+e:"")}optionTerm(n){return n.flags}argumentTerm(n){return n.name()}longestSubcommandTermLength(n,e){return e.visibleCommands(n).reduce((r,i)=>Math.max(r,this.displayWidth(e.styleSubcommandTerm(e.subcommandTerm(i)))),0)}longestOptionTermLength(n,e){return e.visibleOptions(n).reduce((r,i)=>Math.max(r,this.displayWidth(e.styleOptionTerm(e.optionTerm(i)))),0)}longestGlobalOptionTermLength(n,e){return e.visibleGlobalOptions(n).reduce((r,i)=>Math.max(r,this.displayWidth(e.styleOptionTerm(e.optionTerm(i)))),0)}longestArgumentTermLength(n,e){return e.visibleArguments(n).reduce((r,i)=>Math.max(r,this.displayWidth(e.styleArgumentTerm(e.argumentTerm(i)))),0)}commandUsage(n){let e=n._name;n._aliases[0]&&(e=e+"|"+n._aliases[0]);let r="";for(let i=n.parent;i;i=i.parent)r=i.name()+" "+r;return r+e+" "+n.usage()}commandDescription(n){return n.description()}subcommandDescription(n){return n.summary()||n.description()}optionDescription(n){let e=[];if(n.argChoices&&e.push(`choices: ${n.argChoices.map(r=>JSON.stringify(r)).join(", ")}`),n.defaultValue!==void 0&&(n.required||n.optional||n.isBoolean()&&typeof n.defaultValue=="boolean")&&e.push(`default: ${n.defaultValueDescription||JSON.stringify(n.defaultValue)}`),n.presetArg!==void 0&&n.optional&&e.push(`preset: ${JSON.stringify(n.presetArg)}`),n.envVar!==void 0&&e.push(`env: ${n.envVar}`),e.length>0){let r=`(${e.join(", ")})`;return n.description?`${n.description} ${r}`:r}return n.description}argumentDescription(n){let e=[];if(n.argChoices&&e.push(`choices: ${n.argChoices.map(r=>JSON.stringify(r)).join(", ")}`),n.defaultValue!==void 0&&e.push(`default: ${n.defaultValueDescription||JSON.stringify(n.defaultValue)}`),e.length>0){let r=`(${e.join(", ")})`;return n.description?`${n.description} ${r}`:r}return n.description}formatItemList(n,e,r){return e.length===0?[]:[r.styleTitle(n),...e,""]}groupItems(n,e,r){let i=new Map;return n.forEach(o=>{let _=r(o);i.has(_)||i.set(_,[])}),e.forEach(o=>{let _=r(o);i.has(_)||i.set(_,[]),i.get(_).push(o)}),i}formatHelp(n,e){let r=e.padWidth(n,e),i=e.helpWidth??80;function o(d,h){return e.formatItem(d,r,h,e)}let _=[`${e.styleTitle("Usage:")} ${e.styleUsage(e.commandUsage(n))}`,""],s=e.commandDescription(n);s.length>0&&(_=_.concat([e.boxWrap(e.styleCommandDescription(s),i),""]));let c=e.visibleArguments(n).map(d=>o(e.styleArgumentTerm(e.argumentTerm(d)),e.styleArgumentDescription(e.argumentDescription(d))));if(_=_.concat(this.formatItemList("Arguments:",c,e)),this.groupItems(n.options,e.visibleOptions(n),d=>d.helpGroupHeading??"Options:").forEach((d,h)=>{let y=d.map(x=>o(e.styleOptionTerm(e.optionTerm(x)),e.styleOptionDescription(e.optionDescription(x))));_=_.concat(this.formatItemList(h,y,e))}),e.showGlobalOptions){let d=e.visibleGlobalOptions(n).map(h=>o(e.styleOptionTerm(e.optionTerm(h)),e.styleOptionDescription(e.optionDescription(h))));_=_.concat(this.formatItemList("Global Options:",d,e))}return this.groupItems(n.commands,e.visibleCommands(n),d=>d.helpGroup()||"Commands:").forEach((d,h)=>{let y=d.map(x=>o(e.styleSubcommandTerm(e.subcommandTerm(x)),e.styleSubcommandDescription(e.subcommandDescription(x))));_=_.concat(this.formatItemList(h,y,e))}),_.join(`
3
+ `)}displayWidth(n){return Zf(n).length}styleTitle(n){return n}styleUsage(n){return n.split(" ").map(e=>e==="[options]"?this.styleOptionText(e):e==="[command]"?this.styleSubcommandText(e):e[0]==="["||e[0]==="<"?this.styleArgumentText(e):this.styleCommandText(e)).join(" ")}styleCommandDescription(n){return this.styleDescriptionText(n)}styleOptionDescription(n){return this.styleDescriptionText(n)}styleSubcommandDescription(n){return this.styleDescriptionText(n)}styleArgumentDescription(n){return this.styleDescriptionText(n)}styleDescriptionText(n){return n}styleOptionTerm(n){return this.styleOptionText(n)}styleSubcommandTerm(n){return n.split(" ").map(e=>e==="[options]"?this.styleOptionText(e):e[0]==="["||e[0]==="<"?this.styleArgumentText(e):this.styleSubcommandText(e)).join(" ")}styleArgumentTerm(n){return this.styleArgumentText(n)}styleOptionText(n){return n}styleArgumentText(n){return n}styleSubcommandText(n){return n}styleCommandText(n){return n}padWidth(n,e){return Math.max(e.longestOptionTermLength(n,e),e.longestGlobalOptionTermLength(n,e),e.longestSubcommandTermLength(n,e),e.longestArgumentTermLength(n,e))}preformatted(n){return/\n[^\S\r\n]/.test(n)}formatItem(n,e,r,i){let _=" ".repeat(2);if(!r)return _+n;let s=n.padEnd(e+n.length-i.displayWidth(n)),c=2,u=(this.helpWidth??80)-e-c-2,d;return u<this.minWidthToWrap||i.preformatted(r)?d=r:d=i.boxWrap(r,u).replace(/\n/g,`
4
+ `+" ".repeat(e+c)),_+s+" ".repeat(c)+d.replace(/\n/g,`
5
+ ${_}`)}boxWrap(n,e){if(e<this.minWidthToWrap)return n;let r=n.split(/\r\n|\n/),i=/[\s]*[^\s]+/g,o=[];return r.forEach(_=>{let s=_.match(i);if(s===null){o.push("");return}let c=[s.shift()],a=this.displayWidth(c[0]);s.forEach(u=>{let d=this.displayWidth(u);if(a+d<=e){c.push(u),a+=d;return}o.push(c.join(""));let h=u.trimStart();c=[h],a=this.displayWidth(h)}),o.push(c.join(""))}),o.join(`
6
+ `)}};var Rr=class{constructor(n,e){this.flags=n,this.description=e||"",this.required=n.includes("<"),this.optional=n.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(n),this.mandatory=!1;let r=Jf(n);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(n,e){return this.defaultValue=n,this.defaultValueDescription=e,this}preset(n){return this.presetArg=n,this}conflicts(n){return this.conflictsWith=this.conflictsWith.concat(n),this}implies(n){let e=n;return typeof n=="string"&&(e={[n]:!0}),this.implied=Object.assign(this.implied||{},e),this}env(n){return this.envVar=n,this}argParser(n){return this.parseArg=n,this}makeOptionMandatory(n=!0){return this.mandatory=!!n,this}hideHelp(n=!0){return this.hidden=!!n,this}_collectValue(n,e){return e===this.defaultValue||!Array.isArray(e)?[n]:(e.push(n),e)}choices(n){return this.argChoices=n.slice(),this.parseArg=(e,r)=>{if(!this.argChoices.includes(e))throw new Cr(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._collectValue(e,r):e},this}name(){return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){return this.negate?zc(this.name().replace(/^no-/,"")):zc(this.name())}helpGroup(n){return this.helpGroupHeading=n,this}is(n){return this.short===n||this.long===n}isBoolean(){return!this.required&&!this.optional&&!this.negate}},so=class{constructor(n){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,n.forEach(e=>{e.negate?this.negativeOptions.set(e.attributeName(),e):this.positiveOptions.set(e.attributeName(),e)}),this.negativeOptions.forEach((e,r)=>{this.positiveOptions.has(r)&&this.dualOptions.add(r)})}valueFromOption(n,e){let r=e.attributeName();if(!this.dualOptions.has(r))return!0;let i=this.negativeOptions.get(r).presetArg,o=i!==void 0?i:!1;return e.negate===(o===n)}};function zc(t){return t.split("-").reduce((n,e)=>n+e[0].toUpperCase()+e.slice(1))}function Jf(t){let n,e,r=/^-[^-]$/,i=/^--[^-]/,o=t.split(/[ |,]+/).concat("guard");if(r.test(o[0])&&(n=o.shift()),i.test(o[0])&&(e=o.shift()),!n&&r.test(o[0])&&(n=o.shift()),!n&&i.test(o[0])&&(n=e,e=o.shift()),o[0].startsWith("-")){let _=o[0],s=`option creation failed due to '${_}' in option flags '${t}'`;throw/^-[^-][^-]/.test(_)?new Error(`${s}
7
+ - a short flag is a single dash and a single character
8
+ - either use a single dash and a single character (for a short flag)
9
+ - or use a double dash for a long option (and can have two, like '--ws, --workspace')`):r.test(_)?new Error(`${s}
10
+ - too many short flags`):i.test(_)?new Error(`${s}
11
+ - too many long flags`):new Error(`${s}
12
+ - unrecognised flag format`)}if(n===void 0&&e===void 0)throw new Error(`option creation failed due to no flags found in '${t}'.`);return{shortFlag:n,longFlag:e}}function tm(t,n){if(Math.abs(t.length-n.length)>3)return Math.max(t.length,n.length);let e=[];for(let r=0;r<=t.length;r++)e[r]=[r];for(let r=0;r<=n.length;r++)e[0][r]=r;for(let r=1;r<=n.length;r++)for(let i=1;i<=t.length;i++){let o;t[i-1]===n[r-1]?o=0:o=1,e[i][r]=Math.min(e[i-1][r]+1,e[i][r-1]+1,e[i-1][r-1]+o),i>1&&r>1&&t[i-1]===n[r-2]&&t[i-2]===n[r-1]&&(e[i][r]=Math.min(e[i][r],e[i-2][r-2]+1))}return e[t.length][n.length]}function P_(t,n){if(!n||n.length===0)return"";n=Array.from(new Set(n));let e=t.startsWith("--");e&&(t=t.slice(2),n=n.map(_=>_.slice(2)));let r=[],i=3,o=.4;return n.forEach(_=>{if(_.length<=1)return;let s=tm(t,_),c=Math.max(t.length,_.length);(c-s)/c>o&&(s<i?(i=s,r=[_]):s===i&&r.push(_))}),r.sort((_,s)=>_.localeCompare(s)),e&&(r=r.map(_=>`--${_}`)),r.length>1?`
13
+ (Did you mean one of ${r.join(", ")}?)`:r.length===1?`
14
+ (Did you mean ${r[0]}?)`:""}var Ur=class t extends nm{constructor(n){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=n||"",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:e=>xt.stdout.write(e),writeErr:e=>xt.stderr.write(e),outputError:(e,r)=>r(e),getOutHelpWidth:()=>xt.stdout.isTTY?xt.stdout.columns:void 0,getErrHelpWidth:()=>xt.stderr.isTTY?xt.stderr.columns:void 0,getOutHasColors:()=>Hc()??(xt.stdout.isTTY&&xt.stdout.hasColors?.()),getErrHasColors:()=>Hc()??(xt.stderr.isTTY&&xt.stderr.hasColors?.()),stripColor:e=>em(e)},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(n){return this._outputConfiguration=n._outputConfiguration,this._helpOption=n._helpOption,this._helpCommand=n._helpCommand,this._helpConfiguration=n._helpConfiguration,this._exitCallback=n._exitCallback,this._storeOptionsAsProperties=n._storeOptionsAsProperties,this._combineFlagAndOptionalValue=n._combineFlagAndOptionalValue,this._allowExcessArguments=n._allowExcessArguments,this._enablePositionalOptions=n._enablePositionalOptions,this._showHelpAfterError=n._showHelpAfterError,this._showSuggestionAfterError=n._showSuggestionAfterError,this}_getCommandAndAncestors(){let n=[];for(let e=this;e;e=e.parent)n.push(e);return n}command(n,e,r){let i=e,o=r;typeof i=="object"&&i!==null&&(o=i,i=null),o=o||{};let[,_,s]=n.match(/([^ ]+) *(.*)/),c=this.createCommand(_);return i&&(c.description(i),c._executableHandler=!0),o.isDefault&&(this._defaultCommandName=c._name),c._hidden=!!(o.noHelp||o.hidden),c._executableFile=o.executableFile||null,s&&c.arguments(s),this._registerCommand(c),c.parent=this,c.copyInheritedSettings(this),i?this:c}createCommand(n){return new t(n)}createHelp(){return Object.assign(new Ci,this.configureHelp())}configureHelp(n){return n===void 0?this._helpConfiguration:(this._helpConfiguration=n,this)}configureOutput(n){return n===void 0?this._outputConfiguration:(this._outputConfiguration={...this._outputConfiguration,...n},this)}showHelpAfterError(n=!0){return typeof n!="string"&&(n=!!n),this._showHelpAfterError=n,this}showSuggestionAfterError(n=!0){return this._showSuggestionAfterError=!!n,this}addCommand(n,e){if(!n._name)throw new Error(`Command passed to .addCommand() must have a name
15
+ - specify the name in Command constructor or using .name()`);return e=e||{},e.isDefault&&(this._defaultCommandName=n._name),(e.noHelp||e.hidden)&&(n._hidden=!0),this._registerCommand(n),n.parent=this,n._checkForBrokenPassThrough(),this}createArgument(n,e){return new yi(n,e)}argument(n,e,r,i){let o=this.createArgument(n,e);return typeof r=="function"?o.default(i).argParser(r):o.default(r),this.addArgument(o),this}arguments(n){return n.trim().split(/ +/).forEach(e=>{this.argument(e)}),this}addArgument(n){let e=this.registeredArguments.slice(-1)[0];if(e?.variadic)throw new Error(`only the last argument can be variadic '${e.name()}'`);if(n.required&&n.defaultValue!==void 0&&n.parseArg===void 0)throw new Error(`a default value for a required argument is never used: '${n.name()}'`);return this.registeredArguments.push(n),this}helpCommand(n,e){if(typeof n=="boolean")return this._addImplicitHelpCommand=n,n&&this._defaultCommandGroup&&this._initCommandGroup(this._getHelpCommand()),this;let r=n??"help [command]",[,i,o]=r.match(/([^ ]+) *(.*)/),_=e??"display help for command",s=this.createCommand(i);return s.helpOption(!1),o&&s.arguments(o),_&&s.description(_),this._addImplicitHelpCommand=!0,this._helpCommand=s,(n||e)&&this._initCommandGroup(s),this}addHelpCommand(n,e){return typeof n!="object"?(this.helpCommand(n,e),this):(this._addImplicitHelpCommand=!0,this._helpCommand=n,this._initCommandGroup(n),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(n,e){let r=["preSubcommand","preAction","postAction"];if(!r.includes(n))throw new Error(`Unexpected value for event passed to hook : '${n}'.
16
+ Expecting one of '${r.join("', '")}'`);return this._lifeCycleHooks[n]?this._lifeCycleHooks[n].push(e):this._lifeCycleHooks[n]=[e],this}exitOverride(n){return n?this._exitCallback=n:this._exitCallback=e=>{if(e.code!=="commander.executeSubCommandAsync")throw e},this}_exit(n,e,r){this._exitCallback&&this._exitCallback(new Je(n,e,r)),xt.exit(n)}action(n){let e=r=>{let i=this.registeredArguments.length,o=r.slice(0,i);return this._storeOptionsAsProperties?o[i]=this:o[i]=this.opts(),o.push(this),n.apply(this,o)};return this._actionHandler=e,this}createOption(n,e){return new Rr(n,e)}_callParseArg(n,e,r,i){try{return n.parseArg(e,r)}catch(o){if(o.code==="commander.invalidArgument"){let _=`${i} ${o.message}`;this.error(_,{exitCode:o.exitCode,code:o.code})}throw o}}_registerOption(n){let e=n.short&&this._findOption(n.short)||n.long&&this._findOption(n.long);if(e){let r=n.long&&this._findOption(n.long)?n.long:n.short;throw new Error(`Cannot add option '${n.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${r}'
17
+ - already used by option '${e.flags}'`)}this._initOptionGroup(n),this.options.push(n)}_registerCommand(n){let e=i=>[i.name()].concat(i.aliases()),r=e(n).find(i=>this._findCommand(i));if(r){let i=e(this._findCommand(r)).join("|"),o=e(n).join("|");throw new Error(`cannot add command '${o}' as already have command '${i}'`)}this._initCommandGroup(n),this.commands.push(n)}addOption(n){this._registerOption(n);let e=n.name(),r=n.attributeName();n.defaultValue!==void 0&&this.setOptionValueWithSource(r,n.defaultValue,"default");let i=(o,_,s)=>{o==null&&n.presetArg!==void 0&&(o=n.presetArg);let c=this.getOptionValue(r);o!==null&&n.parseArg?o=this._callParseArg(n,o,c,_):o!==null&&n.variadic&&(o=n._collectValue(o,c)),o==null&&(n.negate?o=!1:n.isBoolean()||n.optional?o=!0:o=""),this.setOptionValueWithSource(r,o,s)};return this.on("option:"+e,o=>{let _=`error: option '${n.flags}' argument '${o}' is invalid.`;i(o,_,"cli")}),n.envVar&&this.on("optionEnv:"+e,o=>{let _=`error: option '${n.flags}' value '${o}' from env '${n.envVar}' is invalid.`;i(o,_,"env")}),this}_optionEx(n,e,r,i,o){if(typeof e=="object"&&e instanceof Rr)throw new Error("To add an Option object use addOption() instead of option() or requiredOption()");let _=this.createOption(e,r);if(_.makeOptionMandatory(!!n.mandatory),typeof i=="function")_.default(o).argParser(i);else if(i instanceof RegExp){let s=i;i=(c,a)=>{let u=s.exec(c);return u?u[0]:a},_.default(o).argParser(i)}else _.default(i);return this.addOption(_)}option(n,e,r,i){return this._optionEx({},n,e,r,i)}requiredOption(n,e,r,i){return this._optionEx({mandatory:!0},n,e,r,i)}combineFlagAndOptionalValue(n=!0){return this._combineFlagAndOptionalValue=!!n,this}allowUnknownOption(n=!0){return this._allowUnknownOption=!!n,this}allowExcessArguments(n=!0){return this._allowExcessArguments=!!n,this}enablePositionalOptions(n=!0){return this._enablePositionalOptions=!!n,this}passThroughOptions(n=!0){return this._passThroughOptions=!!n,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(n=!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=!!n,this}getOptionValue(n){return this._storeOptionsAsProperties?this[n]:this._optionValues[n]}setOptionValue(n,e){return this.setOptionValueWithSource(n,e,void 0)}setOptionValueWithSource(n,e,r){return this._storeOptionsAsProperties?this[n]=e:this._optionValues[n]=e,this._optionValueSources[n]=r,this}getOptionValueSource(n){return this._optionValueSources[n]}getOptionValueSourceWithGlobals(n){let e;return this._getCommandAndAncestors().forEach(r=>{r.getOptionValueSource(n)!==void 0&&(e=r.getOptionValueSource(n))}),e}_prepareUserArgs(n,e){if(n!==void 0&&!Array.isArray(n))throw new Error("first parameter to parse must be array or undefined");if(e=e||{},n===void 0&&e.from===void 0){xt.versions?.electron&&(e.from="electron");let i=xt.execArgv??[];(i.includes("-e")||i.includes("--eval")||i.includes("-p")||i.includes("--print"))&&(e.from="eval")}n===void 0&&(n=xt.argv),this.rawArgs=n.slice();let r;switch(e.from){case void 0:case"node":this._scriptPath=n[1],r=n.slice(2);break;case"electron":xt.defaultApp?(this._scriptPath=n[1],r=n.slice(2)):r=n.slice(1);break;case"user":r=n.slice(0);break;case"eval":r=n.slice(1);break;default:throw new Error(`unexpected parse option { from: '${e.from}' }`)}return!this._name&&this._scriptPath&&this.nameFromFilename(this._scriptPath),this._name=this._name||"program",r}parse(n,e){this._prepareForParse();let r=this._prepareUserArgs(n,e);return this._parseCommand([],r),this}async parseAsync(n,e){this._prepareForParse();let r=this._prepareUserArgs(n,e);return await this._parseCommand([],r),this}_prepareForParse(){this._savedState===null?(this.options.filter(n=>n.negate&&n.defaultValue===void 0&&this.getOptionValue(n.attributeName())===void 0).forEach(n=>{let e=n.long.replace(/^--no-/,"--");this._findOption(e)||this.setOptionValueWithSource(n.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(n,e,r){if(co.existsSync(n))return;let i=e?`searched for local subcommand relative to directory '${e}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",o=`'${n}' does not exist
19
+ - if '${r}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
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(n,e){e=e.slice();let r=[".js",".ts",".tsx",".mjs",".cjs"];function i(u,d){let h=Ne.resolve(u,d);if(co.existsSync(h))return h;if(r.includes(Ne.extname(d)))return;let y=r.find(x=>co.existsSync(`${h}${x}`));if(y)return`${h}${y}`}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let o=n._executableFile||`${this._name}-${n._name}`,_=this._executableDir||"";if(this._scriptPath){let u;try{u=co.realpathSync(this._scriptPath)}catch{u=this._scriptPath}_=Ne.resolve(Ne.dirname(u),_)}if(_){let u=i(_,o);if(!u&&!n._executableFile&&this._scriptPath){let d=Ne.basename(this._scriptPath,Ne.extname(this._scriptPath));d!==this._name&&(u=i(_,`${d}-${n._name}`))}o=u||o}let s=r.includes(Ne.extname(o)),c;xt.platform!=="win32"?s?(e.unshift(o),e=Vc(xt.execArgv).concat(e),c=X_.spawn(xt.argv[0],e,{stdio:"inherit"})):c=X_.spawn(o,e,{stdio:"inherit"}):(this._checkForMissingExecutable(o,_,n._name),e.unshift(o),e=Vc(xt.execArgv).concat(e),c=X_.spawn(xt.execPath,e,{stdio:"inherit"})),c.killed||["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach(d=>{xt.on(d,()=>{c.killed===!1&&c.exitCode===null&&c.kill(d)})});let a=this._exitCallback;c.on("close",u=>{u=u??1,a?a(new Je(u,"commander.executeSubCommandAsync","(close)")):xt.exit(u)}),c.on("error",u=>{if(u.code==="ENOENT")this._checkForMissingExecutable(o,_,n._name);else if(u.code==="EACCES")throw new Error(`'${o}' not executable`);if(!a)xt.exit(1);else{let d=new Je(1,"commander.executeSubCommandAsync","(error)");d.nestedError=u,a(d)}}),this.runningCommand=c}_dispatchSubcommand(n,e,r){let i=this._findCommand(n);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,e.concat(r));else return i._parseCommand(e,r)}),o}_dispatchHelpCommand(n){n||this.help();let e=this._findCommand(n);return e&&!e._executableHandler&&e.help(),this._dispatchSubcommand(n,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){this.registeredArguments.forEach((n,e)=>{n.required&&this.args[e]==null&&this.missingArgument(n.name())}),!(this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic)&&this.args.length>this.registeredArguments.length&&this._excessArguments(this.args)}_processArguments(){let n=(r,i,o)=>{let _=i;if(i!==null&&r.parseArg){let s=`error: command-argument value '${i}' is invalid for argument '${r.name()}'.`;_=this._callParseArg(r,i,o,s)}return _};this._checkNumberOfArguments();let e=[];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)=>n(r,s,_),r.defaultValue))):o===void 0&&(o=[]):i<this.args.length&&(o=this.args[i],r.parseArg&&(o=n(r,o,r.defaultValue))),e[i]=o}),this.processedArgs=e}_chainOrCall(n,e){return n?.then&&typeof n.then=="function"?n.then(()=>e()):e()}_chainOrCallHooks(n,e){let r=n,i=[];return this._getCommandAndAncestors().reverse().filter(o=>o._lifeCycleHooks[e]!==void 0).forEach(o=>{o._lifeCycleHooks[e].forEach(_=>{i.push({hookedCommand:o,callback:_})})}),e==="postAction"&&i.reverse(),i.forEach(o=>{r=this._chainOrCall(r,()=>o.callback(o.hookedCommand,this))}),r}_chainOrCallSubCommandHook(n,e,r){let i=n;return this._lifeCycleHooks[r]!==void 0&&this._lifeCycleHooks[r].forEach(o=>{i=this._chainOrCall(i,()=>o(this,e))}),i}_parseCommand(n,e){let r=this.parseOptions(e);if(this._parseOptionsEnv(),this._parseOptionsImplied(),n=n.concat(r.operands),e=r.unknown,this.args=n.concat(e),n&&this._findCommand(n[0]))return this._dispatchSubcommand(n[0],n.slice(1),e);if(this._getHelpCommand()&&n[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(n[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(e),this._dispatchSubcommand(this._defaultCommandName,n,e);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 _;return _=this._chainOrCallHooks(_,"preAction"),_=this._chainOrCall(_,()=>this._actionHandler(this.processedArgs)),this.parent&&(_=this._chainOrCall(_,()=>{this.parent.emit(o,n,e)})),_=this._chainOrCallHooks(_,"postAction"),_}if(this.parent?.listenerCount(o))i(),this._processArguments(),this.parent.emit(o,n,e);else if(n.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",n,e);this.listenerCount("command:*")?this.emit("command:*",n,e):this.commands.length?this.unknownCommand():(i(),this._processArguments())}else this.commands.length?(i(),this.help({error:!0})):(i(),this._processArguments())}_findCommand(n){if(n)return this.commands.find(e=>e._name===n||e._aliases.includes(n))}_findOption(n){return this.options.find(e=>e.is(n))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach(n=>{n.options.forEach(e=>{e.mandatory&&n.getOptionValue(e.attributeName())===void 0&&n.missingMandatoryOptionValue(e)})})}_checkForConflictingLocalOptions(){let n=this.options.filter(r=>{let i=r.attributeName();return this.getOptionValue(i)===void 0?!1:this.getOptionValueSource(i)!=="default"});n.filter(r=>r.conflictsWith.length>0).forEach(r=>{let i=n.find(o=>r.conflictsWith.includes(o.attributeName()));i&&this._conflictingOption(r,i)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach(n=>{n._checkForConflictingLocalOptions()})}parseOptions(n){let e=[],r=[],i=e;function o(u){return u.length>1&&u[0]==="-"}let _=u=>/^-(\d+|\d*\.\d+)(e[+-]?\d+)?$/.test(u)?!this._getCommandAndAncestors().some(d=>d.options.map(h=>h.short).some(h=>/^-\d$/.test(h))):!1,s=null,c=null,a=0;for(;a<n.length||c;){let u=c??n[a++];if(c=null,u==="--"){i===r&&i.push(u),i.push(...n.slice(a));break}if(s&&(!o(u)||_(u))){this.emit(`option:${s.name()}`,u);continue}if(s=null,o(u)){let d=this._findOption(u);if(d){if(d.required){let h=n[a++];h===void 0&&this.optionMissingArgument(d),this.emit(`option:${d.name()}`,h)}else if(d.optional){let h=null;a<n.length&&(!o(n[a])||_(n[a]))&&(h=n[a++]),this.emit(`option:${d.name()}`,h)}else this.emit(`option:${d.name()}`);s=d.variadic?d:null;continue}}if(u.length>2&&u[0]==="-"&&u[1]!=="-"){let d=this._findOption(`-${u[1]}`);if(d){d.required||d.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${d.name()}`,u.slice(2)):(this.emit(`option:${d.name()}`),c=`-${u.slice(2)}`);continue}}if(/^--[^=]+=/.test(u)){let d=u.indexOf("="),h=this._findOption(u.slice(0,d));if(h&&(h.required||h.optional)){this.emit(`option:${h.name()}`,u.slice(d+1));continue}}if(i===e&&o(u)&&!(this.commands.length===0&&_(u))&&(i=r),(this._enablePositionalOptions||this._passThroughOptions)&&e.length===0&&r.length===0){if(this._findCommand(u)){e.push(u),r.push(...n.slice(a));break}else if(this._getHelpCommand()&&u===this._getHelpCommand().name()){e.push(u,...n.slice(a));break}else if(this._defaultCommandName){r.push(u,...n.slice(a));break}}if(this._passThroughOptions){i.push(u,...n.slice(a));break}i.push(u)}return{operands:e,unknown:r}}opts(){if(this._storeOptionsAsProperties){let n={},e=this.options.length;for(let r=0;r<e;r++){let i=this.options[r].attributeName();n[i]=i===this._versionOptionName?this._version:this[i]}return n}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce((n,e)=>Object.assign(n,e.opts()),{})}error(n,e){this._outputConfiguration.outputError(`${n}
22
+ `,this._outputConfiguration.writeErr),typeof this._showHelpAfterError=="string"?this._outputConfiguration.writeErr(`${this._showHelpAfterError}
23
+ `):this._showHelpAfterError&&(this._outputConfiguration.writeErr(`
24
+ `),this.outputHelp({error:!0}));let r=e||{},i=r.exitCode||1,o=r.code||"commander.error";this._exit(i,o,n)}_parseOptionsEnv(){this.options.forEach(n=>{if(n.envVar&&n.envVar in xt.env){let e=n.attributeName();(this.getOptionValue(e)===void 0||["default","config","env"].includes(this.getOptionValueSource(e)))&&(n.required||n.optional?this.emit(`optionEnv:${n.name()}`,xt.env[n.envVar]):this.emit(`optionEnv:${n.name()}`))}})}_parseOptionsImplied(){let n=new so(this.options),e=r=>this.getOptionValue(r)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(r));this.options.filter(r=>r.implied!==void 0&&e(r.attributeName())&&n.valueFromOption(this.getOptionValue(r.attributeName()),r)).forEach(r=>{Object.keys(r.implied).filter(i=>!e(i)).forEach(i=>{this.setOptionValueWithSource(i,r.implied[i],"implied")})})}missingArgument(n){let e=`error: missing required argument '${n}'`;this.error(e,{code:"commander.missingArgument"})}optionMissingArgument(n){let e=`error: option '${n.flags}' argument missing`;this.error(e,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(n){let e=`error: required option '${n.flags}' not specified`;this.error(e,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(n,e){let r=_=>{let s=_.attributeName(),c=this.getOptionValue(s),a=this.options.find(d=>d.negate&&s===d.attributeName()),u=this.options.find(d=>!d.negate&&s===d.attributeName());return a&&(a.presetArg===void 0&&c===!1||a.presetArg!==void 0&&c===a.presetArg)?a:u||_},i=_=>{let s=r(_),c=s.attributeName();return this.getOptionValueSource(c)==="env"?`environment variable '${s.envVar}'`:`option '${s.flags}'`},o=`error: ${i(n)} cannot be used with ${i(e)}`;this.error(o,{code:"commander.conflictingOption"})}unknownOption(n){if(this._allowUnknownOption)return;let e="";if(n.startsWith("--")&&this._showSuggestionAfterError){let i=[],o=this;do{let _=o.createHelp().visibleOptions(o).filter(s=>s.long).map(s=>s.long);i=i.concat(_),o=o.parent}while(o&&!o._enablePositionalOptions);e=P_(n,i)}let r=`error: unknown option '${n}'${e}`;this.error(r,{code:"commander.unknownOption"})}_excessArguments(n){if(this._allowExcessArguments)return;let e=this.registeredArguments.length,r=e===1?"":"s",i=n.length,o=this.parent?` for '${this.name()}'`:"",_=n.join(", "),s=`error: too many arguments${o}. Expected ${e} argument${r} but got ${i}: ${_}.`;this.error(s,{code:"commander.excessArguments"})}unknownCommand(){let n=this.args[0],e="";if(this._showSuggestionAfterError){let i=[];this.createHelp().visibleCommands(this).forEach(o=>{i.push(o.name()),o.alias()&&i.push(o.alias())}),e=P_(n,i)}let r=`error: unknown command '${n}'${e}`;this.error(r,{code:"commander.unknownCommand"})}version(n,e,r){if(n===void 0)return this._version;this._version=n,e=e||"-V, --version",r=r||"output the version number";let i=this.createOption(e,r);return this._versionOptionName=i.attributeName(),this._registerOption(i),this.on("option:"+i.name(),()=>{this._outputConfiguration.writeOut(`${n}
25
+ `),this._exit(0,"commander.version",n)}),this}description(n,e){return n===void 0&&e===void 0?this._description:(this._description=n,e&&(this._argsDescription=e),this)}summary(n){return n===void 0?this._summary:(this._summary=n,this)}alias(n){if(n===void 0)return this._aliases[0];let e=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler&&(e=this.commands[this.commands.length-1]),n===e._name)throw new Error("Command alias can't be the same as its name");let r=this.parent?._findCommand(n);if(r){let i=[r.name()].concat(r.aliases()).join("|");throw new Error(`cannot add alias '${n}' to command '${this.name()}' as already have command '${i}'`)}return e._aliases.push(n),this}aliases(n){return n===void 0?this._aliases:(n.forEach(e=>this.alias(e)),this)}usage(n){if(n===void 0){if(this._usage)return this._usage;let e=this.registeredArguments.map(r=>_o(r));return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?e:[]).join(" ")}return this._usage=n,this}name(n){return n===void 0?this._name:(this._name=n,this)}helpGroup(n){return n===void 0?this._helpGroupHeading??"":(this._helpGroupHeading=n,this)}commandsGroup(n){return n===void 0?this._defaultCommandGroup??"":(this._defaultCommandGroup=n,this)}optionsGroup(n){return n===void 0?this._defaultOptionGroup??"":(this._defaultOptionGroup=n,this)}_initOptionGroup(n){this._defaultOptionGroup&&!n.helpGroupHeading&&n.helpGroup(this._defaultOptionGroup)}_initCommandGroup(n){this._defaultCommandGroup&&!n.helpGroup()&&n.helpGroup(this._defaultCommandGroup)}nameFromFilename(n){return this._name=Ne.basename(n,Ne.extname(n)),this}executableDir(n){return n===void 0?this._executableDir:(this._executableDir=n,this)}helpInformation(n){let e=this.createHelp(),r=this._getOutputContext(n);e.prepareContext({error:r.error,helpWidth:r.helpWidth,outputHasColors:r.hasColors});let i=e.formatHelp(this,e);return r.hasColors?i:this._outputConfiguration.stripColor(i)}_getOutputContext(n){n=n||{};let e=!!n.error,r,i,o;return e?(r=s=>this._outputConfiguration.writeErr(s),i=this._outputConfiguration.getErrHasColors(),o=this._outputConfiguration.getErrHelpWidth()):(r=s=>this._outputConfiguration.writeOut(s),i=this._outputConfiguration.getOutHasColors(),o=this._outputConfiguration.getOutHelpWidth()),{error:e,write:s=>(i||(s=this._outputConfiguration.stripColor(s)),r(s)),hasColors:i,helpWidth:o}}outputHelp(n){let e;typeof n=="function"&&(e=n,n=void 0);let r=this._getOutputContext(n),i={error:r.error,write:r.write,command:this};this._getCommandAndAncestors().reverse().forEach(_=>_.emit("beforeAllHelp",i)),this.emit("beforeHelp",i);let o=this.helpInformation({error:r.error});if(e&&(o=e(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(_=>_.emit("afterAllHelp",i))}helpOption(n,e){return typeof n=="boolean"?(n?(this._helpOption===null&&(this._helpOption=void 0),this._defaultOptionGroup&&this._initOptionGroup(this._getHelpOption())):this._helpOption=null,this):(this._helpOption=this.createOption(n??"-h, --help",e??"display help for command"),(n||e)&&this._initOptionGroup(this._helpOption),this)}_getHelpOption(){return this._helpOption===void 0&&this.helpOption(void 0,void 0),this._helpOption}addHelpOption(n){return this._helpOption=n,this._initOptionGroup(n),this}help(n){this.outputHelp(n);let e=Number(xt.exitCode??0);e===0&&n&&typeof n!="function"&&n.error&&(e=1),this._exit(e,"commander.help","(outputHelp)")}addHelpText(n,e){let r=["beforeAll","before","after","afterAll"];if(!r.includes(n))throw new Error(`Unexpected value for position to addHelpText.
26
+ Expecting one of '${r.join("', '")}'`);let i=`${n}Help`;return this.on(i,o=>{let _;typeof e=="function"?_=e({error:o.error,command:o.command}):_=e,_&&o.write(`${_}
27
+ `)}),this}_outputHelpIfRequested(n){let e=this._getHelpOption();e&&n.find(i=>e.is(i))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};function Vc(t){return t.map(n=>{if(!n.startsWith("--inspect"))return n;let e,r="127.0.0.1",i="9229",o;return(o=n.match(/^(--inspect(-brk)?)$/))!==null?e=o[1]:(o=n.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(e=o[1],/^\d+$/.test(o[3])?i=o[3]:r=o[3]):(o=n.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(e=o[1],r=o[3],i=o[4]),e&&i!=="0"?`${e}=${r}:${parseInt(i)+1}`:n})}function Hc(){if(xt.env.NO_COLOR||xt.env.FORCE_COLOR==="0"||xt.env.FORCE_COLOR==="false")return!1;if(xt.env.FORCE_COLOR||xt.env.CLICOLOR_FORCE!==void 0)return!0}var pb=new Ur;var Rc={};function B_(t){let n=Rc[t],e=n==null?1:n+1|0;return Rc[t]=e,e}function Lt(t){let n=B_(t);return t+("/"+n)}function Uc(t){return t==null?!1:typeof t.MEL_EXN_ID=="string"}function Wc(t){return t.MEL_EXN_ID}var p=(function(n,e){var r=e??{MEL_EXN_ID:n},i=Error.call(this,n,{cause:r});return i.cause==null&&Object.defineProperty(i,"cause",{configurable:!0,enumerable:!1,writable:!0,value:r}),Object.defineProperty(i,"name",{configurable:!0,enumerable:!1,writable:!0,value:"MelangeError"}),Object.assign(i,r),i});p.prototype=Error.prototype;function rm(t){if(Uc(t))return t;let n=new p("Js__Js_exn.Error/1");return n._1=t,n}var yt=rm;function Sr(t,n,e){let r=new Array(e),i=0,o=n;for(;i<e;)r[i]=t[o],i=i+1|0,o=o+1|0;return r}function Zt(t,n,e){if(n<0||n>=t.length)throw new p("Invalid_argument",{MEL_EXN_ID:"Invalid_argument",_1:"index out of bounds"});t[n]=e}function Gt(t,n){if(n<0||n>=t.length)throw new p("Invalid_argument",{MEL_EXN_ID:"Invalid_argument",_1:"index out of bounds"});return t[n]}function vt(t,n){let e=new Array(t);for(let r=0;r<t;++r)e[r]=n;return e}function Yc(t,n,e,r,i){if(r<=n){for(let o=0;o<i;++o)e[o+r|0]=t[o+n|0];return}for(let o=i-1|0;o>=0;--o)e[o+r|0]=t[o+n|0]}function Sn(t,n){for(;;){let e=n,r=t,i=r.length,o=i===0?1:i,_=e.length,s=o-_|0;if(s===0)return r.apply(null,e);if(s>=0)return function(c){return Sn(r,e.concat([c]))};n=Sr(e,o,-s|0),t=r.apply(null,Sr(e,0,o))}}function b(t,n){let e=t.length;if(e===1)return t(n);switch(e){case 1:return t(n);case 2:return function(r){return t(n,r)};case 3:return function(r,i){return t(n,r,i)};case 4:return function(r,i,o){return t(n,r,i,o)};case 5:return function(r,i,o,_){return t(n,r,i,o,_)};case 6:return function(r,i,o,_,s){return t(n,r,i,o,_,s)};case 7:return function(r,i,o,_,s,c){return t(n,r,i,o,_,s,c)};default:return Sn(t,[n])}}function $(t,n,e){let r=t.length;if(r===2)return t(n,e);switch(r){case 1:return Sn(t(n),[e]);case 2:return t(n,e);case 3:return function(i){return t(n,e,i)};case 4:return function(i,o){return t(n,e,i,o)};case 5:return function(i,o,_){return t(n,e,i,o,_)};case 6:return function(i,o,_,s){return t(n,e,i,o,_,s)};case 7:return function(i,o,_,s,c){return t(n,e,i,o,_,s,c)};default:return Sn(t,[n,e])}}function H(t,n,e,r){let i=t.length;if(i===3)return t(n,e,r);switch(i){case 1:return Sn(t(n),[e,r]);case 2:return Sn(t(n,e),[r]);case 3:return t(n,e,r);case 4:return function(o){return t(n,e,r,o)};case 5:return function(o,_){return t(n,e,r,o,_)};case 6:return function(o,_,s){return t(n,e,r,o,_,s)};case 7:return function(o,_,s,c){return t(n,e,r,o,_,s,c)};default:return Sn(t,[n,e,r])}}function ao(t,n,e,r,i){let o=t.length;if(o===4)return t(n,e,r,i);switch(o){case 1:return Sn(t(n),[e,r,i]);case 2:return Sn(t(n,e),[r,i]);case 3:return Sn(t(n,e,r),[i]);case 4:return t(n,e,r,i);case 5:return function(_){return t(n,e,r,i,_)};case 6:return function(_,s){return t(n,e,r,i,_,s)};case 7:return function(_,s,c){return t(n,e,r,i,_,s,c)};default:return Sn(t,[n,e,r,i])}}function Si(t,n,e,r,i,o){let _=t.length;if(_===5)return t(n,e,r,i,o);switch(_){case 1:return Sn(t(n),[e,r,i,o]);case 2:return Sn(t(n,e),[r,i,o]);case 3:return Sn(t(n,e,r),[i,o]);case 4:return Sn(t(n,e,r,i),[o]);case 5:return t(n,e,r,i,o);case 6:return function(s){return t(n,e,r,i,o,s)};case 7:return function(s,c){return t(n,e,r,i,o,s,c)};default:return Sn(t,[n,e,r,i,o])}}function F(t){return t===void 0?{MEL_PRIVATE_NESTED_SOME_NONE:0}:t!==null&&t.MEL_PRIVATE_NESTED_SOME_NONE!==void 0?{MEL_PRIVATE_NESTED_SOME_NONE:t.MEL_PRIVATE_NESTED_SOME_NONE+1|0}:t}function wt(t){if(!(t!==null&&t.MEL_PRIVATE_NESTED_SOME_NONE!==void 0))return t;let n=t.MEL_PRIVATE_NESTED_SOME_NONE;if(n!==0)return{MEL_PRIVATE_NESTED_SOME_NONE:n-1|0}}function Pe(t,n){return t<n?-1:t===n?0:1}function wi(t,n){return t===n?0:t<n?-1:t>n||t===t?1:n===n?-1:0}function Xe(t,n){return t===n?0:t<n?-1:1}function Qc(t,n){return t<n?t:n}function O_(t,n){return t>n?t:n}function tr(t,n){return t[1]===n[1]?t[0]===n[0]:!1}function xi(t,n){let e=n[0],r=t[0];return r>e?!0:r<e?!1:t[1]>=n[1]}function lo(t,n){return!tr(t,n)}function Ai(t,n){return!xi(t,n)}function Wr(t,n){return t[0]>n[0]?!0:t[0]<n[0]?!1:t[1]>n[1]}function q_(t,n){return!Wr(t,n)}var Ei=[-2147483648,0],po=[2147483647,4294967295],nr=[0,1],wn=[0,0],Zc=[-1,4294967295];function F_(t){return(t&-2147483648)!==0}function Kc(t){return(t&-2147483648)===0}function on(t){let n=(t[1]^-1)+1|0;return[(t[0]^-1)+(n===0?1:0)|0,n>>>0]}function z_(t,n,e){let r=t[1],i=r+n|0,o=F_(r)&&(F_(n)||Kc(i))||F_(n)&&Kc(i)?1:0;return[t[0]+e+o|0,i>>>0]}function Ce(t,n){return z_(t,n[1],n[0])}function uo(t,n,e){let r=(n^-1)+1>>>0,i=(e^-1)+(r===0?1:0)|0;return z_(t,r,i)}function rr(t,n){return uo(t,n[1],n[0])}function re(t,n){if(n===0)return t;let e=t[1];return n>=32?[e<<(n-32|0),0]:[e>>>(32-n|0)|t[0]<<n,e<<n>>>0]}function mn(t,n){if(n===0)return t;let e=t[0],r=n-32|0;return r===0?[0,e>>>0]:r>0?[0,e>>>r]:[e>>>n,(e<<(-r|0)|t[1]>>>n)>>>0]}function im(t,n){if(n===0)return t;let e=t[0];return n<32?[e>>n,(e<<(32-n|0)|t[1]>>>n)>>>0]:[e>=0?0:-1,e>>(n-32|0)>>>0]}function om(t){return t[0]!==0?!1:t[1]===0}function Be(t,n){for(;;){let e=n,r=t,i,o=r[0],_=0,s=0,c=0;if(o!==0)c=4;else{if(r[1]===0)return wn;c=4}if(c===4)if(e[0]!==0)s=3;else{if(e[1]===0)return wn;s=3}if(s===3&&(o!==-2147483648||r[1]!==0?_=2:i=e[1]),_===2){let a=e[0],u=r[1],d=0;if(a!==-2147483648||e[1]!==0?d=3:i=u,d===3){let h=e[1];if(o<0){if(a>=0)return on(Be(on(r),e));n=on(e),t=on(r);continue}if(a<0)return on(Be(r,on(e)));let y=o>>>16,x=o&65535,C=u>>>16,S=u&65535,G=a>>>16,D=a&65535,j=h>>>16,M=h&65535,O=0,N=0,rt=0,it=S*M;return rt=(it>>>16)+C*M,N=rt>>>16,rt=(rt&65535)+S*j,N=N+(rt>>>16)+x*M,O=N>>>16,N=(N&65535)+C*j,O=O+(N>>>16),N=(N&65535)+S*D,O=O+(N>>>16),N=N&65535,O=O+(y*M+x*j+C*D+S*G)&65535,[N|O<<16,(it&65535|(rt&65535)<<16)>>>0]}}return(i&1)===0?wn:Ei}}function Bn(t,n){return[t[0]|n[0],(t[1]|n[1])>>>0]}function Se(t,n){return[t[0]&n[0],(t[1]&n[1])>>>0]}function fo(t){return t[0]*4294967296+t[1]}function mo(t){if(isNaN(t)||!isFinite(t))return wn;if(t<=-9223372036854776e3)return Ei;if(t+1>=9223372036854776e3)return po;if(t<0)return on(mo(-t));let n=t/4294967296|0,e=t%4294967296|0;return[n,e>>>0]}function _m(t){let n=t[0],e=n>>21;return e===0?!0:e===-1?!(t[1]===0&&n===-2097152):!1}function er(t){if(_m(t))return String(fo(t));if(t[0]<0)return tr(t,Ei)?"-9223372036854775808":"-"+er(on(t));let n=mo(Math.floor(fo(t)/10)),e=n[1],r=n[0],i=uo(uo(t,e<<3,e>>>29|r<<3),e<<1,e>>>31|r<<1),o=i[1],_=i[0];if(o===0&&_===0)return er(n)+"0";if(_<0){let a=(o^-1)+1>>>0,u=Math.ceil(a/10),d=10*u-a;return er(uo(n,u|0,0))+String(d|0)}let s=Math.floor(o/10),c=o-10*s;return er(z_(n,s|0,0))+String(c|0)}function wr(t,n){for(;;){let e=n,r=t,i=0;if(e[0]!==0||e[1]!==0)i=1;else throw new p("Division_by_zero",{MEL_EXN_ID:"Division_by_zero"});if(i===1){let o=r[0],_=0;if(o!==-2147483648)if(o!==0)_=2;else{if(r[1]===0)return wn;_=2}else if(r[1]!==0)_=2;else{if(tr(e,nr)||tr(e,Zc))return r;if(tr(e,Ei))return nr;let s=im(r,1),c=re(wr(s,e),1),a=0;if(c[0]!==0)a=3;else{if(c[1]===0)return e[0]<0?nr:on(nr);a=3}if(a===3){let u=rr(r,Be(e,c));return Ce(c,wr(u,e))}}if(_===2){let s=e[0],c=0;if(s!==-2147483648)c=3;else{if(e[1]===0)return wn;c=3}if(c===3){if(o<0){if(s>=0)return on(wr(on(r),e));n=on(e),t=on(r);continue}if(s<0)return on(wr(r,on(e)));let a=wn,u=r;for(;xi(u,e);){let d=Math.floor(fo(u)/fo(e)),h=1>d?1:d,y=Math.ceil(Math.log(h)/Math.LN2),x=y<=48?1:Math.pow(2,y-48),C=mo(h),S=Be(C,e);for(;S[0]<0||Wr(S,u);)h=h-x,C=mo(h),S=Be(C,e);om(C)&&(C=nr),a=Ce(a,C),u=rr(u,S)}return a}}}}}function V_(t,n){return rr(t,Be(wr(t,n),n))}function xr(t,n){let e=wr(t,n);return[e,rr(t,Be(e,n))]}function On(t){return[t<0?-1:0,t>>>0]}function Un(t){return t[1]|0}function Jc(t){let n=t[1],e=t[0],r=function(_){return(_>>>0).toString(16)};if(e===0&&n===0)return"0";if(n===0)return r(e)+"00000000";if(e===0)return r(n);let i=r(n),o=8-i.length|0;return o<=0?r(e)+i:r(e)+("0".repeat(o)+i)}function H_(t){return[2147483647&t[0],t[1]]}function R_(t){return(function(n,e){return new Float64Array(new Int32Array([n,e]).buffer)[0]})(t[1],t[0])}function ta(t){let n=(function(e){return new Int32Array(new Float64Array([e]).buffer)})(t);return[n[1],n[0]>>>0]}function Ut(t,n,e){if(n<0||n>=t.length)throw new p("Invalid_argument",{MEL_EXN_ID:"Invalid_argument",_1:"index out of bounds"});t[n]=e}function $i(t,n){if(n<0||n>=t.length)throw new p("Invalid_argument",{MEL_EXN_ID:"Invalid_argument",_1:"index out of bounds"});return t[n]}function na(t,n,e,r){if(!(e<=0))for(let i=n,o=e+n|0;i<o;++i)t[i]=r}function Tt(t){if(t<0)throw new p("Invalid_argument",{MEL_EXN_ID:"Invalid_argument",_1:"String.create"});let n=new Array(t);for(let e=0;e<t;++e)n[e]=0;return n}function Ar(t,n,e,r,i){if(i<=0)return;if(t===e){if(n<r){let a=(t.length-r|0)-1|0,u=i-1|0,d=a>u?u:a;for(let h=d;h>=0;--h)t[r+h|0]=t[n+h|0];return}if(n<=r)return;let _=(t.length-n|0)-1|0,s=i-1|0,c=_>s?s:_;for(let a=0;a<=c;++a)t[r+a|0]=t[n+a|0];return}let o=t.length-n|0;if(i<=o){for(let _=0;_<i;++_)e[r+_|0]=t[n+_|0];return}for(let _=0;_<o;++_)e[r+_|0]=t[n+_|0];for(let _=o;_<i;++_)e[r+_|0]=0}function mt(t){let n=0,e=t.length,r="",i=e;if(n===0&&e<=4096&&e===t.length)return String.fromCharCode.apply(null,t);let o=0;for(;i>0;){let _=i<1024?i:1024,s=new Array(_);for(let c=0;c<_;++c)s[c]=t[c+o|0];r=r+String.fromCharCode.apply(null,s),i=i-_|0,o=o+_|0}return r}function me(t,n,e,r,i){if(i<=0)return;let o=t.length-n|0;if(i<=o){for(let _=0;_<i;++_)e[r+_|0]=t.charCodeAt(n+_|0);return}for(let _=0;_<o;++_)e[r+_|0]=t.charCodeAt(n+_|0);for(let _=o;_<i;++_)e[r+_|0]=0}function dn(t){let n=t.length,e=new Array(n);for(let r=0;r<n;++r)e[r]=t.charCodeAt(r);return e}function ho(t){return(t&255)<<8|(t&65280)>>>8}function go(t){return(t&255)<<24|(t&65280)<<8|(t&16711680)>>>8|(t&-16777216)>>>24}function U_(t){return Bn(Bn(Bn(Bn(Bn(Bn(Bn(re(Se(t,[0,255]),56),re(Se(t,[0,65280]),40)),re(Se(t,[0,16711680]),24)),re(Se(t,[0,4278190080]),8)),mn(Se(t,[255,0]),8)),mn(Se(t,[65280,0]),24)),mn(Se(t,[16711680,0]),40)),mn(Se(t,[-16777216,0]),56))}function bo(t,n,e){let r=255&e>>>8,i=255&e;t[n]=i,t[n+1|0]=r}function Ti(t,n,e){if(n<0||(n+1|0)>=t.length)throw new p("Invalid_argument",{MEL_EXN_ID:"Invalid_argument",_1:"index out of bounds"});bo(t,n,e)}function W_(t,n,e){let r=255&e>>>24,i=255&e>>>16,o=255&e>>>8,_=255&e;t[n]=_,t[n+1|0]=o,t[n+2|0]=i,t[n+3|0]=r}function Gi(t,n,e){if(n<0||(n+3|0)>=t.length)throw new p("Invalid_argument",{MEL_EXN_ID:"Invalid_argument",_1:"index out of bounds"});W_(t,n,e)}function Y_(t,n,e){let i=255&(mn(e,56)[1]|0),_=255&(mn(e,48)[1]|0),c=255&(mn(e,40)[1]|0),u=255&(mn(e,32)[1]|0),h=255&(mn(e,24)[1]|0),x=255&(mn(e,16)[1]|0),S=255&(mn(e,8)[1]|0),G=255&(e[1]|0);t[n]=G,t[n+1|0]=S,t[n+2|0]=x,t[n+3|0]=h,t[n+4|0]=u,t[n+5|0]=c,t[n+6|0]=_,t[n+7|0]=i}function Q_(t,n,e){if(n<0||(n+7|0)>=t.length)throw new p("Invalid_argument",{MEL_EXN_ID:"Invalid_argument",_1:"index out of bounds"});Y_(t,n,e)}var sm=(function(){if(typeof globalThis<"u")return globalThis;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;if(typeof this<"u")return this;throw new Error("Unable to locate global `this`")}),jt=(function(t){var n=sm();if(n[t]===void 0)throw new Error(t+` not polyfilled by Melange yet
28
+ `);return n[t]});function ea(t){return t>=65?t>=97?t>=123?-1:t-87|0:t>=91?-1:t-55|0:t>57||t<48?-1:t-48|0}function cm(t){switch(t){case 0:return 8;case 1:return 16;case 2:return 10;case 3:return 2}}function am(t){let n=1,e=2,r=0;switch(t.charCodeAt(r)){case 43:r=r+1|0;break;case 45:n=-1,r=r+1|0;break}if(t[r]==="0"){let o=t.charCodeAt(r+1|0);if(o>=89)if(o>=111){if(o<121)switch(o){case 111:e=0,r=r+2|0;break;case 117:r=r+2|0;break;case 112:case 113:case 114:case 115:case 116:case 118:case 119:break;case 120:e=1,r=r+2|0;break}}else o===98&&(e=3,r=r+2|0);else if(o!==66){if(o>=79)switch(o){case 79:e=0,r=r+2|0;break;case 85:r=r+2|0;break;case 80:case 81:case 82:case 83:case 84:case 86:case 87:break;case 88:e=1,r=r+2|0;break}}else e=3,r=r+2|0}return[r,n,e]}function vi(t){let n=am(t),e=n[0],r=cm(n[2]),i=4294967295,o=t.length,_=e<o?t.charCodeAt(e):0,s=ea(_);if(s<0||s>=r)throw new p("Failure",{MEL_EXN_ID:"Failure",_1:"int_of_string"});let c=function(d,h){for(;;){let y=h,x=d;if(y===o)return x;let C=t.charCodeAt(y);if(C===95){h=y+1|0;continue}let S=ea(C);if(S<0||S>=r)throw new p("Failure",{MEL_EXN_ID:"Failure",_1:"int_of_string"});let G=r*x+S;if(G>i)throw new p("Failure",{MEL_EXN_ID:"Failure",_1:"int_of_string"});h=y+1|0,d=G}},a=n[1]*c(s,e+1|0),u=a|0;if(r===10&&a!==u)throw new p("Failure",{MEL_EXN_ID:"Failure",_1:"int_of_string"});return u}function lm(t){switch(t){case 0:return 8;case 1:return 16;case 2:return 10}}function um(t){return t>=65&&t<=90||t>=192&&t<=214||t>=216&&t<=222?t+32|0:t}function K_(t){let n=t.length;if(n>31)throw new p("Invalid_argument",{MEL_EXN_ID:"Invalid_argument",_1:"format_int: format too long"});let e={justify:"+",signstyle:"-",filter:" ",alternate:!1,base:2,signedconv:!1,width:0,uppercase:!1,sign:1,prec:-1,conv:"f"},r=0;for(;;){let i=r;if(i>=n)return e;let o=t.charCodeAt(i),_=0;if(o>=69)if(o>=88)if(o>=121)_=1;else switch(o){case 88:e.base=1,e.uppercase=!0,r=i+1|0;continue;case 101:case 102:case 103:_=5;break;case 100:case 105:_=4;break;case 111:e.base=0,r=i+1|0;continue;case 117:e.base=2,r=i+1|0;continue;case 89:case 90:case 91:case 92:case 93:case 94:case 95:case 96:case 97:case 98:case 99:case 104:case 106:case 107:case 108:case 109:case 110:case 112:case 113:case 114:case 115:case 116:case 118:case 119:_=1;break;case 120:e.base=1,r=i+1|0;continue}else if(o>=72)_=1;else{e.signedconv=!0,e.uppercase=!0,e.conv=String.fromCharCode(um(o)),r=i+1|0;continue}else switch(o){case 35:e.alternate=!0,r=i+1|0;continue;case 32:case 43:_=2;break;case 45:e.justify="-",r=i+1|0;continue;case 46:e.prec=0;let s=i+1|0;for(;(function(){let c=t.charCodeAt(s)-48|0;return c>=0&&c<=9})();)e.prec=(Math.imul(e.prec,10)+t.charCodeAt(s)|0)-48|0,s=s+1|0;r=s;continue;case 48:e.filter="0",r=i+1|0;continue;case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:_=3;break;default:_=1}switch(_){case 1:r=i+1|0;continue;case 2:e.signstyle=String.fromCharCode(o),r=i+1|0;continue;case 3:e.width=0;let s=i;for(;(function(){let c=t.charCodeAt(s)-48|0;return c>=0&&c<=9})();)e.width=(Math.imul(e.width,10)+t.charCodeAt(s)|0)-48|0,s=s+1|0;r=s;continue;case 4:e.signedconv=!0,e.base=2,r=i+1|0;continue;case 5:e.signedconv=!0,e.conv=String.fromCharCode(o),r=i+1|0;continue}}}function Z_(t,n){let e=t.justify,r=t.signstyle,i=t.filter,o=t.alternate,_=t.base,s=t.signedconv,c=t.width,a=t.uppercase,u=t.sign,d=n.length;s&&(u<0||r!=="-")&&(d=d+1|0),o&&(_===0?d=d+1|0:_===1&&(d=d+2|0));let h="";if(e==="+"&&i===" ")for(let y=d;y<c;++y)h=h+i;if(s&&(u<0?h=h+"-":r!=="-"&&(h=h+r)),o&&_===0&&(h=h+"0"),o&&_===1&&(h=h+"0x"),e==="+"&&i==="0")for(let y=d;y<c;++y)h=h+i;if(h=a?h+n.toUpperCase():h+n,e==="-")for(let y=d;y<c;++y)h=h+" ";return h}function ie(t,n){if(t==="%d")return String(n);let e=K_(t),i=(n<0?e.signedconv?(e.sign=-1,-n>>>0):n>>>0:n).toString(lm(e.base));if(e.prec>=0){e.filter=" ";let o=e.prec-i.length|0;o>0&&(i="0".repeat(o)+i)}return Z_(e,i)}function fm(t){if(!Ai(t,wn))return er(t);let n=[0,10],e=H_(t),r=xr(e,n),i=xr(Ce([0,8],r[1]),n),o=Ce(Ce([214748364,3435973836],r[0]),i[0]);return er(o)+"0123456789"[Un(i[1])]}function mm(t){let n="",e=[0,8],r="01234567";if(Ai(t,wn)){let i=H_(t),o=xr(i,e),_=Ce([268435456,0],o[0]),s=o[1];for(n=r[Un(s)]+n;lo(_,wn);){let c=xr(_,e);_=c[0],s=c[1],n=r[Un(s)]+n}}else{let i=xr(t,e),o=i[0],_=i[1];for(n=r[Un(_)]+n;lo(o,wn);){let s=xr(o,e);o=s[0],_=s[1],n=r[Un(_)]+n}}return n}function J_(t,n){if(t==="%d")return er(n);let e=K_(t),r=e.signedconv&&Ai(n,wn)?(e.sign=-1,on(n)):n,i=e.base,o;switch(i){case 0:o=mm(r);break;case 1:o=Jc(r);break;case 2:o=fm(r);break}let _;if(e.prec>=0){e.filter=" ";let s=e.prec-o.length|0;_=s>0?"0".repeat(s)+o:o}else _=o;return Z_(e,_)}function ji(t,n){let e=K_(t),r=e.prec<0?6:e.prec,i=n<0?(e.sign=-1,-n):n,o="";if(isNaN(i))o="nan",e.filter=" ";else if(isFinite(i))switch(e.conv){case"e":o=i.toExponential(r);let s=o.length;o[s-3|0]==="e"&&(o=o.slice(0,s-1|0)+("0"+o.slice(s-1|0)));break;case"f":o=i.toFixed(r);break;case"g":let c=r!==0?r:1;o=i.toExponential(c-1|0);let a=o.indexOf("e"),u=Number(o.slice(a+1|0))|0;if(u<-4||i>=1e21||i.toFixed().length>c){let d=a-1|0;for(;o[d]==="0";)d=d-1|0;o[d]==="."&&(d=d-1|0),o=o.slice(0,d+1|0)+o.slice(a);let h=o.length;o[h-3|0]==="e"&&(o=o.slice(0,h-1|0)+("0"+o.slice(h-1|0)))}else{let d=c;if(u<0)d=d-(u+1|0)|0,o=i.toFixed(d);else for(;(function(){return o=i.toFixed(d),o.length>(c+1|0)})();)d=d-1|0;if(d!==0){let h=o.length-1|0;for(;o[h]==="0";)h=h-1|0;o[h]==="."&&(h=h-1|0),o=o.slice(0,h+1|0)}}break}else o="inf",e.filter=" ";return Z_(e,o)}var ra=(function(t,n,e){if(!isFinite(t))return isNaN(t)?"nan":t>0?"infinity":"-infinity";var r=t==0&&1/t==-1/0?1:t>=0?0:1;r&&(t=-t);var i=0;if(t!=0)if(t<1)for(;t<1&&i>-1022;)t*=2,i--;else for(;t>=2;)t/=2,i++;var o=i<0?"":"+",_="";if(r)_="-";else switch(e){case 43:_="+";break;case 32:_=" ";break;default:break}if(n>=0&&n<13){var s=Math.pow(2,n*4);t=Math.round(t*s)/s}var c=t.toString(16);if(n>=0){var a=c.indexOf(".");if(a<0)c+="."+"0".repeat(n);else{var u=a+1+n;c.length<u?c+="0".repeat(u-c.length):c=c.substr(0,u)}}return _+"0x"+c+"p"+o+i.toString(10)}),dm=(function(t,n){var e=+t;if(t.length>0&&e===e||(t=t.replace(/_/g,""),e=+t,t.length>0&&e===e||/^[+-]?nan$/i.test(t)))return e;var r=/^ *([+-]?)0x([0-9a-f]+)\.?([0-9a-f]*)p([+-]?[0-9]+)/i.exec(t);if(r){var i=r[3].replace(/0+$/,""),o=parseInt(r[1]+r[2]+i,16),_=(r[4]|0)-4*i.length;return e=o*Math.pow(2,_),e}if(/^\+?inf(inity)?$/i.test(t))return 1/0;if(/^-inf(inity)?$/i.test(t))return-1/0;throw n});function ts(t){return dm(t,new p("Failure",{MEL_EXN_ID:"Failure",_1:"float_of_string"}))}var ia=ie,ns=ie;var yo={buffer:"",output:(function(t,n){let e=n.length-1|0;if(typeof process<"u"&&process.stdout&&process.stdout.write)return process.stdout.write(n);n[e]===`
29
+ `?console.log(n.slice(0,e)):console.log(n)})},es={buffer:"",output:(function(t,n){let e=n.length-1|0;n[e]===`
30
+ `?console.log(n.slice(0,e)):console.log(n)})};function or(t){if(t.buffer!==""){t.output(t,t.buffer),t.buffer="";return}}function oa(t,n,e,r){let i=e===0&&r===n.length?n:n.slice(e,r);if(typeof process<"u"&&process.stdout&&process.stdout.write&&t===yo)return process.stdout.write(i);let o=i.lastIndexOf(`
31
+ `);o<0?t.buffer=t.buffer+i:(t.buffer=t.buffer+i.slice(0,o+1|0),or(t),t.buffer=t.buffer+i.slice(o+1|0))}function _a(t){return{hd:yo,tl:{hd:es,tl:0}}}function R(t,n){if(n>=t.length||n<0)throw new p("Invalid_argument",{MEL_EXN_ID:"Invalid_argument",_1:"index out of bounds"});return t.charCodeAt(n)}function rs(t){if(typeof process>"u"||process.env===void 0)throw new p("Not_found",{MEL_EXN_ID:"Not_found"});let n=process.env[t];if(n!==void 0)return n;throw new p("Not_found",{MEL_EXN_ID:"Not_found"})}var So=(function(t){return typeof process<"u"&&process.platform==="win32"?"Win32":"Unix"});function sa(t){if(typeof process>"u")return"";let n=process.argv;return n==null?"":n[0]}function ca(t){if(typeof process<"u")return process.exit(t)}function kt(t){if(typeof t!="object"&&typeof t!="function")return 0;switch(t.TAG){case 0:return{TAG:0,_0:kt(t._0)};case 1:return{TAG:1,_0:kt(t._0)};case 2:return{TAG:2,_0:kt(t._0)};case 3:return{TAG:3,_0:kt(t._0)};case 4:return{TAG:4,_0:kt(t._0)};case 5:return{TAG:5,_0:kt(t._0)};case 6:return{TAG:6,_0:kt(t._0)};case 7:return{TAG:7,_0:kt(t._0)};case 8:return{TAG:8,_0:t._0,_1:kt(t._1)};case 9:let n=t._0;return{TAG:9,_0:n,_1:n,_2:kt(t._2)};case 10:return{TAG:10,_0:kt(t._0)};case 11:return{TAG:11,_0:kt(t._0)};case 12:return{TAG:12,_0:kt(t._0)};case 13:return{TAG:13,_0:kt(t._0)};case 14:return{TAG:14,_0:kt(t._0)}}}function pn(t,n){if(typeof t!="object"&&typeof t!="function")return n;switch(t.TAG){case 0:return{TAG:0,_0:pn(t._0,n)};case 1:return{TAG:1,_0:pn(t._0,n)};case 2:return{TAG:2,_0:pn(t._0,n)};case 3:return{TAG:3,_0:pn(t._0,n)};case 4:return{TAG:4,_0:pn(t._0,n)};case 5:return{TAG:5,_0:pn(t._0,n)};case 6:return{TAG:6,_0:pn(t._0,n)};case 7:return{TAG:7,_0:pn(t._0,n)};case 8:return{TAG:8,_0:t._0,_1:pn(t._1,n)};case 9:return{TAG:9,_0:t._0,_1:t._1,_2:pn(t._2,n)};case 10:return{TAG:10,_0:pn(t._0,n)};case 11:return{TAG:11,_0:pn(t._0,n)};case 12:return{TAG:12,_0:pn(t._0,n)};case 13:return{TAG:13,_0:pn(t._0,n)};case 14:return{TAG:14,_0:pn(t._0,n)}}}function $t(t,n){if(typeof t!="object"&&typeof t!="function")return n;switch(t.TAG){case 0:return{TAG:0,_0:$t(t._0,n)};case 1:return{TAG:1,_0:$t(t._0,n)};case 2:return{TAG:2,_0:t._0,_1:$t(t._1,n)};case 3:return{TAG:3,_0:t._0,_1:$t(t._1,n)};case 4:return{TAG:4,_0:t._0,_1:t._1,_2:t._2,_3:$t(t._3,n)};case 5:return{TAG:5,_0:t._0,_1:t._1,_2:t._2,_3:$t(t._3,n)};case 6:return{TAG:6,_0:t._0,_1:t._1,_2:t._2,_3:$t(t._3,n)};case 7:return{TAG:7,_0:t._0,_1:t._1,_2:t._2,_3:$t(t._3,n)};case 8:return{TAG:8,_0:t._0,_1:t._1,_2:t._2,_3:$t(t._3,n)};case 9:return{TAG:9,_0:t._0,_1:$t(t._1,n)};case 10:return{TAG:10,_0:$t(t._0,n)};case 11:return{TAG:11,_0:t._0,_1:$t(t._1,n)};case 12:return{TAG:12,_0:t._0,_1:$t(t._1,n)};case 13:return{TAG:13,_0:t._0,_1:t._1,_2:$t(t._2,n)};case 14:return{TAG:14,_0:t._0,_1:t._1,_2:$t(t._2,n)};case 15:return{TAG:15,_0:$t(t._0,n)};case 16:return{TAG:16,_0:$t(t._0,n)};case 17:return{TAG:17,_0:t._0,_1:$t(t._1,n)};case 18:return{TAG:18,_0:t._0,_1:$t(t._1,n)};case 19:return{TAG:19,_0:$t(t._0,n)};case 20:return{TAG:20,_0:t._0,_1:t._1,_2:$t(t._2,n)};case 21:return{TAG:21,_0:t._0,_1:$t(t._1,n)};case 22:return{TAG:22,_0:$t(t._0,n)};case 23:return{TAG:23,_0:t._0,_1:$t(t._1,n)};case 24:return{TAG:24,_0:t._0,_1:t._1,_2:$t(t._2,n)}}}function hn(t){throw new p("Invalid_argument",{MEL_EXN_ID:"Invalid_argument",_1:t})}var ki="Failure",wo="Sys_error",xo="End_of_file";function Er(t){return t>=0?t:-t|0}function aa(t){return isFinite(t)?Math.abs(t)>=22250738585072014e-324?0:t!==0?1:2:isNaN(t)?4:3}function la(t){return t?"true":"false"}function hm(t){let n=t.length,e=0;for(;;){let r=e;if(r>=n)return t+".";let i=R(t,r);if(i>=48){if(i>=58)return t;e=r+1|0;continue}if(i!==45)return t;e=r+1|0}}function Ao(t){return hm(ji("%.12g",t))}function gm(t,n,e,r){for(;;){let i=t,o=n,_=e;if(!_){i[o]=r;return}let s=_.tl,c=_.hd;if(!s){i[o]={hd:c,tl:r};return}let a=s.tl,u=s.hd;if(!a){i[o]={hd:c,tl:{hd:u,tl:r}};return}let d={hd:a.hd,tl:24029};i[o]={hd:c,tl:{hd:u,tl:d}},e=a.tl,n="tl",t=d}}function oe(t,n){if(!t)return n;let e=t.tl,r=t.hd;if(!e)return{hd:r,tl:n};let i=e.tl,o=e.hd;if(!i)return{hd:r,tl:{hd:o,tl:n}};let _={hd:i.hd,tl:24029};return{hd:r,tl:{hd:o,tl:(gm(_,"tl",i.tl,n),_)}}}var Yr=yo,Qr=es;function bm(t){let n=_a();for(;;){let e=n;if(!e)return;try{or(e.hd)}catch(r){let i=yt(r);if(i.MEL_EXN_ID!==wo)throw i}n=e.tl}}function ss(t,n,e,r){if(e<0||r<0||e>(n.length-r|0))throw new p("Invalid_argument",{MEL_EXN_ID:"Invalid_argument",_1:"output_substring"});oa(t,n,e,r)}function ua(t,n,e){let r=jt("caml_ml_open_descriptor_in")(jt("caml_sys_open")(e,t,n));return jt("caml_ml_set_channel_name")(r,e),r}function fa(t){return ua({hd:0,tl:{hd:6,tl:0}},0,t)}function Eo(t,n,e,r){if(e<0||r<0||e>(n.length-r|0))throw new p("Invalid_argument",{MEL_EXN_ID:"Invalid_argument",_1:"input"});return jt("caml_ml_input")(t,n,e,r)}function ma(t){try{return jt("caml_ml_close_channel")(t)}catch{return}}var _s={contents:bm};function da(t){let n={contents:!0},e=_s.contents,r=function(i){n.contents||(n.contents=!1,b(t,void 0)),b(e,void 0)};_s.contents=r}var ym={contents:(function(t){})};function Cm(t){b(ym.contents,void 0),b(_s.contents,void 0)}function cs(t){return Cm(),ca(t)}var pa="Match_failure",ha="Assert_failure",L="Invalid_argument",pt="Not_found",ga="Out_of_memory",ba="Stack_overflow";var ya="Undefined_recursive_module",Fe=2147483647;function Sm(t,n){return jt("caml_ml_seek_out_64")(t,n)}function wm(t){return jt("caml_ml_pos_out_64")(t)}function xm(t){return jt("caml_ml_channel_size_64")(t)}function Am(t,n){return jt("caml_ml_seek_in_64")(t,n)}function Em(t){return jt("caml_ml_pos_in_64")(t)}function $m(t){return jt("caml_ml_channel_size_64")(t)}var $o={seek_out:Sm,pos_out:wm,out_channel_length:xm,seek_in:Am,pos_in:Em,in_channel_length:$m};var To=(function(t,n){for(var e in t)n(e)});function Mi(t,n){if(t===n)return 0;let e=typeof t,r=typeof n;switch(e){case"bigint":if(r==="bigint")return wi(t,n);break;case"boolean":if(r==="boolean")return Pe(t,n);break;case"function":if(r==="function")throw new p("Invalid_argument",{MEL_EXN_ID:"Invalid_argument",_1:"compare: functional value"});break;case"number":if(r==="number")return wi(t,n);break;case"string":return r==="string"?Xe(t,n):1;case"undefined":return-1}switch(r){case"string":return-1;case"undefined":return 1;default:if(e==="boolean")return 1;if(r==="boolean")return-1;if(e==="function")return 1;if(r==="function")return-1;if(e==="number")return n===null||n.MEL_PRIVATE_NESTED_SOME_NONE!==void 0?1:-1;if(r==="number")return t===null||t.MEL_PRIVATE_NESTED_SOME_NONE!==void 0?-1:1;if(t===null)return n.MEL_PRIVATE_NESTED_SOME_NONE!==void 0?1:-1;if(n===null)return t.MEL_PRIVATE_NESTED_SOME_NONE!==void 0?-1:1;if(t.MEL_PRIVATE_NESTED_SOME_NONE!==void 0)return n.MEL_PRIVATE_NESTED_SOME_NONE!==void 0?Ca(t,n):-1;let i=t.TAG,o=n.TAG;if(i===248)return Pe(t[1],n[1]);if(i===251)throw new p("Invalid_argument",{MEL_EXN_ID:"Invalid_argument",_1:"equal: abstract value"});if(i!==o)return i<o?-1:1;let _=t.length|0,s=n.length|0;if(_===s)if(Array.isArray(t)){let c=0;for(;;){let a=c;if(a===_)return 0;let u=Mi(t[a],n[a]);if(u!==0)return u;c=a+1|0}}else return t instanceof Date&&n instanceof Date?t-n:Ca(t,n);else if(_<s){let c=0;for(;;){let a=c;if(a===_)return-1;let u=Mi(t[a],n[a]);if(u!==0)return u;c=a+1|0}}else{let c=0;for(;;){let a=c;if(a===s)return 1;let u=Mi(t[a],n[a]);if(u!==0)return u;c=a+1|0}}}}function Ca(t,n){let e={contents:void 0},r={contents:void 0},i=function(d,h){let y=d[2],x=d[1];if(!(!Object.prototype.hasOwnProperty.call(x,h)||Mi(d[0][h],x[h])>0))return;let C=y.contents;if(!(C!==void 0&&h>=C)){y.contents=h;return}},o=[t,n,r],_=function(d){return i(o,d)},s=[n,t,e],c=function(d){return i(s,d)};To(t,_),To(n,c);let a=e.contents,u=r.contents;return a!==void 0?u!==void 0?Xe(a,u):-1:u!==void 0?1:0}function ut(t,n){if(t===n)return!0;let e=typeof t;if(e==="string"||e==="number"||e==="bigint"||e==="boolean"||e==="undefined"||t===null)return!1;let r=typeof n;if(e==="function"||r==="function")throw new p("Invalid_argument",{MEL_EXN_ID:"Invalid_argument",_1:"equal: functional value"});if(r==="number"||r==="bigint"||r==="undefined"||n===null)return!1;let i=t.TAG,o=n.TAG;if(i===248)return t[1]===n[1];if(i===251)throw new p("Invalid_argument",{MEL_EXN_ID:"Invalid_argument",_1:"equal: abstract value"});if(i!==o)return!1;let _=t.length|0,s=n.length|0;if(_===s)if(Array.isArray(t)){let c=0;for(;;){let a=c;if(a===_)return!0;if(!ut(t[a],n[a]))return!1;c=a+1|0}}else{if(t instanceof Date&&n instanceof Date)return!(t>n||t<n);{let c={contents:!0},a=function(d){if(!Object.prototype.hasOwnProperty.call(n,d)){c.contents=!1;return}},u=function(d){if(!Object.prototype.hasOwnProperty.call(t,d)||!ut(n[d],t[d])){c.contents=!1;return}};return To(t,a),c.contents&&To(n,u),c.contents}}else return!1}function $r(t,n){return(typeof t=="number"||typeof t=="bigint")&&(typeof n=="number"||typeof n=="bigint")?t!==n:!ut(t,n)}function Sa(t,n){return(typeof t=="number"||typeof t=="bigint")&&(typeof n=="number"||typeof n=="bigint")?t<n:Mi(t,n)<0}function Wt(t){let n=0,e=t;for(;;){let r=e,i=n;if(!r)return i;e=r.tl,n=i+1|0}}function Ii(t,n){for(;;){let e=n,r=t;if(!r)return e;n={hd:r.hd,tl:e},t=r.tl}}function Yt(t){return Ii(t,0)}function Tm(t,n,e,r){for(;;){let i=t,o=n,_=r;if(!_){i[o]=0;return}let s=_.tl,c=_.hd;if(s){let u=b(e,c),h={hd:b(e,s.hd),tl:24029};i[o]={hd:u,tl:h},r=s.tl,n="tl",t=h;continue}let a=b(e,c);i[o]={hd:a,tl:0};return}}function gn(t,n){if(!n)return 0;let e=n.tl,r=n.hd;if(e){let o=b(t,r),s={hd:b(t,e.hd),tl:24029};return{hd:o,tl:(Tm(s,"tl",t,e.tl),s)}}return{hd:b(t,r),tl:0}}function Gm(t,n,e,r,i){for(;;){let o=t,_=n,s=e,c=i;if(!c){o[_]=0;return}let a=c.tl,u=c.hd;if(a){let h=$(r,s,u),x={hd:$(r,s+1|0,a.hd),tl:24029};o[_]={hd:h,tl:x},i=a.tl,e=s+2|0,n="tl",t=x;continue}let d=$(r,s,u);o[_]={hd:d,tl:0};return}}function wa(t,n){let e=0;if(!n)return 0;let r=n.tl,i=n.hd;if(r){let _=$(t,e,i),c={hd:$(t,e+1|0,r.hd),tl:24029};return{hd:_,tl:(Gm(c,"tl",e+2|0,t,r.tl),c)}}return{hd:$(t,e,i),tl:0}}function we(t,n){for(;;){let e=n;if(!e)return;b(t,e.hd),n=e.tl}}function _t(t,n,e){for(;;){let r=e,i=n;if(!r)return i;e=r.tl,n=$(t,i,r.hd)}}function xa(t,n){for(;;){let e=n;if(!e)return!1;if(b(t,e.hd))return!0;n=e.tl}}function Li(t,n){for(;;){let e=n;if(!e)return;let r=e.hd;if(ut(r[0],t))return F(r[1]);n=e.tl}}function vm(t,n,e,r,i){for(;;){let o=t,_=n,s=r,c=i;if(!c){o[_]=0;return}let a=c.tl,u=c.hd,d=s+1|0;if($(e,s,u)){let h={hd:u,tl:24029};o[_]=h,i=a,r=d,n="tl",t=h;continue}i=a,r=d}}function Aa(t,n){let e=0,r=n;for(;;){let i=r,o=e;if(!i)return 0;let _=i.tl,s=i.hd,c=o+1|0;if($(t,o,s)){let a={hd:s,tl:24029};return vm(a,"tl",t,c,_),a}r=_,e=c}}function Go(t,n){for(;;){let e=n;if(!e)return 0;let r=e.tl,i=b(t,e.hd);if(i!==void 0){let o={hd:wt(i),tl:24029};return jm(o,"tl",t,r),o}n=r}}function jm(t,n,e,r){for(;;){let i=t,o=n,_=r;if(!_){i[o]=0;return}let s=_.tl,c=b(e,_.hd);if(c!==void 0){let a={hd:wt(c),tl:24029};i[o]=a,r=s,n="tl",t=a;continue}r=s}}function as(t,n){if(n){let e=b(t,n.hd),r=n.tl;if(!e)return as(t,r);let i={hd:e.hd,tl:24029};return Ea(i,"tl",e.tl,t,r),i}else return 0}function Ea(t,n,e,r,i){for(;;){let o=t,_=n,s=e;if(!s){if(i)return Ea(o,_,b(r,i.hd),r,i.tl);o[_]=0;return}let c={hd:s.hd,tl:24029};o[_]=c,e=s.tl,n="tl",t=c}}function $a(t,n){let e=function(r,i,o,_){for(;;){let s=r,c=i,a=o,u=_;if(a===0){s[c]=0;return}if(!u){s[c]=0;return}let d={hd:u.hd,tl:24029};s[c]=d,_=u.tl,o=a-1|0,i="tl",r=d}};if(t<=0)return 0;{if(t===0||!n)return 0;let r={hd:n.hd,tl:24029};return e(r,"tl",t-1|0,n.tl),r}}function Ta(t,n){if(t<=0)return n;{let e=0,r=n;for(;;){let i=r,o=e;if(!i||o>=t)return i;r=i.tl,e=o+1|0}}}function Tr(t){if(!t)return[0,0];let n=t.hd,e=Tr(t.tl);return[{hd:n[0],tl:e[0]},{hd:n[1],tl:e[1]}]}function Ga(t,n){let e=function(s,c,a){for(;;){let u=a,d=c,h=s;if(!h)return Ii(d,u);if(!d)return Ii(h,u);let y=d.tl,x=d.hd,C=h.tl,S=h.hd,G=$(t,S,x);if(G===0){a={hd:S,tl:u},c=y,s=C;continue}if(G<0){a={hd:S,tl:u},s=C;continue}a={hd:x,tl:u},c=y}},r=function(s,c,a){for(;;){let u=a,d=c,h=s;if(!h)return Ii(d,u);if(!d)return Ii(h,u);let y=d.tl,x=d.hd,C=h.tl,S=h.hd,G=$(t,S,x);if(G===0){a={hd:S,tl:u},c=y,s=C;continue}if(G>0){a={hd:S,tl:u},s=C;continue}a={hd:x,tl:u},c=y}},i=function(s,c){if(s!==2){if(s===3&&c){let y=c.tl;if(y){let x=y.tl;if(x){let C=x.hd,S=y.hd,G=c.hd,D=$(t,G,S),j;if(D===0){let M=$(t,G,C);j=M===0?{hd:G,tl:0}:M<0?{hd:G,tl:{hd:C,tl:0}}:{hd:C,tl:{hd:G,tl:0}}}else if(D<0){let M=$(t,S,C);if(M===0)j={hd:G,tl:{hd:S,tl:0}};else if(M<0)j={hd:G,tl:{hd:S,tl:{hd:C,tl:0}}};else{let O=$(t,G,C);j=O===0?{hd:G,tl:{hd:S,tl:0}}:O<0?{hd:G,tl:{hd:C,tl:{hd:S,tl:0}}}:{hd:C,tl:{hd:G,tl:{hd:S,tl:0}}}}}else{let M=$(t,G,C);if(M===0)j={hd:S,tl:{hd:G,tl:0}};else if(M<0)j={hd:S,tl:{hd:G,tl:{hd:C,tl:0}}};else{let O=$(t,S,C);j=O===0?{hd:S,tl:{hd:G,tl:0}}:O<0?{hd:S,tl:{hd:C,tl:{hd:G,tl:0}}}:{hd:C,tl:{hd:S,tl:{hd:G,tl:0}}}}}return[j,x.tl]}}}}else if(c){let y=c.tl;if(y){let x=y.hd,C=c.hd,S=$(t,C,x);return[S===0?{hd:C,tl:0}:S<0?{hd:C,tl:{hd:x,tl:0}}:{hd:x,tl:{hd:C,tl:0}},y.tl]}}let a=s>>1,u=s-a|0,d=o(a,c),h=o(u,d[1]);return[r(d[0],h[0],0),h[1]]},o=function(s,c){if(s!==2){if(s===3&&c){let y=c.tl;if(y){let x=y.tl;if(x){let C=x.hd,S=y.hd,G=c.hd,D=$(t,G,S),j;if(D===0){let M=$(t,G,C);j=M===0?{hd:G,tl:0}:M>0?{hd:G,tl:{hd:C,tl:0}}:{hd:C,tl:{hd:G,tl:0}}}else if(D>0){let M=$(t,S,C);if(M===0)j={hd:G,tl:{hd:S,tl:0}};else if(M>0)j={hd:G,tl:{hd:S,tl:{hd:C,tl:0}}};else{let O=$(t,G,C);j=O===0?{hd:G,tl:{hd:S,tl:0}}:O>0?{hd:G,tl:{hd:C,tl:{hd:S,tl:0}}}:{hd:C,tl:{hd:G,tl:{hd:S,tl:0}}}}}else{let M=$(t,G,C);if(M===0)j={hd:S,tl:{hd:G,tl:0}};else if(M>0)j={hd:S,tl:{hd:G,tl:{hd:C,tl:0}}};else{let O=$(t,S,C);j=O===0?{hd:S,tl:{hd:G,tl:0}}:O>0?{hd:S,tl:{hd:C,tl:{hd:G,tl:0}}}:{hd:C,tl:{hd:S,tl:{hd:G,tl:0}}}}}return[j,x.tl]}}}}else if(c){let y=c.tl;if(y){let x=y.hd,C=c.hd,S=$(t,C,x);return[S===0?{hd:C,tl:0}:S>0?{hd:C,tl:{hd:x,tl:0}}:{hd:x,tl:{hd:C,tl:0}},y.tl]}}let a=s>>1,u=s-a|0,d=i(a,c),h=i(u,d[1]);return[e(d[0],h[0],0),h[1]]},_=Wt(n);return _<2?n:i(_,n)[0]}function km(t,n,e){for(;;){let r=t,i=n,_=b(e,void 0);if(typeof _!="object"&&typeof _!="function"){r[i]=0;return}let s=_._0,c=b(_._1,void 0);if(typeof c!="object"&&typeof c!="function"){r[i]={hd:s,tl:0};return}let a={hd:c._0,tl:24029};r[i]={hd:s,tl:a},e=c._1,n="tl",t=a}}function va(t){let n=b(t,void 0);if(typeof n!="object"&&typeof n!="function")return 0;let e=n._0,r=b(n._1,void 0);if(typeof r!="object"&&typeof r!="function")return{hd:e,tl:0};let i={hd:r._0,tl:24029};return{hd:e,tl:(km(i,"tl",r._1),i)}}function ja(t,n,e){return t.v===n?(t.v=e,!0):!1}function ls(t,n){let e=t.v;return t.v=e+n|0,e}function ka(t){ls(t,1)}var bb=sa(),Ma=So();var Gr=!1,yb=So()==="Unix",Cb=So()==="Win32";function Ia(t){let n=typeof process>"u"?void 0:process;if(n!==void 0)return n.env[t]}var vo=65536;var fs=32;var Mn=2147483647,Kr=2147483647;var Sb=Kr-2|0;var ms=253,jo=254;function Zr(t,n,e){for(;;){let r=e,i=n,o=b(r,void 0);if(typeof o!="object"&&typeof o!="function")return i;let _=$(t,i,o._0);e=o._1,n=_}}function Da(t){let n=function(f){return typeof f!="object"&&typeof f!="function"?0:f.h},e=function(f,m,l,g){let w=n(f),E=n(g);return{TAG:0,l:f,v:m,d:l,r:g,h:w>=E?w+1|0:E+1|0}},r=function(f,m){return{TAG:0,l:0,v:f,d:m,r:0,h:1}},i=function(f,m,l,g){let w;w=typeof f!="object"&&typeof f!="function"?0:f.h;let E;if(E=typeof g!="object"&&typeof g!="function"?0:g.h,w>(E+2|0)){if(typeof f!="object"&&typeof f!="function")throw new p("Invalid_argument",{MEL_EXN_ID:"Invalid_argument",_1:"Map.bal"});let st=f.r,fn=f.d,Rt=f.v,De=f.l;if(n(De)>=n(st))return e(De,Rt,fn,e(st,m,l,g));if(!(typeof st!="object"&&typeof st!="function"))return e(e(De,Rt,fn,st.l),st.v,st.d,e(st.r,m,l,g));throw new p("Invalid_argument",{MEL_EXN_ID:"Invalid_argument",_1:"Map.bal"})}if(E<=(w+2|0))return{TAG:0,l:f,v:m,d:l,r:g,h:w>=E?w+1|0:E+1|0};if(typeof g!="object"&&typeof g!="function")throw new p("Invalid_argument",{MEL_EXN_ID:"Invalid_argument",_1:"Map.bal"});let v=g.r,I=g.d,B=g.v,Y=g.l;if(n(v)>=n(Y))return e(e(f,m,l,Y),B,I,v);if(!(typeof Y!="object"&&typeof Y!="function"))return e(e(f,m,l,Y.l),Y.v,Y.d,e(Y.r,B,I,v));throw new p("Invalid_argument",{MEL_EXN_ID:"Invalid_argument",_1:"Map.bal"})},o=function(f){return typeof f!="object"&&typeof f!="function"},_=function(f){if(typeof f!="object"&&typeof f!="function")return!1;let m=f.l;if(!(typeof m!="object"&&typeof m!="function"))return!1;let l=f.r;return typeof l!="object"&&typeof l!="function"},s=function(f,m,l){if(typeof l!="object"&&typeof l!="function")return{TAG:0,l:0,v:f,d:m,r:0,h:1};let g=l.r,w=l.d,E=l.v,v=l.l,I=$(t.compare,f,E);if(I===0)return w===m?l:{TAG:0,l:v,v:f,d:m,r:g,h:l.h};if(I<0){let Y=s(f,m,v);return v===Y?l:i(Y,E,w,g)}let B=s(f,m,g);return g===B?l:i(v,E,w,B)},c=function(f,m){for(;;){let l=m;if(typeof l!="object"&&typeof l!="function")throw new p(pt,{MEL_EXN_ID:pt});let g=$(t.compare,f,l.v);if(g===0)return l.d;m=g<0?l.l:l.r}},a=function(f,m){for(;;){let l=m;if(typeof l!="object"&&typeof l!="function")throw new p(pt,{MEL_EXN_ID:pt});let g=l.v;if(b(f,g)){let w=g,E=l.d,v=l.l;for(;;){let I=v,B=E,Y=w;if(typeof I!="object"&&typeof I!="function")return[Y,B];let st=I.v;if(b(f,st)){v=I.l,E=I.d,w=st;continue}v=I.r}}m=l.r}},u=function(f,m){for(;;){let l=m;if(typeof l!="object"&&typeof l!="function")return;let g=l.v;if(b(f,g)){let w=g,E=l.d,v=l.l;for(;;){let I=v,B=E,Y=w;if(typeof I!="object"&&typeof I!="function")return[Y,B];let st=I.v;if(b(f,st)){v=I.l,E=I.d,w=st;continue}v=I.r}}m=l.r}},d=function(f,m){for(;;){let l=m;if(typeof l!="object"&&typeof l!="function")throw new p(pt,{MEL_EXN_ID:pt});let g=l.v;if(b(f,g)){let w=g,E=l.d,v=l.r;for(;;){let I=v,B=E,Y=w;if(typeof I!="object"&&typeof I!="function")return[Y,B];let st=I.v;if(b(f,st)){v=I.r,E=I.d,w=st;continue}v=I.l}}m=l.l}},h=function(f,m){for(;;){let l=m;if(typeof l!="object"&&typeof l!="function")return;let g=l.v;if(b(f,g)){let w=g,E=l.d,v=l.r;for(;;){let I=v,B=E,Y=w;if(typeof I!="object"&&typeof I!="function")return[Y,B];let st=I.v;if(b(f,st)){v=I.r,E=I.d,w=st;continue}v=I.l}}m=l.l}},y=function(f,m){for(;;){let l=m;if(typeof l!="object"&&typeof l!="function")return;let g=$(t.compare,f,l.v);if(g===0)return F(l.d);m=g<0?l.l:l.r}},x=function(f,m){for(;;){let l=m;if(typeof l!="object"&&typeof l!="function")return!1;let g=$(t.compare,f,l.v);if(g===0)return!0;m=g<0?l.l:l.r}},C=function(f){for(;;){let m=f;if(typeof m!="object"&&typeof m!="function")throw new p(pt,{MEL_EXN_ID:pt});let l=m.l;if(typeof l!="object"&&typeof l!="function")return[m.v,m.d];f=l}},S=function(f){for(;;){let m=f;if(typeof m!="object"&&typeof m!="function")return;let l=m.l;if(typeof l!="object"&&typeof l!="function")return[m.v,m.d];f=l}},G=function(f){for(;;){let m=f;if(typeof m!="object"&&typeof m!="function")throw new p(pt,{MEL_EXN_ID:pt});let l=m.r;if(typeof l!="object"&&typeof l!="function")return[m.v,m.d];f=m.r}},D=function(f){for(;;){let m=f;if(typeof m!="object"&&typeof m!="function")return;let l=m.r;if(typeof l!="object"&&typeof l!="function")return[m.v,m.d];f=m.r}},j=function(f){if(typeof f!="object"&&typeof f!="function")throw new p("Invalid_argument",{MEL_EXN_ID:"Invalid_argument",_1:"Map.remove_min_elt"});let m=f.l;return typeof m!="object"&&typeof m!="function"?f.r:i(j(m),f.v,f.d,f.r)},M=function(f,m){if(typeof f!="object"&&typeof f!="function")return m;if(typeof m!="object"&&typeof m!="function")return f;let l=C(m);return i(f,l[0],l[1],j(m))},O=function(f,m){if(typeof m!="object"&&typeof m!="function")return 0;let l=m.r,g=m.d,w=m.v,E=m.l,v=$(t.compare,f,w);if(v===0)return M(E,l);if(v<0){let B=O(f,E);return E===B?m:i(B,w,g,l)}let I=O(f,l);return l===I?m:i(E,w,g,I)},N=function(f,m,l){if(typeof l!="object"&&typeof l!="function"){let Y=b(m,void 0);return Y!==void 0?{TAG:0,l:0,v:f,d:wt(Y),r:0,h:1}:0}let g=l.r,w=l.d,E=l.v,v=l.l,I=$(t.compare,f,E);if(I===0){let Y=b(m,F(w));if(Y===void 0)return M(v,g);let st=wt(Y);return w===st?l:{TAG:0,l:v,v:f,d:st,r:g,h:l.h}}if(I<0){let Y=N(f,m,v);return v===Y?l:i(Y,E,w,g)}let B=N(f,m,g);return g===B?l:i(v,E,w,B)},rt=function(f,m,l){return N(f,function(w){return w!==void 0?{hd:m,tl:w}:{hd:m,tl:0}},l)},it=function(f,m){for(;;){let l=m;if(typeof l!="object"&&typeof l!="function")return;it(f,l.l),$(f,l.v,l.d),m=l.r}},Q=function(f,m){if(typeof m!="object"&&typeof m!="function")return 0;let l=Q(f,m.l),g=b(f,m.d),w=Q(f,m.r);return{TAG:0,l,v:m.v,d:g,r:w,h:m.h}},Ct=function(f,m){if(typeof m!="object"&&typeof m!="function")return 0;let l=m.v,g=Ct(f,m.l),w=$(f,l,m.d),E=Ct(f,m.r);return{TAG:0,l:g,v:l,d:w,r:E,h:m.h}},P=function(f,m,l){for(;;){let g=l,w=m;if(typeof w!="object"&&typeof w!="function")return g;l=H(f,w.v,w.d,P(f,w.l,g)),m=w.r}},z=function(f,m){for(;;){let l=m;if(typeof l!="object"&&typeof l!="function")return!0;if(!$(f,l.v,l.d)||!z(f,l.l))return!1;m=l.r}},k=function(f,m){for(;;){let l=m;if(typeof l!="object"&&typeof l!="function")return!1;if($(f,l.v,l.d)||k(f,l.l))return!0;m=l.r}},V=function(f,m,l){return typeof l!="object"&&typeof l!="function"?r(f,m):i(V(f,m,l.l),l.v,l.d,l.r)},gt=function(f,m,l){return typeof l!="object"&&typeof l!="function"?r(f,m):i(l.l,l.v,l.d,gt(f,m,l.r))},tt=function(f,m,l,g){if(typeof f!="object"&&typeof f!="function")return V(m,l,g);let w=f.h;if(typeof g!="object"&&typeof g!="function")return gt(m,l,f);let E=g.h;return w>(E+2|0)?i(f.l,f.v,f.d,tt(f.r,m,l,g)):E>(w+2|0)?i(tt(f,m,l,g.l),g.v,g.d,g.r):e(f,m,l,g)},St=function(f,m){if(typeof f!="object"&&typeof f!="function")return m;if(typeof m!="object"&&typeof m!="function")return f;let l=C(m);return tt(f,l[0],l[1],j(m))},lt=function(f,m,l,g){return l!==void 0?tt(f,m,wt(l),g):St(f,g)},J=function(f,m){if(typeof m!="object"&&typeof m!="function")return[0,void 0,0];let l=m.r,g=m.d,w=m.v,E=m.l,v=$(t.compare,f,w);if(v===0)return[E,F(g),l];if(v<0){let B=J(f,E);return[B[0],B[1],tt(B[2],w,g,l)]}let I=J(f,l);return[tt(E,w,g,I[0]),I[1],I[2]]},Mt=function(f,m,l){if(typeof m!="object"&&typeof m!="function"){if(typeof l!="object"&&typeof l!="function")return 0}else{let E=m.v;if(m.h>=n(l)){let v=J(E,l);return lt(Mt(f,m.l,v[0]),E,H(f,E,F(m.d),v[1]),Mt(f,m.r,v[2]))}}if(typeof l!="object"&&typeof l!="function")throw new p("Assert_failure",{MEL_EXN_ID:"Assert_failure",_1:["jscomp/stdlib/map.ml",413,10]});let g=l.v,w=J(g,m);return lt(Mt(f,w[0],l.l),g,H(f,g,w[1],F(l.d)),Mt(f,w[2],l.r))},un=function(f,m,l){if(typeof m!="object"&&typeof m!="function")return l;let g=m.d,w=m.v;if(typeof l!="object"&&typeof l!="function")return m;let E=l.d,v=l.v;if(m.h>=l.h){let fn=J(w,l),Rt=fn[1],De=un(f,m.l,fn[0]),bi=un(f,m.r,fn[2]);return Rt!==void 0?lt(De,w,H(f,w,g,wt(Rt)),bi):tt(De,w,g,bi)}let I=J(v,m),B=I[1],Y=un(f,I[0],l.l),st=un(f,I[2],l.r);return B!==void 0?lt(Y,v,H(f,v,wt(B),E),st):tt(Y,v,E,st)},ae=function(f,m){if(typeof m!="object"&&typeof m!="function")return 0;let l=m.r,g=m.d,w=m.v,E=m.l,v=ae(f,E),I=$(f,w,g),B=ae(f,l);return I?E===v&&l===B?m:tt(v,w,g,B):St(v,B)},Pn=function(f,m){if(typeof m!="object"&&typeof m!="function")return 0;let l=m.v,g=Pn(f,m.l),w=$(f,l,m.d),E=Pn(f,m.r);return w!==void 0?tt(g,l,wt(w),E):St(g,E)},Jn=function(f,m){if(typeof m!="object"&&typeof m!="function")return[0,0];let l=m.d,g=m.v,w=Jn(f,m.l),E=w[1],v=w[0],I=$(f,g,l),B=Jn(f,m.r),Y=B[1],st=B[0];return I?[tt(v,g,l,st),St(E,Y)]:[St(v,st),tt(E,g,l,Y)]},nn=function(f,m){for(;;){let l=m,g=f;if(typeof g!="object"&&typeof g!="function")return l;m={TAG:0,_0:g.v,_1:g.d,_2:g.r,_3:l},f=g.l}},te=function(f,m,l){let g=nn(m,0),w=nn(l,0);for(;;){let E=w,v=g;if(typeof v!="object"&&typeof v!="function")return typeof E!="object"&&typeof E!="function"?0:-1;if(typeof E!="object"&&typeof E!="function")return 1;let I=$(t.compare,v._0,E._0);if(I!==0)return I;let B=$(f,v._1,E._1);if(B!==0)return B;w=nn(E._2,E._3),g=nn(v._2,v._3)}},hr=function(f,m,l){let g=nn(m,0),w=nn(l,0);for(;;){let E=w,v=g;if(typeof v!="object"&&typeof v!="function")return typeof E!="object"&&typeof E!="function";if(typeof E!="object"&&typeof E!="function"||$(t.compare,v._0,E._0)!==0||!$(f,v._1,E._1))return!1;w=nn(E._2,E._3),g=nn(v._2,v._3)}},le=function(f){return typeof f!="object"&&typeof f!="function"?0:(le(f.l)+1|0)+le(f.r)|0},Rn=function(f,m){for(;;){let l=m,g=f;if(typeof l!="object"&&typeof l!="function")return g;m=l.l,f={hd:[l.v,l.d],tl:Rn(g,l.r)}}},ue=function(f){return Rn(0,f)},Ze=function(f){return _t((function(m,l){return s(l[0],l[1],m)}),0,f)},ne=function(f,m){return Zr((function(l,g){return s(g[0],g[1],l)}),m,f)},gr=function(f){return ne(f,0)},fe=function(f,m){if(typeof f!="object"&&typeof f!="function")return 0;let l=nn(f._2,f._3);return{TAG:0,_0:[f._0,f._1],_1:(function(g){return fe(l,g)})}},br=function(f){let m=nn(f,0);return function(l){return fe(m,l)}},yr=function(f,m){for(;;){let l=m,g=f;if(typeof g!="object"&&typeof g!="function")return l;m={TAG:0,_0:g.v,_1:g.d,_2:g.l,_3:l},f=g.r}},be=function(f,m){if(typeof f!="object"&&typeof f!="function")return 0;let l=yr(f._2,f._3);return{TAG:0,_0:[f._0,f._1],_1:(function(g){return be(l,g)})}};return{empty:0,add:s,add_to_list:rt,update:N,singleton:r,remove:O,merge:Mt,union:un,cardinal:le,bindings:ue,min_binding:C,min_binding_opt:S,max_binding:G,max_binding_opt:D,choose:C,choose_opt:S,find:c,find_opt:y,find_first:a,find_first_opt:u,find_last:d,find_last_opt:h,iter:it,fold:P,map:Q,mapi:Ct,filter:ae,filter_map:Pn,partition:Jn,split:J,is_empty:o,is_singleton:_,mem:x,equal:hr,compare:te,for_all:z,exists:k,to_list:ue,of_list:Ze,to_seq:br,to_rev_seq:function(f){let m=yr(f,0);return function(l){return be(m,l)}},to_seq_from:function(f,m){let g=function(w,E,v){for(;;){let I=v,B=E;if(typeof B!="object"&&typeof B!="function")return I;let Y=B.r,st=B.d,fn=B.v,Rt=$(t.compare,fn,w);if(Rt===0)return{TAG:0,_0:fn,_1:st,_2:Y,_3:I};if(Rt<0){E=Y;continue}v={TAG:0,_0:fn,_1:st,_2:Y,_3:I},E=B.l}}(f,m,0);return function(w){return fe(g,w)}},add_seq:ne,of_seq:gr}}function Na(t,n){return t<<n|t>>>(32-n|0)|0}function ze(t,n){let e=n;e=Math.imul(e,-862048943),e=Na(e,15),e=Math.imul(e,461845907);let r=t^e;return r=Na(r,13),(r+(r<<2)|0)-430675100|0}function ko(t){let n=t^t>>>16;return n=Math.imul(n,-2048144789),n=n^n>>>13,n=Math.imul(n,-1028477387),n^n>>>16}function ds(t,n){let e=n.length,r=(e/4|0)-1|0,i=t;for(let _=0;_<=r;++_){let s=_<<2,c=n.charCodeAt(s)|n.charCodeAt(s+1|0)<<8|n.charCodeAt(s+2|0)<<16|n.charCodeAt(s+3|0)<<24;i=ze(i,c)}let o=e&3;if(o!==0){let _=o===3?n.charCodeAt(e-1|0)<<16|n.charCodeAt(e-2|0)<<8|n.charCodeAt(e-3|0):o===2?n.charCodeAt(e-1|0)<<8|n.charCodeAt(e-2|0):n.charCodeAt(e-1|0);i=ze(i,_)}return i=i^e,i}function ps(t,n){let e={content:n,next:void 0},r=t.last;r!==void 0?(t.length=t.length+1|0,r.next=e,t.last=e):(t.length=1,t.first=e,t.last=e)}function Dm(t){let n=t.first,e=n.next;return e!==void 0?(t.length=t.length-1|0,t.first=e):(t.length=0,t.first=void 0,t.last=void 0),n.content}function _r(t,n,e,r){let i=e;switch(typeof r){case"number":let _=r|0;return i=ze(i,(_+_|0)+1|0),ko(i);case"string":return i=ds(i,r),ko(i);default:let s={length:0,first:void 0,last:void 0},c=t;for(ps(s,r),c=c-1|0;s.length!==0&&c>0;){let a=Dm(s);switch(typeof a){case"boolean":let d=a?1:0;i=ze(i,(d+d|0)+1|0),c=c-1|0;break;case"number":let h=a|0;i=ze(i,(h+h|0)+1|0),c=c-1|0;break;case"string":i=ds(i,a),c=c-1|0;break;case"function":case"symbol":case"undefined":break;default:let y=a.length|0;if(y!==0){let x=a.TAG,C=y<<10|x;if(x===248)i=ze(i,a[1]);else{i=ze(i,C);let S=y-1|0,G=S<c?S:c;for(let D=0;D<=G;++D)ps(s,a[D])}}else{let x=(function(C,S){var G=0;for(var D in C)S(C[D]),++G;return G})(a,(function(C){ps(s,C)}));i=ze(i,x<<10|0)}}}return ko(i)}}function Di(t,n){if(t===0)return[];if(t<0)throw new p("Invalid_argument",{MEL_EXN_ID:"Invalid_argument",_1:"Array.init"});let e=vt(t,b(n,0));for(let r=1;r<t;++r)e[r]=b(n,r);return e}function hs(t){let n=t.length;return n===0?[]:Sr(t,0,n)}function Pa(t,n){let e=t.length;return e===0?hs(n):n.length===0?Sr(t,0,e):t.concat(n)}function Xa(t,n,e){if(n<0||e<0||n>(t.length-e|0))throw new p("Invalid_argument",{MEL_EXN_ID:"Invalid_argument",_1:"Array.sub"});return Sr(t,n,e)}function gs(t,n,e,r){if(n<0||e<0||n>(t.length-e|0))throw new p("Invalid_argument",{MEL_EXN_ID:"Invalid_argument",_1:"Array.fill"});for(let i=n,o=n+e|0;i<o;++i)t[i]=r}function cr(t,n,e,r,i){if(i<0||n<0||n>(t.length-i|0)||r<0||r>(e.length-i|0))throw new p("Invalid_argument",{MEL_EXN_ID:"Invalid_argument",_1:"Array.blit"});Yc(t,n,e,r,i)}function se(t,n){for(let e=0,r=n.length;e<r;++e)b(t,n[e])}function Ni(t,n){let e=n.length;if(e===0)return[];let r=vt(e,b(t,n[0]));for(let i=1;i<e;++i)r[i]=b(t,n[i]);return r}function Ba(t,n){for(let e=0,r=n.length;e<r;++e)$(t,e,n[e])}function bs(t){let n=t.length-1|0,e=0;for(;;){let r=e,i=n;if(i<0)return r;e={hd:t[i],tl:r},n=i-1|0}}function Pm(t,n){for(;;){let e=n,r=t;if(!e)return r;n=e.tl,t=r+1|0}}function Pi(t){if(!t)return[];let n=vt(Pm(0,t),t.hd),e=1,r=t.tl;for(;;){let i=r,o=e;if(!i)return n;n[o]=i.hd,r=i.tl,e=o+1|0}}function Xi(t,n,e){let r=n;for(let i=0,o=e.length;i<o;++i)r=$(t,r,e[i]);return r}function Oa(t,n){let e=n.length,r=0;for(;;){let i=r;if(i===e)return;if(b(t,n[i]))return i;r=i+1|0}}function Bi(t){if(t<0||t>255)throw new p("Invalid_argument",{MEL_EXN_ID:"Invalid_argument",_1:"Char.chr"});return t}function qa(t){let n=0;if(t>=40){if(t===92)return"\\\\";n=t>=127?1:2}else if(t>=32){if(t>=39)return"\\'";n=2}else if(t>=14)n=1;else switch(t){case 8:return"\\b";case 9:return"\\t";case 10:return"\\n";case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 11:case 12:n=1;break;case 13:return"\\r"}switch(n){case 1:let e=[0,0,0,0];return e[0]=92,e[1]=48+(t/100|0)|0,e[2]=48+(t/10|0)%10|0,e[3]=48+t%10|0,mt(e);case 2:let r=[0];return r[0]=t,mt(r)}}function Mo(t){return t>90||t<65?t:t+32|0}function Oi(t){return t>122||t<97?t:t-32|0}function vr(t,n){return t<=n?t:n}function Ve(t,n){return t>=n?t:n}var $b=Un([1431655765,1431655765]),Tb=Un([858993459,858993459]),Gb=Un([252645135,252645135]);function bn(t,n){let e=Tt(t);return na(e,0,t,n),e}function ys(t,n){let e=Tt(t);for(let r=0;r<t;++r)e[r]=b(n,r);return e}function Fm(t){let n=t.length,e=Tt(n);return Ar(t,0,e,0,n),e}function Io(t,n,e){if(n<0||e<0||n>(t.length-e|0))throw new p("Invalid_argument",{MEL_EXN_ID:"Invalid_argument",_1:"String.sub / Bytes.sub"});let r=Tt(e);return Ar(t,n,r,0,e),r}function Ae(t,n,e){return mt(Io(t,n,e))}function jr(t,n,e,r,i){if(i<0||n<0||n>(t.length-i|0)||r<0||r>(e.length-i|0))throw new p("Invalid_argument",{MEL_EXN_ID:"Invalid_argument",_1:"Bytes.blit"});Ar(t,n,e,r,i)}function Qn(t,n,e,r,i){if(i<0||n<0||n>(t.length-i|0)||r<0||r>(e.length-i|0))throw new p("Invalid_argument",{MEL_EXN_ID:"Invalid_argument",_1:"String.blit / Bytes.blit_string"});me(t,n,e,r,i)}function Fa(t){let n=0;for(let r=0,i=t.length;r<i;++r){let o=t[r];n=n+(o>=32?o>92||o<34?o>=127?4:1:o>91||o<35?2:1:o>=11?o!==13?4:2:o>=8?2:4)|0}if(n===t.length)return t;let e=Tt(n);n=0;for(let r=0,i=t.length;r<i;++r){let o=t[r],_=0;if(o>=35)o!==92?o>=127?_=1:e[n]=o:_=2;else if(o>=32)o>=34?_=2:e[n]=o;else if(o>=14)_=1;else switch(o){case 8:e[n]=92,n=n+1|0,e[n]=98;break;case 9:e[n]=92,n=n+1|0,e[n]=116;break;case 10:e[n]=92,n=n+1|0,e[n]=110;break;case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 11:case 12:_=1;break;case 13:e[n]=92,n=n+1|0,e[n]=114;break}switch(_){case 1:e[n]=92,n=n+1|0,e[n]=48+(o/100|0)|0,n=n+1|0,e[n]=48+(o/10|0)%10|0,n=n+1|0,e[n]=48+o%10|0;break;case 2:e[n]=92,n=n+1|0,e[n]=o;break}n=n+1|0}return e}function Lo(t,n){let e=n.length;if(e===0)return n;let r=Tt(e);for(let i=0;i<e;++i)r[i]=b(t,n[i]);return r}function Do(t,n){let e=n.length,r=0;for(;;){let i=r;if(i===e)return!1;if(b(t,n[i]))return!0;r=i+1|0}}function za(t,n){let e=n.length,r=0;for(;;){let i=r;if(i===e)return!0;if(!b(t,n[i]))return!1;r=i+1|0}}function Cs(t){return Lo(Oi,t)}function qi(t){return Lo(Mo,t)}function zm(t,n){if(n.length===0)return n;let e=Fm(n);return e[0]=b(t,n[0]),e}function Va(t){return zm(Oi,t)}function Ha(t,n,e){return Gr?Ti(t,n,ho(e)):Ti(t,n,e)}function Ra(t,n,e){return Gr?Gi(t,n,go(e)):Gi(t,n,e)}function Ss(t,n){let e=$i(t,n),r=t.length-1|0,i=0;if(e>=224)if(e>=237){if(e>=245)return 16842749;switch(e){case 237:let o=n+1|0;if(o>r)return 16842749;let _=t[o];if(_>>>5!==4)return 16842749;let s=o+1|0;if(s>r)return 33619965;let c=t[s];return c>>>6!==2?33619965:184549376|((e&15)<<12|(_&63)<<6|c&63);case 238:case 239:i=1;break;case 240:let u=n+1|0;if(u>r)return 16842749;let d=t[u];if(d<144||191<d)return 16842749;let h=u+1|0;if(h>r)return 33619965;let y=t[h];if(y>>>6!==2)return 33619965;let x=h+1|0;if(x>r)return 50397181;let C=t[x];return C>>>6!==2?50397181:201326592|((e&7)<<18|(d&63)<<12|(y&63)<<6|C&63);case 241:case 242:case 243:i=2;break;case 244:let G=n+1|0;if(G>r)return 16842749;let D=t[G];if(D>>>4!==8)return 16842749;let j=G+1|0;if(j>r)return 33619965;let M=t[j];if(M>>>6!==2)return 33619965;let O=j+1|0;if(O>r)return 50397181;let N=t[O];return N>>>6!==2?50397181:201326592|((e&7)<<18|(D&63)<<12|(M&63)<<6|N&63)}}else if(e>=225)i=1;else{let o=n+1|0;if(o>r)return 16842749;let _=t[o];if(_>>>5!==5)return 16842749;let s=o+1|0;if(s>r)return 33619965;let c=t[s];return c>>>6!==2?33619965:184549376|((e&15)<<12|(_&63)<<6|c&63)}else{if(e<128)return 150994944|e;if(e<194)return 16842749;let o=n+1|0;if(o>r)return 16842749;let _=t[o];return _>>>6!==2?16842749:167772160|((e&31)<<6|_&63)}switch(i){case 1:let o=n+1|0;if(o>r)return 16842749;let _=t[o];if(_>>>6!==2)return 16842749;let s=o+1|0;if(s>r)return 33619965;let c=t[s];return c>>>6!==2?33619965:184549376|((e&15)<<12|(_&63)<<6|c&63);case 2:let u=n+1|0;if(u>r)return 16842749;let d=t[u];if(d>>>6!==2)return 16842749;let h=u+1|0;if(h>r)return 33619965;let y=t[h];if(y>>>6!==2)return 33619965;let x=h+1|0;if(x>r)return 50397181;let C=t[x];return C>>>6!==2?50397181:201326592|((e&7)<<18|(d&63)<<12|(y&63)<<6|C&63)}}function Ua(t,n,e){let r=t.length-1|0;if(e<0)throw new p("Assert_failure",{MEL_EXN_ID:"Assert_failure",_1:["jscomp/stdlib/bytes.ml",654,20]});if(e<=127)return Ut(t,n,e),1;if(e<=2047){let i=n+1|0;return i>r?0:(Ut(t,n,192|e>>>6),t[i]=128|e&63,2)}if(e<=65535){let i=n+2|0;return i>r?0:(Ut(t,n,224|e>>>12),t[n+1|0]=128|e>>>6&63,t[i]=128|e&63,3)}if(e<=1114111){let i=n+3|0;return i>r?0:(Ut(t,n,240|e>>>18),t[n+1|0]=128|e>>>12&63,t[n+2|0]=128|e>>>6&63,t[i]=128|e&63,4)}throw new p("Assert_failure",{MEL_EXN_ID:"Assert_failure",_1:["jscomp/stdlib/bytes.ml",679,9]})}function Vm(t){return ie("%X",t)+" is not a Unicode scalar value"}function No(t){return 0<=t&&t<=55295?!0:57344<=t?t<=1114111:!1}function Po(t){if(No(t))return t;let n=Vm(t);throw new p("Invalid_argument",{MEL_EXN_ID:"Invalid_argument",_1:n})}function Fn(t,n){return mt(bn(t,n))}function Qa(t,n){return mt(ys(t,n))}function Ot(t,n,e){return n===0&&t.length===e?t:mt(Io(dn(t),n,e))}function Um(t,n){if(t>=n)return t;throw new p("Invalid_argument",{MEL_EXN_ID:"Invalid_argument",_1:"String.concat"})}function Wm(t,n,e){for(;;){let r=e,i=t;if(!r)return i;let o=r.hd;if(!r.tl)return o.length+i|0;e=r.tl,t=Um((o.length+n|0)+i|0,i)}}function Ym(t,n,e,r,i){for(;;){let o=i,_=n;if(!o)return t;let s=o.hd;if(o.tl){me(s,0,t,_,s.length),me(e,0,t,_+s.length|0,r),i=o.tl,n=(_+s.length|0)+r|0;continue}return me(s,0,t,_,s.length),t}}function xn(t,n){if(!n)return"";if(!n.tl)return n.hd;let e=t.length;return mt(Ym(Tt(Wm(0,e,n)),0,t,e,n))}function Ka(t,n){for(let e=0,r=n.length;e<r;++e)b(t,n.charCodeAt(e))}function zi(t,n){for(let e=0,r=n.length;e<r;++e)$(t,e,n.charCodeAt(e))}function Za(t,n){return mt(Lo(t,dn(n)))}function Ja(t,n){return za(t,dn(n))}function tl(t){let n=dn(t),e=Fa(n);return n===e?t:mt(e)}function Qm(t,n,e,r){for(;;){let i=e;if(i>=n)throw new p(pt,{MEL_EXN_ID:pt});if(t.charCodeAt(i)===r)return i;e=i+1|0}}function Km(t,n,e){let r=t.length;if(n<0||n>r)throw new p("Invalid_argument",{MEL_EXN_ID:"Invalid_argument",_1:"String.contains_from / Bytes.contains_from"});try{return Qm(t,r,n,e),!0}catch(i){let o=yt(i);if(o.MEL_EXN_ID===pt)return!1;throw o}}function nl(t,n){return Km(t,0,n)}function Xo(t){return mt(qi(dn(t)))}function kr(t){return mt(Va(dn(t)))}function Mr(t,n){let e=n.length,r=t.length;if(e>=r){let i=0;for(;;){let o=i;if(o===r)return!0;if(n.charCodeAt(o)!==t.charCodeAt(o))return!1;i=o+1|0}}else return!1}function el(t,n){let e=n.length,r=t.length,i=e-r|0;if(i>=0){let o=0;for(;;){let _=o;if(_===r)return!0;if(n.charCodeAt(i+_|0)!==t.charCodeAt(_))return!1;o=_+1|0}}else return!1}function Bo(t,n){let e=0,r=n.length;for(let i=n.length-1|0;i>=0;--i)n.charCodeAt(i)===t&&(e={hd:Ot(n,i+1|0,(r-i|0)-1|0),tl:e},r=i);return{hd:Ot(n,0,r),tl:e}}var Vi=Xe;var As="";var ct=Da({compare:Vi}),Hi=ct.map,Es=ct.mapi;function Ir(t,n,e){let r={contents:n},i=$(Hi,(function(o){let _=$(e,r.contents,o);return r.contents=_[0],_[1]}),t);return[r.contents,i]}function rl(t,n,e){let r={contents:n},i=$(Es,(function(o,_){let s=H(e,o,r.contents,_);return r.contents=s[0],s[1]}),t);return[r.contents,i]}var Oo=ct.empty,Lr=ct.add,il=ct.add_to_list,iy=ct.update,ol=ct.singleton,_l=ct.remove,oy=ct.merge,sl=ct.union,ni=ct.cardinal,ei=ct.bindings,_y=ct.min_binding,sy=ct.min_binding_opt,cy=ct.max_binding,ay=ct.max_binding_opt,ly=ct.choose,uy=ct.choose_opt,qo=ct.find,yn=ct.find_opt,fy=ct.find_first,my=ct.find_first_opt,dy=ct.find_last,py=ct.find_last_opt,ar=ct.iter,Dr=ct.fold,hy=ct.filter,gy=ct.filter_map,by=ct.partition,yy=ct.split,$s=ct.is_empty,Cy=ct.is_singleton,Sy=ct.mem,Zm=ct.equal,Jm=ct.compare,wy=ct.for_all,xy=ct.exists,Ay=ct.to_list,Ee=ct.of_list,Ey=ct.to_seq,$y=ct.to_rev_seq,Ty=ct.to_seq_from,Gy=ct.add_seq,vy=ct.of_seq;function Fo(t,n,e,r,i){return{name:t,kind:n,address:e,is_mutable:i,level:r}}function t0(t){return t.name}function n0(t){return t.kind}function e0(t){return t.address}function r0(t){return t.level}function i0(t){return t.is_mutable}var ri={make:Fo,name:t0,kind:n0,address:e0,level:r0,is_mutable:i0};function cl(t){return{store:Oo,free_variables:0,num_bindings:0,outer:void 0,scope:0}}function al(t){return t.scope=t.scope+1|0,t}function ll(t){return t.scope=t.scope-1|0,t}function ul(t){let n={store:Oo,free_variables:0,num_bindings:0,outer:void 0,scope:0};return{store:n.store,free_variables:n.free_variables,num_bindings:n.num_bindings,outer:t,scope:n.scope}}function fl(t){let n=t.outer;if(n!==void 0)return n;throw new p("Assert_failure",{MEL_EXN_ID:"Assert_failure",_1:["lib/pinc_compiler/symbol_table.ml",64,12]})}function Ts(t,n,e,r){let i=t.outer,_=Fo(n,r||i===void 0?0:1,t.num_bindings,t.scope,e);return[{store:H(Lr,n,_,t.store),free_variables:t.free_variables,num_bindings:t.num_bindings+1|0,outer:t.outer,scope:t.scope},_]}function o0(t,n){let e=n.name,r=n.is_mutable,i=n.level,o=Fo(e,2,Wt(t.free_variables),i,r);return[{store:H(Lr,e,o,t.store),free_variables:oe(t.free_variables,{hd:n,tl:0}),num_bindings:t.num_bindings,outer:t.outer,scope:t.scope},o]}function ml(t,n){let e=Fo(n,3,0,t.scope,!1);return[{store:H(Lr,n,e,t.store),free_variables:t.free_variables,num_bindings:t.num_bindings,outer:t.outer,scope:t.scope},e]}function Gs(t,n){let e=$(yn,n,t.store),r=t.outer;if(e!==void 0)return e.level<=t.scope?[t,e]:[t,void 0];if(r===void 0)return[t,void 0];let i=Gs(r,n),o=i[1],_=i[0];if(o===void 0)return[{store:t.store,free_variables:t.free_variables,num_bindings:t.num_bindings,outer:_,scope:t.scope},void 0];if(o.kind===0)return[{store:t.store,free_variables:t.free_variables,num_bindings:t.num_bindings,outer:_,scope:t.scope},o];let c=o0(t,o),a=c[0];return[{store:a.store,free_variables:a.free_variables,num_bindings:a.num_bindings,outer:_,scope:a.scope},c[1]]}function bt(t){let n=t<1?1:t,e=n>Mn?Mn:n,r=Tt(e);return{inner:{buffer:r,length:e},position:0,initial_buffer:r}}function K(t){return Ae(t.inner.buffer,0,t.position)}function dl(t,n,e){if(n<0||e<0||n>(t.position-e|0))throw new p("Invalid_argument",{MEL_EXN_ID:"Invalid_argument",_1:"Buffer.sub"});return Ae(t.inner.buffer,n,e)}function vs(t){t.position=0}function pl(t){t.position=0;let n=t.initial_buffer,e=t.initial_buffer.length,r={buffer:n,length:e};t.inner=r}function Re(t,n){let e=t.position,i=t.inner.length;for(;(e+n|0)>i;)i=i<<1;if(i>Mn)if((e+n|0)<=Mn)i=Mn;else throw new p("Failure",{MEL_EXN_ID:"Failure",_1:"Buffer.add: cannot grow buffer"});let o=Tt(i);jr(t.inner.buffer,0,o,0,t.position),t.inner={buffer:o,length:i}}function ot(t,n){let e=t.position,r=t.inner;e>=r.length?(Re(t,1),Ut(t.inner.buffer,t.position,n)):r.buffer[e]=n,t.position=e+1|0}function hl(t,n){for(;;){let e=t.position;e>=t.inner.length&&Re(t,4);let r=Ua(t.inner.buffer,e,n);if(r!==0){t.position=e+r|0;return}Re(t,4)}}function zo(t,n,e,r){if(e<0||r<0||e>(n.length-r|0))throw new p("Invalid_argument",{MEL_EXN_ID:"Invalid_argument",_1:"Buffer.add_substring"});let i=t.position,o=t.inner,_=i+r|0;_>o.length?(Re(t,r),Qn(n,e,t.inner.buffer,t.position,r)):me(n,e,o.buffer,i,r),t.position=_}function s0(t,n,e,r){if(e<0||r<0||e>(n.length-r|0))throw new p("Invalid_argument",{MEL_EXN_ID:"Invalid_argument",_1:"Buffer.add_subbytes"});let i=t.position,o=t.inner,_=i+r|0;_>o.length?(Re(t,r),jr(n,e,t.inner.buffer,t.position,r)):Ar(n,e,o.buffer,i,r),t.position=_}function Dt(t,n){zo(t,n,0,n.length)}function Vo(t,n){s0(t,n,0,n.length)}function Nt(t,n){let e=t.position,r=t.inner,i=e+1|0;i>r.length?(Re(t,1),Ut(t.inner.buffer,t.position,n)):r.buffer[e]=n,t.position=i}function c0(t,n){let e=t.position,r=t.inner,i=e+2|0;i>r.length?(Re(t,2),Ti(t.inner.buffer,t.position,n)):bo(r.buffer,e,n),t.position=i}function a0(t,n){let e=t.position,r=t.inner,i=e+4|0;i>r.length?(Re(t,4),Gi(t.inner.buffer,t.position,n)):W_(r.buffer,e,n),t.position=i}function l0(t,n){let e=t.position,r=t.inner,i=e+8|0;i>r.length?(Re(t,8),Q_(t.inner.buffer,t.position,n)):Y_(r.buffer,e,n),t.position=i}function js(t,n){c0(t,Gr?ho(n):n)}function qt(t,n){a0(t,Gr?go(n):n)}function Ho(t,n){l0(t,Gr?U_(n):n)}function ks(t){return t[1]===5?12:-6}function bl(t,n){let e=t.bytes.length,r=t.ind+n|0;if(r<=e)return;let i=Ve(e<<1,r),o=Tt(i);jr(t.bytes,0,o,0,e),t.bytes=o}function oi(t,n){bl(t,1),Ut(t.bytes,t.ind,n),t.ind=t.ind+1|0}function sn(t,n){let e=n.length;bl(t,e),Qn(n,0,t.bytes,t.ind,e),t.ind=t.ind+e|0}function yl(t){return Ae(t.bytes,0,t.ind)}function f0(t,n){let e=t!==void 0?t:70;switch(n[1]){case 0:return 102;case 1:return 101;case 2:return 69;case 3:return 103;case 4:return 71;case 5:return e;case 6:return 104;case 7:return 72;case 8:return 70}}function m0(t,n){switch(n[0]){case 0:break;case 1:oi(t,43);break;case 2:oi(t,32);break}if(n[1]===8)return oi(t,35)}function d0(t){if(typeof t!="object"&&typeof t!="function")switch(t){case 0:return"@]";case 1:return"@}";case 2:return"@?";case 3:return`@
32
+ `;case 4:return"@.";case 5:return"@@";case 6:return"@%"}else switch(t.TAG){case 0:case 1:return t._0;case 2:return"@"+mt(bn(1,t._0))}}function Ls(t,n){for(;;){let e=n;if(typeof e!="object"&&typeof e!="function")return;switch(e.TAG){case 0:sn(t,"%c"),n=e._0;continue;case 1:sn(t,"%s"),n=e._0;continue;case 2:sn(t,"%i"),n=e._0;continue;case 3:sn(t,"%li"),n=e._0;continue;case 4:sn(t,"%ni"),n=e._0;continue;case 5:sn(t,"%Li"),n=e._0;continue;case 6:sn(t,"%f"),n=e._0;continue;case 7:sn(t,"%B"),n=e._0;continue;case 8:sn(t,"%{"),Ls(t,e._0),sn(t,"%}"),n=e._1;continue;case 9:sn(t,"%("),Ls(t,e._0),sn(t,"%)"),n=e._2;continue;case 10:sn(t,"%a"),n=e._0;continue;case 11:sn(t,"%t"),n=e._0;continue;case 12:sn(t,"%?"),n=e._0;continue;case 13:sn(t,"%r"),n=e._0;continue;case 14:sn(t,"%_r"),n=e._0;continue}}}function Ht(t){if(typeof t!="object"&&typeof t!="function")return 0;switch(t.TAG){case 0:return{TAG:0,_0:Ht(t._0)};case 1:return{TAG:1,_0:Ht(t._0)};case 2:return{TAG:2,_0:Ht(t._0)};case 3:return{TAG:3,_0:Ht(t._0)};case 4:return{TAG:4,_0:Ht(t._0)};case 5:return{TAG:5,_0:Ht(t._0)};case 6:return{TAG:6,_0:Ht(t._0)};case 7:return{TAG:7,_0:Ht(t._0)};case 8:return{TAG:8,_0:t._0,_1:Ht(t._1)};case 9:return{TAG:9,_0:t._1,_1:t._0,_2:Ht(t._2)};case 10:return{TAG:10,_0:Ht(t._0)};case 11:return{TAG:11,_0:Ht(t._0)};case 12:return{TAG:12,_0:Ht(t._0)};case 13:return{TAG:13,_0:Ht(t._0)};case 14:return{TAG:14,_0:Ht(t._0)}}}function cn(t){if(typeof t!="object"&&typeof t!="function")return[(function(n){return 0}),(function(n){return 0}),(function(n){return 0}),(function(n){return 0})];switch(t.TAG){case 0:let n=cn(t._0),e=n[1],r=n[0];return[(function(l){return b(r,0),0}),(function(l){return b(e,0),0}),n[2],n[3]];case 1:let i=cn(t._0),o=i[1],_=i[0];return[(function(l){return b(_,0),0}),(function(l){return b(o,0),0}),i[2],i[3]];case 2:let s=cn(t._0),c=s[1],a=s[0];return[(function(l){return b(a,0),0}),(function(l){return b(c,0),0}),s[2],s[3]];case 3:let u=cn(t._0),d=u[1],h=u[0];return[(function(l){return b(h,0),0}),(function(l){return b(d,0),0}),u[2],u[3]];case 4:let y=cn(t._0),x=y[1],C=y[0];return[(function(l){return b(C,0),0}),(function(l){return b(x,0),0}),y[2],y[3]];case 5:let S=cn(t._0),G=S[1],D=S[0];return[(function(l){return b(D,0),0}),(function(l){return b(G,0),0}),S[2],S[3]];case 6:let j=cn(t._0),M=j[1],O=j[0];return[(function(l){return b(O,0),0}),(function(l){return b(M,0),0}),j[2],j[3]];case 7:let N=cn(t._0),rt=N[1],it=N[0];return[(function(l){return b(it,0),0}),(function(l){return b(rt,0),0}),N[2],N[3]];case 8:let Q=cn(t._1),Ct=Q[1],P=Q[0];return[(function(l){return b(P,0),0}),(function(l){return b(Ct,0),0}),Q[2],Q[3]];case 9:let z=cn(t._2),k=z[3],V=z[2],gt=z[1],tt=z[0],St=Qt(Ht(t._0),t._1),lt=cn(St),J=lt[3],Mt=lt[2],un=lt[1],ae=lt[0];return[(function(l){return b(tt,0),b(ae,0),0}),(function(l){return b(un,0),b(gt,0),0}),(function(l){return b(V,0),b(Mt,0),0}),(function(l){return b(J,0),b(k,0),0})];case 10:let Pn=cn(t._0),Jn=Pn[1],nn=Pn[0];return[(function(l){return b(nn,0),0}),(function(l){return b(Jn,0),0}),Pn[2],Pn[3]];case 11:let te=cn(t._0),hr=te[1],le=te[0];return[(function(l){return b(le,0),0}),(function(l){return b(hr,0),0}),te[2],te[3]];case 12:let Rn=cn(t._0),ue=Rn[1],Ze=Rn[0];return[(function(l){return b(Ze,0),0}),(function(l){return b(ue,0),0}),Rn[2],Rn[3]];case 13:let ne=cn(t._0),gr=ne[3],fe=ne[2],br=ne[1],yr=ne[0];return[(function(l){return b(yr,0),0}),(function(l){return b(br,0),0}),(function(l){return b(fe,0),0}),(function(l){return b(gr,0),0})];case 14:let be=cn(t._0),I_=be[3],L_=be[2],f=be[1],m=be[0];return[(function(l){return b(m,0),0}),(function(l){return b(f,0),0}),(function(l){return b(L_,0),0}),(function(l){return b(I_,0),0})]}}function Qt(t,n){let e=0;if(typeof t!="object"&&typeof t!="function"){if(typeof n!="object"&&typeof n!="function")return 0;switch(n.TAG){case 8:e=6;break;case 9:e=7;break;case 10:e=1;break;case 11:e=2;break;case 12:e=3;break;case 13:e=4;break;case 14:e=5;break;default:throw new p("Assert_failure",{MEL_EXN_ID:"Assert_failure",_1:["./camlinternalFormat.cppo.ml",850,23]})}}else switch(t.TAG){case 0:if(typeof n!="object"&&typeof n!="function")e=8;else switch(n.TAG){case 0:return{TAG:0,_0:Qt(t._0,n._0)};case 8:e=6;break;case 9:e=7;break;case 10:e=1;break;case 11:e=2;break;case 12:e=3;break;case 13:e=4;break;case 14:e=5;break}break;case 1:if(typeof n!="object"&&typeof n!="function")e=8;else switch(n.TAG){case 1:return{TAG:1,_0:Qt(t._0,n._0)};case 8:e=6;break;case 9:e=7;break;case 10:e=1;break;case 11:e=2;break;case 12:e=3;break;case 13:e=4;break;case 14:e=5;break}break;case 2:if(typeof n!="object"&&typeof n!="function")e=8;else switch(n.TAG){case 2:return{TAG:2,_0:Qt(t._0,n._0)};case 8:e=6;break;case 9:e=7;break;case 10:e=1;break;case 11:e=2;break;case 12:e=3;break;case 13:e=4;break;case 14:e=5;break}break;case 3:if(typeof n!="object"&&typeof n!="function")e=8;else switch(n.TAG){case 3:return{TAG:3,_0:Qt(t._0,n._0)};case 8:e=6;break;case 9:e=7;break;case 10:e=1;break;case 11:e=2;break;case 12:e=3;break;case 13:e=4;break;case 14:e=5;break}break;case 4:if(typeof n!="object"&&typeof n!="function")e=8;else switch(n.TAG){case 4:return{TAG:4,_0:Qt(t._0,n._0)};case 8:e=6;break;case 9:e=7;break;case 10:e=1;break;case 11:e=2;break;case 12:e=3;break;case 13:e=4;break;case 14:e=5;break}break;case 5:if(typeof n!="object"&&typeof n!="function")e=8;else switch(n.TAG){case 5:return{TAG:5,_0:Qt(t._0,n._0)};case 8:e=6;break;case 9:e=7;break;case 10:e=1;break;case 11:e=2;break;case 12:e=3;break;case 13:e=4;break;case 14:e=5;break}break;case 6:if(typeof n!="object"&&typeof n!="function")e=8;else switch(n.TAG){case 6:return{TAG:6,_0:Qt(t._0,n._0)};case 8:e=6;break;case 9:e=7;break;case 10:e=1;break;case 11:e=2;break;case 12:e=3;break;case 13:e=4;break;case 14:e=5;break}break;case 7:if(typeof n!="object"&&typeof n!="function")e=8;else switch(n.TAG){case 7:return{TAG:7,_0:Qt(t._0,n._0)};case 8:e=6;break;case 9:e=7;break;case 10:e=1;break;case 11:e=2;break;case 12:e=3;break;case 13:e=4;break;case 14:e=5;break}break;case 8:if(typeof n!="object"&&typeof n!="function")throw new p("Assert_failure",{MEL_EXN_ID:"Assert_failure",_1:["./camlinternalFormat.cppo.ml",836,26]});switch(n.TAG){case 8:return{TAG:8,_0:Qt(t._0,n._0),_1:Qt(t._1,n._1)};case 10:e=1;break;case 11:e=2;break;case 12:e=3;break;case 13:e=4;break;case 14:e=5;break;default:throw new p("Assert_failure",{MEL_EXN_ID:"Assert_failure",_1:["./camlinternalFormat.cppo.ml",836,26]})}break;case 9:if(typeof n!="object"&&typeof n!="function")throw new p("Assert_failure",{MEL_EXN_ID:"Assert_failure",_1:["./camlinternalFormat.cppo.ml",846,28]});switch(n.TAG){case 8:e=6;break;case 9:let r=Qt(Ht(t._1),n._0),i=cn(r);return b(i[1],0),b(i[3],0),{TAG:9,_0:t._0,_1:n._1,_2:Qt(t._2,n._2)};case 10:e=1;break;case 11:e=2;break;case 12:e=3;break;case 13:e=4;break;case 14:e=5;break;default:throw new p("Assert_failure",{MEL_EXN_ID:"Assert_failure",_1:["./camlinternalFormat.cppo.ml",846,28]})}break;case 10:if(typeof n!="object"&&typeof n!="function")throw new p("Assert_failure",{MEL_EXN_ID:"Assert_failure",_1:["./camlinternalFormat.cppo.ml",814,21]});if(n.TAG===10)return{TAG:10,_0:Qt(t._0,n._0)};throw new p("Assert_failure",{MEL_EXN_ID:"Assert_failure",_1:["./camlinternalFormat.cppo.ml",814,21]});case 11:if(typeof n!="object"&&typeof n!="function")throw new p("Assert_failure",{MEL_EXN_ID:"Assert_failure",_1:["./camlinternalFormat.cppo.ml",818,21]});switch(n.TAG){case 10:e=1;break;case 11:return{TAG:11,_0:Qt(t._0,n._0)};default:throw new p("Assert_failure",{MEL_EXN_ID:"Assert_failure",_1:["./camlinternalFormat.cppo.ml",818,21]})}break;case 12:if(typeof n!="object"&&typeof n!="function")throw new p("Assert_failure",{MEL_EXN_ID:"Assert_failure",_1:["./camlinternalFormat.cppo.ml",822,19]});switch(n.TAG){case 10:e=1;break;case 11:e=2;break;case 12:return{TAG:12,_0:Qt(t._0,n._0)};default:throw new p("Assert_failure",{MEL_EXN_ID:"Assert_failure",_1:["./camlinternalFormat.cppo.ml",822,19]})}break;case 13:if(typeof n!="object"&&typeof n!="function")throw new p("Assert_failure",{MEL_EXN_ID:"Assert_failure",_1:["./camlinternalFormat.cppo.ml",826,22]});switch(n.TAG){case 10:e=1;break;case 11:e=2;break;case 12:e=3;break;case 13:return{TAG:13,_0:Qt(t._0,n._0)};default:throw new p("Assert_failure",{MEL_EXN_ID:"Assert_failure",_1:["./camlinternalFormat.cppo.ml",826,22]})}break;case 14:if(typeof n!="object"&&typeof n!="function")throw new p("Assert_failure",{MEL_EXN_ID:"Assert_failure",_1:["./camlinternalFormat.cppo.ml",831,30]});switch(n.TAG){case 10:e=1;break;case 11:e=2;break;case 12:e=3;break;case 13:e=4;break;case 14:return{TAG:14,_0:Qt(t._0,n._0)};default:throw new p("Assert_failure",{MEL_EXN_ID:"Assert_failure",_1:["./camlinternalFormat.cppo.ml",831,30]})}break}switch(e){case 1:throw new p("Assert_failure",{MEL_EXN_ID:"Assert_failure",_1:["./camlinternalFormat.cppo.ml",815,21]});case 2:throw new p("Assert_failure",{MEL_EXN_ID:"Assert_failure",_1:["./camlinternalFormat.cppo.ml",819,21]});case 3:throw new p("Assert_failure",{MEL_EXN_ID:"Assert_failure",_1:["./camlinternalFormat.cppo.ml",823,19]});case 4:throw new p("Assert_failure",{MEL_EXN_ID:"Assert_failure",_1:["./camlinternalFormat.cppo.ml",827,22]});case 5:throw new p("Assert_failure",{MEL_EXN_ID:"Assert_failure",_1:["./camlinternalFormat.cppo.ml",832,30]});case 6:throw new p("Assert_failure",{MEL_EXN_ID:"Assert_failure",_1:["./camlinternalFormat.cppo.ml",837,26]});case 7:throw new p("Assert_failure",{MEL_EXN_ID:"Assert_failure",_1:["./camlinternalFormat.cppo.ml",847,28]});case 8:throw new p("Assert_failure",{MEL_EXN_ID:"Assert_failure",_1:["./camlinternalFormat.cppo.ml",851,23]})}}var T=Lt("CamlinternalFormat.Type_mismatch");function Uo(t,n){if(typeof t!="object"&&typeof t!="function")return{TAG:0,_0:0,_1:n};if(t.TAG===0)return{TAG:0,_0:{TAG:0,_0:t._0,_1:t._1},_1:n};if(typeof n!="object"&&typeof n!="function")throw new p(T,{MEL_EXN_ID:T});if(n.TAG===2)return{TAG:0,_0:{TAG:1,_0:t._0},_1:n._0};throw new p(T,{MEL_EXN_ID:T})}function Ri(t,n,e){let r=Uo(t,e);if(!(typeof n!="object"&&typeof n!="function"))return{TAG:0,_0:r._0,_1:{TAG:0,_0:n._0},_2:r._1};if(n===0)return{TAG:0,_0:r._0,_1:0,_2:r._1};let i=r._1;if(typeof i!="object"&&typeof i!="function")throw new p(T,{MEL_EXN_ID:T});if(i.TAG===2)return{TAG:0,_0:r._0,_1:1,_2:i._0};throw new p(T,{MEL_EXN_ID:T})}function Et(t,n){if(typeof t!="object"&&typeof t!="function")return{TAG:0,_0:0,_1:n};switch(t.TAG){case 0:if(typeof n!="object"&&typeof n!="function")throw new p(T,{MEL_EXN_ID:T});if(n.TAG===0){let k=Et(t._0,n._0);return{TAG:0,_0:{TAG:0,_0:k._0},_1:k._1}}throw new p(T,{MEL_EXN_ID:T});case 1:if(typeof n!="object"&&typeof n!="function")throw new p(T,{MEL_EXN_ID:T});if(n.TAG===0){let k=Et(t._0,n._0);return{TAG:0,_0:{TAG:1,_0:k._0},_1:k._1}}throw new p(T,{MEL_EXN_ID:T});case 2:let e=Uo(t._0,n),r=e._1;if(typeof r!="object"&&typeof r!="function")throw new p(T,{MEL_EXN_ID:T});if(r.TAG===1){let k=Et(t._1,r._0);return{TAG:0,_0:{TAG:2,_0:e._0,_1:k._0},_1:k._1}}throw new p(T,{MEL_EXN_ID:T});case 3:let i=Uo(t._0,n),o=i._1;if(typeof o!="object"&&typeof o!="function")throw new p(T,{MEL_EXN_ID:T});if(o.TAG===1){let k=Et(t._1,o._0);return{TAG:0,_0:{TAG:3,_0:i._0,_1:k._0},_1:k._1}}throw new p(T,{MEL_EXN_ID:T});case 4:let _=Ri(t._1,t._2,n),s=_._2;if(typeof s!="object"&&typeof s!="function")throw new p(T,{MEL_EXN_ID:T});if(s.TAG===2){let k=Et(t._3,s._0);return{TAG:0,_0:{TAG:4,_0:t._0,_1:_._0,_2:_._1,_3:k._0},_1:k._1}}throw new p(T,{MEL_EXN_ID:T});case 5:let c=Ri(t._1,t._2,n),a=c._2;if(typeof a!="object"&&typeof a!="function")throw new p(T,{MEL_EXN_ID:T});if(a.TAG===3){let k=Et(t._3,a._0);return{TAG:0,_0:{TAG:5,_0:t._0,_1:c._0,_2:c._1,_3:k._0},_1:k._1}}throw new p(T,{MEL_EXN_ID:T});case 6:let u=Ri(t._1,t._2,n),d=u._2;if(typeof d!="object"&&typeof d!="function")throw new p(T,{MEL_EXN_ID:T});if(d.TAG===4){let k=Et(t._3,d._0);return{TAG:0,_0:{TAG:6,_0:t._0,_1:u._0,_2:u._1,_3:k._0},_1:k._1}}throw new p(T,{MEL_EXN_ID:T});case 7:let h=Ri(t._1,t._2,n),y=h._2;if(typeof y!="object"&&typeof y!="function")throw new p(T,{MEL_EXN_ID:T});if(y.TAG===5){let k=Et(t._3,y._0);return{TAG:0,_0:{TAG:7,_0:t._0,_1:h._0,_2:h._1,_3:k._0},_1:k._1}}throw new p(T,{MEL_EXN_ID:T});case 8:let x=Ri(t._1,t._2,n),C=x._2;if(typeof C!="object"&&typeof C!="function")throw new p(T,{MEL_EXN_ID:T});if(C.TAG===6){let k=Et(t._3,C._0);return{TAG:0,_0:{TAG:8,_0:t._0,_1:x._0,_2:x._1,_3:k._0},_1:k._1}}throw new p(T,{MEL_EXN_ID:T});case 9:let S=Uo(t._0,n),G=S._1;if(typeof G!="object"&&typeof G!="function")throw new p(T,{MEL_EXN_ID:T});if(G.TAG===7){let k=Et(t._1,G._0);return{TAG:0,_0:{TAG:9,_0:S._0,_1:k._0},_1:k._1}}throw new p(T,{MEL_EXN_ID:T});case 10:let D=Et(t._0,n);return{TAG:0,_0:{TAG:10,_0:D._0},_1:D._1};case 11:let j=Et(t._1,n);return{TAG:0,_0:{TAG:11,_0:t._0,_1:j._0},_1:j._1};case 12:let M=Et(t._1,n);return{TAG:0,_0:{TAG:12,_0:t._0,_1:M._0},_1:M._1};case 13:if(typeof n!="object"&&typeof n!="function")throw new p(T,{MEL_EXN_ID:T});if(n.TAG===8){let k=n._0;if($r({TAG:0,_0:t._1},{TAG:0,_0:k}))throw new p(T,{MEL_EXN_ID:T});let V=Et(t._2,n._1);return{TAG:0,_0:{TAG:13,_0:t._0,_1:k,_2:V._0},_1:V._1}}throw new p(T,{MEL_EXN_ID:T});case 14:if(typeof n!="object"&&typeof n!="function")throw new p(T,{MEL_EXN_ID:T});if(n.TAG===9){let k=n._0;if($r({TAG:0,_0:kt(t._1)},{TAG:0,_0:kt(k)}))throw new p(T,{MEL_EXN_ID:T});let V=Et(t._2,kt(n._2));return{TAG:0,_0:{TAG:14,_0:t._0,_1:k,_2:V._0},_1:V._1}}throw new p(T,{MEL_EXN_ID:T});case 15:if(typeof n!="object"&&typeof n!="function")throw new p(T,{MEL_EXN_ID:T});if(n.TAG===10){let k=Et(t._0,n._0);return{TAG:0,_0:{TAG:15,_0:k._0},_1:k._1}}throw new p(T,{MEL_EXN_ID:T});case 16:if(typeof n!="object"&&typeof n!="function")throw new p(T,{MEL_EXN_ID:T});if(n.TAG===11){let k=Et(t._0,n._0);return{TAG:0,_0:{TAG:16,_0:k._0},_1:k._1}}throw new p(T,{MEL_EXN_ID:T});case 17:let O=Et(t._1,n);return{TAG:0,_0:{TAG:17,_0:t._0,_1:O._0},_1:O._1};case 18:let N=t._0,rt=t._1;if(N.TAG===0){let k=N._0,V=Et(k._0,n),gt=Et(rt,V._1);return{TAG:0,_0:{TAG:18,_0:{TAG:0,_0:{TAG:0,_0:V._0,_1:k._1}},_1:gt._0},_1:gt._1}}let it=N._0,Q=Et(it._0,n),Ct=Et(rt,Q._1);return{TAG:0,_0:{TAG:18,_0:{TAG:1,_0:{TAG:0,_0:Q._0,_1:it._1}},_1:Ct._0},_1:Ct._1};case 19:if(typeof n!="object"&&typeof n!="function")throw new p(T,{MEL_EXN_ID:T});if(n.TAG===13){let k=Et(t._0,n._0);return{TAG:0,_0:{TAG:19,_0:k._0},_1:k._1}}throw new p(T,{MEL_EXN_ID:T});case 20:if(typeof n!="object"&&typeof n!="function")throw new p(T,{MEL_EXN_ID:T});if(n.TAG===1){let k=Et(t._2,n._0);return{TAG:0,_0:{TAG:20,_0:t._0,_1:t._1,_2:k._0},_1:k._1}}throw new p(T,{MEL_EXN_ID:T});case 21:if(typeof n!="object"&&typeof n!="function")throw new p(T,{MEL_EXN_ID:T});if(n.TAG===2){let k=Et(t._1,n._0);return{TAG:0,_0:{TAG:21,_0:t._0,_1:k._0},_1:k._1}}throw new p(T,{MEL_EXN_ID:T});case 23:let P=t._0,z=t._1;if(typeof P!="object"&&typeof P!="function"){if(P!==2)return Ms(P,z,n);if(typeof n!="object"&&typeof n!="function")throw new p(T,{MEL_EXN_ID:T});if(n.TAG===14){let k=Et(z,n._0);return{TAG:0,_0:{TAG:23,_0:2,_1:k._0},_1:k._1}}throw new p(T,{MEL_EXN_ID:T})}else switch(P.TAG){case 8:return Ms({TAG:8,_0:P._0,_1:P._1},z,n);case 9:let k=Ln(P._1,z,n),V=k._1;return{TAG:0,_0:{TAG:23,_0:{TAG:9,_0:P._0,_1:k._0},_1:V._0},_1:V._1};default:return Ms(P,z,n)}case 22:case 24:throw new p(T,{MEL_EXN_ID:T})}}function Ms(t,n,e){let r=Et(n,e);return{TAG:0,_0:{TAG:23,_0:t,_1:r._0},_1:r._1}}function Ln(t,n,e){if(typeof t!="object"&&typeof t!="function")return{TAG:0,_0:0,_1:Et(n,e)};switch(t.TAG){case 0:if(typeof e!="object"&&typeof e!="function")throw new p(T,{MEL_EXN_ID:T});if(e.TAG===0){let r=Ln(t._0,n,e._0);return{TAG:0,_0:{TAG:0,_0:r._0},_1:r._1}}throw new p(T,{MEL_EXN_ID:T});case 1:if(typeof e!="object"&&typeof e!="function")throw new p(T,{MEL_EXN_ID:T});if(e.TAG===1){let r=Ln(t._0,n,e._0);return{TAG:0,_0:{TAG:1,_0:r._0},_1:r._1}}throw new p(T,{MEL_EXN_ID:T});case 2:if(typeof e!="object"&&typeof e!="function")throw new p(T,{MEL_EXN_ID:T});if(e.TAG===2){let r=Ln(t._0,n,e._0);return{TAG:0,_0:{TAG:2,_0:r._0},_1:r._1}}throw new p(T,{MEL_EXN_ID:T});case 3:if(typeof e!="object"&&typeof e!="function")throw new p(T,{MEL_EXN_ID:T});if(e.TAG===3){let r=Ln(t._0,n,e._0);return{TAG:0,_0:{TAG:3,_0:r._0},_1:r._1}}throw new p(T,{MEL_EXN_ID:T});case 4:if(typeof e!="object"&&typeof e!="function")throw new p(T,{MEL_EXN_ID:T});if(e.TAG===4){let r=Ln(t._0,n,e._0);return{TAG:0,_0:{TAG:4,_0:r._0},_1:r._1}}throw new p(T,{MEL_EXN_ID:T});case 5:if(typeof e!="object"&&typeof e!="function")throw new p(T,{MEL_EXN_ID:T});if(e.TAG===5){let r=Ln(t._0,n,e._0);return{TAG:0,_0:{TAG:5,_0:r._0},_1:r._1}}throw new p(T,{MEL_EXN_ID:T});case 6:if(typeof e!="object"&&typeof e!="function")throw new p(T,{MEL_EXN_ID:T});if(e.TAG===6){let r=Ln(t._0,n,e._0);return{TAG:0,_0:{TAG:6,_0:r._0},_1:r._1}}throw new p(T,{MEL_EXN_ID:T});case 7:if(typeof e!="object"&&typeof e!="function")throw new p(T,{MEL_EXN_ID:T});if(e.TAG===7){let r=Ln(t._0,n,e._0);return{TAG:0,_0:{TAG:7,_0:r._0},_1:r._1}}throw new p(T,{MEL_EXN_ID:T});case 8:if(typeof e!="object"&&typeof e!="function")throw new p(T,{MEL_EXN_ID:T});if(e.TAG===8){let r=e._0;if($r({TAG:0,_0:t._0},{TAG:0,_0:r}))throw new p(T,{MEL_EXN_ID:T});let i=Ln(t._1,n,e._1);return{TAG:0,_0:{TAG:8,_0:r,_1:i._0},_1:i._1}}throw new p(T,{MEL_EXN_ID:T});case 9:if(typeof e!="object"&&typeof e!="function")throw new p(T,{MEL_EXN_ID:T});if(e.TAG===9){let r=e._1,i=e._0;if($r({TAG:0,_0:kt(t._0)},{TAG:0,_0:kt(i)}))throw new p(T,{MEL_EXN_ID:T});if($r({TAG:0,_0:kt(t._1)},{TAG:0,_0:kt(r)}))throw new p(T,{MEL_EXN_ID:T});let o=Qt(Ht(i),r),_=cn(o);b(_[1],0),b(_[3],0);let s=Ln(kt(t._2),n,e._2);return{TAG:0,_0:{TAG:9,_0:i,_1:r,_2:Ht(s._0)},_1:s._1}}throw new p(T,{MEL_EXN_ID:T});case 10:if(typeof e!="object"&&typeof e!="function")throw new p(T,{MEL_EXN_ID:T});if(e.TAG===10){let r=Ln(t._0,n,e._0);return{TAG:0,_0:{TAG:10,_0:r._0},_1:r._1}}throw new p(T,{MEL_EXN_ID:T});case 11:if(typeof e!="object"&&typeof e!="function")throw new p(T,{MEL_EXN_ID:T});if(e.TAG===11){let r=Ln(t._0,n,e._0);return{TAG:0,_0:{TAG:11,_0:r._0},_1:r._1}}throw new p(T,{MEL_EXN_ID:T});case 12:throw new p(T,{MEL_EXN_ID:T});case 13:if(typeof e!="object"&&typeof e!="function")throw new p(T,{MEL_EXN_ID:T});if(e.TAG===13){let r=Ln(t._0,n,e._0);return{TAG:0,_0:{TAG:13,_0:r._0},_1:r._1}}throw new p(T,{MEL_EXN_ID:T});case 14:if(typeof e!="object"&&typeof e!="function")throw new p(T,{MEL_EXN_ID:T});if(e.TAG===14){let r=Ln(t._0,n,e._0);return{TAG:0,_0:{TAG:14,_0:r._0},_1:r._1}}throw new p(T,{MEL_EXN_ID:T})}}function p0(t,n){let e=Et(t,n),r=e._1;if(typeof r!="object"&&typeof r!="function")return e._0;throw new p(T,{MEL_EXN_ID:T})}function h0(t,n){return p0(t,kt(Ht(n)))}function Vn(t,n,e){let r=e.length,i=Er(n),o=n<0?0:t;if(i<=r)return e;let _=bn(i,o===2?48:32);switch(o){case 0:Qn(e,0,_,0,r);break;case 1:Qn(e,0,_,i-r|0,r);break;case 2:r>0&&(R(e,0)===43||R(e,0)===45||R(e,0)===32)?(Ut(_,0,R(e,0)),Qn(e,1,_,(i-r|0)+1|0,r-1|0)):r>1&&R(e,0)===48&&(R(e,1)===120||R(e,1)===88)?(Ut(_,1,R(e,1)),Qn(e,2,_,(i-r|0)+2|0,r-2|0)):Qn(e,0,_,i-r|0,r);break}return mt(_)}function ii(t,n){let e=Er(t),r=n.length,i=R(n,0),o=0;if(i>=58)if(i>=71){if(i>102||i<97)return n;o=2}else{if(i<65)return n;o=2}else if(i!==32){if(i<43)return n;switch(i){case 43:case 45:o=1;break;case 44:case 46:case 47:return n;case 48:if((e+2|0)>r&&r>1&&(R(n,1)===120||R(n,1)===88)){let _=bn(e+2|0,48);return Ut(_,1,R(n,1)),Qn(n,2,_,(e-r|0)+4|0,r-2|0),mt(_)}o=2;break;case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:o=2;break}}else o=1;switch(o){case 1:if((e+1|0)<=r)return n;let _=bn(e+1|0,48);return Ut(_,0,i),Qn(n,1,_,(e-r|0)+2|0,r-1|0),mt(_);case 2:if(e<=r)return n;let s=bn(e,48);return Qn(n,0,s,e-r|0,r),mt(s)}}function g0(t){let n=tl(t),e=n.length,r=bn(e+2|0,34);return me(n,0,r,1,e),mt(r)}function b0(t){switch(t){case 1:return"%+d";case 2:return"% d";case 4:return"%+i";case 5:return"% i";case 6:return"%x";case 7:return"%#x";case 8:return"%X";case 9:return"%#X";case 10:return"%o";case 11:return"%#o";case 0:case 13:return"%d";case 3:case 14:return"%i";case 12:case 15:return"%u"}}function y0(t){switch(t){case 1:return"%+Ld";case 2:return"% Ld";case 4:return"%+Li";case 5:return"% Li";case 6:return"%Lx";case 7:return"%#Lx";case 8:return"%LX";case 9:return"%#LX";case 10:return"%Lo";case 11:return"%#Lo";case 0:case 13:return"%Ld";case 3:case 14:return"%Li";case 12:case 15:return"%Lu"}}function C0(t){switch(t){case 1:return"%+ld";case 2:return"% ld";case 4:return"%+li";case 5:return"% li";case 6:return"%lx";case 7:return"%#lx";case 8:return"%lX";case 9:return"%#lX";case 10:return"%lo";case 11:return"%#lo";case 0:case 13:return"%ld";case 3:case 14:return"%li";case 12:case 15:return"%lu"}}function S0(t){switch(t){case 1:return"%+nd";case 2:return"% nd";case 4:return"%+ni";case 5:return"% ni";case 6:return"%nx";case 7:return"%#nx";case 8:return"%nX";case 9:return"%#nX";case 10:return"%no";case 11:return"%#no";case 0:case 13:return"%nd";case 3:case 14:return"%ni";case 12:case 15:return"%nu"}}function gl(t,n){let e=Er(n),r=f0(103,t),i={ind:0,bytes:Tt(16)};return oi(i,37),m0(i,t),oi(i,46),sn(i,ie("%d",e)),oi(i,r),yl(i)}function Wo(t,n){switch(t){case 13:case 14:case 15:break;default:return n}let e=0;for(let c=0,a=n.length;c<a;++c){let u=n.charCodeAt(c);u>57||u<48||(e=e+1|0)}let r=e,i=Tt(n.length+((r-1|0)/3|0)|0),o={contents:0},_=function(c){Ut(i,o.contents,c),o.contents=o.contents+1|0},s=(r-1|0)%3+1|0;for(let c=0,a=n.length;c<a;++c){let u=n.charCodeAt(c);u>57||u<48||(s===0&&(_(95),s=3),s=s-1|0),_(u)}return mt(i)}function w0(t,n){return Wo(t,ie(b0(t),n))}function x0(t,n){return Wo(t,ns(C0(t),n))}function A0(t,n){return Wo(t,ia(S0(t),n))}function E0(t,n){return Wo(t,J_(y0(t),n))}function Ue(t,n,e){let r=function(s){let c=t[0],a;switch(c){case 0:a=45;break;case 1:a=43;break;case 2:a=32;break}return ra(e,n,a)},i=function(s){let c=s.length;return function(u){for(;;){let d=u;if(d===c)return!1;let h=R(s,d);if(h>69||h<46){if(h===101)return!0;u=d+1|0;continue}if(h>68||h<47)return!0;u=d+1|0}}(0)?s:s+"."},o=function(s){switch(aa(e)){case 3:return e<0?"neg_infinity":"infinity";case 4:return"nan";default:return s}};switch(t[1]){case 5:let s=ji(gl(t,n),e);return o(i(s));case 6:return r();case 7:let c=r();return mt(Cs(dn(c)));case 8:return o(r());default:return ji(gl(t,n),e)}}function $0(t){let n=qa(t),e=n.length,r=bn(e+2|0,39);return me(n,0,r,1,e),mt(r)}function T0(t){let n={ind:0,bytes:Tt(16)};return Ls(n,t),yl(n)}function dt(t,n,e){for(;;){let r=e,i=n,o=t;if(typeof r!="object"&&typeof r!="function")return b(o,i);switch(r.TAG){case 0:let _=r._0;return function(P){return dt(o,{TAG:5,_0:i,_1:P},_)};case 1:let s=r._0;return function(P){let z=$0(P);return dt(o,{TAG:4,_0:i,_1:z},s)};case 2:return Is(o,i,r._1,r._0,(function(P){return P}));case 3:return Is(o,i,r._1,r._0,g0);case 4:return Ro(o,i,r._3,r._1,r._2,w0,r._0);case 5:return Ro(o,i,r._3,r._1,r._2,x0,r._0);case 6:return Ro(o,i,r._3,r._1,r._2,A0,r._0);case 7:return Ro(o,i,r._3,r._1,r._2,E0,r._0);case 8:let c=r._3,a=r._1,u=r._2,d=r._0;if(typeof a!="object"&&typeof a!="function"){if(typeof u!="object"&&typeof u!="function")return u===0?function(z){let k=Ue(d,ks(d),z);return dt(o,{TAG:4,_0:i,_1:k},c)}:function(z,k){let V=Ue(d,z,k);return dt(o,{TAG:4,_0:i,_1:V},c)};let P=u._0;return function(z){let k=Ue(d,P,z);return dt(o,{TAG:4,_0:i,_1:k},c)}}if(a.TAG===0){let P=a._1,z=a._0;if(typeof u!="object"&&typeof u!="function")return u===0?function(V){let gt=Ue(d,ks(d),V),tt=Vn(z,P,gt);return dt(o,{TAG:4,_0:i,_1:tt},c)}:function(V,gt){let tt=Vn(z,P,Ue(d,V,gt));return dt(o,{TAG:4,_0:i,_1:tt},c)};let k=u._0;return function(V){let gt=Vn(z,P,Ue(d,k,V));return dt(o,{TAG:4,_0:i,_1:gt},c)}}let h=a._0;if(typeof u!="object"&&typeof u!="function")return u===0?function(P,z){let k=Ue(d,ks(d),z),V=Vn(h,P,k);return dt(o,{TAG:4,_0:i,_1:V},c)}:function(P,z,k){let V=Vn(h,P,Ue(d,z,k));return dt(o,{TAG:4,_0:i,_1:V},c)};let y=u._0;return function(P,z){let k=Vn(h,P,Ue(d,y,z));return dt(o,{TAG:4,_0:i,_1:k},c)};case 9:return Is(o,i,r._1,r._0,la);case 10:e=r._0,n={TAG:7,_0:i};continue;case 11:e=r._1,n={TAG:2,_0:i,_1:r._0};continue;case 12:e=r._1,n={TAG:3,_0:i,_1:r._0};continue;case 13:let x=r._2,C=T0(r._1);return function(P){return dt(o,{TAG:4,_0:i,_1:C},x)};case 14:let S=r._2,G=r._1;return function(P){return dt(o,i,$t(h0(P._0,G),S))};case 15:let D=r._0;return function(P,z){return dt(o,{TAG:6,_0:i,_1:(function(k){return $(P,k,z)})},D)};case 16:let j=r._0;return function(P){return dt(o,{TAG:6,_0:i,_1:P},j)};case 17:e=r._1,n={TAG:0,_0:i,_1:r._0};continue;case 18:let M=r._0;if(M.TAG===0){let P=r._1,z=function(k){return dt(o,{TAG:1,_0:i,_1:{TAG:0,_0:k}},P)};e=M._0._0,n=0,t=z;continue}let O=r._1,N=function(P){return dt(o,{TAG:1,_0:i,_1:{TAG:1,_0:P}},O)};e=M._0._0,n=0,t=N;continue;case 19:throw new p("Assert_failure",{MEL_EXN_ID:"Assert_failure",_1:["./camlinternalFormat.cppo.ml",1558,4]});case 20:let rt=r._2,it={TAG:8,_0:i,_1:"Printf: bad conversion %["};return function(P){return dt(o,it,rt)};case 21:let Q=r._1;return function(P){let z=ie("%u",P);return dt(o,{TAG:4,_0:i,_1:z},Q)};case 22:let Ct=r._0;return function(P){return dt(o,{TAG:5,_0:i,_1:P},Ct)};case 23:return G0(o,i,r._0,r._1);case 24:return Cl(o,i,r._2,r._0,b(r._1,void 0))}}}function G0(t,n,e,r){if(!(typeof e!="object"&&typeof e!="function"))return e.TAG===9?zn(t,n,e._1,r):Ds(t,n,r);if(e!==2)return Ds(t,n,r);throw new p("Assert_failure",{MEL_EXN_ID:"Assert_failure",_1:["./camlinternalFormat.cppo.ml",1626,39]})}function zn(t,n,e,r){if(typeof e!="object"&&typeof e!="function")return Ds(t,n,r);switch(e.TAG){case 0:let i=e._0;return function(D){return zn(t,n,i,r)};case 1:let o=e._0;return function(D){return zn(t,n,o,r)};case 2:let _=e._0;return function(D){return zn(t,n,_,r)};case 3:let s=e._0;return function(D){return zn(t,n,s,r)};case 4:let c=e._0;return function(D){return zn(t,n,c,r)};case 5:let a=e._0;return function(D){return zn(t,n,a,r)};case 6:let u=e._0;return function(D){return zn(t,n,u,r)};case 7:let d=e._0;return function(D){return zn(t,n,d,r)};case 8:let h=e._1;return function(D){return zn(t,n,h,r)};case 9:let y=e._2,x=Qt(Ht(e._0),e._1);return function(D){return zn(t,n,pn(x,y),r)};case 10:let C=e._0;return function(D,j){return zn(t,n,C,r)};case 11:let S=e._0;return function(D){return zn(t,n,S,r)};case 12:let G=e._0;return function(D){return zn(t,n,G,r)};case 13:throw new p("Assert_failure",{MEL_EXN_ID:"Assert_failure",_1:["./camlinternalFormat.cppo.ml",1649,31]});case 14:throw new p("Assert_failure",{MEL_EXN_ID:"Assert_failure",_1:["./camlinternalFormat.cppo.ml",1650,31]})}}function Ds(t,n,e){return dt(t,{TAG:8,_0:n,_1:"Printf: bad conversion %_"},e)}function Is(t,n,e,r,i){if(typeof r!="object"&&typeof r!="function")return function(_){let s=b(i,_);return dt(t,{TAG:4,_0:n,_1:s},e)};if(r.TAG===0){let _=r._1,s=r._0;return function(c){let a=Vn(s,_,b(i,c));return dt(t,{TAG:4,_0:n,_1:a},e)}}let o=r._0;return function(_,s){let c=Vn(o,_,b(i,s));return dt(t,{TAG:4,_0:n,_1:c},e)}}function Ro(t,n,e,r,i,o,_){if(typeof r!="object"&&typeof r!="function"){if(typeof i!="object"&&typeof i!="function")return i===0?function(u){let d=$(o,_,u);return dt(t,{TAG:4,_0:n,_1:d},e)}:function(u,d){let h=ii(u,$(o,_,d));return dt(t,{TAG:4,_0:n,_1:h},e)};let a=i._0;return function(u){let d=ii(a,$(o,_,u));return dt(t,{TAG:4,_0:n,_1:d},e)}}if(r.TAG===0){let a=r._1,u=r._0;if(typeof i!="object"&&typeof i!="function")return i===0?function(h){let y=Vn(u,a,$(o,_,h));return dt(t,{TAG:4,_0:n,_1:y},e)}:function(h,y){let x=Vn(u,a,ii(h,$(o,_,y)));return dt(t,{TAG:4,_0:n,_1:x},e)};let d=i._0;return function(h){let y=Vn(u,a,ii(d,$(o,_,h)));return dt(t,{TAG:4,_0:n,_1:y},e)}}let s=r._0;if(typeof i!="object"&&typeof i!="function")return i===0?function(a,u){let d=Vn(s,a,$(o,_,u));return dt(t,{TAG:4,_0:n,_1:d},e)}:function(a,u,d){let h=Vn(s,a,ii(u,$(o,_,d)));return dt(t,{TAG:4,_0:n,_1:h},e)};let c=i._0;return function(a,u){let d=Vn(s,a,ii(c,$(o,_,u)));return dt(t,{TAG:4,_0:n,_1:d},e)}}function Cl(t,n,e,r,i){if(typeof r!="object"&&typeof r!="function")return dt(t,{TAG:4,_0:n,_1:i},e);let o=r._0;return function(_){return Cl(t,n,e,o,b(i,_))}}function Ge(t,n){for(;;){let e=n,r=0;if(typeof e!="object"&&typeof e!="function")return;switch(e.TAG){case 0:let i=d0(e._1);return Ge(t,e._0),Dt(t,i);case 1:let o=e._1,_=e._0;if(o.TAG===0){Ge(t,_),Dt(t,"@{"),n=o._0;continue}Ge(t,_),Dt(t,"@["),n=o._0;continue;case 2:case 4:r=1;break;case 3:case 5:r=2;break;case 6:return Ge(t,e._0),Dt(t,b(e._1,void 0));case 7:n=e._0;continue;case 8:throw Ge(t,e._0),new p("Invalid_argument",{MEL_EXN_ID:"Invalid_argument",_1:e._1})}switch(r){case 1:return Ge(t,e._0),Dt(t,e._1);case 2:return Ge(t,e._0),ot(t,e._1)}}}function v0(t){let n=bt(256);return dt(function(r){Ge(n,r);let i=K(n);throw new p("Failure",{MEL_EXN_ID:"Failure",_1:i})},0,t._0)}function Ns(t){if(t==="")return[0,4];let n=t.length,e=function(x){return b(v0({TAG:0,_0:{TAG:11,_0:"invalid box description ",_1:{TAG:3,_0:0,_1:0}},_1:"invalid box description %S"}),t)},r=function(x){for(;;){let C=x;if(C===n)return C;let S=R(t,C);if(S!==9){if(S!==32)return C;x=C+1|0;continue}x=C+1|0}},i=function(x,C){for(;;){let S=C;if(S===n)return S;let G=R(t,S);if(G>122||G<97)return S;C=S+1|0}},o=function(x,C){for(;;){let S=C;if(S===n)return S;let G=R(t,S);if(G>=48){if(G>=58)return S;C=S+1|0;continue}if(G!==45)return S;C=S+1|0}},_=r(0),s=i(_,_),c=Ot(t,_,s-_|0),a=r(s),u=o(a,a),d;if(a===u)d=0;else try{d=vi(Ot(t,a,u-a|0))}catch(x){let C=yt(x);if(C.MEL_EXN_ID===ki)d=e();else throw C}r(u)!==n&&e();let y;switch(c){case"":case"b":y=4;break;case"h":y=0;break;case"hov":y=3;break;case"hv":y=2;break;case"v":y=1;break;default:y=e()}return[d,y]}function We(t,n){return dt(function(r){let i=bt(64);return Ge(i,r),b(t,K(i))},0,n._0)}function Kt(t){return We((function(n){return n}),t)}function I0(t){return t!==void 0?t==="Yellow"?"33":"31":""}function Yo(t,n,e){let r=I0(n),i=r===""?0:{hd:r,tl:0},_=xn(";",t?{hd:"1",tl:i}:i);return $(Kt({TAG:0,_0:{TAG:11,_0:"\x1B[",_1:{TAG:2,_0:0,_1:{TAG:12,_0:109,_1:{TAG:2,_0:0,_1:{TAG:11,_0:"\x1B[0m",_1:0}}}}},_1:"\x1B[%sm%s\x1B[0m"}),_,e)}var Ui=Kt({TAG:0,_0:{TAG:11,_0:"\x1B[2m",_1:{TAG:2,_0:0,_1:{TAG:11,_0:"\x1B[22m",_1:0}}},_1:"\x1B[2m%s\x1B[22m"});var Xs={v:0},Ps={TAG:0,_0:{TAG:11,_0:'File "',_1:{TAG:2,_0:0,_1:{TAG:11,_0:'", line ',_1:{TAG:4,_0:0,_1:0,_2:0,_3:{TAG:11,_0:", characters ",_1:{TAG:4,_0:0,_1:0,_2:0,_3:{TAG:12,_0:45,_1:{TAG:4,_0:0,_1:0,_2:0,_3:{TAG:11,_0:": ",_1:{TAG:2,_0:0,_1:0}}}}}}}}}},_1:'File "%s", line %d, characters %d-%d: %s'},L0=(function(t){for(var n="",e=1;"_"+e in t;)n+=t["_"+e],++e;return e===1?n:"("+n+")"});function D0(t){let n=Xs.v;for(;;){let e=n;if(!e)return;let r=e.tl,i;try{i=b(e.hd,t)}catch{n=r;continue}if(i!==void 0)return F(wt(i));n=r}}function N0(t){if(t.MEL_EXN_ID===ga)return"Out of memory";if(t.MEL_EXN_ID===ba)return"Stack overflow";if(t.MEL_EXN_ID===pa){let e=t._1,r=e[2];return Si(Kt(Ps),e[0],e[1],r,r+5|0,"Pattern matching failed")}if(t.MEL_EXN_ID===ha){let e=t._1,r=e[2];return Si(Kt(Ps),e[0],e[1],r,r+6|0,"Assertion failed")}if(t.MEL_EXN_ID===ya){let e=t._1,r=e[2];return Si(Kt(Ps),e[0],e[1],r,r+6|0,"Undefined recursive module")}return Wc(t)+L0(t)}function xl(t){let n=D0(t);return n!==void 0?n:N0(t)}function Al(t){for(;;){let n=Xs.v;if(ja(Xs,n,{hd:t,tl:n}))return}}function El(t){return t}var Bs=Lt("Stdlib.Fun.Finally_raised");Al(function(t){if(t.MEL_EXN_ID===Bs)return"Fun.Finally_raised: "+xl(t._1)});function Qo(t,n){let e=function(i){try{return b(t,void 0)}catch(o){let _=yt(o),s,c=new p(Bs,{MEL_EXN_ID:Bs,_1:_});throw jt("caml_restore_raw_backtrace")(c,s),c}},r;try{r=b(n,void 0)}catch(i){let o=yt(i),_;throw e(),jt("caml_restore_raw_backtrace")(o,_),o}return e(),r}function B0(t,n,e){let r=b(t,n);return Qo((function(i){ma(r)}),(function(i){return b(e,r)}))}function qs(t,n){return B0(fa,t,n)}var Wy=$o.seek_in,Yy=$o.pos_in,O0=$o.in_channel_length;function $l(t,n,e,r){return function(o,_){for(;;){let s=_,c=o;if(s===0)return c;let a=Eo(t,n,c,s);if(a===0)return c;_=s-a|0,o=c+a|0}}(e,r)-e|0}function Tl(t,n,e){let r=t.length;if(r>=(n+e|0))return t;let i=r;for(;i<(n+e|0);)i=(i<<1)+1|0;let o=i,_;if(o<=Mn)_=o;else if(n<Mn)_=Mn;else throw new p("Failure",{MEL_EXN_ID:"Failure",_1:"In_channel.input_all: channel content is larger than maximum string length"});let s=Tt(_);return jr(t,0,s,0,n),s}function Gl(t){let n;try{n=jt("caml_ml_channel_size")(t)-jt("caml_ml_pos_in")(t)|0}catch(u){let d=yt(u);if(d.MEL_EXN_ID===wo)n=-1;else throw d}let e=n<0?vo:n,r=e<=Mn?e:Mn,i=Tt(r),o=$l(t,i,0,r);if(o<r)return Ae(i,0,o);let _;try{_=jt("caml_ml_input_char")(t)}catch(u){let d=yt(u);if(d.MEL_EXN_ID===xo)return mt(i);throw d}let s=Tl(i,o,vo+1|0);Ut(s,o,_);let c=s,a=o+1|0;for(;;){let u=a,h=Tl(c,u,vo),y=h.length-u|0,x=$l(t,h,u,y);if(x<y)return Ae(h,0,u+x|0);a=u+y|0,c=h}}function Fs(t){if(!(typeof t!="object"&&typeof t!="function"))return t.TAG===0,t._0}function Ko(t){return typeof t!="object"&&typeof t!="function"?"":t.TAG===0?qs(t._0,Gl):t._1}var zs=0;function jl(t){return{length:0,first:0,last:0}}function Hs(t){t.length=0,t.first=0,t.last=0}function pe(t,n){let e={TAG:0,content:t,next:0},r=n.last;if(typeof r!="object"&&typeof r!="function"){n.length=1,n.first=e,n.last=e;return}n.length=n.length+1|0,r.next=e,n.last=e}function Zo(t){let n=t.first;if(!(typeof n!="object"&&typeof n!="function"))return F(n.content)}function Wi(t){let n=t.first;if(typeof n!="object"&&typeof n!="function")return;let e=n.content,r=n.next;if(typeof r!="object"&&typeof r!="function")return Hs(t),F(e);let i=n.next;return t.length=t.length-1|0,t.first=i,F(e)}function kl(t){let n=function(r,i){if(typeof r!="object"&&typeof r!="function")return 0;let o=r.next;return{TAG:0,_0:r.content,_1:(function(_){return n(o,_)})}},e=t.first;return function(r){return n(e,r)}}var Ml=pe;var Il={contents:!1};function Yi(t){return Il.contents=!0,Qo((function(n){Il.contents=!1}),t)}var q0={length:0,first:0,last:0},F0={contents:!1};function Nl(t){Yi(function(n){if(F0.contents)throw new p("Invalid_argument",{MEL_EXN_ID:"Invalid_argument",_1:"Domain.before_first_spawn"});Ml(t,q0)})}var Ll={contents:0};function Us(t){Yi(function(n){Ll.contents={hd:t,tl:Ll.contents}})}var Dl={contents:0};function z0(t,n){let e={table:void 0,split_from_parent:t,init:n};return Yi(function(r){Dl.contents={hd:{TAG:0,_0:e},tl:Dl.contents}}),e}function V0(t){let n=t.table;if(n!==void 0)return wt(n);let e=b(t.init,void 0);return Yi(function(r){t.table=F(e)}),e}function H0(t,n){Yi(function(e){t.table=F(n)})}var Ft={new_key:z0,get:V0,set:H0};function _i(t){t.c=0,t.len=0}function lr(t,n){n.c={hd:t,tl:n.c},n.len=n.len+1|0}function Pr(t){let n=t.c;if(n)return t.c=n.tl,t.len=t.len-1|0,F(n.hd)}function Xr(t){let n=t.c;if(n)return F(n.hd)}function U0(t){return t}var __=Lt("Stdlib.Format.String_tag");function Zi(t,n){t.pp_right_total=t.pp_right_total+n.length|0,pe(n,t.pp_queue)}function W0(t){t.pp_left_total=1,t.pp_right_total=1,Hs(t.pp_queue)}function Ys(t,n){H(t.pp_out_string,n,0,n.length)}function Br(t,n){return H(t.pp_out_width,n,0,n.length)}function Y0(t,n,e,r){H(t.pp_out_string,r,n,e)}function Ol(t,n,e){t.pp_space_left=t.pp_space_left-n|0,Ys(t,e),t.pp_is_new_line=!1}function t_(t,n){if(n!=="")return Ol(t,Br(t,n),n)}function Qi(t,n,e){t_(t,n[0]),b(t.pp_out_newline,void 0),t.pp_is_new_line=!0;let r=(t.pp_margin-e|0)+n[1]|0,i=vr(t.pp_max_indent,r);t.pp_current_indent=i,t.pp_space_left=t.pp_margin-t.pp_current_indent|0,b(t.pp_out_indent,t.pp_current_indent),t_(t,n[2])}function ql(t,n){Qi(t,["",0,""],n)}function Jo(t,n){let e=n[1];t_(t,n[0]),t.pp_space_left=t.pp_space_left-e|0,b(t.pp_out_spaces,e),t_(t,n[2])}function Q0(t){let n=Xr(t.pp_format_stack);if(n===void 0)return b(t.pp_out_newline,void 0);let e=n.width;if(!(e<=t.pp_space_left))switch(n.box_type){case 0:case 5:return;default:return ql(t,e)}}function K0(t,n,e){if(typeof e!="object"&&typeof e!="function")switch(e){case 0:let r=Xr(t.pp_tbox_stack);if(r===void 0)return;let i=r._0,o=function(a,u){if(!u)return{hd:a,tl:0};let d=u.hd;return Sa(a,d)?{hd:a,tl:u}:{hd:d,tl:o(a,u.tl)}};i.contents=o(t.pp_margin-t.pp_space_left|0,i.contents);return;case 1:Pr(t.pp_format_stack);return;case 2:Pr(t.pp_tbox_stack);return;case 3:let _=Xr(t.pp_format_stack);return _!==void 0?ql(t,_.width):b(t.pp_out_newline,void 0);case 4:if(t.pp_current_indent!==(t.pp_margin-t.pp_space_left|0)){let a=Wi(t.pp_queue);if(a===void 0)return;let u=a.size;t.pp_left_total=t.pp_left_total-a.length|0,t.pp_space_left=t.pp_space_left+u|0;return}else return;case 5:let s=Pr(t.pp_mark_stack);if(s===void 0)return;let c=b(t.pp_mark_close_tag,wt(s));return Ys(t,c)}else switch(e.TAG){case 0:return Ol(t,n,e._0);case 1:let r=e.pos,i=e.len,o=e.source;t.pp_space_left=t.pp_space_left-n|0,Y0(t,r,i,o),t.pp_is_new_line=!1;return;case 2:let _=e.breaks,s=_[0],c=e.fits,a=Xr(t.pp_format_stack);if(a===void 0)return;let u=a.width;switch(a.box_type){case 1:case 2:return Qi(t,_,u);case 3:return(n+Br(t,s)|0)>t.pp_space_left?Qi(t,_,u):Jo(t,c);case 4:return t.pp_is_new_line||!((n+Br(t,s)|0)>t.pp_space_left||t.pp_current_indent>((t.pp_margin-u|0)+_[1]|0))?Jo(t,c):Qi(t,_,u);case 0:case 5:return Jo(t,c)}case 3:let d=t.pp_margin-t.pp_space_left|0,h=Xr(t.pp_tbox_stack);if(h===void 0)return;let y=h._0,x=y.contents,C;if(x){let rt=x.hd;C=function(Q){for(;;){let Ct=Q;if(!Ct)return rt;let P=Ct.hd;if(P>=d)return P;Q=Ct.tl}}(y.contents)}else C=d;let S=C-d|0;return S>=0?Jo(t,["",S+e._0|0,""]):Qi(t,["",C+e._1|0,""],t.pp_margin);case 4:let G=e._1;(t.pp_margin-t.pp_space_left|0)>t.pp_max_indent&&Q0(t);let j=t.pp_space_left-e._0|0,M;return M=G===1?1:n>t.pp_space_left?G:5,lr({box_type:M,width:j},t.pp_format_stack);case 5:return lr(e._0,t.pp_tbox_stack);case 6:let O=e._0,N=b(t.pp_mark_open_tag,O);return Ys(t,N),lr(O,t.pp_mark_stack)}}function Fl(t){for(;;){let n=Zo(t.pp_queue);if(n===void 0)return;let e=n.size,r=t.pp_right_total-t.pp_left_total|0;if(!(e>=0||r>=t.pp_space_left))return;if(Wi(t.pp_queue)!==void 0){let o=e>=0?e:1000000010;K0(t,o,n.token),t.pp_left_total=n.length+t.pp_left_total|0;continue}throw new p("Invalid_argument",{MEL_EXN_ID:"Invalid_argument",_1:"Format: Unsynchronized access to formatter"})}}function zl(t,n){Zi(t,n),Fl(t)}function Vl(t,n,e){zl(t,{size:n,token:{TAG:0,_0:e},length:n})}function Zs(t){_i(t),lr({left_total:-1,queue_elem:{size:-1,token:{TAG:0,_0:""},length:0}},t)}function Qs(t,n){let e=Xr(t.pp_scan_stack);if(e===void 0)return;let r=e.queue_elem,i=r.size;if(e.left_total<t.pp_left_total)return Zs(t.pp_scan_stack);let o=r.token;if(!(typeof o!="object"&&typeof o!="function")){switch(o.TAG){case 2:case 3:break;case 4:if(n)return;r.size=t.pp_right_total+i|0,Pr(t.pp_scan_stack);return;default:return}if(n){r.size=t.pp_right_total+i|0,Pr(t.pp_scan_stack);return}}}function Z0(t,n){pe(n,t.pp_queue),Qs(t,!0),t.pp_right_total=t.pp_right_total+n.length|0}function Hl(t,n,e){n?Z0(t,e):Zi(t,e);let i={left_total:t.pp_right_total,queue_elem:e};lr(i,t.pp_scan_stack)}function Js(t,n,e){if(t.pp_curr_depth=t.pp_curr_depth+1|0,t.pp_curr_depth>=t.pp_max_boxes)if(t.pp_curr_depth===t.pp_max_boxes){let o=t.pp_ellipsis,_=Br(t,o);return Vl(t,_,o)}else return;let i={size:-t.pp_right_total|0,token:{TAG:4,_0:n,_1:e},length:0};Hl(t,!1,i)}function Rl(t,n){if(t.pp_curr_depth>1){t.pp_curr_depth<t.pp_max_boxes&&(Zi(t,{size:0,token:1,length:0}),Qs(t,!0),Qs(t,!1)),t.pp_curr_depth=t.pp_curr_depth-1|0;return}}function Ul(t,n){if(t.pp_print_tags&&(lr(n,t.pp_tag_stack),b(t.pp_print_open_tag,n)),!t.pp_mark_tags)return;Zi(t,{size:0,token:{TAG:6,_0:n},length:0})}function Wl(t,n){if(t.pp_mark_tags&&Zi(t,{size:0,token:5,length:0}),!t.pp_print_tags)return;let e=Pr(t.pp_tag_stack);if(e!==void 0)return b(t.pp_print_close_tag,wt(e))}function J0(t){W0(t),Zs(t.pp_scan_stack),_i(t.pp_format_stack),_i(t.pp_tbox_stack),_i(t.pp_tag_stack),_i(t.pp_mark_stack),t.pp_current_indent=0,t.pp_curr_depth=0,t.pp_space_left=t.pp_margin,Js(t,0,3)}function td(t){let n=t.pp_tag_stack;we(function(r){Wl(t,void 0)},n.c)}function tc(t,n){for(td(t);t.pp_curr_depth>1;)Rl(t,void 0);t.pp_right_total=1000000010,Fl(t),n&&b(t.pp_out_newline,void 0),J0(t)}function si(t,n,e){if(t.pp_curr_depth<t.pp_max_boxes)return Vl(t,n,e)}var Yl=si;function Ki(t,n){Yl(t,Br(t,n),n)}function ur(t,n){Yl(t,1,mt(bn(1,n)))}function s_(t,n){tc(t,!0),b(t.pp_out_flush,void 0)}function fr(t,n){tc(t,!1),b(t.pp_out_flush,void 0)}function nd(t,n){if(t.pp_curr_depth<t.pp_max_boxes)return zl(t,{size:0,token:3,length:0})}function ed(t,n,e){if(t.pp_curr_depth>=t.pp_max_boxes)return;let r=-t.pp_right_total|0,i={TAG:2,fits:n,breaks:e},o=(Br(t,n[0])+n[1]|0)+Br(t,n[2])|0;Hl(t,!0,{size:r,token:i,length:o})}function rd(t,n,e){ed(t,["",n,""],["",e,""])}function Pl(t,n){t.pp_out_string=n.out_string,t.pp_out_width=n.out_width,t.pp_out_flush=n.out_flush,t.pp_out_newline=n.out_newline,t.pp_out_spaces=n.out_spaces,t.pp_out_indent=n.out_indent}function Xl(t,n){return{out_string:t.pp_out_string,out_width:t.pp_out_width,out_flush:t.pp_out_flush,out_newline:t.pp_out_newline,out_spaces:t.pp_out_spaces,out_indent:t.pp_out_indent}}function nc(t,n){H(t.pp_out_string,`
33
+ `,0,1)}var Bl=mt(bn(80,32));function ci(t,n){for(;;){let e=n;if(e<=0)return;if(e<=80)return H(t.pp_out_string,Bl,0,e);H(t.pp_out_string,Bl,0,80),n=e-80|0}}function id(t){return t.MEL_EXN_ID===__?"<"+(t._1+">"):""}function od(t){return t.MEL_EXN_ID===__?"</"+(t._1+">"):""}function _d(t){}function sd(t){}function cd(t,n,e){let r=0,i=n,o=n+e|0;for(;;){let _=i,s=r;if(_>=o)return s;let a=Ss(dn(t),_)>>>24&7;i=_+a|0,r=s+1|0}}function ec(t,n,e,r,i){let o={length:0,first:0,last:0},_={size:-1,token:{TAG:4,_0:0,_1:3},length:0};pe(_,o);let s={c:0,len:0};return Zs(s),lr({left_total:1,queue_elem:_},s),{pp_scan_stack:s,pp_format_stack:{c:0,len:0},pp_tbox_stack:{c:0,len:0},pp_tag_stack:{c:0,len:0},pp_mark_stack:{c:0,len:0},pp_margin:78,pp_min_space_left:10,pp_max_indent:68,pp_space_left:78,pp_current_indent:0,pp_is_new_line:!0,pp_left_total:1,pp_right_total:1,pp_curr_depth:1,pp_max_boxes:Fe,pp_ellipsis:".",pp_out_string:t,pp_out_width:cd,pp_out_flush:n,pp_out_newline:e,pp_out_spaces:r,pp_out_indent:i,pp_print_tags:!1,pp_mark_tags:!1,pp_mark_open_tag:id,pp_mark_close_tag:od,pp_print_open_tag:_d,pp_print_close_tag:sd,pp_queue:o}}function Ql(t,n){let e=ec(t,n,(function(r){}),(function(r){}),(function(r){}));return e.pp_out_newline=(function(r){return nc(e,r)}),e.pp_out_spaces=(function(r){return ci(e,r)}),e.pp_out_indent=(function(r){return ci(e,r)}),e}function Kl(t){return Ql((function(n,e,r){return ss(t,n,e,r)}),(function(n){or(t)}))}function Or(t){return Ql((function(n,e,r){return zo(t,n,e,r)}),(function(n){}))}function ad(t){return bt(512)}var Zl=bt(512),Ks=Kl(Yr),ai=Kl(Qr),ld=Or(Zl),Jl=Ft.new_key(void 0,ad);Ft.set(Jl,Zl);var ud=Ft.new_key(void 0,(function(t){return Or(Ft.get(Jl))}));Ft.set(ud,ld);function n_(t,n,e,r){zo(Ft.get(t),n,e,r)}function e_(t,n,e){let r=Ft.get(n),i=r.position,o=K(r);ss(t,o,0,i),or(t),r.position=0}var r_=Ft.new_key(void 0,(function(t){return bt(512)})),i_=Ft.new_key(void 0,(function(t){return bt(512)})),tu=Ft.new_key(void 0,(function(t){let n=ec((function(e,r,i){return n_(r_,e,r,i)}),(function(e){return e_(Yr,r_,e)}),(function(e){}),(function(e){}),(function(e){}));return n.pp_out_newline=(function(e){return nc(n,e)}),n.pp_out_spaces=(function(e){return ci(n,e)}),n.pp_out_indent=(function(e){return ci(n,e)}),Us(function(e){return fr(n,e)}),n}));Ft.set(tu,Ks);var nu=Ft.new_key(void 0,(function(t){let n=ec((function(e,r,i){return n_(i_,e,r,i)}),(function(e){return e_(Qr,i_,e)}),(function(e){}),(function(e){}),(function(e){}));return n.pp_out_newline=(function(e){return nc(n,e)}),n.pp_out_spaces=(function(e){return ci(n,e)}),n.pp_out_indent=(function(e){return ci(n,e)}),Us(function(e){return fr(n,e)}),n}));Ft.set(nu,ai);function fd(t,n){tc(n,!1);let e=K(t);return pl(t),e}function o_(t,n){let e=bt(16),r=Or(e);$(t,r,n),fr(r,void 0);let i=e.position;return i<2?K(e):dl(e,1,i-2|0)}function eu(t,n){if(typeof n!="object"&&typeof n!="function")switch(n){case 0:return Rl(t,void 0);case 1:return Wl(t,void 0);case 2:return fr(t,void 0);case 3:return nd(t,void 0);case 4:return s_(t,void 0);case 5:return ur(t,64);case 6:return ur(t,37)}else switch(n.TAG){case 0:return rd(t,n._1,n._2);case 1:return;case 2:return ur(t,64),ur(t,n._0)}}function Dn(t,n){let e=0,r,i,o,_,s,c;if(!(typeof n!="object"&&typeof n!="function")){switch(n.TAG){case 0:return Dn(t,n._0),eu(t,n._1);case 1:let a=n._1,u=n._0;if(a.TAG===0)return Dn(t,u),Ul(t,{MEL_EXN_ID:__,_1:o_(Dn,a._0)});Dn(t,u);let d=Ns(o_(Dn,a._0));return Js(t,d[0],d[1]);case 2:let h=n._0,y=0;if(typeof h!="object"&&typeof h!="function"||h.TAG!==0)y=3;else{let M=h._1;typeof M!="object"&&typeof M!="function"||M.TAG!==1?y=3:(r=h._0,i=M._1,o=n._1,e=1)}if(y===3)return Dn(t,h),Ki(t,n._1);break;case 3:let x=n._0,C=0;if(typeof x!="object"&&typeof x!="function"||x.TAG!==0)C=3;else{let M=x._1;typeof M!="object"&&typeof M!="function"||M.TAG!==1?C=3:(_=x._0,s=M._1,c=n._1,e=2)}if(C===3)return Dn(t,x),ur(t,n._1);break;case 4:let S=n._0,G=0;if(typeof S!="object"&&typeof S!="function"||S.TAG!==0)G=3;else{let M=S._1;typeof M!="object"&&typeof M!="function"||M.TAG!==1?G=3:(r=S._0,i=M._1,o=n._1,e=1)}if(G===3)return Dn(t,S),Ki(t,n._1);break;case 5:let D=n._0,j=0;if(typeof D!="object"&&typeof D!="function"||D.TAG!==0)j=3;else{let M=D._1;typeof M!="object"&&typeof M!="function"||M.TAG!==1?j=3:(_=D._0,s=M._1,c=n._1,e=2)}if(j===3)return Dn(t,D),ur(t,n._1);break;case 6:return Dn(t,n._0),b(n._1,t);case 7:return Dn(t,n._0),fr(t,void 0);case 8:throw Dn(t,n._0),new p("Invalid_argument",{MEL_EXN_ID:"Invalid_argument",_1:n._1})}switch(e){case 1:return Dn(t,r),si(t,i,o);case 2:return Dn(t,_),si(t,s,mt(bn(1,c)))}}}function An(t,n){let e=0,r,i,o,_,s,c;if(!(typeof n!="object"&&typeof n!="function")){switch(n.TAG){case 0:return An(t,n._0),eu(t,n._1);case 1:let a=n._1,u=n._0;if(a.TAG===0)return An(t,u),Ul(t,{MEL_EXN_ID:__,_1:o_(An,a._0)});An(t,u);let d=Ns(o_(An,a._0));return Js(t,d[0],d[1]);case 2:let h=n._0,y=0;if(typeof h!="object"&&typeof h!="function"||h.TAG!==0)y=3;else{let N=h._1;typeof N!="object"&&typeof N!="function"||N.TAG!==1?y=3:(r=h._0,i=N._1,o=n._1,e=1)}if(y===3)return An(t,h),Ki(t,n._1);break;case 3:let x=n._0,C=0;if(typeof x!="object"&&typeof x!="function"||x.TAG!==0)C=3;else{let N=x._1;typeof N!="object"&&typeof N!="function"||N.TAG!==1?C=3:(_=x._0,s=N._1,c=n._1,e=2)}if(C===3)return An(t,x),ur(t,n._1);break;case 4:let S=n._0,G=0;if(typeof S!="object"&&typeof S!="function"||S.TAG!==0)G=3;else{let N=S._1;typeof N!="object"&&typeof N!="function"||N.TAG!==1?G=3:(r=S._0,i=N._1,o=n._1,e=1)}if(G===3)return An(t,S),Ki(t,n._1);break;case 5:let D=n._0,j=0;if(typeof D!="object"&&typeof D!="function"||D.TAG!==0)j=3;else{let N=D._1;typeof N!="object"&&typeof N!="function"||N.TAG!==1?j=3:(_=D._0,s=N._1,c=n._1,e=2)}if(j===3)return An(t,D),ur(t,n._1);break;case 6:let M=n._0,O=0;if(typeof M!="object"&&typeof M!="function"||M.TAG!==0)O=3;else{let N=M._1;if(typeof N!="object"&&typeof N!="function")O=3;else{if(N.TAG===1)return An(t,M._0),si(t,N._1,b(n._1,void 0));O=3}}if(O===3)return An(t,M),Ki(t,b(n._1,void 0));break;case 7:return An(t,n._0),fr(t,void 0);case 8:throw An(t,n._0),new p("Invalid_argument",{MEL_EXN_ID:"Invalid_argument",_1:n._1})}switch(e){case 1:return An(t,r),si(t,i,o);case 2:return An(t,_),si(t,s,mt(bn(1,c)))}}}function md(t,n,e){return dt((function(r){return Dn(n,r),b(t,n)}),0,e._0)}function an(t){return function(n){return md((function(e){}),t,n)}}function dd(t,n){let e=bt(512),r=Or(e);return dt(function(o){return An(r,o),b(t,fd(e,r))},0,n._0)}function c_(t){return dd(U0,t)}function ru(t){fr(Ft.get(tu),void 0),fr(Ft.get(nu),void 0)}da(ru);Nl(function(t){ru();let n=Xl(Ks,void 0);Pl(Ks,{out_string:(function(r,i,o){return n_(r_,r,i,o)}),out_width:n.out_width,out_flush:(function(r){return e_(Yr,r_,r)}),out_newline:n.out_newline,out_spaces:n.out_spaces,out_indent:n.out_indent});let e=Xl(ai,void 0);Pl(ai,{out_string:(function(r,i,o){return n_(i_,r,i,o)}),out_width:e.out_width,out_flush:(function(r){return e_(Qr,i_,r)}),out_newline:e.out_newline,out_spaces:e.out_spaces,out_indent:e.out_indent})});function pd(t,n,e){return{source:t,line:n,column:e}}function hd(t){return t.line}function gd(t){return t.column}function bd(t){return t.source}var Ye={make:pd,get_line:hd,get_column:gd,get_source:bd};function Kn(t,n,e){return{loc_start:t.loc_start,loc_end:n.loc_end}}function nt(t,n,e){return t!==void 0?{loc_start:n,loc_end:t}:{loc_start:n,loc_end:n}}var yd={source:zs,line:0,column:0},Cd={source:zs,line:0,column:0},Ji={loc_start:yd,loc_end:Cd};function ou(t){return t.loc_start.source}function Sd(t){let n=Fs(t.loc_start.source),e=ut(t,Ji);if(n===void 0||e)return"";let r=t.loc_start.line===t.loc_end.line?t.loc_start.column===t.loc_end.column?$(c_({TAG:0,_0:{TAG:4,_0:3,_1:0,_2:0,_3:{TAG:12,_0:58,_1:{TAG:4,_0:3,_1:0,_2:0,_3:0}}},_1:"%i:%i"}),t.loc_start.line,t.loc_start.column):H(c_({TAG:0,_0:{TAG:4,_0:3,_1:0,_2:0,_3:{TAG:12,_0:58,_1:{TAG:4,_0:3,_1:0,_2:0,_3:{TAG:12,_0:45,_1:{TAG:4,_0:3,_1:0,_2:0,_3:0}}}}},_1:"%i:%i-%i"}),t.loc_start.line,t.loc_start.column,t.loc_end.column):ao(c_({TAG:0,_0:{TAG:4,_0:3,_1:0,_2:0,_3:{TAG:12,_0:58,_1:{TAG:4,_0:3,_1:0,_2:0,_3:{TAG:12,_0:45,_1:{TAG:4,_0:3,_1:0,_2:0,_3:{TAG:12,_0:58,_1:{TAG:4,_0:3,_1:0,_2:0,_3:0}}}}}}},_1:"%i:%i-%i:%i"}),t.loc_start.line,t.loc_start.column,t.loc_end.line,t.loc_end.column);return $(Kt({TAG:0,_0:{TAG:11,_0:"in file ",_1:{TAG:2,_0:0,_1:{TAG:12,_0:58,_1:{TAG:2,_0:0,_1:0}}}},_1:"in file %s:%s"}),n,r)}function _u(t,n){let e=Fs(n.loc_start.source),r=ut(n,Ji);if(e!==void 0&&!r)return b(an(t)({TAG:0,_0:{TAG:2,_0:0,_1:0},_1:"%s"}),b(Ui,Sd(n)))}var l_=Lt("Pinc_diagnostics.Pinc_error");function wd(t,n,e){let r=n.loc_start,i=n.loc_end,o=Ye.get_line(r),_=Ye.get_line(i),s=Ye.get_column(r),c=Ye.get_column(i),a=Ve(0,o-1|0),u=_+1|0,d=wa((function(x,C){return[x+a|0,C]}),Aa((function(x,C){let S=x+1|0;return S>=a?S<=u:!1}),Bo(10,e))),h=bt(400),y=Or(h);return we((function(x){let C=x[1],S=x[0];if(S>=o&&S<=_){let j=b(Kt({TAG:0,_0:{TAG:4,_0:0,_1:{TAG:0,_0:1,_1:4},_2:0,_3:0},_1:"%4d"}),S);b(an(y)({TAG:0,_0:{TAG:2,_0:0,_1:0},_1:"%s"}),Yo(!0,t,j))}else b(an(y)({TAG:0,_0:{TAG:4,_0:0,_1:{TAG:0,_0:1,_1:4},_2:0,_3:0},_1:"%4d"}),S);b(an(y)({TAG:0,_0:{TAG:12,_0:32,_1:{TAG:2,_0:0,_1:{TAG:12,_0:32,_1:0}}},_1:" %s "}),b(Ui,"\xE2\x94\x82"));let G={contents:!1},D=function(j){let M=S===o,O=j>=s,N=S>=o&&S<=_,rt=j>=s&&j<c,it=S===_,Q=j<c;return M&&!it&&O||N&&rt?!0:it&&!M?Q:!1};zi((function(j,M){let O=j+1|0;if(!D(O))return b(an(y)({TAG:0,_0:{TAG:0,_0:0},_1:"%c"}),M);let N=Fn(1,M);b(an(y)({TAG:0,_0:{TAG:2,_0:0,_1:0},_1:"%s"}),Yo(!0,t,N)),G.contents=!0}),C),G.contents&&t===void 0&&(s_(y,void 0),b(an(y)({TAG:0,_0:{TAG:11,_0:" ",_1:{TAG:2,_0:0,_1:{TAG:12,_0:32,_1:0}}},_1:" %s "}),b(Ui,"\xE2\x94\x82")),zi((function(j,M){return D(j+1|0)?an(y)({TAG:0,_0:{TAG:12,_0:94,_1:0},_1:"^"}):an(y)({TAG:0,_0:{TAG:12,_0:32,_1:0},_1:" "})}),C)),s_(y,void 0)}),d),K(h)}function rc(t,n,e){let r=Ia("NO_COLOR"),i=r!==void 0?r===""?t==="warning"?"Yellow":"Red":void 0:t==="warning"?"Yellow":"Red",o=t==="warning"?"WARNING":"ERROR";$(an(n)({TAG:0,_0:{TAG:18,_0:{TAG:1,_0:{TAG:0,_0:0,_1:""}},_1:{TAG:15,_0:{TAG:17,_0:0,_1:{TAG:12,_0:32,_1:0}}}},_1:"@[%a@] "}),(function(s){return function(c){return b(an(s)({TAG:0,_0:{TAG:2,_0:0,_1:0},_1:"%s"}),Yo(!0,i,c))}}),o),$(an(n)({TAG:0,_0:{TAG:18,_0:{TAG:1,_0:{TAG:0,_0:0,_1:""}},_1:{TAG:15,_0:{TAG:17,_0:0,_1:{TAG:17,_0:{TAG:0,_0:"@,",_1:0,_2:0},_1:0}}}},_1:"@[%a@]@,"}),_u,e);let _=Ko(ou(e));if(_!=="")return b(an(n)({TAG:0,_0:{TAG:17,_0:{TAG:0,_0:"@,",_1:0,_2:0},_1:{TAG:2,_0:0,_1:0}},_1:"@,%s"}),wd(i,e,_))}function xd(t,n){H(an(ai)({TAG:0,_0:{TAG:18,_0:{TAG:1,_0:{TAG:0,_0:{TAG:11,_0:"<v>",_1:0},_1:"<v>"}},_1:{TAG:17,_0:{TAG:0,_0:"@,",_1:0,_2:0},_1:{TAG:15,_0:{TAG:17,_0:{TAG:0,_0:"@,",_1:0,_2:0},_1:{TAG:2,_0:0,_1:{TAG:17,_0:{TAG:0,_0:"@,",_1:0,_2:0},_1:{TAG:17,_0:0,_1:0}}}}}}},_1:"@[<v>@,%a@,%s@,@]"}),(function(e,r){return rc("error",e,r)}),t,n)}function X(t,n){xd(t,n);let e=bt(1),r=Or(e);throw H(an(r)({TAG:0,_0:{TAG:18,_0:{TAG:1,_0:{TAG:0,_0:{TAG:11,_0:"<v>",_1:0},_1:"<v>"}},_1:{TAG:17,_0:{TAG:0,_0:"@,",_1:0,_2:0},_1:{TAG:15,_0:{TAG:17,_0:{TAG:0,_0:"@,",_1:0,_2:0},_1:{TAG:2,_0:0,_1:{TAG:17,_0:{TAG:0,_0:"@,",_1:0,_2:0},_1:{TAG:17,_0:0,_1:0}}}}}}},_1:"@[<v>@,%a@,%s@,@]"}),(function(i,o){return rc("error",i,o)}),t,n),new p(l_,{MEL_EXN_ID:l_,_1:K(e)})}function su(t,n){H(an(ai)({TAG:0,_0:{TAG:18,_0:{TAG:1,_0:{TAG:0,_0:{TAG:11,_0:"<v>",_1:0},_1:"<v>"}},_1:{TAG:17,_0:{TAG:0,_0:"@,",_1:0,_2:0},_1:{TAG:15,_0:{TAG:17,_0:{TAG:0,_0:"@,",_1:0,_2:0},_1:{TAG:2,_0:0,_1:{TAG:17,_0:{TAG:0,_0:"@,",_1:0,_2:0},_1:{TAG:17,_0:0,_1:0}}}}}}},_1:"@[<v>@,%a@,%s@,@]"}),(function(e,r){return rc("warning",e,r)}),t,n)}function cu(t,n){if(n.length!==1)throw new p(L,{MEL_EXN_ID:L,_1:"The Array.length function expects one argument (the array to compute the length of)."});let e=n[0],r;if(typeof e!="object"&&typeof e!="function")throw new p(L,{MEL_EXN_ID:L,_1:"The argument given to the Array.length function is not of type array"});if(e.TAG===5)r=e._0;else throw new p(L,{MEL_EXN_ID:L,_1:"The argument given to the Array.length function is not of type array"});return[t,{TAG:0,_0:r.length}]}function au(t,n){if(n.length!==2)throw new p(L,{MEL_EXN_ID:L,_1:"The Array.append function expects two arguments"});let e=n[0],r,i=0,o=0;if(typeof e!="object"&&typeof e!="function"||e.TAG!==5)o=2;else{let _=n[1];typeof _!="object"&&typeof _!="function"||_.TAG!==5?i=1:r=[e._0,_._0]}if(o===2){let _=n[1];if(typeof _!="object"&&typeof _!="function")i=1;else{if(_.TAG===5)throw new p(L,{MEL_EXN_ID:L,_1:"The first argument given to the Array.append function is not of type array"});i=1}}if(i===1)throw typeof e!="object"&&typeof e!="function"?new p(L,{MEL_EXN_ID:L,_1:"The Array.append function expects two arguments"}):e.TAG===5?new p(L,{MEL_EXN_ID:L,_1:"The second argument given to the Array.append function is not of type array"}):new p(L,{MEL_EXN_ID:L,_1:"The Array.append function expects two arguments"});return[t,{TAG:5,_0:Pa(r[0],r[1])}]}function lu(t,n){if(n.length!==3)throw new p(L,{MEL_EXN_ID:L,_1:"The Record.merge function expects exactly three arguments"});let e=n[0],r,i=0,o=0;if(typeof e!="object"&&typeof e!="function"||e.TAG!==10)o=2;else{let c=n[1];if(typeof c!="object"&&typeof c!="function"||c.TAG!==4)i=1;else{let a=n[2];r=[e._0,c._0,a]}}if(o===2){let c=n[1];if(typeof c!="object"&&typeof c!="function")i=1;else{if(c.TAG===4)throw new p(L,{MEL_EXN_ID:L,_1:"The first argument given to the Html.with_attribute function is not of type html element"});i=1}}if(i===1)throw typeof e!="object"&&typeof e!="function"?new p(L,{MEL_EXN_ID:L,_1:"The Record.merge function expects exactly three arguments"}):e.TAG===10?new p(L,{MEL_EXN_ID:L,_1:"The second argument given to the Html.with_attribute function is not of type string"}):new p(L,{MEL_EXN_ID:L,_1:"The Record.merge function expects exactly three arguments"});let _=r[0],s=H(Lr,r[1],r[2],_.attributes);return[t,{TAG:10,_0:{tag:_.tag,attributes:s,children:_.children}}]}function uu(t,n){if(n.length!==1)throw new p(L,{MEL_EXN_ID:L,_1:"The Math.floor function expects one argument (the number to floor)."});let e=n[0],r;if(typeof e!="object"&&typeof e!="function")throw new p(L,{MEL_EXN_ID:L,_1:"The argument given to the Math.floor function is not of type float or int"});switch(e.TAG){case 0:r=e._0;break;case 1:r=Math.floor(e._0)|0;break;default:throw new p(L,{MEL_EXN_ID:L,_1:"The argument given to the Math.floor function is not of type float or int"})}return[t,{TAG:0,_0:r}]}function fu(t,n){if(n.length!==2)throw new p(L,{MEL_EXN_ID:L,_1:"The Portal.push function expects exactly two arguments"});let e=n[0],r;if(typeof e!="object"&&typeof e!="function")throw new p(L,{MEL_EXN_ID:L,_1:"The first argument given to the Portal.push function is not of type string"});if(e.TAG===4){let D=n[1];r=[e._0,D]}else throw new p(L,{MEL_EXN_ID:L,_1:"The first argument given to the Portal.push function is not of type string"});let i=H(il,r[0],r[1],t.portals),o=t.declaration_render_path,_=t.stack,s=t.resolved_functions,c=t.globals,a=t.past_frames,u=t.current_frame,d=t.constants,h=t.declarations,y=t.tag_path,x=t.tag_meta,C=t.tag_data_provider,S=t.tag_meta_provider;return[{declaration_render_path:o,stack:_,resolved_functions:s,globals:c,past_frames:a,current_frame:u,constants:d,declarations:h,tag_path:y,tag_meta:x,tag_data_provider:C,tag_meta_provider:S,portals:i},0]}function mu(t,n){if(n.length!==2)throw new p(L,{MEL_EXN_ID:L,_1:"The Record.merge function expects two arguments"});let e=n[0],r,i=0,o=0;if(typeof e!="object"&&typeof e!="function"||e.TAG!==6)o=2;else{let _=n[1];if(typeof _!="object"&&typeof _!="function")throw new p(L,{MEL_EXN_ID:L,_1:"The Record.merge function expects two arguments"});if(_.TAG===6)r=[e._0,_._0];else throw new p(L,{MEL_EXN_ID:L,_1:"The Record.merge function expects two arguments"})}if(o===2){let _=n[1];if(typeof _!="object"&&typeof _!="function")i=1;else{if(_.TAG===6)throw new p(L,{MEL_EXN_ID:L,_1:"The first argument given to the Record.merge function is not of type record"});i=1}}if(i===1)throw typeof e!="object"&&typeof e!="function"?new p(L,{MEL_EXN_ID:L,_1:"The Record.merge function expects two arguments"}):e.TAG===5?new p(L,{MEL_EXN_ID:L,_1:"The second argument given to the Record.merge function is not of type record"}):new p(L,{MEL_EXN_ID:L,_1:"The Record.merge function expects two arguments"});return[t,{TAG:6,_0:H(sl,(function(_,s,c){return c}),r[0],r[1])}]}function pu(t,n){let e=t!==void 0?t:0;return{s:n,len:n.length,i:e}}var ic=Lt("Pinc_core__Utf8_string.Malformed");function hu(t,n,e,r){let i=function(s){throw new p(ic,{MEL_EXN_ID:ic,_1:s.s,_2:s.i})},o=function(s,c,a){let u=s!==void 0?s:0;if(c<1)throw new p("Assert_failure",{MEL_EXN_ID:"Assert_failure",_1:["lib/pinc_core/utf8_string.ml",55,4]});if((t.i+c|0)<t.len){let d=1,h=a;for(;;){let y=h,x=d,C=R(t.s,t.i+x|0);C>>>6!==2&&i(t),x===1&&u!==0&&(C&63)<u&&i(t);let S=y<<6|C&63;if(x===c)return No(S)?(t.i=(t.i+x|0)+1|0,b(n,S)):i(t);h=S,d=x+1|0}}else return i(t)};if(t.i>=t.len)return b(e,void 0);let _=R(t.s,t.i);return _>=225?_>=241?_>=245?i(t):o(void 0,3,_&7):_>=240?o(16,3,_&7):o(void 0,2,_&15):_>=194?_>=224?o(32,2,_&15):o(void 0,1,_&31):_>=128?i(t):(t.i=1+t.i|0,b(n,Po(_)))}function vd(t,n,e,r){let i=pu(t,r),o=function(_){return hu(i,(function(s){return o($(n,_,s))}),(function(s){return _}),void 0)};return o(e)}function oc(t,n){return Yt(vd(t!==void 0?t:0,(function(r,i){return{hd:i,tl:r}}),0,n))}function gu(t){let n=_t((function(i,o){let _=o;return i+(_<=127?1:_<=2047?2:_<=65535?3:_<=2097151?4:5)|0}),0,t);n>Mn&&hn("CCUtf8_string.of_list: string size limit exceeded");let e=bn(n,0),r={contents:0};if(we((function(i){let o=function(s){e[r.contents]=s,r.contents=r.contents+1|0},_=i;if(!No(_))throw new p("Assert_failure",{MEL_EXN_ID:"Assert_failure",_1:["lib/pinc_core/utf8_string.ml",117,2]});return _<=127?o(_):_<=2047?(o(192|_>>>6),o(128|_&63)):_<=65535?(o(224|_>>>12),o(128|_>>>6&63),o(128|_&63)):_<=2097151?(o(240|_>>>18),o(128|_>>>12&63),o(128|_>>>6&63),o(128|_&63)):(o(248|_>>>24),o(128|_>>>18&63),o(128|_>>>12&63),o(128|_>>>6&63),o(128|_&63))}),t),r.contents!==n)throw new p("Assert_failure",{MEL_EXN_ID:"Assert_failure",_1:["lib/pinc_core/utf8_string.ml",168,2]});return mt(e)}function jd(t){let n=Lt("Stop");try{let e=pu(void 0,t);for(;;)hu(e,(function(r){}),(function(r){throw new p(n,{MEL_EXN_ID:n})}),void 0);throw new p("Assert_failure",{MEL_EXN_ID:"Assert_failure",_1:["lib/pinc_core/utf8_string.ml",179,4]})}catch(e){let r=yt(e);if(r.MEL_EXN_ID===ic)return!1;if(r.MEL_EXN_ID===n)return!0;throw r}}function _c(t){return jd(t)?t:hn("CCUtf8_string.of_string_exn")}function bu(t,n){if(n.length!==1)throw new p(L,{MEL_EXN_ID:L,_1:"The String.length function expects one argument (the string to compute the length of)."});let e=n[0],r;if(typeof e!="object"&&typeof e!="function")throw new p(L,{MEL_EXN_ID:L,_1:"The argument given to the String.length function is not of type string"});if(e.TAG===4)r=e._0;else throw new p(L,{MEL_EXN_ID:L,_1:"The argument given to the String.length function is not of type string"});return[t,{TAG:0,_0:r.length}]}function yu(t,n){if(n.length!==1)throw new p(L,{MEL_EXN_ID:L,_1:"The `String.characters` function must recieve one argument (string)."});let e=n[0],r;if(typeof e!="object"&&typeof e!="function")throw new p(L,{MEL_EXN_ID:L,_1:"The first argument given to `String.characters` is not of type string"});if(e.TAG===4)r=e._0;else throw new p(L,{MEL_EXN_ID:L,_1:"The first argument given to `String.characters` is not of type string"});let i=Pi(gn((function(o){return{TAG:3,_0:o}}),oc(void 0,_c(r))));return[t,{TAG:5,_0:i}]}function Cu(t,n){if(n.length!==3)throw new p(L,{MEL_EXN_ID:L,_1:"The String.sub function must recieve three arguments (string, offset, length)."});let e=n[0],r,i=0,o=0;if(typeof e!="object"&&typeof e!="function"||e.TAG!==4)o=2;else{let s=n[1];if(typeof s!="object"&&typeof s!="function"||s.TAG!==0)i=1;else{let c=n[2];typeof c!="object"&&typeof c!="function"||c.TAG!==0?i=1:r=[e._0,s._0,c._0]}}if(o===2){let s=n[1];if(typeof s!="object"&&typeof s!="function"||s.TAG!==0)i=1;else{let c=n[2];if(typeof c!="object"&&typeof c!="function")i=1;else{if(c.TAG===0)throw new p(L,{MEL_EXN_ID:L,_1:"The first argument given to `String.sub` is not of type string"});i=1}}}if(i===1){if(typeof e!="object"&&typeof e!="function")throw new p(L,{MEL_EXN_ID:L,_1:"The String.sub function must recieve three arguments (string, offset, length)."});if(e.TAG===4){let s=n[1],c=0,a=n[2];if(typeof a!="object"&&typeof a!="function")c=2;else{if(a.TAG===0)throw new p(L,{MEL_EXN_ID:L,_1:"The second argument (offset) given to `String.sub` is not of type int"});c=2}if(c===2)throw typeof s!="object"&&typeof s!="function"?new p(L,{MEL_EXN_ID:L,_1:"The String.sub function must recieve three arguments (string, offset, length)."}):s.TAG===0?new p(L,{MEL_EXN_ID:L,_1:"The third argument (length) given to `String.sub` is not of type int"}):new p(L,{MEL_EXN_ID:L,_1:"The String.sub function must recieve three arguments (string, offset, length)."})}else throw new p(L,{MEL_EXN_ID:L,_1:"The String.sub function must recieve three arguments (string, offset, length)."})}let _=gu($a(r[2],Ta(r[1],oc(void 0,_c(r[0])))));return[t,{TAG:4,_0:_}]}var Su=[["pinc_array_length",[1,cu]],["pinc_array_append",[2,au]],["pinc_string_length",[1,bu]],["pinc_string_characters",[1,yu]],["pinc_string_sub",[3,Cu]],["pinc_record_merge",[2,mu]],["pinc_html_with_attribute",[3,lu]],["pinc_math_floor",[1,uu]],["pinc_portal_push",[2,fu]]];function wu(t){return Oa((function(n){return t===n[0]}),Su)}var Id=Ni((function(t){return t[1]}),Su);function xu(t){return Gt(Id,t)[0]}function Dd(t){if(typeof t!="object"&&typeof t!="function")switch(t){case 0:return 22;case 1:return 0;case 2:return 2;case 3:return 3;case 4:return 4;case 5:return 5;case 6:return 6;case 7:return 7;case 8:return 8;case 9:return 9;case 10:return 10;case 11:return 11;case 12:return 12;case 13:return 13;case 14:return 14;case 15:return 15;case 16:return 16;case 17:return 17;case 18:return 18;case 19:return 19;case 20:return 25;case 21:return 26;case 22:return 28;case 23:return 29;case 24:return 30;case 25:return 31;case 26:return 33;case 27:return 36;case 28:return 41;case 29:return 42;case 30:return 43;case 31:return 47;case 32:return 254}else switch(t.TAG){case 0:return 1;case 1:return 20;case 2:return 21;case 3:return 23;case 4:return 24;case 5:return 27;case 6:return 32;case 7:return 34;case 8:return 35;case 9:return 38;case 10:return 39;case 11:return 40;case 12:return 44;case 13:return 46;case 14:return 45}}function Nd(t){if(typeof t!="object"&&typeof t!="function")return 0;switch(t.TAG){case 10:return 8;case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 11:return 4;case 12:case 13:return 2;case 14:return 5}}function u_(t,n,e){return Ra(t,n,e),n+4|0}function f_(t){let n=1+Nd(t)|0,e=Tt(n);Ut(e,0,Dd(t));let r=1,i=0;if(!(typeof t!="object"&&typeof t!="function"))switch(t.TAG){case 10:let o=t._0;r=u_(e,r,o[0]),r=u_(e,r,o[1]);break;case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 11:i=1;break;case 12:case 13:i=2;break;case 14:let _=t._0;Ut(e,r,_[0]),r=r+1|0,r=u_(e,r,_[1]);break}switch(i){case 1:r=u_(e,r,t._0);break;case 2:Ha(e,r,t._0),r=r+2|0;break}return e}function Eu(t,n){return t!==void 0?wt(t):n}function $u(t){if(t!==void 0)return wt(t);throw new p("Invalid_argument",{MEL_EXN_ID:"Invalid_argument",_1:"option is None"})}function Jt(t,n){if(t!==void 0)return b(n,wt(t))}function En(t,n){if(n!==void 0)return F(b(t,wt(n)))}function Pd(t,n,e){let r={contents:n},i=En((function(o){let _=$(e,r.contents,o);return r.contents=_[0],_[1]}),t);return[r.contents,i]}var m_={fold_map:Pd};function Xd(t,n,e){let r={contents:n},i=gn((function(o){let _=$(e,r.contents,o);return r.contents=_[0],_[1]}),t);return[r.contents,i]}function Bd(t){for(;;){let n=t;if(n){if(!n.tl)return n.hd;t=n.tl;continue}throw new p(L,{MEL_EXN_ID:L,_1:"List.last_exn"})}}function Od(t,n){return Yt(_t(function(r,i){return xa(b(t,i),r)?r:{hd:i,tl:r}},0,n))}var he={fold_map:Xd,last_exn:Bd,uniq:Od};function qd(t){return t>=14?t===32:t>=9}var Tu={is_whitespace:qd};function Fd(t,n){try{return Ot(n,t,n.length-t|0)}catch(e){let r=yt(e);if(r.MEL_EXN_ID===L)return"";throw r}}function zd(t,n){let e=Lt("Found");try{zi((function(r,i){if(b(n,i))throw new p(e,{MEL_EXN_ID:e,_1:r})}),t);return}catch(r){let i=yt(r);if(i.MEL_EXN_ID===e)return i._1;throw i}}function Vd(t){let n=t.length,e=0;for(;(function(){let i=!1;if(e<n){let o=t.charCodeAt(e);i=o>=14?o===32:o>=9}return i})();)e=e+1|0;let r=n-1|0;return r>=e?Ot(t,e,(r-e|0)+1|0):As}function Hd(t){let e=t.length-1|0;for(;(function(){let r=!1;if(e>=0){let i=t.charCodeAt(e);r=i>=14?i===32:i>=9}return r})();)e=e-1|0;return e>=0?Ot(t,0,(e-0|0)+1|0):As}function Rd(t){let n=function(i){return Bi(i<10?48+i|0:(97+i|0)-10|0)},e=t.length,r=Tt(e<<1);for(let i=0;i<e;++i){let o=R(t,i);r[i<<1]=n(o>>>4),r[(i<<1)+1|0]=n(o&15)}return mt(r)}function Ud(t){let n=function(r){return r>=65?r>=97?r>=103?hn("String.of_hex"):(r-97|0)+10|0:r>=71?hn("String.of_hex"):(r-65|0)+10|0:r>57||r<48?hn("String.of_hex"):r-48|0},e=function(r){return(n(R(t,r))<<4)+n(R(t,r+1|0))|0};return Qa(t.length>>1,(function(r){return Bi(e(r<<1))}))}var qr={drop_first:Fd,find_index:zd,trim_left:Vd,trim_right:Hd,to_hex:Rd,of_hex:Ud};var mC=Number.NaN,dC=R_([2146435072,1]);function ve(t,n){if(typeof n!="object"&&typeof n!="function")return Nt(t,0);switch(n.TAG){case 0:return Nt(t,1),Ho(t,On(n._0));case 1:return Nt(t,2),Ho(t,ta(n._0));case 2:return n._0?Nt(t,3):Nt(t,4);case 3:return Nt(t,5),Ho(t,On(n._0));case 4:let e=n._0,r=e.length;return Nt(t,6),qt(t,r),Dt(t,e);case 5:let i=n._0,o=i.length;return Nt(t,7),qt(t,o),se((function(c){return ve(t,c)}),i);case 6:let _=n._0,s=b(ni,_);return Nt(t,8),qt(t,s),$(ar,(function(c,a){let u=c.length;qt(t,u),Dt(t,c),ve(t,a)}),_);case 7:return Gu(t,n._0);case 8:return Jd(t,n._0);case 9:return Zd(t,n._0);case 10:return tp(t,n._0);case 11:return ep(t,n._0);case 12:return rp(t,n._0);case 13:throw new p("Assert_failure",{MEL_EXN_ID:"Assert_failure",_1:["lib/pinc_types/Value.ml",209,32]});case 14:return np(t,n._0)}}function Gu(t,n){let e=n.num_locals,r=n.num_parameters,i=n.instructions;Nt(t,9),qt(t,e),qt(t,r),qt(t,i.length),se((function(o){let _=f_(o);Vo(t,_)}),i)}function Zd(t,n){let e=n.builtin_num_parameters,r=n.builtin_fn_index;Nt(t,10),qt(t,e),qt(t,r)}function Jd(t,n){let e=n.fn,r=n.free_variables,i=r.length;Nt(t,11),qt(t,i),se((function(o){return ve(t,o)}),r),Gu(t,e)}function tp(t,n){let e=n.tag,r=n.attributes,i=n.children;Nt(t,12);let o=e.length;Nt(t,o),Dt(t,e);let _=b(ni,r);qt(t,_),$(ar,(function(c,a){let u=c.length;qt(t,u),Dt(t,c),ve(t,a)}),r);let s=i.length;qt(t,s),se((function(c){return ve(t,c)}),i)}function np(t,n){let e=n.portal_name,r=n.portal_attributes;Nt(t,15);let i=e.length;Nt(t,i),Dt(t,e);let o=b(ni,r);qt(t,o),$(ar,(function(_,s){let c=_.length;qt(t,c),Dt(t,_),ve(t,s)}),r)}function ep(t,n){Nt(t,13);let e=n.length;qt(t,e),se((function(r){return ve(t,r)}),n)}function rp(t,n){let e=n.name,r=n.subtree;Nt(t,14);let i=e.length;Nt(t,i),Dt(t,e),ve(t,r)}function vu(t,n){let e=f_(n);Vo(t,e)}function op(t){let n=bt(65565),e=t.constants,r=e.length;return qt(n,r),se((function(i){return ve(n,i)}),e),qt(n,t.instructions.length),se((function(i){return vu(n,i)}),t.instructions),qt(n,t.meta_instructions.length),se((function(i){return vu(n,i)}),t.meta_instructions),K(n)}function sc(t){let n=bt(65565);return $(ar,(function(e,r){r.kind===0?Nt(n,0):Nt(n,1),js(n,r.id),js(n,e.length),Dt(n,e);let o=op(r);qt(n,o.length),Dt(n,o)}),t),K(n)}var CC=vt(1e3,0);function ku(t){let n=B_("CamlOO");return t[1]=n,t}var sp=(function(t){var n=new Array(t);return n.TAG=248,n});function cp(t){let n=0;for(let e=0,r=t.length;e<r;++e)n=Math.imul(223,n)+R(t,e)|0;return n=n&2147483647,n>1073741823?n- -2147483648|0:n}var ap=Xe,Nu={compare:ap};function ui(t){return typeof t!="object"&&typeof t!="function"?0:t.h}function je(t,n,e,r){let i=ui(t),o=ui(r);return{TAG:0,l:t,v:n,d:e,r,h:i>=o?i+1|0:o+1|0}}function Mu(t,n,e,r){let i;i=typeof t!="object"&&typeof t!="function"?0:t.h;let o;if(o=typeof r!="object"&&typeof r!="function"?0:r.h,i>(o+2|0)){if(typeof t!="object"&&typeof t!="function")throw new p("Invalid_argument",{MEL_EXN_ID:"Invalid_argument",_1:"Map.bal"});let u=t.r,d=t.d,h=t.v,y=t.l;if(ui(y)>=ui(u))return je(y,h,d,je(u,n,e,r));if(!(typeof u!="object"&&typeof u!="function"))return je(je(y,h,d,u.l),u.v,u.d,je(u.r,n,e,r));throw new p("Invalid_argument",{MEL_EXN_ID:"Invalid_argument",_1:"Map.bal"})}if(o<=(i+2|0))return{TAG:0,l:t,v:n,d:e,r,h:i>=o?i+1|0:o+1|0};if(typeof r!="object"&&typeof r!="function")throw new p("Invalid_argument",{MEL_EXN_ID:"Invalid_argument",_1:"Map.bal"});let _=r.r,s=r.d,c=r.v,a=r.l;if(ui(_)>=ui(a))return je(je(t,n,e,a),c,s,_);if(!(typeof a!="object"&&typeof a!="function"))return je(je(t,n,e,a.l),a.v,a.d,je(a.r,c,s,_));throw new p("Invalid_argument",{MEL_EXN_ID:"Invalid_argument",_1:"Map.bal"})}function cc(t,n,e){if(typeof e!="object"&&typeof e!="function")return{TAG:0,l:0,v:t,d:n,r:0,h:1};let r=e.r,i=e.d,o=e.v,_=e.l,s=$(Nu.compare,t,o);if(s===0)return i===n?e:{TAG:0,l:_,v:t,d:n,r,h:e.h};if(s<0){let a=cc(t,n,_);return _===a?e:Mu(a,o,i,r)}let c=cc(t,n,r);return r===c?e:Mu(_,o,i,c)}function lp(t,n){for(;;){let e=n;if(typeof e!="object"&&typeof e!="function")throw new p(pt,{MEL_EXN_ID:pt});let r=$(Nu.compare,t,e.v);if(r===0)return e.d;n=r<0?e.l:e.r}}var up=Xe,fp={compare:up};function fi(t){return typeof t!="object"&&typeof t!="function"?0:t.h}function ke(t,n,e,r){let i=fi(t),o=fi(r);return{TAG:0,l:t,v:n,d:e,r,h:i>=o?i+1|0:o+1|0}}function Iu(t,n,e,r){let i;i=typeof t!="object"&&typeof t!="function"?0:t.h;let o;if(o=typeof r!="object"&&typeof r!="function"?0:r.h,i>(o+2|0)){if(typeof t!="object"&&typeof t!="function")throw new p("Invalid_argument",{MEL_EXN_ID:"Invalid_argument",_1:"Map.bal"});let u=t.r,d=t.d,h=t.v,y=t.l;if(fi(y)>=fi(u))return ke(y,h,d,ke(u,n,e,r));if(!(typeof u!="object"&&typeof u!="function"))return ke(ke(y,h,d,u.l),u.v,u.d,ke(u.r,n,e,r));throw new p("Invalid_argument",{MEL_EXN_ID:"Invalid_argument",_1:"Map.bal"})}if(o<=(i+2|0))return{TAG:0,l:t,v:n,d:e,r,h:i>=o?i+1|0:o+1|0};if(typeof r!="object"&&typeof r!="function")throw new p("Invalid_argument",{MEL_EXN_ID:"Invalid_argument",_1:"Map.bal"});let _=r.r,s=r.d,c=r.v,a=r.l;if(fi(_)>=fi(a))return ke(ke(t,n,e,a),c,s,_);if(!(typeof a!="object"&&typeof a!="function"))return ke(ke(t,n,e,a.l),a.v,a.d,ke(a.r,c,s,_));throw new p("Invalid_argument",{MEL_EXN_ID:"Invalid_argument",_1:"Map.bal"})}function ac(t,n,e){if(typeof e!="object"&&typeof e!="function")return{TAG:0,l:0,v:t,d:n,r:0,h:1};let r=e.r,i=e.d,o=e.v,_=e.l,s=$(fp.compare,t,o);if(s===0)return i===n?e:{TAG:0,l:_,v:t,d:n,r,h:e.h};if(s<0){let a=ac(t,n,_);return _===a?e:Iu(a,o,i,r)}let c=ac(t,n,r);return r===c?e:Iu(_,o,i,c)}var mp=Pe,dp={compare:mp};function mi(t){return typeof t!="object"&&typeof t!="function"?0:t.h}function Me(t,n,e,r){let i=mi(t),o=mi(r);return{TAG:0,l:t,v:n,d:e,r,h:i>=o?i+1|0:o+1|0}}function Lu(t,n,e,r){let i;i=typeof t!="object"&&typeof t!="function"?0:t.h;let o;if(o=typeof r!="object"&&typeof r!="function"?0:r.h,i>(o+2|0)){if(typeof t!="object"&&typeof t!="function")throw new p("Invalid_argument",{MEL_EXN_ID:"Invalid_argument",_1:"Map.bal"});let u=t.r,d=t.d,h=t.v,y=t.l;if(mi(y)>=mi(u))return Me(y,h,d,Me(u,n,e,r));if(!(typeof u!="object"&&typeof u!="function"))return Me(Me(y,h,d,u.l),u.v,u.d,Me(u.r,n,e,r));throw new p("Invalid_argument",{MEL_EXN_ID:"Invalid_argument",_1:"Map.bal"})}if(o<=(i+2|0))return{TAG:0,l:t,v:n,d:e,r,h:i>=o?i+1|0:o+1|0};if(typeof r!="object"&&typeof r!="function")throw new p("Invalid_argument",{MEL_EXN_ID:"Invalid_argument",_1:"Map.bal"});let _=r.r,s=r.d,c=r.v,a=r.l;if(mi(_)>=mi(a))return Me(Me(t,n,e,a),c,s,_);if(!(typeof a!="object"&&typeof a!="function"))return Me(Me(t,n,e,a.l),a.v,a.d,Me(a.r,c,s,_));throw new p("Invalid_argument",{MEL_EXN_ID:"Invalid_argument",_1:"Map.bal"})}function lc(t,n,e){if(typeof e!="object"&&typeof e!="function")return{TAG:0,l:0,v:t,d:n,r:0,h:1};let r=e.r,i=e.d,o=e.v,_=e.l,s=$(dp.compare,t,o);if(s===0)return i===n?e:{TAG:0,l:_,v:t,d:n,r,h:e.h};if(s<0){let a=lc(t,n,_);return _===a?e:Lu(a,o,i,r)}let c=lc(t,n,r);return r===c?e:Lu(_,o,i,c)}var pp={v:0};function Pu(t){return t<=2?t:Pu((t+1|0)/2|0)<<1}function Du(t){ka(pp);let n=t.length,e=vt((n<<1)+2|0,0);Zt(e,0,n),Zt(e,1,((Pu(n)<<5)/8|0)-1|0);for(let r=0;r<n;++r)Zt(e,(r<<1)+3|0,Gt(t,r));return{size:2,methods:e,methods_by_name:0,methods_by_label:0,previous_states:0,hidden_meths:0,vars:0,initializers:0}}function hp(t,n){let e=t.methods.length;if(n<=e)return;let r=vt(n,0);cr(t.methods,0,r,0,e),t.methods=r}var gp={v:0};function bp(t){let n=t.size;return t.size=n+1|0,n}function Xu(t,n){try{return $(lp,n,t.vars)}catch(e){let r=yt(e);if(r.MEL_EXN_ID===pt){let i=bp(t);return n!==""&&(t.vars=H(cc,n,i,t.vars)),i}throw r}}function Bu(t){if(t===0)return Du([]);let n=Ni(cp,t),e=Du(n);return Ba((function(r,i){let o=(r<<1)+2|0;e.methods_by_name=H(ac,i,o,e.methods_by_name),e.methods_by_label=H(lc,o,!0,e.methods_by_label)}),t),e}function Ou(t){ls(gp,t.size-1|0),t.initializers=Yt(t.initializers),hp(t,3+((Gt(t.methods,1)<<4)/32|0)|0)}function qu(t,n){if(t)return t;let e=sp(n.size);return e[0]=n.methods,ku(e)}var uc={TAG:0,key:void 0,data:void 0,next:void 0};function Cp(t){let n={contents:void 0};if(!uc.key){let i=Bu(0),o=Xu(i,"x"),_=function(s){let c=qu(void 0,i);return c[o]=s[1],c};Ou(i),uc.key=_}let e=[void 0,n],r=b(uc.key,e);return n.contents=F(r),{TAG:0,_0:r}}function Sp(t,n,e){if(n.TAG!==ms)return vt(t,n);let r=vt(t,e);return gs(r,0,t,n),r}function Fu(t,n){if(t.TAG!==jo)return hs(t);let e=t.length,r=vt(e,n);for(let i=0;i<e;++i)r[i]=t[i];return r}function wp(t,n){return t.TAG!==jo?t:Fu(t,n)}var Fr=Lt("Stdlib.Dynarray.Dummy.Array.Dummy_found");function xp(t,n){let e=t.length;if(e===0||Gt(t,0).TAG!==ms){for(let i=0;i<e;++i)if(t[i]===n)throw new p(Fr,{MEL_EXN_ID:Fr,_1:i});return t}let r=vt(e,Gt(t,0));for(let i=1;i<e;++i){let o=t[i];if(o===n)throw new p(Fr,{MEL_EXN_ID:Fr,_1:i});r[i]=o}return r}function Ap(t,n,e){let r=vt(t,e);for(let i=0;i<t;++i)r[i]=b(n,i);return r}function Ep(t,n,e,r,i){if(t.TAG!==jo)return cr(t,n,e,r,i);for(let o=0;o<i;++o)Zt(e,r+o|0,Gt(t,n+o|0))}function $p(t,n,e,r,i,o,_){if(n===i)return cr(t,e,r,o,_);if(_<0||e<0||(e+_|0)<0||(e+_|0)>t.length||o<0||(o+_|0)<0||(o+_|0)>r.length)throw new p("Assert_failure",{MEL_EXN_ID:"Assert_failure",_1:["./dynarray.cppo.ml",351,13]});if(t===r)throw new p("Assert_failure",{MEL_EXN_ID:"Assert_failure",_1:["./dynarray.cppo.ml",364,8]});for(let s=0;s<_;++s){let c=t[e+s|0];if(c===n)throw new p(Fr,{MEL_EXN_ID:Fr,_1:e+s|0});r[o+s|0]=c}}function Tp(t,n){return Xa(t,0,n)}function Gp(t,n,e,r){let i=vt(r,e);return cr(t,0,i,0,n),i}var vp={make:Sp,init:Ap,copy_from_array:Fu,unsafe_nocopy_from_array:wp,Dummy_found:Fr,unsafe_nocopy_to_array:xp,blit_array:Ep,blit:$p,prefix:Tp,extend:Gp},jp=Cp();function kp(t,n,e){return e===0?$(We(hn,{TAG:0,_0:{TAG:11,_0:"Dynarray.",_1:{TAG:2,_0:0,_1:{TAG:11,_0:": index ",_1:{TAG:4,_0:0,_1:0,_2:0,_3:{TAG:11,_0:" out of bounds (empty dynarray)",_1:0}}}}},_1:"Dynarray.%s: index %d out of bounds (empty dynarray)"}),t,n):H(We(hn,{TAG:0,_0:{TAG:11,_0:"Dynarray.",_1:{TAG:2,_0:0,_1:{TAG:11,_0:": index ",_1:{TAG:4,_0:0,_1:0,_2:0,_3:{TAG:11,_0:" out of bounds (0..",_1:{TAG:4,_0:0,_1:0,_2:0,_3:{TAG:12,_0:41,_1:0}}}}}}},_1:"Dynarray.%s: index %d out of bounds (0..%d)"}),t,n,e-1|0)}function Mp(t,n){return $(We(hn,{TAG:0,_0:{TAG:11,_0:"Dynarray.",_1:{TAG:2,_0:0,_1:{TAG:11,_0:": negative capacity ",_1:{TAG:4,_0:0,_1:0,_2:0,_3:{TAG:11,_0:" requested",_1:0}}}}},_1:"Dynarray.%s: negative capacity %d requested"}),t,n)}function Ip(t,n){return H(We(hn,{TAG:0,_0:{TAG:11,_0:"Dynarray.",_1:{TAG:2,_0:0,_1:{TAG:11,_0:": cannot grow to requested length ",_1:{TAG:4,_0:0,_1:0,_2:0,_3:{TAG:11,_0:" (max_array_length is ",_1:{TAG:4,_0:0,_1:0,_2:0,_3:{TAG:12,_0:41,_1:0}}}}}}},_1:"Dynarray.%s: cannot grow to requested length %d (max_array_length is %d)"}),t,n,Kr)}var zu="Invalid dynarray (unsynchronized concurrent length change)";function Lp(t,n){return H(We(hn,{TAG:0,_0:{TAG:2,_0:0,_1:{TAG:11,_0:": missing element at position ",_1:{TAG:4,_0:0,_1:0,_2:0,_3:{TAG:11,_0:" < length ",_1:{TAG:4,_0:0,_1:0,_2:0,_3:0}}}}},_1:"%s: missing element at position %d < length %d"}),zu,t,n)}function Dp(t,n){return H(We(hn,{TAG:0,_0:{TAG:2,_0:0,_1:{TAG:11,_0:": length ",_1:{TAG:4,_0:0,_1:0,_2:0,_3:{TAG:11,_0:" > capacity ",_1:{TAG:4,_0:0,_1:0,_2:0,_3:0}}}}},_1:"%s: length %d > capacity %d"}),zu,t,n)}function Np(t,n,e){return H(We(hn,{TAG:0,_0:{TAG:11,_0:"Dynarray.",_1:{TAG:2,_0:0,_1:{TAG:11,_0:": a length change from ",_1:{TAG:4,_0:0,_1:0,_2:0,_3:{TAG:11,_0:" to ",_1:{TAG:4,_0:0,_1:0,_2:0,_3:{TAG:11,_0:" occurred during iteration",_1:0}}}}}}},_1:"Dynarray.%s: a length change from %d to %d occurred during iteration"}),t,n,e)}function Pp(t,n,e){let r=n.length;if(e!==r)return Np(t,e,r)}function p_(t){return{length:0,arr:[],dummy:jp._0}}function fc(t,n,e){let r=t.length,i=t.arr;return n>=r?kp("set",n,r):Zt(i,n,e)}function Vu(t){let n=t.length-1|0;if(n>=0)return t.length=n,Zt(t.arr,n,t.dummy)}function Xp(t){let n=t<=512?t<<1:t+(t/2|0)|0;return Qc(8>n?8:n,Kr)}function mc(t,n){let e=t.arr,r=e.length;if(n<0)return Mp("ensure_capacity",n);if(r>=n)return;n>Kr&&Ip("ensure_capacity",n);let i=O_(Xp(r),n);if(i<=0)throw new p("Assert_failure",{MEL_EXN_ID:"Assert_failure",_1:["./dynarray.cppo.ml",685,4]});let o=vp.extend(e,t.length,t.dummy,i);if(t.arr=o,0>n)throw new p("Assert_failure",{MEL_EXN_ID:"Assert_failure",_1:["./dynarray.cppo.ml",690,4]});if(!(n<=o.length))throw new p("Assert_failure",{MEL_EXN_ID:"Assert_failure",_1:["./dynarray.cppo.ml",691,4]})}function Bp(t,n){mc(t,t.length+n|0)}function dc(t,n){let e=t.length,r=t.arr;if(!(!(e>=r.length)&&(t.length=e+1|0,r[e]=n,!0)))for(;;){Bp(t,1);let i=t.length,o=t.arr;if(!(i>=o.length)&&(t.length=i+1|0,o[i]=n,!0))return}}function zr(t){let n=t.length,e=t.arr,r=t.dummy,i=e.length;n>i&&Dp(n,i);let o=Di(n,(function(_){let s=e[_];return s===r?Lp(_,n):s}));return Pp("to_array",t,n),o}var h_={offset:0,instruction:0};function qp(t,n){let r={hd:{instructions:p_(),last_instruction:h_,previous_instruction:h_,loop_level:0,break_instructions:0,continue_instructions:0},tl:0},i=p_();mc(i,2048);let o=cl();return{constants:i,symbol_table:o,frames:r,declaration_ids:t}}function ge(t){let n=t.frames;if(n)return n.hd;throw new p("Assert_failure",{MEL_EXN_ID:"Assert_failure",_1:["lib/pinc_compiler/compiler.ml",45,10]})}function di(t){return ge(t).last_instruction.offset}function Fp(t,n,e){let r=t.frames;if(r){let i=r.hd,o=i.instructions,_={offset:n,instruction:e},s=i.last_instruction,c=i.loop_level,a=i.break_instructions,u=i.continue_instructions,d={instructions:o,last_instruction:_,previous_instruction:s,loop_level:c,break_instructions:a,continue_instructions:u};return{constants:t.constants,symbol_table:t.symbol_table,frames:{hd:d,tl:r.tl},declaration_ids:t.declaration_ids}}throw new p("Assert_failure",{MEL_EXN_ID:"Assert_failure",_1:["lib/pinc_compiler/compiler.ml",66,10]})}function g_(t,n,e){let r=t.frames;if(r)return fc(r.hd.instructions,n,e),t;throw new p("Assert_failure",{MEL_EXN_ID:"Assert_failure",_1:["lib/pinc_compiler/compiler.ml",80,10]})}function no(t){let n=t.frames;if(n){let e=n.hd;Vu(e.instructions);let r=e.instructions,i=e.previous_instruction,o=e.previous_instruction,_=e.loop_level,s=e.break_instructions,c=e.continue_instructions,a={instructions:r,last_instruction:i,previous_instruction:o,loop_level:_,break_instructions:s,continue_instructions:c};return{constants:t.constants,symbol_table:t.symbol_table,frames:{hd:a,tl:n.tl},declaration_ids:t.declaration_ids}}throw new p("Assert_failure",{MEL_EXN_ID:"Assert_failure",_1:["lib/pinc_compiler/compiler.ml",88,10]})}function Vr(t,n){return ge(t).last_instruction.instruction===n}function zp(t){let n=t.frames;if(n){let e=n.hd,r=e.instructions,i=e.last_instruction,o=e.previous_instruction,_=e.loop_level+1|0,s=e.break_instructions,c=e.continue_instructions,a={instructions:r,last_instruction:i,previous_instruction:o,loop_level:_,break_instructions:s,continue_instructions:c};return{constants:t.constants,symbol_table:t.symbol_table,frames:{hd:a,tl:n.tl},declaration_ids:t.declaration_ids}}throw new p("Assert_failure",{MEL_EXN_ID:"Assert_failure",_1:["lib/pinc_compiler/compiler.ml",102,10]})}function Vp(t){let n=t.frames;if(n){let e=n.hd,r=e.instructions,i=e.last_instruction,o=e.previous_instruction,_=e.loop_level-1|0,s=e.break_instructions,c=e.continue_instructions,a={instructions:r,last_instruction:i,previous_instruction:o,loop_level:_,break_instructions:s,continue_instructions:c};return{constants:t.constants,symbol_table:t.symbol_table,frames:{hd:a,tl:n.tl},declaration_ids:t.declaration_ids}}throw new p("Assert_failure",{MEL_EXN_ID:"Assert_failure",_1:["lib/pinc_compiler/compiler.ml",110,10]})}function pc(t){let n=t.frames;if(n)return n.hd.loop_level;throw new p("Assert_failure",{MEL_EXN_ID:"Assert_failure",_1:["lib/pinc_compiler/compiler.ml",118,10]})}function Hp(t,n,e){let r=t.frames;if(r){let i=r.hd,o=i.instructions,_=i.last_instruction,s=i.previous_instruction,c=i.loop_level,a={hd:[n,e],tl:i.break_instructions},u=i.continue_instructions,d={instructions:o,last_instruction:_,previous_instruction:s,loop_level:c,break_instructions:a,continue_instructions:u};return{constants:t.constants,symbol_table:t.symbol_table,frames:{hd:d,tl:r.tl},declaration_ids:t.declaration_ids}}throw new p("Assert_failure",{MEL_EXN_ID:"Assert_failure",_1:["lib/pinc_compiler/compiler.ml",124,10]})}function Rp(t,n,e){let r=t.frames;if(r){let i=r.hd,o=i.instructions,_=i.last_instruction,s=i.previous_instruction,c=i.loop_level,a=i.break_instructions,u={hd:[n,e],tl:i.continue_instructions},d={instructions:o,last_instruction:_,previous_instruction:s,loop_level:c,break_instructions:a,continue_instructions:u};return{constants:t.constants,symbol_table:t.symbol_table,frames:{hd:d,tl:r.tl},declaration_ids:t.declaration_ids}}throw new p("Assert_failure",{MEL_EXN_ID:"Assert_failure",_1:["lib/pinc_compiler/compiler.ml",134,10]})}function Up(t,n,e){let r=pc(t),i=function(_,s,c){let a=c[1],u=c[0];if(r===a){fc(_.instructions,u,{TAG:1,_0:s});return}else return[u,a]},o=t.frames;if(o){let _=o.hd,c=Go(function(S){return i(_,n,S)},_.continue_instructions),u=Go(function(S){return i(_,e,S)},_.break_instructions),d=_.instructions,h=_.last_instruction,y=_.previous_instruction,x=_.loop_level,C={instructions:d,last_instruction:h,previous_instruction:y,loop_level:x,break_instructions:u,continue_instructions:c};return{constants:t.constants,symbol_table:t.symbol_table,frames:{hd:C,tl:o.tl},declaration_ids:t.declaration_ids}}throw new p("Assert_failure",{MEL_EXN_ID:"Assert_failure",_1:["lib/pinc_compiler/compiler.ml",156,10]})}function b_(t){let e={instructions:p_(),last_instruction:h_,previous_instruction:h_,loop_level:0,break_instructions:0,continue_instructions:0};return{constants:t.constants,symbol_table:ul(t.symbol_table),frames:{hd:e,tl:t.frames},declaration_ids:t.declaration_ids}}function y_(t){let n=t.frames;if(n)return[{constants:t.constants,symbol_table:fl(t.symbol_table),frames:n.tl,declaration_ids:t.declaration_ids},n.hd];throw new p("Assert_failure",{MEL_EXN_ID:"Assert_failure",_1:["lib/pinc_compiler/compiler.ml",190,10]})}function Hu(t){return{constants:t.constants,symbol_table:al(t.symbol_table),frames:t.frames,declaration_ids:t.declaration_ids}}function Ru(t){return{constants:t.constants,symbol_table:ll(t.symbol_table),frames:t.frames,declaration_ids:t.declaration_ids}}function C_(t,n){return dc(t.constants,n),[t.constants.length-1|0,t]}function q(t,n){let e=ge(t),r=e.instructions.length;return dc(e.instructions,n),Fp(t,r,n)}function Pt(t,n){let e=C_(t,n),r={TAG:0,_0:e[0]};return q(e[1],r)}function mr(t,n,e,r){let i=Ts(t.symbol_table,n,e,r);return[{constants:t.constants,symbol_table:i[0],frames:t.frames,declaration_ids:t.declaration_ids},i[1]]}function hc(t,n,e){let r=Gs(n.symbol_table,e),i=r[1];return i!==void 0?[{constants:n.constants,symbol_table:r[0],frames:n.frames,declaration_ids:n.declaration_ids},i]:X(t,"Unbound identifier `"+(e+"`"))}function Hn(t,n){let e=ri.kind(n),r;switch(e){case 0:r={TAG:4,_0:n.address};break;case 1:r={TAG:8,_0:n.address};break;case 2:r={TAG:11,_0:n.address};break;case 3:r=28;break}return q(t,r)}function Qe(t,n){let e=ri.kind(n),r;switch(e){case 0:r={TAG:3,_0:ri.address(n)};break;case 1:r={TAG:7,_0:ri.address(n)};break;case 2:throw new p("Assert_failure",{MEL_EXN_ID:"Assert_failure",_1:["lib/pinc_compiler/compiler.ml",250,32]});case 3:throw new p("Assert_failure",{MEL_EXN_ID:"Assert_failure",_1:["lib/pinc_compiler/compiler.ml",251,36]})}return q(t,r)}function Uu(t,n,e){let r=$(yn,e,n.declaration_ids);return r!==void 0?r:X(t,"Unbound declaration `"+(e+"`"))}function U(t,n){let e=n.expression_loc,r=n.expression_desc;if(typeof r!="object"&&typeof r!="function")return t;switch(r.TAG){case 0:return a1(t,r._0);case 1:return p1(t,r._0);case 2:return Pt(t,{TAG:0,_0:r._0});case 3:return Pt(t,{TAG:1,_0:r._0});case 4:return m1(t,r._0);case 5:return y1(t,r._0);case 6:return f1(t,r._0);case 7:return i1(t,e,r.name,r.parameters);case 8:return o1(t,r.identifier,r.parameters,r.body);case 9:return d1(t,r.function_definition,r.arguments);case 10:return b1(t,e,r._0);case 11:return h1(t,e,r._0);case 12:return g1(t,r._0.tag_desc);case 13:return u1(t,r.index,r.iterator,r.iterable,r.body);case 14:return Yu(t,r._0);case 15:return _1(t,r._0);case 16:return s1(t,r.condition,r.consequent,r.alternate);case 17:return c1(t,r._0,r._1);case 18:return l1(t,r._0,r._1,r._2)}}function gc(t,n){let e=_t(Yu,t,n),r=Wt(n),i=Pt(e,{TAG:0,_0:r});return q(i,21)}function bc(t,n){let e=b(ei,n),r=Tr(e),i=r[0],_=_t(function(u,d){return Pt(u,{TAG:4,_0:d})},t,i),c=_t(U,_,r[1]),a=Wt(i);return q(c,{TAG:5,_0:a})}function Wp(t,n){let e=_t((function(i,o){let _=o[2]._0[0],s=mr(i[0],_,o[1],!0);return[s[0],{hd:[_,s[1]],tl:i[1]}]}),[t,0],n),r=e[1];return _t((function(i,o){return Wu(r,i,o)}),e[0],n)}function Yp(t){let n=pc(t),e=q(t,{TAG:1,_0:268435455}),r=di(e);return Hp(e,r,n)}function Qp(t,n,e){let r=n._0,i=r[1],o=r[0],_=hc(i,t,o),s=_[1],c=ri.is_mutable(s),a;if(c){let d=U(_[0],e);a=Qe(d,s)}else a=X(i,"Trying to update a non mutable variable `"+(o+"`."));let u=q(a,0);return q(u,1)}function Wu(t,n,e){let r=e[2]._0[0],i=e[1],o=U(n,e[3]),_=Li(r,t),s=_!==void 0?[o,_]:mr(o,r,i,i),c=Qe(s[0],s[1]),a=q(c,0);return q(a,1)}function Kp(t){let n=pc(t),e=q(t,{TAG:1,_0:268435455}),r=di(e);return Rp(e,r,n)}function Zp(t,n){let e=U(t,n);return q(e,1)}function Yu(t,n){let e=n.template_node_desc;switch(e.TAG){case 0:return e1(t,e.html_tag_identifier,e.html_tag_attributes,e.html_tag_children);case 1:return n1(t,e.component_tag_identifier,e.component_tag_attributes,e.component_tag_children);case 2:return r1(t,e._0);case 3:return t1(t,e.portal_tag_name,e.portal_tag_attributes);case 4:return U(t,e._0);case 5:return Pt(t,{TAG:4,_0:e._0})}}function S_(t,n){let e=n.statement_desc;if(typeof e!="object"&&typeof e!="function")return e===0?Yp(t):Kp(t);switch(e.TAG){case 0:return Wu(0,t,e._0);case 1:return Wp(t,e._0);case 2:return Qp(t,e._0,e._1);case 3:return Zp(t,e._0)}}function Jp(t,n){let e=b(ei,n),r=Tr(e),i=r[0],_=_t(function(u,d){return Pt(u,{TAG:4,_0:d})},t,i),c=_t(U,_,r[1]),a=Wt(i);return q(c,{TAG:5,_0:a})}function t1(t,n,e){let r=Pt(t,{TAG:4,_0:n}),i=bc(r,e);return q(i,31)}function n1(t,n,e,r){let i=n._0,o=Uu(i[1],t,i[0]),_=bc(t,e),s=gc(_,r);return q(s,{TAG:13,_0:o})}function e1(t,n,e,r){let i=Pt(t,{TAG:4,_0:n}),o=bc(i,e),_=gc(o,r);return q(_,29)}function r1(t,n){let e=gc(t,n);return q(e,30)}function i1(t,n,e,r){let i=wu(e),o=i!==void 0?i:X(n,"Unbound external function `"+(e+"`")),_=xu(o),s=Wt(r);return _!==s?X(n,"External function %%"+(e+("%% expected "+(String(_)+(" parameters, but got "+String(s)))))):q(t,{TAG:9,_0:o})}function o1(t,n,e,r){let i=b_(t),o;if(n!==void 0){let M=ml(i.symbol_table,n._0[0]);o={constants:i.constants,symbol_table:M[0],frames:i.frames,declaration_ids:i.declaration_ids}}else o=i;let _=_t((function(M,O){return mr(M,O._0[0],!1,!1)[0]}),o,e),s=r.expression_desc,c,a=0;if(typeof s!="object"&&typeof s!="function"||s.TAG!==15?a=1:c=_t(S_,_,s._0),a===1){let M=U(_,r);c=q(M,26)}let u;if(Vr(c,1)){let M=no(c);u=q(M,26)}else u=c;let d;if(Vr(u,26))d=u;else{let M=q(u,0);d=q(M,26)}let h=d.symbol_table.free_variables,y=d.symbol_table.num_bindings,x=y_(d),C=_t(Hn,x[0],h),S=Wt(h),G=Wt(e),D=zr(x[1].instructions),j=C_(C,{TAG:7,_0:{fn_addr:-1,num_locals:y,num_parameters:G,instructions:D}});return q(j[1],{TAG:10,_0:[j[0],S]})}function _1(t,n){let e=Hu(t),r=_t(S_,e,n);return Ru(Vr(r,1)?no(r):r)}function s1(t,n,e,r){let i=U(t,n),o=q(i,{TAG:2,_0:268435455}),_=di(o),s=U(o,e),c=Vr(s,1)?no(s):s,a=q(c,{TAG:1,_0:268435455}),u=di(a),d=ge(a).instructions.length,h=g_(a,_,{TAG:2,_0:d}),y;if(r!==void 0){let C=U(h,r);y=Vr(C,1)?no(C):C}else y=q(h,0);let x=ge(y).instructions.length;return g_(y,u,{TAG:1,_0:x})}function c1(t,n,e){let r=U(t,e);return n===0?q(r,18):q(r,19)}function a1(t,n){return n?_t((function(e,r){let i=e[1],o=e[0],_=r.string_template_desc,s;if(_.TAG===0){let a=_._0._0,u=hc(a[1],o,a[0]);s=Hn(u[0],u[1])}else s=Pt(o,{TAG:4,_0:_._0});return[i>0?q(s,20):s,i+1|0]}),[t,0],n)[0]:Pt(t,{TAG:4,_0:""})}function l1(t,n,e,r){switch(e){case 0:let i=U(t,n),o=U(i,r);return q(o,10);case 1:let _=U(t,n),s=U(_,r);return q(s,11);case 2:let c=U(t,n),a=U(c,r);return q(a,12);case 3:let u=U(t,n),d=U(u,r);return q(d,13);case 4:let h=U(t,n),y=U(h,r);return q(y,14);case 5:let x=U(t,n),C=U(x,r);return q(C,15);case 6:let S=U(t,n),G=U(S,r);return q(G,2);case 7:let D=U(t,n),j=U(D,r);return q(j,3);case 8:let M=U(t,n),O=U(M,r);return q(O,5);case 9:let N=U(t,n),rt=U(N,r);return q(rt,4);case 10:let it=U(t,n),Q=U(it,r);return q(Q,7);case 11:let Ct=U(t,n),P=U(Ct,r);return q(P,6);case 12:let z=U(t,n),k=U(z,r);return q(k,20);case 13:let V=U(t,n),gt=U(V,r);return q(gt,16);case 14:let tt=U(t,n),St=U(tt,r);return q(St,17);case 15:let lt=U(t,n),J=r.expression_desc,Mt;if(typeof J!="object"&&typeof J!="function")throw new p("Assert_failure",{MEL_EXN_ID:"Assert_failure",_1:["lib/pinc_compiler/compiler.ml",526,12]});if(J.TAG===11)Mt=Pt(lt,{TAG:4,_0:J._0});else throw new p("Assert_failure",{MEL_EXN_ID:"Assert_failure",_1:["lib/pinc_compiler/compiler.ml",526,12]});return q(Mt,23);case 16:let un=U(t,n),ae=U(un,r);return q(ae,22);case 17:throw new p("Assert_failure",{MEL_EXN_ID:"Assert_failure",_1:["lib/pinc_compiler/compiler.ml",533,40]});case 18:let Pn=U(t,n),Jn=U(Pn,r);return q(Jn,24);case 19:let nn=U(t,n),te=U(nn,r);return q(te,25)}}function u1(t,n,e,r,i){let o=Hu(t),_=zp(o),s=mr(_,e._0[0],!1,!1),c=mr(s[0],".length",!1,!1),a=c[1],u=n!==void 0?n._0[0]:".index",d=Pt(c[0],{TAG:0,_0:0}),h=mr(d,u,!1,!1),y=h[1],x=Qe(h[0],y),C=mr(x,".n_iterations",!1,!1),S=C[1],G=Pt(C[0],{TAG:0,_0:0}),D=Qe(G,S),j=U(D,r),M=mr(j,".iterable",!1,!1),O=M[1],N=Qe(M[0],O),rt=Hn(N,O),it=q(rt,27),Q=Qe(it,a),Ct=ge(Q).instructions.length,P=Hn(Q,a),z=Hn(P,y),k=q(z,12),V=q(k,{TAG:2,_0:268435455}),gt=di(V),tt=Hn(V,O),St=Hn(tt,y),lt=q(St,22),J=Qe(lt,s[1]),Mt=U(J,i),un=Pt(Mt,{TAG:0,_0:1}),ae=Hn(un,S),Pn=q(ae,2),Jn=Qe(Pn,S),nn=ge(Jn).instructions.length,te=Pt(Jn,{TAG:0,_0:1}),hr=Hn(te,y),le=q(hr,2),Rn=Qe(le,y),ue=q(Rn,{TAG:1,_0:Ct}),Ze=ge(ue).instructions.length,ne=Hn(ue,S),gr=q(ne,21),fe=g_(gr,gt,{TAG:2,_0:Ze}),br=Up(fe,nn,Ze);return Ru(Vp(br))}function f1(t,n){let e=b(ei,n),r=Tr(e),i=r[0],_=_t(function(u,d){return Pt(u,{TAG:4,_0:d})},t,i),c=_t(function(u,d){return U(u,d[1])},_,r[1]),a=Wt(i);return q(c,{TAG:5,_0:a})}function m1(t,n){return n?q(t,8):q(t,9)}function d1(t,n,e){let r=U(t,n),i=_t(U,r,e),o=Wt(e);return q(i,{TAG:6,_0:o})}function p1(t,n){return Pt(t,{TAG:3,_0:n})}function h1(t,n,e){let r=hc(n,t,e);return Hn(r[0],r[1])}function g1(t,n){let e=n.kind,r;if(typeof e!="object"&&typeof e!="function")switch(e){case 0:r="String";break;case 1:r="Int";break;case 2:r="Float";break;case 3:r="Boolean";break;case 4:r="Array";break;case 5:r="Record";break;case 6:r="Slot";break;case 7:r="Store";break;case 8:r="SetContext";break;case 9:r="GetContext";break}else r=e._0;let i=Pt(t,{TAG:4,_0:r}),o=_t((function(S,G){return Pt(S,{TAG:4,_0:G})}),i,n.path),_=Pt(o,{TAG:0,_0:Wt(n.path)}),s=q(_,21),a=n.required?1:0,d=b($s,n.attributes)?[s,a]:[Jp(s,n.attributes),a|2],h=d[1],y=d[0],x=n.children,C;if(x!==void 0){let S=q(y,{TAG:1,_0:268435455}),G=di(S),D=ge(S).instructions.length,j=U(S,x),M=h|4,O=q(j,32),N=ge(O).instructions.length;C=[g_(O,G,{TAG:1,_0:N}),M,D]}else C=[y,h,0];return q(C[0],{TAG:14,_0:[C[1],C[2]]})}function b1(t,n,e){let r=Uu(n,t,e);return q(t,{TAG:12,_0:r})}function y1(t,n){let e=Xi(U,t,n),r=Pt(e,{TAG:0,_0:n.length});return q(r,21)}function C1(t,n,e){let r=Ts(t.symbol_table,n,!1,!0),i=t.constants,o=r[0],_=t.frames,s=t.declaration_ids,a=b_({constants:i,symbol_table:o,frames:_,declaration_ids:s}),u=e.declaration_body,d=u.expression_desc,h,y=0;if(typeof d!="object"&&typeof d!="function"||d.TAG!==15?y=1:h=_t(S_,a,d._0),y===1){let Q=U(a,u);h=q(Q,26)}let x;if(Vr(h,1)){let Q=no(h);x=q(Q,26)}else x=h;let C;if(Vr(x,26))C=x;else{let Q=q(x,0);C=q(Q,26)}let S=C.symbol_table.free_variables,G=C.symbol_table.num_bindings,D=y_(C),j=_t(Hn,D[0],S),M=Wt(S);if(M!==0)throw new p("Assert_failure",{MEL_EXN_ID:"Assert_failure",_1:["lib/pinc_compiler/compiler.ml",904,2]});let O=zr(D[1].instructions),N=C_(j,{TAG:7,_0:{fn_addr:-1,num_locals:G,num_parameters:0,instructions:O}}),rt=q(N[1],{TAG:10,_0:[N[0],M]}),it=q(rt,{TAG:6,_0:0});return q(it,32)}function S1(t,n,e){let r=b_(t),i=e.declaration_body,o=i.expression_desc,_;_=typeof o!="object"&&typeof o!="function"||o.TAG!==15?X(i.expression_loc,"A library declaration must use curly braces."):_t(S_,r,o._0);let s=b(ei,_.symbol_table.store),c=Tr(s),a=c[0],d=_t(function(Q,Ct){return Pt(Q,{TAG:4,_0:Ct})},_,a),h=_t(Hn,d,c[1]),y=Wt(a),x=q(h,{TAG:5,_0:y}),C=q(x,26),S=C.symbol_table.free_variables,G=C.symbol_table.num_bindings,D=y_(C),j=_t(Hn,D[0],S),M=Wt(S);if(M!==0)throw new p("Assert_failure",{MEL_EXN_ID:"Assert_failure",_1:["lib/pinc_compiler/compiler.ml",941,2]});let O=zr(D[1].instructions),N=C_(j,{TAG:7,_0:{fn_addr:-1,num_locals:G,num_parameters:0,instructions:O}}),rt=q(N[1],{TAG:10,_0:[N[0],M]}),it=q(rt,{TAG:6,_0:0});return q(it,32)}function w1(t,n){let e=n.declaration_attributes,r=b_(t),i=b(ei,e),o=Tr(i),_=o[0],c=_t(function(C,S){return Pt(C,{TAG:4,_0:S})},r,_),a=_t(U,c,o[1]),u=Wt(_),d=q(a,{TAG:5,_0:u}),h=q(d,32),y=y_(h),x=zr(y[1].instructions);return[y[0],x]}function x1(t,n,e){let r=qp(t,void 0),i=$(qo,n,t),o=e.declaration_kind,_;switch(o){case 1:_=[1,S1(r,n,e)];break;case 0:case 2:_=[0,C1(r,n,e)];break}let s=_[1],c=zr(ge(s).instructions),a=w1(s,e),u=zr(a[0].constants);return{id:i,kind:_[0],instructions:c,meta_instructions:a[1],constants:u}}function Qu(t){let n={contents:-1},e=$(Hi,(function(r){return n.contents=n.contents+1|0,n.contents}),t);return $(Es,(function(r,i){return x1(e,r,i)}),t)}function E1(t){return _t((function(n,e){let r=qr.find_index(e,(function(i){return!Tu.is_whitespace(i)}));return r!==void 0?n!==void 0?vr(r,n):r:n}),void 0,t)}function Ku(t){let n=E1(t);return n!==void 0?gn((function(e){return qr.drop_first(n,e)}),t):t}function $1(t){let n=Bo(10,t),e=gn(qr.trim_right,n);if(!e)return 0;let r=e.hd;return r===""?Ku(e.tl):{hd:qr.trim_left(r),tl:Ku(e.tl)}}function Zu(t){return xn(`
34
+ `,$1(t))}function Ju(t){let n=function(f){return typeof f!="object"&&typeof f!="function"?0:f.h},e=function(f,m,l){let g;g=typeof f!="object"&&typeof f!="function"?0:f.h;let w;return w=typeof l!="object"&&typeof l!="function"?0:l.h,{TAG:0,l:f,v:m,r:l,h:g>=w?g+1|0:w+1|0}},r=function(f,m,l){let g;g=typeof f!="object"&&typeof f!="function"?0:f.h;let w;if(w=typeof l!="object"&&typeof l!="function"?0:l.h,g>(w+2|0)){if(typeof f!="object"&&typeof f!="function")throw new p("Invalid_argument",{MEL_EXN_ID:"Invalid_argument",_1:"Set.bal"});let B=f.r,Y=f.v,st=f.l;if(n(st)>=n(B))return e(st,Y,e(B,m,l));if(!(typeof B!="object"&&typeof B!="function"))return e(e(st,Y,B.l),B.v,e(B.r,m,l));throw new p("Invalid_argument",{MEL_EXN_ID:"Invalid_argument",_1:"Set.bal"})}if(w<=(g+2|0))return{TAG:0,l:f,v:m,r:l,h:g>=w?g+1|0:w+1|0};if(typeof l!="object"&&typeof l!="function")throw new p("Invalid_argument",{MEL_EXN_ID:"Invalid_argument",_1:"Set.bal"});let E=l.r,v=l.v,I=l.l;if(n(E)>=n(I))return e(e(f,m,I),v,E);if(!(typeof I!="object"&&typeof I!="function"))return e(e(f,m,I.l),I.v,e(I.r,v,E));throw new p("Invalid_argument",{MEL_EXN_ID:"Invalid_argument",_1:"Set.bal"})},i=function(f,m){if(typeof m!="object"&&typeof m!="function")return{TAG:0,l:0,v:f,r:0,h:1};let l=m.r,g=m.v,w=m.l,E=$(t.compare,f,g);if(E===0)return m;if(E<0){let I=i(f,w);return w===I?m:r(I,g,l)}let v=i(f,l);return l===v?m:r(w,g,v)},o=function(f){return{TAG:0,l:0,v:f,r:0,h:1}},_=function(f,m){return typeof m!="object"&&typeof m!="function"?o(f):r(_(f,m.l),m.v,m.r)},s=function(f,m){return typeof m!="object"&&typeof m!="function"?o(f):r(m.l,m.v,s(f,m.r))},c=function(f,m,l){if(typeof f!="object"&&typeof f!="function")return _(m,l);let g=f.h;if(typeof l!="object"&&typeof l!="function")return s(m,f);let w=l.h;return g>(w+2|0)?r(f.l,f.v,c(f.r,m,l)):w>(g+2|0)?r(c(f,m,l.l),l.v,l.r):e(f,m,l)},a=function(f){for(;;){let m=f;if(typeof m!="object"&&typeof m!="function")throw new p(pt,{MEL_EXN_ID:pt});let l=m.l;if(typeof l!="object"&&typeof l!="function")return m.v;f=l}},u=function(f){for(;;){let m=f;if(typeof m!="object"&&typeof m!="function")return;let l=m.l;if(typeof l!="object"&&typeof l!="function")return F(m.v);f=l}},d=function(f){for(;;){let m=f;if(typeof m!="object"&&typeof m!="function")throw new p(pt,{MEL_EXN_ID:pt});let l=m.r;if(typeof l!="object"&&typeof l!="function")return m.v;f=m.r}},h=function(f){for(;;){let m=f;if(typeof m!="object"&&typeof m!="function")return;let l=m.r;if(typeof l!="object"&&typeof l!="function")return F(m.v);f=m.r}},y=function(f){if(typeof f!="object"&&typeof f!="function")throw new p("Invalid_argument",{MEL_EXN_ID:"Invalid_argument",_1:"Set.remove_min_elt"});let m=f.l;return typeof m!="object"&&typeof m!="function"?f.r:r(y(m),f.v,f.r)},x=function(f,m){return typeof f!="object"&&typeof f!="function"?m:typeof m!="object"&&typeof m!="function"?f:c(f,a(m),y(m))},C=function(f,m){if(typeof m!="object"&&typeof m!="function")return[0,!1,0];let l=m.r,g=m.v,w=m.l,E=$(t.compare,f,g);if(E===0)return[w,!0,l];if(E<0){let I=C(f,w);return[I[0],I[1],c(I[2],g,l)]}let v=C(f,l);return[c(w,g,v[0]),v[1],v[2]]},S=function(f){return typeof f!="object"&&typeof f!="function"},G=function(f){if(typeof f!="object"&&typeof f!="function")return!1;let m=f.l;if(!(typeof m!="object"&&typeof m!="function"))return!1;let l=f.r;return typeof l!="object"&&typeof l!="function"},D=function(f,m){for(;;){let l=m;if(typeof l!="object"&&typeof l!="function")return!1;let g=$(t.compare,f,l.v);if(g===0)return!0;m=g<0?l.l:l.r}},j=function(f,m){if(typeof m!="object"&&typeof m!="function")return 0;let l=m.r,g=m.v,w=m.l,E=$(t.compare,f,g);if(E===0)return typeof w!="object"&&typeof w!="function"?l:typeof l!="object"&&typeof l!="function"?w:r(w,a(l),y(l));if(E<0){let I=j(f,w);return w===I?m:r(I,g,l)}let v=j(f,l);return l===v?m:r(w,g,v)},M=function(f,m){if(typeof f!="object"&&typeof f!="function")return m;let l=f.h,g=f.v;if(typeof m!="object"&&typeof m!="function")return f;let w=m.h,E=m.v;if(l>=w){if(w===1)return i(E,f);let I=C(g,m);return c(M(f.l,I[0]),g,M(f.r,I[2]))}if(l===1)return i(g,m);let v=C(E,f);return c(M(v[0],m.l),E,M(v[2],m.r))},O=function(f,m){if(typeof f!="object"&&typeof f!="function"||typeof m!="object"&&typeof m!="function")return 0;let l=f.r,g=f.v,w=f.l,E=C(g,m),v=E[0];return E[1]?c(O(w,v),g,O(l,E[2])):x(O(w,v),O(l,E[2]))},N=function(f,m){if(typeof m!="object"&&typeof m!="function")return{TAG:0,_0:0,_1:(function(I){return 0})};let l=m.r,g=m.v,w=m.l,E=$(t.compare,f,g);if(E===0)return 0;if(E<0){let I=N(f,w);if(typeof I!="object"&&typeof I!="function")return 0;let B=I._1;return{TAG:0,_0:I._0,_1:(function(Y){return c(b(B,void 0),g,l)})}}let v=N(f,l);return typeof v!="object"&&typeof v!="function"?0:{TAG:0,_0:c(w,g,v._0),_1:v._1}},rt=function(f,m){for(;;){let l=m,g=f;if(typeof g!="object"&&typeof g!="function"||typeof l!="object"&&typeof l!="function")return!0;if(g===l)return!1;let w=N(g.v,l);if(typeof w!="object"&&typeof w!="function"||!rt(g.l,w._0))return!1;m=b(w._1,void 0),f=g.r}},it=function(f,m){if(typeof f!="object"&&typeof f!="function")return 0;if(typeof m!="object"&&typeof m!="function")return f;let l=f.r,g=f.v,w=f.l,E=C(g,m),v=E[0];return E[1]?x(it(w,v),it(l,E[2])):c(it(w,v),g,it(l,E[2]))},Q=function(f,m){for(;;){let l=m,g=f;if(typeof g!="object"&&typeof g!="function")return l;m={TAG:0,_0:g.v,_1:g.r,_2:l},f=g.l}},Ct=function(f,m){let l=Q(f,0),g=Q(m,0);for(;;){let w=g,E=l;if(typeof E!="object"&&typeof E!="function")return typeof w!="object"&&typeof w!="function"?0:-1;if(typeof w!="object"&&typeof w!="function")return 1;let v=$(t.compare,E._0,w._0);if(v!==0)return v;g=Q(w._1,w._2),l=Q(E._1,E._2)}},P=function(f,m){return Ct(f,m)===0},z=function(f,m){for(;;){let l=m,g=f;if(typeof g!="object"&&typeof g!="function")return!0;let w=g.r,E=g.v,v=g.l;if(typeof l!="object"&&typeof l!="function")return!1;let I=l.r,B=l.l,Y=$(t.compare,E,l.v);if(Y===0){if(!z(v,B))return!1;m=I,f=w;continue}if(Y<0){if(!z({TAG:0,l:v,v:E,r:0,h:0},B))return!1;f=w;continue}if(!z({TAG:0,l:0,v:E,r:w,h:0},I))return!1;f=v}},k=function(f,m){for(;;){let l=m;if(typeof l!="object"&&typeof l!="function")return;k(f,l.l),b(f,l.v),m=l.r}},V=function(f,m,l){for(;;){let g=l,w=m;if(typeof w!="object"&&typeof w!="function")return g;l=$(f,w.v,V(f,w.l,g)),m=w.r}},gt=function(f,m){for(;;){let l=m;if(typeof l!="object"&&typeof l!="function")return!0;if(!b(f,l.v)||!gt(f,l.l))return!1;m=l.r}},tt=function(f,m){for(;;){let l=m;if(typeof l!="object"&&typeof l!="function")return!1;if(b(f,l.v)||tt(f,l.l))return!0;m=l.r}},St=function(f,m){if(typeof m!="object"&&typeof m!="function")return 0;let l=m.r,g=m.v,w=m.l,E=St(f,w),v=b(f,g),I=St(f,l);return v?w===E&&l===I?m:c(E,g,I):x(E,I)},lt=function(f,m){if(typeof m!="object"&&typeof m!="function")return[0,0];let l=m.v,g=lt(f,m.l),w=g[1],E=g[0],v=b(f,l),I=lt(f,m.r),B=I[1],Y=I[0];return v?[c(E,l,Y),x(w,B)]:[x(E,Y),c(w,l,B)]},J=function(f){return typeof f!="object"&&typeof f!="function"?0:(J(f.l)+1|0)+J(f.r)|0},Mt=function(f,m){for(;;){let l=m,g=f;if(typeof l!="object"&&typeof l!="function")return g;m=l.l,f={hd:l.v,tl:Mt(g,l.r)}}},un=function(f){return Mt(0,f)},ae=function(f,m){for(;;){let l=m;if(typeof l!="object"&&typeof l!="function")throw new p(pt,{MEL_EXN_ID:pt});let g=l.v,w=$(t.compare,f,g);if(w===0)return g;m=w<0?l.l:l.r}},Pn=function(f,m){for(;;){let l=m;if(typeof l!="object"&&typeof l!="function")throw new p(pt,{MEL_EXN_ID:pt});let g=l.v;if(b(f,g)){let w=g,E=l.l;for(;;){let v=E,I=w;if(typeof v!="object"&&typeof v!="function")return I;let B=v.v;if(b(f,B)){E=v.l,w=B;continue}E=v.r}}m=l.r}},Jn=function(f,m){for(;;){let l=m;if(typeof l!="object"&&typeof l!="function")return;let g=l.v;if(b(f,g)){let w=g,E=l.l;for(;;){let v=E,I=w;if(typeof v!="object"&&typeof v!="function")return F(I);let B=v.v;if(b(f,B)){E=v.l,w=B;continue}E=v.r}}m=l.r}},nn=function(f,m){for(;;){let l=m;if(typeof l!="object"&&typeof l!="function")throw new p(pt,{MEL_EXN_ID:pt});let g=l.v;if(b(f,g)){let w=g,E=l.r;for(;;){let v=E,I=w;if(typeof v!="object"&&typeof v!="function")return I;let B=v.v;if(b(f,B)){E=v.r,w=B;continue}E=v.l}}m=l.l}},te=function(f,m){for(;;){let l=m;if(typeof l!="object"&&typeof l!="function")return;let g=l.v;if(b(f,g)){let w=g,E=l.r;for(;;){let v=E,I=w;if(typeof v!="object"&&typeof v!="function")return F(I);let B=v.v;if(b(f,B)){E=v.r,w=B;continue}E=v.l}}m=l.l}},hr=function(f,m){for(;;){let l=m;if(typeof l!="object"&&typeof l!="function")return;let g=l.v,w=$(t.compare,f,g);if(w===0)return F(g);m=w<0?l.l:l.r}},le=function(f,m,l){return(ut(f,0)||$(t.compare,d(f),m)<0)&&(ut(l,0)||$(t.compare,m,a(l))<0)?c(f,m,l):M(f,i(m,l))},Rn=function(f,m){if(typeof m!="object"&&typeof m!="function")return 0;let l=m.r,g=m.v,w=m.l,E=Rn(f,w),v=b(f,g),I=Rn(f,l);return w===E&&g===v&&l===I?m:le(E,v,I)},ue=function(f,m){if(typeof m!="object"&&typeof m!="function")return 0;let l=m.r,g=m.v,w=m.l,E=ue(f,w),v=b(f,g),I=ue(f,l);if(v===void 0)return typeof E!="object"&&typeof E!="function"?I:typeof I!="object"&&typeof I!="function"?E:le(E,a(I),y(I));let B=wt(v);return w===E&&g===B&&l===I?m:le(E,B,I)},Ze=function(f){if(!f)return 0;let m=f.tl,l=f.hd;if(!m)return o(l);let g=m.tl,w=m.hd;if(!g)return i(w,o(l));let E=g.tl,v=g.hd;if(!E)return i(v,i(w,o(l)));let I=E.tl,B=E.hd;if(I)if(I.tl){let Y=Ga(t.compare,f),st=function(fn,Rt){switch(fn){case 0:return[0,Rt];case 1:if(Rt)return[{TAG:0,l:0,v:Rt.hd,r:0,h:1},Rt.tl];break;case 2:if(Rt){let ye=Rt.tl;if(ye)return[{TAG:0,l:{TAG:0,l:0,v:Rt.hd,r:0,h:1},v:ye.hd,r:0,h:2},ye.tl]}break;case 3:if(Rt){let ye=Rt.tl;if(ye){let N_=ye.tl;if(N_)return[{TAG:0,l:{TAG:0,l:0,v:Rt.hd,r:0,h:1},v:ye.hd,r:{TAG:0,l:0,v:N_.hd,r:0,h:1},h:2},N_.tl]}}break}let De=fn/2|0,bi=st(De,Rt),D_=bi[1];if(D_){let ye=st((fn-De|0)-1|0,D_.tl);return[e(bi[0],D_.hd,ye[0]),ye[1]]}throw new p("Assert_failure",{MEL_EXN_ID:"Assert_failure",_1:["jscomp/stdlib/set.ml",576,18]})};return st(Wt(Y),Y)[0]}else return i(I.hd,i(B,i(v,i(w,o(l)))));else return i(B,i(v,i(w,o(l))))},ne=function(f,m){return Zr((function(l,g){return i(g,l)}),m,f)},gr=function(f){return ne(f,0)},fe=function(f,m){if(typeof f!="object"&&typeof f!="function")return 0;let l=Q(f._1,f._2);return{TAG:0,_0:f._0,_1:(function(g){return fe(l,g)})}},br=function(f){let m=Q(f,0);return function(l){return fe(m,l)}},yr=function(f,m){for(;;){let l=m,g=f;if(typeof g!="object"&&typeof g!="function")return l;m={TAG:0,_0:g.v,_1:g.l,_2:l},f=g.r}},be=function(f,m){if(typeof f!="object"&&typeof f!="function")return 0;let l=yr(f._1,f._2);return{TAG:0,_0:f._0,_1:(function(g){return be(l,g)})}};return{empty:0,add:i,singleton:o,remove:j,union:M,inter:O,disjoint:rt,diff:it,cardinal:J,elements:un,min_elt:a,min_elt_opt:u,max_elt:d,max_elt_opt:h,choose:a,choose_opt:u,find:ae,find_opt:hr,find_first:Pn,find_first_opt:Jn,find_last:nn,find_last_opt:te,iter:k,fold:V,map:Rn,filter:St,filter_map:ue,partition:lt,split:C,is_empty:S,is_singleton:G,mem:D,equal:P,compare:Ct,subset:z,for_all:gt,exists:tt,to_list:un,of_list:Ze,to_seq_from:function(f,m){let g=function(w,E,v){for(;;){let I=v,B=E;if(typeof B!="object"&&typeof B!="function")return I;let Y=B.r,st=B.v,fn=$(t.compare,st,w);if(fn===0)return{TAG:0,_0:st,_1:Y,_2:I};if(fn<0){E=Y;continue}v={TAG:0,_0:st,_1:Y,_2:I},E=B.l}}(f,m,0);return function(w){return fe(g,w)}},to_seq:br,to_rev_seq:function(f){let m=yr(f,0);return function(l){return be(m,l)}},add_seq:ne,of_seq:gr}}var at=Ju({compare:Vi}),yc=at.empty,Cc=at.add,vC=at.singleton,jC=at.remove,v1=at.union,kC=at.inter,MC=at.disjoint,IC=at.diff,LC=at.cardinal,tf=at.elements,DC=at.min_elt,NC=at.min_elt_opt,PC=at.max_elt,XC=at.max_elt_opt,BC=at.choose,OC=at.choose_opt,qC=at.find,FC=at.find_opt,zC=at.find_first,VC=at.find_first_opt,HC=at.find_last,RC=at.find_last_opt,UC=at.iter,nf=at.fold,WC=at.map,YC=at.filter,QC=at.filter_map,KC=at.partition,ZC=at.split,JC=at.is_empty,t2=at.is_singleton,j1=at.mem,n2=at.equal,e2=at.compare,r2=at.subset,i2=at.for_all,o2=at.exists,_2=at.to_list,s2=at.of_list,c2=at.to_seq_from,a2=at.to_seq,l2=at.to_rev_seq,u2=at.add_seq,f2=at.of_seq;function w_(t,n,e){return{typ:e,indentation:n,location:t}}function Ie(t){if(typeof t!="object"&&typeof t!="function")switch(t){case 0:return"(";case 1:return")";case 2:return"[";case 3:return"]";case 4:return"{";case 5:return"}";case 6:return"$(";case 7:return'"';case 8:return":";case 9:return",";case 10:return";";case 11:return".";case 12:return"..";case 13:return"...";case 14:return"->";case 15:return"|>";case 16:return"?";case 17:return"=";case 18:return":=";case 19:return"!";case 20:return">";case 21:return"<";case 22:return"+";case 23:return"-";case 24:return"*";case 25:return"**";case 26:return"/";case 27:return"%";case 28:return"&&";case 29:return"||";case 30:return"!=";case 31:return"==";case 32:return">=";case 33:return"<=";case 34:return"++";case 35:return"fn";case 36:return"let";case 37:return"and";case 38:return"mutable";case 39:return"true";case 40:return"false";case 41:return"if";case 42:return"else";case 43:return"for";case 44:return"in";case 45:return"break";case 46:return"continue";case 47:return"component";case 48:return"library";case 49:return"page";case 50:return"(NEWLINE)";case 51:return"<>";case 52:return"</>";case 53:return"/>";case 54:return"> (TAG END)";case 55:return"(BLANKLINE)";case 56:return"(EOF)"}else switch(t.TAG){case 0:return"%%"+(t._0+"%%");case 2:return Xo(t._0);case 3:return kr(t._0);case 4:return String(t._0);case 5:return Ao(t._0);case 6:return'"'+(t._0+'"');case 7:let n=bt(32);return hl(n,t._0[1]),"'"+(K(n)+"'");case 8:return"#"+kr(t._0);case 1:case 9:return"/* "+(t._0+" */");case 10:case 11:return t._0;case 12:case 14:return"<"+t._0;case 13:case 15:return"</"+(t._0+">");case 16:return"<@"+t._0}}function rf(t){if(!(typeof t!="object"&&typeof t!="function"))return!1;switch(t){case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 48:case 49:return!0;default:return!1}}function k1(t){switch(t){case"and":return 37;case"break":return 45;case"component":return 47;case"continue":return 46;case"else":return 42;case"false":return 40;case"fn":return 35;case"for":return 43;case"if":return 41;case"in":return 44;case"let":return 36;case"library":return 48;case"mutable":return 38;case"page":return 49;case"true":return 39;default:return}}function Sc(t){let n=k1(t);if(n!==void 0)return n;let e=R(t,0);return e>90||e<65?{TAG:2,_0:t}:{TAG:3,_0:t}}function af(t){let n=Ko(t),e=n===""?"EOF":{NAME:"Chr",VAL:n.charCodeAt(0)};return{source:t,src:n,current:e,offset:0,line_offset:0,line:1,column:0,saw_characters_on_line:!1,line_indentation:bt(32),mode:{hd:0,tl:0}}}function Z(t){return Ye.make(t.source,t.line,t.column+1|0)}function lf(t){let n=t.mode;if(!n)return 0;switch(n.hd){case 0:return 0;case 1:return 1;case 2:return 2;case 3:return 3;case 4:return 4}}function zt(t,n){n.mode={hd:t,tl:n.mode}}function Zn(t,n){let e=n.mode;if(e&&e.hd===t){n.mode=e.tl;return}}function uf(t){let n=t.current;if(typeof n=="string"||n.NAME!=="Chr")return!1;let e=n.VAL;return e>13||e<9?e===32:!(e===12||e===11)}function At(t,n){try{return{NAME:"Chr",VAL:R(n.src,n.offset+t|0)}}catch(e){let r=yt(e);if(r.MEL_EXN_ID===L)return"EOF";throw r}}function M1(t){let n=K(t.line_indentation);return vs(t.line_indentation),n.length}function ff(t){if(!t.saw_characters_on_line){t.saw_characters_on_line=!0;return}}function A(t){let n=t.offset+1|0,e=t.current,r=0;if(typeof e=="string"||e.NAME!=="Chr")r=1;else{let o=e.VAL,_=0;o===10||o===9?o>=10?(t.line_offset=n,t.line=t.line+1|0,t.saw_characters_on_line=!1,vs(t.line_indentation)):_=2:o!==32?r=1:_=2,_===2&&(t.saw_characters_on_line?r=1:ot(t.line_indentation,o))}r===1&&(uf(t)||ff(t)),t.column=n-t.line_offset|0,t.offset=n;let i;try{i={NAME:"Chr",VAL:R(t.src,n)}}catch(o){let _=yt(o);if(_.MEL_EXN_ID===L)i="EOF";else throw _}t.current=i}function xc(t){A(t),A(t),A(t)}function I1(t,n){for(let e=1;e<=t;++e)A(n)}function _f(t,n,e){let r=t!==void 0?t:!1,o=function(s,c,a){for(;;){let u=a,d=s,h=At(u,c);if(!d)return[!0,u];if(typeof h=="string")return[!1,0];if(h.NAME!=="Chr")return[!1,0];let y=h.VAL,x=d.tl,C=d.hd;if(!r&&C===y){a=u+1|0,s=x;continue}if(!(r&&(Oi(C)===y||Mo(C)===y)))return[!1,0];a=u+1|0,s=x}}(n,e,0),_=o[0];return _&&I1(o[1],e),_}function ro(t){for(;;){let n=t.current;if(typeof n=="string"||n.NAME!=="Chr")return;let e=n.VAL;if(e>=14){if(e!==32)return;A(t);continue}if(e<9)return;switch(e){case 10:if(!t.saw_characters_on_line)return;A(t);continue;case 11:case 12:return;case 9:case 13:A(t);continue}}}function Ac(t){for(;;){let n=t.current,e=0;if(typeof n!="string"&&n.NAME==="Chr"){let r=n.VAL;r!==9&&r!==32||(e=2)}if(e===2&&!t.saw_characters_on_line){A(t);continue}return uf(t)?void 0:ff(t)}}function wc(t){let n=function(o){if(typeof o=="string"||o.NAME!=="Chr")return 16;let _=o.VAL;return _>=65?_>=97?_>=103?16:(_-97|0)+10|0:_>=71?16:((_+32|0)-97|0)+10|0:_>57||_<48?16:_-48|0},e=function(o,_,s){let c=0;for(let a=_;a>=1;--a){let u=n(o.current);c=Math.imul(c,s)+u|0,A(o)}return Po(c)},r=t.current;if(typeof r=="string"){let o=Z(t);return X(nt(void 0,o,void 0),"This escape sequence is not terminated.")}let i=r.VAL;if(i>=58)switch(i){case 98:return A(t),["Char",8];case 102:return A(t),["Char",12];case 110:return A(t),["Char",10];case 111:return A(t),["Octal",e(t,3,8)];case 114:return A(t),["Char",13];case 116:return A(t),["Char",9];case 120:return A(t),["Hex",e(t,2,16)]}else if(i>=48)return["Decimal",e(t,3,10)];return A(t),["Char",i]}function x_(t){let n=bt(32);return function(r){for(;;){let i=r.current,o;if(typeof i=="string"||i.NAME!=="Chr")return;let _=i.VAL;if(_>=91)if(_>=97){if(_>=123)return;o=_}else{if(_!==95)return;o=_}else if(_>=58){if(_<65)return;o=_}else{if(_<48)return;o=_}A(r),ot(n,o)}}(t),Sc(K(n))}function A_(t,n){let e=bt(512);return function(i){for(;;){let o=i.current;if(typeof o=="string")return X(nt(void 0,t,void 0),'This string is not terminated. Please add a double-quote (") at the end.');let _=o.VAL;if(_>=37){if(_===92){let s=At(1,i);if(typeof s=="string")return X(nt(F(Z(i)),t,void 0),'This string is not terminated. Please add a double-quote (") at the end.');let c=s.VAL,a=0;if(c>=40)switch(c){case 92:a=2;break;case 98:A(i),A(i),ot(e,8);continue;case 102:A(i),A(i),ot(e,12);continue;case 110:A(i),A(i),ot(e,10);continue;case 114:A(i),A(i),ot(e,13);continue;case 116:A(i),A(i),ot(e,9);continue;default:a=3}else if(c>=32)switch(c){case 32:a=2;break;case 34:A(i),A(i),ot(e,34);continue;case 33:case 35:case 36:case 37:case 38:a=3;break;case 39:A(i),A(i),ot(e,39);continue}else a=3;switch(a){case 2:A(i),A(i),ot(e,92);continue;case 3:let u=Z(i);return X(nt(void 0,u,void 0),"Unknown escape sequence in string.")}}}else if(_>=34)switch(_){case 34:return;case 35:break;case 36:if(ut(At(1,i),{NAME:"Chr",VAL:40}))return;break}A(i),ot(e,_)}}(n),{TAG:6,_0:K(e)}}function L1(t){let n=Z(t),e=bt(32);(function(_){for(;;){let s=_.current,c;if(typeof s=="string"||s.NAME!=="Chr")return;let a=s.VAL;if(a>=91)if(a>=97){if(a>=123)return;c=a}else{if(a!==95)return;c=a}else if(a>=58){if(a<65)return;c=a}else{if(a<48)return;c=a}A(_),ot(e,c)}})(t);let i=K(e),o=R(i,0);return o>90||o<65?X(nt(F(Z(t)),n,void 0),"Invalid Tag! Tags have to start with an uppercase character. Did you mean to write #"+(kr(i)+"?")):i}function Ec(t){let n=Z(t),e=function(_,s){for(;;){let c=s.current,a;if(typeof c=="string")return K(_);if(c.NAME!=="Chr")return K(_);let u=c.VAL;if(u<58)if(u!==45){if(u<48)return K(_);a=u}else a=u;else{if(u>122||u<97)return K(_);a=u}A(s),ot(_,a)}},r=bt(32),i=e(r,t);ro(t);let o=R(i,0);return o>122||o<97?X(nt(F(Z(t)),n,void 0),"Invalid Html tag! Html tags have to start with a lowercase letter. Instead saw: "+i):i}function mf(t){let n=bt(32);for(;;){let e=t.current,r;if(typeof e=="string")return K(n);if(e.NAME!=="Chr")return K(n);let i=e.VAL;if(i>=91)if(i>=97){if(i>=123)return K(n);r=i}else{if(i!==95)return K(n);r=i}else if(i>=58){if(i<65)return K(n);r=i}else{if(i<48)return K(n);r=i}A(t),ot(n,r)}}function df(t){let n=Z(t);A(t);let e=t.current;if(typeof e=="string")return X(nt(F(Z(t)),n,void 0),"Your Template was not closed correctly. You probably mismatched or forgot a closing tag.");let r=e.VAL;return r>90||r<65?X(nt(F(Z(t)),n,void 0),"Invalid Component tag! Component tags have to start with an uppercase letter. Instead saw: "+Fn(1,r)):{TAG:14,_0:mf(t)}}function pf(t){let n=Z(t);A(t),A(t);let e=t.current;if(typeof e=="string")return X(nt(F(Z(t)),n,void 0),"Your Template was not closed correctly. You probably mismatched or forgot a closing tag.");let r=e.VAL;return r>122||r<97?X(nt(F(Z(t)),n,void 0),"Invalid Portal tag! Portal tags have to start with a lowercase letter. Instead saw: "+Fn(1,r)):{TAG:16,_0:Ec(t)}}function hf(t){let n=Z(t),e=function(_){return X(nt(F(Z(_)),n,void 0),"Invalid DOCTYPE. Currently only the html5 doctype is supported. (<!DOCTYPE html>)")};_f(!0,{hd:60,tl:{hd:33,tl:{hd:68,tl:{hd:79,tl:{hd:67,tl:{hd:84,tl:{hd:89,tl:{hd:80,tl:{hd:69,tl:0}}}}}}}}},t)||e(t),ro(t),_f(!0,{hd:104,tl:{hd:116,tl:{hd:109,tl:{hd:108,tl:0}}}},t)||e(t),ro(t);let i=t.current;if(typeof i=="string")return X(nt(F(Z(t)),n,void 0),"Your DOCTYPE was not closed correctly. You probably forgot the > at the end.");let o=i.VAL;return o!==62?X(nt(void 0,Z(t),void 0),"Expected to see `>` (GREATER-THAN SIGN) at this point. Instead saw: "+Fn(1,o)):(A(t),{TAG:10,_0:"<!DOCTYPE html>"})}function gf(t){let n=Z(t);A(t);let e=t.current;if(typeof e=="string")return X(nt(F(Z(t)),n,void 0),"Your Template was not closed correctly. You probably mismatched or forgot a closing tag.");let r=e.VAL;return r>122||r<97?X(nt(F(Z(t)),n,void 0),"Invalid Template tag! Template tags have to start with a lowercase letter. Instead saw: "+Fn(1,r)):{TAG:12,_0:Ec(t)}}function bf(t){let n=Z(t);A(t),A(t);let e=t.current,r;if(typeof e=="string")r=X(nt(F(Z(t)),n,void 0),"Your Template was not closed correctly. You probably mismatched or forgot a closing tag.");else{let o=e.VAL;r=o>90||o<65?X(nt(F(Z(t)),n,void 0),"Invalid Component tag! Component tags have to start with an uppercase letter. Instead saw: "+Fn(1,o)):mf(t)}let i=t.current;return typeof i!="string"&&i.NAME==="Chr"&&i.VAL===62?(A(t),{TAG:15,_0:r}):X(nt(F(Z(t)),n,void 0),"Expected token "+(Ie(20)+" at this point."))}function yf(t){let n=Z(t);A(t),A(t);let e=t.current,r;if(typeof e=="string")r=X(nt(F(Z(t)),n,void 0),"Your Template was not closed correctly. You probably mismatched or forgot a closing tag.");else{let o=e.VAL;r=o>122||o<97?X(nt(F(Z(t)),n,void 0),"Invalid Template tag! Template tags have to start with a lowercase letter. Instead saw: "+Fn(1,o)):{TAG:13,_0:Ec(t)}}let i=t.current;return typeof i!="string"&&i.NAME==="Chr"&&i.VAL===62?(A(t),r):X(nt(F(Z(t)),n,void 0),"Expected token "+(Ie(20)+" at this point."))}function Cn(t){let n=Z(t),e=function(o,_){for(;;){let s=_.current;if(typeof s=="string")return X(nt(F(Z(_)),n,void 0),"Your Template was not closed correctly. You probably mismatched or forgot a closing tag.");let c=s.VAL;if(c!==10){if(c!==60){if(c===123)return K(o);A(_),ot(o,c);continue}let a=At(1,_);if(typeof a!="string"&&a.NAME==="Chr"){let u=a.VAL;if(u>=64){if(u<91)return K(o);if(!(u>122||u<97))return K(o)}else{if(u===47)return K(o);if(u===62)return K(o)}}A(_),ot(o,60);continue}A(_),ot(o,10),Ac(_)}},r=bt(32);return{TAG:11,_0:e(r,t)}}function Cf(t){return A(t),A(t),zt(4,t),51}function sf(t){let n=function(r,i){for(;;){let o=i.current,_;if(typeof o=="string")return K(r);if(o.NAME!=="Chr")return K(r);let s=o.VAL;if(s>=59)if(s>=91){if(s>122||s<97)return K(r);_=s}else{if(s<65)return K(r);_=s}else if(s>=48)_=s;else{if(s!==45)return K(r);_=s}A(i),ot(r,_)}},e=bt(32);return Sc(n(e,t))}function cf(t){let n=bt(5),e=function(a){for(;;){let u=a.current;if(typeof u=="string"||u.NAME!=="Chr")return;let d=u.VAL;if(d>=58){if(d!==95)return;A(a);continue}if(d<48)return;ot(n,d),A(a)}};e(t);let r=t.current,i;if(typeof r=="string"||!(r.NAME==="Chr"&&r.VAL===46))i=!1;else{let a=At(1,t),u=0;typeof a=="string"||!(a.NAME==="Chr"&&a.VAL===46)?u=1:i=!1,u===1&&(ot(n,46),A(t),e(t),i=!0)}let o=t.current,_,s=0;if(typeof o=="string"||o.NAME!=="Chr")_=i;else{let a=o.VAL;a!==69&&a!==101?_=i:s=1}if(s===1){ot(n,101),A(t);let a=t.current;if(typeof a!="string"&&a.NAME==="Chr")switch(a.VAL){case 43:ot(n,43),A(t);break;case 45:ot(n,45),A(t);break}e(t),_=!0}let c=K(n);return _?{TAG:5,_0:ts(c)}:{TAG:4,_0:vi(c)}}function D1(t){A(t),A(t),ro(t);let n=bt(128);for(;;){let e=t.current;if(typeof e=="string")return K(n);let r=e.VAL;if(r===10)return K(n);A(t),ot(n,r)}}function Sf(t,n){let e=t!==void 0?t:!1,r=Z(n);A(n),A(n);let i=bt(512);for(e&&Dt(i,"/*");;){let o=n.current;if(typeof o=="string")return X(nt(void 0,r,void 0),"This comment is not terminated. Please add a `*/` at the end.");let _=o.VAL;if(_!==42){if(_===47&&ut(At(1,n),{NAME:"Chr",VAL:42})){Dt(i,Sf(!0,n));continue}}else if(ut(At(1,n),{NAME:"Chr",VAL:47}))return A(n),A(n),e&&Dt(i,"*/"),K(i);A(n),ot(i,_)}}function N1(t){let n=Z(t);A(t),A(t);let e=bt(512);for(;;){let r=t.current;if(typeof r=="string")return X(nt(void 0,n,void 0),"This external function symbol is not terminated. Please add a `%%%%` at the end.");let i=r.VAL;if(i===37&&ut(At(1,t),{NAME:"Chr",VAL:37}))return A(t),A(t),K(e);A(t),ot(e,i)}}function eo(t,n){let e=n.current;if(typeof e=="string")return X(nt(F(Z(n)),t,void 0),`Your Template was not closed correctly.
35
+ You probably mismatched or forgot a closing tag.`);let r=e.VAL;if(r<63)if(r!==47){if(r<60)return Cn(n);switch(r){case 60:let i=At(1,n);if(typeof i=="string"||i.NAME!=="Chr")return Cn(n);let o=i.VAL;if(o>=62){if(o>=91)return o>122||o<97?Cn(n):(zt(4,n),zt(2,n),gf(n));if(o>=65)return zt(4,n),zt(3,n),df(n);switch(o){case 62:return Cf(n);case 63:return Cn(n);case 64:return zt(4,n),zt(2,n),pf(n)}}else{if(o===33)return hf(n);if(o!==47)return Cn(n);Zn(4,n);let _=At(2,n);if(typeof _=="string")return X(nt(F(Z(n)),t,void 0),`Your Template was not closed correctly.
36
+ You probably mismatched or forgot a closing tag.`);let s=_.VAL;if(s<91)if(s!==62){if(s>=65)return bf(n)}else return xc(n),52;else if(!(s>122||s<97))return yf(n);return X(nt(F(Z(n)),t,void 0),"Invalid Template tag! Template tags have to start with an uppercase or lowercase letter. Instead saw: "+Fn(1,s))}break;case 61:return Cn(n);case 62:return A(n),54}}else{let i=At(1,n);if(typeof i=="string")return X(nt(F(Z(n)),t,void 0),`Your Template was not closed correctly.
37
+ You probably mismatched or forgot a closing tag.`);let o=i.VAL;return o!==62?X(nt(F(Z(n)),t,void 0),"The character "+(Fn(1,o)+" is unknown. You should remove it.")):(Zn(4,n),A(n),A(n),53)}else switch(r){case 123:return zt(0,n),A(n),4;case 125:return Zn(0,n),A(n),5;default:return Cn(n)}}function wf(t,n){switch(lf(n)){case 0:let r=n.current;if(typeof r=="string")return 56;let i=r.VAL;if(i>=123){if(i<126)switch(i){case 123:return zt(0,n),A(n),4;case 124:let u=At(1,n),d=0;if(typeof u=="string"||u.NAME!=="Chr")d=2;else{let h=u.VAL;if(h!==62)if(h!==124)d=2;else return A(n),A(n),29;else return A(n),A(n),15}if(d===2)return X(nt(F(Z(n)),t,void 0),"The character | is unknown. You should remove it.");break;case 125:return Zn(0,n),A(n),5}}else{if(i>=97)return x_(n);switch(i){case 10:return A(n),55;case 33:let u=At(1,n);return typeof u=="string"||!(u.NAME==="Chr"&&u.VAL===61)?(A(n),19):(A(n),A(n),30);case 34:return A(n),zt(1,n),7;case 35:let d=At(1,n),h=0;if(typeof d=="string")h=2;else{if(d.NAME==="Chr"&&d.VAL-65>>>0<=25)return A(n),{TAG:8,_0:L1(n)};h=2}if(h===2)return X(nt(F(Z(n)),t,void 0),"The character # is unknown. You should remove it.");break;case 37:let y=At(1,n);return typeof y=="string"||!(y.NAME==="Chr"&&y.VAL===37)?(A(n),27):{TAG:0,_0:N1(n)};case 38:let x=At(1,n),C=0;if(typeof x=="string")C=2;else{if(x.NAME==="Chr"&&x.VAL===38)return A(n),A(n),28;C=2}if(C===2)return X(nt(F(Z(n)),t,void 0),"The character & is unknown. You should remove it.");break;case 39:A(n);let S=n.current,G;if(typeof S=="string")G=X(nt(void 0,t,void 0),"This char is not terminated. Please add a single-quote (') at the end.");else{let z=S.VAL;if(z!==92)A(n),G=["Char",z];else{let k=At(1,n);if(typeof k=="string")G=X(nt(F(Z(n)),t,void 0),"This char is not terminated. Please add a single-quote (') at the end.");else{let V=k.VAL;if(V>=40)V!==92?(A(n),G=wc(n)):(A(n),A(n),G=["Char",92]);else if(V>=32)switch(V){case 32:A(n),A(n),G=["Char",32];break;case 34:A(n),A(n),G=["Char",34];break;case 33:case 35:case 36:case 37:case 38:A(n),G=wc(n);break;case 39:A(n),A(n),G=["Char",39];break}else A(n),G=wc(n)}}}let D=n.current;return typeof D!="string"&&D.NAME==="Chr"&&D.VAL===39?(A(n),{TAG:7,_0:G}):X(nt(void 0,t,void 0),"This char is not terminated. Please add a single-quote (') at the end.");case 40:return A(n),zt(0,n),0;case 41:return A(n),Zn(0,n),1;case 42:let j=At(1,n);return typeof j=="string"||!(j.NAME==="Chr"&&j.VAL===42)?(A(n),24):(A(n),A(n),25);case 43:let M=At(1,n);return typeof M=="string"||!(M.NAME==="Chr"&&M.VAL===43)?(A(n),22):(A(n),A(n),34);case 44:return A(n),9;case 45:let O=At(1,n);return typeof O=="string"||!(O.NAME==="Chr"&&O.VAL===62)?(A(n),23):(A(n),A(n),14);case 46:let N=At(1,n);if(typeof N=="string")return A(n),11;if(N.NAME==="Chr"){let z=N.VAL;if(z>=48)return z>=58?(A(n),11):cf(n);if(z!==46)return A(n),11;let k=At(2,n);return typeof k=="string"||!(k.NAME==="Chr"&&k.VAL===46)?(A(n),A(n),12):(xc(n),13)}return A(n),11;case 47:let rt=At(1,n);if(typeof rt=="string")return A(n),26;if(rt.NAME==="Chr"){let z=rt.VAL;return z!==42?z!==47?(A(n),26):{TAG:1,_0:D1(n)}:{TAG:1,_0:Sf(void 0,n)}}return A(n),26;case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return cf(n);case 58:let it=At(1,n);return typeof it=="string"||!(it.NAME==="Chr"&&it.VAL===61)?(A(n),8):(A(n),A(n),18);case 59:return A(n),10;case 60:let Q=At(1,n);if(typeof Q=="string")return A(n),21;if(Q.NAME==="Chr"){let z=Q.VAL;if(z>=65)return z>=97?z>=123?(A(n),21):(zt(4,n),zt(2,n),gf(n)):z>=91?(A(n),21):(zt(4,n),zt(3,n),df(n));if(z===33)return hf(n);if(z>=47)switch(z){case 47:Zn(4,n);let k=At(2,n);if(typeof k=="string")return X(nt(F(Z(n)),t,void 0),`Your Template was not closed correctly.
38
+ You probably mismatched or forgot a closing tag.`);let V=k.VAL,gt=0;if(V<91)if(V!==62){if(V>=65)return bf(n);gt=2}else return xc(n),52;else{if(!(V>122||V<97))return yf(n);gt=2}if(gt===2)return X(nt(F(Z(n)),t,void 0),`Invalid Template tag!
39
+ Template tags have to start with an uppercase or lowercase letter. Instead saw: `+Fn(1,V));break;case 61:return A(n),A(n),33;case 62:return Cf(n);case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:case 58:case 59:case 60:case 63:return A(n),21;case 64:return zt(4,n),zt(2,n),pf(n)}else return A(n),21}else return A(n),21;break;case 61:let Ct=At(1,n);return typeof Ct=="string"||!(Ct.NAME==="Chr"&&Ct.VAL===61)?(A(n),17):(A(n),A(n),31);case 62:let P=At(1,n);return typeof P=="string"||!(P.NAME==="Chr"&&P.VAL===61)?(A(n),20):(A(n),A(n),32);case 63:return A(n),16;case 91:return A(n),2;case 93:return A(n),3;case 65:case 66:case 67:case 68:case 69:case 70:case 71:case 72:case 73:case 74:case 75:case 76:case 77:case 78:case 79:case 80:case 81:case 82:case 83:case 84:case 85:case 86:case 87:case 88:case 89:case 90:case 95:return x_(n);case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 11:case 12:case 13:case 14:case 15:case 16:case 17:case 18:case 19:case 20:case 21:case 22:case 23:case 24:case 25:case 26:case 27:case 28:case 29:case 30:case 31:case 32:case 36:case 64:case 92:case 94:case 96:break}}return A(n),wf(t,n);case 1:let o=n.current;if(typeof o=="string"||o.NAME!=="Chr")return A_(t,n);switch(o.VAL){case 34:return Zn(1,n),A(n),7;case 36:return ut(At(1,n),{NAME:"Chr",VAL:40})?(zt(0,n),A(n),A(n),6):A_(t,n);default:return A_(t,n)}case 2:let _=n.current;if(typeof _=="string")return X(nt(F(Z(n)),t,void 0),`Your Template was not closed correctly.
40
+ You probably mismatched or forgot a closing tag.`);let s=_.VAL;if(s>=62){if(s<91)return s>=63?s>=65?sf(n):Cn(n):(Zn(2,n),eo(t,n));if(s<123)return s>=97?sf(n):Cn(n);if(s>=126)return Cn(n);switch(s){case 123:return zt(0,n),A(n),4;case 124:return Cn(n);case 125:return Zn(0,n),A(n),5}}else{if(s!==34){if(s!==47)return s>=61?(A(n),17):Cn(n);let u=At(1,n);if(typeof u=="string")return X(nt(F(Z(n)),t,void 0),`Your Template was not closed correctly.
41
+ You probably mismatched or forgot a closing tag.`);let d=u.VAL;return d!==62?X(nt(F(Z(n)),t,void 0),"The character "+(Fn(1,d)+" is unknown. You should remove it.")):(Zn(2,n),eo(t,n))}return A(n),zt(1,n),7}case 3:let c=n.current;if(typeof c=="string")return X(nt(F(Z(n)),t,void 0),`Your Template was not closed correctly.
42
+ You probably mismatched or forgot a closing tag.`);let a=c.VAL;if(a>=62){if(a<97)return a!==95?a>=63?Cn(n):(Zn(3,n),eo(t,n)):x_(n);if(a<123)return x_(n);if(a>=126)return Cn(n);switch(a){case 123:return zt(0,n),A(n),4;case 124:return Cn(n);case 125:return Zn(0,n),A(n),5}}else{if(a!==34){if(a!==47)return a>=61?(A(n),17):Cn(n);let u=At(1,n);if(typeof u=="string")return X(nt(F(Z(n)),t,void 0),`Your Template was not closed correctly.
43
+ You probably mismatched or forgot a closing tag.`);let d=u.VAL;return d!==62?X(nt(F(Z(n)),t,void 0),"The character "+(Fn(1,d)+" is unknown. You should remove it.")):(Zn(3,n),eo(t,n))}return A(n),zt(1,n),7}case 4:return Ac(n),eo(t,n)}}function Hr(t){switch(lf(t)){case 1:break;case 4:Ac(t);break;default:ro(t)}let e=Z(t),r=wf(e,t),i=t.saw_characters_on_line?M1(t):0,o=Z(t),_=nt(F(o),e,void 0);return w_(_,i,r)}var X1=`library Base_Fn {
44
+ let default = fn (value, default) -> {
45
+ if (!value) {
46
+ default
47
+ } else {
48
+ value
49
+ }
50
+ };
51
+
52
+ let id = fn (x) -> x;
53
+ }
54
+ `,B1=`library Base_Portal {
55
+ let push = fn (name, element) -> %%pinc_portal_push%%;
56
+ }
57
+ `,O1=`library Base_Record {
58
+ let merge = fn (record1, record2) -> %%pinc_record_merge%%;
59
+ }
60
+ `,q1=`library Base_Math {
61
+ let floor = fn (n) -> %%pinc_math_floor%%;
62
+
63
+ let ceil = fn (n) -> -(floor(-n));
64
+ }
65
+ `,F1=`library Base_Array {
66
+ let make = fn (length) -> {
67
+ 0..length
68
+ };
69
+
70
+ let init = fn (length, f) -> {
71
+ for (index in make(length)) {
72
+ f(index)
73
+ }
74
+ };
75
+
76
+ let length = fn (array) -> %%pinc_array_length%%;
77
+
78
+ let append = fn (array1, array2) -> %%pinc_array_append%%;
79
+
80
+ let rev = fn (array) -> {
81
+ let mutable result = [];
82
+
83
+ for (value in array) {
84
+ result := append([value], result);
85
+ };
86
+
87
+ result
88
+ };
89
+
90
+ let first = fn (array) -> {
91
+ array[0]
92
+ };
93
+
94
+ let map = fn (array, f) -> {
95
+ for (item in array) {
96
+ f(item)
97
+ }
98
+ };
99
+
100
+ let map_reverse = fn (array, f) -> {
101
+ for (item in rev(array)) {
102
+ f(item)
103
+ }
104
+ };
105
+
106
+ let mapi = fn (array, f) -> {
107
+ for (index, item in array) {
108
+ f(index, item)
109
+ }
110
+ };
111
+
112
+ let mapi_reverse = fn (array, f) -> {
113
+ for (index, item in rev(array)) {
114
+ f(index, item)
115
+ }
116
+ };
117
+
118
+ let last = fn (array) -> {
119
+ let len = length(array);
120
+ if (len > 0) {
121
+ array[len - 1]
122
+ }
123
+ };
124
+
125
+ let take_until = fn (array, condition) -> {
126
+ for (item in array) {
127
+ if (condition(item)) {
128
+ break;
129
+ };
130
+ item
131
+ }
132
+ };
133
+
134
+ let slice = fn (array, offset, length) -> {
135
+ for (index, item in array) {
136
+ if (index < offset) {
137
+ continue;
138
+ };
139
+ if (index == length + offset) {
140
+ break;
141
+ };
142
+ item
143
+ }
144
+ };
145
+
146
+ let chunk = fn (array, size) -> {
147
+ let len = length(array);
148
+ let x = Base_Math.ceil(len / size);
149
+ 0..x
150
+ |> mapi(fn (index, item) -> { slice(array, index * size, size) })
151
+ };
152
+
153
+ let join = fn (array, sep) -> {
154
+ let mutable result = "";
155
+ for (index, item in array) {
156
+ if (index > 0) {
157
+ result := result ++ sep;
158
+ };
159
+ result := result ++ item;
160
+ };
161
+ result
162
+ };
163
+
164
+ let partition = fn (array, condition) -> {
165
+ let len = length(array);
166
+ let part = fn (yes, no, index) -> {
167
+ if (index == len) {
168
+ [yes, no]
169
+ } else {
170
+ let item = array[index];
171
+ if (condition(item)) {
172
+ part(append(yes, [item]), no, index + 1)
173
+ } else {
174
+ part(yes, append(no, [item]), index + 1)
175
+ }
176
+ }
177
+ };
178
+ part([], [], 0)
179
+ };
180
+
181
+ let filter = fn (array, condition) -> {
182
+ let len = length(array);
183
+ let aux = fn (acc, index) -> {
184
+ if (index == len) {
185
+ acc
186
+ } else {
187
+ let item = array[index];
188
+ if (condition(item)) {
189
+ aux(append(acc, [item]), index + 1)
190
+ } else {
191
+ aux(acc, index + 1)
192
+ }
193
+ }
194
+ };
195
+
196
+ aux([], 0)
197
+ };
198
+
199
+ let keep = filter;
200
+
201
+ let find = fn (array, condition) -> {
202
+ let len = length(array);
203
+ let aux = fn (index) -> {
204
+ if (index < len) {
205
+ let item = array[index];
206
+ if (condition(item)) {
207
+ item
208
+ } else {
209
+ aux(index + 1)
210
+ }
211
+ }
212
+ };
213
+
214
+ aux(0)
215
+ };
216
+
217
+ let exists = fn (array, condition) -> {
218
+ let len = length(array);
219
+ let aux = fn (index) -> {
220
+ if (index < len) {
221
+ let item = array[index];
222
+ if (condition(item)) {
223
+ true
224
+ } else {
225
+ aux(index + 1)
226
+ }
227
+ } else {
228
+ false
229
+ }
230
+ };
231
+
232
+ aux(0)
233
+ };
234
+
235
+ let some = exists;
236
+
237
+ let for_all = fn (array, condition) -> {
238
+ let len = length(array);
239
+ let aux = fn (acc, index) -> {
240
+ if (index == len || acc == false) {
241
+ acc
242
+ } else {
243
+ let item = array[index];
244
+ aux(acc && condition(item), index + 1)
245
+ }
246
+ };
247
+
248
+ aux(true, 0)
249
+ };
250
+
251
+ let every = for_all;
252
+
253
+ let fold_lefti = fn (array, init, f) -> {
254
+ let len = length(array);
255
+ let aux = fn (acc, index) -> {
256
+ if (index == len || acc == false) {
257
+ acc
258
+ } else {
259
+ let item = array[index];
260
+ let acc = f(acc, item, index);
261
+ aux(acc, index + 1)
262
+ }
263
+ };
264
+
265
+ aux(init, 0)
266
+ };
267
+
268
+ let reducei = fold_lefti;
269
+
270
+ let fold_left = fn (array, init, f) -> {
271
+ fold_lefti(array, init, fn (acc, curr, index) -> { f(acc, curr) })
272
+ };
273
+
274
+ let reduce = fold_left;
275
+
276
+ let group = fn (array, size) -> {
277
+ let array_length = length(array);
278
+ let group_size = Base_Math.floor`,z1=`library Base_String {
279
+ let length = fn (string) -> %%pinc_string_length%%;
280
+ let characters = fn (string) -> %%pinc_string_characters%%;
281
+
282
+ let map = fn (string, f) -> {
283
+ let mutable result = "";
284
+ for (char in characters(string)) {
285
+ result := result ++ f(char);
286
+ };
287
+ result
288
+ };
289
+
290
+ let map_reverse = fn (string, f) -> {
291
+ let mutable result = "";
292
+ for (char in Base_Array.rev(characters(string))) {
293
+ result := result ++ f(char);
294
+ };
295
+ result
296
+ };
297
+
298
+ let mapi = fn (string, f) -> {
299
+ let mutable result = "";
300
+ for (index, char in characters(string)) {
301
+ result := result ++ f(index, char);
302
+ };
303
+ result
304
+ };
305
+
306
+ let mapi_reverse = fn (string, f) -> {
307
+ let mutable result = "";
308
+ for (index, char in Base_Array.rev(characters(string))) {
309
+ result := result ++ f(index, char);
310
+ };
311
+ result
312
+ };
313
+
314
+ let iter = fn (string, f) -> {
315
+ for (char in characters(string)) {
316
+ f(char)
317
+ }
318
+ };
319
+
320
+ let iter_reverse = fn (string, f) -> {
321
+ for (char in Base_Array.rev(characters(string))) {
322
+ f(char)
323
+ }
324
+ };
325
+
326
+ let iteri = fn (string, f) -> {
327
+ for (index, char in characters(string)) {
328
+ f(index, char)
329
+ }
330
+ };
331
+
332
+ let iteri_reverse = fn (string, f) -> {
333
+ for (index, char in Base_Array.rev(characters(string))) {
334
+ f(index, char)
335
+ }
336
+ };
337
+
338
+ let uppercase_ascii = fn (string) -> {
339
+ map(string, fn (c) -> { if (c >= 'a' && c <= 'z') c - 32 else c })
340
+ };
341
+
342
+ let lowercase_ascii = fn (string) -> {
343
+ map(string, fn (c) -> { if (c >= 'A' && c <= 'Z') c + 32 else c })
344
+ };
345
+
346
+ let capitalize_ascii = fn (string) -> {
347
+ mapi(string, fn (index, c) -> { if (index == 0 && c >= 'a' && c <= 'z') c - 32 else c })
348
+ };
349
+
350
+ let nl2br = fn (string) -> {
351
+ let mutable result = "";
352
+ for (char in characters(string)) {
353
+ if (Base_Char.is_newline(char)) {
354
+ result := result ++ "<br>";
355
+ } else {
356
+ result := result ++ char;
357
+ }
358
+ };
359
+ result
360
+ };
361
+
362
+ let sub = fn (string, ofs, len) -> %%pinc_string_sub%%;
363
+
364
+ let trim = fn (string) -> {
365
+ let len = length(string);
366
+ let mutable i = 0;
367
+ let mutable j = len - 1;
368
+ for (char in characters(string)) {
369
+ if (Base_Char.is_whitespace(char)) {
370
+ i := i + 1;
371
+ } else {
372
+ break;
373
+ }
374
+ };
375
+
376
+ for (char in Base_Array.rev(characters(string))) {
377
+ if (Base_Char.is_whitespace(char)) {
378
+ j := j - 1;
379
+ } else {
380
+ break;
381
+ }
382
+ };
383
+
384
+ if (j >= i) {
385
+ sub(string, i, (j - i + 1))
386
+ } else {
387
+ ""
388
+ }
389
+ };
390
+
391
+ let split = fn (string, sep) -> {
392
+ let mutable result = [];
393
+ let chars = characters(string);
394
+ let mutable j = Base_Array.length(chars);
395
+
396
+ for (i in Base_Array.rev(0...j)) {
397
+ if (chars[i] == sep) {
398
+ let slice = Base_Array.slice(chars, i + 1, j - i - 1);
399
+ j := i;
400
+ result := Base_Array.append([Base_Array.join(slice, "")], result);
401
+ }
402
+ };
403
+
404
+ Base_Array.append([Base_Array.join(Base_Array.slice(chars, 0, j), "")], result)
405
+ };
406
+ }
407
+ `,V1=`library Base_Char {
408
+ let is_whitespace = fn (char) -> {
409
+ char == ' ' || char == '\\012' || char == '\\n' || char == '\\r' || char == '\\t'
410
+ };
411
+
412
+ let is_newline = fn (char) -> {
413
+ char == '\\n' || char == '\\r'
414
+ };
415
+ }
416
+ `,H1=`library Base_Html {
417
+ let with_attribute = fn (element, key, value) -> %%pinc_html_with_attribute%%;
418
+ }
419
+ `,R1=`(array_length / size);
420
+
421
+ 0..size
422
+ |> fold_lefti(
423
+ [],
424
+ fn (acc, curr, index) -> {
425
+ append(
426
+ acc,
427
+ [slice(array, index * group_size, if (index == size - 1) array_length else group_size)],
428
+ )
429
+ },
430
+ )
431
+ };
432
+
433
+ let nth = fn (array, index) -> {
434
+ array[index]
435
+ };
436
+
437
+ let sort = fn (array, f) -> {
438
+ let merge = fn (a, b) -> {
439
+ let len_a = length(a);
440
+ if (len_a == 0) {
441
+ b
442
+ } else {
443
+ let len_b = length(b);
444
+ if (len_b == 0) {
445
+ a
446
+ } else {
447
+ let first_a = a[0];
448
+ let first_b = b[0];
449
+ if (f(first_a, first_b) < 0) {
450
+ append([first_a], merge(slice(a, 1, len_a), b))
451
+ } else {
452
+ append([first_b], merge(a, slice(b, 1, len_b)))
453
+ }
454
+ }
455
+ }
456
+ };
457
+
458
+ let len = length(array);
459
+ if (len < 2) {
460
+ array
461
+ } else {
462
+ let h = Base_Math.ceil(len / 2);
463
+ let first_half = array
464
+ |> slice(0, h);
465
+ let second_half = array
466
+ |> slice(h, len);
467
+ merge(sort(first_half, f), sort(second_half, f))
468
+ }
469
+ };
470
+
471
+ let unique = fn (array) -> {
472
+ let isSorted = false;
473
+ let mutable result = [];
474
+ let mutable seen = [];
475
+
476
+ for (index, value in array) {
477
+ if (index == 0 || !exists(seen, fn (item) -> item == value)) {
478
+ seen := append(seen, [value]);
479
+ result := append(result, [value]);
480
+ }
481
+ };
482
+
483
+ result
484
+ };
485
+ }
486
+ `;function U1(t){switch(t){case"/Base_Array.pi":case"Base_Array.pi":return{hd:F1,tl:{hd:R1,tl:0}};case"/Base_Char.pi":case"Base_Char.pi":return{hd:V1,tl:0};case"/Base_Fn.pi":case"Base_Fn.pi":return{hd:X1,tl:0};case"/Base_Html.pi":case"Base_Html.pi":return{hd:H1,tl:0};case"/Base_Math.pi":case"Base_Math.pi":return{hd:q1,tl:0};case"/Base_Portal.pi":case"Base_Portal.pi":return{hd:B1,tl:0};case"/Base_Record.pi":case"Base_Record.pi":return{hd:O1,tl:0};case"/Base_String.pi":case"Base_String.pi":return{hd:z1,tl:0};default:return}}var xf={hd:"Base_Array.pi",tl:{hd:"Base_Char.pi",tl:{hd:"Base_Fn.pi",tl:{hd:"Base_Html.pi",tl:{hd:"Base_Math.pi",tl:{hd:"Base_Portal.pi",tl:{hd:"Base_Record.pi",tl:{hd:"Base_String.pi",tl:0}}}}}}}};function Af(t){let n=U1(t);if(n!==void 0)return n&&!n.tl?n.hd:xn("",n)}function Y1(t){switch(t){case 6:case 7:return 50;case 10:return 70;case 8:case 9:case 11:return 60;case 12:return 40;case 13:return 20;case 14:return 10;case 15:return 110;case 16:case 17:return 0;case 18:case 19:return 5;default:return 30}}function Q1(t){return t===10?1:0}function K1(t){switch(t){case 0:return"==";case 1:return"!=";case 2:return">";case 3:return">=";case 4:return"<";case 5:return"<=";case 6:return"+";case 7:return"-";case 8:return"*";case 9:return"/";case 10:return"**";case 11:return"%";case 12:return"++";case 13:return"&&";case 14:return"||";case 15:return".";case 16:return"[";case 17:return"|>";case 18:return"..";case 19:return"..."}}var E_={get_precedence:Y1,get_associativity:Q1,to_string:K1};function Z1(t){return 100}function J1(t){return t===0?"-...":"!..."}var Ef={get_precedence:Z1,to_string:J1};function nh(t){let n=Wi(t.next);return n!==void 0?n:Hr(t.lexer)}function et(t){let n=nh(t);t.prev_token=t.token,t.token=n}function eh(t){let n=t.token;for(;;){let r=n.typ;if(typeof r!="object"&&typeof r!="function"){if(r!==55)return r}else if(r.TAG!==1)return r;let i=Hr(t.lexer);pe(i,t.next),n=i}}function Gc(t){let n=Zo(t.next),e;if(n!==void 0)e=n;else{let r=Hr(t.lexer);pe(r,t.next),e=r}return e.typ}function rh(t){let n=va(kl(t.next)),e;if(n){let r=n.tl;if(r)e=r.hd;else{let i=Hr(t.lexer);pe(i,t.next),e=i}}else{let r=Hr(t.lexer);pe(r,t.next);let i=Hr(t.lexer);pe(i,t.next),e=i}return e.typ}function $n(t,n){let e=ut(n.token.typ,t);return e&&et(n),e}function Xt(t,n){return ut(n.token.typ,t)?et(n):X(n.token.location,"Expected: `"+(Ie(t)+("`, got `"+(Ie(n.token.typ)+"`"))))}function ih(t){let n=af(t),e=Ye.make(t,0,0),r=nt(void 0,e,void 0),i=w_(r,0,56),o={lexer:n,prev_token:i,token:i,next:jl()};return et(o),o}function hi(t,n,e){let r=n!==void 0?n:"All",i=e.token.location,o=e.token.typ;if(!(typeof o!="object"&&typeof o!="function"))switch(o.TAG){case 2:if(ut(r,"Lower")||ut(r,"All"))return et(e),[o._0,i];break;case 3:if(ut(r,"Upper")||ut(r,"All"))return et(e),[o._0,i];break}if(ut(r,"Lower")){let s;if(t!==void 0)s=t;else if(typeof o!="object"&&typeof o!="function")s="Expected to see a lowercase identifier at this point. Instead saw "+Ie(o);else if(o.TAG===3){let c=o._0;s="Expected to see a lowercase identifier at this point. Did you mean "+(Xo(c)+(" instead of "+(c+"?")))}else s="Expected to see a lowercase identifier at this point. Instead saw "+Ie(o);return X(i,s)}if(!ut(r,"Upper"))return X(i,t!==void 0?t:rf(o)?'"'+(Ie(o)+'" is a keyword. Please choose another name.'):"Expected to see an identifier at this point.");let _;if(t!==void 0)_=t;else if(typeof o!="object"&&typeof o!="function"||o.TAG!==2)_="Expected to see an uppercase identifier at this point.";else{let s=o._0;_="Expected to see an uppercase identifier at this point. Did you mean "+(kr(s)+(" instead of "+(s+"?")))}return X(i,_)}function pi(t,n,e){let r=0;for(;;){let i=r,o=$n(t,e),_=b(n,e);if(_===void 0)return Yt(i);if(!(o||ut(i,0)))return X(e.token.location,"Expected list to be separated by `"+(Ie(t)+"`"));r={hd:wt(_),tl:i}}}function dr(t,n){let e=0;for(;;){let r=e,i=b(t,n);if(i===void 0)return Yt(r);e={hd:wt(i),tl:r}}}function pr(t){let n=0;for(;;){let e=n,r=t.token.typ;if(typeof r!="object"&&typeof r!="function"){if(r!==55)return Yt(e);if(ut(Gc(t),55)){et(t);continue}et(t),n={hd:0,tl:e};continue}else{if(r.TAG!==1)return Yt(e);et(t),n={hd:{TAG:0,_0:r._0},tl:e};continue}}}function oh(t){let n=t.token.typ,e;if(typeof n!="object"&&typeof n!="function")switch(n){case 19:e=1;break;case 23:e=0;break;default:e=void 0}else e=void 0;return Jt(e,(function(r){return et(t),Jt(Nn(Ef.get_precedence(r),t),(function(i){return{TAG:17,_0:r,_1:i}}))}))}function Tc(t){let n=pr(t),e=t.token,r=t.token.typ,i,o=0;if(typeof r!="object"&&typeof r!="function")switch(r){case 36:let s=function(a,u,d){for(;;){let h=u,y=a,x=d.token;et(d);let C=$n(38,d),S=hi(void 0,"Lower",d),G=$n(16,d);Xt(17,d);let D=d.token,j=Nn(void 0,d),M=j!==void 0?j:X(Kn(x.location,D.location,void 0),"Expected expression as right hand side of let declaration"),N=[G,C,{TAG:0,_0:S},M],rt=M.expression_desc,it,Q=0;typeof rt!="object"&&typeof rt!="function"||rt.TAG!==8?Q=1:it=!0,Q===1&&(it=y?X(M.expression_loc,"All expressions in `let ... and` declarations must be function definitions"):!1);let Ct=eh(d);if(!(typeof Ct!="object"&&typeof Ct!="function"))return Yt({hd:N,tl:h});if(Ct!==37)return Yt({hd:N,tl:h});if(!it)return X(M.expression_loc,"All expressions in `let ... and` declarations must be function definitions");pr(d),u={hd:N,tl:h},a=!0}}(!1,0,t),c;if(s)c=s.tl?{TAG:1,_0:s}:{TAG:0,_0:s.hd};else throw new p("Assert_failure",{MEL_EXN_ID:"Assert_failure",_1:["lib/pinc_parser/parser.ml",493,20]});i=c;break;case 45:et(t),i=0;break;case 46:et(t),i=1;break;default:o=1}else if(r.TAG===2&&ut(Gc(t),18)){let _=t.token,s=t.token.location;et(t),et(t);let c=t.token,a=Nn(void 0,t),u=a!==void 0?a:X(Kn(_.location,c.location,void 0),"Expected expression as right hand side of mutation statement");i={TAG:2,_0:{TAG:0,_0:[r._0,s]},_1:u}}else o=1;return o===1&&(i=Jt(Nn(void 0,t),(function(_){return{TAG:3,_0:_}}))),Jt(i,(function(_){let s=t.token;return{statement_loc:Kn(e.location,s.location,void 0),statement_desc:_,statement_annotations:n}}))}function $_(t){let n=pr(t),e=t.token,r=t.token.indentation,i=t.token.typ,o;if(typeof i!="object"&&typeof i!="function")switch(i){case 4:let _=t.token;et(t);let s=t.token.typ,c;c=typeof s!="object"&&typeof s!="function"||s.TAG!==1?void 0:s._0;let a=Nn(void 0,t),u;if(a!==void 0)u={TAG:4,_0:a};else{let h=Kn(_.location,t.token.location,void 0);c!==void 0?u={TAG:5,_0:c}:(su(h,"Expected to see an expression between these braces. \nThis is currently not doing anything, so you can safely remove it.\nIf you wanted to have an empty record here, you need to write `{{}}`"),u={TAG:4,_0:{expression_loc:h,expression_desc:{TAG:6,_0:0},expression_parenthesized:!1,expression_annotations:0}})}Xt(5,t),o=u;break;case 51:et(t);let d=dr($_,t);Xt(52,t),o={TAG:3,_0:d};break;default:o=void 0}else switch(i.TAG){case 10:case 11:et(t),o={TAG:6,_0:i._0};break;case 12:let _=i._0;et(t);let s=17,c=dr((function(j){return io(s,j)}),t),a=$n(53,t),u;if(a)u=0;else{Xt(54,t);let j=dr($_,t);Xt({TAG:13,_0:_},t),u=j}o={TAG:0,html_tag_identifier:_,html_tag_attributes:c,html_tag_children:u};break;case 14:let d=i._0,h={TAG:0,_0:[d,t.token.location]};et(t);let y=17,x=dr((function(j){return io(y,j)}),t),C=$n(53,t),S;if(C)S=0;else{Xt(54,t);let j=dr($_,t);Xt({TAG:15,_0:d},t),S=j}o={TAG:1,component_tag_identifier:h,component_tag_attributes:x,component_tag_children:S};break;case 16:et(t);let G=17,D=dr((function(j){return io(G,j)}),t);Xt(53,t),o={TAG:2,portal_tag_name:i._0,portal_tag_attributes:D};break;default:o=void 0}return Jt(o,(function(_){let s=t.prev_token;return{template_node_loc:Kn(e.location,s.location,void 0),template_node_desc:_,template_node_annotations:n,template_node_indent:r}}))}function _h(t){let n=t.token.typ;if(typeof n!="object"&&typeof n!="function"||n.TAG!==2)return;let e=n._0;et(t);let r=$n(16,t)?"Optional":"Required";Xt(8,t);let i=Nn(void 0,t);return En((function(o){return[e,[r,o]]}),i)}function sh(t){let n=t.token.location,e=t.token.typ,r;if(typeof e!="object"&&typeof e!="function")if(e===6){et(t);let i=hi(`Only lowercase identifiers are allowed as string interpolation placeholders.
487
+ If you want to use more complex constructs, you can always assign them to a let binding.`,"Lower",t);Xt(1,t),r={TAG:0,_0:{TAG:0,_0:i}}}else r=void 0;else e.TAG===6?(et(t),r={TAG:1,_0:e._0}):r=void 0;return Jt(r,(function(i){let o=t.token.location;return{string_template_loc:Kn(n,o,void 0),string_template_desc:i}}))}function $c(t){let n=pr(t),e=t.token.location,r=t.token.typ,i,o=0;if(typeof r!="object"&&typeof r!="function"&&r===4){et(t);let s=function(c){for(;;){let a=c,u=Tc(t);if(u===void 0)return Yt(a);if(!$n(10,t))return Yt({hd:u,tl:a});c={hd:u,tl:a}}}(0);Xt(5,t),i=[!1,{TAG:15,_0:s}]}else o=1;return o===1&&(i=Jt(Nn(void 0,t),(function(_){return[_.expression_parenthesized,_.expression_desc]}))),Jt(i,(function(_){let s=t.token.location;return{expression_loc:Kn(e,s,void 0),expression_desc:_[1],expression_parenthesized:_[0],expression_annotations:n}}))}function ch(t,n){let e=n.token,r;if($n(0,n)){let s=pi(9,(function(c){return io(void 0,c)}),n);Xt(1,n),r=s}else r=0;let i;switch(t){case"Array":i=4;break;case"Boolean":i=3;break;case"Float":i=2;break;case"GetContext":i=9;break;case"Int":i=1;break;case"Record":i=5;break;case"SetContext":i=8;break;case"Slot":i=6;break;case"Store":i=7;break;case"String":i=0;break;default:i={TAG:0,_0:t}}return{TAG:12,_0:{tag_loc:Kn(e.location,n.token.location,void 0),tag_desc:{tag:i,attributes:r}}}}function $f(t){let n=t.token.typ;if(typeof n!="object"&&typeof n!="function"||n.TAG!==2)return;let e=t.token.location;return et(t),{TAG:0,_0:[n._0,e]}}function Nn(t,n){let e=t!==void 0?t:-999,r=function(i,o,_){for(;;){let s=o,c=_.token.location,a=_.token.typ;if(typeof a!="object"&&typeof a!="function")switch(a){case 0:let j=pr(_);et(_);let M=pi(9,(function(Q){return Nn(void 0,Q)}),_),O={TAG:9,function_definition:s,arguments:M};Xt(1,_);let N=_.token.location;o={expression_loc:Kn(c,N,void 0),expression_desc:O,expression_parenthesized:!1,expression_annotations:j};continue;case 10:return s}let u=lh(_);if(u===void 0)return s;let d=E_.get_precedence(u);if(d<i)return s;let h=pr(_);et(_);let y=E_.get_associativity(u),x;x=y===0?d+1|0:d;let C;if(u===15){let j=hi(void 0,"Lower",_),M=j[1],O={TAG:11,_0:j[0]};C={TAG:18,_0:s,_1:u,_2:{expression_loc:M,expression_desc:O,expression_parenthesized:!1,expression_annotations:0}}}else{let j=Nn(x,_);C=j!==void 0?{TAG:18,_0:s,_1:u,_2:j}:X(_.token.location,"Expected expression on right hand side of `"+(E_.to_string(u)+"`"))}u===16&&Xt(3,_);let S=_.token.location;o={expression_loc:Kn(c,S,void 0),expression_desc:C,expression_parenthesized:!1,expression_annotations:h}}};return Jt(ah(n),(function(i){return r(e,i,n)}))}function io(t,n){let e=t!==void 0?t:8,r=n.token.typ;if(typeof r!="object"&&typeof r!="function"||r.TAG!==2)return;let i=r._0;et(n),Xt(e,n);let o=Nn(void 0,n);return En((function(_){return[i,_]}),o)}function ah(t){let n=pr(t),e=t.token.location,r=t.token.typ,i,o=0;if(typeof r!="object"&&typeof r!="function")switch(r){case 0:et(t);let _=Nn(void 0,t);Xt(1,t);let s=t.token.location;i=En((function(P){return[!0,P.expression_desc,s]}),_);break;case 2:et(t);let c=pi(9,(function(P){return Nn(void 0,P)}),t),a=t.token.location;Xt(3,t),i=[!1,{TAG:5,_0:c},a];break;case 4:let u=Gc(t),d=rh(t),h;if(typeof u!="object"&&typeof u!="function")h=u===5;else if(u.TAG===2&&typeof d!="object"&&typeof d!="function")switch(d){case 8:case 16:h=!0;break;default:h=!1}else h=!1;if(h){et(t);let P=pi(9,_h,t);Xt(5,t);let z=t.token.location;i=[!1,{TAG:6,_0:P},z]}else i=Jt($c(t),(function(P){let z=t.token.location;return[!1,P.expression_desc,z]}));break;case 7:et(t);let y=dr(sh,t),x=t.token.location;Xt(7,t),i=[!1,{TAG:0,_0:y},x];break;case 35:let C=t.token.location;et(t);let S=$n(0,t),G;if(S){let P=pi(9,$f,t);Xt(1,t),G=P}else{let P=$f(t);G=P!==void 0?{hd:P,tl:0}:X(C,"Expected this function to have exactly one parameter,\nor a `()` if no parameter is needed.")}let D=t.token.location;Xt(14,t);let j=t.token.typ,M=0;if(typeof j!="object"&&typeof j!="function"||j.TAG!==0)M=3;else{let P=t.token.location;et(t),i=[!1,{TAG:7,parameters:G,name:j._0},P]}M===3&&(i=Jt($c(t),(function(P){return[!1,{TAG:8,parameters:G,body:P},D]})));break;case 39:let O=t.token.location;et(t),i=[!1,{TAG:4,_0:!0},O];break;case 40:let N=t.token.location;et(t),i=[!1,{TAG:4,_0:!1},N];break;case 41:et(t),$n(0,t),i=Jt(Nn(void 0,t),(function(P){let z=t.token.location;$n(1,t);let k=Tc(t),V;if(k!==void 0){let gt=0,tt=k.statement_desc;if(typeof tt!="object"&&typeof tt!="function"||tt.TAG!==3)gt=1;else{let St=tt._0;V={expression_loc:St.expression_loc,expression_desc:St.expression_desc,expression_parenthesized:St.expression_parenthesized,expression_annotations:oe(k.statement_annotations,St.expression_annotations)}}gt===1&&(V={expression_loc:k.statement_loc,expression_desc:{TAG:15,_0:{hd:k,tl:0}},expression_parenthesized:!1,expression_annotations:k.statement_annotations})}else V=void 0;return Jt(V,(function(gt){let tt;if($n(42,t)){let St=Tc(t);if(St!==void 0){let lt=0,J=St.statement_desc;if(typeof J!="object"&&typeof J!="function"||J.TAG!==3)lt=1;else{let Mt=J._0;tt={expression_loc:Mt.expression_loc,expression_desc:Mt.expression_desc,expression_parenthesized:Mt.expression_parenthesized,expression_annotations:oe(St.statement_annotations,Mt.expression_annotations)}}lt===1&&(tt={expression_loc:St.statement_loc,expression_desc:{TAG:15,_0:{hd:St,tl:0}},expression_parenthesized:!1,expression_annotations:St.statement_annotations})}else tt=void 0}else tt=void 0;return[!1,{TAG:16,condition:P,consequent:gt,alternate:tt},z]}))}));break;case 43:et(t),$n(0,t);let rt=hi(void 0,"Lower",t),it;if($n(9,t)){let P=hi(void 0,"Lower",t);it=[{TAG:0,_0:rt},P]}else it=[void 0,rt];let Q=it[0],Ct={TAG:0,_0:it[1]};Xt(44,t),i=Jt(Nn(void 0,t),(function(P){$n(1,t);let z=t.token.location,k=$c(t);return k!==void 0?[!1,{TAG:13,index:Q,iterator:Ct,iterable:P,body:k},z]:X(t.token.location,"Expected expression as body of for loop")}));break;case 50:case 51:o=2;break;default:o=1}else switch(r.TAG){case 2:let _=t.token.location;et(t),i=[!1,{TAG:11,_0:r._0},_];break;case 3:let s=t.token.location;et(t),i=[!1,{TAG:10,_0:r._0},s];break;case 4:let c=t.token.location;et(t),i=[!1,{TAG:2,_0:r._0},c];break;case 5:let a=t.token.location;et(t),i=[!1,{TAG:3,_0:r._0},a];break;case 7:let u=t.token.location;et(t),i=[!1,{TAG:1,_0:r._0},u];break;case 8:let d=t.token.location;et(t),i=En((function(h){return[!1,h,d]}),ch(r._0,t));break;case 10:case 11:case 12:case 14:case 16:o=2;break;default:o=1}switch(o){case 1:i=En((function(_){return[!1,_,t.token.location]}),oh(t));break;case 2:i=Jt($_(t),(function(_){let s=t.token.location;return[!1,{TAG:14,_0:_},s]}));break}return Jt(i,(function(_){return{expression_loc:Kn(e,_[2],void 0),expression_desc:_[1],expression_parenthesized:_[0],expression_annotations:n}}))}function lh(t){let n=t.token.typ;if(typeof n!="object"&&typeof n!="function")switch(n){case 2:return 16;case 11:return 15;case 12:return 18;case 13:return 19;case 15:return 17;case 20:return 2;case 21:return 4;case 22:return 6;case 23:return 7;case 24:return 8;case 25:return 10;case 26:return 9;case 27:return 11;case 28:return 13;case 29:return 14;case 30:return 1;case 31:return 0;case 32:return 3;case 33:return 5;case 34:return 12;default:return}}function uh(t){let n=pr(t),e=t.token.location,r=t.token.typ,i;if(typeof r!="object"&&typeof r!="function")switch(r){case 47:et(t),i=0;break;case 48:et(t),i=1;break;case 49:et(t),i=2;break;case 56:i=void 0;break;default:i=X(t.token.location,"Expected to see a declaration (page, component, store or library).")}else i=X(t.token.location,"Expected to see a declaration (page, component, store or library).");return Jt(i,(function(o){let _=hi(void 0,"Upper",t)[0],s;if($n(0,t)){let h=pi(9,(function(y){return io(void 0,y)}),t);Xt(1,t),s=h}else s=0;let c=Nn(void 0,t),a=c!==void 0?c:X(t.token.location,"Expected declaration to have a body"),u=t.token.location,d=Kn(e,u,void 0);return[_,{declaration_loc:d,declaration_kind:o,declaration_attributes:s,declaration_body:a,declaration_annotations:n}]}))}function fh(t){let n=ih(t);return dr(uh,n)}var mh=gn((function(t){return{TAG:1,_0:t,_1:$u(Af(t))}}),xf);function Tf(t,n){return Yt(_t((function(i,o){let _=fh(o);return _t((function(s,c){let a=c[1],u=c[0];if(Li(u,s)===void 0)return{hd:[u,a],tl:s};let h="Found multiple declarations with identifier `"+(u+"`.\nEvery declaration has to have a unique name in pinc.");return X(a.declaration_loc,h)}),i,_)}),0,oe((t!==void 0?t:!0)?mh:0,n)))}function Gf(t){return Ja((function(n){return n>=91?n>=97?n<123:n===95:n>=58?n>=65:n>=48}),t)}var hh={tags:0,current_identifier:void 0,tag_path:0};function Ke(t,n){let e=n._0;return[t,{TAG:0,_0:[e[0],e[1]]}]}function T_(t,n){let e=n.template_node_desc,r;switch(e.TAG){case 0:r=Sh(t,e.html_tag_identifier,e.html_tag_attributes,e.html_tag_children);break;case 1:r=wh(t,e.component_tag_identifier,e.component_tag_attributes,e.component_tag_children);break;case 2:r=bh(t,e.portal_tag_name,e.portal_tag_attributes);break;case 3:r=Ch(t,e._0);break;case 4:r=yh(t,e._0);break;case 5:r=[t,{TAG:5,_0:""}];break;case 6:r=[t,{TAG:5,_0:e._0}];break}return[r[0],{template_node_loc:n.template_node_loc,template_node_desc:r[1]}]}function gh(t,n){let e=n._0;return[t,{TAG:0,_0:[e[0],e[1]]}]}function It(t,n){let e=n.expression_desc,r;if(typeof e!="object"&&typeof e!="function")r=[t,0];else switch(e.TAG){case 0:r=Dh(t,e._0);break;case 1:r=[t,{TAG:1,_0:e._0[1]}];break;case 2:r=[t,{TAG:2,_0:e._0}];break;case 3:r=[t,{TAG:3,_0:e._0}];break;case 4:r=[t,{TAG:4,_0:e._0}];break;case 5:r=Ih(t,e._0);break;case 6:r=Bh(t,e._0);break;case 7:r=kh(t,n.expression_loc,e.parameters,e.name);break;case 8:r=Oh(t,e.parameters,e.body);break;case 9:r=Lh(t,e.function_definition,e.arguments);break;case 10:r=[t,{TAG:10,_0:e._0}];break;case 11:r=[t,{TAG:11,_0:e._0}];break;case 12:r=Nh(t,e._0);break;case 13:r=Gh(t,e.index,e.iterator,e.iterable,e.body);break;case 14:r=Xh(t,e._0);break;case 15:r=Mh(t,e._0);break;case 16:r=jh(t,e.condition,e.consequent,e.alternate);break;case 17:r=Ph(t,e._0,e._1);break;case 18:r=vh(t,e._0,e._1,e._2);break}return[r[0],{expression_loc:n.expression_loc,expression_desc:r[1]}]}function bh(t,n,e){let r=Ir(b(Ee,e),t,It);return[r[0],{TAG:3,portal_tag_name:n,portal_tag_attributes:r[1]}]}function yh(t,n){let e=It(t,n);return[e[0],{TAG:4,_0:e[1]}]}function Ch(t,n){let e=he.fold_map(n,t,T_);return[e[0],{TAG:2,_0:e[1]}]}function Sh(t,n,e,r){let i=Ir(b(Ee,e),t,It),o=he.fold_map(r,i[0],T_);return[o[0],{TAG:0,html_tag_identifier:n,html_tag_attributes:i[1],html_tag_children:o[1]}]}function wh(t,n,e,r){let i=gh(t,n),o=Ir(b(Ee,e),i[0],It),_=he.fold_map(r,o[0],T_);return[_[0],{TAG:1,component_tag_identifier:i[1],component_tag_attributes:o[1],component_tag_children:_[1]}]}function vf(t,n){let e=n[2],r=n[0],i=r?"Optional":"Required",o=Ke(t,e),_=o[0],s=_.tags,c=[i,e],a=_.tag_path,d=It({tags:s,current_identifier:c,tag_path:a},n[3]),h=d[0],y=h.tags,x=h.tag_path;return[{tags:y,current_identifier:void 0,tag_path:x},[r,n[1],o[1],d[1]]]}function xh(t,n){let e=n.statement_desc,r;if(typeof e!="object"&&typeof e!="function")r=e===0?[t,0]:[t,1];else switch(e.TAG){case 0:let i=e._0;r=Ah(t,i[0],i[1],i[2],i[3]);break;case 1:r=$h(t,e._0);break;case 2:r=Th(t,e._0,e._1);break;case 3:r=Eh(t,e._0);break}return[r[0],{statement_loc:n.statement_loc,statement_desc:r[1]}]}function Ah(t,n,e,r,i){let o=vf(t,[n,e,r,i]);return[o[0],{TAG:0,_0:o[1]}]}function Eh(t,n){let e=It(t,n);return[e[0],{TAG:3,_0:e[1]}]}function $h(t,n){let e=he.fold_map(n,t,vf);return[e[0],{TAG:1,_0:e[1]}]}function Th(t,n,e){let r=Ke(t,n),i=It(r[0],e);return[i[0],{TAG:2,_0:r[1],_1:i[1]}]}function Gh(t,n,e,r,i){let o=m_.fold_map(n,t,Ke),_=Ke(o[0],e),s=It(_[0],r),c=It(s[0],i);return[c[0],{TAG:13,index:o[1],iterator:_[1],iterable:s[1],body:c[1]}]}function vh(t,n,e,r){let i=It(t,n),o=i[1],_=It(i[0],r),s=_[1],c=_[0];if(e===17){let a=s.expression_desc,u;return u=typeof a!="object"&&typeof a!="function"||a.TAG!==9?{TAG:9,function_definition:s,arguments:{hd:o,tl:0}}:{TAG:9,function_definition:a.function_definition,arguments:{hd:o,tl:a.arguments}},[c,u]}else return[c,{TAG:18,_0:o,_1:e,_2:s}]}function jh(t,n,e,r){let i=It(t,n),o=It(i[0],e),_=m_.fold_map(r,o[0],It);return[_[0],{TAG:16,condition:i[1],consequent:o[1],alternate:_[1]}]}function kh(t,n,e,r){let i=t.current_identifier;if(i===void 0)return X(n,"This function is missing an identifier.");let o=Ke(t,i[1]),_=he.fold_map(e,o[0],Ke);return[_[0],{TAG:7,identifier:o[1],parameters:_[1],name:r}]}function Mh(t,n){let e=he.fold_map(n,t,xh);return[e[0],{TAG:15,_0:e[1]}]}function Ih(t,n){let e=he.fold_map(n,t,It);return[e[0],{TAG:5,_0:Pi(e[1])}]}function Lh(t,n,e){let r=It(t,n),i=he.fold_map(e,r[0],It);return[i[0],{TAG:9,function_definition:r[1],arguments:i[1]}]}function Dh(t,n){let e=function(i,o){let _=o.string_template_desc,s;if(_.TAG===0){let c=Ke(i,_._0);s=[c[0],{TAG:0,_0:c[1]}]}else s=[i,{TAG:1,_0:_._0}];return[s[0],{string_template_loc:o.string_template_loc,string_template_desc:s[1]}]},r=he.fold_map(n,t,e);return[r[0],{TAG:0,_0:r[1]}]}function Nh(t,n){let r=function(i,o){let _=i.current_identifier,s=Ir($(_l,"of",b(Ee,o.attributes)),i,It),c=s[1],a=s[0],u=En((function(k){let V=k.expression_loc,gt=k.expression_desc;if(typeof gt!="object"&&typeof gt!="function")return X(V,"Expected attribute `key` on tag to be of type string");if(gt.TAG!==0)return X(V,"Expected attribute `key` on tag to be of type string");let tt=gt._0;if(!tt)return"";let St=tt.hd.string_template_desc;if(St.TAG===0)return X(V,"Expected attribute `key` on tag to be a plain string without interpolations.");if(tt.tl)return X(V,"Expected attribute `key` on tag to be a plain string without interpolations.");let lt=St._0;return Gf(lt)?lt:X(V,"Tag keys may only contain ASCII characters (a-Z), numbers (0-9) and underscores (_).")}),$(yn,"key",c)),d=u!==void 0?u:_!==void 0?_[1]._0[0]:"",h=oe(a.tag_path,{hd:d,tl:0}),y=o.tag,x;x=typeof y!="object"&&typeof y!="function"&&y===4?["Optional",{TAG:0,_0:["#",Ji]}]:void 0;let C={tags:0,current_identifier:x,tag_path:h},S=m_.fold_map,G=(function(k){return H(S,k,C,It)})($(yn,"of",b(Ee,o.attributes))),D=o.tag,j;if(typeof D!="object"&&typeof D!="function")switch(D){case 0:j=["String",0,En((function(lt){let J=lt.expression_desc;if(typeof J!="object"&&typeof J!="function")return X(lt.expression_loc,"Expected attribute `initialValue` on tag `#String` to be of type string");if(J.TAG!==0)return X(lt.expression_loc,"Expected attribute `initialValue` on tag `#String` to be of type string");let Mt=J._0;if(!Mt)return{NAME:"String",VAL:""};let un=Mt.hd.string_template_desc;return un.TAG===0||Mt.tl?X(lt.expression_loc,"Expected attribute `initialValue` on tag `#String` to be of type string"):{NAME:"String",VAL:un._0}}),$(yn,"initialValue",c))];break;case 1:j=["Int",1,En((function(lt){let J=lt.expression_desc;return typeof J!="object"&&typeof J!="function"||J.TAG!==2?X(lt.expression_loc,"Expected attribute `initialValue` on tag `#Int` to be of type int"):{NAME:"Int",VAL:J._0}}),$(yn,"initialValue",c))];break;case 2:j=["Float",2,En((function(lt){let J=lt.expression_desc;return typeof J!="object"&&typeof J!="function"||J.TAG!==3?X(lt.expression_loc,"Expected attribute `initialValue` on tag `#Float` to be of type float"):{NAME:"Float",VAL:J._0}}),$(yn,"initialValue",c))];break;case 3:j=["Boolean",3,En((function(lt){let J=lt.expression_desc;return typeof J!="object"&&typeof J!="function"||J.TAG!==4?X(lt.expression_loc,"Expected attribute `initialValue` on tag `#Boolean` to be of type boolean"):{NAME:"Boolean",VAL:J._0}}),$(yn,"initialValue",c))];break;case 4:j=["Array",4,En((function(lt){let J=lt.expression_desc;return typeof J!="object"&&typeof J!="function"||J.TAG!==2?X(lt.expression_loc,"Expected attribute `initialSize` on tag `#Array` to be of type int"):{NAME:"Int",VAL:J._0}}),$(yn,"initialSize",c))];break;case 5:j=["Record",5,void 0];break;case 6:j=["Slot",6,void 0];break;case 7:j=["Store",7,void 0];break;case 8:j=[void 0,8,void 0];break;case 9:j=[void 0,9,void 0];break}else{let k=D._0,V=En((function(gt){let tt=gt.expression_desc;if(!(typeof tt!="object"&&typeof tt!="function"))switch(tt.TAG){case 0:let St=tt._0;if(!St)return{NAME:"String",VAL:""};let lt=St.hd.string_template_desc;if(lt.TAG!==0&&!St.tl)return{NAME:"String",VAL:lt._0};break;case 2:return{NAME:"Int",VAL:tt._0};case 3:return{NAME:"Float",VAL:tt._0};case 4:return{NAME:"Boolean",VAL:tt._0}}return X(gt.expression_loc,"Expected attribute `initialValue` on tag `#"+(k+"` to be and immediate primitive value (string, int, float, bool)."))}),$(yn,"initialValue",c));j=[{NAME:"Custom",VAL:k},{TAG:0,_0:k},V]}let M=j[0],O=_!==void 0?_[0]==="Required":!0,N=j[1],rt=G[1],it={kind:N,path:h,required:O,attributes:c,children:rt},Q;if(M!==void 0){let k=G[0].tags;Q=oe(a.tags,{hd:{public_tag_key:d,public_tag_typ:M,public_tag_children:k||void 0,public_tag_initial_value:j[2]},tl:0})}else Q=a.tags;let Ct=a.current_identifier,P=a.tag_path;return[{tags:Q,current_identifier:Ct,tag_path:P},it]}(t,n.tag_desc);return[r[0],{TAG:12,_0:{tag_loc:n.tag_loc,tag_desc:r[1]}}]}function Ph(t,n,e){let r=It(t,e);return[r[0],{TAG:17,_0:n,_1:r[1]}]}function Xh(t,n){let e=T_(t,n);return[e[0],{TAG:14,_0:e[1]}]}function Bh(t,n){let e=function(i,o,_){let s=_[0],c=o.tags,a=[s,{TAG:0,_0:[i,Ji]}],u=o.tag_path,h=It({tags:c,current_identifier:a,tag_path:u},_[1]),y=h[0],x=h[1],C=[s,x],S=y.tags,G=y.tag_path;return[{tags:S,current_identifier:void 0,tag_path:G},C]},r=(function(i){return rl(i,t,e)})(b(Ee,n));return[r[0],{TAG:6,_0:r[1]}]}function Oh(t,n,e){let r=t.current_identifier,i;if(r!==void 0){let s=Ke(t,r[1]);i=[s[0],s[1]]}else i=[t,void 0];let o=he.fold_map(n,i[0],Ke),_=It(o[0],e);return[_[0],{TAG:8,identifier:i[1],parameters:o[1],body:_[1]}]}function qh(t,n){let e=n.declaration_kind,r;switch(e){case 0:r=0;break;case 1:r=1;break;case 2:r=2;break}let i=Ir(b(Ee,n.declaration_attributes),t,It),o=It(i[0],n.declaration_body);return[o[0],{declaration_loc:n.declaration_loc,declaration_kind:r,declaration_attributes:i[1],declaration_body:o[1]}]}function Fh(t,n){return Ir(b(Ee,n),t,qh)}function jf(t){return Fh(hh,t)[1]}function kf(t,n){return jf(Tf(t,n))}function G_(t,n,e,r,i,o){let _=((n+t|0)+r|0)+o|0;return(_<<i|_>>>(32-i|0)|0)+e|0}function Tn(t,n,e,r,i,o,_){return G_(n&e|(n^-1)&r,t,n,i,o,_)}function Gn(t,n,e,r,i,o,_){return G_(n&r|e&(r^-1),t,n,i,o,_)}function vn(t,n,e,r,i,o,_){return G_(n^e^r,t,n,i,o,_)}function jn(t,n,e,r,i,o,_){return G_(e^(n|r^-1),t,n,i,o,_)}function vc(t,n){let e=t[0],r=t[1],i=t[2],o=t[3];e=Tn(e,r,i,o,n[0],7,-680876936),o=Tn(o,e,r,i,n[1],12,-389564586),i=Tn(i,o,e,r,n[2],17,606105819),r=Tn(r,i,o,e,n[3],22,-1044525330),e=Tn(e,r,i,o,n[4],7,-176418897),o=Tn(o,e,r,i,n[5],12,1200080426),i=Tn(i,o,e,r,n[6],17,-1473231341),r=Tn(r,i,o,e,n[7],22,-45705983),e=Tn(e,r,i,o,n[8],7,1770035416),o=Tn(o,e,r,i,n[9],12,-1958414417),i=Tn(i,o,e,r,n[10],17,-42063),r=Tn(r,i,o,e,n[11],22,-1990404162),e=Tn(e,r,i,o,n[12],7,1804603682),o=Tn(o,e,r,i,n[13],12,-40341101),i=Tn(i,o,e,r,n[14],17,-1502002290),r=Tn(r,i,o,e,n[15],22,1236535329),e=Gn(e,r,i,o,n[1],5,-165796510),o=Gn(o,e,r,i,n[6],9,-1069501632),i=Gn(i,o,e,r,n[11],14,643717713),r=Gn(r,i,o,e,n[0],20,-373897302),e=Gn(e,r,i,o,n[5],5,-701558691),o=Gn(o,e,r,i,n[10],9,38016083),i=Gn(i,o,e,r,n[15],14,-660478335),r=Gn(r,i,o,e,n[4],20,-405537848),e=Gn(e,r,i,o,n[9],5,568446438),o=Gn(o,e,r,i,n[14],9,-1019803690),i=Gn(i,o,e,r,n[3],14,-187363961),r=Gn(r,i,o,e,n[8],20,1163531501),e=Gn(e,r,i,o,n[13],5,-1444681467),o=Gn(o,e,r,i,n[2],9,-51403784),i=Gn(i,o,e,r,n[7],14,1735328473),r=Gn(r,i,o,e,n[12],20,-1926607734),e=vn(e,r,i,o,n[5],4,-378558),o=vn(o,e,r,i,n[8],11,-2022574463),i=vn(i,o,e,r,n[11],16,1839030562),r=vn(r,i,o,e,n[14],23,-35309556),e=vn(e,r,i,o,n[1],4,-1530992060),o=vn(o,e,r,i,n[4],11,1272893353),i=vn(i,o,e,r,n[7],16,-155497632),r=vn(r,i,o,e,n[10],23,-1094730640),e=vn(e,r,i,o,n[13],4,681279174),o=vn(o,e,r,i,n[0],11,-358537222),i=vn(i,o,e,r,n[3],16,-722521979),r=vn(r,i,o,e,n[6],23,76029189),e=vn(e,r,i,o,n[9],4,-640364487),o=vn(o,e,r,i,n[12],11,-421815835),i=vn(i,o,e,r,n[15],16,530742520),r=vn(r,i,o,e,n[2],23,-995338651),e=jn(e,r,i,o,n[0],6,-198630844),o=jn(o,e,r,i,n[7],10,1126891415),i=jn(i,o,e,r,n[14],15,-1416354905),r=jn(r,i,o,e,n[5],21,-57434055),e=jn(e,r,i,o,n[12],6,1700485571),o=jn(o,e,r,i,n[3],10,-1894986606),i=jn(i,o,e,r,n[10],15,-1051523),r=jn(r,i,o,e,n[1],21,-2054922799),e=jn(e,r,i,o,n[8],6,1873313359),o=jn(o,e,r,i,n[15],10,-30611744),i=jn(i,o,e,r,n[6],15,-1560198380),r=jn(r,i,o,e,n[13],21,1309151649),e=jn(e,r,i,o,n[4],6,-145523070),o=jn(o,e,r,i,n[11],10,-1120210379),i=jn(i,o,e,r,n[2],15,718787259),r=jn(r,i,o,e,n[9],21,-343485551),t[0]=e+t[0]|0,t[1]=r+t[1]|0,t[2]=i+t[2]|0,t[3]=o+t[3]|0}var Bt=[1732584193,-271733879,-1732584194,271733878],ce=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];function Mf(t,n,e){let r=t.slice(n,e),i=r.length;Bt[0]=1732584193,Bt[1]=-271733879,Bt[2]=-1732584194,Bt[3]=271733878;for(let a=0;a<=15;++a)ce[a]=0;let o=i/64|0;for(let a=1;a<=o;++a){for(let u=0;u<=15;++u){let d=((a<<6)-64|0)+(u<<2)|0;ce[u]=((r.charCodeAt(d)+(r.charCodeAt(d+1|0)<<8)|0)+(r.charCodeAt(d+2|0)<<16)|0)+(r.charCodeAt(d+3|0)<<24)|0}vc(Bt,ce)}let _=r.slice(o<<6);for(let a=0;a<=15;++a)ce[a]=0;let s=_.length-1|0;for(let a=0;a<=s;++a)ce[a/4|0]=ce[a/4|0]|_.charCodeAt(a)<<(a%4<<3);let c=s+1|0;if(ce[c/4|0]=ce[c/4|0]|128<<(c%4<<3),c>55){vc(Bt,ce);for(let a=0;a<=15;++a)ce[a]=0}return ce[14]=i<<3,vc(Bt,ce),String.fromCharCode(Bt[0]&255,Bt[0]>>8&255,Bt[0]>>16&255,Bt[0]>>24&255,Bt[1]&255,Bt[1]>>8&255,Bt[1]>>16&255,Bt[1]>>24&255,Bt[2]&255,Bt[2]>>8&255,Bt[2]>>16&255,Bt[2]>>24&255,Bt[3]&255,Bt[3]>>8&255,Bt[3]>>16&255,Bt[3]>>24&255)}function If(t){return Mf(t,0,t.length)}var Lf;if(fs!==32){if(fs!==64)throw new p("Assert_failure",{MEL_EXN_ID:"Assert_failure",_1:["jscomp/stdlib/int32.ml",69,6]});Lf=(function(t){return t&-1})}else Lf=(function(t){if(t>=0&&t<=Fe)return t});var Df=2147483647;var w2=On(Fe);var Nf=po;function Yh(t){return[Math.floor(Math.random()*2147483647)]}function Qh(t,n){cr(n.st,0,t.st,0,55),t.idx=n.idx}function Kh(t,n){let e=function(s,c){return If(s+ie("%d",c))},r=function(s){return((R(s,0)+(R(s,1)<<8)|0)+(R(s,2)<<16)|0)+(R(s,3)<<24)|0},i=n.length===0?[0]:n,o=i.length;for(let s=0;s<=54;++s)Zt(t.st,s,s);let _="x";for(let s=0,c=54+Ve(55,o)|0;s<=c;++s){let a=s%55,u=s%o;_=e(_,Gt(i,u)),Zt(t.st,a,(Gt(t.st,a)^r(_))&1073741823)}t.idx=0}function Pf(t){let n={st:vt(55,0),idx:0};return Kh(n,t),n}function Zh(t){return Pf(Yh())}function Jh(t){let n={st:vt(55,0),idx:0};return Qh(n,t),n}function ln(t){t.idx=(t.idx+1|0)%55;let n=Gt(t.st,t.idx),r=(Gt(t.st,(t.idx+24|0)%55)+(n^n>>>25&31)|0)&1073741823;return Zt(t.st,t.idx,r),r}function Xf(t,n){for(;;){let e=ln(t),r=e%n;if((e-r|0)<=((1073741823-n|0)+1|0))return r}}function tg(t,n){if(n>1073741823||n<=0)throw new p("Invalid_argument",{MEL_EXN_ID:"Invalid_argument",_1:"Random.int"});return Xf(t,n)}function ng(t,n){if(n<=0)throw new p("Invalid_argument",{MEL_EXN_ID:"Invalid_argument",_1:"Random.full_int"});if(n>1073741823)for(;;){let e=ln(t),r=ln(t),i;n<=2147483647?i=[(r&1073725440)<<1|e>>>15,2147483647]:i=[((ln(t)&1073741312)<<12|r>>>9)<<20|e>>>10,Fe];let o=i[0],_=o%n;if((o-_|0)<=((i[1]-n|0)+1|0))return _}else return Xf(t,n)}function eg(t,n){if(n<=0)throw new p("Invalid_argument",{MEL_EXN_ID:"Invalid_argument",_1:"Random.int32"});for(;;){let e=ln(t),r=(ln(t)&1)<<30,i=e|r,o=i%n;if((i-o|0)<=((Df-n|0)+1|0))return o}}function rg(t,n){if(q_(n,wn))throw new p("Invalid_argument",{MEL_EXN_ID:"Invalid_argument",_1:"Random.int64"});for(;;){let e=On(ln(t)),r=re(On(ln(t)),30),i=re(On(ln(t)&7),60),o=Bn(e,Bn(r,i)),_=V_(o,n);if(!Wr(rr(o,_),Ce(rr(Nf,n),nr)))return _}}function ig(t){let n=ln(t),e=ln(t);return(n/1073741824+e)/1073741824}function og(t,n){return ig(t)*n}function _g(t){return(ln(t)&1)===0}function sg(t){let n=ln(t)>>>14,e=ln(t)>>>14;return n|e<<16}function cg(t){let n=mn(On(ln(t)),9),e=mn(On(ln(t)),9),r=mn(On(ln(t)),8);return Bn(n,Bn(re(e,21),re(r,42)))}var oo={make:Pf,make_self_init:Zh,copy:Jh,bits:ln,$$int:tg,full_int:ng,int32:eg,int64:rg,$$float:og,bool:_g,bits32:sg,bits64:cg};var ag={v:!1};var lg=Ft.new_key(void 0,oo.make_self_init);function ug(t,n){for(;;){let e=t;if(e>=n||e<<1<e)return e;t=e<<1}}function Of(t,n){let e=t!==void 0?t:ag.v,r=ug(16,n),i=e?oo.bits(Ft.get(lg)):0;return{size:0,data:vt(r,0),seed:i,initial_size:r}}function fg(t,n,e,r){let i=r.length,o=vt(i,0),_=function(s){for(;;){let c=s;if(typeof c!="object"&&typeof c!="function")return;let a=c.key,u=c.data,d=c.next,h=n?c:{TAG:0,key:a,data:u,next:0},y=b(t,a),x=Gt(o,y);typeof x!="object"&&typeof x!="function"?Zt(r,y,h):x.next=h,Zt(o,y,h),s=d}};for(let s=0,c=e.length;s<c;++s)_(Gt(e,s));if(n)for(let s=0;s<i;++s){let c=Gt(o,s);typeof c!="object"&&typeof c!="function"||(c.next=0)}}function mg(t,n){let e=n.data,r=e.length,i=r<<1;if(i<r)return;let o=vt(i,0),_=n.initial_size>=0;n.data=o,fg(b(t,n),_,e,o)}function jc(t,n){return _r(10,100,t.seed,n)&(t.data.length-1|0)}function qf(t,n){let e=Gt(t.data,jc(t,n));if(typeof e!="object"&&typeof e!="function")return;let r=e.key,i=e.data,o=e.next;if(ut(n,r))return F(i);if(typeof o!="object"&&typeof o!="function")return;let _=o.key,s=o.data,c=o.next;if(ut(n,_))return F(s);if(typeof c!="object"&&typeof c!="function")return;let a=c.key,u=c.data,d=c.next;if(ut(n,a))return F(u);{let h=d;for(;;){let y=h;if(typeof y!="object"&&typeof y!="function")return;let x=y.key,C=y.data,S=y.next;if(ut(n,x))return F(C);h=S}}}function dg(t,n){for(;;){let e=n;if(typeof e!="object"&&typeof e!="function")return e;let r=e.key,i=e.next;if(ut(r,t))return e;n=i}}function pg(t,n,e,r,i,o){if(typeof o!="object"&&typeof o!="function")return Zt(t.data,e,{TAG:0,key:n,data:i,next:r}),t.size=t.size+1|0,t.size>t.data.length<<1?mg(jc,t):void 0;o.key=n,o.data=i}function kc(t,n,e){let r=jc(t,n),i=Gt(t.data,r),o=dg(n,i);pg(t,n,r,i,e,o)}function tn(t,n){for(;;){let e=n,r=t,i=e.expression_desc;if(typeof i!="object"&&typeof i!="function")return r;switch(i.TAG){case 5:return Xi(tn,r,i._0);case 6:return H(Dr,(function(x,C,S){return tn(S,C[1])}),i._0,r);case 8:n=i.body;continue;case 9:let o=tn(r,i.function_definition);return _t(tn,o,i.arguments);case 10:return $(Cc,i._0,r);case 12:let _=i._0,s=H(Dr,(function(x,C,S){return tn(S,C)}),_.tag_desc.attributes,r),c=_.tag_desc.children;return c!==void 0?tn(s,c):s;case 13:let a=tn(r,i.iterable);n=i.body,t=a;continue;case 14:return v_(r,i._0);case 15:return _t(gg,r,i._0);case 16:let u=i.alternate,d=tn(r,i.condition),h=tn(d,i.consequent);if(u===void 0)return h;n=u,t=h;continue;case 17:n=i._1;continue;case 18:let y=tn(r,i._0);n=i._2,t=y;continue;default:return r}}}function gg(t,n){let e=n.statement_desc;if(typeof e!="object"&&typeof e!="function")return t;switch(e.TAG){case 0:return tn(t,e._0[3]);case 1:return _t((function(r,i){return tn(r,i[3])}),t,e._0);case 2:return tn(t,e._1);case 3:return tn(t,e._0)}}function v_(t,n){let e=n.template_node_desc;switch(e.TAG){case 0:let r=H(Dr,(function(_,s,c){return tn(c,s)}),e.html_tag_attributes,t);return _t(v_,r,e.html_tag_children);case 1:let i=$(Cc,e.component_tag_identifier._0[0],t),o=H(Dr,(function(_,s,c){return tn(c,s)}),e.component_tag_attributes,i);return _t(v_,o,e.component_tag_children);case 2:return _t(v_,t,e._0);case 4:return tn(t,e._0);case 3:case 5:return t}}function bg(t){let n=H(Dr,(function(e,r,i){return tn(i,r)}),t.declaration_attributes,yc);return tn(n,t.declaration_body)}function yg(t){let n=Of(void 0,b(ni,t)),e=function(r,i,o,_){kc(n,r,"Unresolved");let s=H(nf,(function(c,a){let u={hd:c,tl:_},d=qf(n,c);if(d!==void 0)return d==="Unresolved"?{hd:[r,Yt(u)],tl:a}:a;let h=$(yn,c,t);return h!==void 0?e(c,wt(h),a,u):a}),i,o);return kc(n,r,"Resolved"),s};return H(Dr,(function(r,i,o){return e(r,i,o,{hd:r,tl:0})}),t,0)}function Cg(t,n){we((function(e){let r=e[0],i=$(qo,r,t),o=xn(" -> ",e[1]);X(i.declaration_loc,"Found cyclic dependency in `"+(r+("`:\n"+(o+`
488
+ %!`))))}),n)}function Ff(t){let n=$(Hi,bg,t);return Cg(t,yg(n)),n}function zf(t,n){let e=$(yn,n,t);return Eu(e,yc)}function k_(t,n){let e=n.length,r=bt(e+20|0);ot(r,39);for(let i=0;i<e;++i)R(n,i)===39?Dt(r,t):ot(r,R(n,i));return ot(r,39),K(r)}function Lc(t,n,e){if(e==="")return n;{let r=e.length-1|0;for(;;){let i=r;if(i<0)return Ot(e,0,1);if(!$(t,e,i)){let o=i,_=i+1|0;for(;;){let s=o;if(s<0)return Ot(e,0,_);if($(t,e,s))return Ot(e,s+1|0,(_-s|0)-1|0);o=s-1|0}}r=i-1|0}}}function Dc(t,n,e){if(e==="")return n;{let r=e.length-1|0;for(;;){let i=r;if(i<0)return Ot(e,0,1);if(!$(t,e,i)){let o=i;for(;;){let _=o;if(_<0)return n;if($(t,e,_)){let s=_;for(;;){let c=s;if(c<0)return Ot(e,0,1);if(!$(t,e,c))return Ot(e,0,c+1|0);s=c-1|0}}o=_-1|0}}r=i-1|0}}}var Nc=".";function Pc(t,n){return R(t,n)===47}function Vf(t){return t.length<1?!0:R(t,0)!==47}function wg(t){return Vf(t)&&!Mr("./",t)?!Mr("../",t):!1}function xg(t,n){return el(n,t)}var M_;try{M_=rs("TMPDIR")}catch(t){let n=yt(t);if(n.MEL_EXN_ID===pt)M_="/tmp";else throw n}function Xc(t){return k_("'\\''",t)}function Hf(t,n,e,r,i){return xn(" ",gn(Xc,{hd:t,tl:i}))+((n!==void 0?" <"+k_("'\\''",n):"")+((e!==void 0?" >"+k_("'\\''",e):"")+(r!==void 0?ut(r,e)?" 2>&1":" 2>"+k_("'\\''",r):"")))}function Ag(t){return Lc(Pc,Nc,t)}function Eg(t){return Dc(Pc,Nc,t)}var $g={$$null:"/dev/null",current_dir_name:Nc,parent_dir_name:"..",dir_sep:"/",is_dir_sep:Pc,is_relative:Vf,is_implicit:wg,check_suffix:xg,temp_dir_name:M_,quote:Xc,quote_command:Hf,basename:Ag,dirname:Eg},Bc=".";function gi(t,n){let e=R(t,n);return e===47||e===92?!0:e===58}function Oc(t){return(t.length<1||R(t,0)!==47)&&(t.length<1||R(t,0)!==92)?t.length<2?!0:R(t,1)!==58:!1}function Rf(t){return Oc(t)&&!Mr("./",t)&&!Mr(".\\",t)&&!Mr("../",t)?!Mr("..\\",t):!1}function Uf(t,n){let e=n.length,r=t.length;if(r<e)return!1;let i=Ot(t,r-e|0,e);return mt(qi(dn(i)))===mt(qi(dn(n)))}var Mc;try{Mc=rs("TEMP")}catch(t){let n=yt(t);if(n.MEL_EXN_ID===pt)Mc=".";else throw n}function Wf(t){let n=t.length,e=bt(n+20|0);ot(e,34);let r=function(_){for(;;){let s=_;if(s===n)return ot(e,34);let c=R(t,s);if(c===34||c===92)return i(0,s);ot(e,c),_=s+1|0}},i=function(_,s){for(;;){let c=s,a=_;if(c===n)return ot(e,34),o(a);let u=R(t,c);if(u!==34){if(u!==92)return o(a),r(c);s=c+1|0,_=a+1|0;continue}return o((a<<1)+1|0),ot(e,34),r(c+1|0)}},o=function(_){for(let s=1;s<=_;++s)ot(e,92)};return r(0),K(e)}function Tg(t){let n=bt(t.length+20|0);return Ka((function(e){if(e>=62){if(e>123||e<63){if(e>=125)return ot(n,e)}else if(e!==94)return ot(n,e)}else if(e>=42){if(e!==60)return ot(n,e)}else{if(e<33)return ot(n,e);switch(e){case 35:case 36:case 39:return ot(n,e);case 33:case 34:case 37:case 38:case 40:case 41:break}}ot(n,94),ot(n,e)}),t),K(n)}function j_(t){let n=nl(t,47)?Za((function(i){return i!==47?i:92}),t):t;if(Do(function(i){return i!==34?i===37:!0},dn(n))){let i="Filename.quote_command: bad file name "+n;throw new p("Failure",{MEL_EXN_ID:"Failure",_1:i})}return Do(function(i){if(i>=42)return i===94;if(i<32)return!1;switch(i){case 34:case 35:case 36:case 37:case 39:return!1;case 32:case 33:case 38:case 40:case 41:return!0}},dn(n))?xn("",{hd:'"',tl:{hd:n,tl:{hd:'"',tl:0}}}):n}function Gg(t,n,e,r,i){return xn("",{hd:'"',tl:{hd:j_(t),tl:{hd:" ",tl:{hd:Tg(xn(" ",gn(Wf,i))),tl:{hd:n!==void 0?" <"+j_(n):"",tl:{hd:e!==void 0?" >"+j_(e):"",tl:{hd:r!==void 0?ut(r,e)?" 2>&1":" 2>"+j_(r):"",tl:{hd:'"',tl:0}}}}}}}})}function vg(t){let n=function(e){return e>=91?!(e>122||e<97):e>=65};return t.length>=2&&n(R(t,0))?R(t,1)===58:!1}function Yf(t){return vg(t)?[Ot(t,0,2),Ot(t,2,t.length-2|0)]:["",t]}function jg(t){let n=Yf(t),e=Dc(gi,Bc,n[1]);return n[0]+e}function kg(t){let n=Yf(t);return Lc(gi,Bc,n[1])}var Mg={$$null:"NUL",current_dir_name:Bc,parent_dir_name:"..",dir_sep:"\\",is_dir_sep:gi,is_relative:Oc,is_implicit:Rf,check_suffix:Uf,temp_dir_name:Mc,quote:Wf,quote_command:Gg,basename:kg,dirname:jg},qc=".";function Ig(t){return Lc(gi,qc,t)}function Lg(t){return Dc(gi,qc,t)}var Dg={$$null:"/dev/null",current_dir_name:qc,parent_dir_name:"..",dir_sep:"/",is_dir_sep:gi,is_relative:Oc,is_implicit:Rf,check_suffix:Uf,temp_dir_name:M_,quote:Xc,quote_command:Hf,basename:Ig,dirname:Lg},kn;switch(Ma){case"Cygwin":kn=Dg;break;case"Win32":kn=Mg;break;default:kn=$g}var Ng=kn.dir_sep,Ic=kn.is_dir_sep,E2=kn.check_suffix,Pg=kn.temp_dir_name;function Fc(t,n){let e=t.length;return e===0||$(Ic,t,e-1|0)?t+n:t+(Ng+n)}function Xg(t){let n=t.length-1|0;for(;;){let e=n;if(e<0||$(Ic,t,e))return 0;if(R(t,e)===46){let r=e-1|0;for(;;){let i=r;if(i<0||$(Ic,t,i))return 0;if(R(t,i)!==46)return t.length-e|0;r=i-1|0}}n=e-1|0}}function Qf(t){let n=Xg(t);return n===0?"":Ot(t,t.length-n|0,n)}var $2=Ft.new_key(void 0,oo.make_self_init);var T2=Ft.new_key(El,(function(t){return Pg}));var G2=kn.current_dir_name,v2=kn.parent_dir_name,j2=kn.is_relative,k2=kn.is_implicit,M2=kn.basename,I2=kn.dirname,L2=kn.$$null,D2=kn.quote,N2=kn.quote_command;import*as Le from"fs";function Og(t,n){let e=0,r={hd:n,tl:0};for(;;){let i=r,o=e;if(!i)return o;let _=i.hd,s=i.tl;if(Le.lstatSync(_).isDirectory()){r=oe(s,gn((function(c){return Fc(_,c)}),bs(Le.readdirSync(_))));continue}if(Qf(_)===t){r=s,e={hd:_,tl:o};continue}r=i.tl}}function qg(t,n){return gn((function(e){let r=Le.readFileSync(e,"utf8");return{TAG:1,_0:e,_1:r}}),Og(".pi",t))}function Kf(t,n){Le.mkdirSync(n,{recursive:!0});try{let e=qg(t,void 0),r=kf(!0,e),i=Ff(r),o=Qu(r);return $(ar,(function(_,s){let c=qr.to_hex(sc($(ol,_,s))),a=b(tf,zf(i,_)),u=xn("",gn((function(G){let D=b(Kt({TAG:0,_0:{TAG:11,_0:"./",_1:{TAG:2,_0:0,_1:{TAG:11,_0:".pi.mjs",_1:0}}},_1:"./%s.pi.mjs"}),G),j=b(Kt({TAG:0,_0:{TAG:2,_0:0,_1:{TAG:11,_0:"Deps",_1:0}},_1:"%sDeps"}),G);return H(Kt({TAG:0,_0:{TAG:11,_0:"import { __internal_code as ",_1:{TAG:2,_0:0,_1:{TAG:11,_0:", __internal_deps as ",_1:{TAG:2,_0:0,_1:{TAG:11,_0:" } from ",_1:{TAG:3,_0:0,_1:{TAG:11,_0:`;
489
+ `,_1:0}}}}}}},_1:`import { __internal_code as %s, __internal_deps as %s } from %S;
490
+ `}),G,j,D)}),a)),d='export const __internal_code = "'+(c+`";
491
+ `),h=b(Kt({TAG:0,_0:{TAG:11,_0:"export const __internal_deps = [",_1:{TAG:2,_0:0,_1:{TAG:11,_0:`];
492
+ `,_1:0}}},_1:`export const __internal_deps = [%s];
493
+ `}),xn(",",as((function(G){return{hd:b(Kt({TAG:0,_0:{TAG:11,_0:"...",_1:{TAG:2,_0:0,_1:{TAG:11,_0:"Deps",_1:0}}},_1:"...%sDeps"}),G),tl:{hd:G,tl:0}}}),a))),y=Zu(b(Kt({TAG:0,_0:{TAG:11,_0:`
494
+ export default function(data, defaultSlot) {
495
+ return {
496
+ __pinc_declaration: true,
497
+ name: `,_1:{TAG:3,_0:0,_1:{TAG:11,_0:`,
498
+ code: [...__internal_deps, __internal_code],
499
+ data: data,
500
+ defaultSlot: defaultSlot,
501
+ };
502
+ };
503
+ `,_1:0}}},_1:`
504
+ export default function(data, defaultSlot) {
505
+ return {
506
+ __pinc_declaration: true,
507
+ name: %S,
508
+ code: [...__internal_deps, __internal_code],
509
+ data: data,
510
+ defaultSlot: defaultSlot,
511
+ };
512
+ };
513
+ `}),_)),x=u+(d+(h+y)),C=b(Kt({TAG:0,_0:{TAG:2,_0:0,_1:{TAG:11,_0:".pi.mjs",_1:0}},_1:"%s.pi.mjs"}),_),S=Fc(n,C);Le.writeFileSync(S,x,"utf8")}),o)}catch(e){let r=yt(e);if(r.MEL_EXN_ID===l_)return cs(1);throw r}}var Fg=new Ur;Fg.name("pincjsc").description("CLI to compile pinc-lang source code to be executable in JavaScript").argument("<inputDir>","input directory where .pi source files are located").argument("<outDir>","output directory where .pi.js files should be stored in").action((t,n)=>{Kf(t,n)}).parse();