| ${this.tree.branches.nodeids} ${this.tree.branches.getKeys()}`);}node=registry.searchTreeLoadByNodeID(newnode);this.tree.branches.subtrees[i]=node;const mhpI=this.tree.might_have_prefix_branches.getIndex(k);if(mhpI!==-1){this.tree.might_have_prefix_branches.subtrees[mhpI]=node;}}nodes.push([k,node.then(node=>{return node.trie(this.dataColumn,this.searchPattern);})]);i+=1;}return nodes;}else{const codePoint=data[this.offset];const trie=new PrefixTrie(this.tree,this.offset+1,this.dataColumn,this.searchPattern,);return[[codePoint,Promise.resolve(trie)]];}}keysExcludeSuffixOnly(){const data=this.tree.data;if(this.offset===data.length){return this.tree.might_have_prefix_branches.getKeys();}else{return Uint8Array.of(data[this.offset]);}}childrenExcludeSuffixOnly(){const data=this.tree.data;if(this.offset===data.length){const nodes=[];let i=0;for(const[k,v]of this.tree.might_have_prefix_branches.entries()){let node;if(v){node=v;}else{const newnode=this.tree.might_have_prefix_branches.getNodeID(i);if(!newnode){throw new Error(`malformed tree; no node for key ${k}`);}node=registry.searchTreeLoadByNodeID(newnode);this.tree.might_have_prefix_branches.subtrees[i]=node;this.tree.branches.subtrees[this.tree.branches.getIndex(k)]=node;}nodes.push([k,node.then(node=>{return node.trie(this.dataColumn,this.searchPattern);})]);i+=1;}return nodes;}else{const codePoint=data[this.offset];const trie=new PrefixTrie(this.tree,this.offset+1,this.dataColumn,this.searchPattern,);return[[codePoint,Promise.resolve(trie)]];}}child(byte){if(this.offset===this.tree.data.length){const i=this.tree.branches.getIndex(byte);if(i!==-1){let branch=this.tree.branches.subtrees[i];if(branch===null){const newnode=this.tree.branches.getNodeID(i);if(!newnode){throw new Error(`malformed tree; no node for key ${byte}`);}branch=registry.searchTreeLoadByNodeID(newnode);this.tree.branches.subtrees[i]=branch;const mhpI=this.tree.might_have_prefix_branches.getIndex(byte);if(mhpI!==-1){this.tree.might_have_prefix_branches.subtrees[mhpI]=branch;}}return branch.then(branch=>branch.trie(this.dataColumn,this.searchPattern));}}else if(this.tree.data[this.offset]===byte){return Promise.resolve(new PrefixTrie(this.tree,this.offset+1,this.dataColumn,this.searchPattern,));}return null;}}class SuffixSearchTree{constructor(branches,dataLen,leaves_suffix,){this.branches=branches;this.dataLen=dataLen;this.leaves_suffix=leaves_suffix;}trie(dataColumn,searchPattern){return new SuffixTrie(this,0,dataColumn,searchPattern);}async search(name,dataColumn){if(typeof name==="string"){const utf8encoder=new TextEncoder();name=utf8encoder.encode(name);}const searchPattern=new Uint8ArraySearchPattern(name);let trie=this.trie(dataColumn,searchPattern);for(const datum of name){const newTrie=trie.child(datum);if(newTrie){trie=await newTrie;}else{return null;}}return trie;}async*searchLev(_name,_dataColumn){}getCurrentLeaves(){return this.leaves_suffix;}}class SuffixTrie{constructor(tree,offset,dataColumn,searchPattern){this.tree=tree;this.offset=offset;this.dataColumn=dataColumn;this.searchPattern=searchPattern;}matches(){return EMPTY_BITMAP;}async*substringMatches(){let layer=[Promise.resolve(this.tree)];while(layer.length){const current_layer=layer;layer=[];for await(const tree of current_layer){let rejected=null;let leaves=tree.getCurrentLeaves();for(const leaf of leaves.entries()){const haystack=await this.dataColumn.at(leaf);if(haystack===undefined||!this.searchPattern.matches(haystack)){if(!rejected){rejected=[];}rejected.push(leaf);}}if(rejected){if(leaves.cardinality()!==rejected.length){for(const rej of rejected){leaves=leaves.remove(rej);}yield leaves;}}else{yield leaves;}}const subnodes=new HashTable();for await(const nodeEncoded of current_layer){const node=nodeEncoded instanceof InlineNeighborsTree?nodeEncoded.decode():nodeEncoded;const branches=node.branches;const l=branches.subtrees.length;for(let i=0;i<l;++i){const subtree=branches.subtrees[i];if(subtree){layer.push(subtree);}else if(subtree===null){const newnode=branches.getNodeID(i);if(!newnode){throw new Error(`malformed tree; no node for index ${i}`);}else{let subnode_list=subnodes.get(newnode);if(!subnode_list){subnode_list=[[i,node]];subnodes.set(newnode,subnode_list);}else{subnode_list.push([i,node]);}}}else{throw new Error(`malformed tree; index ${i} does not exist`);}}}for(const[newnode,subnode_list]of subnodes.entries()){const res=registry.searchTreeLoadByNodeID(newnode);for(const[i,node]of subnode_list){const branches=node.branches;branches.subtrees[i]=res;}layer.push(res);}}}async*prefixMatches(){}keysExcludeSuffixOnly(){return EMPTY_UINT8;}childrenExcludeSuffixOnly(){return[];}child(byte){if(this.offset===this.tree.dataLen){const i=this.tree.branches.getIndex(byte);if(i!==-1){let branch=this.tree.branches.subtrees[i];if(branch===null){const newnode=this.tree.branches.getNodeID(i);if(!newnode){throw new Error(`malformed tree; no node for key ${byte}`);}branch=registry.searchTreeLoadByNodeID(newnode);this.tree.branches.subtrees[i]=branch;}return branch.then(branch=>branch.trie(this.dataColumn,this.searchPattern));}}else{return Promise.resolve(new SuffixTrie(this.tree,this.offset+1,this.dataColumn,this.searchPattern,));}return null;}}class InlineNeighborsTree{constructor(encoded,start,){this.encoded=encoded;this.start=start;}decode(){let i=this.start;const encoded=this.encoded;const has_branches=(encoded[i]&0x04)!==0;const is_suffixes_only=(encoded[i]&0x01)!==0;let leaves_count=((encoded[i]>>4)&0x0f)+1;i+=1;let branch_count=0;if(has_branches){branch_count=encoded[i]+1;i+=1;}const dlen=encoded[i]&0x3f;if((encoded[i]&0x80)!==0){leaves_count=0;}i+=1;let data=EMPTY_UINT8;if(!is_suffixes_only&&dlen!==0){data=encoded.subarray(i,i+dlen);i+=dlen;}const leaf_value_upper=encoded[i]|(encoded[i+1]<<8);i+=2;const branch_nodes=[];for(let j=0;j<branch_count;j+=1){const branch_dlen=encoded[i]&0x0f;const branch_leaves_count=((encoded[i]>>4)&0x0f)+1;i+=1;let branch_data=EMPTY_UINT8;if(!is_suffixes_only&&branch_dlen!==0){branch_data=encoded.subarray(i,i+branch_dlen);i+=branch_dlen;}const branch_leaves=new RoaringBitmap(null);branch_leaves.keysAndCardinalities=Uint8Array.of(leaf_value_upper&0xff,(leaf_value_upper>>8)&0xff,(branch_leaves_count-1)&0xff,((branch_leaves_count-1)>>8)&0xff,);branch_leaves.containers=[new RoaringBitmapArray(branch_leaves_count,encoded.subarray(i,i+(branch_leaves_count*2)),),];i+=branch_leaves_count*2;branch_nodes.push(Promise.resolve(is_suffixes_only?new SuffixSearchTree(EMPTY_SEARCH_TREE_BRANCHES,branch_dlen,branch_leaves,):new PrefixSearchTree(EMPTY_SEARCH_TREE_BRANCHES,EMPTY_SEARCH_TREE_BRANCHES,branch_data,branch_leaves,EMPTY_BITMAP,),));}const branches=branch_count===0?EMPTY_SEARCH_TREE_BRANCHES:new SearchTreeBranchesArray(encoded.subarray(i,i+branch_count),EMPTY_UINT8,);i+=branch_count;branches.subtrees=branch_nodes;let leaves=EMPTY_BITMAP;if(leaves_count!==0){leaves=new RoaringBitmap(null);leaves.keysAndCardinalities=Uint8Array.of(leaf_value_upper&0xff,(leaf_value_upper>>8)&0xff,(leaves_count-1)&0xff,((leaves_count-1)>>8)&0xff,);leaves.containers=[new RoaringBitmapArray(leaves_count,encoded.subarray(i,i+(leaves_count*2)),),];i+=leaves_count*2;}return is_suffixes_only?new SuffixSearchTree(branches,dlen,leaves,):new PrefixSearchTree(branches,branches,data,leaves,EMPTY_BITMAP,);}trie(dataColumn,searchPattern){const tree=this.decode();return tree instanceof SuffixSearchTree?new SuffixTrie(tree,0,dataColumn,searchPattern):new PrefixTrie(tree,0,dataColumn,searchPattern);}search(name,dataColumn){return this.decode().search(name,dataColumn);}searchLev(name,dataColumn){return this.decode().searchLev(name,dataColumn);}getCurrentLeaves(){return this.decode().getCurrentLeaves();}}class DataColumn{constructor(counts,hashes,emptyset,name,searchTree){this.searchTree=searchTree;this.hashes=hashes;this.emptyset=emptyset;this.name=name;this.buckets=[];this.bucket_keys=[];const l=counts.length;let k=0;let totalLength=0;for(let i=0;i<l;++i){const count=counts[i];totalLength+=count;const start=k;for(let j=0;j<count;++j){if(emptyset.contains(k)){j-=1;}k+=1;}const end=k;const bucket={hash:hashes.subarray(i*6,(i+1)*6),data:null,end,count};this.buckets.push(bucket);this.bucket_keys.push(start);}this.length=totalLength;}isEmpty(id){return this.emptyset.contains(id);}at(id){if(this.emptyset.contains(id)){return EMPTY_UINT8;}else{let idx=-1;while(this.bucket_keys[idx+1]<=id){idx+=1;}if(idx===-1||idx>=this.bucket_keys.length){return undefined;}else{const start=this.bucket_keys[idx];const bucket=this.buckets[idx];const data=this.buckets[idx].data;if(data===null){return this.atAsyncFetch(id,start,bucket);}else{return data[id-start];}}}}async atAsyncFetch(id,start,bucket){const{hash,end}=bucket;const dataSansEmptysetOrig=await registry.dataLoadByNameAndHash(this.name,hash,);let data=bucket.data;if(data!==null){return data[id-start];}const dataSansEmptyset=[...dataSansEmptysetOrig];let dataWithEmptyset=null;let pos=start;let insertCount=0;while(pos<end){if(this.emptyset.contains(pos)){if(dataWithEmptyset===null){dataWithEmptyset=dataSansEmptyset.splice(0,insertCount);}else if(insertCount!==0){dataWithEmptyset.push(...dataSansEmptyset.splice(0,insertCount),);}insertCount=0;dataWithEmptyset.push(EMPTY_UINT8);}else{insertCount+=1;}pos+=1;}data=dataWithEmptyset===null?dataSansEmptyset:dataWithEmptyset.concat(dataSansEmptyset);bucket.data=data;return data[id-start];}async search(name){return await(this.searchTree?this.searchTree.search(name,this):null);}async*searchLev(name){if(this.searchTree){yield*this.searchTree.searchLev(name,this);}}}class Database{constructor(searchTreeRoots,dataColumns){this.searchTreeRoots=searchTreeRoots;this.dataColumns=dataColumns;}getIndex(colname){return this.searchTreeRoots.get(colname);}getData(colname){return this.dataColumns.get(colname);}}function loadColumnFromBytes(data){const hashBuf=Uint8Array.of(0,0,0,0,0,0,0,0);const truncatedHash=hashBuf.subarray(2,8);siphashOfBytes(data,0,0,0,0,hashBuf);const cb=registry.dataColumnLoadPromiseCallbacks.get(truncatedHash);if(cb){const backrefs=[];const dataSansEmptyset=[];let i=0;const l=data.length;while(i<l){let c=data[i];if(c>=48&&c<=63){dataSansEmptyset.push(backrefs[c-48]);i+=1;}else{let n=0;while(c<96){n=(n<<4)|(c&0xF);i+=1;c=data[i];}n=(n<<4)|(c&0xF);i+=1;const item=data.subarray(i,i+n);dataSansEmptyset.push(item);i+=n;backrefs.unshift(item);if(backrefs.length>16){backrefs.pop();}}}cb(null,dataSansEmptyset);}}function makeSearchTreeFromBase64(inputBase64){const input=makeUint8ArrayFromBase64(inputBase64);let i=0;const l=input.length;const stash=new HashTable();const hash=Uint8Array.of(0,0,0,0,0,0,0,0);const truncatedHash=new Uint8Array(hash.buffer,2,6);const hash_history=[];const data_history=[];let canonical=EMPTY_UINT8;let tree=new PrefixSearchTree(EMPTY_SEARCH_TREE_BRANCHES,EMPTY_SEARCH_TREE_BRANCHES,EMPTY_UINT8,EMPTY_BITMAP,EMPTY_BITMAP,);function makeBranchesFromBinaryData(input,i,compression_tag,){const is_pure_suffixes_only_node=(compression_tag&0x01)!==0x00;const is_stack_compressed=(compression_tag&0x02)!==0;const is_long_compressed=(compression_tag&0x04)!==0;const all_children_are_compressed=(compression_tag&0xF0)===0xF0&&!is_long_compressed;const any_children_are_compressed=(compression_tag&0xF0)!==0x00||is_long_compressed;const start_point=i;let cplen;let cslen;let alphabitmap=null;if(is_pure_suffixes_only_node){cplen=0;cslen=input[i];i+=1;if(cslen>=0xc0){alphabitmap=SearchTreeBranchesLongAlphaBitmap;cslen=cslen&0x3F;}else if(cslen>=0x80){alphabitmap=SearchTreeBranchesShortAlphaBitmap;cslen=cslen&0x7F;}}else{cplen=input[i];i+=1;cslen=input[i];i+=1;if(cplen===0xff&&cslen===0xff){cplen=0x100;cslen=0;}else if(cplen>=0xc0&&cslen>=0xc0){alphabitmap=SearchTreeBranchesLongAlphaBitmap;cplen=cplen&0x3F;cslen=cslen&0x3F;}else if(cplen>=0x80&&cslen>=0x80){alphabitmap=SearchTreeBranchesShortAlphaBitmap;cplen=cplen&0x7F;cslen=cslen&0x7F;}}let j=0;let cpnodes;if(any_children_are_compressed){cpnodes=cplen===0?EMPTY_UINT8:new Uint8Array(cplen*6);while(j<cplen){const is_compressed=all_children_are_compressed||((0x10<<j)&compression_tag)!==0;if(is_compressed){let slot=hash_history.length-1;if(is_stack_compressed){while(hash_history[slot].used){slot-=1;}}else{slot-=input[i];i+=1;}hash_history[slot].used=true;cpnodes.set(hash_history[slot].hash,j*6,);}else{const joff=j*6;cpnodes[joff+0]=input[i+0];cpnodes[joff+1]=input[i+1];cpnodes[joff+2]=input[i+2];cpnodes[joff+3]=input[i+3];cpnodes[joff+4]=input[i+4];cpnodes[joff+5]=input[i+5];i+=6;}j+=1;}}else{cpnodes=cplen===0?EMPTY_UINT8:input.subarray(i,i+(cplen*6));i+=cplen*6;}j=0;let csnodes;if(any_children_are_compressed){csnodes=cslen===0?EMPTY_UINT8:new Uint8Array(cslen*6);while(j<cslen){const is_compressed=all_children_are_compressed||((0x10<<(cplen+j))&compression_tag)!==0;if(is_compressed){let slot=hash_history.length-1;if(is_stack_compressed){while(hash_history[slot].used){slot-=1;}}else{slot-=input[i];i+=1;}hash_history[slot].used=true;csnodes.set(hash_history[slot].hash,j*6,);}else{const joff=j*6;csnodes[joff+0]=input[i+0];csnodes[joff+1]=input[i+1];csnodes[joff+2]=input[i+2];csnodes[joff+3]=input[i+3];csnodes[joff+4]=input[i+4];csnodes[joff+5]=input[i+5];i+=6;}j+=1;}}else{csnodes=cslen===0?EMPTY_UINT8:input.subarray(i,i+(cslen*6));i+=cslen*6;}let cpbranches;let might_have_prefix_branches;if(cplen===0){cpbranches=EMPTY_UINT8;might_have_prefix_branches=EMPTY_SEARCH_TREE_BRANCHES;}else if(alphabitmap){cpbranches=new Uint8Array(input.buffer,i+input.byteOffset,alphabitmap.width);const branchset=(alphabitmap.width===4?(input[i+3]<<24):0)|(input[i+2]<<16)|(input[i+1]<<8)|input[i];might_have_prefix_branches=new alphabitmap(branchset,cpnodes);i+=alphabitmap.width;}else{cpbranches=new Uint8Array(input.buffer,i+input.byteOffset,cplen);might_have_prefix_branches=new SearchTreeBranchesArray(cpbranches,cpnodes);i+=cplen;}let csbranches;let branches;if(cslen===0){csbranches=EMPTY_UINT8;branches=might_have_prefix_branches;}else if(alphabitmap){csbranches=new Uint8Array(input.buffer,i+input.byteOffset,alphabitmap.width);const branchset=(alphabitmap.width===4?(input[i+3]<<24):0)|(input[i+2]<<16)|(input[i+1]<<8)|input[i];if(cplen===0){branches=new alphabitmap(branchset,csnodes);}else{const cpoffset=i-alphabitmap.width;const cpbranchset=(alphabitmap.width===4?(input[cpoffset+3]<<24):0)|(input[cpoffset+2]<<16)|(input[cpoffset+1]<<8)|input[cpoffset];const hashes=new Uint8Array((cplen+cslen)*6);let cpi=0;let csi=0;let j=0;for(let k=0;k<alphabitmap.ALPHABITMAP_CHARS.length;k+=1){if(branchset&(1<<k)){hashes[j+0]=csnodes[csi+0];hashes[j+1]=csnodes[csi+1];hashes[j+2]=csnodes[csi+2];hashes[j+3]=csnodes[csi+3];hashes[j+4]=csnodes[csi+4];hashes[j+5]=csnodes[csi+5];j+=6;csi+=6;}else if(cpbranchset&(1<<k)){hashes[j+0]=cpnodes[cpi+0];hashes[j+1]=cpnodes[cpi+1];hashes[j+2]=cpnodes[cpi+2];hashes[j+3]=cpnodes[cpi+3];hashes[j+4]=cpnodes[cpi+4];hashes[j+5]=cpnodes[cpi+5];j+=6;cpi+=6;}}branches=new alphabitmap(branchset|cpbranchset,hashes);}i+=alphabitmap.width;}else{csbranches=new Uint8Array(input.buffer,i+input.byteOffset,cslen);if(cplen===0){branches=new SearchTreeBranchesArray(csbranches,csnodes);}else{const branchset=new Uint8Array(cplen+cslen);const hashes=new Uint8Array((cplen+cslen)*6);let cpi=0;let csi=0;let j=0;while(cpi<cplen||csi<cslen){if(cpi>=cplen||(csi<cslen&&cpbranches[cpi]>csbranches[csi])){branchset[j]=csbranches[csi];const joff=j*6;const csioff=csi*6;hashes[joff+0]=csnodes[csioff+0];hashes[joff+1]=csnodes[csioff+1];hashes[joff+2]=csnodes[csioff+2];hashes[joff+3]=csnodes[csioff+3];hashes[joff+4]=csnodes[csioff+4];hashes[joff+5]=csnodes[csioff+5];csi+=1;}else{branchset[j]=cpbranches[cpi];const joff=j*6;const cpioff=cpi*6;hashes[joff+0]=cpnodes[cpioff+0];hashes[joff+1]=cpnodes[cpioff+1];hashes[joff+2]=cpnodes[cpioff+2];hashes[joff+3]=cpnodes[cpioff+3];hashes[joff+4]=cpnodes[cpioff+4];hashes[joff+5]=cpnodes[cpioff+5];cpi+=1;}j+=1;}branches=new SearchTreeBranchesArray(branchset,hashes);}i+=cslen;}return{consumed_len_bytes:i-start_point,cpbranches,csbranches,cpnodes,csnodes,branches,might_have_prefix_branches,};}while(i<l){const start=i;let data;let compression_tag=input[i];const is_pure_suffixes_only_node=(compression_tag&0x01)!==0;const is_long_compressed=(compression_tag&0x04)!==0;const is_data_compressed=(compression_tag&0x08)!==0;i+=1;if(is_long_compressed){compression_tag|=input[i]<<8;i+=1;}let dlen;let no_leaves_flag;let inline_neighbors_flag;if(is_data_compressed&&is_pure_suffixes_only_node){dlen=0;no_leaves_flag=0x80;inline_neighbors_flag=0;}else{dlen=input[i]&0x3F;no_leaves_flag=input[i]&0x80;inline_neighbors_flag=input[i]&0x40;i+=1;}if(inline_neighbors_flag!==0){const leaves_count=no_leaves_flag!==0?0:((compression_tag>>4)&0x0f)+1;const branch_count=is_long_compressed?((compression_tag>>8)&0xff)+1:0;if(is_data_compressed){data=data_history[data_history.length-dlen-1];dlen=data.length;}else if(is_pure_suffixes_only_node){data=EMPTY_UINT8;}else{data=dlen===0?EMPTY_UINT8:new Uint8Array(input.buffer,i+input.byteOffset,dlen);i+=dlen;}const branches_start=i;i+=2;for(let j=0;j<branch_count;j+=1){const branch_dlen=input[i]&0x0f;const branch_leaves_count=((input[i]>>4)&0x0f)+1;i+=1;if(!is_pure_suffixes_only_node){i+=branch_dlen;}i+=branch_leaves_count*2;}i+=branch_count;i+=leaves_count*2;if(is_data_compressed){const clen=(1+(is_long_compressed?1:0)+1+dlen+(i-branches_start));const canonical=new Uint8Array(clen);let ci=0;canonical[ci]=input[start]^ 0x08;ci+=1;if(is_long_compressed){canonical[ci]=input[start+ci];ci+=1;}canonical[ci]=dlen|no_leaves_flag|0x40;ci+=1;for(let j=0;j<dlen;j+=1){canonical[ci]=data[j];ci+=1;}for(let j=branches_start;j<i;j+=1){canonical[ci]=input[j];ci+=1;}tree=new InlineNeighborsTree(canonical,0);siphashOfBytes(canonical,0,0,0,0,hash);}else{tree=new InlineNeighborsTree(input,start);siphashOfBytes(new Uint8Array(input.buffer,start+input.byteOffset,i-start,),0,0,0,0,hash);}}else if(compression_tag>1){if(is_pure_suffixes_only_node){data=EMPTY_UINT8;}else if(is_data_compressed){data=data_history[data_history.length-dlen-1];dlen=data.length;}else{data=dlen===0?EMPTY_UINT8:new Uint8Array(input.buffer,i+input.byteOffset,dlen);i+=dlen;}const coffset=i;const{cpbranches,csbranches,cpnodes,csnodes,consumed_len_bytes:branches_consumed_len_bytes,branches,might_have_prefix_branches,}=makeBranchesFromBinaryData(input,i,compression_tag);i+=branches_consumed_len_bytes;let whole;let suffix;if(is_pure_suffixes_only_node){if(no_leaves_flag){whole=EMPTY_BITMAP;suffix=EMPTY_BITMAP;}else{suffix=input[i]===0?EMPTY_BITMAP1:new RoaringBitmap(input,i);i+=suffix.consumed_len_bytes;}tree=new SuffixSearchTree(branches,dlen,suffix,);const clen=((is_data_compressed?2:3)+csnodes.length+csbranches.length+suffix.consumed_len_bytes);if(canonical.length<clen){canonical=new Uint8Array(clen);}let ci=0;if(is_data_compressed){canonical[ci]=0x09;ci+=1;}else{canonical[ci]=1;ci+=1;canonical[ci]=dlen|no_leaves_flag;ci+=1;}canonical[ci]=input[coffset];ci+=1;canonical.set(csnodes,ci);ci+=csnodes.length;canonical.set(csbranches,ci);ci+=csbranches.length;const leavesOffset=i-suffix.consumed_len_bytes;for(let j=leavesOffset;j<i;j+=1){canonical[ci+j-leavesOffset]=input[j];}siphashOfBytes(canonical.subarray(0,clen),0,0,0,0,hash);}else{if(no_leaves_flag){whole=EMPTY_BITMAP;suffix=EMPTY_BITMAP;}else{whole=input[i]===0?EMPTY_BITMAP1:new RoaringBitmap(input,i);i+=whole.consumed_len_bytes;suffix=input[i]===0?EMPTY_BITMAP1:new RoaringBitmap(input,i);i+=suffix.consumed_len_bytes;}tree=new PrefixSearchTree(branches,might_have_prefix_branches,data,whole,suffix,);const clen=(4+dlen+cpnodes.length+csnodes.length+cpbranches.length+csbranches.length+whole.consumed_len_bytes+suffix.consumed_len_bytes);if(canonical.length<clen){canonical=new Uint8Array(clen);}let ci=0;canonical[ci]=0;ci+=1;canonical[ci]=dlen|no_leaves_flag;ci+=1;canonical.set(data,ci);ci+=data.length;canonical[ci]=input[coffset];ci+=1;canonical[ci]=input[coffset+1];ci+=1;canonical.set(cpnodes,ci);ci+=cpnodes.length;canonical.set(csnodes,ci);ci+=csnodes.length;canonical.set(cpbranches,ci);ci+=cpbranches.length;canonical.set(csbranches,ci);ci+=csbranches.length;const leavesOffset=i-whole.consumed_len_bytes-suffix.consumed_len_bytes;for(let j=leavesOffset;j<i;j+=1){canonical[ci+j-leavesOffset]=input[j];}siphashOfBytes(canonical.subarray(0,clen),0,0,0,0,hash);}}else{if(dlen===0||is_pure_suffixes_only_node){data=EMPTY_UINT8;}else{data=new Uint8Array(input.buffer,i+input.byteOffset,dlen);i+=dlen;}const{consumed_len_bytes:branches_consumed_len_bytes,branches,might_have_prefix_branches,}=makeBranchesFromBinaryData(input,i,compression_tag);i+=branches_consumed_len_bytes;let whole;let suffix;if(no_leaves_flag){whole=EMPTY_BITMAP;suffix=EMPTY_BITMAP;}else if(is_pure_suffixes_only_node){whole=EMPTY_BITMAP;suffix=input[i]===0?EMPTY_BITMAP1:new RoaringBitmap(input,i);i+=suffix.consumed_len_bytes;}else{whole=input[i]===0?EMPTY_BITMAP1:new RoaringBitmap(input,i);i+=whole.consumed_len_bytes;suffix=input[i]===0?EMPTY_BITMAP1:new RoaringBitmap(input,i);i+=suffix.consumed_len_bytes;}siphashOfBytes(new Uint8Array(input.buffer,start+input.byteOffset,i-start,),0,0,0,0,hash);tree=is_pure_suffixes_only_node?new SuffixSearchTree(branches,dlen,suffix,):new PrefixSearchTree(branches,might_have_prefix_branches,data,whole,suffix,);}hash[2]&=0x7f;hash_history.push({hash:truncatedHash.slice(),used:false});if(data.length!==0){data_history.push(data);}if(!(tree instanceof InlineNeighborsTree)){const tree_branch_nodeids=tree.branches.nodeids;const tree_branch_subtrees=tree.branches.subtrees;let j=0;const lb=tree.branches.subtrees.length;while(j<lb){if((tree_branch_nodeids[j*6]&0x80)===0){const subtree=stash.getWithOffsetKey(tree_branch_nodeids,j*6);if(subtree!==undefined){tree_branch_subtrees[j]=Promise.resolve(subtree);}}j+=1;}}if(tree instanceof PrefixSearchTree){const tree_mhp_branch_nodeids=tree.might_have_prefix_branches.nodeids;const tree_mhp_branch_subtrees=tree.might_have_prefix_branches.subtrees;let j=0;const lb=tree.might_have_prefix_branches.subtrees.length;while(j<lb){if((tree_mhp_branch_nodeids[j*6]&0x80)===0){const subtree=stash.getWithOffsetKey(tree_mhp_branch_nodeids,j*6);if(subtree!==undefined){tree_mhp_branch_subtrees[j]=Promise.resolve(subtree);}}j+=1;}}if(i!==l){stash.set(truncatedHash,tree);}}return[truncatedHash,tree];}return new Promise((resolve,reject)=>{registry.searchTreeRootCallback=(error,data)=>{if(data){resolve(data);}else{reject(error);}};hooks.loadRoot(callbacks);});}if(typeof window!=="undefined"){window.Stringdex={loadDatabase,};window.RoaringBitmap=RoaringBitmap;if(window.StringdexOnload){window.StringdexOnload.forEach(cb=>cb(window.Stringdex));}}else{module.exports.Stringdex={loadDatabase,};module.exports.RoaringBitmap=RoaringBitmap;}const makeUint8ArrayFromBase64=Uint8Array.fromBase64?Uint8Array.fromBase64:(string=>{const bytes_as_string=atob(string);const l=bytes_as_string.length;const bytes=new Uint8Array(l);for(let i=0;i<l;++i){bytes[i]=bytes_as_string.charCodeAt(i);}return bytes;});const makeUint8ArrayFromHex=Uint8Array.fromHex?Uint8Array.fromHex:(string=>{const alpha={"0":0,"1":1,"2":2,"3":3,"4":4,"5":5,"6":6,"7":7,"8":8,"9":9,"a":10,"b":11,"A":10,"B":11,"c":12,"d":13,"C":12,"D":13,"e":14,"f":15,"E":14,"F":15,};const l=string.length>>1;const bytes=new Uint8Array(l);for(let i=0;i<l;i+=1){const top=string[i<<1];const bottom=string[(i<<1)+1];bytes[i]=(alpha[top]<<4)|alpha[bottom];}return bytes;});const makeHexFromUint8Array=Uint8Array.prototype.toHex?(array=>array.toHex()):(array=>{const alpha=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f",];const l=array.length;const v=[];for(let i=0;i<l;++i){v.push(alpha[array[i]>>4]);v.push(alpha[array[i]&0xf]);}return v.join("");});function siphashOfBytes(input,k0lo,k0hi,k1lo,k1hi,output){let v0lo=k0lo ^ 0x70736575;let v0hi=k0hi ^ 0x736f6d65;let v1lo=k1lo ^ 0x6e646f6d;let v1hi=k1hi ^ 0x646f7261;let v2lo=k0lo ^ 0x6e657261;let v2hi=k0hi ^ 0x6c796765;let v3lo=k1lo ^ 0x79746573;let v3hi=k1hi ^ 0x74656462;const inputLength=input.length;let inputI=0;const left=inputLength&0x7;let milo=0;let mihi=0;while(inputI<inputLength-left){u8ToU64le(inputI,inputI+8);v3lo ^=milo;v3hi ^=mihi;siphashCompress();v0lo ^=milo;v0hi ^=mihi;inputI+=8;}u8ToU64le(inputI,inputI+left);const blo=milo;const bhi=((inputLength&0xff)<<24)|mihi;v3lo ^=blo;v3hi ^=bhi;siphashCompress();v0lo ^=blo;v0hi ^=bhi;v2lo ^=0xff;siphashCompress();siphashCompress();siphashCompress();output[7]=(v0lo ^ v1lo ^ v2lo ^ v3lo)&0xff;output[6]=(v0lo ^ v1lo ^ v2lo ^ v3lo)>>>8;output[5]=(v0lo ^ v1lo ^ v2lo ^ v3lo)>>>16;output[4]=(v0lo ^ v1lo ^ v2lo ^ v3lo)>>>24;output[3]=(v0hi ^ v1hi ^ v2hi ^ v3hi)&0xff;output[2]=(v0hi ^ v1hi ^ v2hi ^ v3hi)>>>8;output[1]=(v0hi ^ v1hi ^ v2hi ^ v3hi)>>>16;output[0]=(v0hi ^ v1hi ^ v2hi ^ v3hi)>>>24;function u8ToU64le(offset,length){const n0=offset<length?input[offset]&0xff:0;const n1=offset+1<length?input[offset+1]&0xff:0;const n2=offset+2<length?input[offset+2]&0xff:0;const n3=offset+3<length?input[offset+3]&0xff:0;const n4=offset+4<length?input[offset+4]&0xff:0;const n5=offset+5<length?input[offset+5]&0xff:0;const n6=offset+6<length?input[offset+6]&0xff:0;const n7=offset+7<length?input[offset+7]&0xff:0;milo=n0|(n1<<8)|(n2<<16)|(n3<<24);mihi=n4|(n5<<8)|(n6<<16)|(n7<<24);}function siphashCompress(){v0hi=(v0hi+v1hi+(((v0lo>>>0)+(v1lo>>>0)>0xffffffff)?1:0))|0;v0lo=(v0lo+v1lo)|0;let v1lo_=v1lo;let v1hi_=v1hi;v1lo=(v1lo_<<13)|(v1hi_>>>19);v1hi=(v1hi_<<13)|(v1lo_>>>19);v1lo ^=v0lo;v1hi ^=v0hi;const v0lo_=v0lo;const v0hi_=v0hi;v0lo=v0hi_;v0hi=v0lo_;v2hi=(v2hi+v3hi+(((v2lo>>>0)+(v3lo>>>0)>0xffffffff)?1:0))|0;v2lo=(v2lo+v3lo)|0;let v3lo_=v3lo;let v3hi_=v3hi;v3lo=(v3lo_<<16)|(v3hi_>>>16);v3hi=(v3hi_<<16)|(v3lo_>>>16);v3lo ^=v2lo;v3hi ^=v2hi;v0hi=(v0hi+v3hi+(((v0lo>>>0)+(v3lo>>>0)>0xffffffff)?1:0))|0;v0lo=(v0lo+v3lo)|0;v3lo_=v3lo;v3hi_=v3hi;v3lo=(v3lo_<<21)|(v3hi_>>>11);v3hi=(v3hi_<<21)|(v3lo_>>>11);v3lo ^=v0lo;v3hi ^=v0hi;v2hi=(v2hi+v1hi+(((v2lo>>>0)+(v1lo>>>0)>0xffffffff)?1:0))|0;v2lo=(v2lo+v1lo)|0;v1lo_=v1lo;v1hi_=v1hi;v1lo=(v1lo_<<17)|(v1hi_>>>15);v1hi=(v1hi_<<17)|(v1lo_>>>15);v1lo ^=v2lo;v1hi ^=v2hi;const v2lo_=v2lo;const v2hi_=v2hi;v2lo=v2hi_;v2hi=v2lo_;}}class ParametricDescription{constructor(w,n,minErrors){this.w=w;this.n=n;this.minErrors=minErrors;}isAccept(absState){const state=Math.floor(absState/(this.w+1));const offset=absState%(this.w+1);return this.w-offset+this.minErrors[state]<=this.n;}getPosition(absState){return absState%(this.w+1);}getVector(name,charCode,pos,end){let vector=0;for(let i=pos;i<end;i+=1){vector=vector<<1;if(name[i]===charCode){vector|=1;}}return vector;}unpack(data,index,bitsPerValue){const bitLoc=(bitsPerValue*index);const dataLoc=bitLoc>>5;const bitStart=bitLoc&31;if(bitStart+bitsPerValue<=32){return((data[dataLoc]>>bitStart)&this.MASKS[bitsPerValue-1]);}else{const part=32-bitStart;return ~~(((data[dataLoc]>>bitStart)&this.MASKS[part-1])+((data[1+dataLoc]&this.MASKS[bitsPerValue-part-1])<<part));}}}ParametricDescription.prototype.MASKS=new Int32Array([0x1,0x3,0x7,0xF,0x1F,0x3F,0x7F,0xFF,0x1FF,0x3F,0x7FF,0xFFF,0x1FFF,0x3FFF,0x7FFF,0xFFFF,0x1FFFF,0x3FFFF,0x7FFFF,0xFFFFF,0x1FFFFF,0x3FFFFF,0x7FFFFF,0xFFFFFF,0x1FFFFFF,0x3FFFFFF,0x7FFFFFF,0xFFFFFFF,0x1FFFFFFF,0x3FFFFFFF,0x7FFFFFFF,0xFFFFFFFF,]);class Lev2TParametricDescription extends ParametricDescription{transition(absState,position,vector){let state=Math.floor(absState/(this.w+1));let offset=absState%(this.w+1);if(position===this.w){if(state<3){const loc=Math.imul(vector,3)+state;offset+=this.unpack(this.offsetIncrs0,loc,1);state=this.unpack(this.toStates0,loc,2)-1;}}else if(position===this.w-1){if(state<5){const loc=Math.imul(vector,5)+state;offset+=this.unpack(this.offsetIncrs1,loc,1);state=this.unpack(this.toStates1,loc,3)-1;}}else if(position===this.w-2){if(state<13){const loc=Math.imul(vector,13)+state;offset+=this.unpack(this.offsetIncrs2,loc,2);state=this.unpack(this.toStates2,loc,4)-1;}}else if(position===this.w-3){if(state<28){const loc=Math.imul(vector,28)+state;offset+=this.unpack(this.offsetIncrs3,loc,2);state=this.unpack(this.toStates3,loc,5)-1;}}else if(position===this.w-4){if(state<45){const loc=Math.imul(vector,45)+state;offset+=this.unpack(this.offsetIncrs4,loc,3);state=this.unpack(this.toStates4,loc,6)-1;}}else{if(state<45){const loc=Math.imul(vector,45)+state;offset+=this.unpack(this.offsetIncrs5,loc,3);state=this.unpack(this.toStates5,loc,6)-1;}}if(state===-1){return-1;}else{return Math.imul(state,this.w+1)+offset;}}constructor(w){super(w,2,new Int32Array([0,1,2,0,1,-1,0,-1,0,-1,0,-1,0,-1,-1,-1,-1,-1,-2,-1,-1,-2,-1,-2,-1,-1,-1,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,]));}}Lev2TParametricDescription.prototype.toStates0=new Int32Array([0xe,]);Lev2TParametricDescription.prototype.offsetIncrs0=new Int32Array([0x0,]);Lev2TParametricDescription.prototype.toStates1=new Int32Array([0x1a688a2c,]);Lev2TParametricDescription.prototype.offsetIncrs1=new Int32Array([0x3e0,]);Lev2TParametricDescription.prototype.toStates2=new Int32Array([0x70707054,0xdc07035,0x3dd3a3a,0x2323213a,0x15435223,0x22545432,0x5435,]);Lev2TParametricDescription.prototype.offsetIncrs2=new Int32Array([0x80000,0x55582088,0x55555555,0x55,]);Lev2TParametricDescription.prototype.toStates3=new Int32Array([0x1c0380a4,0x700a570,0xca529c0,0x180a00,0xa80af180,0xc5498e60,0x5a546398,0x8c4300e8,0xac18c601,0xd8d43501,0x863500ad,0x51976d6a,0x8ca0180a,0xc3501ac2,0xb0c5be16,0x76dda8a5,0x18c4519,0xc41294a,0xe248d231,0x1086520c,0xce31ac42,0x13946358,0x2d0348c4,0x6732d494,0x1ad224a5,0xd635ad4b,0x520c4139,0xce24948,0x22110a52,0x58ce729d,0xc41394e3,0x941cc520,0x90e732d4,0x4729d224,0x39ce35ad,]);Lev2TParametricDescription.prototype.offsetIncrs3=new Int32Array([0x80000,0xc0c830,0x300f3c30,0x2200fcff,0xcaa00a08,0x3c2200a8,0xa8fea00a,0x55555555,0x55555555,0x55555555,0x55555555,0x55555555,0x55555555,0x55555555,]);Lev2TParametricDescription.prototype.toStates4=new Int32Array([0x801c0144,0x1453803,0x14700038,0xc0005145,0x1401,0x14,0x140000,0x0,0x510000,0x6301f007,0x301f00d1,0xa186178,0xc20ca0c3,0xc20c30,0xc30030c,0xc00c00cd,0xf0c00c30,0x4c054014,0xc30944c3,0x55150c34,0x8300550,0x430c0143,0x50c31,0xc30850c,0xc3143000,0x50053c50,0x5130d301,0x850d30c2,0x30a08608,0xc214414,0x43142145,0x21450031,0x1400c314,0x4c143145,0x32832803,0x28014d6c,0xcd34a0c3,0x1c50c76,0x1c314014,0x430c30c3,0x1431,0xc300500,0xca00d303,0xd36d0e40,0x90b0e400,0xcb2abb2c,0x70c20ca1,0x2c32ca2c,0xcd2c70cb,0x31c00c00,0x34c2c32c,0x5583280,0x558309b7,0x6cd6ca14,0x430850c7,0x51c51401,0x1430c714,0xc3087,0x71451450,0xca00d30,0xc26dc156,0xb9071560,0x1cb2abb2,0xc70c2144,0xb1c51ca1,0x1421c70c,0xc51c00c3,0x30811c51,0x24324308,0xc51031c2,0x70820820,0x5c33830d,0xc33850c3,0x30c30c30,0xc30c31c,0x451450c3,0x20c20c20,0xda0920d,0x5145914f,0x36596114,0x51965865,0xd9643653,0x365a6590,0x51964364,0x43081505,0x920b2032,0x2c718b28,0xd7242249,0x35cb28b0,0x2cb3872c,0x972c30d7,0xb0c32cb2,0x4e1c75c,0xc80c90c2,0x62ca2482,0x4504171c,0xd65d9610,0x33976585,0xd95cb5d,0x4b5ca5d7,0x73975c36,0x10308138,0xc2245105,0x41451031,0x14e24208,0xc35c3387,0x51453851,0x1c51c514,0xc70c30c3,0x20451450,0x14f1440c,0x4f0da092,0x4513d41,0x6533944d,0x1350e658,0xe1545055,0x64365a50,0x5519383,0x51030815,0x28920718,0x441c718b,0x714e2422,0x1c35cb28,0x4e1c7387,0xb28e1c51,0x5c70c32c,0xc204e1c7,0x81c61440,0x1c62ca24,0xd04503ce,0x85d63944,0x39338e65,0x8e154387,0x364b5ca3,0x38739738,]);Lev2TParametricDescription.prototype.offsetIncrs4=new Int32Array([0x10000000,0xc00000,0x60061,0x400,0x0,0x80010008,0x249248a4,0x8229048,0x2092,0x6c3603,0xb61b6c30,0x6db6036d,0xdb6c0,0x361b0180,0x91b72000,0xdb11b71b,0x6db6236,0x1008200,0x12480012,0x24924906,0x48200049,0x80410002,0x24000900,0x4924a489,0x10822492,0x20800125,0x48360,0x9241b692,0x6da4924,0x40009268,0x241b010,0x291b4900,0x6d249249,0x49493423,0x92492492,0x24924924,0x49249249,0x92492492,0x24924924,0x49249249,0x92492492,0x24924924,0x49249249,0x92492492,0x24924924,0x49249249,0x92492492,0x24924924,0x49249249,0x92492492,0x24924924,0x49249249,0x92492492,0x24924924,0x49249249,0x92492492,0x24924924,0x49249249,0x92492492,0x24924924,0x49249249,0x92492492,0x24924924,0x49249249,0x92492492,0x24924924,0x49249249,0x2492,]);Lev2TParametricDescription.prototype.toStates5=new Int32Array([0x801c0144,0x1453803,0x14700038,0xc0005145,0x1401,0x14,0x140000,0x0,0x510000,0x4e00e007,0xe0051,0x3451451c,0xd015000,0x30cd0000,0xc30c30c,0xc30c30d4,0x40c30c30,0x7c01c014,0xc03458c0,0x185e0c07,0x2830c286,0x830c3083,0xc30030,0x33430c,0x30c3003,0x70051030,0x16301f00,0x8301f00d,0x30a18617,0xc20ca0c,0x431420c3,0xb1450c51,0x14314315,0x4f143145,0x34c05401,0x4c30944c,0x55150c3,0x30830055,0x1430c014,0xc00050c3,0xc30850,0xc314300,0x150053c5,0x25130d30,0x5430d30c,0xc0354154,0x300d0c90,0x1cb2cd0c,0xc91cb0c3,0x72c30cb2,0x14f1cb2c,0xc34c0540,0x34c30944,0x82182214,0x851050c2,0x50851430,0x1400c50c,0x30c5085,0x50c51450,0x150053c,0xc25130d3,0x8850d30,0x1430a086,0x450c2144,0x51cb1c21,0x1c91c70c,0xc71c314b,0x34c1cb1,0x6c328328,0xc328014d,0x76cd34a0,0x1401c50c,0xc31c3140,0x31430c30,0x14,0x30c3005,0xa0ca00d3,0x535b0c,0x4d2830ca,0x514369b3,0xc500d01,0x5965965a,0x30d46546,0x6435030c,0x8034c659,0xdb439032,0x2c390034,0xcaaecb24,0x30832872,0xcb28b1c,0x4b1c32cb,0x70030033,0x30b0cb0c,0xe40ca00d,0x400d36d0,0xb2c90b0e,0xca1cb2ab,0xa2c70c20,0x6575d95c,0x4315b5ce,0x95c53831,0x28034c5d,0x9b705583,0xa1455830,0xc76cd6c,0x40143085,0x71451c51,0x871430c,0x450000c3,0xd3071451,0x1560ca00,0x560c26dc,0xb35b2851,0xc914369,0x1a14500d,0x46593945,0xcb2c939,0x94507503,0x328034c3,0x9b70558,0xe41c5583,0x72caaeca,0x1c308510,0xc7147287,0x50871c32,0x1470030c,0xd307147,0xc1560ca0,0x1560c26d,0xabb2b907,0x21441cb2,0x38a1c70c,0x8e657394,0x314b1c93,0x39438738,0x43083081,0x31c22432,0x820c510,0x830d7082,0x50c35c33,0xc30c338,0xc31c30c3,0x50c30c30,0xc204514,0x890c90c2,0x31440c70,0xa8208208,0xea0df0c3,0x8a231430,0xa28a28a2,0x28a28a1e,0x1861868a,0x48308308,0xc3682483,0x14516453,0x4d965845,0xd4659619,0x36590d94,0xd969964,0x546590d9,0x20c20541,0x920d20c,0x5914f0da,0x96114514,0x65865365,0xe89d3519,0x99e7a279,0x9e89e89e,0x81821827,0xb2032430,0x18b28920,0x422492c7,0xb28b0d72,0x3872c35c,0xc30d72cb,0x32cb2972,0x1c75cb0c,0xc90c204e,0xa2482c80,0x24b1c62c,0xc3a89089,0xb0ea2e42,0x9669a31c,0xa4966a28,0x59a8a269,0x8175e7a,0xb203243,0x718b2892,0x4114105c,0x17597658,0x74ce5d96,0x5c36572d,0xd92d7297,0xe1ce5d70,0xc90c204,0xca2482c8,0x4171c62,0x5d961045,0x976585d6,0x79669533,0x964965a2,0x659689e6,0x308175e7,0x24510510,0x451031c2,0xe2420841,0x5c338714,0x453851c3,0x51c51451,0xc30c31c,0x451450c7,0x41440c20,0xc708914,0x82105144,0xf1c58c90,0x1470ea0d,0x61861863,0x8a1e85e8,0x8687a8a2,0x3081861,0x24853c51,0x5053c368,0x1341144f,0x96194ce5,0x1544d439,0x94385514,0xe0d90d96,0x5415464,0x4f1440c2,0xf0da0921,0x4513d414,0x533944d0,0x350e6586,0x86082181,0xe89e981d,0x18277689,0x10308182,0x89207185,0x41c718b2,0x14e24224,0xc35cb287,0xe1c73871,0x28e1c514,0xc70c32cb,0x204e1c75,0x1c61440c,0xc62ca248,0x90891071,0x2e41c58c,0xa31c70ea,0xe86175e7,0xa269a475,0x5e7a57a8,0x51030817,0x28920718,0xf38718b,0xe5134114,0x39961758,0xe1ce4ce,0x728e3855,0x5ce0d92d,0xc204e1ce,0x81c61440,0x1c62ca24,0xd04503ce,0x85d63944,0x75338e65,0x5d86075e,0x89e69647,0x75e76576,]);Lev2TParametricDescription.prototype.offsetIncrs5=new Int32Array([0x10000000,0xc00000,0x60061,0x400,0x0,0x60000008,0x6b003080,0xdb6ab6db,0x2db6,0x800400,0x49245240,0x11482412,0x104904,0x40020000,0x92292000,0xa4b25924,0x9649658,0xd80c000,0xdb0c001b,0x80db6d86,0x6db01b6d,0xc0600003,0x86000d86,0x6db6c36d,0xddadb6ed,0x300001b6,0x6c360,0xe37236e4,0x46db6236,0xdb6c,0x361b018,0xb91b7200,0x6dbb1b71,0x6db763,0x20100820,0x61248001,0x92492490,0x24820004,0x8041000,0x92400090,0x24924830,0x555b6a49,0x2080012,0x20004804,0x49252449,0x84112492,0x4000928,0x240201,0x92922490,0x58924924,0x49456,0x120d8082,0x6da4800,0x69249249,0x249a01b,0x6c04100,0x6d240009,0x92492483,0x24d5adb4,0x60208001,0x92000483,0x24925236,0x6846da49,0x10400092,0x241b0,0x49291b49,0x636d2492,0x92494935,0x24924924,0x49249249,0x92492492,0x24924924,0x49249249,0x92492492,0x24924924,0x49249249,0x92492492,0x24924924,0x49249249,0x92492492,0x24924924,0x49249249,0x92492492,0x24924924,0x49249249,0x92492492,0x24924924,0x49249249,0x92492492,0x24924924,0x49249249,0x92492492,0x24924924,0x49249249,0x92492492,0x24924924,0x49249249,0x92492492,0x24924924,0x49249249,0x92492492,0x24924924,0x49249249,0x92492492,0x24924924,0x49249249,0x92492492,0x24924924,0x49249249,0x92492492,0x24924924,0x49249249,0x92492492,0x24924924,0x49249249,0x92492492,0x24924924,0x49249249,0x92492492,0x24924924,0x49249249,0x92492492,0x24924924,0x49249249,0x92492492,0x24924924,0x49249249,0x92492492,0x24924924,0x49249249,0x92492492,0x24924924,0x49249249,0x92492492,0x24924924,]);class Lev1TParametricDescription extends ParametricDescription{transition(absState,position,vector){let state=Math.floor(absState/(this.w+1));let offset=absState%(this.w+1);if(position===this.w){if(state<2){const loc=Math.imul(vector,2)+state;offset+=this.unpack(this.offsetIncrs0,loc,1);state=this.unpack(this.toStates0,loc,2)-1;}}else if(position===this.w-1){if(state<3){const loc=Math.imul(vector,3)+state;offset+=this.unpack(this.offsetIncrs1,loc,1);state=this.unpack(this.toStates1,loc,2)-1;}}else if(position===this.w-2){if(state<6){const loc=Math.imul(vector,6)+state;offset+=this.unpack(this.offsetIncrs2,loc,2);state=this.unpack(this.toStates2,loc,3)-1;}}else{if(state<6){const loc=Math.imul(vector,6)+state;offset+=this.unpack(this.offsetIncrs3,loc,2);state=this.unpack(this.toStates3,loc,3)-1;}}if(state===-1){return-1;}else{return Math.imul(state,this.w+1)+offset;}}constructor(w){super(w,1,new Int32Array([0,1,0,-1,-1,-1]));}}Lev1TParametricDescription.prototype.toStates0=new Int32Array([0x2,]);Lev1TParametricDescription.prototype.offsetIncrs0=new Int32Array([0x0,]);Lev1TParametricDescription.prototype.toStates1=new Int32Array([0xa43,]);Lev1TParametricDescription.prototype.offsetIncrs1=new Int32Array([0x38,]);Lev1TParametricDescription.prototype.toStates2=new Int32Array([0x12180003,0xb45a4914,0x69,]);Lev1TParametricDescription.prototype.offsetIncrs2=new Int32Array([0x558a0000,0x5555,]);Lev1TParametricDescription.prototype.toStates3=new Int32Array([0x900c0003,0xa1904864,0x45a49169,0x5a6d196a,0x9634,]);Lev1TParametricDescription.prototype.offsetIncrs3=new Int32Array([0xa0fc0000,0x5555ba08,0x55555555,]); |