diff --git a/playground/dist/index.js b/playground/dist/index.js index f206b90a0..ba194ed0b 100644 --- a/playground/dist/index.js +++ b/playground/dist/index.js @@ -13,7 +13,7 @@ var eC=Object.create;var Al=Object.defineProperty;var tC=Object.getOwnPropertyDe `,"\r"," "]),ds=class{string;indexMap;innerCursor=0;constructor(e,r=[]){this.string=e,this.indexMap=r}get cursor(){return dn.toOuterOffset(this.indexMap,this.innerCursor)}getCharRange(e=0){return dn.toOuterRange(this.indexMap,b.create(this.innerCursor+e,this.innerCursor+e+1))}peek(e=1,r=0){return this.string.slice(this.innerCursor+r,this.innerCursor+r+e)}tryPeek(e,r=0){return this.peek(e.length,r)===e}tryPeekAfterWhitespace(e){let r=this.string.length-this.innerCursor,n=0;for(;n="0"&&o<="9"}t.isDigit=e;function r(o){return o==='"'||o==="'"}t.isBrigadierQuote=r;function n(o){return o===`\r `||o==="\r"||o===` `}t.isNewline=n;function i(o){return o===" "||o===" "}t.isSpace=i;function s(o){return t.isSpace(o)||t.isNewline(o)}t.isWhitespace=s})(ke||(ke={}));var Nu;(function(t){function e(r){return typeof r=="function"&&(r=r()),r instanceof ds&&(r=r.cursor),r}t.get=e})(Nu||(Nu={}));var b;(function(t){function e(m){let A=typeof m=="function"?m():m;return t.is(A)?t.create(A.start,A.end):Rd.is(A)?t.create(A.range.start,A.range.end):t.create(A)}t.get=e;function r(m,A){return m=Nu.get(m),{start:m,end:A!==void 0?Nu.get(A):m}}t.create=r;function n(m,A){return{start:t.get(m).start,end:t.get(A).end}}t.span=n;function i(m){return!!m&&typeof m=="object"&&typeof m.start=="number"&&typeof m.end=="number"}t.is=i,t.Beginning=Object.freeze(t.create(0,1)),t.Full=Object.freeze(t.create(0,Number.POSITIVE_INFINITY));function s(m){return`[${m.start}, ${m.end})`}t.toString=s;function o(m,A,w=!1){return m=e(m),m.start<=A&&(w?A<=m.end:AA.end:m.start>=A.end)?1:0}t.compare=d;function p(m,A,w=!1){return(w?m.endA?1:0}t.compareOffset=p;function y(m,A,w=A){return m=e(m),{start:m.start+A,end:m.end+w}}t.translate=y})(b||(b={}));var Rd;(function(t){function e(r){return!!r&&typeof r=="object"&&b.is(r.range)}t.is=e})(Rd||(Rd={}));var dn;(function(t){function e(u,a,l,c){let f=a;for(let h of u){if(b.contains(h[l],a))return h[c].start;if(b.endsBefore(h[l],a))f=a-h[l].end+h[c].end;else break}return f}function r(u,a){return e(u,a,"outer","inner")}t.toInnerOffset=r;function n(u,a){return b.create(r(u,a.start),r(u,a.end))}t.toInnerRange=n;function i(u,a){return e(u,a,"inner","outer")}t.toOuterOffset=i;function s(u,a){return b.create(i(u,a.start),i(u,a.end))}t.toOuterRange=s;function o(u,a){return a.map(l=>({inner:l.inner,outer:s(u,l.outer)}))}t.merge=o})(dn||(dn={}));var Tt;(function(t){function e(o,u){return typeof o=="object"?r(o):n(o,u)}t.create=e;function r(o){return{line:o.line??0,character:o.character??0}}function n(o,u){return r({line:o,character:u})}t.Beginning=t.create(0,0),t.Infinity=t.create(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY);function i(o){return`<${o.line}, ${o.character}>`}t.toString=i;function s(o,u){return o.linel.line?!1:a.line=a.character:!0)&&(u.line===l.line?u.characterp(y.range,m,d))}t.findChildIndex=n;function i(f,h,d=!1){return f.children?.[n(f,h,d)]}t.findChild=i;function s(f,h,d=!1){if(!f.children)return-1;let p=-1;for(let[y,m]of f.children.entries())if(b.endsBefore(m.range,h,d))p=y;else break;return p}t.findLastChildIndex=s;function o(f,h,d=!1){return f.children?.[s(f,h,d)]}t.findLastChild=o;function u({node:f,needle:h,endInclusive:d=!1,predicate:p=()=>!0}){let y,m=b.contains(f,h,d)?f:void 0;for(;m&&p(m);)y=m,m=i(m,h,d);return y}t.findDeepestChild=u;function a({node:f,needle:h,endInclusive:d=!1,predicate:p=()=>!0}){let y=b.contains(f,h,d)?f:void 0;for(;y&&!p(y);)y=i(y,h,d);return y}t.findShallowestChild=a;function*l(f){let h=f;for(;h;)h.locals&&(yield h.locals),h=f.parent}t.getLocalsToRoot=l;function*c(f){f.locals&&(yield f.locals);for(let h of f.children??[])yield*c(h)}t.getLocalsToLeaves=c})(it||(it={}));var lf;(function(t){function e(n){return n.type==="boolean"}t.is=e;function r(n){return{type:"boolean",range:b.get(n)}}t.mock=r})(lf||(lf={}));var ps;(function(t){function e(r){return r?.type==="comment"}t.is=e})(ps||(ps={}));var a8;(function(t){function e(r){return r.type==="error"}t.is=e})(a8||(a8={}));var Zo;(function(t){function e(r){return[...r.parserErrors,...r.binderErrors??[],...r.checkerErrors??[],...r.linterErrors??[]]}t.getErrors=e})(Zo||(Zo={}));var zr;(function(t){function e(n){return n.type==="float"}t.is=e;function r(n){return{type:"float",range:b.get(n),value:0}}t.mock=r})(zr||(zr={}));var ms;(function(t){function e(n){return n.type==="integer"}t.is=e;function r(n){return{type:"integer",range:b.get(n),value:0}}t.mock=r})(ms||(ms={}));var cf;(function(t){function e(r){return r?.type==="item"}t.is=e})(cf||(cf={}));var Me;(function(t){function e(n){return n?.type==="literal"}t.is=e;function r(n,i){return{type:"literal",range:b.get(n),options:i,value:""}}t.mock=r})(Me||(Me={}));var l8;(function(t){function e(n){return n.type==="long"}t.is=e;function r(n){return{type:"long",range:b.get(n),value:0n}}t.mock=r})(l8||(l8={}));var $n;(function(t){function e(r){return r?.type==="pair"}t.is=e})($n||($n={}));var V;(function(t){let e=ee.TagPrefix,r=ee.NamespacePathSep,n=ee.PathSep,i=ee.DefaultNamespace;function s(a){return a?.type==="resource_location"}t.is=s;function o(a,l){return{type:"resource_location",range:b.get(a),options:l}}t.mock=o;function u(a,l="origin",c=!1){let f=a.path?a.path.join(n):"",h;switch(l){case"origin":h=a.namespace!==void 0?`${a.namespace}${r}${f}`:f;break;case"full":h=`${a.namespace||i}${r}${f}`;break;case"short":h=a.namespace&&a.namespace!==i?`${a.namespace}${r}${f}`:f;break}return c&&a.isTag?`${e}${h}`:h}t.toString=u})(V||(V={}));var Iu=Symbol("SequenceUtilDiscriminator"),Lu;(function(t){function e(r){return!!r&&r[Iu]}t.is=e})(Lu||(Lu={}));var ff;(function(t){function e(r,n){return r?r.includes(n):!1}t.is=e})(ff||(ff={}));var c8=new Map([['"','"'],["'","'"],["\\","\\"],["b","\b"],["f","\f"],["n",` -`],["r","\r"],["t"," "]]),ht;(function(t){function e(n){return n?.type==="string"}t.is=e;function r(n,i){return n=b.get(n),{type:"string",range:n,options:i,value:"",valueMap:[{inner:b.create(0),outer:b.create(n.start)}]}}t.mock=r})(ht||(ht={}));var Cr;(function(t){function e(n){return n?.type==="symbol"}t.is=e;function r(n,i){return{type:"symbol",range:b.get(n),options:i,value:""}}t.mock=r})(Cr||(Cr={}));var f8={array:"an array",boolean:"a boolean","bug-of-mc":"Due to a bug of Minecraft (%0%), %1%. Please Mojang, fix your game","code-action.block-state-sort-keys":"Sort block state","code-action.command-replaceitem":"Update this command to /item \u2026 replace","code-action.fix-file":"Fix all auto-fixable problems in this file","code-action.fix-workspace":"Fix all auto-fixable problems in the workspace","code-action.id-attribute-datafix":"Update this attribute name to 1.16","code-action.id-complete-default-namespace":"Complete default namespace","code-action.id-create-file":"Create %0% in the same data pack","code-action.id-omit-default-namespace":"Omit default namespace","code-action.id-zombified-piglin-datafix":"Change this ID to Zombified Piglin's","code-action.nbt-compound-sort-keys":"Sort NBT compound tag","code-action.nbt-type-to-byte":"Convert to an NBT byte tag","code-action.nbt-type-to-double":"Convert to an NBT double tag","code-action.nbt-type-to-float":"Convert to an NBT float tag","code-action.nbt-type-to-int":"Convert to an NBT int tag","code-action.nbt-type-to-long":"Convert to an NBT long tag","code-action.nbt-type-to-short":"Convert to an NBT short tag","code-action.nbt-uuid-datafix":"Update this UUID to 1.16","code-action.selector-sort-keys":"Sort selector argument","code-action.string-double-quote":"Quote this string with double quotation marks","code-action.string-single-quote":"Quote this string with single quotation marks","code-action.string-unquote":"Unquote this string","code-action.vector-align-0.0":"Align this vector to block origin","code-action.vector-align-0.5":"Align this vector to block center",comment:"a comment starting with %0%","conjunction.and_2":" and ","conjunction.and_3+_1":", ","conjunction.and_3+_2":", and ","conjunction.or_2":" or ","conjunction.or_3+_1":", ","conjunction.or_3+_2":", or ","datafix.error.command-replaceitem":"/replaceitem was removed in 20w46a (the second snapshot of 1.17) in favour of /item","duplicate-key":"Duplicate key %0%","ending-quote":"an ending quote %0%",entity:"an entity","error.unparseable-content":"Encountered unparseable content",expected:"Expected %0%","expected-got":"Expected %0% but got %1%",float:"a float","float.between":"a float between %0% and %1%",integer:"an integer","integer.between":"an integer between %0% and %1%","json.doc.advancement.display":"Advancement display settings. If present, the advancement will be visible in the advancement tabs.","json.checker.array.length-between":"%0% with length between %1% and %2%","json.checker.object.field.union-empty-members":"Disallowed property","json.checker.item.duplicate":"Duplicate list item","json.checker.property.deprecated":"Property %0% is deprecated","json.checker.property.missing":"Missing property %0%","json.checker.property.unknown":"Unknown property %0%","json.checker.string.hex-color":"a 6-digit hexadecimal number","json.checker.tag-entry.duplicate":"Duplicate tag entry","json.node.array":"an array","json.node.boolean":"a boolean","json.node.null":"a null","json.node.number":"a number","json.node.object":"an object","json.node.string":"a string","key-not-following-convention":"Invalid key %0% which doesn't follow %1% convention","linter.diagnostic-message-wrapper":"%0% (rule: %1%)","linter.name-convention.illegal":"Name %0% doesn't match %1%","linter.undeclared-symbol.message":"Cannot find %0% %1%","linter-config-validator.name-convention.type":"Expects a string that contains a regular expression describing the name","linter-config-validator.wrapper":"%0%. See [the documentation](%1) for more information",long:"a long","mcfunction.checker.command.data-modify-unapplicable-operation":"Operation %0% can only be used on %1%; the target path has type %2% instead","mcfunction.completer.block.states.default-value":"Default: %0%","mcfunction.parser.entity-selector.arguments.not-applicable":"%0% is not applicable here","mcfunction.parser.entity-selector.arguments.unknown":"Unknown entity selector argument %0%","mcfunction.parser.entity-selector.entities-disallowed":"The selector contains non-player entities","mcfunction.parser.entity-selector.multiple-disallowed":"The selector contains multiple entities","mcfunction.parser.entity-selector.player-name.too-long":"Player names cannot be longer than %0% characters","mcfunction.parser.eoc-unexpected":"Expected more arguments","mcfunction.parser.leading-slash":"a leading slash %0%","mcfunction.parser.no-permission":"Permission level %0% is required, which is higher than %1% defined in config","mcfunction.parser.objective.too-long":"Objective names cannot be longer than %0% characters","mcfunction.parser.range.min>max":"The minimum value %0% is larger than the maximum value %1%","mcfunction.parser.score_holder.fake-name.too-long":"Fake names cannot be longer than %0% characters","mcfunction.parser.sep":"a space (%0%)","mcfunction.parser.trailing":"Trailing data encountered: %0%","mcfunction.parser.unknown-parser":"Parser %0% hasn't been supported yet","mcfunction.parser.uuid.invalid":"Invalid UUID format","mcfunction.parser.vector.local-disallowed":"Local coordinates disallowed","mcfunction.parser.vector.mixed":"Cannot mix local coordinates and world coordinates together","mcfunction.signature-help.command-documentation":"[Minecraft Wiki: `%0%` command](https://minecraft.fandom.com/wiki/Commands/%0%)","mcfunction.signature-help.argument-parser-documentation":"[Minecraft Wiki: `%0%` argument parser](https://minecraft.fandom.com/wiki/Argument_types#%0%)","missing-key":"Missing key %0%","nbt.checker.block-states.fake-boolean":"Boolean block state values should be quoted","nbt.checker.block-states.unexpected-value-type":"Block state values should be either a string or an int","nbt.checker.block-states.unknown-state":"Unknown block state %0% for the following block(s): %1%","nbt.checker.boolean.out-of-range":"A boolean value should be either %0% or %1%","nbt.checker.collection.length-between":"%0% with length between %1% and %2%","nbt.checker.compound.field.union-empty-members":"Disallowed property","nbt.checker.path.index-out-of-bound":"The provided index %0% is out of bound, as the collection can only have at most %1% elements","nbt.checker.path.unexpected-filter":"Compound filters can only be used on compound tags","nbt.checker.path.unexpected-index":"Indices can only be used on array or list tags","nbt.checker.path.unexpected-key":"String keys can only be specified for compound tags","nbt.node":"a tag","nbt.node.byte":"a byte tag","nbt.node.byte_array":"a byte array tag","nbt.node.compound":"a compound tag","nbt.node.double":"a double tag","nbt.node.float":"a float tag","nbt.node.int":"an int tag","nbt.node.int_array":"an int array tag","nbt.node.list":"a list tag","nbt.node.long":"a long tag","nbt.node.long_array":"a long array tag","nbt.node.path.end":"the end of path","nbt.node.path.filter":"a compound filter","nbt.node.path.index":"an index","nbt.node.path.key":"a key","nbt.node.short":"a short tag","nbt.node.string":"a string tag","nbt.parser.number.out-of-range":"This looks like %0%, but it is actually %1% due to the numeral value being out of [%2%, %3%]","mcdoc.binder.dispatcher-statement.duplicated-key":"Duplicated dispatcher case %0%","mcdoc.binder.dispatcher-statement.duplicated-key.related":"%0% has already been dispatched here","mcdoc.binder.duplicated-declaration":"Duplicated declaration for %0%","mcdoc.binder.duplicated-declaration.related":"%0% is already declared here","mcdoc.binder.out-of-root":"File %0% is not under the root directory of any mcdoc project; semantic checking will be skipped","mcdoc.binder.path.super-from-root":"Cannot access super of the project root","mcdoc.binder.path.unknown-identifier":"Identifier %0% does not exist in module %1%","mcdoc.binder.path.unknown-module":"Module %0% does not exist","mcdoc.node.compound-definition":"a compound definition","mcdoc.node.enum-definition":"an enum definition","mcdoc.node.identifier":"an identifier","mcdoc.checker.entry.empty-mod-seg":"You cannot put \u201Cmod.mcdoc\u201D under a root directly","mcdoc.checker.inject-clause.unmatched-injection":"Cannot inject %0% with %1%","mcdoc.checker.type-not-assignable":"Type %0% is not assignable to type %1%","mcdoc.parser.compound-definition.field-type":"a field type","mcdoc.parser.float.illegal":"Encountered illegal float number","mcdoc.parser.identifier.reserved-word":"%0% is a reserved word and cannot be used as an identifier name","mcdoc.parser.identifier.illegal":"%0% doesn't follow the format of %1%","mcdoc.parser.index-body.dynamic-index-not-allowed":"Dynamic indexing is not allowed","mcdoc.parser.inject-clause.definition-expected":"Expected either an enum inject or a compound inject","mcdoc.parser.keyword.separation":"a separation","mcdoc.parser.resource-location.colon-expected":"Expected the colon (%0%) of resource locations","mcdoc.parser.syntax.doc-comment-unexpected":"Doc comments are not allowed here; you might want to replace the three slashes with two slashes","not-matching-any-child":"Invalid argument type",nothing:"nothing",number:"a number","number-range":"a number range","number-range.missing-min-and-max":"Expected either a minimum value or a maximum value","number.<=":"a number smaller than or equal to %0%","number.>=":"a number greater than or equal to %0%","number.between":"a number between %0% and %1%",object:"an object",objective:"an objective","objective-not-following-convention":"Invalid objective %0% which doesn't follow %1% convention","parser.float.illegal":"Illegal float numeral that doesn't follow %0%","parser.integer.illegal":"Illegal integer that doesn't follow %0%","parser.list.value":"a value","parser.list.trailing-sep":"Trailing separation","parser.record.key":"a key","parser.record.trailing-end":"Trailing separation","parser.record.unexpected-char":"Unexpected character %0%","parser.record.value":"a value","parser.resource-location.illegal":"Illegal character(s): %0%","parser.resource-location.namespace-expected":"Namespaces cannot be omitted here","parser.resource-location.tag-diallowed":"Tags are not allowed here","parser.string.illegal-brigadier":"Encountered non-[0-9A-Za-z_.+-] characters in %0%","parser.string.illegal-escape":"Unexpected escape character %0%","parser.string.illegal-quote":"Only %0% can be used to quote strings here","parser.string.illegal-unicode-escape":"Hexadecimal digit expected","punc.period":".","punc.quote":"\u201C%0%\u201D",quote:`a quote (\u201C'\u201D or \u201C"\u201D)`,quote_prefer_double:'Double quote (\u201C"\u201D) is preferable here',quote_prefer_single:"Single quote (\u201C'\u201D) is preferable here","resource-location":"a resource location","score-holder":"a score holder","scoreholder-not-following-convention":"Invalid score_holder %0% which doesn't follow %1% convention","server.new-version":"The Data-pack Language Server has been updated to a newer version: %0%","server.progress.fixing-workspace.begin":"Fixing all auto-fixable problems in the workspace","server.progress.fixing-workspace.report":"fixing %0%","server.progress.preparing.title":"Preparing Spyglass language features","server.remove-cache-file":"The cache file of DHP was moved to a storage location provided by VSCode. You can safely delete the ugly \u201C.datapack\u201D folder in your workspace root.","server.show-release-notes":"Show Release Notes",string:"a string",tag:"a tag","tag-not-following-convention":"Invalid tag %0% which doesn't follow %1% convention",team:"a team","team-not-following-convention":"Invalid team %0% which doesn't follow %1% convention","time-unit":"a time unit","too-many-block-affected":"Too many blocks in the specified area (maximum %0%, specified %1%)","too-many-chunk-affected":"Too many chunks in the specified area (maximum %0%, specified %1%)","unexpected-character":"Found non [a-z0-9/._-] character(s)","unexpected-datapack-tag":"Tags are not allowed here","unexpected-default-namespace":"Default namespace should be omitted here","unexpected-leading-slash":"Unexpected leading slash \u201C/\u201D","unexpected-local-coordinate":"Local coordinate %0% is not allowed","unexpected-nbt":"This tag doesn't exist here","unexpected-nbt-array-type":"Invalid array type %0%. Should be one of \u201CB\u201D, \u201CI\u201D, and \u201CL\u201D","unexpected-nbt-path-filter":"Compound filters are only used for compound tags","unexpected-nbt-path-index":"Indices are only used for lists/arrays tags","unexpected-nbt-path-key":"Keys are only used for compound tags","unexpected-nbt-path-sub":"The current tag doesn't have extra items","unexpected-omitted-default-namespace":"Default namespace shouldn't be omitted here","unexpected-relative-coordinate":"Relative coordinate %0% is not allowed","unexpected-scoreboard-sub-slot":"Only \u201Csidebar\u201D has sub slots","unknown-command":"Unknown command %0%","unknown-escape":"Unexpected escape character %0%","unknown-key":"Unknown key %0%","unquoted-string":"an unquoted string","unsorted-keys":"Unsorted keys",uuid:"a UUID",vector:"a vector"};var h8={en:f8},pk="en";function C(t,...e){let r=h8[pk][t]??h8.en[t];return mk(r,e)??""}function L(t){return C("punc.quote",t)}function mk(t,e){return t?.replace(/%\d+%/g,r=>{let n=parseInt(r.slice(1,-1)),i=e[n];return typeof i!="string"&&i?.[Symbol.iterator]&&(i=gs(i)),`${i??r}`})}function gs(t,e=!0,r="or"){let n=s=>e?L(s):s,i=(typeof t=="string"?[t]:Array.from(t)).map(n);switch(i.length){case 0:return C("nothing");case 1:return i[0];case 2:return i[0]+C(`conjunction.${r}_2`)+i[1];default:return`${i.slice(0,-1).join(C(`conjunction.${r}_3+_1`))}${C(`conjunction.${r}_3+_2`)}${i[i.length-1]}`}}function ze(...t){let e=gk(t);return(r,n)=>{let i={type:"literal",range:b.create(r),options:e,value:""};for(let s of e.pool)if(r.trySkip(s))return i.value=s,i.range.end=r.cursor,i;return n.err.report(C("expected",e.pool),i),i}}function gk(t){let e;return typeof t[0]=="object"?e=t[0]:e={pool:t},e.pool=e.pool.sort((r,n)=>n.length-r.length),e}var Pd=ei(Uc(),1);var Md=Object.freeze(["mcdoc","mcdoc/dispatcher"]),ys=Object.freeze(["activity","attribute","block","block_entity_type","block_predicate_type","chunk_status","custom_stat","enchantment","entity_type","float_provider_type","fluid","game_event","height_provider_type","int_provider_type","item","loot_condition_type","loot_function_type","loot_nbt_provider_type","loot_number_provider_type","loot_pool_entry_type","loot_score_provider_type","memory_module_type","menu","mob_effect","motive","particle_type","point_of_interest_type","pos_rule_test","position_source_type","potion","recipe_serializer","recipe_type","rule_test","schedule","sensor_type","sound_event","stat_type","villager_profession","villager_type","worldgen/biome_source","worldgen/block_placer_type","worldgen/block_state_provider_type","worldgen/carver","worldgen/chunk_generator","worldgen/decorator","worldgen/feature","worldgen/feature_size_type","worldgen/foliage_placer_type","worldgen/material_condition","worldgen/material_rule","worldgen/placement_modifier_type","worldgen/structure_feature","worldgen/structure_piece","worldgen/structure_pool_element","worldgen/structure_processor","worldgen/surface_builder","worldgen/tree_decorator_type","worldgen/trunk_placer_type"]),g8=Object.freeze(["worldgen/biome","worldgen/configured_carver","worldgen/configured_feature","worldgen/configured_structure_feature","worldgen/configured_surface_builder","worldgen/density_function","worldgen/noise","worldgen/noise_settings","worldgen/placed_feature","worldgen/processor_list","worldgen/template_pool"]),Od=Object.freeze(["function",...ys,...g8]),yk=Object.freeze(Od.map(t=>`tag/${t}`)),Yo=Object.freeze(["advancement","chat_type","damage_type","dimension","dimension_type","function","item_modifier","loot_table","predicate","recipe","structure","trim_material","trim_pattern",...yk,...g8]),Ak=Object.freeze(["attribute_modifier_uuid","bossbar","objective","score_holder","storage","tag","team"]),bk=Object.freeze([...Yo,...Ak]),FL=Object.freeze([...bk,...Md,...ys]),Ck=Object.freeze(["bossbar","storage","mcdoc/dispatcher",...Yo,...ys]),d8;(function(t){function e(r){return Ck.includes(r)}t.is=e})(d8||(d8={}));var Lt;(function(t){function e(i){return i?{category:i.category,path:i.path}:void 0}t.fromSymbol=e;function r(i){return JSON.stringify({category:i.category,path:i.path})}t.toString=r;function n(i){return JSON.parse(i)}t.fromString=n})(Lt||(Lt={}));var Jo,p8=class{constructor(){R(this,Jo,new Set)}add(e){e&&g(this,Jo).add(Lt.toString(e))}has(e){return g(this,Jo).has(Lt.toString(e))}collect(){return[...g(this,Jo)].map(Lt.fromString)}};Jo=new WeakMap;var As=Object.freeze(["definition","declaration","implementation","reference","typeDefinition"]),$u;(function(t){function e(r){return As.includes(r)}t.is=e})($u||($u={}));var m8;(function(t){function e(r,n,...i){if(n8(r)){for(let o of r){let u=e(o,n,...i);if(u)return u}return}let s=r[n];for(let o of i);}t.get=e})(m8||(m8={}));var hf;(function(t){function e(r,n,i,s,o){return{...af.create(r,n),...i?{fullRange:b.get(i),fullPosRange:bi.from(i,r)}:{},...s?{contributor:s}:{},...o||{}}}t.create=e})(hf||(hf={}));var zu;(function(t){function e(s){let o=(l,c,f,h,d)=>{l.category=h,l.identifier=d[d.length-1],l.path=d,l.parentMap=c,f&&(l.parentSymbol=f),l.members&&u(l.members,l,h,d)},u=(l,c,f,h)=>{for(let[d,p]of Object.entries(l))o(p,l,c,f,[...h,d])},a=(0,Pd.default)()(s);for(let[l,c]of Object.entries(a))u(c,void 0,l,[]);return a}t.link=e;function r(s){let o=l=>{delete l.category,delete l.identifier,delete l.parentMap,delete l.parentSymbol,delete l.path,l.members&&u(l.members)},u=l=>{for(let c of Object.values(l))o(c)},a=(0,Pd.default)({circles:!0})(s);for(let l of Object.values(a))u(l);return a}t.unlink=r;function n(s){return JSON.stringify(r(s))}t.serialize=n;function i(s){return e(JSON.parse(s))}t.deserialize=i})(zu||(zu={}));var bs=class{constructor(e,r,n,i){this._uri=e,this._languageId=r,this._version=n,this._content=i,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(e){if(e){let r=this.offsetAt(e.start),n=this.offsetAt(e.end);return this._content.substring(r,n)}return this._content}update(e,r){for(let n of e)if(bs.isIncremental(n)){let i=A8(n.range),s=this.offsetAt(i.start),o=this.offsetAt(i.end);this._content=this._content.substring(0,s)+n.text+this._content.substring(o,this._content.length);let u=Math.max(i.start.line,0),a=Math.max(i.end.line,0),l=this._lineOffsets,c=y8(n.text,!1,s);if(a-u===c.length)for(let h=0,d=c.length;he?i=o:n=o+1}let s=n-1;return{line:s,character:e-r[s]}}offsetAt(e){let r=this.getLineOffsets();if(e.line>=r.length)return this._content.length;if(e.line<0)return 0;let n=r[e.line],i=e.line+1{let h=c.range.start.line-f.range.start.line;return h===0?c.range.start.character-f.range.start.character:h}),a=0,l=[];for(let c of u){let f=i.offsetAt(c.range.start);if(fa&&l.push(o.substring(a,f)),c.newText.length&&l.push(c.newText),a=i.offsetAt(c.range.end)}return l.push(o.substr(a)),l.join("")}t.applyEdits=n})(pn||(pn={}));function Nd(t,e){if(t.length<=1)return t;let r=t.length/2|0,n=t.slice(0,r),i=t.slice(r);Nd(n,e),Nd(i,e);let s=0,o=0,u=0;for(;sr.line||e.line===r.line&&e.character>r.character?{start:r,end:e}:t}function Ek(t){let e=A8(t.range);return e!==t.range?{newText:t.newText,range:e}:t}var pf=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var u=t.length-1;u>=0;u--)(o=t[u])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s},Ei,Cs,ju,wi,Es,Er,It=class{constructor(e,r,n,i=!1){R(this,Ei,void 0);R(this,Cs,void 0);R(this,ju,void 0);R(this,wi,new Set);R(this,Es,Object.create(null));R(this,Er,void 0);q(this,"_delayedOps",[]);q(this,"_inDelayMode");N(this,Cs,new r),N(this,ju,r),N(this,Ei,e),N(this,Er,n),this._inDelayMode=i,this.on("symbolCreated",({symbol:s})=>{g(this,wi).add(Lt.toString(s))}).on("symbolRemoved",({symbol:s})=>{g(this,wi).delete(Lt.toString(s))}).on("symbolLocationCreated",({symbol:s,location:o})=>{let u=g(this,Es)[o.contributor??"undefined"]??=Object.create(null),a=u[o.uri]??=new Set,l=Lt.toString(s);a.add(l),g(this,wi).delete(l)}).on("symbolLocationRemoved",({symbol:s})=>{let o=Lt.toString(s);g(this,wi).add(o)})}get global(){return g(this,Ei)}on(e,r){return g(this,Cs).on(e,r),this}once(e,r){return g(this,Cs).once(e,r),this}emit(e,...r){return g(this,Cs).emit(e,...r)}buildCache(){It.forEachSymbol(this.global,e=>{this.emit("symbolCreated",{symbol:e}),It.forEachLocationOfSymbol(e,({type:r,location:n})=>{this.emit("symbolLocationCreated",{symbol:e,type:r,location:n})})})}clone(){return new It(g(this,Ei),g(this,ju),g(this,Er),!0)}applyDelayedEdits(){this._delayedOps.forEach(e=>e()),this._delayedOps=[],this._inDelayMode=!1}contributeAs(e,r){let n=g(this,Er);N(this,Er,e);try{r()}finally{N(this,Er,n)}return this}async contributeAsAsync(e,r){let n=g(this,Er);N(this,Er,e);try{await r()}finally{N(this,Er,n)}return this}clear({uri:e,contributor:r,predicate:n=()=>!0}){let i=()=>r?g(this,Es)[r]?[g(this,Es)[r]]:[]:Object.values(g(this,Es)),s=()=>{let l=i();return(e?l.map(f=>f[e]??new Set):l.map(f=>Object.values(f)).flat()).map(f=>[...f]).flat().map(Lt.fromString)},o=()=>e?[g(this,Ei)]:[g(this,Ei)],u=s(),a=o();for(let l of a){for(let c of u){let{symbol:f}=It.lookupTable(l,c.category,c.path);f&&this.removeLocationsFromSymbol(f,e?h=>h.location.uri===e&&n(h):n)}this.trim(l)}}lookup(e,r,n){for(;n;){if(n.locals){let i=It.lookupTable(n.locals,e,r);if(i.symbol)return i}n=n.parent}return It.lookupTable(this.global,e,r)}query(e,r,...n){let i=It.toUri(e),{parentSymbol:s,parentMap:o,symbol:u}=this.lookup(r,n,$d(e)?e.node:void 0),a=u?It.isVisible(u,i):!0;return new df({category:r,doc:e,contributor:g(this,Er),map:a?o:void 0,parentSymbol:s,path:n,symbol:a?u:void 0,util:this})}getVisibleSymbols(e,r){let n=this.lookup(e,[],void 0).parentMap??void 0;return It.filterVisibleSymbols(r,n)}static toUri(e){return typeof e=="string"?e:$d(e)?e.doc.uri:e.uri}trim(e){let r=n=>{n&&It.isTrimmable(n)&&(delete n.parentMap[n.identifier],this.emit("symbolRemoved",{symbol:n}),r(n.parentSymbol))};for(let n of g(this,wi)){let i=Lt.fromString(n),{symbol:s}=It.lookupTable(e,i.category,i.path);r(s)}}removeLocationsFromSymbol(e,r){for(let n of As)e[n]&&(e[n]=e[n].reduce((i,s)=>(r({location:s,symbol:e,type:n})?this.emit("symbolLocationRemoved",{symbol:e,type:n,location:s}):i.push(s),i),[]))}enterMap(e,r,n,i,s,o,u,a){let l=r[s];return l?this.amendSymbol(l,o,u,a):l=this.createSymbol(n,e,r,i,s,o,u,a),this.emit("symbolAmended",{symbol:l}),l}static lookupTable(e,r,n){let i=e[r],s,o;for(let u=0;u=0;o--){let u=e[o],a=this.lookupTable(u,r,n);if(a.symbol)return a;!s&&!i&&(a.parentSymbol||a.parentMap)&&(s=a.parentSymbol,i=a.parentMap)}return{parentSymbol:s,parentMap:i,symbol:void 0}}createSymbol(e,r,n,i,s,o,u,a){let l=n[s]={category:e,identifier:s,...r?{parentSymbol:r}:{},parentMap:n,path:i,...o.data};return this.emit("symbolCreated",{symbol:l}),this.amendSymbolUsage(l,o.usage,u,a),l}amendSymbol(e,r,n,i){this.amendSymbolMetadata(e,r.data),this.amendSymbolUsage(e,r.usage,n,i)}amendSymbolMetadata(e,r){if(r){if("data"in r&&(e.data=r.data),"desc"in r&&(e.desc=r.desc),r.relations&&Object.keys(r.relations).length){e.relations??={};for(let n of Object.keys(r.relations))e.relations[n]=r.relations[n]}if("subcategory"in r&&(e.subcategory=r.subcategory),"visibility"in r){let n=i=>i===void 0||i===2||i===3;if(e.visibility===r.visibility||n(e.visibility)&&n(r.visibility))e.visibility=r.visibility;else throw new Error(`Cannot change visibility from ${e.visibility} to ${r.visibility}: ${JSON.stringify(Lt.fromSymbol(e))}`)}r.visibilityRestriction?.length&&(e.visibilityRestriction=(e.visibilityRestriction??[]).concat(r.visibilityRestriction))}}amendSymbolUsage(e,r,n,i){if(r){let s=r.type??"reference",o=e[s]??=[],u=b.get((Id.is(r)?r.node:r.range)??0),a=hf.create(n,u,r.fullRange,i,{accessType:r.accessType,skipRenaming:r.skipRenaming});n.uri.startsWith("file:")||(delete a.range,delete a.posRange,delete a.fullRange,delete a.fullPosRange),o.push(a),this.emit("symbolLocationCreated",{symbol:e,type:s,location:a})}}resolveAlias(e){return e?.relations?.aliasOf?this.resolveAlias(this.lookup(e.relations.aliasOf.category,e.relations.aliasOf.path).symbol):e}static filterVisibleSymbols(e,r={}){let n={};for(let[i,s]of Object.entries(r))It.isVisible(s,e)&&(n[i]=s);return n}static isTrimmable(e){return!Object.keys(e.members??{}).length&&!e.declaration?.length&&!e.definition?.length&&!e.implementation?.length&&!e.reference?.length&&!e.typeDefinition?.length}static isVisible(e,r){switch(e.visibility){case 3:return!1;case 0:case 1:case 2:default:return!0}}static isDeclared(e){return!!(e?.declaration?.length||e?.definition?.length)}static isDefined(e){return!!(e?.definition?.length||e?.definition?.length&&e?.implementation?.length)}static isImplemented(e){return!!(e?.implementation?.length||e?.definition?.length)}static isReferenced(e){return!!e?.reference?.length}static isTypeDefined(e){return!!e?.typeDefinition?.length}static getDeclaredLocation(e){return e.declaration?.[0]??e.definition?.[0]??(()=>{throw new Error(`Cannot get declared location of ${JSON.stringify(Lt.fromSymbol(e))}`)})()}static forEachSymbolInMap(e,r){for(let n of Object.values(e))r(n),n.members&&this.forEachSymbolInMap(n.members,r)}static forEachSymbol(e,r){for(let n of Object.values(e))this.forEachSymbolInMap(n,r)}static forEachLocationOfSymbol(e,r){for(let n of As)e[n]?.forEach(i=>r({type:n,location:i}))}static isVisibilityInGlobal(e){return e===void 0||e===2||e===3}static areVisibilitiesCompatible(e,r){return this.isVisibilityInGlobal(e)&&this.isVisibilityInGlobal(r)||e===0&&r===0||e===1&&r===1}},He=It;Ei=new WeakMap,Cs=new WeakMap,ju=new WeakMap,wi=new WeakMap,Es=new WeakMap,Er=new WeakMap;pf([mf()],He.prototype,"clear",null);pf([mf()],He.prototype,"trim",null);pf([mf()],He.prototype,"removeLocationsFromSymbol",null);var Ld;(function(t){function e(r){return!!r?.range}t.is=e})(Ld||(Ld={}));var Id;(function(t){function e(r){return!!r?.node}t.is=e})(Id||(Id={}));var mn,Fi,ws,Xo,Uu,gn,zn,qe,zd=class{constructor({category:e,contributor:r,doc:n,map:i,parentSymbol:s,path:o,symbol:u,util:a}){q(this,"category");q(this,"path");R(this,mn,void 0);R(this,Fi,void 0);R(this,ws,void 0);R(this,Xo,void 0);R(this,Uu,!1);R(this,gn,void 0);R(this,zn,void 0);R(this,qe,void 0);q(this,"util");this.category=e,this.path=o,typeof n=="string"?(n=pn.create(n,"",0,""),N(this,ws,!0)):$d(n)&&(N(this,Fi,n.node),n=n.doc),N(this,mn,n),N(this,Xo,r),N(this,gn,i),N(this,zn,s),N(this,qe,u),this.util=a}get symbol(){return g(this,qe)}get visibleMembers(){return He.filterVisibleSymbols(g(this,mn).uri,this.path.length===0?g(this,gn):g(this,qe)?.members)}heyGimmeDaSymbol(){return g(this,qe)}getData(e){let r=g(this,qe)?.data;return e(r)?r:void 0}with(e){return e(this),this}if(e,r){return e.call(this,g(this,qe),this)&&(r.call(this,g(this,qe),this),N(this,Uu,!0)),this}ifUnknown(e){return this.if(r=>r===void 0,e)}ifKnown(e){return this.if(r=>r!==void 0,e)}ifDeclared(e){return this.if(r=>He.isDeclared(r),e)}ifDefined(e){return this.if(He.isDefined,e)}ifImplemented(e){return this.if(He.isImplemented,e)}ifReferenced(e){return this.if(He.isReferenced,e)}ifTypeDefined(e){return this.if(He.isTypeDefined,e)}else(e){return g(this,Uu)||e.call(this,g(this,qe),this),this}elseEnter(e){return this.else(()=>this.enter(e))}elseResolveAlias(){return this.else(()=>this.resolveAlias())}_enter(e){let r=i=>i.data?.visibility??this.symbol?.visibility??2,n=i=>{let s=r(i);if(g(this,gn)&&He.areVisibilitiesCompatible(s,g(this,qe)?.visibility))return g(this,gn);if(this.path.length>1){if(g(this,zn)){if(!He.areVisibilitiesCompatible(s,g(this,zn).visibility))throw new Error(`Cannot enter member \u201C${this.getPath()}\u201D of ${Ci.stringifyVisibility(s)} visibility to parent of ${Ci.stringifyVisibility(g(this,zn).visibility)} visibility`);return g(this,zn).members??={}}}else{let o;if(He.isVisibilityInGlobal(s))o=this.util.global;else if(s===1){if(!g(this,Fi))throw new Error(`Cannot enter \u201C${this.getPath()}\u201D with ${Ci.stringifyVisibility(s)} visibility as no node is supplied`);let u=g(this,Fi);for(;u;){if(u.type==="file"){o=u.locals;break}u=u.parent}if(!o)throw new Error(`Cannot enter \u201C${this.getPath()}\u201D with ${Ci.stringifyVisibility(s)} visibility as no file node is supplied`)}else{if(!g(this,Fi))throw new Error(`Cannot enter \u201C${this.getPath()}\u201D with ${Ci.stringifyVisibility(s)} visibility as no node is supplied`);let u=g(this,Fi);for(;u;){if(u.locals){o=u.locals;break}u=u.parent}if(!o)throw new Error(`Cannot enter \u201C${this.getPath()}\u201D with ${Ci.stringifyVisibility(s)} visibility as no node with locals is supplied`)}return o[this.category]??={}}throw new Error(`Cannot create the symbol map for \u201C${this.getPath()}\u201D`)};g(this,ws)&&Ld.is(e.usage)&&(e.usage.range=b.create(0,0)),N(this,gn,n(e)),N(this,qe,this.util.enterMap(g(this,zn),g(this,gn),this.category,this.path,this.path[this.path.length-1],e,g(this,mn),g(this,Xo))),e.usage?.node&&(e.usage.node.symbol=g(this,qe))}enter(e){return this._enter(e),this}amend(e){return this.ifKnown(()=>this.enter(e))}resolveAlias(){if(g(this,qe)){let e=this.util.resolveAlias(g(this,qe));if(!e)throw new Error("The current symbol points to an non-existent symbol.");N(this,qe,e),N(this,gn,e.parentMap)}return this}member(){let e,r,n;if(arguments.length===2?(e=g(this,ws)?g(this,mn).uri:g(this,mn),r=arguments[0],n=arguments[1]):(e=arguments[0],r=arguments[1],n=arguments[2]),g(this,qe)===void 0)throw new Error(`Tried to query member symbol \u201C${r}\u201D from an undefined symbol (path \u201C${this.path.join(".")}\u201D)`);let i=typeof e=="string"&&e===g(this,mn).uri&&!g(this,ws)?g(this,mn):e,s=g(this,qe).members,o=s?.[r],u=new zd({category:this.category,doc:i,contributor:g(this,Xo),map:s,parentSymbol:g(this,qe),path:[...this.path,r],symbol:o,util:this.util});return n(u),this}onEach(e,r){for(let n of e)r.call(this,n,this);return this}forEachMember(e){return this.onEach(Object.keys(this.visibleMembers),r=>this.member(r,n=>e(r,n)))}getPath(){return`${this.category}.${this.path.join("/")}`}},df=zd;mn=new WeakMap,Fi=new WeakMap,ws=new WeakMap,Xo=new WeakMap,Uu=new WeakMap,gn=new WeakMap,zn=new WeakMap,qe=new WeakMap;pf([mf(t=>t.util)],df.prototype,"_enter",null);var Ci;(function(t){let e="+ ";function r(l,c){if(l!==c)throw new Error(`Assertion error: ${l} !== ${c}`)}function n(l){return l.map(c=>i(c)).join(` +`],["r","\r"],["t"," "]]),ht;(function(t){function e(n){return n?.type==="string"}t.is=e;function r(n,i){return n=b.get(n),{type:"string",range:n,options:i,value:"",valueMap:[{inner:b.create(0),outer:b.create(n.start)}]}}t.mock=r})(ht||(ht={}));var Cr;(function(t){function e(n){return n?.type==="symbol"}t.is=e;function r(n,i){return{type:"symbol",range:b.get(n),options:i,value:""}}t.mock=r})(Cr||(Cr={}));var f8={array:"an array",boolean:"a boolean","bug-of-mc":"Due to a bug of Minecraft (%0%), %1%. Please Mojang, fix your game","code-action.block-state-sort-keys":"Sort block state","code-action.command-replaceitem":"Update this command to /item \u2026 replace","code-action.fix-file":"Fix all auto-fixable problems in this file","code-action.fix-workspace":"Fix all auto-fixable problems in the workspace","code-action.id-attribute-datafix":"Update this attribute name to 1.16","code-action.id-complete-default-namespace":"Complete default namespace","code-action.id-create-file":"Create %0% in the same data pack","code-action.id-omit-default-namespace":"Omit default namespace","code-action.id-zombified-piglin-datafix":"Change this ID to Zombified Piglin's","code-action.nbt-compound-sort-keys":"Sort NBT compound tag","code-action.nbt-type-to-byte":"Convert to an NBT byte tag","code-action.nbt-type-to-double":"Convert to an NBT double tag","code-action.nbt-type-to-float":"Convert to an NBT float tag","code-action.nbt-type-to-int":"Convert to an NBT int tag","code-action.nbt-type-to-long":"Convert to an NBT long tag","code-action.nbt-type-to-short":"Convert to an NBT short tag","code-action.nbt-uuid-datafix":"Update this UUID to 1.16","code-action.selector-sort-keys":"Sort selector argument","code-action.string-double-quote":"Quote this string with double quotation marks","code-action.string-single-quote":"Quote this string with single quotation marks","code-action.string-unquote":"Unquote this string","code-action.vector-align-0.0":"Align this vector to block origin","code-action.vector-align-0.5":"Align this vector to block center",comment:"a comment starting with %0%","conjunction.and_2":" and ","conjunction.and_3+_1":", ","conjunction.and_3+_2":", and ","conjunction.or_2":" or ","conjunction.or_3+_1":", ","conjunction.or_3+_2":", or ","datafix.error.command-replaceitem":"/replaceitem was removed in 20w46a (the second snapshot of 1.17) in favour of /item","duplicate-key":"Duplicate key %0%","ending-quote":"an ending quote %0%",entity:"an entity","error.unparseable-content":"Encountered unparseable content",expected:"Expected %0%","expected-got":"Expected %0% but got %1%",float:"a float","float.between":"a float between %0% and %1%",integer:"an integer","integer.between":"an integer between %0% and %1%","json.doc.advancement.display":"Advancement display settings. If present, the advancement will be visible in the advancement tabs.","json.checker.array.length-between":"%0% with length between %1% and %2%","json.checker.object.field.union-empty-members":"Disallowed property","json.checker.item.duplicate":"Duplicate list item","json.checker.property.deprecated":"Property %0% is deprecated","json.checker.property.missing":"Missing property %0%","json.checker.property.unknown":"Unknown property %0%","json.checker.string.hex-color":"a 6-digit hexadecimal number","json.checker.tag-entry.duplicate":"Duplicate tag entry","json.node.array":"an array","json.node.boolean":"a boolean","json.node.null":"a null","json.node.number":"a number","json.node.object":"an object","json.node.string":"a string","key-not-following-convention":"Invalid key %0% which doesn't follow %1% convention","linter.diagnostic-message-wrapper":"%0% (rule: %1%)","linter.name-convention.illegal":"Name %0% doesn't match %1%","linter.undeclared-symbol.message":"Cannot find %0% %1%","linter-config-validator.name-convention.type":"Expects a string that contains a regular expression describing the name","linter-config-validator.wrapper":"%0%. See [the documentation](%1) for more information",long:"a long","mcfunction.checker.command.data-modify-unapplicable-operation":"Operation %0% can only be used on %1%; the target path has type %2% instead","mcfunction.completer.block.states.default-value":"Default: %0%","mcfunction.parser.entity-selector.arguments.not-applicable":"%0% is not applicable here","mcfunction.parser.entity-selector.arguments.unknown":"Unknown entity selector argument %0%","mcfunction.parser.entity-selector.entities-disallowed":"The selector contains non-player entities","mcfunction.parser.entity-selector.multiple-disallowed":"The selector contains multiple entities","mcfunction.parser.entity-selector.player-name.too-long":"Player names cannot be longer than %0% characters","mcfunction.parser.eoc-unexpected":"Expected more arguments","mcfunction.parser.leading-slash":"a leading slash %0%","mcfunction.parser.no-permission":"Permission level %0% is required, which is higher than %1% defined in config","mcfunction.parser.objective.too-long":"Objective names cannot be longer than %0% characters","mcfunction.parser.range.min>max":"The minimum value %0% is larger than the maximum value %1%","mcfunction.parser.score_holder.fake-name.too-long":"Fake names cannot be longer than %0% characters","mcfunction.parser.sep":"a space (%0%)","mcfunction.parser.trailing":"Trailing data encountered: %0%","mcfunction.parser.unknown-parser":"Parser %0% hasn't been supported yet","mcfunction.parser.uuid.invalid":"Invalid UUID format","mcfunction.parser.vector.local-disallowed":"Local coordinates disallowed","mcfunction.parser.vector.mixed":"Cannot mix local coordinates and world coordinates together","mcfunction.signature-help.command-documentation":"[Minecraft Wiki: `%0%` command](https://minecraft.fandom.com/wiki/Commands/%0%)","mcfunction.signature-help.argument-parser-documentation":"[Minecraft Wiki: `%0%` argument parser](https://minecraft.fandom.com/wiki/Argument_types#%0%)","missing-key":"Missing key %0%","nbt.checker.block-states.fake-boolean":"Boolean block state values should be quoted","nbt.checker.block-states.unexpected-value-type":"Block state values should be either a string or an int","nbt.checker.block-states.unknown-state":"Unknown block state %0% for the following block(s): %1%","nbt.checker.boolean.out-of-range":"A boolean value should be either %0% or %1%","nbt.checker.collection.length-between":"%0% with length between %1% and %2%","nbt.checker.compound.field.union-empty-members":"Disallowed property","nbt.checker.path.index-out-of-bound":"The provided index %0% is out of bound, as the collection can only have at most %1% elements","nbt.checker.path.unexpected-filter":"Compound filters can only be used on compound tags","nbt.checker.path.unexpected-index":"Indices can only be used on array or list tags","nbt.checker.path.unexpected-key":"String keys can only be specified for compound tags","nbt.node":"a tag","nbt.node.byte":"a byte tag","nbt.node.byte_array":"a byte array tag","nbt.node.compound":"a compound tag","nbt.node.double":"a double tag","nbt.node.float":"a float tag","nbt.node.int":"an int tag","nbt.node.int_array":"an int array tag","nbt.node.list":"a list tag","nbt.node.long":"a long tag","nbt.node.long_array":"a long array tag","nbt.node.path.end":"the end of path","nbt.node.path.filter":"a compound filter","nbt.node.path.index":"an index","nbt.node.path.key":"a key","nbt.node.short":"a short tag","nbt.node.string":"a string tag","nbt.parser.number.out-of-range":"This looks like %0%, but it is actually %1% due to the numeral value being out of [%2%, %3%]","mcdoc.binder.dispatcher-statement.duplicated-key":"Duplicated dispatcher case %0%","mcdoc.binder.dispatcher-statement.duplicated-key.related":"%0% has already been dispatched here","mcdoc.binder.duplicated-declaration":"Duplicated declaration for %0%","mcdoc.binder.duplicated-declaration.related":"%0% is already declared here","mcdoc.binder.out-of-root":"File %0% is not under the root directory of any mcdoc project; semantic checking will be skipped","mcdoc.binder.path.super-from-root":"Cannot access super of the project root","mcdoc.binder.path.unknown-identifier":"Identifier %0% does not exist in module %1%","mcdoc.binder.path.unknown-module":"Module %0% does not exist","mcdoc.node.compound-definition":"a compound definition","mcdoc.node.enum-definition":"an enum definition","mcdoc.node.identifier":"an identifier","mcdoc.checker.entry.empty-mod-seg":"You cannot put \u201Cmod.mcdoc\u201D under a root directly","mcdoc.checker.inject-clause.unmatched-injection":"Cannot inject %0% with %1%","mcdoc.checker.type-not-assignable":"Type %0% is not assignable to type %1%","mcdoc.parser.compound-definition.field-type":"a field type","mcdoc.parser.float.illegal":"Encountered illegal float number","mcdoc.parser.identifier.reserved-word":"%0% is a reserved word and cannot be used as an identifier name","mcdoc.parser.identifier.illegal":"%0% doesn't follow the format of %1%","mcdoc.parser.index-body.dynamic-index-not-allowed":"Dynamic indexing is not allowed","mcdoc.parser.inject-clause.definition-expected":"Expected either an enum inject or a compound inject","mcdoc.parser.keyword.separation":"a separation","mcdoc.parser.resource-location.colon-expected":"Expected the colon (%0%) of resource locations","mcdoc.parser.syntax.doc-comment-unexpected":"Doc comments are not allowed here; you might want to replace the three slashes with two slashes","not-matching-any-child":"Invalid argument type",nothing:"nothing",number:"a number","number-range":"a number range","number-range.missing-min-and-max":"Expected either a minimum value or a maximum value","number.<=":"a number smaller than or equal to %0%","number.>=":"a number greater than or equal to %0%","number.between":"a number between %0% and %1%",object:"an object",objective:"an objective","objective-not-following-convention":"Invalid objective %0% which doesn't follow %1% convention","parser.float.illegal":"Illegal float numeral that doesn't follow %0%","parser.integer.illegal":"Illegal integer that doesn't follow %0%","parser.list.value":"a value","parser.list.trailing-sep":"Trailing separation","parser.record.key":"a key","parser.record.trailing-end":"Trailing separation","parser.record.unexpected-char":"Unexpected character %0%","parser.record.value":"a value","parser.resource-location.illegal":"Illegal character(s): %0%","parser.resource-location.namespace-expected":"Namespaces cannot be omitted here","parser.resource-location.tag-disallowed":"Tags are not allowed here","parser.string.illegal-brigadier":"Encountered non-[0-9A-Za-z_.+-] characters in %0%","parser.string.illegal-escape":"Unexpected escape character %0%","parser.string.illegal-quote":"Only %0% can be used to quote strings here","parser.string.illegal-unicode-escape":"Hexadecimal digit expected","punc.period":".","punc.quote":"\u201C%0%\u201D",quote:`a quote (\u201C'\u201D or \u201C"\u201D)`,quote_prefer_double:'Double quote (\u201C"\u201D) is preferable here',quote_prefer_single:"Single quote (\u201C'\u201D) is preferable here","resource-location":"a resource location","score-holder":"a score holder","scoreholder-not-following-convention":"Invalid score_holder %0% which doesn't follow %1% convention","server.new-version":"The Data-pack Language Server has been updated to a newer version: %0%","server.progress.fixing-workspace.begin":"Fixing all auto-fixable problems in the workspace","server.progress.fixing-workspace.report":"fixing %0%","server.progress.preparing.title":"Preparing Spyglass language features","server.remove-cache-file":"The cache file of DHP was moved to a storage location provided by VSCode. You can safely delete the ugly \u201C.datapack\u201D folder in your workspace root.","server.show-release-notes":"Show Release Notes",string:"a string",tag:"a tag","tag-not-following-convention":"Invalid tag %0% which doesn't follow %1% convention",team:"a team","team-not-following-convention":"Invalid team %0% which doesn't follow %1% convention","time-unit":"a time unit","too-many-block-affected":"Too many blocks in the specified area (maximum %0%, specified %1%)","too-many-chunk-affected":"Too many chunks in the specified area (maximum %0%, specified %1%)","unexpected-character":"Found non [a-z0-9/._-] character(s)","unexpected-datapack-tag":"Tags are not allowed here","unexpected-default-namespace":"Default namespace should be omitted here","unexpected-leading-slash":"Unexpected leading slash \u201C/\u201D","unexpected-local-coordinate":"Local coordinate %0% is not allowed","unexpected-nbt":"This tag doesn't exist here","unexpected-nbt-array-type":"Invalid array type %0%. Should be one of \u201CB\u201D, \u201CI\u201D, and \u201CL\u201D","unexpected-nbt-path-filter":"Compound filters are only used for compound tags","unexpected-nbt-path-index":"Indices are only used for lists/arrays tags","unexpected-nbt-path-key":"Keys are only used for compound tags","unexpected-nbt-path-sub":"The current tag doesn't have extra items","unexpected-omitted-default-namespace":"Default namespace shouldn't be omitted here","unexpected-relative-coordinate":"Relative coordinate %0% is not allowed","unexpected-scoreboard-sub-slot":"Only \u201Csidebar\u201D has sub slots","unknown-command":"Unknown command %0%","unknown-escape":"Unexpected escape character %0%","unknown-key":"Unknown key %0%","unquoted-string":"an unquoted string","unsorted-keys":"Unsorted keys",uuid:"a UUID",vector:"a vector"};var h8={en:f8},pk="en";function C(t,...e){let r=h8[pk][t]??h8.en[t];return mk(r,e)??""}function L(t){return C("punc.quote",t)}function mk(t,e){return t?.replace(/%\d+%/g,r=>{let n=parseInt(r.slice(1,-1)),i=e[n];return typeof i!="string"&&i?.[Symbol.iterator]&&(i=gs(i)),`${i??r}`})}function gs(t,e=!0,r="or"){let n=s=>e?L(s):s,i=(typeof t=="string"?[t]:Array.from(t)).map(n);switch(i.length){case 0:return C("nothing");case 1:return i[0];case 2:return i[0]+C(`conjunction.${r}_2`)+i[1];default:return`${i.slice(0,-1).join(C(`conjunction.${r}_3+_1`))}${C(`conjunction.${r}_3+_2`)}${i[i.length-1]}`}}function ze(...t){let e=gk(t);return(r,n)=>{let i={type:"literal",range:b.create(r),options:e,value:""};for(let s of e.pool)if(r.trySkip(s))return i.value=s,i.range.end=r.cursor,i;return n.err.report(C("expected",e.pool),i),i}}function gk(t){let e;return typeof t[0]=="object"?e=t[0]:e={pool:t},e.pool=e.pool.sort((r,n)=>n.length-r.length),e}var Pd=ei(Uc(),1);var Md=Object.freeze(["mcdoc","mcdoc/dispatcher"]),ys=Object.freeze(["activity","attribute","block","block_entity_type","block_predicate_type","chunk_status","custom_stat","enchantment","entity_type","float_provider_type","fluid","game_event","height_provider_type","int_provider_type","item","loot_condition_type","loot_function_type","loot_nbt_provider_type","loot_number_provider_type","loot_pool_entry_type","loot_score_provider_type","memory_module_type","menu","mob_effect","motive","particle_type","point_of_interest_type","pos_rule_test","position_source_type","potion","recipe_serializer","recipe_type","rule_test","schedule","sensor_type","sound_event","stat_type","villager_profession","villager_type","worldgen/biome_source","worldgen/block_placer_type","worldgen/block_state_provider_type","worldgen/carver","worldgen/chunk_generator","worldgen/decorator","worldgen/feature","worldgen/feature_size_type","worldgen/foliage_placer_type","worldgen/material_condition","worldgen/material_rule","worldgen/placement_modifier_type","worldgen/structure_feature","worldgen/structure_piece","worldgen/structure_pool_element","worldgen/structure_processor","worldgen/surface_builder","worldgen/tree_decorator_type","worldgen/trunk_placer_type"]),g8=Object.freeze(["worldgen/biome","worldgen/configured_carver","worldgen/configured_feature","worldgen/configured_structure_feature","worldgen/configured_surface_builder","worldgen/density_function","worldgen/noise","worldgen/noise_settings","worldgen/placed_feature","worldgen/processor_list","worldgen/template_pool"]),Od=Object.freeze(["function",...ys,...g8]),yk=Object.freeze(Od.map(t=>`tag/${t}`)),Yo=Object.freeze(["advancement","chat_type","damage_type","dimension","dimension_type","function","item_modifier","loot_table","predicate","recipe","structure","trim_material","trim_pattern",...yk,...g8]),Ak=Object.freeze(["attribute_modifier_uuid","bossbar","objective","score_holder","storage","tag","team"]),bk=Object.freeze([...Yo,...Ak]),FL=Object.freeze([...bk,...Md,...ys]),Ck=Object.freeze(["bossbar","storage","mcdoc/dispatcher",...Yo,...ys]),d8;(function(t){function e(r){return Ck.includes(r)}t.is=e})(d8||(d8={}));var Lt;(function(t){function e(i){return i?{category:i.category,path:i.path}:void 0}t.fromSymbol=e;function r(i){return JSON.stringify({category:i.category,path:i.path})}t.toString=r;function n(i){return JSON.parse(i)}t.fromString=n})(Lt||(Lt={}));var Jo,p8=class{constructor(){R(this,Jo,new Set)}add(e){e&&g(this,Jo).add(Lt.toString(e))}has(e){return g(this,Jo).has(Lt.toString(e))}collect(){return[...g(this,Jo)].map(Lt.fromString)}};Jo=new WeakMap;var As=Object.freeze(["definition","declaration","implementation","reference","typeDefinition"]),$u;(function(t){function e(r){return As.includes(r)}t.is=e})($u||($u={}));var m8;(function(t){function e(r,n,...i){if(n8(r)){for(let o of r){let u=e(o,n,...i);if(u)return u}return}let s=r[n];for(let o of i);}t.get=e})(m8||(m8={}));var hf;(function(t){function e(r,n,i,s,o){return{...af.create(r,n),...i?{fullRange:b.get(i),fullPosRange:bi.from(i,r)}:{},...s?{contributor:s}:{},...o||{}}}t.create=e})(hf||(hf={}));var zu;(function(t){function e(s){let o=(l,c,f,h,d)=>{l.category=h,l.identifier=d[d.length-1],l.path=d,l.parentMap=c,f&&(l.parentSymbol=f),l.members&&u(l.members,l,h,d)},u=(l,c,f,h)=>{for(let[d,p]of Object.entries(l))o(p,l,c,f,[...h,d])},a=(0,Pd.default)()(s);for(let[l,c]of Object.entries(a))u(c,void 0,l,[]);return a}t.link=e;function r(s){let o=l=>{delete l.category,delete l.identifier,delete l.parentMap,delete l.parentSymbol,delete l.path,l.members&&u(l.members)},u=l=>{for(let c of Object.values(l))o(c)},a=(0,Pd.default)({circles:!0})(s);for(let l of Object.values(a))u(l);return a}t.unlink=r;function n(s){return JSON.stringify(r(s))}t.serialize=n;function i(s){return e(JSON.parse(s))}t.deserialize=i})(zu||(zu={}));var bs=class{constructor(e,r,n,i){this._uri=e,this._languageId=r,this._version=n,this._content=i,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(e){if(e){let r=this.offsetAt(e.start),n=this.offsetAt(e.end);return this._content.substring(r,n)}return this._content}update(e,r){for(let n of e)if(bs.isIncremental(n)){let i=A8(n.range),s=this.offsetAt(i.start),o=this.offsetAt(i.end);this._content=this._content.substring(0,s)+n.text+this._content.substring(o,this._content.length);let u=Math.max(i.start.line,0),a=Math.max(i.end.line,0),l=this._lineOffsets,c=y8(n.text,!1,s);if(a-u===c.length)for(let h=0,d=c.length;he?i=o:n=o+1}let s=n-1;return{line:s,character:e-r[s]}}offsetAt(e){let r=this.getLineOffsets();if(e.line>=r.length)return this._content.length;if(e.line<0)return 0;let n=r[e.line],i=e.line+1{let h=c.range.start.line-f.range.start.line;return h===0?c.range.start.character-f.range.start.character:h}),a=0,l=[];for(let c of u){let f=i.offsetAt(c.range.start);if(fa&&l.push(o.substring(a,f)),c.newText.length&&l.push(c.newText),a=i.offsetAt(c.range.end)}return l.push(o.substr(a)),l.join("")}t.applyEdits=n})(pn||(pn={}));function Nd(t,e){if(t.length<=1)return t;let r=t.length/2|0,n=t.slice(0,r),i=t.slice(r);Nd(n,e),Nd(i,e);let s=0,o=0,u=0;for(;sr.line||e.line===r.line&&e.character>r.character?{start:r,end:e}:t}function Ek(t){let e=A8(t.range);return e!==t.range?{newText:t.newText,range:e}:t}var pf=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var u=t.length-1;u>=0;u--)(o=t[u])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s},Ei,Cs,ju,wi,Es,Er,It=class{constructor(e,r,n,i=!1){R(this,Ei,void 0);R(this,Cs,void 0);R(this,ju,void 0);R(this,wi,new Set);R(this,Es,Object.create(null));R(this,Er,void 0);q(this,"_delayedOps",[]);q(this,"_inDelayMode");N(this,Cs,new r),N(this,ju,r),N(this,Ei,e),N(this,Er,n),this._inDelayMode=i,this.on("symbolCreated",({symbol:s})=>{g(this,wi).add(Lt.toString(s))}).on("symbolRemoved",({symbol:s})=>{g(this,wi).delete(Lt.toString(s))}).on("symbolLocationCreated",({symbol:s,location:o})=>{let u=g(this,Es)[o.contributor??"undefined"]??=Object.create(null),a=u[o.uri]??=new Set,l=Lt.toString(s);a.add(l),g(this,wi).delete(l)}).on("symbolLocationRemoved",({symbol:s})=>{let o=Lt.toString(s);g(this,wi).add(o)})}get global(){return g(this,Ei)}on(e,r){return g(this,Cs).on(e,r),this}once(e,r){return g(this,Cs).once(e,r),this}emit(e,...r){return g(this,Cs).emit(e,...r)}buildCache(){It.forEachSymbol(this.global,e=>{this.emit("symbolCreated",{symbol:e}),It.forEachLocationOfSymbol(e,({type:r,location:n})=>{this.emit("symbolLocationCreated",{symbol:e,type:r,location:n})})})}clone(){return new It(g(this,Ei),g(this,ju),g(this,Er),!0)}applyDelayedEdits(){this._delayedOps.forEach(e=>e()),this._delayedOps=[],this._inDelayMode=!1}contributeAs(e,r){let n=g(this,Er);N(this,Er,e);try{r()}finally{N(this,Er,n)}return this}async contributeAsAsync(e,r){let n=g(this,Er);N(this,Er,e);try{await r()}finally{N(this,Er,n)}return this}clear({uri:e,contributor:r,predicate:n=()=>!0}){let i=()=>r?g(this,Es)[r]?[g(this,Es)[r]]:[]:Object.values(g(this,Es)),s=()=>{let l=i();return(e?l.map(f=>f[e]??new Set):l.map(f=>Object.values(f)).flat()).map(f=>[...f]).flat().map(Lt.fromString)},o=()=>e?[g(this,Ei)]:[g(this,Ei)],u=s(),a=o();for(let l of a){for(let c of u){let{symbol:f}=It.lookupTable(l,c.category,c.path);f&&this.removeLocationsFromSymbol(f,e?h=>h.location.uri===e&&n(h):n)}this.trim(l)}}lookup(e,r,n){for(;n;){if(n.locals){let i=It.lookupTable(n.locals,e,r);if(i.symbol)return i}n=n.parent}return It.lookupTable(this.global,e,r)}query(e,r,...n){let i=It.toUri(e),{parentSymbol:s,parentMap:o,symbol:u}=this.lookup(r,n,$d(e)?e.node:void 0),a=u?It.isVisible(u,i):!0;return new df({category:r,doc:e,contributor:g(this,Er),map:a?o:void 0,parentSymbol:s,path:n,symbol:a?u:void 0,util:this})}getVisibleSymbols(e,r){let n=this.lookup(e,[],void 0).parentMap??void 0;return It.filterVisibleSymbols(r,n)}static toUri(e){return typeof e=="string"?e:$d(e)?e.doc.uri:e.uri}trim(e){let r=n=>{n&&It.isTrimmable(n)&&(delete n.parentMap[n.identifier],this.emit("symbolRemoved",{symbol:n}),r(n.parentSymbol))};for(let n of g(this,wi)){let i=Lt.fromString(n),{symbol:s}=It.lookupTable(e,i.category,i.path);r(s)}}removeLocationsFromSymbol(e,r){for(let n of As)e[n]&&(e[n]=e[n].reduce((i,s)=>(r({location:s,symbol:e,type:n})?this.emit("symbolLocationRemoved",{symbol:e,type:n,location:s}):i.push(s),i),[]))}enterMap(e,r,n,i,s,o,u,a){let l=r[s];return l?this.amendSymbol(l,o,u,a):l=this.createSymbol(n,e,r,i,s,o,u,a),this.emit("symbolAmended",{symbol:l}),l}static lookupTable(e,r,n){let i=e[r],s,o;for(let u=0;u=0;o--){let u=e[o],a=this.lookupTable(u,r,n);if(a.symbol)return a;!s&&!i&&(a.parentSymbol||a.parentMap)&&(s=a.parentSymbol,i=a.parentMap)}return{parentSymbol:s,parentMap:i,symbol:void 0}}createSymbol(e,r,n,i,s,o,u,a){let l=n[s]={category:e,identifier:s,...r?{parentSymbol:r}:{},parentMap:n,path:i,...o.data};return this.emit("symbolCreated",{symbol:l}),this.amendSymbolUsage(l,o.usage,u,a),l}amendSymbol(e,r,n,i){this.amendSymbolMetadata(e,r.data),this.amendSymbolUsage(e,r.usage,n,i)}amendSymbolMetadata(e,r){if(r){if("data"in r&&(e.data=r.data),"desc"in r&&(e.desc=r.desc),r.relations&&Object.keys(r.relations).length){e.relations??={};for(let n of Object.keys(r.relations))e.relations[n]=r.relations[n]}if("subcategory"in r&&(e.subcategory=r.subcategory),"visibility"in r){let n=i=>i===void 0||i===2||i===3;if(e.visibility===r.visibility||n(e.visibility)&&n(r.visibility))e.visibility=r.visibility;else throw new Error(`Cannot change visibility from ${e.visibility} to ${r.visibility}: ${JSON.stringify(Lt.fromSymbol(e))}`)}r.visibilityRestriction?.length&&(e.visibilityRestriction=(e.visibilityRestriction??[]).concat(r.visibilityRestriction))}}amendSymbolUsage(e,r,n,i){if(r){let s=r.type??"reference",o=e[s]??=[],u=b.get((Id.is(r)?r.node:r.range)??0),a=hf.create(n,u,r.fullRange,i,{accessType:r.accessType,skipRenaming:r.skipRenaming});n.uri.startsWith("file:")||(delete a.range,delete a.posRange,delete a.fullRange,delete a.fullPosRange),o.push(a),this.emit("symbolLocationCreated",{symbol:e,type:s,location:a})}}resolveAlias(e){return e?.relations?.aliasOf?this.resolveAlias(this.lookup(e.relations.aliasOf.category,e.relations.aliasOf.path).symbol):e}static filterVisibleSymbols(e,r={}){let n={};for(let[i,s]of Object.entries(r))It.isVisible(s,e)&&(n[i]=s);return n}static isTrimmable(e){return!Object.keys(e.members??{}).length&&!e.declaration?.length&&!e.definition?.length&&!e.implementation?.length&&!e.reference?.length&&!e.typeDefinition?.length}static isVisible(e,r){switch(e.visibility){case 3:return!1;case 0:case 1:case 2:default:return!0}}static isDeclared(e){return!!(e?.declaration?.length||e?.definition?.length)}static isDefined(e){return!!(e?.definition?.length||e?.definition?.length&&e?.implementation?.length)}static isImplemented(e){return!!(e?.implementation?.length||e?.definition?.length)}static isReferenced(e){return!!e?.reference?.length}static isTypeDefined(e){return!!e?.typeDefinition?.length}static getDeclaredLocation(e){return e.declaration?.[0]??e.definition?.[0]??(()=>{throw new Error(`Cannot get declared location of ${JSON.stringify(Lt.fromSymbol(e))}`)})()}static forEachSymbolInMap(e,r){for(let n of Object.values(e))r(n),n.members&&this.forEachSymbolInMap(n.members,r)}static forEachSymbol(e,r){for(let n of Object.values(e))this.forEachSymbolInMap(n,r)}static forEachLocationOfSymbol(e,r){for(let n of As)e[n]?.forEach(i=>r({type:n,location:i}))}static isVisibilityInGlobal(e){return e===void 0||e===2||e===3}static areVisibilitiesCompatible(e,r){return this.isVisibilityInGlobal(e)&&this.isVisibilityInGlobal(r)||e===0&&r===0||e===1&&r===1}},He=It;Ei=new WeakMap,Cs=new WeakMap,ju=new WeakMap,wi=new WeakMap,Es=new WeakMap,Er=new WeakMap;pf([mf()],He.prototype,"clear",null);pf([mf()],He.prototype,"trim",null);pf([mf()],He.prototype,"removeLocationsFromSymbol",null);var Ld;(function(t){function e(r){return!!r?.range}t.is=e})(Ld||(Ld={}));var Id;(function(t){function e(r){return!!r?.node}t.is=e})(Id||(Id={}));var mn,Fi,ws,Xo,Uu,gn,zn,qe,zd=class{constructor({category:e,contributor:r,doc:n,map:i,parentSymbol:s,path:o,symbol:u,util:a}){q(this,"category");q(this,"path");R(this,mn,void 0);R(this,Fi,void 0);R(this,ws,void 0);R(this,Xo,void 0);R(this,Uu,!1);R(this,gn,void 0);R(this,zn,void 0);R(this,qe,void 0);q(this,"util");this.category=e,this.path=o,typeof n=="string"?(n=pn.create(n,"",0,""),N(this,ws,!0)):$d(n)&&(N(this,Fi,n.node),n=n.doc),N(this,mn,n),N(this,Xo,r),N(this,gn,i),N(this,zn,s),N(this,qe,u),this.util=a}get symbol(){return g(this,qe)}get visibleMembers(){return He.filterVisibleSymbols(g(this,mn).uri,this.path.length===0?g(this,gn):g(this,qe)?.members)}heyGimmeDaSymbol(){return g(this,qe)}getData(e){let r=g(this,qe)?.data;return e(r)?r:void 0}with(e){return e(this),this}if(e,r){return e.call(this,g(this,qe),this)&&(r.call(this,g(this,qe),this),N(this,Uu,!0)),this}ifUnknown(e){return this.if(r=>r===void 0,e)}ifKnown(e){return this.if(r=>r!==void 0,e)}ifDeclared(e){return this.if(r=>He.isDeclared(r),e)}ifDefined(e){return this.if(He.isDefined,e)}ifImplemented(e){return this.if(He.isImplemented,e)}ifReferenced(e){return this.if(He.isReferenced,e)}ifTypeDefined(e){return this.if(He.isTypeDefined,e)}else(e){return g(this,Uu)||e.call(this,g(this,qe),this),this}elseEnter(e){return this.else(()=>this.enter(e))}elseResolveAlias(){return this.else(()=>this.resolveAlias())}_enter(e){let r=i=>i.data?.visibility??this.symbol?.visibility??2,n=i=>{let s=r(i);if(g(this,gn)&&He.areVisibilitiesCompatible(s,g(this,qe)?.visibility))return g(this,gn);if(this.path.length>1){if(g(this,zn)){if(!He.areVisibilitiesCompatible(s,g(this,zn).visibility))throw new Error(`Cannot enter member \u201C${this.getPath()}\u201D of ${Ci.stringifyVisibility(s)} visibility to parent of ${Ci.stringifyVisibility(g(this,zn).visibility)} visibility`);return g(this,zn).members??={}}}else{let o;if(He.isVisibilityInGlobal(s))o=this.util.global;else if(s===1){if(!g(this,Fi))throw new Error(`Cannot enter \u201C${this.getPath()}\u201D with ${Ci.stringifyVisibility(s)} visibility as no node is supplied`);let u=g(this,Fi);for(;u;){if(u.type==="file"){o=u.locals;break}u=u.parent}if(!o)throw new Error(`Cannot enter \u201C${this.getPath()}\u201D with ${Ci.stringifyVisibility(s)} visibility as no file node is supplied`)}else{if(!g(this,Fi))throw new Error(`Cannot enter \u201C${this.getPath()}\u201D with ${Ci.stringifyVisibility(s)} visibility as no node is supplied`);let u=g(this,Fi);for(;u;){if(u.locals){o=u.locals;break}u=u.parent}if(!o)throw new Error(`Cannot enter \u201C${this.getPath()}\u201D with ${Ci.stringifyVisibility(s)} visibility as no node with locals is supplied`)}return o[this.category]??={}}throw new Error(`Cannot create the symbol map for \u201C${this.getPath()}\u201D`)};g(this,ws)&&Ld.is(e.usage)&&(e.usage.range=b.create(0,0)),N(this,gn,n(e)),N(this,qe,this.util.enterMap(g(this,zn),g(this,gn),this.category,this.path,this.path[this.path.length-1],e,g(this,mn),g(this,Xo))),e.usage?.node&&(e.usage.node.symbol=g(this,qe))}enter(e){return this._enter(e),this}amend(e){return this.ifKnown(()=>this.enter(e))}resolveAlias(){if(g(this,qe)){let e=this.util.resolveAlias(g(this,qe));if(!e)throw new Error("The current symbol points to an non-existent symbol.");N(this,qe,e),N(this,gn,e.parentMap)}return this}member(){let e,r,n;if(arguments.length===2?(e=g(this,ws)?g(this,mn).uri:g(this,mn),r=arguments[0],n=arguments[1]):(e=arguments[0],r=arguments[1],n=arguments[2]),g(this,qe)===void 0)throw new Error(`Tried to query member symbol \u201C${r}\u201D from an undefined symbol (path \u201C${this.path.join(".")}\u201D)`);let i=typeof e=="string"&&e===g(this,mn).uri&&!g(this,ws)?g(this,mn):e,s=g(this,qe).members,o=s?.[r],u=new zd({category:this.category,doc:i,contributor:g(this,Xo),map:s,parentSymbol:g(this,qe),path:[...this.path,r],symbol:o,util:this.util});return n(u),this}onEach(e,r){for(let n of e)r.call(this,n,this);return this}forEachMember(e){return this.onEach(Object.keys(this.visibleMembers),r=>this.member(r,n=>e(r,n)))}getPath(){return`${this.category}.${this.path.join("/")}`}},df=zd;mn=new WeakMap,Fi=new WeakMap,ws=new WeakMap,Xo=new WeakMap,Uu=new WeakMap,gn=new WeakMap,zn=new WeakMap,qe=new WeakMap;pf([mf(t=>t.util)],df.prototype,"_enter",null);var Ci;(function(t){let e="+ ";function r(l,c){if(l!==c)throw new Error(`Assertion error: ${l} !== ${c}`)}function n(l){return l.map(c=>i(c)).join(` ------------ `)}t.stringifySymbolStack=n;function i(l,c=""){let f=[];for(let h of Object.keys(l)){let d=l[h];f.push([h,s(d,`${c}${e}`)])}return f.map(h=>`CATEGORY ${h[0]} ${h[1]}`).join(` @@ -41,8 +41,8 @@ ${s.desc}`:"");return Ju.create(i.range,o)}if(i.hover)return Ju.create(i.range,i `))):(d(),l=h);let y;n.skipWhitespace(),n.peek(e.sep.length)===e.sep?y=b.create(n,()=>n.skip(e.sep.length)):i.err.report(C("expected",L(e.sep)),n),n.skipWhitespace();let m=typeof e.value=="function"?e.value:e.value.get(s,l),A=n.cursor,{result:w,updateSrcAndCtx:k,endCursor:E}=tr(m,n,i);w===W||E-A===0&&![e.sep,e.end,r,"\r",` `," "," "].includes(n.peek())?i.err.report(C("expected",C("parser.record.value")),b.create(n,()=>n.skipUntilOrEnd(e.sep,e.end,r,"\r",` `))):(k(),c=w);let v;n.skipWhitespace(),o=!0,(u=n.peek(e.end.length)===e.end)&&(v=b.create(n,()=>n.skip(e.end.length))),s.children.push({type:"pair",range:b.create(a,n),...l||c?{children:[l,c].filter(T=>!!T)}:{},key:l,sep:y,value:c,end:v}),n.skipWhitespace()}u&&!e.trailingEnd&&i.err.report(C("parser.record.trailing-end"),s.children[s.children.length-1].end),n.trySkip(r)||i.err.report(C("expected",L(r)),n)}else i.err.report(C("expected",L(t)),n);return s.range.end=n.cursor,s}}var Kk=new Set([" ","\r",` -`,"=",",",'"',"'","{","}","[","]","(",")",";"]),e5=new Set(["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","0","1","2","3","4","5","6","7","8","9","_","-","."]);function et(t){return(e,r)=>{let n={type:"resource_location",range:b.create(e),options:t};e.trySkip(ee.TagPrefix)&&(n.isTag=!0);let i=e.cursor;for(;e.canReadInLine()&&!Kk.has(e.peek());)e.skip();let s=e.sliceToCursor(i);if(n.range.end=e.cursor,s.length===0)r.err.report(C("expected",C("resource-location")),n);else{let o=s.indexOf(t.namespacePathSep??ee.NamespacePathSep);o>=0&&(n.namespace=s.slice(0,o));let u=s.slice(o+1);n.path=u.split(ee.PathSep);let a=[...new Set([...[...n.namespace??[]].filter(l=>!e5.has(l)),...[...u].filter(l=>l!=="/"&&!e5.has(l))])];a.length&&r.err.report(C("parser.resource-location.illegal",gs(a,!0,"and")),n),n.isTag&&!t.allowTag&&r.err.report(C("parser.resource-location.tag-diallowed"),n),!n.namespace&&t.isPredicate&&r.err.report(C("parser.resource-location.namespace-expected"),n)}return n}}function Ft(t){return(e,r)=>{let n={type:"string",range:b.create(e),options:t,value:"",valueMap:[]},i=e.cursor;if(t.quotes?.length&&(e.peek()==='"'||e.peek()==="'")){let s=e.read(),o=e.cursor;for(;e.canRead()&&e.peek()!==s;){let u=e.peek();if(t.escapable&&u==="\\"){let a=e.cursor;e.skip();let l=e.read();if(l==="\\"||l===s||ff.is(t.escapable.characters,l))n.valueMap.push({inner:b.create(n.value.length,n.value.length+1),outer:b.create(a,e)}),n.value+=c8.get(l);else if(t.escapable.unicode&&l==="u"){let c=e.peek(4);/^[0-9a-f]{4}$/i.test(c)?(e.skip(4),n.valueMap.push({inner:b.create(n.value.length,n.value.length+1),outer:b.create(a,e)}),n.value+=String.fromCharCode(parseInt(c,16))):(r.err.report(C("parser.string.illegal-unicode-escape"),b.create(e,e.getCharRange(3).end)),n.valueMap.push({inner:b.create(n.value.length,n.value.length+1),outer:b.create(a,e)}),n.value+=l)}else t.escapable.allowUnknown||r.err.report(C("parser.string.illegal-escape",L(l)),e.getCharRange(-1)),n.valueMap.push({inner:b.create(n.value.length,n.value.length+1),outer:b.create(a,e)}),n.value+=l}else e.skip(),n.value+=u}e.trySkip(s)||r.err.report(C("expected",L(s)),e),t.quotes.includes(s)||r.err.report(C("parser.string.illegal-quote",t.quotes),n),i=o}else if(t.unquotable){for(;e.canRead()&&Gd(e.peek(),t.unquotable);)n.value+=e.read();!n.value&&!t.unquotable.allowEmpty&&r.err.report(C("expected",C("string")),e)}else r.err.report(C("expected",t.quotes),e);if(n.valueMap.unshift({inner:b.create(0),outer:b.create(i)}),t.value?.parser){let s=np(t.value.parser,n.value,n.valueMap,r);s!==W&&(n.children=[s])}return n.range.end=e.cursor,n}}function np(t,e,r,n){let i=new ke(e,r),s={...n,doc:pn.create(n.doc.uri,n.doc.languageId,n.doc.version,e)};return t(i,s)}var Gk=Object.freeze(["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","_",".","+","-"]),Zk=new Set(Gk),t5=/^[0-9A-Za-z_\.\+\-]*$/,ma={allowEmpty:!0,allowList:Zk},Pi={escapable:{},quotes:['"',"'"],unquotable:ma},Ns=Ft(Pi);function Gd(t,e){return e.allowList?.has(t)??!e.blockList?.has(t)}function r5(t){let e=Jk(t);return(r,n)=>{let i={type:"symbol",range:b.create(r),options:e,value:r.readRemaining()};return i.range.end=r.cursor,i}}function Jk(t){return typeof t=="string"?{category:t}:t}var e0=ei(i5(),1);function D1(t){let e=t.length;for(;--e>=0;)t[e]=0}var Yk=0,V5=1,Xk=2,Qk=3,eB=258,wp=29,_a=256,wa=_a+1+wp,x1=30,Fp=19,q5=2*wa+1,Ls=15,ip=16,tB=7,xp=256,H5=16,W5=17,K5=18,Ap=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),Uf=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),rB=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),G5=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),nB=512,Zn=new Array((wa+2)*2);D1(Zn);var ba=new Array(x1*2);D1(ba);var Fa=new Array(nB);D1(Fa);var xa=new Array(eB-Qk+1);D1(xa);var Dp=new Array(wp);D1(Dp);var Wf=new Array(x1);D1(Wf);function sp(t,e,r,n,i){this.static_tree=t,this.extra_bits=e,this.extra_base=r,this.elems=n,this.max_length=i,this.has_stree=t&&t.length}var Z5,J5,Y5;function op(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}var X5=t=>t<256?Fa[t]:Fa[256+(t>>>7)],Da=(t,e)=>{t.pending_buf[t.pending++]=e&255,t.pending_buf[t.pending++]=e>>>8&255},jt=(t,e,r)=>{t.bi_valid>ip-r?(t.bi_buf|=e<>ip-t.bi_valid,t.bi_valid+=r-ip):(t.bi_buf|=e<{jt(t,r[e*2],r[e*2+1])},Q5=(t,e)=>{let r=0;do r|=t&1,t>>>=1,r<<=1;while(--e>0);return r>>>1},iB=t=>{t.bi_valid===16?(Da(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=t.bi_buf&255,t.bi_buf>>=8,t.bi_valid-=8)},sB=(t,e)=>{let r=e.dyn_tree,n=e.max_code,i=e.stat_desc.static_tree,s=e.stat_desc.has_stree,o=e.stat_desc.extra_bits,u=e.stat_desc.extra_base,a=e.stat_desc.max_length,l,c,f,h,d,p,y=0;for(h=0;h<=Ls;h++)t.bl_count[h]=0;for(r[t.heap[t.heap_max]*2+1]=0,l=t.heap_max+1;la&&(h=a,y++),r[c*2+1]=h,!(c>n)&&(t.bl_count[h]++,d=0,c>=u&&(d=o[c-u]),p=r[c*2],t.opt_len+=p*(h+d),s&&(t.static_len+=p*(i[c*2+1]+d)));if(y!==0){do{for(h=a-1;t.bl_count[h]===0;)h--;t.bl_count[h]--,t.bl_count[h+1]+=2,t.bl_count[a]--,y-=2}while(y>0);for(h=a;h!==0;h--)for(c=t.bl_count[h];c!==0;)f=t.heap[--l],!(f>n)&&(r[f*2+1]!==h&&(t.opt_len+=(h-r[f*2+1])*r[f*2],r[f*2+1]=h),c--)}},ey=(t,e,r)=>{let n=new Array(Ls+1),i=0,s,o;for(s=1;s<=Ls;s++)n[s]=i=i+r[s-1]<<1;for(o=0;o<=e;o++){let u=t[o*2+1];u!==0&&(t[o*2]=Q5(n[u]++,u))}},oB=()=>{let t,e,r,n,i,s=new Array(Ls+1);for(r=0,n=0;n>=7;n{let e;for(e=0;e{t.bi_valid>8?Da(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0},uB=(t,e,r,n)=>{ry(t),n&&(Da(t,r),Da(t,~r)),t.pending_buf.set(t.window.subarray(e,e+r),t.pending),t.pending+=r},s5=(t,e,r,n)=>{let i=e*2,s=r*2;return t[i]{let n=t.heap[r],i=r<<1;for(;i<=t.heap_len&&(i{let n,i,s=0,o,u;if(t.last_lit!==0)do n=t.pending_buf[t.d_buf+s*2]<<8|t.pending_buf[t.d_buf+s*2+1],i=t.pending_buf[t.l_buf+s],s++,n===0?Fn(t,i,e):(o=xa[i],Fn(t,o+_a+1,e),u=Ap[o],u!==0&&(i-=Dp[o],jt(t,i,u)),n--,o=X5(n),Fn(t,o,r),u=Uf[o],u!==0&&(n-=Wf[o],jt(t,n,u)));while(s{let r=e.dyn_tree,n=e.stat_desc.static_tree,i=e.stat_desc.has_stree,s=e.stat_desc.elems,o,u,a=-1,l;for(t.heap_len=0,t.heap_max=q5,o=0;o>1;o>=1;o--)up(t,r,o);l=s;do o=t.heap[1],t.heap[1]=t.heap[t.heap_len--],up(t,r,1),u=t.heap[1],t.heap[--t.heap_max]=o,t.heap[--t.heap_max]=u,r[l*2]=r[o*2]+r[u*2],t.depth[l]=(t.depth[o]>=t.depth[u]?t.depth[o]:t.depth[u])+1,r[o*2+1]=r[u*2+1]=l,t.heap[1]=l++,up(t,r,1);while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],sB(t,e),ey(r,a,t.bl_count)},u5=(t,e,r)=>{let n,i=-1,s,o=e[0*2+1],u=0,a=7,l=4;for(o===0&&(a=138,l=3),e[(r+1)*2+1]=65535,n=0;n<=r;n++)s=o,o=e[(n+1)*2+1],!(++u{let n,i=-1,s,o=e[0*2+1],u=0,a=7,l=4;for(o===0&&(a=138,l=3),n=0;n<=r;n++)if(s=o,o=e[(n+1)*2+1],!(++u{let e;for(u5(t,t.dyn_ltree,t.l_desc.max_code),u5(t,t.dyn_dtree,t.d_desc.max_code),bp(t,t.bl_desc),e=Fp-1;e>=3&&t.bl_tree[G5[e]*2+1]===0;e--);return t.opt_len+=3*(e+1)+5+5+4,e},lB=(t,e,r,n)=>{let i;for(jt(t,e-257,5),jt(t,r-1,5),jt(t,n-4,4),i=0;i{let e=4093624447,r;for(r=0;r<=31;r++,e>>>=1)if(e&1&&t.dyn_ltree[r*2]!==0)return 0;if(t.dyn_ltree[9*2]!==0||t.dyn_ltree[10*2]!==0||t.dyn_ltree[13*2]!==0)return 1;for(r=32;r<_a;r++)if(t.dyn_ltree[r*2]!==0)return 1;return 0},l5=!1,fB=t=>{l5||(oB(),l5=!0),t.l_desc=new op(t.dyn_ltree,Z5),t.d_desc=new op(t.dyn_dtree,J5),t.bl_desc=new op(t.bl_tree,Y5),t.bi_buf=0,t.bi_valid=0,ty(t)},ny=(t,e,r,n)=>{jt(t,(Yk<<1)+(n?1:0),3),uB(t,e,r,!0)},hB=t=>{jt(t,V5<<1,3),Fn(t,xp,Zn),iB(t)},dB=(t,e,r,n)=>{let i,s,o=0;t.level>0?(t.strm.data_type===2&&(t.strm.data_type=cB(t)),bp(t,t.l_desc),bp(t,t.d_desc),o=aB(t),i=t.opt_len+3+7>>>3,s=t.static_len+3+7>>>3,s<=i&&(i=s)):i=s=r+5,r+4<=i&&e!==-1?ny(t,e,r,n):t.strategy===4||s===i?(jt(t,(V5<<1)+(n?1:0),3),o5(t,Zn,ba)):(jt(t,(Xk<<1)+(n?1:0),3),lB(t,t.l_desc.max_code+1,t.d_desc.max_code+1,o+1),o5(t,t.dyn_ltree,t.dyn_dtree)),ty(t),n&&ry(t)},pB=(t,e,r)=>(t.pending_buf[t.d_buf+t.last_lit*2]=e>>>8&255,t.pending_buf[t.d_buf+t.last_lit*2+1]=e&255,t.pending_buf[t.l_buf+t.last_lit]=r&255,t.last_lit++,e===0?t.dyn_ltree[r*2]++:(t.matches++,e--,t.dyn_ltree[(xa[r]+_a+1)*2]++,t.dyn_dtree[X5(e)*2]++),t.last_lit===t.lit_bufsize-1),mB=fB,gB=ny,yB=dB,AB=pB,bB=hB,CB={_tr_init:mB,_tr_stored_block:gB,_tr_flush_block:yB,_tr_tally:AB,_tr_align:bB},EB=(t,e,r,n)=>{let i=t&65535|0,s=t>>>16&65535|0,o=0;for(;r!==0;){o=r>2e3?2e3:r,r-=o;do i=i+e[n++]|0,s=s+i|0;while(--o);i%=65521,s%=65521}return i|s<<16|0},va=EB,wB=()=>{let t,e=[];for(var r=0;r<256;r++){t=r;for(var n=0;n<8;n++)t=t&1?3988292384^t>>>1:t>>>1;e[r]=t}return e},FB=new Uint32Array(wB()),xB=(t,e,r,n)=>{let i=FB,s=n+r;t^=-1;for(let o=n;o>>8^i[(t^e[o])&255];return t^-1},st=xB,$s={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},Vs={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8},{_tr_init:DB,_tr_stored_block:vB,_tr_flush_block:kB,_tr_tally:Ii,_tr_align:BB}=CB,{Z_NO_FLUSH:qs,Z_PARTIAL_FLUSH:SB,Z_FULL_FLUSH:_B,Z_FINISH:$i,Z_BLOCK:c5,Z_OK:xn,Z_STREAM_END:f5,Z_STREAM_ERROR:xr,Z_DATA_ERROR:TB,Z_BUF_ERROR:ap,Z_DEFAULT_COMPRESSION:RB,Z_FILTERED:PB,Z_HUFFMAN_ONLY:Lf,Z_RLE:MB,Z_FIXED:OB,Z_DEFAULT_STRATEGY:NB,Z_UNKNOWN:LB,Z_DEFLATED:Zf}=Vs,IB=9,$B=15,zB=8,jB=29,UB=256,Cp=UB+1+jB,VB=30,qB=19,HB=2*Cp+1,WB=15,re=3,Ni=258,Hr=Ni+re+1,KB=32,Jf=42,Ep=69,Vf=73,qf=91,Hf=103,Is=113,ya=666,tt=1,Ta=2,zs=3,v1=4,GB=3,Li=(t,e)=>(t.msg=$s[e],e),h5=t=>(t<<1)-(t>4?9:0),Oi=t=>{let e=t.length;for(;--e>=0;)t[e]=0},ZB=(t,e,r)=>(e<{let e=t.state,r=e.pending;r>t.avail_out&&(r=t.avail_out),r!==0&&(t.output.set(e.pending_buf.subarray(e.pending_out,e.pending_out+r),t.next_out),t.next_out+=r,e.pending_out+=r,t.total_out+=r,t.avail_out-=r,e.pending-=r,e.pending===0&&(e.pending_out=0))},dt=(t,e)=>{kB(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,Mi(t.strm)},ce=(t,e)=>{t.pending_buf[t.pending++]=e},ga=(t,e)=>{t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=e&255},JB=(t,e,r,n)=>{let i=t.avail_in;return i>n&&(i=n),i===0?0:(t.avail_in-=i,e.set(t.input.subarray(t.next_in,t.next_in+i),r),t.state.wrap===1?t.adler=va(t.adler,e,i,r):t.state.wrap===2&&(t.adler=st(t.adler,e,i,r)),t.next_in+=i,t.total_in+=i,i)},iy=(t,e)=>{let r=t.max_chain_length,n=t.strstart,i,s,o=t.prev_length,u=t.nice_match,a=t.strstart>t.w_size-Hr?t.strstart-(t.w_size-Hr):0,l=t.window,c=t.w_mask,f=t.prev,h=t.strstart+Ni,d=l[n+o-1],p=l[n+o];t.prev_length>=t.good_match&&(r>>=2),u>t.lookahead&&(u=t.lookahead);do if(i=e,!(l[i+o]!==p||l[i+o-1]!==d||l[i]!==l[n]||l[++i]!==l[n+1])){n+=2,i++;do;while(l[++n]===l[++i]&&l[++n]===l[++i]&&l[++n]===l[++i]&&l[++n]===l[++i]&&l[++n]===l[++i]&&l[++n]===l[++i]&&l[++n]===l[++i]&&l[++n]===l[++i]&&no){if(t.match_start=e,o=s,s>=u)break;d=l[n+o-1],p=l[n+o]}}while((e=f[e&c])>a&&--r!==0);return o<=t.lookahead?o:t.lookahead},js=t=>{let e=t.w_size,r,n,i,s,o;do{if(s=t.window_size-t.lookahead-t.strstart,t.strstart>=e+(e-Hr)){t.window.set(t.window.subarray(e,e+e),0),t.match_start-=e,t.strstart-=e,t.block_start-=e,n=t.hash_size,r=n;do i=t.head[--r],t.head[r]=i>=e?i-e:0;while(--n);n=e,r=n;do i=t.prev[--r],t.prev[r]=i>=e?i-e:0;while(--n);s+=e}if(t.strm.avail_in===0)break;if(n=JB(t.strm,t.window,t.strstart+t.lookahead,s),t.lookahead+=n,t.lookahead+t.insert>=re)for(o=t.strstart-t.insert,t.ins_h=t.window[o],t.ins_h=zi(t,t.ins_h,t.window[o+1]);t.insert&&(t.ins_h=zi(t,t.ins_h,t.window[o+re-1]),t.prev[o&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=o,o++,t.insert--,!(t.lookahead+t.insert{let r=65535;for(r>t.pending_buf_size-5&&(r=t.pending_buf_size-5);;){if(t.lookahead<=1){if(js(t),t.lookahead===0&&e===qs)return tt;if(t.lookahead===0)break}t.strstart+=t.lookahead,t.lookahead=0;let n=t.block_start+r;if((t.strstart===0||t.strstart>=n)&&(t.lookahead=t.strstart-n,t.strstart=n,dt(t,!1),t.strm.avail_out===0)||t.strstart-t.block_start>=t.w_size-Hr&&(dt(t,!1),t.strm.avail_out===0))return tt}return t.insert=0,e===$i?(dt(t,!0),t.strm.avail_out===0?zs:v1):(t.strstart>t.block_start&&(dt(t,!1),t.strm.avail_out===0),tt)},lp=(t,e)=>{let r,n;for(;;){if(t.lookahead=re&&(t.ins_h=zi(t,t.ins_h,t.window[t.strstart+re-1]),r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),r!==0&&t.strstart-r<=t.w_size-Hr&&(t.match_length=iy(t,r)),t.match_length>=re)if(n=Ii(t,t.strstart-t.match_start,t.match_length-re),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=re){t.match_length--;do t.strstart++,t.ins_h=zi(t,t.ins_h,t.window[t.strstart+re-1]),r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart;while(--t.match_length!==0);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=zi(t,t.ins_h,t.window[t.strstart+1]);else n=Ii(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(n&&(dt(t,!1),t.strm.avail_out===0))return tt}return t.insert=t.strstart{let r,n,i;for(;;){if(t.lookahead=re&&(t.ins_h=zi(t,t.ins_h,t.window[t.strstart+re-1]),r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=re-1,r!==0&&t.prev_length4096)&&(t.match_length=re-1)),t.prev_length>=re&&t.match_length<=t.prev_length){i=t.strstart+t.lookahead-re,n=Ii(t,t.strstart-1-t.prev_match,t.prev_length-re),t.lookahead-=t.prev_length-1,t.prev_length-=2;do++t.strstart<=i&&(t.ins_h=zi(t,t.ins_h,t.window[t.strstart+re-1]),r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart);while(--t.prev_length!==0);if(t.match_available=0,t.match_length=re-1,t.strstart++,n&&(dt(t,!1),t.strm.avail_out===0))return tt}else if(t.match_available){if(n=Ii(t,0,t.window[t.strstart-1]),n&&dt(t,!1),t.strstart++,t.lookahead--,t.strm.avail_out===0)return tt}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(n=Ii(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart{let r,n,i,s,o=t.window;for(;;){if(t.lookahead<=Ni){if(js(t),t.lookahead<=Ni&&e===qs)return tt;if(t.lookahead===0)break}if(t.match_length=0,t.lookahead>=re&&t.strstart>0&&(i=t.strstart-1,n=o[i],n===o[++i]&&n===o[++i]&&n===o[++i])){s=t.strstart+Ni;do;while(n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&it.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=re?(r=Ii(t,1,t.match_length-re),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(r=Ii(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),r&&(dt(t,!1),t.strm.avail_out===0))return tt}return t.insert=0,e===$i?(dt(t,!0),t.strm.avail_out===0?zs:v1):t.last_lit&&(dt(t,!1),t.strm.avail_out===0)?tt:Ta},QB=(t,e)=>{let r;for(;;){if(t.lookahead===0&&(js(t),t.lookahead===0)){if(e===qs)return tt;break}if(t.match_length=0,r=Ii(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,r&&(dt(t,!1),t.strm.avail_out===0))return tt}return t.insert=0,e===$i?(dt(t,!0),t.strm.avail_out===0?zs:v1):t.last_lit&&(dt(t,!1),t.strm.avail_out===0)?tt:Ta};function wn(t,e,r,n,i){this.good_length=t,this.max_lazy=e,this.nice_length=r,this.max_chain=n,this.func=i}var Aa=[new wn(0,0,0,0,YB),new wn(4,4,8,4,lp),new wn(4,5,16,8,lp),new wn(4,6,32,32,lp),new wn(4,4,16,16,w1),new wn(8,16,32,32,w1),new wn(8,16,128,128,w1),new wn(8,32,128,256,w1),new wn(32,128,258,1024,w1),new wn(32,258,258,4096,w1)],eS=t=>{t.window_size=2*t.w_size,Oi(t.head),t.max_lazy_match=Aa[t.level].max_lazy,t.good_match=Aa[t.level].good_length,t.nice_match=Aa[t.level].nice_length,t.max_chain_length=Aa[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=re-1,t.match_available=0,t.ins_h=0};function tS(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=Zf,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(HB*2),this.dyn_dtree=new Uint16Array((2*VB+1)*2),this.bl_tree=new Uint16Array((2*qB+1)*2),Oi(this.dyn_ltree),Oi(this.dyn_dtree),Oi(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(WB+1),this.heap=new Uint16Array(2*Cp+1),Oi(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(2*Cp+1),Oi(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}var sy=t=>{if(!t||!t.state)return Li(t,xr);t.total_in=t.total_out=0,t.data_type=LB;let e=t.state;return e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?Jf:Is,t.adler=e.wrap===2?0:1,e.last_flush=qs,DB(e),xn},oy=t=>{let e=sy(t);return e===xn&&eS(t.state),e},rS=(t,e)=>!t||!t.state||t.state.wrap!==2?xr:(t.state.gzhead=e,xn),uy=(t,e,r,n,i,s)=>{if(!t)return xr;let o=1;if(e===RB&&(e=6),n<0?(o=0,n=-n):n>15&&(o=2,n-=16),i<1||i>IB||r!==Zf||n<8||n>15||e<0||e>9||s<0||s>OB)return Li(t,xr);n===8&&(n=9);let u=new tS;return t.state=u,u.strm=t,u.wrap=o,u.gzhead=null,u.w_bits=n,u.w_size=1<uy(t,e,Zf,$B,zB,NB),iS=(t,e)=>{let r,n;if(!t||!t.state||e>c5||e<0)return t?Li(t,xr):xr;let i=t.state;if(!t.output||!t.input&&t.avail_in!==0||i.status===ya&&e!==$i)return Li(t,t.avail_out===0?ap:xr);i.strm=t;let s=i.last_flush;if(i.last_flush=e,i.status===Jf)if(i.wrap===2)t.adler=0,ce(i,31),ce(i,139),ce(i,8),i.gzhead?(ce(i,(i.gzhead.text?1:0)+(i.gzhead.hcrc?2:0)+(i.gzhead.extra?4:0)+(i.gzhead.name?8:0)+(i.gzhead.comment?16:0)),ce(i,i.gzhead.time&255),ce(i,i.gzhead.time>>8&255),ce(i,i.gzhead.time>>16&255),ce(i,i.gzhead.time>>24&255),ce(i,i.level===9?2:i.strategy>=Lf||i.level<2?4:0),ce(i,i.gzhead.os&255),i.gzhead.extra&&i.gzhead.extra.length&&(ce(i,i.gzhead.extra.length&255),ce(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(t.adler=st(t.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=Ep):(ce(i,0),ce(i,0),ce(i,0),ce(i,0),ce(i,0),ce(i,i.level===9?2:i.strategy>=Lf||i.level<2?4:0),ce(i,GB),i.status=Is);else{let o=Zf+(i.w_bits-8<<4)<<8,u=-1;i.strategy>=Lf||i.level<2?u=0:i.level<6?u=1:i.level===6?u=2:u=3,o|=u<<6,i.strstart!==0&&(o|=KB),o+=31-o%31,i.status=Is,ga(i,o),i.strstart!==0&&(ga(i,t.adler>>>16),ga(i,t.adler&65535)),t.adler=1}if(i.status===Ep)if(i.gzhead.extra){for(r=i.pending;i.gzindex<(i.gzhead.extra.length&65535)&&!(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>r&&(t.adler=st(t.adler,i.pending_buf,i.pending-r,r)),Mi(t),r=i.pending,i.pending===i.pending_buf_size));)ce(i,i.gzhead.extra[i.gzindex]&255),i.gzindex++;i.gzhead.hcrc&&i.pending>r&&(t.adler=st(t.adler,i.pending_buf,i.pending-r,r)),i.gzindex===i.gzhead.extra.length&&(i.gzindex=0,i.status=Vf)}else i.status=Vf;if(i.status===Vf)if(i.gzhead.name){r=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>r&&(t.adler=st(t.adler,i.pending_buf,i.pending-r,r)),Mi(t),r=i.pending,i.pending===i.pending_buf_size)){n=1;break}i.gzindexr&&(t.adler=st(t.adler,i.pending_buf,i.pending-r,r)),n===0&&(i.gzindex=0,i.status=qf)}else i.status=qf;if(i.status===qf)if(i.gzhead.comment){r=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>r&&(t.adler=st(t.adler,i.pending_buf,i.pending-r,r)),Mi(t),r=i.pending,i.pending===i.pending_buf_size)){n=1;break}i.gzindexr&&(t.adler=st(t.adler,i.pending_buf,i.pending-r,r)),n===0&&(i.status=Hf)}else i.status=Hf;if(i.status===Hf&&(i.gzhead.hcrc?(i.pending+2>i.pending_buf_size&&Mi(t),i.pending+2<=i.pending_buf_size&&(ce(i,t.adler&255),ce(i,t.adler>>8&255),t.adler=0,i.status=Is)):i.status=Is),i.pending!==0){if(Mi(t),t.avail_out===0)return i.last_flush=-1,xn}else if(t.avail_in===0&&h5(e)<=h5(s)&&e!==$i)return Li(t,ap);if(i.status===ya&&t.avail_in!==0)return Li(t,ap);if(t.avail_in!==0||i.lookahead!==0||e!==qs&&i.status!==ya){let o=i.strategy===Lf?QB(i,e):i.strategy===MB?XB(i,e):Aa[i.level].func(i,e);if((o===zs||o===v1)&&(i.status=ya),o===tt||o===zs)return t.avail_out===0&&(i.last_flush=-1),xn;if(o===Ta&&(e===SB?BB(i):e!==c5&&(vB(i,0,0,!1),e===_B&&(Oi(i.head),i.lookahead===0&&(i.strstart=0,i.block_start=0,i.insert=0))),Mi(t),t.avail_out===0))return i.last_flush=-1,xn}return e!==$i?xn:i.wrap<=0?f5:(i.wrap===2?(ce(i,t.adler&255),ce(i,t.adler>>8&255),ce(i,t.adler>>16&255),ce(i,t.adler>>24&255),ce(i,t.total_in&255),ce(i,t.total_in>>8&255),ce(i,t.total_in>>16&255),ce(i,t.total_in>>24&255)):(ga(i,t.adler>>>16),ga(i,t.adler&65535)),Mi(t),i.wrap>0&&(i.wrap=-i.wrap),i.pending!==0?xn:f5)},sS=t=>{if(!t||!t.state)return xr;let e=t.state.status;return e!==Jf&&e!==Ep&&e!==Vf&&e!==qf&&e!==Hf&&e!==Is&&e!==ya?Li(t,xr):(t.state=null,e===Is?Li(t,TB):xn)},oS=(t,e)=>{let r=e.length;if(!t||!t.state)return xr;let n=t.state,i=n.wrap;if(i===2||i===1&&n.status!==Jf||n.lookahead)return xr;if(i===1&&(t.adler=va(t.adler,e,r,0)),n.wrap=0,r>=n.w_size){i===0&&(Oi(n.head),n.strstart=0,n.block_start=0,n.insert=0);let a=new Uint8Array(n.w_size);a.set(e.subarray(r-n.w_size,r),0),e=a,r=n.w_size}let s=t.avail_in,o=t.next_in,u=t.input;for(t.avail_in=r,t.next_in=0,t.input=e,js(n);n.lookahead>=re;){let a=n.strstart,l=n.lookahead-(re-1);do n.ins_h=zi(n,n.ins_h,n.window[a+re-1]),n.prev[a&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=a,a++;while(--l);n.strstart=a,n.lookahead=re-1,js(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=re-1,n.match_available=0,t.next_in=o,t.input=u,t.avail_in=s,n.wrap=i,xn},uS=nS,aS=uy,lS=oy,cS=sy,fS=rS,hS=iS,dS=sS,pS=oS,mS="pako deflate (from Nodeca project)",Ca={deflateInit:uS,deflateInit2:aS,deflateReset:lS,deflateResetKeep:cS,deflateSetHeader:fS,deflate:hS,deflateEnd:dS,deflateSetDictionary:pS,deflateInfo:mS},gS=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),yS=function(t){let e=Array.prototype.slice.call(arguments,1);for(;e.length;){let r=e.shift();if(r){if(typeof r!="object")throw new TypeError(r+"must be non-object");for(let n in r)gS(r,n)&&(t[n]=r[n])}}return t},AS=t=>{let e=0;for(let n=0,i=t.length;n=252?6:t>=248?5:t>=240?4:t>=224?3:t>=192?2:1;ka[254]=ka[254]=1;var bS=t=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(t);let e,r,n,i,s,o=t.length,u=0;for(i=0;i>>6,e[s++]=128|r&63):r<65536?(e[s++]=224|r>>>12,e[s++]=128|r>>>6&63,e[s++]=128|r&63):(e[s++]=240|r>>>18,e[s++]=128|r>>>12&63,e[s++]=128|r>>>6&63,e[s++]=128|r&63);return e},CS=(t,e)=>{if(e<65534&&t.subarray&&ay)return String.fromCharCode.apply(null,t.length===e?t:t.subarray(0,e));let r="";for(let n=0;n{let r=e||t.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(t.subarray(0,e));let n,i,s=new Array(r*2);for(i=0,n=0;n4){s[i++]=65533,n+=u-1;continue}for(o&=u===2?31:u===3?15:7;u>1&&n1){s[i++]=65533;continue}o<65536?s[i++]=o:(o-=65536,s[i++]=55296|o>>10&1023,s[i++]=56320|o&1023)}return CS(s,i)},wS=(t,e)=>{e=e||t.length,e>t.length&&(e=t.length);let r=e-1;for(;r>=0&&(t[r]&192)===128;)r--;return r<0||r===0?e:r+ka[t[r]]>e?r:e},Ba={string2buf:bS,buf2string:ES,utf8border:wS};function FS(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}var ly=FS,cy=Object.prototype.toString,{Z_NO_FLUSH:xS,Z_SYNC_FLUSH:DS,Z_FULL_FLUSH:vS,Z_FINISH:kS,Z_OK:Kf,Z_STREAM_END:BS,Z_DEFAULT_COMPRESSION:SS,Z_DEFAULT_STRATEGY:_S,Z_DEFLATED:TS}=Vs;function Ra(t){this.options=Yf.assign({level:SS,method:TS,chunkSize:16384,windowBits:15,memLevel:8,strategy:_S},t||{});let e=this.options;e.raw&&e.windowBits>0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new ly,this.strm.avail_out=0;let r=Ca.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(r!==Kf)throw new Error($s[r]);if(e.header&&Ca.deflateSetHeader(this.strm,e.header),e.dictionary){let n;if(typeof e.dictionary=="string"?n=Ba.string2buf(e.dictionary):cy.call(e.dictionary)==="[object ArrayBuffer]"?n=new Uint8Array(e.dictionary):n=e.dictionary,r=Ca.deflateSetDictionary(this.strm,n),r!==Kf)throw new Error($s[r]);this._dict_set=!0}}Ra.prototype.push=function(t,e){let r=this.strm,n=this.options.chunkSize,i,s;if(this.ended)return!1;for(e===~~e?s=e:s=e===!0?kS:xS,typeof t=="string"?r.input=Ba.string2buf(t):cy.call(t)==="[object ArrayBuffer]"?r.input=new Uint8Array(t):r.input=t,r.next_in=0,r.avail_in=r.input.length;;){if(r.avail_out===0&&(r.output=new Uint8Array(n),r.next_out=0,r.avail_out=n),(s===DS||s===vS)&&r.avail_out<=6){this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;continue}if(i=Ca.deflate(r,s),i===BS)return r.next_out>0&&this.onData(r.output.subarray(0,r.next_out)),i=Ca.deflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===Kf;if(r.avail_out===0){this.onData(r.output);continue}if(s>0&&r.next_out>0){this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;continue}if(r.avail_in===0)break}return!0};Ra.prototype.onData=function(t){this.chunks.push(t)};Ra.prototype.onEnd=function(t){t===Kf&&(this.result=Yf.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};function vp(t,e){let r=new Ra(e);if(r.push(t,!0),r.err)throw r.msg||$s[r.err];return r.result}function RS(t,e){return e=e||{},e.raw=!0,vp(t,e)}function PS(t,e){return e=e||{},e.gzip=!0,vp(t,e)}var MS=Ra,OS=vp,NS=RS,LS=PS,IS=Vs,$S={Deflate:MS,deflate:OS,deflateRaw:NS,gzip:LS,constants:IS},If=30,zS=12,jS=function(e,r){let n,i,s,o,u,a,l,c,f,h,d,p,y,m,A,w,k,E,v,T,B,F,x,S,O=e.state;n=e.next_in,x=e.input,i=n+(e.avail_in-5),s=e.next_out,S=e.output,o=s-(r-e.avail_out),u=s+(e.avail_out-257),a=O.dmax,l=O.wsize,c=O.whave,f=O.wnext,h=O.window,d=O.hold,p=O.bits,y=O.lencode,m=O.distcode,A=(1<>>24,d>>>=E,p-=E,E=k>>>16&255,E===0)S[s++]=k&65535;else if(E&16){v=k&65535,E&=15,E&&(p>>=E,p-=E),p<15&&(d+=x[n++]<>>24,d>>>=E,p-=E,E=k>>>16&255,E&16){if(T=k&65535,E&=15,pa){e.msg="invalid distance too far back",O.mode=If;break e}if(d>>>=E,p-=E,E=s-o,T>E){if(E=T-E,E>c&&O.sane){e.msg="invalid distance too far back",O.mode=If;break e}if(B=0,F=h,f===0){if(B+=l-E,E2;)S[s++]=F[B++],S[s++]=F[B++],S[s++]=F[B++],v-=3;v&&(S[s++]=F[B++],v>1&&(S[s++]=F[B++]))}else{B=s-T;do S[s++]=S[B++],S[s++]=S[B++],S[s++]=S[B++],v-=3;while(v>2);v&&(S[s++]=S[B++],v>1&&(S[s++]=S[B++]))}}else if(E&64){e.msg="invalid distance code",O.mode=If;break e}else{k=m[(k&65535)+(d&(1<>3,n-=v,p-=v<<3,d&=(1<{let a=u.bits,l=0,c=0,f=0,h=0,d=0,p=0,y=0,m=0,A=0,w=0,k,E,v,T,B,F=null,x=0,S,O=new Uint16Array(F1+1),de=new Uint16Array(F1+1),xe=null,gt=0,Ke,Ue,yt;for(l=0;l<=F1;l++)O[l]=0;for(c=0;c=1&&O[h]===0;h--);if(d>h&&(d=h),h===0)return i[s++]=1<<24|64<<16|0,i[s++]=1<<24|64<<16|0,u.bits=1,0;for(f=1;f0&&(t===m5||h!==1))return-1;for(de[1]=0,l=1;ld5||t===g5&&A>p5)return 1;for(;;){Ke=l-y,o[c]S?(Ue=xe[gt+o[c]],yt=F[x+o[c]]):(Ue=32+64,yt=0),k=1<>y)+E]=Ke<<24|Ue<<16|yt|0;while(E!==0);for(k=1<>=1;if(k!==0?(w&=k-1,w+=k):w=0,c++,--O[l]===0){if(l===h)break;l=e[r+o[c]]}if(l>d&&(w&T)!==v){for(y===0&&(y=d),B+=f,p=l-y,m=1<d5||t===g5&&A>p5)return 1;v=w&T,i[v]=d<<24|p<<16|B-s|0}}return w!==0&&(i[B+w]=l-y<<24|64<<16|0),u.bits=d,0},Ea=WS,KS=0,fy=1,hy=2,{Z_FINISH:y5,Z_BLOCK:GS,Z_TREES:$f,Z_OK:Us,Z_STREAM_END:ZS,Z_NEED_DICT:JS,Z_STREAM_ERROR:Dr,Z_DATA_ERROR:dy,Z_MEM_ERROR:py,Z_BUF_ERROR:YS,Z_DEFLATED:A5}=Vs,my=1,b5=2,C5=3,E5=4,w5=5,F5=6,x5=7,D5=8,v5=9,k5=10,Gf=11,Gn=12,fp=13,B5=14,hp=15,S5=16,_5=17,T5=18,R5=19,zf=20,jf=21,P5=22,M5=23,O5=24,N5=25,L5=26,dp=27,I5=28,$5=29,Te=30,gy=31,XS=32,QS=852,e_=592,t_=15,r_=t_,z5=t=>(t>>>24&255)+(t>>>8&65280)+((t&65280)<<8)+((t&255)<<24);function n_(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}var yy=t=>{if(!t||!t.state)return Dr;let e=t.state;return t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=e.wrap&1),e.mode=my,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new Int32Array(QS),e.distcode=e.distdyn=new Int32Array(e_),e.sane=1,e.back=-1,Us},Ay=t=>{if(!t||!t.state)return Dr;let e=t.state;return e.wsize=0,e.whave=0,e.wnext=0,yy(t)},by=(t,e)=>{let r;if(!t||!t.state)return Dr;let n=t.state;return e<0?(r=0,e=-e):(r=(e>>4)+1,e<48&&(e&=15)),e&&(e<8||e>15)?Dr:(n.window!==null&&n.wbits!==e&&(n.window=null),n.wrap=r,n.wbits=e,Ay(t))},Cy=(t,e)=>{if(!t)return Dr;let r=new n_;t.state=r,r.window=null;let n=by(t,e);return n!==Us&&(t.state=null),n},i_=t=>Cy(t,r_),j5=!0,pp,mp,s_=t=>{if(j5){pp=new Int32Array(512),mp=new Int32Array(32);let e=0;for(;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(Ea(fy,t.lens,0,288,pp,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;Ea(hy,t.lens,0,32,mp,0,t.work,{bits:5}),j5=!1}t.lencode=pp,t.lenbits=9,t.distcode=mp,t.distbits=5},Ey=(t,e,r,n)=>{let i,s=t.state;return s.window===null&&(s.wsize=1<=s.wsize?(s.window.set(e.subarray(r-s.wsize,r),0),s.wnext=0,s.whave=s.wsize):(i=s.wsize-s.wnext,i>n&&(i=n),s.window.set(e.subarray(r-n,r-n+i),s.wnext),n-=i,n?(s.window.set(e.subarray(r-n,r),0),s.wnext=n,s.whave=s.wsize):(s.wnext+=i,s.wnext===s.wsize&&(s.wnext=0),s.whave{let r,n,i,s,o,u,a,l,c,f,h,d,p,y,m=0,A,w,k,E,v,T,B,F,x=new Uint8Array(4),S,O,de=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(!t||!t.state||!t.output||!t.input&&t.avail_in!==0)return Dr;r=t.state,r.mode===Gn&&(r.mode=fp),o=t.next_out,i=t.output,a=t.avail_out,s=t.next_in,n=t.input,u=t.avail_in,l=r.hold,c=r.bits,f=u,h=a,F=Us;e:for(;;)switch(r.mode){case my:if(r.wrap===0){r.mode=fp;break}for(;c<16;){if(u===0)break e;u--,l+=n[s++]<>>8&255,r.check=st(r.check,x,2,0),l=0,c=0,r.mode=b5;break}if(r.flags=0,r.head&&(r.head.done=!1),!(r.wrap&1)||(((l&255)<<8)+(l>>8))%31){t.msg="incorrect header check",r.mode=Te;break}if((l&15)!==A5){t.msg="unknown compression method",r.mode=Te;break}if(l>>>=4,c-=4,B=(l&15)+8,r.wbits===0)r.wbits=B;else if(B>r.wbits){t.msg="invalid window size",r.mode=Te;break}r.dmax=1<>8&1),r.flags&512&&(x[0]=l&255,x[1]=l>>>8&255,r.check=st(r.check,x,2,0)),l=0,c=0,r.mode=C5;case C5:for(;c<32;){if(u===0)break e;u--,l+=n[s++]<>>8&255,x[2]=l>>>16&255,x[3]=l>>>24&255,r.check=st(r.check,x,4,0)),l=0,c=0,r.mode=E5;case E5:for(;c<16;){if(u===0)break e;u--,l+=n[s++]<>8),r.flags&512&&(x[0]=l&255,x[1]=l>>>8&255,r.check=st(r.check,x,2,0)),l=0,c=0,r.mode=w5;case w5:if(r.flags&1024){for(;c<16;){if(u===0)break e;u--,l+=n[s++]<>>8&255,r.check=st(r.check,x,2,0)),l=0,c=0}else r.head&&(r.head.extra=null);r.mode=F5;case F5:if(r.flags&1024&&(d=r.length,d>u&&(d=u),d&&(r.head&&(B=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Uint8Array(r.head.extra_len)),r.head.extra.set(n.subarray(s,s+d),B)),r.flags&512&&(r.check=st(r.check,n,d,s)),u-=d,s+=d,r.length-=d),r.length))break e;r.length=0,r.mode=x5;case x5:if(r.flags&2048){if(u===0)break e;d=0;do B=n[s+d++],r.head&&B&&r.length<65536&&(r.head.name+=String.fromCharCode(B));while(B&&d>9&1,r.head.done=!0),t.adler=r.check=0,r.mode=Gn;break;case k5:for(;c<32;){if(u===0)break e;u--,l+=n[s++]<>>=c&7,c-=c&7,r.mode=dp;break}for(;c<3;){if(u===0)break e;u--,l+=n[s++]<>>=1,c-=1,l&3){case 0:r.mode=B5;break;case 1:if(s_(r),r.mode=zf,e===$f){l>>>=2,c-=2;break e}break;case 2:r.mode=_5;break;case 3:t.msg="invalid block type",r.mode=Te}l>>>=2,c-=2;break;case B5:for(l>>>=c&7,c-=c&7;c<32;){if(u===0)break e;u--,l+=n[s++]<>>16^65535)){t.msg="invalid stored block lengths",r.mode=Te;break}if(r.length=l&65535,l=0,c=0,r.mode=hp,e===$f)break e;case hp:r.mode=S5;case S5:if(d=r.length,d){if(d>u&&(d=u),d>a&&(d=a),d===0)break e;i.set(n.subarray(s,s+d),o),u-=d,s+=d,a-=d,o+=d,r.length-=d;break}r.mode=Gn;break;case _5:for(;c<14;){if(u===0)break e;u--,l+=n[s++]<>>=5,c-=5,r.ndist=(l&31)+1,l>>>=5,c-=5,r.ncode=(l&15)+4,l>>>=4,c-=4,r.nlen>286||r.ndist>30){t.msg="too many length or distance symbols",r.mode=Te;break}r.have=0,r.mode=T5;case T5:for(;r.have>>=3,c-=3}for(;r.have<19;)r.lens[de[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,S={bits:r.lenbits},F=Ea(KS,r.lens,0,19,r.lencode,0,r.work,S),r.lenbits=S.bits,F){t.msg="invalid code lengths set",r.mode=Te;break}r.have=0,r.mode=R5;case R5:for(;r.have>>24,w=m>>>16&255,k=m&65535,!(A<=c);){if(u===0)break e;u--,l+=n[s++]<>>=A,c-=A,r.lens[r.have++]=k;else{if(k===16){for(O=A+2;c>>=A,c-=A,r.have===0){t.msg="invalid bit length repeat",r.mode=Te;break}B=r.lens[r.have-1],d=3+(l&3),l>>>=2,c-=2}else if(k===17){for(O=A+3;c>>=A,c-=A,B=0,d=3+(l&7),l>>>=3,c-=3}else{for(O=A+7;c>>=A,c-=A,B=0,d=11+(l&127),l>>>=7,c-=7}if(r.have+d>r.nlen+r.ndist){t.msg="invalid bit length repeat",r.mode=Te;break}for(;d--;)r.lens[r.have++]=B}}if(r.mode===Te)break;if(r.lens[256]===0){t.msg="invalid code -- missing end-of-block",r.mode=Te;break}if(r.lenbits=9,S={bits:r.lenbits},F=Ea(fy,r.lens,0,r.nlen,r.lencode,0,r.work,S),r.lenbits=S.bits,F){t.msg="invalid literal/lengths set",r.mode=Te;break}if(r.distbits=6,r.distcode=r.distdyn,S={bits:r.distbits},F=Ea(hy,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,S),r.distbits=S.bits,F){t.msg="invalid distances set",r.mode=Te;break}if(r.mode=zf,e===$f)break e;case zf:r.mode=jf;case jf:if(u>=6&&a>=258){t.next_out=o,t.avail_out=a,t.next_in=s,t.avail_in=u,r.hold=l,r.bits=c,jS(t,h),o=t.next_out,i=t.output,a=t.avail_out,s=t.next_in,n=t.input,u=t.avail_in,l=r.hold,c=r.bits,r.mode===Gn&&(r.back=-1);break}for(r.back=0;m=r.lencode[l&(1<>>24,w=m>>>16&255,k=m&65535,!(A<=c);){if(u===0)break e;u--,l+=n[s++]<>E)],A=m>>>24,w=m>>>16&255,k=m&65535,!(E+A<=c);){if(u===0)break e;u--,l+=n[s++]<>>=E,c-=E,r.back+=E}if(l>>>=A,c-=A,r.back+=A,r.length=k,w===0){r.mode=L5;break}if(w&32){r.back=-1,r.mode=Gn;break}if(w&64){t.msg="invalid literal/length code",r.mode=Te;break}r.extra=w&15,r.mode=P5;case P5:if(r.extra){for(O=r.extra;c>>=r.extra,c-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=M5;case M5:for(;m=r.distcode[l&(1<>>24,w=m>>>16&255,k=m&65535,!(A<=c);){if(u===0)break e;u--,l+=n[s++]<>E)],A=m>>>24,w=m>>>16&255,k=m&65535,!(E+A<=c);){if(u===0)break e;u--,l+=n[s++]<>>=E,c-=E,r.back+=E}if(l>>>=A,c-=A,r.back+=A,w&64){t.msg="invalid distance code",r.mode=Te;break}r.offset=k,r.extra=w&15,r.mode=O5;case O5:if(r.extra){for(O=r.extra;c>>=r.extra,c-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){t.msg="invalid distance too far back",r.mode=Te;break}r.mode=N5;case N5:if(a===0)break e;if(d=h-a,r.offset>d){if(d=r.offset-d,d>r.whave&&r.sane){t.msg="invalid distance too far back",r.mode=Te;break}d>r.wnext?(d-=r.wnext,p=r.wsize-d):p=r.wnext-d,d>r.length&&(d=r.length),y=r.window}else y=i,p=o-r.offset,d=r.length;d>a&&(d=a),a-=d,r.length-=d;do i[o++]=y[p++];while(--d);r.length===0&&(r.mode=jf);break;case L5:if(a===0)break e;i[o++]=r.length,a--,r.mode=jf;break;case dp:if(r.wrap){for(;c<32;){if(u===0)break e;u--,l|=n[s++]<{if(!t||!t.state)return Dr;let e=t.state;return e.window&&(e.window=null),t.state=null,Us},a_=(t,e)=>{if(!t||!t.state)return Dr;let r=t.state;return r.wrap&2?(r.head=e,e.done=!1,Us):Dr},l_=(t,e)=>{let r=e.length,n,i,s;return!t||!t.state||(n=t.state,n.wrap!==0&&n.mode!==Gf)?Dr:n.mode===Gf&&(i=1,i=va(i,e,r,0),i!==n.check)?dy:(s=Ey(t,e,r,r),s?(n.mode=gy,py):(n.havedict=1,Us))},c_=Ay,f_=by,h_=yy,d_=i_,p_=Cy,m_=o_,g_=u_,y_=a_,A_=l_,b_="pako inflate (from Nodeca project)",Jn={inflateReset:c_,inflateReset2:f_,inflateResetKeep:h_,inflateInit:d_,inflateInit2:p_,inflate:m_,inflateEnd:g_,inflateGetHeader:y_,inflateSetDictionary:A_,inflateInfo:b_};function C_(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}var E_=C_,wy=Object.prototype.toString,{Z_NO_FLUSH:w_,Z_FINISH:F_,Z_OK:Sa,Z_STREAM_END:gp,Z_NEED_DICT:yp,Z_STREAM_ERROR:x_,Z_DATA_ERROR:U5,Z_MEM_ERROR:D_}=Vs;function Pa(t){this.options=Yf.assign({chunkSize:1024*64,windowBits:15,to:""},t||{});let e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,e.windowBits===0&&(e.windowBits=-15)),e.windowBits>=0&&e.windowBits<16&&!(t&&t.windowBits)&&(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&(e.windowBits&15||(e.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new ly,this.strm.avail_out=0;let r=Jn.inflateInit2(this.strm,e.windowBits);if(r!==Sa)throw new Error($s[r]);if(this.header=new E_,Jn.inflateGetHeader(this.strm,this.header),e.dictionary&&(typeof e.dictionary=="string"?e.dictionary=Ba.string2buf(e.dictionary):wy.call(e.dictionary)==="[object ArrayBuffer]"&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(r=Jn.inflateSetDictionary(this.strm,e.dictionary),r!==Sa)))throw new Error($s[r])}Pa.prototype.push=function(t,e){let r=this.strm,n=this.options.chunkSize,i=this.options.dictionary,s,o,u;if(this.ended)return!1;for(e===~~e?o=e:o=e===!0?F_:w_,wy.call(t)==="[object ArrayBuffer]"?r.input=new Uint8Array(t):r.input=t,r.next_in=0,r.avail_in=r.input.length;;){for(r.avail_out===0&&(r.output=new Uint8Array(n),r.next_out=0,r.avail_out=n),s=Jn.inflate(r,o),s===yp&&i&&(s=Jn.inflateSetDictionary(r,i),s===Sa?s=Jn.inflate(r,o):s===U5&&(s=yp));r.avail_in>0&&s===gp&&r.state.wrap>0&&t[r.next_in]!==0;)Jn.inflateReset(r),s=Jn.inflate(r,o);switch(s){case x_:case U5:case yp:case D_:return this.onEnd(s),this.ended=!0,!1}if(u=r.avail_out,r.next_out&&(r.avail_out===0||s===gp))if(this.options.to==="string"){let a=Ba.utf8border(r.output,r.next_out),l=r.next_out-a,c=Ba.buf2string(r.output,a);r.next_out=l,r.avail_out=n-l,l&&r.output.set(r.output.subarray(a,a+l),0),this.onData(c)}else this.onData(r.output.length===r.next_out?r.output:r.output.subarray(0,r.next_out));if(!(s===Sa&&u===0)){if(s===gp)return s=Jn.inflateEnd(this.strm),this.onEnd(s),this.ended=!0,!0;if(r.avail_in===0)break}}return!0};Pa.prototype.onData=function(t){this.chunks.push(t)};Pa.prototype.onEnd=function(t){t===Sa&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=Yf.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};function kp(t,e){let r=new Pa(e);if(r.push(t),r.err)throw r.msg||$s[r.err];return r.result}function v_(t,e){return e=e||{},e.raw=!0,kp(t,e)}var k_=Pa,B_=kp,S_=v_,__=kp,T_=Vs,R_={Inflate:k_,inflate:B_,inflateRaw:S_,ungzip:__,constants:T_},{Deflate:P_,deflate:M_,deflateRaw:O_,gzip:N_}=$S,{Inflate:L_,inflate:I_,inflateRaw:$_,ungzip:z_}=R_,j_=P_,U_=M_,V_=O_,q_=N_,H_=L_,W_=I_,K_=$_,G_=z_,Z_=Vs,Bp={Deflate:j_,deflate:U_,deflateRaw:V_,gzip:q_,Inflate:H_,inflate:W_,inflateRaw:K_,ungzip:G_,constants:Z_};var Dn,Sp=class{constructor(){R(this,Dn,new Map)}emit(e,...r){let n=g(this,Dn).get(e);if(!n?.all?.size)return!1;for(let i of n.all)i(...r),n.once.has(i)&&(n.all.delete(i),n.once.delete(i));return!1}on(e,r){return g(this,Dn).has(e)||g(this,Dn).set(e,{all:new Set,once:new Set}),g(this,Dn).get(e).all.add(r),this}once(e,r){g(this,Dn).has(e)||g(this,Dn).set(e,{all:new Set,once:new Set});let n=g(this,Dn).get(e);return n.all.add(r),n.once.add(r),this}};Dn=new WeakMap;var _p=class{async get(e,r={}){let n=new Headers;for(let[s,o]of Object.entries(r?.headers??{})){let u=typeof o=="string"?[o]:o;for(let a of u)n.append(s,a)}let i=await fetch(e,{headers:n,redirect:"follow"});if(i.ok)return new Uint8Array(await i.arrayBuffer());throw new Error(`Status code ${i.status}: ${i.ok}`)}},Tp=class{on(e,r){return e==="ready"&&r(),this}once(e,r){return e==="ready"&&r(),this}async close(){}},Qf=class{states;constructor(){this.states=JSON.parse(localStorage.getItem(Qf.LocalStorageKey)??"{}")}saveStates(){localStorage.setItem(Qf.LocalStorageKey,JSON.stringify(this.states))}async chmod(e,r){}async getAllFiles(e){return[]}async mkdir(e,r){if(e=X.ensureEndingSlash(e.toString()),this.states[e])throw new Error(`EEXIST: ${e}`);this.states[e]={type:"directory"},this.saveStates()}async readFile(e){e=e.toString();let r=this.states[e];if(r){if(r.type==="directory")throw new Error(`EISDIR: ${e}`)}else throw new Error(`ENOENT: ${e}`);return new Uint8Array((0,e0.decode)(r.content))}async showFile(e){throw new Error("showFile not supported on browser")}async stat(e){e=e.toString();let r=this.states[e];if(!r)throw new Error(`ENOENT: ${e}`);return{isDirectory:()=>r.type==="directory",isFile:()=>r.type==="file"}}async unlink(e){if(e=e.toString(),!this.states[e])throw new Error(`ENOENT: ${e}`);delete this.states[e],this.saveStates()}watch(e){return new Tp}async writeFile(e,r,n){e=e.toString(),typeof r=="string"&&(r=new TextEncoder().encode(r)),r=(0,e0.encode)(r),this.states[e]={type:"file",content:r},this.saveStates()}},Xf=Qf;q(Xf,"LocalStorageKey","spyglassmc-browser-fs");var Rp={archive:{decompressBall(t,e){throw new Error("decompressBall not supported on browser.")},async gunzip(t){return Bp.inflate(t)},async gzip(t){return Bp.gzip(t)}},crypto:{async getSha1(t){typeof t=="string"&&(t=new TextEncoder().encode(t));let e=await crypto.subtle.digest("SHA-1",t);return J_(new Uint8Array(e))}},downloader:new _p,error:{isKind(t,e){return t instanceof Error&&t.message.startsWith(e)}},event:{EventEmitter:Sp},fs:new Xf};function J_(t){let e="";for(let r of t)e+=r.toString(16).padStart(2,"0");return e}Object.freeze(Rp);var to={};Rr(to,{TypeDefSymbolData:()=>Za,fileModule:()=>ky,module_:()=>By,registerMcdocBinders:()=>Vp});var Fy;(function(t){function e(r){return r?.type==="mcdoc:module"}t.is=e})(Fy||(Fy={}));var t0;(function(t){function e(r){return ps.is(r)||Ma.is(r)||Xn.is(r)||Ka.is(r)||Qn.is(r)||eo.is(r)||P1.is(r)}t.is=e})(t0||(t0={}));var Ma;(function(t){function e(n){return{attributes:n.children.filter(Wr.is),location:n.children.find(V.is),index:n.children.find(vn.is),target:n.children.find(vr.is),typeParams:n.children.find(_1.is)}}t.destruct=e;function r(n){return n?.type==="mcdoc:dispatch_statement"}t.is=r})(Ma||(Ma={}));var pt;(function(t){function e(r){return r?.type==="mcdoc:literal"}t.is=e})(pt||(pt={}));var vn;(function(t){function e(n){return{parallelIndices:n.children.filter(Pp.is)}}t.destruct=e;function r(n){return n?.type==="mcdoc:index_body"}t.is=r})(vn||(vn={}));var Pp;(function(t){function e(r){return Oa.is(r)||Hs.is(r)}t.is=e})(Pp||(Pp={}));var Oa;(function(t){function e(r){return pt.is(r)||Ut.is(r)||ht.is(r)||V.is(r)}t.is=e})(Oa||(Oa={}));var Ut;(function(t){function e(r){return r?.type==="mcdoc:identifier"}t.is=e})(Ut||(Ut={}));var Hs;(function(t){function e(n){return{keys:n.children.filter(Mp.is)}}t.destruct=e;function r(n){return n?.type==="mcdoc:dynamic_index"}t.is=r})(Hs||(Hs={}));var Mp;(function(t){function e(r){return pt.is(r)||Ut.is(r)||ht.is(r)}t.is=e})(Mp||(Mp={}));var vr;(function(t){function e(r){return Op.is(r)||Np.is(r)||Va.is(r)||za.is(r)||ja.is(r)||Ua.is(r)||Ks.is(r)||Gs.is(r)||Xn.is(r)||Qn.is(r)||Zs.is(r)||Xs.is(r)||Qs.is(r)}t.is=e})(vr||(vr={}));var Na;(function(t){function e(r){return{appendixes:r.children.filter(n=>vn.is(n)||Ws.is(n)),attributes:r.children.filter(Wr.is)}}t.destruct=e})(Na||(Na={}));var Wr;(function(t){function e(n){return{name:n.children.find(Ut.is),value:n.children.find(r0.is)}}t.destruct=e;function r(n){return n?.type==="mcdoc:attribute"}t.is=r})(Wr||(Wr={}));var r0;(function(t){function e(r){return vr.is(r)||La.is(r)}t.is=e})(r0||(r0={}));var La;(function(t){function e(n){return{positional:n.children.find(Ia.is),named:n.children.find($a.is)}}t.destruct=e;function r(n){return n?.type==="mcdoc:attribute/tree"}t.is=r})(La||(La={}));var Ia;(function(t){function e(n){return{values:n.children.filter(r0.is)}}t.destruct=e;function r(n){return n?.type==="mcdoc:attribute/tree/pos"}t.is=r})(Ia||(Ia={}));var $a;(function(t){function e(n){let i={values:[]},s;for(let o of n.children)ps.is(o)||(Ut.is(o)||ht.is(o)?s=o:s&&(i.values.push({key:s,value:o}),s=void 0));return i}t.destruct=e;function r(n){return n?.type==="mcdoc:attribute/tree/named"}t.is=r})($a||($a={}));var Ws;(function(t){function e(n){return{args:n.children.filter(vr.is)}}t.destruct=e;function r(n){return n?.type==="mcdoc:type_arg_block"}t.is=r})(Ws||(Ws={}));var Op;(function(t){function e(r){return r?.type==="mcdoc:type/any"}t.is=e})(Op||(Op={}));var Np;(function(t){function e(r){return r?.type==="mcdoc:type/boolean"}t.is=e})(Np||(Np={}));var ji;(function(t){function e(n){return vy(n)}t.destruct=e;function r(n){return n?.type==="mcdoc:int_range"}t.is=r})(ji||(ji={}));var za;(function(t){function e(n){return{value:n.children.find(Lp.is)}}t.destruct=e;function r(n){return n?.type==="mcdoc:type/literal"}t.is=r})(za||(za={}));var Lp;(function(t){function e(r){return pt.is(r)||Yn.is(r)||ht.is(r)}t.is=e})(Lp||(Lp={}));var Yn;(function(t){function e(n){return{value:n.children.find(zr.is),suffix:n.children.find(pt.is)}}t.destruct=e;function r(n){return n?.type==="mcdoc:typed_number"}t.is=r})(Yn||(Yn={}));var ja;(function(t){function e(n){return{numericKind:n.children.find(pt.is),valueRange:n.children.find(k1.is)||n.children.find(ji.is)}}t.destruct=e;function r(n){return n?.type==="mcdoc:type/numeric_type"}t.is=r})(ja||(ja={}));var Kr="<";function Dy(t){let e=t&2?Kr:"",r=t&1?Kr:"";return`${e}..${r}`}function vy(t){let e,r,n;return t.children.length===1?(e=0,r=n=t.children[0]):t.children.length===3?(e=i(t.children[1]),r=t.children[0],n=t.children[2]):pt.is(t.children[0])?(e=i(t.children[0]),n=t.children[1]):(e=i(t.children[1]),r=t.children[0]),{kind:e,min:r,max:n};function i(s){let o=0;return s.value.startsWith(Kr)&&(o|=2),s.value.endsWith(Kr)&&(o|=1),o}}var k1;(function(t){function e(n){return vy(n)}t.destruct=e;function r(n){return n?.type==="mcdoc:float_range"}t.is=r})(k1||(k1={}));var Ua;(function(t){function e(n){let i,s,o=!1;for(let u of n.children)pt.is(u)&&u.value==="[]"?o=!0:ji.is(u)&&(o?i=u:s=u);return{arrayKind:n.children.find(pt.is),lengthRange:i,valueRange:s}}t.destruct=e;function r(n){return n?.type==="mcdoc:type/primitive_array"}t.is=r})(Ua||(Ua={}));var Ks;(function(t){function e(n){return{item:n.children.find(vr.is),lengthRange:n.children.find(ji.is)}}t.destruct=e;function r(n){return n?.type==="mcdoc:type/list"}t.is=r})(Ks||(Ks={}));var Va;(function(t){function e(n){return{lengthRange:n.children.find(ji.is)}}t.destruct=e;function r(n){return n?.type==="mcdoc:type/string"}t.is=r})(Va||(Va={}));var Gs;(function(t){function e(n){return{items:n.children.filter(vr.is)}}t.destruct=e;function r(n){return n?.type==="mcdoc:type/tuple"}t.is=r})(Gs||(Gs={}));var Xn;(function(t){t.Kinds=new Set(["byte","short","int","long","float","double","string"]);function e(n){return{block:n.children.find(B1.is),docComments:n.children.find(Ui.is),enumKind:i(n),identifier:n.children.find(Ut.is),keyword:n.children.find(pt.is)};function i(s){for(let o of s.children.filter(pt.is))if(t.Kinds.has(o.value))return o.value}}t.destruct=e;function r(n){return n?.type==="mcdoc:enum"}t.is=r})(Xn||(Xn={}));var Ui;(function(t){function e(n){if(!n)return;let i=n.children.map(s=>s.comment);return i.every(s=>s.length===0||s.startsWith(" "))&&(i=i.map(s=>s.slice(1))),i.join(` -`)}t.asText=e;function r(n){return n?.type==="mcdoc:doc_comments"}t.is=r})(Ui||(Ui={}));var B1;(function(t){function e(n){return{fields:n.children.filter(S1.is)}}t.destruct=e;function r(n){return n?.type==="mcdoc:enum/block"}t.is=r})(B1||(B1={}));var S1;(function(t){function e(n){return{attributes:n.children.filter(Wr.is),identifier:n.children.find(Ut.is),value:n.children.find(Ip.is)}}t.destruct=e;function r(n){return n?.type==="mcdoc:enum/field"}t.is=r})(S1||(S1={}));var Ip;(function(t){function e(r){return Yn.is(r)||ht.is(r)}t.is=e})(Ip||(Ip={}));var xy;(function(t){function e(r){return Wr.is(r)||Ui.is(r)}t.is=e})(xy||(xy={}));var Qn;(function(t){function e(n){return{block:n.children.find(T1.is),docComments:n.children.find(Ui.is),identifier:n.children.find(Ut.is),keyword:n.children.find(pt.is)}}t.destruct=e;function r(n){return n?.type==="mcdoc:struct"}t.is=r})(Qn||(Qn={}));var Zs;(function(t){function e(n){return{path:n.children.find(Js.is)}}t.destruct=e;function r(n){return n?.type==="mcdoc:type/reference"}t.is=r})(Zs||(Zs={}));var _1;(function(t){function e(n){return{params:n.children.filter(qa.is)}}t.destruct=e;function r(n){return n?.type==="mcdoc:type_param_block"}t.is=r})(_1||(_1={}));var qa;(function(t){function e(n){return{identifier:n.children.find(Ut.is)}}t.destruct=e;function r(n){return n?.type==="mcdoc:type_param"}t.is=r})(qa||(qa={}));var Js;(function(t){function e(n){let i=Ou(n?.children,-1);return{children:n?.children??[],isAbsolute:n?.isAbsolute,lastIdentifier:Ut.is(i)?i:void 0}}t.destruct=e;function r(n){return n?.type==="mcdoc:path"}t.is=r})(Js||(Js={}));var T1;(function(t){function e(n){return{fields:n.children.filter(Ha.is)}}t.destruct=e;function r(n){return n?.type==="mcdoc:struct/block"}t.is=r})(T1||(T1={}));var Ha;(function(t){function e(r){return Vi.is(r)||R1.is(r)}t.is=e})(Ha||(Ha={}));var Vi;(function(t){function e(n){return{attributes:n.children.filter(Wr.is),key:n.children.find(Wa.is),type:n.children.find(vr.is),isOptional:n.isOptional}}t.destruct=e;function r(n){return n?.type==="mcdoc:struct/field/pair"}t.is=r})(Vi||(Vi={}));var Wa;(function(t){function e(r){return ht.is(r)||Ut.is(r)||Ys.is(r)}t.is=e})(Wa||(Wa={}));var Ys;(function(t){function e(n){return{type:n.children.find(vr.is)}}t.destruct=e;function r(n){return n?.type==="mcdoc:struct/map_key"}t.is=r})(Ys||(Ys={}));var R1;(function(t){function e(n){return{attributes:n.children.filter(Wr.is),type:n.children.find(vr.is)}}t.destruct=e;function r(n){return n?.type==="mcdoc:struct/field/spread"}t.is=r})(R1||(R1={}));var Xs;(function(t){function e(n){return{location:n.children.find(V.is),index:n.children.find(vn.is)}}t.destruct=e;function r(n){return n?.type==="mcdoc:type/dispatcher"}t.is=r})(Xs||(Xs={}));var Qs;(function(t){function e(n){return{members:n.children.filter(vr.is)}}t.destruct=e;function r(n){return n?.type==="mcdoc:type/union"}t.is=r})(Qs||(Qs={}));var Ka;(function(t){function e(n){return{injection:n.children.find($p.is)}}t.destruct=e;function r(n){return n?.type==="mcdoc:injection"}t.is=r})(Ka||(Ka={}));var $p;(function(t){function e(r){return Ga.is(r)||zp.is(r)}t.is=e})($p||($p={}));var Ga;(function(t){function e(r){return r?.type==="mcdoc:injection/enum"}t.is=e})(Ga||(Ga={}));var zp;(function(t){function e(r){return r?.type==="mcdoc:injection/struct"}t.is=e})(zp||(zp={}));var eo;(function(t){function e(n){return{attributes:n.children.filter(Wr.is),docComments:n.children.find(Ui.is),identifier:n.children.find(Ut.is),keyword:n.children.find(pt.is),typeParams:n.children.find(_1.is),rhs:n.children.find(vr.is)}}t.destruct=e;function r(n){return n?.type==="mcdoc:type_alias"}t.is=r})(eo||(eo={}));var P1;(function(t){function e(n){return{binding:n.children.find(Ut.is),path:n.children.find(Js.is)}}t.destruct=e;function r(n){return n?.type==="mcdoc:use_statement"}t.is=r})(P1||(P1={}));var jp;(function(t){function e(r){return!!r&&typeof r=="object"&&typeof r.nextAnonymousIndex=="number"}t.is=e})(jp||(jp={}));var Za;(function(t){function e(r){return!!r&&typeof r=="object"&&typeof r.typeDef=="object"}t.is=e})(Za||(Za={}));var ky=vs.create(async(t,e)=>{let r=uT(e.doc.uri,e);if(!r){e.err.report(C("mcdoc.binder.out-of-root",L(e.doc.uri)),b.Beginning,0);return}let n={...e,moduleIdentifier:r};return By(t,n)});async function By(t,e){let r={nextAnonymousIndex:0};e.symbols.query({doc:e.doc,node:t},"mcdoc",e.moduleIdentifier).amend({data:{data:r}}),Y_(t,e);for(let n of t.children)switch(n.type){case"mcdoc:dispatch_statement":await X_(n,e);break;case"mcdoc:enum":Ty(n,e);break;case"mcdoc:injection":await tT(n,e);break;case"mcdoc:struct":await Ry(n,e);break;case"mcdoc:type_alias":await nT(n,e);break;case"mcdoc:use_statement":await iT(n,e);break}}function Y_(t,e){$t(t,()=>!0,t0.is,l=>{switch(l.type){case"mcdoc:enum":r(l);break;case"mcdoc:struct":n(l);break;case"mcdoc:type_alias":i(l);break;case"mcdoc:use_statement":s(l);break}});function r(l){o("enum",l,Xn.destruct,c=>({typeDef:Ny(c,e)}))}function n(l){o("struct",l,Qn.destruct,c=>({typeDef:Ly(c,e)}))}function i(l){o("type_alias",l,eo.destruct,c=>{let{attributes:f,rhs:h,typeParams:d}=eo.destruct(c);if(!h)return;let p={typeDef:kn(h,e)};return d&&Sy(l,d,p,e),p.typeDef=qp(p.typeDef,f,e),p})}function s(l){let{binding:c,path:f}=P1.destruct(l);if(!f)return;let{lastIdentifier:h}=Js.destruct(f),d=c??h;d&&e.symbols.query({doc:e.doc,node:l},"mcdoc",`${e.moduleIdentifier}::${d.value}`).ifDeclared(p=>M1(e,p,d)).elseEnter({data:{subcategory:"use_statement_binding",visibility:1},usage:{type:"definition",node:d,fullRange:l}})}function o(l,c,f,h){let{docComments:d,identifier:p,keyword:y}=f(c),m=p?.value??a(c,e);e.symbols.query({doc:e.doc,node:c},"mcdoc",`${e.moduleIdentifier}::${m}`).ifDeclared(A=>M1(e,A,p??c)).elseEnter({data:{data:h(c),desc:Ui.asText(d),subcategory:l},usage:{type:"definition",node:p??y,fullRange:p&&c}})}function u(l,c){let f=c.symbols.query({doc:c.doc,node:l},"mcdoc",c.moduleIdentifier).getData(jp.is);if(!f)throw new Error(`No symbol data for module '${c.moduleIdentifier}'`);return f.nextAnonymousIndex++}function a(l,c){return``}}function Sy(t,e,r,n){t.locals=Object.create(null),r.typeDef={kind:"template",child:r.typeDef,typeParams:[]};let{params:i}=_1.destruct(e);for(let s of i){let{identifier:o}=qa.destruct(s);if(o.value){let u=`${n.moduleIdentifier}::${o.value}`;n.symbols.query({doc:n.doc,node:t},"mcdoc",u).ifDeclared(a=>M1(n,a,o)).elseEnter({data:{visibility:0},usage:{type:"declaration",node:o,fullRange:s}}),r.typeDef.typeParams.push({path:u})}}}async function X_(t,e){let{attributes:r,location:n,index:i,target:s,typeParams:o}=Ma.destruct(t);if(!(n&&i&&s))return;let u=V.toString(n,"full");e.symbols.query(e.doc,"mcdoc/dispatcher",u).enter({usage:{type:"reference",node:n,fullRange:t}});let{parallelIndices:a}=vn.destruct(i);if(a.length){let l={typeDef:kn(s,e)};o&&Sy(t,o,l,e),l.typeDef=qp(l.typeDef,r,e);for(let c of a)Hs.is(c)||e.symbols.query(e.doc,"mcdoc/dispatcher",u,Ya(c)).ifDeclared(f=>M1(e,f,c,{localeString:"mcdoc.binder.dispatcher-statement.duplicated-key"})).elseEnter({data:{data:l},usage:{type:"definition",node:c,fullRange:t}})}await qi(s,e)}async function qi(t,e){if(Xs.is(t))await Q_(t,e);else if(Xn.is(t))Ty(t,e);else if(Ks.is(t)){let{item:n}=Ks.destruct(t);await qi(n,e)}else if(Zs.is(t)){let{path:n}=Zs.destruct(t);await _y(n,e)}else if(Qn.is(t))await Ry(t,e);else if(Gs.is(t)){let{items:n}=Gs.destruct(t);for(let i of n)await qi(i,e)}else if(Qs.is(t)){let{members:n}=Qs.destruct(t);for(let i of n)await qi(i,e)}let{appendixes:r}=Na.destruct(t);for(let n of r)if(Ws.is(n)){let{args:i}=Ws.destruct(n);for(let s of i)await qi(s,e)}}async function Q_(t,e){let{index:r,location:n}=Xs.destruct(t),i=V.toString(n,"full");e.symbols.query(e.doc,"mcdoc/dispatcher",i).enter({usage:{type:"reference",node:n,fullRange:t}});let{parallelIndices:s}=vn.destruct(r);for(let o of s)Hs.is(o)||e.symbols.query(e.doc,"mcdoc/dispatcher",i,Ya(o)).enter({usage:{type:"reference",node:o,fullRange:t}})}async function _y(t,e){for(let{identifiers:r,node:n,indexRight:i}of Py(t,e,{reportErrors:!0}))if(r?.length){if(i===1){let s=n0(r),o=oT(s,e);if(!o){e.err.report(C("mcdoc.binder.path.unknown-module",L(s)),t,2);return}await e.ensureBindingStarted(o)}e.symbols.query({doc:e.doc,node:n},"mcdoc",n0(r)).ifDeclared((s,o)=>o.enter({usage:{type:"reference",node:n,fullRange:t,skipRenaming:pt.is(n)}})).else(()=>{i===0&&e.err.report(C("mcdoc.binder.path.unknown-identifier",L(Ou(r,-1)),L(n0(r.slice(0,-1)))),t,2)})}}function Ty(t,e){let{block:r,identifier:n,keyword:i}=Xn.destruct(t),s=n?.symbol??i.symbol;if(s?.subcategory!=="enum")return;let o=e.symbols.query({doc:e.doc,node:t},"mcdoc",...s.path);Ir.assertDefined(o.symbol),eT(r,e,o)}function eT(t,e,r,n={}){let{fields:i}=B1.destruct(t);for(let s of i){let{identifier:o}=S1.destruct(s);r.member(o.value,u=>u.ifDeclared(a=>M1(e,a,o)).elseEnter({usage:{type:"definition",node:o,fullRange:s}}))}}async function tT(t,e){let{injection:r}=Ka.destruct(t);Ga.is(r)}async function Ry(t,e){let{block:r,identifier:n,keyword:i}=Qn.destruct(t),s=n?.symbol??i.symbol;if(s?.subcategory!=="struct")return;let o=e.symbols.query({doc:e.doc,node:t},"mcdoc",...s.path);Ir.assertDefined(o.symbol),await rT(r,e,o)}async function rT(t,e,r,n={}){let{fields:i}=T1.destruct(t);for(let s of i)if(Vi.is(s)){let{key:o,type:u}=Vi.destruct(s);Ys.is(o)||r.member(o.value,a=>a.ifDeclared(l=>M1(e,l,o)).elseEnter({usage:{type:"definition",node:o,fullRange:s}})),await qi(u,e)}else{let{type:o}=R1.destruct(s);await qi(o,e)}}async function nT(t,e){let{identifier:r,rhs:n,typeParams:i}=eo.destruct(t);r?.value&&n&&await qi(n,e)}async function iT(t,e){let{path:r}=P1.destruct(t);if(r)return _y(r,e)}function Vp(t){t.registerBinder("mcdoc:module",ky)}function M1(t,e,r,n={localeString:"mcdoc.binder.duplicated-declaration"}){t.err.report(C(n.localeString,L(e.identifier)),r,2,{related:[{location:He.getDeclaredLocation(e),message:C(`${n.localeString}.related`,L(e.identifier))}]})}function*Py(t,e,r={}){let{children:n,isAbsolute:i}=Js.destruct(t),s=i?[]:e.moduleIdentifier.slice(2).split("::");for(let[o,u]of n.entries()){switch(u.type){case"mcdoc:identifier":s.push(u.value);break;case"mcdoc:literal":if(s.length===0){r.reportErrors&&e.err.report(C("mcdoc.binder.path.super-from-root"),u);return}s.pop();break;default:Ir.assertNever(u)}yield{identifiers:s,node:u,index:o,indexRight:n.length-1-o}}}function sT(t,e,r={}){return Ou([...Py(t,e,r)],-1)?.identifiers}function oT(t,e){return e.symbols.global.mcdoc?.[t]?.definition?.[0]?.uri}function uT(t,e){return Object.values(e.symbols.global.mcdoc??{}).find(r=>r.subcategory==="module"&&r.definition?.some(n=>n.uri===t))?.identifier}function n0(t){return t?`::${t.join("::")}`:void 0}function kn(t,e){switch(t.type){case"mcdoc:enum":return Ny(t,e);case"mcdoc:struct":return Ly(t,e);case"mcdoc:type/any":return wT(t,e);case"mcdoc:type/boolean":return FT(t,e);case"mcdoc:type/dispatcher":return xT(t,e);case"mcdoc:type/list":return DT(t,e);case"mcdoc:type/literal":return vT(t,e);case"mcdoc:type/numeric_type":return ST(t,e);case"mcdoc:type/primitive_array":return _T(t,e);case"mcdoc:type/string":return TT(t,e);case"mcdoc:type/reference":return RT(t,e);case"mcdoc:type/tuple":return PT(t,e);case"mcdoc:type/union":return MT(t,e);default:return Ir.assertNever(t)}}function rr(t,e,r,n={}){let{attributes:i,appendixes:s}=Na.destruct(t),o=e;for(let u of s)if(vn.is(u)){if(n.skipFirstIndexBody){n.skipFirstIndexBody=!1;continue}o={kind:"indexed",child:o,parallelIndices:Oy(u,r)}}else o={kind:"concrete",child:o,typeArgs:dT(u,r)};return o=qp(o,i,r),o}function qp(t,e,r){for(let n of e)t={kind:"attributed",attribute:My(n,r),child:t};return t}function Hp(t,e){return aT(t.map(r=>My(r,e)))}function aT(t){return t.length?t:void 0}function My(t,e){let{name:r,value:n}=Wr.destruct(t);return{name:r.value,value:n&&Up(n,e)}}function Up(t,e){return t.type==="mcdoc:attribute/tree"?{kind:"tree",values:lT(t,e)}:kn(t,e)}function lT(t,e){let r={},{named:n,positional:i}=La.destruct(t);if(i){let{values:s}=Ia.destruct(i);for(let[o,u]of s.entries())r[o]=Up(u,e)}if(n){let{values:s}=$a.destruct(n);for(let{key:o,value:u}of s)r[o.value]=Up(u,e)}return r}function Oy(t,e){let{parallelIndices:r}=vn.destruct(t);return r.map(n=>cT(n,e))}function cT(t,e){return Oa.is(t)?fT(t,e):hT(t,e)}function fT(t,e){return{kind:"static",value:Ya(t)}}function hT(t,e){let{keys:r}=Hs.destruct(t);return{kind:"dynamic",accessor:r.map(Ya)}}function dT(t,e){let{args:r}=Ws.destruct(t);return r.map(n=>kn(n,e))}function Ny(t,e){let{block:r,enumKind:n,identifier:i}=Xn.destruct(t),s=i?.symbol??t.symbol;return s&&Za.is(s.data)&&s.data.typeDef.kind==="enum"?s.data.typeDef:rr(t,{kind:"enum",enumKind:n,values:pT(r,e)},e)}function pT(t,e){let{fields:r}=B1.destruct(t);return r.map(n=>mT(n,e))}function mT(t,e){let{attributes:r,identifier:n,value:i}=S1.destruct(t);return{attributes:Hp(r,e),identifier:n.value,value:gT(i,e)}}function gT(t,e){if(Yn.is(t)){let{value:r}=Yn.destruct(t);return r.value}return t.value}function Ly(t,e){let{block:r,identifier:n}=Qn.destruct(t),i=n?.symbol??t.symbol;return i&&Za.is(i.data)&&i.data.typeDef.kind==="struct"?i.data.typeDef:rr(t,{kind:"struct",fields:yT(r,e)},e)}function yT(t,e){let{fields:r}=T1.destruct(t);return r.map(n=>AT(n,e))}function AT(t,e){return Vi.is(t)?bT(t,e):ET(t,e)}function bT(t,e){let{attributes:r,key:n,type:i,isOptional:s}=Vi.destruct(t);return{kind:"pair",attributes:Hp(r,e),key:CT(n,e),type:kn(i,e),optional:s}}function CT(t,e){if(Ys.is(t)){let{type:r}=Ys.destruct(t);return kn(r,e)}else return Ya(t)}function ET(t,e){let{attributes:r,type:n}=R1.destruct(t);return{kind:"spread",attributes:Hp(r,e),type:kn(n,e)}}function wT(t,e){return rr(t,{kind:"any"},e)}function FT(t,e){return rr(t,{kind:"boolean"},e)}function xT(t,e){let{index:r,location:n}=Xs.destruct(t);return rr(t,{kind:"dispatcher",parallelIndices:Oy(r,e),registry:V.toString(n,"full")},e,{skipFirstIndexBody:!0})}function DT(t,e){let{item:r,lengthRange:n}=Ks.destruct(t);return rr(t,{kind:"list",item:kn(r,e),lengthRange:Ja(n,e)},e)}function Ja(t,e){if(!t)return;let{kind:r,min:n,max:i}=k1.is(t)?k1.destruct(t):ji.destruct(t);return{kind:r,min:n?.value,max:i?.value}}function vT(t,e){let{value:r}=za.destruct(t);return rr(t,{kind:"literal",value:kT(r,e)},e)}function kT(t,e){if(pt.is(t))return{kind:"boolean",value:t.value==="true"};if(Yn.is(t)){let{suffix:r,value:n}=Yn.destruct(t);return{kind:"number",value:n.value,suffix:BT(r,e)}}else return{kind:"string",value:t.value}}function BT(t,e){return t?.value?.toLowerCase()}function ST(t,e){let{numericKind:r,valueRange:n}=ja.destruct(t);return rr(t,{kind:r.value,valueRange:Ja(n,e)},e)}function _T(t,e){let{arrayKind:r,lengthRange:n,valueRange:i}=Ua.destruct(t);return rr(t,{kind:`${r.value}_array`,lengthRange:Ja(n,e),valueRange:Ja(i,e)},e)}function TT(t,e){let{lengthRange:r}=Va.destruct(t);return rr(t,{kind:"string",lengthRange:Ja(r,e)},e)}function RT(t,e){let{path:r}=Zs.destruct(t);return rr(t,{kind:"reference",path:n0(sT(r,e))},e)}function PT(t,e){let{items:r}=Gs.destruct(t);return rr(t,{kind:"tuple",items:r.map(n=>kn(n,e))},e)}function MT(t,e){let{members:r}=Qs.destruct(t);return rr(t,{kind:"union",members:r.map(n=>kn(n,e))},e)}function Ya(t){return V.is(t)?V.toString(t,"short"):t.value}var OT=t=>[Oe.create(t,"variable")],NT=t=>[Oe.create(t,t.colorTokenType??"literal")];function Iy(t){t.registerColorizer("mcdoc:literal",NT),t.registerColorizer("mcdoc:identifier",OT)}var zy=Object.freeze(["fallback","none","unknown"]),uU=Object.freeze({kind:"union",members:[]});var LT=Object.freeze(["b","s","l","f","d"]),jy=Object.freeze([...LT,"B","S","L","F","D"]),Kp=Object.freeze(["byte","short","int","long"]),s0=Object.freeze(["float","double"]),aU=Object.freeze([...Kp,...s0]),Gp=Object.freeze(["byte","int","long"]),lU=Object.freeze(Gp.map(t=>`${t}_array`)),i0;(function(t){function e(r){let n=s=>{if(!s)return"";let{kind:o,min:u,max:a}=s;return u===a?` @ ${u}`:` @ ${u??""}${Dy(o)}${a??""}`},i=s=>{let o=[];for(let u of Qe.toArray(s))u===void 0?o.push("()"):o.push(u.kind==="static"?`[${u.value}]`:`[[${u.accessor.map(a=>typeof a=="string"?a:a.keyword).join(".")}]]`);return`[${o.join(", ")}]`};if(r===void 0)return"";switch(r.kind){case"any":case"boolean":return r.kind;case"attributed":return`#[${r.attribute.name}${r.attribute.value?"=":""}] ${e(r.child)}`;case"byte":return`byte${n(r.valueRange)}`;case"byte_array":return`byte${n(r.valueRange)}[]${n(r.lengthRange)}`;case"concrete":return`${e(r.child)}${r.typeArgs.length?`<${r.typeArgs.map(e).join(", ")}>`:""}`;case"dispatcher":return`${r.registry??"spyglass:unknown"}[${i(r.parallelIndices)}]`;case"double":return`double${n(r.valueRange)}`;case"enum":return"";case"float":return`float${n(r.valueRange)}`;case"indexed":return`${e(r.child)}${i(r.parallelIndices)}`;case"int":return`int${n(r.valueRange)}`;case"int_array":return`int${n(r.valueRange)}[]${n(r.lengthRange)}`;case"list":return`[${e(r.item)}]${n(r.lengthRange)}`;case"literal":return`${r.value}`;case"long":return`long${n(r.valueRange)}`;case"long_array":return`long${n(r.valueRange)}[]${n(r.lengthRange)}`;case"reference":return r.path??"";case"short":return`short${n(r.valueRange)}`;case"string":return`string${n(r.lengthRange)}`;case"struct":return"";case"template":return`${e(r.child)}${r.typeParams.length?`<${r.typeParams.map(s=>`?${s.path}`).join(", ")}>`:""}`;case"tuple":return`[${r.items.map(s=>e(s)).join(",")}${r.items.length===1?",":""}]`;case"union":return`(${r.members.map(e).join(" | ")})`;case"unsafe":return"unsafe";default:return Ir.assertNever(r)}}t.toString=e})(i0||(i0={}));var mt;(function(t){t[t.Nah=0]="Nah",t[t.Assignable=1]="Assignable",t[t.StrictlyAssignable=3]="StrictlyAssignable"})(mt||(mt={}));var Xa=(t,e)=>{if(!e)return!0;if(!t)return!1;let{min:r,max:n}=t,{min:i,max:s}=e;return(i===void 0||r!==void 0&&r>=i)&&(s===void 0||n!==void 0&&n<=s)},N1=t=>{let e=new Set,r=n=>{for(let i of e){if((O1(n,i)&mt.StrictlyAssignable)===mt.StrictlyAssignable)return;(O1(i,n)&mt.StrictlyAssignable)===mt.StrictlyAssignable&&e.delete(i)}e.add(n)};for(let n of t.members)n.kind==="union"?N1(n).members.forEach(r):r(n);return{kind:"union",members:[...e]}};var IT=t=>(t=N1(t),t.members.length===1?t.members[0]:t),Qa=t=>({kind:"list",item:Wp(t.item),...t.lengthRange?{lengthRange:{...t.lengthRange}}:{}}),Wp=t=>(t.kind==="union"?t=IT(t):t.kind==="list"&&(t=Qa(t)),t),O1=(t,e,r=[])=>{let n=o=>o?mt.StrictlyAssignable:mt.Nah,i=o=>o?mt.Assignable:mt.Nah,s;return t=Wp(t),e=Wp(e),t.kind==="any"||t.kind==="reference"||e.kind==="reference"?s=mt.Assignable:e.kind==="any"?s=mt.StrictlyAssignable:t.kind==="union"?s=i(t.members.every(o=>O1(o,e,r))):e.kind==="union"?s=i(e.members.some(o=>O1(t,o))):t.kind==="boolean"?s=n(e.kind==="boolean"||e.kind==="byte"):t.kind==="byte"?e.kind==="boolean"?s=O1(t,{kind:"byte",valueRange:{kind:0,min:0,max:1}},r):e.kind==="byte"?s=n(Xa(t.valueRange,e.valueRange)):e.kind==="enum"?s=i(!e.enumKind||e.enumKind==="byte"):s=mt.Nah:t.kind==="byte_array"||t.kind==="int_array"||t.kind==="long_array"?s=n(e.kind===t.kind&&Xa(t.lengthRange,e.lengthRange)&&Xa(t.valueRange,e.valueRange)):t.kind==="struct"||t.kind==="dispatcher"?s=i(e.kind==="struct"||e.kind==="dispatcher"):t.kind==="enum"?s=i((e.kind==="byte"||e.kind==="float"||e.kind==="double"||e.kind==="int"||e.kind==="long"||e.kind==="short"||e.kind==="string")&&(!t.enumKind||t.enumKind===e.kind)):t.kind==="float"||t.kind==="double"||t.kind==="int"||t.kind==="long"||t.kind==="short"?e.kind===t.kind?s=n(Xa(t.valueRange,e.valueRange)):e.kind==="enum"?s=i(!e.enumKind||e.enumKind===t.kind):s=mt.Nah:t.kind==="list"?e.kind==="list"&&Xa(t.lengthRange,e.lengthRange)?s=O1(t.item,e.item,r):s=mt.Nah:t.kind==="string"?e.kind==="string"?s=mt.StrictlyAssignable:s=i(e.kind==="enum"&&(!e.enumKind||e.enumKind==="string")):s=mt.Nah,s||r.push(C("mcdoc.checker.type-not-assignable",L(i0.toString(t)),L(i0.toString(e)))),s};var Zy=E1(da({singleLinePrefixes:new Set(["//"])}),(t,e)=>!e.slice(t).startsWith("///"),C("mcdoc.parser.syntax.doc-comment-unexpected"));function Jy(t=!1){return(e,r)=>{let n=[];for(e.skipWhitespace();e.canRead()&&e.peek(2)==="//"&&(!t||e.peek(3)!=="///");){let i=Zy(e,r);n.push(i),e.skipWhitespace()}return n}}function j(t,e=!1){return(r,n)=>{r.skipWhitespace();let i=Be(t,Jy(e))(r,n);return r.skipWhitespace(),i}}function Zr(t,e=!1){return C1(t,Jy(e))}function Gr(t,e){return(r,n)=>{let i={type:"mcdoc:literal",range:b.create(r),value:"",colorTokenType:e?.colorTokenType};return i.value=r.readIf(s=>e?.allowedChars?.has(s)??(e?.specialChars?.has(s)||/[a-z]/i.test(s))),i.range.end=r.cursor,Qe.toArray(t).every(s=>s!==i.value)&&n.err.report(C("expected-got",gs(t),L(i.value)),i),i}}function qt(t,e={colorTokenType:"keyword"}){return(r,n)=>{let i=Gr(t,e)(r,n);return Qe.toArray(t).includes(i.value)?i:W}}function ne(t){return(e,r)=>{e.skipWhitespace(),e.trySkip(t)||r.err.report(C("expected-got",L(t),L(e.peek())),e)}}function Ae(t){return(e,r)=>{if(e.skipWhitespace(),!e.trySkip(t))return W}}function Zp(t){return E1(et(t),e=>e.namespace!==void 0,C("mcdoc.parser.resource-location.colon-expected",L(ee.NamespacePathSep)))}var $T=Object.freeze(["\0","","","","","","","\x07","\b"," ",` +`,"=",",",'"',"'","{","}","[","]","(",")",";"]),e5=new Set(["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","0","1","2","3","4","5","6","7","8","9","_","-","."]);function et(t){return(e,r)=>{let n={type:"resource_location",range:b.create(e),options:t};e.trySkip(ee.TagPrefix)&&(n.isTag=!0);let i=e.cursor;for(;e.canReadInLine()&&!Kk.has(e.peek());)e.skip();let s=e.sliceToCursor(i);if(n.range.end=e.cursor,s.length===0)r.err.report(C("expected",C("resource-location")),n);else{let o=s.indexOf(t.namespacePathSep??ee.NamespacePathSep);o>=0&&(n.namespace=s.slice(0,o));let u=s.slice(o+1);n.path=u.split(ee.PathSep);let a=[...new Set([...[...n.namespace??[]].filter(l=>!e5.has(l)),...[...u].filter(l=>l!=="/"&&!e5.has(l))])];a.length&&r.err.report(C("parser.resource-location.illegal",gs(a,!0,"and")),n),n.isTag&&!t.allowTag&&r.err.report(C("parser.resource-location.tag-disallowed"),n),!n.namespace&&t.isPredicate&&r.err.report(C("parser.resource-location.namespace-expected"),n)}return n}}function Ft(t){return(e,r)=>{let n={type:"string",range:b.create(e),options:t,value:"",valueMap:[]},i=e.cursor;if(t.quotes?.length&&(e.peek()==='"'||e.peek()==="'")){let s=e.read(),o=e.cursor;for(;e.canRead()&&e.peek()!==s;){let u=e.peek();if(t.escapable&&u==="\\"){let a=e.cursor;e.skip();let l=e.read();if(l==="\\"||l===s||ff.is(t.escapable.characters,l))n.valueMap.push({inner:b.create(n.value.length,n.value.length+1),outer:b.create(a,e)}),n.value+=c8.get(l);else if(t.escapable.unicode&&l==="u"){let c=e.peek(4);/^[0-9a-f]{4}$/i.test(c)?(e.skip(4),n.valueMap.push({inner:b.create(n.value.length,n.value.length+1),outer:b.create(a,e)}),n.value+=String.fromCharCode(parseInt(c,16))):(r.err.report(C("parser.string.illegal-unicode-escape"),b.create(e,e.getCharRange(3).end)),n.valueMap.push({inner:b.create(n.value.length,n.value.length+1),outer:b.create(a,e)}),n.value+=l)}else t.escapable.allowUnknown||r.err.report(C("parser.string.illegal-escape",L(l)),e.getCharRange(-1)),n.valueMap.push({inner:b.create(n.value.length,n.value.length+1),outer:b.create(a,e)}),n.value+=l}else e.skip(),n.value+=u}e.trySkip(s)||r.err.report(C("expected",L(s)),e),t.quotes.includes(s)||r.err.report(C("parser.string.illegal-quote",t.quotes),n),i=o}else if(t.unquotable){for(;e.canRead()&&Gd(e.peek(),t.unquotable);)n.value+=e.read();!n.value&&!t.unquotable.allowEmpty&&r.err.report(C("expected",C("string")),e)}else r.err.report(C("expected",t.quotes),e);if(n.valueMap.unshift({inner:b.create(0),outer:b.create(i)}),t.value?.parser){let s=np(t.value.parser,n.value,n.valueMap,r);s!==W&&(n.children=[s])}return n.range.end=e.cursor,n}}function np(t,e,r,n){let i=new ke(e,r),s={...n,doc:pn.create(n.doc.uri,n.doc.languageId,n.doc.version,e)};return t(i,s)}var Gk=Object.freeze(["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","_",".","+","-"]),Zk=new Set(Gk),t5=/^[0-9A-Za-z_\.\+\-]*$/,ma={allowEmpty:!0,allowList:Zk},Pi={escapable:{},quotes:['"',"'"],unquotable:ma},Ns=Ft(Pi);function Gd(t,e){return e.allowList?.has(t)??!e.blockList?.has(t)}function r5(t){let e=Jk(t);return(r,n)=>{let i={type:"symbol",range:b.create(r),options:e,value:r.readRemaining()};return i.range.end=r.cursor,i}}function Jk(t){return typeof t=="string"?{category:t}:t}var e0=ei(i5(),1);function D1(t){let e=t.length;for(;--e>=0;)t[e]=0}var Yk=0,V5=1,Xk=2,Qk=3,eB=258,wp=29,_a=256,wa=_a+1+wp,x1=30,Fp=19,q5=2*wa+1,Ls=15,ip=16,tB=7,xp=256,H5=16,W5=17,K5=18,Ap=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),Uf=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),rB=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),G5=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),nB=512,Zn=new Array((wa+2)*2);D1(Zn);var ba=new Array(x1*2);D1(ba);var Fa=new Array(nB);D1(Fa);var xa=new Array(eB-Qk+1);D1(xa);var Dp=new Array(wp);D1(Dp);var Wf=new Array(x1);D1(Wf);function sp(t,e,r,n,i){this.static_tree=t,this.extra_bits=e,this.extra_base=r,this.elems=n,this.max_length=i,this.has_stree=t&&t.length}var Z5,J5,Y5;function op(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}var X5=t=>t<256?Fa[t]:Fa[256+(t>>>7)],Da=(t,e)=>{t.pending_buf[t.pending++]=e&255,t.pending_buf[t.pending++]=e>>>8&255},jt=(t,e,r)=>{t.bi_valid>ip-r?(t.bi_buf|=e<>ip-t.bi_valid,t.bi_valid+=r-ip):(t.bi_buf|=e<{jt(t,r[e*2],r[e*2+1])},Q5=(t,e)=>{let r=0;do r|=t&1,t>>>=1,r<<=1;while(--e>0);return r>>>1},iB=t=>{t.bi_valid===16?(Da(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=t.bi_buf&255,t.bi_buf>>=8,t.bi_valid-=8)},sB=(t,e)=>{let r=e.dyn_tree,n=e.max_code,i=e.stat_desc.static_tree,s=e.stat_desc.has_stree,o=e.stat_desc.extra_bits,u=e.stat_desc.extra_base,a=e.stat_desc.max_length,l,c,f,h,d,p,y=0;for(h=0;h<=Ls;h++)t.bl_count[h]=0;for(r[t.heap[t.heap_max]*2+1]=0,l=t.heap_max+1;la&&(h=a,y++),r[c*2+1]=h,!(c>n)&&(t.bl_count[h]++,d=0,c>=u&&(d=o[c-u]),p=r[c*2],t.opt_len+=p*(h+d),s&&(t.static_len+=p*(i[c*2+1]+d)));if(y!==0){do{for(h=a-1;t.bl_count[h]===0;)h--;t.bl_count[h]--,t.bl_count[h+1]+=2,t.bl_count[a]--,y-=2}while(y>0);for(h=a;h!==0;h--)for(c=t.bl_count[h];c!==0;)f=t.heap[--l],!(f>n)&&(r[f*2+1]!==h&&(t.opt_len+=(h-r[f*2+1])*r[f*2],r[f*2+1]=h),c--)}},ey=(t,e,r)=>{let n=new Array(Ls+1),i=0,s,o;for(s=1;s<=Ls;s++)n[s]=i=i+r[s-1]<<1;for(o=0;o<=e;o++){let u=t[o*2+1];u!==0&&(t[o*2]=Q5(n[u]++,u))}},oB=()=>{let t,e,r,n,i,s=new Array(Ls+1);for(r=0,n=0;n>=7;n{let e;for(e=0;e{t.bi_valid>8?Da(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0},uB=(t,e,r,n)=>{ry(t),n&&(Da(t,r),Da(t,~r)),t.pending_buf.set(t.window.subarray(e,e+r),t.pending),t.pending+=r},s5=(t,e,r,n)=>{let i=e*2,s=r*2;return t[i]{let n=t.heap[r],i=r<<1;for(;i<=t.heap_len&&(i{let n,i,s=0,o,u;if(t.last_lit!==0)do n=t.pending_buf[t.d_buf+s*2]<<8|t.pending_buf[t.d_buf+s*2+1],i=t.pending_buf[t.l_buf+s],s++,n===0?Fn(t,i,e):(o=xa[i],Fn(t,o+_a+1,e),u=Ap[o],u!==0&&(i-=Dp[o],jt(t,i,u)),n--,o=X5(n),Fn(t,o,r),u=Uf[o],u!==0&&(n-=Wf[o],jt(t,n,u)));while(s{let r=e.dyn_tree,n=e.stat_desc.static_tree,i=e.stat_desc.has_stree,s=e.stat_desc.elems,o,u,a=-1,l;for(t.heap_len=0,t.heap_max=q5,o=0;o>1;o>=1;o--)up(t,r,o);l=s;do o=t.heap[1],t.heap[1]=t.heap[t.heap_len--],up(t,r,1),u=t.heap[1],t.heap[--t.heap_max]=o,t.heap[--t.heap_max]=u,r[l*2]=r[o*2]+r[u*2],t.depth[l]=(t.depth[o]>=t.depth[u]?t.depth[o]:t.depth[u])+1,r[o*2+1]=r[u*2+1]=l,t.heap[1]=l++,up(t,r,1);while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],sB(t,e),ey(r,a,t.bl_count)},u5=(t,e,r)=>{let n,i=-1,s,o=e[0*2+1],u=0,a=7,l=4;for(o===0&&(a=138,l=3),e[(r+1)*2+1]=65535,n=0;n<=r;n++)s=o,o=e[(n+1)*2+1],!(++u{let n,i=-1,s,o=e[0*2+1],u=0,a=7,l=4;for(o===0&&(a=138,l=3),n=0;n<=r;n++)if(s=o,o=e[(n+1)*2+1],!(++u{let e;for(u5(t,t.dyn_ltree,t.l_desc.max_code),u5(t,t.dyn_dtree,t.d_desc.max_code),bp(t,t.bl_desc),e=Fp-1;e>=3&&t.bl_tree[G5[e]*2+1]===0;e--);return t.opt_len+=3*(e+1)+5+5+4,e},lB=(t,e,r,n)=>{let i;for(jt(t,e-257,5),jt(t,r-1,5),jt(t,n-4,4),i=0;i{let e=4093624447,r;for(r=0;r<=31;r++,e>>>=1)if(e&1&&t.dyn_ltree[r*2]!==0)return 0;if(t.dyn_ltree[9*2]!==0||t.dyn_ltree[10*2]!==0||t.dyn_ltree[13*2]!==0)return 1;for(r=32;r<_a;r++)if(t.dyn_ltree[r*2]!==0)return 1;return 0},l5=!1,fB=t=>{l5||(oB(),l5=!0),t.l_desc=new op(t.dyn_ltree,Z5),t.d_desc=new op(t.dyn_dtree,J5),t.bl_desc=new op(t.bl_tree,Y5),t.bi_buf=0,t.bi_valid=0,ty(t)},ny=(t,e,r,n)=>{jt(t,(Yk<<1)+(n?1:0),3),uB(t,e,r,!0)},hB=t=>{jt(t,V5<<1,3),Fn(t,xp,Zn),iB(t)},dB=(t,e,r,n)=>{let i,s,o=0;t.level>0?(t.strm.data_type===2&&(t.strm.data_type=cB(t)),bp(t,t.l_desc),bp(t,t.d_desc),o=aB(t),i=t.opt_len+3+7>>>3,s=t.static_len+3+7>>>3,s<=i&&(i=s)):i=s=r+5,r+4<=i&&e!==-1?ny(t,e,r,n):t.strategy===4||s===i?(jt(t,(V5<<1)+(n?1:0),3),o5(t,Zn,ba)):(jt(t,(Xk<<1)+(n?1:0),3),lB(t,t.l_desc.max_code+1,t.d_desc.max_code+1,o+1),o5(t,t.dyn_ltree,t.dyn_dtree)),ty(t),n&&ry(t)},pB=(t,e,r)=>(t.pending_buf[t.d_buf+t.last_lit*2]=e>>>8&255,t.pending_buf[t.d_buf+t.last_lit*2+1]=e&255,t.pending_buf[t.l_buf+t.last_lit]=r&255,t.last_lit++,e===0?t.dyn_ltree[r*2]++:(t.matches++,e--,t.dyn_ltree[(xa[r]+_a+1)*2]++,t.dyn_dtree[X5(e)*2]++),t.last_lit===t.lit_bufsize-1),mB=fB,gB=ny,yB=dB,AB=pB,bB=hB,CB={_tr_init:mB,_tr_stored_block:gB,_tr_flush_block:yB,_tr_tally:AB,_tr_align:bB},EB=(t,e,r,n)=>{let i=t&65535|0,s=t>>>16&65535|0,o=0;for(;r!==0;){o=r>2e3?2e3:r,r-=o;do i=i+e[n++]|0,s=s+i|0;while(--o);i%=65521,s%=65521}return i|s<<16|0},va=EB,wB=()=>{let t,e=[];for(var r=0;r<256;r++){t=r;for(var n=0;n<8;n++)t=t&1?3988292384^t>>>1:t>>>1;e[r]=t}return e},FB=new Uint32Array(wB()),xB=(t,e,r,n)=>{let i=FB,s=n+r;t^=-1;for(let o=n;o>>8^i[(t^e[o])&255];return t^-1},st=xB,$s={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},Vs={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8},{_tr_init:DB,_tr_stored_block:vB,_tr_flush_block:kB,_tr_tally:Ii,_tr_align:BB}=CB,{Z_NO_FLUSH:qs,Z_PARTIAL_FLUSH:SB,Z_FULL_FLUSH:_B,Z_FINISH:$i,Z_BLOCK:c5,Z_OK:xn,Z_STREAM_END:f5,Z_STREAM_ERROR:xr,Z_DATA_ERROR:TB,Z_BUF_ERROR:ap,Z_DEFAULT_COMPRESSION:RB,Z_FILTERED:PB,Z_HUFFMAN_ONLY:Lf,Z_RLE:MB,Z_FIXED:OB,Z_DEFAULT_STRATEGY:NB,Z_UNKNOWN:LB,Z_DEFLATED:Zf}=Vs,IB=9,$B=15,zB=8,jB=29,UB=256,Cp=UB+1+jB,VB=30,qB=19,HB=2*Cp+1,WB=15,re=3,Ni=258,Hr=Ni+re+1,KB=32,Jf=42,Ep=69,Vf=73,qf=91,Hf=103,Is=113,ya=666,tt=1,Ta=2,zs=3,v1=4,GB=3,Li=(t,e)=>(t.msg=$s[e],e),h5=t=>(t<<1)-(t>4?9:0),Oi=t=>{let e=t.length;for(;--e>=0;)t[e]=0},ZB=(t,e,r)=>(e<{let e=t.state,r=e.pending;r>t.avail_out&&(r=t.avail_out),r!==0&&(t.output.set(e.pending_buf.subarray(e.pending_out,e.pending_out+r),t.next_out),t.next_out+=r,e.pending_out+=r,t.total_out+=r,t.avail_out-=r,e.pending-=r,e.pending===0&&(e.pending_out=0))},dt=(t,e)=>{kB(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,Mi(t.strm)},ce=(t,e)=>{t.pending_buf[t.pending++]=e},ga=(t,e)=>{t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=e&255},JB=(t,e,r,n)=>{let i=t.avail_in;return i>n&&(i=n),i===0?0:(t.avail_in-=i,e.set(t.input.subarray(t.next_in,t.next_in+i),r),t.state.wrap===1?t.adler=va(t.adler,e,i,r):t.state.wrap===2&&(t.adler=st(t.adler,e,i,r)),t.next_in+=i,t.total_in+=i,i)},iy=(t,e)=>{let r=t.max_chain_length,n=t.strstart,i,s,o=t.prev_length,u=t.nice_match,a=t.strstart>t.w_size-Hr?t.strstart-(t.w_size-Hr):0,l=t.window,c=t.w_mask,f=t.prev,h=t.strstart+Ni,d=l[n+o-1],p=l[n+o];t.prev_length>=t.good_match&&(r>>=2),u>t.lookahead&&(u=t.lookahead);do if(i=e,!(l[i+o]!==p||l[i+o-1]!==d||l[i]!==l[n]||l[++i]!==l[n+1])){n+=2,i++;do;while(l[++n]===l[++i]&&l[++n]===l[++i]&&l[++n]===l[++i]&&l[++n]===l[++i]&&l[++n]===l[++i]&&l[++n]===l[++i]&&l[++n]===l[++i]&&l[++n]===l[++i]&&no){if(t.match_start=e,o=s,s>=u)break;d=l[n+o-1],p=l[n+o]}}while((e=f[e&c])>a&&--r!==0);return o<=t.lookahead?o:t.lookahead},js=t=>{let e=t.w_size,r,n,i,s,o;do{if(s=t.window_size-t.lookahead-t.strstart,t.strstart>=e+(e-Hr)){t.window.set(t.window.subarray(e,e+e),0),t.match_start-=e,t.strstart-=e,t.block_start-=e,n=t.hash_size,r=n;do i=t.head[--r],t.head[r]=i>=e?i-e:0;while(--n);n=e,r=n;do i=t.prev[--r],t.prev[r]=i>=e?i-e:0;while(--n);s+=e}if(t.strm.avail_in===0)break;if(n=JB(t.strm,t.window,t.strstart+t.lookahead,s),t.lookahead+=n,t.lookahead+t.insert>=re)for(o=t.strstart-t.insert,t.ins_h=t.window[o],t.ins_h=zi(t,t.ins_h,t.window[o+1]);t.insert&&(t.ins_h=zi(t,t.ins_h,t.window[o+re-1]),t.prev[o&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=o,o++,t.insert--,!(t.lookahead+t.insert{let r=65535;for(r>t.pending_buf_size-5&&(r=t.pending_buf_size-5);;){if(t.lookahead<=1){if(js(t),t.lookahead===0&&e===qs)return tt;if(t.lookahead===0)break}t.strstart+=t.lookahead,t.lookahead=0;let n=t.block_start+r;if((t.strstart===0||t.strstart>=n)&&(t.lookahead=t.strstart-n,t.strstart=n,dt(t,!1),t.strm.avail_out===0)||t.strstart-t.block_start>=t.w_size-Hr&&(dt(t,!1),t.strm.avail_out===0))return tt}return t.insert=0,e===$i?(dt(t,!0),t.strm.avail_out===0?zs:v1):(t.strstart>t.block_start&&(dt(t,!1),t.strm.avail_out===0),tt)},lp=(t,e)=>{let r,n;for(;;){if(t.lookahead=re&&(t.ins_h=zi(t,t.ins_h,t.window[t.strstart+re-1]),r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),r!==0&&t.strstart-r<=t.w_size-Hr&&(t.match_length=iy(t,r)),t.match_length>=re)if(n=Ii(t,t.strstart-t.match_start,t.match_length-re),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=re){t.match_length--;do t.strstart++,t.ins_h=zi(t,t.ins_h,t.window[t.strstart+re-1]),r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart;while(--t.match_length!==0);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=zi(t,t.ins_h,t.window[t.strstart+1]);else n=Ii(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(n&&(dt(t,!1),t.strm.avail_out===0))return tt}return t.insert=t.strstart{let r,n,i;for(;;){if(t.lookahead=re&&(t.ins_h=zi(t,t.ins_h,t.window[t.strstart+re-1]),r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=re-1,r!==0&&t.prev_length4096)&&(t.match_length=re-1)),t.prev_length>=re&&t.match_length<=t.prev_length){i=t.strstart+t.lookahead-re,n=Ii(t,t.strstart-1-t.prev_match,t.prev_length-re),t.lookahead-=t.prev_length-1,t.prev_length-=2;do++t.strstart<=i&&(t.ins_h=zi(t,t.ins_h,t.window[t.strstart+re-1]),r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart);while(--t.prev_length!==0);if(t.match_available=0,t.match_length=re-1,t.strstart++,n&&(dt(t,!1),t.strm.avail_out===0))return tt}else if(t.match_available){if(n=Ii(t,0,t.window[t.strstart-1]),n&&dt(t,!1),t.strstart++,t.lookahead--,t.strm.avail_out===0)return tt}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(n=Ii(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart{let r,n,i,s,o=t.window;for(;;){if(t.lookahead<=Ni){if(js(t),t.lookahead<=Ni&&e===qs)return tt;if(t.lookahead===0)break}if(t.match_length=0,t.lookahead>=re&&t.strstart>0&&(i=t.strstart-1,n=o[i],n===o[++i]&&n===o[++i]&&n===o[++i])){s=t.strstart+Ni;do;while(n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&it.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=re?(r=Ii(t,1,t.match_length-re),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(r=Ii(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),r&&(dt(t,!1),t.strm.avail_out===0))return tt}return t.insert=0,e===$i?(dt(t,!0),t.strm.avail_out===0?zs:v1):t.last_lit&&(dt(t,!1),t.strm.avail_out===0)?tt:Ta},QB=(t,e)=>{let r;for(;;){if(t.lookahead===0&&(js(t),t.lookahead===0)){if(e===qs)return tt;break}if(t.match_length=0,r=Ii(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,r&&(dt(t,!1),t.strm.avail_out===0))return tt}return t.insert=0,e===$i?(dt(t,!0),t.strm.avail_out===0?zs:v1):t.last_lit&&(dt(t,!1),t.strm.avail_out===0)?tt:Ta};function wn(t,e,r,n,i){this.good_length=t,this.max_lazy=e,this.nice_length=r,this.max_chain=n,this.func=i}var Aa=[new wn(0,0,0,0,YB),new wn(4,4,8,4,lp),new wn(4,5,16,8,lp),new wn(4,6,32,32,lp),new wn(4,4,16,16,w1),new wn(8,16,32,32,w1),new wn(8,16,128,128,w1),new wn(8,32,128,256,w1),new wn(32,128,258,1024,w1),new wn(32,258,258,4096,w1)],eS=t=>{t.window_size=2*t.w_size,Oi(t.head),t.max_lazy_match=Aa[t.level].max_lazy,t.good_match=Aa[t.level].good_length,t.nice_match=Aa[t.level].nice_length,t.max_chain_length=Aa[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=re-1,t.match_available=0,t.ins_h=0};function tS(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=Zf,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(HB*2),this.dyn_dtree=new Uint16Array((2*VB+1)*2),this.bl_tree=new Uint16Array((2*qB+1)*2),Oi(this.dyn_ltree),Oi(this.dyn_dtree),Oi(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(WB+1),this.heap=new Uint16Array(2*Cp+1),Oi(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(2*Cp+1),Oi(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}var sy=t=>{if(!t||!t.state)return Li(t,xr);t.total_in=t.total_out=0,t.data_type=LB;let e=t.state;return e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?Jf:Is,t.adler=e.wrap===2?0:1,e.last_flush=qs,DB(e),xn},oy=t=>{let e=sy(t);return e===xn&&eS(t.state),e},rS=(t,e)=>!t||!t.state||t.state.wrap!==2?xr:(t.state.gzhead=e,xn),uy=(t,e,r,n,i,s)=>{if(!t)return xr;let o=1;if(e===RB&&(e=6),n<0?(o=0,n=-n):n>15&&(o=2,n-=16),i<1||i>IB||r!==Zf||n<8||n>15||e<0||e>9||s<0||s>OB)return Li(t,xr);n===8&&(n=9);let u=new tS;return t.state=u,u.strm=t,u.wrap=o,u.gzhead=null,u.w_bits=n,u.w_size=1<uy(t,e,Zf,$B,zB,NB),iS=(t,e)=>{let r,n;if(!t||!t.state||e>c5||e<0)return t?Li(t,xr):xr;let i=t.state;if(!t.output||!t.input&&t.avail_in!==0||i.status===ya&&e!==$i)return Li(t,t.avail_out===0?ap:xr);i.strm=t;let s=i.last_flush;if(i.last_flush=e,i.status===Jf)if(i.wrap===2)t.adler=0,ce(i,31),ce(i,139),ce(i,8),i.gzhead?(ce(i,(i.gzhead.text?1:0)+(i.gzhead.hcrc?2:0)+(i.gzhead.extra?4:0)+(i.gzhead.name?8:0)+(i.gzhead.comment?16:0)),ce(i,i.gzhead.time&255),ce(i,i.gzhead.time>>8&255),ce(i,i.gzhead.time>>16&255),ce(i,i.gzhead.time>>24&255),ce(i,i.level===9?2:i.strategy>=Lf||i.level<2?4:0),ce(i,i.gzhead.os&255),i.gzhead.extra&&i.gzhead.extra.length&&(ce(i,i.gzhead.extra.length&255),ce(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(t.adler=st(t.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=Ep):(ce(i,0),ce(i,0),ce(i,0),ce(i,0),ce(i,0),ce(i,i.level===9?2:i.strategy>=Lf||i.level<2?4:0),ce(i,GB),i.status=Is);else{let o=Zf+(i.w_bits-8<<4)<<8,u=-1;i.strategy>=Lf||i.level<2?u=0:i.level<6?u=1:i.level===6?u=2:u=3,o|=u<<6,i.strstart!==0&&(o|=KB),o+=31-o%31,i.status=Is,ga(i,o),i.strstart!==0&&(ga(i,t.adler>>>16),ga(i,t.adler&65535)),t.adler=1}if(i.status===Ep)if(i.gzhead.extra){for(r=i.pending;i.gzindex<(i.gzhead.extra.length&65535)&&!(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>r&&(t.adler=st(t.adler,i.pending_buf,i.pending-r,r)),Mi(t),r=i.pending,i.pending===i.pending_buf_size));)ce(i,i.gzhead.extra[i.gzindex]&255),i.gzindex++;i.gzhead.hcrc&&i.pending>r&&(t.adler=st(t.adler,i.pending_buf,i.pending-r,r)),i.gzindex===i.gzhead.extra.length&&(i.gzindex=0,i.status=Vf)}else i.status=Vf;if(i.status===Vf)if(i.gzhead.name){r=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>r&&(t.adler=st(t.adler,i.pending_buf,i.pending-r,r)),Mi(t),r=i.pending,i.pending===i.pending_buf_size)){n=1;break}i.gzindexr&&(t.adler=st(t.adler,i.pending_buf,i.pending-r,r)),n===0&&(i.gzindex=0,i.status=qf)}else i.status=qf;if(i.status===qf)if(i.gzhead.comment){r=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>r&&(t.adler=st(t.adler,i.pending_buf,i.pending-r,r)),Mi(t),r=i.pending,i.pending===i.pending_buf_size)){n=1;break}i.gzindexr&&(t.adler=st(t.adler,i.pending_buf,i.pending-r,r)),n===0&&(i.status=Hf)}else i.status=Hf;if(i.status===Hf&&(i.gzhead.hcrc?(i.pending+2>i.pending_buf_size&&Mi(t),i.pending+2<=i.pending_buf_size&&(ce(i,t.adler&255),ce(i,t.adler>>8&255),t.adler=0,i.status=Is)):i.status=Is),i.pending!==0){if(Mi(t),t.avail_out===0)return i.last_flush=-1,xn}else if(t.avail_in===0&&h5(e)<=h5(s)&&e!==$i)return Li(t,ap);if(i.status===ya&&t.avail_in!==0)return Li(t,ap);if(t.avail_in!==0||i.lookahead!==0||e!==qs&&i.status!==ya){let o=i.strategy===Lf?QB(i,e):i.strategy===MB?XB(i,e):Aa[i.level].func(i,e);if((o===zs||o===v1)&&(i.status=ya),o===tt||o===zs)return t.avail_out===0&&(i.last_flush=-1),xn;if(o===Ta&&(e===SB?BB(i):e!==c5&&(vB(i,0,0,!1),e===_B&&(Oi(i.head),i.lookahead===0&&(i.strstart=0,i.block_start=0,i.insert=0))),Mi(t),t.avail_out===0))return i.last_flush=-1,xn}return e!==$i?xn:i.wrap<=0?f5:(i.wrap===2?(ce(i,t.adler&255),ce(i,t.adler>>8&255),ce(i,t.adler>>16&255),ce(i,t.adler>>24&255),ce(i,t.total_in&255),ce(i,t.total_in>>8&255),ce(i,t.total_in>>16&255),ce(i,t.total_in>>24&255)):(ga(i,t.adler>>>16),ga(i,t.adler&65535)),Mi(t),i.wrap>0&&(i.wrap=-i.wrap),i.pending!==0?xn:f5)},sS=t=>{if(!t||!t.state)return xr;let e=t.state.status;return e!==Jf&&e!==Ep&&e!==Vf&&e!==qf&&e!==Hf&&e!==Is&&e!==ya?Li(t,xr):(t.state=null,e===Is?Li(t,TB):xn)},oS=(t,e)=>{let r=e.length;if(!t||!t.state)return xr;let n=t.state,i=n.wrap;if(i===2||i===1&&n.status!==Jf||n.lookahead)return xr;if(i===1&&(t.adler=va(t.adler,e,r,0)),n.wrap=0,r>=n.w_size){i===0&&(Oi(n.head),n.strstart=0,n.block_start=0,n.insert=0);let a=new Uint8Array(n.w_size);a.set(e.subarray(r-n.w_size,r),0),e=a,r=n.w_size}let s=t.avail_in,o=t.next_in,u=t.input;for(t.avail_in=r,t.next_in=0,t.input=e,js(n);n.lookahead>=re;){let a=n.strstart,l=n.lookahead-(re-1);do n.ins_h=zi(n,n.ins_h,n.window[a+re-1]),n.prev[a&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=a,a++;while(--l);n.strstart=a,n.lookahead=re-1,js(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=re-1,n.match_available=0,t.next_in=o,t.input=u,t.avail_in=s,n.wrap=i,xn},uS=nS,aS=uy,lS=oy,cS=sy,fS=rS,hS=iS,dS=sS,pS=oS,mS="pako deflate (from Nodeca project)",Ca={deflateInit:uS,deflateInit2:aS,deflateReset:lS,deflateResetKeep:cS,deflateSetHeader:fS,deflate:hS,deflateEnd:dS,deflateSetDictionary:pS,deflateInfo:mS},gS=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),yS=function(t){let e=Array.prototype.slice.call(arguments,1);for(;e.length;){let r=e.shift();if(r){if(typeof r!="object")throw new TypeError(r+"must be non-object");for(let n in r)gS(r,n)&&(t[n]=r[n])}}return t},AS=t=>{let e=0;for(let n=0,i=t.length;n=252?6:t>=248?5:t>=240?4:t>=224?3:t>=192?2:1;ka[254]=ka[254]=1;var bS=t=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(t);let e,r,n,i,s,o=t.length,u=0;for(i=0;i>>6,e[s++]=128|r&63):r<65536?(e[s++]=224|r>>>12,e[s++]=128|r>>>6&63,e[s++]=128|r&63):(e[s++]=240|r>>>18,e[s++]=128|r>>>12&63,e[s++]=128|r>>>6&63,e[s++]=128|r&63);return e},CS=(t,e)=>{if(e<65534&&t.subarray&&ay)return String.fromCharCode.apply(null,t.length===e?t:t.subarray(0,e));let r="";for(let n=0;n{let r=e||t.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(t.subarray(0,e));let n,i,s=new Array(r*2);for(i=0,n=0;n4){s[i++]=65533,n+=u-1;continue}for(o&=u===2?31:u===3?15:7;u>1&&n1){s[i++]=65533;continue}o<65536?s[i++]=o:(o-=65536,s[i++]=55296|o>>10&1023,s[i++]=56320|o&1023)}return CS(s,i)},wS=(t,e)=>{e=e||t.length,e>t.length&&(e=t.length);let r=e-1;for(;r>=0&&(t[r]&192)===128;)r--;return r<0||r===0?e:r+ka[t[r]]>e?r:e},Ba={string2buf:bS,buf2string:ES,utf8border:wS};function FS(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}var ly=FS,cy=Object.prototype.toString,{Z_NO_FLUSH:xS,Z_SYNC_FLUSH:DS,Z_FULL_FLUSH:vS,Z_FINISH:kS,Z_OK:Kf,Z_STREAM_END:BS,Z_DEFAULT_COMPRESSION:SS,Z_DEFAULT_STRATEGY:_S,Z_DEFLATED:TS}=Vs;function Ra(t){this.options=Yf.assign({level:SS,method:TS,chunkSize:16384,windowBits:15,memLevel:8,strategy:_S},t||{});let e=this.options;e.raw&&e.windowBits>0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new ly,this.strm.avail_out=0;let r=Ca.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(r!==Kf)throw new Error($s[r]);if(e.header&&Ca.deflateSetHeader(this.strm,e.header),e.dictionary){let n;if(typeof e.dictionary=="string"?n=Ba.string2buf(e.dictionary):cy.call(e.dictionary)==="[object ArrayBuffer]"?n=new Uint8Array(e.dictionary):n=e.dictionary,r=Ca.deflateSetDictionary(this.strm,n),r!==Kf)throw new Error($s[r]);this._dict_set=!0}}Ra.prototype.push=function(t,e){let r=this.strm,n=this.options.chunkSize,i,s;if(this.ended)return!1;for(e===~~e?s=e:s=e===!0?kS:xS,typeof t=="string"?r.input=Ba.string2buf(t):cy.call(t)==="[object ArrayBuffer]"?r.input=new Uint8Array(t):r.input=t,r.next_in=0,r.avail_in=r.input.length;;){if(r.avail_out===0&&(r.output=new Uint8Array(n),r.next_out=0,r.avail_out=n),(s===DS||s===vS)&&r.avail_out<=6){this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;continue}if(i=Ca.deflate(r,s),i===BS)return r.next_out>0&&this.onData(r.output.subarray(0,r.next_out)),i=Ca.deflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===Kf;if(r.avail_out===0){this.onData(r.output);continue}if(s>0&&r.next_out>0){this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;continue}if(r.avail_in===0)break}return!0};Ra.prototype.onData=function(t){this.chunks.push(t)};Ra.prototype.onEnd=function(t){t===Kf&&(this.result=Yf.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};function vp(t,e){let r=new Ra(e);if(r.push(t,!0),r.err)throw r.msg||$s[r.err];return r.result}function RS(t,e){return e=e||{},e.raw=!0,vp(t,e)}function PS(t,e){return e=e||{},e.gzip=!0,vp(t,e)}var MS=Ra,OS=vp,NS=RS,LS=PS,IS=Vs,$S={Deflate:MS,deflate:OS,deflateRaw:NS,gzip:LS,constants:IS},If=30,zS=12,jS=function(e,r){let n,i,s,o,u,a,l,c,f,h,d,p,y,m,A,w,k,E,v,T,B,F,x,S,O=e.state;n=e.next_in,x=e.input,i=n+(e.avail_in-5),s=e.next_out,S=e.output,o=s-(r-e.avail_out),u=s+(e.avail_out-257),a=O.dmax,l=O.wsize,c=O.whave,f=O.wnext,h=O.window,d=O.hold,p=O.bits,y=O.lencode,m=O.distcode,A=(1<>>24,d>>>=E,p-=E,E=k>>>16&255,E===0)S[s++]=k&65535;else if(E&16){v=k&65535,E&=15,E&&(p>>=E,p-=E),p<15&&(d+=x[n++]<>>24,d>>>=E,p-=E,E=k>>>16&255,E&16){if(T=k&65535,E&=15,pa){e.msg="invalid distance too far back",O.mode=If;break e}if(d>>>=E,p-=E,E=s-o,T>E){if(E=T-E,E>c&&O.sane){e.msg="invalid distance too far back",O.mode=If;break e}if(B=0,F=h,f===0){if(B+=l-E,E2;)S[s++]=F[B++],S[s++]=F[B++],S[s++]=F[B++],v-=3;v&&(S[s++]=F[B++],v>1&&(S[s++]=F[B++]))}else{B=s-T;do S[s++]=S[B++],S[s++]=S[B++],S[s++]=S[B++],v-=3;while(v>2);v&&(S[s++]=S[B++],v>1&&(S[s++]=S[B++]))}}else if(E&64){e.msg="invalid distance code",O.mode=If;break e}else{k=m[(k&65535)+(d&(1<>3,n-=v,p-=v<<3,d&=(1<{let a=u.bits,l=0,c=0,f=0,h=0,d=0,p=0,y=0,m=0,A=0,w=0,k,E,v,T,B,F=null,x=0,S,O=new Uint16Array(F1+1),de=new Uint16Array(F1+1),xe=null,gt=0,Ke,Ue,yt;for(l=0;l<=F1;l++)O[l]=0;for(c=0;c=1&&O[h]===0;h--);if(d>h&&(d=h),h===0)return i[s++]=1<<24|64<<16|0,i[s++]=1<<24|64<<16|0,u.bits=1,0;for(f=1;f0&&(t===m5||h!==1))return-1;for(de[1]=0,l=1;ld5||t===g5&&A>p5)return 1;for(;;){Ke=l-y,o[c]S?(Ue=xe[gt+o[c]],yt=F[x+o[c]]):(Ue=32+64,yt=0),k=1<>y)+E]=Ke<<24|Ue<<16|yt|0;while(E!==0);for(k=1<>=1;if(k!==0?(w&=k-1,w+=k):w=0,c++,--O[l]===0){if(l===h)break;l=e[r+o[c]]}if(l>d&&(w&T)!==v){for(y===0&&(y=d),B+=f,p=l-y,m=1<d5||t===g5&&A>p5)return 1;v=w&T,i[v]=d<<24|p<<16|B-s|0}}return w!==0&&(i[B+w]=l-y<<24|64<<16|0),u.bits=d,0},Ea=WS,KS=0,fy=1,hy=2,{Z_FINISH:y5,Z_BLOCK:GS,Z_TREES:$f,Z_OK:Us,Z_STREAM_END:ZS,Z_NEED_DICT:JS,Z_STREAM_ERROR:Dr,Z_DATA_ERROR:dy,Z_MEM_ERROR:py,Z_BUF_ERROR:YS,Z_DEFLATED:A5}=Vs,my=1,b5=2,C5=3,E5=4,w5=5,F5=6,x5=7,D5=8,v5=9,k5=10,Gf=11,Gn=12,fp=13,B5=14,hp=15,S5=16,_5=17,T5=18,R5=19,zf=20,jf=21,P5=22,M5=23,O5=24,N5=25,L5=26,dp=27,I5=28,$5=29,Te=30,gy=31,XS=32,QS=852,e_=592,t_=15,r_=t_,z5=t=>(t>>>24&255)+(t>>>8&65280)+((t&65280)<<8)+((t&255)<<24);function n_(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}var yy=t=>{if(!t||!t.state)return Dr;let e=t.state;return t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=e.wrap&1),e.mode=my,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new Int32Array(QS),e.distcode=e.distdyn=new Int32Array(e_),e.sane=1,e.back=-1,Us},Ay=t=>{if(!t||!t.state)return Dr;let e=t.state;return e.wsize=0,e.whave=0,e.wnext=0,yy(t)},by=(t,e)=>{let r;if(!t||!t.state)return Dr;let n=t.state;return e<0?(r=0,e=-e):(r=(e>>4)+1,e<48&&(e&=15)),e&&(e<8||e>15)?Dr:(n.window!==null&&n.wbits!==e&&(n.window=null),n.wrap=r,n.wbits=e,Ay(t))},Cy=(t,e)=>{if(!t)return Dr;let r=new n_;t.state=r,r.window=null;let n=by(t,e);return n!==Us&&(t.state=null),n},i_=t=>Cy(t,r_),j5=!0,pp,mp,s_=t=>{if(j5){pp=new Int32Array(512),mp=new Int32Array(32);let e=0;for(;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(Ea(fy,t.lens,0,288,pp,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;Ea(hy,t.lens,0,32,mp,0,t.work,{bits:5}),j5=!1}t.lencode=pp,t.lenbits=9,t.distcode=mp,t.distbits=5},Ey=(t,e,r,n)=>{let i,s=t.state;return s.window===null&&(s.wsize=1<=s.wsize?(s.window.set(e.subarray(r-s.wsize,r),0),s.wnext=0,s.whave=s.wsize):(i=s.wsize-s.wnext,i>n&&(i=n),s.window.set(e.subarray(r-n,r-n+i),s.wnext),n-=i,n?(s.window.set(e.subarray(r-n,r),0),s.wnext=n,s.whave=s.wsize):(s.wnext+=i,s.wnext===s.wsize&&(s.wnext=0),s.whave{let r,n,i,s,o,u,a,l,c,f,h,d,p,y,m=0,A,w,k,E,v,T,B,F,x=new Uint8Array(4),S,O,de=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(!t||!t.state||!t.output||!t.input&&t.avail_in!==0)return Dr;r=t.state,r.mode===Gn&&(r.mode=fp),o=t.next_out,i=t.output,a=t.avail_out,s=t.next_in,n=t.input,u=t.avail_in,l=r.hold,c=r.bits,f=u,h=a,F=Us;e:for(;;)switch(r.mode){case my:if(r.wrap===0){r.mode=fp;break}for(;c<16;){if(u===0)break e;u--,l+=n[s++]<>>8&255,r.check=st(r.check,x,2,0),l=0,c=0,r.mode=b5;break}if(r.flags=0,r.head&&(r.head.done=!1),!(r.wrap&1)||(((l&255)<<8)+(l>>8))%31){t.msg="incorrect header check",r.mode=Te;break}if((l&15)!==A5){t.msg="unknown compression method",r.mode=Te;break}if(l>>>=4,c-=4,B=(l&15)+8,r.wbits===0)r.wbits=B;else if(B>r.wbits){t.msg="invalid window size",r.mode=Te;break}r.dmax=1<>8&1),r.flags&512&&(x[0]=l&255,x[1]=l>>>8&255,r.check=st(r.check,x,2,0)),l=0,c=0,r.mode=C5;case C5:for(;c<32;){if(u===0)break e;u--,l+=n[s++]<>>8&255,x[2]=l>>>16&255,x[3]=l>>>24&255,r.check=st(r.check,x,4,0)),l=0,c=0,r.mode=E5;case E5:for(;c<16;){if(u===0)break e;u--,l+=n[s++]<>8),r.flags&512&&(x[0]=l&255,x[1]=l>>>8&255,r.check=st(r.check,x,2,0)),l=0,c=0,r.mode=w5;case w5:if(r.flags&1024){for(;c<16;){if(u===0)break e;u--,l+=n[s++]<>>8&255,r.check=st(r.check,x,2,0)),l=0,c=0}else r.head&&(r.head.extra=null);r.mode=F5;case F5:if(r.flags&1024&&(d=r.length,d>u&&(d=u),d&&(r.head&&(B=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Uint8Array(r.head.extra_len)),r.head.extra.set(n.subarray(s,s+d),B)),r.flags&512&&(r.check=st(r.check,n,d,s)),u-=d,s+=d,r.length-=d),r.length))break e;r.length=0,r.mode=x5;case x5:if(r.flags&2048){if(u===0)break e;d=0;do B=n[s+d++],r.head&&B&&r.length<65536&&(r.head.name+=String.fromCharCode(B));while(B&&d>9&1,r.head.done=!0),t.adler=r.check=0,r.mode=Gn;break;case k5:for(;c<32;){if(u===0)break e;u--,l+=n[s++]<>>=c&7,c-=c&7,r.mode=dp;break}for(;c<3;){if(u===0)break e;u--,l+=n[s++]<>>=1,c-=1,l&3){case 0:r.mode=B5;break;case 1:if(s_(r),r.mode=zf,e===$f){l>>>=2,c-=2;break e}break;case 2:r.mode=_5;break;case 3:t.msg="invalid block type",r.mode=Te}l>>>=2,c-=2;break;case B5:for(l>>>=c&7,c-=c&7;c<32;){if(u===0)break e;u--,l+=n[s++]<>>16^65535)){t.msg="invalid stored block lengths",r.mode=Te;break}if(r.length=l&65535,l=0,c=0,r.mode=hp,e===$f)break e;case hp:r.mode=S5;case S5:if(d=r.length,d){if(d>u&&(d=u),d>a&&(d=a),d===0)break e;i.set(n.subarray(s,s+d),o),u-=d,s+=d,a-=d,o+=d,r.length-=d;break}r.mode=Gn;break;case _5:for(;c<14;){if(u===0)break e;u--,l+=n[s++]<>>=5,c-=5,r.ndist=(l&31)+1,l>>>=5,c-=5,r.ncode=(l&15)+4,l>>>=4,c-=4,r.nlen>286||r.ndist>30){t.msg="too many length or distance symbols",r.mode=Te;break}r.have=0,r.mode=T5;case T5:for(;r.have>>=3,c-=3}for(;r.have<19;)r.lens[de[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,S={bits:r.lenbits},F=Ea(KS,r.lens,0,19,r.lencode,0,r.work,S),r.lenbits=S.bits,F){t.msg="invalid code lengths set",r.mode=Te;break}r.have=0,r.mode=R5;case R5:for(;r.have>>24,w=m>>>16&255,k=m&65535,!(A<=c);){if(u===0)break e;u--,l+=n[s++]<>>=A,c-=A,r.lens[r.have++]=k;else{if(k===16){for(O=A+2;c>>=A,c-=A,r.have===0){t.msg="invalid bit length repeat",r.mode=Te;break}B=r.lens[r.have-1],d=3+(l&3),l>>>=2,c-=2}else if(k===17){for(O=A+3;c>>=A,c-=A,B=0,d=3+(l&7),l>>>=3,c-=3}else{for(O=A+7;c>>=A,c-=A,B=0,d=11+(l&127),l>>>=7,c-=7}if(r.have+d>r.nlen+r.ndist){t.msg="invalid bit length repeat",r.mode=Te;break}for(;d--;)r.lens[r.have++]=B}}if(r.mode===Te)break;if(r.lens[256]===0){t.msg="invalid code -- missing end-of-block",r.mode=Te;break}if(r.lenbits=9,S={bits:r.lenbits},F=Ea(fy,r.lens,0,r.nlen,r.lencode,0,r.work,S),r.lenbits=S.bits,F){t.msg="invalid literal/lengths set",r.mode=Te;break}if(r.distbits=6,r.distcode=r.distdyn,S={bits:r.distbits},F=Ea(hy,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,S),r.distbits=S.bits,F){t.msg="invalid distances set",r.mode=Te;break}if(r.mode=zf,e===$f)break e;case zf:r.mode=jf;case jf:if(u>=6&&a>=258){t.next_out=o,t.avail_out=a,t.next_in=s,t.avail_in=u,r.hold=l,r.bits=c,jS(t,h),o=t.next_out,i=t.output,a=t.avail_out,s=t.next_in,n=t.input,u=t.avail_in,l=r.hold,c=r.bits,r.mode===Gn&&(r.back=-1);break}for(r.back=0;m=r.lencode[l&(1<>>24,w=m>>>16&255,k=m&65535,!(A<=c);){if(u===0)break e;u--,l+=n[s++]<>E)],A=m>>>24,w=m>>>16&255,k=m&65535,!(E+A<=c);){if(u===0)break e;u--,l+=n[s++]<>>=E,c-=E,r.back+=E}if(l>>>=A,c-=A,r.back+=A,r.length=k,w===0){r.mode=L5;break}if(w&32){r.back=-1,r.mode=Gn;break}if(w&64){t.msg="invalid literal/length code",r.mode=Te;break}r.extra=w&15,r.mode=P5;case P5:if(r.extra){for(O=r.extra;c>>=r.extra,c-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=M5;case M5:for(;m=r.distcode[l&(1<>>24,w=m>>>16&255,k=m&65535,!(A<=c);){if(u===0)break e;u--,l+=n[s++]<>E)],A=m>>>24,w=m>>>16&255,k=m&65535,!(E+A<=c);){if(u===0)break e;u--,l+=n[s++]<>>=E,c-=E,r.back+=E}if(l>>>=A,c-=A,r.back+=A,w&64){t.msg="invalid distance code",r.mode=Te;break}r.offset=k,r.extra=w&15,r.mode=O5;case O5:if(r.extra){for(O=r.extra;c>>=r.extra,c-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){t.msg="invalid distance too far back",r.mode=Te;break}r.mode=N5;case N5:if(a===0)break e;if(d=h-a,r.offset>d){if(d=r.offset-d,d>r.whave&&r.sane){t.msg="invalid distance too far back",r.mode=Te;break}d>r.wnext?(d-=r.wnext,p=r.wsize-d):p=r.wnext-d,d>r.length&&(d=r.length),y=r.window}else y=i,p=o-r.offset,d=r.length;d>a&&(d=a),a-=d,r.length-=d;do i[o++]=y[p++];while(--d);r.length===0&&(r.mode=jf);break;case L5:if(a===0)break e;i[o++]=r.length,a--,r.mode=jf;break;case dp:if(r.wrap){for(;c<32;){if(u===0)break e;u--,l|=n[s++]<{if(!t||!t.state)return Dr;let e=t.state;return e.window&&(e.window=null),t.state=null,Us},a_=(t,e)=>{if(!t||!t.state)return Dr;let r=t.state;return r.wrap&2?(r.head=e,e.done=!1,Us):Dr},l_=(t,e)=>{let r=e.length,n,i,s;return!t||!t.state||(n=t.state,n.wrap!==0&&n.mode!==Gf)?Dr:n.mode===Gf&&(i=1,i=va(i,e,r,0),i!==n.check)?dy:(s=Ey(t,e,r,r),s?(n.mode=gy,py):(n.havedict=1,Us))},c_=Ay,f_=by,h_=yy,d_=i_,p_=Cy,m_=o_,g_=u_,y_=a_,A_=l_,b_="pako inflate (from Nodeca project)",Jn={inflateReset:c_,inflateReset2:f_,inflateResetKeep:h_,inflateInit:d_,inflateInit2:p_,inflate:m_,inflateEnd:g_,inflateGetHeader:y_,inflateSetDictionary:A_,inflateInfo:b_};function C_(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}var E_=C_,wy=Object.prototype.toString,{Z_NO_FLUSH:w_,Z_FINISH:F_,Z_OK:Sa,Z_STREAM_END:gp,Z_NEED_DICT:yp,Z_STREAM_ERROR:x_,Z_DATA_ERROR:U5,Z_MEM_ERROR:D_}=Vs;function Pa(t){this.options=Yf.assign({chunkSize:1024*64,windowBits:15,to:""},t||{});let e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,e.windowBits===0&&(e.windowBits=-15)),e.windowBits>=0&&e.windowBits<16&&!(t&&t.windowBits)&&(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&(e.windowBits&15||(e.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new ly,this.strm.avail_out=0;let r=Jn.inflateInit2(this.strm,e.windowBits);if(r!==Sa)throw new Error($s[r]);if(this.header=new E_,Jn.inflateGetHeader(this.strm,this.header),e.dictionary&&(typeof e.dictionary=="string"?e.dictionary=Ba.string2buf(e.dictionary):wy.call(e.dictionary)==="[object ArrayBuffer]"&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(r=Jn.inflateSetDictionary(this.strm,e.dictionary),r!==Sa)))throw new Error($s[r])}Pa.prototype.push=function(t,e){let r=this.strm,n=this.options.chunkSize,i=this.options.dictionary,s,o,u;if(this.ended)return!1;for(e===~~e?o=e:o=e===!0?F_:w_,wy.call(t)==="[object ArrayBuffer]"?r.input=new Uint8Array(t):r.input=t,r.next_in=0,r.avail_in=r.input.length;;){for(r.avail_out===0&&(r.output=new Uint8Array(n),r.next_out=0,r.avail_out=n),s=Jn.inflate(r,o),s===yp&&i&&(s=Jn.inflateSetDictionary(r,i),s===Sa?s=Jn.inflate(r,o):s===U5&&(s=yp));r.avail_in>0&&s===gp&&r.state.wrap>0&&t[r.next_in]!==0;)Jn.inflateReset(r),s=Jn.inflate(r,o);switch(s){case x_:case U5:case yp:case D_:return this.onEnd(s),this.ended=!0,!1}if(u=r.avail_out,r.next_out&&(r.avail_out===0||s===gp))if(this.options.to==="string"){let a=Ba.utf8border(r.output,r.next_out),l=r.next_out-a,c=Ba.buf2string(r.output,a);r.next_out=l,r.avail_out=n-l,l&&r.output.set(r.output.subarray(a,a+l),0),this.onData(c)}else this.onData(r.output.length===r.next_out?r.output:r.output.subarray(0,r.next_out));if(!(s===Sa&&u===0)){if(s===gp)return s=Jn.inflateEnd(this.strm),this.onEnd(s),this.ended=!0,!0;if(r.avail_in===0)break}}return!0};Pa.prototype.onData=function(t){this.chunks.push(t)};Pa.prototype.onEnd=function(t){t===Sa&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=Yf.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};function kp(t,e){let r=new Pa(e);if(r.push(t),r.err)throw r.msg||$s[r.err];return r.result}function v_(t,e){return e=e||{},e.raw=!0,kp(t,e)}var k_=Pa,B_=kp,S_=v_,__=kp,T_=Vs,R_={Inflate:k_,inflate:B_,inflateRaw:S_,ungzip:__,constants:T_},{Deflate:P_,deflate:M_,deflateRaw:O_,gzip:N_}=$S,{Inflate:L_,inflate:I_,inflateRaw:$_,ungzip:z_}=R_,j_=P_,U_=M_,V_=O_,q_=N_,H_=L_,W_=I_,K_=$_,G_=z_,Z_=Vs,Bp={Deflate:j_,deflate:U_,deflateRaw:V_,gzip:q_,Inflate:H_,inflate:W_,inflateRaw:K_,ungzip:G_,constants:Z_};var Dn,Sp=class{constructor(){R(this,Dn,new Map)}emit(e,...r){let n=g(this,Dn).get(e);if(!n?.all?.size)return!1;for(let i of n.all)i(...r),n.once.has(i)&&(n.all.delete(i),n.once.delete(i));return!1}on(e,r){return g(this,Dn).has(e)||g(this,Dn).set(e,{all:new Set,once:new Set}),g(this,Dn).get(e).all.add(r),this}once(e,r){g(this,Dn).has(e)||g(this,Dn).set(e,{all:new Set,once:new Set});let n=g(this,Dn).get(e);return n.all.add(r),n.once.add(r),this}};Dn=new WeakMap;var _p=class{async get(e,r={}){let n=new Headers;for(let[s,o]of Object.entries(r?.headers??{})){let u=typeof o=="string"?[o]:o;for(let a of u)n.append(s,a)}let i=await fetch(e,{headers:n,redirect:"follow"});if(i.ok)return new Uint8Array(await i.arrayBuffer());throw new Error(`Status code ${i.status}: ${i.ok}`)}},Tp=class{on(e,r){return e==="ready"&&r(),this}once(e,r){return e==="ready"&&r(),this}async close(){}},Qf=class{states;constructor(){this.states=JSON.parse(localStorage.getItem(Qf.LocalStorageKey)??"{}")}saveStates(){localStorage.setItem(Qf.LocalStorageKey,JSON.stringify(this.states))}async chmod(e,r){}async getAllFiles(e){return[]}async mkdir(e,r){if(e=X.ensureEndingSlash(e.toString()),this.states[e])throw new Error(`EEXIST: ${e}`);this.states[e]={type:"directory"},this.saveStates()}async readFile(e){e=e.toString();let r=this.states[e];if(r){if(r.type==="directory")throw new Error(`EISDIR: ${e}`)}else throw new Error(`ENOENT: ${e}`);return new Uint8Array((0,e0.decode)(r.content))}async showFile(e){throw new Error("showFile not supported on browser")}async stat(e){e=e.toString();let r=this.states[e];if(!r)throw new Error(`ENOENT: ${e}`);return{isDirectory:()=>r.type==="directory",isFile:()=>r.type==="file"}}async unlink(e){if(e=e.toString(),!this.states[e])throw new Error(`ENOENT: ${e}`);delete this.states[e],this.saveStates()}watch(e){return new Tp}async writeFile(e,r,n){e=e.toString(),typeof r=="string"&&(r=new TextEncoder().encode(r)),r=(0,e0.encode)(r),this.states[e]={type:"file",content:r},this.saveStates()}},Xf=Qf;q(Xf,"LocalStorageKey","spyglassmc-browser-fs");var Rp={archive:{decompressBall(t,e){throw new Error("decompressBall not supported on browser.")},async gunzip(t){return Bp.inflate(t)},async gzip(t){return Bp.gzip(t)}},crypto:{async getSha1(t){typeof t=="string"&&(t=new TextEncoder().encode(t));let e=await crypto.subtle.digest("SHA-1",t);return J_(new Uint8Array(e))}},downloader:new _p,error:{isKind(t,e){return t instanceof Error&&t.message.startsWith(e)}},event:{EventEmitter:Sp},fs:new Xf};function J_(t){let e="";for(let r of t)e+=r.toString(16).padStart(2,"0");return e}Object.freeze(Rp);var to={};Rr(to,{TypeDefSymbolData:()=>Za,fileModule:()=>ky,module_:()=>By,registerMcdocBinders:()=>Vp});var Fy;(function(t){function e(r){return r?.type==="mcdoc:module"}t.is=e})(Fy||(Fy={}));var t0;(function(t){function e(r){return ps.is(r)||Ma.is(r)||Xn.is(r)||Ka.is(r)||Qn.is(r)||eo.is(r)||P1.is(r)}t.is=e})(t0||(t0={}));var Ma;(function(t){function e(n){return{attributes:n.children.filter(Wr.is),location:n.children.find(V.is),index:n.children.find(vn.is),target:n.children.find(vr.is),typeParams:n.children.find(_1.is)}}t.destruct=e;function r(n){return n?.type==="mcdoc:dispatch_statement"}t.is=r})(Ma||(Ma={}));var pt;(function(t){function e(r){return r?.type==="mcdoc:literal"}t.is=e})(pt||(pt={}));var vn;(function(t){function e(n){return{parallelIndices:n.children.filter(Pp.is)}}t.destruct=e;function r(n){return n?.type==="mcdoc:index_body"}t.is=r})(vn||(vn={}));var Pp;(function(t){function e(r){return Oa.is(r)||Hs.is(r)}t.is=e})(Pp||(Pp={}));var Oa;(function(t){function e(r){return pt.is(r)||Ut.is(r)||ht.is(r)||V.is(r)}t.is=e})(Oa||(Oa={}));var Ut;(function(t){function e(r){return r?.type==="mcdoc:identifier"}t.is=e})(Ut||(Ut={}));var Hs;(function(t){function e(n){return{keys:n.children.filter(Mp.is)}}t.destruct=e;function r(n){return n?.type==="mcdoc:dynamic_index"}t.is=r})(Hs||(Hs={}));var Mp;(function(t){function e(r){return pt.is(r)||Ut.is(r)||ht.is(r)}t.is=e})(Mp||(Mp={}));var vr;(function(t){function e(r){return Op.is(r)||Np.is(r)||Va.is(r)||za.is(r)||ja.is(r)||Ua.is(r)||Ks.is(r)||Gs.is(r)||Xn.is(r)||Qn.is(r)||Zs.is(r)||Xs.is(r)||Qs.is(r)}t.is=e})(vr||(vr={}));var Na;(function(t){function e(r){return{appendixes:r.children.filter(n=>vn.is(n)||Ws.is(n)),attributes:r.children.filter(Wr.is)}}t.destruct=e})(Na||(Na={}));var Wr;(function(t){function e(n){return{name:n.children.find(Ut.is),value:n.children.find(r0.is)}}t.destruct=e;function r(n){return n?.type==="mcdoc:attribute"}t.is=r})(Wr||(Wr={}));var r0;(function(t){function e(r){return vr.is(r)||La.is(r)}t.is=e})(r0||(r0={}));var La;(function(t){function e(n){return{positional:n.children.find(Ia.is),named:n.children.find($a.is)}}t.destruct=e;function r(n){return n?.type==="mcdoc:attribute/tree"}t.is=r})(La||(La={}));var Ia;(function(t){function e(n){return{values:n.children.filter(r0.is)}}t.destruct=e;function r(n){return n?.type==="mcdoc:attribute/tree/pos"}t.is=r})(Ia||(Ia={}));var $a;(function(t){function e(n){let i={values:[]},s;for(let o of n.children)ps.is(o)||(Ut.is(o)||ht.is(o)?s=o:s&&(i.values.push({key:s,value:o}),s=void 0));return i}t.destruct=e;function r(n){return n?.type==="mcdoc:attribute/tree/named"}t.is=r})($a||($a={}));var Ws;(function(t){function e(n){return{args:n.children.filter(vr.is)}}t.destruct=e;function r(n){return n?.type==="mcdoc:type_arg_block"}t.is=r})(Ws||(Ws={}));var Op;(function(t){function e(r){return r?.type==="mcdoc:type/any"}t.is=e})(Op||(Op={}));var Np;(function(t){function e(r){return r?.type==="mcdoc:type/boolean"}t.is=e})(Np||(Np={}));var ji;(function(t){function e(n){return vy(n)}t.destruct=e;function r(n){return n?.type==="mcdoc:int_range"}t.is=r})(ji||(ji={}));var za;(function(t){function e(n){return{value:n.children.find(Lp.is)}}t.destruct=e;function r(n){return n?.type==="mcdoc:type/literal"}t.is=r})(za||(za={}));var Lp;(function(t){function e(r){return pt.is(r)||Yn.is(r)||ht.is(r)}t.is=e})(Lp||(Lp={}));var Yn;(function(t){function e(n){return{value:n.children.find(zr.is),suffix:n.children.find(pt.is)}}t.destruct=e;function r(n){return n?.type==="mcdoc:typed_number"}t.is=r})(Yn||(Yn={}));var ja;(function(t){function e(n){return{numericKind:n.children.find(pt.is),valueRange:n.children.find(k1.is)||n.children.find(ji.is)}}t.destruct=e;function r(n){return n?.type==="mcdoc:type/numeric_type"}t.is=r})(ja||(ja={}));var Kr="<";function Dy(t){let e=t&2?Kr:"",r=t&1?Kr:"";return`${e}..${r}`}function vy(t){let e,r,n;return t.children.length===1?(e=0,r=n=t.children[0]):t.children.length===3?(e=i(t.children[1]),r=t.children[0],n=t.children[2]):pt.is(t.children[0])?(e=i(t.children[0]),n=t.children[1]):(e=i(t.children[1]),r=t.children[0]),{kind:e,min:r,max:n};function i(s){let o=0;return s.value.startsWith(Kr)&&(o|=2),s.value.endsWith(Kr)&&(o|=1),o}}var k1;(function(t){function e(n){return vy(n)}t.destruct=e;function r(n){return n?.type==="mcdoc:float_range"}t.is=r})(k1||(k1={}));var Ua;(function(t){function e(n){let i,s,o=!1;for(let u of n.children)pt.is(u)&&u.value==="[]"?o=!0:ji.is(u)&&(o?i=u:s=u);return{arrayKind:n.children.find(pt.is),lengthRange:i,valueRange:s}}t.destruct=e;function r(n){return n?.type==="mcdoc:type/primitive_array"}t.is=r})(Ua||(Ua={}));var Ks;(function(t){function e(n){return{item:n.children.find(vr.is),lengthRange:n.children.find(ji.is)}}t.destruct=e;function r(n){return n?.type==="mcdoc:type/list"}t.is=r})(Ks||(Ks={}));var Va;(function(t){function e(n){return{lengthRange:n.children.find(ji.is)}}t.destruct=e;function r(n){return n?.type==="mcdoc:type/string"}t.is=r})(Va||(Va={}));var Gs;(function(t){function e(n){return{items:n.children.filter(vr.is)}}t.destruct=e;function r(n){return n?.type==="mcdoc:type/tuple"}t.is=r})(Gs||(Gs={}));var Xn;(function(t){t.Kinds=new Set(["byte","short","int","long","float","double","string"]);function e(n){return{block:n.children.find(B1.is),docComments:n.children.find(Ui.is),enumKind:i(n),identifier:n.children.find(Ut.is),keyword:n.children.find(pt.is)};function i(s){for(let o of s.children.filter(pt.is))if(t.Kinds.has(o.value))return o.value}}t.destruct=e;function r(n){return n?.type==="mcdoc:enum"}t.is=r})(Xn||(Xn={}));var Ui;(function(t){function e(n){if(!n)return;let i=n.children.map(s=>s.comment);return i.every(s=>s.length===0||s.startsWith(" "))&&(i=i.map(s=>s.slice(1))),i.join(` +`)}t.asText=e;function r(n){return n?.type==="mcdoc:doc_comments"}t.is=r})(Ui||(Ui={}));var B1;(function(t){function e(n){return{fields:n.children.filter(S1.is)}}t.destruct=e;function r(n){return n?.type==="mcdoc:enum/block"}t.is=r})(B1||(B1={}));var S1;(function(t){function e(n){return{attributes:n.children.filter(Wr.is),identifier:n.children.find(Ut.is),value:n.children.find(Ip.is)}}t.destruct=e;function r(n){return n?.type==="mcdoc:enum/field"}t.is=r})(S1||(S1={}));var Ip;(function(t){function e(r){return Yn.is(r)||ht.is(r)}t.is=e})(Ip||(Ip={}));var xy;(function(t){function e(r){return Wr.is(r)||Ui.is(r)}t.is=e})(xy||(xy={}));var Qn;(function(t){function e(n){return{block:n.children.find(T1.is),docComments:n.children.find(Ui.is),identifier:n.children.find(Ut.is),keyword:n.children.find(pt.is)}}t.destruct=e;function r(n){return n?.type==="mcdoc:struct"}t.is=r})(Qn||(Qn={}));var Zs;(function(t){function e(n){return{path:n.children.find(Js.is)}}t.destruct=e;function r(n){return n?.type==="mcdoc:type/reference"}t.is=r})(Zs||(Zs={}));var _1;(function(t){function e(n){return{params:n.children.filter(qa.is)}}t.destruct=e;function r(n){return n?.type==="mcdoc:type_param_block"}t.is=r})(_1||(_1={}));var qa;(function(t){function e(n){return{identifier:n.children.find(Ut.is)}}t.destruct=e;function r(n){return n?.type==="mcdoc:type_param"}t.is=r})(qa||(qa={}));var Js;(function(t){function e(n){let i=Ou(n?.children,-1);return{children:n?.children??[],isAbsolute:n?.isAbsolute,lastIdentifier:Ut.is(i)?i:void 0}}t.destruct=e;function r(n){return n?.type==="mcdoc:path"}t.is=r})(Js||(Js={}));var T1;(function(t){function e(n){return{fields:n.children.filter(Ha.is)}}t.destruct=e;function r(n){return n?.type==="mcdoc:struct/block"}t.is=r})(T1||(T1={}));var Ha;(function(t){function e(r){return Vi.is(r)||R1.is(r)}t.is=e})(Ha||(Ha={}));var Vi;(function(t){function e(n){return{attributes:n.children.filter(Wr.is),key:n.children.find(Wa.is),type:n.children.find(vr.is),isOptional:n.isOptional}}t.destruct=e;function r(n){return n?.type==="mcdoc:struct/field/pair"}t.is=r})(Vi||(Vi={}));var Wa;(function(t){function e(r){return ht.is(r)||Ut.is(r)||Ys.is(r)}t.is=e})(Wa||(Wa={}));var Ys;(function(t){function e(n){return{type:n.children.find(vr.is)}}t.destruct=e;function r(n){return n?.type==="mcdoc:struct/map_key"}t.is=r})(Ys||(Ys={}));var R1;(function(t){function e(n){return{attributes:n.children.filter(Wr.is),type:n.children.find(vr.is)}}t.destruct=e;function r(n){return n?.type==="mcdoc:struct/field/spread"}t.is=r})(R1||(R1={}));var Xs;(function(t){function e(n){return{location:n.children.find(V.is),index:n.children.find(vn.is)}}t.destruct=e;function r(n){return n?.type==="mcdoc:type/dispatcher"}t.is=r})(Xs||(Xs={}));var Qs;(function(t){function e(n){return{members:n.children.filter(vr.is)}}t.destruct=e;function r(n){return n?.type==="mcdoc:type/union"}t.is=r})(Qs||(Qs={}));var Ka;(function(t){function e(n){return{injection:n.children.find($p.is)}}t.destruct=e;function r(n){return n?.type==="mcdoc:injection"}t.is=r})(Ka||(Ka={}));var $p;(function(t){function e(r){return Ga.is(r)||zp.is(r)}t.is=e})($p||($p={}));var Ga;(function(t){function e(r){return r?.type==="mcdoc:injection/enum"}t.is=e})(Ga||(Ga={}));var zp;(function(t){function e(r){return r?.type==="mcdoc:injection/struct"}t.is=e})(zp||(zp={}));var eo;(function(t){function e(n){return{attributes:n.children.filter(Wr.is),docComments:n.children.find(Ui.is),identifier:n.children.find(Ut.is),keyword:n.children.find(pt.is),typeParams:n.children.find(_1.is),rhs:n.children.find(vr.is)}}t.destruct=e;function r(n){return n?.type==="mcdoc:type_alias"}t.is=r})(eo||(eo={}));var P1;(function(t){function e(n){return{binding:n.children.find(Ut.is),path:n.children.find(Js.is)}}t.destruct=e;function r(n){return n?.type==="mcdoc:use_statement"}t.is=r})(P1||(P1={}));var jp;(function(t){function e(r){return!!r&&typeof r=="object"&&typeof r.nextAnonymousIndex=="number"}t.is=e})(jp||(jp={}));var Za;(function(t){function e(r){return!!r&&typeof r=="object"&&typeof r.typeDef=="object"}t.is=e})(Za||(Za={}));var ky=vs.create(async(t,e)=>{let r=uT(e.doc.uri,e);if(!r){e.err.report(C("mcdoc.binder.out-of-root",L(e.doc.uri)),b.Beginning,0);return}let n={...e,moduleIdentifier:r};return By(t,n)});async function By(t,e){let r={nextAnonymousIndex:0};e.symbols.query({doc:e.doc,node:t},"mcdoc",e.moduleIdentifier).amend({data:{data:r}}),Y_(t,e);for(let n of t.children)switch(n.type){case"mcdoc:dispatch_statement":await X_(n,e);break;case"mcdoc:enum":Ty(n,e);break;case"mcdoc:injection":await tT(n,e);break;case"mcdoc:struct":await Ry(n,e);break;case"mcdoc:type_alias":await nT(n,e);break;case"mcdoc:use_statement":await iT(n,e);break}}function Y_(t,e){$t(t,()=>!0,t0.is,l=>{switch(l.type){case"mcdoc:enum":r(l);break;case"mcdoc:struct":n(l);break;case"mcdoc:type_alias":i(l);break;case"mcdoc:use_statement":s(l);break}});function r(l){o("enum",l,Xn.destruct,c=>({typeDef:Ny(c,e)}))}function n(l){o("struct",l,Qn.destruct,c=>({typeDef:Ly(c,e)}))}function i(l){o("type_alias",l,eo.destruct,c=>{let{attributes:f,rhs:h,typeParams:d}=eo.destruct(c);if(!h)return;let p={typeDef:kn(h,e)};return d&&Sy(l,d,p,e),p.typeDef=qp(p.typeDef,f,e),p})}function s(l){let{binding:c,path:f}=P1.destruct(l);if(!f)return;let{lastIdentifier:h}=Js.destruct(f),d=c??h;d&&e.symbols.query({doc:e.doc,node:l},"mcdoc",`${e.moduleIdentifier}::${d.value}`).ifDeclared(p=>M1(e,p,d)).elseEnter({data:{subcategory:"use_statement_binding",visibility:1},usage:{type:"definition",node:d,fullRange:l}})}function o(l,c,f,h){let{docComments:d,identifier:p,keyword:y}=f(c),m=p?.value??a(c,e);e.symbols.query({doc:e.doc,node:c},"mcdoc",`${e.moduleIdentifier}::${m}`).ifDeclared(A=>M1(e,A,p??c)).elseEnter({data:{data:h(c),desc:Ui.asText(d),subcategory:l},usage:{type:"definition",node:p??y,fullRange:p&&c}})}function u(l,c){let f=c.symbols.query({doc:c.doc,node:l},"mcdoc",c.moduleIdentifier).getData(jp.is);if(!f)throw new Error(`No symbol data for module '${c.moduleIdentifier}'`);return f.nextAnonymousIndex++}function a(l,c){return``}}function Sy(t,e,r,n){t.locals=Object.create(null),r.typeDef={kind:"template",child:r.typeDef,typeParams:[]};let{params:i}=_1.destruct(e);for(let s of i){let{identifier:o}=qa.destruct(s);if(o.value){let u=`${n.moduleIdentifier}::${o.value}`;n.symbols.query({doc:n.doc,node:t},"mcdoc",u).ifDeclared(a=>M1(n,a,o)).elseEnter({data:{visibility:0},usage:{type:"declaration",node:o,fullRange:s}}),r.typeDef.typeParams.push({path:u})}}}async function X_(t,e){let{attributes:r,location:n,index:i,target:s,typeParams:o}=Ma.destruct(t);if(!(n&&i&&s))return;let u=V.toString(n,"full");e.symbols.query(e.doc,"mcdoc/dispatcher",u).enter({usage:{type:"reference",node:n,fullRange:t}});let{parallelIndices:a}=vn.destruct(i);if(a.length){let l={typeDef:kn(s,e)};o&&Sy(t,o,l,e),l.typeDef=qp(l.typeDef,r,e);for(let c of a)Hs.is(c)||e.symbols.query(e.doc,"mcdoc/dispatcher",u,Ya(c)).ifDeclared(f=>M1(e,f,c,{localeString:"mcdoc.binder.dispatcher-statement.duplicated-key"})).elseEnter({data:{data:l},usage:{type:"definition",node:c,fullRange:t}})}await qi(s,e)}async function qi(t,e){if(Xs.is(t))await Q_(t,e);else if(Xn.is(t))Ty(t,e);else if(Ks.is(t)){let{item:n}=Ks.destruct(t);await qi(n,e)}else if(Zs.is(t)){let{path:n}=Zs.destruct(t);await _y(n,e)}else if(Qn.is(t))await Ry(t,e);else if(Gs.is(t)){let{items:n}=Gs.destruct(t);for(let i of n)await qi(i,e)}else if(Qs.is(t)){let{members:n}=Qs.destruct(t);for(let i of n)await qi(i,e)}let{appendixes:r}=Na.destruct(t);for(let n of r)if(Ws.is(n)){let{args:i}=Ws.destruct(n);for(let s of i)await qi(s,e)}}async function Q_(t,e){let{index:r,location:n}=Xs.destruct(t),i=V.toString(n,"full");e.symbols.query(e.doc,"mcdoc/dispatcher",i).enter({usage:{type:"reference",node:n,fullRange:t}});let{parallelIndices:s}=vn.destruct(r);for(let o of s)Hs.is(o)||e.symbols.query(e.doc,"mcdoc/dispatcher",i,Ya(o)).enter({usage:{type:"reference",node:o,fullRange:t}})}async function _y(t,e){for(let{identifiers:r,node:n,indexRight:i}of Py(t,e,{reportErrors:!0}))if(r?.length){if(i===1){let s=n0(r),o=oT(s,e);if(!o){e.err.report(C("mcdoc.binder.path.unknown-module",L(s)),t,2);return}await e.ensureBindingStarted(o)}e.symbols.query({doc:e.doc,node:n},"mcdoc",n0(r)).ifDeclared((s,o)=>o.enter({usage:{type:"reference",node:n,fullRange:t,skipRenaming:pt.is(n)}})).else(()=>{i===0&&e.err.report(C("mcdoc.binder.path.unknown-identifier",L(Ou(r,-1)),L(n0(r.slice(0,-1)))),t,2)})}}function Ty(t,e){let{block:r,identifier:n,keyword:i}=Xn.destruct(t),s=n?.symbol??i.symbol;if(s?.subcategory!=="enum")return;let o=e.symbols.query({doc:e.doc,node:t},"mcdoc",...s.path);Ir.assertDefined(o.symbol),eT(r,e,o)}function eT(t,e,r,n={}){let{fields:i}=B1.destruct(t);for(let s of i){let{identifier:o}=S1.destruct(s);r.member(o.value,u=>u.ifDeclared(a=>M1(e,a,o)).elseEnter({usage:{type:"definition",node:o,fullRange:s}}))}}async function tT(t,e){let{injection:r}=Ka.destruct(t);Ga.is(r)}async function Ry(t,e){let{block:r,identifier:n,keyword:i}=Qn.destruct(t),s=n?.symbol??i.symbol;if(s?.subcategory!=="struct")return;let o=e.symbols.query({doc:e.doc,node:t},"mcdoc",...s.path);Ir.assertDefined(o.symbol),await rT(r,e,o)}async function rT(t,e,r,n={}){let{fields:i}=T1.destruct(t);for(let s of i)if(Vi.is(s)){let{key:o,type:u}=Vi.destruct(s);Ys.is(o)||r.member(o.value,a=>a.ifDeclared(l=>M1(e,l,o)).elseEnter({usage:{type:"definition",node:o,fullRange:s}})),await qi(u,e)}else{let{type:o}=R1.destruct(s);await qi(o,e)}}async function nT(t,e){let{identifier:r,rhs:n,typeParams:i}=eo.destruct(t);r?.value&&n&&await qi(n,e)}async function iT(t,e){let{path:r}=P1.destruct(t);if(r)return _y(r,e)}function Vp(t){t.registerBinder("mcdoc:module",ky)}function M1(t,e,r,n={localeString:"mcdoc.binder.duplicated-declaration"}){t.err.report(C(n.localeString,L(e.identifier)),r,2,{related:[{location:He.getDeclaredLocation(e),message:C(`${n.localeString}.related`,L(e.identifier))}]})}function*Py(t,e,r={}){let{children:n,isAbsolute:i}=Js.destruct(t),s=i?[]:e.moduleIdentifier.slice(2).split("::");for(let[o,u]of n.entries()){switch(u.type){case"mcdoc:identifier":s.push(u.value);break;case"mcdoc:literal":if(s.length===0){r.reportErrors&&e.err.report(C("mcdoc.binder.path.super-from-root"),u);return}s.pop();break;default:Ir.assertNever(u)}yield{identifiers:s,node:u,index:o,indexRight:n.length-1-o}}}function sT(t,e,r={}){return Ou([...Py(t,e,r)],-1)?.identifiers}function oT(t,e){return e.symbols.global.mcdoc?.[t]?.definition?.[0]?.uri}function uT(t,e){return Object.values(e.symbols.global.mcdoc??{}).find(r=>r.subcategory==="module"&&r.definition?.some(n=>n.uri===t))?.identifier}function n0(t){return t?`::${t.join("::")}`:void 0}function kn(t,e){switch(t.type){case"mcdoc:enum":return Ny(t,e);case"mcdoc:struct":return Ly(t,e);case"mcdoc:type/any":return wT(t,e);case"mcdoc:type/boolean":return FT(t,e);case"mcdoc:type/dispatcher":return xT(t,e);case"mcdoc:type/list":return DT(t,e);case"mcdoc:type/literal":return vT(t,e);case"mcdoc:type/numeric_type":return ST(t,e);case"mcdoc:type/primitive_array":return _T(t,e);case"mcdoc:type/string":return TT(t,e);case"mcdoc:type/reference":return RT(t,e);case"mcdoc:type/tuple":return PT(t,e);case"mcdoc:type/union":return MT(t,e);default:return Ir.assertNever(t)}}function rr(t,e,r,n={}){let{attributes:i,appendixes:s}=Na.destruct(t),o=e;for(let u of s)if(vn.is(u)){if(n.skipFirstIndexBody){n.skipFirstIndexBody=!1;continue}o={kind:"indexed",child:o,parallelIndices:Oy(u,r)}}else o={kind:"concrete",child:o,typeArgs:dT(u,r)};return o=qp(o,i,r),o}function qp(t,e,r){for(let n of e)t={kind:"attributed",attribute:My(n,r),child:t};return t}function Hp(t,e){return aT(t.map(r=>My(r,e)))}function aT(t){return t.length?t:void 0}function My(t,e){let{name:r,value:n}=Wr.destruct(t);return{name:r.value,value:n&&Up(n,e)}}function Up(t,e){return t.type==="mcdoc:attribute/tree"?{kind:"tree",values:lT(t,e)}:kn(t,e)}function lT(t,e){let r={},{named:n,positional:i}=La.destruct(t);if(i){let{values:s}=Ia.destruct(i);for(let[o,u]of s.entries())r[o]=Up(u,e)}if(n){let{values:s}=$a.destruct(n);for(let{key:o,value:u}of s)r[o.value]=Up(u,e)}return r}function Oy(t,e){let{parallelIndices:r}=vn.destruct(t);return r.map(n=>cT(n,e))}function cT(t,e){return Oa.is(t)?fT(t,e):hT(t,e)}function fT(t,e){return{kind:"static",value:Ya(t)}}function hT(t,e){let{keys:r}=Hs.destruct(t);return{kind:"dynamic",accessor:r.map(Ya)}}function dT(t,e){let{args:r}=Ws.destruct(t);return r.map(n=>kn(n,e))}function Ny(t,e){let{block:r,enumKind:n,identifier:i}=Xn.destruct(t),s=i?.symbol??t.symbol;return s&&Za.is(s.data)&&s.data.typeDef.kind==="enum"?s.data.typeDef:rr(t,{kind:"enum",enumKind:n,values:pT(r,e)},e)}function pT(t,e){let{fields:r}=B1.destruct(t);return r.map(n=>mT(n,e))}function mT(t,e){let{attributes:r,identifier:n,value:i}=S1.destruct(t);return{attributes:Hp(r,e),identifier:n.value,value:gT(i,e)}}function gT(t,e){if(Yn.is(t)){let{value:r}=Yn.destruct(t);return r.value}return t.value}function Ly(t,e){let{block:r,identifier:n}=Qn.destruct(t),i=n?.symbol??t.symbol;return i&&Za.is(i.data)&&i.data.typeDef.kind==="struct"?i.data.typeDef:rr(t,{kind:"struct",fields:yT(r,e)},e)}function yT(t,e){let{fields:r}=T1.destruct(t);return r.map(n=>AT(n,e))}function AT(t,e){return Vi.is(t)?bT(t,e):ET(t,e)}function bT(t,e){let{attributes:r,key:n,type:i,isOptional:s}=Vi.destruct(t);return{kind:"pair",attributes:Hp(r,e),key:CT(n,e),type:kn(i,e),optional:s}}function CT(t,e){if(Ys.is(t)){let{type:r}=Ys.destruct(t);return kn(r,e)}else return Ya(t)}function ET(t,e){let{attributes:r,type:n}=R1.destruct(t);return{kind:"spread",attributes:Hp(r,e),type:kn(n,e)}}function wT(t,e){return rr(t,{kind:"any"},e)}function FT(t,e){return rr(t,{kind:"boolean"},e)}function xT(t,e){let{index:r,location:n}=Xs.destruct(t);return rr(t,{kind:"dispatcher",parallelIndices:Oy(r,e),registry:V.toString(n,"full")},e,{skipFirstIndexBody:!0})}function DT(t,e){let{item:r,lengthRange:n}=Ks.destruct(t);return rr(t,{kind:"list",item:kn(r,e),lengthRange:Ja(n,e)},e)}function Ja(t,e){if(!t)return;let{kind:r,min:n,max:i}=k1.is(t)?k1.destruct(t):ji.destruct(t);return{kind:r,min:n?.value,max:i?.value}}function vT(t,e){let{value:r}=za.destruct(t);return rr(t,{kind:"literal",value:kT(r,e)},e)}function kT(t,e){if(pt.is(t))return{kind:"boolean",value:t.value==="true"};if(Yn.is(t)){let{suffix:r,value:n}=Yn.destruct(t);return{kind:"number",value:n.value,suffix:BT(r,e)}}else return{kind:"string",value:t.value}}function BT(t,e){return t?.value?.toLowerCase()}function ST(t,e){let{numericKind:r,valueRange:n}=ja.destruct(t);return rr(t,{kind:r.value,valueRange:Ja(n,e)},e)}function _T(t,e){let{arrayKind:r,lengthRange:n,valueRange:i}=Ua.destruct(t);return rr(t,{kind:`${r.value}_array`,lengthRange:Ja(n,e),valueRange:Ja(i,e)},e)}function TT(t,e){let{lengthRange:r}=Va.destruct(t);return rr(t,{kind:"string",lengthRange:Ja(r,e)},e)}function RT(t,e){let{path:r}=Zs.destruct(t);return rr(t,{kind:"reference",path:n0(sT(r,e))},e)}function PT(t,e){let{items:r}=Gs.destruct(t);return rr(t,{kind:"tuple",items:r.map(n=>kn(n,e))},e)}function MT(t,e){let{members:r}=Qs.destruct(t);return rr(t,{kind:"union",members:r.map(n=>kn(n,e))},e)}function Ya(t){return V.is(t)?V.toString(t,"short"):t.value}var OT=t=>[Oe.create(t,"variable")],NT=t=>[Oe.create(t,t.colorTokenType??"literal")];function Iy(t){t.registerColorizer("mcdoc:literal",NT),t.registerColorizer("mcdoc:identifier",OT)}var zy=Object.freeze(["fallback","none","unknown","spawnitem"]),uU=Object.freeze({kind:"union",members:[]});var LT=Object.freeze(["b","s","l","f","d"]),jy=Object.freeze([...LT,"B","S","L","F","D"]),Kp=Object.freeze(["byte","short","int","long"]),s0=Object.freeze(["float","double"]),aU=Object.freeze([...Kp,...s0]),Gp=Object.freeze(["byte","int","long"]),lU=Object.freeze(Gp.map(t=>`${t}_array`)),i0;(function(t){function e(r){let n=s=>{if(!s)return"";let{kind:o,min:u,max:a}=s;return u===a?` @ ${u}`:` @ ${u??""}${Dy(o)}${a??""}`},i=s=>{let o=[];for(let u of Qe.toArray(s))u===void 0?o.push("()"):o.push(u.kind==="static"?`[${u.value}]`:`[[${u.accessor.map(a=>typeof a=="string"?a:a.keyword).join(".")}]]`);return`[${o.join(", ")}]`};if(r===void 0)return"";switch(r.kind){case"any":case"boolean":return r.kind;case"attributed":return`#[${r.attribute.name}${r.attribute.value?"=":""}] ${e(r.child)}`;case"byte":return`byte${n(r.valueRange)}`;case"byte_array":return`byte${n(r.valueRange)}[]${n(r.lengthRange)}`;case"concrete":return`${e(r.child)}${r.typeArgs.length?`<${r.typeArgs.map(e).join(", ")}>`:""}`;case"dispatcher":return`${r.registry??"spyglass:unknown"}[${i(r.parallelIndices)}]`;case"double":return`double${n(r.valueRange)}`;case"enum":return"";case"float":return`float${n(r.valueRange)}`;case"indexed":return`${e(r.child)}${i(r.parallelIndices)}`;case"int":return`int${n(r.valueRange)}`;case"int_array":return`int${n(r.valueRange)}[]${n(r.lengthRange)}`;case"list":return`[${e(r.item)}]${n(r.lengthRange)}`;case"literal":return`${r.value}`;case"long":return`long${n(r.valueRange)}`;case"long_array":return`long${n(r.valueRange)}[]${n(r.lengthRange)}`;case"reference":return r.path??"";case"short":return`short${n(r.valueRange)}`;case"string":return`string${n(r.lengthRange)}`;case"struct":return"";case"template":return`${e(r.child)}${r.typeParams.length?`<${r.typeParams.map(s=>`?${s.path}`).join(", ")}>`:""}`;case"tuple":return`[${r.items.map(s=>e(s)).join(",")}${r.items.length===1?",":""}]`;case"union":return`(${r.members.map(e).join(" | ")})`;case"unsafe":return"unsafe";default:return Ir.assertNever(r)}}t.toString=e})(i0||(i0={}));var mt;(function(t){t[t.Nah=0]="Nah",t[t.Assignable=1]="Assignable",t[t.StrictlyAssignable=3]="StrictlyAssignable"})(mt||(mt={}));var Xa=(t,e)=>{if(!e)return!0;if(!t)return!1;let{min:r,max:n}=t,{min:i,max:s}=e;return(i===void 0||r!==void 0&&r>=i)&&(s===void 0||n!==void 0&&n<=s)},N1=t=>{let e=new Set,r=n=>{for(let i of e){if((O1(n,i)&mt.StrictlyAssignable)===mt.StrictlyAssignable)return;(O1(i,n)&mt.StrictlyAssignable)===mt.StrictlyAssignable&&e.delete(i)}e.add(n)};for(let n of t.members)n.kind==="union"?N1(n).members.forEach(r):r(n);return{kind:"union",members:[...e]}};var IT=t=>(t=N1(t),t.members.length===1?t.members[0]:t),Qa=t=>({kind:"list",item:Wp(t.item),...t.lengthRange?{lengthRange:{...t.lengthRange}}:{}}),Wp=t=>(t.kind==="union"?t=IT(t):t.kind==="list"&&(t=Qa(t)),t),O1=(t,e,r=[])=>{let n=o=>o?mt.StrictlyAssignable:mt.Nah,i=o=>o?mt.Assignable:mt.Nah,s;return t=Wp(t),e=Wp(e),t.kind==="any"||t.kind==="reference"||e.kind==="reference"?s=mt.Assignable:e.kind==="any"?s=mt.StrictlyAssignable:t.kind==="union"?s=i(t.members.every(o=>O1(o,e,r))):e.kind==="union"?s=i(e.members.some(o=>O1(t,o))):t.kind==="boolean"?s=n(e.kind==="boolean"||e.kind==="byte"):t.kind==="byte"?e.kind==="boolean"?s=O1(t,{kind:"byte",valueRange:{kind:0,min:0,max:1}},r):e.kind==="byte"?s=n(Xa(t.valueRange,e.valueRange)):e.kind==="enum"?s=i(!e.enumKind||e.enumKind==="byte"):s=mt.Nah:t.kind==="byte_array"||t.kind==="int_array"||t.kind==="long_array"?s=n(e.kind===t.kind&&Xa(t.lengthRange,e.lengthRange)&&Xa(t.valueRange,e.valueRange)):t.kind==="struct"||t.kind==="dispatcher"?s=i(e.kind==="struct"||e.kind==="dispatcher"):t.kind==="enum"?s=i((e.kind==="byte"||e.kind==="float"||e.kind==="double"||e.kind==="int"||e.kind==="long"||e.kind==="short"||e.kind==="string")&&(!t.enumKind||t.enumKind===e.kind)):t.kind==="float"||t.kind==="double"||t.kind==="int"||t.kind==="long"||t.kind==="short"?e.kind===t.kind?s=n(Xa(t.valueRange,e.valueRange)):e.kind==="enum"?s=i(!e.enumKind||e.enumKind===t.kind):s=mt.Nah:t.kind==="list"?e.kind==="list"&&Xa(t.lengthRange,e.lengthRange)?s=O1(t.item,e.item,r):s=mt.Nah:t.kind==="string"?e.kind==="string"?s=mt.StrictlyAssignable:s=i(e.kind==="enum"&&(!e.enumKind||e.enumKind==="string")):s=mt.Nah,s||r.push(C("mcdoc.checker.type-not-assignable",L(i0.toString(t)),L(i0.toString(e)))),s};var Zy=E1(da({singleLinePrefixes:new Set(["//"])}),(t,e)=>!e.slice(t).startsWith("///"),C("mcdoc.parser.syntax.doc-comment-unexpected"));function Jy(t=!1){return(e,r)=>{let n=[];for(e.skipWhitespace();e.canRead()&&e.peek(2)==="//"&&(!t||e.peek(3)!=="///");){let i=Zy(e,r);n.push(i),e.skipWhitespace()}return n}}function j(t,e=!1){return(r,n)=>{r.skipWhitespace();let i=Be(t,Jy(e))(r,n);return r.skipWhitespace(),i}}function Zr(t,e=!1){return C1(t,Jy(e))}function Gr(t,e){return(r,n)=>{let i={type:"mcdoc:literal",range:b.create(r),value:"",colorTokenType:e?.colorTokenType};return i.value=r.readIf(s=>e?.allowedChars?.has(s)??(e?.specialChars?.has(s)||/[a-z]/i.test(s))),i.range.end=r.cursor,Qe.toArray(t).every(s=>s!==i.value)&&n.err.report(C("expected-got",gs(t),L(i.value)),i),i}}function qt(t,e={colorTokenType:"keyword"}){return(r,n)=>{let i=Gr(t,e)(r,n);return Qe.toArray(t).includes(i.value)?i:W}}function ne(t){return(e,r)=>{e.skipWhitespace(),e.trySkip(t)||r.err.report(C("expected-got",L(t),L(e.peek())),e)}}function Ae(t){return(e,r)=>{if(e.skipWhitespace(),!e.trySkip(t))return W}}function Zp(t){return E1(et(t),e=>e.namespace!==void 0,C("mcdoc.parser.resource-location.colon-expected",L(ee.NamespacePathSep)))}var $T=Object.freeze(["\0","","","","","","","\x07","\b"," ",` `,"\v","\f","\r","","","\x7F"]),L1=Wn(Ft({escapable:{characters:["b","f","n","r","t","\\",'"'],unicode:!0},quotes:['"']}),...$T),kr=(t,e)=>{let r=/^[\p{L}\p{Nl}]$/u,n=/^[\p{L}\p{Nl}\u200C\u200D\p{Mn}\p{Mc}\p{Nd}\p{Pc}]$/u,i=new Set(["any","boolean","byte","double","enum","false","float","int","long","short","string","struct","super","true"]),s={type:"mcdoc:identifier",range:b.create(t),options:{category:"mcdoc"},value:""},o=t.innerCursor;if(r.test(t.peek()))for(t.skip();n.test(t.peek());)t.skip();else e.err.report(C("expected",C("mcdoc.node.identifier")),t);return s.value=t.string.slice(o,t.innerCursor),s.range.end=t.cursor,i.has(s.value)&&e.err.report(C("mcdoc.parser.identifier.reserved-word",L(s.value)),s),s};function Jp(t){let e=le([{prefix:"%",parser:Gr(["%key","%parent"],{specialChars:new Set(["%"])})},{prefix:'"',parser:L1},{parser:kr}]),r=he("mcdoc:dynamic_index",j([ne("["),e,C1(Be([Ae("."),e])),ne("]")])),n=le([{prefix:"%",parser:Gr(zy.map(i=>`%${i}`),{specialChars:new Set(["%"])})},{prefix:'"',parser:L1},{prefix:"[",parser:t?.noDynamic?E1(r,()=>!1,C("mcdoc.parser.index-body.dynamic-index-not-allowed")):r},{parser:Fr([Zp({category:"mcdoc/dispatcher",accessType:t?.accessType}),kr])}]);return he("mcdoc:index_body",j([ne("["),n,Zr(j([Ae(","),fe(n)])),Se(Ae(",")),ne("]")]))}var Uy=le([{prefix:"super",parser:Gr("super")},{parser:kr}]),u0=(t,e)=>{let r;return t.trySkip("::")&&(r=!0),Q(Be([Uy,C1(Be([Ae("::"),Uy]))]),n=>({type:"mcdoc:path",children:n.children,range:n.range,isAbsolute:r}))(t,e)},Vy=he("mcdoc:attribute/tree/pos",j([{get:()=>o0},Zr(j([Ae(","),{get:()=>fe(o0)}],!0),!0)],!0)),qy=j([le([{prefix:'"',parser:L1},{parser:kr}]),le([{prefix:"=",parser:j([ne("="),{get:()=>o0}],!0)},{parser:{get:()=>Yp}}])],!0),Hy=he("mcdoc:attribute/tree/named",j([qy,Zr(j([Ae(","),fe(qy)],!0),!0)],!0)),zT=Fr([j([Hy,Se(Ae(","))]),j([Vy,ne(","),Hy,Se(Ae(","))]),j([Vy,Se(Ae(","))])]),jT=Object.freeze({"(":")","[":"]","{":"}"}),Yp=(t,e)=>{let r=t.trySkip("(")?"(":t.trySkip("[")?"[":t.trySkip("{")?"{":void 0;if(!r)return W;let n=zT(t,e),i={type:"mcdoc:attribute/tree",range:n.range,children:n.children,delim:r};return t.trySkip(jT[r]),i},o0=le([{predicate:t=>["(","[","{"].includes(t.peek()),parser:Yp},{parser:{get:()=>Vt}}]),UT=he("mcdoc:attribute",j([Ae("#["),kr,le([{prefix:"=",parser:j([ne("="),o0,ne("]")],!0)},{predicate:t=>["(","[","{"].includes(t.peek()),parser:j([Yp,ne("]")],!0)},{parser:ne("]")}])],!0)),Xp=C1(UT),Wy=he("mcdoc:type_param",j([kr])),VT=he("mcdoc:type_param_block",j([ne("<"),le([{prefix:">",parser:ne(">")},{parser:j([Wy,Zr(j([Ae(","),fe(Wy)])),Se(Ae(",")),ne(">")])}])])),Qp=()=>{},qT=da({singleLinePrefixes:new Set(["///"]),includesEol:!0}),HT=he("mcdoc:doc_comments",C1(qT,t=>(t.skipWhitespace(),[]))),I1=j([Se(fe(HT)),Xp]),Yy=le([{prefix:"<",parser:VT},{parser:Qp}]),WT=he("mcdoc:dispatch_statement",j([I1,qt("dispatch"),Zp({category:"mcdoc/dispatcher",accessType:1}),Jp({noDynamic:!0}),Yy,Gr("to"),{get:()=>Vt}],!0)),Xy=Gr(["byte","short","int","long","string","float","double"],{colorTokenType:"type"}),Qy=En({pattern:/^[-+]?(?:[0-9]+(?:[eE][-+]?[0-9]+)?|[0-9]*\.[0-9]+(?:[eE][-+]?[0-9]+)?)$/}),eA=he("mcdoc:typed_number",Be([Qy,Se(qt(jy,{colorTokenType:"keyword"}))])),KT=le([{prefix:'"',parser:L1},{parser:eA}]),Ky=he("mcdoc:enum/field",j([I1,kr,ne("="),KT],!0)),tA=he("mcdoc:enum/block",j([ne("{"),le([{prefix:"}",parser:ne("}")},{parser:j([Ky,Zr(j([Ae(","),fe(Ky)],!0),!0),Se(Ae(",")),ne("}")],!0)}])],!0)),rA=he("mcdoc:enum",j([I1,qt("enum"),ne("("),Xy,ne(")"),Se(ha(kr)),tA],!0)),GT=he("mcdoc:struct/map_key",j([ne("["),{get:()=>Vt},ne("]")],!0)),ZT=le([{prefix:'"',parser:L1},{prefix:"[",parser:GT},{parser:kr}]),JT=(t,e)=>{let r,n=j([I1,ZT],!0)(t,e);t.trySkip("?")&&(r=!0);let i=j([ne(":"),{get:()=>Vt}],!0)(t,e);return{type:"mcdoc:struct/field/pair",children:[...n.children,...i.children],range:b.span(n,i),isOptional:r}},YT=he("mcdoc:struct/field/spread",j([Xp,Ae("..."),{get:()=>Vt}],!0)),Gy=Fr([YT,JT]),nA=he("mcdoc:struct/block",j([ne("{"),le([{prefix:"}",parser:ne("}")},{parser:j([Gy,Zr(j([Ae(","),fe(Gy)],!0),!0),Se(Ae(",")),ne("}")],!0)}])],!0)),iA=he("mcdoc:struct",j([I1,qt("struct"),Se(fe(kr)),nA],!0)),XT=he("mcdoc:injection/enum",j([Gr("enum"),ne("("),Xy,ne(")"),u0,tA])),QT=he("mcdoc:injection/struct",j([Gr("struct"),u0,nA])),eR=he("mcdoc:injection",j([qt("inject"),le([{prefix:"enum",parser:XT},{parser:QT}])])),tR=he("mcdoc:type_alias",j([I1,qt("type"),kr,Yy,ne("="),{get:()=>Vt}],!0)),rR=he("mcdoc:use_statement",j([qt("use"),u0,le([{prefix:"as",parser:j([Gr("as"),kr])},{parser:Qp}])],!0)),nR=Fr([Zy,WT,rA,eR,iA,tR,rR]),sA=he("mcdoc:module",Zr(nR,!0)),iR=he("mcdoc:type_arg_block",j([Ae("<"),le([{prefix:">",parser:ne(">")},{parser:j([{get:()=>Vt},Zr(j([Ae(","),{get:()=>fe(Vt)}],!0),!0),Se(Ae(",")),ne(">")],!0)}])]));function Jr(t,e){return he(t,j([Xp,e,Zr(le([{prefix:"<",parser:iR},{parser:ha(Jp())}]),!0)],!0))}var sR=Jr("mcdoc:type/any",qt("any",{colorTokenType:"type"})),oR=Jr("mcdoc:type/boolean",qt("boolean",{colorTokenType:"type"})),uR=Kn({pattern:/^(?:0|[-+]?[1-9][0-9]*)$/});function oA(t,e){let r=i=>i.tryPeek("..")||i.tryPeek(`${Kr}..`),n=Gr(["..",`..${Kr}`,`${Kr}..`,`${Kr}..${Kr}`],{allowedChars:new Set([".",Kr])});return he(t,le([{predicate:r,parser:Be([n,e])},{parser:Be([Wn(e,".."),le([{predicate:r,parser:Be([n,Se(fe(e))])},{parser:Qp}])])}]))}var aR=oA("mcdoc:int_range",uR),el=Se((t,e)=>t.trySkip("@")?(t.skipWhitespace(),aR(t,e)):W),lR=Jr("mcdoc:type/string",j([qt("string",{colorTokenType:"type"}),el])),cR=Jr("mcdoc:type/literal",le([{predicate:t=>t.tryPeek("false")||t.tryPeek("true"),parser:qt(["false","true"],{colorTokenType:"type"})},{prefix:'"',parser:fe(L1)},{parser:ha(eA)}])),fR=oA("mcdoc:float_range",Qy),hR=Se((t,e)=>t.trySkip("@")?(t.skipWhitespace(),fR(t,e)):W),dR=Jr("mcdoc:type/numeric_type",le([{predicate:t=>s0.some(e=>t.tryPeek(e)),parser:j([qt(s0,{colorTokenType:"type"}),hR],!0)},{parser:j([qt(Kp,{colorTokenType:"type"}),el],!0)}])),pR=Jr("mcdoc:type/primitive_array",j([Gr(Gp),el,qt("[]",{allowedChars:new Set(["[","]"]),colorTokenType:"type"}),el])),mR=Jr("mcdoc:type/list",j([Ae("["),{get:()=>Vt},ne("]"),el],!0)),gR=Jr("mcdoc:type/tuple",j([Ae("["),{get:()=>Vt},Ae(","),le([{prefix:"]",parser:ne("]")},{parser:j([{get:()=>Vt},Zr(j([Ae(","),{get:()=>fe(Vt)}],!0),!0),Se(Ae(",")),ne("]")],!0)}])],!0)),yR=Jr("mcdoc:type/dispatcher",j([ha(Zp({category:"mcdoc/dispatcher"})),Jp()])),AR=Jr("mcdoc:type/union",j([Ae("("),le([{prefix:")",parser:ne(")")},{parser:j([{get:()=>Vt},Zr(j([Ae("|"),{get:()=>fe(Vt)}],!0),!0),Se(Ae("|")),ne(")")],!0)}])])),bR=Jr("mcdoc:type/reference",j([u0])),Vt=Fr([sR,oR,yR,rA,mR,cR,dR,pR,lR,iA,gR,AR,bR]);function uA(t){return`::${t.join("::")}`}var $1=".mcdoc",aA="mcdoc/",lA=(t,e)=>{let r=[];for(let n of t){if(!n.endsWith($1))continue;let i=X.getRel(n,e.roots);i&&(i=i.slice(0,-$1.length).replace(/(^|\/)mod$/,""),r.push([n,i]))}r.every(([n,i])=>i.startsWith(aA))&&(r=r.map(([n,i])=>[n,i.slice(aA.length)]));for(let[n,i]of r)e.symbols.query(n,"mcdoc",uA(i.split("/"))).ifKnown(()=>{}).elseEnter({data:{subcategory:"module"},usage:{type:"definition"}})},cA=(t,e,r)=>t.endsWith($1)&&!e.endsWith($1)?-1:!t.endsWith($1)&&e.endsWith($1)?1:r(t,e);var fA=({meta:t})=>{t.registerLanguage("mcdoc",{extensions:[".mcdoc"],parser:sA}),t.registerUriBinder(lA),t.setUriSorter(cA),Vp(t),Iy(t)};function hA(t){t.registerColorizer("nbt:byte",We.number),t.registerColorizer("nbt:short",We.number),t.registerColorizer("nbt:int",We.number),t.registerColorizer("nbt:long",We.number),t.registerColorizer("nbt:float",We.number),t.registerColorizer("nbt:double",We.number)}var Bn={};Rr(Bn,{byteArray:()=>rm,compound:()=>Hi,entry:()=>Wi,intArray:()=>nm,list:()=>tm,longArray:()=>im,path:()=>sm,primitive:()=>ro,string:()=>em});function Br(t){return C(`nbt.node.${t.replace(/^nbt:/,"")}`)}var Hi=(t,e)=>he("nbt:compound",qr({start:"{",pair:{key:fe(Ft({...Pi,colorTokenType:"property"})),sep:":",value:Wi,end:",",trailingEnd:!1},end:"}"}))(t,e);var pA=(2-2**-23)*2**127,wR=[{pattern:/^[-+]?(?:0|[1-9][0-9]*)b$/i,type:"nbt:byte",hasSuffix:!0,group:2,min:-128,max:127},{pattern:/^[-+]?(?:0|[1-9][0-9]*)s$/i,type:"nbt:short",hasSuffix:!0,group:2,min:-32768,max:32767},{pattern:/^[-+]?(?:0|[1-9][0-9]*)$/,type:"nbt:int",hasSuffix:!1,group:2,min:-2147483648,max:2147483647},{pattern:/^[-+]?(?:0|[1-9][0-9]*)l$/i,type:"nbt:long",hasSuffix:!0,group:3,min:-9223372036854775808n,max:9223372036854775807n},{pattern:/^[-+]?(?:[0-9]+\.?|[0-9]*\.[0-9]+)(?:e[-+]?[0-9]+)?f$/i,type:"nbt:float",hasSuffix:!0,group:1,min:-pA,max:pA},{pattern:/^[-+]?(?:[0-9]+\.|[0-9]*\.[0-9]+)(?:e[-+]?[0-9]+)?$/i,type:"nbt:double",hasSuffix:!1,group:1,min:-Number.MAX_VALUE,max:Number.MAX_VALUE},{pattern:/^[-+]?(?:[0-9]+\.?|[0-9]*\.[0-9]+)(?:e[-+]?[0-9]+)?d$/i,type:"nbt:double",hasSuffix:!0,group:1,min:-Number.MAX_VALUE,max:Number.MAX_VALUE},{pattern:/^true$/i,type:"nbt:byte",value:1,group:0},{pattern:/^false$/i,type:"nbt:byte",value:0,group:0}],em=Ns,ro=(t,e)=>{if(ke.isBrigadierQuote(t.peek()))return em(t,e);let{result:r,updateSrcAndCtx:n}=tr(em,t,e);for(let i of wR)if(i.pattern.test(r.value)){if(i.group===0){let c={type:"nbt:byte",range:r.range,value:i.value};return n(),c}let s=!1,o=()=>s=!0,u=i.group===2?Kn({pattern:/./,min:i.min,max:i.max,onOutOfRange:o}):i.group===3?pa({pattern:/./,min:i.min,max:i.max,onOutOfRange:o}):En({pattern:/./,min:i.min,max:i.max,onOutOfRange:o}),{result:a,updateSrcAndCtx:l}=tr(u,t,e);if(s){e.err.report(C("nbt.parser.number.out-of-range",Br(i.type),C("nbt.node.string"),i.min,i.max),r,2);break}return l(),i.hasSuffix&&(t.skip(),a.range.end++),{...a,type:i.type}}return n(),r};var Wi=(t,e)=>fe(le([{predicate:r=>r.tryPeek("[B;"),parser:rm},{predicate:r=>r.tryPeek("[I;"),parser:nm},{predicate:r=>r.tryPeek("[L;"),parser:im},{predicate:r=>r.tryPeek("["),parser:tm},{predicate:r=>r.tryPeek("{"),parser:Hi},{parser:ro}]))(t,e);var tm=(t,e)=>{let n=Ri({start:"[",value:Wi,sep:",",trailingSep:!1,end:"]"})(t,e);if(n.type="nbt:list",n.valueType=n.children[0]?.value?.type,n.valueType)for(let{value:i}of n.children)i&&i.type!==n.valueType&&e.err.report(C("expected-got",Br(n.valueType),Br(i.type)),i);return n},rm=(t,e)=>{let n=Ri({start:"[B;",value:ro,sep:",",trailingSep:!1,end:"]"})(t,e);n.type="nbt:byte_array";for(let{value:i}of n.children)i&&i.type!=="nbt:byte"&&e.err.report(C("expected-got",C("nbt.node.byte"),Br(i.type)),i);return n},nm=(t,e)=>{let n=Ri({start:"[I;",value:ro,sep:",",trailingSep:!1,end:"]"})(t,e);n.type="nbt:int_array";for(let{value:i}of n.children)i&&i.type!=="nbt:int"&&e.err.report(C("expected-got",C("nbt.node.int"),Br(i.type)),i);return n},im=(t,e)=>{let n=Ri({start:"[L;",value:ro,sep:",",trailingSep:!1,end:"]"})(t,e);n.type="nbt:long_array";for(let{value:i}of n.children)i&&i.type!=="nbt:long"&&e.err.report(C("expected-got",C("nbt.node.long"),Br(i.type)),i);return n};var sm=(t,e)=>{let r={type:"nbt:path",children:[],range:b.create(t)},n=["filter","key"],i=mA(t),s;for(;s!==t.cursor&&(n.includes(i)||e.err.report(C("expected-got",gs(n.map(gA),!1,"or"),gA(i)),t),i!=="end");)s=t.cursor,n=vR[i](r.children,t,e),i=mA(t);return r.range.end=t.cursor,r},FR=(t,e,r)=>(t.push(Hi(e,r)),e.trySkip(".")?["key"]:["end"]),xR=(t,e,r)=>{let n={type:"nbt:path/index",children:void 0,range:b.create(e)};if(!e.trySkip("["))throw new Error(`NBT path index parser called at illegal position: \u201C${e.peek()}\u201D at ${e.cursor}`);e.skipSpace();let i=e.peek();return i==="{"?n.children=[Hi(e,r)]:i!=="]"&&(n.children=[Kn({pattern:/^-?\d+$/})(e,r)]),e.skipSpace(),e.trySkip("]")||r.err.report(C("expected-got",L("]"),L(e.peek())),e),n.range.end=e.cursor,t.push(n),e.trySkip(".")?["index","key"]:["end","index"]},DR=(t,e,r)=>{let n=Ft({colorTokenType:"property",escapable:{},quotes:['"',"'"],unquotable:{blockList:new Set([` `,"\r"," "," ",'"',"[","]",".","{","}"])}})(e,r);return t.push(n),e.trySkip(".")?["index","key"]:["end","filter","index"]};function mA(t){switch(t.peek()){case"":case" ":case` `:case"\r":return"end";case"{":return"filter";case"[":return"index";default:return"key"}}function gA(t){return C(`nbt.node.path.${t}`)}var vR={filter:FR,index:xR,key:DR};var nr={};Rr(nr,{blockStates:()=>Em,compound:()=>xA,definition:()=>FA,enum_:()=>_R,fieldValue:()=>rl,index:()=>wA,path:()=>TR});var yA;(function(t){function e(r){return om.is(r)||Yr.is(r)||gm.is(r)}t.is=e})(yA||(yA={}));var om;(function(t){function e(r){return um.is(r)||ht.is(r)}t.is=e})(om||(om={}));var um;(function(t){function e(r){return am.is(r)||dm.is(r)}t.is=e})(um||(um={}));var am;(function(t){function e(r){return lm.is(r)||cm.is(r)||fm.is(r)||hm.is(r)}t.is=e})(am||(am={}));var lm;(function(t){function e(r){return r?.type==="nbt:byte"}t.is=e})(lm||(lm={}));var cm;(function(t){function e(r){return r?.type==="nbt:short"}t.is=e})(cm||(cm={}));var fm;(function(t){function e(r){return r?.type==="nbt:int"}t.is=e})(fm||(fm={}));var hm;(function(t){function e(r){return r?.type==="nbt:long"}t.is=e})(hm||(hm={}));var dm;(function(t){function e(r){return pm.is(r)||mm.is(r)}t.is=e})(dm||(dm={}));var pm;(function(t){function e(r){return r?.type==="nbt:float"}t.is=e})(pm||(pm={}));var mm;(function(t){function e(r){return r?.type==="nbt:double"}t.is=e})(mm||(mm={}));var Yr;(function(t){function e(r){return r?.type==="nbt:compound"}t.is=e})(Yr||(Yr={}));var gm;(function(t){function e(r){return tl.is(r)||ym.is(r)}t.is=e})(gm||(gm={}));var tl;(function(t){function e(r){return r?.type==="nbt:list"}t.is=e})(tl||(tl={}));var ym;(function(t){function e(r){return Am.is(r)||bm.is(r)||Cm.is(r)}t.is=e})(ym||(ym={}));var Am;(function(t){function e(r){return r?.type==="nbt:byte_array"}t.is=e})(Am||(Am={}));var bm;(function(t){function e(r){return r?.type==="nbt:int_array"}t.is=e})(bm||(bm={}));var Cm;(function(t){function e(r){return r?.type==="nbt:long_array"}t.is=e})(Cm||(Cm={}));var z1;(function(t){function e(r){return r?.type==="nbt:path"}t.is=e})(z1||(z1={}));var AA;(function(t){function e(r){return r?.type==="nbt:path/index"}t.is=e})(AA||(AA={}));var kR={"minecraft:brain_coral_fan":["minecraft:brain_coral_fan","minecraft:brain_coral_wall_fan"],"minecraft:bubble_coral_fan":["minecraft:bubble_coral_fan","minecraft:bubble_coral_wall_fan"],"minecraft:fire_coral_fan":["minecraft:fire_coral_fan","minecraft:fire_coral_wall_fan"],"minecraft:horn_coral_fan":["minecraft:horn_coral_fan","minecraft:horn_coral_wall_fan"],"minecraft:tube_coral_fan":["minecraft:tube_coral_fan","minecraft:tube_coral_wall_fan"],"minecraft:creeper_head":["minecraft:creeper_head","minecraft:creeper_wall_head"],"minecraft:dragon_head":["minecraft:dragon_head","minecraft:dragon_wall_head"],"minecraft:player_head":["minecraft:player_head","minecraft:player_wall_head"],"minecraft:skeleton_skull":["minecraft:skeleton_skull","minecraft:skeleton_wall_skull"],"minecraft:wither_skeleton_skull":["minecraft:wither_skeleton_skull","minecraft:wither_skeleton_wall_skull"],"minecraft:dead_brain_coral_fan":["minecraft:dead_brain_coral_fan","minecraft:dead_brain_coral_wall_fan"],"minecraft:dead_bubble_coral_fan":["minecraft:dead_bubble_coral_fan","minecraft:dead_bubble_coral_wall_fan"],"minecraft:dead_fire_coral_fan":["minecraft:dead_fire_coral_fan","minecraft:dead_fire_coral_wall_fan"],"minecraft:dead_horn_coral_fan":["minecraft:dead_horn_coral_fan","minecraft:dead_horn_coral_wall_fan"],"minecraft:dead_tube_coral_fan":["minecraft:dead_tube_coral_fan","minecraft:dead_tube_coral_wall_fan"],"minecraft:torch":["minecraft:torch","minecraft:wall_torch"],"minecraft:soul_torch":["minecraft:soul_torch","minecraft:soul_wall_torch"],"minecraft:redstone_torch":["minecraft:redstone_torch","minecraft:redstone_wall_torch"],"minecraft:beetroot_seeds":["minecraft:beetroots"],"minecraft:carrot":["minecraft:carrots"],"minecraft:cocoa_beans":["minecraft:cocoa"],"minecraft:glow_berries":["minecraft:cave_vines"],"minecraft:melon_seeds":["minecraft:melon_stem"],"minecraft:potato":["minecraft:potatoes"],"minecraft:pumpkin_seeds":["minecraft:pumpkin_stem"],"minecraft:redstone":["minecraft:redstone_wire"],"minecraft:string":["minecraft:tripwire"],"minecraft:sweat_berries":["minecraft:sweat_berry_bush"],"minecraft:wheat_seeds":["minecraft:wheat"]};function bA(t){return kR[t]}function CA(t){if(t==="minecraft:armor_stand")return t;let e=t.match(/^minecraft:([a-z0-9_]+)_spawn_egg$/);if(e)return`minecraft:${e[1]}`}var BR={"::minecraft::block::banner::Banner.CustomName":"mcfunction:component","::minecraft::block::brewingstand::BrewingStand.CustomName":"mcfunction:component","::minecraft::block::commandblock::CommandBlock.Command":"mcfunction:command","::minecraft::block::commandblock::CommandBlock.CustomName":"mcfunction:component","::minecraft::block::container::ContainerBase.CustomName":"mcfunction:component","::minecraft::block::enchantingtable::EnchantingTable.CustomName":"mcfunction:component","::minecraft::block::furnace::Furnace.CustomName":"mcfunction:component","::minecraft::block::hopper::Hopper.CustomName":"mcfunction:component","::minecraft::block::sign::Sign.Text1":"mcfunction:component","::minecraft::block::sign::Sign.Text2":"mcfunction:component","::minecraft::block::sign::Sign.Text3":"mcfunction:component","::minecraft::block::sign::Sign.Text4":"mcfunction:component","::minecraft::entity::effectcloud::EffectCloud.Particle":"mcfunction:particle","::minecraft::entity::minecart::CommandMinecart.Command":"mcfunction:command","::minecraft::entity::mob::LivingEntity.Team":"mcfunction:team","::minecraft::entity::EntityBase.Tags[]":"mcfunction:tag","::minecraft::item::blockitem::BlockItem.CanPlaceOn[]":"mcfunction:block_predicate","::minecraft::item::book::WrittenBook.pages[]":"mcfunction:component","::minecraft::item::ItemBase.CanDestroy[]":"mcfunction:block_predicate"};function EA(t){return BR[t]}function wA(t,e,r={}){switch(t){case"custom:blockitemstates":let n=bA(e);return n?Em(n,r):Rt.noop;case"custom:blockstates":return Em([e],r);case"custom:spawnitemtag":let i=CA(e);return i?wA("entity_type",i,r):Rt.noop;default:let s=SR(t);return s?(o,u)=>{FA(s,r)(o,u)}:Rt.noop}}function SR(t){switch(t){case"block":return"::java::server::world::block::BlockEntity";case"entity_type":return"::java::server::world::entity::AnyEntity";case"item":return"::java::server::world::item::AnyItem";default:return}}function FA(t,e={}){return(r,n)=>{let s=n.symbols.query(n.doc,"mcdoc",t).getData(to.TypeDefSymbolData.is)?.typeDef;if(s)switch(s.kind){case"struct":xA(s,e)(r,n);break;default:n.logger.error(`[nbt.checker.definition] Expected a struct type, but got ${s.kind}`)}}}function Em(t,e={}){return(r,n)=>{let i=rf("block",t,n);for(let{key:s,value:o}of r.children)if(!(!s||!o)){if(o.type==="nbt:byte"&&(n.src.slice(o.range).toLowerCase()==="false"||n.src.slice(o.range).toLowerCase()==="true")){n.err.report(C("nbt.checker.block-states.fake-boolean"),o,2);continue}else if(o.type!=="string"&&o.type!=="nbt:int"){n.err.report(C("nbt.checker.block-states.unexpected-value-type"),o,2);continue}if(Object.keys(i).includes(s.value)){let u=i[s.value];u.includes(o.value.toString())||n.err.report(C("expected-got",u,L(o.value.toString())),o,2)}else n.err.report(C("nbt.checker.block-states.unknown-state",L(s.value),t),s,2)}}}function xA(t,e={}){return(r,n)=>{for(let{key:i,value:s}of r.children){if(!i||!s)continue;let o=i.value,u=t.fields.find(a=>a.kind==="pair"&&a.key===o);u?rl(u.type,e)(s,n):e.allowUnknownKey||n.err.report(C("unknown-key",L(o)),i,2)}}}function _R(t,e={}){return t?(r,n)=>{}:Rt.noop}function TR(t,e){return(r,n)=>{}}function rl(t,e){let r=(i,{kind:s,min:o=-1/0,max:u=1/0})=>{let a=(l,c,f)=>f?l{if(t.kind!=="any"&&t.kind!=="dispatcher"&&t.kind!=="enum"&&t.kind!=="literal"&&t.kind!=="reference"&&t.kind!=="union"&&t.kind!=="attributed"&&t.kind!=="unsafe"&&t.kind!=="concrete"&&t.kind!=="indexed"&&t.kind!=="template"&&i.type!==n[t.kind]){s.err.report(C("expected",Br(n[t.kind])),i,2);return}switch(t.kind){case"boolean":i=i,i.value!==0&&i.value!==1&&s.err.report(C("nbt.checker.boolean.out-of-range",L("0b"),L("1b")),i,2);break;case"byte_array":case"int_array":case"long_array":if(i=i,t.lengthRange&&!r(i.children.length,t.lengthRange)&&s.err.report(C("expected",C("nbt.checker.collection.length-between",Br(i.type),t.lengthRange.min??"-\u221E",t.lengthRange.max??"+\u221E")),i,2),t.valueRange)for(let{value:a}of i.children)a&&!r(Number(a.value),t.valueRange)&&s.err.report(C("number.between",t.valueRange.min??"-\u221E",t.valueRange.max??"+\u221E"),i,2);break;case"byte":case"short":case"int":case"long":case"float":case"double":i=i,t.valueRange&&!r(Number(i.value),t.valueRange)&&s.err.report(C("number.between",t.valueRange.min??"-\u221E",t.valueRange.max??"+\u221E"),i,2);break;case"dispatcher":i=i;break;case"list":i=i,t=Qa(t),t.lengthRange&&!r(i.children.length,t.lengthRange)&&s.err.report(C("expected",C("nbt.checker.collection.length-between",Br(i.type),t.lengthRange.min??"-\u221E",t.lengthRange.max??"+\u221E")),i,2);for(let{value:a}of i.children)a&&rl(t.item,e)(a,s);break;case"string":i=i;let o="",u=i;if(cf.is(i.parent)&&tl.is(i.parent.parent)&&(o="[]",u=i.parent.parent),$n.is(u.parent)){let a=u.parent.key?.symbol?.parentSymbol?.path.join("::"),l=u.parent.key?.value,c=`${a}.${l}${o}`,f=EA(c);if(f)try{let h=s.meta.getParser(f),d=np(h,i.value,i.valueMap,s);d!==W&&(i.children=[d],d.parent=i)}catch(h){s.logger.error("[nbt.checker.fieldValue#string]",h)}}break;case"reference":i=i;break;case"union":t=N1(t),t.members.length===0?s.err.report(C("nbt.checker.compound.field.union-empty-members"),$n.is(i.parent)?i.parent.key??i.parent:i,2):Rt.any(t.members.map(a=>rl(a,e)))(i,s);break;case"attributed":rl(t.child,e)(i,s);break}}}var DA=({meta:t})=>{t.registerLanguage("nbt",{extensions:[".snbt"],parser:Wi}),t.registerParser("nbt:entry",Wi),t.registerParser("nbt:compound",Hi),t.registerParser("nbt:path",sm),hA(t)};var Pt;(function(t){function e(r,n){return Math.sign(Number(r.slice(2))-Number(n.slice(2)))}t.cmp=e})(Pt||(Pt={}));var l0;(function(t){function e(r){if(!r?.pack?.pack_format?.toString())throw new Error("\u201Cpack.pack_format\u201D undefined")}t.assert=e})(l0||(l0={}));function vA(t,{packMcmeta:e,versions:r}){function n(o){if(o.release_target)return o.release_target;if(o.type==="release")return o.id;let u=r.findIndex(a=>a.id===o.id);for(let a=u;a>=0;a-=1)if(r[a].type==="release")return r[a].id;return"1.21"}function i(o){return o=o??r[0],{id:o.id,name:o.name,release:n(o),isLatest:o===r[0]}}if(r.length===0)throw new Error("mcmeta version list is empty");t=t.toLowerCase(),r=r.sort((o,u)=>u.data_version-o.data_version);let s=r.find(o=>o.type==="release");if(t==="auto"){if(e&&s){if(e.pack.pack_format>s.data_pack_version)return i(r[0]);let o;for(let u of r)if(u.type==="release"){if(e.pack.pack_format>u.data_pack_version)return i(o);if(e.pack.pack_format===u.data_pack_version)return i(u);o=u}return i(o)}return i(s)}else{if(t==="latest release")return i(s);if(t==="latest snapshot")return i(r[0])}return i(r.find(o=>t===o.id.toLowerCase()||t===o.name.toLowerCase()))}var RR={fastly:"https://fastly.jsdelivr.net/gh/${user}/${repo}@${tag}/${path}",github:"https://raw.githubusercontent.com/${user}/${repo}/${tag}/${path}",jsdelivr:"https://cdn.jsdelivr.net/gh/${user}/${repo}@${tag}/${path}"};function kA(t,e,r){let n=e?"summary":`${t}-summary`;function i(s){let u=(RR[r.toLowerCase()]??r).replace(/\${user}/g,"misode").replace(/\${repo}/g,"mcmeta").replace(/\${tag}/g,n).replace(/\${path}/g,s);if(!zc.is(u))throw new Error(`Expected a remote URI from data source template but got ${u}`);return u}return{blocks:i("blocks/data.json.gz"),commands:i("commands/data.json.gz"),registries:i("registries/data.json.gz")}}function BA(t){let e="mcmeta://summary/registries.json";function r(i,s,o){let u=`${i[0].toUpperCase()}${i.slice(1)}`;for(let[a,[l,c]]of Object.entries(s)){let f=e;o.query(f,i,ee.lengthen(a)).onEach(Object.entries(l),([h,d],p)=>{let y=c[h];p.member(`${f}#${u}_states`,h,m=>{m.enter({data:{subcategory:"state"},usage:{type:"declaration"}}).onEach(d,A=>{m.member(A,w=>{w.enter({data:{subcategory:"state_value"},usage:{type:"declaration"}}),A===y&&m.amend({data:{relations:{default:{category:i,path:w.path}}}})})})})})}}function n(i,s){function o(u){return Yo.includes(u)||ys.includes(u)}for(let[u,a]of Object.entries(i))if(o(u))for(let l of a)s.query(e,u,ee.lengthen(l)).enter({usage:{type:"declaration"}})}return i=>{n(t.registries,i),r("block",t.blocks,i),r("fluid",t.fluids,i)}}var SA={flowing_lava:[{falling:["false","true"],level:["1","2","3","4","5","6","7","8"]},{falling:"false",level:"1"}],flowing_water:[{falling:["false","true"],level:["1","2","3","4","5","6","7","8"]},{falling:"false",level:"1"}],lava:[{falling:["false","true"]},{falling:"false"}],water:[{falling:["false","true"]},{falling:"false"}]};var nl=15e3;async function _A(t,e){return e.download({id:"mc-je/versions.json.gz",uri:"https://raw.githubusercontent.com/misode/mcmeta/summary/versions/data.json.gz",transformer:r=>wd(t,r),cache:c0("misode","mcmeta","refs/heads/summary"),ttl:nl})}async function TA(t,e,r,n,i,s,o={}){let u=RA({defaultBranch:"summary",getTag:m=>`${m}-summary`,isLatest:i,version:n}),a=kA(n,i,s),l;async function c(m,A){if(A)try{let w=await X.readJson(t,A.path);return A.replace?w:Mu(m,w)}catch(w){r.error(`[je] [mcmeta-overrides] Failed loading customized mcmeta summary file \u201C${A.path}\u201D`,w)}return m}let f=async(m,A)=>{let w={},k=await e.download({id:`mc-je/${n}/${m}.json.gz`,uri:a[m],transformer:E=>wd(t,E),cache:c0("misode","mcmeta",u),ttl:nl},w);return l||=w.checksum,c(k,A)},[h,d,p,y]=[await f("blocks",o.blocks),await f("commands",o.commands),await c(SA,o.fluids),await f("registries",o.registries)];return{blocks:h,commands:d,fluids:p,registries:y,checksum:l}}function RA({defaultBranch:t,getTag:e,isLatest:r,version:n}){return r?`refs/heads/${t}`:`refs/tags/${e(n)}`}var Fm={headers:{Accept:"application/vnd.github.v3+json","User-Agent":"SpyglassMC"}};function c0(t,e,r){return{checksumExtension:".commit-sha",checksumJob:{uri:`https://api.github.com/repos/${t}/${e}/git/${r}`,transformer:n=>{let i=JSON.parse(br(n));if(Array.isArray(i))return i[0].object.sha;if(i.message===void 0)return i.object.sha;throw new Error(i.message)},options:Fm,ttl:nl}}}async function PR({defaultBranch:t,downloader:e,getTag:r,repo:n,isLatest:i,owner:s,version:o}){let u=RA({defaultBranch:t,getTag:r,isLatest:i,version:o}),a={};return await e.download({id:`mc-je/${o}/${n}.tar.gz`,uri:`https://api.github.com/repos/${s}/${n}/tarball/${u}`,transformer:l=>l,cache:c0(s,n,u),options:Fm,ttl:nl},a),a.cacheUri}async function PA(t,e,r){let n=await PR({defaultBranch:"data",downloader:t,getTag:i=>`${i}-data`,owner:"misode",repo:"mcmeta",isLatest:r,version:e});return{info:{startDepth:1},uri:n}}async function MA(t){let e="SpyglassMC",r="vanilla-mcdoc",n="refs/heads/main",i={};return await t.download({id:"mc-je/vanilla-mcdoc.tar.gz",uri:`https://api.github.com/repos/${e}/${r}/tarball/${n}`,transformer:s=>s,cache:c0(e,r,n),options:Fm,ttl:nl},i),{info:{startDepth:1},uri:i.cacheUri}}var OR=(()=>{let t=new Set(["block","fluid","function","game_event","item","worldgen/block_placer_type","worldgen/surface_builder"]),e=new Map([["advancements",{category:"advancement",extname:".json"}],["dimension",{category:"dimension",extname:".json",since:"1.16"}],["dimension_type",{category:"dimension_type",extname:".json",since:"1.16"}],["functions",{category:"function",extname:".mcfunction"}],["item_modifiers",{category:"item_modifier",extname:".json",since:"1.17"}],["loot_tables",{category:"loot_table",extname:".json"}],["predicates",{category:"predicate",extname:".json"}],["recipes",{category:"recipe",extname:".json"}],["tags/blocks",{category:"tag/block",extname:".json"}],["tags/entity_types",{category:"tag/entity_type",extname:".json"}],["tags/fluids",{category:"tag/fluid",extname:".json"}],["tags/functions",{category:"tag/function",extname:".json"}],["tags/game_events",{category:"tag/game_event",extname:".json",since:"1.17"}],["tags/items",{category:"tag/item",extname:".json"}],["worldgen/biome",{category:"worldgen/biome",extname:".json",since:"1.16"}],["worldgen/configured_carver",{category:"worldgen/configured_carver",extname:".json",since:"1.16"}],["worldgen/configured_feature",{category:"worldgen/configured_feature",extname:".json",since:"1.16"}],["worldgen/configured_structure_feature",{category:"worldgen/configured_structure_feature",extname:".json",since:"1.16"}],["worldgen/configured_surface_builder",{category:"worldgen/configured_surface_builder",extname:".json",since:"1.16",until:"1.17"}],["worldgen/density_function",{category:"worldgen/density_function",extname:".json",since:"1.18"}],["worldgen/noise",{category:"worldgen/noise",extname:".json",since:"1.18"}],["worldgen/noise_settings",{category:"worldgen/noise_settings",extname:".json",since:"1.16"}],["worldgen/placed_feature",{category:"worldgen/placed_feature",extname:".json",since:"1.18"}],["worldgen/processor_list",{category:"worldgen/processor_list",extname:".json",since:"1.16"}],["worldgen/template_pool",{category:"worldgen/template_pool",extname:".json",since:"1.16"}]]);for(let r of Od)t.has(r)||e.set(`tags/${r}`,{category:`tag/${r}`,extname:".json",since:"1.18"});return e})();function*NR(t,e){yield*X.getRels(t,e);let r=t.split("/");for(let n=r.length-2;n>=0;n--)r[n]==="data"&&(yield r.slice(n).join("/"))}function xm(t,e){let r=/^data\/([^\/]+)\/((?:tags\/|worldgen\/)?[a-z_]+)\/(.*)(\.(?:mcfunction|json))$/,n=NR(t,e.roots);for(let i of n){let s=i.match(r);if(!s)continue;let o=OR.get(s[2]);if(!o||o.extname!==s[4])continue;let u=e.project.loadedVersion;if(!(!u||!LR(u,o.since,o.until)))return{category:o.category,namespace:s[1],identifier:s[3]}}}var OA=(t,e)=>{for(let r of t){let n=xm(r,e);n&&e.symbols.query(r,n.category,`${n.namespace}:${n.identifier}`).enter({usage:{type:"definition"}})}};function LR(t,e,r){return!(e&&Pt.cmp(t,e)<0||r&&Pt.cmp(r,t)<0)}var IR=t=>[Oe.create(t,"literal")],$R=t=>[Oe.create(t,"literal")],zR=(t,e)=>{let r=[];for(let n of t.children)if(n.key&&r.push(Oe.create(n.key,"property")),n.value){let i=e.meta.getColorizer(n.value.type);r.push(...i(n.value,e))}return r};function NA(t){t.registerColorizer("json:boolean",IR),t.registerColorizer("json:null",$R),t.registerColorizer("json:number",We.number),t.registerColorizer("json:object",zR),t.registerColorizer("json:string",We.string)}var sl={};Rr(sl,{JsonStringOptions:()=>f0,array:()=>km,entry:()=>Ki,number:()=>Dm,object:()=>vm,string:()=>il});var IA=(t,e)=>{let r=t.cursor;return t.trySkip("false")?{type:"json:boolean",range:b.create(r,t),value:!1}:t.trySkip("true")?{type:"json:boolean",range:b.create(r,t),value:!0}:W};var $A=(t,e)=>{let r=t.cursor;return t.trySkip("null")?{type:"json:null",range:b.create(r,t)}:W};var Dm=(t,e)=>{let n=En({pattern:/^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][-+]?\d+)?$/})(t,e);return n.type="json:number",n};var f0={escapable:{characters:["b","f","n","r","t"],unicode:!0},quotes:['"']},il=(t,e)=>{let n=Ft(f0)(t,e);return n.type="json:string",n};var vm=(t,e)=>he("json:object",qr({start:"{",pair:{key:il,sep:":",value:Ki,end:",",trailingEnd:!1},end:"}"}))(t,e);var jR=new Set(["0","1","2","3","4","5","6","7","8","9","-"]),Ki=(t,e)=>le([{predicate:r=>r.tryPeek("["),parser:km},{predicate:r=>r.tryPeek("false")||r.tryPeek("true"),parser:IA},{predicate:r=>r.tryPeek("null"),parser:$A},{predicate:r=>jR.has(r.peek()),parser:Dm},{predicate:r=>r.tryPeek("{"),parser:vm},{parser:il}])(t,e);var km=(t,e)=>{let n=Ri({start:"[",value:Ki,sep:",",trailingSep:!1,end:"]"})(t,e);return n.type="json:array",n};var h0;(function(t){function e(n){return io.is(n)||ol.is(n)||so.is(n)||_m.is(n)||Tm.is(n)||Rm.is(n)}t.is=e;function r(n){return t.is(n)||Bm.is(n)||Sm.is(n)}t.isRelated=r})(h0||(h0={}));var no;(function(t){function e(i){return i.type==="json:array"}t.isArray=e;function r(i){return i.type==="json:object"}t.isObject=r;function n(i){return i.type==="json:string"}t.isString=n})(no||(no={}));var io;(function(t){function e(n){return n?.type==="json:object"}t.is=e;function r(n){return{type:"json:object",range:b.get(n),children:[]}}t.mock=r})(io||(io={}));var Bm;(function(t){function e(r){return r.type==="pair"}t.is=e})(Bm||(Bm={}));var ol;(function(t){function e(n){return n?.type==="json:array"}t.is=e;function r(n){return{type:"json:array",range:b.get(n),children:[]}}t.mock=r})(ol||(ol={}));var Sm;(function(t){function e(r){return r.type==="item"}t.is=e})(Sm||(Sm={}));var zA;(function(t){function e(r){return r.type==="json:string"}t.is=e})(zA||(zA={}));var so;(function(t){function e(n){return n?.type==="json:string"}t.is=e;function r(n){return{...ht.mock(n,f0),type:"json:string"}}t.mock=r})(so||(so={}));var _m;(function(t){function e(r){return r.type==="json:number"}t.is=e})(_m||(_m={}));var Tm;(function(t){function e(r){return r.type==="json:boolean"}t.is=e})(Tm||(Tm={}));var Rm;(function(t){function e(r){return r.type==="json:null"}t.is=e})(Rm||(Rm={}));var jA=[`