@powerhousedao/connect 5.0.0-staging.24 → 5.0.0-staging.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/dist/assets/{atlas-import.huSz2S1P.js → atlas-import.CzW8-AP5.js} +2 -2
  2. package/dist/assets/{atlas-import.huSz2S1P.js.map → atlas-import.CzW8-AP5.js.map} +1 -1
  3. package/dist/assets/{ccip.B4gPk9T8.js → ccip.DqmhJKD0.js} +2 -2
  4. package/dist/assets/{ccip.B4gPk9T8.js.map → ccip.DqmhJKD0.js.map} +1 -1
  5. package/dist/assets/{content.EqFpXqQo.js → content.CxDClVTv.js} +2 -2
  6. package/dist/assets/{content.EqFpXqQo.js.map → content.CxDClVTv.js.map} +1 -1
  7. package/dist/assets/{creators.Cg7hgtUz.js → creators.BVnKHfhT.js} +2 -2
  8. package/dist/assets/{creators.Cg7hgtUz.js.map → creators.BVnKHfhT.js.map} +1 -1
  9. package/dist/assets/{drive-icon.VGDDLaPE.js → drive-icon.BUXuX5Ex.js} +2 -2
  10. package/dist/assets/{drive-icon.VGDDLaPE.js.map → drive-icon.BUXuX5Ex.js.map} +1 -1
  11. package/dist/assets/{index.CYAFrFct.js → index.B-dgtyfz.js} +2 -2
  12. package/dist/assets/{index.CYAFrFct.js.map → index.B-dgtyfz.js.map} +1 -1
  13. package/dist/assets/{index.DL3Up0hU.js → index.BKnM0GnX.js} +2 -2
  14. package/dist/assets/{index.DL3Up0hU.js.map → index.BKnM0GnX.js.map} +1 -1
  15. package/dist/assets/{index.DA_wjuiB.js → index.BS7j0VZJ.js} +2 -2
  16. package/dist/assets/{index.DA_wjuiB.js.map → index.BS7j0VZJ.js.map} +1 -1
  17. package/dist/assets/{index.CCqDl19I.js → index.Bli07gDj.js} +2 -2
  18. package/dist/assets/{index.CCqDl19I.js.map → index.Bli07gDj.js.map} +1 -1
  19. package/dist/assets/{index.CXV2LGi6.js → index.CZ3emu5D.js} +2 -2
  20. package/dist/assets/{index.CXV2LGi6.js.map → index.CZ3emu5D.js.map} +1 -1
  21. package/dist/assets/{index.JK7MVe59.js → index.C_h1SBrG.js} +2 -2
  22. package/dist/assets/{index.JK7MVe59.js.map → index.C_h1SBrG.js.map} +1 -1
  23. package/dist/assets/{index.CYF9Wn1v.js → index.Vc7_nzpo.js} +2 -2
  24. package/dist/assets/{index.CYF9Wn1v.js.map → index.Vc7_nzpo.js.map} +1 -1
  25. package/dist/assets/{main.BXlmSY46.js → main.s5_GNYWM.js} +8 -8
  26. package/dist/assets/{main.BXlmSY46.js.map → main.s5_GNYWM.js.map} +1 -1
  27. package/dist/assets/{nodefs.BpF1PLlt.js → nodefs.BiUz1Kbc.js} +2 -2
  28. package/dist/assets/{nodefs.BpF1PLlt.js.map → nodefs.BiUz1Kbc.js.map} +1 -1
  29. package/dist/assets/{opfs-ahp.BCWCVPBr.js → opfs-ahp.B2bR4XKE.js} +2 -2
  30. package/dist/assets/{opfs-ahp.BCWCVPBr.js.map → opfs-ahp.B2bR4XKE.js.map} +1 -1
  31. package/dist/assets/{root._-_EHvJY.js → root.4AaIaYqm.js} +2 -2
  32. package/dist/assets/{root._-_EHvJY.js.map → root.4AaIaYqm.js.map} +1 -1
  33. package/dist/index.html +1 -1
  34. package/dist/vite-envs.sh +1 -1
  35. package/package.json +9 -9
@@ -1,4 +1,4 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./content.EqFpXqQo.js","./drive-icon.VGDDLaPE.js","./index.CXV2LGi6.js","./root._-_EHvJY.js","./style-rsFGAo46.css","./index.DA_wjuiB.js","./creators.Cg7hgtUz.js","./index.DL3Up0hU.js"])))=>i.map(i=>d[i]);
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./content.CxDClVTv.js","./drive-icon.BUXuX5Ex.js","./index.CZ3emu5D.js","./root.4AaIaYqm.js","./style-rsFGAo46.css","./index.BS7j0VZJ.js","./creators.BVnKHfhT.js","./index.BKnM0GnX.js"])))=>i.map(i=>d[i]);
2
2
  var _f=Object.defineProperty;var $d=tr=>{throw TypeError(tr)};var bf=(tr,rr,ir)=>rr in tr?_f(tr,rr,{enumerable:!0,configurable:!0,writable:!0,value:ir}):tr[rr]=ir;var ki=(tr,rr,ir)=>bf(tr,typeof rr!="symbol"?rr+"":rr,ir),td=(tr,rr,ir)=>rr.has(tr)||$d("Cannot "+ir);var kr=(tr,rr,ir)=>(td(tr,rr,"read from private field"),ir?ir.call(tr):rr.get(tr)),Ri=(tr,rr,ir)=>rr.has(tr)?$d("Cannot add the same private member more than once"):rr instanceof WeakSet?rr.add(tr):rr.set(tr,ir),Ni=(tr,rr,ir,lr)=>(td(tr,rr,"write to private field"),lr?lr.call(tr,ir):rr.set(tr,ir),ir),Bi=(tr,rr,ir)=>(td(tr,rr,"access private method"),ir);var Sc=(tr,rr,ir,lr)=>({set _(dr){Ni(tr,rr,dr,ir)},get _(){return kr(tr,rr,lr)}});import{jsx as jsx$1,Fragment,jsxs}from"react/jsx-runtime";import{createRoot}from"react-dom/client";import*as React from"react";import React__default,{forwardRef,useLayoutEffect,useState,Suspense,useRef,useEffect,useCallback,useId as useId$1,useMemo,useContext,createContext,Component,Fragment as Fragment$1,useSyncExternalStore,createElement,isValidElement,cloneElement,Children,StrictMode,lazy}from"react";import*as ReactDOM from"react-dom";import ReactDOM__default,{createPortal}from"react-dom";function _mergeNamespaces(tr,rr){for(var ir=0;ir<rr.length;ir++){const lr=rr[ir];if(typeof lr!="string"&&!Array.isArray(lr)){for(const dr in lr)if(dr!=="default"&&!(dr in tr)){const fr=Object.getOwnPropertyDescriptor(lr,dr);fr&&Object.defineProperty(tr,dr,fr.get?fr:{enumerable:!0,get:()=>lr[dr]})}}}return Object.freeze(Object.defineProperty(tr,Symbol.toStringTag,{value:"Module"}))}(function(){const rr=document.createElement("link").relList;if(rr&&rr.supports&&rr.supports("modulepreload"))return;for(const dr of document.querySelectorAll('link[rel="modulepreload"]'))lr(dr);new MutationObserver(dr=>{for(const fr of dr)if(fr.type==="childList")for(const hr of fr.addedNodes)hr.tagName==="LINK"&&hr.rel==="modulepreload"&&lr(hr)}).observe(document,{childList:!0,subtree:!0});function ir(dr){const fr={};return dr.integrity&&(fr.integrity=dr.integrity),dr.referrerPolicy&&(fr.referrerPolicy=dr.referrerPolicy),dr.crossOrigin==="use-credentials"?fr.credentials="include":dr.crossOrigin==="anonymous"?fr.credentials="omit":fr.credentials="same-origin",fr}function lr(dr){if(dr.ep)return;dr.ep=!0;const fr=ir(dr);fetch(dr.href,fr)}})();function setRef(tr,rr){if(typeof tr=="function")return tr(rr);tr!=null&&(tr.current=rr)}function composeRefs(...tr){return rr=>{let ir=!1;const lr=tr.map(dr=>{const fr=setRef(dr,rr);return!ir&&typeof fr=="function"&&(ir=!0),fr});if(ir)return()=>{for(let dr=0;dr<lr.length;dr++){const fr=lr[dr];typeof fr=="function"?fr():setRef(tr[dr],null)}}}}function useComposedRefs(...tr){return React.useCallback(composeRefs(...tr),tr)}function createSlot(tr){const rr=createSlotClone(tr),ir=React.forwardRef((lr,dr)=>{const{children:fr,...hr}=lr,mr=React.Children.toArray(fr),gr=mr.find(isSlottable);if(gr){const yr=gr.props.children,_r=mr.map(br=>br===gr?React.Children.count(yr)>1?React.Children.only(null):React.isValidElement(yr)?yr.props.children:null:br);return jsx$1(rr,{...hr,ref:dr,children:React.isValidElement(yr)?React.cloneElement(yr,void 0,_r):null})}return jsx$1(rr,{...hr,ref:dr,children:fr})});return ir.displayName=`${tr}.Slot`,ir}var Slot$3=createSlot("Slot");function createSlotClone(tr){const rr=React.forwardRef((ir,lr)=>{const{children:dr,...fr}=ir;if(React.isValidElement(dr)){const hr=getElementRef$1(dr),mr=mergeProps$1(fr,dr.props);return dr.type!==React.Fragment&&(mr.ref=lr?composeRefs(lr,hr):hr),React.cloneElement(dr,mr)}return React.Children.count(dr)>1?React.Children.only(null):null});return rr.displayName=`${tr}.SlotClone`,rr}var SLOTTABLE_IDENTIFIER=Symbol("radix.slottable");function createSlottable(tr){const rr=({children:ir})=>jsx$1(Fragment,{children:ir});return rr.displayName=`${tr}.Slottable`,rr.__radixId=SLOTTABLE_IDENTIFIER,rr}function isSlottable(tr){return React.isValidElement(tr)&&typeof tr.type=="function"&&"__radixId"in tr.type&&tr.type.__radixId===SLOTTABLE_IDENTIFIER}function mergeProps$1(tr,rr){const ir={...rr};for(const lr in rr){const dr=tr[lr],fr=rr[lr];/^on[A-Z]/.test(lr)?dr&&fr?ir[lr]=(...mr)=>{const gr=fr(...mr);return dr(...mr),gr}:dr&&(ir[lr]=dr):lr==="style"?ir[lr]={...dr,...fr}:lr==="className"&&(ir[lr]=[dr,fr].filter(Boolean).join(" "))}return{...tr,...ir}}function getElementRef$1(tr){var lr,dr;let rr=(lr=Object.getOwnPropertyDescriptor(tr.props,"ref"))==null?void 0:lr.get,ir=rr&&"isReactWarning"in rr&&rr.isReactWarning;return ir?tr.ref:(rr=(dr=Object.getOwnPropertyDescriptor(tr,"ref"))==null?void 0:dr.get,ir=rr&&"isReactWarning"in rr&&rr.isReactWarning,ir?tr.props.ref:tr.props.ref||tr.ref)}function r$2(tr){var rr,ir,lr="";if(typeof tr=="string"||typeof tr=="number")lr+=tr;else if(typeof tr=="object")if(Array.isArray(tr)){var dr=tr.length;for(rr=0;rr<dr;rr++)tr[rr]&&(ir=r$2(tr[rr]))&&(lr&&(lr+=" "),lr+=ir)}else for(ir in tr)tr[ir]&&(lr&&(lr+=" "),lr+=ir);return lr}function clsx(){for(var tr,rr,ir=0,lr="",dr=arguments.length;ir<dr;ir++)(tr=arguments[ir])&&(rr=r$2(tr))&&(lr&&(lr+=" "),lr+=rr);return lr}const falsyToString=tr=>typeof tr=="boolean"?`${tr}`:tr===0?"0":tr,cx=clsx,cva=(tr,rr)=>ir=>{var lr;if((rr==null?void 0:rr.variants)==null)return cx(tr,ir==null?void 0:ir.class,ir==null?void 0:ir.className);const{variants:dr,defaultVariants:fr}=rr,hr=Object.keys(dr).map(yr=>{const _r=ir==null?void 0:ir[yr],br=fr==null?void 0:fr[yr];if(_r===null)return null;const vr=falsyToString(_r)||falsyToString(br);return dr[yr][vr]}),mr=ir&&Object.entries(ir).reduce((yr,_r)=>{let[br,vr]=_r;return vr===void 0||(yr[br]=vr),yr},{}),gr=rr==null||(lr=rr.compoundVariants)===null||lr===void 0?void 0:lr.reduce((yr,_r)=>{let{class:br,className:vr,...wr}=_r;return Object.entries(wr).every(xr=>{let[Sr,Ar]=xr;return Array.isArray(Ar)?Ar.includes({...fr,...mr}[Sr]):{...fr,...mr}[Sr]===Ar})?[...yr,br,vr]:yr},[]);return cx(tr,hr,gr,ir==null?void 0:ir.class,ir==null?void 0:ir.className)},CLASS_PART_SEPARATOR="-",createClassGroupUtils=tr=>{const rr=createClassMap(tr),{conflictingClassGroups:ir,conflictingClassGroupModifiers:lr}=tr;return{getClassGroupId:hr=>{const mr=hr.split(CLASS_PART_SEPARATOR);return mr[0]===""&&mr.length!==1&&mr.shift(),getGroupRecursive(mr,rr)||getGroupIdForArbitraryProperty(hr)},getConflictingClassGroupIds:(hr,mr)=>{const gr=ir[hr]||[];return mr&&lr[hr]?[...gr,...lr[hr]]:gr}}},getGroupRecursive=(tr,rr)=>{var hr;if(tr.length===0)return rr.classGroupId;const ir=tr[0],lr=rr.nextPart.get(ir),dr=lr?getGroupRecursive(tr.slice(1),lr):void 0;if(dr)return dr;if(rr.validators.length===0)return;const fr=tr.join(CLASS_PART_SEPARATOR);return(hr=rr.validators.find(({validator:mr})=>mr(fr)))==null?void 0:hr.classGroupId},arbitraryPropertyRegex=/^\[(.+)\]$/,getGroupIdForArbitraryProperty=tr=>{if(arbitraryPropertyRegex.test(tr)){const rr=arbitraryPropertyRegex.exec(tr)[1],ir=rr==null?void 0:rr.substring(0,rr.indexOf(":"));if(ir)return"arbitrary.."+ir}},createClassMap=tr=>{const{theme:rr,classGroups:ir}=tr,lr={nextPart:new Map,validators:[]};for(const dr in ir)processClassesRecursively(ir[dr],lr,dr,rr);return lr},processClassesRecursively=(tr,rr,ir,lr)=>{tr.forEach(dr=>{if(typeof dr=="string"){const fr=dr===""?rr:getPart(rr,dr);fr.classGroupId=ir;return}if(typeof dr=="function"){if(isThemeGetter(dr)){processClassesRecursively(dr(lr),rr,ir,lr);return}rr.validators.push({validator:dr,classGroupId:ir});return}Object.entries(dr).forEach(([fr,hr])=>{processClassesRecursively(hr,getPart(rr,fr),ir,lr)})})},getPart=(tr,rr)=>{let ir=tr;return rr.split(CLASS_PART_SEPARATOR).forEach(lr=>{ir.nextPart.has(lr)||ir.nextPart.set(lr,{nextPart:new Map,validators:[]}),ir=ir.nextPart.get(lr)}),ir},isThemeGetter=tr=>tr.isThemeGetter,createLruCache=tr=>{if(tr<1)return{get:()=>{},set:()=>{}};let rr=0,ir=new Map,lr=new Map;const dr=(fr,hr)=>{ir.set(fr,hr),rr++,rr>tr&&(rr=0,lr=ir,ir=new Map)};return{get(fr){let hr=ir.get(fr);if(hr!==void 0)return hr;if((hr=lr.get(fr))!==void 0)return dr(fr,hr),hr},set(fr,hr){ir.has(fr)?ir.set(fr,hr):dr(fr,hr)}}},IMPORTANT_MODIFIER="!",MODIFIER_SEPARATOR=":",MODIFIER_SEPARATOR_LENGTH=MODIFIER_SEPARATOR.length,createParseClassName=tr=>{const{prefix:rr,experimentalParseClassName:ir}=tr;let lr=dr=>{const fr=[];let hr=0,mr=0,gr=0,yr;for(let xr=0;xr<dr.length;xr++){let Sr=dr[xr];if(hr===0&&mr===0){if(Sr===MODIFIER_SEPARATOR){fr.push(dr.slice(gr,xr)),gr=xr+MODIFIER_SEPARATOR_LENGTH;continue}if(Sr==="/"){yr=xr;continue}}Sr==="["?hr++:Sr==="]"?hr--:Sr==="("?mr++:Sr===")"&&mr--}const _r=fr.length===0?dr:dr.substring(gr),br=stripImportantModifier(_r),vr=br!==_r,wr=yr&&yr>gr?yr-gr:void 0;return{modifiers:fr,hasImportantModifier:vr,baseClassName:br,maybePostfixModifierPosition:wr}};if(rr){const dr=rr+MODIFIER_SEPARATOR,fr=lr;lr=hr=>hr.startsWith(dr)?fr(hr.substring(dr.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:hr,maybePostfixModifierPosition:void 0}}if(ir){const dr=lr;lr=fr=>ir({className:fr,parseClassName:dr})}return lr},stripImportantModifier=tr=>tr.endsWith(IMPORTANT_MODIFIER)?tr.substring(0,tr.length-1):tr.startsWith(IMPORTANT_MODIFIER)?tr.substring(1):tr,createSortModifiers=tr=>{const rr=Object.fromEntries(tr.orderSensitiveModifiers.map(lr=>[lr,!0]));return lr=>{if(lr.length<=1)return lr;const dr=[];let fr=[];return lr.forEach(hr=>{hr[0]==="["||rr[hr]?(dr.push(...fr.sort(),hr),fr=[]):fr.push(hr)}),dr.push(...fr.sort()),dr}},createConfigUtils=tr=>({cache:createLruCache(tr.cacheSize),parseClassName:createParseClassName(tr),sortModifiers:createSortModifiers(tr),...createClassGroupUtils(tr)}),SPLIT_CLASSES_REGEX=/\s+/,mergeClassList=(tr,rr)=>{const{parseClassName:ir,getClassGroupId:lr,getConflictingClassGroupIds:dr,sortModifiers:fr}=rr,hr=[],mr=tr.trim().split(SPLIT_CLASSES_REGEX);let gr="";for(let yr=mr.length-1;yr>=0;yr-=1){const _r=mr[yr],{isExternal:br,modifiers:vr,hasImportantModifier:wr,baseClassName:xr,maybePostfixModifierPosition:Sr}=ir(_r);if(br){gr=_r+(gr.length>0?" "+gr:gr);continue}let Ar=!!Sr,Ir=lr(Ar?xr.substring(0,Sr):xr);if(!Ir){if(!Ar){gr=_r+(gr.length>0?" "+gr:gr);continue}if(Ir=lr(xr),!Ir){gr=_r+(gr.length>0?" "+gr:gr);continue}Ar=!1}const Mr=fr(vr).join(":"),Or=wr?Mr+IMPORTANT_MODIFIER:Mr,$r=Or+Ir;if(hr.includes($r))continue;hr.push($r);const Dr=dr(Ir,Ar);for(let zr=0;zr<Dr.length;++zr){const Fr=Dr[zr];hr.push(Or+Fr)}gr=_r+(gr.length>0?" "+gr:gr)}return gr};function twJoin(){let tr=0,rr,ir,lr="";for(;tr<arguments.length;)(rr=arguments[tr++])&&(ir=toValue(rr))&&(lr&&(lr+=" "),lr+=ir);return lr}const toValue=tr=>{if(typeof tr=="string")return tr;let rr,ir="";for(let lr=0;lr<tr.length;lr++)tr[lr]&&(rr=toValue(tr[lr]))&&(ir&&(ir+=" "),ir+=rr);return ir};function createTailwindMerge(tr,...rr){let ir,lr,dr,fr=hr;function hr(gr){const yr=rr.reduce((_r,br)=>br(_r),tr());return ir=createConfigUtils(yr),lr=ir.cache.get,dr=ir.cache.set,fr=mr,mr(gr)}function mr(gr){const yr=lr(gr);if(yr)return yr;const _r=mergeClassList(gr,ir);return dr(gr,_r),_r}return function(){return fr(twJoin.apply(null,arguments))}}const fromTheme=tr=>{const rr=ir=>ir[tr]||[];return rr.isThemeGetter=!0,rr},arbitraryValueRegex=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,arbitraryVariableRegex=/^\((?:(\w[\w-]*):)?(.+)\)$/i,fractionRegex=/^\d+\/\d+$/,tshirtUnitRegex=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,lengthUnitRegex=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,colorFunctionRegex=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,shadowRegex=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,imageRegex=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,isFraction=tr=>fractionRegex.test(tr),isNumber$2=tr=>!!tr&&!Number.isNaN(Number(tr)),isInteger$1=tr=>!!tr&&Number.isInteger(Number(tr)),isPercent=tr=>tr.endsWith("%")&&isNumber$2(tr.slice(0,-1)),isTshirtSize=tr=>tshirtUnitRegex.test(tr),isAny=()=>!0,isLengthOnly=tr=>lengthUnitRegex.test(tr)&&!colorFunctionRegex.test(tr),isNever=()=>!1,isShadow=tr=>shadowRegex.test(tr),isImage=tr=>imageRegex.test(tr),isAnyNonArbitrary=tr=>!isArbitraryValue(tr)&&!isArbitraryVariable(tr),isArbitrarySize=tr=>getIsArbitraryValue(tr,isLabelSize,isNever),isArbitraryValue=tr=>arbitraryValueRegex.test(tr),isArbitraryLength=tr=>getIsArbitraryValue(tr,isLabelLength,isLengthOnly),isArbitraryNumber=tr=>getIsArbitraryValue(tr,isLabelNumber,isNumber$2),isArbitraryPosition=tr=>getIsArbitraryValue(tr,isLabelPosition,isNever),isArbitraryImage=tr=>getIsArbitraryValue(tr,isLabelImage,isImage),isArbitraryShadow=tr=>getIsArbitraryValue(tr,isLabelShadow,isShadow),isArbitraryVariable=tr=>arbitraryVariableRegex.test(tr),isArbitraryVariableLength=tr=>getIsArbitraryVariable(tr,isLabelLength),isArbitraryVariableFamilyName=tr=>getIsArbitraryVariable(tr,isLabelFamilyName),isArbitraryVariablePosition=tr=>getIsArbitraryVariable(tr,isLabelPosition),isArbitraryVariableSize=tr=>getIsArbitraryVariable(tr,isLabelSize),isArbitraryVariableImage=tr=>getIsArbitraryVariable(tr,isLabelImage),isArbitraryVariableShadow=tr=>getIsArbitraryVariable(tr,isLabelShadow,!0),getIsArbitraryValue=(tr,rr,ir)=>{const lr=arbitraryValueRegex.exec(tr);return lr?lr[1]?rr(lr[1]):ir(lr[2]):!1},getIsArbitraryVariable=(tr,rr,ir=!1)=>{const lr=arbitraryVariableRegex.exec(tr);return lr?lr[1]?rr(lr[1]):ir:!1},isLabelPosition=tr=>tr==="position"||tr==="percentage",isLabelImage=tr=>tr==="image"||tr==="url",isLabelSize=tr=>tr==="length"||tr==="size"||tr==="bg-size",isLabelLength=tr=>tr==="length",isLabelNumber=tr=>tr==="number",isLabelFamilyName=tr=>tr==="family-name",isLabelShadow=tr=>tr==="shadow",getDefaultConfig=()=>{const tr=fromTheme("color"),rr=fromTheme("font"),ir=fromTheme("text"),lr=fromTheme("font-weight"),dr=fromTheme("tracking"),fr=fromTheme("leading"),hr=fromTheme("breakpoint"),mr=fromTheme("container"),gr=fromTheme("spacing"),yr=fromTheme("radius"),_r=fromTheme("shadow"),br=fromTheme("inset-shadow"),vr=fromTheme("text-shadow"),wr=fromTheme("drop-shadow"),xr=fromTheme("blur"),Sr=fromTheme("perspective"),Ar=fromTheme("aspect"),Ir=fromTheme("ease"),Mr=fromTheme("animate"),Or=()=>["auto","avoid","all","avoid-page","page","left","right","column"],$r=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],Dr=()=>[...$r(),isArbitraryVariable,isArbitraryValue],zr=()=>["auto","hidden","clip","visible","scroll"],Fr=()=>["auto","contain","none"],Jr=()=>[isArbitraryVariable,isArbitraryValue,gr],$n=()=>[isFraction,"full","auto",...Jr()],Qr=()=>[isInteger$1,"none","subgrid",isArbitraryVariable,isArbitraryValue],Zn=()=>["auto",{span:["full",isInteger$1,isArbitraryVariable,isArbitraryValue]},isInteger$1,isArbitraryVariable,isArbitraryValue],qn=()=>[isInteger$1,"auto",isArbitraryVariable,isArbitraryValue],Xn=()=>["auto","min","max","fr",isArbitraryVariable,isArbitraryValue],Lr=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],Gr=()=>["start","end","center","stretch","center-safe","end-safe"],Hn=()=>["auto",...Jr()],ii=()=>[isFraction,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...Jr()],oi=()=>[tr,isArbitraryVariable,isArbitraryValue],ri=()=>[...$r(),isArbitraryVariablePosition,isArbitraryPosition,{position:[isArbitraryVariable,isArbitraryValue]}],ti=()=>["no-repeat",{repeat:["","x","y","space","round"]}],si=()=>["auto","cover","contain",isArbitraryVariableSize,isArbitrarySize,{size:[isArbitraryVariable,isArbitraryValue]}],Jn=()=>[isPercent,isArbitraryVariableLength,isArbitraryLength],ni=()=>["","none","full",yr,isArbitraryVariable,isArbitraryValue],Yn=()=>["",isNumber$2,isArbitraryVariableLength,isArbitraryLength],ei=()=>["solid","dashed","dotted","double"],ai=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],pi=()=>[isNumber$2,isPercent,isArbitraryVariablePosition,isArbitraryPosition],bi=()=>["","none",xr,isArbitraryVariable,isArbitraryValue],vi=()=>["none",isNumber$2,isArbitraryVariable,isArbitraryValue],Ti=()=>["none",isNumber$2,isArbitraryVariable,isArbitraryValue],Li=()=>[isNumber$2,isArbitraryVariable,isArbitraryValue],qi=()=>[isFraction,"full",...Jr()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[isTshirtSize],breakpoint:[isTshirtSize],color:[isAny],container:[isTshirtSize],"drop-shadow":[isTshirtSize],ease:["in","out","in-out"],font:[isAnyNonArbitrary],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[isTshirtSize],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[isTshirtSize],shadow:[isTshirtSize],spacing:["px",isNumber$2],text:[isTshirtSize],"text-shadow":[isTshirtSize],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",isFraction,isArbitraryValue,isArbitraryVariable,Ar]}],container:["container"],columns:[{columns:[isNumber$2,isArbitraryValue,isArbitraryVariable,mr]}],"break-after":[{"break-after":Or()}],"break-before":[{"break-before":Or()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:Dr()}],overflow:[{overflow:zr()}],"overflow-x":[{"overflow-x":zr()}],"overflow-y":[{"overflow-y":zr()}],overscroll:[{overscroll:Fr()}],"overscroll-x":[{"overscroll-x":Fr()}],"overscroll-y":[{"overscroll-y":Fr()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:$n()}],"inset-x":[{"inset-x":$n()}],"inset-y":[{"inset-y":$n()}],start:[{start:$n()}],end:[{end:$n()}],top:[{top:$n()}],right:[{right:$n()}],bottom:[{bottom:$n()}],left:[{left:$n()}],visibility:["visible","invisible","collapse"],z:[{z:[isInteger$1,"auto",isArbitraryVariable,isArbitraryValue]}],basis:[{basis:[isFraction,"full","auto",mr,...Jr()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[isNumber$2,isFraction,"auto","initial","none",isArbitraryValue]}],grow:[{grow:["",isNumber$2,isArbitraryVariable,isArbitraryValue]}],shrink:[{shrink:["",isNumber$2,isArbitraryVariable,isArbitraryValue]}],order:[{order:[isInteger$1,"first","last","none",isArbitraryVariable,isArbitraryValue]}],"grid-cols":[{"grid-cols":Qr()}],"col-start-end":[{col:Zn()}],"col-start":[{"col-start":qn()}],"col-end":[{"col-end":qn()}],"grid-rows":[{"grid-rows":Qr()}],"row-start-end":[{row:Zn()}],"row-start":[{"row-start":qn()}],"row-end":[{"row-end":qn()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":Xn()}],"auto-rows":[{"auto-rows":Xn()}],gap:[{gap:Jr()}],"gap-x":[{"gap-x":Jr()}],"gap-y":[{"gap-y":Jr()}],"justify-content":[{justify:[...Lr(),"normal"]}],"justify-items":[{"justify-items":[...Gr(),"normal"]}],"justify-self":[{"justify-self":["auto",...Gr()]}],"align-content":[{content:["normal",...Lr()]}],"align-items":[{items:[...Gr(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...Gr(),{baseline:["","last"]}]}],"place-content":[{"place-content":Lr()}],"place-items":[{"place-items":[...Gr(),"baseline"]}],"place-self":[{"place-self":["auto",...Gr()]}],p:[{p:Jr()}],px:[{px:Jr()}],py:[{py:Jr()}],ps:[{ps:Jr()}],pe:[{pe:Jr()}],pt:[{pt:Jr()}],pr:[{pr:Jr()}],pb:[{pb:Jr()}],pl:[{pl:Jr()}],m:[{m:Hn()}],mx:[{mx:Hn()}],my:[{my:Hn()}],ms:[{ms:Hn()}],me:[{me:Hn()}],mt:[{mt:Hn()}],mr:[{mr:Hn()}],mb:[{mb:Hn()}],ml:[{ml:Hn()}],"space-x":[{"space-x":Jr()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":Jr()}],"space-y-reverse":["space-y-reverse"],size:[{size:ii()}],w:[{w:[mr,"screen",...ii()]}],"min-w":[{"min-w":[mr,"screen","none",...ii()]}],"max-w":[{"max-w":[mr,"screen","none","prose",{screen:[hr]},...ii()]}],h:[{h:["screen","lh",...ii()]}],"min-h":[{"min-h":["screen","lh","none",...ii()]}],"max-h":[{"max-h":["screen","lh",...ii()]}],"font-size":[{text:["base",ir,isArbitraryVariableLength,isArbitraryLength]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[lr,isArbitraryVariable,isArbitraryNumber]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",isPercent,isArbitraryValue]}],"font-family":[{font:[isArbitraryVariableFamilyName,isArbitraryValue,rr]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[dr,isArbitraryVariable,isArbitraryValue]}],"line-clamp":[{"line-clamp":[isNumber$2,"none",isArbitraryVariable,isArbitraryNumber]}],leading:[{leading:[fr,...Jr()]}],"list-image":[{"list-image":["none",isArbitraryVariable,isArbitraryValue]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",isArbitraryVariable,isArbitraryValue]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:oi()}],"text-color":[{text:oi()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ei(),"wavy"]}],"text-decoration-thickness":[{decoration:[isNumber$2,"from-font","auto",isArbitraryVariable,isArbitraryLength]}],"text-decoration-color":[{decoration:oi()}],"underline-offset":[{"underline-offset":[isNumber$2,"auto",isArbitraryVariable,isArbitraryValue]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:Jr()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",isArbitraryVariable,isArbitraryValue]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",isArbitraryVariable,isArbitraryValue]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:ri()}],"bg-repeat":[{bg:ti()}],"bg-size":[{bg:si()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},isInteger$1,isArbitraryVariable,isArbitraryValue],radial:["",isArbitraryVariable,isArbitraryValue],conic:[isInteger$1,isArbitraryVariable,isArbitraryValue]},isArbitraryVariableImage,isArbitraryImage]}],"bg-color":[{bg:oi()}],"gradient-from-pos":[{from:Jn()}],"gradient-via-pos":[{via:Jn()}],"gradient-to-pos":[{to:Jn()}],"gradient-from":[{from:oi()}],"gradient-via":[{via:oi()}],"gradient-to":[{to:oi()}],rounded:[{rounded:ni()}],"rounded-s":[{"rounded-s":ni()}],"rounded-e":[{"rounded-e":ni()}],"rounded-t":[{"rounded-t":ni()}],"rounded-r":[{"rounded-r":ni()}],"rounded-b":[{"rounded-b":ni()}],"rounded-l":[{"rounded-l":ni()}],"rounded-ss":[{"rounded-ss":ni()}],"rounded-se":[{"rounded-se":ni()}],"rounded-ee":[{"rounded-ee":ni()}],"rounded-es":[{"rounded-es":ni()}],"rounded-tl":[{"rounded-tl":ni()}],"rounded-tr":[{"rounded-tr":ni()}],"rounded-br":[{"rounded-br":ni()}],"rounded-bl":[{"rounded-bl":ni()}],"border-w":[{border:Yn()}],"border-w-x":[{"border-x":Yn()}],"border-w-y":[{"border-y":Yn()}],"border-w-s":[{"border-s":Yn()}],"border-w-e":[{"border-e":Yn()}],"border-w-t":[{"border-t":Yn()}],"border-w-r":[{"border-r":Yn()}],"border-w-b":[{"border-b":Yn()}],"border-w-l":[{"border-l":Yn()}],"divide-x":[{"divide-x":Yn()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":Yn()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ei(),"hidden","none"]}],"divide-style":[{divide:[...ei(),"hidden","none"]}],"border-color":[{border:oi()}],"border-color-x":[{"border-x":oi()}],"border-color-y":[{"border-y":oi()}],"border-color-s":[{"border-s":oi()}],"border-color-e":[{"border-e":oi()}],"border-color-t":[{"border-t":oi()}],"border-color-r":[{"border-r":oi()}],"border-color-b":[{"border-b":oi()}],"border-color-l":[{"border-l":oi()}],"divide-color":[{divide:oi()}],"outline-style":[{outline:[...ei(),"none","hidden"]}],"outline-offset":[{"outline-offset":[isNumber$2,isArbitraryVariable,isArbitraryValue]}],"outline-w":[{outline:["",isNumber$2,isArbitraryVariableLength,isArbitraryLength]}],"outline-color":[{outline:oi()}],shadow:[{shadow:["","none",_r,isArbitraryVariableShadow,isArbitraryShadow]}],"shadow-color":[{shadow:oi()}],"inset-shadow":[{"inset-shadow":["none",br,isArbitraryVariableShadow,isArbitraryShadow]}],"inset-shadow-color":[{"inset-shadow":oi()}],"ring-w":[{ring:Yn()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:oi()}],"ring-offset-w":[{"ring-offset":[isNumber$2,isArbitraryLength]}],"ring-offset-color":[{"ring-offset":oi()}],"inset-ring-w":[{"inset-ring":Yn()}],"inset-ring-color":[{"inset-ring":oi()}],"text-shadow":[{"text-shadow":["none",vr,isArbitraryVariableShadow,isArbitraryShadow]}],"text-shadow-color":[{"text-shadow":oi()}],opacity:[{opacity:[isNumber$2,isArbitraryVariable,isArbitraryValue]}],"mix-blend":[{"mix-blend":[...ai(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ai()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[isNumber$2]}],"mask-image-linear-from-pos":[{"mask-linear-from":pi()}],"mask-image-linear-to-pos":[{"mask-linear-to":pi()}],"mask-image-linear-from-color":[{"mask-linear-from":oi()}],"mask-image-linear-to-color":[{"mask-linear-to":oi()}],"mask-image-t-from-pos":[{"mask-t-from":pi()}],"mask-image-t-to-pos":[{"mask-t-to":pi()}],"mask-image-t-from-color":[{"mask-t-from":oi()}],"mask-image-t-to-color":[{"mask-t-to":oi()}],"mask-image-r-from-pos":[{"mask-r-from":pi()}],"mask-image-r-to-pos":[{"mask-r-to":pi()}],"mask-image-r-from-color":[{"mask-r-from":oi()}],"mask-image-r-to-color":[{"mask-r-to":oi()}],"mask-image-b-from-pos":[{"mask-b-from":pi()}],"mask-image-b-to-pos":[{"mask-b-to":pi()}],"mask-image-b-from-color":[{"mask-b-from":oi()}],"mask-image-b-to-color":[{"mask-b-to":oi()}],"mask-image-l-from-pos":[{"mask-l-from":pi()}],"mask-image-l-to-pos":[{"mask-l-to":pi()}],"mask-image-l-from-color":[{"mask-l-from":oi()}],"mask-image-l-to-color":[{"mask-l-to":oi()}],"mask-image-x-from-pos":[{"mask-x-from":pi()}],"mask-image-x-to-pos":[{"mask-x-to":pi()}],"mask-image-x-from-color":[{"mask-x-from":oi()}],"mask-image-x-to-color":[{"mask-x-to":oi()}],"mask-image-y-from-pos":[{"mask-y-from":pi()}],"mask-image-y-to-pos":[{"mask-y-to":pi()}],"mask-image-y-from-color":[{"mask-y-from":oi()}],"mask-image-y-to-color":[{"mask-y-to":oi()}],"mask-image-radial":[{"mask-radial":[isArbitraryVariable,isArbitraryValue]}],"mask-image-radial-from-pos":[{"mask-radial-from":pi()}],"mask-image-radial-to-pos":[{"mask-radial-to":pi()}],"mask-image-radial-from-color":[{"mask-radial-from":oi()}],"mask-image-radial-to-color":[{"mask-radial-to":oi()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":$r()}],"mask-image-conic-pos":[{"mask-conic":[isNumber$2]}],"mask-image-conic-from-pos":[{"mask-conic-from":pi()}],"mask-image-conic-to-pos":[{"mask-conic-to":pi()}],"mask-image-conic-from-color":[{"mask-conic-from":oi()}],"mask-image-conic-to-color":[{"mask-conic-to":oi()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:ri()}],"mask-repeat":[{mask:ti()}],"mask-size":[{mask:si()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",isArbitraryVariable,isArbitraryValue]}],filter:[{filter:["","none",isArbitraryVariable,isArbitraryValue]}],blur:[{blur:bi()}],brightness:[{brightness:[isNumber$2,isArbitraryVariable,isArbitraryValue]}],contrast:[{contrast:[isNumber$2,isArbitraryVariable,isArbitraryValue]}],"drop-shadow":[{"drop-shadow":["","none",wr,isArbitraryVariableShadow,isArbitraryShadow]}],"drop-shadow-color":[{"drop-shadow":oi()}],grayscale:[{grayscale:["",isNumber$2,isArbitraryVariable,isArbitraryValue]}],"hue-rotate":[{"hue-rotate":[isNumber$2,isArbitraryVariable,isArbitraryValue]}],invert:[{invert:["",isNumber$2,isArbitraryVariable,isArbitraryValue]}],saturate:[{saturate:[isNumber$2,isArbitraryVariable,isArbitraryValue]}],sepia:[{sepia:["",isNumber$2,isArbitraryVariable,isArbitraryValue]}],"backdrop-filter":[{"backdrop-filter":["","none",isArbitraryVariable,isArbitraryValue]}],"backdrop-blur":[{"backdrop-blur":bi()}],"backdrop-brightness":[{"backdrop-brightness":[isNumber$2,isArbitraryVariable,isArbitraryValue]}],"backdrop-contrast":[{"backdrop-contrast":[isNumber$2,isArbitraryVariable,isArbitraryValue]}],"backdrop-grayscale":[{"backdrop-grayscale":["",isNumber$2,isArbitraryVariable,isArbitraryValue]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[isNumber$2,isArbitraryVariable,isArbitraryValue]}],"backdrop-invert":[{"backdrop-invert":["",isNumber$2,isArbitraryVariable,isArbitraryValue]}],"backdrop-opacity":[{"backdrop-opacity":[isNumber$2,isArbitraryVariable,isArbitraryValue]}],"backdrop-saturate":[{"backdrop-saturate":[isNumber$2,isArbitraryVariable,isArbitraryValue]}],"backdrop-sepia":[{"backdrop-sepia":["",isNumber$2,isArbitraryVariable,isArbitraryValue]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":Jr()}],"border-spacing-x":[{"border-spacing-x":Jr()}],"border-spacing-y":[{"border-spacing-y":Jr()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",isArbitraryVariable,isArbitraryValue]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[isNumber$2,"initial",isArbitraryVariable,isArbitraryValue]}],ease:[{ease:["linear","initial",Ir,isArbitraryVariable,isArbitraryValue]}],delay:[{delay:[isNumber$2,isArbitraryVariable,isArbitraryValue]}],animate:[{animate:["none",Mr,isArbitraryVariable,isArbitraryValue]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[Sr,isArbitraryVariable,isArbitraryValue]}],"perspective-origin":[{"perspective-origin":Dr()}],rotate:[{rotate:vi()}],"rotate-x":[{"rotate-x":vi()}],"rotate-y":[{"rotate-y":vi()}],"rotate-z":[{"rotate-z":vi()}],scale:[{scale:Ti()}],"scale-x":[{"scale-x":Ti()}],"scale-y":[{"scale-y":Ti()}],"scale-z":[{"scale-z":Ti()}],"scale-3d":["scale-3d"],skew:[{skew:Li()}],"skew-x":[{"skew-x":Li()}],"skew-y":[{"skew-y":Li()}],transform:[{transform:[isArbitraryVariable,isArbitraryValue,"","none","gpu","cpu"]}],"transform-origin":[{origin:Dr()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:qi()}],"translate-x":[{"translate-x":qi()}],"translate-y":[{"translate-y":qi()}],"translate-z":[{"translate-z":qi()}],"translate-none":["translate-none"],accent:[{accent:oi()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:oi()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",isArbitraryVariable,isArbitraryValue]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":Jr()}],"scroll-mx":[{"scroll-mx":Jr()}],"scroll-my":[{"scroll-my":Jr()}],"scroll-ms":[{"scroll-ms":Jr()}],"scroll-me":[{"scroll-me":Jr()}],"scroll-mt":[{"scroll-mt":Jr()}],"scroll-mr":[{"scroll-mr":Jr()}],"scroll-mb":[{"scroll-mb":Jr()}],"scroll-ml":[{"scroll-ml":Jr()}],"scroll-p":[{"scroll-p":Jr()}],"scroll-px":[{"scroll-px":Jr()}],"scroll-py":[{"scroll-py":Jr()}],"scroll-ps":[{"scroll-ps":Jr()}],"scroll-pe":[{"scroll-pe":Jr()}],"scroll-pt":[{"scroll-pt":Jr()}],"scroll-pr":[{"scroll-pr":Jr()}],"scroll-pb":[{"scroll-pb":Jr()}],"scroll-pl":[{"scroll-pl":Jr()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",isArbitraryVariable,isArbitraryValue]}],fill:[{fill:["none",...oi()]}],"stroke-w":[{stroke:[isNumber$2,isArbitraryVariableLength,isArbitraryLength,isArbitraryNumber]}],stroke:[{stroke:["none",...oi()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},twMerge=createTailwindMerge(getDefaultConfig);function cn$2(...tr){return twMerge(clsx(tr))}const Button$1=forwardRef(function(rr,ir){const{color:lr="dark",size:dr="medium",className:fr="",children:hr,icon:mr,iconPosition:gr="left",...yr}=rr,_r={small:"px-2 py-1.5 text-xs rounded-md font-medium",medium:"px-6 py-3 text-base rounded-xl font-semibold tracking-wide"},vr=twJoin({light:"bg-gray-200 text-gray-600 hover:text-gray-700 hover:border-gray-300 active:border-slate-100 active:text-gray-600 disabled:text-gray-400",dark:"bg-gray-800 text-slate-50 hover:bg-slate-800 active:border-slate-700 disabled:bg-gray-300 disabled:text-slate-100",red:"bg-red-900 text-slate-50 hover:opacity-80 active:border-red-800 disabled:text-red-400 disabled:opacity-100",blue:"bg-blue-900 text-slate-50 hover:opacity-80 active:border-blue-800 disabled:text-blue-400 disabled:opacity-100"}[lr],_r[dr]),wr=twMerge("flex items-center justify-center gap-2 border border-none outline-none transition disabled:cursor-not-allowed",vr,fr);return jsxs("button",{className:wr,ref:ir,...yr,children:[gr==="left"&&mr,hr,gr==="right"&&mr]})});function composeEventHandlers(tr,rr,{checkForDefaultPrevented:ir=!0}={}){return function(dr){if(tr==null||tr(dr),ir===!1||!dr.defaultPrevented)return rr==null?void 0:rr(dr)}}function createContext2(tr,rr){const ir=React.createContext(rr),lr=fr=>{const{children:hr,...mr}=fr,gr=React.useMemo(()=>mr,Object.values(mr));return jsx$1(ir.Provider,{value:gr,children:hr})};lr.displayName=tr+"Provider";function dr(fr){const hr=React.useContext(ir);if(hr)return hr;if(rr!==void 0)return rr;throw new Error(`\`${fr}\` must be used within \`${tr}\``)}return[lr,dr]}function createContextScope(tr,rr=[]){let ir=[];function lr(fr,hr){const mr=React.createContext(hr),gr=ir.length;ir=[...ir,hr];const yr=br=>{var Ir;const{scope:vr,children:wr,...xr}=br,Sr=((Ir=vr==null?void 0:vr[tr])==null?void 0:Ir[gr])||mr,Ar=React.useMemo(()=>xr,Object.values(xr));return jsx$1(Sr.Provider,{value:Ar,children:wr})};yr.displayName=fr+"Provider";function _r(br,vr){var Sr;const wr=((Sr=vr==null?void 0:vr[tr])==null?void 0:Sr[gr])||mr,xr=React.useContext(wr);if(xr)return xr;if(hr!==void 0)return hr;throw new Error(`\`${br}\` must be used within \`${fr}\``)}return[yr,_r]}const dr=()=>{const fr=ir.map(hr=>React.createContext(hr));return function(mr){const gr=(mr==null?void 0:mr[tr])||fr;return React.useMemo(()=>({[`__scope${tr}`]:{...mr,[tr]:gr}}),[mr,gr])}};return dr.scopeName=tr,[lr,composeContextScopes(dr,...rr)]}function composeContextScopes(...tr){const rr=tr[0];if(tr.length===1)return rr;const ir=()=>{const lr=tr.map(dr=>({useScope:dr(),scopeName:dr.scopeName}));return function(fr){const hr=lr.reduce((mr,{useScope:gr,scopeName:yr})=>{const br=gr(fr)[`__scope${yr}`];return{...mr,...br}},{});return React.useMemo(()=>({[`__scope${rr.scopeName}`]:hr}),[hr])}};return ir.scopeName=rr.scopeName,ir}var useLayoutEffect2=globalThis!=null&&globalThis.document?React.useLayoutEffect:()=>{},useInsertionEffect$1=React[" useInsertionEffect ".trim().toString()]||useLayoutEffect2;function useControllableState({prop:tr,defaultProp:rr,onChange:ir=()=>{},caller:lr}){const[dr,fr,hr]=useUncontrolledState({defaultProp:rr,onChange:ir}),mr=tr!==void 0,gr=mr?tr:dr;{const _r=React.useRef(tr!==void 0);React.useEffect(()=>{const br=_r.current;br!==mr&&console.warn(`${lr} is changing from ${br?"controlled":"uncontrolled"} to ${mr?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),_r.current=mr},[mr,lr])}const yr=React.useCallback(_r=>{var br;if(mr){const vr=isFunction$2(_r)?_r(tr):_r;vr!==tr&&((br=hr.current)==null||br.call(hr,vr))}else fr(_r)},[mr,tr,fr,hr]);return[gr,yr]}function useUncontrolledState({defaultProp:tr,onChange:rr}){const[ir,lr]=React.useState(tr),dr=React.useRef(ir),fr=React.useRef(rr);return useInsertionEffect$1(()=>{fr.current=rr},[rr]),React.useEffect(()=>{var hr;dr.current!==ir&&((hr=fr.current)==null||hr.call(fr,ir),dr.current=ir)},[ir,dr]),[ir,lr,fr]}function isFunction$2(tr){return typeof tr=="function"}var NODES=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Primitive=NODES.reduce((tr,rr)=>{const ir=createSlot(`Primitive.${rr}`),lr=React.forwardRef((dr,fr)=>{const{asChild:hr,...mr}=dr,gr=hr?ir:rr;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),jsx$1(gr,{...mr,ref:fr})});return lr.displayName=`Primitive.${rr}`,{...tr,[rr]:lr}},{});function dispatchDiscreteCustomEvent(tr,rr){tr&&ReactDOM.flushSync(()=>tr.dispatchEvent(rr))}function createCollection(tr){const rr=tr+"CollectionProvider",[ir,lr]=createContextScope(rr),[dr,fr]=ir(rr,{collectionRef:{current:null},itemMap:new Map}),hr=Sr=>{const{scope:Ar,children:Ir}=Sr,Mr=React__default.useRef(null),Or=React__default.useRef(new Map).current;return jsx$1(dr,{scope:Ar,itemMap:Or,collectionRef:Mr,children:Ir})};hr.displayName=rr;const mr=tr+"CollectionSlot",gr=createSlot(mr),yr=React__default.forwardRef((Sr,Ar)=>{const{scope:Ir,children:Mr}=Sr,Or=fr(mr,Ir),$r=useComposedRefs(Ar,Or.collectionRef);return jsx$1(gr,{ref:$r,children:Mr})});yr.displayName=mr;const _r=tr+"CollectionItemSlot",br="data-radix-collection-item",vr=createSlot(_r),wr=React__default.forwardRef((Sr,Ar)=>{const{scope:Ir,children:Mr,...Or}=Sr,$r=React__default.useRef(null),Dr=useComposedRefs(Ar,$r),zr=fr(_r,Ir);return React__default.useEffect(()=>(zr.itemMap.set($r,{ref:$r,...Or}),()=>void zr.itemMap.delete($r))),jsx$1(vr,{[br]:"",ref:Dr,children:Mr})});wr.displayName=_r;function xr(Sr){const Ar=fr(tr+"CollectionConsumer",Sr);return React__default.useCallback(()=>{const Mr=Ar.collectionRef.current;if(!Mr)return[];const Or=Array.from(Mr.querySelectorAll(`[${br}]`));return Array.from(Ar.itemMap.values()).sort((zr,Fr)=>Or.indexOf(zr.ref.current)-Or.indexOf(Fr.ref.current))},[Ar.collectionRef,Ar.itemMap])}return[{Provider:hr,Slot:yr,ItemSlot:wr},xr,lr]}var DirectionContext=React.createContext(void 0);function useDirection(tr){const rr=React.useContext(DirectionContext);return tr||rr||"ltr"}function useCallbackRef$1(tr){const rr=React.useRef(tr);return React.useEffect(()=>{rr.current=tr}),React.useMemo(()=>(...ir)=>{var lr;return(lr=rr.current)==null?void 0:lr.call(rr,...ir)},[])}function useEscapeKeydown(tr,rr=globalThis==null?void 0:globalThis.document){const ir=useCallbackRef$1(tr);React.useEffect(()=>{const lr=dr=>{dr.key==="Escape"&&ir(dr)};return rr.addEventListener("keydown",lr,{capture:!0}),()=>rr.removeEventListener("keydown",lr,{capture:!0})},[ir,rr])}var DISMISSABLE_LAYER_NAME="DismissableLayer",CONTEXT_UPDATE="dismissableLayer.update",POINTER_DOWN_OUTSIDE="dismissableLayer.pointerDownOutside",FOCUS_OUTSIDE="dismissableLayer.focusOutside",originalBodyPointerEvents,DismissableLayerContext=React.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),DismissableLayer=React.forwardRef((tr,rr)=>{const{disableOutsidePointerEvents:ir=!1,onEscapeKeyDown:lr,onPointerDownOutside:dr,onFocusOutside:fr,onInteractOutside:hr,onDismiss:mr,...gr}=tr,yr=React.useContext(DismissableLayerContext),[_r,br]=React.useState(null),vr=(_r==null?void 0:_r.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,wr]=React.useState({}),xr=useComposedRefs(rr,Fr=>br(Fr)),Sr=Array.from(yr.layers),[Ar]=[...yr.layersWithOutsidePointerEventsDisabled].slice(-1),Ir=Sr.indexOf(Ar),Mr=_r?Sr.indexOf(_r):-1,Or=yr.layersWithOutsidePointerEventsDisabled.size>0,$r=Mr>=Ir,Dr=usePointerDownOutside(Fr=>{const Jr=Fr.target,$n=[...yr.branches].some(Qr=>Qr.contains(Jr));!$r||$n||(dr==null||dr(Fr),hr==null||hr(Fr),Fr.defaultPrevented||mr==null||mr())},vr),zr=useFocusOutside(Fr=>{const Jr=Fr.target;[...yr.branches].some(Qr=>Qr.contains(Jr))||(fr==null||fr(Fr),hr==null||hr(Fr),Fr.defaultPrevented||mr==null||mr())},vr);return useEscapeKeydown(Fr=>{Mr===yr.layers.size-1&&(lr==null||lr(Fr),!Fr.defaultPrevented&&mr&&(Fr.preventDefault(),mr()))},vr),React.useEffect(()=>{if(_r)return ir&&(yr.layersWithOutsidePointerEventsDisabled.size===0&&(originalBodyPointerEvents=vr.body.style.pointerEvents,vr.body.style.pointerEvents="none"),yr.layersWithOutsidePointerEventsDisabled.add(_r)),yr.layers.add(_r),dispatchUpdate(),()=>{ir&&yr.layersWithOutsidePointerEventsDisabled.size===1&&(vr.body.style.pointerEvents=originalBodyPointerEvents)}},[_r,vr,ir,yr]),React.useEffect(()=>()=>{_r&&(yr.layers.delete(_r),yr.layersWithOutsidePointerEventsDisabled.delete(_r),dispatchUpdate())},[_r,yr]),React.useEffect(()=>{const Fr=()=>wr({});return document.addEventListener(CONTEXT_UPDATE,Fr),()=>document.removeEventListener(CONTEXT_UPDATE,Fr)},[]),jsx$1(Primitive.div,{...gr,ref:xr,style:{pointerEvents:Or?$r?"auto":"none":void 0,...tr.style},onFocusCapture:composeEventHandlers(tr.onFocusCapture,zr.onFocusCapture),onBlurCapture:composeEventHandlers(tr.onBlurCapture,zr.onBlurCapture),onPointerDownCapture:composeEventHandlers(tr.onPointerDownCapture,Dr.onPointerDownCapture)})});DismissableLayer.displayName=DISMISSABLE_LAYER_NAME;var BRANCH_NAME="DismissableLayerBranch",DismissableLayerBranch=React.forwardRef((tr,rr)=>{const ir=React.useContext(DismissableLayerContext),lr=React.useRef(null),dr=useComposedRefs(rr,lr);return React.useEffect(()=>{const fr=lr.current;if(fr)return ir.branches.add(fr),()=>{ir.branches.delete(fr)}},[ir.branches]),jsx$1(Primitive.div,{...tr,ref:dr})});DismissableLayerBranch.displayName=BRANCH_NAME;function usePointerDownOutside(tr,rr=globalThis==null?void 0:globalThis.document){const ir=useCallbackRef$1(tr),lr=React.useRef(!1),dr=React.useRef(()=>{});return React.useEffect(()=>{const fr=mr=>{if(mr.target&&!lr.current){let gr=function(){handleAndDispatchCustomEvent(POINTER_DOWN_OUTSIDE,ir,yr,{discrete:!0})};const yr={originalEvent:mr};mr.pointerType==="touch"?(rr.removeEventListener("click",dr.current),dr.current=gr,rr.addEventListener("click",dr.current,{once:!0})):gr()}else rr.removeEventListener("click",dr.current);lr.current=!1},hr=window.setTimeout(()=>{rr.addEventListener("pointerdown",fr)},0);return()=>{window.clearTimeout(hr),rr.removeEventListener("pointerdown",fr),rr.removeEventListener("click",dr.current)}},[rr,ir]),{onPointerDownCapture:()=>lr.current=!0}}function useFocusOutside(tr,rr=globalThis==null?void 0:globalThis.document){const ir=useCallbackRef$1(tr),lr=React.useRef(!1);return React.useEffect(()=>{const dr=fr=>{fr.target&&!lr.current&&handleAndDispatchCustomEvent(FOCUS_OUTSIDE,ir,{originalEvent:fr},{discrete:!1})};return rr.addEventListener("focusin",dr),()=>rr.removeEventListener("focusin",dr)},[rr,ir]),{onFocusCapture:()=>lr.current=!0,onBlurCapture:()=>lr.current=!1}}function dispatchUpdate(){const tr=new CustomEvent(CONTEXT_UPDATE);document.dispatchEvent(tr)}function handleAndDispatchCustomEvent(tr,rr,ir,{discrete:lr}){const dr=ir.originalEvent.target,fr=new CustomEvent(tr,{bubbles:!1,cancelable:!0,detail:ir});rr&&dr.addEventListener(tr,rr,{once:!0}),lr?dispatchDiscreteCustomEvent(dr,fr):dr.dispatchEvent(fr)}var count$1=0;function useFocusGuards(){React.useEffect(()=>{const tr=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",tr[0]??createFocusGuard()),document.body.insertAdjacentElement("beforeend",tr[1]??createFocusGuard()),count$1++,()=>{count$1===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(rr=>rr.remove()),count$1--}},[])}function createFocusGuard(){const tr=document.createElement("span");return tr.setAttribute("data-radix-focus-guard",""),tr.tabIndex=0,tr.style.outline="none",tr.style.opacity="0",tr.style.position="fixed",tr.style.pointerEvents="none",tr}var AUTOFOCUS_ON_MOUNT="focusScope.autoFocusOnMount",AUTOFOCUS_ON_UNMOUNT="focusScope.autoFocusOnUnmount",EVENT_OPTIONS$1={bubbles:!1,cancelable:!0},FOCUS_SCOPE_NAME="FocusScope",FocusScope=React.forwardRef((tr,rr)=>{const{loop:ir=!1,trapped:lr=!1,onMountAutoFocus:dr,onUnmountAutoFocus:fr,...hr}=tr,[mr,gr]=React.useState(null),yr=useCallbackRef$1(dr),_r=useCallbackRef$1(fr),br=React.useRef(null),vr=useComposedRefs(rr,Sr=>gr(Sr)),wr=React.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;React.useEffect(()=>{if(lr){let Sr=function(Or){if(wr.paused||!mr)return;const $r=Or.target;mr.contains($r)?br.current=$r:focus(br.current,{select:!0})},Ar=function(Or){if(wr.paused||!mr)return;const $r=Or.relatedTarget;$r!==null&&(mr.contains($r)||focus(br.current,{select:!0}))},Ir=function(Or){if(document.activeElement===document.body)for(const Dr of Or)Dr.removedNodes.length>0&&focus(mr)};document.addEventListener("focusin",Sr),document.addEventListener("focusout",Ar);const Mr=new MutationObserver(Ir);return mr&&Mr.observe(mr,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",Sr),document.removeEventListener("focusout",Ar),Mr.disconnect()}}},[lr,mr,wr.paused]),React.useEffect(()=>{if(mr){focusScopesStack.add(wr);const Sr=document.activeElement;if(!mr.contains(Sr)){const Ir=new CustomEvent(AUTOFOCUS_ON_MOUNT,EVENT_OPTIONS$1);mr.addEventListener(AUTOFOCUS_ON_MOUNT,yr),mr.dispatchEvent(Ir),Ir.defaultPrevented||(focusFirst$2(removeLinks(getTabbableCandidates(mr)),{select:!0}),document.activeElement===Sr&&focus(mr))}return()=>{mr.removeEventListener(AUTOFOCUS_ON_MOUNT,yr),setTimeout(()=>{const Ir=new CustomEvent(AUTOFOCUS_ON_UNMOUNT,EVENT_OPTIONS$1);mr.addEventListener(AUTOFOCUS_ON_UNMOUNT,_r),mr.dispatchEvent(Ir),Ir.defaultPrevented||focus(Sr??document.body,{select:!0}),mr.removeEventListener(AUTOFOCUS_ON_UNMOUNT,_r),focusScopesStack.remove(wr)},0)}}},[mr,yr,_r,wr]);const xr=React.useCallback(Sr=>{if(!ir&&!lr||wr.paused)return;const Ar=Sr.key==="Tab"&&!Sr.altKey&&!Sr.ctrlKey&&!Sr.metaKey,Ir=document.activeElement;if(Ar&&Ir){const Mr=Sr.currentTarget,[Or,$r]=getTabbableEdges(Mr);Or&&$r?!Sr.shiftKey&&Ir===$r?(Sr.preventDefault(),ir&&focus(Or,{select:!0})):Sr.shiftKey&&Ir===Or&&(Sr.preventDefault(),ir&&focus($r,{select:!0})):Ir===Mr&&Sr.preventDefault()}},[ir,lr,wr.paused]);return jsx$1(Primitive.div,{tabIndex:-1,...hr,ref:vr,onKeyDown:xr})});FocusScope.displayName=FOCUS_SCOPE_NAME;function focusFirst$2(tr,{select:rr=!1}={}){const ir=document.activeElement;for(const lr of tr)if(focus(lr,{select:rr}),document.activeElement!==ir)return}function getTabbableEdges(tr){const rr=getTabbableCandidates(tr),ir=findVisible(rr,tr),lr=findVisible(rr.reverse(),tr);return[ir,lr]}function getTabbableCandidates(tr){const rr=[],ir=document.createTreeWalker(tr,NodeFilter.SHOW_ELEMENT,{acceptNode:lr=>{const dr=lr.tagName==="INPUT"&&lr.type==="hidden";return lr.disabled||lr.hidden||dr?NodeFilter.FILTER_SKIP:lr.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;ir.nextNode();)rr.push(ir.currentNode);return rr}function findVisible(tr,rr){for(const ir of tr)if(!isHidden(ir,{upTo:rr}))return ir}function isHidden(tr,{upTo:rr}){if(getComputedStyle(tr).visibility==="hidden")return!0;for(;tr;){if(rr!==void 0&&tr===rr)return!1;if(getComputedStyle(tr).display==="none")return!0;tr=tr.parentElement}return!1}function isSelectableInput(tr){return tr instanceof HTMLInputElement&&"select"in tr}function focus(tr,{select:rr=!1}={}){if(tr&&tr.focus){const ir=document.activeElement;tr.focus({preventScroll:!0}),tr!==ir&&isSelectableInput(tr)&&rr&&tr.select()}}var focusScopesStack=createFocusScopesStack();function createFocusScopesStack(){let tr=[];return{add(rr){const ir=tr[0];rr!==ir&&(ir==null||ir.pause()),tr=arrayRemove(tr,rr),tr.unshift(rr)},remove(rr){var ir;tr=arrayRemove(tr,rr),(ir=tr[0])==null||ir.resume()}}}function arrayRemove(tr,rr){const ir=[...tr],lr=ir.indexOf(rr);return lr!==-1&&ir.splice(lr,1),ir}function removeLinks(tr){return tr.filter(rr=>rr.tagName!=="A")}var useReactId=React[" useId ".trim().toString()]||(()=>{}),count=0;function useId(tr){const[rr,ir]=React.useState(useReactId());return useLayoutEffect2(()=>{ir(lr=>lr??String(count++))},[tr]),tr||(rr?`radix-${rr}`:"")}const sides=["top","right","bottom","left"],min$1=Math.min,max$1=Math.max,round$1=Math.round,floor$1=Math.floor,createCoords=tr=>({x:tr,y:tr}),oppositeSideMap={left:"right",right:"left",bottom:"top",top:"bottom"},oppositeAlignmentMap={start:"end",end:"start"};function clamp(tr,rr,ir){return max$1(tr,min$1(rr,ir))}function evaluate(tr,rr){return typeof tr=="function"?tr(rr):tr}function getSide(tr){return tr.split("-")[0]}function getAlignment(tr){return tr.split("-")[1]}function getOppositeAxis(tr){return tr==="x"?"y":"x"}function getAxisLength(tr){return tr==="y"?"height":"width"}const yAxisSides=new Set(["top","bottom"]);function getSideAxis(tr){return yAxisSides.has(getSide(tr))?"y":"x"}function getAlignmentAxis(tr){return getOppositeAxis(getSideAxis(tr))}function getAlignmentSides(tr,rr,ir){ir===void 0&&(ir=!1);const lr=getAlignment(tr),dr=getAlignmentAxis(tr),fr=getAxisLength(dr);let hr=dr==="x"?lr===(ir?"end":"start")?"right":"left":lr==="start"?"bottom":"top";return rr.reference[fr]>rr.floating[fr]&&(hr=getOppositePlacement(hr)),[hr,getOppositePlacement(hr)]}function getExpandedPlacements(tr){const rr=getOppositePlacement(tr);return[getOppositeAlignmentPlacement(tr),rr,getOppositeAlignmentPlacement(rr)]}function getOppositeAlignmentPlacement(tr){return tr.replace(/start|end/g,rr=>oppositeAlignmentMap[rr])}const lrPlacement=["left","right"],rlPlacement=["right","left"],tbPlacement=["top","bottom"],btPlacement=["bottom","top"];function getSideList(tr,rr,ir){switch(tr){case"top":case"bottom":return ir?rr?rlPlacement:lrPlacement:rr?lrPlacement:rlPlacement;case"left":case"right":return rr?tbPlacement:btPlacement;default:return[]}}function getOppositeAxisPlacements(tr,rr,ir,lr){const dr=getAlignment(tr);let fr=getSideList(getSide(tr),ir==="start",lr);return dr&&(fr=fr.map(hr=>hr+"-"+dr),rr&&(fr=fr.concat(fr.map(getOppositeAlignmentPlacement)))),fr}function getOppositePlacement(tr){return tr.replace(/left|right|bottom|top/g,rr=>oppositeSideMap[rr])}function expandPaddingObject(tr){return{top:0,right:0,bottom:0,left:0,...tr}}function getPaddingObject(tr){return typeof tr!="number"?expandPaddingObject(tr):{top:tr,right:tr,bottom:tr,left:tr}}function rectToClientRect(tr){const{x:rr,y:ir,width:lr,height:dr}=tr;return{width:lr,height:dr,top:ir,left:rr,right:rr+lr,bottom:ir+dr,x:rr,y:ir}}function computeCoordsFromPlacement(tr,rr,ir){let{reference:lr,floating:dr}=tr;const fr=getSideAxis(rr),hr=getAlignmentAxis(rr),mr=getAxisLength(hr),gr=getSide(rr),yr=fr==="y",_r=lr.x+lr.width/2-dr.width/2,br=lr.y+lr.height/2-dr.height/2,vr=lr[mr]/2-dr[mr]/2;let wr;switch(gr){case"top":wr={x:_r,y:lr.y-dr.height};break;case"bottom":wr={x:_r,y:lr.y+lr.height};break;case"right":wr={x:lr.x+lr.width,y:br};break;case"left":wr={x:lr.x-dr.width,y:br};break;default:wr={x:lr.x,y:lr.y}}switch(getAlignment(rr)){case"start":wr[hr]-=vr*(ir&&yr?-1:1);break;case"end":wr[hr]+=vr*(ir&&yr?-1:1);break}return wr}const computePosition$1=async(tr,rr,ir)=>{const{placement:lr="bottom",strategy:dr="absolute",middleware:fr=[],platform:hr}=ir,mr=fr.filter(Boolean),gr=await(hr.isRTL==null?void 0:hr.isRTL(rr));let yr=await hr.getElementRects({reference:tr,floating:rr,strategy:dr}),{x:_r,y:br}=computeCoordsFromPlacement(yr,lr,gr),vr=lr,wr={},xr=0;for(let Sr=0;Sr<mr.length;Sr++){const{name:Ar,fn:Ir}=mr[Sr],{x:Mr,y:Or,data:$r,reset:Dr}=await Ir({x:_r,y:br,initialPlacement:lr,placement:vr,strategy:dr,middlewareData:wr,rects:yr,platform:hr,elements:{reference:tr,floating:rr}});_r=Mr??_r,br=Or??br,wr={...wr,[Ar]:{...wr[Ar],...$r}},Dr&&xr<=50&&(xr++,typeof Dr=="object"&&(Dr.placement&&(vr=Dr.placement),Dr.rects&&(yr=Dr.rects===!0?await hr.getElementRects({reference:tr,floating:rr,strategy:dr}):Dr.rects),{x:_r,y:br}=computeCoordsFromPlacement(yr,vr,gr)),Sr=-1)}return{x:_r,y:br,placement:vr,strategy:dr,middlewareData:wr}};async function detectOverflow(tr,rr){var ir;rr===void 0&&(rr={});const{x:lr,y:dr,platform:fr,rects:hr,elements:mr,strategy:gr}=tr,{boundary:yr="clippingAncestors",rootBoundary:_r="viewport",elementContext:br="floating",altBoundary:vr=!1,padding:wr=0}=evaluate(rr,tr),xr=getPaddingObject(wr),Ar=mr[vr?br==="floating"?"reference":"floating":br],Ir=rectToClientRect(await fr.getClippingRect({element:(ir=await(fr.isElement==null?void 0:fr.isElement(Ar)))==null||ir?Ar:Ar.contextElement||await(fr.getDocumentElement==null?void 0:fr.getDocumentElement(mr.floating)),boundary:yr,rootBoundary:_r,strategy:gr})),Mr=br==="floating"?{x:lr,y:dr,width:hr.floating.width,height:hr.floating.height}:hr.reference,Or=await(fr.getOffsetParent==null?void 0:fr.getOffsetParent(mr.floating)),$r=await(fr.isElement==null?void 0:fr.isElement(Or))?await(fr.getScale==null?void 0:fr.getScale(Or))||{x:1,y:1}:{x:1,y:1},Dr=rectToClientRect(fr.convertOffsetParentRelativeRectToViewportRelativeRect?await fr.convertOffsetParentRelativeRectToViewportRelativeRect({elements:mr,rect:Mr,offsetParent:Or,strategy:gr}):Mr);return{top:(Ir.top-Dr.top+xr.top)/$r.y,bottom:(Dr.bottom-Ir.bottom+xr.bottom)/$r.y,left:(Ir.left-Dr.left+xr.left)/$r.x,right:(Dr.right-Ir.right+xr.right)/$r.x}}const arrow$3=tr=>({name:"arrow",options:tr,async fn(rr){const{x:ir,y:lr,placement:dr,rects:fr,platform:hr,elements:mr,middlewareData:gr}=rr,{element:yr,padding:_r=0}=evaluate(tr,rr)||{};if(yr==null)return{};const br=getPaddingObject(_r),vr={x:ir,y:lr},wr=getAlignmentAxis(dr),xr=getAxisLength(wr),Sr=await hr.getDimensions(yr),Ar=wr==="y",Ir=Ar?"top":"left",Mr=Ar?"bottom":"right",Or=Ar?"clientHeight":"clientWidth",$r=fr.reference[xr]+fr.reference[wr]-vr[wr]-fr.floating[xr],Dr=vr[wr]-fr.reference[wr],zr=await(hr.getOffsetParent==null?void 0:hr.getOffsetParent(yr));let Fr=zr?zr[Or]:0;(!Fr||!await(hr.isElement==null?void 0:hr.isElement(zr)))&&(Fr=mr.floating[Or]||fr.floating[xr]);const Jr=$r/2-Dr/2,$n=Fr/2-Sr[xr]/2-1,Qr=min$1(br[Ir],$n),Zn=min$1(br[Mr],$n),qn=Qr,Xn=Fr-Sr[xr]-Zn,Lr=Fr/2-Sr[xr]/2+Jr,Gr=clamp(qn,Lr,Xn),Hn=!gr.arrow&&getAlignment(dr)!=null&&Lr!==Gr&&fr.reference[xr]/2-(Lr<qn?Qr:Zn)-Sr[xr]/2<0,ii=Hn?Lr<qn?Lr-qn:Lr-Xn:0;return{[wr]:vr[wr]+ii,data:{[wr]:Gr,centerOffset:Lr-Gr-ii,...Hn&&{alignmentOffset:ii}},reset:Hn}}}),flip$2=function(tr){return tr===void 0&&(tr={}),{name:"flip",options:tr,async fn(rr){var ir,lr;const{placement:dr,middlewareData:fr,rects:hr,initialPlacement:mr,platform:gr,elements:yr}=rr,{mainAxis:_r=!0,crossAxis:br=!0,fallbackPlacements:vr,fallbackStrategy:wr="bestFit",fallbackAxisSideDirection:xr="none",flipAlignment:Sr=!0,...Ar}=evaluate(tr,rr);if((ir=fr.arrow)!=null&&ir.alignmentOffset)return{};const Ir=getSide(dr),Mr=getSideAxis(mr),Or=getSide(mr)===mr,$r=await(gr.isRTL==null?void 0:gr.isRTL(yr.floating)),Dr=vr||(Or||!Sr?[getOppositePlacement(mr)]:getExpandedPlacements(mr)),zr=xr!=="none";!vr&&zr&&Dr.push(...getOppositeAxisPlacements(mr,Sr,xr,$r));const Fr=[mr,...Dr],Jr=await detectOverflow(rr,Ar),$n=[];let Qr=((lr=fr.flip)==null?void 0:lr.overflows)||[];if(_r&&$n.push(Jr[Ir]),br){const Lr=getAlignmentSides(dr,hr,$r);$n.push(Jr[Lr[0]],Jr[Lr[1]])}if(Qr=[...Qr,{placement:dr,overflows:$n}],!$n.every(Lr=>Lr<=0)){var Zn,qn;const Lr=(((Zn=fr.flip)==null?void 0:Zn.index)||0)+1,Gr=Fr[Lr];if(Gr&&(!(br==="alignment"?Mr!==getSideAxis(Gr):!1)||Qr.every(oi=>getSideAxis(oi.placement)===Mr?oi.overflows[0]>0:!0)))return{data:{index:Lr,overflows:Qr},reset:{placement:Gr}};let Hn=(qn=Qr.filter(ii=>ii.overflows[0]<=0).sort((ii,oi)=>ii.overflows[1]-oi.overflows[1])[0])==null?void 0:qn.placement;if(!Hn)switch(wr){case"bestFit":{var Xn;const ii=(Xn=Qr.filter(oi=>{if(zr){const ri=getSideAxis(oi.placement);return ri===Mr||ri==="y"}return!0}).map(oi=>[oi.placement,oi.overflows.filter(ri=>ri>0).reduce((ri,ti)=>ri+ti,0)]).sort((oi,ri)=>oi[1]-ri[1])[0])==null?void 0:Xn[0];ii&&(Hn=ii);break}case"initialPlacement":Hn=mr;break}if(dr!==Hn)return{reset:{placement:Hn}}}return{}}}};function getSideOffsets(tr,rr){return{top:tr.top-rr.height,right:tr.right-rr.width,bottom:tr.bottom-rr.height,left:tr.left-rr.width}}function isAnySideFullyClipped(tr){return sides.some(rr=>tr[rr]>=0)}const hide$2=function(tr){return tr===void 0&&(tr={}),{name:"hide",options:tr,async fn(rr){const{rects:ir}=rr,{strategy:lr="referenceHidden",...dr}=evaluate(tr,rr);switch(lr){case"referenceHidden":{const fr=await detectOverflow(rr,{...dr,elementContext:"reference"}),hr=getSideOffsets(fr,ir.reference);return{data:{referenceHiddenOffsets:hr,referenceHidden:isAnySideFullyClipped(hr)}}}case"escaped":{const fr=await detectOverflow(rr,{...dr,altBoundary:!0}),hr=getSideOffsets(fr,ir.floating);return{data:{escapedOffsets:hr,escaped:isAnySideFullyClipped(hr)}}}default:return{}}}}},originSides=new Set(["left","top"]);async function convertValueToCoords(tr,rr){const{placement:ir,platform:lr,elements:dr}=tr,fr=await(lr.isRTL==null?void 0:lr.isRTL(dr.floating)),hr=getSide(ir),mr=getAlignment(ir),gr=getSideAxis(ir)==="y",yr=originSides.has(hr)?-1:1,_r=fr&&gr?-1:1,br=evaluate(rr,tr);let{mainAxis:vr,crossAxis:wr,alignmentAxis:xr}=typeof br=="number"?{mainAxis:br,crossAxis:0,alignmentAxis:null}:{mainAxis:br.mainAxis||0,crossAxis:br.crossAxis||0,alignmentAxis:br.alignmentAxis};return mr&&typeof xr=="number"&&(wr=mr==="end"?xr*-1:xr),gr?{x:wr*_r,y:vr*yr}:{x:vr*yr,y:wr*_r}}const offset$3=function(tr){return tr===void 0&&(tr=0),{name:"offset",options:tr,async fn(rr){var ir,lr;const{x:dr,y:fr,placement:hr,middlewareData:mr}=rr,gr=await convertValueToCoords(rr,tr);return hr===((ir=mr.offset)==null?void 0:ir.placement)&&(lr=mr.arrow)!=null&&lr.alignmentOffset?{}:{x:dr+gr.x,y:fr+gr.y,data:{...gr,placement:hr}}}}},shift$2=function(tr){return tr===void 0&&(tr={}),{name:"shift",options:tr,async fn(rr){const{x:ir,y:lr,placement:dr}=rr,{mainAxis:fr=!0,crossAxis:hr=!1,limiter:mr={fn:Ar=>{let{x:Ir,y:Mr}=Ar;return{x:Ir,y:Mr}}},...gr}=evaluate(tr,rr),yr={x:ir,y:lr},_r=await detectOverflow(rr,gr),br=getSideAxis(getSide(dr)),vr=getOppositeAxis(br);let wr=yr[vr],xr=yr[br];if(fr){const Ar=vr==="y"?"top":"left",Ir=vr==="y"?"bottom":"right",Mr=wr+_r[Ar],Or=wr-_r[Ir];wr=clamp(Mr,wr,Or)}if(hr){const Ar=br==="y"?"top":"left",Ir=br==="y"?"bottom":"right",Mr=xr+_r[Ar],Or=xr-_r[Ir];xr=clamp(Mr,xr,Or)}const Sr=mr.fn({...rr,[vr]:wr,[br]:xr});return{...Sr,data:{x:Sr.x-ir,y:Sr.y-lr,enabled:{[vr]:fr,[br]:hr}}}}}},limitShift$2=function(tr){return tr===void 0&&(tr={}),{options:tr,fn(rr){const{x:ir,y:lr,placement:dr,rects:fr,middlewareData:hr}=rr,{offset:mr=0,mainAxis:gr=!0,crossAxis:yr=!0}=evaluate(tr,rr),_r={x:ir,y:lr},br=getSideAxis(dr),vr=getOppositeAxis(br);let wr=_r[vr],xr=_r[br];const Sr=evaluate(mr,rr),Ar=typeof Sr=="number"?{mainAxis:Sr,crossAxis:0}:{mainAxis:0,crossAxis:0,...Sr};if(gr){const Or=vr==="y"?"height":"width",$r=fr.reference[vr]-fr.floating[Or]+Ar.mainAxis,Dr=fr.reference[vr]+fr.reference[Or]-Ar.mainAxis;wr<$r?wr=$r:wr>Dr&&(wr=Dr)}if(yr){var Ir,Mr;const Or=vr==="y"?"width":"height",$r=originSides.has(getSide(dr)),Dr=fr.reference[br]-fr.floating[Or]+($r&&((Ir=hr.offset)==null?void 0:Ir[br])||0)+($r?0:Ar.crossAxis),zr=fr.reference[br]+fr.reference[Or]+($r?0:((Mr=hr.offset)==null?void 0:Mr[br])||0)-($r?Ar.crossAxis:0);xr<Dr?xr=Dr:xr>zr&&(xr=zr)}return{[vr]:wr,[br]:xr}}}},size$5=function(tr){return tr===void 0&&(tr={}),{name:"size",options:tr,async fn(rr){var ir,lr;const{placement:dr,rects:fr,platform:hr,elements:mr}=rr,{apply:gr=()=>{},...yr}=evaluate(tr,rr),_r=await detectOverflow(rr,yr),br=getSide(dr),vr=getAlignment(dr),wr=getSideAxis(dr)==="y",{width:xr,height:Sr}=fr.floating;let Ar,Ir;br==="top"||br==="bottom"?(Ar=br,Ir=vr===(await(hr.isRTL==null?void 0:hr.isRTL(mr.floating))?"start":"end")?"left":"right"):(Ir=br,Ar=vr==="end"?"top":"bottom");const Mr=Sr-_r.top-_r.bottom,Or=xr-_r.left-_r.right,$r=min$1(Sr-_r[Ar],Mr),Dr=min$1(xr-_r[Ir],Or),zr=!rr.middlewareData.shift;let Fr=$r,Jr=Dr;if((ir=rr.middlewareData.shift)!=null&&ir.enabled.x&&(Jr=Or),(lr=rr.middlewareData.shift)!=null&&lr.enabled.y&&(Fr=Mr),zr&&!vr){const Qr=max$1(_r.left,0),Zn=max$1(_r.right,0),qn=max$1(_r.top,0),Xn=max$1(_r.bottom,0);wr?Jr=xr-2*(Qr!==0||Zn!==0?Qr+Zn:max$1(_r.left,_r.right)):Fr=Sr-2*(qn!==0||Xn!==0?qn+Xn:max$1(_r.top,_r.bottom))}await gr({...rr,availableWidth:Jr,availableHeight:Fr});const $n=await hr.getDimensions(mr.floating);return xr!==$n.width||Sr!==$n.height?{reset:{rects:!0}}:{}}}};function hasWindow(){return typeof window<"u"}function getNodeName(tr){return isNode$1(tr)?(tr.nodeName||"").toLowerCase():"#document"}function getWindow(tr){var rr;return(tr==null||(rr=tr.ownerDocument)==null?void 0:rr.defaultView)||window}function getDocumentElement(tr){var rr;return(rr=(isNode$1(tr)?tr.ownerDocument:tr.document)||window.document)==null?void 0:rr.documentElement}function isNode$1(tr){return hasWindow()?tr instanceof Node||tr instanceof getWindow(tr).Node:!1}function isElement$1(tr){return hasWindow()?tr instanceof Element||tr instanceof getWindow(tr).Element:!1}function isHTMLElement$1(tr){return hasWindow()?tr instanceof HTMLElement||tr instanceof getWindow(tr).HTMLElement:!1}function isShadowRoot(tr){return!hasWindow()||typeof ShadowRoot>"u"?!1:tr instanceof ShadowRoot||tr instanceof getWindow(tr).ShadowRoot}const invalidOverflowDisplayValues=new Set(["inline","contents"]);function isOverflowElement(tr){const{overflow:rr,overflowX:ir,overflowY:lr,display:dr}=getComputedStyle$1(tr);return/auto|scroll|overlay|hidden|clip/.test(rr+lr+ir)&&!invalidOverflowDisplayValues.has(dr)}const tableElements=new Set(["table","td","th"]);function isTableElement(tr){return tableElements.has(getNodeName(tr))}const topLayerSelectors=[":popover-open",":modal"];function isTopLayer(tr){return topLayerSelectors.some(rr=>{try{return tr.matches(rr)}catch{return!1}})}const transformProperties=["transform","translate","scale","rotate","perspective"],willChangeValues=["transform","translate","scale","rotate","perspective","filter"],containValues=["paint","layout","strict","content"];function isContainingBlock(tr){const rr=isWebKit(),ir=isElement$1(tr)?getComputedStyle$1(tr):tr;return transformProperties.some(lr=>ir[lr]?ir[lr]!=="none":!1)||(ir.containerType?ir.containerType!=="normal":!1)||!rr&&(ir.backdropFilter?ir.backdropFilter!=="none":!1)||!rr&&(ir.filter?ir.filter!=="none":!1)||willChangeValues.some(lr=>(ir.willChange||"").includes(lr))||containValues.some(lr=>(ir.contain||"").includes(lr))}function getContainingBlock(tr){let rr=getParentNode(tr);for(;isHTMLElement$1(rr)&&!isLastTraversableNode(rr);){if(isContainingBlock(rr))return rr;if(isTopLayer(rr))return null;rr=getParentNode(rr)}return null}function isWebKit(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const lastTraversableNodeNames=new Set(["html","body","#document"]);function isLastTraversableNode(tr){return lastTraversableNodeNames.has(getNodeName(tr))}function getComputedStyle$1(tr){return getWindow(tr).getComputedStyle(tr)}function getNodeScroll(tr){return isElement$1(tr)?{scrollLeft:tr.scrollLeft,scrollTop:tr.scrollTop}:{scrollLeft:tr.scrollX,scrollTop:tr.scrollY}}function getParentNode(tr){if(getNodeName(tr)==="html")return tr;const rr=tr.assignedSlot||tr.parentNode||isShadowRoot(tr)&&tr.host||getDocumentElement(tr);return isShadowRoot(rr)?rr.host:rr}function getNearestOverflowAncestor(tr){const rr=getParentNode(tr);return isLastTraversableNode(rr)?tr.ownerDocument?tr.ownerDocument.body:tr.body:isHTMLElement$1(rr)&&isOverflowElement(rr)?rr:getNearestOverflowAncestor(rr)}function getOverflowAncestors(tr,rr,ir){var lr;rr===void 0&&(rr=[]),ir===void 0&&(ir=!0);const dr=getNearestOverflowAncestor(tr),fr=dr===((lr=tr.ownerDocument)==null?void 0:lr.body),hr=getWindow(dr);if(fr){const mr=getFrameElement(hr);return rr.concat(hr,hr.visualViewport||[],isOverflowElement(dr)?dr:[],mr&&ir?getOverflowAncestors(mr):[])}return rr.concat(dr,getOverflowAncestors(dr,[],ir))}function getFrameElement(tr){return tr.parent&&Object.getPrototypeOf(tr.parent)?tr.frameElement:null}function getCssDimensions(tr){const rr=getComputedStyle$1(tr);let ir=parseFloat(rr.width)||0,lr=parseFloat(rr.height)||0;const dr=isHTMLElement$1(tr),fr=dr?tr.offsetWidth:ir,hr=dr?tr.offsetHeight:lr,mr=round$1(ir)!==fr||round$1(lr)!==hr;return mr&&(ir=fr,lr=hr),{width:ir,height:lr,$:mr}}function unwrapElement(tr){return isElement$1(tr)?tr:tr.contextElement}function getScale(tr){const rr=unwrapElement(tr);if(!isHTMLElement$1(rr))return createCoords(1);const ir=rr.getBoundingClientRect(),{width:lr,height:dr,$:fr}=getCssDimensions(rr);let hr=(fr?round$1(ir.width):ir.width)/lr,mr=(fr?round$1(ir.height):ir.height)/dr;return(!hr||!Number.isFinite(hr))&&(hr=1),(!mr||!Number.isFinite(mr))&&(mr=1),{x:hr,y:mr}}const noOffsets=createCoords(0);function getVisualOffsets(tr){const rr=getWindow(tr);return!isWebKit()||!rr.visualViewport?noOffsets:{x:rr.visualViewport.offsetLeft,y:rr.visualViewport.offsetTop}}function shouldAddVisualOffsets(tr,rr,ir){return rr===void 0&&(rr=!1),!ir||rr&&ir!==getWindow(tr)?!1:rr}function getBoundingClientRect(tr,rr,ir,lr){rr===void 0&&(rr=!1),ir===void 0&&(ir=!1);const dr=tr.getBoundingClientRect(),fr=unwrapElement(tr);let hr=createCoords(1);rr&&(lr?isElement$1(lr)&&(hr=getScale(lr)):hr=getScale(tr));const mr=shouldAddVisualOffsets(fr,ir,lr)?getVisualOffsets(fr):createCoords(0);let gr=(dr.left+mr.x)/hr.x,yr=(dr.top+mr.y)/hr.y,_r=dr.width/hr.x,br=dr.height/hr.y;if(fr){const vr=getWindow(fr),wr=lr&&isElement$1(lr)?getWindow(lr):lr;let xr=vr,Sr=getFrameElement(xr);for(;Sr&&lr&&wr!==xr;){const Ar=getScale(Sr),Ir=Sr.getBoundingClientRect(),Mr=getComputedStyle$1(Sr),Or=Ir.left+(Sr.clientLeft+parseFloat(Mr.paddingLeft))*Ar.x,$r=Ir.top+(Sr.clientTop+parseFloat(Mr.paddingTop))*Ar.y;gr*=Ar.x,yr*=Ar.y,_r*=Ar.x,br*=Ar.y,gr+=Or,yr+=$r,xr=getWindow(Sr),Sr=getFrameElement(xr)}}return rectToClientRect({width:_r,height:br,x:gr,y:yr})}function getWindowScrollBarX(tr,rr){const ir=getNodeScroll(tr).scrollLeft;return rr?rr.left+ir:getBoundingClientRect(getDocumentElement(tr)).left+ir}function getHTMLOffset(tr,rr,ir){ir===void 0&&(ir=!1);const lr=tr.getBoundingClientRect(),dr=lr.left+rr.scrollLeft-(ir?0:getWindowScrollBarX(tr,lr)),fr=lr.top+rr.scrollTop;return{x:dr,y:fr}}function convertOffsetParentRelativeRectToViewportRelativeRect(tr){let{elements:rr,rect:ir,offsetParent:lr,strategy:dr}=tr;const fr=dr==="fixed",hr=getDocumentElement(lr),mr=rr?isTopLayer(rr.floating):!1;if(lr===hr||mr&&fr)return ir;let gr={scrollLeft:0,scrollTop:0},yr=createCoords(1);const _r=createCoords(0),br=isHTMLElement$1(lr);if((br||!br&&!fr)&&((getNodeName(lr)!=="body"||isOverflowElement(hr))&&(gr=getNodeScroll(lr)),isHTMLElement$1(lr))){const wr=getBoundingClientRect(lr);yr=getScale(lr),_r.x=wr.x+lr.clientLeft,_r.y=wr.y+lr.clientTop}const vr=hr&&!br&&!fr?getHTMLOffset(hr,gr,!0):createCoords(0);return{width:ir.width*yr.x,height:ir.height*yr.y,x:ir.x*yr.x-gr.scrollLeft*yr.x+_r.x+vr.x,y:ir.y*yr.y-gr.scrollTop*yr.y+_r.y+vr.y}}function getClientRects(tr){return Array.from(tr.getClientRects())}function getDocumentRect(tr){const rr=getDocumentElement(tr),ir=getNodeScroll(tr),lr=tr.ownerDocument.body,dr=max$1(rr.scrollWidth,rr.clientWidth,lr.scrollWidth,lr.clientWidth),fr=max$1(rr.scrollHeight,rr.clientHeight,lr.scrollHeight,lr.clientHeight);let hr=-ir.scrollLeft+getWindowScrollBarX(tr);const mr=-ir.scrollTop;return getComputedStyle$1(lr).direction==="rtl"&&(hr+=max$1(rr.clientWidth,lr.clientWidth)-dr),{width:dr,height:fr,x:hr,y:mr}}function getViewportRect(tr,rr){const ir=getWindow(tr),lr=getDocumentElement(tr),dr=ir.visualViewport;let fr=lr.clientWidth,hr=lr.clientHeight,mr=0,gr=0;if(dr){fr=dr.width,hr=dr.height;const yr=isWebKit();(!yr||yr&&rr==="fixed")&&(mr=dr.offsetLeft,gr=dr.offsetTop)}return{width:fr,height:hr,x:mr,y:gr}}const absoluteOrFixed=new Set(["absolute","fixed"]);function getInnerBoundingClientRect(tr,rr){const ir=getBoundingClientRect(tr,!0,rr==="fixed"),lr=ir.top+tr.clientTop,dr=ir.left+tr.clientLeft,fr=isHTMLElement$1(tr)?getScale(tr):createCoords(1),hr=tr.clientWidth*fr.x,mr=tr.clientHeight*fr.y,gr=dr*fr.x,yr=lr*fr.y;return{width:hr,height:mr,x:gr,y:yr}}function getClientRectFromClippingAncestor(tr,rr,ir){let lr;if(rr==="viewport")lr=getViewportRect(tr,ir);else if(rr==="document")lr=getDocumentRect(getDocumentElement(tr));else if(isElement$1(rr))lr=getInnerBoundingClientRect(rr,ir);else{const dr=getVisualOffsets(tr);lr={x:rr.x-dr.x,y:rr.y-dr.y,width:rr.width,height:rr.height}}return rectToClientRect(lr)}function hasFixedPositionAncestor(tr,rr){const ir=getParentNode(tr);return ir===rr||!isElement$1(ir)||isLastTraversableNode(ir)?!1:getComputedStyle$1(ir).position==="fixed"||hasFixedPositionAncestor(ir,rr)}function getClippingElementAncestors(tr,rr){const ir=rr.get(tr);if(ir)return ir;let lr=getOverflowAncestors(tr,[],!1).filter(mr=>isElement$1(mr)&&getNodeName(mr)!=="body"),dr=null;const fr=getComputedStyle$1(tr).position==="fixed";let hr=fr?getParentNode(tr):tr;for(;isElement$1(hr)&&!isLastTraversableNode(hr);){const mr=getComputedStyle$1(hr),gr=isContainingBlock(hr);!gr&&mr.position==="fixed"&&(dr=null),(fr?!gr&&!dr:!gr&&mr.position==="static"&&!!dr&&absoluteOrFixed.has(dr.position)||isOverflowElement(hr)&&!gr&&hasFixedPositionAncestor(tr,hr))?lr=lr.filter(_r=>_r!==hr):dr=mr,hr=getParentNode(hr)}return rr.set(tr,lr),lr}function getClippingRect(tr){let{element:rr,boundary:ir,rootBoundary:lr,strategy:dr}=tr;const hr=[...ir==="clippingAncestors"?isTopLayer(rr)?[]:getClippingElementAncestors(rr,this._c):[].concat(ir),lr],mr=hr[0],gr=hr.reduce((yr,_r)=>{const br=getClientRectFromClippingAncestor(rr,_r,dr);return yr.top=max$1(br.top,yr.top),yr.right=min$1(br.right,yr.right),yr.bottom=min$1(br.bottom,yr.bottom),yr.left=max$1(br.left,yr.left),yr},getClientRectFromClippingAncestor(rr,mr,dr));return{width:gr.right-gr.left,height:gr.bottom-gr.top,x:gr.left,y:gr.top}}function getDimensions$1(tr){const{width:rr,height:ir}=getCssDimensions(tr);return{width:rr,height:ir}}function getRectRelativeToOffsetParent(tr,rr,ir){const lr=isHTMLElement$1(rr),dr=getDocumentElement(rr),fr=ir==="fixed",hr=getBoundingClientRect(tr,!0,fr,rr);let mr={scrollLeft:0,scrollTop:0};const gr=createCoords(0);function yr(){gr.x=getWindowScrollBarX(dr)}if(lr||!lr&&!fr)if((getNodeName(rr)!=="body"||isOverflowElement(dr))&&(mr=getNodeScroll(rr)),lr){const wr=getBoundingClientRect(rr,!0,fr,rr);gr.x=wr.x+rr.clientLeft,gr.y=wr.y+rr.clientTop}else dr&&yr();fr&&!lr&&dr&&yr();const _r=dr&&!lr&&!fr?getHTMLOffset(dr,mr):createCoords(0),br=hr.left+mr.scrollLeft-gr.x-_r.x,vr=hr.top+mr.scrollTop-gr.y-_r.y;return{x:br,y:vr,width:hr.width,height:hr.height}}function isStaticPositioned(tr){return getComputedStyle$1(tr).position==="static"}function getTrueOffsetParent(tr,rr){if(!isHTMLElement$1(tr)||getComputedStyle$1(tr).position==="fixed")return null;if(rr)return rr(tr);let ir=tr.offsetParent;return getDocumentElement(tr)===ir&&(ir=ir.ownerDocument.body),ir}function getOffsetParent(tr,rr){const ir=getWindow(tr);if(isTopLayer(tr))return ir;if(!isHTMLElement$1(tr)){let dr=getParentNode(tr);for(;dr&&!isLastTraversableNode(dr);){if(isElement$1(dr)&&!isStaticPositioned(dr))return dr;dr=getParentNode(dr)}return ir}let lr=getTrueOffsetParent(tr,rr);for(;lr&&isTableElement(lr)&&isStaticPositioned(lr);)lr=getTrueOffsetParent(lr,rr);return lr&&isLastTraversableNode(lr)&&isStaticPositioned(lr)&&!isContainingBlock(lr)?ir:lr||getContainingBlock(tr)||ir}const getElementRects=async function(tr){const rr=this.getOffsetParent||getOffsetParent,ir=this.getDimensions,lr=await ir(tr.floating);return{reference:getRectRelativeToOffsetParent(tr.reference,await rr(tr.floating),tr.strategy),floating:{x:0,y:0,width:lr.width,height:lr.height}}};function isRTL(tr){return getComputedStyle$1(tr).direction==="rtl"}const platform={convertOffsetParentRelativeRectToViewportRelativeRect,getDocumentElement,getClippingRect,getOffsetParent,getElementRects,getClientRects,getDimensions:getDimensions$1,getScale,isElement:isElement$1,isRTL};function rectsAreEqual(tr,rr){return tr.x===rr.x&&tr.y===rr.y&&tr.width===rr.width&&tr.height===rr.height}function observeMove(tr,rr){let ir=null,lr;const dr=getDocumentElement(tr);function fr(){var mr;clearTimeout(lr),(mr=ir)==null||mr.disconnect(),ir=null}function hr(mr,gr){mr===void 0&&(mr=!1),gr===void 0&&(gr=1),fr();const yr=tr.getBoundingClientRect(),{left:_r,top:br,width:vr,height:wr}=yr;if(mr||rr(),!vr||!wr)return;const xr=floor$1(br),Sr=floor$1(dr.clientWidth-(_r+vr)),Ar=floor$1(dr.clientHeight-(br+wr)),Ir=floor$1(_r),Or={rootMargin:-xr+"px "+-Sr+"px "+-Ar+"px "+-Ir+"px",threshold:max$1(0,min$1(1,gr))||1};let $r=!0;function Dr(zr){const Fr=zr[0].intersectionRatio;if(Fr!==gr){if(!$r)return hr();Fr?hr(!1,Fr):lr=setTimeout(()=>{hr(!1,1e-7)},1e3)}Fr===1&&!rectsAreEqual(yr,tr.getBoundingClientRect())&&hr(),$r=!1}try{ir=new IntersectionObserver(Dr,{...Or,root:dr.ownerDocument})}catch{ir=new IntersectionObserver(Dr,Or)}ir.observe(tr)}return hr(!0),fr}function autoUpdate(tr,rr,ir,lr){lr===void 0&&(lr={});const{ancestorScroll:dr=!0,ancestorResize:fr=!0,elementResize:hr=typeof ResizeObserver=="function",layoutShift:mr=typeof IntersectionObserver=="function",animationFrame:gr=!1}=lr,yr=unwrapElement(tr),_r=dr||fr?[...yr?getOverflowAncestors(yr):[],...getOverflowAncestors(rr)]:[];_r.forEach(Ir=>{dr&&Ir.addEventListener("scroll",ir,{passive:!0}),fr&&Ir.addEventListener("resize",ir)});const br=yr&&mr?observeMove(yr,ir):null;let vr=-1,wr=null;hr&&(wr=new ResizeObserver(Ir=>{let[Mr]=Ir;Mr&&Mr.target===yr&&wr&&(wr.unobserve(rr),cancelAnimationFrame(vr),vr=requestAnimationFrame(()=>{var Or;(Or=wr)==null||Or.observe(rr)})),ir()}),yr&&!gr&&wr.observe(yr),wr.observe(rr));let xr,Sr=gr?getBoundingClientRect(tr):null;gr&&Ar();function Ar(){const Ir=getBoundingClientRect(tr);Sr&&!rectsAreEqual(Sr,Ir)&&ir(),Sr=Ir,xr=requestAnimationFrame(Ar)}return ir(),()=>{var Ir;_r.forEach(Mr=>{dr&&Mr.removeEventListener("scroll",ir),fr&&Mr.removeEventListener("resize",ir)}),br==null||br(),(Ir=wr)==null||Ir.disconnect(),wr=null,gr&&cancelAnimationFrame(xr)}}const offset$2=offset$3,shift$1=shift$2,flip$1=flip$2,size$4=size$5,hide$1=hide$2,arrow$2=arrow$3,limitShift$1=limitShift$2,computePosition=(tr,rr,ir)=>{const lr=new Map,dr={platform,...ir},fr={...dr.platform,_c:lr};return computePosition$1(tr,rr,{...dr,platform:fr})};var isClient=typeof document<"u",noop$6=function(){},index$4=isClient?useLayoutEffect:noop$6;function deepEqual$2(tr,rr){if(tr===rr)return!0;if(typeof tr!=typeof rr)return!1;if(typeof tr=="function"&&tr.toString()===rr.toString())return!0;let ir,lr,dr;if(tr&&rr&&typeof tr=="object"){if(Array.isArray(tr)){if(ir=tr.length,ir!==rr.length)return!1;for(lr=ir;lr--!==0;)if(!deepEqual$2(tr[lr],rr[lr]))return!1;return!0}if(dr=Object.keys(tr),ir=dr.length,ir!==Object.keys(rr).length)return!1;for(lr=ir;lr--!==0;)if(!{}.hasOwnProperty.call(rr,dr[lr]))return!1;for(lr=ir;lr--!==0;){const fr=dr[lr];if(!(fr==="_owner"&&tr.$$typeof)&&!deepEqual$2(tr[fr],rr[fr]))return!1}return!0}return tr!==tr&&rr!==rr}function getDPR(tr){return typeof window>"u"?1:(tr.ownerDocument.defaultView||window).devicePixelRatio||1}function roundByDPR(tr,rr){const ir=getDPR(tr);return Math.round(rr*ir)/ir}function useLatestRef(tr){const rr=React.useRef(tr);return index$4(()=>{rr.current=tr}),rr}function useFloating(tr){tr===void 0&&(tr={});const{placement:rr="bottom",strategy:ir="absolute",middleware:lr=[],platform:dr,elements:{reference:fr,floating:hr}={},transform:mr=!0,whileElementsMounted:gr,open:yr}=tr,[_r,br]=React.useState({x:0,y:0,strategy:ir,placement:rr,middlewareData:{},isPositioned:!1}),[vr,wr]=React.useState(lr);deepEqual$2(vr,lr)||wr(lr);const[xr,Sr]=React.useState(null),[Ar,Ir]=React.useState(null),Mr=React.useCallback(oi=>{oi!==zr.current&&(zr.current=oi,Sr(oi))},[]),Or=React.useCallback(oi=>{oi!==Fr.current&&(Fr.current=oi,Ir(oi))},[]),$r=fr||xr,Dr=hr||Ar,zr=React.useRef(null),Fr=React.useRef(null),Jr=React.useRef(_r),$n=gr!=null,Qr=useLatestRef(gr),Zn=useLatestRef(dr),qn=useLatestRef(yr),Xn=React.useCallback(()=>{if(!zr.current||!Fr.current)return;const oi={placement:rr,strategy:ir,middleware:vr};Zn.current&&(oi.platform=Zn.current),computePosition(zr.current,Fr.current,oi).then(ri=>{const ti={...ri,isPositioned:qn.current!==!1};Lr.current&&!deepEqual$2(Jr.current,ti)&&(Jr.current=ti,ReactDOM.flushSync(()=>{br(ti)}))})},[vr,rr,ir,Zn,qn]);index$4(()=>{yr===!1&&Jr.current.isPositioned&&(Jr.current.isPositioned=!1,br(oi=>({...oi,isPositioned:!1})))},[yr]);const Lr=React.useRef(!1);index$4(()=>(Lr.current=!0,()=>{Lr.current=!1}),[]),index$4(()=>{if($r&&(zr.current=$r),Dr&&(Fr.current=Dr),$r&&Dr){if(Qr.current)return Qr.current($r,Dr,Xn);Xn()}},[$r,Dr,Xn,Qr,$n]);const Gr=React.useMemo(()=>({reference:zr,floating:Fr,setReference:Mr,setFloating:Or}),[Mr,Or]),Hn=React.useMemo(()=>({reference:$r,floating:Dr}),[$r,Dr]),ii=React.useMemo(()=>{const oi={position:ir,left:0,top:0};if(!Hn.floating)return oi;const ri=roundByDPR(Hn.floating,_r.x),ti=roundByDPR(Hn.floating,_r.y);return mr?{...oi,transform:"translate("+ri+"px, "+ti+"px)",...getDPR(Hn.floating)>=1.5&&{willChange:"transform"}}:{position:ir,left:ri,top:ti}},[ir,mr,Hn.floating,_r.x,_r.y]);return React.useMemo(()=>({..._r,update:Xn,refs:Gr,elements:Hn,floatingStyles:ii}),[_r,Xn,Gr,Hn,ii])}const arrow$1=tr=>{function rr(ir){return{}.hasOwnProperty.call(ir,"current")}return{name:"arrow",options:tr,fn(ir){const{element:lr,padding:dr}=typeof tr=="function"?tr(ir):tr;return lr&&rr(lr)?lr.current!=null?arrow$2({element:lr.current,padding:dr}).fn(ir):{}:lr?arrow$2({element:lr,padding:dr}).fn(ir):{}}}},offset$1=(tr,rr)=>({...offset$2(tr),options:[tr,rr]}),shift=(tr,rr)=>({...shift$1(tr),options:[tr,rr]}),limitShift=(tr,rr)=>({...limitShift$1(tr),options:[tr,rr]}),flip=(tr,rr)=>({...flip$1(tr),options:[tr,rr]}),size$3=(tr,rr)=>({...size$4(tr),options:[tr,rr]}),hide=(tr,rr)=>({...hide$1(tr),options:[tr,rr]}),arrow=(tr,rr)=>({...arrow$1(tr),options:[tr,rr]});var NAME$1="Arrow",Arrow$1=React.forwardRef((tr,rr)=>{const{children:ir,width:lr=10,height:dr=5,...fr}=tr;return jsx$1(Primitive.svg,{...fr,ref:rr,width:lr,height:dr,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:tr.asChild?ir:jsx$1("polygon",{points:"0,0 30,0 15,10"})})});Arrow$1.displayName=NAME$1;var Root$4=Arrow$1;function useSize(tr){const[rr,ir]=React.useState(void 0);return useLayoutEffect2(()=>{if(tr){ir({width:tr.offsetWidth,height:tr.offsetHeight});const lr=new ResizeObserver(dr=>{if(!Array.isArray(dr)||!dr.length)return;const fr=dr[0];let hr,mr;if("borderBoxSize"in fr){const gr=fr.borderBoxSize,yr=Array.isArray(gr)?gr[0]:gr;hr=yr.inlineSize,mr=yr.blockSize}else hr=tr.offsetWidth,mr=tr.offsetHeight;ir({width:hr,height:mr})});return lr.observe(tr,{box:"border-box"}),()=>lr.unobserve(tr)}else ir(void 0)},[tr]),rr}var POPPER_NAME="Popper",[createPopperContext,createPopperScope]=createContextScope(POPPER_NAME),[PopperProvider,usePopperContext]=createPopperContext(POPPER_NAME),Popper=tr=>{const{__scopePopper:rr,children:ir}=tr,[lr,dr]=React.useState(null);return jsx$1(PopperProvider,{scope:rr,anchor:lr,onAnchorChange:dr,children:ir})};Popper.displayName=POPPER_NAME;var ANCHOR_NAME$2="PopperAnchor",PopperAnchor=React.forwardRef((tr,rr)=>{const{__scopePopper:ir,virtualRef:lr,...dr}=tr,fr=usePopperContext(ANCHOR_NAME$2,ir),hr=React.useRef(null),mr=useComposedRefs(rr,hr),gr=React.useRef(null);return React.useEffect(()=>{const yr=gr.current;gr.current=(lr==null?void 0:lr.current)||hr.current,yr!==gr.current&&fr.onAnchorChange(gr.current)}),lr?null:jsx$1(Primitive.div,{...dr,ref:mr})});PopperAnchor.displayName=ANCHOR_NAME$2;var CONTENT_NAME$6="PopperContent",[PopperContentProvider,useContentContext]=createPopperContext(CONTENT_NAME$6),PopperContent=React.forwardRef((tr,rr)=>{var pi,bi,vi,Ti,Li,qi;const{__scopePopper:ir,side:lr="bottom",sideOffset:dr=0,align:fr="center",alignOffset:hr=0,arrowPadding:mr=0,avoidCollisions:gr=!0,collisionBoundary:yr=[],collisionPadding:_r=0,sticky:br="partial",hideWhenDetached:vr=!1,updatePositionStrategy:wr="optimized",onPlaced:xr,...Sr}=tr,Ar=usePopperContext(CONTENT_NAME$6,ir),[Ir,Mr]=React.useState(null),Or=useComposedRefs(rr,Hi=>Mr(Hi)),[$r,Dr]=React.useState(null),zr=useSize($r),Fr=(zr==null?void 0:zr.width)??0,Jr=(zr==null?void 0:zr.height)??0,$n=lr+(fr!=="center"?"-"+fr:""),Qr=typeof _r=="number"?_r:{top:0,right:0,bottom:0,left:0,..._r},Zn=Array.isArray(yr)?yr:[yr],qn=Zn.length>0,Xn={padding:Qr,boundary:Zn.filter(isNotNull),altBoundary:qn},{refs:Lr,floatingStyles:Gr,placement:Hn,isPositioned:ii,middlewareData:oi}=useFloating({strategy:"fixed",placement:$n,whileElementsMounted:(...Hi)=>autoUpdate(...Hi,{animationFrame:wr==="always"}),elements:{reference:Ar.anchor},middleware:[offset$1({mainAxis:dr+Jr,alignmentAxis:hr}),gr&&shift({mainAxis:!0,crossAxis:!1,limiter:br==="partial"?limitShift():void 0,...Xn}),gr&&flip({...Xn}),size$3({...Xn,apply:({elements:Hi,rects:Kn,availableWidth:yi,availableHeight:Ii})=>{const{width:gi,height:hi}=Kn.reference,fi=Hi.floating.style;fi.setProperty("--radix-popper-available-width",`${yi}px`),fi.setProperty("--radix-popper-available-height",`${Ii}px`),fi.setProperty("--radix-popper-anchor-width",`${gi}px`),fi.setProperty("--radix-popper-anchor-height",`${hi}px`)}}),$r&&arrow({element:$r,padding:mr}),transformOrigin({arrowWidth:Fr,arrowHeight:Jr}),vr&&hide({strategy:"referenceHidden",...Xn})]}),[ri,ti]=getSideAndAlignFromPlacement(Hn),si=useCallbackRef$1(xr);useLayoutEffect2(()=>{ii&&(si==null||si())},[ii,si]);const Jn=(pi=oi.arrow)==null?void 0:pi.x,ni=(bi=oi.arrow)==null?void 0:bi.y,Yn=((vi=oi.arrow)==null?void 0:vi.centerOffset)!==0,[ei,ai]=React.useState();return useLayoutEffect2(()=>{Ir&&ai(window.getComputedStyle(Ir).zIndex)},[Ir]),jsx$1("div",{ref:Lr.setFloating,"data-radix-popper-content-wrapper":"",style:{...Gr,transform:ii?Gr.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ei,"--radix-popper-transform-origin":[(Ti=oi.transformOrigin)==null?void 0:Ti.x,(Li=oi.transformOrigin)==null?void 0:Li.y].join(" "),...((qi=oi.hide)==null?void 0:qi.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:tr.dir,children:jsx$1(PopperContentProvider,{scope:ir,placedSide:ri,onArrowChange:Dr,arrowX:Jn,arrowY:ni,shouldHideArrow:Yn,children:jsx$1(Primitive.div,{"data-side":ri,"data-align":ti,...Sr,ref:Or,style:{...Sr.style,animation:ii?void 0:"none"}})})})});PopperContent.displayName=CONTENT_NAME$6;var ARROW_NAME$4="PopperArrow",OPPOSITE_SIDE={top:"bottom",right:"left",bottom:"top",left:"right"},PopperArrow=React.forwardRef(function(rr,ir){const{__scopePopper:lr,...dr}=rr,fr=useContentContext(ARROW_NAME$4,lr),hr=OPPOSITE_SIDE[fr.placedSide];return jsx$1("span",{ref:fr.onArrowChange,style:{position:"absolute",left:fr.arrowX,top:fr.arrowY,[hr]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[fr.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[fr.placedSide],visibility:fr.shouldHideArrow?"hidden":void 0},children:jsx$1(Root$4,{...dr,ref:ir,style:{...dr.style,display:"block"}})})});PopperArrow.displayName=ARROW_NAME$4;function isNotNull(tr){return tr!==null}var transformOrigin=tr=>({name:"transformOrigin",options:tr,fn(rr){var Ar,Ir,Mr;const{placement:ir,rects:lr,middlewareData:dr}=rr,hr=((Ar=dr.arrow)==null?void 0:Ar.centerOffset)!==0,mr=hr?0:tr.arrowWidth,gr=hr?0:tr.arrowHeight,[yr,_r]=getSideAndAlignFromPlacement(ir),br={start:"0%",center:"50%",end:"100%"}[_r],vr=(((Ir=dr.arrow)==null?void 0:Ir.x)??0)+mr/2,wr=(((Mr=dr.arrow)==null?void 0:Mr.y)??0)+gr/2;let xr="",Sr="";return yr==="bottom"?(xr=hr?br:`${vr}px`,Sr=`${-gr}px`):yr==="top"?(xr=hr?br:`${vr}px`,Sr=`${lr.floating.height+gr}px`):yr==="right"?(xr=`${-gr}px`,Sr=hr?br:`${wr}px`):yr==="left"&&(xr=`${lr.floating.width+gr}px`,Sr=hr?br:`${wr}px`),{data:{x:xr,y:Sr}}}});function getSideAndAlignFromPlacement(tr){const[rr,ir="center"]=tr.split("-");return[rr,ir]}var Root2$3=Popper,Anchor=PopperAnchor,Content$4=PopperContent,Arrow=PopperArrow,PORTAL_NAME$5="Portal",Portal$4=React.forwardRef((tr,rr)=>{var mr;const{container:ir,...lr}=tr,[dr,fr]=React.useState(!1);useLayoutEffect2(()=>fr(!0),[]);const hr=ir||dr&&((mr=globalThis==null?void 0:globalThis.document)==null?void 0:mr.body);return hr?ReactDOM__default.createPortal(jsx$1(Primitive.div,{...lr,ref:rr}),hr):null});Portal$4.displayName=PORTAL_NAME$5;function useStateMachine(tr,rr){return React.useReducer((ir,lr)=>rr[ir][lr]??ir,tr)}var Presence=tr=>{const{present:rr,children:ir}=tr,lr=usePresence(rr),dr=typeof ir=="function"?ir({present:lr.isPresent}):React.Children.only(ir),fr=useComposedRefs(lr.ref,getElementRef(dr));return typeof ir=="function"||lr.isPresent?React.cloneElement(dr,{ref:fr}):null};Presence.displayName="Presence";function usePresence(tr){const[rr,ir]=React.useState(),lr=React.useRef(null),dr=React.useRef(tr),fr=React.useRef("none"),hr=tr?"mounted":"unmounted",[mr,gr]=useStateMachine(hr,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return React.useEffect(()=>{const yr=getAnimationName(lr.current);fr.current=mr==="mounted"?yr:"none"},[mr]),useLayoutEffect2(()=>{const yr=lr.current,_r=dr.current;if(_r!==tr){const vr=fr.current,wr=getAnimationName(yr);tr?gr("MOUNT"):wr==="none"||(yr==null?void 0:yr.display)==="none"?gr("UNMOUNT"):gr(_r&&vr!==wr?"ANIMATION_OUT":"UNMOUNT"),dr.current=tr}},[tr,gr]),useLayoutEffect2(()=>{if(rr){let yr;const _r=rr.ownerDocument.defaultView??window,br=wr=>{const Sr=getAnimationName(lr.current).includes(CSS.escape(wr.animationName));if(wr.target===rr&&Sr&&(gr("ANIMATION_END"),!dr.current)){const Ar=rr.style.animationFillMode;rr.style.animationFillMode="forwards",yr=_r.setTimeout(()=>{rr.style.animationFillMode==="forwards"&&(rr.style.animationFillMode=Ar)})}},vr=wr=>{wr.target===rr&&(fr.current=getAnimationName(lr.current))};return rr.addEventListener("animationstart",vr),rr.addEventListener("animationcancel",br),rr.addEventListener("animationend",br),()=>{_r.clearTimeout(yr),rr.removeEventListener("animationstart",vr),rr.removeEventListener("animationcancel",br),rr.removeEventListener("animationend",br)}}else gr("ANIMATION_END")},[rr,gr]),{isPresent:["mounted","unmountSuspended"].includes(mr),ref:React.useCallback(yr=>{lr.current=yr?getComputedStyle(yr):null,ir(yr)},[])}}function getAnimationName(tr){return(tr==null?void 0:tr.animationName)||"none"}function getElementRef(tr){var lr,dr;let rr=(lr=Object.getOwnPropertyDescriptor(tr.props,"ref"))==null?void 0:lr.get,ir=rr&&"isReactWarning"in rr&&rr.isReactWarning;return ir?tr.ref:(rr=(dr=Object.getOwnPropertyDescriptor(tr,"ref"))==null?void 0:dr.get,ir=rr&&"isReactWarning"in rr&&rr.isReactWarning,ir?tr.props.ref:tr.props.ref||tr.ref)}var ENTRY_FOCUS="rovingFocusGroup.onEntryFocus",EVENT_OPTIONS={bubbles:!1,cancelable:!0},GROUP_NAME$2="RovingFocusGroup",[Collection$1,useCollection$1,createCollectionScope$1]=createCollection(GROUP_NAME$2),[createRovingFocusGroupContext,createRovingFocusGroupScope]=createContextScope(GROUP_NAME$2,[createCollectionScope$1]),[RovingFocusProvider,useRovingFocusContext]=createRovingFocusGroupContext(GROUP_NAME$2),RovingFocusGroup=React.forwardRef((tr,rr)=>jsx$1(Collection$1.Provider,{scope:tr.__scopeRovingFocusGroup,children:jsx$1(Collection$1.Slot,{scope:tr.__scopeRovingFocusGroup,children:jsx$1(RovingFocusGroupImpl,{...tr,ref:rr})})}));RovingFocusGroup.displayName=GROUP_NAME$2;var RovingFocusGroupImpl=React.forwardRef((tr,rr)=>{const{__scopeRovingFocusGroup:ir,orientation:lr,loop:dr=!1,dir:fr,currentTabStopId:hr,defaultCurrentTabStopId:mr,onCurrentTabStopIdChange:gr,onEntryFocus:yr,preventScrollOnEntryFocus:_r=!1,...br}=tr,vr=React.useRef(null),wr=useComposedRefs(rr,vr),xr=useDirection(fr),[Sr,Ar]=useControllableState({prop:hr,defaultProp:mr??null,onChange:gr,caller:GROUP_NAME$2}),[Ir,Mr]=React.useState(!1),Or=useCallbackRef$1(yr),$r=useCollection$1(ir),Dr=React.useRef(!1),[zr,Fr]=React.useState(0);return React.useEffect(()=>{const Jr=vr.current;if(Jr)return Jr.addEventListener(ENTRY_FOCUS,Or),()=>Jr.removeEventListener(ENTRY_FOCUS,Or)},[Or]),jsx$1(RovingFocusProvider,{scope:ir,orientation:lr,dir:xr,loop:dr,currentTabStopId:Sr,onItemFocus:React.useCallback(Jr=>Ar(Jr),[Ar]),onItemShiftTab:React.useCallback(()=>Mr(!0),[]),onFocusableItemAdd:React.useCallback(()=>Fr(Jr=>Jr+1),[]),onFocusableItemRemove:React.useCallback(()=>Fr(Jr=>Jr-1),[]),children:jsx$1(Primitive.div,{tabIndex:Ir||zr===0?-1:0,"data-orientation":lr,...br,ref:wr,style:{outline:"none",...tr.style},onMouseDown:composeEventHandlers(tr.onMouseDown,()=>{Dr.current=!0}),onFocus:composeEventHandlers(tr.onFocus,Jr=>{const $n=!Dr.current;if(Jr.target===Jr.currentTarget&&$n&&!Ir){const Qr=new CustomEvent(ENTRY_FOCUS,EVENT_OPTIONS);if(Jr.currentTarget.dispatchEvent(Qr),!Qr.defaultPrevented){const Zn=$r().filter(Hn=>Hn.focusable),qn=Zn.find(Hn=>Hn.active),Xn=Zn.find(Hn=>Hn.id===Sr),Gr=[qn,Xn,...Zn].filter(Boolean).map(Hn=>Hn.ref.current);focusFirst$1(Gr,_r)}}Dr.current=!1}),onBlur:composeEventHandlers(tr.onBlur,()=>Mr(!1))})})}),ITEM_NAME$2="RovingFocusGroupItem",RovingFocusGroupItem=React.forwardRef((tr,rr)=>{const{__scopeRovingFocusGroup:ir,focusable:lr=!0,active:dr=!1,tabStopId:fr,children:hr,...mr}=tr,gr=useId(),yr=fr||gr,_r=useRovingFocusContext(ITEM_NAME$2,ir),br=_r.currentTabStopId===yr,vr=useCollection$1(ir),{onFocusableItemAdd:wr,onFocusableItemRemove:xr,currentTabStopId:Sr}=_r;return React.useEffect(()=>{if(lr)return wr(),()=>xr()},[lr,wr,xr]),jsx$1(Collection$1.ItemSlot,{scope:ir,id:yr,focusable:lr,active:dr,children:jsx$1(Primitive.span,{tabIndex:br?0:-1,"data-orientation":_r.orientation,...mr,ref:rr,onMouseDown:composeEventHandlers(tr.onMouseDown,Ar=>{lr?_r.onItemFocus(yr):Ar.preventDefault()}),onFocus:composeEventHandlers(tr.onFocus,()=>_r.onItemFocus(yr)),onKeyDown:composeEventHandlers(tr.onKeyDown,Ar=>{if(Ar.key==="Tab"&&Ar.shiftKey){_r.onItemShiftTab();return}if(Ar.target!==Ar.currentTarget)return;const Ir=getFocusIntent(Ar,_r.orientation,_r.dir);if(Ir!==void 0){if(Ar.metaKey||Ar.ctrlKey||Ar.altKey||Ar.shiftKey)return;Ar.preventDefault();let Or=vr().filter($r=>$r.focusable).map($r=>$r.ref.current);if(Ir==="last")Or.reverse();else if(Ir==="prev"||Ir==="next"){Ir==="prev"&&Or.reverse();const $r=Or.indexOf(Ar.currentTarget);Or=_r.loop?wrapArray$1(Or,$r+1):Or.slice($r+1)}setTimeout(()=>focusFirst$1(Or))}}),children:typeof hr=="function"?hr({isCurrentTabStop:br,hasTabStop:Sr!=null}):hr})})});RovingFocusGroupItem.displayName=ITEM_NAME$2;var MAP_KEY_TO_FOCUS_INTENT={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function getDirectionAwareKey(tr,rr){return rr!=="rtl"?tr:tr==="ArrowLeft"?"ArrowRight":tr==="ArrowRight"?"ArrowLeft":tr}function getFocusIntent(tr,rr,ir){const lr=getDirectionAwareKey(tr.key,ir);if(!(rr==="vertical"&&["ArrowLeft","ArrowRight"].includes(lr))&&!(rr==="horizontal"&&["ArrowUp","ArrowDown"].includes(lr)))return MAP_KEY_TO_FOCUS_INTENT[lr]}function focusFirst$1(tr,rr=!1){const ir=document.activeElement;for(const lr of tr)if(lr===ir||(lr.focus({preventScroll:rr}),document.activeElement!==ir))return}function wrapArray$1(tr,rr){return tr.map((ir,lr)=>tr[(rr+lr)%tr.length])}var Root$3=RovingFocusGroup,Item=RovingFocusGroupItem,getDefaultParent=function(tr){if(typeof document>"u")return null;var rr=Array.isArray(tr)?tr[0]:tr;return rr.ownerDocument.body},counterMap=new WeakMap,uncontrolledNodes=new WeakMap,markerMap={},lockCount=0,unwrapHost=function(tr){return tr&&(tr.host||unwrapHost(tr.parentNode))},correctTargets=function(tr,rr){return rr.map(function(ir){if(tr.contains(ir))return ir;var lr=unwrapHost(ir);return lr&&tr.contains(lr)?lr:(console.error("aria-hidden",ir,"in not contained inside",tr,". Doing nothing"),null)}).filter(function(ir){return!!ir})},applyAttributeToOthers=function(tr,rr,ir,lr){var dr=correctTargets(rr,Array.isArray(tr)?tr:[tr]);markerMap[ir]||(markerMap[ir]=new WeakMap);var fr=markerMap[ir],hr=[],mr=new Set,gr=new Set(dr),yr=function(br){!br||mr.has(br)||(mr.add(br),yr(br.parentNode))};dr.forEach(yr);var _r=function(br){!br||gr.has(br)||Array.prototype.forEach.call(br.children,function(vr){if(mr.has(vr))_r(vr);else try{var wr=vr.getAttribute(lr),xr=wr!==null&&wr!=="false",Sr=(counterMap.get(vr)||0)+1,Ar=(fr.get(vr)||0)+1;counterMap.set(vr,Sr),fr.set(vr,Ar),hr.push(vr),Sr===1&&xr&&uncontrolledNodes.set(vr,!0),Ar===1&&vr.setAttribute(ir,"true"),xr||vr.setAttribute(lr,"true")}catch(Ir){console.error("aria-hidden: cannot operate on ",vr,Ir)}})};return _r(rr),mr.clear(),lockCount++,function(){hr.forEach(function(br){var vr=counterMap.get(br)-1,wr=fr.get(br)-1;counterMap.set(br,vr),fr.set(br,wr),vr||(uncontrolledNodes.has(br)||br.removeAttribute(lr),uncontrolledNodes.delete(br)),wr||br.removeAttribute(ir)}),lockCount--,lockCount||(counterMap=new WeakMap,counterMap=new WeakMap,uncontrolledNodes=new WeakMap,markerMap={})}},hideOthers=function(tr,rr,ir){ir===void 0&&(ir="data-aria-hidden");var lr=Array.from(Array.isArray(tr)?tr:[tr]),dr=getDefaultParent(tr);return dr?(lr.push.apply(lr,Array.from(dr.querySelectorAll("[aria-live], script"))),applyAttributeToOthers(lr,dr,ir,"aria-hidden")):function(){return null}},__assign=function(){return __assign=Object.assign||function(rr){for(var ir,lr=1,dr=arguments.length;lr<dr;lr++){ir=arguments[lr];for(var fr in ir)Object.prototype.hasOwnProperty.call(ir,fr)&&(rr[fr]=ir[fr])}return rr},__assign.apply(this,arguments)};function __rest(tr,rr){var ir={};for(var lr in tr)Object.prototype.hasOwnProperty.call(tr,lr)&&rr.indexOf(lr)<0&&(ir[lr]=tr[lr]);if(tr!=null&&typeof Object.getOwnPropertySymbols=="function")for(var dr=0,lr=Object.getOwnPropertySymbols(tr);dr<lr.length;dr++)rr.indexOf(lr[dr])<0&&Object.prototype.propertyIsEnumerable.call(tr,lr[dr])&&(ir[lr[dr]]=tr[lr[dr]]);return ir}function __spreadArray(tr,rr,ir){if(ir||arguments.length===2)for(var lr=0,dr=rr.length,fr;lr<dr;lr++)(fr||!(lr in rr))&&(fr||(fr=Array.prototype.slice.call(rr,0,lr)),fr[lr]=rr[lr]);return tr.concat(fr||Array.prototype.slice.call(rr))}var zeroRightClassName="right-scroll-bar-position",fullWidthClassName="width-before-scroll-bar",noScrollbarsClassName="with-scroll-bars-hidden",removedBarSizeVariable="--removed-body-scroll-bar-size";function assignRef(tr,rr){return typeof tr=="function"?tr(rr):tr&&(tr.current=rr),tr}function useCallbackRef(tr,rr){var ir=useState(function(){return{value:tr,callback:rr,facade:{get current(){return ir.value},set current(lr){var dr=ir.value;dr!==lr&&(ir.value=lr,ir.callback(lr,dr))}}}})[0];return ir.callback=rr,ir.facade}var useIsomorphicLayoutEffect$3=typeof window<"u"?React.useLayoutEffect:React.useEffect,currentValues=new WeakMap;function useMergeRefs(tr,rr){var ir=useCallbackRef(null,function(lr){return tr.forEach(function(dr){return assignRef(dr,lr)})});return useIsomorphicLayoutEffect$3(function(){var lr=currentValues.get(ir);if(lr){var dr=new Set(lr),fr=new Set(tr),hr=ir.current;dr.forEach(function(mr){fr.has(mr)||assignRef(mr,null)}),fr.forEach(function(mr){dr.has(mr)||assignRef(mr,hr)})}currentValues.set(ir,tr)},[tr]),ir}function ItoI(tr){return tr}function innerCreateMedium(tr,rr){rr===void 0&&(rr=ItoI);var ir=[],lr=!1,dr={read:function(){if(lr)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return ir.length?ir[ir.length-1]:tr},useMedium:function(fr){var hr=rr(fr,lr);return ir.push(hr),function(){ir=ir.filter(function(mr){return mr!==hr})}},assignSyncMedium:function(fr){for(lr=!0;ir.length;){var hr=ir;ir=[],hr.forEach(fr)}ir={push:function(mr){return fr(mr)},filter:function(){return ir}}},assignMedium:function(fr){lr=!0;var hr=[];if(ir.length){var mr=ir;ir=[],mr.forEach(fr),hr=ir}var gr=function(){var _r=hr;hr=[],_r.forEach(fr)},yr=function(){return Promise.resolve().then(gr)};yr(),ir={push:function(_r){hr.push(_r),yr()},filter:function(_r){return hr=hr.filter(_r),ir}}}};return dr}function createSidecarMedium(tr){tr===void 0&&(tr={});var rr=innerCreateMedium(null);return rr.options=__assign({async:!0,ssr:!1},tr),rr}var SideCar$1=function(tr){var rr=tr.sideCar,ir=__rest(tr,["sideCar"]);if(!rr)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var lr=rr.read();if(!lr)throw new Error("Sidecar medium not found");return React.createElement(lr,__assign({},ir))};SideCar$1.isSideCarExport=!0;function exportSidecar(tr,rr){return tr.useMedium(rr),SideCar$1}var effectCar=createSidecarMedium(),nothing=function(){},RemoveScroll=React.forwardRef(function(tr,rr){var ir=React.useRef(null),lr=React.useState({onScrollCapture:nothing,onWheelCapture:nothing,onTouchMoveCapture:nothing}),dr=lr[0],fr=lr[1],hr=tr.forwardProps,mr=tr.children,gr=tr.className,yr=tr.removeScrollBar,_r=tr.enabled,br=tr.shards,vr=tr.sideCar,wr=tr.noRelative,xr=tr.noIsolation,Sr=tr.inert,Ar=tr.allowPinchZoom,Ir=tr.as,Mr=Ir===void 0?"div":Ir,Or=tr.gapMode,$r=__rest(tr,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),Dr=vr,zr=useMergeRefs([ir,rr]),Fr=__assign(__assign({},$r),dr);return React.createElement(React.Fragment,null,_r&&React.createElement(Dr,{sideCar:effectCar,removeScrollBar:yr,shards:br,noRelative:wr,noIsolation:xr,inert:Sr,setCallbacks:fr,allowPinchZoom:!!Ar,lockRef:ir,gapMode:Or}),hr?React.cloneElement(React.Children.only(mr),__assign(__assign({},Fr),{ref:zr})):React.createElement(Mr,__assign({},Fr,{className:gr,ref:zr}),mr))});RemoveScroll.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};RemoveScroll.classNames={fullWidth:fullWidthClassName,zeroRight:zeroRightClassName};var getNonce=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function makeStyleTag(){if(!document)return null;var tr=document.createElement("style");tr.type="text/css";var rr=getNonce();return rr&&tr.setAttribute("nonce",rr),tr}function injectStyles(tr,rr){tr.styleSheet?tr.styleSheet.cssText=rr:tr.appendChild(document.createTextNode(rr))}function insertStyleTag(tr){var rr=document.head||document.getElementsByTagName("head")[0];rr.appendChild(tr)}var stylesheetSingleton=function(){var tr=0,rr=null;return{add:function(ir){tr==0&&(rr=makeStyleTag())&&(injectStyles(rr,ir),insertStyleTag(rr)),tr++},remove:function(){tr--,!tr&&rr&&(rr.parentNode&&rr.parentNode.removeChild(rr),rr=null)}}},styleHookSingleton=function(){var tr=stylesheetSingleton();return function(rr,ir){React.useEffect(function(){return tr.add(rr),function(){tr.remove()}},[rr&&ir])}},styleSingleton=function(){var tr=styleHookSingleton(),rr=function(ir){var lr=ir.styles,dr=ir.dynamic;return tr(lr,dr),null};return rr},zeroGap={left:0,top:0,right:0,gap:0},parse$4=function(tr){return parseInt(tr||"",10)||0},getOffset=function(tr){var rr=window.getComputedStyle(document.body),ir=rr[tr==="padding"?"paddingLeft":"marginLeft"],lr=rr[tr==="padding"?"paddingTop":"marginTop"],dr=rr[tr==="padding"?"paddingRight":"marginRight"];return[parse$4(ir),parse$4(lr),parse$4(dr)]},getGapWidth=function(tr){if(tr===void 0&&(tr="margin"),typeof window>"u")return zeroGap;var rr=getOffset(tr),ir=document.documentElement.clientWidth,lr=window.innerWidth;return{left:rr[0],top:rr[1],right:rr[2],gap:Math.max(0,lr-ir+rr[2]-rr[0])}},Style=styleSingleton(),lockAttribute="data-scroll-locked",getStyles=function(tr,rr,ir,lr){var dr=tr.left,fr=tr.top,hr=tr.right,mr=tr.gap;return ir===void 0&&(ir="margin"),`
3
3
  .`.concat(noScrollbarsClassName,` {
4
4
  overflow: hidden `).concat(lr,`;
@@ -186,7 +186,7 @@ ${ti}`,ii.pop(),`[${pi}]`}let si=Object.keys(Hn);const Jn=si.length;if(Jn===0)re
186
186
  ${ri}`;let Yn="",ei="",ai=Math.min(Jn,$n);gr(Hn)&&(Yn+=yr(Hn,ni,$n),si=si.slice(Hn.length),ai-=Hn.length,ei=ni),zr&&(si=hr(si,Fr)),ii.push(Hn);for(let pi=0;pi<ai;pi++){const bi=si[pi],vi=qn(bi,Hn[bi],ii,oi,ri);vi!==void 0&&(Yn+=`${ei}${fr(bi)}: ${vi}`,ei=ni)}if(Jn>$n){const pi=Jn-$n;Yn+=`${ei}"...": "${xr(pi)} not stringified"`,ei=ni}return ei!==""&&(Yn=`
187
187
  ${ri}${Yn}
188
188
  ${ti}`),ii.pop(),`{${Yn}}`}case"number":return isFinite(Hn)?String(Hn):Or?Or(Hn):"null";case"boolean":return Hn===!0?"true":"false";case"undefined":return;case"bigint":if(Dr)return String(Hn);default:return Or?Or(Hn):void 0}}function Xn(Gr,Hn,ii){switch(typeof Hn){case"string":return fr(Hn);case"object":{if(Hn===null)return"null";if(typeof Hn.toJSON=="function"){if(Hn=Hn.toJSON(Gr),typeof Hn!="object")return Xn(Gr,Hn,ii);if(Hn===null)return"null"}if(ii.indexOf(Hn)!==-1)return $r;let oi="";const ri=Hn.length!==void 0;if(ri&&Array.isArray(Hn)){if(Hn.length===0)return"[]";if(Jr<ii.length+1)return'"[Array]"';ii.push(Hn);const Yn=Math.min(Hn.length,$n);let ei=0;for(;ei<Yn-1;ei++){const pi=Xn(String(ei),Hn[ei],ii);oi+=pi!==void 0?pi:"null",oi+=","}const ai=Xn(String(ei),Hn[ei],ii);if(oi+=ai!==void 0?ai:"null",Hn.length-1>$n){const pi=Hn.length-$n-1;oi+=`,"... ${xr(pi)} not stringified"`}return ii.pop(),`[${oi}]`}let ti=Object.keys(Hn);const si=ti.length;if(si===0)return"{}";if(Jr<ii.length+1)return'"[Object]"';let Jn="",ni=Math.min(si,$n);ri&&gr(Hn)&&(oi+=yr(Hn,",",$n),ti=ti.slice(Hn.length),ni-=Hn.length,Jn=","),zr&&(ti=hr(ti,Fr)),ii.push(Hn);for(let Yn=0;Yn<ni;Yn++){const ei=ti[Yn],ai=Xn(ei,Hn[ei],ii);ai!==void 0&&(oi+=`${Jn}${fr(ei)}:${ai}`,Jn=",")}if(si>$n){const Yn=si-$n;oi+=`${Jn}"...":"${xr(Yn)} not stringified"`}return ii.pop(),`{${oi}}`}case"number":return isFinite(Hn)?String(Hn):Or?Or(Hn):"null";case"boolean":return Hn===!0?"true":"false";case"undefined":return;case"bigint":if(Dr)return String(Hn);default:return Or?Or(Hn):void 0}}function Lr(Gr,Hn,ii){if(arguments.length>1){let oi="";if(typeof ii=="number"?oi=" ".repeat(Math.min(ii,10)):typeof ii=="string"&&(oi=ii.slice(0,10)),Hn!=null){if(typeof Hn=="function")return Qr("",{"":Gr},[],Hn,oi,"");if(Array.isArray(Hn))return Zn("",Gr,[],Sr(Hn),oi,"")}if(oi.length!==0)return qn("",Gr,[],oi,"")}return Xn("",Gr,[])}return Lr}})(safeStableStringify,safeStableStringify.exports)),safeStableStringify.exports}var safeStableStringifyExports=requireSafeStableStringify();const cjsModule=getDefaultExportFromCjs(safeStableStringifyExports);var util$4;(function(tr){tr.assertEqual=dr=>{};function rr(dr){}tr.assertIs=rr;function ir(dr){throw new Error}tr.assertNever=ir,tr.arrayToEnum=dr=>{const fr={};for(const hr of dr)fr[hr]=hr;return fr},tr.getValidEnumValues=dr=>{const fr=tr.objectKeys(dr).filter(mr=>typeof dr[dr[mr]]!="number"),hr={};for(const mr of fr)hr[mr]=dr[mr];return tr.objectValues(hr)},tr.objectValues=dr=>tr.objectKeys(dr).map(function(fr){return dr[fr]}),tr.objectKeys=typeof Object.keys=="function"?dr=>Object.keys(dr):dr=>{const fr=[];for(const hr in dr)Object.prototype.hasOwnProperty.call(dr,hr)&&fr.push(hr);return fr},tr.find=(dr,fr)=>{for(const hr of dr)if(fr(hr))return hr},tr.isInteger=typeof Number.isInteger=="function"?dr=>Number.isInteger(dr):dr=>typeof dr=="number"&&Number.isFinite(dr)&&Math.floor(dr)===dr;function lr(dr,fr=" | "){return dr.map(hr=>typeof hr=="string"?`'${hr}'`:hr).join(fr)}tr.joinValues=lr,tr.jsonStringifyReplacer=(dr,fr)=>typeof fr=="bigint"?fr.toString():fr})(util$4||(util$4={}));var objectUtil;(function(tr){tr.mergeShapes=(rr,ir)=>({...rr,...ir})})(objectUtil||(objectUtil={}));const ZodParsedType=util$4.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),getParsedType=tr=>{switch(typeof tr){case"undefined":return ZodParsedType.undefined;case"string":return ZodParsedType.string;case"number":return Number.isNaN(tr)?ZodParsedType.nan:ZodParsedType.number;case"boolean":return ZodParsedType.boolean;case"function":return ZodParsedType.function;case"bigint":return ZodParsedType.bigint;case"symbol":return ZodParsedType.symbol;case"object":return Array.isArray(tr)?ZodParsedType.array:tr===null?ZodParsedType.null:tr.then&&typeof tr.then=="function"&&tr.catch&&typeof tr.catch=="function"?ZodParsedType.promise:typeof Map<"u"&&tr instanceof Map?ZodParsedType.map:typeof Set<"u"&&tr instanceof Set?ZodParsedType.set:typeof Date<"u"&&tr instanceof Date?ZodParsedType.date:ZodParsedType.object;default:return ZodParsedType.unknown}},ZodIssueCode=util$4.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class ZodError extends Error{get errors(){return this.issues}constructor(rr){super(),this.issues=[],this.addIssue=lr=>{this.issues=[...this.issues,lr]},this.addIssues=(lr=[])=>{this.issues=[...this.issues,...lr]};const ir=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,ir):this.__proto__=ir,this.name="ZodError",this.issues=rr}format(rr){const ir=rr||function(fr){return fr.message},lr={_errors:[]},dr=fr=>{for(const hr of fr.issues)if(hr.code==="invalid_union")hr.unionErrors.map(dr);else if(hr.code==="invalid_return_type")dr(hr.returnTypeError);else if(hr.code==="invalid_arguments")dr(hr.argumentsError);else if(hr.path.length===0)lr._errors.push(ir(hr));else{let mr=lr,gr=0;for(;gr<hr.path.length;){const yr=hr.path[gr];gr===hr.path.length-1?(mr[yr]=mr[yr]||{_errors:[]},mr[yr]._errors.push(ir(hr))):mr[yr]=mr[yr]||{_errors:[]},mr=mr[yr],gr++}}};return dr(this),lr}static assert(rr){if(!(rr instanceof ZodError))throw new Error(`Not a ZodError: ${rr}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,util$4.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(rr=ir=>ir.message){const ir={},lr=[];for(const dr of this.issues)if(dr.path.length>0){const fr=dr.path[0];ir[fr]=ir[fr]||[],ir[fr].push(rr(dr))}else lr.push(rr(dr));return{formErrors:lr,fieldErrors:ir}}get formErrors(){return this.flatten()}}ZodError.create=tr=>new ZodError(tr);const errorMap=(tr,rr)=>{let ir;switch(tr.code){case ZodIssueCode.invalid_type:tr.received===ZodParsedType.undefined?ir="Required":ir=`Expected ${tr.expected}, received ${tr.received}`;break;case ZodIssueCode.invalid_literal:ir=`Invalid literal value, expected ${JSON.stringify(tr.expected,util$4.jsonStringifyReplacer)}`;break;case ZodIssueCode.unrecognized_keys:ir=`Unrecognized key(s) in object: ${util$4.joinValues(tr.keys,", ")}`;break;case ZodIssueCode.invalid_union:ir="Invalid input";break;case ZodIssueCode.invalid_union_discriminator:ir=`Invalid discriminator value. Expected ${util$4.joinValues(tr.options)}`;break;case ZodIssueCode.invalid_enum_value:ir=`Invalid enum value. Expected ${util$4.joinValues(tr.options)}, received '${tr.received}'`;break;case ZodIssueCode.invalid_arguments:ir="Invalid function arguments";break;case ZodIssueCode.invalid_return_type:ir="Invalid function return type";break;case ZodIssueCode.invalid_date:ir="Invalid date";break;case ZodIssueCode.invalid_string:typeof tr.validation=="object"?"includes"in tr.validation?(ir=`Invalid input: must include "${tr.validation.includes}"`,typeof tr.validation.position=="number"&&(ir=`${ir} at one or more positions greater than or equal to ${tr.validation.position}`)):"startsWith"in tr.validation?ir=`Invalid input: must start with "${tr.validation.startsWith}"`:"endsWith"in tr.validation?ir=`Invalid input: must end with "${tr.validation.endsWith}"`:util$4.assertNever(tr.validation):tr.validation!=="regex"?ir=`Invalid ${tr.validation}`:ir="Invalid";break;case ZodIssueCode.too_small:tr.type==="array"?ir=`Array must contain ${tr.exact?"exactly":tr.inclusive?"at least":"more than"} ${tr.minimum} element(s)`:tr.type==="string"?ir=`String must contain ${tr.exact?"exactly":tr.inclusive?"at least":"over"} ${tr.minimum} character(s)`:tr.type==="number"?ir=`Number must be ${tr.exact?"exactly equal to ":tr.inclusive?"greater than or equal to ":"greater than "}${tr.minimum}`:tr.type==="bigint"?ir=`Number must be ${tr.exact?"exactly equal to ":tr.inclusive?"greater than or equal to ":"greater than "}${tr.minimum}`:tr.type==="date"?ir=`Date must be ${tr.exact?"exactly equal to ":tr.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(tr.minimum))}`:ir="Invalid input";break;case ZodIssueCode.too_big:tr.type==="array"?ir=`Array must contain ${tr.exact?"exactly":tr.inclusive?"at most":"less than"} ${tr.maximum} element(s)`:tr.type==="string"?ir=`String must contain ${tr.exact?"exactly":tr.inclusive?"at most":"under"} ${tr.maximum} character(s)`:tr.type==="number"?ir=`Number must be ${tr.exact?"exactly":tr.inclusive?"less than or equal to":"less than"} ${tr.maximum}`:tr.type==="bigint"?ir=`BigInt must be ${tr.exact?"exactly":tr.inclusive?"less than or equal to":"less than"} ${tr.maximum}`:tr.type==="date"?ir=`Date must be ${tr.exact?"exactly":tr.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(tr.maximum))}`:ir="Invalid input";break;case ZodIssueCode.custom:ir="Invalid input";break;case ZodIssueCode.invalid_intersection_types:ir="Intersection results could not be merged";break;case ZodIssueCode.not_multiple_of:ir=`Number must be a multiple of ${tr.multipleOf}`;break;case ZodIssueCode.not_finite:ir="Number must be finite";break;default:ir=rr.defaultError,util$4.assertNever(tr)}return{message:ir}};let overrideErrorMap=errorMap;function getErrorMap(){return overrideErrorMap}const makeIssue=tr=>{const{data:rr,path:ir,errorMaps:lr,issueData:dr}=tr,fr=[...ir,...dr.path||[]],hr={...dr,path:fr};if(dr.message!==void 0)return{...dr,path:fr,message:dr.message};let mr="";const gr=lr.filter(yr=>!!yr).slice().reverse();for(const yr of gr)mr=yr(hr,{data:rr,defaultError:mr}).message;return{...dr,path:fr,message:mr}};function addIssueToContext(tr,rr){const ir=getErrorMap(),lr=makeIssue({issueData:rr,data:tr.data,path:tr.path,errorMaps:[tr.common.contextualErrorMap,tr.schemaErrorMap,ir,ir===errorMap?void 0:errorMap].filter(dr=>!!dr)});tr.common.issues.push(lr)}class ParseStatus{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(rr,ir){const lr=[];for(const dr of ir){if(dr.status==="aborted")return INVALID$3;dr.status==="dirty"&&rr.dirty(),lr.push(dr.value)}return{status:rr.value,value:lr}}static async mergeObjectAsync(rr,ir){const lr=[];for(const dr of ir){const fr=await dr.key,hr=await dr.value;lr.push({key:fr,value:hr})}return ParseStatus.mergeObjectSync(rr,lr)}static mergeObjectSync(rr,ir){const lr={};for(const dr of ir){const{key:fr,value:hr}=dr;if(fr.status==="aborted"||hr.status==="aborted")return INVALID$3;fr.status==="dirty"&&rr.dirty(),hr.status==="dirty"&&rr.dirty(),fr.value!=="__proto__"&&(typeof hr.value<"u"||dr.alwaysSet)&&(lr[fr.value]=hr.value)}return{status:rr.value,value:lr}}}const INVALID$3=Object.freeze({status:"aborted"}),DIRTY=tr=>({status:"dirty",value:tr}),OK=tr=>({status:"valid",value:tr}),isAborted=tr=>tr.status==="aborted",isDirty=tr=>tr.status==="dirty",isValid=tr=>tr.status==="valid",isAsync=tr=>typeof Promise<"u"&&tr instanceof Promise;var errorUtil;(function(tr){tr.errToObj=rr=>typeof rr=="string"?{message:rr}:rr||{},tr.toString=rr=>typeof rr=="string"?rr:rr==null?void 0:rr.message})(errorUtil||(errorUtil={}));class ParseInputLazyPath{constructor(rr,ir,lr,dr){this._cachedPath=[],this.parent=rr,this.data=ir,this._path=lr,this._key=dr}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const handleResult=(tr,rr)=>{if(isValid(rr))return{success:!0,data:rr.value};if(!tr.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const ir=new ZodError(tr.common.issues);return this._error=ir,this._error}}};function processCreateParams(tr){if(!tr)return{};const{errorMap:rr,invalid_type_error:ir,required_error:lr,description:dr}=tr;if(rr&&(ir||lr))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return rr?{errorMap:rr,description:dr}:{errorMap:(hr,mr)=>{const{message:gr}=tr;return hr.code==="invalid_enum_value"?{message:gr??mr.defaultError}:typeof mr.data>"u"?{message:gr??lr??mr.defaultError}:hr.code!=="invalid_type"?{message:mr.defaultError}:{message:gr??ir??mr.defaultError}},description:dr}}class ZodType{get description(){return this._def.description}_getType(rr){return getParsedType(rr.data)}_getOrReturnCtx(rr,ir){return ir||{common:rr.parent.common,data:rr.data,parsedType:getParsedType(rr.data),schemaErrorMap:this._def.errorMap,path:rr.path,parent:rr.parent}}_processInputParams(rr){return{status:new ParseStatus,ctx:{common:rr.parent.common,data:rr.data,parsedType:getParsedType(rr.data),schemaErrorMap:this._def.errorMap,path:rr.path,parent:rr.parent}}}_parseSync(rr){const ir=this._parse(rr);if(isAsync(ir))throw new Error("Synchronous parse encountered promise.");return ir}_parseAsync(rr){const ir=this._parse(rr);return Promise.resolve(ir)}parse(rr,ir){const lr=this.safeParse(rr,ir);if(lr.success)return lr.data;throw lr.error}safeParse(rr,ir){const lr={common:{issues:[],async:(ir==null?void 0:ir.async)??!1,contextualErrorMap:ir==null?void 0:ir.errorMap},path:(ir==null?void 0:ir.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:rr,parsedType:getParsedType(rr)},dr=this._parseSync({data:rr,path:lr.path,parent:lr});return handleResult(lr,dr)}"~validate"(rr){var lr,dr;const ir={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:rr,parsedType:getParsedType(rr)};if(!this["~standard"].async)try{const fr=this._parseSync({data:rr,path:[],parent:ir});return isValid(fr)?{value:fr.value}:{issues:ir.common.issues}}catch(fr){(dr=(lr=fr==null?void 0:fr.message)==null?void 0:lr.toLowerCase())!=null&&dr.includes("encountered")&&(this["~standard"].async=!0),ir.common={issues:[],async:!0}}return this._parseAsync({data:rr,path:[],parent:ir}).then(fr=>isValid(fr)?{value:fr.value}:{issues:ir.common.issues})}async parseAsync(rr,ir){const lr=await this.safeParseAsync(rr,ir);if(lr.success)return lr.data;throw lr.error}async safeParseAsync(rr,ir){const lr={common:{issues:[],contextualErrorMap:ir==null?void 0:ir.errorMap,async:!0},path:(ir==null?void 0:ir.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:rr,parsedType:getParsedType(rr)},dr=this._parse({data:rr,path:lr.path,parent:lr}),fr=await(isAsync(dr)?dr:Promise.resolve(dr));return handleResult(lr,fr)}refine(rr,ir){const lr=dr=>typeof ir=="string"||typeof ir>"u"?{message:ir}:typeof ir=="function"?ir(dr):ir;return this._refinement((dr,fr)=>{const hr=rr(dr),mr=()=>fr.addIssue({code:ZodIssueCode.custom,...lr(dr)});return typeof Promise<"u"&&hr instanceof Promise?hr.then(gr=>gr?!0:(mr(),!1)):hr?!0:(mr(),!1)})}refinement(rr,ir){return this._refinement((lr,dr)=>rr(lr)?!0:(dr.addIssue(typeof ir=="function"?ir(lr,dr):ir),!1))}_refinement(rr){return new ZodEffects({schema:this,typeName:ZodFirstPartyTypeKind.ZodEffects,effect:{type:"refinement",refinement:rr}})}superRefine(rr){return this._refinement(rr)}constructor(rr){this.spa=this.safeParseAsync,this._def=rr,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:ir=>this["~validate"](ir)}}optional(){return ZodOptional.create(this,this._def)}nullable(){return ZodNullable.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ZodArray.create(this)}promise(){return ZodPromise.create(this,this._def)}or(rr){return ZodUnion.create([this,rr],this._def)}and(rr){return ZodIntersection.create(this,rr,this._def)}transform(rr){return new ZodEffects({...processCreateParams(this._def),schema:this,typeName:ZodFirstPartyTypeKind.ZodEffects,effect:{type:"transform",transform:rr}})}default(rr){const ir=typeof rr=="function"?rr:()=>rr;return new ZodDefault({...processCreateParams(this._def),innerType:this,defaultValue:ir,typeName:ZodFirstPartyTypeKind.ZodDefault})}brand(){return new ZodBranded({typeName:ZodFirstPartyTypeKind.ZodBranded,type:this,...processCreateParams(this._def)})}catch(rr){const ir=typeof rr=="function"?rr:()=>rr;return new ZodCatch({...processCreateParams(this._def),innerType:this,catchValue:ir,typeName:ZodFirstPartyTypeKind.ZodCatch})}describe(rr){const ir=this.constructor;return new ir({...this._def,description:rr})}pipe(rr){return ZodPipeline.create(this,rr)}readonly(){return ZodReadonly.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const cuidRegex=/^c[^\s-]{8,}$/i,cuid2Regex=/^[0-9a-z]+$/,ulidRegex=/^[0-9A-HJKMNP-TV-Z]{26}$/i,uuidRegex=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,nanoidRegex=/^[a-z0-9_-]{21}$/i,jwtRegex=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,durationRegex=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,emailRegex=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,_emojiRegex="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let emojiRegex;const ipv4Regex=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv4CidrRegex=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ipv6Regex=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,ipv6CidrRegex=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64Regex$1=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64urlRegex=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,dateRegexSource="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",dateRegex=new RegExp(`^${dateRegexSource}$`);function timeRegexSource(tr){let rr="[0-5]\\d";tr.precision?rr=`${rr}\\.\\d{${tr.precision}}`:tr.precision==null&&(rr=`${rr}(\\.\\d+)?`);const ir=tr.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${rr})${ir}`}function timeRegex(tr){return new RegExp(`^${timeRegexSource(tr)}$`)}function datetimeRegex(tr){let rr=`${dateRegexSource}T${timeRegexSource(tr)}`;const ir=[];return ir.push(tr.local?"Z?":"Z"),tr.offset&&ir.push("([+-]\\d{2}:?\\d{2})"),rr=`${rr}(${ir.join("|")})`,new RegExp(`^${rr}$`)}function isValidIP(tr,rr){return!!((rr==="v4"||!rr)&&ipv4Regex.test(tr)||(rr==="v6"||!rr)&&ipv6Regex.test(tr))}function isValidJWT(tr,rr){if(!jwtRegex.test(tr))return!1;try{const[ir]=tr.split(".");if(!ir)return!1;const lr=ir.replace(/-/g,"+").replace(/_/g,"/").padEnd(ir.length+(4-ir.length%4)%4,"="),dr=JSON.parse(atob(lr));return!(typeof dr!="object"||dr===null||"typ"in dr&&(dr==null?void 0:dr.typ)!=="JWT"||!dr.alg||rr&&dr.alg!==rr)}catch{return!1}}function isValidCidr(tr,rr){return!!((rr==="v4"||!rr)&&ipv4CidrRegex.test(tr)||(rr==="v6"||!rr)&&ipv6CidrRegex.test(tr))}class ZodString extends ZodType{_parse(rr){if(this._def.coerce&&(rr.data=String(rr.data)),this._getType(rr)!==ZodParsedType.string){const fr=this._getOrReturnCtx(rr);return addIssueToContext(fr,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.string,received:fr.parsedType}),INVALID$3}const lr=new ParseStatus;let dr;for(const fr of this._def.checks)if(fr.kind==="min")rr.data.length<fr.value&&(dr=this._getOrReturnCtx(rr,dr),addIssueToContext(dr,{code:ZodIssueCode.too_small,minimum:fr.value,type:"string",inclusive:!0,exact:!1,message:fr.message}),lr.dirty());else if(fr.kind==="max")rr.data.length>fr.value&&(dr=this._getOrReturnCtx(rr,dr),addIssueToContext(dr,{code:ZodIssueCode.too_big,maximum:fr.value,type:"string",inclusive:!0,exact:!1,message:fr.message}),lr.dirty());else if(fr.kind==="length"){const hr=rr.data.length>fr.value,mr=rr.data.length<fr.value;(hr||mr)&&(dr=this._getOrReturnCtx(rr,dr),hr?addIssueToContext(dr,{code:ZodIssueCode.too_big,maximum:fr.value,type:"string",inclusive:!0,exact:!0,message:fr.message}):mr&&addIssueToContext(dr,{code:ZodIssueCode.too_small,minimum:fr.value,type:"string",inclusive:!0,exact:!0,message:fr.message}),lr.dirty())}else if(fr.kind==="email")emailRegex.test(rr.data)||(dr=this._getOrReturnCtx(rr,dr),addIssueToContext(dr,{validation:"email",code:ZodIssueCode.invalid_string,message:fr.message}),lr.dirty());else if(fr.kind==="emoji")emojiRegex||(emojiRegex=new RegExp(_emojiRegex,"u")),emojiRegex.test(rr.data)||(dr=this._getOrReturnCtx(rr,dr),addIssueToContext(dr,{validation:"emoji",code:ZodIssueCode.invalid_string,message:fr.message}),lr.dirty());else if(fr.kind==="uuid")uuidRegex.test(rr.data)||(dr=this._getOrReturnCtx(rr,dr),addIssueToContext(dr,{validation:"uuid",code:ZodIssueCode.invalid_string,message:fr.message}),lr.dirty());else if(fr.kind==="nanoid")nanoidRegex.test(rr.data)||(dr=this._getOrReturnCtx(rr,dr),addIssueToContext(dr,{validation:"nanoid",code:ZodIssueCode.invalid_string,message:fr.message}),lr.dirty());else if(fr.kind==="cuid")cuidRegex.test(rr.data)||(dr=this._getOrReturnCtx(rr,dr),addIssueToContext(dr,{validation:"cuid",code:ZodIssueCode.invalid_string,message:fr.message}),lr.dirty());else if(fr.kind==="cuid2")cuid2Regex.test(rr.data)||(dr=this._getOrReturnCtx(rr,dr),addIssueToContext(dr,{validation:"cuid2",code:ZodIssueCode.invalid_string,message:fr.message}),lr.dirty());else if(fr.kind==="ulid")ulidRegex.test(rr.data)||(dr=this._getOrReturnCtx(rr,dr),addIssueToContext(dr,{validation:"ulid",code:ZodIssueCode.invalid_string,message:fr.message}),lr.dirty());else if(fr.kind==="url")try{new URL(rr.data)}catch{dr=this._getOrReturnCtx(rr,dr),addIssueToContext(dr,{validation:"url",code:ZodIssueCode.invalid_string,message:fr.message}),lr.dirty()}else fr.kind==="regex"?(fr.regex.lastIndex=0,fr.regex.test(rr.data)||(dr=this._getOrReturnCtx(rr,dr),addIssueToContext(dr,{validation:"regex",code:ZodIssueCode.invalid_string,message:fr.message}),lr.dirty())):fr.kind==="trim"?rr.data=rr.data.trim():fr.kind==="includes"?rr.data.includes(fr.value,fr.position)||(dr=this._getOrReturnCtx(rr,dr),addIssueToContext(dr,{code:ZodIssueCode.invalid_string,validation:{includes:fr.value,position:fr.position},message:fr.message}),lr.dirty()):fr.kind==="toLowerCase"?rr.data=rr.data.toLowerCase():fr.kind==="toUpperCase"?rr.data=rr.data.toUpperCase():fr.kind==="startsWith"?rr.data.startsWith(fr.value)||(dr=this._getOrReturnCtx(rr,dr),addIssueToContext(dr,{code:ZodIssueCode.invalid_string,validation:{startsWith:fr.value},message:fr.message}),lr.dirty()):fr.kind==="endsWith"?rr.data.endsWith(fr.value)||(dr=this._getOrReturnCtx(rr,dr),addIssueToContext(dr,{code:ZodIssueCode.invalid_string,validation:{endsWith:fr.value},message:fr.message}),lr.dirty()):fr.kind==="datetime"?datetimeRegex(fr).test(rr.data)||(dr=this._getOrReturnCtx(rr,dr),addIssueToContext(dr,{code:ZodIssueCode.invalid_string,validation:"datetime",message:fr.message}),lr.dirty()):fr.kind==="date"?dateRegex.test(rr.data)||(dr=this._getOrReturnCtx(rr,dr),addIssueToContext(dr,{code:ZodIssueCode.invalid_string,validation:"date",message:fr.message}),lr.dirty()):fr.kind==="time"?timeRegex(fr).test(rr.data)||(dr=this._getOrReturnCtx(rr,dr),addIssueToContext(dr,{code:ZodIssueCode.invalid_string,validation:"time",message:fr.message}),lr.dirty()):fr.kind==="duration"?durationRegex.test(rr.data)||(dr=this._getOrReturnCtx(rr,dr),addIssueToContext(dr,{validation:"duration",code:ZodIssueCode.invalid_string,message:fr.message}),lr.dirty()):fr.kind==="ip"?isValidIP(rr.data,fr.version)||(dr=this._getOrReturnCtx(rr,dr),addIssueToContext(dr,{validation:"ip",code:ZodIssueCode.invalid_string,message:fr.message}),lr.dirty()):fr.kind==="jwt"?isValidJWT(rr.data,fr.alg)||(dr=this._getOrReturnCtx(rr,dr),addIssueToContext(dr,{validation:"jwt",code:ZodIssueCode.invalid_string,message:fr.message}),lr.dirty()):fr.kind==="cidr"?isValidCidr(rr.data,fr.version)||(dr=this._getOrReturnCtx(rr,dr),addIssueToContext(dr,{validation:"cidr",code:ZodIssueCode.invalid_string,message:fr.message}),lr.dirty()):fr.kind==="base64"?base64Regex$1.test(rr.data)||(dr=this._getOrReturnCtx(rr,dr),addIssueToContext(dr,{validation:"base64",code:ZodIssueCode.invalid_string,message:fr.message}),lr.dirty()):fr.kind==="base64url"?base64urlRegex.test(rr.data)||(dr=this._getOrReturnCtx(rr,dr),addIssueToContext(dr,{validation:"base64url",code:ZodIssueCode.invalid_string,message:fr.message}),lr.dirty()):util$4.assertNever(fr);return{status:lr.value,value:rr.data}}_regex(rr,ir,lr){return this.refinement(dr=>rr.test(dr),{validation:ir,code:ZodIssueCode.invalid_string,...errorUtil.errToObj(lr)})}_addCheck(rr){return new ZodString({...this._def,checks:[...this._def.checks,rr]})}email(rr){return this._addCheck({kind:"email",...errorUtil.errToObj(rr)})}url(rr){return this._addCheck({kind:"url",...errorUtil.errToObj(rr)})}emoji(rr){return this._addCheck({kind:"emoji",...errorUtil.errToObj(rr)})}uuid(rr){return this._addCheck({kind:"uuid",...errorUtil.errToObj(rr)})}nanoid(rr){return this._addCheck({kind:"nanoid",...errorUtil.errToObj(rr)})}cuid(rr){return this._addCheck({kind:"cuid",...errorUtil.errToObj(rr)})}cuid2(rr){return this._addCheck({kind:"cuid2",...errorUtil.errToObj(rr)})}ulid(rr){return this._addCheck({kind:"ulid",...errorUtil.errToObj(rr)})}base64(rr){return this._addCheck({kind:"base64",...errorUtil.errToObj(rr)})}base64url(rr){return this._addCheck({kind:"base64url",...errorUtil.errToObj(rr)})}jwt(rr){return this._addCheck({kind:"jwt",...errorUtil.errToObj(rr)})}ip(rr){return this._addCheck({kind:"ip",...errorUtil.errToObj(rr)})}cidr(rr){return this._addCheck({kind:"cidr",...errorUtil.errToObj(rr)})}datetime(rr){return typeof rr=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:rr}):this._addCheck({kind:"datetime",precision:typeof(rr==null?void 0:rr.precision)>"u"?null:rr==null?void 0:rr.precision,offset:(rr==null?void 0:rr.offset)??!1,local:(rr==null?void 0:rr.local)??!1,...errorUtil.errToObj(rr==null?void 0:rr.message)})}date(rr){return this._addCheck({kind:"date",message:rr})}time(rr){return typeof rr=="string"?this._addCheck({kind:"time",precision:null,message:rr}):this._addCheck({kind:"time",precision:typeof(rr==null?void 0:rr.precision)>"u"?null:rr==null?void 0:rr.precision,...errorUtil.errToObj(rr==null?void 0:rr.message)})}duration(rr){return this._addCheck({kind:"duration",...errorUtil.errToObj(rr)})}regex(rr,ir){return this._addCheck({kind:"regex",regex:rr,...errorUtil.errToObj(ir)})}includes(rr,ir){return this._addCheck({kind:"includes",value:rr,position:ir==null?void 0:ir.position,...errorUtil.errToObj(ir==null?void 0:ir.message)})}startsWith(rr,ir){return this._addCheck({kind:"startsWith",value:rr,...errorUtil.errToObj(ir)})}endsWith(rr,ir){return this._addCheck({kind:"endsWith",value:rr,...errorUtil.errToObj(ir)})}min(rr,ir){return this._addCheck({kind:"min",value:rr,...errorUtil.errToObj(ir)})}max(rr,ir){return this._addCheck({kind:"max",value:rr,...errorUtil.errToObj(ir)})}length(rr,ir){return this._addCheck({kind:"length",value:rr,...errorUtil.errToObj(ir)})}nonempty(rr){return this.min(1,errorUtil.errToObj(rr))}trim(){return new ZodString({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new ZodString({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new ZodString({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(rr=>rr.kind==="datetime")}get isDate(){return!!this._def.checks.find(rr=>rr.kind==="date")}get isTime(){return!!this._def.checks.find(rr=>rr.kind==="time")}get isDuration(){return!!this._def.checks.find(rr=>rr.kind==="duration")}get isEmail(){return!!this._def.checks.find(rr=>rr.kind==="email")}get isURL(){return!!this._def.checks.find(rr=>rr.kind==="url")}get isEmoji(){return!!this._def.checks.find(rr=>rr.kind==="emoji")}get isUUID(){return!!this._def.checks.find(rr=>rr.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(rr=>rr.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(rr=>rr.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(rr=>rr.kind==="cuid2")}get isULID(){return!!this._def.checks.find(rr=>rr.kind==="ulid")}get isIP(){return!!this._def.checks.find(rr=>rr.kind==="ip")}get isCIDR(){return!!this._def.checks.find(rr=>rr.kind==="cidr")}get isBase64(){return!!this._def.checks.find(rr=>rr.kind==="base64")}get isBase64url(){return!!this._def.checks.find(rr=>rr.kind==="base64url")}get minLength(){let rr=null;for(const ir of this._def.checks)ir.kind==="min"&&(rr===null||ir.value>rr)&&(rr=ir.value);return rr}get maxLength(){let rr=null;for(const ir of this._def.checks)ir.kind==="max"&&(rr===null||ir.value<rr)&&(rr=ir.value);return rr}}ZodString.create=tr=>new ZodString({checks:[],typeName:ZodFirstPartyTypeKind.ZodString,coerce:(tr==null?void 0:tr.coerce)??!1,...processCreateParams(tr)});function floatSafeRemainder(tr,rr){const ir=(tr.toString().split(".")[1]||"").length,lr=(rr.toString().split(".")[1]||"").length,dr=ir>lr?ir:lr,fr=Number.parseInt(tr.toFixed(dr).replace(".","")),hr=Number.parseInt(rr.toFixed(dr).replace(".",""));return fr%hr/10**dr}class ZodNumber extends ZodType{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(rr){if(this._def.coerce&&(rr.data=Number(rr.data)),this._getType(rr)!==ZodParsedType.number){const fr=this._getOrReturnCtx(rr);return addIssueToContext(fr,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.number,received:fr.parsedType}),INVALID$3}let lr;const dr=new ParseStatus;for(const fr of this._def.checks)fr.kind==="int"?util$4.isInteger(rr.data)||(lr=this._getOrReturnCtx(rr,lr),addIssueToContext(lr,{code:ZodIssueCode.invalid_type,expected:"integer",received:"float",message:fr.message}),dr.dirty()):fr.kind==="min"?(fr.inclusive?rr.data<fr.value:rr.data<=fr.value)&&(lr=this._getOrReturnCtx(rr,lr),addIssueToContext(lr,{code:ZodIssueCode.too_small,minimum:fr.value,type:"number",inclusive:fr.inclusive,exact:!1,message:fr.message}),dr.dirty()):fr.kind==="max"?(fr.inclusive?rr.data>fr.value:rr.data>=fr.value)&&(lr=this._getOrReturnCtx(rr,lr),addIssueToContext(lr,{code:ZodIssueCode.too_big,maximum:fr.value,type:"number",inclusive:fr.inclusive,exact:!1,message:fr.message}),dr.dirty()):fr.kind==="multipleOf"?floatSafeRemainder(rr.data,fr.value)!==0&&(lr=this._getOrReturnCtx(rr,lr),addIssueToContext(lr,{code:ZodIssueCode.not_multiple_of,multipleOf:fr.value,message:fr.message}),dr.dirty()):fr.kind==="finite"?Number.isFinite(rr.data)||(lr=this._getOrReturnCtx(rr,lr),addIssueToContext(lr,{code:ZodIssueCode.not_finite,message:fr.message}),dr.dirty()):util$4.assertNever(fr);return{status:dr.value,value:rr.data}}gte(rr,ir){return this.setLimit("min",rr,!0,errorUtil.toString(ir))}gt(rr,ir){return this.setLimit("min",rr,!1,errorUtil.toString(ir))}lte(rr,ir){return this.setLimit("max",rr,!0,errorUtil.toString(ir))}lt(rr,ir){return this.setLimit("max",rr,!1,errorUtil.toString(ir))}setLimit(rr,ir,lr,dr){return new ZodNumber({...this._def,checks:[...this._def.checks,{kind:rr,value:ir,inclusive:lr,message:errorUtil.toString(dr)}]})}_addCheck(rr){return new ZodNumber({...this._def,checks:[...this._def.checks,rr]})}int(rr){return this._addCheck({kind:"int",message:errorUtil.toString(rr)})}positive(rr){return this._addCheck({kind:"min",value:0,inclusive:!1,message:errorUtil.toString(rr)})}negative(rr){return this._addCheck({kind:"max",value:0,inclusive:!1,message:errorUtil.toString(rr)})}nonpositive(rr){return this._addCheck({kind:"max",value:0,inclusive:!0,message:errorUtil.toString(rr)})}nonnegative(rr){return this._addCheck({kind:"min",value:0,inclusive:!0,message:errorUtil.toString(rr)})}multipleOf(rr,ir){return this._addCheck({kind:"multipleOf",value:rr,message:errorUtil.toString(ir)})}finite(rr){return this._addCheck({kind:"finite",message:errorUtil.toString(rr)})}safe(rr){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:errorUtil.toString(rr)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:errorUtil.toString(rr)})}get minValue(){let rr=null;for(const ir of this._def.checks)ir.kind==="min"&&(rr===null||ir.value>rr)&&(rr=ir.value);return rr}get maxValue(){let rr=null;for(const ir of this._def.checks)ir.kind==="max"&&(rr===null||ir.value<rr)&&(rr=ir.value);return rr}get isInt(){return!!this._def.checks.find(rr=>rr.kind==="int"||rr.kind==="multipleOf"&&util$4.isInteger(rr.value))}get isFinite(){let rr=null,ir=null;for(const lr of this._def.checks){if(lr.kind==="finite"||lr.kind==="int"||lr.kind==="multipleOf")return!0;lr.kind==="min"?(ir===null||lr.value>ir)&&(ir=lr.value):lr.kind==="max"&&(rr===null||lr.value<rr)&&(rr=lr.value)}return Number.isFinite(ir)&&Number.isFinite(rr)}}ZodNumber.create=tr=>new ZodNumber({checks:[],typeName:ZodFirstPartyTypeKind.ZodNumber,coerce:(tr==null?void 0:tr.coerce)||!1,...processCreateParams(tr)});class ZodBigInt extends ZodType{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(rr){if(this._def.coerce)try{rr.data=BigInt(rr.data)}catch{return this._getInvalidInput(rr)}if(this._getType(rr)!==ZodParsedType.bigint)return this._getInvalidInput(rr);let lr;const dr=new ParseStatus;for(const fr of this._def.checks)fr.kind==="min"?(fr.inclusive?rr.data<fr.value:rr.data<=fr.value)&&(lr=this._getOrReturnCtx(rr,lr),addIssueToContext(lr,{code:ZodIssueCode.too_small,type:"bigint",minimum:fr.value,inclusive:fr.inclusive,message:fr.message}),dr.dirty()):fr.kind==="max"?(fr.inclusive?rr.data>fr.value:rr.data>=fr.value)&&(lr=this._getOrReturnCtx(rr,lr),addIssueToContext(lr,{code:ZodIssueCode.too_big,type:"bigint",maximum:fr.value,inclusive:fr.inclusive,message:fr.message}),dr.dirty()):fr.kind==="multipleOf"?rr.data%fr.value!==BigInt(0)&&(lr=this._getOrReturnCtx(rr,lr),addIssueToContext(lr,{code:ZodIssueCode.not_multiple_of,multipleOf:fr.value,message:fr.message}),dr.dirty()):util$4.assertNever(fr);return{status:dr.value,value:rr.data}}_getInvalidInput(rr){const ir=this._getOrReturnCtx(rr);return addIssueToContext(ir,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.bigint,received:ir.parsedType}),INVALID$3}gte(rr,ir){return this.setLimit("min",rr,!0,errorUtil.toString(ir))}gt(rr,ir){return this.setLimit("min",rr,!1,errorUtil.toString(ir))}lte(rr,ir){return this.setLimit("max",rr,!0,errorUtil.toString(ir))}lt(rr,ir){return this.setLimit("max",rr,!1,errorUtil.toString(ir))}setLimit(rr,ir,lr,dr){return new ZodBigInt({...this._def,checks:[...this._def.checks,{kind:rr,value:ir,inclusive:lr,message:errorUtil.toString(dr)}]})}_addCheck(rr){return new ZodBigInt({...this._def,checks:[...this._def.checks,rr]})}positive(rr){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:errorUtil.toString(rr)})}negative(rr){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:errorUtil.toString(rr)})}nonpositive(rr){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:errorUtil.toString(rr)})}nonnegative(rr){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:errorUtil.toString(rr)})}multipleOf(rr,ir){return this._addCheck({kind:"multipleOf",value:rr,message:errorUtil.toString(ir)})}get minValue(){let rr=null;for(const ir of this._def.checks)ir.kind==="min"&&(rr===null||ir.value>rr)&&(rr=ir.value);return rr}get maxValue(){let rr=null;for(const ir of this._def.checks)ir.kind==="max"&&(rr===null||ir.value<rr)&&(rr=ir.value);return rr}}ZodBigInt.create=tr=>new ZodBigInt({checks:[],typeName:ZodFirstPartyTypeKind.ZodBigInt,coerce:(tr==null?void 0:tr.coerce)??!1,...processCreateParams(tr)});class ZodBoolean extends ZodType{_parse(rr){if(this._def.coerce&&(rr.data=!!rr.data),this._getType(rr)!==ZodParsedType.boolean){const lr=this._getOrReturnCtx(rr);return addIssueToContext(lr,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.boolean,received:lr.parsedType}),INVALID$3}return OK(rr.data)}}ZodBoolean.create=tr=>new ZodBoolean({typeName:ZodFirstPartyTypeKind.ZodBoolean,coerce:(tr==null?void 0:tr.coerce)||!1,...processCreateParams(tr)});class ZodDate extends ZodType{_parse(rr){if(this._def.coerce&&(rr.data=new Date(rr.data)),this._getType(rr)!==ZodParsedType.date){const fr=this._getOrReturnCtx(rr);return addIssueToContext(fr,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.date,received:fr.parsedType}),INVALID$3}if(Number.isNaN(rr.data.getTime())){const fr=this._getOrReturnCtx(rr);return addIssueToContext(fr,{code:ZodIssueCode.invalid_date}),INVALID$3}const lr=new ParseStatus;let dr;for(const fr of this._def.checks)fr.kind==="min"?rr.data.getTime()<fr.value&&(dr=this._getOrReturnCtx(rr,dr),addIssueToContext(dr,{code:ZodIssueCode.too_small,message:fr.message,inclusive:!0,exact:!1,minimum:fr.value,type:"date"}),lr.dirty()):fr.kind==="max"?rr.data.getTime()>fr.value&&(dr=this._getOrReturnCtx(rr,dr),addIssueToContext(dr,{code:ZodIssueCode.too_big,message:fr.message,inclusive:!0,exact:!1,maximum:fr.value,type:"date"}),lr.dirty()):util$4.assertNever(fr);return{status:lr.value,value:new Date(rr.data.getTime())}}_addCheck(rr){return new ZodDate({...this._def,checks:[...this._def.checks,rr]})}min(rr,ir){return this._addCheck({kind:"min",value:rr.getTime(),message:errorUtil.toString(ir)})}max(rr,ir){return this._addCheck({kind:"max",value:rr.getTime(),message:errorUtil.toString(ir)})}get minDate(){let rr=null;for(const ir of this._def.checks)ir.kind==="min"&&(rr===null||ir.value>rr)&&(rr=ir.value);return rr!=null?new Date(rr):null}get maxDate(){let rr=null;for(const ir of this._def.checks)ir.kind==="max"&&(rr===null||ir.value<rr)&&(rr=ir.value);return rr!=null?new Date(rr):null}}ZodDate.create=tr=>new ZodDate({checks:[],coerce:(tr==null?void 0:tr.coerce)||!1,typeName:ZodFirstPartyTypeKind.ZodDate,...processCreateParams(tr)});class ZodSymbol extends ZodType{_parse(rr){if(this._getType(rr)!==ZodParsedType.symbol){const lr=this._getOrReturnCtx(rr);return addIssueToContext(lr,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.symbol,received:lr.parsedType}),INVALID$3}return OK(rr.data)}}ZodSymbol.create=tr=>new ZodSymbol({typeName:ZodFirstPartyTypeKind.ZodSymbol,...processCreateParams(tr)});class ZodUndefined extends ZodType{_parse(rr){if(this._getType(rr)!==ZodParsedType.undefined){const lr=this._getOrReturnCtx(rr);return addIssueToContext(lr,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.undefined,received:lr.parsedType}),INVALID$3}return OK(rr.data)}}ZodUndefined.create=tr=>new ZodUndefined({typeName:ZodFirstPartyTypeKind.ZodUndefined,...processCreateParams(tr)});class ZodNull extends ZodType{_parse(rr){if(this._getType(rr)!==ZodParsedType.null){const lr=this._getOrReturnCtx(rr);return addIssueToContext(lr,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.null,received:lr.parsedType}),INVALID$3}return OK(rr.data)}}ZodNull.create=tr=>new ZodNull({typeName:ZodFirstPartyTypeKind.ZodNull,...processCreateParams(tr)});class ZodAny extends ZodType{constructor(){super(...arguments),this._any=!0}_parse(rr){return OK(rr.data)}}ZodAny.create=tr=>new ZodAny({typeName:ZodFirstPartyTypeKind.ZodAny,...processCreateParams(tr)});class ZodUnknown extends ZodType{constructor(){super(...arguments),this._unknown=!0}_parse(rr){return OK(rr.data)}}ZodUnknown.create=tr=>new ZodUnknown({typeName:ZodFirstPartyTypeKind.ZodUnknown,...processCreateParams(tr)});class ZodNever extends ZodType{_parse(rr){const ir=this._getOrReturnCtx(rr);return addIssueToContext(ir,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.never,received:ir.parsedType}),INVALID$3}}ZodNever.create=tr=>new ZodNever({typeName:ZodFirstPartyTypeKind.ZodNever,...processCreateParams(tr)});class ZodVoid extends ZodType{_parse(rr){if(this._getType(rr)!==ZodParsedType.undefined){const lr=this._getOrReturnCtx(rr);return addIssueToContext(lr,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.void,received:lr.parsedType}),INVALID$3}return OK(rr.data)}}ZodVoid.create=tr=>new ZodVoid({typeName:ZodFirstPartyTypeKind.ZodVoid,...processCreateParams(tr)});class ZodArray extends ZodType{_parse(rr){const{ctx:ir,status:lr}=this._processInputParams(rr),dr=this._def;if(ir.parsedType!==ZodParsedType.array)return addIssueToContext(ir,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.array,received:ir.parsedType}),INVALID$3;if(dr.exactLength!==null){const hr=ir.data.length>dr.exactLength.value,mr=ir.data.length<dr.exactLength.value;(hr||mr)&&(addIssueToContext(ir,{code:hr?ZodIssueCode.too_big:ZodIssueCode.too_small,minimum:mr?dr.exactLength.value:void 0,maximum:hr?dr.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:dr.exactLength.message}),lr.dirty())}if(dr.minLength!==null&&ir.data.length<dr.minLength.value&&(addIssueToContext(ir,{code:ZodIssueCode.too_small,minimum:dr.minLength.value,type:"array",inclusive:!0,exact:!1,message:dr.minLength.message}),lr.dirty()),dr.maxLength!==null&&ir.data.length>dr.maxLength.value&&(addIssueToContext(ir,{code:ZodIssueCode.too_big,maximum:dr.maxLength.value,type:"array",inclusive:!0,exact:!1,message:dr.maxLength.message}),lr.dirty()),ir.common.async)return Promise.all([...ir.data].map((hr,mr)=>dr.type._parseAsync(new ParseInputLazyPath(ir,hr,ir.path,mr)))).then(hr=>ParseStatus.mergeArray(lr,hr));const fr=[...ir.data].map((hr,mr)=>dr.type._parseSync(new ParseInputLazyPath(ir,hr,ir.path,mr)));return ParseStatus.mergeArray(lr,fr)}get element(){return this._def.type}min(rr,ir){return new ZodArray({...this._def,minLength:{value:rr,message:errorUtil.toString(ir)}})}max(rr,ir){return new ZodArray({...this._def,maxLength:{value:rr,message:errorUtil.toString(ir)}})}length(rr,ir){return new ZodArray({...this._def,exactLength:{value:rr,message:errorUtil.toString(ir)}})}nonempty(rr){return this.min(1,rr)}}ZodArray.create=(tr,rr)=>new ZodArray({type:tr,minLength:null,maxLength:null,exactLength:null,typeName:ZodFirstPartyTypeKind.ZodArray,...processCreateParams(rr)});function deepPartialify(tr){if(tr instanceof ZodObject){const rr={};for(const ir in tr.shape){const lr=tr.shape[ir];rr[ir]=ZodOptional.create(deepPartialify(lr))}return new ZodObject({...tr._def,shape:()=>rr})}else return tr instanceof ZodArray?new ZodArray({...tr._def,type:deepPartialify(tr.element)}):tr instanceof ZodOptional?ZodOptional.create(deepPartialify(tr.unwrap())):tr instanceof ZodNullable?ZodNullable.create(deepPartialify(tr.unwrap())):tr instanceof ZodTuple?ZodTuple.create(tr.items.map(rr=>deepPartialify(rr))):tr}class ZodObject extends ZodType{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const rr=this._def.shape(),ir=util$4.objectKeys(rr);return this._cached={shape:rr,keys:ir},this._cached}_parse(rr){if(this._getType(rr)!==ZodParsedType.object){const yr=this._getOrReturnCtx(rr);return addIssueToContext(yr,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.object,received:yr.parsedType}),INVALID$3}const{status:lr,ctx:dr}=this._processInputParams(rr),{shape:fr,keys:hr}=this._getCached(),mr=[];if(!(this._def.catchall instanceof ZodNever&&this._def.unknownKeys==="strip"))for(const yr in dr.data)hr.includes(yr)||mr.push(yr);const gr=[];for(const yr of hr){const _r=fr[yr],br=dr.data[yr];gr.push({key:{status:"valid",value:yr},value:_r._parse(new ParseInputLazyPath(dr,br,dr.path,yr)),alwaysSet:yr in dr.data})}if(this._def.catchall instanceof ZodNever){const yr=this._def.unknownKeys;if(yr==="passthrough")for(const _r of mr)gr.push({key:{status:"valid",value:_r},value:{status:"valid",value:dr.data[_r]}});else if(yr==="strict")mr.length>0&&(addIssueToContext(dr,{code:ZodIssueCode.unrecognized_keys,keys:mr}),lr.dirty());else if(yr!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const yr=this._def.catchall;for(const _r of mr){const br=dr.data[_r];gr.push({key:{status:"valid",value:_r},value:yr._parse(new ParseInputLazyPath(dr,br,dr.path,_r)),alwaysSet:_r in dr.data})}}return dr.common.async?Promise.resolve().then(async()=>{const yr=[];for(const _r of gr){const br=await _r.key,vr=await _r.value;yr.push({key:br,value:vr,alwaysSet:_r.alwaysSet})}return yr}).then(yr=>ParseStatus.mergeObjectSync(lr,yr)):ParseStatus.mergeObjectSync(lr,gr)}get shape(){return this._def.shape()}strict(rr){return new ZodObject({...this._def,unknownKeys:"strict",...rr!==void 0?{errorMap:(ir,lr)=>{var fr,hr;const dr=((hr=(fr=this._def).errorMap)==null?void 0:hr.call(fr,ir,lr).message)??lr.defaultError;return ir.code==="unrecognized_keys"?{message:errorUtil.errToObj(rr).message??dr}:{message:dr}}}:{}})}strip(){return new ZodObject({...this._def,unknownKeys:"strip"})}passthrough(){return new ZodObject({...this._def,unknownKeys:"passthrough"})}extend(rr){return new ZodObject({...this._def,shape:()=>({...this._def.shape(),...rr})})}merge(rr){return new ZodObject({unknownKeys:rr._def.unknownKeys,catchall:rr._def.catchall,shape:()=>({...this._def.shape(),...rr._def.shape()}),typeName:ZodFirstPartyTypeKind.ZodObject})}setKey(rr,ir){return this.augment({[rr]:ir})}catchall(rr){return new ZodObject({...this._def,catchall:rr})}pick(rr){const ir={};for(const lr of util$4.objectKeys(rr))rr[lr]&&this.shape[lr]&&(ir[lr]=this.shape[lr]);return new ZodObject({...this._def,shape:()=>ir})}omit(rr){const ir={};for(const lr of util$4.objectKeys(this.shape))rr[lr]||(ir[lr]=this.shape[lr]);return new ZodObject({...this._def,shape:()=>ir})}deepPartial(){return deepPartialify(this)}partial(rr){const ir={};for(const lr of util$4.objectKeys(this.shape)){const dr=this.shape[lr];rr&&!rr[lr]?ir[lr]=dr:ir[lr]=dr.optional()}return new ZodObject({...this._def,shape:()=>ir})}required(rr){const ir={};for(const lr of util$4.objectKeys(this.shape))if(rr&&!rr[lr])ir[lr]=this.shape[lr];else{let fr=this.shape[lr];for(;fr instanceof ZodOptional;)fr=fr._def.innerType;ir[lr]=fr}return new ZodObject({...this._def,shape:()=>ir})}keyof(){return createZodEnum(util$4.objectKeys(this.shape))}}ZodObject.create=(tr,rr)=>new ZodObject({shape:()=>tr,unknownKeys:"strip",catchall:ZodNever.create(),typeName:ZodFirstPartyTypeKind.ZodObject,...processCreateParams(rr)});ZodObject.strictCreate=(tr,rr)=>new ZodObject({shape:()=>tr,unknownKeys:"strict",catchall:ZodNever.create(),typeName:ZodFirstPartyTypeKind.ZodObject,...processCreateParams(rr)});ZodObject.lazycreate=(tr,rr)=>new ZodObject({shape:tr,unknownKeys:"strip",catchall:ZodNever.create(),typeName:ZodFirstPartyTypeKind.ZodObject,...processCreateParams(rr)});class ZodUnion extends ZodType{_parse(rr){const{ctx:ir}=this._processInputParams(rr),lr=this._def.options;function dr(fr){for(const mr of fr)if(mr.result.status==="valid")return mr.result;for(const mr of fr)if(mr.result.status==="dirty")return ir.common.issues.push(...mr.ctx.common.issues),mr.result;const hr=fr.map(mr=>new ZodError(mr.ctx.common.issues));return addIssueToContext(ir,{code:ZodIssueCode.invalid_union,unionErrors:hr}),INVALID$3}if(ir.common.async)return Promise.all(lr.map(async fr=>{const hr={...ir,common:{...ir.common,issues:[]},parent:null};return{result:await fr._parseAsync({data:ir.data,path:ir.path,parent:hr}),ctx:hr}})).then(dr);{let fr;const hr=[];for(const gr of lr){const yr={...ir,common:{...ir.common,issues:[]},parent:null},_r=gr._parseSync({data:ir.data,path:ir.path,parent:yr});if(_r.status==="valid")return _r;_r.status==="dirty"&&!fr&&(fr={result:_r,ctx:yr}),yr.common.issues.length&&hr.push(yr.common.issues)}if(fr)return ir.common.issues.push(...fr.ctx.common.issues),fr.result;const mr=hr.map(gr=>new ZodError(gr));return addIssueToContext(ir,{code:ZodIssueCode.invalid_union,unionErrors:mr}),INVALID$3}}get options(){return this._def.options}}ZodUnion.create=(tr,rr)=>new ZodUnion({options:tr,typeName:ZodFirstPartyTypeKind.ZodUnion,...processCreateParams(rr)});function mergeValues(tr,rr){const ir=getParsedType(tr),lr=getParsedType(rr);if(tr===rr)return{valid:!0,data:tr};if(ir===ZodParsedType.object&&lr===ZodParsedType.object){const dr=util$4.objectKeys(rr),fr=util$4.objectKeys(tr).filter(mr=>dr.indexOf(mr)!==-1),hr={...tr,...rr};for(const mr of fr){const gr=mergeValues(tr[mr],rr[mr]);if(!gr.valid)return{valid:!1};hr[mr]=gr.data}return{valid:!0,data:hr}}else if(ir===ZodParsedType.array&&lr===ZodParsedType.array){if(tr.length!==rr.length)return{valid:!1};const dr=[];for(let fr=0;fr<tr.length;fr++){const hr=tr[fr],mr=rr[fr],gr=mergeValues(hr,mr);if(!gr.valid)return{valid:!1};dr.push(gr.data)}return{valid:!0,data:dr}}else return ir===ZodParsedType.date&&lr===ZodParsedType.date&&+tr==+rr?{valid:!0,data:tr}:{valid:!1}}class ZodIntersection extends ZodType{_parse(rr){const{status:ir,ctx:lr}=this._processInputParams(rr),dr=(fr,hr)=>{if(isAborted(fr)||isAborted(hr))return INVALID$3;const mr=mergeValues(fr.value,hr.value);return mr.valid?((isDirty(fr)||isDirty(hr))&&ir.dirty(),{status:ir.value,value:mr.data}):(addIssueToContext(lr,{code:ZodIssueCode.invalid_intersection_types}),INVALID$3)};return lr.common.async?Promise.all([this._def.left._parseAsync({data:lr.data,path:lr.path,parent:lr}),this._def.right._parseAsync({data:lr.data,path:lr.path,parent:lr})]).then(([fr,hr])=>dr(fr,hr)):dr(this._def.left._parseSync({data:lr.data,path:lr.path,parent:lr}),this._def.right._parseSync({data:lr.data,path:lr.path,parent:lr}))}}ZodIntersection.create=(tr,rr,ir)=>new ZodIntersection({left:tr,right:rr,typeName:ZodFirstPartyTypeKind.ZodIntersection,...processCreateParams(ir)});class ZodTuple extends ZodType{_parse(rr){const{status:ir,ctx:lr}=this._processInputParams(rr);if(lr.parsedType!==ZodParsedType.array)return addIssueToContext(lr,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.array,received:lr.parsedType}),INVALID$3;if(lr.data.length<this._def.items.length)return addIssueToContext(lr,{code:ZodIssueCode.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),INVALID$3;!this._def.rest&&lr.data.length>this._def.items.length&&(addIssueToContext(lr,{code:ZodIssueCode.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),ir.dirty());const fr=[...lr.data].map((hr,mr)=>{const gr=this._def.items[mr]||this._def.rest;return gr?gr._parse(new ParseInputLazyPath(lr,hr,lr.path,mr)):null}).filter(hr=>!!hr);return lr.common.async?Promise.all(fr).then(hr=>ParseStatus.mergeArray(ir,hr)):ParseStatus.mergeArray(ir,fr)}get items(){return this._def.items}rest(rr){return new ZodTuple({...this._def,rest:rr})}}ZodTuple.create=(tr,rr)=>{if(!Array.isArray(tr))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ZodTuple({items:tr,typeName:ZodFirstPartyTypeKind.ZodTuple,rest:null,...processCreateParams(rr)})};class ZodRecord extends ZodType{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(rr){const{status:ir,ctx:lr}=this._processInputParams(rr);if(lr.parsedType!==ZodParsedType.object)return addIssueToContext(lr,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.object,received:lr.parsedType}),INVALID$3;const dr=[],fr=this._def.keyType,hr=this._def.valueType;for(const mr in lr.data)dr.push({key:fr._parse(new ParseInputLazyPath(lr,mr,lr.path,mr)),value:hr._parse(new ParseInputLazyPath(lr,lr.data[mr],lr.path,mr)),alwaysSet:mr in lr.data});return lr.common.async?ParseStatus.mergeObjectAsync(ir,dr):ParseStatus.mergeObjectSync(ir,dr)}get element(){return this._def.valueType}static create(rr,ir,lr){return ir instanceof ZodType?new ZodRecord({keyType:rr,valueType:ir,typeName:ZodFirstPartyTypeKind.ZodRecord,...processCreateParams(lr)}):new ZodRecord({keyType:ZodString.create(),valueType:rr,typeName:ZodFirstPartyTypeKind.ZodRecord,...processCreateParams(ir)})}}class ZodMap extends ZodType{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(rr){const{status:ir,ctx:lr}=this._processInputParams(rr);if(lr.parsedType!==ZodParsedType.map)return addIssueToContext(lr,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.map,received:lr.parsedType}),INVALID$3;const dr=this._def.keyType,fr=this._def.valueType,hr=[...lr.data.entries()].map(([mr,gr],yr)=>({key:dr._parse(new ParseInputLazyPath(lr,mr,lr.path,[yr,"key"])),value:fr._parse(new ParseInputLazyPath(lr,gr,lr.path,[yr,"value"]))}));if(lr.common.async){const mr=new Map;return Promise.resolve().then(async()=>{for(const gr of hr){const yr=await gr.key,_r=await gr.value;if(yr.status==="aborted"||_r.status==="aborted")return INVALID$3;(yr.status==="dirty"||_r.status==="dirty")&&ir.dirty(),mr.set(yr.value,_r.value)}return{status:ir.value,value:mr}})}else{const mr=new Map;for(const gr of hr){const yr=gr.key,_r=gr.value;if(yr.status==="aborted"||_r.status==="aborted")return INVALID$3;(yr.status==="dirty"||_r.status==="dirty")&&ir.dirty(),mr.set(yr.value,_r.value)}return{status:ir.value,value:mr}}}}ZodMap.create=(tr,rr,ir)=>new ZodMap({valueType:rr,keyType:tr,typeName:ZodFirstPartyTypeKind.ZodMap,...processCreateParams(ir)});class ZodSet extends ZodType{_parse(rr){const{status:ir,ctx:lr}=this._processInputParams(rr);if(lr.parsedType!==ZodParsedType.set)return addIssueToContext(lr,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.set,received:lr.parsedType}),INVALID$3;const dr=this._def;dr.minSize!==null&&lr.data.size<dr.minSize.value&&(addIssueToContext(lr,{code:ZodIssueCode.too_small,minimum:dr.minSize.value,type:"set",inclusive:!0,exact:!1,message:dr.minSize.message}),ir.dirty()),dr.maxSize!==null&&lr.data.size>dr.maxSize.value&&(addIssueToContext(lr,{code:ZodIssueCode.too_big,maximum:dr.maxSize.value,type:"set",inclusive:!0,exact:!1,message:dr.maxSize.message}),ir.dirty());const fr=this._def.valueType;function hr(gr){const yr=new Set;for(const _r of gr){if(_r.status==="aborted")return INVALID$3;_r.status==="dirty"&&ir.dirty(),yr.add(_r.value)}return{status:ir.value,value:yr}}const mr=[...lr.data.values()].map((gr,yr)=>fr._parse(new ParseInputLazyPath(lr,gr,lr.path,yr)));return lr.common.async?Promise.all(mr).then(gr=>hr(gr)):hr(mr)}min(rr,ir){return new ZodSet({...this._def,minSize:{value:rr,message:errorUtil.toString(ir)}})}max(rr,ir){return new ZodSet({...this._def,maxSize:{value:rr,message:errorUtil.toString(ir)}})}size(rr,ir){return this.min(rr,ir).max(rr,ir)}nonempty(rr){return this.min(1,rr)}}ZodSet.create=(tr,rr)=>new ZodSet({valueType:tr,minSize:null,maxSize:null,typeName:ZodFirstPartyTypeKind.ZodSet,...processCreateParams(rr)});class ZodLazy extends ZodType{get schema(){return this._def.getter()}_parse(rr){const{ctx:ir}=this._processInputParams(rr);return this._def.getter()._parse({data:ir.data,path:ir.path,parent:ir})}}ZodLazy.create=(tr,rr)=>new ZodLazy({getter:tr,typeName:ZodFirstPartyTypeKind.ZodLazy,...processCreateParams(rr)});class ZodLiteral extends ZodType{_parse(rr){if(rr.data!==this._def.value){const ir=this._getOrReturnCtx(rr);return addIssueToContext(ir,{received:ir.data,code:ZodIssueCode.invalid_literal,expected:this._def.value}),INVALID$3}return{status:"valid",value:rr.data}}get value(){return this._def.value}}ZodLiteral.create=(tr,rr)=>new ZodLiteral({value:tr,typeName:ZodFirstPartyTypeKind.ZodLiteral,...processCreateParams(rr)});function createZodEnum(tr,rr){return new ZodEnum({values:tr,typeName:ZodFirstPartyTypeKind.ZodEnum,...processCreateParams(rr)})}class ZodEnum extends ZodType{_parse(rr){if(typeof rr.data!="string"){const ir=this._getOrReturnCtx(rr),lr=this._def.values;return addIssueToContext(ir,{expected:util$4.joinValues(lr),received:ir.parsedType,code:ZodIssueCode.invalid_type}),INVALID$3}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(rr.data)){const ir=this._getOrReturnCtx(rr),lr=this._def.values;return addIssueToContext(ir,{received:ir.data,code:ZodIssueCode.invalid_enum_value,options:lr}),INVALID$3}return OK(rr.data)}get options(){return this._def.values}get enum(){const rr={};for(const ir of this._def.values)rr[ir]=ir;return rr}get Values(){const rr={};for(const ir of this._def.values)rr[ir]=ir;return rr}get Enum(){const rr={};for(const ir of this._def.values)rr[ir]=ir;return rr}extract(rr,ir=this._def){return ZodEnum.create(rr,{...this._def,...ir})}exclude(rr,ir=this._def){return ZodEnum.create(this.options.filter(lr=>!rr.includes(lr)),{...this._def,...ir})}}ZodEnum.create=createZodEnum;class ZodNativeEnum extends ZodType{_parse(rr){const ir=util$4.getValidEnumValues(this._def.values),lr=this._getOrReturnCtx(rr);if(lr.parsedType!==ZodParsedType.string&&lr.parsedType!==ZodParsedType.number){const dr=util$4.objectValues(ir);return addIssueToContext(lr,{expected:util$4.joinValues(dr),received:lr.parsedType,code:ZodIssueCode.invalid_type}),INVALID$3}if(this._cache||(this._cache=new Set(util$4.getValidEnumValues(this._def.values))),!this._cache.has(rr.data)){const dr=util$4.objectValues(ir);return addIssueToContext(lr,{received:lr.data,code:ZodIssueCode.invalid_enum_value,options:dr}),INVALID$3}return OK(rr.data)}get enum(){return this._def.values}}ZodNativeEnum.create=(tr,rr)=>new ZodNativeEnum({values:tr,typeName:ZodFirstPartyTypeKind.ZodNativeEnum,...processCreateParams(rr)});class ZodPromise extends ZodType{unwrap(){return this._def.type}_parse(rr){const{ctx:ir}=this._processInputParams(rr);if(ir.parsedType!==ZodParsedType.promise&&ir.common.async===!1)return addIssueToContext(ir,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.promise,received:ir.parsedType}),INVALID$3;const lr=ir.parsedType===ZodParsedType.promise?ir.data:Promise.resolve(ir.data);return OK(lr.then(dr=>this._def.type.parseAsync(dr,{path:ir.path,errorMap:ir.common.contextualErrorMap})))}}ZodPromise.create=(tr,rr)=>new ZodPromise({type:tr,typeName:ZodFirstPartyTypeKind.ZodPromise,...processCreateParams(rr)});class ZodEffects extends ZodType{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ZodFirstPartyTypeKind.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(rr){const{status:ir,ctx:lr}=this._processInputParams(rr),dr=this._def.effect||null,fr={addIssue:hr=>{addIssueToContext(lr,hr),hr.fatal?ir.abort():ir.dirty()},get path(){return lr.path}};if(fr.addIssue=fr.addIssue.bind(fr),dr.type==="preprocess"){const hr=dr.transform(lr.data,fr);if(lr.common.async)return Promise.resolve(hr).then(async mr=>{if(ir.value==="aborted")return INVALID$3;const gr=await this._def.schema._parseAsync({data:mr,path:lr.path,parent:lr});return gr.status==="aborted"?INVALID$3:gr.status==="dirty"||ir.value==="dirty"?DIRTY(gr.value):gr});{if(ir.value==="aborted")return INVALID$3;const mr=this._def.schema._parseSync({data:hr,path:lr.path,parent:lr});return mr.status==="aborted"?INVALID$3:mr.status==="dirty"||ir.value==="dirty"?DIRTY(mr.value):mr}}if(dr.type==="refinement"){const hr=mr=>{const gr=dr.refinement(mr,fr);if(lr.common.async)return Promise.resolve(gr);if(gr instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return mr};if(lr.common.async===!1){const mr=this._def.schema._parseSync({data:lr.data,path:lr.path,parent:lr});return mr.status==="aborted"?INVALID$3:(mr.status==="dirty"&&ir.dirty(),hr(mr.value),{status:ir.value,value:mr.value})}else return this._def.schema._parseAsync({data:lr.data,path:lr.path,parent:lr}).then(mr=>mr.status==="aborted"?INVALID$3:(mr.status==="dirty"&&ir.dirty(),hr(mr.value).then(()=>({status:ir.value,value:mr.value}))))}if(dr.type==="transform")if(lr.common.async===!1){const hr=this._def.schema._parseSync({data:lr.data,path:lr.path,parent:lr});if(!isValid(hr))return INVALID$3;const mr=dr.transform(hr.value,fr);if(mr instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:ir.value,value:mr}}else return this._def.schema._parseAsync({data:lr.data,path:lr.path,parent:lr}).then(hr=>isValid(hr)?Promise.resolve(dr.transform(hr.value,fr)).then(mr=>({status:ir.value,value:mr})):INVALID$3);util$4.assertNever(dr)}}ZodEffects.create=(tr,rr,ir)=>new ZodEffects({schema:tr,typeName:ZodFirstPartyTypeKind.ZodEffects,effect:rr,...processCreateParams(ir)});ZodEffects.createWithPreprocess=(tr,rr,ir)=>new ZodEffects({schema:rr,effect:{type:"preprocess",transform:tr},typeName:ZodFirstPartyTypeKind.ZodEffects,...processCreateParams(ir)});class ZodOptional extends ZodType{_parse(rr){return this._getType(rr)===ZodParsedType.undefined?OK(void 0):this._def.innerType._parse(rr)}unwrap(){return this._def.innerType}}ZodOptional.create=(tr,rr)=>new ZodOptional({innerType:tr,typeName:ZodFirstPartyTypeKind.ZodOptional,...processCreateParams(rr)});class ZodNullable extends ZodType{_parse(rr){return this._getType(rr)===ZodParsedType.null?OK(null):this._def.innerType._parse(rr)}unwrap(){return this._def.innerType}}ZodNullable.create=(tr,rr)=>new ZodNullable({innerType:tr,typeName:ZodFirstPartyTypeKind.ZodNullable,...processCreateParams(rr)});class ZodDefault extends ZodType{_parse(rr){const{ctx:ir}=this._processInputParams(rr);let lr=ir.data;return ir.parsedType===ZodParsedType.undefined&&(lr=this._def.defaultValue()),this._def.innerType._parse({data:lr,path:ir.path,parent:ir})}removeDefault(){return this._def.innerType}}ZodDefault.create=(tr,rr)=>new ZodDefault({innerType:tr,typeName:ZodFirstPartyTypeKind.ZodDefault,defaultValue:typeof rr.default=="function"?rr.default:()=>rr.default,...processCreateParams(rr)});class ZodCatch extends ZodType{_parse(rr){const{ctx:ir}=this._processInputParams(rr),lr={...ir,common:{...ir.common,issues:[]}},dr=this._def.innerType._parse({data:lr.data,path:lr.path,parent:{...lr}});return isAsync(dr)?dr.then(fr=>({status:"valid",value:fr.status==="valid"?fr.value:this._def.catchValue({get error(){return new ZodError(lr.common.issues)},input:lr.data})})):{status:"valid",value:dr.status==="valid"?dr.value:this._def.catchValue({get error(){return new ZodError(lr.common.issues)},input:lr.data})}}removeCatch(){return this._def.innerType}}ZodCatch.create=(tr,rr)=>new ZodCatch({innerType:tr,typeName:ZodFirstPartyTypeKind.ZodCatch,catchValue:typeof rr.catch=="function"?rr.catch:()=>rr.catch,...processCreateParams(rr)});class ZodNaN extends ZodType{_parse(rr){if(this._getType(rr)!==ZodParsedType.nan){const lr=this._getOrReturnCtx(rr);return addIssueToContext(lr,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.nan,received:lr.parsedType}),INVALID$3}return{status:"valid",value:rr.data}}}ZodNaN.create=tr=>new ZodNaN({typeName:ZodFirstPartyTypeKind.ZodNaN,...processCreateParams(tr)});class ZodBranded extends ZodType{_parse(rr){const{ctx:ir}=this._processInputParams(rr),lr=ir.data;return this._def.type._parse({data:lr,path:ir.path,parent:ir})}unwrap(){return this._def.type}}class ZodPipeline extends ZodType{_parse(rr){const{status:ir,ctx:lr}=this._processInputParams(rr);if(lr.common.async)return(async()=>{const fr=await this._def.in._parseAsync({data:lr.data,path:lr.path,parent:lr});return fr.status==="aborted"?INVALID$3:fr.status==="dirty"?(ir.dirty(),DIRTY(fr.value)):this._def.out._parseAsync({data:fr.value,path:lr.path,parent:lr})})();{const dr=this._def.in._parseSync({data:lr.data,path:lr.path,parent:lr});return dr.status==="aborted"?INVALID$3:dr.status==="dirty"?(ir.dirty(),{status:"dirty",value:dr.value}):this._def.out._parseSync({data:dr.value,path:lr.path,parent:lr})}}static create(rr,ir){return new ZodPipeline({in:rr,out:ir,typeName:ZodFirstPartyTypeKind.ZodPipeline})}}class ZodReadonly extends ZodType{_parse(rr){const ir=this._def.innerType._parse(rr),lr=dr=>(isValid(dr)&&(dr.value=Object.freeze(dr.value)),dr);return isAsync(ir)?ir.then(dr=>lr(dr)):lr(ir)}unwrap(){return this._def.innerType}}ZodReadonly.create=(tr,rr)=>new ZodReadonly({innerType:tr,typeName:ZodFirstPartyTypeKind.ZodReadonly,...processCreateParams(rr)});var ZodFirstPartyTypeKind;(function(tr){tr.ZodString="ZodString",tr.ZodNumber="ZodNumber",tr.ZodNaN="ZodNaN",tr.ZodBigInt="ZodBigInt",tr.ZodBoolean="ZodBoolean",tr.ZodDate="ZodDate",tr.ZodSymbol="ZodSymbol",tr.ZodUndefined="ZodUndefined",tr.ZodNull="ZodNull",tr.ZodAny="ZodAny",tr.ZodUnknown="ZodUnknown",tr.ZodNever="ZodNever",tr.ZodVoid="ZodVoid",tr.ZodArray="ZodArray",tr.ZodObject="ZodObject",tr.ZodUnion="ZodUnion",tr.ZodDiscriminatedUnion="ZodDiscriminatedUnion",tr.ZodIntersection="ZodIntersection",tr.ZodTuple="ZodTuple",tr.ZodRecord="ZodRecord",tr.ZodMap="ZodMap",tr.ZodSet="ZodSet",tr.ZodFunction="ZodFunction",tr.ZodLazy="ZodLazy",tr.ZodLiteral="ZodLiteral",tr.ZodEnum="ZodEnum",tr.ZodEffects="ZodEffects",tr.ZodNativeEnum="ZodNativeEnum",tr.ZodOptional="ZodOptional",tr.ZodNullable="ZodNullable",tr.ZodDefault="ZodDefault",tr.ZodCatch="ZodCatch",tr.ZodPromise="ZodPromise",tr.ZodBranded="ZodBranded",tr.ZodPipeline="ZodPipeline",tr.ZodReadonly="ZodReadonly"})(ZodFirstPartyTypeKind||(ZodFirstPartyTypeKind={}));const stringType=ZodString.create,numberType=ZodNumber.create,booleanType=ZodBoolean.create,nullType=ZodNull.create,anyType=ZodAny.create,unknownType=ZodUnknown.create,arrayType=ZodArray.create,objectType=ZodObject.create,unionType=ZodUnion.create,recordType=ZodRecord.create,lazyType=ZodLazy.create,literalType=ZodLiteral.create,enumType=ZodEnum.create,SET_NAME="SET_NAME",UNDO="UNDO",REDO="REDO",PRUNE="PRUNE",LOAD_STATE="LOAD_STATE",Operation={Remove:"remove",Replace:"replace",Add:"add"},PROXY_DRAFT=Symbol.for("__MUTATIVE_PROXY_DRAFT__"),RAW_RETURN_SYMBOL=Symbol("__MUTATIVE_RAW_RETURN_SYMBOL__"),iteratorSymbol=Symbol.iterator,dataTypes={mutable:"mutable",immutable:"immutable"},internal={};function has(tr,rr){return tr instanceof Map?tr.has(rr):Object.prototype.hasOwnProperty.call(tr,rr)}function getDescriptor(tr,rr){if(rr in tr){let ir=Reflect.getPrototypeOf(tr);for(;ir;){const lr=Reflect.getOwnPropertyDescriptor(ir,rr);if(lr)return lr;ir=Reflect.getPrototypeOf(ir)}}}function isBaseSetInstance(tr){return Object.getPrototypeOf(tr)===Set.prototype}function isBaseMapInstance(tr){return Object.getPrototypeOf(tr)===Map.prototype}function latest(tr){var rr;return(rr=tr.copy)!==null&&rr!==void 0?rr:tr.original}function isDraft(tr){return!!getProxyDraft(tr)}function getProxyDraft(tr){return typeof tr!="object"?null:tr==null?void 0:tr[PROXY_DRAFT]}function getValue(tr){var rr;const ir=getProxyDraft(tr);return ir?(rr=ir.copy)!==null&&rr!==void 0?rr:ir.original:tr}function isDraftable(tr,rr){if(!tr||typeof tr!="object")return!1;let ir;return Object.getPrototypeOf(tr)===Object.prototype||Array.isArray(tr)||tr instanceof Map||tr instanceof Set||!!(rr!=null&&rr.mark)&&((ir=rr.mark(tr,dataTypes))===dataTypes.immutable||typeof ir=="function")}function getPath$1(tr,rr=[]){if(Object.hasOwnProperty.call(tr,"key")){const ir=tr.parent.copy,lr=getProxyDraft(get$2(ir,tr.key));if(lr!==null&&(lr==null?void 0:lr.original)!==tr.original)return null;const dr=tr.parent.type===3,fr=dr?Array.from(tr.parent.setMap.keys()).indexOf(tr.key):tr.key;if(!(dr&&ir.size>fr||has(ir,fr)))return null;rr.push(fr)}if(tr.parent)return getPath$1(tr.parent,rr);rr.reverse();try{resolvePath$1(tr.copy,rr)}catch{return null}return rr}function getType(tr){return Array.isArray(tr)?1:tr instanceof Map?2:tr instanceof Set?3:0}function get$2(tr,rr){return getType(tr)===2?tr.get(rr):tr[rr]}function set(tr,rr,ir){getType(tr)===2?tr.set(rr,ir):tr[rr]=ir}function peek(tr,rr){const ir=getProxyDraft(tr);return(ir?latest(ir):tr)[rr]}function isEqual(tr,rr){return tr===rr?tr!==0||1/tr===1/rr:tr!==tr&&rr!==rr}function revokeProxy(tr){if(tr)for(;tr.finalities.revoke.length>0;)tr.finalities.revoke.pop()()}function escapePath(tr,rr){return rr?tr:[""].concat(tr).map(ir=>{const lr=`${ir}`;return lr.indexOf("/")===-1&&lr.indexOf("~")===-1?lr:lr.replace(/~/g,"~0").replace(/\//g,"~1")}).join("/")}function resolvePath$1(tr,rr){for(let ir=0;ir<rr.length-1;ir+=1){const lr=rr[ir];if(tr=get$2(getType(tr)===3?Array.from(tr):tr,lr),typeof tr!="object")throw new Error(`Cannot resolve patch at '${rr.join("/")}'.`)}return tr}function strictCopy(tr){const rr=Object.create(Object.getPrototypeOf(tr));return Reflect.ownKeys(tr).forEach(ir=>{let lr=Reflect.getOwnPropertyDescriptor(tr,ir);if(lr.enumerable&&lr.configurable&&lr.writable){rr[ir]=tr[ir];return}lr.writable||(lr.writable=!0,lr.configurable=!0),(lr.get||lr.set)&&(lr={configurable:!0,writable:!0,enumerable:lr.enumerable,value:tr[ir]}),Reflect.defineProperty(rr,ir,lr)}),rr}const propIsEnum=Object.prototype.propertyIsEnumerable;function shallowCopy(tr,rr){let ir;if(Array.isArray(tr))return Array.prototype.concat.call(tr);if(tr instanceof Set){if(!isBaseSetInstance(tr)){const lr=Object.getPrototypeOf(tr).constructor;return new lr(tr.values())}return Set.prototype.difference?Set.prototype.difference.call(tr,new Set):new Set(tr.values())}else if(tr instanceof Map){if(!isBaseMapInstance(tr)){const lr=Object.getPrototypeOf(tr).constructor;return new lr(tr)}return new Map(tr)}else if(rr!=null&&rr.mark&&(ir=rr.mark(tr,dataTypes),ir!==void 0)&&ir!==dataTypes.mutable){if(ir===dataTypes.immutable)return strictCopy(tr);if(typeof ir=="function"){if(rr.enablePatches||rr.enableAutoFreeze)throw new Error("You can't use mark and patches or auto freeze together.");return ir()}throw new Error(`Unsupported mark result: ${ir}`)}else if(typeof tr=="object"&&Object.getPrototypeOf(tr)===Object.prototype){const lr={};return Object.keys(tr).forEach(dr=>{lr[dr]=tr[dr]}),Object.getOwnPropertySymbols(tr).forEach(dr=>{propIsEnum.call(tr,dr)&&(lr[dr]=tr[dr])}),lr}else throw new Error("Please check mark() to ensure that it is a stable marker draftable function.")}function ensureShallowCopy(tr){tr.copy||(tr.copy=shallowCopy(tr.original,tr.options))}function deepClone(tr){if(!isDraftable(tr))return getValue(tr);if(Array.isArray(tr))return tr.map(deepClone);if(tr instanceof Map){const ir=Array.from(tr.entries()).map(([lr,dr])=>[lr,deepClone(dr)]);if(!isBaseMapInstance(tr)){const lr=Object.getPrototypeOf(tr).constructor;return new lr(ir)}return new Map(ir)}if(tr instanceof Set){const ir=Array.from(tr).map(deepClone);if(!isBaseSetInstance(tr)){const lr=Object.getPrototypeOf(tr).constructor;return new lr(ir)}return new Set(ir)}const rr=Object.create(Object.getPrototypeOf(tr));for(const ir in tr)rr[ir]=deepClone(tr[ir]);return rr}function cloneIfNeeded(tr){return isDraft(tr)?deepClone(tr):tr}function markChanged(tr){var rr;tr.assignedMap=(rr=tr.assignedMap)!==null&&rr!==void 0?rr:new Map,tr.operated||(tr.operated=!0,tr.parent&&markChanged(tr.parent))}function throwFrozenError(){throw new Error("Cannot modify frozen object")}function deepFreeze(tr,rr,ir,lr,dr){{ir=ir??new WeakMap,lr=lr??[],dr=dr??[];const hr=ir.has(tr)?ir.get(tr):tr;if(lr.length>0){const mr=lr.indexOf(hr);if(hr&&typeof hr=="object"&&mr!==-1)throw lr[0]===hr?new Error("Forbids circular reference"):new Error(`Forbids circular reference: ~/${dr.slice(0,mr).map((gr,yr)=>{if(typeof gr=="symbol")return`[${gr.toString()}]`;const _r=lr[yr];return typeof gr=="object"&&(_r instanceof Map||_r instanceof Set)?Array.from(_r.keys()).indexOf(gr):gr}).join("/")}`);lr.push(hr),dr.push(rr)}else lr.push(hr)}if(Object.isFrozen(tr)||isDraft(tr)){lr.pop(),dr.pop();return}switch(getType(tr)){case 2:for(const[mr,gr]of tr)deepFreeze(mr,mr,ir,lr,dr),deepFreeze(gr,mr,ir,lr,dr);tr.set=tr.clear=tr.delete=throwFrozenError;break;case 3:for(const mr of tr)deepFreeze(mr,mr,ir,lr,dr);tr.add=tr.clear=tr.delete=throwFrozenError;break;case 1:Object.freeze(tr);let hr=0;for(const mr of tr)deepFreeze(mr,hr,ir,lr,dr),hr+=1;break;default:Object.freeze(tr),Object.keys(tr).forEach(mr=>{const gr=tr[mr];deepFreeze(gr,mr,ir,lr,dr)})}lr.pop(),dr.pop()}function forEach$1(tr,rr){const ir=getType(tr);if(ir===0)Reflect.ownKeys(tr).forEach(lr=>{rr(lr,tr[lr],tr)});else if(ir===1){let lr=0;for(const dr of tr)rr(lr,dr,tr),lr+=1}else tr.forEach((lr,dr)=>rr(dr,lr,tr))}function handleValue(tr,rr,ir){if(isDraft(tr)||!isDraftable(tr,ir)||rr.has(tr)||Object.isFrozen(tr))return;const lr=tr instanceof Set,dr=lr?new Map:void 0;if(rr.add(tr),forEach$1(tr,(fr,hr)=>{var mr;if(isDraft(hr)){const gr=getProxyDraft(hr);ensureShallowCopy(gr);const yr=!((mr=gr.assignedMap)===null||mr===void 0)&&mr.size||gr.operated?gr.copy:gr.original;set(lr?dr:tr,fr,yr)}else handleValue(hr,rr,ir)}),dr){const fr=tr,hr=Array.from(fr);fr.clear(),hr.forEach(mr=>{fr.add(dr.has(mr)?dr.get(mr):mr)})}}function finalizeAssigned(tr,rr){const ir=tr.type===3?tr.setMap:tr.copy;tr.finalities.revoke.length>1&&tr.assignedMap.get(rr)&&ir&&handleValue(get$2(ir,rr),tr.finalities.handledSet,tr.options)}function finalizeSetValue(tr){tr.type===3&&tr.copy&&(tr.copy.clear(),tr.setMap.forEach(rr=>{tr.copy.add(getValue(rr))}))}function finalizePatches(tr,rr,ir,lr){if(tr.operated&&tr.assignedMap&&tr.assignedMap.size>0&&!tr.finalized){if(ir&&lr){const fr=getPath$1(tr);fr&&rr(tr,fr,ir,lr)}tr.finalized=!0}}function markFinalization(tr,rr,ir,lr){const dr=getProxyDraft(ir);dr&&(dr.callbacks||(dr.callbacks=[]),dr.callbacks.push((fr,hr)=>{var mr;const gr=tr.type===3?tr.setMap:tr.copy;if(isEqual(get$2(gr,rr),ir)){let yr=dr.original;dr.copy&&(yr=dr.copy),finalizeSetValue(tr),finalizePatches(tr,lr,fr,hr),tr.options.enableAutoFreeze&&(tr.options.updatedValues=(mr=tr.options.updatedValues)!==null&&mr!==void 0?mr:new WeakMap,tr.options.updatedValues.set(yr,dr.original)),set(gr,rr,yr)}}),tr.options.enableAutoFreeze&&dr.finalities!==tr.finalities&&(tr.options.enableAutoFreeze=!1)),isDraftable(ir,tr.options)&&tr.finalities.draft.push(()=>{const fr=tr.type===3?tr.setMap:tr.copy;isEqual(get$2(fr,rr),ir)&&finalizeAssigned(tr,rr)})}function generateArrayPatches(tr,rr,ir,lr,dr){let{original:fr,assignedMap:hr,options:mr}=tr,gr=tr.copy;gr.length<fr.length&&([fr,gr]=[gr,fr],[ir,lr]=[lr,ir]);for(let yr=0;yr<fr.length;yr+=1)if(hr.get(yr.toString())&&gr[yr]!==fr[yr]){const _r=rr.concat([yr]),br=escapePath(_r,dr);ir.push({op:Operation.Replace,path:br,value:cloneIfNeeded(gr[yr])}),lr.push({op:Operation.Replace,path:br,value:cloneIfNeeded(fr[yr])})}for(let yr=fr.length;yr<gr.length;yr+=1){const _r=rr.concat([yr]),br=escapePath(_r,dr);ir.push({op:Operation.Add,path:br,value:cloneIfNeeded(gr[yr])})}if(fr.length<gr.length){const{arrayLengthAssignment:yr=!0}=mr.enablePatches;if(yr){const _r=rr.concat(["length"]),br=escapePath(_r,dr);lr.push({op:Operation.Replace,path:br,value:fr.length})}else for(let _r=gr.length;fr.length<_r;_r-=1){const br=rr.concat([_r-1]),vr=escapePath(br,dr);lr.push({op:Operation.Remove,path:vr})}}}function generatePatchesFromAssigned({original:tr,copy:rr,assignedMap:ir},lr,dr,fr,hr){ir.forEach((mr,gr)=>{const yr=get$2(tr,gr),_r=cloneIfNeeded(get$2(rr,gr)),br=mr?has(tr,gr)?Operation.Replace:Operation.Add:Operation.Remove;if(isEqual(yr,_r)&&br===Operation.Replace)return;const vr=lr.concat(gr),wr=escapePath(vr,hr);dr.push(br===Operation.Remove?{op:br,path:wr}:{op:br,path:wr,value:_r}),fr.push(br===Operation.Add?{op:Operation.Remove,path:wr}:br===Operation.Remove?{op:Operation.Add,path:wr,value:yr}:{op:Operation.Replace,path:wr,value:yr})})}function generateSetPatches({original:tr,copy:rr},ir,lr,dr,fr){let hr=0;tr.forEach(mr=>{if(!rr.has(mr)){const gr=ir.concat([hr]),yr=escapePath(gr,fr);lr.push({op:Operation.Remove,path:yr,value:mr}),dr.unshift({op:Operation.Add,path:yr,value:mr})}hr+=1}),hr=0,rr.forEach(mr=>{if(!tr.has(mr)){const gr=ir.concat([hr]),yr=escapePath(gr,fr);lr.push({op:Operation.Add,path:yr,value:mr}),dr.unshift({op:Operation.Remove,path:yr,value:mr})}hr+=1})}function generatePatches(tr,rr,ir,lr){const{pathAsArray:dr=!0}=tr.options.enablePatches;switch(tr.type){case 0:case 2:return generatePatchesFromAssigned(tr,rr,ir,lr,dr);case 1:return generateArrayPatches(tr,rr,ir,lr,dr);case 3:return generateSetPatches(tr,rr,ir,lr,dr)}}let readable=!1;const checkReadable=(tr,rr,ir=!1)=>{if(typeof tr=="object"&&tr!==null&&(!isDraftable(tr,rr)||ir)&&!readable)throw new Error("Strict mode: Mutable data cannot be accessed directly, please use 'unsafe(callback)' wrap.")};function unsafe(tr){readable=!0;let rr;try{rr=tr()}finally{readable=!1}return rr}const mapHandler={get size(){return latest(getProxyDraft(this)).size},has(tr){return latest(getProxyDraft(this)).has(tr)},set(tr,rr){const ir=getProxyDraft(this),lr=latest(ir);return(!lr.has(tr)||!isEqual(lr.get(tr),rr))&&(ensureShallowCopy(ir),markChanged(ir),ir.assignedMap.set(tr,!0),ir.copy.set(tr,rr),markFinalization(ir,tr,rr,generatePatches)),this},delete(tr){if(!this.has(tr))return!1;const rr=getProxyDraft(this);return ensureShallowCopy(rr),markChanged(rr),rr.original.has(tr)?rr.assignedMap.set(tr,!1):rr.assignedMap.delete(tr),rr.copy.delete(tr),!0},clear(){const tr=getProxyDraft(this);if(this.size){ensureShallowCopy(tr),markChanged(tr),tr.assignedMap=new Map;for(const[rr]of tr.original)tr.assignedMap.set(rr,!1);tr.copy.clear()}},forEach(tr,rr){const ir=getProxyDraft(this);latest(ir).forEach((lr,dr)=>{tr.call(rr,this.get(dr),dr,this)})},get(tr){var rr,ir;const lr=getProxyDraft(this),dr=latest(lr).get(tr),fr=((ir=(rr=lr.options).mark)===null||ir===void 0?void 0:ir.call(rr,dr,dataTypes))===dataTypes.mutable;if(lr.options.strict&&checkReadable(dr,lr.options,fr),fr||lr.finalized||!isDraftable(dr,lr.options)||dr!==lr.original.get(tr))return dr;const hr=internal.createDraft({original:dr,parentDraft:lr,key:tr,finalities:lr.finalities,options:lr.options});return ensureShallowCopy(lr),lr.copy.set(tr,hr),hr},keys(){return latest(getProxyDraft(this)).keys()},values(){const tr=this.keys();return{[iteratorSymbol]:()=>this.values(),next:()=>{const rr=tr.next();return rr.done?rr:{done:!1,value:this.get(rr.value)}}}},entries(){const tr=this.keys();return{[iteratorSymbol]:()=>this.entries(),next:()=>{const rr=tr.next();if(rr.done)return rr;const ir=this.get(rr.value);return{done:!1,value:[rr.value,ir]}}}},[iteratorSymbol](){return this.entries()}},mapHandlerKeys=Reflect.ownKeys(mapHandler),getNextIterator=(tr,rr,{isValuesIterator:ir})=>()=>{var lr,dr;const fr=rr.next();if(fr.done)return fr;const hr=fr.value;let mr=tr.setMap.get(hr);const gr=getProxyDraft(mr),yr=((dr=(lr=tr.options).mark)===null||dr===void 0?void 0:dr.call(lr,mr,dataTypes))===dataTypes.mutable;if(tr.options.strict&&checkReadable(hr,tr.options,yr),!yr&&!gr&&isDraftable(hr,tr.options)&&!tr.finalized&&tr.original.has(hr)){const _r=internal.createDraft({original:hr,parentDraft:tr,key:hr,finalities:tr.finalities,options:tr.options});tr.setMap.set(hr,_r),mr=_r}else gr&&(mr=gr.proxy);return{done:!1,value:ir?mr:[mr,mr]}},setHandler={get size(){return getProxyDraft(this).setMap.size},has(tr){const rr=getProxyDraft(this);if(rr.setMap.has(tr))return!0;ensureShallowCopy(rr);const ir=getProxyDraft(tr);return!!(ir&&rr.setMap.has(ir.original))},add(tr){const rr=getProxyDraft(this);return this.has(tr)||(ensureShallowCopy(rr),markChanged(rr),rr.assignedMap.set(tr,!0),rr.setMap.set(tr,tr),markFinalization(rr,tr,tr,generatePatches)),this},delete(tr){if(!this.has(tr))return!1;const rr=getProxyDraft(this);ensureShallowCopy(rr),markChanged(rr);const ir=getProxyDraft(tr);return ir&&rr.setMap.has(ir.original)?(rr.assignedMap.set(ir.original,!1),rr.setMap.delete(ir.original)):(!ir&&rr.setMap.has(tr)?rr.assignedMap.set(tr,!1):rr.assignedMap.delete(tr),rr.setMap.delete(tr))},clear(){if(!this.size)return;const tr=getProxyDraft(this);ensureShallowCopy(tr),markChanged(tr);for(const rr of tr.original)tr.assignedMap.set(rr,!1);tr.setMap.clear()},values(){const tr=getProxyDraft(this);ensureShallowCopy(tr);const rr=tr.setMap.keys();return{[Symbol.iterator]:()=>this.values(),next:getNextIterator(tr,rr,{isValuesIterator:!0})}},entries(){const tr=getProxyDraft(this);ensureShallowCopy(tr);const rr=tr.setMap.keys();return{[Symbol.iterator]:()=>this.entries(),next:getNextIterator(tr,rr,{isValuesIterator:!1})}},keys(){return this.values()},[iteratorSymbol](){return this.values()},forEach(tr,rr){const ir=this.values();let lr=ir.next();for(;!lr.done;)tr.call(rr,lr.value,lr.value,this),lr=ir.next()}};Set.prototype.difference&&Object.assign(setHandler,{intersection(tr){return Set.prototype.intersection.call(new Set(this.values()),tr)},union(tr){return Set.prototype.union.call(new Set(this.values()),tr)},difference(tr){return Set.prototype.difference.call(new Set(this.values()),tr)},symmetricDifference(tr){return Set.prototype.symmetricDifference.call(new Set(this.values()),tr)},isSubsetOf(tr){return Set.prototype.isSubsetOf.call(new Set(this.values()),tr)},isSupersetOf(tr){return Set.prototype.isSupersetOf.call(new Set(this.values()),tr)},isDisjointFrom(tr){return Set.prototype.isDisjointFrom.call(new Set(this.values()),tr)}});const setHandlerKeys=Reflect.ownKeys(setHandler),draftsCache=new WeakSet,proxyHandler={get(tr,rr,ir){var lr,dr;const fr=(lr=tr.copy)===null||lr===void 0?void 0:lr[rr];if(fr&&draftsCache.has(fr))return fr;if(rr===PROXY_DRAFT)return tr;let hr;if(tr.options.mark){const yr=rr==="size"&&(tr.original instanceof Map||tr.original instanceof Set)?Reflect.get(tr.original,rr):Reflect.get(tr.original,rr,ir);if(hr=tr.options.mark(yr,dataTypes),hr===dataTypes.mutable)return tr.options.strict&&checkReadable(yr,tr.options,!0),yr}const mr=latest(tr);if(mr instanceof Map&&mapHandlerKeys.includes(rr)){if(rr==="size")return Object.getOwnPropertyDescriptor(mapHandler,"size").get.call(tr.proxy);const yr=mapHandler[rr];if(yr)return yr.bind(tr.proxy)}if(mr instanceof Set&&setHandlerKeys.includes(rr)){if(rr==="size")return Object.getOwnPropertyDescriptor(setHandler,"size").get.call(tr.proxy);const yr=setHandler[rr];if(yr)return yr.bind(tr.proxy)}if(!has(mr,rr)){const yr=getDescriptor(mr,rr);return yr?"value"in yr?yr.value:(dr=yr.get)===null||dr===void 0?void 0:dr.call(tr.proxy):void 0}const gr=mr[rr];if(tr.options.strict&&checkReadable(gr,tr.options),tr.finalized||!isDraftable(gr,tr.options))return gr;if(gr===peek(tr.original,rr)){if(ensureShallowCopy(tr),tr.copy[rr]=createDraft({original:tr.original[rr],parentDraft:tr,key:tr.type===1?Number(rr):rr,finalities:tr.finalities,options:tr.options}),typeof hr=="function"){const yr=getProxyDraft(tr.copy[rr]);return ensureShallowCopy(yr),markChanged(yr),yr.copy}return tr.copy[rr]}return gr},set(tr,rr,ir){var lr;if(tr.type===3||tr.type===2)throw new Error("Map/Set draft does not support any property assignment.");let dr;if(tr.type===1&&rr!=="length"&&!(Number.isInteger(dr=Number(rr))&&dr>=0&&(rr===0||dr===0||String(dr)===String(rr))))throw new Error("Only supports setting array indices and the 'length' property.");const fr=getDescriptor(latest(tr),rr);if(fr!=null&&fr.set)return fr.set.call(tr.proxy,ir),!0;const hr=peek(latest(tr),rr),mr=getProxyDraft(hr);return mr&&isEqual(mr.original,ir)?(tr.copy[rr]=ir,tr.assignedMap=(lr=tr.assignedMap)!==null&&lr!==void 0?lr:new Map,tr.assignedMap.set(rr,!1),!0):(isEqual(ir,hr)&&(ir!==void 0||has(tr.original,rr))||(ensureShallowCopy(tr),markChanged(tr),has(tr.original,rr)&&isEqual(ir,tr.original[rr])?tr.assignedMap.delete(rr):tr.assignedMap.set(rr,!0),tr.copy[rr]=ir,markFinalization(tr,rr,ir,generatePatches)),!0)},has(tr,rr){return rr in latest(tr)},ownKeys(tr){return Reflect.ownKeys(latest(tr))},getOwnPropertyDescriptor(tr,rr){const ir=latest(tr),lr=Reflect.getOwnPropertyDescriptor(ir,rr);return lr&&{writable:!0,configurable:tr.type!==1||rr!=="length",enumerable:lr.enumerable,value:ir[rr]}},getPrototypeOf(tr){return Reflect.getPrototypeOf(tr.original)},setPrototypeOf(){throw new Error("Cannot call 'setPrototypeOf()' on drafts")},defineProperty(){throw new Error("Cannot call 'defineProperty()' on drafts")},deleteProperty(tr,rr){var ir;return tr.type===1?proxyHandler.set.call(this,tr,rr,void 0,tr.proxy):(peek(tr.original,rr)!==void 0||rr in tr.original?(ensureShallowCopy(tr),markChanged(tr),tr.assignedMap.set(rr,!1)):(tr.assignedMap=(ir=tr.assignedMap)!==null&&ir!==void 0?ir:new Map,tr.assignedMap.delete(rr)),tr.copy&&delete tr.copy[rr],!0)}};function createDraft(tr){const{original:rr,parentDraft:ir,key:lr,finalities:dr,options:fr}=tr,hr=getType(rr),mr={type:hr,finalized:!1,parent:ir,original:rr,copy:null,proxy:null,finalities:dr,options:fr,setMap:hr===3?new Map(rr.entries()):void 0};(lr||"key"in tr)&&(mr.key=lr);const{proxy:gr,revoke:yr}=Proxy.revocable(hr===1?Object.assign([],mr):mr,proxyHandler);if(dr.revoke.push(yr),draftsCache.add(gr),mr.proxy=gr,ir){const _r=ir;_r.finalities.draft.push((br,vr)=>{var wr,xr;const Sr=getProxyDraft(gr);let Ar=_r.type===3?_r.setMap:_r.copy;const Ir=get$2(Ar,lr),Mr=getProxyDraft(Ir);if(Mr){let Or=Mr.original;Mr.operated&&(Or=getValue(Ir)),finalizeSetValue(Mr),finalizePatches(Mr,generatePatches,br,vr),_r.options.enableAutoFreeze&&(_r.options.updatedValues=(wr=_r.options.updatedValues)!==null&&wr!==void 0?wr:new WeakMap,_r.options.updatedValues.set(Or,Mr.original)),set(Ar,lr,Or)}(xr=Sr.callbacks)===null||xr===void 0||xr.forEach(Or=>{Or(br,vr)})})}else{const _r=getProxyDraft(gr);_r.finalities.draft.push((br,vr)=>{finalizeSetValue(_r),finalizePatches(_r,generatePatches,br,vr)})}return gr}internal.createDraft=createDraft;function finalizeDraft(tr,rr,ir,lr,dr){var fr;const hr=getProxyDraft(tr),mr=(fr=hr==null?void 0:hr.original)!==null&&fr!==void 0?fr:tr,gr=!!rr.length;if(hr!=null&&hr.operated)for(;hr.finalities.draft.length>0;)hr.finalities.draft.pop()(ir,lr);const yr=gr?rr[0]:hr?hr.operated?hr.copy:hr.original:tr;return hr&&revokeProxy(hr),dr&&deepFreeze(yr,yr,hr==null?void 0:hr.options.updatedValues),[yr,ir&&gr?[{op:Operation.Replace,path:[],value:rr[0]}]:ir,lr&&gr?[{op:Operation.Replace,path:[],value:mr}]:lr]}function draftify(tr,rr){var ir;const lr={draft:[],revoke:[],handledSet:new WeakSet};let dr,fr;rr.enablePatches&&(dr=[],fr=[]);const mr=((ir=rr.mark)===null||ir===void 0?void 0:ir.call(rr,tr,dataTypes))===dataTypes.mutable||!isDraftable(tr,rr)?tr:createDraft({original:tr,parentDraft:null,finalities:lr,options:rr});return[mr,(gr=[])=>{const[yr,_r,br]=finalizeDraft(mr,gr,dr,fr,rr.enableAutoFreeze);return rr.enablePatches?[yr,_r,br]:yr}]}function handleReturnValue(tr){const{rootDraft:rr,value:ir,useRawReturn:lr=!1,isRoot:dr=!0}=tr;forEach$1(ir,(fr,hr,mr)=>{const gr=getProxyDraft(hr);if(gr&&rr&&gr.finalities===rr.finalities){tr.isContainDraft=!0;const yr=gr.original;if(mr instanceof Set){const _r=Array.from(mr);mr.clear(),_r.forEach(br=>mr.add(fr===br?yr:br))}else set(mr,fr,yr)}else typeof hr=="object"&&hr!==null&&(tr.value=hr,tr.isRoot=!1,handleReturnValue(tr))}),dr&&(tr.isContainDraft||console.warn("The return value does not contain any draft, please use 'rawReturn()' to wrap the return value to improve performance."),lr&&console.warn("The return value contains drafts, please don't use 'rawReturn()' to wrap the return value."))}function getCurrent(tr){var rr;const ir=getProxyDraft(tr);if(!isDraftable(tr,ir==null?void 0:ir.options))return tr;const lr=getType(tr);if(ir&&!ir.operated)return ir.original;let dr;function fr(){dr=lr===2?isBaseMapInstance(tr)?new Map(tr):new(Object.getPrototypeOf(tr)).constructor(tr):lr===3?Array.from(ir.setMap.values()):shallowCopy(tr,ir==null?void 0:ir.options)}if(ir){ir.finalized=!0;try{fr()}finally{ir.finalized=!1}}else dr=tr;if(forEach$1(dr,(hr,mr)=>{if(ir&&isEqual(get$2(ir.original,hr),mr))return;const gr=getCurrent(mr);gr!==mr&&(dr===tr&&fr(),set(dr,hr,gr))}),lr===3){const hr=(rr=ir==null?void 0:ir.original)!==null&&rr!==void 0?rr:dr;return isBaseSetInstance(hr)?new Set(dr):new(Object.getPrototypeOf(hr)).constructor(dr)}return dr}function current(tr){if(!isDraft(tr))throw new Error(`current() is only used for Draft, parameter: ${tr}`);return getCurrent(tr)}const makeCreator=tr=>function rr(ir,lr,dr){var fr,hr,mr;if(typeof ir=="function"&&typeof lr!="function")return function(Dr,...zr){return rr(Dr,Fr=>ir.call(this,Fr,...zr),lr)};const gr=ir,yr=lr;let _r=dr;if(typeof lr!="function"&&(_r=lr),_r!==void 0&&Object.prototype.toString.call(_r)!=="[object Object]")throw new Error(`Invalid options: ${_r}, 'options' should be an object.`);_r=Object.assign(Object.assign({},tr),_r);const br=isDraft(gr)?current(gr):gr,vr=Array.isArray(_r.mark)?((Dr,zr)=>{for(const Fr of _r.mark){if(typeof Fr!="function")throw new Error(`Invalid mark: ${Fr}, 'mark' should be a function.`);const Jr=Fr(Dr,zr);if(Jr)return Jr}}):_r.mark,wr=(fr=_r.enablePatches)!==null&&fr!==void 0?fr:!1,xr=(hr=_r.strict)!==null&&hr!==void 0?hr:!1,Ar={enableAutoFreeze:(mr=_r.enableAutoFreeze)!==null&&mr!==void 0?mr:!1,mark:vr,strict:xr,enablePatches:wr};if(!isDraftable(br,Ar)&&typeof br=="object"&&br!==null)throw new Error("Invalid base state: create() only supports plain objects, arrays, Set, Map or using mark() to mark the state as immutable.");const[Ir,Mr]=draftify(br,Ar);if(typeof lr!="function"){if(!isDraftable(br,Ar))throw new Error("Invalid base state: create() only supports plain objects, arrays, Set, Map or using mark() to mark the state as immutable.");return[Ir,Mr]}let Or;try{Or=yr(Ir)}catch(Dr){throw revokeProxy(getProxyDraft(Ir)),Dr}const $r=Dr=>{const zr=getProxyDraft(Ir);if(!isDraft(Dr)){if(Dr!==void 0&&!isEqual(Dr,Ir)&&(zr!=null&&zr.operated))throw new Error("Either the value is returned as a new non-draft value, or only the draft is modified without returning any value.");const Jr=Dr==null?void 0:Dr[RAW_RETURN_SYMBOL];if(Jr){const $n=Jr[0];return Ar.strict&&typeof Dr=="object"&&Dr!==null&&handleReturnValue({rootDraft:zr,value:Dr,useRawReturn:!0}),Mr([$n])}if(Dr!==void 0)return typeof Dr=="object"&&Dr!==null&&handleReturnValue({rootDraft:zr,value:Dr}),Mr([Dr])}if(Dr===Ir||Dr===void 0)return Mr([]);const Fr=getProxyDraft(Dr);if(Ar===Fr.options){if(Fr.operated)throw new Error("Cannot return a modified child draft.");return Mr([current(Dr)])}return Mr([Dr])};return Or instanceof Promise?Or.then($r,Dr=>{throw revokeProxy(getProxyDraft(Ir)),Dr}):$r(Or)},create$1=makeCreator();Object.prototype.constructor.toString();function castDraft(tr){return tr}const actionFromAction=tr=>({id:tr.id,timestampUtcMs:tr.timestampUtcMs,type:tr.type,input:tr.input,scope:tr.scope,context:tr.context,attachments:tr.attachments}),operationFromAction=(tr,rr,ir)=>({...tr,action:tr,id:generateId(),timestampUtcMs:new Date().toISOString(),hash:"",error:void 0,index:rr,skip:ir}),operationFromOperation=(tr,rr)=>({...tr,hash:"",error:void 0,skip:rr}),operationWithContext=(tr,rr)=>{if(!tr.action)throw new Error("Operation has no action");return{...tr,action:{...tr.action,context:rr}}},actionSigner=(tr,rr,ir=[])=>({user:tr,app:rr,signatures:ir}),defaultAuthState=()=>({}),defaultDocumentState=()=>({version:"1.0.0"}),defaultBaseState=()=>({auth:defaultAuthState(),document:defaultDocumentState()}),createAuthState=tr=>({...defaultAuthState(),...tr}),createDocumentState=tr=>({...defaultDocumentState(),...tr}),createBaseState=(tr,rr)=>({auth:createAuthState(tr),document:createDocumentState(rr)});function generateId(tr){return generateUUID()}function getUnixTimestamp(tr){return(new Date(tr).getTime()/1e3).toFixed(0)}function buildOperationSignatureParams({documentId:tr,signer:rr,action:ir,previousStateHash:lr}){const{scope:dr,type:fr}=ir;return[getUnixTimestamp(new Date),rr.app.key,hash$1([tr,dr,fr,cjsModule(ir.input)].join("")),lr]}const textEncode=new TextEncoder;function buildOperationSignatureMessage(tr){const rr=tr.join(""),ir=`Signed Operation:
189
- `+rr.length.toString();return textEncode.encode(ir+rr)}function ab2hex$1(tr){const rr=ArrayBuffer.isView(tr)?tr:new Uint8Array(tr);return Array.prototype.map.call(rr,ir=>("00"+ir.toString(16)).slice(-2)).join("")}async function buildOperationSignature(tr,rr){const ir=buildOperationSignatureParams(tr),lr=buildOperationSignatureMessage(ir),dr=await rr(lr);return[...ir,`0x${ab2hex$1(dr)}`]}async function buildSignedAction(tr,rr,ir,lr,dr){var _r;const fr=rr(ir,tr,void 0,{reuseOperationResultingState:!0}),hr=fr.operations[tr.scope].at(-1);if(!hr)throw new Error("Action was not applied");const mr=((_r=fr.operations[tr.scope].at(-2))==null?void 0:_r.hash)??"",gr=await buildOperationSignature({documentId:ir.header.id,signer:lr,action:tr,previousStateHash:mr},dr),yr={signer:actionSigner(lr.user,lr.app,[...lr.signatures,gr])};return operationWithContext(hr,yr)}var IntegrityIssueType;(function(tr){tr.UNEXPECTED_INDEX="UNEXPECTED_INDEX"})(IntegrityIssueType||(IntegrityIssueType={}));var IntegrityIssueSubType;(function(tr){tr.DUPLICATED_INDEX="DUPLICATED_INDEX",tr.MISSING_INDEX="MISSING_INDEX"})(IntegrityIssueSubType||(IntegrityIssueSubType={}));function garbageCollect(tr){var lr,dr,fr;const rr=[];let ir=tr.length-1;for(;ir>-1;){rr.unshift(tr[ir]);const hr=(((lr=tr[ir])==null?void 0:lr.index)||0)-(((dr=tr[ir])==null?void 0:dr.skip)||0)-1;let mr=ir-1;for(;mr>-1&&(((fr=tr[mr])==null?void 0:fr.index)||0)>hr;)mr--;ir=mr}return rr}function sortOperations(tr){return tr.slice().sort((rr,ir)=>rr.skip-ir.skip).sort((rr,ir)=>rr.index-ir.index)}function reshuffleByTimestamp(tr,rr,ir){return[...rr,...ir].sort((lr,dr)=>new Date(lr.timestampUtcMs||"").getTime()-new Date(dr.timestampUtcMs||"").getTime()).map((lr,dr)=>({...lr,index:tr.index+dr,skip:dr===0?tr.skip:0}))}function operationsAreEqual(tr,rr){const ir=tr,lr=rr,dr={index:ir.index,skip:ir.skip,type:ir.type??null,scope:ir.scope??null,input:ir.input??null},fr={index:lr.index,skip:lr.skip,type:lr.type??null,scope:lr.scope??null,input:lr.input??null};return cjsModule(dr)===cjsModule(fr)}function attachBranch(tr,rr){const ir=garbageCollect(sortOperations(tr.slice())),lr=garbageCollect(sortOperations(rr.slice()));if(ir.length<1)return[lr,[]];const dr=[];let fr=!1;for(;lr.length>0;){const hr=lr[0];let mr=ir.shift();for(;mr&&precedes(mr,hr);)dr.push(mr),mr=ir.shift();if(mr?fr||(operationsAreEqual(mr,hr)?(lr.shift(),dr.push(mr)):(ir.unshift(mr),fr=!0)):fr=!0,fr){let gr=lr.shift();for(;gr;)dr.push(gr),gr=lr.shift()}}if(!fr){let hr=ir.shift();for(;hr;)dr.push(hr),hr=ir.shift()}return[garbageCollect(dr),ir]}function precedes(tr,rr){return tr.index<rr.index||tr.index===rr.index&&tr.id===rr.id&&tr.skip<rr.skip}function split$2(tr,rr){const ir=[],lr=[],dr=[],fr=Math.max(tr.length,rr.length);let hr=!1;for(let mr=0;mr<fr;mr++){const gr=tr[mr],yr=rr[mr];gr&&yr?!hr&&operationsAreEqual(gr,yr)?ir.push(gr):(hr=!0,lr.push(gr),dr.push(yr)):gr?lr.push(gr):yr&&dr.push(yr)}return[ir,lr,dr]}function merge(tr,rr,ir){const[lr,dr,fr]=split$2(garbageCollect(tr),garbageCollect(rr)),hr=getMaxIndex(lr),mr=1+Math.max(hr,getMaxIndex(dr),getMaxIndex(fr)),gr=filterDuplicatedOperations(fr,dr),yr=ir({index:mr,skip:mr-(hr+1)},dr,gr);return lr.concat(yr)}function getMaxIndex(tr){const rr=tr[tr.length-1];return rr?rr.index:-1}function nextSkipNumber(tr){var lr,dr,fr;if(tr.length<1)return-1;const rr=garbageCollect(tr);let ir=(((lr=rr[rr.length-1])==null?void 0:lr.skip)||0)+1;return rr.length>1&&(ir+=((dr=rr[rr.length-2])==null?void 0:dr.skip)||0),(((fr=rr[rr.length-1])==null?void 0:fr.index)||-1)<ir?-1:ir}function groupOperationsByScope(tr){return tr.reduce((ir,lr)=>{var dr;return ir[lr.action.scope]||(ir[lr.action.scope]=[]),(dr=ir[lr.action.scope])==null||dr.push(lr),ir},{})}function removeExistingOperations(tr,rr){return tr.filter(ir=>!rr.some(lr=>ir.action.type==="NOOP"&&ir.skip===0&&ir.index===lr.index||ir.index===lr.index&&ir.skip===lr.skip&&ir.action.scope===lr.action.scope&&ir.hash===lr.hash&&ir.action.type===lr.action.type))}function skipHeaderOperations(tr,rr){const ir=sortOperations(tr).at(-1),lr=(ir==null?void 0:ir.index)??-1,dr=lr+1,fr={...rr,index:rr.index??dr};if(fr.index<lr)throw new Error(`The skip header operation index must be greater than or equal to ${lr}`);return garbageCollect(sortOperations([...tr,fr])).slice(0,-1)}function garbageCollectDocumentOperations(tr){return Object.entries(tr).reduce((ir,lr)=>{const[dr,fr]=lr;return{...ir,[dr]:garbageCollect(sortOperations(fr))}},{})}function filterDuplicatedOperations(tr,rr){return tr.filter(ir=>ir.id?!rr.some(lr=>lr.id===ir.id):!0)}function filterDocumentOperationsResultingState(tr){return tr?Object.entries(tr).reduce((ir,[lr,dr])=>({...ir,[lr]:dr.map(fr=>{const{resultingState:hr,...mr}=fr;return mr})}),{}):{}}function diffOperations(tr,rr){return tr.filter(ir=>!rr.some(lr=>ir.index===lr.index))}const isDefinedNonNullAny$1=tr=>tr!=null;anyType().refine(tr=>isDefinedNonNullAny$1(tr));const Load_StateSchema=enumType(["LOAD_STATE"]),PruneSchema=enumType(["PRUNE"]),RedoSchema=enumType(["REDO"]),Set_NameSchema=enumType(["SET_NAME"]),UndoSchema=enumType(["UNDO"]);function OperationScopeSchema(){return stringType()}function DocumentActionSchema(){return unionType([LoadStateActionSchema(),PruneActionSchema(),RedoActionSchema(),SetNameActionSchema(),UndoActionSchema()])}function LoadStateActionSchema(){return objectType({id:stringType(),timestampUtcMs:stringType(),input:lazyType(()=>LoadStateActionInputSchema()),type:Load_StateSchema,scope:OperationScopeSchema()})}function LoadStateActionInputSchema(){return objectType({operations:numberType(),state:lazyType(()=>LoadStateActionStateInputSchema())})}function LoadStateActionStateInputSchema(){return objectType({data:unknownType().nullish(),name:stringType()})}function PruneActionSchema(){return objectType({id:stringType(),timestampUtcMs:stringType(),input:lazyType(()=>PruneActionInputSchema()),type:PruneSchema,scope:OperationScopeSchema()})}function PruneActionInputSchema(){return objectType({end:numberType().nullish(),start:numberType().nullish()})}const RedoActionInputSchema=numberType;function RedoActionSchema(){return objectType({id:stringType(),timestampUtcMs:stringType().datetime(),input:RedoActionInputSchema(),type:RedoSchema,scope:OperationScopeSchema()})}const SetNameActionInputSchema=stringType;function SetNameActionSchema(){return objectType({id:stringType(),timestampUtcMs:stringType().datetime(),input:SetNameActionInputSchema(),type:Set_NameSchema,scope:literalType("global")})}const UndoActionInputSchema=numberType;function UndoActionSchema(){return objectType({id:stringType(),timestampUtcMs:stringType().datetime(),input:UndoActionInputSchema(),type:UndoSchema,scope:OperationScopeSchema()})}const setName=tr=>createAction("SET_NAME",tr,void 0,SetNameActionInputSchema,"global"),undo=(tr=1,rr="global")=>createAction("UNDO",tr,void 0,UndoActionInputSchema,rr),redo=(tr=1,rr="global")=>createAction("REDO",tr,void 0,RedoActionInputSchema,rr),prune=(tr,rr,ir="global")=>createAction("PRUNE",{start:tr,end:rr},void 0,PruneActionInputSchema,ir),loadState=(tr,rr)=>createAction("LOAD_STATE",{state:tr,operations:rr},void 0,LoadStateActionInputSchema),noop$4=(tr="global")=>createAction("NOOP",void 0,void 0,void 0,tr),actions$1={setName,undo,redo,prune,noop:noop$4};function setNameOperation(tr,rr){return{...tr,header:{...tr.header,name:rr}}}function undoOperation(tr,rr,ir){const{scope:lr}=rr;return create$1({document:tr,action:rr,skip:ir,reuseLastOperationIndex:!1},fr=>{const hr=[...tr.operations[lr]],mr=sortOperations(hr);fr.action=noop$4(lr);const gr=mr.at(-1);let yr=(gr==null?void 0:gr.index)??-1;const _r=(gr==null?void 0:gr.action.type)!=="NOOP";_r?yr=yr+1:fr.reuseLastOperationIndex=!0;const br=_r?[...mr,{index:yr,skip:0}]:mr;if(fr.skip=nextSkipNumber(br),gr&&fr.skip>gr.skip+1&&(fr.skip=fr.skip+1),fr.skip<0)throw new Error("Cannot undo: you can't undo more operations than the ones in the scope history")})}function redoOperation(tr,rr,ir){const{scope:lr,input:dr}=rr;return create$1({document:tr,action:rr,skip:ir,reuseLastOperationIndex:!1},hr=>{if(hr.skip>0)throw new Error("Cannot redo: skip value from reducer cannot be used with REDO action");if(typeof dr!="number"||dr>1)throw new Error("Cannot redo: you can only redo one operation at a time");if(typeof dr!="number"||dr<1)throw new Error("Invalid REDO action: invalid redo input value");if(hr.document.clipboard.length<1)throw new Error("Cannot redo: no operations in the clipboard");const mr=hr.document.clipboard.findLastIndex(yr=>yr.action.scope===lr);if(mr<0)throw new Error(`Cannot redo: no operations in clipboard for scope "${lr}"`);const gr=hr.document.clipboard.splice(mr,1)[0];hr.action={type:gr.action.type,scope:gr.action.scope,input:gr.action.input}})}function pruneOperation(tr,rr,ir){const lr=tr.operations.global;let{start:dr,end:fr}=rr;dr=dr||0,fr=fr||lr.length;const hr=lr.slice(dr,fr),mr=lr.slice(0,dr),gr=lr.slice(fr),yr=replayOperations(tr.initialState,{...tr.operations,global:mr.concat(hr)},ir),_r=yr.state,br=yr.header.name,vr=mr.length,wr=mr.length?mr[mr.length-1].timestampUtcMs:gr.length?gr[0].timestampUtcMs:new Date().toISOString(),xr=loadState({name:br,..._r},hr.length);return replayOperations(tr.initialState,{...tr.operations,global:[...mr,{skip:0,...xr,action:xr,timestampUtcMs:wr,index:vr,hash:hashDocumentStateForScope({state:_r},"global")},...gr.map((Sr,Ar)=>({...Sr,index:vr+Ar+1}))]},ir)}function loadStateOperation(tr,rr){return{...tr,header:{...tr.header,name:rr.state.name},state:rr.state.data}}function getNextRevision(tr,rr){var lr;return(((lr=tr.operations[rr].at(-1))==null?void 0:lr.index)??-1??-1)+1}function updateHeaderRevision(tr,rr){const ir={...tr.header,revision:{...tr.header.revision,[rr]:getNextRevision(tr,rr)},lastModifiedAtUtcIso:getDocumentLastModified(tr)};return{...tr,header:ir}}function updateOperationsForAction(tr,rr,ir=!1,lr=0){if([UNDO,REDO,PRUNE].includes(rr.type))return tr;const dr=rr.scope,fr=tr.operations[dr].slice(),hr=fr.sort((_r,br)=>_r.index-br.index).at(-1),mr=(hr==null?void 0:hr.index)??-1,gr=ir?mr:mr+1,yr=operationFromAction(rr,gr,lr);return fr.push(yr),{...tr,operations:{...tr.operations,[dr]:fr}}}function updateOperationsForOperation(tr,rr,ir=!1,lr=0){const dr=rr.action.scope,fr=tr.operations[dr].slice(),hr=fr.sort((_r,br)=>_r.index-br.index).at(-1),mr=(hr==null?void 0:hr.index)??-1,gr=ir?mr:mr+1;if(rr.index-lr>gr)throw new Error(`Missing operations: expected ${gr} with skip 0 or equivalent, got index ${rr.index} with skip ${lr}`);const yr=operationFromOperation(rr,lr);return fr.push(yr),{...tr,operations:{...tr.operations,[dr]:fr}}}function updateDocument(tr,rr,ir=!1,lr=0,dr){let fr;return dr?fr=updateOperationsForOperation(tr,dr,ir,lr):fr=updateOperationsForAction(tr,rr,ir,lr),fr=updateHeaderRevision(fr,rr.scope),fr}function _baseReducer(tr,rr,ir){const lr=DocumentActionSchema().parse(rr);switch(lr.type){case SET_NAME:return setNameOperation(tr,lr.input);case PRUNE:return pruneOperation(tr,lr.input,ir);case LOAD_STATE:return loadStateOperation(tr,lr.input);default:return tr}}function processUndoRedo(tr,rr,ir){switch(rr.type){case UNDO:return undoOperation(tr,rr,ir);case REDO:return redoOperation(tr,rr,ir);default:return{document:tr,action:rr,skip:ir,reuseLastOperationIndex:!1}}}function processSkipOperation(tr,rr,ir,lr,dr=!1,fr=parseResultingState){const hr=rr.scope,mr=tr.operations[hr].at(-1);if(!mr)return tr;const gr=garbageCollectDocumentOperations({...tr.operations,[hr]:skipHeaderOperations(tr.operations[hr],mr)});let yr;const _r=gr[hr].at(-1);if(dr&&(_r!=null&&_r.resultingState))yr=fr(_r.resultingState);else{const{state:br}=replayOperations(tr.initialState,gr,ir,void 0,void 0,void 0,void 0,{reuseOperationResultingState:dr,operationResultingStateParser:fr});yr=br[hr]}return{...tr,state:{...tr.state,[hr]:yr},operations:garbageCollectDocumentOperations({...tr.operations})}}function processUndoOperation(tr,rr,ir,lr=!1,dr=parseResultingState){const fr=[...tr.operations[rr]],hr=sortOperations(fr);hr.pop();const mr=garbageCollectDocumentOperations({...tr.operations}),gr=[...mr[rr]],yr=diffOperations(garbageCollect(hr),gr),_r=replayOperations(tr.initialState,mr,ir,void 0,void 0,void 0,void 0,{reuseOperationResultingState:lr,operationResultingStateParser:dr}),br=sortOperations([...tr.clipboard,...yr].filter(vr=>vr.action.type!=="NOOP")).reverse();return{..._r,clipboard:br}}function baseReducer(tr,rr,ir,lr,dr={}){var Or,$r,Dr;const{skip:fr,ignoreSkipOperations:hr=!1,reuseOperationResultingState:mr=!1,operationResultingStateParser:gr,pruneOnSkip:yr=!0}=dr;let _r=actionFromAction(rr),br=fr??((Or=dr.replayOptions)==null?void 0:Or.operation.skip)??0,vr={...tr},wr=!1;const xr=!hr&&br>0;if(isUndoRedo(_r)){const{skip:zr,action:Fr,document:Jr,reuseLastOperationIndex:$n}=processUndoRedo(tr,_r,br);_r=Fr,br=zr,vr=Jr,wr=$n}else vr={...vr,clipboard:[]};if(isDocumentAction(_r)&&(vr=_baseReducer(vr,_r,ir)),vr=updateDocument(vr,_r,wr,br,($r=dr.replayOptions)==null?void 0:$r.operation),isUndo(rr))return processUndoOperation(vr,rr.scope,ir);if(xr){const zr=processSkipOperation(vr,_r,ir,br,mr,gr);yr?vr=zr:vr={...zr,operations:vr.operations}}if(vr=create$1(vr,zr=>{try{const Fr=ir(zr.state,_r,lr);Fr&&unsafe(()=>{zr.state=Fr})}catch(Fr){const Jr=vr.operations[_r.scope].length-1;zr.operations[_r.scope][Jr].error=Fr.message,zr.operations[_r.scope][Jr].skip=0,xr&&(zr.state={...tr.state},zr.operations={...tr.operations,[_r.scope]:[...tr.operations[_r.scope],{...zr.operations[_r.scope][Jr]}]})}}),[UNDO,REDO,PRUNE].includes(_r.type))return vr;const Ar=_r.scope||"global";let Ir=hashDocumentStateForScope(vr,Ar);(Dr=dr.replayOptions)!=null&&Dr.operation.hash&&dr.replayOptions.operation.hash!==""&&(Ir=dr.replayOptions.operation.hash);const Mr=vr.operations[Ar].at(-1);return Mr&&(Mr.hash=Ir,mr&&(Mr.resultingState=JSON.stringify(vr.state[Ar])),!isDocumentAction(_r)&&_r.attachments&&_r.attachments.forEach(zr=>{const{hash:Fr,...Jr}=zr;vr.attachments||(vr.attachments={}),vr.attachments[Fr]={...Jr}})),vr}class InvalidActionInputError extends Error{constructor(ir){super();ki(this,"data");this.name="InvalidActionInputError",this.data=ir,this.message=this.message||`Invalid action input: ${JSON.stringify(ir,null,2)}`}}class InvalidActionInputZodError extends InvalidActionInputError{constructor(ir){super(ir);ki(this,"issues");this.issues=ir,this.name="InvalidActionInputZodError"}}const scriptRel="modulepreload",assetsURL=function(tr,rr){return new URL(tr,rr).href},seen={},__vitePreload=function(rr,ir,lr){let dr=Promise.resolve();if(ir&&ir.length>0){let hr=function(_r){return Promise.all(_r.map(br=>Promise.resolve(br).then(vr=>({status:"fulfilled",value:vr}),vr=>({status:"rejected",reason:vr}))))};const mr=document.getElementsByTagName("link"),gr=document.querySelector("meta[property=csp-nonce]"),yr=(gr==null?void 0:gr.nonce)||(gr==null?void 0:gr.getAttribute("nonce"));dr=hr(ir.map(_r=>{if(_r=assetsURL(_r,lr),_r in seen)return;seen[_r]=!0;const br=_r.endsWith(".css"),vr=br?'[rel="stylesheet"]':"";if(!!lr)for(let Sr=mr.length-1;Sr>=0;Sr--){const Ar=mr[Sr];if(Ar.href===_r&&(!br||Ar.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${_r}"]${vr}`))return;const xr=document.createElement("link");if(xr.rel=br?"stylesheet":scriptRel,br||(xr.as="script"),xr.crossOrigin="",xr.href=_r,yr&&xr.setAttribute("nonce",yr),document.head.appendChild(xr),br)return new Promise((Sr,Ar)=>{xr.addEventListener("load",Sr),xr.addEventListener("error",()=>Ar(new Error(`Unable to preload CSS for ${_r}`)))})}))}function fr(hr){const mr=new Event("vite:preloadError",{cancelable:!0});if(mr.payload=hr,window.dispatchEvent(mr),!mr.defaultPrevented)throw hr}return dr.then(hr=>{for(const mr of hr||[])mr.status==="rejected"&&fr(mr.reason);return rr().catch(fr)})},generateStablePayload=tr=>`${tr.documentType}:${tr.createdAtUtcIso}:${tr.nonce}`;var nu,Oc,Wd;class PublicKeySigner{constructor(rr){Ri(this,Oc);Ri(this,nu);ki(this,"subtleCrypto");ki(this,"publicCryptoKey");Ni(this,nu,rr),this.subtleCrypto=Bi(this,Oc,Wd).call(this)}async publicKey(){return kr(this,nu)}async sign(rr){throw new Error("PublicKeySigner only supports verification")}async verify(rr,ir){const lr=await this.subtleCrypto;this.publicCryptoKey||(this.publicCryptoKey=await lr.importKey("jwk",kr(this,nu),{name:"Ed25519",namedCurve:"Ed25519"},!0,["verify"]));let dr;try{dr=await lr.verify("Ed25519",this.publicCryptoKey,ir,rr)}catch{throw new Error("invalid signature")}if(!dr)throw new Error("invalid signature")}}nu=new WeakMap,Oc=new WeakSet,Wd=function(){return new Promise((rr,ir)=>{var lr;typeof window>"u"?__vitePreload(()=>import("node:crypto"),[],import.meta.url).then(dr=>{rr(dr.webcrypto.subtle)}).catch(ir):((lr=window.crypto)!=null&&lr.subtle||ir(new Error("Crypto module not available")),rr(window.crypto.subtle))})};const createSignerFromHeader=async tr=>new PublicKeySigner(tr.sig.publicKey),verify=async(tr,rr,ir)=>{const lr=generateStablePayload(tr),fr=new TextEncoder().encode(lr),hr=Uint8Array.from(atob(rr),mr=>mr.charCodeAt(0));await ir.verify(fr,hr)},validateHeader=async tr=>{const rr=await createSignerFromHeader(tr);return await verify({documentType:tr.documentType,createdAtUtcIso:tr.createdAtUtcIso,nonce:tr.sig.nonce},tr.id,rr)},createUnsignedHeader=(tr=generateUUID(),rr="")=>({id:tr,sig:{publicKey:{},nonce:""},documentType:rr,createdAtUtcIso:new Date().toISOString(),slug:"",name:"",branch:"main",revision:{document:0},lastModifiedAtUtcIso:new Date().toISOString(),meta:{}});function isUndoRedo(tr){return[UNDO,REDO].includes(tr.type)}function isUndo(tr){return tr.type===UNDO}function isDocumentAction(tr){return[SET_NAME,UNDO,REDO,PRUNE,LOAD_STATE].includes(tr.type)}function createAction(tr,rr,ir,lr,dr="global"){if(!tr)throw new Error("Empty action type");if(typeof tr!="string")throw new Error(`Invalid action type: ${JSON.stringify(tr)}`);const fr={id:generateId(),timestampUtcMs:new Date().toISOString(),type:tr,input:rr,scope:dr};try{lr==null||lr().parse(fr.input)}catch(hr){throw hr instanceof ZodError?new InvalidActionInputZodError(hr.issues):new InvalidActionInputError(hr)}return fr}function createReducer(tr,rr=baseReducer){return(lr,dr,fr,hr)=>rr(lr,dr,tr,fr,hr)}function baseCreateDocument(tr,rr){const ir=tr(rr);return{header:createUnsignedHeader(),state:ir,initialState:ir,operations:{global:[],local:[]},clipboard:[],attachments:{},history:[]}}function hashDocumentStateForScope(tr,rr="global"){const ir=cjsModule(tr.state[rr]||"");return hash$1(ir)}function getDocumentLastModified(tr){return sortOperations(Object.values(tr.operations).flat()).at(-1).timestampUtcMs||tr.header.lastModifiedAtUtcIso}const defaultCreateState=tr=>tr;function replayOperations(tr,rr,ir,lr,dr,fr=baseReducer,hr={},mr){const gr=createReducer(ir,fr);return replayDocument(tr,rr,gr,lr,dr,hr,mr)}function replayDocument(tr,rr,ir,lr,dr,fr={},hr){const{checkHashes:mr=!0,reuseOperationResultingState:gr,operationResultingStateParser:yr=parseResultingState}=hr||{};let _r=tr;const br=[],vr={global:[],local:[]};if(gr)for(const[Ir,Mr]of Object.entries(rr)){const Or=Mr.findLastIndex(Dr=>!!Dr.resultingState);if(Or<0){br.push(...Mr);continue}const $r=Mr[Or];if($r.resultingState)try{const Dr=yr($r.resultingState);_r={..._r,[Ir]:Dr},vr[Ir].push(...Mr.slice(0,Or+1)),br.push(...Mr.slice(Or+1))}catch{br.push(...Mr)}}else br.push(...Object.values(rr).flat());const wr=baseCreateDocument(defaultCreateState,_r);dr!=null&&dr.slug&&(wr.header.slug=dr.slug),wr.initialState=tr,wr.operations=vr;let xr=wr;if(br.length)xr=br.reduce((Ir,Mr)=>ir(Ir,Mr.action,lr,{ignoreSkipOperations:!0,checkHashes:mr,replayOptions:{operation:Mr}}),wr);else for(const Ir of Object.values(vr)){const Mr=Ir.at(-1);Mr&&(xr=updateHeaderRevision(xr,Mr.action.scope))}if(!mr)for(const Ir of Object.keys(xr.state))for(let Mr=br.length-1;Mr>=0;Mr--){const Or=br[Mr];if(Or.action.scope===Ir){if(Or.hash!==hashDocumentStateForScope(xr,Ir))throw new Error(`Hash mismatch for scope ${Ir}`);break}}const Sr=Object.keys(xr.operations).reduce((Ir,Mr)=>{const Or=Mr;return{...Ir,[Or]:[...xr.operations[Or].map(($r,Dr)=>{var zr;return{...$r,timestamp:((zr=rr[Or][Dr])==null?void 0:zr.timestampUtcMs)??$r.timestampUtcMs}})]}},{global:[],local:[]}),Ar=dr?dr.lastModifiedAtUtcIso:Object.values(Sr).reduce((Ir,Mr)=>{const Or=Mr.at(-1);return Or&&Or.timestampUtcMs>Ir?Or.timestampUtcMs:Ir},wr.header.lastModifiedAtUtcIso);return dr&&(xr.header={...dr,revision:xr.header.revision,lastModifiedAtUtcIso:Ar}),{...xr,operations:Sr}}function parseResultingState(tr){const rr=typeof tr;if(rr==="string")return JSON.parse(tr);if(rr==="object")return tr;throw new Error(`Providing resulting state is of type: ${rr}`)}function commonjsRequire(tr){throw new Error('Could not dynamically require "'+tr+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var jszip_min={exports:{}},hasRequiredJszip_min;function requireJszip_min(){return hasRequiredJszip_min||(hasRequiredJszip_min=1,(function(tr,rr){(function(ir){tr.exports=ir()})(function(){return(function ir(lr,dr,fr){function hr(yr,_r){if(!dr[yr]){if(!lr[yr]){var br=typeof commonjsRequire=="function"&&commonjsRequire;if(!_r&&br)return br(yr,!0);if(mr)return mr(yr,!0);var vr=new Error("Cannot find module '"+yr+"'");throw vr.code="MODULE_NOT_FOUND",vr}var wr=dr[yr]={exports:{}};lr[yr][0].call(wr.exports,function(xr){var Sr=lr[yr][1][xr];return hr(Sr||xr)},wr,wr.exports,ir,lr,dr,fr)}return dr[yr].exports}for(var mr=typeof commonjsRequire=="function"&&commonjsRequire,gr=0;gr<fr.length;gr++)hr(fr[gr]);return hr})({1:[function(ir,lr,dr){var fr=ir("./utils"),hr=ir("./support"),mr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";dr.encode=function(gr){for(var yr,_r,br,vr,wr,xr,Sr,Ar=[],Ir=0,Mr=gr.length,Or=Mr,$r=fr.getTypeOf(gr)!=="string";Ir<gr.length;)Or=Mr-Ir,br=$r?(yr=gr[Ir++],_r=Ir<Mr?gr[Ir++]:0,Ir<Mr?gr[Ir++]:0):(yr=gr.charCodeAt(Ir++),_r=Ir<Mr?gr.charCodeAt(Ir++):0,Ir<Mr?gr.charCodeAt(Ir++):0),vr=yr>>2,wr=(3&yr)<<4|_r>>4,xr=1<Or?(15&_r)<<2|br>>6:64,Sr=2<Or?63&br:64,Ar.push(mr.charAt(vr)+mr.charAt(wr)+mr.charAt(xr)+mr.charAt(Sr));return Ar.join("")},dr.decode=function(gr){var yr,_r,br,vr,wr,xr,Sr=0,Ar=0,Ir="data:";if(gr.substr(0,Ir.length)===Ir)throw new Error("Invalid base64 input, it looks like a data url.");var Mr,Or=3*(gr=gr.replace(/[^A-Za-z0-9+/=]/g,"")).length/4;if(gr.charAt(gr.length-1)===mr.charAt(64)&&Or--,gr.charAt(gr.length-2)===mr.charAt(64)&&Or--,Or%1!=0)throw new Error("Invalid base64 input, bad content length.");for(Mr=hr.uint8array?new Uint8Array(0|Or):new Array(0|Or);Sr<gr.length;)yr=mr.indexOf(gr.charAt(Sr++))<<2|(vr=mr.indexOf(gr.charAt(Sr++)))>>4,_r=(15&vr)<<4|(wr=mr.indexOf(gr.charAt(Sr++)))>>2,br=(3&wr)<<6|(xr=mr.indexOf(gr.charAt(Sr++))),Mr[Ar++]=yr,wr!==64&&(Mr[Ar++]=_r),xr!==64&&(Mr[Ar++]=br);return Mr}},{"./support":30,"./utils":32}],2:[function(ir,lr,dr){var fr=ir("./external"),hr=ir("./stream/DataWorker"),mr=ir("./stream/Crc32Probe"),gr=ir("./stream/DataLengthProbe");function yr(_r,br,vr,wr,xr){this.compressedSize=_r,this.uncompressedSize=br,this.crc32=vr,this.compression=wr,this.compressedContent=xr}yr.prototype={getContentWorker:function(){var _r=new hr(fr.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new gr("data_length")),br=this;return _r.on("end",function(){if(this.streamInfo.data_length!==br.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),_r},getCompressedWorker:function(){return new hr(fr.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},yr.createWorkerFrom=function(_r,br,vr){return _r.pipe(new mr).pipe(new gr("uncompressedSize")).pipe(br.compressWorker(vr)).pipe(new gr("compressedSize")).withStreamInfo("compression",br)},lr.exports=yr},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(ir,lr,dr){var fr=ir("./stream/GenericWorker");dr.STORE={magic:"\0\0",compressWorker:function(){return new fr("STORE compression")},uncompressWorker:function(){return new fr("STORE decompression")}},dr.DEFLATE=ir("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(ir,lr,dr){var fr=ir("./utils"),hr=(function(){for(var mr,gr=[],yr=0;yr<256;yr++){mr=yr;for(var _r=0;_r<8;_r++)mr=1&mr?3988292384^mr>>>1:mr>>>1;gr[yr]=mr}return gr})();lr.exports=function(mr,gr){return mr!==void 0&&mr.length?fr.getTypeOf(mr)!=="string"?(function(yr,_r,br,vr){var wr=hr,xr=vr+br;yr^=-1;for(var Sr=vr;Sr<xr;Sr++)yr=yr>>>8^wr[255&(yr^_r[Sr])];return-1^yr})(0|gr,mr,mr.length,0):(function(yr,_r,br,vr){var wr=hr,xr=vr+br;yr^=-1;for(var Sr=vr;Sr<xr;Sr++)yr=yr>>>8^wr[255&(yr^_r.charCodeAt(Sr))];return-1^yr})(0|gr,mr,mr.length,0):0}},{"./utils":32}],5:[function(ir,lr,dr){dr.base64=!1,dr.binary=!1,dr.dir=!1,dr.createFolders=!0,dr.date=null,dr.compression=null,dr.compressionOptions=null,dr.comment=null,dr.unixPermissions=null,dr.dosPermissions=null},{}],6:[function(ir,lr,dr){var fr=null;fr=typeof Promise<"u"?Promise:ir("lie"),lr.exports={Promise:fr}},{lie:37}],7:[function(ir,lr,dr){var fr=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",hr=ir("pako"),mr=ir("./utils"),gr=ir("./stream/GenericWorker"),yr=fr?"uint8array":"array";function _r(br,vr){gr.call(this,"FlateWorker/"+br),this._pako=null,this._pakoAction=br,this._pakoOptions=vr,this.meta={}}dr.magic="\b\0",mr.inherits(_r,gr),_r.prototype.processChunk=function(br){this.meta=br.meta,this._pako===null&&this._createPako(),this._pako.push(mr.transformTo(yr,br.data),!1)},_r.prototype.flush=function(){gr.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},_r.prototype.cleanUp=function(){gr.prototype.cleanUp.call(this),this._pako=null},_r.prototype._createPako=function(){this._pako=new hr[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var br=this;this._pako.onData=function(vr){br.push({data:vr,meta:br.meta})}},dr.compressWorker=function(br){return new _r("Deflate",br)},dr.uncompressWorker=function(){return new _r("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(ir,lr,dr){function fr(wr,xr){var Sr,Ar="";for(Sr=0;Sr<xr;Sr++)Ar+=String.fromCharCode(255&wr),wr>>>=8;return Ar}function hr(wr,xr,Sr,Ar,Ir,Mr){var Or,$r,Dr=wr.file,zr=wr.compression,Fr=Mr!==yr.utf8encode,Jr=mr.transformTo("string",Mr(Dr.name)),$n=mr.transformTo("string",yr.utf8encode(Dr.name)),Qr=Dr.comment,Zn=mr.transformTo("string",Mr(Qr)),qn=mr.transformTo("string",yr.utf8encode(Qr)),Xn=$n.length!==Dr.name.length,Lr=qn.length!==Qr.length,Gr="",Hn="",ii="",oi=Dr.dir,ri=Dr.date,ti={crc32:0,compressedSize:0,uncompressedSize:0};xr&&!Sr||(ti.crc32=wr.crc32,ti.compressedSize=wr.compressedSize,ti.uncompressedSize=wr.uncompressedSize);var si=0;xr&&(si|=8),Fr||!Xn&&!Lr||(si|=2048);var Jn=0,ni=0;oi&&(Jn|=16),Ir==="UNIX"?(ni=798,Jn|=(function(ei,ai){var pi=ei;return ei||(pi=ai?16893:33204),(65535&pi)<<16})(Dr.unixPermissions,oi)):(ni=20,Jn|=(function(ei){return 63&(ei||0)})(Dr.dosPermissions)),Or=ri.getUTCHours(),Or<<=6,Or|=ri.getUTCMinutes(),Or<<=5,Or|=ri.getUTCSeconds()/2,$r=ri.getUTCFullYear()-1980,$r<<=4,$r|=ri.getUTCMonth()+1,$r<<=5,$r|=ri.getUTCDate(),Xn&&(Hn=fr(1,1)+fr(_r(Jr),4)+$n,Gr+="up"+fr(Hn.length,2)+Hn),Lr&&(ii=fr(1,1)+fr(_r(Zn),4)+qn,Gr+="uc"+fr(ii.length,2)+ii);var Yn="";return Yn+=`
189
+ `+rr.length.toString();return textEncode.encode(ir+rr)}function ab2hex$1(tr){const rr=ArrayBuffer.isView(tr)?tr:new Uint8Array(tr);return Array.prototype.map.call(rr,ir=>("00"+ir.toString(16)).slice(-2)).join("")}async function buildOperationSignature(tr,rr){const ir=buildOperationSignatureParams(tr),lr=buildOperationSignatureMessage(ir),dr=await rr(lr);return[...ir,`0x${ab2hex$1(dr)}`]}async function buildSignedAction(tr,rr,ir,lr,dr){var _r;const fr=rr(ir,tr,void 0,{reuseOperationResultingState:!0}),hr=fr.operations[tr.scope].at(-1);if(!hr)throw new Error("Action was not applied");const mr=((_r=fr.operations[tr.scope].at(-2))==null?void 0:_r.hash)??"",gr=await buildOperationSignature({documentId:ir.header.id,signer:lr,action:tr,previousStateHash:mr},dr),yr={signer:actionSigner(lr.user,lr.app,[...lr.signatures,gr])};return operationWithContext(hr,yr)}var IntegrityIssueType;(function(tr){tr.UNEXPECTED_INDEX="UNEXPECTED_INDEX"})(IntegrityIssueType||(IntegrityIssueType={}));var IntegrityIssueSubType;(function(tr){tr.DUPLICATED_INDEX="DUPLICATED_INDEX",tr.MISSING_INDEX="MISSING_INDEX"})(IntegrityIssueSubType||(IntegrityIssueSubType={}));function garbageCollect(tr){var lr,dr,fr;const rr=[];let ir=tr.length-1;for(;ir>-1;){rr.unshift(tr[ir]);const hr=(((lr=tr[ir])==null?void 0:lr.index)||0)-(((dr=tr[ir])==null?void 0:dr.skip)||0)-1;let mr=ir-1;for(;mr>-1&&(((fr=tr[mr])==null?void 0:fr.index)||0)>hr;)mr--;ir=mr}return rr}function sortOperations(tr){return tr.slice().sort((rr,ir)=>rr.skip-ir.skip).sort((rr,ir)=>rr.index-ir.index)}function reshuffleByTimestamp(tr,rr,ir){return[...rr,...ir].sort((lr,dr)=>new Date(lr.timestampUtcMs||"").getTime()-new Date(dr.timestampUtcMs||"").getTime()).map((lr,dr)=>({...lr,index:tr.index+dr,skip:dr===0?tr.skip:0}))}function operationsAreEqual(tr,rr){const ir=tr,lr=rr,dr={index:ir.index,skip:ir.skip,type:ir.type??null,scope:ir.scope??null,input:ir.input??null},fr={index:lr.index,skip:lr.skip,type:lr.type??null,scope:lr.scope??null,input:lr.input??null};return cjsModule(dr)===cjsModule(fr)}function attachBranch(tr,rr){const ir=garbageCollect(sortOperations(tr.slice())),lr=garbageCollect(sortOperations(rr.slice()));if(ir.length<1)return[lr,[]];const dr=[];let fr=!1;for(;lr.length>0;){const hr=lr[0];let mr=ir.shift();for(;mr&&precedes(mr,hr);)dr.push(mr),mr=ir.shift();if(mr?fr||(operationsAreEqual(mr,hr)?(lr.shift(),dr.push(mr)):(ir.unshift(mr),fr=!0)):fr=!0,fr){let gr=lr.shift();for(;gr;)dr.push(gr),gr=lr.shift()}}if(!fr){let hr=ir.shift();for(;hr;)dr.push(hr),hr=ir.shift()}return[garbageCollect(dr),ir]}function precedes(tr,rr){return tr.index<rr.index||tr.index===rr.index&&tr.id===rr.id&&tr.skip<rr.skip}function split$2(tr,rr){const ir=[],lr=[],dr=[],fr=Math.max(tr.length,rr.length);let hr=!1;for(let mr=0;mr<fr;mr++){const gr=tr[mr],yr=rr[mr];gr&&yr?!hr&&operationsAreEqual(gr,yr)?ir.push(gr):(hr=!0,lr.push(gr),dr.push(yr)):gr?lr.push(gr):yr&&dr.push(yr)}return[ir,lr,dr]}function merge(tr,rr,ir){const[lr,dr,fr]=split$2(garbageCollect(tr),garbageCollect(rr)),hr=getMaxIndex(lr),mr=1+Math.max(hr,getMaxIndex(dr),getMaxIndex(fr)),gr=filterDuplicatedOperations(fr,dr),yr=ir({index:mr,skip:mr-(hr+1)},dr,gr);return lr.concat(yr)}function getMaxIndex(tr){const rr=tr[tr.length-1];return rr?rr.index:-1}function nextSkipNumber(tr){var lr,dr,fr;if(tr.length<1)return-1;const rr=garbageCollect(tr);let ir=(((lr=rr[rr.length-1])==null?void 0:lr.skip)||0)+1;return rr.length>1&&(ir+=((dr=rr[rr.length-2])==null?void 0:dr.skip)||0),(((fr=rr[rr.length-1])==null?void 0:fr.index)||-1)<ir?-1:ir}function groupOperationsByScope(tr){return tr.reduce((ir,lr)=>{var dr;return ir[lr.action.scope]||(ir[lr.action.scope]=[]),(dr=ir[lr.action.scope])==null||dr.push(lr),ir},{})}function removeExistingOperations(tr,rr){return tr.filter(ir=>!rr.some(lr=>ir.action.type==="NOOP"&&ir.skip===0&&ir.index===lr.index||ir.index===lr.index&&ir.skip===lr.skip&&ir.action.scope===lr.action.scope&&ir.hash===lr.hash&&ir.action.type===lr.action.type))}function skipHeaderOperations(tr,rr){const ir=sortOperations(tr).at(-1),lr=(ir==null?void 0:ir.index)??-1,dr=lr+1,fr={...rr,index:rr.index??dr};if(fr.index<lr)throw new Error(`The skip header operation index must be greater than or equal to ${lr}`);return garbageCollect(sortOperations([...tr,fr])).slice(0,-1)}function garbageCollectDocumentOperations(tr){return Object.entries(tr).reduce((ir,lr)=>{const[dr,fr]=lr;return{...ir,[dr]:garbageCollect(sortOperations(fr))}},{})}function filterDuplicatedOperations(tr,rr){return tr.filter(ir=>ir.id?!rr.some(lr=>lr.id===ir.id):!0)}function filterDocumentOperationsResultingState(tr){return tr?Object.entries(tr).reduce((ir,[lr,dr])=>({...ir,[lr]:dr.map(fr=>{const{resultingState:hr,...mr}=fr;return mr})}),{}):{}}function diffOperations(tr,rr){return tr.filter(ir=>!rr.some(lr=>ir.index===lr.index))}const isDefinedNonNullAny$1=tr=>tr!=null;anyType().refine(tr=>isDefinedNonNullAny$1(tr));const Load_StateSchema=enumType(["LOAD_STATE"]),PruneSchema=enumType(["PRUNE"]),RedoSchema=enumType(["REDO"]),Set_NameSchema=enumType(["SET_NAME"]),UndoSchema=enumType(["UNDO"]);function OperationScopeSchema(){return stringType()}function DocumentActionSchema(){return unionType([LoadStateActionSchema(),PruneActionSchema(),RedoActionSchema(),SetNameActionSchema(),UndoActionSchema()])}function LoadStateActionSchema(){return objectType({id:stringType(),timestampUtcMs:stringType(),input:lazyType(()=>LoadStateActionInputSchema()),type:Load_StateSchema,scope:OperationScopeSchema()})}function LoadStateActionInputSchema(){return objectType({operations:numberType(),state:lazyType(()=>LoadStateActionStateInputSchema())})}function LoadStateActionStateInputSchema(){return objectType({data:unknownType().nullish(),name:stringType()})}function PruneActionSchema(){return objectType({id:stringType(),timestampUtcMs:stringType(),input:lazyType(()=>PruneActionInputSchema()),type:PruneSchema,scope:OperationScopeSchema()})}function PruneActionInputSchema(){return objectType({end:numberType().nullish(),start:numberType().nullish()})}const RedoActionInputSchema=numberType;function RedoActionSchema(){return objectType({id:stringType(),timestampUtcMs:stringType().datetime(),input:RedoActionInputSchema(),type:RedoSchema,scope:OperationScopeSchema()})}const SetNameActionInputSchema=stringType;function SetNameActionSchema(){return objectType({id:stringType(),timestampUtcMs:stringType().datetime(),input:SetNameActionInputSchema(),type:Set_NameSchema,scope:literalType("global")})}const UndoActionInputSchema=numberType;function UndoActionSchema(){return objectType({id:stringType(),timestampUtcMs:stringType().datetime(),input:UndoActionInputSchema(),type:UndoSchema,scope:OperationScopeSchema()})}const setName=tr=>createAction("SET_NAME",tr,void 0,SetNameActionInputSchema,"global"),undo=(tr=1,rr="global")=>createAction("UNDO",tr,void 0,UndoActionInputSchema,rr),redo=(tr=1,rr="global")=>createAction("REDO",tr,void 0,RedoActionInputSchema,rr),prune=(tr,rr,ir="global")=>createAction("PRUNE",{start:tr,end:rr},void 0,PruneActionInputSchema,ir),loadState=(tr,rr)=>createAction("LOAD_STATE",{state:tr,operations:rr},void 0,LoadStateActionInputSchema),noop$4=(tr="global")=>createAction("NOOP",void 0,void 0,void 0,tr),actions$1={setName,undo,redo,prune,noop:noop$4};function setNameOperation(tr,rr){return{...tr,header:{...tr.header,name:rr}}}function undoOperation(tr,rr,ir){const{scope:lr}=rr;return create$1({document:tr,action:rr,skip:ir,reuseLastOperationIndex:!1},fr=>{const hr=[...tr.operations[lr]],mr=sortOperations(hr);fr.action=noop$4(lr);const gr=mr.at(-1);let yr=(gr==null?void 0:gr.index)??-1;const _r=(gr==null?void 0:gr.action.type)!=="NOOP";_r?yr=yr+1:fr.reuseLastOperationIndex=!0;const br=_r?[...mr,{index:yr,skip:0}]:mr;if(fr.skip=nextSkipNumber(br),gr&&fr.skip>gr.skip+1&&(fr.skip=fr.skip+1),fr.skip<0)throw new Error("Cannot undo: you can't undo more operations than the ones in the scope history")})}function redoOperation(tr,rr,ir){const{scope:lr,input:dr}=rr;return create$1({document:tr,action:rr,skip:ir,reuseLastOperationIndex:!1},hr=>{if(hr.skip>0)throw new Error("Cannot redo: skip value from reducer cannot be used with REDO action");if(typeof dr!="number"||dr>1)throw new Error("Cannot redo: you can only redo one operation at a time");if(typeof dr!="number"||dr<1)throw new Error("Invalid REDO action: invalid redo input value");if(hr.document.clipboard.length<1)throw new Error("Cannot redo: no operations in the clipboard");const mr=hr.document.clipboard.findLastIndex(yr=>yr.action.scope===lr);if(mr<0)throw new Error(`Cannot redo: no operations in clipboard for scope "${lr}"`);const gr=hr.document.clipboard.splice(mr,1)[0];hr.action={type:gr.action.type,scope:gr.action.scope,input:gr.action.input}})}function pruneOperation(tr,rr,ir){const lr=tr.operations.global;let{start:dr,end:fr}=rr;dr=dr||0,fr=fr||lr.length;const hr=lr.slice(dr,fr),mr=lr.slice(0,dr),gr=lr.slice(fr),yr=replayOperations(tr.initialState,{...tr.operations,global:mr.concat(hr)},ir),_r=yr.state,br=yr.header.name,vr=mr.length,wr=mr.length?mr[mr.length-1].timestampUtcMs:gr.length?gr[0].timestampUtcMs:new Date().toISOString(),xr=loadState({name:br,..._r},hr.length);return replayOperations(tr.initialState,{...tr.operations,global:[...mr,{skip:0,...xr,action:xr,timestampUtcMs:wr,index:vr,hash:hashDocumentStateForScope({state:_r},"global")},...gr.map((Sr,Ar)=>({...Sr,index:vr+Ar+1}))]},ir)}function loadStateOperation(tr,rr){return{...tr,header:{...tr.header,name:rr.state.name},state:rr.state.data}}function getNextRevision(tr,rr){var lr;return(((lr=tr.operations[rr].at(-1))==null?void 0:lr.index)??-1??-1)+1}function updateHeaderRevision(tr,rr){const ir={...tr.header,revision:{...tr.header.revision,[rr]:getNextRevision(tr,rr)},lastModifiedAtUtcIso:getDocumentLastModified(tr)};return{...tr,header:ir}}function updateOperationsForAction(tr,rr,ir=!1,lr=0){if([UNDO,REDO,PRUNE].includes(rr.type))return tr;const dr=rr.scope,fr=tr.operations[dr].slice(),hr=fr.sort((_r,br)=>_r.index-br.index).at(-1),mr=(hr==null?void 0:hr.index)??-1,gr=ir?mr:mr+1,yr=operationFromAction(rr,gr,lr);return fr.push(yr),{...tr,operations:{...tr.operations,[dr]:fr}}}function updateOperationsForOperation(tr,rr,ir=!1,lr=0){const dr=rr.action.scope,fr=tr.operations[dr].slice(),hr=fr.sort((_r,br)=>_r.index-br.index).at(-1),mr=(hr==null?void 0:hr.index)??-1,gr=ir?mr:mr+1;if(rr.index-lr>gr)throw new Error(`Missing operations: expected ${gr} with skip 0 or equivalent, got index ${rr.index} with skip ${lr}`);const yr=operationFromOperation(rr,lr);return fr.push(yr),{...tr,operations:{...tr.operations,[dr]:fr}}}function updateDocument(tr,rr,ir=!1,lr=0,dr){let fr;return dr?fr=updateOperationsForOperation(tr,dr,ir,lr):fr=updateOperationsForAction(tr,rr,ir,lr),fr=updateHeaderRevision(fr,rr.scope),fr}function _baseReducer(tr,rr,ir){const lr=DocumentActionSchema().parse(rr);switch(lr.type){case SET_NAME:return setNameOperation(tr,lr.input);case PRUNE:return pruneOperation(tr,lr.input,ir);case LOAD_STATE:return loadStateOperation(tr,lr.input);default:return tr}}function processUndoRedo(tr,rr,ir){switch(rr.type){case UNDO:return undoOperation(tr,rr,ir);case REDO:return redoOperation(tr,rr,ir);default:return{document:tr,action:rr,skip:ir,reuseLastOperationIndex:!1}}}function processSkipOperation(tr,rr,ir,lr,dr=!1,fr=parseResultingState){const hr=rr.scope,mr=tr.operations[hr].at(-1);if(!mr)return tr;const gr=garbageCollectDocumentOperations({...tr.operations,[hr]:skipHeaderOperations(tr.operations[hr],mr)});let yr;const _r=gr[hr].at(-1);if(dr&&(_r!=null&&_r.resultingState))yr=fr(_r.resultingState);else{const{state:br}=replayOperations(tr.initialState,gr,ir,void 0,void 0,void 0,void 0,{reuseOperationResultingState:dr,operationResultingStateParser:fr});yr=br[hr]}return{...tr,state:{...tr.state,[hr]:yr},operations:garbageCollectDocumentOperations({...tr.operations})}}function processUndoOperation(tr,rr,ir,lr=!1,dr=parseResultingState){const fr=[...tr.operations[rr]],hr=sortOperations(fr);hr.pop();const mr=garbageCollectDocumentOperations({...tr.operations}),gr=[...mr[rr]],yr=diffOperations(garbageCollect(hr),gr),_r=replayOperations(tr.initialState,mr,ir,void 0,void 0,void 0,void 0,{reuseOperationResultingState:lr,operationResultingStateParser:dr}),br=sortOperations([...tr.clipboard,...yr].filter(vr=>vr.action.type!=="NOOP")).reverse();return{..._r,clipboard:br}}function baseReducer(tr,rr,ir,lr,dr={}){var Or,$r,Dr;const{skip:fr,ignoreSkipOperations:hr=!1,reuseOperationResultingState:mr=!1,operationResultingStateParser:gr,pruneOnSkip:yr=!0}=dr;let _r=actionFromAction(rr),br=fr??((Or=dr.replayOptions)==null?void 0:Or.operation.skip)??0,vr={...tr},wr=!1;const xr=!hr&&br>0;if(isUndoRedo(_r)){const{skip:zr,action:Fr,document:Jr,reuseLastOperationIndex:$n}=processUndoRedo(tr,_r,br);_r=Fr,br=zr,vr=Jr,wr=$n}else vr={...vr,clipboard:[]};if(isDocumentAction(_r)&&(vr=_baseReducer(vr,_r,ir)),vr=updateDocument(vr,_r,wr,br,($r=dr.replayOptions)==null?void 0:$r.operation),isUndo(rr))return processUndoOperation(vr,rr.scope,ir);if(xr){const zr=processSkipOperation(vr,_r,ir,br,mr,gr);yr?vr=zr:vr={...zr,operations:vr.operations}}if(vr=create$1(vr,zr=>{try{const Fr=ir(zr.state,_r,lr);Fr&&unsafe(()=>{zr.state=Fr})}catch(Fr){const Jr=vr.operations[_r.scope].length-1;zr.operations[_r.scope][Jr].error=Fr.message,zr.operations[_r.scope][Jr].skip=0,xr&&(zr.state={...tr.state},zr.operations={...tr.operations,[_r.scope]:[...tr.operations[_r.scope],{...zr.operations[_r.scope][Jr]}]})}}),[UNDO,REDO,PRUNE].includes(_r.type))return vr;const Ar=_r.scope||"global";let Ir=hashDocumentStateForScope(vr,Ar);(Dr=dr.replayOptions)!=null&&Dr.operation.hash&&dr.replayOptions.operation.hash!==""&&(Ir=dr.replayOptions.operation.hash);const Mr=vr.operations[Ar].at(-1);return Mr&&(Mr.hash=Ir,mr&&(Mr.resultingState=JSON.stringify(vr.state[Ar])),!isDocumentAction(_r)&&_r.attachments&&_r.attachments.forEach(zr=>{const{hash:Fr,...Jr}=zr;vr.attachments||(vr.attachments={}),vr.attachments[Fr]={...Jr}})),vr}class InvalidActionInputError extends Error{constructor(ir){super();ki(this,"data");this.name="InvalidActionInputError",this.data=ir,this.message=this.message||`Invalid action input: ${JSON.stringify(ir,null,2)}`}}class InvalidActionInputZodError extends InvalidActionInputError{constructor(ir){super(ir);ki(this,"issues");this.issues=ir,this.name="InvalidActionInputZodError"}}class HashMismatchError extends Error{constructor(ir,lr,dr){super();ki(this,"_scope");ki(this,"_document");ki(this,"_operation");this.name="HashMismatchError",this._document=lr,this._scope=ir,this._operation=dr,this.message=JSON.stringify({error:`Hash mismatch on document ${lr.header.id}, scope ${ir}, index ${dr.index}`,document:lr,scope:ir,operation:dr})}get document(){return this._document}get scope(){return this._scope}get operation(){return this._operation}}const scriptRel="modulepreload",assetsURL=function(tr,rr){return new URL(tr,rr).href},seen={},__vitePreload=function(rr,ir,lr){let dr=Promise.resolve();if(ir&&ir.length>0){let hr=function(_r){return Promise.all(_r.map(br=>Promise.resolve(br).then(vr=>({status:"fulfilled",value:vr}),vr=>({status:"rejected",reason:vr}))))};const mr=document.getElementsByTagName("link"),gr=document.querySelector("meta[property=csp-nonce]"),yr=(gr==null?void 0:gr.nonce)||(gr==null?void 0:gr.getAttribute("nonce"));dr=hr(ir.map(_r=>{if(_r=assetsURL(_r,lr),_r in seen)return;seen[_r]=!0;const br=_r.endsWith(".css"),vr=br?'[rel="stylesheet"]':"";if(!!lr)for(let Sr=mr.length-1;Sr>=0;Sr--){const Ar=mr[Sr];if(Ar.href===_r&&(!br||Ar.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${_r}"]${vr}`))return;const xr=document.createElement("link");if(xr.rel=br?"stylesheet":scriptRel,br||(xr.as="script"),xr.crossOrigin="",xr.href=_r,yr&&xr.setAttribute("nonce",yr),document.head.appendChild(xr),br)return new Promise((Sr,Ar)=>{xr.addEventListener("load",Sr),xr.addEventListener("error",()=>Ar(new Error(`Unable to preload CSS for ${_r}`)))})}))}function fr(hr){const mr=new Event("vite:preloadError",{cancelable:!0});if(mr.payload=hr,window.dispatchEvent(mr),!mr.defaultPrevented)throw hr}return dr.then(hr=>{for(const mr of hr||[])mr.status==="rejected"&&fr(mr.reason);return rr().catch(fr)})},generateStablePayload=tr=>`${tr.documentType}:${tr.createdAtUtcIso}:${tr.nonce}`;var nu,Oc,Wd;class PublicKeySigner{constructor(rr){Ri(this,Oc);Ri(this,nu);ki(this,"subtleCrypto");ki(this,"publicCryptoKey");Ni(this,nu,rr),this.subtleCrypto=Bi(this,Oc,Wd).call(this)}async publicKey(){return kr(this,nu)}async sign(rr){throw new Error("PublicKeySigner only supports verification")}async verify(rr,ir){const lr=await this.subtleCrypto;this.publicCryptoKey||(this.publicCryptoKey=await lr.importKey("jwk",kr(this,nu),{name:"Ed25519",namedCurve:"Ed25519"},!0,["verify"]));let dr;try{dr=await lr.verify("Ed25519",this.publicCryptoKey,ir,rr)}catch{throw new Error("invalid signature")}if(!dr)throw new Error("invalid signature")}}nu=new WeakMap,Oc=new WeakSet,Wd=function(){return new Promise((rr,ir)=>{var lr;typeof window>"u"?__vitePreload(()=>import("node:crypto"),[],import.meta.url).then(dr=>{rr(dr.webcrypto.subtle)}).catch(ir):((lr=window.crypto)!=null&&lr.subtle||ir(new Error("Crypto module not available")),rr(window.crypto.subtle))})};const createSignerFromHeader=async tr=>new PublicKeySigner(tr.sig.publicKey),verify=async(tr,rr,ir)=>{const lr=generateStablePayload(tr),fr=new TextEncoder().encode(lr),hr=Uint8Array.from(atob(rr),mr=>mr.charCodeAt(0));await ir.verify(fr,hr)},validateHeader=async tr=>{const rr=await createSignerFromHeader(tr);return await verify({documentType:tr.documentType,createdAtUtcIso:tr.createdAtUtcIso,nonce:tr.sig.nonce},tr.id,rr)},createUnsignedHeader=(tr=generateUUID(),rr="")=>({id:tr,sig:{publicKey:{},nonce:""},documentType:rr,createdAtUtcIso:new Date().toISOString(),slug:"",name:"",branch:"main",revision:{document:0},lastModifiedAtUtcIso:new Date().toISOString(),meta:{}});function isUndoRedo(tr){return[UNDO,REDO].includes(tr.type)}function isUndo(tr){return tr.type===UNDO}function isDocumentAction(tr){return[SET_NAME,UNDO,REDO,PRUNE,LOAD_STATE].includes(tr.type)}function createAction(tr,rr,ir,lr,dr="global"){if(!tr)throw new Error("Empty action type");if(typeof tr!="string")throw new Error(`Invalid action type: ${JSON.stringify(tr)}`);const fr={id:generateId(),timestampUtcMs:new Date().toISOString(),type:tr,input:rr,scope:dr};try{lr==null||lr().parse(fr.input)}catch(hr){throw hr instanceof ZodError?new InvalidActionInputZodError(hr.issues):new InvalidActionInputError(hr)}return fr}function createReducer(tr,rr=baseReducer){return(lr,dr,fr,hr)=>rr(lr,dr,tr,fr,hr)}function baseCreateDocument(tr,rr){const ir=tr(rr);return{header:createUnsignedHeader(),state:ir,initialState:ir,operations:{global:[],local:[]},clipboard:[],attachments:{},history:[]}}function hashDocumentStateForScope(tr,rr="global"){const ir=cjsModule(tr.state[rr]||"");return hash$1(ir)}function getDocumentLastModified(tr){return sortOperations(Object.values(tr.operations).flat()).at(-1).timestampUtcMs||tr.header.lastModifiedAtUtcIso}const defaultCreateState=tr=>tr;function replayOperations(tr,rr,ir,lr,dr,fr=baseReducer,hr={},mr){const gr=createReducer(ir,fr);return replayDocument(tr,rr,gr,lr,dr,hr,mr)}function replayDocument(tr,rr,ir,lr,dr,fr={},hr){const{checkHashes:mr=!0,reuseOperationResultingState:gr,operationResultingStateParser:yr=parseResultingState}=hr||{};let _r=tr;const br=[],vr={global:[],local:[]};if(gr)for(const[Ir,Mr]of Object.entries(rr)){const Or=Mr.findLastIndex(Dr=>!!Dr.resultingState);if(Or<0){br.push(...Mr);continue}const $r=Mr[Or];if($r.resultingState)try{const Dr=yr($r.resultingState);_r={..._r,[Ir]:Dr},vr[Ir].push(...Mr.slice(0,Or+1)),br.push(...Mr.slice(Or+1))}catch{br.push(...Mr)}}else br.push(...Object.values(rr).flat());const wr=baseCreateDocument(defaultCreateState,_r);dr!=null&&dr.slug&&(wr.header.slug=dr.slug),wr.initialState=tr,wr.operations=vr;let xr=wr;if(br.length)xr=br.reduce((Ir,Mr)=>ir(Ir,Mr.action,lr,{ignoreSkipOperations:!0,checkHashes:mr,replayOptions:{operation:Mr}}),wr);else for(const Ir of Object.values(vr)){const Mr=Ir.at(-1);Mr&&(xr=updateHeaderRevision(xr,Mr.action.scope))}if(!mr)for(const Ir of Object.keys(xr.state))for(let Mr=br.length-1;Mr>=0;Mr--){const Or=br[Mr];if(Or.action.scope===Ir){if(Or.hash!==hashDocumentStateForScope(xr,Ir))throw new HashMismatchError(Ir,xr,Or);break}}const Sr=Object.keys(xr.operations).reduce((Ir,Mr)=>{const Or=Mr;return{...Ir,[Or]:[...xr.operations[Or].map(($r,Dr)=>{var zr;return{...$r,timestamp:((zr=rr[Or][Dr])==null?void 0:zr.timestampUtcMs)??$r.timestampUtcMs}})]}},{global:[],local:[]}),Ar=dr?dr.lastModifiedAtUtcIso:Object.values(Sr).reduce((Ir,Mr)=>{const Or=Mr.at(-1);return Or&&Or.timestampUtcMs>Ir?Or.timestampUtcMs:Ir},wr.header.lastModifiedAtUtcIso);return dr&&(xr.header={...dr,revision:xr.header.revision,lastModifiedAtUtcIso:Ar}),{...xr,operations:Sr}}function parseResultingState(tr){const rr=typeof tr;if(rr==="string")return JSON.parse(tr);if(rr==="object")return tr;throw new Error(`Providing resulting state is of type: ${rr}`)}function commonjsRequire(tr){throw new Error('Could not dynamically require "'+tr+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var jszip_min={exports:{}},hasRequiredJszip_min;function requireJszip_min(){return hasRequiredJszip_min||(hasRequiredJszip_min=1,(function(tr,rr){(function(ir){tr.exports=ir()})(function(){return(function ir(lr,dr,fr){function hr(yr,_r){if(!dr[yr]){if(!lr[yr]){var br=typeof commonjsRequire=="function"&&commonjsRequire;if(!_r&&br)return br(yr,!0);if(mr)return mr(yr,!0);var vr=new Error("Cannot find module '"+yr+"'");throw vr.code="MODULE_NOT_FOUND",vr}var wr=dr[yr]={exports:{}};lr[yr][0].call(wr.exports,function(xr){var Sr=lr[yr][1][xr];return hr(Sr||xr)},wr,wr.exports,ir,lr,dr,fr)}return dr[yr].exports}for(var mr=typeof commonjsRequire=="function"&&commonjsRequire,gr=0;gr<fr.length;gr++)hr(fr[gr]);return hr})({1:[function(ir,lr,dr){var fr=ir("./utils"),hr=ir("./support"),mr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";dr.encode=function(gr){for(var yr,_r,br,vr,wr,xr,Sr,Ar=[],Ir=0,Mr=gr.length,Or=Mr,$r=fr.getTypeOf(gr)!=="string";Ir<gr.length;)Or=Mr-Ir,br=$r?(yr=gr[Ir++],_r=Ir<Mr?gr[Ir++]:0,Ir<Mr?gr[Ir++]:0):(yr=gr.charCodeAt(Ir++),_r=Ir<Mr?gr.charCodeAt(Ir++):0,Ir<Mr?gr.charCodeAt(Ir++):0),vr=yr>>2,wr=(3&yr)<<4|_r>>4,xr=1<Or?(15&_r)<<2|br>>6:64,Sr=2<Or?63&br:64,Ar.push(mr.charAt(vr)+mr.charAt(wr)+mr.charAt(xr)+mr.charAt(Sr));return Ar.join("")},dr.decode=function(gr){var yr,_r,br,vr,wr,xr,Sr=0,Ar=0,Ir="data:";if(gr.substr(0,Ir.length)===Ir)throw new Error("Invalid base64 input, it looks like a data url.");var Mr,Or=3*(gr=gr.replace(/[^A-Za-z0-9+/=]/g,"")).length/4;if(gr.charAt(gr.length-1)===mr.charAt(64)&&Or--,gr.charAt(gr.length-2)===mr.charAt(64)&&Or--,Or%1!=0)throw new Error("Invalid base64 input, bad content length.");for(Mr=hr.uint8array?new Uint8Array(0|Or):new Array(0|Or);Sr<gr.length;)yr=mr.indexOf(gr.charAt(Sr++))<<2|(vr=mr.indexOf(gr.charAt(Sr++)))>>4,_r=(15&vr)<<4|(wr=mr.indexOf(gr.charAt(Sr++)))>>2,br=(3&wr)<<6|(xr=mr.indexOf(gr.charAt(Sr++))),Mr[Ar++]=yr,wr!==64&&(Mr[Ar++]=_r),xr!==64&&(Mr[Ar++]=br);return Mr}},{"./support":30,"./utils":32}],2:[function(ir,lr,dr){var fr=ir("./external"),hr=ir("./stream/DataWorker"),mr=ir("./stream/Crc32Probe"),gr=ir("./stream/DataLengthProbe");function yr(_r,br,vr,wr,xr){this.compressedSize=_r,this.uncompressedSize=br,this.crc32=vr,this.compression=wr,this.compressedContent=xr}yr.prototype={getContentWorker:function(){var _r=new hr(fr.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new gr("data_length")),br=this;return _r.on("end",function(){if(this.streamInfo.data_length!==br.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),_r},getCompressedWorker:function(){return new hr(fr.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},yr.createWorkerFrom=function(_r,br,vr){return _r.pipe(new mr).pipe(new gr("uncompressedSize")).pipe(br.compressWorker(vr)).pipe(new gr("compressedSize")).withStreamInfo("compression",br)},lr.exports=yr},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(ir,lr,dr){var fr=ir("./stream/GenericWorker");dr.STORE={magic:"\0\0",compressWorker:function(){return new fr("STORE compression")},uncompressWorker:function(){return new fr("STORE decompression")}},dr.DEFLATE=ir("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(ir,lr,dr){var fr=ir("./utils"),hr=(function(){for(var mr,gr=[],yr=0;yr<256;yr++){mr=yr;for(var _r=0;_r<8;_r++)mr=1&mr?3988292384^mr>>>1:mr>>>1;gr[yr]=mr}return gr})();lr.exports=function(mr,gr){return mr!==void 0&&mr.length?fr.getTypeOf(mr)!=="string"?(function(yr,_r,br,vr){var wr=hr,xr=vr+br;yr^=-1;for(var Sr=vr;Sr<xr;Sr++)yr=yr>>>8^wr[255&(yr^_r[Sr])];return-1^yr})(0|gr,mr,mr.length,0):(function(yr,_r,br,vr){var wr=hr,xr=vr+br;yr^=-1;for(var Sr=vr;Sr<xr;Sr++)yr=yr>>>8^wr[255&(yr^_r.charCodeAt(Sr))];return-1^yr})(0|gr,mr,mr.length,0):0}},{"./utils":32}],5:[function(ir,lr,dr){dr.base64=!1,dr.binary=!1,dr.dir=!1,dr.createFolders=!0,dr.date=null,dr.compression=null,dr.compressionOptions=null,dr.comment=null,dr.unixPermissions=null,dr.dosPermissions=null},{}],6:[function(ir,lr,dr){var fr=null;fr=typeof Promise<"u"?Promise:ir("lie"),lr.exports={Promise:fr}},{lie:37}],7:[function(ir,lr,dr){var fr=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",hr=ir("pako"),mr=ir("./utils"),gr=ir("./stream/GenericWorker"),yr=fr?"uint8array":"array";function _r(br,vr){gr.call(this,"FlateWorker/"+br),this._pako=null,this._pakoAction=br,this._pakoOptions=vr,this.meta={}}dr.magic="\b\0",mr.inherits(_r,gr),_r.prototype.processChunk=function(br){this.meta=br.meta,this._pako===null&&this._createPako(),this._pako.push(mr.transformTo(yr,br.data),!1)},_r.prototype.flush=function(){gr.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},_r.prototype.cleanUp=function(){gr.prototype.cleanUp.call(this),this._pako=null},_r.prototype._createPako=function(){this._pako=new hr[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var br=this;this._pako.onData=function(vr){br.push({data:vr,meta:br.meta})}},dr.compressWorker=function(br){return new _r("Deflate",br)},dr.uncompressWorker=function(){return new _r("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(ir,lr,dr){function fr(wr,xr){var Sr,Ar="";for(Sr=0;Sr<xr;Sr++)Ar+=String.fromCharCode(255&wr),wr>>>=8;return Ar}function hr(wr,xr,Sr,Ar,Ir,Mr){var Or,$r,Dr=wr.file,zr=wr.compression,Fr=Mr!==yr.utf8encode,Jr=mr.transformTo("string",Mr(Dr.name)),$n=mr.transformTo("string",yr.utf8encode(Dr.name)),Qr=Dr.comment,Zn=mr.transformTo("string",Mr(Qr)),qn=mr.transformTo("string",yr.utf8encode(Qr)),Xn=$n.length!==Dr.name.length,Lr=qn.length!==Qr.length,Gr="",Hn="",ii="",oi=Dr.dir,ri=Dr.date,ti={crc32:0,compressedSize:0,uncompressedSize:0};xr&&!Sr||(ti.crc32=wr.crc32,ti.compressedSize=wr.compressedSize,ti.uncompressedSize=wr.uncompressedSize);var si=0;xr&&(si|=8),Fr||!Xn&&!Lr||(si|=2048);var Jn=0,ni=0;oi&&(Jn|=16),Ir==="UNIX"?(ni=798,Jn|=(function(ei,ai){var pi=ei;return ei||(pi=ai?16893:33204),(65535&pi)<<16})(Dr.unixPermissions,oi)):(ni=20,Jn|=(function(ei){return 63&(ei||0)})(Dr.dosPermissions)),Or=ri.getUTCHours(),Or<<=6,Or|=ri.getUTCMinutes(),Or<<=5,Or|=ri.getUTCSeconds()/2,$r=ri.getUTCFullYear()-1980,$r<<=4,$r|=ri.getUTCMonth()+1,$r<<=5,$r|=ri.getUTCDate(),Xn&&(Hn=fr(1,1)+fr(_r(Jr),4)+$n,Gr+="up"+fr(Hn.length,2)+Hn),Lr&&(ii=fr(1,1)+fr(_r(Zn),4)+qn,Gr+="uc"+fr(ii.length,2)+ii);var Yn="";return Yn+=`
190
190
  \0`,Yn+=fr(si,2),Yn+=zr.magic,Yn+=fr(Or,2),Yn+=fr($r,2),Yn+=fr(ti.crc32,4),Yn+=fr(ti.compressedSize,4),Yn+=fr(ti.uncompressedSize,4),Yn+=fr(Jr.length,2),Yn+=fr(Gr.length,2),{fileRecord:br.LOCAL_FILE_HEADER+Yn+Jr+Gr,dirRecord:br.CENTRAL_FILE_HEADER+fr(ni,2)+Yn+fr(Zn.length,2)+"\0\0\0\0"+fr(Jn,4)+fr(Ar,4)+Jr+Gr+Zn}}var mr=ir("../utils"),gr=ir("../stream/GenericWorker"),yr=ir("../utf8"),_r=ir("../crc32"),br=ir("../signature");function vr(wr,xr,Sr,Ar){gr.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=xr,this.zipPlatform=Sr,this.encodeFileName=Ar,this.streamFiles=wr,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}mr.inherits(vr,gr),vr.prototype.push=function(wr){var xr=wr.meta.percent||0,Sr=this.entriesCount,Ar=this._sources.length;this.accumulate?this.contentBuffer.push(wr):(this.bytesWritten+=wr.data.length,gr.prototype.push.call(this,{data:wr.data,meta:{currentFile:this.currentFile,percent:Sr?(xr+100*(Sr-Ar-1))/Sr:100}}))},vr.prototype.openedSource=function(wr){this.currentSourceOffset=this.bytesWritten,this.currentFile=wr.file.name;var xr=this.streamFiles&&!wr.file.dir;if(xr){var Sr=hr(wr,xr,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:Sr.fileRecord,meta:{percent:0}})}else this.accumulate=!0},vr.prototype.closedSource=function(wr){this.accumulate=!1;var xr=this.streamFiles&&!wr.file.dir,Sr=hr(wr,xr,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(Sr.dirRecord),xr)this.push({data:(function(Ar){return br.DATA_DESCRIPTOR+fr(Ar.crc32,4)+fr(Ar.compressedSize,4)+fr(Ar.uncompressedSize,4)})(wr),meta:{percent:100}});else for(this.push({data:Sr.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},vr.prototype.flush=function(){for(var wr=this.bytesWritten,xr=0;xr<this.dirRecords.length;xr++)this.push({data:this.dirRecords[xr],meta:{percent:100}});var Sr=this.bytesWritten-wr,Ar=(function(Ir,Mr,Or,$r,Dr){var zr=mr.transformTo("string",Dr($r));return br.CENTRAL_DIRECTORY_END+"\0\0\0\0"+fr(Ir,2)+fr(Ir,2)+fr(Mr,4)+fr(Or,4)+fr(zr.length,2)+zr})(this.dirRecords.length,Sr,wr,this.zipComment,this.encodeFileName);this.push({data:Ar,meta:{percent:100}})},vr.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},vr.prototype.registerPrevious=function(wr){this._sources.push(wr);var xr=this;return wr.on("data",function(Sr){xr.processChunk(Sr)}),wr.on("end",function(){xr.closedSource(xr.previous.streamInfo),xr._sources.length?xr.prepareNextSource():xr.end()}),wr.on("error",function(Sr){xr.error(Sr)}),this},vr.prototype.resume=function(){return!!gr.prototype.resume.call(this)&&(!this.previous&&this._sources.length?(this.prepareNextSource(),!0):this.previous||this._sources.length||this.generatedError?void 0:(this.end(),!0))},vr.prototype.error=function(wr){var xr=this._sources;if(!gr.prototype.error.call(this,wr))return!1;for(var Sr=0;Sr<xr.length;Sr++)try{xr[Sr].error(wr)}catch{}return!0},vr.prototype.lock=function(){gr.prototype.lock.call(this);for(var wr=this._sources,xr=0;xr<wr.length;xr++)wr[xr].lock()},lr.exports=vr},{"../crc32":4,"../signature":23,"../stream/GenericWorker":28,"../utf8":31,"../utils":32}],9:[function(ir,lr,dr){var fr=ir("../compressions"),hr=ir("./ZipFileWorker");dr.generateWorker=function(mr,gr,yr){var _r=new hr(gr.streamFiles,yr,gr.platform,gr.encodeFileName),br=0;try{mr.forEach(function(vr,wr){br++;var xr=(function(Mr,Or){var $r=Mr||Or,Dr=fr[$r];if(!Dr)throw new Error($r+" is not a valid compression method !");return Dr})(wr.options.compression,gr.compression),Sr=wr.options.compressionOptions||gr.compressionOptions||{},Ar=wr.dir,Ir=wr.date;wr._compressWorker(xr,Sr).withStreamInfo("file",{name:vr,dir:Ar,date:Ir,comment:wr.comment||"",unixPermissions:wr.unixPermissions,dosPermissions:wr.dosPermissions}).pipe(_r)}),_r.entriesCount=br}catch(vr){_r.error(vr)}return _r}},{"../compressions":3,"./ZipFileWorker":8}],10:[function(ir,lr,dr){function fr(){if(!(this instanceof fr))return new fr;if(arguments.length)throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");this.files=Object.create(null),this.comment=null,this.root="",this.clone=function(){var hr=new fr;for(var mr in this)typeof this[mr]!="function"&&(hr[mr]=this[mr]);return hr}}(fr.prototype=ir("./object")).loadAsync=ir("./load"),fr.support=ir("./support"),fr.defaults=ir("./defaults"),fr.version="3.10.1",fr.loadAsync=function(hr,mr){return new fr().loadAsync(hr,mr)},fr.external=ir("./external"),lr.exports=fr},{"./defaults":5,"./external":6,"./load":11,"./object":15,"./support":30}],11:[function(ir,lr,dr){var fr=ir("./utils"),hr=ir("./external"),mr=ir("./utf8"),gr=ir("./zipEntries"),yr=ir("./stream/Crc32Probe"),_r=ir("./nodejsUtils");function br(vr){return new hr.Promise(function(wr,xr){var Sr=vr.decompressed.getContentWorker().pipe(new yr);Sr.on("error",function(Ar){xr(Ar)}).on("end",function(){Sr.streamInfo.crc32!==vr.decompressed.crc32?xr(new Error("Corrupted zip : CRC32 mismatch")):wr()}).resume()})}lr.exports=function(vr,wr){var xr=this;return wr=fr.extend(wr||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:mr.utf8decode}),_r.isNode&&_r.isStream(vr)?hr.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):fr.prepareContent("the loaded zip file",vr,!0,wr.optimizedBinaryString,wr.base64).then(function(Sr){var Ar=new gr(wr);return Ar.load(Sr),Ar}).then(function(Sr){var Ar=[hr.Promise.resolve(Sr)],Ir=Sr.files;if(wr.checkCRC32)for(var Mr=0;Mr<Ir.length;Mr++)Ar.push(br(Ir[Mr]));return hr.Promise.all(Ar)}).then(function(Sr){for(var Ar=Sr.shift(),Ir=Ar.files,Mr=0;Mr<Ir.length;Mr++){var Or=Ir[Mr],$r=Or.fileNameStr,Dr=fr.resolve(Or.fileNameStr);xr.file(Dr,Or.decompressed,{binary:!0,optimizedBinaryString:!0,date:Or.date,dir:Or.dir,comment:Or.fileCommentStr.length?Or.fileCommentStr:null,unixPermissions:Or.unixPermissions,dosPermissions:Or.dosPermissions,createFolders:wr.createFolders}),Or.dir||(xr.file(Dr).unsafeOriginalName=$r)}return Ar.zipComment.length&&(xr.comment=Ar.zipComment),xr})}},{"./external":6,"./nodejsUtils":14,"./stream/Crc32Probe":25,"./utf8":31,"./utils":32,"./zipEntries":33}],12:[function(ir,lr,dr){var fr=ir("../utils"),hr=ir("../stream/GenericWorker");function mr(gr,yr){hr.call(this,"Nodejs stream input adapter for "+gr),this._upstreamEnded=!1,this._bindStream(yr)}fr.inherits(mr,hr),mr.prototype._bindStream=function(gr){var yr=this;(this._stream=gr).pause(),gr.on("data",function(_r){yr.push({data:_r,meta:{percent:0}})}).on("error",function(_r){yr.isPaused?this.generatedError=_r:yr.error(_r)}).on("end",function(){yr.isPaused?yr._upstreamEnded=!0:yr.end()})},mr.prototype.pause=function(){return!!hr.prototype.pause.call(this)&&(this._stream.pause(),!0)},mr.prototype.resume=function(){return!!hr.prototype.resume.call(this)&&(this._upstreamEnded?this.end():this._stream.resume(),!0)},lr.exports=mr},{"../stream/GenericWorker":28,"../utils":32}],13:[function(ir,lr,dr){var fr=ir("readable-stream").Readable;function hr(mr,gr,yr){fr.call(this,gr),this._helper=mr;var _r=this;mr.on("data",function(br,vr){_r.push(br)||_r._helper.pause(),yr&&yr(vr)}).on("error",function(br){_r.emit("error",br)}).on("end",function(){_r.push(null)})}ir("../utils").inherits(hr,fr),hr.prototype._read=function(){this._helper.resume()},lr.exports=hr},{"../utils":32,"readable-stream":16}],14:[function(ir,lr,dr){lr.exports={isNode:typeof Buffer<"u",newBufferFrom:function(fr,hr){if(Buffer.from&&Buffer.from!==Uint8Array.from)return Buffer.from(fr,hr);if(typeof fr=="number")throw new Error('The "data" argument must not be a number');return new Buffer(fr,hr)},allocBuffer:function(fr){if(Buffer.alloc)return Buffer.alloc(fr);var hr=new Buffer(fr);return hr.fill(0),hr},isBuffer:function(fr){return Buffer.isBuffer(fr)},isStream:function(fr){return fr&&typeof fr.on=="function"&&typeof fr.pause=="function"&&typeof fr.resume=="function"}}},{}],15:[function(ir,lr,dr){function fr(Dr,zr,Fr){var Jr,$n=mr.getTypeOf(zr),Qr=mr.extend(Fr||{},_r);Qr.date=Qr.date||new Date,Qr.compression!==null&&(Qr.compression=Qr.compression.toUpperCase()),typeof Qr.unixPermissions=="string"&&(Qr.unixPermissions=parseInt(Qr.unixPermissions,8)),Qr.unixPermissions&&16384&Qr.unixPermissions&&(Qr.dir=!0),Qr.dosPermissions&&16&Qr.dosPermissions&&(Qr.dir=!0),Qr.dir&&(Dr=Ir(Dr)),Qr.createFolders&&(Jr=Ar(Dr))&&Mr.call(this,Jr,!0);var Zn=$n==="string"&&Qr.binary===!1&&Qr.base64===!1;Fr&&Fr.binary!==void 0||(Qr.binary=!Zn),(zr instanceof br&&zr.uncompressedSize===0||Qr.dir||!zr||zr.length===0)&&(Qr.base64=!1,Qr.binary=!0,zr="",Qr.compression="STORE",$n="string");var qn=null;qn=zr instanceof br||zr instanceof gr?zr:xr.isNode&&xr.isStream(zr)?new Sr(Dr,zr):mr.prepareContent(Dr,zr,Qr.binary,Qr.optimizedBinaryString,Qr.base64);var Xn=new vr(Dr,qn,Qr);this.files[Dr]=Xn}var hr=ir("./utf8"),mr=ir("./utils"),gr=ir("./stream/GenericWorker"),yr=ir("./stream/StreamHelper"),_r=ir("./defaults"),br=ir("./compressedObject"),vr=ir("./zipObject"),wr=ir("./generate"),xr=ir("./nodejsUtils"),Sr=ir("./nodejs/NodejsStreamInputAdapter"),Ar=function(Dr){Dr.slice(-1)==="/"&&(Dr=Dr.substring(0,Dr.length-1));var zr=Dr.lastIndexOf("/");return 0<zr?Dr.substring(0,zr):""},Ir=function(Dr){return Dr.slice(-1)!=="/"&&(Dr+="/"),Dr},Mr=function(Dr,zr){return zr=zr!==void 0?zr:_r.createFolders,Dr=Ir(Dr),this.files[Dr]||fr.call(this,Dr,null,{dir:!0,createFolders:zr}),this.files[Dr]};function Or(Dr){return Object.prototype.toString.call(Dr)==="[object RegExp]"}var $r={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(Dr){var zr,Fr,Jr;for(zr in this.files)Jr=this.files[zr],(Fr=zr.slice(this.root.length,zr.length))&&zr.slice(0,this.root.length)===this.root&&Dr(Fr,Jr)},filter:function(Dr){var zr=[];return this.forEach(function(Fr,Jr){Dr(Fr,Jr)&&zr.push(Jr)}),zr},file:function(Dr,zr,Fr){if(arguments.length!==1)return Dr=this.root+Dr,fr.call(this,Dr,zr,Fr),this;if(Or(Dr)){var Jr=Dr;return this.filter(function(Qr,Zn){return!Zn.dir&&Jr.test(Qr)})}var $n=this.files[this.root+Dr];return $n&&!$n.dir?$n:null},folder:function(Dr){if(!Dr)return this;if(Or(Dr))return this.filter(function($n,Qr){return Qr.dir&&Dr.test($n)});var zr=this.root+Dr,Fr=Mr.call(this,zr),Jr=this.clone();return Jr.root=Fr.name,Jr},remove:function(Dr){Dr=this.root+Dr;var zr=this.files[Dr];if(zr||(Dr.slice(-1)!=="/"&&(Dr+="/"),zr=this.files[Dr]),zr&&!zr.dir)delete this.files[Dr];else for(var Fr=this.filter(function($n,Qr){return Qr.name.slice(0,Dr.length)===Dr}),Jr=0;Jr<Fr.length;Jr++)delete this.files[Fr[Jr].name];return this},generate:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},generateInternalStream:function(Dr){var zr,Fr={};try{if((Fr=mr.extend(Dr||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:hr.utf8encode})).type=Fr.type.toLowerCase(),Fr.compression=Fr.compression.toUpperCase(),Fr.type==="binarystring"&&(Fr.type="string"),!Fr.type)throw new Error("No output type specified.");mr.checkSupport(Fr.type),Fr.platform!=="darwin"&&Fr.platform!=="freebsd"&&Fr.platform!=="linux"&&Fr.platform!=="sunos"||(Fr.platform="UNIX"),Fr.platform==="win32"&&(Fr.platform="DOS");var Jr=Fr.comment||this.comment||"";zr=wr.generateWorker(this,Fr,Jr)}catch($n){(zr=new gr("error")).error($n)}return new yr(zr,Fr.type||"string",Fr.mimeType)},generateAsync:function(Dr,zr){return this.generateInternalStream(Dr).accumulate(zr)},generateNodeStream:function(Dr,zr){return(Dr=Dr||{}).type||(Dr.type="nodebuffer"),this.generateInternalStream(Dr).toNodejsStream(zr)}};lr.exports=$r},{"./compressedObject":2,"./defaults":5,"./generate":9,"./nodejs/NodejsStreamInputAdapter":12,"./nodejsUtils":14,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31,"./utils":32,"./zipObject":35}],16:[function(ir,lr,dr){lr.exports=ir("stream")},{stream:void 0}],17:[function(ir,lr,dr){var fr=ir("./DataReader");function hr(mr){fr.call(this,mr);for(var gr=0;gr<this.data.length;gr++)mr[gr]=255&mr[gr]}ir("../utils").inherits(hr,fr),hr.prototype.byteAt=function(mr){return this.data[this.zero+mr]},hr.prototype.lastIndexOfSignature=function(mr){for(var gr=mr.charCodeAt(0),yr=mr.charCodeAt(1),_r=mr.charCodeAt(2),br=mr.charCodeAt(3),vr=this.length-4;0<=vr;--vr)if(this.data[vr]===gr&&this.data[vr+1]===yr&&this.data[vr+2]===_r&&this.data[vr+3]===br)return vr-this.zero;return-1},hr.prototype.readAndCheckSignature=function(mr){var gr=mr.charCodeAt(0),yr=mr.charCodeAt(1),_r=mr.charCodeAt(2),br=mr.charCodeAt(3),vr=this.readData(4);return gr===vr[0]&&yr===vr[1]&&_r===vr[2]&&br===vr[3]},hr.prototype.readData=function(mr){if(this.checkOffset(mr),mr===0)return[];var gr=this.data.slice(this.zero+this.index,this.zero+this.index+mr);return this.index+=mr,gr},lr.exports=hr},{"../utils":32,"./DataReader":18}],18:[function(ir,lr,dr){var fr=ir("../utils");function hr(mr){this.data=mr,this.length=mr.length,this.index=0,this.zero=0}hr.prototype={checkOffset:function(mr){this.checkIndex(this.index+mr)},checkIndex:function(mr){if(this.length<this.zero+mr||mr<0)throw new Error("End of data reached (data length = "+this.length+", asked index = "+mr+"). Corrupted zip ?")},setIndex:function(mr){this.checkIndex(mr),this.index=mr},skip:function(mr){this.setIndex(this.index+mr)},byteAt:function(){},readInt:function(mr){var gr,yr=0;for(this.checkOffset(mr),gr=this.index+mr-1;gr>=this.index;gr--)yr=(yr<<8)+this.byteAt(gr);return this.index+=mr,yr},readString:function(mr){return fr.transformTo("string",this.readData(mr))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var mr=this.readInt(4);return new Date(Date.UTC(1980+(mr>>25&127),(mr>>21&15)-1,mr>>16&31,mr>>11&31,mr>>5&63,(31&mr)<<1))}},lr.exports=hr},{"../utils":32}],19:[function(ir,lr,dr){var fr=ir("./Uint8ArrayReader");function hr(mr){fr.call(this,mr)}ir("../utils").inherits(hr,fr),hr.prototype.readData=function(mr){this.checkOffset(mr);var gr=this.data.slice(this.zero+this.index,this.zero+this.index+mr);return this.index+=mr,gr},lr.exports=hr},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(ir,lr,dr){var fr=ir("./DataReader");function hr(mr){fr.call(this,mr)}ir("../utils").inherits(hr,fr),hr.prototype.byteAt=function(mr){return this.data.charCodeAt(this.zero+mr)},hr.prototype.lastIndexOfSignature=function(mr){return this.data.lastIndexOf(mr)-this.zero},hr.prototype.readAndCheckSignature=function(mr){return mr===this.readData(4)},hr.prototype.readData=function(mr){this.checkOffset(mr);var gr=this.data.slice(this.zero+this.index,this.zero+this.index+mr);return this.index+=mr,gr},lr.exports=hr},{"../utils":32,"./DataReader":18}],21:[function(ir,lr,dr){var fr=ir("./ArrayReader");function hr(mr){fr.call(this,mr)}ir("../utils").inherits(hr,fr),hr.prototype.readData=function(mr){if(this.checkOffset(mr),mr===0)return new Uint8Array(0);var gr=this.data.subarray(this.zero+this.index,this.zero+this.index+mr);return this.index+=mr,gr},lr.exports=hr},{"../utils":32,"./ArrayReader":17}],22:[function(ir,lr,dr){var fr=ir("../utils"),hr=ir("../support"),mr=ir("./ArrayReader"),gr=ir("./StringReader"),yr=ir("./NodeBufferReader"),_r=ir("./Uint8ArrayReader");lr.exports=function(br){var vr=fr.getTypeOf(br);return fr.checkSupport(vr),vr!=="string"||hr.uint8array?vr==="nodebuffer"?new yr(br):hr.uint8array?new _r(fr.transformTo("uint8array",br)):new mr(fr.transformTo("array",br)):new gr(br)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(ir,lr,dr){dr.LOCAL_FILE_HEADER="PK",dr.CENTRAL_FILE_HEADER="PK",dr.CENTRAL_DIRECTORY_END="PK",dr.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07",dr.ZIP64_CENTRAL_DIRECTORY_END="PK",dr.DATA_DESCRIPTOR="PK\x07\b"},{}],24:[function(ir,lr,dr){var fr=ir("./GenericWorker"),hr=ir("../utils");function mr(gr){fr.call(this,"ConvertWorker to "+gr),this.destType=gr}hr.inherits(mr,fr),mr.prototype.processChunk=function(gr){this.push({data:hr.transformTo(this.destType,gr.data),meta:gr.meta})},lr.exports=mr},{"../utils":32,"./GenericWorker":28}],25:[function(ir,lr,dr){var fr=ir("./GenericWorker"),hr=ir("../crc32");function mr(){fr.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}ir("../utils").inherits(mr,fr),mr.prototype.processChunk=function(gr){this.streamInfo.crc32=hr(gr.data,this.streamInfo.crc32||0),this.push(gr)},lr.exports=mr},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(ir,lr,dr){var fr=ir("../utils"),hr=ir("./GenericWorker");function mr(gr){hr.call(this,"DataLengthProbe for "+gr),this.propName=gr,this.withStreamInfo(gr,0)}fr.inherits(mr,hr),mr.prototype.processChunk=function(gr){if(gr){var yr=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=yr+gr.data.length}hr.prototype.processChunk.call(this,gr)},lr.exports=mr},{"../utils":32,"./GenericWorker":28}],27:[function(ir,lr,dr){var fr=ir("../utils"),hr=ir("./GenericWorker");function mr(gr){hr.call(this,"DataWorker");var yr=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,gr.then(function(_r){yr.dataIsReady=!0,yr.data=_r,yr.max=_r&&_r.length||0,yr.type=fr.getTypeOf(_r),yr.isPaused||yr._tickAndRepeat()},function(_r){yr.error(_r)})}fr.inherits(mr,hr),mr.prototype.cleanUp=function(){hr.prototype.cleanUp.call(this),this.data=null},mr.prototype.resume=function(){return!!hr.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,fr.delay(this._tickAndRepeat,[],this)),!0)},mr.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(fr.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},mr.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var gr=null,yr=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":gr=this.data.substring(this.index,yr);break;case"uint8array":gr=this.data.subarray(this.index,yr);break;case"array":case"nodebuffer":gr=this.data.slice(this.index,yr)}return this.index=yr,this.push({data:gr,meta:{percent:this.max?this.index/this.max*100:0}})},lr.exports=mr},{"../utils":32,"./GenericWorker":28}],28:[function(ir,lr,dr){function fr(hr){this.name=hr||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}fr.prototype={push:function(hr){this.emit("data",hr)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(hr){this.emit("error",hr)}return!0},error:function(hr){return!this.isFinished&&(this.isPaused?this.generatedError=hr:(this.isFinished=!0,this.emit("error",hr),this.previous&&this.previous.error(hr),this.cleanUp()),!0)},on:function(hr,mr){return this._listeners[hr].push(mr),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(hr,mr){if(this._listeners[hr])for(var gr=0;gr<this._listeners[hr].length;gr++)this._listeners[hr][gr].call(this,mr)},pipe:function(hr){return hr.registerPrevious(this)},registerPrevious:function(hr){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.streamInfo=hr.streamInfo,this.mergeStreamInfo(),this.previous=hr;var mr=this;return hr.on("data",function(gr){mr.processChunk(gr)}),hr.on("end",function(){mr.end()}),hr.on("error",function(gr){mr.error(gr)}),this},pause:function(){return!this.isPaused&&!this.isFinished&&(this.isPaused=!0,this.previous&&this.previous.pause(),!0)},resume:function(){if(!this.isPaused||this.isFinished)return!1;var hr=this.isPaused=!1;return this.generatedError&&(this.error(this.generatedError),hr=!0),this.previous&&this.previous.resume(),!hr},flush:function(){},processChunk:function(hr){this.push(hr)},withStreamInfo:function(hr,mr){return this.extraStreamInfo[hr]=mr,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var hr in this.extraStreamInfo)Object.prototype.hasOwnProperty.call(this.extraStreamInfo,hr)&&(this.streamInfo[hr]=this.extraStreamInfo[hr])},lock:function(){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.isLocked=!0,this.previous&&this.previous.lock()},toString:function(){var hr="Worker "+this.name;return this.previous?this.previous+" -> "+hr:hr}},lr.exports=fr},{}],29:[function(ir,lr,dr){var fr=ir("../utils"),hr=ir("./ConvertWorker"),mr=ir("./GenericWorker"),gr=ir("../base64"),yr=ir("../support"),_r=ir("../external"),br=null;if(yr.nodestream)try{br=ir("../nodejs/NodejsStreamOutputAdapter")}catch{}function vr(xr,Sr){return new _r.Promise(function(Ar,Ir){var Mr=[],Or=xr._internalType,$r=xr._outputType,Dr=xr._mimeType;xr.on("data",function(zr,Fr){Mr.push(zr),Sr&&Sr(Fr)}).on("error",function(zr){Mr=[],Ir(zr)}).on("end",function(){try{var zr=(function(Fr,Jr,$n){switch(Fr){case"blob":return fr.newBlob(fr.transformTo("arraybuffer",Jr),$n);case"base64":return gr.encode(Jr);default:return fr.transformTo(Fr,Jr)}})($r,(function(Fr,Jr){var $n,Qr=0,Zn=null,qn=0;for($n=0;$n<Jr.length;$n++)qn+=Jr[$n].length;switch(Fr){case"string":return Jr.join("");case"array":return Array.prototype.concat.apply([],Jr);case"uint8array":for(Zn=new Uint8Array(qn),$n=0;$n<Jr.length;$n++)Zn.set(Jr[$n],Qr),Qr+=Jr[$n].length;return Zn;case"nodebuffer":return Buffer.concat(Jr);default:throw new Error("concat : unsupported type '"+Fr+"'")}})(Or,Mr),Dr);Ar(zr)}catch(Fr){Ir(Fr)}Mr=[]}).resume()})}function wr(xr,Sr,Ar){var Ir=Sr;switch(Sr){case"blob":case"arraybuffer":Ir="uint8array";break;case"base64":Ir="string"}try{this._internalType=Ir,this._outputType=Sr,this._mimeType=Ar,fr.checkSupport(Ir),this._worker=xr.pipe(new hr(Ir)),xr.lock()}catch(Mr){this._worker=new mr("error"),this._worker.error(Mr)}}wr.prototype={accumulate:function(xr){return vr(this,xr)},on:function(xr,Sr){var Ar=this;return xr==="data"?this._worker.on(xr,function(Ir){Sr.call(Ar,Ir.data,Ir.meta)}):this._worker.on(xr,function(){fr.delay(Sr,arguments,Ar)}),this},resume:function(){return fr.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(xr){if(fr.checkSupport("nodestream"),this._outputType!=="nodebuffer")throw new Error(this._outputType+" is not supported by this method");return new br(this,{objectMode:this._outputType!=="nodebuffer"},xr)}},lr.exports=wr},{"../base64":1,"../external":6,"../nodejs/NodejsStreamOutputAdapter":13,"../support":30,"../utils":32,"./ConvertWorker":24,"./GenericWorker":28}],30:[function(ir,lr,dr){if(dr.base64=!0,dr.array=!0,dr.string=!0,dr.arraybuffer=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",dr.nodebuffer=typeof Buffer<"u",dr.uint8array=typeof Uint8Array<"u",typeof ArrayBuffer>"u")dr.blob=!1;else{var fr=new ArrayBuffer(0);try{dr.blob=new Blob([fr],{type:"application/zip"}).size===0}catch{try{var hr=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);hr.append(fr),dr.blob=hr.getBlob("application/zip").size===0}catch{dr.blob=!1}}}try{dr.nodestream=!!ir("readable-stream").Readable}catch{dr.nodestream=!1}},{"readable-stream":16}],31:[function(ir,lr,dr){for(var fr=ir("./utils"),hr=ir("./support"),mr=ir("./nodejsUtils"),gr=ir("./stream/GenericWorker"),yr=new Array(256),_r=0;_r<256;_r++)yr[_r]=252<=_r?6:248<=_r?5:240<=_r?4:224<=_r?3:192<=_r?2:1;yr[254]=yr[254]=1;function br(){gr.call(this,"utf-8 decode"),this.leftOver=null}function vr(){gr.call(this,"utf-8 encode")}dr.utf8encode=function(wr){return hr.nodebuffer?mr.newBufferFrom(wr,"utf-8"):(function(xr){var Sr,Ar,Ir,Mr,Or,$r=xr.length,Dr=0;for(Mr=0;Mr<$r;Mr++)(64512&(Ar=xr.charCodeAt(Mr)))==55296&&Mr+1<$r&&(64512&(Ir=xr.charCodeAt(Mr+1)))==56320&&(Ar=65536+(Ar-55296<<10)+(Ir-56320),Mr++),Dr+=Ar<128?1:Ar<2048?2:Ar<65536?3:4;for(Sr=hr.uint8array?new Uint8Array(Dr):new Array(Dr),Mr=Or=0;Or<Dr;Mr++)(64512&(Ar=xr.charCodeAt(Mr)))==55296&&Mr+1<$r&&(64512&(Ir=xr.charCodeAt(Mr+1)))==56320&&(Ar=65536+(Ar-55296<<10)+(Ir-56320),Mr++),Ar<128?Sr[Or++]=Ar:(Ar<2048?Sr[Or++]=192|Ar>>>6:(Ar<65536?Sr[Or++]=224|Ar>>>12:(Sr[Or++]=240|Ar>>>18,Sr[Or++]=128|Ar>>>12&63),Sr[Or++]=128|Ar>>>6&63),Sr[Or++]=128|63&Ar);return Sr})(wr)},dr.utf8decode=function(wr){return hr.nodebuffer?fr.transformTo("nodebuffer",wr).toString("utf-8"):(function(xr){var Sr,Ar,Ir,Mr,Or=xr.length,$r=new Array(2*Or);for(Sr=Ar=0;Sr<Or;)if((Ir=xr[Sr++])<128)$r[Ar++]=Ir;else if(4<(Mr=yr[Ir]))$r[Ar++]=65533,Sr+=Mr-1;else{for(Ir&=Mr===2?31:Mr===3?15:7;1<Mr&&Sr<Or;)Ir=Ir<<6|63&xr[Sr++],Mr--;1<Mr?$r[Ar++]=65533:Ir<65536?$r[Ar++]=Ir:(Ir-=65536,$r[Ar++]=55296|Ir>>10&1023,$r[Ar++]=56320|1023&Ir)}return $r.length!==Ar&&($r.subarray?$r=$r.subarray(0,Ar):$r.length=Ar),fr.applyFromCharCode($r)})(wr=fr.transformTo(hr.uint8array?"uint8array":"array",wr))},fr.inherits(br,gr),br.prototype.processChunk=function(wr){var xr=fr.transformTo(hr.uint8array?"uint8array":"array",wr.data);if(this.leftOver&&this.leftOver.length){if(hr.uint8array){var Sr=xr;(xr=new Uint8Array(Sr.length+this.leftOver.length)).set(this.leftOver,0),xr.set(Sr,this.leftOver.length)}else xr=this.leftOver.concat(xr);this.leftOver=null}var Ar=(function(Mr,Or){var $r;for((Or=Or||Mr.length)>Mr.length&&(Or=Mr.length),$r=Or-1;0<=$r&&(192&Mr[$r])==128;)$r--;return $r<0||$r===0?Or:$r+yr[Mr[$r]]>Or?$r:Or})(xr),Ir=xr;Ar!==xr.length&&(hr.uint8array?(Ir=xr.subarray(0,Ar),this.leftOver=xr.subarray(Ar,xr.length)):(Ir=xr.slice(0,Ar),this.leftOver=xr.slice(Ar,xr.length))),this.push({data:dr.utf8decode(Ir),meta:wr.meta})},br.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:dr.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},dr.Utf8DecodeWorker=br,fr.inherits(vr,gr),vr.prototype.processChunk=function(wr){this.push({data:dr.utf8encode(wr.data),meta:wr.meta})},dr.Utf8EncodeWorker=vr},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(ir,lr,dr){var fr=ir("./support"),hr=ir("./base64"),mr=ir("./nodejsUtils"),gr=ir("./external");function yr(Sr){return Sr}function _r(Sr,Ar){for(var Ir=0;Ir<Sr.length;++Ir)Ar[Ir]=255&Sr.charCodeAt(Ir);return Ar}ir("setimmediate"),dr.newBlob=function(Sr,Ar){dr.checkSupport("blob");try{return new Blob([Sr],{type:Ar})}catch{try{var Ir=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);return Ir.append(Sr),Ir.getBlob(Ar)}catch{throw new Error("Bug : can't construct the Blob.")}}};var br={stringifyByChunk:function(Sr,Ar,Ir){var Mr=[],Or=0,$r=Sr.length;if($r<=Ir)return String.fromCharCode.apply(null,Sr);for(;Or<$r;)Ar==="array"||Ar==="nodebuffer"?Mr.push(String.fromCharCode.apply(null,Sr.slice(Or,Math.min(Or+Ir,$r)))):Mr.push(String.fromCharCode.apply(null,Sr.subarray(Or,Math.min(Or+Ir,$r)))),Or+=Ir;return Mr.join("")},stringifyByChar:function(Sr){for(var Ar="",Ir=0;Ir<Sr.length;Ir++)Ar+=String.fromCharCode(Sr[Ir]);return Ar},applyCanBeUsed:{uint8array:(function(){try{return fr.uint8array&&String.fromCharCode.apply(null,new Uint8Array(1)).length===1}catch{return!1}})(),nodebuffer:(function(){try{return fr.nodebuffer&&String.fromCharCode.apply(null,mr.allocBuffer(1)).length===1}catch{return!1}})()}};function vr(Sr){var Ar=65536,Ir=dr.getTypeOf(Sr),Mr=!0;if(Ir==="uint8array"?Mr=br.applyCanBeUsed.uint8array:Ir==="nodebuffer"&&(Mr=br.applyCanBeUsed.nodebuffer),Mr)for(;1<Ar;)try{return br.stringifyByChunk(Sr,Ir,Ar)}catch{Ar=Math.floor(Ar/2)}return br.stringifyByChar(Sr)}function wr(Sr,Ar){for(var Ir=0;Ir<Sr.length;Ir++)Ar[Ir]=Sr[Ir];return Ar}dr.applyFromCharCode=vr;var xr={};xr.string={string:yr,array:function(Sr){return _r(Sr,new Array(Sr.length))},arraybuffer:function(Sr){return xr.string.uint8array(Sr).buffer},uint8array:function(Sr){return _r(Sr,new Uint8Array(Sr.length))},nodebuffer:function(Sr){return _r(Sr,mr.allocBuffer(Sr.length))}},xr.array={string:vr,array:yr,arraybuffer:function(Sr){return new Uint8Array(Sr).buffer},uint8array:function(Sr){return new Uint8Array(Sr)},nodebuffer:function(Sr){return mr.newBufferFrom(Sr)}},xr.arraybuffer={string:function(Sr){return vr(new Uint8Array(Sr))},array:function(Sr){return wr(new Uint8Array(Sr),new Array(Sr.byteLength))},arraybuffer:yr,uint8array:function(Sr){return new Uint8Array(Sr)},nodebuffer:function(Sr){return mr.newBufferFrom(new Uint8Array(Sr))}},xr.uint8array={string:vr,array:function(Sr){return wr(Sr,new Array(Sr.length))},arraybuffer:function(Sr){return Sr.buffer},uint8array:yr,nodebuffer:function(Sr){return mr.newBufferFrom(Sr)}},xr.nodebuffer={string:vr,array:function(Sr){return wr(Sr,new Array(Sr.length))},arraybuffer:function(Sr){return xr.nodebuffer.uint8array(Sr).buffer},uint8array:function(Sr){return wr(Sr,new Uint8Array(Sr.length))},nodebuffer:yr},dr.transformTo=function(Sr,Ar){if(Ar=Ar||"",!Sr)return Ar;dr.checkSupport(Sr);var Ir=dr.getTypeOf(Ar);return xr[Ir][Sr](Ar)},dr.resolve=function(Sr){for(var Ar=Sr.split("/"),Ir=[],Mr=0;Mr<Ar.length;Mr++){var Or=Ar[Mr];Or==="."||Or===""&&Mr!==0&&Mr!==Ar.length-1||(Or===".."?Ir.pop():Ir.push(Or))}return Ir.join("/")},dr.getTypeOf=function(Sr){return typeof Sr=="string"?"string":Object.prototype.toString.call(Sr)==="[object Array]"?"array":fr.nodebuffer&&mr.isBuffer(Sr)?"nodebuffer":fr.uint8array&&Sr instanceof Uint8Array?"uint8array":fr.arraybuffer&&Sr instanceof ArrayBuffer?"arraybuffer":void 0},dr.checkSupport=function(Sr){if(!fr[Sr.toLowerCase()])throw new Error(Sr+" is not supported by this platform")},dr.MAX_VALUE_16BITS=65535,dr.MAX_VALUE_32BITS=-1,dr.pretty=function(Sr){var Ar,Ir,Mr="";for(Ir=0;Ir<(Sr||"").length;Ir++)Mr+="\\x"+((Ar=Sr.charCodeAt(Ir))<16?"0":"")+Ar.toString(16).toUpperCase();return Mr},dr.delay=function(Sr,Ar,Ir){setImmediate(function(){Sr.apply(Ir||null,Ar||[])})},dr.inherits=function(Sr,Ar){function Ir(){}Ir.prototype=Ar.prototype,Sr.prototype=new Ir},dr.extend=function(){var Sr,Ar,Ir={};for(Sr=0;Sr<arguments.length;Sr++)for(Ar in arguments[Sr])Object.prototype.hasOwnProperty.call(arguments[Sr],Ar)&&Ir[Ar]===void 0&&(Ir[Ar]=arguments[Sr][Ar]);return Ir},dr.prepareContent=function(Sr,Ar,Ir,Mr,Or){return gr.Promise.resolve(Ar).then(function($r){return fr.blob&&($r instanceof Blob||["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call($r))!==-1)&&typeof FileReader<"u"?new gr.Promise(function(Dr,zr){var Fr=new FileReader;Fr.onload=function(Jr){Dr(Jr.target.result)},Fr.onerror=function(Jr){zr(Jr.target.error)},Fr.readAsArrayBuffer($r)}):$r}).then(function($r){var Dr=dr.getTypeOf($r);return Dr?(Dr==="arraybuffer"?$r=dr.transformTo("uint8array",$r):Dr==="string"&&(Or?$r=hr.decode($r):Ir&&Mr!==!0&&($r=(function(zr){return _r(zr,fr.uint8array?new Uint8Array(zr.length):new Array(zr.length))})($r))),$r):gr.Promise.reject(new Error("Can't read the data of '"+Sr+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"))})}},{"./base64":1,"./external":6,"./nodejsUtils":14,"./support":30,setimmediate:54}],33:[function(ir,lr,dr){var fr=ir("./reader/readerFor"),hr=ir("./utils"),mr=ir("./signature"),gr=ir("./zipEntry"),yr=ir("./support");function _r(br){this.files=[],this.loadOptions=br}_r.prototype={checkSignature:function(br){if(!this.reader.readAndCheckSignature(br)){this.reader.index-=4;var vr=this.reader.readString(4);throw new Error("Corrupted zip or bug: unexpected signature ("+hr.pretty(vr)+", expected "+hr.pretty(br)+")")}},isSignature:function(br,vr){var wr=this.reader.index;this.reader.setIndex(br);var xr=this.reader.readString(4)===vr;return this.reader.setIndex(wr),xr},readBlockEndOfCentral:function(){this.diskNumber=this.reader.readInt(2),this.diskWithCentralDirStart=this.reader.readInt(2),this.centralDirRecordsOnThisDisk=this.reader.readInt(2),this.centralDirRecords=this.reader.readInt(2),this.centralDirSize=this.reader.readInt(4),this.centralDirOffset=this.reader.readInt(4),this.zipCommentLength=this.reader.readInt(2);var br=this.reader.readData(this.zipCommentLength),vr=yr.uint8array?"uint8array":"array",wr=hr.transformTo(vr,br);this.zipComment=this.loadOptions.decodeFileName(wr)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.reader.skip(4),this.diskNumber=this.reader.readInt(4),this.diskWithCentralDirStart=this.reader.readInt(4),this.centralDirRecordsOnThisDisk=this.reader.readInt(8),this.centralDirRecords=this.reader.readInt(8),this.centralDirSize=this.reader.readInt(8),this.centralDirOffset=this.reader.readInt(8),this.zip64ExtensibleData={};for(var br,vr,wr,xr=this.zip64EndOfCentralSize-44;0<xr;)br=this.reader.readInt(2),vr=this.reader.readInt(4),wr=this.reader.readData(vr),this.zip64ExtensibleData[br]={id:br,length:vr,value:wr}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),1<this.disksCount)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var br,vr;for(br=0;br<this.files.length;br++)vr=this.files[br],this.reader.setIndex(vr.localHeaderOffset),this.checkSignature(mr.LOCAL_FILE_HEADER),vr.readLocalPart(this.reader),vr.handleUTF8(),vr.processAttributes()},readCentralDir:function(){var br;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(mr.CENTRAL_FILE_HEADER);)(br=new gr({zip64:this.zip64},this.loadOptions)).readCentralPart(this.reader),this.files.push(br);if(this.centralDirRecords!==this.files.length&&this.centralDirRecords!==0&&this.files.length===0)throw new Error("Corrupted zip or bug: expected "+this.centralDirRecords+" records in central dir, got "+this.files.length)},readEndOfCentral:function(){var br=this.reader.lastIndexOfSignature(mr.CENTRAL_DIRECTORY_END);if(br<0)throw this.isSignature(0,mr.LOCAL_FILE_HEADER)?new Error("Corrupted zip: can't find end of central directory"):new Error("Can't find end of central directory : is this a zip file ? If it is, see https://stuk.github.io/jszip/documentation/howto/read_zip.html");this.reader.setIndex(br);var vr=br;if(this.checkSignature(mr.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===hr.MAX_VALUE_16BITS||this.diskWithCentralDirStart===hr.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===hr.MAX_VALUE_16BITS||this.centralDirRecords===hr.MAX_VALUE_16BITS||this.centralDirSize===hr.MAX_VALUE_32BITS||this.centralDirOffset===hr.MAX_VALUE_32BITS){if(this.zip64=!0,(br=this.reader.lastIndexOfSignature(mr.ZIP64_CENTRAL_DIRECTORY_LOCATOR))<0)throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator");if(this.reader.setIndex(br),this.checkSignature(mr.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,mr.ZIP64_CENTRAL_DIRECTORY_END)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(mr.ZIP64_CENTRAL_DIRECTORY_END),this.relativeOffsetEndOfZip64CentralDir<0))throw new Error("Corrupted zip: can't find the ZIP64 end of central directory");this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(mr.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var wr=this.centralDirOffset+this.centralDirSize;this.zip64&&(wr+=20,wr+=12+this.zip64EndOfCentralSize);var xr=vr-wr;if(0<xr)this.isSignature(vr,mr.CENTRAL_FILE_HEADER)||(this.reader.zero=xr);else if(xr<0)throw new Error("Corrupted zip: missing "+Math.abs(xr)+" bytes.")},prepareReader:function(br){this.reader=fr(br)},load:function(br){this.prepareReader(br),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},lr.exports=_r},{"./reader/readerFor":22,"./signature":23,"./support":30,"./utils":32,"./zipEntry":34}],34:[function(ir,lr,dr){var fr=ir("./reader/readerFor"),hr=ir("./utils"),mr=ir("./compressedObject"),gr=ir("./crc32"),yr=ir("./utf8"),_r=ir("./compressions"),br=ir("./support");function vr(wr,xr){this.options=wr,this.loadOptions=xr}vr.prototype={isEncrypted:function(){return(1&this.bitFlag)==1},useUTF8:function(){return(2048&this.bitFlag)==2048},readLocalPart:function(wr){var xr,Sr;if(wr.skip(22),this.fileNameLength=wr.readInt(2),Sr=wr.readInt(2),this.fileName=wr.readData(this.fileNameLength),wr.skip(Sr),this.compressedSize===-1||this.uncompressedSize===-1)throw new Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)");if((xr=(function(Ar){for(var Ir in _r)if(Object.prototype.hasOwnProperty.call(_r,Ir)&&_r[Ir].magic===Ar)return _r[Ir];return null})(this.compressionMethod))===null)throw new Error("Corrupted zip : compression "+hr.pretty(this.compressionMethod)+" unknown (inner file : "+hr.transformTo("string",this.fileName)+")");this.decompressed=new mr(this.compressedSize,this.uncompressedSize,this.crc32,xr,wr.readData(this.compressedSize))},readCentralPart:function(wr){this.versionMadeBy=wr.readInt(2),wr.skip(2),this.bitFlag=wr.readInt(2),this.compressionMethod=wr.readString(2),this.date=wr.readDate(),this.crc32=wr.readInt(4),this.compressedSize=wr.readInt(4),this.uncompressedSize=wr.readInt(4);var xr=wr.readInt(2);if(this.extraFieldsLength=wr.readInt(2),this.fileCommentLength=wr.readInt(2),this.diskNumberStart=wr.readInt(2),this.internalFileAttributes=wr.readInt(2),this.externalFileAttributes=wr.readInt(4),this.localHeaderOffset=wr.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");wr.skip(xr),this.readExtraFields(wr),this.parseZIP64ExtraField(wr),this.fileComment=wr.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var wr=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),wr==0&&(this.dosPermissions=63&this.externalFileAttributes),wr==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!=="/"||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var wr=fr(this.extraFields[1].value);this.uncompressedSize===hr.MAX_VALUE_32BITS&&(this.uncompressedSize=wr.readInt(8)),this.compressedSize===hr.MAX_VALUE_32BITS&&(this.compressedSize=wr.readInt(8)),this.localHeaderOffset===hr.MAX_VALUE_32BITS&&(this.localHeaderOffset=wr.readInt(8)),this.diskNumberStart===hr.MAX_VALUE_32BITS&&(this.diskNumberStart=wr.readInt(4))}},readExtraFields:function(wr){var xr,Sr,Ar,Ir=wr.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});wr.index+4<Ir;)xr=wr.readInt(2),Sr=wr.readInt(2),Ar=wr.readData(Sr),this.extraFields[xr]={id:xr,length:Sr,value:Ar};wr.setIndex(Ir)},handleUTF8:function(){var wr=br.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=yr.utf8decode(this.fileName),this.fileCommentStr=yr.utf8decode(this.fileComment);else{var xr=this.findExtraFieldUnicodePath();if(xr!==null)this.fileNameStr=xr;else{var Sr=hr.transformTo(wr,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(Sr)}var Ar=this.findExtraFieldUnicodeComment();if(Ar!==null)this.fileCommentStr=Ar;else{var Ir=hr.transformTo(wr,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(Ir)}}},findExtraFieldUnicodePath:function(){var wr=this.extraFields[28789];if(wr){var xr=fr(wr.value);return xr.readInt(1)!==1||gr(this.fileName)!==xr.readInt(4)?null:yr.utf8decode(xr.readData(wr.length-5))}return null},findExtraFieldUnicodeComment:function(){var wr=this.extraFields[25461];if(wr){var xr=fr(wr.value);return xr.readInt(1)!==1||gr(this.fileComment)!==xr.readInt(4)?null:yr.utf8decode(xr.readData(wr.length-5))}return null}},lr.exports=vr},{"./compressedObject":2,"./compressions":3,"./crc32":4,"./reader/readerFor":22,"./support":30,"./utf8":31,"./utils":32}],35:[function(ir,lr,dr){function fr(xr,Sr,Ar){this.name=xr,this.dir=Ar.dir,this.date=Ar.date,this.comment=Ar.comment,this.unixPermissions=Ar.unixPermissions,this.dosPermissions=Ar.dosPermissions,this._data=Sr,this._dataBinary=Ar.binary,this.options={compression:Ar.compression,compressionOptions:Ar.compressionOptions}}var hr=ir("./stream/StreamHelper"),mr=ir("./stream/DataWorker"),gr=ir("./utf8"),yr=ir("./compressedObject"),_r=ir("./stream/GenericWorker");fr.prototype={internalStream:function(xr){var Sr=null,Ar="string";try{if(!xr)throw new Error("No output type specified.");var Ir=(Ar=xr.toLowerCase())==="string"||Ar==="text";Ar!=="binarystring"&&Ar!=="text"||(Ar="string"),Sr=this._decompressWorker();var Mr=!this._dataBinary;Mr&&!Ir&&(Sr=Sr.pipe(new gr.Utf8EncodeWorker)),!Mr&&Ir&&(Sr=Sr.pipe(new gr.Utf8DecodeWorker))}catch(Or){(Sr=new _r("error")).error(Or)}return new hr(Sr,Ar,"")},async:function(xr,Sr){return this.internalStream(xr).accumulate(Sr)},nodeStream:function(xr,Sr){return this.internalStream(xr||"nodebuffer").toNodejsStream(Sr)},_compressWorker:function(xr,Sr){if(this._data instanceof yr&&this._data.compression.magic===xr.magic)return this._data.getCompressedWorker();var Ar=this._decompressWorker();return this._dataBinary||(Ar=Ar.pipe(new gr.Utf8EncodeWorker)),yr.createWorkerFrom(Ar,xr,Sr)},_decompressWorker:function(){return this._data instanceof yr?this._data.getContentWorker():this._data instanceof _r?this._data:new mr(this._data)}};for(var br=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],vr=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},wr=0;wr<br.length;wr++)fr.prototype[br[wr]]=vr;lr.exports=fr},{"./compressedObject":2,"./stream/DataWorker":27,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31}],36:[function(ir,lr,dr){(function(fr){var hr,mr,gr=fr.MutationObserver||fr.WebKitMutationObserver;if(gr){var yr=0,_r=new gr(xr),br=fr.document.createTextNode("");_r.observe(br,{characterData:!0}),hr=function(){br.data=yr=++yr%2}}else if(fr.setImmediate||fr.MessageChannel===void 0)hr="document"in fr&&"onreadystatechange"in fr.document.createElement("script")?function(){var Sr=fr.document.createElement("script");Sr.onreadystatechange=function(){xr(),Sr.onreadystatechange=null,Sr.parentNode.removeChild(Sr),Sr=null},fr.document.documentElement.appendChild(Sr)}:function(){setTimeout(xr,0)};else{var vr=new fr.MessageChannel;vr.port1.onmessage=xr,hr=function(){vr.port2.postMessage(0)}}var wr=[];function xr(){var Sr,Ar;mr=!0;for(var Ir=wr.length;Ir;){for(Ar=wr,wr=[],Sr=-1;++Sr<Ir;)Ar[Sr]();Ir=wr.length}mr=!1}lr.exports=function(Sr){wr.push(Sr)!==1||mr||hr()}}).call(this,typeof commonjsGlobal<"u"?commonjsGlobal:typeof self<"u"?self:typeof window<"u"?window:{})},{}],37:[function(ir,lr,dr){var fr=ir("immediate");function hr(){}var mr={},gr=["REJECTED"],yr=["FULFILLED"],_r=["PENDING"];function br(Ir){if(typeof Ir!="function")throw new TypeError("resolver must be a function");this.state=_r,this.queue=[],this.outcome=void 0,Ir!==hr&&Sr(this,Ir)}function vr(Ir,Mr,Or){this.promise=Ir,typeof Mr=="function"&&(this.onFulfilled=Mr,this.callFulfilled=this.otherCallFulfilled),typeof Or=="function"&&(this.onRejected=Or,this.callRejected=this.otherCallRejected)}function wr(Ir,Mr,Or){fr(function(){var $r;try{$r=Mr(Or)}catch(Dr){return mr.reject(Ir,Dr)}$r===Ir?mr.reject(Ir,new TypeError("Cannot resolve promise with itself")):mr.resolve(Ir,$r)})}function xr(Ir){var Mr=Ir&&Ir.then;if(Ir&&(typeof Ir=="object"||typeof Ir=="function")&&typeof Mr=="function")return function(){Mr.apply(Ir,arguments)}}function Sr(Ir,Mr){var Or=!1;function $r(Fr){Or||(Or=!0,mr.reject(Ir,Fr))}function Dr(Fr){Or||(Or=!0,mr.resolve(Ir,Fr))}var zr=Ar(function(){Mr(Dr,$r)});zr.status==="error"&&$r(zr.value)}function Ar(Ir,Mr){var Or={};try{Or.value=Ir(Mr),Or.status="success"}catch($r){Or.status="error",Or.value=$r}return Or}(lr.exports=br).prototype.finally=function(Ir){if(typeof Ir!="function")return this;var Mr=this.constructor;return this.then(function(Or){return Mr.resolve(Ir()).then(function(){return Or})},function(Or){return Mr.resolve(Ir()).then(function(){throw Or})})},br.prototype.catch=function(Ir){return this.then(null,Ir)},br.prototype.then=function(Ir,Mr){if(typeof Ir!="function"&&this.state===yr||typeof Mr!="function"&&this.state===gr)return this;var Or=new this.constructor(hr);return this.state!==_r?wr(Or,this.state===yr?Ir:Mr,this.outcome):this.queue.push(new vr(Or,Ir,Mr)),Or},vr.prototype.callFulfilled=function(Ir){mr.resolve(this.promise,Ir)},vr.prototype.otherCallFulfilled=function(Ir){wr(this.promise,this.onFulfilled,Ir)},vr.prototype.callRejected=function(Ir){mr.reject(this.promise,Ir)},vr.prototype.otherCallRejected=function(Ir){wr(this.promise,this.onRejected,Ir)},mr.resolve=function(Ir,Mr){var Or=Ar(xr,Mr);if(Or.status==="error")return mr.reject(Ir,Or.value);var $r=Or.value;if($r)Sr(Ir,$r);else{Ir.state=yr,Ir.outcome=Mr;for(var Dr=-1,zr=Ir.queue.length;++Dr<zr;)Ir.queue[Dr].callFulfilled(Mr)}return Ir},mr.reject=function(Ir,Mr){Ir.state=gr,Ir.outcome=Mr;for(var Or=-1,$r=Ir.queue.length;++Or<$r;)Ir.queue[Or].callRejected(Mr);return Ir},br.resolve=function(Ir){return Ir instanceof this?Ir:mr.resolve(new this(hr),Ir)},br.reject=function(Ir){var Mr=new this(hr);return mr.reject(Mr,Ir)},br.all=function(Ir){var Mr=this;if(Object.prototype.toString.call(Ir)!=="[object Array]")return this.reject(new TypeError("must be an array"));var Or=Ir.length,$r=!1;if(!Or)return this.resolve([]);for(var Dr=new Array(Or),zr=0,Fr=-1,Jr=new this(hr);++Fr<Or;)$n(Ir[Fr],Fr);return Jr;function $n(Qr,Zn){Mr.resolve(Qr).then(function(qn){Dr[Zn]=qn,++zr!==Or||$r||($r=!0,mr.resolve(Jr,Dr))},function(qn){$r||($r=!0,mr.reject(Jr,qn))})}},br.race=function(Ir){var Mr=this;if(Object.prototype.toString.call(Ir)!=="[object Array]")return this.reject(new TypeError("must be an array"));var Or=Ir.length,$r=!1;if(!Or)return this.resolve([]);for(var Dr=-1,zr=new this(hr);++Dr<Or;)Fr=Ir[Dr],Mr.resolve(Fr).then(function(Jr){$r||($r=!0,mr.resolve(zr,Jr))},function(Jr){$r||($r=!0,mr.reject(zr,Jr))});var Fr;return zr}},{immediate:36}],38:[function(ir,lr,dr){var fr={};(0,ir("./lib/utils/common").assign)(fr,ir("./lib/deflate"),ir("./lib/inflate"),ir("./lib/zlib/constants")),lr.exports=fr},{"./lib/deflate":39,"./lib/inflate":40,"./lib/utils/common":41,"./lib/zlib/constants":44}],39:[function(ir,lr,dr){var fr=ir("./zlib/deflate"),hr=ir("./utils/common"),mr=ir("./utils/strings"),gr=ir("./zlib/messages"),yr=ir("./zlib/zstream"),_r=Object.prototype.toString,br=0,vr=-1,wr=0,xr=8;function Sr(Ir){if(!(this instanceof Sr))return new Sr(Ir);this.options=hr.assign({level:vr,method:xr,chunkSize:16384,windowBits:15,memLevel:8,strategy:wr,to:""},Ir||{});var Mr=this.options;Mr.raw&&0<Mr.windowBits?Mr.windowBits=-Mr.windowBits:Mr.gzip&&0<Mr.windowBits&&Mr.windowBits<16&&(Mr.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new yr,this.strm.avail_out=0;var Or=fr.deflateInit2(this.strm,Mr.level,Mr.method,Mr.windowBits,Mr.memLevel,Mr.strategy);if(Or!==br)throw new Error(gr[Or]);if(Mr.header&&fr.deflateSetHeader(this.strm,Mr.header),Mr.dictionary){var $r;if($r=typeof Mr.dictionary=="string"?mr.string2buf(Mr.dictionary):_r.call(Mr.dictionary)==="[object ArrayBuffer]"?new Uint8Array(Mr.dictionary):Mr.dictionary,(Or=fr.deflateSetDictionary(this.strm,$r))!==br)throw new Error(gr[Or]);this._dict_set=!0}}function Ar(Ir,Mr){var Or=new Sr(Mr);if(Or.push(Ir,!0),Or.err)throw Or.msg||gr[Or.err];return Or.result}Sr.prototype.push=function(Ir,Mr){var Or,$r,Dr=this.strm,zr=this.options.chunkSize;if(this.ended)return!1;$r=Mr===~~Mr?Mr:Mr===!0?4:0,typeof Ir=="string"?Dr.input=mr.string2buf(Ir):_r.call(Ir)==="[object ArrayBuffer]"?Dr.input=new Uint8Array(Ir):Dr.input=Ir,Dr.next_in=0,Dr.avail_in=Dr.input.length;do{if(Dr.avail_out===0&&(Dr.output=new hr.Buf8(zr),Dr.next_out=0,Dr.avail_out=zr),(Or=fr.deflate(Dr,$r))!==1&&Or!==br)return this.onEnd(Or),!(this.ended=!0);Dr.avail_out!==0&&(Dr.avail_in!==0||$r!==4&&$r!==2)||(this.options.to==="string"?this.onData(mr.buf2binstring(hr.shrinkBuf(Dr.output,Dr.next_out))):this.onData(hr.shrinkBuf(Dr.output,Dr.next_out)))}while((0<Dr.avail_in||Dr.avail_out===0)&&Or!==1);return $r===4?(Or=fr.deflateEnd(this.strm),this.onEnd(Or),this.ended=!0,Or===br):$r!==2||(this.onEnd(br),!(Dr.avail_out=0))},Sr.prototype.onData=function(Ir){this.chunks.push(Ir)},Sr.prototype.onEnd=function(Ir){Ir===br&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=hr.flattenChunks(this.chunks)),this.chunks=[],this.err=Ir,this.msg=this.strm.msg},dr.Deflate=Sr,dr.deflate=Ar,dr.deflateRaw=function(Ir,Mr){return(Mr=Mr||{}).raw=!0,Ar(Ir,Mr)},dr.gzip=function(Ir,Mr){return(Mr=Mr||{}).gzip=!0,Ar(Ir,Mr)}},{"./utils/common":41,"./utils/strings":42,"./zlib/deflate":46,"./zlib/messages":51,"./zlib/zstream":53}],40:[function(ir,lr,dr){var fr=ir("./zlib/inflate"),hr=ir("./utils/common"),mr=ir("./utils/strings"),gr=ir("./zlib/constants"),yr=ir("./zlib/messages"),_r=ir("./zlib/zstream"),br=ir("./zlib/gzheader"),vr=Object.prototype.toString;function wr(Sr){if(!(this instanceof wr))return new wr(Sr);this.options=hr.assign({chunkSize:16384,windowBits:0,to:""},Sr||{});var Ar=this.options;Ar.raw&&0<=Ar.windowBits&&Ar.windowBits<16&&(Ar.windowBits=-Ar.windowBits,Ar.windowBits===0&&(Ar.windowBits=-15)),!(0<=Ar.windowBits&&Ar.windowBits<16)||Sr&&Sr.windowBits||(Ar.windowBits+=32),15<Ar.windowBits&&Ar.windowBits<48&&(15&Ar.windowBits)==0&&(Ar.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new _r,this.strm.avail_out=0;var Ir=fr.inflateInit2(this.strm,Ar.windowBits);if(Ir!==gr.Z_OK)throw new Error(yr[Ir]);this.header=new br,fr.inflateGetHeader(this.strm,this.header)}function xr(Sr,Ar){var Ir=new wr(Ar);if(Ir.push(Sr,!0),Ir.err)throw Ir.msg||yr[Ir.err];return Ir.result}wr.prototype.push=function(Sr,Ar){var Ir,Mr,Or,$r,Dr,zr,Fr=this.strm,Jr=this.options.chunkSize,$n=this.options.dictionary,Qr=!1;if(this.ended)return!1;Mr=Ar===~~Ar?Ar:Ar===!0?gr.Z_FINISH:gr.Z_NO_FLUSH,typeof Sr=="string"?Fr.input=mr.binstring2buf(Sr):vr.call(Sr)==="[object ArrayBuffer]"?Fr.input=new Uint8Array(Sr):Fr.input=Sr,Fr.next_in=0,Fr.avail_in=Fr.input.length;do{if(Fr.avail_out===0&&(Fr.output=new hr.Buf8(Jr),Fr.next_out=0,Fr.avail_out=Jr),(Ir=fr.inflate(Fr,gr.Z_NO_FLUSH))===gr.Z_NEED_DICT&&$n&&(zr=typeof $n=="string"?mr.string2buf($n):vr.call($n)==="[object ArrayBuffer]"?new Uint8Array($n):$n,Ir=fr.inflateSetDictionary(this.strm,zr)),Ir===gr.Z_BUF_ERROR&&Qr===!0&&(Ir=gr.Z_OK,Qr=!1),Ir!==gr.Z_STREAM_END&&Ir!==gr.Z_OK)return this.onEnd(Ir),!(this.ended=!0);Fr.next_out&&(Fr.avail_out!==0&&Ir!==gr.Z_STREAM_END&&(Fr.avail_in!==0||Mr!==gr.Z_FINISH&&Mr!==gr.Z_SYNC_FLUSH)||(this.options.to==="string"?(Or=mr.utf8border(Fr.output,Fr.next_out),$r=Fr.next_out-Or,Dr=mr.buf2string(Fr.output,Or),Fr.next_out=$r,Fr.avail_out=Jr-$r,$r&&hr.arraySet(Fr.output,Fr.output,Or,$r,0),this.onData(Dr)):this.onData(hr.shrinkBuf(Fr.output,Fr.next_out)))),Fr.avail_in===0&&Fr.avail_out===0&&(Qr=!0)}while((0<Fr.avail_in||Fr.avail_out===0)&&Ir!==gr.Z_STREAM_END);return Ir===gr.Z_STREAM_END&&(Mr=gr.Z_FINISH),Mr===gr.Z_FINISH?(Ir=fr.inflateEnd(this.strm),this.onEnd(Ir),this.ended=!0,Ir===gr.Z_OK):Mr!==gr.Z_SYNC_FLUSH||(this.onEnd(gr.Z_OK),!(Fr.avail_out=0))},wr.prototype.onData=function(Sr){this.chunks.push(Sr)},wr.prototype.onEnd=function(Sr){Sr===gr.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=hr.flattenChunks(this.chunks)),this.chunks=[],this.err=Sr,this.msg=this.strm.msg},dr.Inflate=wr,dr.inflate=xr,dr.inflateRaw=function(Sr,Ar){return(Ar=Ar||{}).raw=!0,xr(Sr,Ar)},dr.ungzip=xr},{"./utils/common":41,"./utils/strings":42,"./zlib/constants":44,"./zlib/gzheader":47,"./zlib/inflate":49,"./zlib/messages":51,"./zlib/zstream":53}],41:[function(ir,lr,dr){var fr=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";dr.assign=function(gr){for(var yr=Array.prototype.slice.call(arguments,1);yr.length;){var _r=yr.shift();if(_r){if(typeof _r!="object")throw new TypeError(_r+"must be non-object");for(var br in _r)_r.hasOwnProperty(br)&&(gr[br]=_r[br])}}return gr},dr.shrinkBuf=function(gr,yr){return gr.length===yr?gr:gr.subarray?gr.subarray(0,yr):(gr.length=yr,gr)};var hr={arraySet:function(gr,yr,_r,br,vr){if(yr.subarray&&gr.subarray)gr.set(yr.subarray(_r,_r+br),vr);else for(var wr=0;wr<br;wr++)gr[vr+wr]=yr[_r+wr]},flattenChunks:function(gr){var yr,_r,br,vr,wr,xr;for(yr=br=0,_r=gr.length;yr<_r;yr++)br+=gr[yr].length;for(xr=new Uint8Array(br),yr=vr=0,_r=gr.length;yr<_r;yr++)wr=gr[yr],xr.set(wr,vr),vr+=wr.length;return xr}},mr={arraySet:function(gr,yr,_r,br,vr){for(var wr=0;wr<br;wr++)gr[vr+wr]=yr[_r+wr]},flattenChunks:function(gr){return[].concat.apply([],gr)}};dr.setTyped=function(gr){gr?(dr.Buf8=Uint8Array,dr.Buf16=Uint16Array,dr.Buf32=Int32Array,dr.assign(dr,hr)):(dr.Buf8=Array,dr.Buf16=Array,dr.Buf32=Array,dr.assign(dr,mr))},dr.setTyped(fr)},{}],42:[function(ir,lr,dr){var fr=ir("./common"),hr=!0,mr=!0;try{String.fromCharCode.apply(null,[0])}catch{hr=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{mr=!1}for(var gr=new fr.Buf8(256),yr=0;yr<256;yr++)gr[yr]=252<=yr?6:248<=yr?5:240<=yr?4:224<=yr?3:192<=yr?2:1;function _r(br,vr){if(vr<65537&&(br.subarray&&mr||!br.subarray&&hr))return String.fromCharCode.apply(null,fr.shrinkBuf(br,vr));for(var wr="",xr=0;xr<vr;xr++)wr+=String.fromCharCode(br[xr]);return wr}gr[254]=gr[254]=1,dr.string2buf=function(br){var vr,wr,xr,Sr,Ar,Ir=br.length,Mr=0;for(Sr=0;Sr<Ir;Sr++)(64512&(wr=br.charCodeAt(Sr)))==55296&&Sr+1<Ir&&(64512&(xr=br.charCodeAt(Sr+1)))==56320&&(wr=65536+(wr-55296<<10)+(xr-56320),Sr++),Mr+=wr<128?1:wr<2048?2:wr<65536?3:4;for(vr=new fr.Buf8(Mr),Sr=Ar=0;Ar<Mr;Sr++)(64512&(wr=br.charCodeAt(Sr)))==55296&&Sr+1<Ir&&(64512&(xr=br.charCodeAt(Sr+1)))==56320&&(wr=65536+(wr-55296<<10)+(xr-56320),Sr++),wr<128?vr[Ar++]=wr:(wr<2048?vr[Ar++]=192|wr>>>6:(wr<65536?vr[Ar++]=224|wr>>>12:(vr[Ar++]=240|wr>>>18,vr[Ar++]=128|wr>>>12&63),vr[Ar++]=128|wr>>>6&63),vr[Ar++]=128|63&wr);return vr},dr.buf2binstring=function(br){return _r(br,br.length)},dr.binstring2buf=function(br){for(var vr=new fr.Buf8(br.length),wr=0,xr=vr.length;wr<xr;wr++)vr[wr]=br.charCodeAt(wr);return vr},dr.buf2string=function(br,vr){var wr,xr,Sr,Ar,Ir=vr||br.length,Mr=new Array(2*Ir);for(wr=xr=0;wr<Ir;)if((Sr=br[wr++])<128)Mr[xr++]=Sr;else if(4<(Ar=gr[Sr]))Mr[xr++]=65533,wr+=Ar-1;else{for(Sr&=Ar===2?31:Ar===3?15:7;1<Ar&&wr<Ir;)Sr=Sr<<6|63&br[wr++],Ar--;1<Ar?Mr[xr++]=65533:Sr<65536?Mr[xr++]=Sr:(Sr-=65536,Mr[xr++]=55296|Sr>>10&1023,Mr[xr++]=56320|1023&Sr)}return _r(Mr,xr)},dr.utf8border=function(br,vr){var wr;for((vr=vr||br.length)>br.length&&(vr=br.length),wr=vr-1;0<=wr&&(192&br[wr])==128;)wr--;return wr<0||wr===0?vr:wr+gr[br[wr]]>vr?wr:vr}},{"./common":41}],43:[function(ir,lr,dr){lr.exports=function(fr,hr,mr,gr){for(var yr=65535&fr|0,_r=fr>>>16&65535|0,br=0;mr!==0;){for(mr-=br=2e3<mr?2e3:mr;_r=_r+(yr=yr+hr[gr++]|0)|0,--br;);yr%=65521,_r%=65521}return yr|_r<<16|0}},{}],44:[function(ir,lr,dr){lr.exports={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_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}},{}],45:[function(ir,lr,dr){var fr=(function(){for(var hr,mr=[],gr=0;gr<256;gr++){hr=gr;for(var yr=0;yr<8;yr++)hr=1&hr?3988292384^hr>>>1:hr>>>1;mr[gr]=hr}return mr})();lr.exports=function(hr,mr,gr,yr){var _r=fr,br=yr+gr;hr^=-1;for(var vr=yr;vr<br;vr++)hr=hr>>>8^_r[255&(hr^mr[vr])];return-1^hr}},{}],46:[function(ir,lr,dr){var fr,hr=ir("../utils/common"),mr=ir("./trees"),gr=ir("./adler32"),yr=ir("./crc32"),_r=ir("./messages"),br=0,vr=4,wr=0,xr=-2,Sr=-1,Ar=4,Ir=2,Mr=8,Or=9,$r=286,Dr=30,zr=19,Fr=2*$r+1,Jr=15,$n=3,Qr=258,Zn=Qr+$n+1,qn=42,Xn=113,Lr=1,Gr=2,Hn=3,ii=4;function oi(Kn,yi){return Kn.msg=_r[yi],yi}function ri(Kn){return(Kn<<1)-(4<Kn?9:0)}function ti(Kn){for(var yi=Kn.length;0<=--yi;)Kn[yi]=0}function si(Kn){var yi=Kn.state,Ii=yi.pending;Ii>Kn.avail_out&&(Ii=Kn.avail_out),Ii!==0&&(hr.arraySet(Kn.output,yi.pending_buf,yi.pending_out,Ii,Kn.next_out),Kn.next_out+=Ii,yi.pending_out+=Ii,Kn.total_out+=Ii,Kn.avail_out-=Ii,yi.pending-=Ii,yi.pending===0&&(yi.pending_out=0))}function Jn(Kn,yi){mr._tr_flush_block(Kn,0<=Kn.block_start?Kn.block_start:-1,Kn.strstart-Kn.block_start,yi),Kn.block_start=Kn.strstart,si(Kn.strm)}function ni(Kn,yi){Kn.pending_buf[Kn.pending++]=yi}function Yn(Kn,yi){Kn.pending_buf[Kn.pending++]=yi>>>8&255,Kn.pending_buf[Kn.pending++]=255&yi}function ei(Kn,yi){var Ii,gi,hi=Kn.max_chain_length,fi=Kn.strstart,ci=Kn.prev_length,wi=Kn.nice_match,_i=Kn.strstart>Kn.w_size-Zn?Kn.strstart-(Kn.w_size-Zn):0,Mi=Kn.window,li=Kn.w_mask,ui=Kn.prev,Ci=Kn.strstart+Qr,ji=Mi[fi+ci-1],xi=Mi[fi+ci];Kn.prev_length>=Kn.good_match&&(hi>>=2),wi>Kn.lookahead&&(wi=Kn.lookahead);do if(Mi[(Ii=yi)+ci]===xi&&Mi[Ii+ci-1]===ji&&Mi[Ii]===Mi[fi]&&Mi[++Ii]===Mi[fi+1]){fi+=2,Ii++;do;while(Mi[++fi]===Mi[++Ii]&&Mi[++fi]===Mi[++Ii]&&Mi[++fi]===Mi[++Ii]&&Mi[++fi]===Mi[++Ii]&&Mi[++fi]===Mi[++Ii]&&Mi[++fi]===Mi[++Ii]&&Mi[++fi]===Mi[++Ii]&&Mi[++fi]===Mi[++Ii]&&fi<Ci);if(gi=Qr-(Ci-fi),fi=Ci-Qr,ci<gi){if(Kn.match_start=yi,wi<=(ci=gi))break;ji=Mi[fi+ci-1],xi=Mi[fi+ci]}}while((yi=ui[yi&li])>_i&&--hi!=0);return ci<=Kn.lookahead?ci:Kn.lookahead}function ai(Kn){var yi,Ii,gi,hi,fi,ci,wi,_i,Mi,li,ui=Kn.w_size;do{if(hi=Kn.window_size-Kn.lookahead-Kn.strstart,Kn.strstart>=ui+(ui-Zn)){for(hr.arraySet(Kn.window,Kn.window,ui,ui,0),Kn.match_start-=ui,Kn.strstart-=ui,Kn.block_start-=ui,yi=Ii=Kn.hash_size;gi=Kn.head[--yi],Kn.head[yi]=ui<=gi?gi-ui:0,--Ii;);for(yi=Ii=ui;gi=Kn.prev[--yi],Kn.prev[yi]=ui<=gi?gi-ui:0,--Ii;);hi+=ui}if(Kn.strm.avail_in===0)break;if(ci=Kn.strm,wi=Kn.window,_i=Kn.strstart+Kn.lookahead,Mi=hi,li=void 0,li=ci.avail_in,Mi<li&&(li=Mi),Ii=li===0?0:(ci.avail_in-=li,hr.arraySet(wi,ci.input,ci.next_in,li,_i),ci.state.wrap===1?ci.adler=gr(ci.adler,wi,li,_i):ci.state.wrap===2&&(ci.adler=yr(ci.adler,wi,li,_i)),ci.next_in+=li,ci.total_in+=li,li),Kn.lookahead+=Ii,Kn.lookahead+Kn.insert>=$n)for(fi=Kn.strstart-Kn.insert,Kn.ins_h=Kn.window[fi],Kn.ins_h=(Kn.ins_h<<Kn.hash_shift^Kn.window[fi+1])&Kn.hash_mask;Kn.insert&&(Kn.ins_h=(Kn.ins_h<<Kn.hash_shift^Kn.window[fi+$n-1])&Kn.hash_mask,Kn.prev[fi&Kn.w_mask]=Kn.head[Kn.ins_h],Kn.head[Kn.ins_h]=fi,fi++,Kn.insert--,!(Kn.lookahead+Kn.insert<$n)););}while(Kn.lookahead<Zn&&Kn.strm.avail_in!==0)}function pi(Kn,yi){for(var Ii,gi;;){if(Kn.lookahead<Zn){if(ai(Kn),Kn.lookahead<Zn&&yi===br)return Lr;if(Kn.lookahead===0)break}if(Ii=0,Kn.lookahead>=$n&&(Kn.ins_h=(Kn.ins_h<<Kn.hash_shift^Kn.window[Kn.strstart+$n-1])&Kn.hash_mask,Ii=Kn.prev[Kn.strstart&Kn.w_mask]=Kn.head[Kn.ins_h],Kn.head[Kn.ins_h]=Kn.strstart),Ii!==0&&Kn.strstart-Ii<=Kn.w_size-Zn&&(Kn.match_length=ei(Kn,Ii)),Kn.match_length>=$n)if(gi=mr._tr_tally(Kn,Kn.strstart-Kn.match_start,Kn.match_length-$n),Kn.lookahead-=Kn.match_length,Kn.match_length<=Kn.max_lazy_match&&Kn.lookahead>=$n){for(Kn.match_length--;Kn.strstart++,Kn.ins_h=(Kn.ins_h<<Kn.hash_shift^Kn.window[Kn.strstart+$n-1])&Kn.hash_mask,Ii=Kn.prev[Kn.strstart&Kn.w_mask]=Kn.head[Kn.ins_h],Kn.head[Kn.ins_h]=Kn.strstart,--Kn.match_length!=0;);Kn.strstart++}else Kn.strstart+=Kn.match_length,Kn.match_length=0,Kn.ins_h=Kn.window[Kn.strstart],Kn.ins_h=(Kn.ins_h<<Kn.hash_shift^Kn.window[Kn.strstart+1])&Kn.hash_mask;else gi=mr._tr_tally(Kn,0,Kn.window[Kn.strstart]),Kn.lookahead--,Kn.strstart++;if(gi&&(Jn(Kn,!1),Kn.strm.avail_out===0))return Lr}return Kn.insert=Kn.strstart<$n-1?Kn.strstart:$n-1,yi===vr?(Jn(Kn,!0),Kn.strm.avail_out===0?Hn:ii):Kn.last_lit&&(Jn(Kn,!1),Kn.strm.avail_out===0)?Lr:Gr}function bi(Kn,yi){for(var Ii,gi,hi;;){if(Kn.lookahead<Zn){if(ai(Kn),Kn.lookahead<Zn&&yi===br)return Lr;if(Kn.lookahead===0)break}if(Ii=0,Kn.lookahead>=$n&&(Kn.ins_h=(Kn.ins_h<<Kn.hash_shift^Kn.window[Kn.strstart+$n-1])&Kn.hash_mask,Ii=Kn.prev[Kn.strstart&Kn.w_mask]=Kn.head[Kn.ins_h],Kn.head[Kn.ins_h]=Kn.strstart),Kn.prev_length=Kn.match_length,Kn.prev_match=Kn.match_start,Kn.match_length=$n-1,Ii!==0&&Kn.prev_length<Kn.max_lazy_match&&Kn.strstart-Ii<=Kn.w_size-Zn&&(Kn.match_length=ei(Kn,Ii),Kn.match_length<=5&&(Kn.strategy===1||Kn.match_length===$n&&4096<Kn.strstart-Kn.match_start)&&(Kn.match_length=$n-1)),Kn.prev_length>=$n&&Kn.match_length<=Kn.prev_length){for(hi=Kn.strstart+Kn.lookahead-$n,gi=mr._tr_tally(Kn,Kn.strstart-1-Kn.prev_match,Kn.prev_length-$n),Kn.lookahead-=Kn.prev_length-1,Kn.prev_length-=2;++Kn.strstart<=hi&&(Kn.ins_h=(Kn.ins_h<<Kn.hash_shift^Kn.window[Kn.strstart+$n-1])&Kn.hash_mask,Ii=Kn.prev[Kn.strstart&Kn.w_mask]=Kn.head[Kn.ins_h],Kn.head[Kn.ins_h]=Kn.strstart),--Kn.prev_length!=0;);if(Kn.match_available=0,Kn.match_length=$n-1,Kn.strstart++,gi&&(Jn(Kn,!1),Kn.strm.avail_out===0))return Lr}else if(Kn.match_available){if((gi=mr._tr_tally(Kn,0,Kn.window[Kn.strstart-1]))&&Jn(Kn,!1),Kn.strstart++,Kn.lookahead--,Kn.strm.avail_out===0)return Lr}else Kn.match_available=1,Kn.strstart++,Kn.lookahead--}return Kn.match_available&&(gi=mr._tr_tally(Kn,0,Kn.window[Kn.strstart-1]),Kn.match_available=0),Kn.insert=Kn.strstart<$n-1?Kn.strstart:$n-1,yi===vr?(Jn(Kn,!0),Kn.strm.avail_out===0?Hn:ii):Kn.last_lit&&(Jn(Kn,!1),Kn.strm.avail_out===0)?Lr:Gr}function vi(Kn,yi,Ii,gi,hi){this.good_length=Kn,this.max_lazy=yi,this.nice_length=Ii,this.max_chain=gi,this.func=hi}function Ti(){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=Mr,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 hr.Buf16(2*Fr),this.dyn_dtree=new hr.Buf16(2*(2*Dr+1)),this.bl_tree=new hr.Buf16(2*(2*zr+1)),ti(this.dyn_ltree),ti(this.dyn_dtree),ti(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new hr.Buf16(Jr+1),this.heap=new hr.Buf16(2*$r+1),ti(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new hr.Buf16(2*$r+1),ti(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}function Li(Kn){var yi;return Kn&&Kn.state?(Kn.total_in=Kn.total_out=0,Kn.data_type=Ir,(yi=Kn.state).pending=0,yi.pending_out=0,yi.wrap<0&&(yi.wrap=-yi.wrap),yi.status=yi.wrap?qn:Xn,Kn.adler=yi.wrap===2?0:1,yi.last_flush=br,mr._tr_init(yi),wr):oi(Kn,xr)}function qi(Kn){var yi=Li(Kn);return yi===wr&&(function(Ii){Ii.window_size=2*Ii.w_size,ti(Ii.head),Ii.max_lazy_match=fr[Ii.level].max_lazy,Ii.good_match=fr[Ii.level].good_length,Ii.nice_match=fr[Ii.level].nice_length,Ii.max_chain_length=fr[Ii.level].max_chain,Ii.strstart=0,Ii.block_start=0,Ii.lookahead=0,Ii.insert=0,Ii.match_length=Ii.prev_length=$n-1,Ii.match_available=0,Ii.ins_h=0})(Kn.state),yi}function Hi(Kn,yi,Ii,gi,hi,fi){if(!Kn)return xr;var ci=1;if(yi===Sr&&(yi=6),gi<0?(ci=0,gi=-gi):15<gi&&(ci=2,gi-=16),hi<1||Or<hi||Ii!==Mr||gi<8||15<gi||yi<0||9<yi||fi<0||Ar<fi)return oi(Kn,xr);gi===8&&(gi=9);var wi=new Ti;return(Kn.state=wi).strm=Kn,wi.wrap=ci,wi.gzhead=null,wi.w_bits=gi,wi.w_size=1<<wi.w_bits,wi.w_mask=wi.w_size-1,wi.hash_bits=hi+7,wi.hash_size=1<<wi.hash_bits,wi.hash_mask=wi.hash_size-1,wi.hash_shift=~~((wi.hash_bits+$n-1)/$n),wi.window=new hr.Buf8(2*wi.w_size),wi.head=new hr.Buf16(wi.hash_size),wi.prev=new hr.Buf16(wi.w_size),wi.lit_bufsize=1<<hi+6,wi.pending_buf_size=4*wi.lit_bufsize,wi.pending_buf=new hr.Buf8(wi.pending_buf_size),wi.d_buf=1*wi.lit_bufsize,wi.l_buf=3*wi.lit_bufsize,wi.level=yi,wi.strategy=fi,wi.method=Ii,qi(Kn)}fr=[new vi(0,0,0,0,function(Kn,yi){var Ii=65535;for(Ii>Kn.pending_buf_size-5&&(Ii=Kn.pending_buf_size-5);;){if(Kn.lookahead<=1){if(ai(Kn),Kn.lookahead===0&&yi===br)return Lr;if(Kn.lookahead===0)break}Kn.strstart+=Kn.lookahead,Kn.lookahead=0;var gi=Kn.block_start+Ii;if((Kn.strstart===0||Kn.strstart>=gi)&&(Kn.lookahead=Kn.strstart-gi,Kn.strstart=gi,Jn(Kn,!1),Kn.strm.avail_out===0)||Kn.strstart-Kn.block_start>=Kn.w_size-Zn&&(Jn(Kn,!1),Kn.strm.avail_out===0))return Lr}return Kn.insert=0,yi===vr?(Jn(Kn,!0),Kn.strm.avail_out===0?Hn:ii):(Kn.strstart>Kn.block_start&&(Jn(Kn,!1),Kn.strm.avail_out),Lr)}),new vi(4,4,8,4,pi),new vi(4,5,16,8,pi),new vi(4,6,32,32,pi),new vi(4,4,16,16,bi),new vi(8,16,32,32,bi),new vi(8,16,128,128,bi),new vi(8,32,128,256,bi),new vi(32,128,258,1024,bi),new vi(32,258,258,4096,bi)],dr.deflateInit=function(Kn,yi){return Hi(Kn,yi,Mr,15,8,0)},dr.deflateInit2=Hi,dr.deflateReset=qi,dr.deflateResetKeep=Li,dr.deflateSetHeader=function(Kn,yi){return Kn&&Kn.state?Kn.state.wrap!==2?xr:(Kn.state.gzhead=yi,wr):xr},dr.deflate=function(Kn,yi){var Ii,gi,hi,fi;if(!Kn||!Kn.state||5<yi||yi<0)return Kn?oi(Kn,xr):xr;if(gi=Kn.state,!Kn.output||!Kn.input&&Kn.avail_in!==0||gi.status===666&&yi!==vr)return oi(Kn,Kn.avail_out===0?-5:xr);if(gi.strm=Kn,Ii=gi.last_flush,gi.last_flush=yi,gi.status===qn)if(gi.wrap===2)Kn.adler=0,ni(gi,31),ni(gi,139),ni(gi,8),gi.gzhead?(ni(gi,(gi.gzhead.text?1:0)+(gi.gzhead.hcrc?2:0)+(gi.gzhead.extra?4:0)+(gi.gzhead.name?8:0)+(gi.gzhead.comment?16:0)),ni(gi,255&gi.gzhead.time),ni(gi,gi.gzhead.time>>8&255),ni(gi,gi.gzhead.time>>16&255),ni(gi,gi.gzhead.time>>24&255),ni(gi,gi.level===9?2:2<=gi.strategy||gi.level<2?4:0),ni(gi,255&gi.gzhead.os),gi.gzhead.extra&&gi.gzhead.extra.length&&(ni(gi,255&gi.gzhead.extra.length),ni(gi,gi.gzhead.extra.length>>8&255)),gi.gzhead.hcrc&&(Kn.adler=yr(Kn.adler,gi.pending_buf,gi.pending,0)),gi.gzindex=0,gi.status=69):(ni(gi,0),ni(gi,0),ni(gi,0),ni(gi,0),ni(gi,0),ni(gi,gi.level===9?2:2<=gi.strategy||gi.level<2?4:0),ni(gi,3),gi.status=Xn);else{var ci=Mr+(gi.w_bits-8<<4)<<8;ci|=(2<=gi.strategy||gi.level<2?0:gi.level<6?1:gi.level===6?2:3)<<6,gi.strstart!==0&&(ci|=32),ci+=31-ci%31,gi.status=Xn,Yn(gi,ci),gi.strstart!==0&&(Yn(gi,Kn.adler>>>16),Yn(gi,65535&Kn.adler)),Kn.adler=1}if(gi.status===69)if(gi.gzhead.extra){for(hi=gi.pending;gi.gzindex<(65535&gi.gzhead.extra.length)&&(gi.pending!==gi.pending_buf_size||(gi.gzhead.hcrc&&gi.pending>hi&&(Kn.adler=yr(Kn.adler,gi.pending_buf,gi.pending-hi,hi)),si(Kn),hi=gi.pending,gi.pending!==gi.pending_buf_size));)ni(gi,255&gi.gzhead.extra[gi.gzindex]),gi.gzindex++;gi.gzhead.hcrc&&gi.pending>hi&&(Kn.adler=yr(Kn.adler,gi.pending_buf,gi.pending-hi,hi)),gi.gzindex===gi.gzhead.extra.length&&(gi.gzindex=0,gi.status=73)}else gi.status=73;if(gi.status===73)if(gi.gzhead.name){hi=gi.pending;do{if(gi.pending===gi.pending_buf_size&&(gi.gzhead.hcrc&&gi.pending>hi&&(Kn.adler=yr(Kn.adler,gi.pending_buf,gi.pending-hi,hi)),si(Kn),hi=gi.pending,gi.pending===gi.pending_buf_size)){fi=1;break}fi=gi.gzindex<gi.gzhead.name.length?255&gi.gzhead.name.charCodeAt(gi.gzindex++):0,ni(gi,fi)}while(fi!==0);gi.gzhead.hcrc&&gi.pending>hi&&(Kn.adler=yr(Kn.adler,gi.pending_buf,gi.pending-hi,hi)),fi===0&&(gi.gzindex=0,gi.status=91)}else gi.status=91;if(gi.status===91)if(gi.gzhead.comment){hi=gi.pending;do{if(gi.pending===gi.pending_buf_size&&(gi.gzhead.hcrc&&gi.pending>hi&&(Kn.adler=yr(Kn.adler,gi.pending_buf,gi.pending-hi,hi)),si(Kn),hi=gi.pending,gi.pending===gi.pending_buf_size)){fi=1;break}fi=gi.gzindex<gi.gzhead.comment.length?255&gi.gzhead.comment.charCodeAt(gi.gzindex++):0,ni(gi,fi)}while(fi!==0);gi.gzhead.hcrc&&gi.pending>hi&&(Kn.adler=yr(Kn.adler,gi.pending_buf,gi.pending-hi,hi)),fi===0&&(gi.status=103)}else gi.status=103;if(gi.status===103&&(gi.gzhead.hcrc?(gi.pending+2>gi.pending_buf_size&&si(Kn),gi.pending+2<=gi.pending_buf_size&&(ni(gi,255&Kn.adler),ni(gi,Kn.adler>>8&255),Kn.adler=0,gi.status=Xn)):gi.status=Xn),gi.pending!==0){if(si(Kn),Kn.avail_out===0)return gi.last_flush=-1,wr}else if(Kn.avail_in===0&&ri(yi)<=ri(Ii)&&yi!==vr)return oi(Kn,-5);if(gi.status===666&&Kn.avail_in!==0)return oi(Kn,-5);if(Kn.avail_in!==0||gi.lookahead!==0||yi!==br&&gi.status!==666){var wi=gi.strategy===2?(function(_i,Mi){for(var li;;){if(_i.lookahead===0&&(ai(_i),_i.lookahead===0)){if(Mi===br)return Lr;break}if(_i.match_length=0,li=mr._tr_tally(_i,0,_i.window[_i.strstart]),_i.lookahead--,_i.strstart++,li&&(Jn(_i,!1),_i.strm.avail_out===0))return Lr}return _i.insert=0,Mi===vr?(Jn(_i,!0),_i.strm.avail_out===0?Hn:ii):_i.last_lit&&(Jn(_i,!1),_i.strm.avail_out===0)?Lr:Gr})(gi,yi):gi.strategy===3?(function(_i,Mi){for(var li,ui,Ci,ji,xi=_i.window;;){if(_i.lookahead<=Qr){if(ai(_i),_i.lookahead<=Qr&&Mi===br)return Lr;if(_i.lookahead===0)break}if(_i.match_length=0,_i.lookahead>=$n&&0<_i.strstart&&(ui=xi[Ci=_i.strstart-1])===xi[++Ci]&&ui===xi[++Ci]&&ui===xi[++Ci]){ji=_i.strstart+Qr;do;while(ui===xi[++Ci]&&ui===xi[++Ci]&&ui===xi[++Ci]&&ui===xi[++Ci]&&ui===xi[++Ci]&&ui===xi[++Ci]&&ui===xi[++Ci]&&ui===xi[++Ci]&&Ci<ji);_i.match_length=Qr-(ji-Ci),_i.match_length>_i.lookahead&&(_i.match_length=_i.lookahead)}if(_i.match_length>=$n?(li=mr._tr_tally(_i,1,_i.match_length-$n),_i.lookahead-=_i.match_length,_i.strstart+=_i.match_length,_i.match_length=0):(li=mr._tr_tally(_i,0,_i.window[_i.strstart]),_i.lookahead--,_i.strstart++),li&&(Jn(_i,!1),_i.strm.avail_out===0))return Lr}return _i.insert=0,Mi===vr?(Jn(_i,!0),_i.strm.avail_out===0?Hn:ii):_i.last_lit&&(Jn(_i,!1),_i.strm.avail_out===0)?Lr:Gr})(gi,yi):fr[gi.level].func(gi,yi);if(wi!==Hn&&wi!==ii||(gi.status=666),wi===Lr||wi===Hn)return Kn.avail_out===0&&(gi.last_flush=-1),wr;if(wi===Gr&&(yi===1?mr._tr_align(gi):yi!==5&&(mr._tr_stored_block(gi,0,0,!1),yi===3&&(ti(gi.head),gi.lookahead===0&&(gi.strstart=0,gi.block_start=0,gi.insert=0))),si(Kn),Kn.avail_out===0))return gi.last_flush=-1,wr}return yi!==vr?wr:gi.wrap<=0?1:(gi.wrap===2?(ni(gi,255&Kn.adler),ni(gi,Kn.adler>>8&255),ni(gi,Kn.adler>>16&255),ni(gi,Kn.adler>>24&255),ni(gi,255&Kn.total_in),ni(gi,Kn.total_in>>8&255),ni(gi,Kn.total_in>>16&255),ni(gi,Kn.total_in>>24&255)):(Yn(gi,Kn.adler>>>16),Yn(gi,65535&Kn.adler)),si(Kn),0<gi.wrap&&(gi.wrap=-gi.wrap),gi.pending!==0?wr:1)},dr.deflateEnd=function(Kn){var yi;return Kn&&Kn.state?(yi=Kn.state.status)!==qn&&yi!==69&&yi!==73&&yi!==91&&yi!==103&&yi!==Xn&&yi!==666?oi(Kn,xr):(Kn.state=null,yi===Xn?oi(Kn,-3):wr):xr},dr.deflateSetDictionary=function(Kn,yi){var Ii,gi,hi,fi,ci,wi,_i,Mi,li=yi.length;if(!Kn||!Kn.state||(fi=(Ii=Kn.state).wrap)===2||fi===1&&Ii.status!==qn||Ii.lookahead)return xr;for(fi===1&&(Kn.adler=gr(Kn.adler,yi,li,0)),Ii.wrap=0,li>=Ii.w_size&&(fi===0&&(ti(Ii.head),Ii.strstart=0,Ii.block_start=0,Ii.insert=0),Mi=new hr.Buf8(Ii.w_size),hr.arraySet(Mi,yi,li-Ii.w_size,Ii.w_size,0),yi=Mi,li=Ii.w_size),ci=Kn.avail_in,wi=Kn.next_in,_i=Kn.input,Kn.avail_in=li,Kn.next_in=0,Kn.input=yi,ai(Ii);Ii.lookahead>=$n;){for(gi=Ii.strstart,hi=Ii.lookahead-($n-1);Ii.ins_h=(Ii.ins_h<<Ii.hash_shift^Ii.window[gi+$n-1])&Ii.hash_mask,Ii.prev[gi&Ii.w_mask]=Ii.head[Ii.ins_h],Ii.head[Ii.ins_h]=gi,gi++,--hi;);Ii.strstart=gi,Ii.lookahead=$n-1,ai(Ii)}return Ii.strstart+=Ii.lookahead,Ii.block_start=Ii.strstart,Ii.insert=Ii.lookahead,Ii.lookahead=0,Ii.match_length=Ii.prev_length=$n-1,Ii.match_available=0,Kn.next_in=wi,Kn.input=_i,Kn.avail_in=ci,Ii.wrap=fi,wr},dr.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./messages":51,"./trees":52}],47:[function(ir,lr,dr){lr.exports=function(){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}},{}],48:[function(ir,lr,dr){lr.exports=function(fr,hr){var mr,gr,yr,_r,br,vr,wr,xr,Sr,Ar,Ir,Mr,Or,$r,Dr,zr,Fr,Jr,$n,Qr,Zn,qn,Xn,Lr,Gr;mr=fr.state,gr=fr.next_in,Lr=fr.input,yr=gr+(fr.avail_in-5),_r=fr.next_out,Gr=fr.output,br=_r-(hr-fr.avail_out),vr=_r+(fr.avail_out-257),wr=mr.dmax,xr=mr.wsize,Sr=mr.whave,Ar=mr.wnext,Ir=mr.window,Mr=mr.hold,Or=mr.bits,$r=mr.lencode,Dr=mr.distcode,zr=(1<<mr.lenbits)-1,Fr=(1<<mr.distbits)-1;e:do{Or<15&&(Mr+=Lr[gr++]<<Or,Or+=8,Mr+=Lr[gr++]<<Or,Or+=8),Jr=$r[Mr&zr];t:for(;;){if(Mr>>>=$n=Jr>>>24,Or-=$n,($n=Jr>>>16&255)===0)Gr[_r++]=65535&Jr;else{if(!(16&$n)){if((64&$n)==0){Jr=$r[(65535&Jr)+(Mr&(1<<$n)-1)];continue t}if(32&$n){mr.mode=12;break e}fr.msg="invalid literal/length code",mr.mode=30;break e}Qr=65535&Jr,($n&=15)&&(Or<$n&&(Mr+=Lr[gr++]<<Or,Or+=8),Qr+=Mr&(1<<$n)-1,Mr>>>=$n,Or-=$n),Or<15&&(Mr+=Lr[gr++]<<Or,Or+=8,Mr+=Lr[gr++]<<Or,Or+=8),Jr=Dr[Mr&Fr];r:for(;;){if(Mr>>>=$n=Jr>>>24,Or-=$n,!(16&($n=Jr>>>16&255))){if((64&$n)==0){Jr=Dr[(65535&Jr)+(Mr&(1<<$n)-1)];continue r}fr.msg="invalid distance code",mr.mode=30;break e}if(Zn=65535&Jr,Or<($n&=15)&&(Mr+=Lr[gr++]<<Or,(Or+=8)<$n&&(Mr+=Lr[gr++]<<Or,Or+=8)),wr<(Zn+=Mr&(1<<$n)-1)){fr.msg="invalid distance too far back",mr.mode=30;break e}if(Mr>>>=$n,Or-=$n,($n=_r-br)<Zn){if(Sr<($n=Zn-$n)&&mr.sane){fr.msg="invalid distance too far back",mr.mode=30;break e}if(Xn=Ir,(qn=0)===Ar){if(qn+=xr-$n,$n<Qr){for(Qr-=$n;Gr[_r++]=Ir[qn++],--$n;);qn=_r-Zn,Xn=Gr}}else if(Ar<$n){if(qn+=xr+Ar-$n,($n-=Ar)<Qr){for(Qr-=$n;Gr[_r++]=Ir[qn++],--$n;);if(qn=0,Ar<Qr){for(Qr-=$n=Ar;Gr[_r++]=Ir[qn++],--$n;);qn=_r-Zn,Xn=Gr}}}else if(qn+=Ar-$n,$n<Qr){for(Qr-=$n;Gr[_r++]=Ir[qn++],--$n;);qn=_r-Zn,Xn=Gr}for(;2<Qr;)Gr[_r++]=Xn[qn++],Gr[_r++]=Xn[qn++],Gr[_r++]=Xn[qn++],Qr-=3;Qr&&(Gr[_r++]=Xn[qn++],1<Qr&&(Gr[_r++]=Xn[qn++]))}else{for(qn=_r-Zn;Gr[_r++]=Gr[qn++],Gr[_r++]=Gr[qn++],Gr[_r++]=Gr[qn++],2<(Qr-=3););Qr&&(Gr[_r++]=Gr[qn++],1<Qr&&(Gr[_r++]=Gr[qn++]))}break}}break}}while(gr<yr&&_r<vr);gr-=Qr=Or>>3,Mr&=(1<<(Or-=Qr<<3))-1,fr.next_in=gr,fr.next_out=_r,fr.avail_in=gr<yr?yr-gr+5:5-(gr-yr),fr.avail_out=_r<vr?vr-_r+257:257-(_r-vr),mr.hold=Mr,mr.bits=Or}},{}],49:[function(ir,lr,dr){var fr=ir("../utils/common"),hr=ir("./adler32"),mr=ir("./crc32"),gr=ir("./inffast"),yr=ir("./inftrees"),_r=1,br=2,vr=0,wr=-2,xr=1,Sr=852,Ar=592;function Ir(qn){return(qn>>>24&255)+(qn>>>8&65280)+((65280&qn)<<8)+((255&qn)<<24)}function Mr(){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 fr.Buf16(320),this.work=new fr.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function Or(qn){var Xn;return qn&&qn.state?(Xn=qn.state,qn.total_in=qn.total_out=Xn.total=0,qn.msg="",Xn.wrap&&(qn.adler=1&Xn.wrap),Xn.mode=xr,Xn.last=0,Xn.havedict=0,Xn.dmax=32768,Xn.head=null,Xn.hold=0,Xn.bits=0,Xn.lencode=Xn.lendyn=new fr.Buf32(Sr),Xn.distcode=Xn.distdyn=new fr.Buf32(Ar),Xn.sane=1,Xn.back=-1,vr):wr}function $r(qn){var Xn;return qn&&qn.state?((Xn=qn.state).wsize=0,Xn.whave=0,Xn.wnext=0,Or(qn)):wr}function Dr(qn,Xn){var Lr,Gr;return qn&&qn.state?(Gr=qn.state,Xn<0?(Lr=0,Xn=-Xn):(Lr=1+(Xn>>4),Xn<48&&(Xn&=15)),Xn&&(Xn<8||15<Xn)?wr:(Gr.window!==null&&Gr.wbits!==Xn&&(Gr.window=null),Gr.wrap=Lr,Gr.wbits=Xn,$r(qn))):wr}function zr(qn,Xn){var Lr,Gr;return qn?(Gr=new Mr,(qn.state=Gr).window=null,(Lr=Dr(qn,Xn))!==vr&&(qn.state=null),Lr):wr}var Fr,Jr,$n=!0;function Qr(qn){if($n){var Xn;for(Fr=new fr.Buf32(512),Jr=new fr.Buf32(32),Xn=0;Xn<144;)qn.lens[Xn++]=8;for(;Xn<256;)qn.lens[Xn++]=9;for(;Xn<280;)qn.lens[Xn++]=7;for(;Xn<288;)qn.lens[Xn++]=8;for(yr(_r,qn.lens,0,288,Fr,0,qn.work,{bits:9}),Xn=0;Xn<32;)qn.lens[Xn++]=5;yr(br,qn.lens,0,32,Jr,0,qn.work,{bits:5}),$n=!1}qn.lencode=Fr,qn.lenbits=9,qn.distcode=Jr,qn.distbits=5}function Zn(qn,Xn,Lr,Gr){var Hn,ii=qn.state;return ii.window===null&&(ii.wsize=1<<ii.wbits,ii.wnext=0,ii.whave=0,ii.window=new fr.Buf8(ii.wsize)),Gr>=ii.wsize?(fr.arraySet(ii.window,Xn,Lr-ii.wsize,ii.wsize,0),ii.wnext=0,ii.whave=ii.wsize):(Gr<(Hn=ii.wsize-ii.wnext)&&(Hn=Gr),fr.arraySet(ii.window,Xn,Lr-Gr,Hn,ii.wnext),(Gr-=Hn)?(fr.arraySet(ii.window,Xn,Lr-Gr,Gr,0),ii.wnext=Gr,ii.whave=ii.wsize):(ii.wnext+=Hn,ii.wnext===ii.wsize&&(ii.wnext=0),ii.whave<ii.wsize&&(ii.whave+=Hn))),0}dr.inflateReset=$r,dr.inflateReset2=Dr,dr.inflateResetKeep=Or,dr.inflateInit=function(qn){return zr(qn,15)},dr.inflateInit2=zr,dr.inflate=function(qn,Xn){var Lr,Gr,Hn,ii,oi,ri,ti,si,Jn,ni,Yn,ei,ai,pi,bi,vi,Ti,Li,qi,Hi,Kn,yi,Ii,gi,hi=0,fi=new fr.Buf8(4),ci=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!qn||!qn.state||!qn.output||!qn.input&&qn.avail_in!==0)return wr;(Lr=qn.state).mode===12&&(Lr.mode=13),oi=qn.next_out,Hn=qn.output,ti=qn.avail_out,ii=qn.next_in,Gr=qn.input,ri=qn.avail_in,si=Lr.hold,Jn=Lr.bits,ni=ri,Yn=ti,yi=vr;e:for(;;)switch(Lr.mode){case xr:if(Lr.wrap===0){Lr.mode=13;break}for(;Jn<16;){if(ri===0)break e;ri--,si+=Gr[ii++]<<Jn,Jn+=8}if(2&Lr.wrap&&si===35615){fi[Lr.check=0]=255&si,fi[1]=si>>>8&255,Lr.check=mr(Lr.check,fi,2,0),Jn=si=0,Lr.mode=2;break}if(Lr.flags=0,Lr.head&&(Lr.head.done=!1),!(1&Lr.wrap)||(((255&si)<<8)+(si>>8))%31){qn.msg="incorrect header check",Lr.mode=30;break}if((15&si)!=8){qn.msg="unknown compression method",Lr.mode=30;break}if(Jn-=4,Kn=8+(15&(si>>>=4)),Lr.wbits===0)Lr.wbits=Kn;else if(Kn>Lr.wbits){qn.msg="invalid window size",Lr.mode=30;break}Lr.dmax=1<<Kn,qn.adler=Lr.check=1,Lr.mode=512&si?10:12,Jn=si=0;break;case 2:for(;Jn<16;){if(ri===0)break e;ri--,si+=Gr[ii++]<<Jn,Jn+=8}if(Lr.flags=si,(255&Lr.flags)!=8){qn.msg="unknown compression method",Lr.mode=30;break}if(57344&Lr.flags){qn.msg="unknown header flags set",Lr.mode=30;break}Lr.head&&(Lr.head.text=si>>8&1),512&Lr.flags&&(fi[0]=255&si,fi[1]=si>>>8&255,Lr.check=mr(Lr.check,fi,2,0)),Jn=si=0,Lr.mode=3;case 3:for(;Jn<32;){if(ri===0)break e;ri--,si+=Gr[ii++]<<Jn,Jn+=8}Lr.head&&(Lr.head.time=si),512&Lr.flags&&(fi[0]=255&si,fi[1]=si>>>8&255,fi[2]=si>>>16&255,fi[3]=si>>>24&255,Lr.check=mr(Lr.check,fi,4,0)),Jn=si=0,Lr.mode=4;case 4:for(;Jn<16;){if(ri===0)break e;ri--,si+=Gr[ii++]<<Jn,Jn+=8}Lr.head&&(Lr.head.xflags=255&si,Lr.head.os=si>>8),512&Lr.flags&&(fi[0]=255&si,fi[1]=si>>>8&255,Lr.check=mr(Lr.check,fi,2,0)),Jn=si=0,Lr.mode=5;case 5:if(1024&Lr.flags){for(;Jn<16;){if(ri===0)break e;ri--,si+=Gr[ii++]<<Jn,Jn+=8}Lr.length=si,Lr.head&&(Lr.head.extra_len=si),512&Lr.flags&&(fi[0]=255&si,fi[1]=si>>>8&255,Lr.check=mr(Lr.check,fi,2,0)),Jn=si=0}else Lr.head&&(Lr.head.extra=null);Lr.mode=6;case 6:if(1024&Lr.flags&&(ri<(ei=Lr.length)&&(ei=ri),ei&&(Lr.head&&(Kn=Lr.head.extra_len-Lr.length,Lr.head.extra||(Lr.head.extra=new Array(Lr.head.extra_len)),fr.arraySet(Lr.head.extra,Gr,ii,ei,Kn)),512&Lr.flags&&(Lr.check=mr(Lr.check,Gr,ei,ii)),ri-=ei,ii+=ei,Lr.length-=ei),Lr.length))break e;Lr.length=0,Lr.mode=7;case 7:if(2048&Lr.flags){if(ri===0)break e;for(ei=0;Kn=Gr[ii+ei++],Lr.head&&Kn&&Lr.length<65536&&(Lr.head.name+=String.fromCharCode(Kn)),Kn&&ei<ri;);if(512&Lr.flags&&(Lr.check=mr(Lr.check,Gr,ei,ii)),ri-=ei,ii+=ei,Kn)break e}else Lr.head&&(Lr.head.name=null);Lr.length=0,Lr.mode=8;case 8:if(4096&Lr.flags){if(ri===0)break e;for(ei=0;Kn=Gr[ii+ei++],Lr.head&&Kn&&Lr.length<65536&&(Lr.head.comment+=String.fromCharCode(Kn)),Kn&&ei<ri;);if(512&Lr.flags&&(Lr.check=mr(Lr.check,Gr,ei,ii)),ri-=ei,ii+=ei,Kn)break e}else Lr.head&&(Lr.head.comment=null);Lr.mode=9;case 9:if(512&Lr.flags){for(;Jn<16;){if(ri===0)break e;ri--,si+=Gr[ii++]<<Jn,Jn+=8}if(si!==(65535&Lr.check)){qn.msg="header crc mismatch",Lr.mode=30;break}Jn=si=0}Lr.head&&(Lr.head.hcrc=Lr.flags>>9&1,Lr.head.done=!0),qn.adler=Lr.check=0,Lr.mode=12;break;case 10:for(;Jn<32;){if(ri===0)break e;ri--,si+=Gr[ii++]<<Jn,Jn+=8}qn.adler=Lr.check=Ir(si),Jn=si=0,Lr.mode=11;case 11:if(Lr.havedict===0)return qn.next_out=oi,qn.avail_out=ti,qn.next_in=ii,qn.avail_in=ri,Lr.hold=si,Lr.bits=Jn,2;qn.adler=Lr.check=1,Lr.mode=12;case 12:if(Xn===5||Xn===6)break e;case 13:if(Lr.last){si>>>=7&Jn,Jn-=7&Jn,Lr.mode=27;break}for(;Jn<3;){if(ri===0)break e;ri--,si+=Gr[ii++]<<Jn,Jn+=8}switch(Lr.last=1&si,Jn-=1,3&(si>>>=1)){case 0:Lr.mode=14;break;case 1:if(Qr(Lr),Lr.mode=20,Xn!==6)break;si>>>=2,Jn-=2;break e;case 2:Lr.mode=17;break;case 3:qn.msg="invalid block type",Lr.mode=30}si>>>=2,Jn-=2;break;case 14:for(si>>>=7&Jn,Jn-=7&Jn;Jn<32;){if(ri===0)break e;ri--,si+=Gr[ii++]<<Jn,Jn+=8}if((65535&si)!=(si>>>16^65535)){qn.msg="invalid stored block lengths",Lr.mode=30;break}if(Lr.length=65535&si,Jn=si=0,Lr.mode=15,Xn===6)break e;case 15:Lr.mode=16;case 16:if(ei=Lr.length){if(ri<ei&&(ei=ri),ti<ei&&(ei=ti),ei===0)break e;fr.arraySet(Hn,Gr,ii,ei,oi),ri-=ei,ii+=ei,ti-=ei,oi+=ei,Lr.length-=ei;break}Lr.mode=12;break;case 17:for(;Jn<14;){if(ri===0)break e;ri--,si+=Gr[ii++]<<Jn,Jn+=8}if(Lr.nlen=257+(31&si),si>>>=5,Jn-=5,Lr.ndist=1+(31&si),si>>>=5,Jn-=5,Lr.ncode=4+(15&si),si>>>=4,Jn-=4,286<Lr.nlen||30<Lr.ndist){qn.msg="too many length or distance symbols",Lr.mode=30;break}Lr.have=0,Lr.mode=18;case 18:for(;Lr.have<Lr.ncode;){for(;Jn<3;){if(ri===0)break e;ri--,si+=Gr[ii++]<<Jn,Jn+=8}Lr.lens[ci[Lr.have++]]=7&si,si>>>=3,Jn-=3}for(;Lr.have<19;)Lr.lens[ci[Lr.have++]]=0;if(Lr.lencode=Lr.lendyn,Lr.lenbits=7,Ii={bits:Lr.lenbits},yi=yr(0,Lr.lens,0,19,Lr.lencode,0,Lr.work,Ii),Lr.lenbits=Ii.bits,yi){qn.msg="invalid code lengths set",Lr.mode=30;break}Lr.have=0,Lr.mode=19;case 19:for(;Lr.have<Lr.nlen+Lr.ndist;){for(;vi=(hi=Lr.lencode[si&(1<<Lr.lenbits)-1])>>>16&255,Ti=65535&hi,!((bi=hi>>>24)<=Jn);){if(ri===0)break e;ri--,si+=Gr[ii++]<<Jn,Jn+=8}if(Ti<16)si>>>=bi,Jn-=bi,Lr.lens[Lr.have++]=Ti;else{if(Ti===16){for(gi=bi+2;Jn<gi;){if(ri===0)break e;ri--,si+=Gr[ii++]<<Jn,Jn+=8}if(si>>>=bi,Jn-=bi,Lr.have===0){qn.msg="invalid bit length repeat",Lr.mode=30;break}Kn=Lr.lens[Lr.have-1],ei=3+(3&si),si>>>=2,Jn-=2}else if(Ti===17){for(gi=bi+3;Jn<gi;){if(ri===0)break e;ri--,si+=Gr[ii++]<<Jn,Jn+=8}Jn-=bi,Kn=0,ei=3+(7&(si>>>=bi)),si>>>=3,Jn-=3}else{for(gi=bi+7;Jn<gi;){if(ri===0)break e;ri--,si+=Gr[ii++]<<Jn,Jn+=8}Jn-=bi,Kn=0,ei=11+(127&(si>>>=bi)),si>>>=7,Jn-=7}if(Lr.have+ei>Lr.nlen+Lr.ndist){qn.msg="invalid bit length repeat",Lr.mode=30;break}for(;ei--;)Lr.lens[Lr.have++]=Kn}}if(Lr.mode===30)break;if(Lr.lens[256]===0){qn.msg="invalid code -- missing end-of-block",Lr.mode=30;break}if(Lr.lenbits=9,Ii={bits:Lr.lenbits},yi=yr(_r,Lr.lens,0,Lr.nlen,Lr.lencode,0,Lr.work,Ii),Lr.lenbits=Ii.bits,yi){qn.msg="invalid literal/lengths set",Lr.mode=30;break}if(Lr.distbits=6,Lr.distcode=Lr.distdyn,Ii={bits:Lr.distbits},yi=yr(br,Lr.lens,Lr.nlen,Lr.ndist,Lr.distcode,0,Lr.work,Ii),Lr.distbits=Ii.bits,yi){qn.msg="invalid distances set",Lr.mode=30;break}if(Lr.mode=20,Xn===6)break e;case 20:Lr.mode=21;case 21:if(6<=ri&&258<=ti){qn.next_out=oi,qn.avail_out=ti,qn.next_in=ii,qn.avail_in=ri,Lr.hold=si,Lr.bits=Jn,gr(qn,Yn),oi=qn.next_out,Hn=qn.output,ti=qn.avail_out,ii=qn.next_in,Gr=qn.input,ri=qn.avail_in,si=Lr.hold,Jn=Lr.bits,Lr.mode===12&&(Lr.back=-1);break}for(Lr.back=0;vi=(hi=Lr.lencode[si&(1<<Lr.lenbits)-1])>>>16&255,Ti=65535&hi,!((bi=hi>>>24)<=Jn);){if(ri===0)break e;ri--,si+=Gr[ii++]<<Jn,Jn+=8}if(vi&&(240&vi)==0){for(Li=bi,qi=vi,Hi=Ti;vi=(hi=Lr.lencode[Hi+((si&(1<<Li+qi)-1)>>Li)])>>>16&255,Ti=65535&hi,!(Li+(bi=hi>>>24)<=Jn);){if(ri===0)break e;ri--,si+=Gr[ii++]<<Jn,Jn+=8}si>>>=Li,Jn-=Li,Lr.back+=Li}if(si>>>=bi,Jn-=bi,Lr.back+=bi,Lr.length=Ti,vi===0){Lr.mode=26;break}if(32&vi){Lr.back=-1,Lr.mode=12;break}if(64&vi){qn.msg="invalid literal/length code",Lr.mode=30;break}Lr.extra=15&vi,Lr.mode=22;case 22:if(Lr.extra){for(gi=Lr.extra;Jn<gi;){if(ri===0)break e;ri--,si+=Gr[ii++]<<Jn,Jn+=8}Lr.length+=si&(1<<Lr.extra)-1,si>>>=Lr.extra,Jn-=Lr.extra,Lr.back+=Lr.extra}Lr.was=Lr.length,Lr.mode=23;case 23:for(;vi=(hi=Lr.distcode[si&(1<<Lr.distbits)-1])>>>16&255,Ti=65535&hi,!((bi=hi>>>24)<=Jn);){if(ri===0)break e;ri--,si+=Gr[ii++]<<Jn,Jn+=8}if((240&vi)==0){for(Li=bi,qi=vi,Hi=Ti;vi=(hi=Lr.distcode[Hi+((si&(1<<Li+qi)-1)>>Li)])>>>16&255,Ti=65535&hi,!(Li+(bi=hi>>>24)<=Jn);){if(ri===0)break e;ri--,si+=Gr[ii++]<<Jn,Jn+=8}si>>>=Li,Jn-=Li,Lr.back+=Li}if(si>>>=bi,Jn-=bi,Lr.back+=bi,64&vi){qn.msg="invalid distance code",Lr.mode=30;break}Lr.offset=Ti,Lr.extra=15&vi,Lr.mode=24;case 24:if(Lr.extra){for(gi=Lr.extra;Jn<gi;){if(ri===0)break e;ri--,si+=Gr[ii++]<<Jn,Jn+=8}Lr.offset+=si&(1<<Lr.extra)-1,si>>>=Lr.extra,Jn-=Lr.extra,Lr.back+=Lr.extra}if(Lr.offset>Lr.dmax){qn.msg="invalid distance too far back",Lr.mode=30;break}Lr.mode=25;case 25:if(ti===0)break e;if(ei=Yn-ti,Lr.offset>ei){if((ei=Lr.offset-ei)>Lr.whave&&Lr.sane){qn.msg="invalid distance too far back",Lr.mode=30;break}ai=ei>Lr.wnext?(ei-=Lr.wnext,Lr.wsize-ei):Lr.wnext-ei,ei>Lr.length&&(ei=Lr.length),pi=Lr.window}else pi=Hn,ai=oi-Lr.offset,ei=Lr.length;for(ti<ei&&(ei=ti),ti-=ei,Lr.length-=ei;Hn[oi++]=pi[ai++],--ei;);Lr.length===0&&(Lr.mode=21);break;case 26:if(ti===0)break e;Hn[oi++]=Lr.length,ti--,Lr.mode=21;break;case 27:if(Lr.wrap){for(;Jn<32;){if(ri===0)break e;ri--,si|=Gr[ii++]<<Jn,Jn+=8}if(Yn-=ti,qn.total_out+=Yn,Lr.total+=Yn,Yn&&(qn.adler=Lr.check=Lr.flags?mr(Lr.check,Hn,Yn,oi-Yn):hr(Lr.check,Hn,Yn,oi-Yn)),Yn=ti,(Lr.flags?si:Ir(si))!==Lr.check){qn.msg="incorrect data check",Lr.mode=30;break}Jn=si=0}Lr.mode=28;case 28:if(Lr.wrap&&Lr.flags){for(;Jn<32;){if(ri===0)break e;ri--,si+=Gr[ii++]<<Jn,Jn+=8}if(si!==(4294967295&Lr.total)){qn.msg="incorrect length check",Lr.mode=30;break}Jn=si=0}Lr.mode=29;case 29:yi=1;break e;case 30:yi=-3;break e;case 31:return-4;case 32:default:return wr}return qn.next_out=oi,qn.avail_out=ti,qn.next_in=ii,qn.avail_in=ri,Lr.hold=si,Lr.bits=Jn,(Lr.wsize||Yn!==qn.avail_out&&Lr.mode<30&&(Lr.mode<27||Xn!==4))&&Zn(qn,qn.output,qn.next_out,Yn-qn.avail_out)?(Lr.mode=31,-4):(ni-=qn.avail_in,Yn-=qn.avail_out,qn.total_in+=ni,qn.total_out+=Yn,Lr.total+=Yn,Lr.wrap&&Yn&&(qn.adler=Lr.check=Lr.flags?mr(Lr.check,Hn,Yn,qn.next_out-Yn):hr(Lr.check,Hn,Yn,qn.next_out-Yn)),qn.data_type=Lr.bits+(Lr.last?64:0)+(Lr.mode===12?128:0)+(Lr.mode===20||Lr.mode===15?256:0),(ni==0&&Yn===0||Xn===4)&&yi===vr&&(yi=-5),yi)},dr.inflateEnd=function(qn){if(!qn||!qn.state)return wr;var Xn=qn.state;return Xn.window&&(Xn.window=null),qn.state=null,vr},dr.inflateGetHeader=function(qn,Xn){var Lr;return qn&&qn.state?(2&(Lr=qn.state).wrap)==0?wr:((Lr.head=Xn).done=!1,vr):wr},dr.inflateSetDictionary=function(qn,Xn){var Lr,Gr=Xn.length;return qn&&qn.state?(Lr=qn.state).wrap!==0&&Lr.mode!==11?wr:Lr.mode===11&&hr(1,Xn,Gr,0)!==Lr.check?-3:Zn(qn,Xn,Gr,Gr)?(Lr.mode=31,-4):(Lr.havedict=1,vr):wr},dr.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./inffast":48,"./inftrees":50}],50:[function(ir,lr,dr){var fr=ir("../utils/common"),hr=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],mr=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],gr=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],yr=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];lr.exports=function(_r,br,vr,wr,xr,Sr,Ar,Ir){var Mr,Or,$r,Dr,zr,Fr,Jr,$n,Qr,Zn=Ir.bits,qn=0,Xn=0,Lr=0,Gr=0,Hn=0,ii=0,oi=0,ri=0,ti=0,si=0,Jn=null,ni=0,Yn=new fr.Buf16(16),ei=new fr.Buf16(16),ai=null,pi=0;for(qn=0;qn<=15;qn++)Yn[qn]=0;for(Xn=0;Xn<wr;Xn++)Yn[br[vr+Xn]]++;for(Hn=Zn,Gr=15;1<=Gr&&Yn[Gr]===0;Gr--);if(Gr<Hn&&(Hn=Gr),Gr===0)return xr[Sr++]=20971520,xr[Sr++]=20971520,Ir.bits=1,0;for(Lr=1;Lr<Gr&&Yn[Lr]===0;Lr++);for(Hn<Lr&&(Hn=Lr),qn=ri=1;qn<=15;qn++)if(ri<<=1,(ri-=Yn[qn])<0)return-1;if(0<ri&&(_r===0||Gr!==1))return-1;for(ei[1]=0,qn=1;qn<15;qn++)ei[qn+1]=ei[qn]+Yn[qn];for(Xn=0;Xn<wr;Xn++)br[vr+Xn]!==0&&(Ar[ei[br[vr+Xn]]++]=Xn);if(Fr=_r===0?(Jn=ai=Ar,19):_r===1?(Jn=hr,ni-=257,ai=mr,pi-=257,256):(Jn=gr,ai=yr,-1),qn=Lr,zr=Sr,oi=Xn=si=0,$r=-1,Dr=(ti=1<<(ii=Hn))-1,_r===1&&852<ti||_r===2&&592<ti)return 1;for(;;){for(Jr=qn-oi,Qr=Ar[Xn]<Fr?($n=0,Ar[Xn]):Ar[Xn]>Fr?($n=ai[pi+Ar[Xn]],Jn[ni+Ar[Xn]]):($n=96,0),Mr=1<<qn-oi,Lr=Or=1<<ii;xr[zr+(si>>oi)+(Or-=Mr)]=Jr<<24|$n<<16|Qr|0,Or!==0;);for(Mr=1<<qn-1;si&Mr;)Mr>>=1;if(Mr!==0?(si&=Mr-1,si+=Mr):si=0,Xn++,--Yn[qn]==0){if(qn===Gr)break;qn=br[vr+Ar[Xn]]}if(Hn<qn&&(si&Dr)!==$r){for(oi===0&&(oi=Hn),zr+=Lr,ri=1<<(ii=qn-oi);ii+oi<Gr&&!((ri-=Yn[ii+oi])<=0);)ii++,ri<<=1;if(ti+=1<<ii,_r===1&&852<ti||_r===2&&592<ti)return 1;xr[$r=si&Dr]=Hn<<24|ii<<16|zr-Sr|0}}return si!==0&&(xr[zr+si]=qn-oi<<24|64<<16|0),Ir.bits=Hn,0}},{"../utils/common":41}],51:[function(ir,lr,dr){lr.exports={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"}},{}],52:[function(ir,lr,dr){var fr=ir("../utils/common"),hr=0,mr=1;function gr(hi){for(var fi=hi.length;0<=--fi;)hi[fi]=0}var yr=0,_r=29,br=256,vr=br+1+_r,wr=30,xr=19,Sr=2*vr+1,Ar=15,Ir=16,Mr=7,Or=256,$r=16,Dr=17,zr=18,Fr=[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],Jr=[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],$n=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],Qr=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],Zn=new Array(2*(vr+2));gr(Zn);var qn=new Array(2*wr);gr(qn);var Xn=new Array(512);gr(Xn);var Lr=new Array(256);gr(Lr);var Gr=new Array(_r);gr(Gr);var Hn,ii,oi,ri=new Array(wr);function ti(hi,fi,ci,wi,_i){this.static_tree=hi,this.extra_bits=fi,this.extra_base=ci,this.elems=wi,this.max_length=_i,this.has_stree=hi&&hi.length}function si(hi,fi){this.dyn_tree=hi,this.max_code=0,this.stat_desc=fi}function Jn(hi){return hi<256?Xn[hi]:Xn[256+(hi>>>7)]}function ni(hi,fi){hi.pending_buf[hi.pending++]=255&fi,hi.pending_buf[hi.pending++]=fi>>>8&255}function Yn(hi,fi,ci){hi.bi_valid>Ir-ci?(hi.bi_buf|=fi<<hi.bi_valid&65535,ni(hi,hi.bi_buf),hi.bi_buf=fi>>Ir-hi.bi_valid,hi.bi_valid+=ci-Ir):(hi.bi_buf|=fi<<hi.bi_valid&65535,hi.bi_valid+=ci)}function ei(hi,fi,ci){Yn(hi,ci[2*fi],ci[2*fi+1])}function ai(hi,fi){for(var ci=0;ci|=1&hi,hi>>>=1,ci<<=1,0<--fi;);return ci>>>1}function pi(hi,fi,ci){var wi,_i,Mi=new Array(Ar+1),li=0;for(wi=1;wi<=Ar;wi++)Mi[wi]=li=li+ci[wi-1]<<1;for(_i=0;_i<=fi;_i++){var ui=hi[2*_i+1];ui!==0&&(hi[2*_i]=ai(Mi[ui]++,ui))}}function bi(hi){var fi;for(fi=0;fi<vr;fi++)hi.dyn_ltree[2*fi]=0;for(fi=0;fi<wr;fi++)hi.dyn_dtree[2*fi]=0;for(fi=0;fi<xr;fi++)hi.bl_tree[2*fi]=0;hi.dyn_ltree[2*Or]=1,hi.opt_len=hi.static_len=0,hi.last_lit=hi.matches=0}function vi(hi){8<hi.bi_valid?ni(hi,hi.bi_buf):0<hi.bi_valid&&(hi.pending_buf[hi.pending++]=hi.bi_buf),hi.bi_buf=0,hi.bi_valid=0}function Ti(hi,fi,ci,wi){var _i=2*fi,Mi=2*ci;return hi[_i]<hi[Mi]||hi[_i]===hi[Mi]&&wi[fi]<=wi[ci]}function Li(hi,fi,ci){for(var wi=hi.heap[ci],_i=ci<<1;_i<=hi.heap_len&&(_i<hi.heap_len&&Ti(fi,hi.heap[_i+1],hi.heap[_i],hi.depth)&&_i++,!Ti(fi,wi,hi.heap[_i],hi.depth));)hi.heap[ci]=hi.heap[_i],ci=_i,_i<<=1;hi.heap[ci]=wi}function qi(hi,fi,ci){var wi,_i,Mi,li,ui=0;if(hi.last_lit!==0)for(;wi=hi.pending_buf[hi.d_buf+2*ui]<<8|hi.pending_buf[hi.d_buf+2*ui+1],_i=hi.pending_buf[hi.l_buf+ui],ui++,wi===0?ei(hi,_i,fi):(ei(hi,(Mi=Lr[_i])+br+1,fi),(li=Fr[Mi])!==0&&Yn(hi,_i-=Gr[Mi],li),ei(hi,Mi=Jn(--wi),ci),(li=Jr[Mi])!==0&&Yn(hi,wi-=ri[Mi],li)),ui<hi.last_lit;);ei(hi,Or,fi)}function Hi(hi,fi){var ci,wi,_i,Mi=fi.dyn_tree,li=fi.stat_desc.static_tree,ui=fi.stat_desc.has_stree,Ci=fi.stat_desc.elems,ji=-1;for(hi.heap_len=0,hi.heap_max=Sr,ci=0;ci<Ci;ci++)Mi[2*ci]!==0?(hi.heap[++hi.heap_len]=ji=ci,hi.depth[ci]=0):Mi[2*ci+1]=0;for(;hi.heap_len<2;)Mi[2*(_i=hi.heap[++hi.heap_len]=ji<2?++ji:0)]=1,hi.depth[_i]=0,hi.opt_len--,ui&&(hi.static_len-=li[2*_i+1]);for(fi.max_code=ji,ci=hi.heap_len>>1;1<=ci;ci--)Li(hi,Mi,ci);for(_i=Ci;ci=hi.heap[1],hi.heap[1]=hi.heap[hi.heap_len--],Li(hi,Mi,1),wi=hi.heap[1],hi.heap[--hi.heap_max]=ci,hi.heap[--hi.heap_max]=wi,Mi[2*_i]=Mi[2*ci]+Mi[2*wi],hi.depth[_i]=(hi.depth[ci]>=hi.depth[wi]?hi.depth[ci]:hi.depth[wi])+1,Mi[2*ci+1]=Mi[2*wi+1]=_i,hi.heap[1]=_i++,Li(hi,Mi,1),2<=hi.heap_len;);hi.heap[--hi.heap_max]=hi.heap[1],(function(xi,mi){var Vi,rs,ds,Xi,gs,uo,Ls=mi.dyn_tree,co=mi.max_code,Js=mi.stat_desc.static_tree,bo=mi.stat_desc.has_stree,Ao=mi.stat_desc.extra_bits,Oa=mi.stat_desc.extra_base,Bo=mi.stat_desc.max_length,ha=0;for(Xi=0;Xi<=Ar;Xi++)xi.bl_count[Xi]=0;for(Ls[2*xi.heap[xi.heap_max]+1]=0,Vi=xi.heap_max+1;Vi<Sr;Vi++)Bo<(Xi=Ls[2*Ls[2*(rs=xi.heap[Vi])+1]+1]+1)&&(Xi=Bo,ha++),Ls[2*rs+1]=Xi,co<rs||(xi.bl_count[Xi]++,gs=0,Oa<=rs&&(gs=Ao[rs-Oa]),uo=Ls[2*rs],xi.opt_len+=uo*(Xi+gs),bo&&(xi.static_len+=uo*(Js[2*rs+1]+gs)));if(ha!==0){do{for(Xi=Bo-1;xi.bl_count[Xi]===0;)Xi--;xi.bl_count[Xi]--,xi.bl_count[Xi+1]+=2,xi.bl_count[Bo]--,ha-=2}while(0<ha);for(Xi=Bo;Xi!==0;Xi--)for(rs=xi.bl_count[Xi];rs!==0;)co<(ds=xi.heap[--Vi])||(Ls[2*ds+1]!==Xi&&(xi.opt_len+=(Xi-Ls[2*ds+1])*Ls[2*ds],Ls[2*ds+1]=Xi),rs--)}})(hi,fi),pi(Mi,ji,hi.bl_count)}function Kn(hi,fi,ci){var wi,_i,Mi=-1,li=fi[1],ui=0,Ci=7,ji=4;for(li===0&&(Ci=138,ji=3),fi[2*(ci+1)+1]=65535,wi=0;wi<=ci;wi++)_i=li,li=fi[2*(wi+1)+1],++ui<Ci&&_i===li||(ui<ji?hi.bl_tree[2*_i]+=ui:_i!==0?(_i!==Mi&&hi.bl_tree[2*_i]++,hi.bl_tree[2*$r]++):ui<=10?hi.bl_tree[2*Dr]++:hi.bl_tree[2*zr]++,Mi=_i,ji=(ui=0)===li?(Ci=138,3):_i===li?(Ci=6,3):(Ci=7,4))}function yi(hi,fi,ci){var wi,_i,Mi=-1,li=fi[1],ui=0,Ci=7,ji=4;for(li===0&&(Ci=138,ji=3),wi=0;wi<=ci;wi++)if(_i=li,li=fi[2*(wi+1)+1],!(++ui<Ci&&_i===li)){if(ui<ji)for(;ei(hi,_i,hi.bl_tree),--ui!=0;);else _i!==0?(_i!==Mi&&(ei(hi,_i,hi.bl_tree),ui--),ei(hi,$r,hi.bl_tree),Yn(hi,ui-3,2)):ui<=10?(ei(hi,Dr,hi.bl_tree),Yn(hi,ui-3,3)):(ei(hi,zr,hi.bl_tree),Yn(hi,ui-11,7));Mi=_i,ji=(ui=0)===li?(Ci=138,3):_i===li?(Ci=6,3):(Ci=7,4)}}gr(ri);var Ii=!1;function gi(hi,fi,ci,wi){Yn(hi,(yr<<1)+(wi?1:0),3),(function(_i,Mi,li,ui){vi(_i),ni(_i,li),ni(_i,~li),fr.arraySet(_i.pending_buf,_i.window,Mi,li,_i.pending),_i.pending+=li})(hi,fi,ci)}dr._tr_init=function(hi){Ii||((function(){var fi,ci,wi,_i,Mi,li=new Array(Ar+1);for(_i=wi=0;_i<_r-1;_i++)for(Gr[_i]=wi,fi=0;fi<1<<Fr[_i];fi++)Lr[wi++]=_i;for(Lr[wi-1]=_i,_i=Mi=0;_i<16;_i++)for(ri[_i]=Mi,fi=0;fi<1<<Jr[_i];fi++)Xn[Mi++]=_i;for(Mi>>=7;_i<wr;_i++)for(ri[_i]=Mi<<7,fi=0;fi<1<<Jr[_i]-7;fi++)Xn[256+Mi++]=_i;for(ci=0;ci<=Ar;ci++)li[ci]=0;for(fi=0;fi<=143;)Zn[2*fi+1]=8,fi++,li[8]++;for(;fi<=255;)Zn[2*fi+1]=9,fi++,li[9]++;for(;fi<=279;)Zn[2*fi+1]=7,fi++,li[7]++;for(;fi<=287;)Zn[2*fi+1]=8,fi++,li[8]++;for(pi(Zn,vr+1,li),fi=0;fi<wr;fi++)qn[2*fi+1]=5,qn[2*fi]=ai(fi,5);Hn=new ti(Zn,Fr,br+1,vr,Ar),ii=new ti(qn,Jr,0,wr,Ar),oi=new ti(new Array(0),$n,0,xr,Mr)})(),Ii=!0),hi.l_desc=new si(hi.dyn_ltree,Hn),hi.d_desc=new si(hi.dyn_dtree,ii),hi.bl_desc=new si(hi.bl_tree,oi),hi.bi_buf=0,hi.bi_valid=0,bi(hi)},dr._tr_stored_block=gi,dr._tr_flush_block=function(hi,fi,ci,wi){var _i,Mi,li=0;0<hi.level?(hi.strm.data_type===2&&(hi.strm.data_type=(function(ui){var Ci,ji=4093624447;for(Ci=0;Ci<=31;Ci++,ji>>>=1)if(1&ji&&ui.dyn_ltree[2*Ci]!==0)return hr;if(ui.dyn_ltree[18]!==0||ui.dyn_ltree[20]!==0||ui.dyn_ltree[26]!==0)return mr;for(Ci=32;Ci<br;Ci++)if(ui.dyn_ltree[2*Ci]!==0)return mr;return hr})(hi)),Hi(hi,hi.l_desc),Hi(hi,hi.d_desc),li=(function(ui){var Ci;for(Kn(ui,ui.dyn_ltree,ui.l_desc.max_code),Kn(ui,ui.dyn_dtree,ui.d_desc.max_code),Hi(ui,ui.bl_desc),Ci=xr-1;3<=Ci&&ui.bl_tree[2*Qr[Ci]+1]===0;Ci--);return ui.opt_len+=3*(Ci+1)+5+5+4,Ci})(hi),_i=hi.opt_len+3+7>>>3,(Mi=hi.static_len+3+7>>>3)<=_i&&(_i=Mi)):_i=Mi=ci+5,ci+4<=_i&&fi!==-1?gi(hi,fi,ci,wi):hi.strategy===4||Mi===_i?(Yn(hi,2+(wi?1:0),3),qi(hi,Zn,qn)):(Yn(hi,4+(wi?1:0),3),(function(ui,Ci,ji,xi){var mi;for(Yn(ui,Ci-257,5),Yn(ui,ji-1,5),Yn(ui,xi-4,4),mi=0;mi<xi;mi++)Yn(ui,ui.bl_tree[2*Qr[mi]+1],3);yi(ui,ui.dyn_ltree,Ci-1),yi(ui,ui.dyn_dtree,ji-1)})(hi,hi.l_desc.max_code+1,hi.d_desc.max_code+1,li+1),qi(hi,hi.dyn_ltree,hi.dyn_dtree)),bi(hi),wi&&vi(hi)},dr._tr_tally=function(hi,fi,ci){return hi.pending_buf[hi.d_buf+2*hi.last_lit]=fi>>>8&255,hi.pending_buf[hi.d_buf+2*hi.last_lit+1]=255&fi,hi.pending_buf[hi.l_buf+hi.last_lit]=255&ci,hi.last_lit++,fi===0?hi.dyn_ltree[2*ci]++:(hi.matches++,fi--,hi.dyn_ltree[2*(Lr[ci]+br+1)]++,hi.dyn_dtree[2*Jn(fi)]++),hi.last_lit===hi.lit_bufsize-1},dr._tr_align=function(hi){Yn(hi,2,3),ei(hi,Or,Zn),(function(fi){fi.bi_valid===16?(ni(fi,fi.bi_buf),fi.bi_buf=0,fi.bi_valid=0):8<=fi.bi_valid&&(fi.pending_buf[fi.pending++]=255&fi.bi_buf,fi.bi_buf>>=8,fi.bi_valid-=8)})(hi)}},{"../utils/common":41}],53:[function(ir,lr,dr){lr.exports=function(){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}},{}],54:[function(ir,lr,dr){(function(fr){(function(hr,mr){if(!hr.setImmediate){var gr,yr,_r,br,vr=1,wr={},xr=!1,Sr=hr.document,Ar=Object.getPrototypeOf&&Object.getPrototypeOf(hr);Ar=Ar&&Ar.setTimeout?Ar:hr,gr={}.toString.call(hr.process)==="[object process]"?function($r){process.nextTick(function(){Mr($r)})}:(function(){if(hr.postMessage&&!hr.importScripts){var $r=!0,Dr=hr.onmessage;return hr.onmessage=function(){$r=!1},hr.postMessage("","*"),hr.onmessage=Dr,$r}})()?(br="setImmediate$"+Math.random()+"$",hr.addEventListener?hr.addEventListener("message",Or,!1):hr.attachEvent("onmessage",Or),function($r){hr.postMessage(br+$r,"*")}):hr.MessageChannel?((_r=new MessageChannel).port1.onmessage=function($r){Mr($r.data)},function($r){_r.port2.postMessage($r)}):Sr&&"onreadystatechange"in Sr.createElement("script")?(yr=Sr.documentElement,function($r){var Dr=Sr.createElement("script");Dr.onreadystatechange=function(){Mr($r),Dr.onreadystatechange=null,yr.removeChild(Dr),Dr=null},yr.appendChild(Dr)}):function($r){setTimeout(Mr,0,$r)},Ar.setImmediate=function($r){typeof $r!="function"&&($r=new Function(""+$r));for(var Dr=new Array(arguments.length-1),zr=0;zr<Dr.length;zr++)Dr[zr]=arguments[zr+1];var Fr={callback:$r,args:Dr};return wr[vr]=Fr,gr(vr),vr++},Ar.clearImmediate=Ir}function Ir($r){delete wr[$r]}function Mr($r){if(xr)setTimeout(Mr,0,$r);else{var Dr=wr[$r];if(Dr){xr=!0;try{(function(zr){var Fr=zr.callback,Jr=zr.args;switch(Jr.length){case 0:Fr();break;case 1:Fr(Jr[0]);break;case 2:Fr(Jr[0],Jr[1]);break;case 3:Fr(Jr[0],Jr[1],Jr[2]);break;default:Fr.apply(mr,Jr)}})(Dr)}finally{Ir($r),xr=!1}}}}function Or($r){$r.source===hr&&typeof $r.data=="string"&&$r.data.indexOf(br)===0&&Mr(+$r.data.slice(br.length))}})(typeof self>"u"?fr===void 0?this:fr:self)}).call(this,typeof commonjsGlobal<"u"?commonjsGlobal:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)})})(jszip_min)),jszip_min.exports}var jszip_minExports=requireJszip_min();const JSZip=getDefaultExportFromCjs(jszip_minExports);function validateOperations(tr){const rr=[],ir=Object.keys(tr);for(const lr of ir){const dr=tr[lr].sort((hr,mr)=>hr.index-mr.index);let fr=-1;for(let hr=0;hr<dr.length;hr++)fr=fr+1+dr[hr].skip,dr[hr].index!==fr&&rr.push({message:`Invalid operation index ${dr[hr].index} at position ${hr}`,details:{position:hr,operation:dr[hr],scope:dr[hr].action.scope}})}return rr}function createZip(tr){const rr=new JSZip,ir=tr.header;return rr.file("header.json",JSON.stringify(ir,null,2)),rr.file("state.json",JSON.stringify(tr.initialState||{},null,2)),rr.file("current-state.json",JSON.stringify(tr.state||{},null,2)),rr.file("operations.json",JSON.stringify(filterDocumentOperationsResultingState(tr.operations),null,2)),tr.attachments&&Object.keys(tr.attachments).forEach(dr=>{var mr;const{data:fr,...hr}=((mr=tr.attachments)==null?void 0:mr[dr])??{};fr&&rr.file(dr,fr,{base64:!0,createFolders:!0,comment:JSON.stringify(hr)})}),rr}async function baseSaveToFile(tr,rr,ir,lr){await createZip(tr).generateAsync({type:"uint8array",streamFiles:!0});const fr=lr??tr.header.name,hr=".phd";return writeFile(rr,fr.endsWith(hr)?fr:`${fr}${hr}`)}async function baseSaveToFileHandle(tr,rr){const lr=await createZip(tr).generateAsync({type:"blob"}),dr=await rr.createWritable();await dr.write(lr),await dr.close()}async function baseLoadFromFile(tr,rr,ir){const lr=readFile();return baseLoadFromInput(lr,rr,ir)}async function baseLoadFromInput(tr,rr,ir){const lr=new JSZip;return await lr.loadAsync(tr),loadFromZip(lr,rr,ir)}async function loadFromZip(tr,rr,ir){const lr=tr.file("state.json");if(!lr)throw new Error("Initial state not found");const dr=await lr.async("string"),fr=JSON.parse(dr),hr=tr.file("header.json");let mr;hr&&(mr=JSON.parse(await hr.async("string")));const gr=tr.file("operations.json");if(!gr)throw new Error("Operations history not found");const yr=JSON.parse(await gr.async("string")),_r=garbageCollectDocumentOperations(yr),br=validateOperations(_r);if(br.length){const wr=br.map(xr=>xr.message);throw new Error(wr.join(`
191
191
  `))}let vr=replayDocument(fr,_r,rr,void 0,mr,{},ir);return mr&&(vr={...vr,header:mr}),vr}const SPLIT_LOWER_UPPER_RE=new RegExp("([\\p{Ll}\\d])(\\p{Lu})","gu"),SPLIT_UPPER_UPPER_RE=new RegExp("(\\p{Lu})([\\p{Lu}][\\p{Ll}])","gu"),SPLIT_SEPARATE_NUMBER_RE=new RegExp("(\\d)\\p{Ll}|(\\p{L})\\d","u"),DEFAULT_STRIP_REGEXP=/[^\p{L}\d]+/giu,SPLIT_REPLACE_VALUE="$1\0$2",DEFAULT_PREFIX_SUFFIX_CHARACTERS="";function split$1(tr){let rr=tr.trim();rr=rr.replace(SPLIT_LOWER_UPPER_RE,SPLIT_REPLACE_VALUE).replace(SPLIT_UPPER_UPPER_RE,SPLIT_REPLACE_VALUE),rr=rr.replace(DEFAULT_STRIP_REGEXP,"\0");let ir=0,lr=rr.length;for(;rr.charAt(ir)==="\0";)ir++;if(ir===lr)return[];for(;rr.charAt(lr-1)==="\0";)lr--;return rr.slice(ir,lr).split(/\0/g)}function splitSeparateNumbers(tr){const rr=split$1(tr);for(let ir=0;ir<rr.length;ir++){const lr=rr[ir],dr=SPLIT_SEPARATE_NUMBER_RE.exec(lr);if(dr){const fr=dr.index+(dr[1]??dr[2]).length;rr.splice(ir,1,lr.slice(0,fr),lr.slice(fr))}}return rr}function noCase(tr,rr){const[ir,lr,dr]=splitPrefixSuffix(tr,rr);return ir+lr.map(lowerFactory(rr==null?void 0:rr.locale)).join((rr==null?void 0:rr.delimiter)??" ")+dr}function pascalCase(tr,rr){const[ir,lr,dr]=splitPrefixSuffix(tr,rr),fr=lowerFactory(rr==null?void 0:rr.locale),hr=upperFactory(rr==null?void 0:rr.locale),mr=rr!=null&&rr.mergeAmbiguousCharacters?capitalCaseTransformFactory(fr,hr):pascalCaseTransformFactory(fr,hr);return ir+lr.map(mr).join((rr==null?void 0:rr.delimiter)??"")+dr}function capitalCase(tr,rr){const[ir,lr,dr]=splitPrefixSuffix(tr,rr),fr=lowerFactory(rr==null?void 0:rr.locale),hr=upperFactory(rr==null?void 0:rr.locale);return ir+lr.map(capitalCaseTransformFactory(fr,hr)).join(" ")+dr}function constantCase(tr,rr){const[ir,lr,dr]=splitPrefixSuffix(tr,rr);return ir+lr.map(upperFactory(rr==null?void 0:rr.locale)).join("_")+dr}function sentenceCase(tr,rr){const[ir,lr,dr]=splitPrefixSuffix(tr,rr),fr=lowerFactory(rr==null?void 0:rr.locale),hr=upperFactory(rr==null?void 0:rr.locale),mr=capitalCaseTransformFactory(fr,hr);return ir+lr.map((gr,yr)=>yr===0?mr(gr):fr(gr)).join(" ")+dr}function snakeCase(tr,rr){return noCase(tr,{delimiter:"_",...rr})}function lowerFactory(tr){return tr===!1?rr=>rr.toLowerCase():rr=>rr.toLocaleLowerCase(tr)}function upperFactory(tr){return tr===!1?rr=>rr.toUpperCase():rr=>rr.toLocaleUpperCase(tr)}function capitalCaseTransformFactory(tr,rr){return ir=>`${rr(ir[0])}${tr(ir.slice(1))}`}function pascalCaseTransformFactory(tr,rr){return(ir,lr)=>{const dr=ir[0];return(lr>0&&dr>="0"&&dr<="9"?"_"+dr:rr(dr))+tr(ir.slice(1))}}function splitPrefixSuffix(tr,rr={}){const ir=rr.split??(rr.separateNumbers?splitSeparateNumbers:split$1),lr=rr.prefixCharacters??DEFAULT_PREFIX_SUFFIX_CHARACTERS,dr=rr.suffixCharacters??DEFAULT_PREFIX_SUFFIX_CHARACTERS;let fr=0,hr=tr.length;for(;fr<tr.length;){const mr=tr.charAt(fr);if(!lr.includes(mr))break;fr++}for(;hr>fr;){const mr=hr-1,gr=tr.charAt(mr);if(!dr.includes(gr))break;hr=mr}return[tr.slice(0,fr),ir(tr.slice(fr,hr)),tr.slice(hr)]}function validateInitialState(tr,rr=!1){const ir=[];if(rr&&tr==="")return ir;try{const lr=JSON.parse(tr);!rr&&!Object.keys(lr).length&&ir.push({message:"Initial state cannot be empty",details:{initialState:tr}})}catch{ir.push({message:"Invalid initial state",details:{initialState:tr}})}return ir}function validateStateSchemaName(tr,rr,ir="",lr=!0){const dr=[];if(!lr&&!tr)return dr.push({message:"State schema is required",details:{schema:tr}}),dr;if(lr&&!tr)return dr;const fr=`type ${pascalCase(rr)}${pascalCase(ir)}State`;return tr.includes(fr)||dr.push({message:`Invalid state schema name. Expected ${fr}`,details:{schema:tr}}),dr}function validateModules(tr){const rr=[];tr.length||rr.push({message:"Modules are required",details:{modules:tr}});const ir=tr.reduce((lr,dr)=>[...lr,...validateModule(dr)],[]);return[...rr,...ir]}function validateModule(tr){const rr=[];tr.name||rr.push({message:"Module name is required",details:{module:tr}}),tr.operations.length||rr.push({message:"Module operations are required",details:{module:tr}});const ir=tr.operations.reduce((lr,dr)=>[...lr,...validateModuleOperation(dr)],[]);return[...rr,...ir]}function validateModuleOperation(tr){const rr=[];return tr.name||rr.push({message:"Operation name is required",details:{operation:tr}}),tr.schema||rr.push({message:"Operation schema is required",details:{operation:tr}}),rr}const customUtils$1=Object.freeze(Object.defineProperty({__proto__:null,validateInitialState,validateModule,validateModuleOperation,validateModules,validateStateSchemaName},Symbol.toStringTag,{value:"Module"})),isDefinedNonNullAny=tr=>tr!=null;anyType().refine(tr=>isDefinedNonNullAny(tr));const TransmitterTypeSchema=enumType(["Internal","MatrixConnect","PullResponder","RESTWebhook","SecureConnect","SwitchboardPush"]),TriggerTypeSchema=enumType(["PullResponder"]);function AddFileInputSchema(){return objectType({documentType:stringType(),id:stringType(),name:stringType(),parentFolder:stringType().nullish()})}function AddFolderInputSchema(){return objectType({id:stringType(),name:stringType(),parentFolder:stringType().nullish()})}function AddListenerInputSchema(){return objectType({listener:ListenerSchema()})}function AddTriggerInputSchema(){return objectType({trigger:TriggerSchema()})}function CopyNodeInputSchema(){return objectType({srcId:stringType(),targetId:stringType(),targetName:stringType().nullish(),targetParentFolder:stringType().nullish()})}function DeleteNodeInputSchema(){return objectType({id:stringType()})}function ListenerSchema(){return objectType({__typename:literalType("Listener").optional(),block:booleanType(),callInfo:ListenerCallInfoSchema().nullable(),filter:ListenerFilterSchema(),label:stringType().nullable(),listenerId:stringType(),system:booleanType()})}function ListenerCallInfoSchema(){return objectType({__typename:literalType("ListenerCallInfo").optional(),data:stringType().nullable(),name:stringType().nullable(),transmitterType:TransmitterTypeSchema.nullable()})}function ListenerFilterSchema(){return objectType({__typename:literalType("ListenerFilter").optional(),branch:arrayType(stringType()).nullable(),documentId:arrayType(stringType()).nullable(),documentType:arrayType(stringType()),scope:arrayType(stringType()).nullable()})}function MoveNodeInputSchema(){return objectType({srcFolder:stringType(),targetParentFolder:stringType().nullish()})}function PullResponderTriggerDataSchema(){return objectType({__typename:literalType("PullResponderTriggerData").optional(),interval:stringType(),listenerId:stringType(),url:stringType()})}function RemoveListenerInputSchema(){return objectType({listenerId:stringType()})}function RemoveTriggerInputSchema(){return objectType({triggerId:stringType()})}function SetAvailableOfflineInputSchema(){return objectType({availableOffline:booleanType()})}function SetDriveIconInputSchema(){return objectType({icon:stringType()})}function SetDriveNameInputSchema(){return objectType({name:stringType()})}function SetSharingTypeInputSchema(){return objectType({type:stringType()})}function TriggerSchema(){return objectType({__typename:literalType("Trigger").optional(),data:TriggerDataSchema().nullable(),id:stringType(),type:TriggerTypeSchema})}function TriggerDataSchema(){return PullResponderTriggerDataSchema()}function UpdateFileInputSchema(){return objectType({documentType:stringType().nullish(),id:stringType(),name:stringType().nullish(),parentFolder:stringType().nullish()})}function UpdateNodeInputSchema(){return objectType({id:stringType(),name:stringType().nullish(),parentFolder:stringType().nullish()})}const reducer$2={setDriveNameOperation(tr,rr,ir){tr.name=rr.input.name},setDriveIconOperation(tr,rr,ir){tr.icon=rr.input.icon},setSharingTypeOperation(tr,rr,ir){tr.sharingType=rr.input.type},setAvailableOfflineOperation(tr,rr,ir){tr.availableOffline=rr.input.availableOffline},addListenerOperation(tr,rr,ir){if(tr.listeners.find(lr=>lr.listenerId===rr.input.listener.listenerId))throw new Error(`A listener with Id: ${rr.input.listener.listenerId} already exists`);tr.listeners.push(rr.input.listener)},removeListenerOperation(tr,rr,ir){tr.listeners=tr.listeners.filter(lr=>lr.listenerId!==rr.input.listenerId)},addTriggerOperation(tr,rr,ir){if(tr.triggers.find(lr=>lr.id===rr.input.trigger.id))throw new Error(`A trigger with Id: ${rr.input.trigger.id} already exists`);tr.triggers.push(rr.input.trigger)},removeTriggerOperation(tr,rr,ir){tr.triggers=tr.triggers.filter(lr=>lr.id!==rr.input.triggerId)}};let DocumentModelNotFoundError$1=class extends Error{constructor(ir,lr){super(`Document model "${ir}" not found`,{cause:lr});ki(this,"id");this.id=ir}};class OperationError extends Error{constructor(ir,lr,dr,fr){super(dr,{cause:fr??lr});ki(this,"status");ki(this,"operation");this.status=ir,this.operation=lr,fr instanceof Error&&(this.stack=fr.stack)}}class ConflictOperationError extends OperationError{constructor(rr,ir){super("CONFLICT",ir,`Conflicting operation on index ${ir.index}`,{existingOperation:rr,newOperation:ir})}}class DocumentIdValidationError extends Error{constructor(rr){super(`Invalid document id: ${rr}`)}}class DocumentSlugValidationError extends Error{constructor(rr){super(`Invalid slug: ${rr}`)}}var DocumentAlreadyExistsReason;(function(tr){tr.ID="id",tr.SLUG="slug"})(DocumentAlreadyExistsReason||(DocumentAlreadyExistsReason={}));class DocumentAlreadyExistsError extends Error{constructor(ir,lr=DocumentAlreadyExistsReason.ID){super(`Document (${ir}) uses ${lr} that already exists`);ki(this,"documentId");this.documentId=ir}}let DocumentNotFoundError$1=class extends Error{constructor(ir){super(`Document with id ${ir} not found`);ki(this,"documentId");this.documentId=ir}};class SynchronizationUnitNotFoundError extends Error{constructor(ir){super(`Sync unit ${JSON.stringify(ir)} not found`);ki(this,"syncUnitId");this.syncUnitId=ir}}const isValidDocumentId=tr=>tr&&tr.length>0&&/^[a-zA-Z0-9_-]+$/.test(tr),isValidSlug=tr=>tr&&tr.length>0&&/^[a-zA-Z0-9_-]+$/.test(tr),resolveStorageUnitsFilterComponent=tr=>tr&&tr.length>0&&!tr.includes("*")?new Set(tr):null,resolveStorageUnitsFilter=tr=>({parentId:resolveStorageUnitsFilterComponent(tr.parentId),documentId:resolveStorageUnitsFilterComponent(tr.documentId),documentModelType:resolveStorageUnitsFilterComponent(tr.documentModelType),scope:resolveStorageUnitsFilterComponent(tr.scope),branch:resolveStorageUnitsFilterComponent(tr.branch)});function isFileNode(tr){return tr.kind==="file"}function isFolderNode(tr){return tr.kind==="folder"}function getAncestors(tr,rr){if(tr.parentFolder){const ir=rr.find(lr=>lr.id===tr.parentFolder);if(!ir)throw new Error(`Parent node with id ${tr.parentFolder} not found`);return[ir,...getAncestors(ir,rr)]}else return[]}function getDescendants(tr,rr){const ir=rr.filter(dr=>dr.parentFolder===tr.id),lr=ir.map(dr=>getDescendants(dr,rr));return[...ir,...lr.flat()]}function generateNodesCopy(tr,rr,ir){const lr=ir.find(gr=>gr.id===tr.srcId);if(!lr)throw new Error(`Node with id ${tr.srcId} not found`);const dr=[{...lr,name:tr.targetName||lr.name,parentFolder:tr.targetParentFolder||null},...getDescendants(lr,ir)],fr={};tr.targetParentFolder&&(fr[tr.targetParentFolder]=tr.targetParentFolder);const hr=gr=>{let yr=fr[gr.id];if(!yr){const _r=gr.id;yr=rr(gr),fr[_r]=yr}return yr};return dr.map(gr=>({srcId:gr.id,targetId:hr(gr),targetName:gr.name,targetParentFolder:gr.parentFolder?fr[gr.parentFolder]:null}))}function getNextCopyNumber(tr,rr){let ir=0;const lr=new RegExp(`^${escapeRegExp(rr)} \\(copy\\)(?: (\\d+))?$`);for(const dr of tr){const fr=dr.match(lr);if(fr){const hr=fr[1]?parseInt(fr[1],10):1;hr>ir&&(ir=hr)}}return ir+1}function escapeRegExp(tr){return tr.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function handleTargetNameCollisions(tr){const{nodes:rr,targetParentFolder:ir,srcName:lr}=tr,dr=rr.filter(mr=>ir===""?mr.parentFolder===null:mr.parentFolder===ir).map(mr=>mr.name);return dr.includes(lr)?`${lr} (copy) ${getNextCopyNumber(dr,lr)}`:lr}const isValidName=tr=>/^[a-zA-Z0-9-_.\s()]+$/.test(tr),customUtils=Object.freeze(Object.defineProperty({__proto__:null,escapeRegExp,generateNodesCopy,getAncestors,getDescendants,getNextCopyNumber,handleTargetNameCollisions,isFileNode,isFolderNode,isValidName},Symbol.toStringTag,{value:"Module"})),reducer$1={addFileOperation(tr,rr,ir){if(tr.nodes.find(fr=>fr.id===rr.input.id))throw new Error(`Node with id ${rr.input.id} already exists!`);if(!isValidDocumentId(rr.input.id))throw new DocumentIdValidationError(rr.input.id);if(!isValidName(rr.input.name))throw new Error(`Invalid name: '${rr.input.name}'. Names must be valid URL characters.`);const lr=handleTargetNameCollisions({nodes:tr.nodes,srcName:rr.input.name,targetParentFolder:rr.input.parentFolder||null}),dr={id:rr.input.id,name:lr,kind:"file",parentFolder:rr.input.parentFolder??null,documentType:rr.input.documentType};tr.nodes.push(dr),ir==null||ir({type:"CREATE_CHILD_DOCUMENT",input:{id:rr.input.id,documentType:rr.input.documentType}})},addFolderOperation(tr,rr){if(tr.nodes.find(lr=>lr.id===rr.input.id))throw new Error(`Node with id ${rr.input.id} already exists!`);if(!isValidName(rr.input.name))throw new Error(`Invalid name: '${rr.input.name}'. Names must be valid URL characters.`);const ir=handleTargetNameCollisions({nodes:tr.nodes,srcName:rr.input.name,targetParentFolder:rr.input.parentFolder||null});tr.nodes.push({...rr.input,name:ir,kind:"folder",parentFolder:rr.input.parentFolder??null})},deleteNodeOperation(tr,rr,ir){const lr=tr.nodes.find(fr=>fr.id===rr.input.id);if(!lr)throw new Error(`Node with id ${rr.input.id} not found`);const dr=getDescendants(lr,tr.nodes);tr.nodes=tr.nodes.filter(fr=>fr.id!==rr.input.id&&!dr.find(hr=>hr.id===fr.id)),[lr,...dr].filter(fr=>isFileNode(fr)).forEach(fr=>{ir==null||ir({type:"DELETE_CHILD_DOCUMENT",input:{id:fr.id}})})},updateFileOperation(tr,rr){if(rr.input.name&&!isValidName(rr.input.name))throw new Error(`Invalid name: '${rr.input.name}'. Names must be valid URL characters.`);tr.nodes=tr.nodes.map(ir=>ir.id===rr.input.id?{...ir,name:handleTargetNameCollisions({nodes:tr.nodes,srcName:rr.input.name??ir.name,targetParentFolder:rr.input.parentFolder||null}),documentType:rr.input.documentType??ir.documentType}:ir)},updateNodeOperation(tr,rr){if(rr.input.name&&!isValidName(rr.input.name))throw new Error(`Invalid name: '${rr.input.name}'. Names must be valid URL characters.`);tr.nodes=tr.nodes.map(ir=>ir.id===rr.input.id?{...ir,name:handleTargetNameCollisions({nodes:tr.nodes,srcName:rr.input.name??ir.name,targetParentFolder:rr.input.parentFolder||null}),parentFolder:rr.input.parentFolder===null?null:ir.parentFolder}:ir)},copyNodeOperation(tr,rr,ir){const lr=tr.nodes.find(gr=>gr.id===rr.input.srcId);if(!lr)throw new Error(`Node with id ${rr.input.srcId} not found`);if(!isValidDocumentId(rr.input.targetId))throw new DocumentIdValidationError(rr.input.targetId);if(tr.nodes.find(gr=>gr.id===rr.input.targetId))throw new Error(`Node with id ${rr.input.targetId} already exists`);const fr=handleTargetNameCollisions({nodes:tr.nodes,srcName:rr.input.targetName||lr.name,targetParentFolder:rr.input.targetParentFolder||null}),hr={...lr,id:rr.input.targetId,slug:rr.input.targetId,name:fr,parentFolder:rr.input.targetParentFolder||null};tr.nodes.push(hr),isFileNode(hr)&&(ir==null||ir({type:"COPY_CHILD_DOCUMENT",input:{id:rr.input.srcId,newId:rr.input.targetId}}))},moveNodeOperation(tr,rr){if(rr.input.srcFolder===rr.input.targetParentFolder)throw new Error("Circular Reference Error: Attempting to move a node to its current parent folder");const ir=tr.nodes.find(dr=>dr.id===rr.input.srcFolder);if(!ir)throw new Error(`Node with id ${rr.input.srcFolder} not found`);const lr=handleTargetNameCollisions({nodes:tr.nodes,srcName:ir.name,targetParentFolder:rr.input.targetParentFolder||null});if(isFolderNode(ir)&&getDescendants(ir,tr.nodes).find(fr=>fr.id===rr.input.targetParentFolder))throw new Error("Circular Reference Error: Cannot move a folder to one of its descendants");tr.nodes=tr.nodes.map(dr=>dr.id===rr.input.srcFolder?{...dr,name:lr,parentFolder:rr.input.targetParentFolder||null}:dr)}},stateReducer=(tr,rr,ir)=>{if(isDocumentAction(rr))return tr;const lr=rr;switch(lr.type){case"ADD_FILE":AddFileInputSchema().parse(lr.input),reducer$1.addFileOperation(tr[lr.scope],rr,ir);break;case"ADD_FOLDER":AddFolderInputSchema().parse(lr.input),reducer$1.addFolderOperation(tr[lr.scope],rr,ir);break;case"DELETE_NODE":DeleteNodeInputSchema().parse(lr.input),reducer$1.deleteNodeOperation(tr[lr.scope],rr,ir);break;case"UPDATE_FILE":UpdateFileInputSchema().parse(lr.input),reducer$1.updateFileOperation(tr[lr.scope],rr,ir);break;case"UPDATE_NODE":UpdateNodeInputSchema().parse(lr.input),reducer$1.updateNodeOperation(tr[lr.scope],rr,ir);break;case"COPY_NODE":CopyNodeInputSchema().parse(lr.input),reducer$1.copyNodeOperation(tr[lr.scope],rr,ir);break;case"MOVE_NODE":MoveNodeInputSchema().parse(lr.input),reducer$1.moveNodeOperation(tr[lr.scope],rr,ir);break;case"SET_DRIVE_NAME":SetDriveNameInputSchema().parse(lr.input),reducer$2.setDriveNameOperation(tr[lr.scope],rr,ir);break;case"SET_DRIVE_ICON":SetDriveIconInputSchema().parse(lr.input),reducer$2.setDriveIconOperation(tr[lr.scope],rr,ir);break;case"SET_SHARING_TYPE":SetSharingTypeInputSchema().parse(lr.input),reducer$2.setSharingTypeOperation(tr[lr.scope],rr,ir);break;case"SET_AVAILABLE_OFFLINE":SetAvailableOfflineInputSchema().parse(lr.input),reducer$2.setAvailableOfflineOperation(tr[lr.scope],rr,ir);break;case"ADD_LISTENER":AddListenerInputSchema().parse(lr.input),reducer$2.addListenerOperation(tr[lr.scope],rr,ir);break;case"REMOVE_LISTENER":RemoveListenerInputSchema().parse(lr.input),reducer$2.removeListenerOperation(tr[lr.scope],rr,ir);break;case"ADD_TRIGGER":AddTriggerInputSchema().parse(lr.input),reducer$2.addTriggerOperation(tr[lr.scope],rr,ir);break;case"REMOVE_TRIGGER":RemoveTriggerInputSchema().parse(lr.input),reducer$2.removeTriggerOperation(tr[lr.scope],rr,ir);break;default:return tr}},reducer=createReducer(stateReducer),initialGlobalState={name:"",nodes:[],icon:null},initialLocalState={listeners:[],triggers:[],sharingType:"private",availableOffline:!1},utils$5={fileExtension:"phdd",createState(tr){return{...defaultBaseState(),global:{...initialGlobalState,...tr==null?void 0:tr.global},local:{...initialLocalState,...tr==null?void 0:tr.local}}},createDocument(tr){const rr=baseCreateDocument(utils$5.createState,tr);return rr.header.documentType=driveDocumentType,rr.header.id=generateId(),rr},saveToFile(tr,rr,ir){return baseSaveToFile(tr,rr,"phdd",ir)},saveToFileHandle(tr,rr){return baseSaveToFileHandle(tr,rr)},loadFromFile(tr){return baseLoadFromFile(tr,reducer)},loadFromInput(tr){return baseLoadFromInput(tr,reducer)}},createDocument=utils$5.createDocument;function addFile$1(tr){return tr&&typeof tr=="object"&&"synchronizationUnits"in tr?createAction("ADD_FILE",{...tr},void 0,void 0,"global"):createAction("ADD_FILE",{...tr},void 0,AddFileInputSchema,"global")}const addFolder$1=tr=>createAction("ADD_FOLDER",{...tr},void 0,AddFolderInputSchema,"global"),deleteNode$1=tr=>createAction("DELETE_NODE",{...tr},void 0,DeleteNodeInputSchema,"global"),updateFile=tr=>createAction("UPDATE_FILE",{...tr},void 0,UpdateFileInputSchema,"global"),updateNode=tr=>createAction("UPDATE_NODE",{...tr},void 0,UpdateNodeInputSchema,"global"),copyNode$1=tr=>createAction("COPY_NODE",{...tr},void 0,CopyNodeInputSchema,"global"),moveNode$1=tr=>createAction("MOVE_NODE",{...tr},void 0,MoveNodeInputSchema,"global"),setDriveName=tr=>createAction("SET_DRIVE_NAME",{...tr},void 0,SetDriveNameInputSchema,"global"),setDriveIcon=tr=>createAction("SET_DRIVE_ICON",{...tr},void 0,SetDriveIconInputSchema,"global"),setSharingType=tr=>createAction("SET_SHARING_TYPE",{...tr},void 0,SetSharingTypeInputSchema,"local"),setAvailableOffline=tr=>createAction("SET_AVAILABLE_OFFLINE",{...tr},void 0,SetAvailableOfflineInputSchema,"local"),addListener=tr=>createAction("ADD_LISTENER",{...tr},void 0,AddListenerInputSchema,"local"),removeListener=tr=>createAction("REMOVE_LISTENER",{...tr},void 0,RemoveListenerInputSchema,"local"),addTrigger$1=tr=>createAction("ADD_TRIGGER",{...tr},void 0,AddTriggerInputSchema,"local"),removeTrigger$1=tr=>createAction("REMOVE_TRIGGER",{...tr},void 0,RemoveTriggerInputSchema,"local"),DocumentDriveActions=Object.freeze(Object.defineProperty({__proto__:null,addFile:addFile$1,addFolder:addFolder$1,addListener,addTrigger:addTrigger$1,copyNode:copyNode$1,deleteNode:deleteNode$1,moveNode:moveNode$1,removeListener,removeTrigger:removeTrigger$1,setAvailableOffline,setDriveIcon,setDriveName,setSharingType,updateFile,updateNode},Symbol.toStringTag,{value:"Module"}));function defaultGlobalState(){return{icon:null,name:"",nodes:[]}}function defaultLocalState$1(){return{availableOffline:!1,listeners:[],sharingType:null,triggers:[]}}function createGlobalState(tr){return{...defaultGlobalState(),...tr||{}}}function createLocalState(tr){return{...defaultLocalState$1(),...tr||{}}}function createState(tr,rr,ir){return{...createBaseState(tr==null?void 0:tr.auth,tr==null?void 0:tr.document),global:createGlobalState(rr),local:createLocalState(ir)}}function createDocumentDriveDocument(tr){return createDocument(tr?createState(createBaseState(tr.auth,tr.document),tr.global,tr.local):void 0)}const utils$4={...utils$5,...customUtils},actions={...actions$1,...DocumentDriveActions},module={reducer,actions,utils:utils$4,documentModel},driveDocumentModelModule=module,LogLevels={verbose:1,debug:2,info:3,warn:4,error:5,silent:6};function isLogLevel(tr){return typeof tr=="string"&&tr in LogLevels}var define_process_env_default={},Ua,wl,Va,za,Yl;class ConsoleLogger{constructor(rr,ir){Ri(this,za);Ri(this,Ua);Ri(this,wl,"env");Ri(this,Va);Ni(this,Ua,(rr||[]).map(lr=>`[${lr}]`)),Ni(this,Va,ir),this.log=this.log.bind(this),this.info=this.info.bind(this),this.warn=this.warn.bind(this),this.error=this.error.bind(this),this.debug=this.debug.bind(this),this.verbose=this.verbose.bind(this)}get level(){return kr(this,wl)}set level(rr){if(rr!=="env"&&!isLogLevel(rr))throw new Error(`Invalid log level: ${JSON.stringify(rr)}.
192
192
  Must be one of ${Object.keys(LogLevels).concat(["env"]).join(", ")}.`);Ni(this,wl,rr)}get errorHandler(){return kr(this,Va)}set errorHandler(rr){Ni(this,Va,rr)}log(...rr){return this.debug(...rr)}verbose(...rr){if(!(kr(this,za,Yl)>LogLevels.verbose))return this.debug(...rr)}debug(...rr){if(!(kr(this,za,Yl)>LogLevels.debug))return console.debug(...kr(this,Ua),...rr)}info(...rr){if(!(kr(this,za,Yl)>LogLevels.info))return console.info(...kr(this,Ua),...rr)}warn(...rr){if(!(kr(this,za,Yl)>LogLevels.warn))return console.warn(...kr(this,Ua),...rr)}error(...rr){if(!(kr(this,za,Yl)>LogLevels.error))return kr(this,Va)&&kr(this,Va).call(this,...rr),console.error(...kr(this,Ua),...rr)}}Ua=new WeakMap,wl=new WeakMap,Va=new WeakMap,za=new WeakSet,Yl=function(){if(kr(this,wl)==="env"){const rr=typeof process<"u"&&"env"in process?define_process_env_default.LOG_LEVEL:void 0;return!rr||!(rr in LogLevels)?LogLevels.info:LogLevels[rr]}return LogLevels[kr(this,wl)]};const loggerInstance=new ConsoleLogger;let logLevel="env",errorHandler;loggerInstance.level=logLevel;loggerInstance.errorHandler=errorHandler;const logger$6=loggerInstance,setLogLevel=tr=>{logLevel=tr,loggerInstance.level=tr},childLogger=tr=>{const rr=new ConsoleLogger(tr);return rr.level=logLevel,rr.errorHandler=errorHandler,rr};var RunAsap;(function(tr){tr.useMessageChannel=typeof MessageChannel>"u"?new Error("MessageChannel is not supported"):lr=>{const dr=new AbortController,fr=dr.signal,hr=new MessageChannel;return hr.port1.postMessage(null),hr.port2.addEventListener("message",()=>{lr(),hr.port1.close(),hr.port2.close()},{once:!0,signal:fr}),hr.port2.start(),()=>dr.abort()},tr.usePostMessage=(()=>{const lr=typeof window=="object"&&window||typeof global=="object"&&global||typeof self=="object"&&self;if(!lr)return new Error("No global object found");const dr=lr;if(!dr.postMessage||!dr.addEventListener||dr.importScripts)return new Error("postMessage is not supported");let fr=0;const hr=new Map;function mr(){return fr===9007199254740991?0:++fr}const gr="com.usePostMessage"+Math.random();return dr.addEventListener("message",yr=>{const _r=yr;if(typeof _r.data!="string"||_r.source!==dr||!_r.data.startsWith(gr))return;const br=_r.data.split(":").at(1);if(br===void 0)return;const vr=+br,wr=hr.get(vr);wr&&(wr(),hr.delete(vr))},!1),yr=>{const _r=mr();return hr.set(_r,yr),dr.postMessage(gr+":"+_r,{targetOrigin:"*"}),()=>{hr.delete(_r)}}})(),tr.useSetImmediate=typeof window<"u"?new Error("setImmediate is not supported on the browser"):typeof setImmediate>"u"?new Error("setImmediate is not supported"):lr=>{const dr=setImmediate(lr);return()=>clearImmediate(dr)},tr.useSetTimeout=lr=>{const dr=setTimeout(lr,0);return()=>clearTimeout(dr)};function rr(lr){return tr.useSetImmediate instanceof Error?tr.useMessageChannel instanceof Error?tr.usePostMessage instanceof Error?tr.useSetTimeout(lr):tr.usePostMessage(lr):tr.useMessageChannel(lr):tr.useSetImmediate(lr)}tr.runAsap=rr;function ir(lr,dr=rr){if(dr instanceof Error)throw new Error("queueMethod is not supported",{cause:dr});return new Promise((fr,hr)=>{dr(()=>{lr().then(fr).catch(hr)})})}tr.runAsapAsync=ir})(RunAsap||(RunAsap={}));const runAsapAsync=RunAsap.runAsapAsync;function isDocumentDrive(tr){return tr.header.documentType===driveDocumentType}function mergeOperations(tr,rr){const ir=Object.keys(tr).reduce((dr,fr)=>{var mr;const hr=fr;return dr[hr]=((mr=tr[hr].at(-1))==null?void 0:mr.index)??0,dr},{}),lr=rr.find(dr=>dr.index<(ir[dr.action.scope]??0));if(lr)throw new OperationError("ERROR",lr,`Tried to add operation with index ${lr.index} and document is at index ${ir[lr.action.scope]}`);return rr.sort((dr,fr)=>dr.index-fr.index).reduce((dr,fr)=>{const hr=dr[fr.action.scope]||[];return{...dr,[fr.action.scope]:[...hr,fr]}},tr)}function isBefore(tr,rr){return new Date(tr)<new Date(rr)}function operationsToRevision(tr){const rr=tr==null?void 0:tr.at(-1);return rr?rr.index+1:0}var $c,Gd;class InternalTransmitter{constructor(rr,ir,lr){Ri(this,$c);ki(this,"drive");ki(this,"processor");ki(this,"taskQueueMethod");ki(this,"transmitQueue");this.drive=rr,this.processor=ir,this.taskQueueMethod=lr===void 0?RunAsap.runAsap:lr}async transmit(rr,ir){var dr;const lr=async()=>{var hr;const fr=[];for(const mr of rr){const gr=await Bi(this,$c,Gd).call(this,mr),yr=await this.drive.getDocument(mr.documentId),_r=((hr=gr.at(-1))==null?void 0:hr.state)??{};fr.push({...mr,documentType:yr.header.documentType,operations:gr,state:_r})}try{return await this.processor.onStrands(fr),rr.map(({operations:mr,...gr})=>({...gr,status:"SUCCESS",revision:operationsToRevision(mr)}))}catch(mr){return logger$6.error(mr),rr.map(({operations:gr,...yr})=>{var _r;return{...yr,status:"ERROR",revision:((_r=gr.at(0))==null?void 0:_r.index)??0}})}};return this.transmitQueue=((dr=this.transmitQueue)==null?void 0:dr.then(()=>lr()))??lr(),this.transmitQueue}async disconnect(){await this.processor.onDisconnect()}}$c=new WeakSet,Gd=async function(rr){const ir=[],lr=new Map,dr=async fr=>{const hr=lr.get(fr);if(hr)return hr;const mr={revisions:{[rr.scope]:fr},checkHashes:!1},gr=await(rr.documentId===rr.driveId?this.drive.getDrive(rr.driveId,mr):this.drive.getDocument(rr.documentId,mr));return fr<0?lr.set(fr,gr.initialState[rr.scope]):lr.set(fr,gr.state[rr.scope]),lr.get(fr)};for(const fr of rr.operations){const hr=()=>dr(fr.index),mr=await(this.taskQueueMethod?RunAsap.runAsapAsync(hr,this.taskQueueMethod):hr()),gr=()=>dr(fr.index-1),yr=await(this.taskQueueMethod?RunAsap.runAsapAsync(gr,this.taskQueueMethod):gr()),_r={id:fr.actionId,timestampUtcMs:fr.timestampUtcMs,type:fr.type,input:fr.input,context:fr.context,scope:rr.scope};ir.push({...fr,state:mr,previousState:yr,action:_r})}return ir};const FNV_PRIMES={32:16777619n,64:1099511628211n,128:309485009821345068724781371n,256:374144419156711147060143317175368453031918731002211n,512:35835915874844867368919076489095108449946327955754392558399825615420669938882575126094039892345713852759n,1024:5016456510113118655434598811035278955030765345404790744303017523831112055108147451509157692220295382716162651878526895249385292291816524375083746691371804094271873160484737966720260389217684476157468082573n},FNV_OFFSETS={32:2166136261n,64:14695981039346656037n,128:144066263297769815596495629667062367629n,256:100029257958052580907070968620625704837092796014241193945225284501741471925557n,512:9659303129496669498009435400716310466090418745672637896108374329434462657994582932197716438449813051892206539805784495328239340083876191928701583869517785n,1024:14197795064947621068722070641403218320880622795441933960878474914617582723252296732303717722150864096521202355549365628174669108571814760471015076148029755969804077320157692458563003215304957150157403644460363550505412711285966361610267868082893823963790439336411086884584107735010676915n},cachedEncoder=new globalThis.TextEncoder;function fnv1aUint8Array(tr,rr){const ir=FNV_PRIMES[rr];let lr=FNV_OFFSETS[rr];for(let dr=0;dr<tr.length;dr++)lr^=BigInt(tr[dr]),lr=BigInt.asUintN(rr,lr*ir);return lr}function fnv1aEncodeInto(tr,rr,ir){if(ir.length===0)throw new Error("The `utf8Buffer` option must have a length greater than zero");const lr=FNV_PRIMES[rr];let dr=FNV_OFFSETS[rr],fr=tr;for(;fr.length>0;){const hr=cachedEncoder.encodeInto(fr,ir);fr=fr.slice(hr.read);for(let mr=0;mr<hr.written;mr++)dr^=BigInt(ir[mr]),dr=BigInt.asUintN(rr,dr*lr)}return dr}function fnv1a(tr,{size:rr=32,utf8Buffer:ir}={}){if(!FNV_PRIMES[rr])throw new Error("The `size` option must be one of 32, 64, 128, 256, 512, or 1024");if(typeof tr=="string"){if(ir)return fnv1aEncodeInto(tr,rr,ir);tr=cachedEncoder.encode(tr)}return fnv1aUint8Array(tr,rr)}const SUPPORTED_SIZES=[32,64,128,256,512,1024],LOG2_26=Math.log2(26);function hashNamespace(tr,rr=10,ir="fnv1a"){if(ir==="fnv1a"){const lr=Math.ceil(rr*LOG2_26),dr=SUPPORTED_SIZES.find(hr=>hr&&hr>=lr)??1024,fr=fnv1a(tr,{size:dr});return toBase26(fr,rr)}else throw new Error(`Unsupported hashing algorithm: ${ir}`)}function toBase26(tr,rr=10){const ir="abcdefghijklmnopqrstuvwxyz";let lr="";for(;tr>0n&&lr.length<rr;)lr=ir[Number(tr%26n)]+lr,tr/=26n;return lr.padStart(rr,"a")}function createRelationalDb(tr,rr){const ir=tr;return ir.createNamespace=(lr,dr)=>createNamespacedDb(tr,lr,dr??rr),ir.queryNamespace=(lr,dr)=>createNamespacedQueryBuilder(tr,lr,dr??rr),ir}async function createNamespacedDb(tr,rr,ir){const dr=(ir==null?void 0:ir.hashNamespace)??!0?hashNamespace(rr):rr;return await tr.schema.createSchema(dr).ifNotExists().execute(),tr.withSchema(dr)}function createNamespacedQueryBuilder(tr,rr,ir){const dr=(ir==null?void 0:ir.hashNamespace)??!0?hashNamespace(rr):rr,fr=tr.withSchema(dr);return relationalDbToQueryBuilder(fr)}function relationalDbToQueryBuilder(tr){return{selectFrom:tr.selectFrom.bind(tr),selectNoFrom:tr.selectNoFrom.bind(tr),with:tr.with.bind(tr),withRecursive:tr.withRecursive.bind(tr),withSchema:rr=>relationalDbToQueryBuilder(tr.withSchema(rr))}}function isRelationalDbProcessor(tr){return RelationalDbProcessor.is(tr)}const IS_RELATIONAL_DB_PROCESSOR=Symbol.for("ph.IS_RELATIONAL_DB_PROCESSOR");var Dd;Dd=IS_RELATIONAL_DB_PROCESSOR;class RelationalDbProcessor{constructor(rr,ir,lr){ki(this,"_namespace");ki(this,"_filter");ki(this,"relationalDb");this._namespace=rr,this._filter=ir,this.relationalDb=lr}static is(rr){var lr;let ir=Object.getPrototypeOf(rr);for(;ir;){if((lr=ir.constructor)!=null&&lr[IS_RELATIONAL_DB_PROCESSOR])return!0;ir=Object.getPrototypeOf(ir)}return!1}static getNamespace(rr){return`${this.name}_${rr.replaceAll("-","_")}`}static query(rr,ir){return ir.queryNamespace(this.getNamespace(rr))}get filter(){return this._filter}get namespace(){return this._namespace}get query(){return relationalDbToQueryBuilder(this.relationalDb)}}ki(RelationalDbProcessor,Dd,!0);class ProcessorManager{constructor(rr,ir){ki(this,"listeners");ki(this,"drive");ki(this,"logger",childLogger(["document-drive","processor-manager"]));ki(this,"processorsByDrive",new Map);ki(this,"idToFactory",new Map);ki(this,"identifierToListeners",new Map);this.listeners=rr,this.drive=ir}async registerFactory(rr,ir){this.logger.debug(`Registering factory '${rr}'.`),this.idToFactory.set(rr,ir);const lr=await this.drive.getDrives();for(const dr of lr)await this.createProcessors(dr,rr,ir)}async unregisterFactory(rr){var lr;const ir=this.identifierToListeners.get(rr)??[];for(const dr of ir)await this.listeners.removeListener(dr.driveId,dr.listenerId).catch(this.logger.error),(lr=dr.transmitter)!=null&&lr.disconnect&&await dr.transmitter.disconnect();this.identifierToListeners.set(rr,[])}async registerDrive(rr){this.logger.debug(`Registering drive '${rr}'.`);for(const[ir,lr]of this.idToFactory)await this.createProcessors(rr,ir,lr)}async createProcessors(rr,ir,lr){const dr=await this.drive.getDrive(rr);let fr=this.identifierToListeners.get(ir);fr||(fr=[],this.identifierToListeners.set(ir,fr));let hr=this.processorsByDrive.get(rr);hr||(hr=[],this.processorsByDrive.set(rr,hr));let mr=[];try{mr=await lr(dr.header)}catch(gr){this.logger.error(`Error creating processors for drive ${rr}:`,gr);return}for(const{filter:gr,processor:yr}of mr){const _r=isRelationalDbProcessor(yr);if(_r&&hr.some(wr=>isRelationalDbProcessor(wr.processor)&&wr.processor.namespace===yr.namespace)){this.logger.warn(`Processor with namespace '${yr.namespace}' already registered for drive '${rr}'.`);continue}_r&&await yr.initAndUpgrade();const br=generateId(),vr={driveId:rr,listenerId:br,block:!1,system:!1,filter:gr,callInfo:void 0,transmitter:new InternalTransmitter(this.drive,yr)};await this.listeners.setListener(rr,vr),fr.push(vr),hr.push({filter:gr,processor:yr})}}}let createNanoEvents=()=>({emit(tr,...rr){for(let ir=this.events[tr]||[],lr=0,dr=ir.length;lr<dr;lr++)ir[lr](...rr)},events:{},on(tr,rr){var ir;return((ir=this.events)[tr]||(ir[tr]=[])).push(rr),()=>{var lr;this.events[tr]=(lr=this.events[tr])==null?void 0:lr.filter(dr=>rr!==dr)}}});class MemoryQueue{constructor(rr){ki(this,"id");ki(this,"running",!1);ki(this,"deleted",!1);ki(this,"items",[]);ki(this,"dependencies",new Array);this.id=rr}async isRunning(){return this.running}async setRunning(rr){this.running=rr}async setDeleted(rr){this.deleted=rr}async isDeleted(){return this.deleted}async addJob(rr){return this.items.push(rr),Promise.resolve()}async getNextJob(){const rr=this.items.shift();return Promise.resolve(rr)}async amountOfJobs(){return Promise.resolve(this.items.length)}getId(){return this.id}async isBlocked(){return this.running||this.deleted||this.dependencies.length>0}async getJobs(){return this.items}async addDependency(rr){this.dependencies.includes(rr.jobId)||this.dependencies.push(rr.jobId)}async removeDependency(rr){const ir=this.dependencies.indexOf(rr.jobId);ir>-1&&this.dependencies.splice(ir,1)}}function isDocumentJob(tr){return"documentType"in tr}function isOperationJob(tr){return"operations"in tr}function isActionJob(tr){return"actions"in tr}class EventQueueManager{constructor(rr=1,ir=0){ki(this,"logger",childLogger(["EventQueueManager"]));ki(this,"emitter",createNanoEvents());ki(this,"queues",new Map);ki(this,"globalQueue",new Array);ki(this,"isFindingJob",!1);ki(this,"maxWorkers");ki(this,"workers");ki(this,"runningJobs",new Array);ki(this,"timeout");ki(this,"delegate");ki(this,"onError");this.maxWorkers=rr,this.workers=0,this.timeout=ir}async init(rr,ir){this.delegate=rr,this.onError=ir;function lr(dr){return(async(...fr)=>{try{await dr(...fr)}catch(hr){throw hr instanceof Error?hr:new Error(JSON.stringify(hr))}})}return this.emitter.on("jobAdded",lr(async dr=>{this.logger.verbose("Added job",dr),await this.processNextJob()})),this.emitter.on("jobStarted",lr(async dr=>{this.logger.verbose("Started job",dr.jobId),this.runningJobs.push(dr),await this.processNextJob()})),this.emitter.on("jobCompleted",lr(async(dr,fr)=>{this.logger.verbose("Completed job",dr.jobId),await this.handleJobCompleted(dr,fr)})),this.emitter.on("jobFailed",lr(async(dr,fr)=>{this.logger.error("Failed job",dr,fr),this.removeJob(dr),ir(fr),await this.processNextJob()})),Promise.resolve()}async addJob(rr){if(!this.delegate)throw new Error("No server delegate defined");const ir=generateId(),lr=isDocumentJob(rr),dr=isDocumentJob(rr)?void 0:isOperationJob(rr)?rr.operations:rr.actions;if(!lr&&!(dr!=null&&dr.length))throw new Error("Job has no operations or actions: "+JSON.stringify(rr));const fr=dr==null?void 0:dr.at(0),hr=fr?"action"in fr?fr.action.scope:fr.scope:"global";if(dr!=null&&dr.find(yr=>("action"in yr?yr.action.scope:yr.scope)!==hr))throw new Error("Job has actions with different scopes");const mr=this.getQueue(rr.documentId,hr);if(!isDocumentJob(rr)&&await mr.isDeleted())throw new Error("Job has operations for deleted document");const gr=Object.freeze({jobId:ir,...rr});return await mr.addJob(gr),this.globalQueue.push({jobId:ir,documentId:rr.documentId,scope:hr,timestampUtcMs:new Date().toUTCString()}),this.emit("jobAdded",gr),ir}getQueue(rr,ir){let lr=this.queues.get(rr);lr||(lr=new Map,this.queues.set(rr,lr));let dr=lr.get(ir);return dr||(dr=new MemoryQueue(ir),lr.set(ir,dr)),dr}getDocumentQueues(rr){return this.queues.get(rr)}removeQueue(rr,ir){const lr=this.queues.get(rr),dr=lr==null?void 0:lr.delete(ir);return dr&&this.emit("queueRemoved",{documentId:rr,scope:ir}),dr}removeDocumentQueues(rr){const ir=this.queues.get(rr);ir==null||ir.keys().forEach(lr=>{this.removeQueue(rr,lr)})}removeJob(rr){const ir=this.runningJobs.findIndex(dr=>dr.jobId===rr.jobId);ir===-1&&this.logger.warn("Running job not found",rr.jobId),this.runningJobs.splice(ir,1);const lr=this.globalQueue.findIndex(dr=>dr.jobId===rr.jobId);lr===-1&&this.logger.warn("Job not found on global queue",rr.jobId),this.globalQueue.splice(lr,1)}async handleJobCompleted(rr,ir){return this.removeJob(rr),this.processNextJob()}isBusy(){return this.workers>=this.maxWorkers}async processNextJob(){if(this.isFindingJob)return;if(!this.delegate)throw new Error("No server delegate defined");if(this.globalQueue.length===0||this.isBusy())return;this.isFindingJob=!0,this.workers++;let rr,ir;try{const lr=await this.findNextJob();rr=lr==null?void 0:lr.queue,ir=lr==null?void 0:lr.job}catch(lr){logger$6.error("Error finding next job",lr)}if(!rr||!ir){this.workers--,this.isFindingJob=!1;return}try{await rr.setRunning(!0),this.isFindingJob=!1,this.emit("jobStarted",ir);const lr=await this.delegate.processJob(ir);this.workers--,await rr.setRunning(!1),this.emit("jobCompleted",ir,lr)}catch(lr){logger$6.error("Job failed",lr),this.workers--,this.isFindingJob=!1,await rr.setRunning(!1),this.emit("jobFailed",ir,lr instanceof Error?lr:new Error(JSON.stringify(lr)))}}async findNextJob(){const rr=new Set;for(const ir of this.globalQueue){const lr=this.getQueue(ir.documentId,ir.scope),dr=lr.getId();if(rr.has(dr))continue;if(await lr.isBlocked()){rr.add(lr.getId());continue}const fr=await lr.getNextJob();if((fr==null?void 0:fr.jobId)!==ir.jobId){logger$6.warn("Queue has different job waiting to be picked up"),logger$6.error(ir,fr);continue}return{queue:lr,job:fr}}}emit(rr,...ir){this.emitter.emit(rr,...ir)}on(rr,ir){return this.emitter.on(rr,ir)}}class ReadDriveError extends Error{}class ReadDriveNotFoundError extends ReadDriveError{constructor(rr){super(`Read drive ${rr} not found.`)}}class ReadDriveSlugNotFoundError extends ReadDriveError{constructor(rr){super(`Read drive with slug ${rr} not found.`)}}class ReadDocumentNotFoundError extends ReadDriveError{constructor(rr,ir){super(`Document with id ${ir} not found on read drive ${rr}.`)}}function devAssert(tr,rr){if(!!!tr)throw new Error(rr)}function isObjectLike(tr){return typeof tr=="object"&&tr!==null}function invariant$1(tr,rr){if(!!!tr)throw new Error(rr??"Unexpected invariant triggered.")}const LineRegExp=/\r\n|[\n\r]/g;function getLocation(tr,rr){let ir=0,lr=1;for(const dr of tr.body.matchAll(LineRegExp)){if(typeof dr.index=="number"||invariant$1(!1),dr.index>=rr)break;ir=dr.index+dr[0].length,lr+=1}return{line:lr,column:rr+1-ir}}function printLocation(tr){return printSourceLocation(tr.source,getLocation(tr.source,tr.start))}function printSourceLocation(tr,rr){const ir=tr.locationOffset.column-1,lr="".padStart(ir)+tr.body,dr=rr.line-1,fr=tr.locationOffset.line-1,hr=rr.line+fr,mr=rr.line===1?ir:0,gr=rr.column+mr,yr=`${tr.name}:${hr}:${gr}
@@ -561,7 +561,7 @@ ${dr.message}`)}}validateConnection(dr){return dr&&!dr._fatalError&&!dr._protoco
561
561
  WHERE a.typcategory = 'A'
562
562
  GROUP BY b.oid, b.typarray
563
563
  ORDER BY b.oid
564
- `);for(let lr of ir.rows)this.serializers[lr.typarray]=dr=>Ke$1(dr,this.serializers[lr.oid],lr.typarray),this.parsers[lr.typarray]=dr=>yn(dr,this.parsers[lr.oid],lr.typarray)}async refreshArrayTypes(){await this._initArrayTypes({force:!0})}async query(rr,ir,lr){return await this._checkReady(),await this._runExclusiveTransaction(async()=>await T$1(this,r$1,g$2).call(this,rr,ir,lr))}async sql(rr,...ir){let{query:lr,params:dr}=g$3(rr,...ir);return await this.query(lr,dr)}async exec(rr,ir){return await this._checkReady(),await this._runExclusiveTransaction(async()=>await T$1(this,r$1,h$1).call(this,rr,ir))}async describeQuery(rr,ir){try{await T$1(this,r$1,l).call(this,O$2.parse({text:rr,types:ir==null?void 0:ir.paramTypes}),ir);let lr=await T$1(this,r$1,l).call(this,O$2.describe({type:"S"}),ir),dr=lr.messages.find(gr=>gr.name==="parameterDescription"),fr=lr.messages.find(gr=>gr.name==="rowDescription"),hr=(dr==null?void 0:dr.dataTypeIDs.map(gr=>({dataTypeID:gr,serializer:this.serializers[gr]})))??[],mr=(fr==null?void 0:fr.fields.map(gr=>({name:gr.name,dataTypeID:gr.dataTypeID,parser:this.parsers[gr.dataTypeID]})))??[];return{queryParams:hr,resultFields:mr}}finally{await T$1(this,r$1,l).call(this,O$2.sync(),ir)}}async transaction(rr){return await this._checkReady(),await this._runExclusiveTransaction(async()=>{await T$1(this,r$1,h$1).call(this,"BEGIN"),x$3(this,u$1,!0);let ir=!1,lr=()=>{if(ir)throw new Error("Transaction is closed")},dr={query:async(fr,hr,mr)=>(lr(),await T$1(this,r$1,g$2).call(this,fr,hr,mr)),sql:async(fr,...hr)=>{let{query:mr,params:gr}=g$3(fr,...hr);return await T$1(this,r$1,g$2).call(this,mr,gr)},exec:async(fr,hr)=>(lr(),await T$1(this,r$1,h$1).call(this,fr,hr)),rollback:async()=>{lr(),await T$1(this,r$1,h$1).call(this,"ROLLBACK"),ir=!0},get closed(){return ir}};try{let fr=await rr(dr);return ir||(ir=!0,await T$1(this,r$1,h$1).call(this,"COMMIT")),x$3(this,u$1,!1),fr}catch(fr){throw ir||await T$1(this,r$1,h$1).call(this,"ROLLBACK"),x$3(this,u$1,!1),fr}})}async runExclusive(rr){return await this._runExclusiveQuery(rr)}};b$1=new WeakMap,u$1=new WeakMap,r$1=new WeakSet,l=async function(tr,rr={}){return await this.execProtocol(tr,{...rr,syncToFs:!1})},g$2=async function(tr,rr=[],ir){return await this._runExclusiveQuery(async()=>{T$1(this,r$1,R$1).call(this,"runQuery",tr,rr,ir),await this._handleBlob(ir==null?void 0:ir.blob);let lr;try{let{messages:fr}=await T$1(this,r$1,l).call(this,O$2.parse({text:tr,types:ir==null?void 0:ir.paramTypes}),ir),hr=De((await T$1(this,r$1,l).call(this,O$2.describe({type:"S"}),ir)).messages),mr=rr.map((gr,yr)=>{var vr;let _r=hr[yr];if(gr==null)return null;let br=((vr=ir==null?void 0:ir.serializers)==null?void 0:vr[_r])??this.serializers[_r];return br?br(gr):gr.toString()});lr=[...fr,...(await T$1(this,r$1,l).call(this,O$2.bind({values:mr}),ir)).messages,...(await T$1(this,r$1,l).call(this,O$2.describe({type:"P"}),ir)).messages,...(await T$1(this,r$1,l).call(this,O$2.execute({}),ir)).messages]}finally{await T$1(this,r$1,l).call(this,O$2.sync(),ir)}await this._cleanupBlob(),h$2(this,u$1)||await this.syncToFs();let dr=await this._getWrittenBlob();return bn(lr,this.parsers,ir,dr)[0]})},h$1=async function(tr,rr){return await this._runExclusiveQuery(async()=>{T$1(this,r$1,R$1).call(this,"runExec",tr,rr),await this._handleBlob(rr==null?void 0:rr.blob);let ir;try{ir=(await T$1(this,r$1,l).call(this,O$2.query(tr),rr)).messages}finally{await T$1(this,r$1,l).call(this,O$2.sync(),rr)}this._cleanupBlob(),h$2(this,u$1)||await this.syncToFs();let lr=await this._getWrittenBlob();return bn(ir,this.parsers,rr,lr)})},R$1=function(...tr){this.debug>0&&console.log(...tr)};var w$1=D$3((tr,rr)=>{u$2();var ir=9007199254740991,lr=(function(Ir){return Ir})();function dr(Ir){return Ir===lr}function fr(Ir){return typeof Ir=="string"||Object.prototype.toString.call(Ir)=="[object String]"}function hr(Ir){return Object.prototype.toString.call(Ir)=="[object Date]"}function mr(Ir){return Ir!==null&&typeof Ir=="object"}function gr(Ir){return typeof Ir=="function"}function yr(Ir){return typeof Ir=="number"&&Ir>-1&&Ir%1==0&&Ir<=ir}function _r(Ir){return Object.prototype.toString.call(Ir)=="[object Array]"}function br(Ir){return mr(Ir)&&!gr(Ir)&&yr(Ir.length)}function vr(Ir){return Object.prototype.toString.call(Ir)=="[object ArrayBuffer]"}function wr(Ir,Mr){return Array.prototype.map.call(Ir,Mr)}function xr(Ir,Mr){var Or=lr;return gr(Mr)&&Array.prototype.every.call(Ir,function($r,Dr,zr){var Fr=Mr($r,Dr,zr);return Fr&&(Or=$r),!Fr}),Or}function Sr(Ir){return Object.assign.apply(null,arguments)}function Ar(Ir){var Mr,Or,$r;if(fr(Ir)){for(Or=Ir.length,$r=new Uint8Array(Or),Mr=0;Mr<Or;Mr++)$r[Mr]=Ir.charCodeAt(Mr)&255;return $r}return vr(Ir)?new Uint8Array(Ir):mr(Ir)&&vr(Ir.buffer)?new Uint8Array(Ir.buffer):br(Ir)?new Uint8Array(Ir):mr(Ir)&&gr(Ir.toString)?Ar(Ir.toString()):new Uint8Array}rr.exports.MAX_SAFE_INTEGER=ir,rr.exports.isUndefined=dr,rr.exports.isString=fr,rr.exports.isObject=mr,rr.exports.isDateTime=hr,rr.exports.isFunction=gr,rr.exports.isArray=_r,rr.exports.isArrayLike=br,rr.exports.isArrayBuffer=vr,rr.exports.map=wr,rr.exports.find=xr,rr.exports.extend=Sr,rr.exports.toUint8Array=Ar}),x$1=D$3((tr,rr)=>{u$2();var ir="\0";rr.exports={NULL_CHAR:ir,TMAGIC:"ustar"+ir+"00",OLDGNU_MAGIC:"ustar "+ir,REGTYPE:0,LNKTYPE:1,SYMTYPE:2,CHRTYPE:3,BLKTYPE:4,DIRTYPE:5,FIFOTYPE:6,CONTTYPE:7,TSUID:parseInt("4000",8),TSGID:parseInt("2000",8),TSVTX:parseInt("1000",8),TUREAD:parseInt("0400",8),TUWRITE:parseInt("0200",8),TUEXEC:parseInt("0100",8),TGREAD:parseInt("0040",8),TGWRITE:parseInt("0020",8),TGEXEC:parseInt("0010",8),TOREAD:parseInt("0004",8),TOWRITE:parseInt("0002",8),TOEXEC:parseInt("0001",8),TPERMALL:parseInt("0777",8),TPERMMASK:parseInt("0777",8)}}),L$1=D$3((tr,rr)=>{u$2();var ir=w$1(),lr=x$1(),dr=512,fr=lr.TPERMALL,hr=0,mr=0,gr=[["name",100,0,function(Mr,Or){return br(Mr[Or[0]],Or[1])},function(Mr,Or,$r){return xr(Mr.slice(Or,Or+$r[1]))}],["mode",8,100,function(Mr,Or){var $r=Mr[Or[0]]||fr;return $r=$r&lr.TPERMMASK,vr($r,Or[1],fr)},function(Mr,Or,$r){var Dr=Sr(Mr.slice(Or,Or+$r[1]));return Dr&=lr.TPERMMASK,Dr}],["uid",8,108,function(Mr,Or){return vr(Mr[Or[0]],Or[1],hr)},function(Mr,Or,$r){return Sr(Mr.slice(Or,Or+$r[1]))}],["gid",8,116,function(Mr,Or){return vr(Mr[Or[0]],Or[1],mr)},function(Mr,Or,$r){return Sr(Mr.slice(Or,Or+$r[1]))}],["size",12,124,function(Mr,Or){return vr(Mr.data.length,Or[1])},function(Mr,Or,$r){return Sr(Mr.slice(Or,Or+$r[1]))}],["modifyTime",12,136,function(Mr,Or){return wr(Mr[Or[0]],Or[1])},function(Mr,Or,$r){return Ar(Mr.slice(Or,Or+$r[1]))}],["checksum",8,148,function(Mr,Or){return" "},function(Mr,Or,$r){return Sr(Mr.slice(Or,Or+$r[1]))}],["type",1,156,function(Mr,Or){return""+(parseInt(Mr[Or[0]],10)||0)%8},function(Mr,Or,$r){return(parseInt(String.fromCharCode(Mr[Or]),10)||0)%8}],["linkName",100,157,function(Mr,Or){return""},function(Mr,Or,$r){return xr(Mr.slice(Or,Or+$r[1]))}],["ustar",8,257,function(Mr,Or){return lr.TMAGIC},function(Mr,Or,$r){return _r(xr(Mr.slice(Or,Or+$r[1]),!0))},function(Mr,Or){return Mr[Or[0]]==lr.TMAGIC||Mr[Or[0]]==lr.OLDGNU_MAGIC}],["owner",32,265,function(Mr,Or){return br(Mr[Or[0]],Or[1])},function(Mr,Or,$r){return xr(Mr.slice(Or,Or+$r[1]))}],["group",32,297,function(Mr,Or){return br(Mr[Or[0]],Or[1])},function(Mr,Or,$r){return xr(Mr.slice(Or,Or+$r[1]))}],["majorNumber",8,329,function(Mr,Or){return""},function(Mr,Or,$r){return Sr(Mr.slice(Or,Or+$r[1]))}],["minorNumber",8,337,function(Mr,Or){return""},function(Mr,Or,$r){return Sr(Mr.slice(Or,Or+$r[1]))}],["prefix",131,345,function(Mr,Or){return br(Mr[Or[0]],Or[1])},function(Mr,Or,$r){return xr(Mr.slice(Or,Or+$r[1]))}],["accessTime",12,476,function(Mr,Or){return wr(Mr[Or[0]],Or[1])},function(Mr,Or,$r){return Ar(Mr.slice(Or,Or+$r[1]))}],["createTime",12,488,function(Mr,Or){return wr(Mr[Or[0]],Or[1])},function(Mr,Or,$r){return Ar(Mr.slice(Or,Or+$r[1]))}]],yr=(function(Mr){var Or=Mr[Mr.length-1];return Or[2]+Or[1]})(gr);function _r(Mr){if(Mr.length==8){var Or=Mr.split("");if(Or[5]==lr.NULL_CHAR)return(Or[6]==" "||Or[6]==lr.NULL_CHAR)&&(Or[6]="0"),(Or[7]==" "||Or[7]==lr.NULL_CHAR)&&(Or[7]="0"),Or=Or.join(""),Or==lr.TMAGIC?Or:Mr;if(Or[7]==lr.NULL_CHAR)return Or[5]==lr.NULL_CHAR&&(Or[5]=" "),Or[6]==lr.NULL_CHAR&&(Or[6]=" "),Or==lr.OLDGNU_MAGIC?Or:Mr}return Mr}function br(Mr,Or){return Or-=1,ir.isUndefined(Mr)&&(Mr=""),Mr=(""+Mr).substr(0,Or),Mr+lr.NULL_CHAR}function vr(Mr,Or,$r){for($r=parseInt($r)||0,Or-=1,Mr=(parseInt(Mr)||$r).toString(8).substr(-Or,Or);Mr.length<Or;)Mr="0"+Mr;return Mr+lr.NULL_CHAR}function wr(Mr,Or){if(ir.isDateTime(Mr))Mr=Math.floor(1*Mr/1e3);else if(Mr=parseInt(Mr,10),isFinite(Mr)){if(Mr<=0)return""}else Mr=Math.floor(1*new Date/1e3);return vr(Mr,Or,0)}function xr(Mr,Or){var $r=String.fromCharCode.apply(null,Mr);if(Or)return $r;var Dr=$r.indexOf(lr.NULL_CHAR);return Dr>=0?$r.substr(0,Dr):$r}function Sr(Mr){var Or=String.fromCharCode.apply(null,Mr);return parseInt(Or.replace(/^0+$/g,""),8)||0}function Ar(Mr){return Mr.length==0||Mr[0]==0?null:new Date(1e3*Sr(Mr))}function Ir(Mr,Or,$r){var Dr=parseInt(Or,10)||0,zr=Math.min(Dr+yr,Mr.length),Fr=0,Jr=0,$n=0;$r&&gr.every(function(Xn){return Xn[0]=="checksum"?(Jr=Dr+Xn[2],$n=Jr+Xn[1],!1):!0});for(var Qr=32,Zn=Dr;Zn<zr;Zn++){var qn=Zn>=Jr&&Zn<$n?Qr:Mr[Zn];Fr=(Fr+qn)%262144}return Fr}rr.exports.recordSize=dr,rr.exports.defaultFileMode=fr,rr.exports.defaultUid=hr,rr.exports.defaultGid=mr,rr.exports.posixHeader=gr,rr.exports.effectiveHeaderSize=yr,rr.exports.calculateChecksum=Ir,rr.exports.formatTarString=br,rr.exports.formatTarNumber=vr,rr.exports.formatTarDateTime=wr,rr.exports.parseTarString=xr,rr.exports.parseTarNumber=Sr,rr.exports.parseTarDateTime=Ar}),er=D$3((tr,rr)=>{u$2();var ir=x$1(),lr=w$1(),dr=L$1();function fr(br){return dr.recordSize}function hr(br){return Math.ceil(br.data.length/dr.recordSize)*dr.recordSize}function mr(br){var vr=0;return br.forEach(function(wr){vr+=fr()+hr(wr)}),vr+=dr.recordSize*2,new Uint8Array(vr)}function gr(br,vr,wr){wr=parseInt(wr)||0;var xr=wr;dr.posixHeader.forEach(function(Or){for(var $r=Or[3](vr,Or),Dr=$r.length,zr=0;zr<Dr;zr+=1)br[xr+zr]=$r.charCodeAt(zr)&255;xr+=Or[1]});var Sr=lr.find(dr.posixHeader,function(Or){return Or[0]=="checksum"});if(Sr){var Ar=dr.calculateChecksum(br,wr,!0),Ir=dr.formatTarNumber(Ar,Sr[1]-2)+ir.NULL_CHAR+" ";xr=wr+Sr[2];for(var Mr=0;Mr<Ir.length;Mr+=1)br[xr]=Ir.charCodeAt(Mr)&255,xr++}return wr+fr()}function yr(br,vr,wr){return wr=parseInt(wr,10)||0,br.set(vr.data,wr),wr+hr(vr)}function _r(br){br=lr.map(br,function(xr){return lr.extend({},xr,{data:lr.toUint8Array(xr.data)})});var vr=mr(br),wr=0;return br.forEach(function(xr){wr=gr(vr,xr,wr),wr=yr(vr,xr,wr)}),vr}rr.exports.tar=_r}),nr=D$3((tr,rr)=>{u$2();var ir=x$1(),lr=w$1(),dr=L$1(),fr={extractData:!0,checkHeader:!0,checkChecksum:!0,checkFileSize:!0},hr={size:!0,checksum:!0,ustar:!0},mr={unexpectedEndOfFile:"Unexpected end of file.",fileCorrupted:"File is corrupted.",checksumCheckFailed:"Checksum check failed."};function gr(Sr){return dr.recordSize}function yr(Sr){return Math.ceil(Sr/dr.recordSize)*dr.recordSize}function _r(Sr,Ar){for(var Ir=Ar,Mr=Math.min(Sr.length,Ar+dr.recordSize*2),Or=Ir;Or<Mr;Or++)if(Sr[Or]!=0)return!1;return!0}function br(Sr,Ar,Ir){if(Sr.length-Ar<dr.recordSize){if(Ir.checkFileSize)throw new Error(mr.unexpectedEndOfFile);return null}Ar=parseInt(Ar)||0;var Mr={},Or=Ar;if(dr.posixHeader.forEach(function(zr){Mr[zr[0]]=zr[4](Sr,Or,zr),Or+=zr[1]}),Mr.type!=0&&(Mr.size=0),Ir.checkHeader&&dr.posixHeader.forEach(function(zr){if(lr.isFunction(zr[5])&&!zr[5](Mr,zr)){var Fr=new Error(mr.fileCorrupted);throw Fr.data={offset:Ar+zr[2],field:zr[0]},Fr}}),Ir.checkChecksum){var $r=dr.calculateChecksum(Sr,Ar,!0);if($r!=Mr.checksum){var Dr=new Error(mr.checksumCheckFailed);throw Dr.data={offset:Ar,header:Mr,checksum:$r},Dr}}return Mr}function vr(Sr,Ar,Ir,Mr){return Mr.extractData?Ir.size<=0?new Uint8Array:Sr.slice(Ar,Ar+Ir.size):null}function wr(Sr,Ar){var Ir={};return dr.posixHeader.forEach(function(Mr){var Or=Mr[0];hr[Or]||(Ir[Or]=Sr[Or])}),Ir.isOldGNUFormat=Sr.ustar==ir.OLDGNU_MAGIC,Ar&&(Ir.data=Ar),Ir}function xr(Sr,Ar){Ar=lr.extend({},fr,Ar);for(var Ir=[],Mr=0,Or=Sr.length;Or-Mr>=dr.recordSize;){Sr=lr.toUint8Array(Sr);var $r=br(Sr,Mr,Ar);if(!$r)break;Mr+=gr();var Dr=vr(Sr,Mr,$r,Ar);if(Ir.push(wr($r,Dr)),Mr+=yr($r.size),_r(Sr,Mr))break}return Ir}rr.exports.untar=xr}),or$2=D$3((tr,rr)=>{u$2();var ir=w$1(),lr=x$1(),dr=er(),fr=nr();ir.extend(rr.exports,dr,fr,lr)});u$2();u$2();var g$1=L$3(or$2());async function H$2(tr,rr,ir="pgdata",lr="auto"){let dr=Br(tr,rr),[fr,hr]=await qr(dr,lr),mr=ir+(hr?".tar.gz":".tar"),gr=hr?"application/x-gzip":"application/x-tar";return typeof File<"u"?new File([fr],mr,{type:gr}):new Blob([fr],{type:gr})}var Hr=["application/x-gtar","application/x-tar+gzip","application/x-gzip","application/gzip"];async function ce$1(tr,rr,ir){let lr=new Uint8Array(await rr.arrayBuffer()),dr=typeof File<"u"&&rr instanceof File?rr.name:void 0;(Hr.includes(rr.type)||dr!=null&&dr.endsWith(".tgz")||dr!=null&&dr.endsWith(".tar.gz"))&&(lr=await ar(lr));let fr;try{fr=(0,g$1.untar)(lr)}catch(hr){if(hr instanceof Error&&hr.message.includes("File is corrupted"))lr=await ar(lr),fr=(0,g$1.untar)(lr);else throw hr}for(let hr of fr){let mr=ir+hr.name,gr=mr.split("/").slice(0,-1);for(let yr=1;yr<=gr.length;yr++){let _r=gr.slice(0,yr).join("/");tr.analyzePath(_r).exists||tr.mkdir(_r)}hr.type===g$1.REGTYPE?(tr.writeFile(mr,hr.data),tr.utime(mr,sr(hr.modifyTime),sr(hr.modifyTime))):hr.type===g$1.DIRTYPE&&tr.mkdir(mr)}}function jr(tr,rr){let ir=[],lr=dr=>{tr.readdir(dr).forEach(fr=>{if(fr==="."||fr==="..")return;let hr=dr+"/"+fr,mr=tr.stat(hr),gr=tr.isFile(mr.mode)?tr.readFile(hr,{encoding:"binary"}):new Uint8Array(0);ir.push({name:hr.substring(rr.length),mode:mr.mode,size:mr.size,type:tr.isFile(mr.mode)?g$1.REGTYPE:g$1.DIRTYPE,modifyTime:mr.mtime,data:gr}),tr.isDir(mr.mode)&&lr(hr)})};return lr(rr),ir}function Br(tr,rr){let ir=jr(tr,rr);return(0,g$1.tar)(ir)}async function qr(tr,rr="auto"){if(rr==="none")return[tr,!1];if(typeof CompressionStream<"u")return[await Yr(tr),!0];if(typeof process<"u"&&process.versions&&process.versions.node)return[await Wr(tr),!0];if(rr==="auto")return[tr,!1];throw new Error("Compression not supported in this environment")}async function Yr(tr){let rr=new CompressionStream("gzip"),ir=rr.writable.getWriter(),lr=rr.readable.getReader();ir.write(tr),ir.close();let dr=[];for(;;){let{value:mr,done:gr}=await lr.read();if(gr)break;mr&&dr.push(mr)}let fr=new Uint8Array(dr.reduce((mr,gr)=>mr+gr.length,0)),hr=0;return dr.forEach(mr=>{fr.set(mr,hr),hr+=mr.length}),fr}async function Wr(tr){let{promisify:rr}=await __vitePreload(()=>Promise.resolve().then(()=>__viteBrowserExternal$1),void 0,import.meta.url),{gzip:ir}=await __vitePreload(async()=>{const{gzip:lr}=await Promise.resolve().then(()=>__viteBrowserExternal$1);return{gzip:lr}},void 0,import.meta.url);return await rr(ir)(tr)}async function ar(tr){if(typeof CompressionStream<"u")return await Xr(tr);if(typeof process<"u"&&process.versions&&process.versions.node)return await Kr(tr);throw new Error("Unsupported environment for decompression")}async function Xr(tr){let rr=new DecompressionStream("gzip"),ir=rr.writable.getWriter(),lr=rr.readable.getReader();ir.write(tr),ir.close();let dr=[];for(;;){let{value:mr,done:gr}=await lr.read();if(gr)break;mr&&dr.push(mr)}let fr=new Uint8Array(dr.reduce((mr,gr)=>mr+gr.length,0)),hr=0;return dr.forEach(mr=>{fr.set(mr,hr),hr+=mr.length}),fr}async function Kr(tr){let{promisify:rr}=await __vitePreload(()=>Promise.resolve().then(()=>__viteBrowserExternal$1),void 0,import.meta.url),{gunzip:ir}=await __vitePreload(async()=>{const{gunzip:lr}=await Promise.resolve().then(()=>__viteBrowserExternal$1);return{gunzip:lr}},void 0,import.meta.url);return await rr(ir)(tr)}function sr(tr){return tr?typeof tr=="number"?tr:Math.floor(tr.getTime()/1e3):Math.floor(Date.now()/1e3)}var Vr="/tmp/pglite",C$1=Vr+"/base",ur=class{constructor(tr){this.dataDir=tr}async init(tr,rr){return this.pg=tr,{emscriptenOpts:rr}}async syncToFs(tr){}async initialSyncFs(){}async closeFs(){}async dumpTar(tr,rr){return H$2(this.pg.Module.FS,C$1,tr,rr)}},cr=class{constructor(tr,{debug:rr=!1}={}){this.dataDir=tr,this.debug=rr}async syncToFs(tr){}async initialSyncFs(){}async closeFs(){}async dumpTar(tr,rr){return H$2(this.pg.Module.FS,C$1,tr,rr)}async init(tr,rr){return this.pg=tr,{emscriptenOpts:{...rr,preRun:[...rr.preRun||[],ir=>{let lr=Zr(ir,this);ir.FS.mkdir(C$1),ir.FS.mount(lr,{},C$1)}]}}}},pr={EBADF:8,EBADFD:127,EEXIST:20,EINVAL:28,EISDIR:31,ENODEV:43,ENOENT:44,ENOTDIR:54,ENOTEMPTY:55},Zr=(tr,rr)=>{let ir=tr.FS,lr=rr.debug?console.log:null,dr={tryFSOperation(fr){try{return fr()}catch(hr){throw hr.code?hr.code==="UNKNOWN"?new ir.ErrnoError(pr.EINVAL):new ir.ErrnoError(hr.code):hr}},mount(fr){return dr.createNode(null,"/",16895,0)},syncfs(fr,hr,mr){},createNode(fr,hr,mr,gr){if(!ir.isDir(mr)&&!ir.isFile(mr))throw new ir.ErrnoError(28);let yr=ir.createNode(fr,hr,mr);return yr.node_ops=dr.node_ops,yr.stream_ops=dr.stream_ops,yr},getMode:function(fr){return lr==null||lr("getMode",fr),dr.tryFSOperation(()=>rr.lstat(fr).mode)},realPath:function(fr){let hr=[];for(;fr.parent!==fr;)hr.push(fr.name),fr=fr.parent;return hr.push(fr.mount.opts.root),hr.reverse(),hr.join("/")},node_ops:{getattr(fr){lr==null||lr("getattr",dr.realPath(fr));let hr=dr.realPath(fr);return dr.tryFSOperation(()=>{let mr=rr.lstat(hr);return{...mr,dev:0,ino:fr.id,nlink:1,rdev:fr.rdev,atime:new Date(mr.atime),mtime:new Date(mr.mtime),ctime:new Date(mr.ctime)}})},setattr(fr,hr){lr==null||lr("setattr",dr.realPath(fr),hr);let mr=dr.realPath(fr);dr.tryFSOperation(()=>{hr.mode!==void 0&&rr.chmod(mr,hr.mode),hr.size!==void 0&&rr.truncate(mr,hr.size),hr.timestamp!==void 0&&rr.utimes(mr,hr.timestamp,hr.timestamp),hr.size!==void 0&&rr.truncate(mr,hr.size)})},lookup(fr,hr){lr==null||lr("lookup",dr.realPath(fr),hr);let mr=[dr.realPath(fr),hr].join("/"),gr=dr.getMode(mr);return dr.createNode(fr,hr,gr)},mknod(fr,hr,mr,gr){lr==null||lr("mknod",dr.realPath(fr),hr,mr,gr);let yr=dr.createNode(fr,hr,mr,gr),_r=dr.realPath(yr);return dr.tryFSOperation(()=>(ir.isDir(yr.mode)?rr.mkdir(_r,{mode:mr}):rr.writeFile(_r,"",{mode:mr}),yr))},rename(fr,hr,mr){lr==null||lr("rename",dr.realPath(fr),dr.realPath(hr),mr);let gr=dr.realPath(fr),yr=[dr.realPath(hr),mr].join("/");dr.tryFSOperation(()=>{rr.rename(gr,yr)}),fr.name=mr},unlink(fr,hr){lr==null||lr("unlink",dr.realPath(fr),hr);let mr=[dr.realPath(fr),hr].join("/");try{rr.unlink(mr)}catch{}},rmdir(fr,hr){lr==null||lr("rmdir",dr.realPath(fr),hr);let mr=[dr.realPath(fr),hr].join("/");return dr.tryFSOperation(()=>{rr.rmdir(mr)})},readdir(fr){lr==null||lr("readdir",dr.realPath(fr));let hr=dr.realPath(fr);return dr.tryFSOperation(()=>rr.readdir(hr))},symlink(fr,hr,mr){throw lr==null||lr("symlink",dr.realPath(fr),hr,mr),new ir.ErrnoError(63)},readlink(fr){throw lr==null||lr("readlink",dr.realPath(fr)),new ir.ErrnoError(63)}},stream_ops:{open(fr){lr==null||lr("open stream",dr.realPath(fr.node));let hr=dr.realPath(fr.node);return dr.tryFSOperation(()=>{ir.isFile(fr.node.mode)&&(fr.shared.refcount=1,fr.nfd=rr.open(hr))})},close(fr){return lr==null||lr("close stream",dr.realPath(fr.node)),dr.tryFSOperation(()=>{ir.isFile(fr.node.mode)&&fr.nfd&&--fr.shared.refcount===0&&rr.close(fr.nfd)})},dup(fr){lr==null||lr("dup stream",dr.realPath(fr.node)),fr.shared.refcount++},read(fr,hr,mr,gr,yr){return lr==null||lr("read stream",dr.realPath(fr.node),mr,gr,yr),gr===0?0:dr.tryFSOperation(()=>rr.read(fr.nfd,hr,mr,gr,yr))},write(fr,hr,mr,gr,yr){return lr==null||lr("write stream",dr.realPath(fr.node),mr,gr,yr),dr.tryFSOperation(()=>rr.write(fr.nfd,hr.buffer,mr,gr,yr))},llseek(fr,hr,mr){lr==null||lr("llseek stream",dr.realPath(fr.node),hr,mr);let gr=hr;if(mr===1?gr+=fr.position:mr===2&&ir.isFile(fr.node.mode)&&dr.tryFSOperation(()=>{let yr=rr.fstat(fr.nfd);gr+=yr.size}),gr<0)throw new ir.ErrnoError(28);return gr},mmap(fr,hr,mr,gr,yr){if(lr==null||lr("mmap stream",dr.realPath(fr.node),hr,mr,gr,yr),!ir.isFile(fr.node.mode))throw new ir.ErrnoError(pr.ENODEV);let _r=tr.mmapAlloc(hr);return dr.stream_ops.read(fr,tr.HEAP8,_r,hr,mr),{ptr:_r,allocated:!0}},msync(fr,hr,mr,gr,yr){return lr==null||lr("msync stream",dr.realPath(fr.node),mr,gr,yr),dr.stream_ops.write(fr,hr,0,gr,mr),0}}};return dr};u$2();u$2();u$2();var He=new Error("request for lock canceled"),We=function(tr,rr,ir,lr){function dr(fr){return fr instanceof ir?fr:new ir(function(hr){hr(fr)})}return new(ir||(ir=Promise))(function(fr,hr){function mr(_r){try{yr(lr.next(_r))}catch(br){hr(br)}}function gr(_r){try{yr(lr.throw(_r))}catch(br){hr(br)}}function yr(_r){_r.done?fr(_r.value):dr(_r.value).then(mr,gr)}yr((lr=lr.apply(tr,[])).next())})},ce=class{constructor(tr,rr=He){this._value=tr,this._cancelError=rr,this._weightedQueues=[],this._weightedWaiters=[]}acquire(tr=1){if(tr<=0)throw new Error(`invalid weight ${tr}: must be positive`);return new Promise((rr,ir)=>{this._weightedQueues[tr-1]||(this._weightedQueues[tr-1]=[]),this._weightedQueues[tr-1].push({resolve:rr,reject:ir}),this._dispatch()})}runExclusive(tr,rr=1){return We(this,void 0,void 0,function*(){let[ir,lr]=yield this.acquire(rr);try{return yield tr(ir)}finally{lr()}})}waitForUnlock(tr=1){if(tr<=0)throw new Error(`invalid weight ${tr}: must be positive`);return new Promise(rr=>{this._weightedWaiters[tr-1]||(this._weightedWaiters[tr-1]=[]),this._weightedWaiters[tr-1].push(rr),this._dispatch()})}isLocked(){return this._value<=0}getValue(){return this._value}setValue(tr){this._value=tr,this._dispatch()}release(tr=1){if(tr<=0)throw new Error(`invalid weight ${tr}: must be positive`);this._value+=tr,this._dispatch()}cancel(){this._weightedQueues.forEach(tr=>tr.forEach(rr=>rr.reject(this._cancelError))),this._weightedQueues=[]}_dispatch(){var tr;for(let rr=this._value;rr>0;rr--){let ir=(tr=this._weightedQueues[rr-1])===null||tr===void 0?void 0:tr.shift();if(!ir)continue;let lr=this._value,dr=rr;this._value-=rr,rr=this._value+1,ir.resolve([lr,this._newReleaser(dr)])}this._drainUnlockWaiters()}_newReleaser(tr){let rr=!1;return()=>{rr||(rr=!0,this.release(tr))}}_drainUnlockWaiters(){for(let tr=this._value;tr>0;tr--)this._weightedWaiters[tr-1]&&(this._weightedWaiters[tr-1].forEach(rr=>rr()),this._weightedWaiters[tr-1]=[])}},je=function(tr,rr,ir,lr){function dr(fr){return fr instanceof ir?fr:new ir(function(hr){hr(fr)})}return new(ir||(ir=Promise))(function(fr,hr){function mr(_r){try{yr(lr.next(_r))}catch(br){hr(br)}}function gr(_r){try{yr(lr.throw(_r))}catch(br){hr(br)}}function yr(_r){_r.done?fr(_r.value):dr(_r.value).then(mr,gr)}yr((lr=lr.apply(tr,[])).next())})},H$1=class{constructor(rr){this._semaphore=new ce(1,rr)}acquire(){return je(this,void 0,void 0,function*(){let[,rr]=yield this._semaphore.acquire();return rr})}runExclusive(rr){return this._semaphore.runExclusive(()=>rr())}isLocked(){return this._semaphore.isLocked()}waitForUnlock(){return this._semaphore.waitForUnlock()}release(){this._semaphore.isLocked()&&this._semaphore.release()}cancel(){return this._semaphore.cancel()}};u$2();var Ie=L$3(or$2());async function ge(tr){if(Fe$1){let rr=await __vitePreload(()=>Promise.resolve().then(()=>__viteBrowserExternal$1),void 0,import.meta.url),ir=await __vitePreload(()=>Promise.resolve().then(()=>__viteBrowserExternal$1),void 0,import.meta.url),{Writable:lr}=await __vitePreload(async()=>{const{Writable:mr}=await Promise.resolve().then(()=>__viteBrowserExternal$1);return{Writable:mr}},void 0,import.meta.url),{pipeline:dr}=await __vitePreload(async()=>{const{pipeline:mr}=await Promise.resolve().then(()=>__viteBrowserExternal$1);return{pipeline:mr}},void 0,import.meta.url);if(!rr.existsSync(tr))throw new Error(`Extension bundle not found: ${tr}`);let fr=ir.createGunzip(),hr=[];return await dr(rr.createReadStream(tr),fr,new lr({write(mr,gr,yr){hr.push(mr),yr()}})),new Blob(hr)}else{let rr=await fetch(tr.toString());if(!rr.ok||!rr.body)return null;if(rr.headers.get("Content-Encoding")==="gzip")return rr.blob();{let ir=new DecompressionStream("gzip");return new Response(rr.body.pipeThrough(ir)).blob()}}}async function Pe(tr,rr){for(let ir in tr.pg_extensions){let lr;try{lr=await tr.pg_extensions[ir]}catch(dr){console.error("Failed to fetch extension:",ir,dr);continue}if(lr){let dr=new Uint8Array(await lr.arrayBuffer());Ve(tr,ir,dr,rr)}else console.error("Could not get binary data for extension:",ir)}}function Ve(tr,rr,ir,lr){Ie.default.untar(ir).forEach(dr=>{if(!dr.name.startsWith(".")){let fr=tr.WASM_PREFIX+"/"+dr.name;if(dr.name.endsWith(".so")){let hr=(...gr)=>{lr("pgfs:ext OK",fr,gr)},mr=(...gr)=>{lr("pgfs:ext FAIL",fr,gr)};tr.FS.createPreloadedFile(Ke(fr),dr.name.split("/").pop().slice(0,-3),dr.data,!0,!0,hr,mr,!1)}else tr.FS.writeFile(fr,dr.data)}})}function Ke(tr){let rr=tr.lastIndexOf("/");return rr>0?tr.slice(0,rr):tr}u$2();u$2();var ee=class extends ur{async init(tr,rr){return this.pg=tr,{emscriptenOpts:{...rr,preRun:[...rr.preRun||[],ir=>{let lr=ir.FS.filesystems.IDBFS;ir.FS.mkdir("/pglite"),ir.FS.mkdir(`/pglite/${this.dataDir}`),ir.FS.mount(lr,{},`/pglite/${this.dataDir}`),ir.FS.symlink(`/pglite/${this.dataDir}`,C$1)}]}}}initialSyncFs(){return new Promise((tr,rr)=>{this.pg.Module.FS.syncfs(!0,ir=>{ir?rr(ir):tr()})})}syncToFs(tr){return new Promise((rr,ir)=>{this.pg.Module.FS.syncfs(!1,lr=>{lr?ir(lr):rr()})})}async closeFs(){let tr=this.pg.Module.FS.filesystems.IDBFS.dbs[this.dataDir];tr&&tr.close(),this.pg.Module.FS.quit()}};u$2();var te=class extends ur{async closeFs(){this.pg.Module.FS.quit()}};function Fe(tr){let rr;if(tr!=null&&tr.startsWith("file://")){if(tr=tr.slice(7),!tr)throw new Error("Invalid dataDir, must be a valid path");rr="nodefs"}else tr!=null&&tr.startsWith("idb://")?(tr=tr.slice(6),rr="idbfs"):tr!=null&&tr.startsWith("opfs-ahp://")?(tr=tr.slice(11),rr="opfs-ahp"):!tr||tr!=null&&tr.startsWith("memory://")?rr="memoryfs":rr="nodefs";return{dataDir:tr,fsType:rr}}async function Ae(tr,rr){let ir;if(tr&&rr==="nodefs"){let{NodeFS:lr}=await __vitePreload(()=>import("./nodefs.BpF1PLlt.js"),[],import.meta.url);ir=new lr(tr)}else if(tr&&rr==="idbfs")ir=new ee(tr);else if(tr&&rr==="opfs-ahp"){let{OpfsAhpFS:lr}=await __vitePreload(()=>import("./opfs-ahp.BCWCVPBr.js"),[],import.meta.url);ir=new lr(tr)}else ir=new te;return ir}u$2();u$2();var Qe=(()=>{var _scriptName=import.meta.url;return async function(moduleArg={}){var moduleRtn,Module=moduleArg,readyPromiseResolve,readyPromiseReject,readyPromise=new Promise((tr,rr)=>{readyPromiseResolve=tr,readyPromiseReject=rr}),ENVIRONMENT_IS_WEB=typeof window=="object",ENVIRONMENT_IS_WORKER=typeof WorkerGlobalScope<"u",ENVIRONMENT_IS_NODE=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string"&&process.type!="renderer";if(ENVIRONMENT_IS_NODE){let{createRequire:tr}=await __vitePreload(()=>Promise.resolve().then(()=>__viteBrowserExternal$1),void 0,import.meta.url),rr=import.meta.url;rr.startsWith("data:")&&(rr="/");var require=tr(rr)}Module.expectedDataFileDownloads??(Module.expectedDataFileDownloads=0),Module.expectedDataFileDownloads++,(()=>{var tr=typeof ENVIRONMENT_IS_PTHREAD<"u"&&ENVIRONMENT_IS_PTHREAD,rr=typeof ENVIRONMENT_IS_WASM_WORKER<"u"&&ENVIRONMENT_IS_WASM_WORKER;if(tr||rr)return;var ir=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string";function lr(dr){typeof window=="object"?window.encodeURIComponent(window.location.pathname.substring(0,window.location.pathname.lastIndexOf("/"))+"/"):typeof process>"u"&&typeof location<"u"&&encodeURIComponent(location.pathname.substring(0,location.pathname.lastIndexOf("/"))+"/");var fr="postgres.data",hr="postgres.data",mr=Module.locateFile?Module.locateFile(hr,""):hr,gr=dr.remote_package_size;function yr(xr,Sr,Ar,Ir){if(ir){require("fs").readFile(xr,(Mr,Or)=>{Mr?Ir(Mr):Ar(Or.buffer)});return}Module.dataFileDownloads??(Module.dataFileDownloads={}),fetch(xr).catch(Mr=>Promise.reject(new Error(`Network Error: ${xr}`,{cause:Mr}))).then(Mr=>{var Qr;if(!Mr.ok)return Promise.reject(new Error(`${Mr.status}: ${Mr.url}`));if(!Mr.body&&Mr.arrayBuffer)return Mr.arrayBuffer().then(Ar);let Or=Mr.body.getReader(),$r=()=>Or.read().then($n).catch(Zn=>Promise.reject(new Error(`Unexpected error while handling : ${Mr.url} ${Zn}`,{cause:Zn}))),Dr=[],zr=Mr.headers,Fr=Number(zr.get("Content-Length")??Sr),Jr=0,$n=({done:Zn,value:qn})=>{var Xn;if(Zn){let Lr=new Uint8Array(Dr.map(Hn=>Hn.length).reduce((Hn,ii)=>Hn+ii,0)),Gr=0;for(let Hn of Dr)Lr.set(Hn,Gr),Gr+=Hn.length;Ar(Lr.buffer)}else{Dr.push(qn),Jr+=qn.length,Module.dataFileDownloads[xr]={loaded:Jr,total:Fr};let Lr=0,Gr=0;for(let Hn of Object.values(Module.dataFileDownloads))Lr+=Hn.loaded,Gr+=Hn.total;return(Xn=Module.setStatus)==null||Xn.call(Module,`Downloading data... (${Lr}/${Gr})`),$r()}};return(Qr=Module.setStatus)==null||Qr.call(Module,"Downloading data..."),$r()})}function _r(xr){console.error("package error:",xr)}var br=null,vr=Module.getPreloadedPackage?Module.getPreloadedPackage(mr,gr):null;vr||yr(mr,gr,xr=>{br?(br(xr),br=null):vr=xr},_r);function wr(xr){function Sr($r,Dr){if(!$r)throw Dr+new Error().stack}xr.FS_createPath("/","home",!0,!0),xr.FS_createPath("/home","web_user",!0,!0),xr.FS_createPath("/","tmp",!0,!0),xr.FS_createPath("/tmp","pglite",!0,!0),xr.FS_createPath("/tmp/pglite","bin",!0,!0),xr.FS_createPath("/tmp/pglite","lib",!0,!0),xr.FS_createPath("/tmp/pglite/lib","postgresql",!0,!0),xr.FS_createPath("/tmp/pglite/lib/postgresql","pgxs",!0,!0),xr.FS_createPath("/tmp/pglite/lib/postgresql/pgxs","config",!0,!0),xr.FS_createPath("/tmp/pglite/lib/postgresql/pgxs","src",!0,!0),xr.FS_createPath("/tmp/pglite/lib/postgresql/pgxs/src","makefiles",!0,!0),xr.FS_createPath("/tmp/pglite/lib/postgresql/pgxs/src","test",!0,!0),xr.FS_createPath("/tmp/pglite/lib/postgresql/pgxs/src/test","isolation",!0,!0),xr.FS_createPath("/tmp/pglite/lib/postgresql/pgxs/src/test","regress",!0,!0),xr.FS_createPath("/tmp/pglite","share",!0,!0),xr.FS_createPath("/tmp/pglite/share","postgresql",!0,!0),xr.FS_createPath("/tmp/pglite/share/postgresql","extension",!0,!0),xr.FS_createPath("/tmp/pglite/share/postgresql","timezone",!0,!0),xr.FS_createPath("/tmp/pglite/share/postgresql/timezone","Africa",!0,!0),xr.FS_createPath("/tmp/pglite/share/postgresql/timezone","America",!0,!0),xr.FS_createPath("/tmp/pglite/share/postgresql/timezone/America","Argentina",!0,!0),xr.FS_createPath("/tmp/pglite/share/postgresql/timezone/America","Indiana",!0,!0),xr.FS_createPath("/tmp/pglite/share/postgresql/timezone/America","Kentucky",!0,!0),xr.FS_createPath("/tmp/pglite/share/postgresql/timezone/America","North_Dakota",!0,!0),xr.FS_createPath("/tmp/pglite/share/postgresql/timezone","Antarctica",!0,!0),xr.FS_createPath("/tmp/pglite/share/postgresql/timezone","Arctic",!0,!0),xr.FS_createPath("/tmp/pglite/share/postgresql/timezone","Asia",!0,!0),xr.FS_createPath("/tmp/pglite/share/postgresql/timezone","Atlantic",!0,!0),xr.FS_createPath("/tmp/pglite/share/postgresql/timezone","Australia",!0,!0),xr.FS_createPath("/tmp/pglite/share/postgresql/timezone","Brazil",!0,!0),xr.FS_createPath("/tmp/pglite/share/postgresql/timezone","Canada",!0,!0),xr.FS_createPath("/tmp/pglite/share/postgresql/timezone","Chile",!0,!0),xr.FS_createPath("/tmp/pglite/share/postgresql/timezone","Etc",!0,!0),xr.FS_createPath("/tmp/pglite/share/postgresql/timezone","Europe",!0,!0),xr.FS_createPath("/tmp/pglite/share/postgresql/timezone","Indian",!0,!0),xr.FS_createPath("/tmp/pglite/share/postgresql/timezone","Mexico",!0,!0),xr.FS_createPath("/tmp/pglite/share/postgresql/timezone","Pacific",!0,!0),xr.FS_createPath("/tmp/pglite/share/postgresql/timezone","US",!0,!0),xr.FS_createPath("/tmp/pglite/share/postgresql","timezonesets",!0,!0),xr.FS_createPath("/tmp/pglite/share/postgresql","tsearch_data",!0,!0);function Ar($r,Dr,zr){this.start=$r,this.end=Dr,this.audio=zr}Ar.prototype={requests:{},open:function($r,Dr){this.name=Dr,this.requests[Dr]=this,xr.addRunDependency(`fp ${this.name}`)},send:function(){},onload:function(){var $r=this.byteArray.subarray(this.start,this.end);this.finish($r)},finish:function($r){var Dr=this;xr.FS_createDataFile(this.name,null,$r,!0,!0,!0),xr.removeRunDependency(`fp ${Dr.name}`),this.requests[this.name]=null}};for(var Ir=dr.files,Mr=0;Mr<Ir.length;++Mr)new Ar(Ir[Mr].start,Ir[Mr].end,Ir[Mr].audio||0).open("GET",Ir[Mr].filename);function Or($r){Sr($r,"Loading data file failed."),Sr($r.constructor.name===ArrayBuffer.name,"bad input to processPackageData");var Dr=new Uint8Array($r);Ar.prototype.byteArray=Dr;for(var zr=dr.files,Fr=0;Fr<zr.length;++Fr)Ar.prototype.requests[zr[Fr].filename].onload();xr.removeRunDependency("datafile_postgres.data")}xr.addRunDependency("datafile_postgres.data"),xr.preloadResults??(xr.preloadResults={}),xr.preloadResults[fr]={fromCache:!1},vr?(Or(vr),vr=null):br=Or}Module.calledRun?wr(Module):(Module.preRun??(Module.preRun=[])).push(wr)}lr({files:[{filename:"/home/web_user/.pgpass",start:0,end:204},{filename:"/tmp/pglite/bin/initdb",start:204,end:216},{filename:"/tmp/pglite/bin/postgres",start:216,end:228},{filename:"/tmp/pglite/lib/postgresql/cyrillic_and_mic.so",start:228,end:20397},{filename:"/tmp/pglite/lib/postgresql/dict_snowball.so",start:20397,end:1581299},{filename:"/tmp/pglite/lib/postgresql/euc2004_sjis2004.so",start:1581299,end:1592382},{filename:"/tmp/pglite/lib/postgresql/euc_cn_and_mic.so",start:1592382,end:1599256},{filename:"/tmp/pglite/lib/postgresql/euc_jp_and_sjis.so",start:1599256,end:1622931},{filename:"/tmp/pglite/lib/postgresql/euc_kr_and_mic.so",start:1622931,end:1630057},{filename:"/tmp/pglite/lib/postgresql/euc_tw_and_big5.so",start:1630057,end:1651566},{filename:"/tmp/pglite/lib/postgresql/latin2_and_win1250.so",start:1651566,end:1660345},{filename:"/tmp/pglite/lib/postgresql/latin_and_mic.so",start:1660345,end:1668272},{filename:"/tmp/pglite/lib/postgresql/libpqwalreceiver.so",start:1668272,end:2186522},{filename:"/tmp/pglite/lib/postgresql/pgoutput.so",start:2186522,end:2303364},{filename:"/tmp/pglite/lib/postgresql/pgxs/config/install-sh",start:2303364,end:2317361},{filename:"/tmp/pglite/lib/postgresql/pgxs/config/missing",start:2317361,end:2318709},{filename:"/tmp/pglite/lib/postgresql/pgxs/src/Makefile.global",start:2318709,end:2354956},{filename:"/tmp/pglite/lib/postgresql/pgxs/src/Makefile.port",start:2354956,end:2355232},{filename:"/tmp/pglite/lib/postgresql/pgxs/src/Makefile.shlib",start:2355232,end:2371270},{filename:"/tmp/pglite/lib/postgresql/pgxs/src/makefiles/pgxs.mk",start:2371270,end:2386198},{filename:"/tmp/pglite/lib/postgresql/pgxs/src/nls-global.mk",start:2386198,end:2393083},{filename:"/tmp/pglite/lib/postgresql/pgxs/src/test/isolation/isolationtester.cjs",start:2393083,end:2589770},{filename:"/tmp/pglite/lib/postgresql/pgxs/src/test/isolation/pg_isolation_regress.cjs",start:2589770,end:2742128},{filename:"/tmp/pglite/lib/postgresql/pgxs/src/test/regress/pg_regress.cjs",start:2742128,end:2894476},{filename:"/tmp/pglite/lib/postgresql/plpgsql.so",start:2894476,end:3653241},{filename:"/tmp/pglite/password",start:3653241,end:3653250},{filename:"/tmp/pglite/share/postgresql/errcodes.txt",start:3653250,end:3686708},{filename:"/tmp/pglite/share/postgresql/extension/plpgsql--1.0.sql",start:3686708,end:3687366},{filename:"/tmp/pglite/share/postgresql/extension/plpgsql.control",start:3687366,end:3687559},{filename:"/tmp/pglite/share/postgresql/fix-CVE-2024-4317.sql",start:3687559,end:3693324},{filename:"/tmp/pglite/share/postgresql/information_schema.sql",start:3693324,end:3808299},{filename:"/tmp/pglite/share/postgresql/pg_hba.conf.sample",start:3808299,end:3813924},{filename:"/tmp/pglite/share/postgresql/pg_ident.conf.sample",start:3813924,end:3816564},{filename:"/tmp/pglite/share/postgresql/pg_service.conf.sample",start:3816564,end:3817168},{filename:"/tmp/pglite/share/postgresql/postgres.bki",start:3817168,end:4761272},{filename:"/tmp/pglite/share/postgresql/postgresql.conf.sample",start:4761272,end:4790919},{filename:"/tmp/pglite/share/postgresql/psqlrc.sample",start:4790919,end:4791197},{filename:"/tmp/pglite/share/postgresql/snowball_create.sql",start:4791197,end:4835373},{filename:"/tmp/pglite/share/postgresql/sql_features.txt",start:4835373,end:4871054},{filename:"/tmp/pglite/share/postgresql/system_constraints.sql",start:4871054,end:4879949},{filename:"/tmp/pglite/share/postgresql/system_functions.sql",start:4879949,end:4903264},{filename:"/tmp/pglite/share/postgresql/system_views.sql",start:4903264,end:4953537},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Abidjan",start:4953537,end:4953667},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Accra",start:4953667,end:4953797},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Addis_Ababa",start:4953797,end:4953988},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Algiers",start:4953988,end:4954458},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Asmara",start:4954458,end:4954649},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Asmera",start:4954649,end:4954840},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Bamako",start:4954840,end:4954970},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Bangui",start:4954970,end:4955150},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Banjul",start:4955150,end:4955280},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Bissau",start:4955280,end:4955429},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Blantyre",start:4955429,end:4955560},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Brazzaville",start:4955560,end:4955740},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Bujumbura",start:4955740,end:4955871},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Cairo",start:4955871,end:4957180},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Casablanca",start:4957180,end:4959099},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Ceuta",start:4959099,end:4959661},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Conakry",start:4959661,end:4959791},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Dakar",start:4959791,end:4959921},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Dar_es_Salaam",start:4959921,end:4960112},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Djibouti",start:4960112,end:4960303},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Douala",start:4960303,end:4960483},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/El_Aaiun",start:4960483,end:4962313},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Freetown",start:4962313,end:4962443},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Gaborone",start:4962443,end:4962574},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Harare",start:4962574,end:4962705},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Johannesburg",start:4962705,end:4962895},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Juba",start:4962895,end:4963353},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Kampala",start:4963353,end:4963544},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Khartoum",start:4963544,end:4964002},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Kigali",start:4964002,end:4964133},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Kinshasa",start:4964133,end:4964313},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Lagos",start:4964313,end:4964493},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Libreville",start:4964493,end:4964673},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Lome",start:4964673,end:4964803},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Luanda",start:4964803,end:4964983},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Lubumbashi",start:4964983,end:4965114},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Lusaka",start:4965114,end:4965245},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Malabo",start:4965245,end:4965425},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Maputo",start:4965425,end:4965556},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Maseru",start:4965556,end:4965746},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Mbabane",start:4965746,end:4965936},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Mogadishu",start:4965936,end:4966127},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Monrovia",start:4966127,end:4966291},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Nairobi",start:4966291,end:4966482},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Ndjamena",start:4966482,end:4966642},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Niamey",start:4966642,end:4966822},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Nouakchott",start:4966822,end:4966952},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Ouagadougou",start:4966952,end:4967082},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Porto-Novo",start:4967082,end:4967262},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Sao_Tome",start:4967262,end:4967435},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Timbuktu",start:4967435,end:4967565},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Tripoli",start:4967565,end:4967996},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Tunis",start:4967996,end:4968445},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Windhoek",start:4968445,end:4969083},{filename:"/tmp/pglite/share/postgresql/timezone/America/Adak",start:4969083,end:4970052},{filename:"/tmp/pglite/share/postgresql/timezone/America/Anchorage",start:4970052,end:4971029},{filename:"/tmp/pglite/share/postgresql/timezone/America/Anguilla",start:4971029,end:4971206},{filename:"/tmp/pglite/share/postgresql/timezone/America/Antigua",start:4971206,end:4971383},{filename:"/tmp/pglite/share/postgresql/timezone/America/Araguaina",start:4971383,end:4971975},{filename:"/tmp/pglite/share/postgresql/timezone/America/Argentina/Buenos_Aires",start:4971975,end:4972683},{filename:"/tmp/pglite/share/postgresql/timezone/America/Argentina/Catamarca",start:4972683,end:4973391},{filename:"/tmp/pglite/share/postgresql/timezone/America/Argentina/ComodRivadavia",start:4973391,end:4974099},{filename:"/tmp/pglite/share/postgresql/timezone/America/Argentina/Cordoba",start:4974099,end:4974807},{filename:"/tmp/pglite/share/postgresql/timezone/America/Argentina/Jujuy",start:4974807,end:4975497},{filename:"/tmp/pglite/share/postgresql/timezone/America/Argentina/La_Rioja",start:4975497,end:4976214},{filename:"/tmp/pglite/share/postgresql/timezone/America/Argentina/Mendoza",start:4976214,end:4976922},{filename:"/tmp/pglite/share/postgresql/timezone/America/Argentina/Rio_Gallegos",start:4976922,end:4977630},{filename:"/tmp/pglite/share/postgresql/timezone/America/Argentina/Salta",start:4977630,end:4978320},{filename:"/tmp/pglite/share/postgresql/timezone/America/Argentina/San_Juan",start:4978320,end:4979037},{filename:"/tmp/pglite/share/postgresql/timezone/America/Argentina/San_Luis",start:4979037,end:4979754},{filename:"/tmp/pglite/share/postgresql/timezone/America/Argentina/Tucuman",start:4979754,end:4980480},{filename:"/tmp/pglite/share/postgresql/timezone/America/Argentina/Ushuaia",start:4980480,end:4981188},{filename:"/tmp/pglite/share/postgresql/timezone/America/Aruba",start:4981188,end:4981365},{filename:"/tmp/pglite/share/postgresql/timezone/America/Asuncion",start:4981365,end:4982249},{filename:"/tmp/pglite/share/postgresql/timezone/America/Atikokan",start:4982249,end:4982398},{filename:"/tmp/pglite/share/postgresql/timezone/America/Atka",start:4982398,end:4983367},{filename:"/tmp/pglite/share/postgresql/timezone/America/Bahia",start:4983367,end:4984049},{filename:"/tmp/pglite/share/postgresql/timezone/America/Bahia_Banderas",start:4984049,end:4984777},{filename:"/tmp/pglite/share/postgresql/timezone/America/Barbados",start:4984777,end:4985055},{filename:"/tmp/pglite/share/postgresql/timezone/America/Belem",start:4985055,end:4985449},{filename:"/tmp/pglite/share/postgresql/timezone/America/Belize",start:4985449,end:4986494},{filename:"/tmp/pglite/share/postgresql/timezone/America/Blanc-Sablon",start:4986494,end:4986671},{filename:"/tmp/pglite/share/postgresql/timezone/America/Boa_Vista",start:4986671,end:4987101},{filename:"/tmp/pglite/share/postgresql/timezone/America/Bogota",start:4987101,end:4987280},{filename:"/tmp/pglite/share/postgresql/timezone/America/Boise",start:4987280,end:4988279},{filename:"/tmp/pglite/share/postgresql/timezone/America/Buenos_Aires",start:4988279,end:4988987},{filename:"/tmp/pglite/share/postgresql/timezone/America/Cambridge_Bay",start:4988987,end:4989870},{filename:"/tmp/pglite/share/postgresql/timezone/America/Campo_Grande",start:4989870,end:4990822},{filename:"/tmp/pglite/share/postgresql/timezone/America/Cancun",start:4990822,end:4991351},{filename:"/tmp/pglite/share/postgresql/timezone/America/Caracas",start:4991351,end:4991541},{filename:"/tmp/pglite/share/postgresql/timezone/America/Catamarca",start:4991541,end:4992249},{filename:"/tmp/pglite/share/postgresql/timezone/America/Cayenne",start:4992249,end:4992400},{filename:"/tmp/pglite/share/postgresql/timezone/America/Cayman",start:4992400,end:4992549},{filename:"/tmp/pglite/share/postgresql/timezone/America/Chicago",start:4992549,end:4994303},{filename:"/tmp/pglite/share/postgresql/timezone/America/Chihuahua",start:4994303,end:4994994},{filename:"/tmp/pglite/share/postgresql/timezone/America/Ciudad_Juarez",start:4994994,end:4995712},{filename:"/tmp/pglite/share/postgresql/timezone/America/Coral_Harbour",start:4995712,end:4995861},{filename:"/tmp/pglite/share/postgresql/timezone/America/Cordoba",start:4995861,end:4996569},{filename:"/tmp/pglite/share/postgresql/timezone/America/Costa_Rica",start:4996569,end:4996801},{filename:"/tmp/pglite/share/postgresql/timezone/America/Creston",start:4996801,end:4997041},{filename:"/tmp/pglite/share/postgresql/timezone/America/Cuiaba",start:4997041,end:4997975},{filename:"/tmp/pglite/share/postgresql/timezone/America/Curacao",start:4997975,end:4998152},{filename:"/tmp/pglite/share/postgresql/timezone/America/Danmarkshavn",start:4998152,end:4998599},{filename:"/tmp/pglite/share/postgresql/timezone/America/Dawson",start:4998599,end:4999628},{filename:"/tmp/pglite/share/postgresql/timezone/America/Dawson_Creek",start:4999628,end:5000311},{filename:"/tmp/pglite/share/postgresql/timezone/America/Denver",start:5000311,end:5001353},{filename:"/tmp/pglite/share/postgresql/timezone/America/Detroit",start:5001353,end:5002252},{filename:"/tmp/pglite/share/postgresql/timezone/America/Dominica",start:5002252,end:5002429},{filename:"/tmp/pglite/share/postgresql/timezone/America/Edmonton",start:5002429,end:5003399},{filename:"/tmp/pglite/share/postgresql/timezone/America/Eirunepe",start:5003399,end:5003835},{filename:"/tmp/pglite/share/postgresql/timezone/America/El_Salvador",start:5003835,end:5004011},{filename:"/tmp/pglite/share/postgresql/timezone/America/Ensenada",start:5004011,end:5005036},{filename:"/tmp/pglite/share/postgresql/timezone/America/Fort_Nelson",start:5005036,end:5006484},{filename:"/tmp/pglite/share/postgresql/timezone/America/Fort_Wayne",start:5006484,end:5007015},{filename:"/tmp/pglite/share/postgresql/timezone/America/Fortaleza",start:5007015,end:5007499},{filename:"/tmp/pglite/share/postgresql/timezone/America/Glace_Bay",start:5007499,end:5008379},{filename:"/tmp/pglite/share/postgresql/timezone/America/Godthab",start:5008379,end:5009344},{filename:"/tmp/pglite/share/postgresql/timezone/America/Goose_Bay",start:5009344,end:5010924},{filename:"/tmp/pglite/share/postgresql/timezone/America/Grand_Turk",start:5010924,end:5011777},{filename:"/tmp/pglite/share/postgresql/timezone/America/Grenada",start:5011777,end:5011954},{filename:"/tmp/pglite/share/postgresql/timezone/America/Guadeloupe",start:5011954,end:5012131},{filename:"/tmp/pglite/share/postgresql/timezone/America/Guatemala",start:5012131,end:5012343},{filename:"/tmp/pglite/share/postgresql/timezone/America/Guayaquil",start:5012343,end:5012522},{filename:"/tmp/pglite/share/postgresql/timezone/America/Guyana",start:5012522,end:5012703},{filename:"/tmp/pglite/share/postgresql/timezone/America/Halifax",start:5012703,end:5014375},{filename:"/tmp/pglite/share/postgresql/timezone/America/Havana",start:5014375,end:5015492},{filename:"/tmp/pglite/share/postgresql/timezone/America/Hermosillo",start:5015492,end:5015778},{filename:"/tmp/pglite/share/postgresql/timezone/America/Indiana/Indianapolis",start:5015778,end:5016309},{filename:"/tmp/pglite/share/postgresql/timezone/America/Indiana/Knox",start:5016309,end:5017325},{filename:"/tmp/pglite/share/postgresql/timezone/America/Indiana/Marengo",start:5017325,end:5017892},{filename:"/tmp/pglite/share/postgresql/timezone/America/Indiana/Petersburg",start:5017892,end:5018575},{filename:"/tmp/pglite/share/postgresql/timezone/America/Indiana/Tell_City",start:5018575,end:5019097},{filename:"/tmp/pglite/share/postgresql/timezone/America/Indiana/Vevay",start:5019097,end:5019466},{filename:"/tmp/pglite/share/postgresql/timezone/America/Indiana/Vincennes",start:5019466,end:5020024},{filename:"/tmp/pglite/share/postgresql/timezone/America/Indiana/Winamac",start:5020024,end:5020636},{filename:"/tmp/pglite/share/postgresql/timezone/America/Indianapolis",start:5020636,end:5021167},{filename:"/tmp/pglite/share/postgresql/timezone/America/Inuvik",start:5021167,end:5021984},{filename:"/tmp/pglite/share/postgresql/timezone/America/Iqaluit",start:5021984,end:5022839},{filename:"/tmp/pglite/share/postgresql/timezone/America/Jamaica",start:5022839,end:5023178},{filename:"/tmp/pglite/share/postgresql/timezone/America/Jujuy",start:5023178,end:5023868},{filename:"/tmp/pglite/share/postgresql/timezone/America/Juneau",start:5023868,end:5024834},{filename:"/tmp/pglite/share/postgresql/timezone/America/Kentucky/Louisville",start:5024834,end:5026076},{filename:"/tmp/pglite/share/postgresql/timezone/America/Kentucky/Monticello",start:5026076,end:5027048},{filename:"/tmp/pglite/share/postgresql/timezone/America/Knox_IN",start:5027048,end:5028064},{filename:"/tmp/pglite/share/postgresql/timezone/America/Kralendijk",start:5028064,end:5028241},{filename:"/tmp/pglite/share/postgresql/timezone/America/La_Paz",start:5028241,end:5028411},{filename:"/tmp/pglite/share/postgresql/timezone/America/Lima",start:5028411,end:5028694},{filename:"/tmp/pglite/share/postgresql/timezone/America/Los_Angeles",start:5028694,end:5029988},{filename:"/tmp/pglite/share/postgresql/timezone/America/Louisville",start:5029988,end:5031230},{filename:"/tmp/pglite/share/postgresql/timezone/America/Lower_Princes",start:5031230,end:5031407},{filename:"/tmp/pglite/share/postgresql/timezone/America/Maceio",start:5031407,end:5031909},{filename:"/tmp/pglite/share/postgresql/timezone/America/Managua",start:5031909,end:5032204},{filename:"/tmp/pglite/share/postgresql/timezone/America/Manaus",start:5032204,end:5032616},{filename:"/tmp/pglite/share/postgresql/timezone/America/Marigot",start:5032616,end:5032793},{filename:"/tmp/pglite/share/postgresql/timezone/America/Martinique",start:5032793,end:5032971},{filename:"/tmp/pglite/share/postgresql/timezone/America/Matamoros",start:5032971,end:5033408},{filename:"/tmp/pglite/share/postgresql/timezone/America/Mazatlan",start:5033408,end:5034126},{filename:"/tmp/pglite/share/postgresql/timezone/America/Mendoza",start:5034126,end:5034834},{filename:"/tmp/pglite/share/postgresql/timezone/America/Menominee",start:5034834,end:5035751},{filename:"/tmp/pglite/share/postgresql/timezone/America/Merida",start:5035751,end:5036405},{filename:"/tmp/pglite/share/postgresql/timezone/America/Metlakatla",start:5036405,end:5037e3},{filename:"/tmp/pglite/share/postgresql/timezone/America/Mexico_City",start:5037e3,end:5037773},{filename:"/tmp/pglite/share/postgresql/timezone/America/Miquelon",start:5037773,end:5038323},{filename:"/tmp/pglite/share/postgresql/timezone/America/Moncton",start:5038323,end:5039816},{filename:"/tmp/pglite/share/postgresql/timezone/America/Monterrey",start:5039816,end:5040460},{filename:"/tmp/pglite/share/postgresql/timezone/America/Montevideo",start:5040460,end:5041429},{filename:"/tmp/pglite/share/postgresql/timezone/America/Montreal",start:5041429,end:5043146},{filename:"/tmp/pglite/share/postgresql/timezone/America/Montserrat",start:5043146,end:5043323},{filename:"/tmp/pglite/share/postgresql/timezone/America/Nassau",start:5043323,end:5045040},{filename:"/tmp/pglite/share/postgresql/timezone/America/New_York",start:5045040,end:5046784},{filename:"/tmp/pglite/share/postgresql/timezone/America/Nipigon",start:5046784,end:5048501},{filename:"/tmp/pglite/share/postgresql/timezone/America/Nome",start:5048501,end:5049476},{filename:"/tmp/pglite/share/postgresql/timezone/America/Noronha",start:5049476,end:5049960},{filename:"/tmp/pglite/share/postgresql/timezone/America/North_Dakota/Beulah",start:5049960,end:5051003},{filename:"/tmp/pglite/share/postgresql/timezone/America/North_Dakota/Center",start:5051003,end:5051993},{filename:"/tmp/pglite/share/postgresql/timezone/America/North_Dakota/New_Salem",start:5051993,end:5052983},{filename:"/tmp/pglite/share/postgresql/timezone/America/Nuuk",start:5052983,end:5053948},{filename:"/tmp/pglite/share/postgresql/timezone/America/Ojinaga",start:5053948,end:5054657},{filename:"/tmp/pglite/share/postgresql/timezone/America/Panama",start:5054657,end:5054806},{filename:"/tmp/pglite/share/postgresql/timezone/America/Pangnirtung",start:5054806,end:5055661},{filename:"/tmp/pglite/share/postgresql/timezone/America/Paramaribo",start:5055661,end:5055848},{filename:"/tmp/pglite/share/postgresql/timezone/America/Phoenix",start:5055848,end:5056088},{filename:"/tmp/pglite/share/postgresql/timezone/America/Port-au-Prince",start:5056088,end:5056653},{filename:"/tmp/pglite/share/postgresql/timezone/America/Port_of_Spain",start:5056653,end:5056830},{filename:"/tmp/pglite/share/postgresql/timezone/America/Porto_Acre",start:5056830,end:5057248},{filename:"/tmp/pglite/share/postgresql/timezone/America/Porto_Velho",start:5057248,end:5057642},{filename:"/tmp/pglite/share/postgresql/timezone/America/Puerto_Rico",start:5057642,end:5057819},{filename:"/tmp/pglite/share/postgresql/timezone/America/Punta_Arenas",start:5057819,end:5059037},{filename:"/tmp/pglite/share/postgresql/timezone/America/Rainy_River",start:5059037,end:5060331},{filename:"/tmp/pglite/share/postgresql/timezone/America/Rankin_Inlet",start:5060331,end:5061138},{filename:"/tmp/pglite/share/postgresql/timezone/America/Recife",start:5061138,end:5061622},{filename:"/tmp/pglite/share/postgresql/timezone/America/Regina",start:5061622,end:5062260},{filename:"/tmp/pglite/share/postgresql/timezone/America/Resolute",start:5062260,end:5063067},{filename:"/tmp/pglite/share/postgresql/timezone/America/Rio_Branco",start:5063067,end:5063485},{filename:"/tmp/pglite/share/postgresql/timezone/America/Rosario",start:5063485,end:5064193},{filename:"/tmp/pglite/share/postgresql/timezone/America/Santa_Isabel",start:5064193,end:5065218},{filename:"/tmp/pglite/share/postgresql/timezone/America/Santarem",start:5065218,end:5065627},{filename:"/tmp/pglite/share/postgresql/timezone/America/Santiago",start:5065627,end:5066981},{filename:"/tmp/pglite/share/postgresql/timezone/America/Santo_Domingo",start:5066981,end:5067298},{filename:"/tmp/pglite/share/postgresql/timezone/America/Sao_Paulo",start:5067298,end:5068250},{filename:"/tmp/pglite/share/postgresql/timezone/America/Scoresbysund",start:5068250,end:5069234},{filename:"/tmp/pglite/share/postgresql/timezone/America/Shiprock",start:5069234,end:5070276},{filename:"/tmp/pglite/share/postgresql/timezone/America/Sitka",start:5070276,end:5071232},{filename:"/tmp/pglite/share/postgresql/timezone/America/St_Barthelemy",start:5071232,end:5071409},{filename:"/tmp/pglite/share/postgresql/timezone/America/St_Johns",start:5071409,end:5073287},{filename:"/tmp/pglite/share/postgresql/timezone/America/St_Kitts",start:5073287,end:5073464},{filename:"/tmp/pglite/share/postgresql/timezone/America/St_Lucia",start:5073464,end:5073641},{filename:"/tmp/pglite/share/postgresql/timezone/America/St_Thomas",start:5073641,end:5073818},{filename:"/tmp/pglite/share/postgresql/timezone/America/St_Vincent",start:5073818,end:5073995},{filename:"/tmp/pglite/share/postgresql/timezone/America/Swift_Current",start:5073995,end:5074363},{filename:"/tmp/pglite/share/postgresql/timezone/America/Tegucigalpa",start:5074363,end:5074557},{filename:"/tmp/pglite/share/postgresql/timezone/America/Thule",start:5074557,end:5075012},{filename:"/tmp/pglite/share/postgresql/timezone/America/Thunder_Bay",start:5075012,end:5076729},{filename:"/tmp/pglite/share/postgresql/timezone/America/Tijuana",start:5076729,end:5077754},{filename:"/tmp/pglite/share/postgresql/timezone/America/Toronto",start:5077754,end:5079471},{filename:"/tmp/pglite/share/postgresql/timezone/America/Tortola",start:5079471,end:5079648},{filename:"/tmp/pglite/share/postgresql/timezone/America/Vancouver",start:5079648,end:5080978},{filename:"/tmp/pglite/share/postgresql/timezone/America/Virgin",start:5080978,end:5081155},{filename:"/tmp/pglite/share/postgresql/timezone/America/Whitehorse",start:5081155,end:5082184},{filename:"/tmp/pglite/share/postgresql/timezone/America/Winnipeg",start:5082184,end:5083478},{filename:"/tmp/pglite/share/postgresql/timezone/America/Yakutat",start:5083478,end:5084424},{filename:"/tmp/pglite/share/postgresql/timezone/America/Yellowknife",start:5084424,end:5085394},{filename:"/tmp/pglite/share/postgresql/timezone/Antarctica/Casey",start:5085394,end:5085681},{filename:"/tmp/pglite/share/postgresql/timezone/Antarctica/Davis",start:5085681,end:5085878},{filename:"/tmp/pglite/share/postgresql/timezone/Antarctica/DumontDUrville",start:5085878,end:5086032},{filename:"/tmp/pglite/share/postgresql/timezone/Antarctica/Macquarie",start:5086032,end:5087008},{filename:"/tmp/pglite/share/postgresql/timezone/Antarctica/Mawson",start:5087008,end:5087160},{filename:"/tmp/pglite/share/postgresql/timezone/Antarctica/McMurdo",start:5087160,end:5088203},{filename:"/tmp/pglite/share/postgresql/timezone/Antarctica/Palmer",start:5088203,end:5089090},{filename:"/tmp/pglite/share/postgresql/timezone/Antarctica/Rothera",start:5089090,end:5089222},{filename:"/tmp/pglite/share/postgresql/timezone/Antarctica/South_Pole",start:5089222,end:5090265},{filename:"/tmp/pglite/share/postgresql/timezone/Antarctica/Syowa",start:5090265,end:5090398},{filename:"/tmp/pglite/share/postgresql/timezone/Antarctica/Troll",start:5090398,end:5090575},{filename:"/tmp/pglite/share/postgresql/timezone/Antarctica/Vostok",start:5090575,end:5090745},{filename:"/tmp/pglite/share/postgresql/timezone/Arctic/Longyearbyen",start:5090745,end:5091450},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Aden",start:5091450,end:5091583},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Almaty",start:5091583,end:5092201},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Amman",start:5092201,end:5093129},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Anadyr",start:5093129,end:5093872},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Aqtau",start:5093872,end:5094478},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Aqtobe",start:5094478,end:5095093},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Ashgabat",start:5095093,end:5095468},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Ashkhabad",start:5095468,end:5095843},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Atyrau",start:5095843,end:5096459},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Baghdad",start:5096459,end:5097089},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Bahrain",start:5097089,end:5097241},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Baku",start:5097241,end:5097985},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Bangkok",start:5097985,end:5098137},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Barnaul",start:5098137,end:5098890},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Beirut",start:5098890,end:5099622},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Bishkek",start:5099622,end:5100240},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Brunei",start:5100240,end:5100560},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Calcutta",start:5100560,end:5100780},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Chita",start:5100780,end:5101530},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Choibalsan",start:5101530,end:5102149},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Chongqing",start:5102149,end:5102542},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Chungking",start:5102542,end:5102935},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Colombo",start:5102935,end:5103182},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Dacca",start:5103182,end:5103413},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Damascus",start:5103413,end:5104647},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Dhaka",start:5104647,end:5104878},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Dili",start:5104878,end:5105048},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Dubai",start:5105048,end:5105181},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Dushanbe",start:5105181,end:5105547},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Famagusta",start:5105547,end:5106487},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Gaza",start:5106487,end:5108933},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Harbin",start:5108933,end:5109326},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Hebron",start:5109326,end:5111790},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Ho_Chi_Minh",start:5111790,end:5112026},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Hong_Kong",start:5112026,end:5112801},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Hovd",start:5112801,end:5113395},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Irkutsk",start:5113395,end:5114155},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Istanbul",start:5114155,end:5115355},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Jakarta",start:5115355,end:5115603},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Jayapura",start:5115603,end:5115774},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Jerusalem",start:5115774,end:5116848},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Kabul",start:5116848,end:5117007},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Kamchatka",start:5117007,end:5117734},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Karachi",start:5117734,end:5118e3},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Kashgar",start:5118e3,end:5118133},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Kathmandu",start:5118133,end:5118294},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Katmandu",start:5118294,end:5118455},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Khandyga",start:5118455,end:5119230},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Kolkata",start:5119230,end:5119450},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Krasnoyarsk",start:5119450,end:5120191},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Kuala_Lumpur",start:5120191,end:5120447},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Kuching",start:5120447,end:5120767},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Kuwait",start:5120767,end:5120900},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Macao",start:5120900,end:5121691},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Macau",start:5121691,end:5122482},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Magadan",start:5122482,end:5123233},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Makassar",start:5123233,end:5123423},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Manila",start:5123423,end:5123661},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Muscat",start:5123661,end:5123794},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Nicosia",start:5123794,end:5124391},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Novokuznetsk",start:5124391,end:5125117},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Novosibirsk",start:5125117,end:5125870},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Omsk",start:5125870,end:5126611},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Oral",start:5126611,end:5127236},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Phnom_Penh",start:5127236,end:5127388},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Pontianak",start:5127388,end:5127635},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Pyongyang",start:5127635,end:5127818},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Qatar",start:5127818,end:5127970},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Qostanay",start:5127970,end:5128594},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Qyzylorda",start:5128594,end:5129218},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Rangoon",start:5129218,end:5129405},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Riyadh",start:5129405,end:5129538},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Saigon",start:5129538,end:5129774},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Sakhalin",start:5129774,end:5130529},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Samarkand",start:5130529,end:5130895},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Seoul",start:5130895,end:5131310},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Shanghai",start:5131310,end:5131703},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Singapore",start:5131703,end:5131959},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Srednekolymsk",start:5131959,end:5132701},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Taipei",start:5132701,end:5133212},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Tashkent",start:5133212,end:5133578},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Tbilisi",start:5133578,end:5134207},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Tehran",start:5134207,end:5135019},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Tel_Aviv",start:5135019,end:5136093},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Thimbu",start:5136093,end:5136247},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Thimphu",start:5136247,end:5136401},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Tokyo",start:5136401,end:5136614},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Tomsk",start:5136614,end:5137367},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Ujung_Pandang",start:5137367,end:5137557},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Ulaanbaatar",start:5137557,end:5138151},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Ulan_Bator",start:5138151,end:5138745},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Urumqi",start:5138745,end:5138878},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Ust-Nera",start:5138878,end:5139649},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Vientiane",start:5139649,end:5139801},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Vladivostok",start:5139801,end:5140543},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Yakutsk",start:5140543,end:5141284},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Yangon",start:5141284,end:5141471},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Yekaterinburg",start:5141471,end:5142231},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Yerevan",start:5142231,end:5142939},{filename:"/tmp/pglite/share/postgresql/timezone/Atlantic/Azores",start:5142939,end:5144392},{filename:"/tmp/pglite/share/postgresql/timezone/Atlantic/Bermuda",start:5144392,end:5145416},{filename:"/tmp/pglite/share/postgresql/timezone/Atlantic/Canary",start:5145416,end:5145894},{filename:"/tmp/pglite/share/postgresql/timezone/Atlantic/Cape_Verde",start:5145894,end:5146069},{filename:"/tmp/pglite/share/postgresql/timezone/Atlantic/Faeroe",start:5146069,end:5146510},{filename:"/tmp/pglite/share/postgresql/timezone/Atlantic/Faroe",start:5146510,end:5146951},{filename:"/tmp/pglite/share/postgresql/timezone/Atlantic/Jan_Mayen",start:5146951,end:5147656},{filename:"/tmp/pglite/share/postgresql/timezone/Atlantic/Madeira",start:5147656,end:5149109},{filename:"/tmp/pglite/share/postgresql/timezone/Atlantic/Reykjavik",start:5149109,end:5149239},{filename:"/tmp/pglite/share/postgresql/timezone/Atlantic/South_Georgia",start:5149239,end:5149371},{filename:"/tmp/pglite/share/postgresql/timezone/Atlantic/St_Helena",start:5149371,end:5149501},{filename:"/tmp/pglite/share/postgresql/timezone/Atlantic/Stanley",start:5149501,end:5150290},{filename:"/tmp/pglite/share/postgresql/timezone/Australia/ACT",start:5150290,end:5151194},{filename:"/tmp/pglite/share/postgresql/timezone/Australia/Adelaide",start:5151194,end:5152115},{filename:"/tmp/pglite/share/postgresql/timezone/Australia/Brisbane",start:5152115,end:5152404},{filename:"/tmp/pglite/share/postgresql/timezone/Australia/Broken_Hill",start:5152404,end:5153345},{filename:"/tmp/pglite/share/postgresql/timezone/Australia/Canberra",start:5153345,end:5154249},{filename:"/tmp/pglite/share/postgresql/timezone/Australia/Currie",start:5154249,end:5155252},{filename:"/tmp/pglite/share/postgresql/timezone/Australia/Darwin",start:5155252,end:5155486},{filename:"/tmp/pglite/share/postgresql/timezone/Australia/Eucla",start:5155486,end:5155800},{filename:"/tmp/pglite/share/postgresql/timezone/Australia/Hobart",start:5155800,end:5156803},{filename:"/tmp/pglite/share/postgresql/timezone/Australia/LHI",start:5156803,end:5157495},{filename:"/tmp/pglite/share/postgresql/timezone/Australia/Lindeman",start:5157495,end:5157820},{filename:"/tmp/pglite/share/postgresql/timezone/Australia/Lord_Howe",start:5157820,end:5158512},{filename:"/tmp/pglite/share/postgresql/timezone/Australia/Melbourne",start:5158512,end:5159416},{filename:"/tmp/pglite/share/postgresql/timezone/Australia/NSW",start:5159416,end:5160320},{filename:"/tmp/pglite/share/postgresql/timezone/Australia/North",start:5160320,end:5160554},{filename:"/tmp/pglite/share/postgresql/timezone/Australia/Perth",start:5160554,end:5160860},{filename:"/tmp/pglite/share/postgresql/timezone/Australia/Queensland",start:5160860,end:5161149},{filename:"/tmp/pglite/share/postgresql/timezone/Australia/South",start:5161149,end:5162070},{filename:"/tmp/pglite/share/postgresql/timezone/Australia/Sydney",start:5162070,end:5162974},{filename:"/tmp/pglite/share/postgresql/timezone/Australia/Tasmania",start:5162974,end:5163977},{filename:"/tmp/pglite/share/postgresql/timezone/Australia/Victoria",start:5163977,end:5164881},{filename:"/tmp/pglite/share/postgresql/timezone/Australia/West",start:5164881,end:5165187},{filename:"/tmp/pglite/share/postgresql/timezone/Australia/Yancowinna",start:5165187,end:5166128},{filename:"/tmp/pglite/share/postgresql/timezone/Brazil/Acre",start:5166128,end:5166546},{filename:"/tmp/pglite/share/postgresql/timezone/Brazil/DeNoronha",start:5166546,end:5167030},{filename:"/tmp/pglite/share/postgresql/timezone/Brazil/East",start:5167030,end:5167982},{filename:"/tmp/pglite/share/postgresql/timezone/Brazil/West",start:5167982,end:5168394},{filename:"/tmp/pglite/share/postgresql/timezone/CET",start:5168394,end:5169015},{filename:"/tmp/pglite/share/postgresql/timezone/CST6CDT",start:5169015,end:5169966},{filename:"/tmp/pglite/share/postgresql/timezone/Canada/Atlantic",start:5169966,end:5171638},{filename:"/tmp/pglite/share/postgresql/timezone/Canada/Central",start:5171638,end:5172932},{filename:"/tmp/pglite/share/postgresql/timezone/Canada/Eastern",start:5172932,end:5174649},{filename:"/tmp/pglite/share/postgresql/timezone/Canada/Mountain",start:5174649,end:5175619},{filename:"/tmp/pglite/share/postgresql/timezone/Canada/Newfoundland",start:5175619,end:5177497},{filename:"/tmp/pglite/share/postgresql/timezone/Canada/Pacific",start:5177497,end:5178827},{filename:"/tmp/pglite/share/postgresql/timezone/Canada/Saskatchewan",start:5178827,end:5179465},{filename:"/tmp/pglite/share/postgresql/timezone/Canada/Yukon",start:5179465,end:5180494},{filename:"/tmp/pglite/share/postgresql/timezone/Chile/Continental",start:5180494,end:5181848},{filename:"/tmp/pglite/share/postgresql/timezone/Chile/EasterIsland",start:5181848,end:5183022},{filename:"/tmp/pglite/share/postgresql/timezone/Cuba",start:5183022,end:5184139},{filename:"/tmp/pglite/share/postgresql/timezone/EET",start:5184139,end:5184636},{filename:"/tmp/pglite/share/postgresql/timezone/EST",start:5184636,end:5184747},{filename:"/tmp/pglite/share/postgresql/timezone/EST5EDT",start:5184747,end:5185698},{filename:"/tmp/pglite/share/postgresql/timezone/Egypt",start:5185698,end:5187007},{filename:"/tmp/pglite/share/postgresql/timezone/Eire",start:5187007,end:5188503},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/GMT",start:5188503,end:5188614},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/GMT+0",start:5188614,end:5188725},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/GMT+1",start:5188725,end:5188838},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/GMT+10",start:5188838,end:5188952},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/GMT+11",start:5188952,end:5189066},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/GMT+12",start:5189066,end:5189180},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/GMT+2",start:5189180,end:5189293},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/GMT+3",start:5189293,end:5189406},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/GMT+4",start:5189406,end:5189519},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/GMT+5",start:5189519,end:5189632},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/GMT+6",start:5189632,end:5189745},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/GMT+7",start:5189745,end:5189858},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/GMT+8",start:5189858,end:5189971},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/GMT+9",start:5189971,end:5190084},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/GMT-0",start:5190084,end:5190195},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/GMT-1",start:5190195,end:5190309},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/GMT-10",start:5190309,end:5190424},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/GMT-11",start:5190424,end:5190539},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/GMT-12",start:5190539,end:5190654},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/GMT-13",start:5190654,end:5190769},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/GMT-14",start:5190769,end:5190884},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/GMT-2",start:5190884,end:5190998},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/GMT-3",start:5190998,end:5191112},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/GMT-4",start:5191112,end:5191226},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/GMT-5",start:5191226,end:5191340},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/GMT-6",start:5191340,end:5191454},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/GMT-7",start:5191454,end:5191568},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/GMT-8",start:5191568,end:5191682},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/GMT-9",start:5191682,end:5191796},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/GMT0",start:5191796,end:5191907},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/Greenwich",start:5191907,end:5192018},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/UCT",start:5192018,end:5192129},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/UTC",start:5192129,end:5192240},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/Universal",start:5192240,end:5192351},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/Zulu",start:5192351,end:5192462},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Amsterdam",start:5192462,end:5193565},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Andorra",start:5193565,end:5193954},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Astrakhan",start:5193954,end:5194680},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Athens",start:5194680,end:5195362},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Belfast",start:5195362,end:5196961},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Belgrade",start:5196961,end:5197439},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Berlin",start:5197439,end:5198144},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Bratislava",start:5198144,end:5198867},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Brussels",start:5198867,end:5199970},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Bucharest",start:5199970,end:5200631},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Budapest",start:5200631,end:5201397},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Busingen",start:5201397,end:5201894},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Chisinau",start:5201894,end:5202649},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Copenhagen",start:5202649,end:5203354},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Dublin",start:5203354,end:5204850},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Gibraltar",start:5204850,end:5206070},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Guernsey",start:5206070,end:5207669},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Helsinki",start:5207669,end:5208150},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Isle_of_Man",start:5208150,end:5209749},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Istanbul",start:5209749,end:5210949},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Jersey",start:5210949,end:5212548},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Kaliningrad",start:5212548,end:5213452},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Kiev",start:5213452,end:5214010},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Kirov",start:5214010,end:5214745},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Kyiv",start:5214745,end:5215303},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Lisbon",start:5215303,end:5216757},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Ljubljana",start:5216757,end:5217235},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/London",start:5217235,end:5218834},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Luxembourg",start:5218834,end:5219937},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Madrid",start:5219937,end:5220834},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Malta",start:5220834,end:5221762},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Mariehamn",start:5221762,end:5222243},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Minsk",start:5222243,end:5223051},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Monaco",start:5223051,end:5224156},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Moscow",start:5224156,end:5225064},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Nicosia",start:5225064,end:5225661},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Oslo",start:5225661,end:5226366},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Paris",start:5226366,end:5227471},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Podgorica",start:5227471,end:5227949},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Prague",start:5227949,end:5228672},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Riga",start:5228672,end:5229366},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Rome",start:5229366,end:5230313},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Samara",start:5230313,end:5231045},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/San_Marino",start:5231045,end:5231992},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Sarajevo",start:5231992,end:5232470},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Saratov",start:5232470,end:5233196},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Simferopol",start:5233196,end:5234061},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Skopje",start:5234061,end:5234539},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Sofia",start:5234539,end:5235131},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Stockholm",start:5235131,end:5235836},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Tallinn",start:5235836,end:5236511},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Tirane",start:5236511,end:5237115},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Tiraspol",start:5237115,end:5237870},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Ulyanovsk",start:5237870,end:5238630},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Uzhgorod",start:5238630,end:5239188},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Vaduz",start:5239188,end:5239685},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Vatican",start:5239685,end:5240632},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Vienna",start:5240632,end:5241290},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Vilnius",start:5241290,end:5241966},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Volgograd",start:5241966,end:5242719},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Warsaw",start:5242719,end:5243642},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Zagreb",start:5243642,end:5244120},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Zaporozhye",start:5244120,end:5244678},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Zurich",start:5244678,end:5245175},{filename:"/tmp/pglite/share/postgresql/timezone/Factory",start:5245175,end:5245288},{filename:"/tmp/pglite/share/postgresql/timezone/GB",start:5245288,end:5246887},{filename:"/tmp/pglite/share/postgresql/timezone/GB-Eire",start:5246887,end:5248486},{filename:"/tmp/pglite/share/postgresql/timezone/GMT",start:5248486,end:5248597},{filename:"/tmp/pglite/share/postgresql/timezone/GMT+0",start:5248597,end:5248708},{filename:"/tmp/pglite/share/postgresql/timezone/GMT-0",start:5248708,end:5248819},{filename:"/tmp/pglite/share/postgresql/timezone/GMT0",start:5248819,end:5248930},{filename:"/tmp/pglite/share/postgresql/timezone/Greenwich",start:5248930,end:5249041},{filename:"/tmp/pglite/share/postgresql/timezone/HST",start:5249041,end:5249153},{filename:"/tmp/pglite/share/postgresql/timezone/Hongkong",start:5249153,end:5249928},{filename:"/tmp/pglite/share/postgresql/timezone/Iceland",start:5249928,end:5250058},{filename:"/tmp/pglite/share/postgresql/timezone/Indian/Antananarivo",start:5250058,end:5250249},{filename:"/tmp/pglite/share/postgresql/timezone/Indian/Chagos",start:5250249,end:5250401},{filename:"/tmp/pglite/share/postgresql/timezone/Indian/Christmas",start:5250401,end:5250553},{filename:"/tmp/pglite/share/postgresql/timezone/Indian/Cocos",start:5250553,end:5250740},{filename:"/tmp/pglite/share/postgresql/timezone/Indian/Comoro",start:5250740,end:5250931},{filename:"/tmp/pglite/share/postgresql/timezone/Indian/Kerguelen",start:5250931,end:5251083},{filename:"/tmp/pglite/share/postgresql/timezone/Indian/Mahe",start:5251083,end:5251216},{filename:"/tmp/pglite/share/postgresql/timezone/Indian/Maldives",start:5251216,end:5251368},{filename:"/tmp/pglite/share/postgresql/timezone/Indian/Mauritius",start:5251368,end:5251547},{filename:"/tmp/pglite/share/postgresql/timezone/Indian/Mayotte",start:5251547,end:5251738},{filename:"/tmp/pglite/share/postgresql/timezone/Indian/Reunion",start:5251738,end:5251871},{filename:"/tmp/pglite/share/postgresql/timezone/Iran",start:5251871,end:5252683},{filename:"/tmp/pglite/share/postgresql/timezone/Israel",start:5252683,end:5253757},{filename:"/tmp/pglite/share/postgresql/timezone/Jamaica",start:5253757,end:5254096},{filename:"/tmp/pglite/share/postgresql/timezone/Japan",start:5254096,end:5254309},{filename:"/tmp/pglite/share/postgresql/timezone/Kwajalein",start:5254309,end:5254528},{filename:"/tmp/pglite/share/postgresql/timezone/Libya",start:5254528,end:5254959},{filename:"/tmp/pglite/share/postgresql/timezone/MET",start:5254959,end:5255580},{filename:"/tmp/pglite/share/postgresql/timezone/MST",start:5255580,end:5255691},{filename:"/tmp/pglite/share/postgresql/timezone/MST7MDT",start:5255691,end:5256642},{filename:"/tmp/pglite/share/postgresql/timezone/Mexico/BajaNorte",start:5256642,end:5257667},{filename:"/tmp/pglite/share/postgresql/timezone/Mexico/BajaSur",start:5257667,end:5258385},{filename:"/tmp/pglite/share/postgresql/timezone/Mexico/General",start:5258385,end:5259158},{filename:"/tmp/pglite/share/postgresql/timezone/NZ",start:5259158,end:5260201},{filename:"/tmp/pglite/share/postgresql/timezone/NZ-CHAT",start:5260201,end:5261009},{filename:"/tmp/pglite/share/postgresql/timezone/Navajo",start:5261009,end:5262051},{filename:"/tmp/pglite/share/postgresql/timezone/PRC",start:5262051,end:5262444},{filename:"/tmp/pglite/share/postgresql/timezone/PST8PDT",start:5262444,end:5263395},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Apia",start:5263395,end:5263802},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Auckland",start:5263802,end:5264845},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Bougainville",start:5264845,end:5265046},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Chatham",start:5265046,end:5265854},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Chuuk",start:5265854,end:5266008},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Easter",start:5266008,end:5267182},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Efate",start:5267182,end:5267524},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Enderbury",start:5267524,end:5267696},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Fakaofo",start:5267696,end:5267849},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Fiji",start:5267849,end:5268245},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Funafuti",start:5268245,end:5268379},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Galapagos",start:5268379,end:5268554},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Gambier",start:5268554,end:5268686},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Guadalcanal",start:5268686,end:5268820},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Guam",start:5268820,end:5269170},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Honolulu",start:5269170,end:5269391},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Johnston",start:5269391,end:5269612},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Kanton",start:5269612,end:5269784},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Kiritimati",start:5269784,end:5269958},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Kosrae",start:5269958,end:5270200},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Kwajalein",start:5270200,end:5270419},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Majuro",start:5270419,end:5270553},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Marquesas",start:5270553,end:5270692},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Midway",start:5270692,end:5270838},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Nauru",start:5270838,end:5271021},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Niue",start:5271021,end:5271175},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Norfolk",start:5271175,end:5271422},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Noumea",start:5271422,end:5271620},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Pago_Pago",start:5271620,end:5271766},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Palau",start:5271766,end:5271914},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Pitcairn",start:5271914,end:5272067},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Pohnpei",start:5272067,end:5272201},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Ponape",start:5272201,end:5272335},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Port_Moresby",start:5272335,end:5272489},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Rarotonga",start:5272489,end:5272895},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Saipan",start:5272895,end:5273245},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Samoa",start:5273245,end:5273391},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Tahiti",start:5273391,end:5273524},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Tarawa",start:5273524,end:5273658},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Tongatapu",start:5273658,end:5273895},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Truk",start:5273895,end:5274049},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Wake",start:5274049,end:5274183},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Wallis",start:5274183,end:5274317},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Yap",start:5274317,end:5274471},{filename:"/tmp/pglite/share/postgresql/timezone/Poland",start:5274471,end:5275394},{filename:"/tmp/pglite/share/postgresql/timezone/Portugal",start:5275394,end:5276848},{filename:"/tmp/pglite/share/postgresql/timezone/ROC",start:5276848,end:5277359},{filename:"/tmp/pglite/share/postgresql/timezone/ROK",start:5277359,end:5277774},{filename:"/tmp/pglite/share/postgresql/timezone/Singapore",start:5277774,end:5278030},{filename:"/tmp/pglite/share/postgresql/timezone/Turkey",start:5278030,end:5279230},{filename:"/tmp/pglite/share/postgresql/timezone/UCT",start:5279230,end:5279341},{filename:"/tmp/pglite/share/postgresql/timezone/US/Alaska",start:5279341,end:5280318},{filename:"/tmp/pglite/share/postgresql/timezone/US/Aleutian",start:5280318,end:5281287},{filename:"/tmp/pglite/share/postgresql/timezone/US/Arizona",start:5281287,end:5281527},{filename:"/tmp/pglite/share/postgresql/timezone/US/Central",start:5281527,end:5283281},{filename:"/tmp/pglite/share/postgresql/timezone/US/East-Indiana",start:5283281,end:5283812},{filename:"/tmp/pglite/share/postgresql/timezone/US/Eastern",start:5283812,end:5285556},{filename:"/tmp/pglite/share/postgresql/timezone/US/Hawaii",start:5285556,end:5285777},{filename:"/tmp/pglite/share/postgresql/timezone/US/Indiana-Starke",start:5285777,end:5286793},{filename:"/tmp/pglite/share/postgresql/timezone/US/Michigan",start:5286793,end:5287692},{filename:"/tmp/pglite/share/postgresql/timezone/US/Mountain",start:5287692,end:5288734},{filename:"/tmp/pglite/share/postgresql/timezone/US/Pacific",start:5288734,end:5290028},{filename:"/tmp/pglite/share/postgresql/timezone/US/Samoa",start:5290028,end:5290174},{filename:"/tmp/pglite/share/postgresql/timezone/UTC",start:5290174,end:5290285},{filename:"/tmp/pglite/share/postgresql/timezone/Universal",start:5290285,end:5290396},{filename:"/tmp/pglite/share/postgresql/timezone/W-SU",start:5290396,end:5291304},{filename:"/tmp/pglite/share/postgresql/timezone/WET",start:5291304,end:5291798},{filename:"/tmp/pglite/share/postgresql/timezone/Zulu",start:5291798,end:5291909},{filename:"/tmp/pglite/share/postgresql/timezonesets/Africa.txt",start:5291909,end:5298882},{filename:"/tmp/pglite/share/postgresql/timezonesets/America.txt",start:5298882,end:5309889},{filename:"/tmp/pglite/share/postgresql/timezonesets/Antarctica.txt",start:5309889,end:5311023},{filename:"/tmp/pglite/share/postgresql/timezonesets/Asia.txt",start:5311023,end:5319334},{filename:"/tmp/pglite/share/postgresql/timezonesets/Atlantic.txt",start:5319334,end:5322867},{filename:"/tmp/pglite/share/postgresql/timezonesets/Australia",start:5322867,end:5324002},{filename:"/tmp/pglite/share/postgresql/timezonesets/Australia.txt",start:5324002,end:5327386},{filename:"/tmp/pglite/share/postgresql/timezonesets/Default",start:5327386,end:5354636},{filename:"/tmp/pglite/share/postgresql/timezonesets/Etc.txt",start:5354636,end:5355886},{filename:"/tmp/pglite/share/postgresql/timezonesets/Europe.txt",start:5355886,end:5364668},{filename:"/tmp/pglite/share/postgresql/timezonesets/India",start:5364668,end:5365261},{filename:"/tmp/pglite/share/postgresql/timezonesets/Indian.txt",start:5365261,end:5366522},{filename:"/tmp/pglite/share/postgresql/timezonesets/Pacific.txt",start:5366522,end:5370290},{filename:"/tmp/pglite/share/postgresql/tsearch_data/danish.stop",start:5370290,end:5370714},{filename:"/tmp/pglite/share/postgresql/tsearch_data/dutch.stop",start:5370714,end:5371167},{filename:"/tmp/pglite/share/postgresql/tsearch_data/english.stop",start:5371167,end:5371789},{filename:"/tmp/pglite/share/postgresql/tsearch_data/finnish.stop",start:5371789,end:5373368},{filename:"/tmp/pglite/share/postgresql/tsearch_data/french.stop",start:5373368,end:5374173},{filename:"/tmp/pglite/share/postgresql/tsearch_data/german.stop",start:5374173,end:5375522},{filename:"/tmp/pglite/share/postgresql/tsearch_data/hungarian.stop",start:5375522,end:5376749},{filename:"/tmp/pglite/share/postgresql/tsearch_data/hunspell_sample.affix",start:5376749,end:5376992},{filename:"/tmp/pglite/share/postgresql/tsearch_data/hunspell_sample_long.affix",start:5376992,end:5377625},{filename:"/tmp/pglite/share/postgresql/tsearch_data/hunspell_sample_long.dict",start:5377625,end:5377723},{filename:"/tmp/pglite/share/postgresql/tsearch_data/hunspell_sample_num.affix",start:5377723,end:5378185},{filename:"/tmp/pglite/share/postgresql/tsearch_data/hunspell_sample_num.dict",start:5378185,end:5378314},{filename:"/tmp/pglite/share/postgresql/tsearch_data/ispell_sample.affix",start:5378314,end:5378779},{filename:"/tmp/pglite/share/postgresql/tsearch_data/ispell_sample.dict",start:5378779,end:5378860},{filename:"/tmp/pglite/share/postgresql/tsearch_data/italian.stop",start:5378860,end:5380514},{filename:"/tmp/pglite/share/postgresql/tsearch_data/nepali.stop",start:5380514,end:5384775},{filename:"/tmp/pglite/share/postgresql/tsearch_data/norwegian.stop",start:5384775,end:5385626},{filename:"/tmp/pglite/share/postgresql/tsearch_data/portuguese.stop",start:5385626,end:5386893},{filename:"/tmp/pglite/share/postgresql/tsearch_data/russian.stop",start:5386893,end:5388128},{filename:"/tmp/pglite/share/postgresql/tsearch_data/spanish.stop",start:5388128,end:5390306},{filename:"/tmp/pglite/share/postgresql/tsearch_data/swedish.stop",start:5390306,end:5390865},{filename:"/tmp/pglite/share/postgresql/tsearch_data/synonym_sample.syn",start:5390865,end:5390938},{filename:"/tmp/pglite/share/postgresql/tsearch_data/thesaurus_sample.ths",start:5390938,end:5391411},{filename:"/tmp/pglite/share/postgresql/tsearch_data/turkish.stop",start:5391411,end:5391671},{filename:"/tmp/pglite/share/postgresql/tsearch_data/unaccent.rules",start:5391671,end:5401610},{filename:"/tmp/pglite/share/postgresql/tsearch_data/xsyn_sample.rules",start:5401610,end:5401749}],remote_package_size:5401749})})();var moduleOverrides=Object.assign({},Module),arguments_=[],thisProgram="./this.program",quit_=(tr,rr)=>{throw rr},scriptDirectory="";function locateFile(tr){return Module.locateFile?Module.locateFile(tr,scriptDirectory):scriptDirectory+tr}var readAsync,readBinary;if(ENVIRONMENT_IS_NODE){var fs=require("fs"),nodePath=require("path");import.meta.url.startsWith("data:")||(scriptDirectory=nodePath.dirname(require("url").fileURLToPath(import.meta.url))+"/"),readBinary=tr=>{tr=isFileURI(tr)?new URL(tr):tr;var rr=fs.readFileSync(tr);return rr},readAsync=async(tr,rr=!0)=>{tr=isFileURI(tr)?new URL(tr):tr;var ir=fs.readFileSync(tr,rr?void 0:"utf8");return ir},!Module.thisProgram&&process.argv.length>1&&(thisProgram=process.argv[1].replace(/\\/g,"/")),arguments_=process.argv.slice(2),quit_=(tr,rr)=>{throw process.exitCode=tr,rr}}else(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)&&(ENVIRONMENT_IS_WORKER?scriptDirectory=self.location.href:typeof document<"u"&&document.currentScript&&(scriptDirectory=document.currentScript.src),_scriptName&&(scriptDirectory=_scriptName),scriptDirectory.startsWith("blob:")?scriptDirectory="":scriptDirectory=scriptDirectory.substr(0,scriptDirectory.replace(/[?#].*/,"").lastIndexOf("/")+1),readAsync=async tr=>{var rr=await fetch(tr,{credentials:"same-origin"});if(rr.ok)return rr.arrayBuffer();throw new Error(rr.status+" : "+rr.url)});var out=Module.print||console.log.bind(console),err=Module.printErr||console.error.bind(console);Object.assign(Module,moduleOverrides),moduleOverrides=null,Module.arguments&&(arguments_=Module.arguments),Module.thisProgram&&(thisProgram=Module.thisProgram);var dynamicLibraries=Module.dynamicLibraries||[],wasmBinary=Module.wasmBinary,wasmMemory,ABORT=!1,EXITSTATUS;function assert(tr,rr){tr||abort(rr)}var HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAP64,HEAPF64;function updateMemoryViews(){var tr=wasmMemory.buffer;Module.HEAP8=HEAP8=new Int8Array(tr),Module.HEAP16=HEAP16=new Int16Array(tr),Module.HEAPU8=HEAPU8=new Uint8Array(tr),Module.HEAPU16=HEAPU16=new Uint16Array(tr),Module.HEAP32=HEAP32=new Int32Array(tr),Module.HEAPU32=HEAPU32=new Uint32Array(tr),Module.HEAPF32=HEAPF32=new Float32Array(tr),Module.HEAPF64=HEAPF64=new Float64Array(tr),Module.HEAP64=HEAP64=new BigInt64Array(tr),Module.HEAPU64=new BigUint64Array(tr)}if(Module.wasmMemory)wasmMemory=Module.wasmMemory;else{var INITIAL_MEMORY=Module.INITIAL_MEMORY||134217728;wasmMemory=new WebAssembly.Memory({initial:INITIAL_MEMORY/65536,maximum:32768})}updateMemoryViews();var __ATPRERUN__=[],__ATINIT__=[],__ATMAIN__=[],__ATPOSTRUN__=[],__RELOC_FUNCS__=[],runtimeInitialized=!1;function preRun(){if(Module.preRun)for(typeof Module.preRun=="function"&&(Module.preRun=[Module.preRun]);Module.preRun.length;)addOnPreRun(Module.preRun.shift());callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){runtimeInitialized=!0,callRuntimeCallbacks(__RELOC_FUNCS__),!Module.noFSInit&&!FS.initialized&&FS.init(),FS.ignorePermissions=!1,SOCKFS.root=FS.mount(SOCKFS,{},null),PIPEFS.root=FS.mount(PIPEFS,{},null),callRuntimeCallbacks(__ATINIT__)}function preMain(){callRuntimeCallbacks(__ATMAIN__)}function postRun(){if(Module.postRun)for(typeof Module.postRun=="function"&&(Module.postRun=[Module.postRun]);Module.postRun.length;)addOnPostRun(Module.postRun.shift());callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(tr){__ATPRERUN__.unshift(tr)}function addOnInit(tr){__ATINIT__.unshift(tr)}function addOnPostRun(tr){__ATPOSTRUN__.unshift(tr)}var runDependencies=0,dependenciesFulfilled=null;function addRunDependency(tr){var rr;runDependencies++,(rr=Module.monitorRunDependencies)==null||rr.call(Module,runDependencies)}function removeRunDependency(tr){var ir;if(runDependencies--,(ir=Module.monitorRunDependencies)==null||ir.call(Module,runDependencies),runDependencies==0&&dependenciesFulfilled){var rr=dependenciesFulfilled;dependenciesFulfilled=null,rr()}}function abort(tr){var ir;(ir=Module.onAbort)==null||ir.call(Module,tr),tr="Aborted("+tr+")",err(tr),ABORT=!0,tr+=". Build with -sASSERTIONS for more info.";var rr=new WebAssembly.RuntimeError(tr);throw readyPromiseReject(rr),rr}var dataURIPrefix="data:application/octet-stream;base64,",isDataURI=tr=>tr.startsWith(dataURIPrefix),isFileURI=tr=>tr.startsWith("file://");function findWasmBinary(){if(Module.locateFile){var tr="postgres.wasm";return isDataURI(tr)?tr:locateFile(tr)}return new URL(""+new URL("postgres-CyuUVpXN.wasm",import.meta.url).href,import.meta.url).href}var wasmBinaryFile;function getBinarySync(tr){if(tr==wasmBinaryFile&&wasmBinary)return new Uint8Array(wasmBinary);if(readBinary)return readBinary(tr);throw"both async and sync fetching of the wasm failed"}async function getWasmBinary(tr){if(!wasmBinary)try{var rr=await readAsync(tr);return new Uint8Array(rr)}catch{}return getBinarySync(tr)}async function instantiateArrayBuffer(tr,rr){try{var ir=await getWasmBinary(tr),lr=await WebAssembly.instantiate(ir,rr);return lr}catch(dr){err(`failed to asynchronously prepare wasm: ${dr}`),abort(dr)}}async function instantiateAsync(tr,rr,ir){if(!tr&&typeof WebAssembly.instantiateStreaming=="function"&&!isDataURI(rr)&&!ENVIRONMENT_IS_NODE&&typeof fetch=="function")try{var lr=fetch(rr,{credentials:"same-origin"}),dr=await WebAssembly.instantiateStreaming(lr,ir);return dr}catch(fr){err(`wasm streaming compile failed: ${fr}`),err("falling back to ArrayBuffer instantiation")}return instantiateArrayBuffer(rr,ir)}function getWasmImports(){return{env:wasmImports,wasi_snapshot_preview1:wasmImports,"GOT.mem":new Proxy(wasmImports,GOTHandler),"GOT.func":new Proxy(wasmImports,GOTHandler)}}async function createWasm(){function tr(dr,fr){wasmExports=dr.exports,wasmExports=relocateExports(wasmExports,16777216);var hr=getDylinkMetadata(fr);return hr.neededDynlibs&&(dynamicLibraries=hr.neededDynlibs.concat(dynamicLibraries)),mergeLibSymbols(wasmExports),LDSO.init(),loadDylibs(),addOnInit(wasmExports.__wasm_call_ctors),__RELOC_FUNCS__.push(wasmExports.__wasm_apply_data_relocs),removeRunDependency(),wasmExports}addRunDependency();function rr(dr){tr(dr.instance,dr.module)}var ir=getWasmImports();if(Module.instantiateWasm)try{return Module.instantiateWasm(ir,tr)}catch(dr){err(`Module.instantiateWasm callback failed with error: ${dr}`),readyPromiseReject(dr)}wasmBinaryFile??(wasmBinaryFile=findWasmBinary());try{var lr=await instantiateAsync(wasmBinary,wasmBinaryFile,ir);return rr(lr),lr}catch(dr){readyPromiseReject(dr);return}}var ASM_CONSTS={18792944:tr=>{Module.is_worker=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope,Module.FD_BUFFER_MAX=tr,Module.emscripten_copy_to=console.warn},18793117:()=>{Module.postMessage=function(tr){console.log("# 1252: onCustomMessage:",__FILE__,tr)}},18793242:()=>{if(Module.is_worker){let tr=function(rr){console.log("onCustomMessage:",rr)};Module.onCustomMessage=tr}else Module.postMessage=function(tr){switch(tr.type){case"raw":{stringToUTF8(tr.data,shm_rawinput,Module.FD_BUFFER_MAX);break}case"stdin":{stringToUTF8(tr.data,1,Module.FD_BUFFER_MAX);break}case"rcon":{stringToUTF8(tr.data,shm_rcon,Module.FD_BUFFER_MAX);break}default:console.warn("custom_postMessage?",tr)}}}};function is_web_env(){try{if(window)return 1}catch{return 0}}is_web_env.sig="i";class ExitStatus{constructor(rr){P$2(this,"name","ExitStatus"),this.message=`Program terminated with exit(${rr})`,this.status=rr}}var GOT={},currentModuleWeakSymbols=new Set([]),GOTHandler={get(tr,rr){var ir=GOT[rr];return ir||(ir=GOT[rr]=new WebAssembly.Global({value:"i32",mutable:!0})),currentModuleWeakSymbols.has(rr)||(ir.required=!0),ir}},callRuntimeCallbacks=tr=>{for(;tr.length>0;)tr.shift()(Module)},UTF8Decoder=typeof TextDecoder<"u"?new TextDecoder:void 0,UTF8ArrayToString=(tr,rr=0,ir=NaN)=>{for(var lr=rr+ir,dr=rr;tr[dr]&&!(dr>=lr);)++dr;if(dr-rr>16&&tr.buffer&&UTF8Decoder)return UTF8Decoder.decode(tr.subarray(rr,dr));for(var fr="";rr<dr;){var hr=tr[rr++];if(!(hr&128)){fr+=String.fromCharCode(hr);continue}var mr=tr[rr++]&63;if((hr&224)==192){fr+=String.fromCharCode((hr&31)<<6|mr);continue}var gr=tr[rr++]&63;if((hr&240)==224?hr=(hr&15)<<12|mr<<6|gr:hr=(hr&7)<<18|mr<<12|gr<<6|tr[rr++]&63,hr<65536)fr+=String.fromCharCode(hr);else{var yr=hr-65536;fr+=String.fromCharCode(55296|yr>>10,56320|yr&1023)}}return fr},getDylinkMetadata=tr=>{var rr=0,ir=0;function lr(){return tr[rr++]}function dr(){for(var qn=0,Xn=1;;){var Lr=tr[rr++];if(qn+=(Lr&127)*Xn,Xn*=128,!(Lr&128))break}return qn}function fr(){var qn=dr();return rr+=qn,UTF8ArrayToString(tr,rr-qn,qn)}function hr(qn,Xn){if(qn)throw new Error(Xn)}var mr="dylink.0";if(tr instanceof WebAssembly.Module){var gr=WebAssembly.Module.customSections(tr,mr);gr.length===0&&(mr="dylink",gr=WebAssembly.Module.customSections(tr,mr)),hr(gr.length===0,"need dylink section"),tr=new Uint8Array(gr[0]),ir=tr.length}else{var yr=new Uint32Array(new Uint8Array(tr.subarray(0,24)).buffer),_r=yr[0]==1836278016;hr(!_r,"need to see wasm magic number"),hr(tr[8]!==0,"need the dylink section to be first"),rr=9;var br=dr();ir=rr+br,mr=fr()}var vr={neededDynlibs:[],tlsExports:new Set,weakImports:new Set};if(mr=="dylink"){vr.memorySize=dr(),vr.memoryAlign=dr(),vr.tableSize=dr(),vr.tableAlign=dr();for(var wr=dr(),xr=0;xr<wr;++xr){var Sr=fr();vr.neededDynlibs.push(Sr)}}else{hr(mr!=="dylink.0");for(var Ar=1,Ir=2,Mr=3,Or=4,$r=256,Dr=3,zr=1;rr<ir;){var Fr=lr(),Jr=dr();if(Fr===Ar)vr.memorySize=dr(),vr.memoryAlign=dr(),vr.tableSize=dr(),vr.tableAlign=dr();else if(Fr===Ir)for(var wr=dr(),xr=0;xr<wr;++xr)Sr=fr(),vr.neededDynlibs.push(Sr);else if(Fr===Mr)for(var $n=dr();$n--;){var Qr=fr(),Zn=dr();Zn&$r&&vr.tlsExports.add(Qr)}else if(Fr===Or)for(var $n=dr();$n--;){fr();var Qr=fr(),Zn=dr();(Zn&Dr)==zr&&vr.weakImports.add(Qr)}else rr+=Jr}}return vr};function getValue(tr,rr="i8"){switch(rr.endsWith("*")&&(rr="*"),rr){case"i1":return HEAP8[tr];case"i8":return HEAP8[tr];case"i16":return HEAP16[tr>>1];case"i32":return HEAP32[tr>>2];case"i64":return HEAP64[tr>>3];case"float":return HEAPF32[tr>>2];case"double":return HEAPF64[tr>>3];case"*":return HEAPU32[tr>>2];default:abort(`invalid type for getValue: ${rr}`)}}var newDSO=(tr,rr,ir)=>{var lr={refcount:1/0,name:tr,exports:ir,global:!0};return LDSO.loadedLibsByName[tr]=lr,rr!=null&&(LDSO.loadedLibsByHandle[rr]=lr),lr},LDSO={loadedLibsByName:{},loadedLibsByHandle:{},init(){newDSO("__main__",0,wasmImports)}},___heap_base=23144432,alignMemory=(tr,rr)=>Math.ceil(tr/rr)*rr,getMemory=tr=>{if(runtimeInitialized)return _calloc(tr,1);var rr=___heap_base,ir=rr+alignMemory(tr,16);return ___heap_base=ir,GOT.__heap_base.value=ir,rr},isInternalSym=tr=>["__cpp_exception","__c_longjmp","__wasm_apply_data_relocs","__dso_handle","__tls_size","__tls_align","__set_stack_limits","_emscripten_tls_init","__wasm_init_tls","__wasm_call_ctors","__start_em_asm","__stop_em_asm","__start_em_js","__stop_em_js"].includes(tr)||tr.startsWith("__em_js__"),uleb128Encode=(tr,rr)=>{tr<128?rr.push(tr):rr.push(tr%128|128,tr>>7)},sigToWasmTypes=tr=>{for(var rr={i:"i32",j:"i64",f:"f32",d:"f64",e:"externref",p:"i32"},ir={parameters:[],results:tr[0]=="v"?[]:[rr[tr[0]]]},lr=1;lr<tr.length;++lr)ir.parameters.push(rr[tr[lr]]);return ir},generateFuncType=(tr,rr)=>{var ir=tr.slice(0,1),lr=tr.slice(1),dr={i:127,p:127,j:126,f:125,d:124,e:111};rr.push(96),uleb128Encode(lr.length,rr);for(var fr=0;fr<lr.length;++fr)rr.push(dr[lr[fr]]);ir=="v"?rr.push(0):rr.push(1,dr[ir])},convertJsFunctionToWasm=(tr,rr)=>{if(typeof WebAssembly.Function=="function")return new WebAssembly.Function(sigToWasmTypes(rr),tr);var ir=[1];generateFuncType(rr,ir);var lr=[0,97,115,109,1,0,0,0,1];uleb128Encode(ir.length,lr),lr.push(...ir),lr.push(2,7,1,1,101,1,102,0,0,7,5,1,1,102,0,0);var dr=new WebAssembly.Module(new Uint8Array(lr)),fr=new WebAssembly.Instance(dr,{e:{f:tr}}),hr=fr.exports.f;return hr},wasmTableMirror=[],wasmTable=new WebAssembly.Table({initial:5360,element:"anyfunc"}),getWasmTableEntry=tr=>{var rr=wasmTableMirror[tr];return rr||(tr>=wasmTableMirror.length&&(wasmTableMirror.length=tr+1),wasmTableMirror[tr]=rr=wasmTable.get(tr)),rr},updateTableMap=(tr,rr)=>{if(functionsInTableMap)for(var ir=tr;ir<tr+rr;ir++){var lr=getWasmTableEntry(ir);lr&&functionsInTableMap.set(lr,ir)}},functionsInTableMap,getFunctionAddress=tr=>(functionsInTableMap||(functionsInTableMap=new WeakMap,updateTableMap(0,wasmTable.length)),functionsInTableMap.get(tr)||0),freeTableIndexes=[],getEmptyTableSlot=()=>{if(freeTableIndexes.length)return freeTableIndexes.pop();try{wasmTable.grow(1)}catch(tr){throw tr instanceof RangeError?"Unable to grow wasm table. Set ALLOW_TABLE_GROWTH.":tr}return wasmTable.length-1},setWasmTableEntry=(tr,rr)=>{wasmTable.set(tr,rr),wasmTableMirror[tr]=wasmTable.get(tr)},addFunction=(tr,rr)=>{var ir=getFunctionAddress(tr);if(ir)return ir;var lr=getEmptyTableSlot();try{setWasmTableEntry(lr,tr)}catch(fr){if(!(fr instanceof TypeError))throw fr;var dr=convertJsFunctionToWasm(tr,rr);setWasmTableEntry(lr,dr)}return functionsInTableMap.set(tr,lr),lr},updateGOT=(tr,rr)=>{for(var ir in tr)if(!isInternalSym(ir)){var lr=tr[ir];GOT[ir]||(GOT[ir]=new WebAssembly.Global({value:"i32",mutable:!0})),GOT[ir].value==0&&(typeof lr=="function"?GOT[ir].value=addFunction(lr):typeof lr=="number"?GOT[ir].value=lr:err(`unhandled export type for '${ir}': ${typeof lr}`))}},relocateExports=(tr,rr,ir)=>{var lr={};for(var dr in tr){var fr=tr[dr];typeof fr=="object"&&(fr=fr.value),typeof fr=="number"&&(fr+=rr),lr[dr]=fr}return updateGOT(lr),lr},isSymbolDefined=tr=>{var rr=wasmImports[tr];return!(!rr||rr.stub)},dynCall=(tr,rr,ir=[])=>{var lr=getWasmTableEntry(rr)(...ir);return lr},stackSave=()=>_emscripten_stack_get_current(),stackRestore=tr=>__emscripten_stack_restore(tr),createInvokeFunction=tr=>(rr,...ir)=>{var lr=stackSave();try{return dynCall(tr,rr,ir)}catch(dr){if(stackRestore(lr),dr!==dr+0)throw dr;if(_setThrew(1,0),tr[0]=="j")return 0n}},resolveGlobalSymbol=(tr,rr=!1)=>{var ir;return isSymbolDefined(tr)?ir=wasmImports[tr]:tr.startsWith("invoke_")&&(ir=wasmImports[tr]=createInvokeFunction(tr.split("_")[1])),{sym:ir,name:tr}},UTF8ToString=(tr,rr)=>tr?UTF8ArrayToString(HEAPU8,tr,rr):"",loadWebAssemblyModule=(binary,flags,libName,localScope,handle)=>{var metadata=getDylinkMetadata(binary);currentModuleWeakSymbols=metadata.weakImports;function loadModule(){var firstLoad=!handle||!HEAP8[handle+8];if(firstLoad){var memAlign=Math.pow(2,metadata.memoryAlign),memoryBase=metadata.memorySize?alignMemory(getMemory(metadata.memorySize+memAlign),memAlign):0,tableBase=metadata.tableSize?wasmTable.length:0;handle&&(HEAP8[handle+8]=1,HEAPU32[handle+12>>2]=memoryBase,HEAP32[handle+16>>2]=metadata.memorySize,HEAPU32[handle+20>>2]=tableBase,HEAP32[handle+24>>2]=metadata.tableSize)}else memoryBase=HEAPU32[handle+12>>2],tableBase=HEAPU32[handle+20>>2];var tableGrowthNeeded=tableBase+metadata.tableSize-wasmTable.length;tableGrowthNeeded>0&&wasmTable.grow(tableGrowthNeeded);var moduleExports;function resolveSymbol(tr){var rr=resolveGlobalSymbol(tr).sym;return!rr&&localScope&&(rr=localScope[tr]),rr||(rr=moduleExports[tr]),rr}var proxyHandler={get(tr,rr){switch(rr){case"__memory_base":return memoryBase;case"__table_base":return tableBase}if(rr in wasmImports&&!wasmImports[rr].stub)return wasmImports[rr];if(!(rr in tr)){var ir;tr[rr]=(...lr)=>(ir||(ir=resolveSymbol(rr)),ir(...lr))}return tr[rr]}},proxy=new Proxy({},proxyHandler),info={"GOT.mem":new Proxy({},GOTHandler),"GOT.func":new Proxy({},GOTHandler),env:proxy,wasi_snapshot_preview1:proxy};function postInstantiation(module,instance){updateTableMap(tableBase,metadata.tableSize),moduleExports=relocateExports(instance.exports,memoryBase),flags.allowUndefined||reportUndefinedSymbols();function addEmAsm(addr,body){for(var args=[],arity=0;arity<16&&body.indexOf("$"+arity)!=-1;arity++)args.push("$"+arity);args=args.join(",");var func=`(${args}) => { ${body} };`;ASM_CONSTS[start]=eval(func)}if("__start_em_asm"in moduleExports)for(var start=moduleExports.__start_em_asm,stop=moduleExports.__stop_em_asm;start<stop;){var jsString=UTF8ToString(start);addEmAsm(start,jsString),start=HEAPU8.indexOf(0,start)+1}function addEmJs(name,cSig,body){var jsArgs=[];if(cSig=cSig.slice(1,-1),cSig!="void"){cSig=cSig.split(",");for(var i in cSig){var jsArg=cSig[i].split(" ").pop();jsArgs.push(jsArg.replaceAll("*",""))}}var func=`(${jsArgs}) => ${body};`;moduleExports[name]=eval(func)}for(var name in moduleExports)if(name.startsWith("__em_js__")){var start=moduleExports[name],jsString=UTF8ToString(start),parts=jsString.split("<::>");addEmJs(name.replace("__em_js__",""),parts[0],parts[1]),delete moduleExports[name]}var applyRelocs=moduleExports.__wasm_apply_data_relocs;applyRelocs&&(runtimeInitialized?applyRelocs():__RELOC_FUNCS__.push(applyRelocs));var init=moduleExports.__wasm_call_ctors;return init&&(runtimeInitialized?init():__ATINIT__.push(init)),moduleExports}if(flags.loadAsync){if(binary instanceof WebAssembly.Module){var instance=new WebAssembly.Instance(binary,info);return Promise.resolve(postInstantiation(binary,instance))}return WebAssembly.instantiate(binary,info).then(tr=>postInstantiation(tr.module,tr.instance))}var module=binary instanceof WebAssembly.Module?binary:new WebAssembly.Module(binary),instance=new WebAssembly.Instance(module,info);return postInstantiation(module,instance)}return flags.loadAsync?metadata.neededDynlibs.reduce((tr,rr)=>tr.then(()=>loadDynamicLibrary(rr,flags,localScope)),Promise.resolve()).then(loadModule):(metadata.neededDynlibs.forEach(tr=>loadDynamicLibrary(tr,flags,localScope)),loadModule())},mergeLibSymbols=(tr,rr)=>{for(var[ir,lr]of Object.entries(tr)){let dr=hr=>{isSymbolDefined(hr)||(wasmImports[hr]=lr)};dr(ir);let fr="__main_argc_argv";ir=="main"&&dr(fr),ir==fr&&dr("main")}},asyncLoad=async tr=>{var rr=await readAsync(tr);return new Uint8Array(rr)},preloadPlugins=Module.preloadPlugins||[],registerWasmPlugin=()=>{var tr={promiseChainEnd:Promise.resolve(),canHandle:rr=>!Module.noWasmDecoding&&rr.endsWith(".so"),handle:(rr,ir,lr,dr)=>{tr.promiseChainEnd=tr.promiseChainEnd.then(()=>loadWebAssemblyModule(rr,{loadAsync:!0,nodelete:!0},ir,{})).then(fr=>{preloadedWasm[ir]=fr,lr(rr)},fr=>{err(`failed to instantiate wasm: ${ir}: ${fr}`),dr()})}};preloadPlugins.push(tr)},preloadedWasm={};function loadDynamicLibrary(tr,rr={global:!0,nodelete:!0},ir,lr){var dr=LDSO.loadedLibsByName[tr];if(dr)return rr.global?dr.global||(dr.global=!0,mergeLibSymbols(dr.exports)):ir&&Object.assign(ir,dr.exports),rr.nodelete&&dr.refcount!==1/0&&(dr.refcount=1/0),dr.refcount++,lr&&(LDSO.loadedLibsByHandle[lr]=dr),rr.loadAsync?Promise.resolve(!0):!0;dr=newDSO(tr,lr,"loading"),dr.refcount=rr.nodelete?1/0:1,dr.global=rr.global;function fr(){if(lr){var gr=HEAPU32[lr+28>>2],yr=HEAPU32[lr+32>>2];if(gr&&yr){var _r=HEAP8.slice(gr,gr+yr);return rr.loadAsync?Promise.resolve(_r):_r}}var br=locateFile(tr);if(rr.loadAsync)return asyncLoad(br);if(!readBinary)throw new Error(`${br}: file not found, and synchronous loading of external files is not available`);return readBinary(br)}function hr(){var gr=preloadedWasm[tr];return gr?rr.loadAsync?Promise.resolve(gr):gr:rr.loadAsync?fr().then(yr=>loadWebAssemblyModule(yr,rr,tr,ir,lr)):loadWebAssemblyModule(fr(),rr,tr,ir,lr)}function mr(gr){dr.global?mergeLibSymbols(gr):ir&&Object.assign(ir,gr),dr.exports=gr}return rr.loadAsync?hr().then(gr=>(mr(gr),!0)):(mr(hr()),!0)}var reportUndefinedSymbols=()=>{for(var[tr,rr]of Object.entries(GOT))if(rr.value==0){var ir=resolveGlobalSymbol(tr,!0).sym;if(!ir&&!rr.required)continue;if(typeof ir=="function")rr.value=addFunction(ir,ir.sig);else if(typeof ir=="number")rr.value=ir;else throw new Error(`bad export type for '${tr}': ${typeof ir}`)}},loadDylibs=()=>{if(!dynamicLibraries.length){reportUndefinedSymbols();return}addRunDependency(),dynamicLibraries.reduce((tr,rr)=>tr.then(()=>loadDynamicLibrary(rr,{loadAsync:!0,global:!0,nodelete:!0,allowUndefined:!0})),Promise.resolve()).then(()=>{reportUndefinedSymbols(),removeRunDependency()})},noExitRuntime=Module.noExitRuntime||!0;function setValue(tr,rr,ir="i8"){switch(ir.endsWith("*")&&(ir="*"),ir){case"i1":HEAP8[tr]=rr;break;case"i8":HEAP8[tr]=rr;break;case"i16":HEAP16[tr>>1]=rr;break;case"i32":HEAP32[tr>>2]=rr;break;case"i64":HEAP64[tr>>3]=BigInt(rr);break;case"float":HEAPF32[tr>>2]=rr;break;case"double":HEAPF64[tr>>3]=rr;break;case"*":HEAPU32[tr>>2]=rr;break;default:abort(`invalid type for setValue: ${ir}`)}}var ___assert_fail=(tr,rr,ir,lr)=>abort(`Assertion failed: ${UTF8ToString(tr)}, at: `+[rr?UTF8ToString(rr):"unknown filename",ir,lr?UTF8ToString(lr):"unknown function"]);___assert_fail.sig="vppip";var ___call_sighandler=(tr,rr)=>getWasmTableEntry(tr)(rr);___call_sighandler.sig="vpi";var ___memory_base=new WebAssembly.Global({value:"i32",mutable:!1},16777216),___stack_pointer=new WebAssembly.Global({value:"i32",mutable:!0},23144432),PATH={isAbs:tr=>tr.charAt(0)==="/",splitPath:tr=>{var rr=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return rr.exec(tr).slice(1)},normalizeArray:(tr,rr)=>{for(var ir=0,lr=tr.length-1;lr>=0;lr--){var dr=tr[lr];dr==="."?tr.splice(lr,1):dr===".."?(tr.splice(lr,1),ir++):ir&&(tr.splice(lr,1),ir--)}if(rr)for(;ir;ir--)tr.unshift("..");return tr},normalize:tr=>{var rr=PATH.isAbs(tr),ir=tr.substr(-1)==="/";return tr=PATH.normalizeArray(tr.split("/").filter(lr=>!!lr),!rr).join("/"),!tr&&!rr&&(tr="."),tr&&ir&&(tr+="/"),(rr?"/":"")+tr},dirname:tr=>{var rr=PATH.splitPath(tr),ir=rr[0],lr=rr[1];return!ir&&!lr?".":(lr&&(lr=lr.substr(0,lr.length-1)),ir+lr)},basename:tr=>{if(tr==="/")return"/";tr=PATH.normalize(tr),tr=tr.replace(/\/$/,"");var rr=tr.lastIndexOf("/");return rr===-1?tr:tr.substr(rr+1)},join:(...tr)=>PATH.normalize(tr.join("/")),join2:(tr,rr)=>PATH.normalize(tr+"/"+rr)},initRandomFill=()=>{if(typeof crypto=="object"&&typeof crypto.getRandomValues=="function")return lr=>crypto.getRandomValues(lr);if(ENVIRONMENT_IS_NODE)try{var tr=require("crypto"),rr=tr.randomFillSync;if(rr)return lr=>tr.randomFillSync(lr);var ir=tr.randomBytes;return lr=>(lr.set(ir(lr.byteLength)),lr)}catch{}abort("initRandomDevice")},randomFill=tr=>(randomFill=initRandomFill())(tr),PATH_FS={resolve:(...tr)=>{for(var rr="",ir=!1,lr=tr.length-1;lr>=-1&&!ir;lr--){var dr=lr>=0?tr[lr]:FS.cwd();if(typeof dr!="string")throw new TypeError("Arguments to path.resolve must be strings");if(!dr)return"";rr=dr+"/"+rr,ir=PATH.isAbs(dr)}return rr=PATH.normalizeArray(rr.split("/").filter(fr=>!!fr),!ir).join("/"),(ir?"/":"")+rr||"."},relative:(tr,rr)=>{tr=PATH_FS.resolve(tr).substr(1),rr=PATH_FS.resolve(rr).substr(1);function ir(yr){for(var _r=0;_r<yr.length&&yr[_r]==="";_r++);for(var br=yr.length-1;br>=0&&yr[br]==="";br--);return _r>br?[]:yr.slice(_r,br-_r+1)}for(var lr=ir(tr.split("/")),dr=ir(rr.split("/")),fr=Math.min(lr.length,dr.length),hr=fr,mr=0;mr<fr;mr++)if(lr[mr]!==dr[mr]){hr=mr;break}for(var gr=[],mr=hr;mr<lr.length;mr++)gr.push("..");return gr=gr.concat(dr.slice(hr)),gr.join("/")}},FS_stdin_getChar_buffer=[],lengthBytesUTF8=tr=>{for(var rr=0,ir=0;ir<tr.length;++ir){var lr=tr.charCodeAt(ir);lr<=127?rr++:lr<=2047?rr+=2:lr>=55296&&lr<=57343?(rr+=4,++ir):rr+=3}return rr},stringToUTF8Array=(tr,rr,ir,lr)=>{if(!(lr>0))return 0;for(var dr=ir,fr=ir+lr-1,hr=0;hr<tr.length;++hr){var mr=tr.charCodeAt(hr);if(mr>=55296&&mr<=57343){var gr=tr.charCodeAt(++hr);mr=65536+((mr&1023)<<10)|gr&1023}if(mr<=127){if(ir>=fr)break;rr[ir++]=mr}else if(mr<=2047){if(ir+1>=fr)break;rr[ir++]=192|mr>>6,rr[ir++]=128|mr&63}else if(mr<=65535){if(ir+2>=fr)break;rr[ir++]=224|mr>>12,rr[ir++]=128|mr>>6&63,rr[ir++]=128|mr&63}else{if(ir+3>=fr)break;rr[ir++]=240|mr>>18,rr[ir++]=128|mr>>12&63,rr[ir++]=128|mr>>6&63,rr[ir++]=128|mr&63}}return rr[ir]=0,ir-dr};function intArrayFromString(tr,rr,ir){var lr=lengthBytesUTF8(tr)+1,dr=new Array(lr),fr=stringToUTF8Array(tr,dr,0,dr.length);return dr.length=fr,dr}var FS_stdin_getChar=()=>{if(!FS_stdin_getChar_buffer.length){var tr=null;if(ENVIRONMENT_IS_NODE){var rr=256,ir=Buffer.alloc(rr),lr=0,dr=process.stdin.fd;try{lr=fs.readSync(dr,ir,0,rr)}catch(fr){if(fr.toString().includes("EOF"))lr=0;else throw fr}lr>0&&(tr=ir.slice(0,lr).toString("utf-8"))}else typeof window<"u"&&typeof window.prompt=="function"&&(tr=window.prompt("Input: "),tr!==null&&(tr+=`
564
+ `);for(let lr of ir.rows)this.serializers[lr.typarray]=dr=>Ke$1(dr,this.serializers[lr.oid],lr.typarray),this.parsers[lr.typarray]=dr=>yn(dr,this.parsers[lr.oid],lr.typarray)}async refreshArrayTypes(){await this._initArrayTypes({force:!0})}async query(rr,ir,lr){return await this._checkReady(),await this._runExclusiveTransaction(async()=>await T$1(this,r$1,g$2).call(this,rr,ir,lr))}async sql(rr,...ir){let{query:lr,params:dr}=g$3(rr,...ir);return await this.query(lr,dr)}async exec(rr,ir){return await this._checkReady(),await this._runExclusiveTransaction(async()=>await T$1(this,r$1,h$1).call(this,rr,ir))}async describeQuery(rr,ir){try{await T$1(this,r$1,l).call(this,O$2.parse({text:rr,types:ir==null?void 0:ir.paramTypes}),ir);let lr=await T$1(this,r$1,l).call(this,O$2.describe({type:"S"}),ir),dr=lr.messages.find(gr=>gr.name==="parameterDescription"),fr=lr.messages.find(gr=>gr.name==="rowDescription"),hr=(dr==null?void 0:dr.dataTypeIDs.map(gr=>({dataTypeID:gr,serializer:this.serializers[gr]})))??[],mr=(fr==null?void 0:fr.fields.map(gr=>({name:gr.name,dataTypeID:gr.dataTypeID,parser:this.parsers[gr.dataTypeID]})))??[];return{queryParams:hr,resultFields:mr}}finally{await T$1(this,r$1,l).call(this,O$2.sync(),ir)}}async transaction(rr){return await this._checkReady(),await this._runExclusiveTransaction(async()=>{await T$1(this,r$1,h$1).call(this,"BEGIN"),x$3(this,u$1,!0);let ir=!1,lr=()=>{if(ir)throw new Error("Transaction is closed")},dr={query:async(fr,hr,mr)=>(lr(),await T$1(this,r$1,g$2).call(this,fr,hr,mr)),sql:async(fr,...hr)=>{let{query:mr,params:gr}=g$3(fr,...hr);return await T$1(this,r$1,g$2).call(this,mr,gr)},exec:async(fr,hr)=>(lr(),await T$1(this,r$1,h$1).call(this,fr,hr)),rollback:async()=>{lr(),await T$1(this,r$1,h$1).call(this,"ROLLBACK"),ir=!0},get closed(){return ir}};try{let fr=await rr(dr);return ir||(ir=!0,await T$1(this,r$1,h$1).call(this,"COMMIT")),x$3(this,u$1,!1),fr}catch(fr){throw ir||await T$1(this,r$1,h$1).call(this,"ROLLBACK"),x$3(this,u$1,!1),fr}})}async runExclusive(rr){return await this._runExclusiveQuery(rr)}};b$1=new WeakMap,u$1=new WeakMap,r$1=new WeakSet,l=async function(tr,rr={}){return await this.execProtocol(tr,{...rr,syncToFs:!1})},g$2=async function(tr,rr=[],ir){return await this._runExclusiveQuery(async()=>{T$1(this,r$1,R$1).call(this,"runQuery",tr,rr,ir),await this._handleBlob(ir==null?void 0:ir.blob);let lr;try{let{messages:fr}=await T$1(this,r$1,l).call(this,O$2.parse({text:tr,types:ir==null?void 0:ir.paramTypes}),ir),hr=De((await T$1(this,r$1,l).call(this,O$2.describe({type:"S"}),ir)).messages),mr=rr.map((gr,yr)=>{var vr;let _r=hr[yr];if(gr==null)return null;let br=((vr=ir==null?void 0:ir.serializers)==null?void 0:vr[_r])??this.serializers[_r];return br?br(gr):gr.toString()});lr=[...fr,...(await T$1(this,r$1,l).call(this,O$2.bind({values:mr}),ir)).messages,...(await T$1(this,r$1,l).call(this,O$2.describe({type:"P"}),ir)).messages,...(await T$1(this,r$1,l).call(this,O$2.execute({}),ir)).messages]}finally{await T$1(this,r$1,l).call(this,O$2.sync(),ir)}await this._cleanupBlob(),h$2(this,u$1)||await this.syncToFs();let dr=await this._getWrittenBlob();return bn(lr,this.parsers,ir,dr)[0]})},h$1=async function(tr,rr){return await this._runExclusiveQuery(async()=>{T$1(this,r$1,R$1).call(this,"runExec",tr,rr),await this._handleBlob(rr==null?void 0:rr.blob);let ir;try{ir=(await T$1(this,r$1,l).call(this,O$2.query(tr),rr)).messages}finally{await T$1(this,r$1,l).call(this,O$2.sync(),rr)}this._cleanupBlob(),h$2(this,u$1)||await this.syncToFs();let lr=await this._getWrittenBlob();return bn(ir,this.parsers,rr,lr)})},R$1=function(...tr){this.debug>0&&console.log(...tr)};var w$1=D$3((tr,rr)=>{u$2();var ir=9007199254740991,lr=(function(Ir){return Ir})();function dr(Ir){return Ir===lr}function fr(Ir){return typeof Ir=="string"||Object.prototype.toString.call(Ir)=="[object String]"}function hr(Ir){return Object.prototype.toString.call(Ir)=="[object Date]"}function mr(Ir){return Ir!==null&&typeof Ir=="object"}function gr(Ir){return typeof Ir=="function"}function yr(Ir){return typeof Ir=="number"&&Ir>-1&&Ir%1==0&&Ir<=ir}function _r(Ir){return Object.prototype.toString.call(Ir)=="[object Array]"}function br(Ir){return mr(Ir)&&!gr(Ir)&&yr(Ir.length)}function vr(Ir){return Object.prototype.toString.call(Ir)=="[object ArrayBuffer]"}function wr(Ir,Mr){return Array.prototype.map.call(Ir,Mr)}function xr(Ir,Mr){var Or=lr;return gr(Mr)&&Array.prototype.every.call(Ir,function($r,Dr,zr){var Fr=Mr($r,Dr,zr);return Fr&&(Or=$r),!Fr}),Or}function Sr(Ir){return Object.assign.apply(null,arguments)}function Ar(Ir){var Mr,Or,$r;if(fr(Ir)){for(Or=Ir.length,$r=new Uint8Array(Or),Mr=0;Mr<Or;Mr++)$r[Mr]=Ir.charCodeAt(Mr)&255;return $r}return vr(Ir)?new Uint8Array(Ir):mr(Ir)&&vr(Ir.buffer)?new Uint8Array(Ir.buffer):br(Ir)?new Uint8Array(Ir):mr(Ir)&&gr(Ir.toString)?Ar(Ir.toString()):new Uint8Array}rr.exports.MAX_SAFE_INTEGER=ir,rr.exports.isUndefined=dr,rr.exports.isString=fr,rr.exports.isObject=mr,rr.exports.isDateTime=hr,rr.exports.isFunction=gr,rr.exports.isArray=_r,rr.exports.isArrayLike=br,rr.exports.isArrayBuffer=vr,rr.exports.map=wr,rr.exports.find=xr,rr.exports.extend=Sr,rr.exports.toUint8Array=Ar}),x$1=D$3((tr,rr)=>{u$2();var ir="\0";rr.exports={NULL_CHAR:ir,TMAGIC:"ustar"+ir+"00",OLDGNU_MAGIC:"ustar "+ir,REGTYPE:0,LNKTYPE:1,SYMTYPE:2,CHRTYPE:3,BLKTYPE:4,DIRTYPE:5,FIFOTYPE:6,CONTTYPE:7,TSUID:parseInt("4000",8),TSGID:parseInt("2000",8),TSVTX:parseInt("1000",8),TUREAD:parseInt("0400",8),TUWRITE:parseInt("0200",8),TUEXEC:parseInt("0100",8),TGREAD:parseInt("0040",8),TGWRITE:parseInt("0020",8),TGEXEC:parseInt("0010",8),TOREAD:parseInt("0004",8),TOWRITE:parseInt("0002",8),TOEXEC:parseInt("0001",8),TPERMALL:parseInt("0777",8),TPERMMASK:parseInt("0777",8)}}),L$1=D$3((tr,rr)=>{u$2();var ir=w$1(),lr=x$1(),dr=512,fr=lr.TPERMALL,hr=0,mr=0,gr=[["name",100,0,function(Mr,Or){return br(Mr[Or[0]],Or[1])},function(Mr,Or,$r){return xr(Mr.slice(Or,Or+$r[1]))}],["mode",8,100,function(Mr,Or){var $r=Mr[Or[0]]||fr;return $r=$r&lr.TPERMMASK,vr($r,Or[1],fr)},function(Mr,Or,$r){var Dr=Sr(Mr.slice(Or,Or+$r[1]));return Dr&=lr.TPERMMASK,Dr}],["uid",8,108,function(Mr,Or){return vr(Mr[Or[0]],Or[1],hr)},function(Mr,Or,$r){return Sr(Mr.slice(Or,Or+$r[1]))}],["gid",8,116,function(Mr,Or){return vr(Mr[Or[0]],Or[1],mr)},function(Mr,Or,$r){return Sr(Mr.slice(Or,Or+$r[1]))}],["size",12,124,function(Mr,Or){return vr(Mr.data.length,Or[1])},function(Mr,Or,$r){return Sr(Mr.slice(Or,Or+$r[1]))}],["modifyTime",12,136,function(Mr,Or){return wr(Mr[Or[0]],Or[1])},function(Mr,Or,$r){return Ar(Mr.slice(Or,Or+$r[1]))}],["checksum",8,148,function(Mr,Or){return" "},function(Mr,Or,$r){return Sr(Mr.slice(Or,Or+$r[1]))}],["type",1,156,function(Mr,Or){return""+(parseInt(Mr[Or[0]],10)||0)%8},function(Mr,Or,$r){return(parseInt(String.fromCharCode(Mr[Or]),10)||0)%8}],["linkName",100,157,function(Mr,Or){return""},function(Mr,Or,$r){return xr(Mr.slice(Or,Or+$r[1]))}],["ustar",8,257,function(Mr,Or){return lr.TMAGIC},function(Mr,Or,$r){return _r(xr(Mr.slice(Or,Or+$r[1]),!0))},function(Mr,Or){return Mr[Or[0]]==lr.TMAGIC||Mr[Or[0]]==lr.OLDGNU_MAGIC}],["owner",32,265,function(Mr,Or){return br(Mr[Or[0]],Or[1])},function(Mr,Or,$r){return xr(Mr.slice(Or,Or+$r[1]))}],["group",32,297,function(Mr,Or){return br(Mr[Or[0]],Or[1])},function(Mr,Or,$r){return xr(Mr.slice(Or,Or+$r[1]))}],["majorNumber",8,329,function(Mr,Or){return""},function(Mr,Or,$r){return Sr(Mr.slice(Or,Or+$r[1]))}],["minorNumber",8,337,function(Mr,Or){return""},function(Mr,Or,$r){return Sr(Mr.slice(Or,Or+$r[1]))}],["prefix",131,345,function(Mr,Or){return br(Mr[Or[0]],Or[1])},function(Mr,Or,$r){return xr(Mr.slice(Or,Or+$r[1]))}],["accessTime",12,476,function(Mr,Or){return wr(Mr[Or[0]],Or[1])},function(Mr,Or,$r){return Ar(Mr.slice(Or,Or+$r[1]))}],["createTime",12,488,function(Mr,Or){return wr(Mr[Or[0]],Or[1])},function(Mr,Or,$r){return Ar(Mr.slice(Or,Or+$r[1]))}]],yr=(function(Mr){var Or=Mr[Mr.length-1];return Or[2]+Or[1]})(gr);function _r(Mr){if(Mr.length==8){var Or=Mr.split("");if(Or[5]==lr.NULL_CHAR)return(Or[6]==" "||Or[6]==lr.NULL_CHAR)&&(Or[6]="0"),(Or[7]==" "||Or[7]==lr.NULL_CHAR)&&(Or[7]="0"),Or=Or.join(""),Or==lr.TMAGIC?Or:Mr;if(Or[7]==lr.NULL_CHAR)return Or[5]==lr.NULL_CHAR&&(Or[5]=" "),Or[6]==lr.NULL_CHAR&&(Or[6]=" "),Or==lr.OLDGNU_MAGIC?Or:Mr}return Mr}function br(Mr,Or){return Or-=1,ir.isUndefined(Mr)&&(Mr=""),Mr=(""+Mr).substr(0,Or),Mr+lr.NULL_CHAR}function vr(Mr,Or,$r){for($r=parseInt($r)||0,Or-=1,Mr=(parseInt(Mr)||$r).toString(8).substr(-Or,Or);Mr.length<Or;)Mr="0"+Mr;return Mr+lr.NULL_CHAR}function wr(Mr,Or){if(ir.isDateTime(Mr))Mr=Math.floor(1*Mr/1e3);else if(Mr=parseInt(Mr,10),isFinite(Mr)){if(Mr<=0)return""}else Mr=Math.floor(1*new Date/1e3);return vr(Mr,Or,0)}function xr(Mr,Or){var $r=String.fromCharCode.apply(null,Mr);if(Or)return $r;var Dr=$r.indexOf(lr.NULL_CHAR);return Dr>=0?$r.substr(0,Dr):$r}function Sr(Mr){var Or=String.fromCharCode.apply(null,Mr);return parseInt(Or.replace(/^0+$/g,""),8)||0}function Ar(Mr){return Mr.length==0||Mr[0]==0?null:new Date(1e3*Sr(Mr))}function Ir(Mr,Or,$r){var Dr=parseInt(Or,10)||0,zr=Math.min(Dr+yr,Mr.length),Fr=0,Jr=0,$n=0;$r&&gr.every(function(Xn){return Xn[0]=="checksum"?(Jr=Dr+Xn[2],$n=Jr+Xn[1],!1):!0});for(var Qr=32,Zn=Dr;Zn<zr;Zn++){var qn=Zn>=Jr&&Zn<$n?Qr:Mr[Zn];Fr=(Fr+qn)%262144}return Fr}rr.exports.recordSize=dr,rr.exports.defaultFileMode=fr,rr.exports.defaultUid=hr,rr.exports.defaultGid=mr,rr.exports.posixHeader=gr,rr.exports.effectiveHeaderSize=yr,rr.exports.calculateChecksum=Ir,rr.exports.formatTarString=br,rr.exports.formatTarNumber=vr,rr.exports.formatTarDateTime=wr,rr.exports.parseTarString=xr,rr.exports.parseTarNumber=Sr,rr.exports.parseTarDateTime=Ar}),er=D$3((tr,rr)=>{u$2();var ir=x$1(),lr=w$1(),dr=L$1();function fr(br){return dr.recordSize}function hr(br){return Math.ceil(br.data.length/dr.recordSize)*dr.recordSize}function mr(br){var vr=0;return br.forEach(function(wr){vr+=fr()+hr(wr)}),vr+=dr.recordSize*2,new Uint8Array(vr)}function gr(br,vr,wr){wr=parseInt(wr)||0;var xr=wr;dr.posixHeader.forEach(function(Or){for(var $r=Or[3](vr,Or),Dr=$r.length,zr=0;zr<Dr;zr+=1)br[xr+zr]=$r.charCodeAt(zr)&255;xr+=Or[1]});var Sr=lr.find(dr.posixHeader,function(Or){return Or[0]=="checksum"});if(Sr){var Ar=dr.calculateChecksum(br,wr,!0),Ir=dr.formatTarNumber(Ar,Sr[1]-2)+ir.NULL_CHAR+" ";xr=wr+Sr[2];for(var Mr=0;Mr<Ir.length;Mr+=1)br[xr]=Ir.charCodeAt(Mr)&255,xr++}return wr+fr()}function yr(br,vr,wr){return wr=parseInt(wr,10)||0,br.set(vr.data,wr),wr+hr(vr)}function _r(br){br=lr.map(br,function(xr){return lr.extend({},xr,{data:lr.toUint8Array(xr.data)})});var vr=mr(br),wr=0;return br.forEach(function(xr){wr=gr(vr,xr,wr),wr=yr(vr,xr,wr)}),vr}rr.exports.tar=_r}),nr=D$3((tr,rr)=>{u$2();var ir=x$1(),lr=w$1(),dr=L$1(),fr={extractData:!0,checkHeader:!0,checkChecksum:!0,checkFileSize:!0},hr={size:!0,checksum:!0,ustar:!0},mr={unexpectedEndOfFile:"Unexpected end of file.",fileCorrupted:"File is corrupted.",checksumCheckFailed:"Checksum check failed."};function gr(Sr){return dr.recordSize}function yr(Sr){return Math.ceil(Sr/dr.recordSize)*dr.recordSize}function _r(Sr,Ar){for(var Ir=Ar,Mr=Math.min(Sr.length,Ar+dr.recordSize*2),Or=Ir;Or<Mr;Or++)if(Sr[Or]!=0)return!1;return!0}function br(Sr,Ar,Ir){if(Sr.length-Ar<dr.recordSize){if(Ir.checkFileSize)throw new Error(mr.unexpectedEndOfFile);return null}Ar=parseInt(Ar)||0;var Mr={},Or=Ar;if(dr.posixHeader.forEach(function(zr){Mr[zr[0]]=zr[4](Sr,Or,zr),Or+=zr[1]}),Mr.type!=0&&(Mr.size=0),Ir.checkHeader&&dr.posixHeader.forEach(function(zr){if(lr.isFunction(zr[5])&&!zr[5](Mr,zr)){var Fr=new Error(mr.fileCorrupted);throw Fr.data={offset:Ar+zr[2],field:zr[0]},Fr}}),Ir.checkChecksum){var $r=dr.calculateChecksum(Sr,Ar,!0);if($r!=Mr.checksum){var Dr=new Error(mr.checksumCheckFailed);throw Dr.data={offset:Ar,header:Mr,checksum:$r},Dr}}return Mr}function vr(Sr,Ar,Ir,Mr){return Mr.extractData?Ir.size<=0?new Uint8Array:Sr.slice(Ar,Ar+Ir.size):null}function wr(Sr,Ar){var Ir={};return dr.posixHeader.forEach(function(Mr){var Or=Mr[0];hr[Or]||(Ir[Or]=Sr[Or])}),Ir.isOldGNUFormat=Sr.ustar==ir.OLDGNU_MAGIC,Ar&&(Ir.data=Ar),Ir}function xr(Sr,Ar){Ar=lr.extend({},fr,Ar);for(var Ir=[],Mr=0,Or=Sr.length;Or-Mr>=dr.recordSize;){Sr=lr.toUint8Array(Sr);var $r=br(Sr,Mr,Ar);if(!$r)break;Mr+=gr();var Dr=vr(Sr,Mr,$r,Ar);if(Ir.push(wr($r,Dr)),Mr+=yr($r.size),_r(Sr,Mr))break}return Ir}rr.exports.untar=xr}),or$2=D$3((tr,rr)=>{u$2();var ir=w$1(),lr=x$1(),dr=er(),fr=nr();ir.extend(rr.exports,dr,fr,lr)});u$2();u$2();var g$1=L$3(or$2());async function H$2(tr,rr,ir="pgdata",lr="auto"){let dr=Br(tr,rr),[fr,hr]=await qr(dr,lr),mr=ir+(hr?".tar.gz":".tar"),gr=hr?"application/x-gzip":"application/x-tar";return typeof File<"u"?new File([fr],mr,{type:gr}):new Blob([fr],{type:gr})}var Hr=["application/x-gtar","application/x-tar+gzip","application/x-gzip","application/gzip"];async function ce$1(tr,rr,ir){let lr=new Uint8Array(await rr.arrayBuffer()),dr=typeof File<"u"&&rr instanceof File?rr.name:void 0;(Hr.includes(rr.type)||dr!=null&&dr.endsWith(".tgz")||dr!=null&&dr.endsWith(".tar.gz"))&&(lr=await ar(lr));let fr;try{fr=(0,g$1.untar)(lr)}catch(hr){if(hr instanceof Error&&hr.message.includes("File is corrupted"))lr=await ar(lr),fr=(0,g$1.untar)(lr);else throw hr}for(let hr of fr){let mr=ir+hr.name,gr=mr.split("/").slice(0,-1);for(let yr=1;yr<=gr.length;yr++){let _r=gr.slice(0,yr).join("/");tr.analyzePath(_r).exists||tr.mkdir(_r)}hr.type===g$1.REGTYPE?(tr.writeFile(mr,hr.data),tr.utime(mr,sr(hr.modifyTime),sr(hr.modifyTime))):hr.type===g$1.DIRTYPE&&tr.mkdir(mr)}}function jr(tr,rr){let ir=[],lr=dr=>{tr.readdir(dr).forEach(fr=>{if(fr==="."||fr==="..")return;let hr=dr+"/"+fr,mr=tr.stat(hr),gr=tr.isFile(mr.mode)?tr.readFile(hr,{encoding:"binary"}):new Uint8Array(0);ir.push({name:hr.substring(rr.length),mode:mr.mode,size:mr.size,type:tr.isFile(mr.mode)?g$1.REGTYPE:g$1.DIRTYPE,modifyTime:mr.mtime,data:gr}),tr.isDir(mr.mode)&&lr(hr)})};return lr(rr),ir}function Br(tr,rr){let ir=jr(tr,rr);return(0,g$1.tar)(ir)}async function qr(tr,rr="auto"){if(rr==="none")return[tr,!1];if(typeof CompressionStream<"u")return[await Yr(tr),!0];if(typeof process<"u"&&process.versions&&process.versions.node)return[await Wr(tr),!0];if(rr==="auto")return[tr,!1];throw new Error("Compression not supported in this environment")}async function Yr(tr){let rr=new CompressionStream("gzip"),ir=rr.writable.getWriter(),lr=rr.readable.getReader();ir.write(tr),ir.close();let dr=[];for(;;){let{value:mr,done:gr}=await lr.read();if(gr)break;mr&&dr.push(mr)}let fr=new Uint8Array(dr.reduce((mr,gr)=>mr+gr.length,0)),hr=0;return dr.forEach(mr=>{fr.set(mr,hr),hr+=mr.length}),fr}async function Wr(tr){let{promisify:rr}=await __vitePreload(()=>Promise.resolve().then(()=>__viteBrowserExternal$1),void 0,import.meta.url),{gzip:ir}=await __vitePreload(async()=>{const{gzip:lr}=await Promise.resolve().then(()=>__viteBrowserExternal$1);return{gzip:lr}},void 0,import.meta.url);return await rr(ir)(tr)}async function ar(tr){if(typeof CompressionStream<"u")return await Xr(tr);if(typeof process<"u"&&process.versions&&process.versions.node)return await Kr(tr);throw new Error("Unsupported environment for decompression")}async function Xr(tr){let rr=new DecompressionStream("gzip"),ir=rr.writable.getWriter(),lr=rr.readable.getReader();ir.write(tr),ir.close();let dr=[];for(;;){let{value:mr,done:gr}=await lr.read();if(gr)break;mr&&dr.push(mr)}let fr=new Uint8Array(dr.reduce((mr,gr)=>mr+gr.length,0)),hr=0;return dr.forEach(mr=>{fr.set(mr,hr),hr+=mr.length}),fr}async function Kr(tr){let{promisify:rr}=await __vitePreload(()=>Promise.resolve().then(()=>__viteBrowserExternal$1),void 0,import.meta.url),{gunzip:ir}=await __vitePreload(async()=>{const{gunzip:lr}=await Promise.resolve().then(()=>__viteBrowserExternal$1);return{gunzip:lr}},void 0,import.meta.url);return await rr(ir)(tr)}function sr(tr){return tr?typeof tr=="number"?tr:Math.floor(tr.getTime()/1e3):Math.floor(Date.now()/1e3)}var Vr="/tmp/pglite",C$1=Vr+"/base",ur=class{constructor(tr){this.dataDir=tr}async init(tr,rr){return this.pg=tr,{emscriptenOpts:rr}}async syncToFs(tr){}async initialSyncFs(){}async closeFs(){}async dumpTar(tr,rr){return H$2(this.pg.Module.FS,C$1,tr,rr)}},cr=class{constructor(tr,{debug:rr=!1}={}){this.dataDir=tr,this.debug=rr}async syncToFs(tr){}async initialSyncFs(){}async closeFs(){}async dumpTar(tr,rr){return H$2(this.pg.Module.FS,C$1,tr,rr)}async init(tr,rr){return this.pg=tr,{emscriptenOpts:{...rr,preRun:[...rr.preRun||[],ir=>{let lr=Zr(ir,this);ir.FS.mkdir(C$1),ir.FS.mount(lr,{},C$1)}]}}}},pr={EBADF:8,EBADFD:127,EEXIST:20,EINVAL:28,EISDIR:31,ENODEV:43,ENOENT:44,ENOTDIR:54,ENOTEMPTY:55},Zr=(tr,rr)=>{let ir=tr.FS,lr=rr.debug?console.log:null,dr={tryFSOperation(fr){try{return fr()}catch(hr){throw hr.code?hr.code==="UNKNOWN"?new ir.ErrnoError(pr.EINVAL):new ir.ErrnoError(hr.code):hr}},mount(fr){return dr.createNode(null,"/",16895,0)},syncfs(fr,hr,mr){},createNode(fr,hr,mr,gr){if(!ir.isDir(mr)&&!ir.isFile(mr))throw new ir.ErrnoError(28);let yr=ir.createNode(fr,hr,mr);return yr.node_ops=dr.node_ops,yr.stream_ops=dr.stream_ops,yr},getMode:function(fr){return lr==null||lr("getMode",fr),dr.tryFSOperation(()=>rr.lstat(fr).mode)},realPath:function(fr){let hr=[];for(;fr.parent!==fr;)hr.push(fr.name),fr=fr.parent;return hr.push(fr.mount.opts.root),hr.reverse(),hr.join("/")},node_ops:{getattr(fr){lr==null||lr("getattr",dr.realPath(fr));let hr=dr.realPath(fr);return dr.tryFSOperation(()=>{let mr=rr.lstat(hr);return{...mr,dev:0,ino:fr.id,nlink:1,rdev:fr.rdev,atime:new Date(mr.atime),mtime:new Date(mr.mtime),ctime:new Date(mr.ctime)}})},setattr(fr,hr){lr==null||lr("setattr",dr.realPath(fr),hr);let mr=dr.realPath(fr);dr.tryFSOperation(()=>{hr.mode!==void 0&&rr.chmod(mr,hr.mode),hr.size!==void 0&&rr.truncate(mr,hr.size),hr.timestamp!==void 0&&rr.utimes(mr,hr.timestamp,hr.timestamp),hr.size!==void 0&&rr.truncate(mr,hr.size)})},lookup(fr,hr){lr==null||lr("lookup",dr.realPath(fr),hr);let mr=[dr.realPath(fr),hr].join("/"),gr=dr.getMode(mr);return dr.createNode(fr,hr,gr)},mknod(fr,hr,mr,gr){lr==null||lr("mknod",dr.realPath(fr),hr,mr,gr);let yr=dr.createNode(fr,hr,mr,gr),_r=dr.realPath(yr);return dr.tryFSOperation(()=>(ir.isDir(yr.mode)?rr.mkdir(_r,{mode:mr}):rr.writeFile(_r,"",{mode:mr}),yr))},rename(fr,hr,mr){lr==null||lr("rename",dr.realPath(fr),dr.realPath(hr),mr);let gr=dr.realPath(fr),yr=[dr.realPath(hr),mr].join("/");dr.tryFSOperation(()=>{rr.rename(gr,yr)}),fr.name=mr},unlink(fr,hr){lr==null||lr("unlink",dr.realPath(fr),hr);let mr=[dr.realPath(fr),hr].join("/");try{rr.unlink(mr)}catch{}},rmdir(fr,hr){lr==null||lr("rmdir",dr.realPath(fr),hr);let mr=[dr.realPath(fr),hr].join("/");return dr.tryFSOperation(()=>{rr.rmdir(mr)})},readdir(fr){lr==null||lr("readdir",dr.realPath(fr));let hr=dr.realPath(fr);return dr.tryFSOperation(()=>rr.readdir(hr))},symlink(fr,hr,mr){throw lr==null||lr("symlink",dr.realPath(fr),hr,mr),new ir.ErrnoError(63)},readlink(fr){throw lr==null||lr("readlink",dr.realPath(fr)),new ir.ErrnoError(63)}},stream_ops:{open(fr){lr==null||lr("open stream",dr.realPath(fr.node));let hr=dr.realPath(fr.node);return dr.tryFSOperation(()=>{ir.isFile(fr.node.mode)&&(fr.shared.refcount=1,fr.nfd=rr.open(hr))})},close(fr){return lr==null||lr("close stream",dr.realPath(fr.node)),dr.tryFSOperation(()=>{ir.isFile(fr.node.mode)&&fr.nfd&&--fr.shared.refcount===0&&rr.close(fr.nfd)})},dup(fr){lr==null||lr("dup stream",dr.realPath(fr.node)),fr.shared.refcount++},read(fr,hr,mr,gr,yr){return lr==null||lr("read stream",dr.realPath(fr.node),mr,gr,yr),gr===0?0:dr.tryFSOperation(()=>rr.read(fr.nfd,hr,mr,gr,yr))},write(fr,hr,mr,gr,yr){return lr==null||lr("write stream",dr.realPath(fr.node),mr,gr,yr),dr.tryFSOperation(()=>rr.write(fr.nfd,hr.buffer,mr,gr,yr))},llseek(fr,hr,mr){lr==null||lr("llseek stream",dr.realPath(fr.node),hr,mr);let gr=hr;if(mr===1?gr+=fr.position:mr===2&&ir.isFile(fr.node.mode)&&dr.tryFSOperation(()=>{let yr=rr.fstat(fr.nfd);gr+=yr.size}),gr<0)throw new ir.ErrnoError(28);return gr},mmap(fr,hr,mr,gr,yr){if(lr==null||lr("mmap stream",dr.realPath(fr.node),hr,mr,gr,yr),!ir.isFile(fr.node.mode))throw new ir.ErrnoError(pr.ENODEV);let _r=tr.mmapAlloc(hr);return dr.stream_ops.read(fr,tr.HEAP8,_r,hr,mr),{ptr:_r,allocated:!0}},msync(fr,hr,mr,gr,yr){return lr==null||lr("msync stream",dr.realPath(fr.node),mr,gr,yr),dr.stream_ops.write(fr,hr,0,gr,mr),0}}};return dr};u$2();u$2();u$2();var He=new Error("request for lock canceled"),We=function(tr,rr,ir,lr){function dr(fr){return fr instanceof ir?fr:new ir(function(hr){hr(fr)})}return new(ir||(ir=Promise))(function(fr,hr){function mr(_r){try{yr(lr.next(_r))}catch(br){hr(br)}}function gr(_r){try{yr(lr.throw(_r))}catch(br){hr(br)}}function yr(_r){_r.done?fr(_r.value):dr(_r.value).then(mr,gr)}yr((lr=lr.apply(tr,[])).next())})},ce=class{constructor(tr,rr=He){this._value=tr,this._cancelError=rr,this._weightedQueues=[],this._weightedWaiters=[]}acquire(tr=1){if(tr<=0)throw new Error(`invalid weight ${tr}: must be positive`);return new Promise((rr,ir)=>{this._weightedQueues[tr-1]||(this._weightedQueues[tr-1]=[]),this._weightedQueues[tr-1].push({resolve:rr,reject:ir}),this._dispatch()})}runExclusive(tr,rr=1){return We(this,void 0,void 0,function*(){let[ir,lr]=yield this.acquire(rr);try{return yield tr(ir)}finally{lr()}})}waitForUnlock(tr=1){if(tr<=0)throw new Error(`invalid weight ${tr}: must be positive`);return new Promise(rr=>{this._weightedWaiters[tr-1]||(this._weightedWaiters[tr-1]=[]),this._weightedWaiters[tr-1].push(rr),this._dispatch()})}isLocked(){return this._value<=0}getValue(){return this._value}setValue(tr){this._value=tr,this._dispatch()}release(tr=1){if(tr<=0)throw new Error(`invalid weight ${tr}: must be positive`);this._value+=tr,this._dispatch()}cancel(){this._weightedQueues.forEach(tr=>tr.forEach(rr=>rr.reject(this._cancelError))),this._weightedQueues=[]}_dispatch(){var tr;for(let rr=this._value;rr>0;rr--){let ir=(tr=this._weightedQueues[rr-1])===null||tr===void 0?void 0:tr.shift();if(!ir)continue;let lr=this._value,dr=rr;this._value-=rr,rr=this._value+1,ir.resolve([lr,this._newReleaser(dr)])}this._drainUnlockWaiters()}_newReleaser(tr){let rr=!1;return()=>{rr||(rr=!0,this.release(tr))}}_drainUnlockWaiters(){for(let tr=this._value;tr>0;tr--)this._weightedWaiters[tr-1]&&(this._weightedWaiters[tr-1].forEach(rr=>rr()),this._weightedWaiters[tr-1]=[])}},je=function(tr,rr,ir,lr){function dr(fr){return fr instanceof ir?fr:new ir(function(hr){hr(fr)})}return new(ir||(ir=Promise))(function(fr,hr){function mr(_r){try{yr(lr.next(_r))}catch(br){hr(br)}}function gr(_r){try{yr(lr.throw(_r))}catch(br){hr(br)}}function yr(_r){_r.done?fr(_r.value):dr(_r.value).then(mr,gr)}yr((lr=lr.apply(tr,[])).next())})},H$1=class{constructor(rr){this._semaphore=new ce(1,rr)}acquire(){return je(this,void 0,void 0,function*(){let[,rr]=yield this._semaphore.acquire();return rr})}runExclusive(rr){return this._semaphore.runExclusive(()=>rr())}isLocked(){return this._semaphore.isLocked()}waitForUnlock(){return this._semaphore.waitForUnlock()}release(){this._semaphore.isLocked()&&this._semaphore.release()}cancel(){return this._semaphore.cancel()}};u$2();var Ie=L$3(or$2());async function ge(tr){if(Fe$1){let rr=await __vitePreload(()=>Promise.resolve().then(()=>__viteBrowserExternal$1),void 0,import.meta.url),ir=await __vitePreload(()=>Promise.resolve().then(()=>__viteBrowserExternal$1),void 0,import.meta.url),{Writable:lr}=await __vitePreload(async()=>{const{Writable:mr}=await Promise.resolve().then(()=>__viteBrowserExternal$1);return{Writable:mr}},void 0,import.meta.url),{pipeline:dr}=await __vitePreload(async()=>{const{pipeline:mr}=await Promise.resolve().then(()=>__viteBrowserExternal$1);return{pipeline:mr}},void 0,import.meta.url);if(!rr.existsSync(tr))throw new Error(`Extension bundle not found: ${tr}`);let fr=ir.createGunzip(),hr=[];return await dr(rr.createReadStream(tr),fr,new lr({write(mr,gr,yr){hr.push(mr),yr()}})),new Blob(hr)}else{let rr=await fetch(tr.toString());if(!rr.ok||!rr.body)return null;if(rr.headers.get("Content-Encoding")==="gzip")return rr.blob();{let ir=new DecompressionStream("gzip");return new Response(rr.body.pipeThrough(ir)).blob()}}}async function Pe(tr,rr){for(let ir in tr.pg_extensions){let lr;try{lr=await tr.pg_extensions[ir]}catch(dr){console.error("Failed to fetch extension:",ir,dr);continue}if(lr){let dr=new Uint8Array(await lr.arrayBuffer());Ve(tr,ir,dr,rr)}else console.error("Could not get binary data for extension:",ir)}}function Ve(tr,rr,ir,lr){Ie.default.untar(ir).forEach(dr=>{if(!dr.name.startsWith(".")){let fr=tr.WASM_PREFIX+"/"+dr.name;if(dr.name.endsWith(".so")){let hr=(...gr)=>{lr("pgfs:ext OK",fr,gr)},mr=(...gr)=>{lr("pgfs:ext FAIL",fr,gr)};tr.FS.createPreloadedFile(Ke(fr),dr.name.split("/").pop().slice(0,-3),dr.data,!0,!0,hr,mr,!1)}else tr.FS.writeFile(fr,dr.data)}})}function Ke(tr){let rr=tr.lastIndexOf("/");return rr>0?tr.slice(0,rr):tr}u$2();u$2();var ee=class extends ur{async init(tr,rr){return this.pg=tr,{emscriptenOpts:{...rr,preRun:[...rr.preRun||[],ir=>{let lr=ir.FS.filesystems.IDBFS;ir.FS.mkdir("/pglite"),ir.FS.mkdir(`/pglite/${this.dataDir}`),ir.FS.mount(lr,{},`/pglite/${this.dataDir}`),ir.FS.symlink(`/pglite/${this.dataDir}`,C$1)}]}}}initialSyncFs(){return new Promise((tr,rr)=>{this.pg.Module.FS.syncfs(!0,ir=>{ir?rr(ir):tr()})})}syncToFs(tr){return new Promise((rr,ir)=>{this.pg.Module.FS.syncfs(!1,lr=>{lr?ir(lr):rr()})})}async closeFs(){let tr=this.pg.Module.FS.filesystems.IDBFS.dbs[this.dataDir];tr&&tr.close(),this.pg.Module.FS.quit()}};u$2();var te=class extends ur{async closeFs(){this.pg.Module.FS.quit()}};function Fe(tr){let rr;if(tr!=null&&tr.startsWith("file://")){if(tr=tr.slice(7),!tr)throw new Error("Invalid dataDir, must be a valid path");rr="nodefs"}else tr!=null&&tr.startsWith("idb://")?(tr=tr.slice(6),rr="idbfs"):tr!=null&&tr.startsWith("opfs-ahp://")?(tr=tr.slice(11),rr="opfs-ahp"):!tr||tr!=null&&tr.startsWith("memory://")?rr="memoryfs":rr="nodefs";return{dataDir:tr,fsType:rr}}async function Ae(tr,rr){let ir;if(tr&&rr==="nodefs"){let{NodeFS:lr}=await __vitePreload(()=>import("./nodefs.BiUz1Kbc.js"),[],import.meta.url);ir=new lr(tr)}else if(tr&&rr==="idbfs")ir=new ee(tr);else if(tr&&rr==="opfs-ahp"){let{OpfsAhpFS:lr}=await __vitePreload(()=>import("./opfs-ahp.B2bR4XKE.js"),[],import.meta.url);ir=new lr(tr)}else ir=new te;return ir}u$2();u$2();var Qe=(()=>{var _scriptName=import.meta.url;return async function(moduleArg={}){var moduleRtn,Module=moduleArg,readyPromiseResolve,readyPromiseReject,readyPromise=new Promise((tr,rr)=>{readyPromiseResolve=tr,readyPromiseReject=rr}),ENVIRONMENT_IS_WEB=typeof window=="object",ENVIRONMENT_IS_WORKER=typeof WorkerGlobalScope<"u",ENVIRONMENT_IS_NODE=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string"&&process.type!="renderer";if(ENVIRONMENT_IS_NODE){let{createRequire:tr}=await __vitePreload(()=>Promise.resolve().then(()=>__viteBrowserExternal$1),void 0,import.meta.url),rr=import.meta.url;rr.startsWith("data:")&&(rr="/");var require=tr(rr)}Module.expectedDataFileDownloads??(Module.expectedDataFileDownloads=0),Module.expectedDataFileDownloads++,(()=>{var tr=typeof ENVIRONMENT_IS_PTHREAD<"u"&&ENVIRONMENT_IS_PTHREAD,rr=typeof ENVIRONMENT_IS_WASM_WORKER<"u"&&ENVIRONMENT_IS_WASM_WORKER;if(tr||rr)return;var ir=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string";function lr(dr){typeof window=="object"?window.encodeURIComponent(window.location.pathname.substring(0,window.location.pathname.lastIndexOf("/"))+"/"):typeof process>"u"&&typeof location<"u"&&encodeURIComponent(location.pathname.substring(0,location.pathname.lastIndexOf("/"))+"/");var fr="postgres.data",hr="postgres.data",mr=Module.locateFile?Module.locateFile(hr,""):hr,gr=dr.remote_package_size;function yr(xr,Sr,Ar,Ir){if(ir){require("fs").readFile(xr,(Mr,Or)=>{Mr?Ir(Mr):Ar(Or.buffer)});return}Module.dataFileDownloads??(Module.dataFileDownloads={}),fetch(xr).catch(Mr=>Promise.reject(new Error(`Network Error: ${xr}`,{cause:Mr}))).then(Mr=>{var Qr;if(!Mr.ok)return Promise.reject(new Error(`${Mr.status}: ${Mr.url}`));if(!Mr.body&&Mr.arrayBuffer)return Mr.arrayBuffer().then(Ar);let Or=Mr.body.getReader(),$r=()=>Or.read().then($n).catch(Zn=>Promise.reject(new Error(`Unexpected error while handling : ${Mr.url} ${Zn}`,{cause:Zn}))),Dr=[],zr=Mr.headers,Fr=Number(zr.get("Content-Length")??Sr),Jr=0,$n=({done:Zn,value:qn})=>{var Xn;if(Zn){let Lr=new Uint8Array(Dr.map(Hn=>Hn.length).reduce((Hn,ii)=>Hn+ii,0)),Gr=0;for(let Hn of Dr)Lr.set(Hn,Gr),Gr+=Hn.length;Ar(Lr.buffer)}else{Dr.push(qn),Jr+=qn.length,Module.dataFileDownloads[xr]={loaded:Jr,total:Fr};let Lr=0,Gr=0;for(let Hn of Object.values(Module.dataFileDownloads))Lr+=Hn.loaded,Gr+=Hn.total;return(Xn=Module.setStatus)==null||Xn.call(Module,`Downloading data... (${Lr}/${Gr})`),$r()}};return(Qr=Module.setStatus)==null||Qr.call(Module,"Downloading data..."),$r()})}function _r(xr){console.error("package error:",xr)}var br=null,vr=Module.getPreloadedPackage?Module.getPreloadedPackage(mr,gr):null;vr||yr(mr,gr,xr=>{br?(br(xr),br=null):vr=xr},_r);function wr(xr){function Sr($r,Dr){if(!$r)throw Dr+new Error().stack}xr.FS_createPath("/","home",!0,!0),xr.FS_createPath("/home","web_user",!0,!0),xr.FS_createPath("/","tmp",!0,!0),xr.FS_createPath("/tmp","pglite",!0,!0),xr.FS_createPath("/tmp/pglite","bin",!0,!0),xr.FS_createPath("/tmp/pglite","lib",!0,!0),xr.FS_createPath("/tmp/pglite/lib","postgresql",!0,!0),xr.FS_createPath("/tmp/pglite/lib/postgresql","pgxs",!0,!0),xr.FS_createPath("/tmp/pglite/lib/postgresql/pgxs","config",!0,!0),xr.FS_createPath("/tmp/pglite/lib/postgresql/pgxs","src",!0,!0),xr.FS_createPath("/tmp/pglite/lib/postgresql/pgxs/src","makefiles",!0,!0),xr.FS_createPath("/tmp/pglite/lib/postgresql/pgxs/src","test",!0,!0),xr.FS_createPath("/tmp/pglite/lib/postgresql/pgxs/src/test","isolation",!0,!0),xr.FS_createPath("/tmp/pglite/lib/postgresql/pgxs/src/test","regress",!0,!0),xr.FS_createPath("/tmp/pglite","share",!0,!0),xr.FS_createPath("/tmp/pglite/share","postgresql",!0,!0),xr.FS_createPath("/tmp/pglite/share/postgresql","extension",!0,!0),xr.FS_createPath("/tmp/pglite/share/postgresql","timezone",!0,!0),xr.FS_createPath("/tmp/pglite/share/postgresql/timezone","Africa",!0,!0),xr.FS_createPath("/tmp/pglite/share/postgresql/timezone","America",!0,!0),xr.FS_createPath("/tmp/pglite/share/postgresql/timezone/America","Argentina",!0,!0),xr.FS_createPath("/tmp/pglite/share/postgresql/timezone/America","Indiana",!0,!0),xr.FS_createPath("/tmp/pglite/share/postgresql/timezone/America","Kentucky",!0,!0),xr.FS_createPath("/tmp/pglite/share/postgresql/timezone/America","North_Dakota",!0,!0),xr.FS_createPath("/tmp/pglite/share/postgresql/timezone","Antarctica",!0,!0),xr.FS_createPath("/tmp/pglite/share/postgresql/timezone","Arctic",!0,!0),xr.FS_createPath("/tmp/pglite/share/postgresql/timezone","Asia",!0,!0),xr.FS_createPath("/tmp/pglite/share/postgresql/timezone","Atlantic",!0,!0),xr.FS_createPath("/tmp/pglite/share/postgresql/timezone","Australia",!0,!0),xr.FS_createPath("/tmp/pglite/share/postgresql/timezone","Brazil",!0,!0),xr.FS_createPath("/tmp/pglite/share/postgresql/timezone","Canada",!0,!0),xr.FS_createPath("/tmp/pglite/share/postgresql/timezone","Chile",!0,!0),xr.FS_createPath("/tmp/pglite/share/postgresql/timezone","Etc",!0,!0),xr.FS_createPath("/tmp/pglite/share/postgresql/timezone","Europe",!0,!0),xr.FS_createPath("/tmp/pglite/share/postgresql/timezone","Indian",!0,!0),xr.FS_createPath("/tmp/pglite/share/postgresql/timezone","Mexico",!0,!0),xr.FS_createPath("/tmp/pglite/share/postgresql/timezone","Pacific",!0,!0),xr.FS_createPath("/tmp/pglite/share/postgresql/timezone","US",!0,!0),xr.FS_createPath("/tmp/pglite/share/postgresql","timezonesets",!0,!0),xr.FS_createPath("/tmp/pglite/share/postgresql","tsearch_data",!0,!0);function Ar($r,Dr,zr){this.start=$r,this.end=Dr,this.audio=zr}Ar.prototype={requests:{},open:function($r,Dr){this.name=Dr,this.requests[Dr]=this,xr.addRunDependency(`fp ${this.name}`)},send:function(){},onload:function(){var $r=this.byteArray.subarray(this.start,this.end);this.finish($r)},finish:function($r){var Dr=this;xr.FS_createDataFile(this.name,null,$r,!0,!0,!0),xr.removeRunDependency(`fp ${Dr.name}`),this.requests[this.name]=null}};for(var Ir=dr.files,Mr=0;Mr<Ir.length;++Mr)new Ar(Ir[Mr].start,Ir[Mr].end,Ir[Mr].audio||0).open("GET",Ir[Mr].filename);function Or($r){Sr($r,"Loading data file failed."),Sr($r.constructor.name===ArrayBuffer.name,"bad input to processPackageData");var Dr=new Uint8Array($r);Ar.prototype.byteArray=Dr;for(var zr=dr.files,Fr=0;Fr<zr.length;++Fr)Ar.prototype.requests[zr[Fr].filename].onload();xr.removeRunDependency("datafile_postgres.data")}xr.addRunDependency("datafile_postgres.data"),xr.preloadResults??(xr.preloadResults={}),xr.preloadResults[fr]={fromCache:!1},vr?(Or(vr),vr=null):br=Or}Module.calledRun?wr(Module):(Module.preRun??(Module.preRun=[])).push(wr)}lr({files:[{filename:"/home/web_user/.pgpass",start:0,end:204},{filename:"/tmp/pglite/bin/initdb",start:204,end:216},{filename:"/tmp/pglite/bin/postgres",start:216,end:228},{filename:"/tmp/pglite/lib/postgresql/cyrillic_and_mic.so",start:228,end:20397},{filename:"/tmp/pglite/lib/postgresql/dict_snowball.so",start:20397,end:1581299},{filename:"/tmp/pglite/lib/postgresql/euc2004_sjis2004.so",start:1581299,end:1592382},{filename:"/tmp/pglite/lib/postgresql/euc_cn_and_mic.so",start:1592382,end:1599256},{filename:"/tmp/pglite/lib/postgresql/euc_jp_and_sjis.so",start:1599256,end:1622931},{filename:"/tmp/pglite/lib/postgresql/euc_kr_and_mic.so",start:1622931,end:1630057},{filename:"/tmp/pglite/lib/postgresql/euc_tw_and_big5.so",start:1630057,end:1651566},{filename:"/tmp/pglite/lib/postgresql/latin2_and_win1250.so",start:1651566,end:1660345},{filename:"/tmp/pglite/lib/postgresql/latin_and_mic.so",start:1660345,end:1668272},{filename:"/tmp/pglite/lib/postgresql/libpqwalreceiver.so",start:1668272,end:2186522},{filename:"/tmp/pglite/lib/postgresql/pgoutput.so",start:2186522,end:2303364},{filename:"/tmp/pglite/lib/postgresql/pgxs/config/install-sh",start:2303364,end:2317361},{filename:"/tmp/pglite/lib/postgresql/pgxs/config/missing",start:2317361,end:2318709},{filename:"/tmp/pglite/lib/postgresql/pgxs/src/Makefile.global",start:2318709,end:2354956},{filename:"/tmp/pglite/lib/postgresql/pgxs/src/Makefile.port",start:2354956,end:2355232},{filename:"/tmp/pglite/lib/postgresql/pgxs/src/Makefile.shlib",start:2355232,end:2371270},{filename:"/tmp/pglite/lib/postgresql/pgxs/src/makefiles/pgxs.mk",start:2371270,end:2386198},{filename:"/tmp/pglite/lib/postgresql/pgxs/src/nls-global.mk",start:2386198,end:2393083},{filename:"/tmp/pglite/lib/postgresql/pgxs/src/test/isolation/isolationtester.cjs",start:2393083,end:2589770},{filename:"/tmp/pglite/lib/postgresql/pgxs/src/test/isolation/pg_isolation_regress.cjs",start:2589770,end:2742128},{filename:"/tmp/pglite/lib/postgresql/pgxs/src/test/regress/pg_regress.cjs",start:2742128,end:2894476},{filename:"/tmp/pglite/lib/postgresql/plpgsql.so",start:2894476,end:3653241},{filename:"/tmp/pglite/password",start:3653241,end:3653250},{filename:"/tmp/pglite/share/postgresql/errcodes.txt",start:3653250,end:3686708},{filename:"/tmp/pglite/share/postgresql/extension/plpgsql--1.0.sql",start:3686708,end:3687366},{filename:"/tmp/pglite/share/postgresql/extension/plpgsql.control",start:3687366,end:3687559},{filename:"/tmp/pglite/share/postgresql/fix-CVE-2024-4317.sql",start:3687559,end:3693324},{filename:"/tmp/pglite/share/postgresql/information_schema.sql",start:3693324,end:3808299},{filename:"/tmp/pglite/share/postgresql/pg_hba.conf.sample",start:3808299,end:3813924},{filename:"/tmp/pglite/share/postgresql/pg_ident.conf.sample",start:3813924,end:3816564},{filename:"/tmp/pglite/share/postgresql/pg_service.conf.sample",start:3816564,end:3817168},{filename:"/tmp/pglite/share/postgresql/postgres.bki",start:3817168,end:4761272},{filename:"/tmp/pglite/share/postgresql/postgresql.conf.sample",start:4761272,end:4790919},{filename:"/tmp/pglite/share/postgresql/psqlrc.sample",start:4790919,end:4791197},{filename:"/tmp/pglite/share/postgresql/snowball_create.sql",start:4791197,end:4835373},{filename:"/tmp/pglite/share/postgresql/sql_features.txt",start:4835373,end:4871054},{filename:"/tmp/pglite/share/postgresql/system_constraints.sql",start:4871054,end:4879949},{filename:"/tmp/pglite/share/postgresql/system_functions.sql",start:4879949,end:4903264},{filename:"/tmp/pglite/share/postgresql/system_views.sql",start:4903264,end:4953537},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Abidjan",start:4953537,end:4953667},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Accra",start:4953667,end:4953797},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Addis_Ababa",start:4953797,end:4953988},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Algiers",start:4953988,end:4954458},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Asmara",start:4954458,end:4954649},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Asmera",start:4954649,end:4954840},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Bamako",start:4954840,end:4954970},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Bangui",start:4954970,end:4955150},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Banjul",start:4955150,end:4955280},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Bissau",start:4955280,end:4955429},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Blantyre",start:4955429,end:4955560},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Brazzaville",start:4955560,end:4955740},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Bujumbura",start:4955740,end:4955871},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Cairo",start:4955871,end:4957180},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Casablanca",start:4957180,end:4959099},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Ceuta",start:4959099,end:4959661},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Conakry",start:4959661,end:4959791},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Dakar",start:4959791,end:4959921},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Dar_es_Salaam",start:4959921,end:4960112},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Djibouti",start:4960112,end:4960303},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Douala",start:4960303,end:4960483},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/El_Aaiun",start:4960483,end:4962313},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Freetown",start:4962313,end:4962443},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Gaborone",start:4962443,end:4962574},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Harare",start:4962574,end:4962705},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Johannesburg",start:4962705,end:4962895},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Juba",start:4962895,end:4963353},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Kampala",start:4963353,end:4963544},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Khartoum",start:4963544,end:4964002},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Kigali",start:4964002,end:4964133},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Kinshasa",start:4964133,end:4964313},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Lagos",start:4964313,end:4964493},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Libreville",start:4964493,end:4964673},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Lome",start:4964673,end:4964803},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Luanda",start:4964803,end:4964983},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Lubumbashi",start:4964983,end:4965114},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Lusaka",start:4965114,end:4965245},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Malabo",start:4965245,end:4965425},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Maputo",start:4965425,end:4965556},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Maseru",start:4965556,end:4965746},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Mbabane",start:4965746,end:4965936},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Mogadishu",start:4965936,end:4966127},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Monrovia",start:4966127,end:4966291},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Nairobi",start:4966291,end:4966482},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Ndjamena",start:4966482,end:4966642},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Niamey",start:4966642,end:4966822},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Nouakchott",start:4966822,end:4966952},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Ouagadougou",start:4966952,end:4967082},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Porto-Novo",start:4967082,end:4967262},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Sao_Tome",start:4967262,end:4967435},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Timbuktu",start:4967435,end:4967565},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Tripoli",start:4967565,end:4967996},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Tunis",start:4967996,end:4968445},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Windhoek",start:4968445,end:4969083},{filename:"/tmp/pglite/share/postgresql/timezone/America/Adak",start:4969083,end:4970052},{filename:"/tmp/pglite/share/postgresql/timezone/America/Anchorage",start:4970052,end:4971029},{filename:"/tmp/pglite/share/postgresql/timezone/America/Anguilla",start:4971029,end:4971206},{filename:"/tmp/pglite/share/postgresql/timezone/America/Antigua",start:4971206,end:4971383},{filename:"/tmp/pglite/share/postgresql/timezone/America/Araguaina",start:4971383,end:4971975},{filename:"/tmp/pglite/share/postgresql/timezone/America/Argentina/Buenos_Aires",start:4971975,end:4972683},{filename:"/tmp/pglite/share/postgresql/timezone/America/Argentina/Catamarca",start:4972683,end:4973391},{filename:"/tmp/pglite/share/postgresql/timezone/America/Argentina/ComodRivadavia",start:4973391,end:4974099},{filename:"/tmp/pglite/share/postgresql/timezone/America/Argentina/Cordoba",start:4974099,end:4974807},{filename:"/tmp/pglite/share/postgresql/timezone/America/Argentina/Jujuy",start:4974807,end:4975497},{filename:"/tmp/pglite/share/postgresql/timezone/America/Argentina/La_Rioja",start:4975497,end:4976214},{filename:"/tmp/pglite/share/postgresql/timezone/America/Argentina/Mendoza",start:4976214,end:4976922},{filename:"/tmp/pglite/share/postgresql/timezone/America/Argentina/Rio_Gallegos",start:4976922,end:4977630},{filename:"/tmp/pglite/share/postgresql/timezone/America/Argentina/Salta",start:4977630,end:4978320},{filename:"/tmp/pglite/share/postgresql/timezone/America/Argentina/San_Juan",start:4978320,end:4979037},{filename:"/tmp/pglite/share/postgresql/timezone/America/Argentina/San_Luis",start:4979037,end:4979754},{filename:"/tmp/pglite/share/postgresql/timezone/America/Argentina/Tucuman",start:4979754,end:4980480},{filename:"/tmp/pglite/share/postgresql/timezone/America/Argentina/Ushuaia",start:4980480,end:4981188},{filename:"/tmp/pglite/share/postgresql/timezone/America/Aruba",start:4981188,end:4981365},{filename:"/tmp/pglite/share/postgresql/timezone/America/Asuncion",start:4981365,end:4982249},{filename:"/tmp/pglite/share/postgresql/timezone/America/Atikokan",start:4982249,end:4982398},{filename:"/tmp/pglite/share/postgresql/timezone/America/Atka",start:4982398,end:4983367},{filename:"/tmp/pglite/share/postgresql/timezone/America/Bahia",start:4983367,end:4984049},{filename:"/tmp/pglite/share/postgresql/timezone/America/Bahia_Banderas",start:4984049,end:4984777},{filename:"/tmp/pglite/share/postgresql/timezone/America/Barbados",start:4984777,end:4985055},{filename:"/tmp/pglite/share/postgresql/timezone/America/Belem",start:4985055,end:4985449},{filename:"/tmp/pglite/share/postgresql/timezone/America/Belize",start:4985449,end:4986494},{filename:"/tmp/pglite/share/postgresql/timezone/America/Blanc-Sablon",start:4986494,end:4986671},{filename:"/tmp/pglite/share/postgresql/timezone/America/Boa_Vista",start:4986671,end:4987101},{filename:"/tmp/pglite/share/postgresql/timezone/America/Bogota",start:4987101,end:4987280},{filename:"/tmp/pglite/share/postgresql/timezone/America/Boise",start:4987280,end:4988279},{filename:"/tmp/pglite/share/postgresql/timezone/America/Buenos_Aires",start:4988279,end:4988987},{filename:"/tmp/pglite/share/postgresql/timezone/America/Cambridge_Bay",start:4988987,end:4989870},{filename:"/tmp/pglite/share/postgresql/timezone/America/Campo_Grande",start:4989870,end:4990822},{filename:"/tmp/pglite/share/postgresql/timezone/America/Cancun",start:4990822,end:4991351},{filename:"/tmp/pglite/share/postgresql/timezone/America/Caracas",start:4991351,end:4991541},{filename:"/tmp/pglite/share/postgresql/timezone/America/Catamarca",start:4991541,end:4992249},{filename:"/tmp/pglite/share/postgresql/timezone/America/Cayenne",start:4992249,end:4992400},{filename:"/tmp/pglite/share/postgresql/timezone/America/Cayman",start:4992400,end:4992549},{filename:"/tmp/pglite/share/postgresql/timezone/America/Chicago",start:4992549,end:4994303},{filename:"/tmp/pglite/share/postgresql/timezone/America/Chihuahua",start:4994303,end:4994994},{filename:"/tmp/pglite/share/postgresql/timezone/America/Ciudad_Juarez",start:4994994,end:4995712},{filename:"/tmp/pglite/share/postgresql/timezone/America/Coral_Harbour",start:4995712,end:4995861},{filename:"/tmp/pglite/share/postgresql/timezone/America/Cordoba",start:4995861,end:4996569},{filename:"/tmp/pglite/share/postgresql/timezone/America/Costa_Rica",start:4996569,end:4996801},{filename:"/tmp/pglite/share/postgresql/timezone/America/Creston",start:4996801,end:4997041},{filename:"/tmp/pglite/share/postgresql/timezone/America/Cuiaba",start:4997041,end:4997975},{filename:"/tmp/pglite/share/postgresql/timezone/America/Curacao",start:4997975,end:4998152},{filename:"/tmp/pglite/share/postgresql/timezone/America/Danmarkshavn",start:4998152,end:4998599},{filename:"/tmp/pglite/share/postgresql/timezone/America/Dawson",start:4998599,end:4999628},{filename:"/tmp/pglite/share/postgresql/timezone/America/Dawson_Creek",start:4999628,end:5000311},{filename:"/tmp/pglite/share/postgresql/timezone/America/Denver",start:5000311,end:5001353},{filename:"/tmp/pglite/share/postgresql/timezone/America/Detroit",start:5001353,end:5002252},{filename:"/tmp/pglite/share/postgresql/timezone/America/Dominica",start:5002252,end:5002429},{filename:"/tmp/pglite/share/postgresql/timezone/America/Edmonton",start:5002429,end:5003399},{filename:"/tmp/pglite/share/postgresql/timezone/America/Eirunepe",start:5003399,end:5003835},{filename:"/tmp/pglite/share/postgresql/timezone/America/El_Salvador",start:5003835,end:5004011},{filename:"/tmp/pglite/share/postgresql/timezone/America/Ensenada",start:5004011,end:5005036},{filename:"/tmp/pglite/share/postgresql/timezone/America/Fort_Nelson",start:5005036,end:5006484},{filename:"/tmp/pglite/share/postgresql/timezone/America/Fort_Wayne",start:5006484,end:5007015},{filename:"/tmp/pglite/share/postgresql/timezone/America/Fortaleza",start:5007015,end:5007499},{filename:"/tmp/pglite/share/postgresql/timezone/America/Glace_Bay",start:5007499,end:5008379},{filename:"/tmp/pglite/share/postgresql/timezone/America/Godthab",start:5008379,end:5009344},{filename:"/tmp/pglite/share/postgresql/timezone/America/Goose_Bay",start:5009344,end:5010924},{filename:"/tmp/pglite/share/postgresql/timezone/America/Grand_Turk",start:5010924,end:5011777},{filename:"/tmp/pglite/share/postgresql/timezone/America/Grenada",start:5011777,end:5011954},{filename:"/tmp/pglite/share/postgresql/timezone/America/Guadeloupe",start:5011954,end:5012131},{filename:"/tmp/pglite/share/postgresql/timezone/America/Guatemala",start:5012131,end:5012343},{filename:"/tmp/pglite/share/postgresql/timezone/America/Guayaquil",start:5012343,end:5012522},{filename:"/tmp/pglite/share/postgresql/timezone/America/Guyana",start:5012522,end:5012703},{filename:"/tmp/pglite/share/postgresql/timezone/America/Halifax",start:5012703,end:5014375},{filename:"/tmp/pglite/share/postgresql/timezone/America/Havana",start:5014375,end:5015492},{filename:"/tmp/pglite/share/postgresql/timezone/America/Hermosillo",start:5015492,end:5015778},{filename:"/tmp/pglite/share/postgresql/timezone/America/Indiana/Indianapolis",start:5015778,end:5016309},{filename:"/tmp/pglite/share/postgresql/timezone/America/Indiana/Knox",start:5016309,end:5017325},{filename:"/tmp/pglite/share/postgresql/timezone/America/Indiana/Marengo",start:5017325,end:5017892},{filename:"/tmp/pglite/share/postgresql/timezone/America/Indiana/Petersburg",start:5017892,end:5018575},{filename:"/tmp/pglite/share/postgresql/timezone/America/Indiana/Tell_City",start:5018575,end:5019097},{filename:"/tmp/pglite/share/postgresql/timezone/America/Indiana/Vevay",start:5019097,end:5019466},{filename:"/tmp/pglite/share/postgresql/timezone/America/Indiana/Vincennes",start:5019466,end:5020024},{filename:"/tmp/pglite/share/postgresql/timezone/America/Indiana/Winamac",start:5020024,end:5020636},{filename:"/tmp/pglite/share/postgresql/timezone/America/Indianapolis",start:5020636,end:5021167},{filename:"/tmp/pglite/share/postgresql/timezone/America/Inuvik",start:5021167,end:5021984},{filename:"/tmp/pglite/share/postgresql/timezone/America/Iqaluit",start:5021984,end:5022839},{filename:"/tmp/pglite/share/postgresql/timezone/America/Jamaica",start:5022839,end:5023178},{filename:"/tmp/pglite/share/postgresql/timezone/America/Jujuy",start:5023178,end:5023868},{filename:"/tmp/pglite/share/postgresql/timezone/America/Juneau",start:5023868,end:5024834},{filename:"/tmp/pglite/share/postgresql/timezone/America/Kentucky/Louisville",start:5024834,end:5026076},{filename:"/tmp/pglite/share/postgresql/timezone/America/Kentucky/Monticello",start:5026076,end:5027048},{filename:"/tmp/pglite/share/postgresql/timezone/America/Knox_IN",start:5027048,end:5028064},{filename:"/tmp/pglite/share/postgresql/timezone/America/Kralendijk",start:5028064,end:5028241},{filename:"/tmp/pglite/share/postgresql/timezone/America/La_Paz",start:5028241,end:5028411},{filename:"/tmp/pglite/share/postgresql/timezone/America/Lima",start:5028411,end:5028694},{filename:"/tmp/pglite/share/postgresql/timezone/America/Los_Angeles",start:5028694,end:5029988},{filename:"/tmp/pglite/share/postgresql/timezone/America/Louisville",start:5029988,end:5031230},{filename:"/tmp/pglite/share/postgresql/timezone/America/Lower_Princes",start:5031230,end:5031407},{filename:"/tmp/pglite/share/postgresql/timezone/America/Maceio",start:5031407,end:5031909},{filename:"/tmp/pglite/share/postgresql/timezone/America/Managua",start:5031909,end:5032204},{filename:"/tmp/pglite/share/postgresql/timezone/America/Manaus",start:5032204,end:5032616},{filename:"/tmp/pglite/share/postgresql/timezone/America/Marigot",start:5032616,end:5032793},{filename:"/tmp/pglite/share/postgresql/timezone/America/Martinique",start:5032793,end:5032971},{filename:"/tmp/pglite/share/postgresql/timezone/America/Matamoros",start:5032971,end:5033408},{filename:"/tmp/pglite/share/postgresql/timezone/America/Mazatlan",start:5033408,end:5034126},{filename:"/tmp/pglite/share/postgresql/timezone/America/Mendoza",start:5034126,end:5034834},{filename:"/tmp/pglite/share/postgresql/timezone/America/Menominee",start:5034834,end:5035751},{filename:"/tmp/pglite/share/postgresql/timezone/America/Merida",start:5035751,end:5036405},{filename:"/tmp/pglite/share/postgresql/timezone/America/Metlakatla",start:5036405,end:5037e3},{filename:"/tmp/pglite/share/postgresql/timezone/America/Mexico_City",start:5037e3,end:5037773},{filename:"/tmp/pglite/share/postgresql/timezone/America/Miquelon",start:5037773,end:5038323},{filename:"/tmp/pglite/share/postgresql/timezone/America/Moncton",start:5038323,end:5039816},{filename:"/tmp/pglite/share/postgresql/timezone/America/Monterrey",start:5039816,end:5040460},{filename:"/tmp/pglite/share/postgresql/timezone/America/Montevideo",start:5040460,end:5041429},{filename:"/tmp/pglite/share/postgresql/timezone/America/Montreal",start:5041429,end:5043146},{filename:"/tmp/pglite/share/postgresql/timezone/America/Montserrat",start:5043146,end:5043323},{filename:"/tmp/pglite/share/postgresql/timezone/America/Nassau",start:5043323,end:5045040},{filename:"/tmp/pglite/share/postgresql/timezone/America/New_York",start:5045040,end:5046784},{filename:"/tmp/pglite/share/postgresql/timezone/America/Nipigon",start:5046784,end:5048501},{filename:"/tmp/pglite/share/postgresql/timezone/America/Nome",start:5048501,end:5049476},{filename:"/tmp/pglite/share/postgresql/timezone/America/Noronha",start:5049476,end:5049960},{filename:"/tmp/pglite/share/postgresql/timezone/America/North_Dakota/Beulah",start:5049960,end:5051003},{filename:"/tmp/pglite/share/postgresql/timezone/America/North_Dakota/Center",start:5051003,end:5051993},{filename:"/tmp/pglite/share/postgresql/timezone/America/North_Dakota/New_Salem",start:5051993,end:5052983},{filename:"/tmp/pglite/share/postgresql/timezone/America/Nuuk",start:5052983,end:5053948},{filename:"/tmp/pglite/share/postgresql/timezone/America/Ojinaga",start:5053948,end:5054657},{filename:"/tmp/pglite/share/postgresql/timezone/America/Panama",start:5054657,end:5054806},{filename:"/tmp/pglite/share/postgresql/timezone/America/Pangnirtung",start:5054806,end:5055661},{filename:"/tmp/pglite/share/postgresql/timezone/America/Paramaribo",start:5055661,end:5055848},{filename:"/tmp/pglite/share/postgresql/timezone/America/Phoenix",start:5055848,end:5056088},{filename:"/tmp/pglite/share/postgresql/timezone/America/Port-au-Prince",start:5056088,end:5056653},{filename:"/tmp/pglite/share/postgresql/timezone/America/Port_of_Spain",start:5056653,end:5056830},{filename:"/tmp/pglite/share/postgresql/timezone/America/Porto_Acre",start:5056830,end:5057248},{filename:"/tmp/pglite/share/postgresql/timezone/America/Porto_Velho",start:5057248,end:5057642},{filename:"/tmp/pglite/share/postgresql/timezone/America/Puerto_Rico",start:5057642,end:5057819},{filename:"/tmp/pglite/share/postgresql/timezone/America/Punta_Arenas",start:5057819,end:5059037},{filename:"/tmp/pglite/share/postgresql/timezone/America/Rainy_River",start:5059037,end:5060331},{filename:"/tmp/pglite/share/postgresql/timezone/America/Rankin_Inlet",start:5060331,end:5061138},{filename:"/tmp/pglite/share/postgresql/timezone/America/Recife",start:5061138,end:5061622},{filename:"/tmp/pglite/share/postgresql/timezone/America/Regina",start:5061622,end:5062260},{filename:"/tmp/pglite/share/postgresql/timezone/America/Resolute",start:5062260,end:5063067},{filename:"/tmp/pglite/share/postgresql/timezone/America/Rio_Branco",start:5063067,end:5063485},{filename:"/tmp/pglite/share/postgresql/timezone/America/Rosario",start:5063485,end:5064193},{filename:"/tmp/pglite/share/postgresql/timezone/America/Santa_Isabel",start:5064193,end:5065218},{filename:"/tmp/pglite/share/postgresql/timezone/America/Santarem",start:5065218,end:5065627},{filename:"/tmp/pglite/share/postgresql/timezone/America/Santiago",start:5065627,end:5066981},{filename:"/tmp/pglite/share/postgresql/timezone/America/Santo_Domingo",start:5066981,end:5067298},{filename:"/tmp/pglite/share/postgresql/timezone/America/Sao_Paulo",start:5067298,end:5068250},{filename:"/tmp/pglite/share/postgresql/timezone/America/Scoresbysund",start:5068250,end:5069234},{filename:"/tmp/pglite/share/postgresql/timezone/America/Shiprock",start:5069234,end:5070276},{filename:"/tmp/pglite/share/postgresql/timezone/America/Sitka",start:5070276,end:5071232},{filename:"/tmp/pglite/share/postgresql/timezone/America/St_Barthelemy",start:5071232,end:5071409},{filename:"/tmp/pglite/share/postgresql/timezone/America/St_Johns",start:5071409,end:5073287},{filename:"/tmp/pglite/share/postgresql/timezone/America/St_Kitts",start:5073287,end:5073464},{filename:"/tmp/pglite/share/postgresql/timezone/America/St_Lucia",start:5073464,end:5073641},{filename:"/tmp/pglite/share/postgresql/timezone/America/St_Thomas",start:5073641,end:5073818},{filename:"/tmp/pglite/share/postgresql/timezone/America/St_Vincent",start:5073818,end:5073995},{filename:"/tmp/pglite/share/postgresql/timezone/America/Swift_Current",start:5073995,end:5074363},{filename:"/tmp/pglite/share/postgresql/timezone/America/Tegucigalpa",start:5074363,end:5074557},{filename:"/tmp/pglite/share/postgresql/timezone/America/Thule",start:5074557,end:5075012},{filename:"/tmp/pglite/share/postgresql/timezone/America/Thunder_Bay",start:5075012,end:5076729},{filename:"/tmp/pglite/share/postgresql/timezone/America/Tijuana",start:5076729,end:5077754},{filename:"/tmp/pglite/share/postgresql/timezone/America/Toronto",start:5077754,end:5079471},{filename:"/tmp/pglite/share/postgresql/timezone/America/Tortola",start:5079471,end:5079648},{filename:"/tmp/pglite/share/postgresql/timezone/America/Vancouver",start:5079648,end:5080978},{filename:"/tmp/pglite/share/postgresql/timezone/America/Virgin",start:5080978,end:5081155},{filename:"/tmp/pglite/share/postgresql/timezone/America/Whitehorse",start:5081155,end:5082184},{filename:"/tmp/pglite/share/postgresql/timezone/America/Winnipeg",start:5082184,end:5083478},{filename:"/tmp/pglite/share/postgresql/timezone/America/Yakutat",start:5083478,end:5084424},{filename:"/tmp/pglite/share/postgresql/timezone/America/Yellowknife",start:5084424,end:5085394},{filename:"/tmp/pglite/share/postgresql/timezone/Antarctica/Casey",start:5085394,end:5085681},{filename:"/tmp/pglite/share/postgresql/timezone/Antarctica/Davis",start:5085681,end:5085878},{filename:"/tmp/pglite/share/postgresql/timezone/Antarctica/DumontDUrville",start:5085878,end:5086032},{filename:"/tmp/pglite/share/postgresql/timezone/Antarctica/Macquarie",start:5086032,end:5087008},{filename:"/tmp/pglite/share/postgresql/timezone/Antarctica/Mawson",start:5087008,end:5087160},{filename:"/tmp/pglite/share/postgresql/timezone/Antarctica/McMurdo",start:5087160,end:5088203},{filename:"/tmp/pglite/share/postgresql/timezone/Antarctica/Palmer",start:5088203,end:5089090},{filename:"/tmp/pglite/share/postgresql/timezone/Antarctica/Rothera",start:5089090,end:5089222},{filename:"/tmp/pglite/share/postgresql/timezone/Antarctica/South_Pole",start:5089222,end:5090265},{filename:"/tmp/pglite/share/postgresql/timezone/Antarctica/Syowa",start:5090265,end:5090398},{filename:"/tmp/pglite/share/postgresql/timezone/Antarctica/Troll",start:5090398,end:5090575},{filename:"/tmp/pglite/share/postgresql/timezone/Antarctica/Vostok",start:5090575,end:5090745},{filename:"/tmp/pglite/share/postgresql/timezone/Arctic/Longyearbyen",start:5090745,end:5091450},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Aden",start:5091450,end:5091583},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Almaty",start:5091583,end:5092201},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Amman",start:5092201,end:5093129},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Anadyr",start:5093129,end:5093872},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Aqtau",start:5093872,end:5094478},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Aqtobe",start:5094478,end:5095093},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Ashgabat",start:5095093,end:5095468},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Ashkhabad",start:5095468,end:5095843},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Atyrau",start:5095843,end:5096459},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Baghdad",start:5096459,end:5097089},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Bahrain",start:5097089,end:5097241},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Baku",start:5097241,end:5097985},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Bangkok",start:5097985,end:5098137},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Barnaul",start:5098137,end:5098890},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Beirut",start:5098890,end:5099622},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Bishkek",start:5099622,end:5100240},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Brunei",start:5100240,end:5100560},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Calcutta",start:5100560,end:5100780},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Chita",start:5100780,end:5101530},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Choibalsan",start:5101530,end:5102149},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Chongqing",start:5102149,end:5102542},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Chungking",start:5102542,end:5102935},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Colombo",start:5102935,end:5103182},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Dacca",start:5103182,end:5103413},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Damascus",start:5103413,end:5104647},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Dhaka",start:5104647,end:5104878},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Dili",start:5104878,end:5105048},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Dubai",start:5105048,end:5105181},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Dushanbe",start:5105181,end:5105547},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Famagusta",start:5105547,end:5106487},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Gaza",start:5106487,end:5108933},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Harbin",start:5108933,end:5109326},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Hebron",start:5109326,end:5111790},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Ho_Chi_Minh",start:5111790,end:5112026},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Hong_Kong",start:5112026,end:5112801},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Hovd",start:5112801,end:5113395},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Irkutsk",start:5113395,end:5114155},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Istanbul",start:5114155,end:5115355},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Jakarta",start:5115355,end:5115603},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Jayapura",start:5115603,end:5115774},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Jerusalem",start:5115774,end:5116848},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Kabul",start:5116848,end:5117007},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Kamchatka",start:5117007,end:5117734},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Karachi",start:5117734,end:5118e3},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Kashgar",start:5118e3,end:5118133},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Kathmandu",start:5118133,end:5118294},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Katmandu",start:5118294,end:5118455},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Khandyga",start:5118455,end:5119230},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Kolkata",start:5119230,end:5119450},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Krasnoyarsk",start:5119450,end:5120191},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Kuala_Lumpur",start:5120191,end:5120447},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Kuching",start:5120447,end:5120767},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Kuwait",start:5120767,end:5120900},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Macao",start:5120900,end:5121691},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Macau",start:5121691,end:5122482},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Magadan",start:5122482,end:5123233},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Makassar",start:5123233,end:5123423},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Manila",start:5123423,end:5123661},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Muscat",start:5123661,end:5123794},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Nicosia",start:5123794,end:5124391},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Novokuznetsk",start:5124391,end:5125117},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Novosibirsk",start:5125117,end:5125870},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Omsk",start:5125870,end:5126611},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Oral",start:5126611,end:5127236},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Phnom_Penh",start:5127236,end:5127388},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Pontianak",start:5127388,end:5127635},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Pyongyang",start:5127635,end:5127818},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Qatar",start:5127818,end:5127970},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Qostanay",start:5127970,end:5128594},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Qyzylorda",start:5128594,end:5129218},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Rangoon",start:5129218,end:5129405},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Riyadh",start:5129405,end:5129538},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Saigon",start:5129538,end:5129774},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Sakhalin",start:5129774,end:5130529},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Samarkand",start:5130529,end:5130895},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Seoul",start:5130895,end:5131310},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Shanghai",start:5131310,end:5131703},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Singapore",start:5131703,end:5131959},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Srednekolymsk",start:5131959,end:5132701},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Taipei",start:5132701,end:5133212},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Tashkent",start:5133212,end:5133578},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Tbilisi",start:5133578,end:5134207},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Tehran",start:5134207,end:5135019},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Tel_Aviv",start:5135019,end:5136093},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Thimbu",start:5136093,end:5136247},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Thimphu",start:5136247,end:5136401},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Tokyo",start:5136401,end:5136614},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Tomsk",start:5136614,end:5137367},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Ujung_Pandang",start:5137367,end:5137557},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Ulaanbaatar",start:5137557,end:5138151},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Ulan_Bator",start:5138151,end:5138745},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Urumqi",start:5138745,end:5138878},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Ust-Nera",start:5138878,end:5139649},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Vientiane",start:5139649,end:5139801},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Vladivostok",start:5139801,end:5140543},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Yakutsk",start:5140543,end:5141284},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Yangon",start:5141284,end:5141471},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Yekaterinburg",start:5141471,end:5142231},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Yerevan",start:5142231,end:5142939},{filename:"/tmp/pglite/share/postgresql/timezone/Atlantic/Azores",start:5142939,end:5144392},{filename:"/tmp/pglite/share/postgresql/timezone/Atlantic/Bermuda",start:5144392,end:5145416},{filename:"/tmp/pglite/share/postgresql/timezone/Atlantic/Canary",start:5145416,end:5145894},{filename:"/tmp/pglite/share/postgresql/timezone/Atlantic/Cape_Verde",start:5145894,end:5146069},{filename:"/tmp/pglite/share/postgresql/timezone/Atlantic/Faeroe",start:5146069,end:5146510},{filename:"/tmp/pglite/share/postgresql/timezone/Atlantic/Faroe",start:5146510,end:5146951},{filename:"/tmp/pglite/share/postgresql/timezone/Atlantic/Jan_Mayen",start:5146951,end:5147656},{filename:"/tmp/pglite/share/postgresql/timezone/Atlantic/Madeira",start:5147656,end:5149109},{filename:"/tmp/pglite/share/postgresql/timezone/Atlantic/Reykjavik",start:5149109,end:5149239},{filename:"/tmp/pglite/share/postgresql/timezone/Atlantic/South_Georgia",start:5149239,end:5149371},{filename:"/tmp/pglite/share/postgresql/timezone/Atlantic/St_Helena",start:5149371,end:5149501},{filename:"/tmp/pglite/share/postgresql/timezone/Atlantic/Stanley",start:5149501,end:5150290},{filename:"/tmp/pglite/share/postgresql/timezone/Australia/ACT",start:5150290,end:5151194},{filename:"/tmp/pglite/share/postgresql/timezone/Australia/Adelaide",start:5151194,end:5152115},{filename:"/tmp/pglite/share/postgresql/timezone/Australia/Brisbane",start:5152115,end:5152404},{filename:"/tmp/pglite/share/postgresql/timezone/Australia/Broken_Hill",start:5152404,end:5153345},{filename:"/tmp/pglite/share/postgresql/timezone/Australia/Canberra",start:5153345,end:5154249},{filename:"/tmp/pglite/share/postgresql/timezone/Australia/Currie",start:5154249,end:5155252},{filename:"/tmp/pglite/share/postgresql/timezone/Australia/Darwin",start:5155252,end:5155486},{filename:"/tmp/pglite/share/postgresql/timezone/Australia/Eucla",start:5155486,end:5155800},{filename:"/tmp/pglite/share/postgresql/timezone/Australia/Hobart",start:5155800,end:5156803},{filename:"/tmp/pglite/share/postgresql/timezone/Australia/LHI",start:5156803,end:5157495},{filename:"/tmp/pglite/share/postgresql/timezone/Australia/Lindeman",start:5157495,end:5157820},{filename:"/tmp/pglite/share/postgresql/timezone/Australia/Lord_Howe",start:5157820,end:5158512},{filename:"/tmp/pglite/share/postgresql/timezone/Australia/Melbourne",start:5158512,end:5159416},{filename:"/tmp/pglite/share/postgresql/timezone/Australia/NSW",start:5159416,end:5160320},{filename:"/tmp/pglite/share/postgresql/timezone/Australia/North",start:5160320,end:5160554},{filename:"/tmp/pglite/share/postgresql/timezone/Australia/Perth",start:5160554,end:5160860},{filename:"/tmp/pglite/share/postgresql/timezone/Australia/Queensland",start:5160860,end:5161149},{filename:"/tmp/pglite/share/postgresql/timezone/Australia/South",start:5161149,end:5162070},{filename:"/tmp/pglite/share/postgresql/timezone/Australia/Sydney",start:5162070,end:5162974},{filename:"/tmp/pglite/share/postgresql/timezone/Australia/Tasmania",start:5162974,end:5163977},{filename:"/tmp/pglite/share/postgresql/timezone/Australia/Victoria",start:5163977,end:5164881},{filename:"/tmp/pglite/share/postgresql/timezone/Australia/West",start:5164881,end:5165187},{filename:"/tmp/pglite/share/postgresql/timezone/Australia/Yancowinna",start:5165187,end:5166128},{filename:"/tmp/pglite/share/postgresql/timezone/Brazil/Acre",start:5166128,end:5166546},{filename:"/tmp/pglite/share/postgresql/timezone/Brazil/DeNoronha",start:5166546,end:5167030},{filename:"/tmp/pglite/share/postgresql/timezone/Brazil/East",start:5167030,end:5167982},{filename:"/tmp/pglite/share/postgresql/timezone/Brazil/West",start:5167982,end:5168394},{filename:"/tmp/pglite/share/postgresql/timezone/CET",start:5168394,end:5169015},{filename:"/tmp/pglite/share/postgresql/timezone/CST6CDT",start:5169015,end:5169966},{filename:"/tmp/pglite/share/postgresql/timezone/Canada/Atlantic",start:5169966,end:5171638},{filename:"/tmp/pglite/share/postgresql/timezone/Canada/Central",start:5171638,end:5172932},{filename:"/tmp/pglite/share/postgresql/timezone/Canada/Eastern",start:5172932,end:5174649},{filename:"/tmp/pglite/share/postgresql/timezone/Canada/Mountain",start:5174649,end:5175619},{filename:"/tmp/pglite/share/postgresql/timezone/Canada/Newfoundland",start:5175619,end:5177497},{filename:"/tmp/pglite/share/postgresql/timezone/Canada/Pacific",start:5177497,end:5178827},{filename:"/tmp/pglite/share/postgresql/timezone/Canada/Saskatchewan",start:5178827,end:5179465},{filename:"/tmp/pglite/share/postgresql/timezone/Canada/Yukon",start:5179465,end:5180494},{filename:"/tmp/pglite/share/postgresql/timezone/Chile/Continental",start:5180494,end:5181848},{filename:"/tmp/pglite/share/postgresql/timezone/Chile/EasterIsland",start:5181848,end:5183022},{filename:"/tmp/pglite/share/postgresql/timezone/Cuba",start:5183022,end:5184139},{filename:"/tmp/pglite/share/postgresql/timezone/EET",start:5184139,end:5184636},{filename:"/tmp/pglite/share/postgresql/timezone/EST",start:5184636,end:5184747},{filename:"/tmp/pglite/share/postgresql/timezone/EST5EDT",start:5184747,end:5185698},{filename:"/tmp/pglite/share/postgresql/timezone/Egypt",start:5185698,end:5187007},{filename:"/tmp/pglite/share/postgresql/timezone/Eire",start:5187007,end:5188503},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/GMT",start:5188503,end:5188614},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/GMT+0",start:5188614,end:5188725},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/GMT+1",start:5188725,end:5188838},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/GMT+10",start:5188838,end:5188952},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/GMT+11",start:5188952,end:5189066},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/GMT+12",start:5189066,end:5189180},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/GMT+2",start:5189180,end:5189293},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/GMT+3",start:5189293,end:5189406},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/GMT+4",start:5189406,end:5189519},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/GMT+5",start:5189519,end:5189632},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/GMT+6",start:5189632,end:5189745},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/GMT+7",start:5189745,end:5189858},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/GMT+8",start:5189858,end:5189971},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/GMT+9",start:5189971,end:5190084},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/GMT-0",start:5190084,end:5190195},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/GMT-1",start:5190195,end:5190309},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/GMT-10",start:5190309,end:5190424},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/GMT-11",start:5190424,end:5190539},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/GMT-12",start:5190539,end:5190654},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/GMT-13",start:5190654,end:5190769},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/GMT-14",start:5190769,end:5190884},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/GMT-2",start:5190884,end:5190998},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/GMT-3",start:5190998,end:5191112},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/GMT-4",start:5191112,end:5191226},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/GMT-5",start:5191226,end:5191340},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/GMT-6",start:5191340,end:5191454},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/GMT-7",start:5191454,end:5191568},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/GMT-8",start:5191568,end:5191682},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/GMT-9",start:5191682,end:5191796},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/GMT0",start:5191796,end:5191907},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/Greenwich",start:5191907,end:5192018},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/UCT",start:5192018,end:5192129},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/UTC",start:5192129,end:5192240},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/Universal",start:5192240,end:5192351},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/Zulu",start:5192351,end:5192462},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Amsterdam",start:5192462,end:5193565},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Andorra",start:5193565,end:5193954},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Astrakhan",start:5193954,end:5194680},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Athens",start:5194680,end:5195362},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Belfast",start:5195362,end:5196961},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Belgrade",start:5196961,end:5197439},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Berlin",start:5197439,end:5198144},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Bratislava",start:5198144,end:5198867},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Brussels",start:5198867,end:5199970},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Bucharest",start:5199970,end:5200631},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Budapest",start:5200631,end:5201397},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Busingen",start:5201397,end:5201894},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Chisinau",start:5201894,end:5202649},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Copenhagen",start:5202649,end:5203354},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Dublin",start:5203354,end:5204850},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Gibraltar",start:5204850,end:5206070},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Guernsey",start:5206070,end:5207669},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Helsinki",start:5207669,end:5208150},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Isle_of_Man",start:5208150,end:5209749},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Istanbul",start:5209749,end:5210949},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Jersey",start:5210949,end:5212548},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Kaliningrad",start:5212548,end:5213452},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Kiev",start:5213452,end:5214010},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Kirov",start:5214010,end:5214745},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Kyiv",start:5214745,end:5215303},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Lisbon",start:5215303,end:5216757},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Ljubljana",start:5216757,end:5217235},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/London",start:5217235,end:5218834},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Luxembourg",start:5218834,end:5219937},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Madrid",start:5219937,end:5220834},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Malta",start:5220834,end:5221762},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Mariehamn",start:5221762,end:5222243},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Minsk",start:5222243,end:5223051},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Monaco",start:5223051,end:5224156},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Moscow",start:5224156,end:5225064},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Nicosia",start:5225064,end:5225661},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Oslo",start:5225661,end:5226366},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Paris",start:5226366,end:5227471},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Podgorica",start:5227471,end:5227949},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Prague",start:5227949,end:5228672},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Riga",start:5228672,end:5229366},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Rome",start:5229366,end:5230313},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Samara",start:5230313,end:5231045},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/San_Marino",start:5231045,end:5231992},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Sarajevo",start:5231992,end:5232470},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Saratov",start:5232470,end:5233196},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Simferopol",start:5233196,end:5234061},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Skopje",start:5234061,end:5234539},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Sofia",start:5234539,end:5235131},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Stockholm",start:5235131,end:5235836},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Tallinn",start:5235836,end:5236511},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Tirane",start:5236511,end:5237115},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Tiraspol",start:5237115,end:5237870},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Ulyanovsk",start:5237870,end:5238630},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Uzhgorod",start:5238630,end:5239188},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Vaduz",start:5239188,end:5239685},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Vatican",start:5239685,end:5240632},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Vienna",start:5240632,end:5241290},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Vilnius",start:5241290,end:5241966},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Volgograd",start:5241966,end:5242719},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Warsaw",start:5242719,end:5243642},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Zagreb",start:5243642,end:5244120},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Zaporozhye",start:5244120,end:5244678},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Zurich",start:5244678,end:5245175},{filename:"/tmp/pglite/share/postgresql/timezone/Factory",start:5245175,end:5245288},{filename:"/tmp/pglite/share/postgresql/timezone/GB",start:5245288,end:5246887},{filename:"/tmp/pglite/share/postgresql/timezone/GB-Eire",start:5246887,end:5248486},{filename:"/tmp/pglite/share/postgresql/timezone/GMT",start:5248486,end:5248597},{filename:"/tmp/pglite/share/postgresql/timezone/GMT+0",start:5248597,end:5248708},{filename:"/tmp/pglite/share/postgresql/timezone/GMT-0",start:5248708,end:5248819},{filename:"/tmp/pglite/share/postgresql/timezone/GMT0",start:5248819,end:5248930},{filename:"/tmp/pglite/share/postgresql/timezone/Greenwich",start:5248930,end:5249041},{filename:"/tmp/pglite/share/postgresql/timezone/HST",start:5249041,end:5249153},{filename:"/tmp/pglite/share/postgresql/timezone/Hongkong",start:5249153,end:5249928},{filename:"/tmp/pglite/share/postgresql/timezone/Iceland",start:5249928,end:5250058},{filename:"/tmp/pglite/share/postgresql/timezone/Indian/Antananarivo",start:5250058,end:5250249},{filename:"/tmp/pglite/share/postgresql/timezone/Indian/Chagos",start:5250249,end:5250401},{filename:"/tmp/pglite/share/postgresql/timezone/Indian/Christmas",start:5250401,end:5250553},{filename:"/tmp/pglite/share/postgresql/timezone/Indian/Cocos",start:5250553,end:5250740},{filename:"/tmp/pglite/share/postgresql/timezone/Indian/Comoro",start:5250740,end:5250931},{filename:"/tmp/pglite/share/postgresql/timezone/Indian/Kerguelen",start:5250931,end:5251083},{filename:"/tmp/pglite/share/postgresql/timezone/Indian/Mahe",start:5251083,end:5251216},{filename:"/tmp/pglite/share/postgresql/timezone/Indian/Maldives",start:5251216,end:5251368},{filename:"/tmp/pglite/share/postgresql/timezone/Indian/Mauritius",start:5251368,end:5251547},{filename:"/tmp/pglite/share/postgresql/timezone/Indian/Mayotte",start:5251547,end:5251738},{filename:"/tmp/pglite/share/postgresql/timezone/Indian/Reunion",start:5251738,end:5251871},{filename:"/tmp/pglite/share/postgresql/timezone/Iran",start:5251871,end:5252683},{filename:"/tmp/pglite/share/postgresql/timezone/Israel",start:5252683,end:5253757},{filename:"/tmp/pglite/share/postgresql/timezone/Jamaica",start:5253757,end:5254096},{filename:"/tmp/pglite/share/postgresql/timezone/Japan",start:5254096,end:5254309},{filename:"/tmp/pglite/share/postgresql/timezone/Kwajalein",start:5254309,end:5254528},{filename:"/tmp/pglite/share/postgresql/timezone/Libya",start:5254528,end:5254959},{filename:"/tmp/pglite/share/postgresql/timezone/MET",start:5254959,end:5255580},{filename:"/tmp/pglite/share/postgresql/timezone/MST",start:5255580,end:5255691},{filename:"/tmp/pglite/share/postgresql/timezone/MST7MDT",start:5255691,end:5256642},{filename:"/tmp/pglite/share/postgresql/timezone/Mexico/BajaNorte",start:5256642,end:5257667},{filename:"/tmp/pglite/share/postgresql/timezone/Mexico/BajaSur",start:5257667,end:5258385},{filename:"/tmp/pglite/share/postgresql/timezone/Mexico/General",start:5258385,end:5259158},{filename:"/tmp/pglite/share/postgresql/timezone/NZ",start:5259158,end:5260201},{filename:"/tmp/pglite/share/postgresql/timezone/NZ-CHAT",start:5260201,end:5261009},{filename:"/tmp/pglite/share/postgresql/timezone/Navajo",start:5261009,end:5262051},{filename:"/tmp/pglite/share/postgresql/timezone/PRC",start:5262051,end:5262444},{filename:"/tmp/pglite/share/postgresql/timezone/PST8PDT",start:5262444,end:5263395},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Apia",start:5263395,end:5263802},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Auckland",start:5263802,end:5264845},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Bougainville",start:5264845,end:5265046},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Chatham",start:5265046,end:5265854},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Chuuk",start:5265854,end:5266008},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Easter",start:5266008,end:5267182},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Efate",start:5267182,end:5267524},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Enderbury",start:5267524,end:5267696},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Fakaofo",start:5267696,end:5267849},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Fiji",start:5267849,end:5268245},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Funafuti",start:5268245,end:5268379},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Galapagos",start:5268379,end:5268554},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Gambier",start:5268554,end:5268686},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Guadalcanal",start:5268686,end:5268820},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Guam",start:5268820,end:5269170},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Honolulu",start:5269170,end:5269391},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Johnston",start:5269391,end:5269612},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Kanton",start:5269612,end:5269784},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Kiritimati",start:5269784,end:5269958},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Kosrae",start:5269958,end:5270200},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Kwajalein",start:5270200,end:5270419},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Majuro",start:5270419,end:5270553},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Marquesas",start:5270553,end:5270692},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Midway",start:5270692,end:5270838},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Nauru",start:5270838,end:5271021},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Niue",start:5271021,end:5271175},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Norfolk",start:5271175,end:5271422},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Noumea",start:5271422,end:5271620},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Pago_Pago",start:5271620,end:5271766},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Palau",start:5271766,end:5271914},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Pitcairn",start:5271914,end:5272067},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Pohnpei",start:5272067,end:5272201},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Ponape",start:5272201,end:5272335},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Port_Moresby",start:5272335,end:5272489},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Rarotonga",start:5272489,end:5272895},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Saipan",start:5272895,end:5273245},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Samoa",start:5273245,end:5273391},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Tahiti",start:5273391,end:5273524},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Tarawa",start:5273524,end:5273658},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Tongatapu",start:5273658,end:5273895},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Truk",start:5273895,end:5274049},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Wake",start:5274049,end:5274183},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Wallis",start:5274183,end:5274317},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Yap",start:5274317,end:5274471},{filename:"/tmp/pglite/share/postgresql/timezone/Poland",start:5274471,end:5275394},{filename:"/tmp/pglite/share/postgresql/timezone/Portugal",start:5275394,end:5276848},{filename:"/tmp/pglite/share/postgresql/timezone/ROC",start:5276848,end:5277359},{filename:"/tmp/pglite/share/postgresql/timezone/ROK",start:5277359,end:5277774},{filename:"/tmp/pglite/share/postgresql/timezone/Singapore",start:5277774,end:5278030},{filename:"/tmp/pglite/share/postgresql/timezone/Turkey",start:5278030,end:5279230},{filename:"/tmp/pglite/share/postgresql/timezone/UCT",start:5279230,end:5279341},{filename:"/tmp/pglite/share/postgresql/timezone/US/Alaska",start:5279341,end:5280318},{filename:"/tmp/pglite/share/postgresql/timezone/US/Aleutian",start:5280318,end:5281287},{filename:"/tmp/pglite/share/postgresql/timezone/US/Arizona",start:5281287,end:5281527},{filename:"/tmp/pglite/share/postgresql/timezone/US/Central",start:5281527,end:5283281},{filename:"/tmp/pglite/share/postgresql/timezone/US/East-Indiana",start:5283281,end:5283812},{filename:"/tmp/pglite/share/postgresql/timezone/US/Eastern",start:5283812,end:5285556},{filename:"/tmp/pglite/share/postgresql/timezone/US/Hawaii",start:5285556,end:5285777},{filename:"/tmp/pglite/share/postgresql/timezone/US/Indiana-Starke",start:5285777,end:5286793},{filename:"/tmp/pglite/share/postgresql/timezone/US/Michigan",start:5286793,end:5287692},{filename:"/tmp/pglite/share/postgresql/timezone/US/Mountain",start:5287692,end:5288734},{filename:"/tmp/pglite/share/postgresql/timezone/US/Pacific",start:5288734,end:5290028},{filename:"/tmp/pglite/share/postgresql/timezone/US/Samoa",start:5290028,end:5290174},{filename:"/tmp/pglite/share/postgresql/timezone/UTC",start:5290174,end:5290285},{filename:"/tmp/pglite/share/postgresql/timezone/Universal",start:5290285,end:5290396},{filename:"/tmp/pglite/share/postgresql/timezone/W-SU",start:5290396,end:5291304},{filename:"/tmp/pglite/share/postgresql/timezone/WET",start:5291304,end:5291798},{filename:"/tmp/pglite/share/postgresql/timezone/Zulu",start:5291798,end:5291909},{filename:"/tmp/pglite/share/postgresql/timezonesets/Africa.txt",start:5291909,end:5298882},{filename:"/tmp/pglite/share/postgresql/timezonesets/America.txt",start:5298882,end:5309889},{filename:"/tmp/pglite/share/postgresql/timezonesets/Antarctica.txt",start:5309889,end:5311023},{filename:"/tmp/pglite/share/postgresql/timezonesets/Asia.txt",start:5311023,end:5319334},{filename:"/tmp/pglite/share/postgresql/timezonesets/Atlantic.txt",start:5319334,end:5322867},{filename:"/tmp/pglite/share/postgresql/timezonesets/Australia",start:5322867,end:5324002},{filename:"/tmp/pglite/share/postgresql/timezonesets/Australia.txt",start:5324002,end:5327386},{filename:"/tmp/pglite/share/postgresql/timezonesets/Default",start:5327386,end:5354636},{filename:"/tmp/pglite/share/postgresql/timezonesets/Etc.txt",start:5354636,end:5355886},{filename:"/tmp/pglite/share/postgresql/timezonesets/Europe.txt",start:5355886,end:5364668},{filename:"/tmp/pglite/share/postgresql/timezonesets/India",start:5364668,end:5365261},{filename:"/tmp/pglite/share/postgresql/timezonesets/Indian.txt",start:5365261,end:5366522},{filename:"/tmp/pglite/share/postgresql/timezonesets/Pacific.txt",start:5366522,end:5370290},{filename:"/tmp/pglite/share/postgresql/tsearch_data/danish.stop",start:5370290,end:5370714},{filename:"/tmp/pglite/share/postgresql/tsearch_data/dutch.stop",start:5370714,end:5371167},{filename:"/tmp/pglite/share/postgresql/tsearch_data/english.stop",start:5371167,end:5371789},{filename:"/tmp/pglite/share/postgresql/tsearch_data/finnish.stop",start:5371789,end:5373368},{filename:"/tmp/pglite/share/postgresql/tsearch_data/french.stop",start:5373368,end:5374173},{filename:"/tmp/pglite/share/postgresql/tsearch_data/german.stop",start:5374173,end:5375522},{filename:"/tmp/pglite/share/postgresql/tsearch_data/hungarian.stop",start:5375522,end:5376749},{filename:"/tmp/pglite/share/postgresql/tsearch_data/hunspell_sample.affix",start:5376749,end:5376992},{filename:"/tmp/pglite/share/postgresql/tsearch_data/hunspell_sample_long.affix",start:5376992,end:5377625},{filename:"/tmp/pglite/share/postgresql/tsearch_data/hunspell_sample_long.dict",start:5377625,end:5377723},{filename:"/tmp/pglite/share/postgresql/tsearch_data/hunspell_sample_num.affix",start:5377723,end:5378185},{filename:"/tmp/pglite/share/postgresql/tsearch_data/hunspell_sample_num.dict",start:5378185,end:5378314},{filename:"/tmp/pglite/share/postgresql/tsearch_data/ispell_sample.affix",start:5378314,end:5378779},{filename:"/tmp/pglite/share/postgresql/tsearch_data/ispell_sample.dict",start:5378779,end:5378860},{filename:"/tmp/pglite/share/postgresql/tsearch_data/italian.stop",start:5378860,end:5380514},{filename:"/tmp/pglite/share/postgresql/tsearch_data/nepali.stop",start:5380514,end:5384775},{filename:"/tmp/pglite/share/postgresql/tsearch_data/norwegian.stop",start:5384775,end:5385626},{filename:"/tmp/pglite/share/postgresql/tsearch_data/portuguese.stop",start:5385626,end:5386893},{filename:"/tmp/pglite/share/postgresql/tsearch_data/russian.stop",start:5386893,end:5388128},{filename:"/tmp/pglite/share/postgresql/tsearch_data/spanish.stop",start:5388128,end:5390306},{filename:"/tmp/pglite/share/postgresql/tsearch_data/swedish.stop",start:5390306,end:5390865},{filename:"/tmp/pglite/share/postgresql/tsearch_data/synonym_sample.syn",start:5390865,end:5390938},{filename:"/tmp/pglite/share/postgresql/tsearch_data/thesaurus_sample.ths",start:5390938,end:5391411},{filename:"/tmp/pglite/share/postgresql/tsearch_data/turkish.stop",start:5391411,end:5391671},{filename:"/tmp/pglite/share/postgresql/tsearch_data/unaccent.rules",start:5391671,end:5401610},{filename:"/tmp/pglite/share/postgresql/tsearch_data/xsyn_sample.rules",start:5401610,end:5401749}],remote_package_size:5401749})})();var moduleOverrides=Object.assign({},Module),arguments_=[],thisProgram="./this.program",quit_=(tr,rr)=>{throw rr},scriptDirectory="";function locateFile(tr){return Module.locateFile?Module.locateFile(tr,scriptDirectory):scriptDirectory+tr}var readAsync,readBinary;if(ENVIRONMENT_IS_NODE){var fs=require("fs"),nodePath=require("path");import.meta.url.startsWith("data:")||(scriptDirectory=nodePath.dirname(require("url").fileURLToPath(import.meta.url))+"/"),readBinary=tr=>{tr=isFileURI(tr)?new URL(tr):tr;var rr=fs.readFileSync(tr);return rr},readAsync=async(tr,rr=!0)=>{tr=isFileURI(tr)?new URL(tr):tr;var ir=fs.readFileSync(tr,rr?void 0:"utf8");return ir},!Module.thisProgram&&process.argv.length>1&&(thisProgram=process.argv[1].replace(/\\/g,"/")),arguments_=process.argv.slice(2),quit_=(tr,rr)=>{throw process.exitCode=tr,rr}}else(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)&&(ENVIRONMENT_IS_WORKER?scriptDirectory=self.location.href:typeof document<"u"&&document.currentScript&&(scriptDirectory=document.currentScript.src),_scriptName&&(scriptDirectory=_scriptName),scriptDirectory.startsWith("blob:")?scriptDirectory="":scriptDirectory=scriptDirectory.substr(0,scriptDirectory.replace(/[?#].*/,"").lastIndexOf("/")+1),readAsync=async tr=>{var rr=await fetch(tr,{credentials:"same-origin"});if(rr.ok)return rr.arrayBuffer();throw new Error(rr.status+" : "+rr.url)});var out=Module.print||console.log.bind(console),err=Module.printErr||console.error.bind(console);Object.assign(Module,moduleOverrides),moduleOverrides=null,Module.arguments&&(arguments_=Module.arguments),Module.thisProgram&&(thisProgram=Module.thisProgram);var dynamicLibraries=Module.dynamicLibraries||[],wasmBinary=Module.wasmBinary,wasmMemory,ABORT=!1,EXITSTATUS;function assert(tr,rr){tr||abort(rr)}var HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAP64,HEAPF64;function updateMemoryViews(){var tr=wasmMemory.buffer;Module.HEAP8=HEAP8=new Int8Array(tr),Module.HEAP16=HEAP16=new Int16Array(tr),Module.HEAPU8=HEAPU8=new Uint8Array(tr),Module.HEAPU16=HEAPU16=new Uint16Array(tr),Module.HEAP32=HEAP32=new Int32Array(tr),Module.HEAPU32=HEAPU32=new Uint32Array(tr),Module.HEAPF32=HEAPF32=new Float32Array(tr),Module.HEAPF64=HEAPF64=new Float64Array(tr),Module.HEAP64=HEAP64=new BigInt64Array(tr),Module.HEAPU64=new BigUint64Array(tr)}if(Module.wasmMemory)wasmMemory=Module.wasmMemory;else{var INITIAL_MEMORY=Module.INITIAL_MEMORY||134217728;wasmMemory=new WebAssembly.Memory({initial:INITIAL_MEMORY/65536,maximum:32768})}updateMemoryViews();var __ATPRERUN__=[],__ATINIT__=[],__ATMAIN__=[],__ATPOSTRUN__=[],__RELOC_FUNCS__=[],runtimeInitialized=!1;function preRun(){if(Module.preRun)for(typeof Module.preRun=="function"&&(Module.preRun=[Module.preRun]);Module.preRun.length;)addOnPreRun(Module.preRun.shift());callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){runtimeInitialized=!0,callRuntimeCallbacks(__RELOC_FUNCS__),!Module.noFSInit&&!FS.initialized&&FS.init(),FS.ignorePermissions=!1,SOCKFS.root=FS.mount(SOCKFS,{},null),PIPEFS.root=FS.mount(PIPEFS,{},null),callRuntimeCallbacks(__ATINIT__)}function preMain(){callRuntimeCallbacks(__ATMAIN__)}function postRun(){if(Module.postRun)for(typeof Module.postRun=="function"&&(Module.postRun=[Module.postRun]);Module.postRun.length;)addOnPostRun(Module.postRun.shift());callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(tr){__ATPRERUN__.unshift(tr)}function addOnInit(tr){__ATINIT__.unshift(tr)}function addOnPostRun(tr){__ATPOSTRUN__.unshift(tr)}var runDependencies=0,dependenciesFulfilled=null;function addRunDependency(tr){var rr;runDependencies++,(rr=Module.monitorRunDependencies)==null||rr.call(Module,runDependencies)}function removeRunDependency(tr){var ir;if(runDependencies--,(ir=Module.monitorRunDependencies)==null||ir.call(Module,runDependencies),runDependencies==0&&dependenciesFulfilled){var rr=dependenciesFulfilled;dependenciesFulfilled=null,rr()}}function abort(tr){var ir;(ir=Module.onAbort)==null||ir.call(Module,tr),tr="Aborted("+tr+")",err(tr),ABORT=!0,tr+=". Build with -sASSERTIONS for more info.";var rr=new WebAssembly.RuntimeError(tr);throw readyPromiseReject(rr),rr}var dataURIPrefix="data:application/octet-stream;base64,",isDataURI=tr=>tr.startsWith(dataURIPrefix),isFileURI=tr=>tr.startsWith("file://");function findWasmBinary(){if(Module.locateFile){var tr="postgres.wasm";return isDataURI(tr)?tr:locateFile(tr)}return new URL(""+new URL("postgres-CyuUVpXN.wasm",import.meta.url).href,import.meta.url).href}var wasmBinaryFile;function getBinarySync(tr){if(tr==wasmBinaryFile&&wasmBinary)return new Uint8Array(wasmBinary);if(readBinary)return readBinary(tr);throw"both async and sync fetching of the wasm failed"}async function getWasmBinary(tr){if(!wasmBinary)try{var rr=await readAsync(tr);return new Uint8Array(rr)}catch{}return getBinarySync(tr)}async function instantiateArrayBuffer(tr,rr){try{var ir=await getWasmBinary(tr),lr=await WebAssembly.instantiate(ir,rr);return lr}catch(dr){err(`failed to asynchronously prepare wasm: ${dr}`),abort(dr)}}async function instantiateAsync(tr,rr,ir){if(!tr&&typeof WebAssembly.instantiateStreaming=="function"&&!isDataURI(rr)&&!ENVIRONMENT_IS_NODE&&typeof fetch=="function")try{var lr=fetch(rr,{credentials:"same-origin"}),dr=await WebAssembly.instantiateStreaming(lr,ir);return dr}catch(fr){err(`wasm streaming compile failed: ${fr}`),err("falling back to ArrayBuffer instantiation")}return instantiateArrayBuffer(rr,ir)}function getWasmImports(){return{env:wasmImports,wasi_snapshot_preview1:wasmImports,"GOT.mem":new Proxy(wasmImports,GOTHandler),"GOT.func":new Proxy(wasmImports,GOTHandler)}}async function createWasm(){function tr(dr,fr){wasmExports=dr.exports,wasmExports=relocateExports(wasmExports,16777216);var hr=getDylinkMetadata(fr);return hr.neededDynlibs&&(dynamicLibraries=hr.neededDynlibs.concat(dynamicLibraries)),mergeLibSymbols(wasmExports),LDSO.init(),loadDylibs(),addOnInit(wasmExports.__wasm_call_ctors),__RELOC_FUNCS__.push(wasmExports.__wasm_apply_data_relocs),removeRunDependency(),wasmExports}addRunDependency();function rr(dr){tr(dr.instance,dr.module)}var ir=getWasmImports();if(Module.instantiateWasm)try{return Module.instantiateWasm(ir,tr)}catch(dr){err(`Module.instantiateWasm callback failed with error: ${dr}`),readyPromiseReject(dr)}wasmBinaryFile??(wasmBinaryFile=findWasmBinary());try{var lr=await instantiateAsync(wasmBinary,wasmBinaryFile,ir);return rr(lr),lr}catch(dr){readyPromiseReject(dr);return}}var ASM_CONSTS={18792944:tr=>{Module.is_worker=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope,Module.FD_BUFFER_MAX=tr,Module.emscripten_copy_to=console.warn},18793117:()=>{Module.postMessage=function(tr){console.log("# 1252: onCustomMessage:",__FILE__,tr)}},18793242:()=>{if(Module.is_worker){let tr=function(rr){console.log("onCustomMessage:",rr)};Module.onCustomMessage=tr}else Module.postMessage=function(tr){switch(tr.type){case"raw":{stringToUTF8(tr.data,shm_rawinput,Module.FD_BUFFER_MAX);break}case"stdin":{stringToUTF8(tr.data,1,Module.FD_BUFFER_MAX);break}case"rcon":{stringToUTF8(tr.data,shm_rcon,Module.FD_BUFFER_MAX);break}default:console.warn("custom_postMessage?",tr)}}}};function is_web_env(){try{if(window)return 1}catch{return 0}}is_web_env.sig="i";class ExitStatus{constructor(rr){P$2(this,"name","ExitStatus"),this.message=`Program terminated with exit(${rr})`,this.status=rr}}var GOT={},currentModuleWeakSymbols=new Set([]),GOTHandler={get(tr,rr){var ir=GOT[rr];return ir||(ir=GOT[rr]=new WebAssembly.Global({value:"i32",mutable:!0})),currentModuleWeakSymbols.has(rr)||(ir.required=!0),ir}},callRuntimeCallbacks=tr=>{for(;tr.length>0;)tr.shift()(Module)},UTF8Decoder=typeof TextDecoder<"u"?new TextDecoder:void 0,UTF8ArrayToString=(tr,rr=0,ir=NaN)=>{for(var lr=rr+ir,dr=rr;tr[dr]&&!(dr>=lr);)++dr;if(dr-rr>16&&tr.buffer&&UTF8Decoder)return UTF8Decoder.decode(tr.subarray(rr,dr));for(var fr="";rr<dr;){var hr=tr[rr++];if(!(hr&128)){fr+=String.fromCharCode(hr);continue}var mr=tr[rr++]&63;if((hr&224)==192){fr+=String.fromCharCode((hr&31)<<6|mr);continue}var gr=tr[rr++]&63;if((hr&240)==224?hr=(hr&15)<<12|mr<<6|gr:hr=(hr&7)<<18|mr<<12|gr<<6|tr[rr++]&63,hr<65536)fr+=String.fromCharCode(hr);else{var yr=hr-65536;fr+=String.fromCharCode(55296|yr>>10,56320|yr&1023)}}return fr},getDylinkMetadata=tr=>{var rr=0,ir=0;function lr(){return tr[rr++]}function dr(){for(var qn=0,Xn=1;;){var Lr=tr[rr++];if(qn+=(Lr&127)*Xn,Xn*=128,!(Lr&128))break}return qn}function fr(){var qn=dr();return rr+=qn,UTF8ArrayToString(tr,rr-qn,qn)}function hr(qn,Xn){if(qn)throw new Error(Xn)}var mr="dylink.0";if(tr instanceof WebAssembly.Module){var gr=WebAssembly.Module.customSections(tr,mr);gr.length===0&&(mr="dylink",gr=WebAssembly.Module.customSections(tr,mr)),hr(gr.length===0,"need dylink section"),tr=new Uint8Array(gr[0]),ir=tr.length}else{var yr=new Uint32Array(new Uint8Array(tr.subarray(0,24)).buffer),_r=yr[0]==1836278016;hr(!_r,"need to see wasm magic number"),hr(tr[8]!==0,"need the dylink section to be first"),rr=9;var br=dr();ir=rr+br,mr=fr()}var vr={neededDynlibs:[],tlsExports:new Set,weakImports:new Set};if(mr=="dylink"){vr.memorySize=dr(),vr.memoryAlign=dr(),vr.tableSize=dr(),vr.tableAlign=dr();for(var wr=dr(),xr=0;xr<wr;++xr){var Sr=fr();vr.neededDynlibs.push(Sr)}}else{hr(mr!=="dylink.0");for(var Ar=1,Ir=2,Mr=3,Or=4,$r=256,Dr=3,zr=1;rr<ir;){var Fr=lr(),Jr=dr();if(Fr===Ar)vr.memorySize=dr(),vr.memoryAlign=dr(),vr.tableSize=dr(),vr.tableAlign=dr();else if(Fr===Ir)for(var wr=dr(),xr=0;xr<wr;++xr)Sr=fr(),vr.neededDynlibs.push(Sr);else if(Fr===Mr)for(var $n=dr();$n--;){var Qr=fr(),Zn=dr();Zn&$r&&vr.tlsExports.add(Qr)}else if(Fr===Or)for(var $n=dr();$n--;){fr();var Qr=fr(),Zn=dr();(Zn&Dr)==zr&&vr.weakImports.add(Qr)}else rr+=Jr}}return vr};function getValue(tr,rr="i8"){switch(rr.endsWith("*")&&(rr="*"),rr){case"i1":return HEAP8[tr];case"i8":return HEAP8[tr];case"i16":return HEAP16[tr>>1];case"i32":return HEAP32[tr>>2];case"i64":return HEAP64[tr>>3];case"float":return HEAPF32[tr>>2];case"double":return HEAPF64[tr>>3];case"*":return HEAPU32[tr>>2];default:abort(`invalid type for getValue: ${rr}`)}}var newDSO=(tr,rr,ir)=>{var lr={refcount:1/0,name:tr,exports:ir,global:!0};return LDSO.loadedLibsByName[tr]=lr,rr!=null&&(LDSO.loadedLibsByHandle[rr]=lr),lr},LDSO={loadedLibsByName:{},loadedLibsByHandle:{},init(){newDSO("__main__",0,wasmImports)}},___heap_base=23144432,alignMemory=(tr,rr)=>Math.ceil(tr/rr)*rr,getMemory=tr=>{if(runtimeInitialized)return _calloc(tr,1);var rr=___heap_base,ir=rr+alignMemory(tr,16);return ___heap_base=ir,GOT.__heap_base.value=ir,rr},isInternalSym=tr=>["__cpp_exception","__c_longjmp","__wasm_apply_data_relocs","__dso_handle","__tls_size","__tls_align","__set_stack_limits","_emscripten_tls_init","__wasm_init_tls","__wasm_call_ctors","__start_em_asm","__stop_em_asm","__start_em_js","__stop_em_js"].includes(tr)||tr.startsWith("__em_js__"),uleb128Encode=(tr,rr)=>{tr<128?rr.push(tr):rr.push(tr%128|128,tr>>7)},sigToWasmTypes=tr=>{for(var rr={i:"i32",j:"i64",f:"f32",d:"f64",e:"externref",p:"i32"},ir={parameters:[],results:tr[0]=="v"?[]:[rr[tr[0]]]},lr=1;lr<tr.length;++lr)ir.parameters.push(rr[tr[lr]]);return ir},generateFuncType=(tr,rr)=>{var ir=tr.slice(0,1),lr=tr.slice(1),dr={i:127,p:127,j:126,f:125,d:124,e:111};rr.push(96),uleb128Encode(lr.length,rr);for(var fr=0;fr<lr.length;++fr)rr.push(dr[lr[fr]]);ir=="v"?rr.push(0):rr.push(1,dr[ir])},convertJsFunctionToWasm=(tr,rr)=>{if(typeof WebAssembly.Function=="function")return new WebAssembly.Function(sigToWasmTypes(rr),tr);var ir=[1];generateFuncType(rr,ir);var lr=[0,97,115,109,1,0,0,0,1];uleb128Encode(ir.length,lr),lr.push(...ir),lr.push(2,7,1,1,101,1,102,0,0,7,5,1,1,102,0,0);var dr=new WebAssembly.Module(new Uint8Array(lr)),fr=new WebAssembly.Instance(dr,{e:{f:tr}}),hr=fr.exports.f;return hr},wasmTableMirror=[],wasmTable=new WebAssembly.Table({initial:5360,element:"anyfunc"}),getWasmTableEntry=tr=>{var rr=wasmTableMirror[tr];return rr||(tr>=wasmTableMirror.length&&(wasmTableMirror.length=tr+1),wasmTableMirror[tr]=rr=wasmTable.get(tr)),rr},updateTableMap=(tr,rr)=>{if(functionsInTableMap)for(var ir=tr;ir<tr+rr;ir++){var lr=getWasmTableEntry(ir);lr&&functionsInTableMap.set(lr,ir)}},functionsInTableMap,getFunctionAddress=tr=>(functionsInTableMap||(functionsInTableMap=new WeakMap,updateTableMap(0,wasmTable.length)),functionsInTableMap.get(tr)||0),freeTableIndexes=[],getEmptyTableSlot=()=>{if(freeTableIndexes.length)return freeTableIndexes.pop();try{wasmTable.grow(1)}catch(tr){throw tr instanceof RangeError?"Unable to grow wasm table. Set ALLOW_TABLE_GROWTH.":tr}return wasmTable.length-1},setWasmTableEntry=(tr,rr)=>{wasmTable.set(tr,rr),wasmTableMirror[tr]=wasmTable.get(tr)},addFunction=(tr,rr)=>{var ir=getFunctionAddress(tr);if(ir)return ir;var lr=getEmptyTableSlot();try{setWasmTableEntry(lr,tr)}catch(fr){if(!(fr instanceof TypeError))throw fr;var dr=convertJsFunctionToWasm(tr,rr);setWasmTableEntry(lr,dr)}return functionsInTableMap.set(tr,lr),lr},updateGOT=(tr,rr)=>{for(var ir in tr)if(!isInternalSym(ir)){var lr=tr[ir];GOT[ir]||(GOT[ir]=new WebAssembly.Global({value:"i32",mutable:!0})),GOT[ir].value==0&&(typeof lr=="function"?GOT[ir].value=addFunction(lr):typeof lr=="number"?GOT[ir].value=lr:err(`unhandled export type for '${ir}': ${typeof lr}`))}},relocateExports=(tr,rr,ir)=>{var lr={};for(var dr in tr){var fr=tr[dr];typeof fr=="object"&&(fr=fr.value),typeof fr=="number"&&(fr+=rr),lr[dr]=fr}return updateGOT(lr),lr},isSymbolDefined=tr=>{var rr=wasmImports[tr];return!(!rr||rr.stub)},dynCall=(tr,rr,ir=[])=>{var lr=getWasmTableEntry(rr)(...ir);return lr},stackSave=()=>_emscripten_stack_get_current(),stackRestore=tr=>__emscripten_stack_restore(tr),createInvokeFunction=tr=>(rr,...ir)=>{var lr=stackSave();try{return dynCall(tr,rr,ir)}catch(dr){if(stackRestore(lr),dr!==dr+0)throw dr;if(_setThrew(1,0),tr[0]=="j")return 0n}},resolveGlobalSymbol=(tr,rr=!1)=>{var ir;return isSymbolDefined(tr)?ir=wasmImports[tr]:tr.startsWith("invoke_")&&(ir=wasmImports[tr]=createInvokeFunction(tr.split("_")[1])),{sym:ir,name:tr}},UTF8ToString=(tr,rr)=>tr?UTF8ArrayToString(HEAPU8,tr,rr):"",loadWebAssemblyModule=(binary,flags,libName,localScope,handle)=>{var metadata=getDylinkMetadata(binary);currentModuleWeakSymbols=metadata.weakImports;function loadModule(){var firstLoad=!handle||!HEAP8[handle+8];if(firstLoad){var memAlign=Math.pow(2,metadata.memoryAlign),memoryBase=metadata.memorySize?alignMemory(getMemory(metadata.memorySize+memAlign),memAlign):0,tableBase=metadata.tableSize?wasmTable.length:0;handle&&(HEAP8[handle+8]=1,HEAPU32[handle+12>>2]=memoryBase,HEAP32[handle+16>>2]=metadata.memorySize,HEAPU32[handle+20>>2]=tableBase,HEAP32[handle+24>>2]=metadata.tableSize)}else memoryBase=HEAPU32[handle+12>>2],tableBase=HEAPU32[handle+20>>2];var tableGrowthNeeded=tableBase+metadata.tableSize-wasmTable.length;tableGrowthNeeded>0&&wasmTable.grow(tableGrowthNeeded);var moduleExports;function resolveSymbol(tr){var rr=resolveGlobalSymbol(tr).sym;return!rr&&localScope&&(rr=localScope[tr]),rr||(rr=moduleExports[tr]),rr}var proxyHandler={get(tr,rr){switch(rr){case"__memory_base":return memoryBase;case"__table_base":return tableBase}if(rr in wasmImports&&!wasmImports[rr].stub)return wasmImports[rr];if(!(rr in tr)){var ir;tr[rr]=(...lr)=>(ir||(ir=resolveSymbol(rr)),ir(...lr))}return tr[rr]}},proxy=new Proxy({},proxyHandler),info={"GOT.mem":new Proxy({},GOTHandler),"GOT.func":new Proxy({},GOTHandler),env:proxy,wasi_snapshot_preview1:proxy};function postInstantiation(module,instance){updateTableMap(tableBase,metadata.tableSize),moduleExports=relocateExports(instance.exports,memoryBase),flags.allowUndefined||reportUndefinedSymbols();function addEmAsm(addr,body){for(var args=[],arity=0;arity<16&&body.indexOf("$"+arity)!=-1;arity++)args.push("$"+arity);args=args.join(",");var func=`(${args}) => { ${body} };`;ASM_CONSTS[start]=eval(func)}if("__start_em_asm"in moduleExports)for(var start=moduleExports.__start_em_asm,stop=moduleExports.__stop_em_asm;start<stop;){var jsString=UTF8ToString(start);addEmAsm(start,jsString),start=HEAPU8.indexOf(0,start)+1}function addEmJs(name,cSig,body){var jsArgs=[];if(cSig=cSig.slice(1,-1),cSig!="void"){cSig=cSig.split(",");for(var i in cSig){var jsArg=cSig[i].split(" ").pop();jsArgs.push(jsArg.replaceAll("*",""))}}var func=`(${jsArgs}) => ${body};`;moduleExports[name]=eval(func)}for(var name in moduleExports)if(name.startsWith("__em_js__")){var start=moduleExports[name],jsString=UTF8ToString(start),parts=jsString.split("<::>");addEmJs(name.replace("__em_js__",""),parts[0],parts[1]),delete moduleExports[name]}var applyRelocs=moduleExports.__wasm_apply_data_relocs;applyRelocs&&(runtimeInitialized?applyRelocs():__RELOC_FUNCS__.push(applyRelocs));var init=moduleExports.__wasm_call_ctors;return init&&(runtimeInitialized?init():__ATINIT__.push(init)),moduleExports}if(flags.loadAsync){if(binary instanceof WebAssembly.Module){var instance=new WebAssembly.Instance(binary,info);return Promise.resolve(postInstantiation(binary,instance))}return WebAssembly.instantiate(binary,info).then(tr=>postInstantiation(tr.module,tr.instance))}var module=binary instanceof WebAssembly.Module?binary:new WebAssembly.Module(binary),instance=new WebAssembly.Instance(module,info);return postInstantiation(module,instance)}return flags.loadAsync?metadata.neededDynlibs.reduce((tr,rr)=>tr.then(()=>loadDynamicLibrary(rr,flags,localScope)),Promise.resolve()).then(loadModule):(metadata.neededDynlibs.forEach(tr=>loadDynamicLibrary(tr,flags,localScope)),loadModule())},mergeLibSymbols=(tr,rr)=>{for(var[ir,lr]of Object.entries(tr)){let dr=hr=>{isSymbolDefined(hr)||(wasmImports[hr]=lr)};dr(ir);let fr="__main_argc_argv";ir=="main"&&dr(fr),ir==fr&&dr("main")}},asyncLoad=async tr=>{var rr=await readAsync(tr);return new Uint8Array(rr)},preloadPlugins=Module.preloadPlugins||[],registerWasmPlugin=()=>{var tr={promiseChainEnd:Promise.resolve(),canHandle:rr=>!Module.noWasmDecoding&&rr.endsWith(".so"),handle:(rr,ir,lr,dr)=>{tr.promiseChainEnd=tr.promiseChainEnd.then(()=>loadWebAssemblyModule(rr,{loadAsync:!0,nodelete:!0},ir,{})).then(fr=>{preloadedWasm[ir]=fr,lr(rr)},fr=>{err(`failed to instantiate wasm: ${ir}: ${fr}`),dr()})}};preloadPlugins.push(tr)},preloadedWasm={};function loadDynamicLibrary(tr,rr={global:!0,nodelete:!0},ir,lr){var dr=LDSO.loadedLibsByName[tr];if(dr)return rr.global?dr.global||(dr.global=!0,mergeLibSymbols(dr.exports)):ir&&Object.assign(ir,dr.exports),rr.nodelete&&dr.refcount!==1/0&&(dr.refcount=1/0),dr.refcount++,lr&&(LDSO.loadedLibsByHandle[lr]=dr),rr.loadAsync?Promise.resolve(!0):!0;dr=newDSO(tr,lr,"loading"),dr.refcount=rr.nodelete?1/0:1,dr.global=rr.global;function fr(){if(lr){var gr=HEAPU32[lr+28>>2],yr=HEAPU32[lr+32>>2];if(gr&&yr){var _r=HEAP8.slice(gr,gr+yr);return rr.loadAsync?Promise.resolve(_r):_r}}var br=locateFile(tr);if(rr.loadAsync)return asyncLoad(br);if(!readBinary)throw new Error(`${br}: file not found, and synchronous loading of external files is not available`);return readBinary(br)}function hr(){var gr=preloadedWasm[tr];return gr?rr.loadAsync?Promise.resolve(gr):gr:rr.loadAsync?fr().then(yr=>loadWebAssemblyModule(yr,rr,tr,ir,lr)):loadWebAssemblyModule(fr(),rr,tr,ir,lr)}function mr(gr){dr.global?mergeLibSymbols(gr):ir&&Object.assign(ir,gr),dr.exports=gr}return rr.loadAsync?hr().then(gr=>(mr(gr),!0)):(mr(hr()),!0)}var reportUndefinedSymbols=()=>{for(var[tr,rr]of Object.entries(GOT))if(rr.value==0){var ir=resolveGlobalSymbol(tr,!0).sym;if(!ir&&!rr.required)continue;if(typeof ir=="function")rr.value=addFunction(ir,ir.sig);else if(typeof ir=="number")rr.value=ir;else throw new Error(`bad export type for '${tr}': ${typeof ir}`)}},loadDylibs=()=>{if(!dynamicLibraries.length){reportUndefinedSymbols();return}addRunDependency(),dynamicLibraries.reduce((tr,rr)=>tr.then(()=>loadDynamicLibrary(rr,{loadAsync:!0,global:!0,nodelete:!0,allowUndefined:!0})),Promise.resolve()).then(()=>{reportUndefinedSymbols(),removeRunDependency()})},noExitRuntime=Module.noExitRuntime||!0;function setValue(tr,rr,ir="i8"){switch(ir.endsWith("*")&&(ir="*"),ir){case"i1":HEAP8[tr]=rr;break;case"i8":HEAP8[tr]=rr;break;case"i16":HEAP16[tr>>1]=rr;break;case"i32":HEAP32[tr>>2]=rr;break;case"i64":HEAP64[tr>>3]=BigInt(rr);break;case"float":HEAPF32[tr>>2]=rr;break;case"double":HEAPF64[tr>>3]=rr;break;case"*":HEAPU32[tr>>2]=rr;break;default:abort(`invalid type for setValue: ${ir}`)}}var ___assert_fail=(tr,rr,ir,lr)=>abort(`Assertion failed: ${UTF8ToString(tr)}, at: `+[rr?UTF8ToString(rr):"unknown filename",ir,lr?UTF8ToString(lr):"unknown function"]);___assert_fail.sig="vppip";var ___call_sighandler=(tr,rr)=>getWasmTableEntry(tr)(rr);___call_sighandler.sig="vpi";var ___memory_base=new WebAssembly.Global({value:"i32",mutable:!1},16777216),___stack_pointer=new WebAssembly.Global({value:"i32",mutable:!0},23144432),PATH={isAbs:tr=>tr.charAt(0)==="/",splitPath:tr=>{var rr=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return rr.exec(tr).slice(1)},normalizeArray:(tr,rr)=>{for(var ir=0,lr=tr.length-1;lr>=0;lr--){var dr=tr[lr];dr==="."?tr.splice(lr,1):dr===".."?(tr.splice(lr,1),ir++):ir&&(tr.splice(lr,1),ir--)}if(rr)for(;ir;ir--)tr.unshift("..");return tr},normalize:tr=>{var rr=PATH.isAbs(tr),ir=tr.substr(-1)==="/";return tr=PATH.normalizeArray(tr.split("/").filter(lr=>!!lr),!rr).join("/"),!tr&&!rr&&(tr="."),tr&&ir&&(tr+="/"),(rr?"/":"")+tr},dirname:tr=>{var rr=PATH.splitPath(tr),ir=rr[0],lr=rr[1];return!ir&&!lr?".":(lr&&(lr=lr.substr(0,lr.length-1)),ir+lr)},basename:tr=>{if(tr==="/")return"/";tr=PATH.normalize(tr),tr=tr.replace(/\/$/,"");var rr=tr.lastIndexOf("/");return rr===-1?tr:tr.substr(rr+1)},join:(...tr)=>PATH.normalize(tr.join("/")),join2:(tr,rr)=>PATH.normalize(tr+"/"+rr)},initRandomFill=()=>{if(typeof crypto=="object"&&typeof crypto.getRandomValues=="function")return lr=>crypto.getRandomValues(lr);if(ENVIRONMENT_IS_NODE)try{var tr=require("crypto"),rr=tr.randomFillSync;if(rr)return lr=>tr.randomFillSync(lr);var ir=tr.randomBytes;return lr=>(lr.set(ir(lr.byteLength)),lr)}catch{}abort("initRandomDevice")},randomFill=tr=>(randomFill=initRandomFill())(tr),PATH_FS={resolve:(...tr)=>{for(var rr="",ir=!1,lr=tr.length-1;lr>=-1&&!ir;lr--){var dr=lr>=0?tr[lr]:FS.cwd();if(typeof dr!="string")throw new TypeError("Arguments to path.resolve must be strings");if(!dr)return"";rr=dr+"/"+rr,ir=PATH.isAbs(dr)}return rr=PATH.normalizeArray(rr.split("/").filter(fr=>!!fr),!ir).join("/"),(ir?"/":"")+rr||"."},relative:(tr,rr)=>{tr=PATH_FS.resolve(tr).substr(1),rr=PATH_FS.resolve(rr).substr(1);function ir(yr){for(var _r=0;_r<yr.length&&yr[_r]==="";_r++);for(var br=yr.length-1;br>=0&&yr[br]==="";br--);return _r>br?[]:yr.slice(_r,br-_r+1)}for(var lr=ir(tr.split("/")),dr=ir(rr.split("/")),fr=Math.min(lr.length,dr.length),hr=fr,mr=0;mr<fr;mr++)if(lr[mr]!==dr[mr]){hr=mr;break}for(var gr=[],mr=hr;mr<lr.length;mr++)gr.push("..");return gr=gr.concat(dr.slice(hr)),gr.join("/")}},FS_stdin_getChar_buffer=[],lengthBytesUTF8=tr=>{for(var rr=0,ir=0;ir<tr.length;++ir){var lr=tr.charCodeAt(ir);lr<=127?rr++:lr<=2047?rr+=2:lr>=55296&&lr<=57343?(rr+=4,++ir):rr+=3}return rr},stringToUTF8Array=(tr,rr,ir,lr)=>{if(!(lr>0))return 0;for(var dr=ir,fr=ir+lr-1,hr=0;hr<tr.length;++hr){var mr=tr.charCodeAt(hr);if(mr>=55296&&mr<=57343){var gr=tr.charCodeAt(++hr);mr=65536+((mr&1023)<<10)|gr&1023}if(mr<=127){if(ir>=fr)break;rr[ir++]=mr}else if(mr<=2047){if(ir+1>=fr)break;rr[ir++]=192|mr>>6,rr[ir++]=128|mr&63}else if(mr<=65535){if(ir+2>=fr)break;rr[ir++]=224|mr>>12,rr[ir++]=128|mr>>6&63,rr[ir++]=128|mr&63}else{if(ir+3>=fr)break;rr[ir++]=240|mr>>18,rr[ir++]=128|mr>>12&63,rr[ir++]=128|mr>>6&63,rr[ir++]=128|mr&63}}return rr[ir]=0,ir-dr};function intArrayFromString(tr,rr,ir){var lr=lengthBytesUTF8(tr)+1,dr=new Array(lr),fr=stringToUTF8Array(tr,dr,0,dr.length);return dr.length=fr,dr}var FS_stdin_getChar=()=>{if(!FS_stdin_getChar_buffer.length){var tr=null;if(ENVIRONMENT_IS_NODE){var rr=256,ir=Buffer.alloc(rr),lr=0,dr=process.stdin.fd;try{lr=fs.readSync(dr,ir,0,rr)}catch(fr){if(fr.toString().includes("EOF"))lr=0;else throw fr}lr>0&&(tr=ir.slice(0,lr).toString("utf-8"))}else typeof window<"u"&&typeof window.prompt=="function"&&(tr=window.prompt("Input: "),tr!==null&&(tr+=`
565
565
  `));if(!tr)return null;FS_stdin_getChar_buffer=intArrayFromString(tr)}return FS_stdin_getChar_buffer.shift()},TTY={ttys:[],init(){},shutdown(){},register(tr,rr){TTY.ttys[tr]={input:[],output:[],ops:rr},FS.registerDevice(tr,TTY.stream_ops)},stream_ops:{open(tr){var rr=TTY.ttys[tr.node.rdev];if(!rr)throw new FS.ErrnoError(43);tr.tty=rr,tr.seekable=!1},close(tr){tr.tty.ops.fsync(tr.tty)},fsync(tr){tr.tty.ops.fsync(tr.tty)},read(tr,rr,ir,lr,dr){if(!tr.tty||!tr.tty.ops.get_char)throw new FS.ErrnoError(60);for(var fr=0,hr=0;hr<lr;hr++){var mr;try{mr=tr.tty.ops.get_char(tr.tty)}catch{throw new FS.ErrnoError(29)}if(mr===void 0&&fr===0)throw new FS.ErrnoError(6);if(mr==null)break;fr++,rr[ir+hr]=mr}return fr&&(tr.node.atime=Date.now()),fr},write(tr,rr,ir,lr,dr){if(!tr.tty||!tr.tty.ops.put_char)throw new FS.ErrnoError(60);try{for(var fr=0;fr<lr;fr++)tr.tty.ops.put_char(tr.tty,rr[ir+fr])}catch{throw new FS.ErrnoError(29)}return lr&&(tr.node.mtime=tr.node.ctime=Date.now()),fr}},default_tty_ops:{get_char(tr){return FS_stdin_getChar()},put_char(tr,rr){rr===null||rr===10?(out(UTF8ArrayToString(tr.output)),tr.output=[]):rr!=0&&tr.output.push(rr)},fsync(tr){tr.output&&tr.output.length>0&&(out(UTF8ArrayToString(tr.output)),tr.output=[])},ioctl_tcgets(tr){return{c_iflag:25856,c_oflag:5,c_cflag:191,c_lflag:35387,c_cc:[3,28,127,21,4,0,1,0,17,19,26,0,18,15,23,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}},ioctl_tcsets(tr,rr,ir){return 0},ioctl_tiocgwinsz(tr){return[24,80]}},default_tty1_ops:{put_char(tr,rr){rr===null||rr===10?(err(UTF8ArrayToString(tr.output)),tr.output=[]):rr!=0&&tr.output.push(rr)},fsync(tr){tr.output&&tr.output.length>0&&(err(UTF8ArrayToString(tr.output)),tr.output=[])}}},zeroMemory=(tr,rr)=>{HEAPU8.fill(0,tr,tr+rr)},mmapAlloc=tr=>{tr=alignMemory(tr,65536);var rr=_emscripten_builtin_memalign(65536,tr);return rr&&zeroMemory(rr,tr),rr},MEMFS={ops_table:null,mount(tr){return MEMFS.createNode(null,"/",16895,0)},createNode(tr,rr,ir,lr){if(FS.isBlkdev(ir)||FS.isFIFO(ir))throw new FS.ErrnoError(63);MEMFS.ops_table||(MEMFS.ops_table={dir:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr,lookup:MEMFS.node_ops.lookup,mknod:MEMFS.node_ops.mknod,rename:MEMFS.node_ops.rename,unlink:MEMFS.node_ops.unlink,rmdir:MEMFS.node_ops.rmdir,readdir:MEMFS.node_ops.readdir,symlink:MEMFS.node_ops.symlink},stream:{llseek:MEMFS.stream_ops.llseek}},file:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr},stream:{llseek:MEMFS.stream_ops.llseek,read:MEMFS.stream_ops.read,write:MEMFS.stream_ops.write,allocate:MEMFS.stream_ops.allocate,mmap:MEMFS.stream_ops.mmap,msync:MEMFS.stream_ops.msync}},link:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr,readlink:MEMFS.node_ops.readlink},stream:{}},chrdev:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr},stream:FS.chrdev_stream_ops}});var dr=FS.createNode(tr,rr,ir,lr);return FS.isDir(dr.mode)?(dr.node_ops=MEMFS.ops_table.dir.node,dr.stream_ops=MEMFS.ops_table.dir.stream,dr.contents={}):FS.isFile(dr.mode)?(dr.node_ops=MEMFS.ops_table.file.node,dr.stream_ops=MEMFS.ops_table.file.stream,dr.usedBytes=0,dr.contents=null):FS.isLink(dr.mode)?(dr.node_ops=MEMFS.ops_table.link.node,dr.stream_ops=MEMFS.ops_table.link.stream):FS.isChrdev(dr.mode)&&(dr.node_ops=MEMFS.ops_table.chrdev.node,dr.stream_ops=MEMFS.ops_table.chrdev.stream),dr.atime=dr.mtime=dr.ctime=Date.now(),tr&&(tr.contents[rr]=dr,tr.atime=tr.mtime=tr.ctime=dr.atime),dr},getFileDataAsTypedArray(tr){return tr.contents?tr.contents.subarray?tr.contents.subarray(0,tr.usedBytes):new Uint8Array(tr.contents):new Uint8Array(0)},expandFileStorage(tr,rr){var ir=tr.contents?tr.contents.length:0;if(!(ir>=rr)){var lr=1048576;rr=Math.max(rr,ir*(ir<lr?2:1.125)>>>0),ir!=0&&(rr=Math.max(rr,256));var dr=tr.contents;tr.contents=new Uint8Array(rr),tr.usedBytes>0&&tr.contents.set(dr.subarray(0,tr.usedBytes),0)}},resizeFileStorage(tr,rr){if(tr.usedBytes!=rr)if(rr==0)tr.contents=null,tr.usedBytes=0;else{var ir=tr.contents;tr.contents=new Uint8Array(rr),ir&&tr.contents.set(ir.subarray(0,Math.min(rr,tr.usedBytes))),tr.usedBytes=rr}},node_ops:{getattr(tr){var rr={};return rr.dev=FS.isChrdev(tr.mode)?tr.id:1,rr.ino=tr.id,rr.mode=tr.mode,rr.nlink=1,rr.uid=0,rr.gid=0,rr.rdev=tr.rdev,FS.isDir(tr.mode)?rr.size=4096:FS.isFile(tr.mode)?rr.size=tr.usedBytes:FS.isLink(tr.mode)?rr.size=tr.link.length:rr.size=0,rr.atime=new Date(tr.atime),rr.mtime=new Date(tr.mtime),rr.ctime=new Date(tr.ctime),rr.blksize=4096,rr.blocks=Math.ceil(rr.size/rr.blksize),rr},setattr(tr,rr){for(let ir of["mode","atime","mtime","ctime"])rr[ir]&&(tr[ir]=rr[ir]);rr.size!==void 0&&MEMFS.resizeFileStorage(tr,rr.size)},lookup(tr,rr){throw MEMFS.doesNotExistError},mknod(tr,rr,ir,lr){return MEMFS.createNode(tr,rr,ir,lr)},rename(tr,rr,ir){var lr;try{lr=FS.lookupNode(rr,ir)}catch{}if(lr){if(FS.isDir(tr.mode))for(var dr in lr.contents)throw new FS.ErrnoError(55);FS.hashRemoveNode(lr)}delete tr.parent.contents[tr.name],rr.contents[ir]=tr,tr.name=ir,rr.ctime=rr.mtime=tr.parent.ctime=tr.parent.mtime=Date.now()},unlink(tr,rr){delete tr.contents[rr],tr.ctime=tr.mtime=Date.now()},rmdir(tr,rr){var ir=FS.lookupNode(tr,rr);for(var lr in ir.contents)throw new FS.ErrnoError(55);delete tr.contents[rr],tr.ctime=tr.mtime=Date.now()},readdir(tr){return[".","..",...Object.keys(tr.contents)]},symlink(tr,rr,ir){var lr=MEMFS.createNode(tr,rr,41471,0);return lr.link=ir,lr},readlink(tr){if(!FS.isLink(tr.mode))throw new FS.ErrnoError(28);return tr.link}},stream_ops:{read(tr,rr,ir,lr,dr){var fr=tr.node.contents;if(dr>=tr.node.usedBytes)return 0;var hr=Math.min(tr.node.usedBytes-dr,lr);if(hr>8&&fr.subarray)rr.set(fr.subarray(dr,dr+hr),ir);else for(var mr=0;mr<hr;mr++)rr[ir+mr]=fr[dr+mr];return hr},write(tr,rr,ir,lr,dr,fr){if(rr.buffer===HEAP8.buffer&&(fr=!1),!lr)return 0;var hr=tr.node;if(hr.mtime=hr.ctime=Date.now(),rr.subarray&&(!hr.contents||hr.contents.subarray)){if(fr)return hr.contents=rr.subarray(ir,ir+lr),hr.usedBytes=lr,lr;if(hr.usedBytes===0&&dr===0)return hr.contents=rr.slice(ir,ir+lr),hr.usedBytes=lr,lr;if(dr+lr<=hr.usedBytes)return hr.contents.set(rr.subarray(ir,ir+lr),dr),lr}if(MEMFS.expandFileStorage(hr,dr+lr),hr.contents.subarray&&rr.subarray)hr.contents.set(rr.subarray(ir,ir+lr),dr);else for(var mr=0;mr<lr;mr++)hr.contents[dr+mr]=rr[ir+mr];return hr.usedBytes=Math.max(hr.usedBytes,dr+lr),lr},llseek(tr,rr,ir){var lr=rr;if(ir===1?lr+=tr.position:ir===2&&FS.isFile(tr.node.mode)&&(lr+=tr.node.usedBytes),lr<0)throw new FS.ErrnoError(28);return lr},allocate(tr,rr,ir){MEMFS.expandFileStorage(tr.node,rr+ir),tr.node.usedBytes=Math.max(tr.node.usedBytes,rr+ir)},mmap(tr,rr,ir,lr,dr){if(!FS.isFile(tr.node.mode))throw new FS.ErrnoError(43);var fr,hr,mr=tr.node.contents;if(!(dr&2)&&mr&&mr.buffer===HEAP8.buffer)hr=!1,fr=mr.byteOffset;else{if(hr=!0,fr=mmapAlloc(rr),!fr)throw new FS.ErrnoError(48);mr&&((ir>0||ir+rr<mr.length)&&(mr.subarray?mr=mr.subarray(ir,ir+rr):mr=Array.prototype.slice.call(mr,ir,ir+rr)),HEAP8.set(mr,fr))}return{ptr:fr,allocated:hr}},msync(tr,rr,ir,lr,dr){return MEMFS.stream_ops.write(tr,rr,0,lr,ir,!1),0}}},FS_createDataFile=(tr,rr,ir,lr,dr,fr)=>{FS.createDataFile(tr,rr,ir,lr,dr,fr)},FS_handledByPreloadPlugin=(tr,rr,ir,lr)=>{typeof Browser<"u"&&Browser.init();var dr=!1;return preloadPlugins.forEach(fr=>{dr||fr.canHandle(rr)&&(fr.handle(tr,rr,ir,lr),dr=!0)}),dr},FS_createPreloadedFile=(tr,rr,ir,lr,dr,fr,hr,mr,gr,yr)=>{var _r=rr?PATH_FS.resolve(PATH.join2(tr,rr)):tr;function br(vr){function wr(xr){yr==null||yr(),mr||FS_createDataFile(tr,rr,xr,lr,dr,gr),fr==null||fr(),removeRunDependency()}FS_handledByPreloadPlugin(vr,_r,wr,()=>{hr==null||hr(),removeRunDependency()})||wr(vr)}addRunDependency(),typeof ir=="string"?asyncLoad(ir).then(br,hr):br(ir)},FS_modeStringToFlags=tr=>{var rr={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090},ir=rr[tr];if(typeof ir>"u")throw new Error(`Unknown file open mode: ${tr}`);return ir},FS_getMode=(tr,rr)=>{var ir=0;return tr&&(ir|=365),rr&&(ir|=146),ir},IDBFS={dbs:{},indexedDB:()=>{if(typeof indexedDB<"u")return indexedDB;var tr=null;return typeof window=="object"&&(tr=window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB),tr},DB_VERSION:21,DB_STORE_NAME:"FILE_DATA",queuePersist:tr=>{function rr(){tr.idbPersistState==="again"?ir():tr.idbPersistState=0}function ir(){tr.idbPersistState="idb",IDBFS.syncfs(tr,!1,rr)}tr.idbPersistState?tr.idbPersistState==="idb"&&(tr.idbPersistState="again"):tr.idbPersistState=setTimeout(ir,0)},mount:tr=>{var lr;var rr=MEMFS.mount(tr);if((lr=tr==null?void 0:tr.opts)!=null&&lr.autoPersist){rr.idbPersistState=0;var ir=rr.node_ops;rr.node_ops=Object.assign({},rr.node_ops),rr.node_ops.mknod=(dr,fr,hr,mr)=>{var gr=ir.mknod(dr,fr,hr,mr);return gr.node_ops=rr.node_ops,gr.idbfs_mount=rr.mount,gr.memfs_stream_ops=gr.stream_ops,gr.stream_ops=Object.assign({},gr.stream_ops),gr.stream_ops.write=(yr,_r,br,vr,wr,xr)=>(yr.node.isModified=!0,gr.memfs_stream_ops.write(yr,_r,br,vr,wr,xr)),gr.stream_ops.close=yr=>{var _r=yr.node;if(_r.isModified&&(IDBFS.queuePersist(_r.idbfs_mount),_r.isModified=!1),_r.memfs_stream_ops.close)return _r.memfs_stream_ops.close(yr)},gr},rr.node_ops.mkdir=(...dr)=>(IDBFS.queuePersist(rr.mount),ir.mkdir(...dr)),rr.node_ops.rmdir=(...dr)=>(IDBFS.queuePersist(rr.mount),ir.rmdir(...dr)),rr.node_ops.symlink=(...dr)=>(IDBFS.queuePersist(rr.mount),ir.symlink(...dr)),rr.node_ops.unlink=(...dr)=>(IDBFS.queuePersist(rr.mount),ir.unlink(...dr)),rr.node_ops.rename=(...dr)=>(IDBFS.queuePersist(rr.mount),ir.rename(...dr))}return rr},syncfs:(tr,rr,ir)=>{IDBFS.getLocalSet(tr,(lr,dr)=>{if(lr)return ir(lr);IDBFS.getRemoteSet(tr,(fr,hr)=>{if(fr)return ir(fr);var mr=rr?hr:dr,gr=rr?dr:hr;IDBFS.reconcile(mr,gr,ir)})})},quit:()=>{Object.values(IDBFS.dbs).forEach(tr=>tr.close()),IDBFS.dbs={}},getDB:(tr,rr)=>{var ir=IDBFS.dbs[tr];if(ir)return rr(null,ir);var lr;try{lr=IDBFS.indexedDB().open(tr,IDBFS.DB_VERSION)}catch(dr){return rr(dr)}if(!lr)return rr("Unable to connect to IndexedDB");lr.onupgradeneeded=dr=>{var fr=dr.target.result,hr=dr.target.transaction,mr;fr.objectStoreNames.contains(IDBFS.DB_STORE_NAME)?mr=hr.objectStore(IDBFS.DB_STORE_NAME):mr=fr.createObjectStore(IDBFS.DB_STORE_NAME),mr.indexNames.contains("timestamp")||mr.createIndex("timestamp","timestamp",{unique:!1})},lr.onsuccess=()=>{ir=lr.result,IDBFS.dbs[tr]=ir,rr(null,ir)},lr.onerror=dr=>{rr(dr.target.error),dr.preventDefault()}},getLocalSet:(tr,rr)=>{var ir={};function lr(gr){return gr!=="."&&gr!==".."}function dr(gr){return yr=>PATH.join2(gr,yr)}for(var fr=FS.readdir(tr.mountpoint).filter(lr).map(dr(tr.mountpoint));fr.length;){var hr=fr.pop(),mr;try{mr=FS.stat(hr)}catch(gr){return rr(gr)}FS.isDir(mr.mode)&&fr.push(...FS.readdir(hr).filter(lr).map(dr(hr))),ir[hr]={timestamp:mr.mtime}}return rr(null,{type:"local",entries:ir})},getRemoteSet:(tr,rr)=>{var ir={};IDBFS.getDB(tr.mountpoint,(lr,dr)=>{if(lr)return rr(lr);try{var fr=dr.transaction([IDBFS.DB_STORE_NAME],"readonly");fr.onerror=gr=>{rr(gr.target.error),gr.preventDefault()};var hr=fr.objectStore(IDBFS.DB_STORE_NAME),mr=hr.index("timestamp");mr.openKeyCursor().onsuccess=gr=>{var yr=gr.target.result;if(!yr)return rr(null,{type:"remote",db:dr,entries:ir});ir[yr.primaryKey]={timestamp:yr.key},yr.continue()}}catch(gr){return rr(gr)}})},loadLocalEntry:(tr,rr)=>{var ir,lr;try{var dr=FS.lookupPath(tr);lr=dr.node,ir=FS.stat(tr)}catch(fr){return rr(fr)}return FS.isDir(ir.mode)?rr(null,{timestamp:ir.mtime,mode:ir.mode}):FS.isFile(ir.mode)?(lr.contents=MEMFS.getFileDataAsTypedArray(lr),rr(null,{timestamp:ir.mtime,mode:ir.mode,contents:lr.contents})):rr(new Error("node type not supported"))},storeLocalEntry:(tr,rr,ir)=>{try{if(FS.isDir(rr.mode))FS.mkdirTree(tr,rr.mode);else if(FS.isFile(rr.mode))FS.writeFile(tr,rr.contents,{canOwn:!0});else return ir(new Error("node type not supported"));FS.chmod(tr,rr.mode),FS.utime(tr,rr.timestamp,rr.timestamp)}catch(lr){return ir(lr)}ir(null)},removeLocalEntry:(tr,rr)=>{try{var ir=FS.stat(tr);FS.isDir(ir.mode)?FS.rmdir(tr):FS.isFile(ir.mode)&&FS.unlink(tr)}catch(lr){return rr(lr)}rr(null)},loadRemoteEntry:(tr,rr,ir)=>{var lr=tr.get(rr);lr.onsuccess=dr=>ir(null,dr.target.result),lr.onerror=dr=>{ir(dr.target.error),dr.preventDefault()}},storeRemoteEntry:(tr,rr,ir,lr)=>{try{var dr=tr.put(ir,rr)}catch(fr){lr(fr);return}dr.onsuccess=fr=>lr(),dr.onerror=fr=>{lr(fr.target.error),fr.preventDefault()}},removeRemoteEntry:(tr,rr,ir)=>{var lr=tr.delete(rr);lr.onsuccess=dr=>ir(),lr.onerror=dr=>{ir(dr.target.error),dr.preventDefault()}},reconcile:(tr,rr,ir)=>{var lr=0,dr=[];Object.keys(tr.entries).forEach(br=>{var vr=tr.entries[br],wr=rr.entries[br];(!wr||vr.timestamp.getTime()!=wr.timestamp.getTime())&&(dr.push(br),lr++)});var fr=[];if(Object.keys(rr.entries).forEach(br=>{tr.entries[br]||(fr.push(br),lr++)}),!lr)return ir(null);var hr=!1,mr=tr.type==="remote"?tr.db:rr.db,gr=mr.transaction([IDBFS.DB_STORE_NAME],"readwrite"),yr=gr.objectStore(IDBFS.DB_STORE_NAME);function _r(br){if(br&&!hr)return hr=!0,ir(br)}gr.onerror=gr.onabort=br=>{_r(br.target.error),br.preventDefault()},gr.oncomplete=br=>{hr||ir(null)},dr.sort().forEach(br=>{rr.type==="local"?IDBFS.loadRemoteEntry(yr,br,(vr,wr)=>{if(vr)return _r(vr);IDBFS.storeLocalEntry(br,wr,_r)}):IDBFS.loadLocalEntry(br,(vr,wr)=>{if(vr)return _r(vr);IDBFS.storeRemoteEntry(yr,br,wr,_r)})}),fr.sort().reverse().forEach(br=>{rr.type==="local"?IDBFS.removeLocalEntry(br,_r):IDBFS.removeRemoteEntry(yr,br,_r)})}},ERRNO_CODES={EPERM:63,ENOENT:44,ESRCH:71,EINTR:27,EIO:29,ENXIO:60,E2BIG:1,ENOEXEC:45,EBADF:8,ECHILD:12,EAGAIN:6,EWOULDBLOCK:6,ENOMEM:48,EACCES:2,EFAULT:21,ENOTBLK:105,EBUSY:10,EEXIST:20,EXDEV:75,ENODEV:43,ENOTDIR:54,EISDIR:31,EINVAL:28,ENFILE:41,EMFILE:33,ENOTTY:59,ETXTBSY:74,EFBIG:22,ENOSPC:51,ESPIPE:70,EROFS:69,EMLINK:34,EPIPE:64,EDOM:18,ERANGE:68,ENOMSG:49,EIDRM:24,ECHRNG:106,EL2NSYNC:156,EL3HLT:107,EL3RST:108,ELNRNG:109,EUNATCH:110,ENOCSI:111,EL2HLT:112,EDEADLK:16,ENOLCK:46,EBADE:113,EBADR:114,EXFULL:115,ENOANO:104,EBADRQC:103,EBADSLT:102,EDEADLOCK:16,EBFONT:101,ENOSTR:100,ENODATA:116,ETIME:117,ENOSR:118,ENONET:119,ENOPKG:120,EREMOTE:121,ENOLINK:47,EADV:122,ESRMNT:123,ECOMM:124,EPROTO:65,EMULTIHOP:36,EDOTDOT:125,EBADMSG:9,ENOTUNIQ:126,EBADFD:127,EREMCHG:128,ELIBACC:129,ELIBBAD:130,ELIBSCN:131,ELIBMAX:132,ELIBEXEC:133,ENOSYS:52,ENOTEMPTY:55,ENAMETOOLONG:37,ELOOP:32,EOPNOTSUPP:138,EPFNOSUPPORT:139,ECONNRESET:15,ENOBUFS:42,EAFNOSUPPORT:5,EPROTOTYPE:67,ENOTSOCK:57,ENOPROTOOPT:50,ESHUTDOWN:140,ECONNREFUSED:14,EADDRINUSE:3,ECONNABORTED:13,ENETUNREACH:40,ENETDOWN:38,ETIMEDOUT:73,EHOSTDOWN:142,EHOSTUNREACH:23,EINPROGRESS:26,EALREADY:7,EDESTADDRREQ:17,EMSGSIZE:35,EPROTONOSUPPORT:66,ESOCKTNOSUPPORT:137,EADDRNOTAVAIL:4,ENETRESET:39,EISCONN:30,ENOTCONN:53,ETOOMANYREFS:141,EUSERS:136,EDQUOT:19,ESTALE:72,ENOTSUP:138,ENOMEDIUM:148,EILSEQ:25,EOVERFLOW:61,ECANCELED:11,ENOTRECOVERABLE:56,EOWNERDEAD:62,ESTRPIPE:135},NODEFS={isWindows:!1,staticInit(){NODEFS.isWindows=!!process.platform.match(/^win/);var tr=process.binding("constants");tr.fs&&(tr=tr.fs),NODEFS.flagsForNodeMap={1024:tr.O_APPEND,64:tr.O_CREAT,128:tr.O_EXCL,256:tr.O_NOCTTY,0:tr.O_RDONLY,2:tr.O_RDWR,4096:tr.O_SYNC,512:tr.O_TRUNC,1:tr.O_WRONLY,131072:tr.O_NOFOLLOW}},convertNodeCode(tr){var rr=tr.code;return ERRNO_CODES[rr]},tryFSOperation(tr){try{return tr()}catch(rr){throw rr.code?rr.code==="UNKNOWN"?new FS.ErrnoError(28):new FS.ErrnoError(NODEFS.convertNodeCode(rr)):rr}},mount(tr){return NODEFS.createNode(null,"/",NODEFS.getMode(tr.opts.root),0)},createNode(tr,rr,ir,lr){if(!FS.isDir(ir)&&!FS.isFile(ir)&&!FS.isLink(ir))throw new FS.ErrnoError(28);var dr=FS.createNode(tr,rr,ir);return dr.node_ops=NODEFS.node_ops,dr.stream_ops=NODEFS.stream_ops,dr},getMode(tr){return NODEFS.tryFSOperation(()=>{var rr=fs.lstatSync(tr).mode;return NODEFS.isWindows&&(rr|=(rr&292)>>2),rr})},realPath(tr){for(var rr=[];tr.parent!==tr;)rr.push(tr.name),tr=tr.parent;return rr.push(tr.mount.opts.root),rr.reverse(),PATH.join(...rr)},flagsForNode(tr){tr&=-2097153,tr&=-2049,tr&=-32769,tr&=-524289,tr&=-65537;var rr=0;for(var ir in NODEFS.flagsForNodeMap)tr&ir&&(rr|=NODEFS.flagsForNodeMap[ir],tr^=ir);if(tr)throw new FS.ErrnoError(28);return rr},node_ops:{getattr(tr){var rr=NODEFS.realPath(tr),ir;return NODEFS.tryFSOperation(()=>ir=fs.lstatSync(rr)),NODEFS.isWindows&&(ir.blksize||(ir.blksize=4096),ir.blocks||(ir.blocks=(ir.size+ir.blksize-1)/ir.blksize|0),ir.mode|=(ir.mode&292)>>2),{dev:ir.dev,ino:ir.ino,mode:ir.mode,nlink:ir.nlink,uid:ir.uid,gid:ir.gid,rdev:ir.rdev,size:ir.size,atime:ir.atime,mtime:ir.mtime,ctime:ir.ctime,blksize:ir.blksize,blocks:ir.blocks}},setattr(tr,rr){var ir=NODEFS.realPath(tr);NODEFS.tryFSOperation(()=>{if(rr.mode!==void 0){var lr=rr.mode;NODEFS.isWindows&&(lr&=384),fs.chmodSync(ir,lr),tr.mode=rr.mode}if(rr.atime||rr.mtime){var dr=rr.atime&&new Date(rr.atime),fr=rr.mtime&&new Date(rr.mtime);fs.utimesSync(ir,dr,fr)}rr.size!==void 0&&fs.truncateSync(ir,rr.size)})},lookup(tr,rr){var ir=PATH.join2(NODEFS.realPath(tr),rr),lr=NODEFS.getMode(ir);return NODEFS.createNode(tr,rr,lr)},mknod(tr,rr,ir,lr){var dr=NODEFS.createNode(tr,rr,ir,lr),fr=NODEFS.realPath(dr);return NODEFS.tryFSOperation(()=>{FS.isDir(dr.mode)?fs.mkdirSync(fr,dr.mode):fs.writeFileSync(fr,"",{mode:dr.mode})}),dr},rename(tr,rr,ir){var lr=NODEFS.realPath(tr),dr=PATH.join2(NODEFS.realPath(rr),ir);try{FS.unlink(dr)}catch{}NODEFS.tryFSOperation(()=>fs.renameSync(lr,dr)),tr.name=ir},unlink(tr,rr){var ir=PATH.join2(NODEFS.realPath(tr),rr);NODEFS.tryFSOperation(()=>fs.unlinkSync(ir))},rmdir(tr,rr){var ir=PATH.join2(NODEFS.realPath(tr),rr);NODEFS.tryFSOperation(()=>fs.rmdirSync(ir))},readdir(tr){var rr=NODEFS.realPath(tr);return NODEFS.tryFSOperation(()=>fs.readdirSync(rr))},symlink(tr,rr,ir){var lr=PATH.join2(NODEFS.realPath(tr),rr);NODEFS.tryFSOperation(()=>fs.symlinkSync(ir,lr))},readlink(tr){var rr=NODEFS.realPath(tr);return NODEFS.tryFSOperation(()=>fs.readlinkSync(rr))},statfs(tr){var rr=NODEFS.tryFSOperation(()=>fs.statfsSync(tr));return rr.frsize=rr.bsize,rr}},stream_ops:{open(tr){var rr=NODEFS.realPath(tr.node);NODEFS.tryFSOperation(()=>{FS.isFile(tr.node.mode)&&(tr.shared.refcount=1,tr.nfd=fs.openSync(rr,NODEFS.flagsForNode(tr.flags)))})},close(tr){NODEFS.tryFSOperation(()=>{FS.isFile(tr.node.mode)&&tr.nfd&&--tr.shared.refcount===0&&fs.closeSync(tr.nfd)})},dup(tr){tr.shared.refcount++},read(tr,rr,ir,lr,dr){return lr===0?0:NODEFS.tryFSOperation(()=>fs.readSync(tr.nfd,new Int8Array(rr.buffer,ir,lr),0,lr,dr))},write(tr,rr,ir,lr,dr){return NODEFS.tryFSOperation(()=>fs.writeSync(tr.nfd,new Int8Array(rr.buffer,ir,lr),0,lr,dr))},llseek(tr,rr,ir){var lr=rr;if(ir===1?lr+=tr.position:ir===2&&FS.isFile(tr.node.mode)&&NODEFS.tryFSOperation(()=>{var dr=fs.fstatSync(tr.nfd);lr+=dr.size}),lr<0)throw new FS.ErrnoError(28);return lr},mmap(tr,rr,ir,lr,dr){if(!FS.isFile(tr.node.mode))throw new FS.ErrnoError(43);var fr=mmapAlloc(rr);return NODEFS.stream_ops.read(tr,HEAP8,fr,rr,ir),{ptr:fr,allocated:!0}},msync(tr,rr,ir,lr,dr){return NODEFS.stream_ops.write(tr,rr,0,lr,ir,!1),0}}},FS={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,ErrnoError:class{constructor(tr){P$2(this,"name","ErrnoError"),this.errno=tr}},filesystems:null,syncFSRequests:0,readFiles:{},FSStream:class{constructor(){P$2(this,"shared",{})}get object(){return this.node}set object(tr){this.node=tr}get isRead(){return(this.flags&2097155)!==1}get isWrite(){return(this.flags&2097155)!==0}get isAppend(){return this.flags&1024}get flags(){return this.shared.flags}set flags(tr){this.shared.flags=tr}get position(){return this.shared.position}set position(tr){this.shared.position=tr}},FSNode:class{constructor(tr,rr,ir,lr){P$2(this,"node_ops",{}),P$2(this,"stream_ops",{}),P$2(this,"readMode",365),P$2(this,"writeMode",146),P$2(this,"mounted",null),tr||(tr=this),this.parent=tr,this.mount=tr.mount,this.id=FS.nextInode++,this.name=rr,this.mode=ir,this.rdev=lr,this.atime=this.mtime=this.ctime=Date.now()}get read(){return(this.mode&this.readMode)===this.readMode}set read(tr){tr?this.mode|=this.readMode:this.mode&=~this.readMode}get write(){return(this.mode&this.writeMode)===this.writeMode}set write(tr){tr?this.mode|=this.writeMode:this.mode&=~this.writeMode}get isFolder(){return FS.isDir(this.mode)}get isDevice(){return FS.isChrdev(this.mode)}},lookupPath(tr,rr={}){if(!tr)return{path:"",node:null};rr.follow_mount??(rr.follow_mount=!0),PATH.isAbs(tr)||(tr=FS.cwd()+"/"+tr);e:for(var ir=0;ir<40;ir++){for(var lr=tr.split("/").filter(yr=>!!yr&&yr!=="."),dr=FS.root,fr="/",hr=0;hr<lr.length;hr++){var mr=hr===lr.length-1;if(mr&&rr.parent)break;if(lr[hr]===".."){fr=PATH.dirname(fr),dr=dr.parent;continue}fr=PATH.join2(fr,lr[hr]);try{dr=FS.lookupNode(dr,lr[hr])}catch(yr){if((yr==null?void 0:yr.errno)===44&&mr&&rr.noent_okay)return{path:fr};throw yr}if(FS.isMountpoint(dr)&&(!mr||rr.follow_mount)&&(dr=dr.mounted.root),FS.isLink(dr.mode)&&(!mr||rr.follow)){if(!dr.node_ops.readlink)throw new FS.ErrnoError(52);var gr=dr.node_ops.readlink(dr);PATH.isAbs(gr)||(gr=PATH.dirname(fr)+"/"+gr),tr=gr+"/"+lr.slice(hr+1).join("/");continue e}}return{path:fr,node:dr}}throw new FS.ErrnoError(32)},getPath(tr){for(var rr;;){if(FS.isRoot(tr)){var ir=tr.mount.mountpoint;return rr?ir[ir.length-1]!=="/"?`${ir}/${rr}`:ir+rr:ir}rr=rr?`${tr.name}/${rr}`:tr.name,tr=tr.parent}},hashName(tr,rr){for(var ir=0,lr=0;lr<rr.length;lr++)ir=(ir<<5)-ir+rr.charCodeAt(lr)|0;return(tr+ir>>>0)%FS.nameTable.length},hashAddNode(tr){var rr=FS.hashName(tr.parent.id,tr.name);tr.name_next=FS.nameTable[rr],FS.nameTable[rr]=tr},hashRemoveNode(tr){var rr=FS.hashName(tr.parent.id,tr.name);if(FS.nameTable[rr]===tr)FS.nameTable[rr]=tr.name_next;else for(var ir=FS.nameTable[rr];ir;){if(ir.name_next===tr){ir.name_next=tr.name_next;break}ir=ir.name_next}},lookupNode(tr,rr){var ir=FS.mayLookup(tr);if(ir)throw new FS.ErrnoError(ir);for(var lr=FS.hashName(tr.id,rr),dr=FS.nameTable[lr];dr;dr=dr.name_next){var fr=dr.name;if(dr.parent.id===tr.id&&fr===rr)return dr}return FS.lookup(tr,rr)},createNode(tr,rr,ir,lr){var dr=new FS.FSNode(tr,rr,ir,lr);return FS.hashAddNode(dr),dr},destroyNode(tr){FS.hashRemoveNode(tr)},isRoot(tr){return tr===tr.parent},isMountpoint(tr){return!!tr.mounted},isFile(tr){return(tr&61440)===32768},isDir(tr){return(tr&61440)===16384},isLink(tr){return(tr&61440)===40960},isChrdev(tr){return(tr&61440)===8192},isBlkdev(tr){return(tr&61440)===24576},isFIFO(tr){return(tr&61440)===4096},isSocket(tr){return(tr&49152)===49152},flagsToPermissionString(tr){var rr=["r","w","rw"][tr&3];return tr&512&&(rr+="w"),rr},nodePermissions(tr,rr){return FS.ignorePermissions?0:rr.includes("r")&&!(tr.mode&292)||rr.includes("w")&&!(tr.mode&146)||rr.includes("x")&&!(tr.mode&73)?2:0},mayLookup(tr){if(!FS.isDir(tr.mode))return 54;var rr=FS.nodePermissions(tr,"x");return rr||(tr.node_ops.lookup?0:2)},mayCreate(tr,rr){if(!FS.isDir(tr.mode))return 54;try{return FS.lookupNode(tr,rr),20}catch{}return FS.nodePermissions(tr,"wx")},mayDelete(tr,rr,ir){var lr;try{lr=FS.lookupNode(tr,rr)}catch(fr){return fr.errno}var dr=FS.nodePermissions(tr,"wx");if(dr)return dr;if(ir){if(!FS.isDir(lr.mode))return 54;if(FS.isRoot(lr)||FS.getPath(lr)===FS.cwd())return 10}else if(FS.isDir(lr.mode))return 31;return 0},mayOpen(tr,rr){return tr?FS.isLink(tr.mode)?32:FS.isDir(tr.mode)&&(FS.flagsToPermissionString(rr)!=="r"||rr&512)?31:FS.nodePermissions(tr,FS.flagsToPermissionString(rr)):44},MAX_OPEN_FDS:4096,nextfd(){for(var tr=0;tr<=FS.MAX_OPEN_FDS;tr++)if(!FS.streams[tr])return tr;throw new FS.ErrnoError(33)},getStreamChecked(tr){var rr=FS.getStream(tr);if(!rr)throw new FS.ErrnoError(8);return rr},getStream:tr=>FS.streams[tr],createStream(tr,rr=-1){return tr=Object.assign(new FS.FSStream,tr),rr==-1&&(rr=FS.nextfd()),tr.fd=rr,FS.streams[rr]=tr,tr},closeStream(tr){FS.streams[tr]=null},dupStream(tr,rr=-1){var lr,dr;var ir=FS.createStream(tr,rr);return(dr=(lr=ir.stream_ops)==null?void 0:lr.dup)==null||dr.call(lr,ir),ir},chrdev_stream_ops:{open(tr){var ir,lr;var rr=FS.getDevice(tr.node.rdev);tr.stream_ops=rr.stream_ops,(lr=(ir=tr.stream_ops).open)==null||lr.call(ir,tr)},llseek(){throw new FS.ErrnoError(70)}},major:tr=>tr>>8,minor:tr=>tr&255,makedev:(tr,rr)=>tr<<8|rr,registerDevice(tr,rr){FS.devices[tr]={stream_ops:rr}},getDevice:tr=>FS.devices[tr],getMounts(tr){for(var rr=[],ir=[tr];ir.length;){var lr=ir.pop();rr.push(lr),ir.push(...lr.mounts)}return rr},syncfs(tr,rr){typeof tr=="function"&&(rr=tr,tr=!1),FS.syncFSRequests++,FS.syncFSRequests>1&&err(`warning: ${FS.syncFSRequests} FS.syncfs operations in flight at once, probably just doing extra work`);var ir=FS.getMounts(FS.root.mount),lr=0;function dr(hr){return FS.syncFSRequests--,rr(hr)}function fr(hr){if(hr)return fr.errored?void 0:(fr.errored=!0,dr(hr));++lr>=ir.length&&dr(null)}ir.forEach(hr=>{if(!hr.type.syncfs)return fr(null);hr.type.syncfs(hr,tr,fr)})},mount(tr,rr,ir){var lr=ir==="/",dr=!ir,fr;if(lr&&FS.root)throw new FS.ErrnoError(10);if(!lr&&!dr){var hr=FS.lookupPath(ir,{follow_mount:!1});if(ir=hr.path,fr=hr.node,FS.isMountpoint(fr))throw new FS.ErrnoError(10);if(!FS.isDir(fr.mode))throw new FS.ErrnoError(54)}var mr={type:tr,opts:rr,mountpoint:ir,mounts:[]},gr=tr.mount(mr);return gr.mount=mr,mr.root=gr,lr?FS.root=gr:fr&&(fr.mounted=mr,fr.mount&&fr.mount.mounts.push(mr)),gr},unmount(tr){var rr=FS.lookupPath(tr,{follow_mount:!1});if(!FS.isMountpoint(rr.node))throw new FS.ErrnoError(28);var ir=rr.node,lr=ir.mounted,dr=FS.getMounts(lr);Object.keys(FS.nameTable).forEach(hr=>{for(var mr=FS.nameTable[hr];mr;){var gr=mr.name_next;dr.includes(mr.mount)&&FS.destroyNode(mr),mr=gr}}),ir.mounted=null;var fr=ir.mount.mounts.indexOf(lr);ir.mount.mounts.splice(fr,1)},lookup(tr,rr){return tr.node_ops.lookup(tr,rr)},mknod(tr,rr,ir){var lr=FS.lookupPath(tr,{parent:!0}),dr=lr.node,fr=PATH.basename(tr);if(!fr||fr==="."||fr==="..")throw new FS.ErrnoError(28);var hr=FS.mayCreate(dr,fr);if(hr)throw new FS.ErrnoError(hr);if(!dr.node_ops.mknod)throw new FS.ErrnoError(63);return dr.node_ops.mknod(dr,fr,rr,ir)},statfs(tr){var rr={bsize:4096,frsize:4096,blocks:1e6,bfree:5e5,bavail:5e5,files:FS.nextInode,ffree:FS.nextInode-1,fsid:42,flags:2,namelen:255},ir=FS.lookupPath(tr,{follow:!0}).node;return ir!=null&&ir.node_ops.statfs&&Object.assign(rr,ir.node_ops.statfs(ir.mount.opts.root)),rr},create(tr,rr=438){return rr&=4095,rr|=32768,FS.mknod(tr,rr,0)},mkdir(tr,rr=511){return rr&=1023,rr|=16384,FS.mknod(tr,rr,0)},mkdirTree(tr,rr){for(var ir=tr.split("/"),lr="",dr=0;dr<ir.length;++dr)if(ir[dr]){lr+="/"+ir[dr];try{FS.mkdir(lr,rr)}catch(fr){if(fr.errno!=20)throw fr}}},mkdev(tr,rr,ir){return typeof ir>"u"&&(ir=rr,rr=438),rr|=8192,FS.mknod(tr,rr,ir)},symlink(tr,rr){if(!PATH_FS.resolve(tr))throw new FS.ErrnoError(44);var ir=FS.lookupPath(rr,{parent:!0}),lr=ir.node;if(!lr)throw new FS.ErrnoError(44);var dr=PATH.basename(rr),fr=FS.mayCreate(lr,dr);if(fr)throw new FS.ErrnoError(fr);if(!lr.node_ops.symlink)throw new FS.ErrnoError(63);return lr.node_ops.symlink(lr,dr,tr)},rename(tr,rr){var ir=PATH.dirname(tr),lr=PATH.dirname(rr),dr=PATH.basename(tr),fr=PATH.basename(rr),hr,mr,gr;if(hr=FS.lookupPath(tr,{parent:!0}),mr=hr.node,hr=FS.lookupPath(rr,{parent:!0}),gr=hr.node,!mr||!gr)throw new FS.ErrnoError(44);if(mr.mount!==gr.mount)throw new FS.ErrnoError(75);var yr=FS.lookupNode(mr,dr),_r=PATH_FS.relative(tr,lr);if(_r.charAt(0)!==".")throw new FS.ErrnoError(28);if(_r=PATH_FS.relative(rr,ir),_r.charAt(0)!==".")throw new FS.ErrnoError(55);var br;try{br=FS.lookupNode(gr,fr)}catch{}if(yr!==br){var vr=FS.isDir(yr.mode),wr=FS.mayDelete(mr,dr,vr);if(wr)throw new FS.ErrnoError(wr);if(wr=br?FS.mayDelete(gr,fr,vr):FS.mayCreate(gr,fr),wr)throw new FS.ErrnoError(wr);if(!mr.node_ops.rename)throw new FS.ErrnoError(63);if(FS.isMountpoint(yr)||br&&FS.isMountpoint(br))throw new FS.ErrnoError(10);if(gr!==mr&&(wr=FS.nodePermissions(mr,"w"),wr))throw new FS.ErrnoError(wr);FS.hashRemoveNode(yr);try{mr.node_ops.rename(yr,gr,fr),yr.parent=gr}catch(xr){throw xr}finally{FS.hashAddNode(yr)}}},rmdir(tr){var rr=FS.lookupPath(tr,{parent:!0}),ir=rr.node,lr=PATH.basename(tr),dr=FS.lookupNode(ir,lr),fr=FS.mayDelete(ir,lr,!0);if(fr)throw new FS.ErrnoError(fr);if(!ir.node_ops.rmdir)throw new FS.ErrnoError(63);if(FS.isMountpoint(dr))throw new FS.ErrnoError(10);ir.node_ops.rmdir(ir,lr),FS.destroyNode(dr)},readdir(tr){var rr=FS.lookupPath(tr,{follow:!0}),ir=rr.node;if(!ir.node_ops.readdir)throw new FS.ErrnoError(54);return ir.node_ops.readdir(ir)},unlink(tr){var rr=FS.lookupPath(tr,{parent:!0}),ir=rr.node;if(!ir)throw new FS.ErrnoError(44);var lr=PATH.basename(tr),dr=FS.lookupNode(ir,lr),fr=FS.mayDelete(ir,lr,!1);if(fr)throw new FS.ErrnoError(fr);if(!ir.node_ops.unlink)throw new FS.ErrnoError(63);if(FS.isMountpoint(dr))throw new FS.ErrnoError(10);ir.node_ops.unlink(ir,lr),FS.destroyNode(dr)},readlink(tr){var rr=FS.lookupPath(tr),ir=rr.node;if(!ir)throw new FS.ErrnoError(44);if(!ir.node_ops.readlink)throw new FS.ErrnoError(28);return ir.node_ops.readlink(ir)},stat(tr,rr){var ir=FS.lookupPath(tr,{follow:!rr}),lr=ir.node;if(!lr)throw new FS.ErrnoError(44);if(!lr.node_ops.getattr)throw new FS.ErrnoError(63);return lr.node_ops.getattr(lr)},lstat(tr){return FS.stat(tr,!0)},chmod(tr,rr,ir){var lr;if(typeof tr=="string"){var dr=FS.lookupPath(tr,{follow:!ir});lr=dr.node}else lr=tr;if(!lr.node_ops.setattr)throw new FS.ErrnoError(63);lr.node_ops.setattr(lr,{mode:rr&4095|lr.mode&-4096,ctime:Date.now()})},lchmod(tr,rr){FS.chmod(tr,rr,!0)},fchmod(tr,rr){var ir=FS.getStreamChecked(tr);FS.chmod(ir.node,rr)},chown(tr,rr,ir,lr){var dr;if(typeof tr=="string"){var fr=FS.lookupPath(tr,{follow:!lr});dr=fr.node}else dr=tr;if(!dr.node_ops.setattr)throw new FS.ErrnoError(63);dr.node_ops.setattr(dr,{timestamp:Date.now()})},lchown(tr,rr,ir){FS.chown(tr,rr,ir,!0)},fchown(tr,rr,ir){var lr=FS.getStreamChecked(tr);FS.chown(lr.node,rr,ir)},truncate(tr,rr){if(rr<0)throw new FS.ErrnoError(28);var ir;if(typeof tr=="string"){var lr=FS.lookupPath(tr,{follow:!0});ir=lr.node}else ir=tr;if(!ir.node_ops.setattr)throw new FS.ErrnoError(63);if(FS.isDir(ir.mode))throw new FS.ErrnoError(31);if(!FS.isFile(ir.mode))throw new FS.ErrnoError(28);var dr=FS.nodePermissions(ir,"w");if(dr)throw new FS.ErrnoError(dr);ir.node_ops.setattr(ir,{size:rr,timestamp:Date.now()})},ftruncate(tr,rr){var ir=FS.getStreamChecked(tr);if(!(ir.flags&2097155))throw new FS.ErrnoError(28);FS.truncate(ir.node,rr)},utime(tr,rr,ir){var lr=FS.lookupPath(tr,{follow:!0}),dr=lr.node;dr.node_ops.setattr(dr,{atime:rr,mtime:ir})},open(tr,rr,ir=438){if(tr==="")throw new FS.ErrnoError(44);rr=typeof rr=="string"?FS_modeStringToFlags(rr):rr,rr&64?ir=ir&4095|32768:ir=0;var lr;if(typeof tr=="object")lr=tr;else{var dr=FS.lookupPath(tr,{follow:!(rr&131072),noent_okay:!0});lr=dr.node,tr=dr.path}var fr=!1;if(rr&64)if(lr){if(rr&128)throw new FS.ErrnoError(20)}else lr=FS.mknod(tr,ir,0),fr=!0;if(!lr)throw new FS.ErrnoError(44);if(FS.isChrdev(lr.mode)&&(rr&=-513),rr&65536&&!FS.isDir(lr.mode))throw new FS.ErrnoError(54);if(!fr){var hr=FS.mayOpen(lr,rr);if(hr)throw new FS.ErrnoError(hr)}rr&512&&!fr&&FS.truncate(lr,0),rr&=-131713;var mr=FS.createStream({node:lr,path:FS.getPath(lr),flags:rr,seekable:!0,position:0,stream_ops:lr.stream_ops,ungotten:[],error:!1});return mr.stream_ops.open&&mr.stream_ops.open(mr),Module.logReadFiles&&!(rr&1)&&(tr in FS.readFiles||(FS.readFiles[tr]=1)),mr},close(tr){if(FS.isClosed(tr))throw new FS.ErrnoError(8);tr.getdents&&(tr.getdents=null);try{tr.stream_ops.close&&tr.stream_ops.close(tr)}catch(rr){throw rr}finally{FS.closeStream(tr.fd)}tr.fd=null},isClosed(tr){return tr.fd===null},llseek(tr,rr,ir){if(FS.isClosed(tr))throw new FS.ErrnoError(8);if(!tr.seekable||!tr.stream_ops.llseek)throw new FS.ErrnoError(70);if(ir!=0&&ir!=1&&ir!=2)throw new FS.ErrnoError(28);return tr.position=tr.stream_ops.llseek(tr,rr,ir),tr.ungotten=[],tr.position},read(tr,rr,ir,lr,dr){if(lr<0||dr<0)throw new FS.ErrnoError(28);if(FS.isClosed(tr))throw new FS.ErrnoError(8);if((tr.flags&2097155)===1)throw new FS.ErrnoError(8);if(FS.isDir(tr.node.mode))throw new FS.ErrnoError(31);if(!tr.stream_ops.read)throw new FS.ErrnoError(28);var fr=typeof dr<"u";if(!fr)dr=tr.position;else if(!tr.seekable)throw new FS.ErrnoError(70);var hr=tr.stream_ops.read(tr,rr,ir,lr,dr);return fr||(tr.position+=hr),hr},write(tr,rr,ir,lr,dr,fr){if(lr<0||dr<0)throw new FS.ErrnoError(28);if(FS.isClosed(tr))throw new FS.ErrnoError(8);if(!(tr.flags&2097155))throw new FS.ErrnoError(8);if(FS.isDir(tr.node.mode))throw new FS.ErrnoError(31);if(!tr.stream_ops.write)throw new FS.ErrnoError(28);tr.seekable&&tr.flags&1024&&FS.llseek(tr,0,2);var hr=typeof dr<"u";if(!hr)dr=tr.position;else if(!tr.seekable)throw new FS.ErrnoError(70);var mr=tr.stream_ops.write(tr,rr,ir,lr,dr,fr);return hr||(tr.position+=mr),mr},allocate(tr,rr,ir){if(FS.isClosed(tr))throw new FS.ErrnoError(8);if(rr<0||ir<=0)throw new FS.ErrnoError(28);if(!(tr.flags&2097155))throw new FS.ErrnoError(8);if(!FS.isFile(tr.node.mode)&&!FS.isDir(tr.node.mode))throw new FS.ErrnoError(43);if(!tr.stream_ops.allocate)throw new FS.ErrnoError(138);tr.stream_ops.allocate(tr,rr,ir)},mmap(tr,rr,ir,lr,dr){if(lr&2&&!(dr&2)&&(tr.flags&2097155)!==2)throw new FS.ErrnoError(2);if((tr.flags&2097155)===1)throw new FS.ErrnoError(2);if(!tr.stream_ops.mmap)throw new FS.ErrnoError(43);if(!rr)throw new FS.ErrnoError(28);return tr.stream_ops.mmap(tr,rr,ir,lr,dr)},msync(tr,rr,ir,lr,dr){return tr.stream_ops.msync?tr.stream_ops.msync(tr,rr,ir,lr,dr):0},ioctl(tr,rr,ir){if(!tr.stream_ops.ioctl)throw new FS.ErrnoError(59);return tr.stream_ops.ioctl(tr,rr,ir)},readFile(tr,rr={}){if(rr.flags=rr.flags||0,rr.encoding=rr.encoding||"binary",rr.encoding!=="utf8"&&rr.encoding!=="binary")throw new Error(`Invalid encoding type "${rr.encoding}"`);var ir,lr=FS.open(tr,rr.flags),dr=FS.stat(tr),fr=dr.size,hr=new Uint8Array(fr);return FS.read(lr,hr,0,fr,0),rr.encoding==="utf8"?ir=UTF8ArrayToString(hr):rr.encoding==="binary"&&(ir=hr),FS.close(lr),ir},writeFile(tr,rr,ir={}){ir.flags=ir.flags||577;var lr=FS.open(tr,ir.flags,ir.mode);if(typeof rr=="string"){var dr=new Uint8Array(lengthBytesUTF8(rr)+1),fr=stringToUTF8Array(rr,dr,0,dr.length);FS.write(lr,dr,0,fr,void 0,ir.canOwn)}else if(ArrayBuffer.isView(rr))FS.write(lr,rr,0,rr.byteLength,void 0,ir.canOwn);else throw new Error("Unsupported data type");FS.close(lr)},cwd:()=>FS.currentPath,chdir(tr){var rr=FS.lookupPath(tr,{follow:!0});if(rr.node===null)throw new FS.ErrnoError(44);if(!FS.isDir(rr.node.mode))throw new FS.ErrnoError(54);var ir=FS.nodePermissions(rr.node,"x");if(ir)throw new FS.ErrnoError(ir);FS.currentPath=rr.path},createDefaultDirectories(){FS.mkdir("/tmp"),FS.mkdir("/home"),FS.mkdir("/home/web_user")},createDefaultDevices(){FS.mkdir("/dev"),FS.registerDevice(FS.makedev(1,3),{read:()=>0,write:(lr,dr,fr,hr,mr)=>hr,llseek:()=>0}),FS.mkdev("/dev/null",FS.makedev(1,3)),TTY.register(FS.makedev(5,0),TTY.default_tty_ops),TTY.register(FS.makedev(6,0),TTY.default_tty1_ops),FS.mkdev("/dev/tty",FS.makedev(5,0)),FS.mkdev("/dev/tty1",FS.makedev(6,0));var tr=new Uint8Array(1024),rr=0,ir=()=>(rr===0&&(rr=randomFill(tr).byteLength),tr[--rr]);FS.createDevice("/dev","random",ir),FS.createDevice("/dev","urandom",ir),FS.mkdir("/dev/shm"),FS.mkdir("/dev/shm/tmp")},createSpecialDirectories(){FS.mkdir("/proc");var tr=FS.mkdir("/proc/self");FS.mkdir("/proc/self/fd"),FS.mount({mount(){var rr=FS.createNode(tr,"fd",16895,73);return rr.stream_ops={llseek:MEMFS.stream_ops.llseek},rr.node_ops={lookup(ir,lr){var dr=+lr,fr=FS.getStreamChecked(dr),hr={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>fr.path},id:dr+1};return hr.parent=hr,hr},readdir(){return Array.from(FS.streams.entries()).filter(([ir,lr])=>lr).map(([ir,lr])=>ir.toString())}},rr}},{},"/proc/self/fd")},createStandardStreams(tr,rr,ir){tr?FS.createDevice("/dev","stdin",tr):FS.symlink("/dev/tty","/dev/stdin"),rr?FS.createDevice("/dev","stdout",null,rr):FS.symlink("/dev/tty","/dev/stdout"),ir?FS.createDevice("/dev","stderr",null,ir):FS.symlink("/dev/tty1","/dev/stderr"),FS.open("/dev/stdin",0),FS.open("/dev/stdout",1),FS.open("/dev/stderr",1)},staticInit(){FS.nameTable=new Array(4096),FS.mount(MEMFS,{},"/"),FS.createDefaultDirectories(),FS.createDefaultDevices(),FS.createSpecialDirectories(),FS.filesystems={MEMFS,IDBFS,NODEFS}},init(tr,rr,ir){FS.initialized=!0,tr??(tr=Module.stdin),rr??(rr=Module.stdout),ir??(ir=Module.stderr),FS.createStandardStreams(tr,rr,ir)},quit(){FS.initialized=!1,_fflush(0);for(var tr=0;tr<FS.streams.length;tr++){var rr=FS.streams[tr];rr&&FS.close(rr)}},findObject(tr,rr){var ir=FS.analyzePath(tr,rr);return ir.exists?ir.object:null},analyzePath(tr,rr){try{var ir=FS.lookupPath(tr,{follow:!rr});tr=ir.path}catch{}var lr={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};try{var ir=FS.lookupPath(tr,{parent:!0});lr.parentExists=!0,lr.parentPath=ir.path,lr.parentObject=ir.node,lr.name=PATH.basename(tr),ir=FS.lookupPath(tr,{follow:!rr}),lr.exists=!0,lr.path=ir.path,lr.object=ir.node,lr.name=ir.node.name,lr.isRoot=ir.path==="/"}catch(dr){lr.error=dr.errno}return lr},createPath(tr,rr,ir,lr){tr=typeof tr=="string"?tr:FS.getPath(tr);for(var dr=rr.split("/").reverse();dr.length;){var fr=dr.pop();if(fr){var hr=PATH.join2(tr,fr);try{FS.mkdir(hr)}catch{}tr=hr}}return hr},createFile(tr,rr,ir,lr,dr){var fr=PATH.join2(typeof tr=="string"?tr:FS.getPath(tr),rr),hr=FS_getMode(lr,dr);return FS.create(fr,hr)},createDataFile(tr,rr,ir,lr,dr,fr){var hr=rr;tr&&(tr=typeof tr=="string"?tr:FS.getPath(tr),hr=rr?PATH.join2(tr,rr):tr);var mr=FS_getMode(lr,dr),gr=FS.create(hr,mr);if(ir){if(typeof ir=="string"){for(var yr=new Array(ir.length),_r=0,br=ir.length;_r<br;++_r)yr[_r]=ir.charCodeAt(_r);ir=yr}FS.chmod(gr,mr|146);var vr=FS.open(gr,577);FS.write(vr,ir,0,ir.length,0,fr),FS.close(vr),FS.chmod(gr,mr)}},createDevice(tr,rr,ir,lr){var dr,fr=PATH.join2(typeof tr=="string"?tr:FS.getPath(tr),rr),hr=FS_getMode(!!ir,!!lr);(dr=FS.createDevice).major??(dr.major=64);var mr=FS.makedev(FS.createDevice.major++,0);return FS.registerDevice(mr,{open(gr){gr.seekable=!1},close(gr){var yr;(yr=lr==null?void 0:lr.buffer)!=null&&yr.length&&lr(10)},read(gr,yr,_r,br,vr){for(var wr=0,xr=0;xr<br;xr++){var Sr;try{Sr=ir()}catch{throw new FS.ErrnoError(29)}if(Sr===void 0&&wr===0)throw new FS.ErrnoError(6);if(Sr==null)break;wr++,yr[_r+xr]=Sr}return wr&&(gr.node.atime=Date.now()),wr},write(gr,yr,_r,br,vr){for(var wr=0;wr<br;wr++)try{lr(yr[_r+wr])}catch{throw new FS.ErrnoError(29)}return br&&(gr.node.mtime=gr.node.ctime=Date.now()),wr}}),FS.mkdev(fr,hr,mr)},forceLoadFile(tr){if(tr.isDevice||tr.isFolder||tr.link||tr.contents)return!0;if(typeof XMLHttpRequest<"u")throw new Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");try{tr.contents=readBinary(tr.url),tr.usedBytes=tr.contents.length}catch{throw new FS.ErrnoError(29)}},createLazyFile(tr,rr,ir,lr,dr){class fr{constructor(){P$2(this,"lengthKnown",!1),P$2(this,"chunks",[])}get(wr){if(!(wr>this.length-1||wr<0)){var xr=wr%this.chunkSize,Sr=wr/this.chunkSize|0;return this.getter(Sr)[xr]}}setDataGetter(wr){this.getter=wr}cacheLength(){var wr=new XMLHttpRequest;if(wr.open("HEAD",ir,!1),wr.send(null),!(wr.status>=200&&wr.status<300||wr.status===304))throw new Error("Couldn't load "+ir+". Status: "+wr.status);var xr=Number(wr.getResponseHeader("Content-length")),Sr,Ar=(Sr=wr.getResponseHeader("Accept-Ranges"))&&Sr==="bytes",Ir=(Sr=wr.getResponseHeader("Content-Encoding"))&&Sr==="gzip",Mr=1024*1024;Ar||(Mr=xr);var Or=(Dr,zr)=>{if(Dr>zr)throw new Error("invalid range ("+Dr+", "+zr+") or no bytes requested!");if(zr>xr-1)throw new Error("only "+xr+" bytes available! programmer error!");var Fr=new XMLHttpRequest;if(Fr.open("GET",ir,!1),xr!==Mr&&Fr.setRequestHeader("Range","bytes="+Dr+"-"+zr),Fr.responseType="arraybuffer",Fr.overrideMimeType&&Fr.overrideMimeType("text/plain; charset=x-user-defined"),Fr.send(null),!(Fr.status>=200&&Fr.status<300||Fr.status===304))throw new Error("Couldn't load "+ir+". Status: "+Fr.status);return Fr.response!==void 0?new Uint8Array(Fr.response||[]):intArrayFromString(Fr.responseText||"")},$r=this;$r.setDataGetter(Dr=>{var zr=Dr*Mr,Fr=(Dr+1)*Mr-1;if(Fr=Math.min(Fr,xr-1),typeof $r.chunks[Dr]>"u"&&($r.chunks[Dr]=Or(zr,Fr)),typeof $r.chunks[Dr]>"u")throw new Error("doXHR failed!");return $r.chunks[Dr]}),(Ir||!xr)&&(Mr=xr=1,xr=this.getter(0).length,Mr=xr,out("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=xr,this._chunkSize=Mr,this.lengthKnown=!0}get length(){return this.lengthKnown||this.cacheLength(),this._length}get chunkSize(){return this.lengthKnown||this.cacheLength(),this._chunkSize}}if(typeof XMLHttpRequest<"u"){if(!ENVIRONMENT_IS_WORKER)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var hr=new fr,mr={isDevice:!1,contents:hr}}else var mr={isDevice:!1,url:ir};var gr=FS.createFile(tr,rr,mr,lr,dr);mr.contents?gr.contents=mr.contents:mr.url&&(gr.contents=null,gr.url=mr.url),Object.defineProperties(gr,{usedBytes:{get:function(){return this.contents.length}}});var yr={},_r=Object.keys(gr.stream_ops);_r.forEach(vr=>{var wr=gr.stream_ops[vr];yr[vr]=(...xr)=>(FS.forceLoadFile(gr),wr(...xr))});function br(vr,wr,xr,Sr,Ar){var Ir=vr.node.contents;if(Ar>=Ir.length)return 0;var Mr=Math.min(Ir.length-Ar,Sr);if(Ir.slice)for(var Or=0;Or<Mr;Or++)wr[xr+Or]=Ir[Ar+Or];else for(var Or=0;Or<Mr;Or++)wr[xr+Or]=Ir.get(Ar+Or);return Mr}return yr.read=(vr,wr,xr,Sr,Ar)=>(FS.forceLoadFile(gr),br(vr,wr,xr,Sr,Ar)),yr.mmap=(vr,wr,xr,Sr,Ar)=>{FS.forceLoadFile(gr);var Ir=mmapAlloc(wr);if(!Ir)throw new FS.ErrnoError(48);return br(vr,HEAP8,Ir,wr,xr),{ptr:Ir,allocated:!0}},gr.stream_ops=yr,gr}},SYSCALLS={DEFAULT_POLLMASK:5,calculateAt(tr,rr,ir){if(PATH.isAbs(rr))return rr;var lr;if(tr===-100)lr=FS.cwd();else{var dr=SYSCALLS.getStreamFromFD(tr);lr=dr.path}if(rr.length==0){if(!ir)throw new FS.ErrnoError(44);return lr}return lr+"/"+rr},doStat(tr,rr,ir){var lr=tr(rr);HEAP32[ir>>2]=lr.dev,HEAP32[ir+4>>2]=lr.mode,HEAPU32[ir+8>>2]=lr.nlink,HEAP32[ir+12>>2]=lr.uid,HEAP32[ir+16>>2]=lr.gid,HEAP32[ir+20>>2]=lr.rdev,HEAP64[ir+24>>3]=BigInt(lr.size),HEAP32[ir+32>>2]=4096,HEAP32[ir+36>>2]=lr.blocks;var dr=lr.atime.getTime(),fr=lr.mtime.getTime(),hr=lr.ctime.getTime();return HEAP64[ir+40>>3]=BigInt(Math.floor(dr/1e3)),HEAPU32[ir+48>>2]=dr%1e3*1e3*1e3,HEAP64[ir+56>>3]=BigInt(Math.floor(fr/1e3)),HEAPU32[ir+64>>2]=fr%1e3*1e3*1e3,HEAP64[ir+72>>3]=BigInt(Math.floor(hr/1e3)),HEAPU32[ir+80>>2]=hr%1e3*1e3*1e3,HEAP64[ir+88>>3]=BigInt(lr.ino),0},doMsync(tr,rr,ir,lr,dr){if(!FS.isFile(rr.node.mode))throw new FS.ErrnoError(43);if(lr&2)return 0;var fr=HEAPU8.slice(tr,tr+ir);FS.msync(rr,fr,dr,ir,lr)},getStreamFromFD(tr){var rr=FS.getStreamChecked(tr);return rr},varargs:void 0,getStr(tr){var rr=UTF8ToString(tr);return rr}},___syscall__newselect=function(tr,rr,ir,lr,dr){try{for(var fr=0,hr=rr?HEAP32[rr>>2]:0,mr=rr?HEAP32[rr+4>>2]:0,gr=ir?HEAP32[ir>>2]:0,yr=ir?HEAP32[ir+4>>2]:0,_r=lr?HEAP32[lr>>2]:0,br=lr?HEAP32[lr+4>>2]:0,vr=0,wr=0,xr=0,Sr=0,Ar=0,Ir=0,Mr=(rr?HEAP32[rr>>2]:0)|(ir?HEAP32[ir>>2]:0)|(lr?HEAP32[lr>>2]:0),Or=(rr?HEAP32[rr+4>>2]:0)|(ir?HEAP32[ir+4>>2]:0)|(lr?HEAP32[lr+4>>2]:0),$r=(qn,Xn,Lr,Gr)=>qn<32?Xn&Gr:Lr&Gr,Dr=0;Dr<tr;Dr++){var zr=1<<Dr%32;if($r(Dr,Mr,Or,zr)){var Fr=SYSCALLS.getStreamFromFD(Dr),Jr=SYSCALLS.DEFAULT_POLLMASK;if(Fr.stream_ops.poll){var $n=-1;if(dr){var Qr=rr?HEAP32[dr>>2]:0,Zn=rr?HEAP32[dr+4>>2]:0;$n=(Qr+Zn/1e6)*1e3}Jr=Fr.stream_ops.poll(Fr,$n)}Jr&1&&$r(Dr,hr,mr,zr)&&(Dr<32?vr=vr|zr:wr=wr|zr,fr++),Jr&4&&$r(Dr,gr,yr,zr)&&(Dr<32?xr=xr|zr:Sr=Sr|zr,fr++),Jr&2&&$r(Dr,_r,br,zr)&&(Dr<32?Ar=Ar|zr:Ir=Ir|zr,fr++)}}return rr&&(HEAP32[rr>>2]=vr,HEAP32[rr+4>>2]=wr),ir&&(HEAP32[ir>>2]=xr,HEAP32[ir+4>>2]=Sr),lr&&(HEAP32[lr>>2]=Ar,HEAP32[lr+4>>2]=Ir),fr}catch(qn){if(typeof FS>"u"||qn.name!=="ErrnoError")throw qn;return-qn.errno}};___syscall__newselect.sig="iipppp";var SOCKFS={websocketArgs:{},callbacks:{},on(tr,rr){SOCKFS.callbacks[tr]=rr},emit(tr,rr){var ir,lr;(lr=(ir=SOCKFS.callbacks)[tr])==null||lr.call(ir,rr)},mount(tr){return SOCKFS.websocketArgs=Module.websocket||{},(Module.websocket??(Module.websocket={})).on=SOCKFS.on,FS.createNode(null,"/",16895,0)},createSocket(tr,rr,ir){rr&=-526337;var lr=rr==1;if(lr&&ir&&ir!=6)throw new FS.ErrnoError(66);var dr={family:tr,type:rr,protocol:ir,server:null,error:null,peers:{},pending:[],recv_queue:[],sock_ops:SOCKFS.websocket_sock_ops},fr=SOCKFS.nextname(),hr=FS.createNode(SOCKFS.root,fr,49152,0);hr.sock=dr;var mr=FS.createStream({path:fr,node:hr,flags:2,seekable:!1,stream_ops:SOCKFS.stream_ops});return dr.stream=mr,dr},getSocket(tr){var rr=FS.getStream(tr);return!rr||!FS.isSocket(rr.node.mode)?null:rr.node.sock},stream_ops:{poll(tr){var rr=tr.node.sock;return rr.sock_ops.poll(rr)},ioctl(tr,rr,ir){var lr=tr.node.sock;return lr.sock_ops.ioctl(lr,rr,ir)},read(tr,rr,ir,lr,dr){var fr=tr.node.sock,hr=fr.sock_ops.recvmsg(fr,lr);return hr?(rr.set(hr.buffer,ir),hr.buffer.length):0},write(tr,rr,ir,lr,dr){var fr=tr.node.sock;return fr.sock_ops.sendmsg(fr,rr,ir,lr)},close(tr){var rr=tr.node.sock;rr.sock_ops.close(rr)}},nextname(){return SOCKFS.nextname.current||(SOCKFS.nextname.current=0),`socket[${SOCKFS.nextname.current++}]`},websocket_sock_ops:{createPeer(tr,rr,ir){var lr;if(typeof rr=="object"&&(lr=rr,rr=null,ir=null),lr)if(lr._socket)rr=lr._socket.remoteAddress,ir=lr._socket.remotePort;else{var dr=/ws[s]?:\/\/([^:]+):(\d+)/.exec(lr.url);if(!dr)throw new Error("WebSocket URL must be in the format ws(s)://address:port");rr=dr[1],ir=parseInt(dr[2],10)}else try{var fr="ws:#".replace("#","//"),hr="binary",mr=void 0;if(SOCKFS.websocketArgs.url&&(fr=SOCKFS.websocketArgs.url),SOCKFS.websocketArgs.subprotocol?hr=SOCKFS.websocketArgs.subprotocol:SOCKFS.websocketArgs.subprotocol===null&&(hr="null"),fr==="ws://"||fr==="wss://"){var gr=rr.split("/");fr=fr+gr[0]+":"+ir+"/"+gr.slice(1).join("/")}hr!=="null"&&(hr=hr.replace(/^ +| +$/g,"").split(/ *, */),mr=hr);var yr;ENVIRONMENT_IS_NODE?yr=require("ws"):yr=WebSocket,lr=new yr(fr,mr),lr.binaryType="arraybuffer"}catch{throw new FS.ErrnoError(23)}var _r={addr:rr,port:ir,socket:lr,msg_send_queue:[]};return SOCKFS.websocket_sock_ops.addPeer(tr,_r),SOCKFS.websocket_sock_ops.handlePeerEvents(tr,_r),tr.type===2&&typeof tr.sport<"u"&&_r.msg_send_queue.push(new Uint8Array([255,255,255,255,112,111,114,116,(tr.sport&65280)>>8,tr.sport&255])),_r},getPeer(tr,rr,ir){return tr.peers[rr+":"+ir]},addPeer(tr,rr){tr.peers[rr.addr+":"+rr.port]=rr},removePeer(tr,rr){delete tr.peers[rr.addr+":"+rr.port]},handlePeerEvents(tr,rr){var ir=!0,lr=function(){tr.connecting=!1,SOCKFS.emit("open",tr.stream.fd);try{for(var fr=rr.msg_send_queue.shift();fr;)rr.socket.send(fr),fr=rr.msg_send_queue.shift()}catch{rr.socket.close()}};function dr(fr){if(typeof fr=="string"){var hr=new TextEncoder;fr=hr.encode(fr)}else{if(assert(fr.byteLength!==void 0),fr.byteLength==0)return;fr=new Uint8Array(fr)}var mr=ir;if(ir=!1,mr&&fr.length===10&&fr[0]===255&&fr[1]===255&&fr[2]===255&&fr[3]===255&&fr[4]===112&&fr[5]===111&&fr[6]===114&&fr[7]===116){var gr=fr[8]<<8|fr[9];SOCKFS.websocket_sock_ops.removePeer(tr,rr),rr.port=gr,SOCKFS.websocket_sock_ops.addPeer(tr,rr);return}tr.recv_queue.push({addr:rr.addr,port:rr.port,data:fr}),SOCKFS.emit("message",tr.stream.fd)}ENVIRONMENT_IS_NODE?(rr.socket.on("open",lr),rr.socket.on("message",function(fr,hr){hr&&dr(new Uint8Array(fr).buffer)}),rr.socket.on("close",function(){SOCKFS.emit("close",tr.stream.fd)}),rr.socket.on("error",function(fr){tr.error=14,SOCKFS.emit("error",[tr.stream.fd,tr.error,"ECONNREFUSED: Connection refused"])})):(rr.socket.onopen=lr,rr.socket.onclose=function(){SOCKFS.emit("close",tr.stream.fd)},rr.socket.onmessage=function(fr){dr(fr.data)},rr.socket.onerror=function(fr){tr.error=14,SOCKFS.emit("error",[tr.stream.fd,tr.error,"ECONNREFUSED: Connection refused"])})},poll(tr){if(tr.type===1&&tr.server)return tr.pending.length?65:0;var rr=0,ir=tr.type===1?SOCKFS.websocket_sock_ops.getPeer(tr,tr.daddr,tr.dport):null;return(tr.recv_queue.length||!ir||ir&&ir.socket.readyState===ir.socket.CLOSING||ir&&ir.socket.readyState===ir.socket.CLOSED)&&(rr|=65),(!ir||ir&&ir.socket.readyState===ir.socket.OPEN)&&(rr|=4),(ir&&ir.socket.readyState===ir.socket.CLOSING||ir&&ir.socket.readyState===ir.socket.CLOSED)&&(tr.connecting?rr|=4:rr|=16),rr},ioctl(tr,rr,ir){switch(rr){case 21531:var lr=0;return tr.recv_queue.length&&(lr=tr.recv_queue[0].data.length),HEAP32[ir>>2]=lr,0;default:return 28}},close(tr){if(tr.server){try{tr.server.close()}catch{}tr.server=null}for(var rr=Object.keys(tr.peers),ir=0;ir<rr.length;ir++){var lr=tr.peers[rr[ir]];try{lr.socket.close()}catch{}SOCKFS.websocket_sock_ops.removePeer(tr,lr)}return 0},bind(tr,rr,ir){if(typeof tr.saddr<"u"||typeof tr.sport<"u")throw new FS.ErrnoError(28);if(tr.saddr=rr,tr.sport=ir,tr.type===2){tr.server&&(tr.server.close(),tr.server=null);try{tr.sock_ops.listen(tr,0)}catch(lr){if(lr.name!=="ErrnoError"||lr.errno!==138)throw lr}}},connect(tr,rr,ir){if(tr.server)throw new FS.ErrnoError(138);if(typeof tr.daddr<"u"&&typeof tr.dport<"u"){var lr=SOCKFS.websocket_sock_ops.getPeer(tr,tr.daddr,tr.dport);if(lr)throw lr.socket.readyState===lr.socket.CONNECTING?new FS.ErrnoError(7):new FS.ErrnoError(30)}var dr=SOCKFS.websocket_sock_ops.createPeer(tr,rr,ir);tr.daddr=dr.addr,tr.dport=dr.port,tr.connecting=!0},listen(tr,rr){if(!ENVIRONMENT_IS_NODE)throw new FS.ErrnoError(138);if(tr.server)throw new FS.ErrnoError(28);var ir=require("ws").Server,lr=tr.saddr;tr.server=new ir({host:lr,port:tr.sport}),SOCKFS.emit("listen",tr.stream.fd),tr.server.on("connection",function(dr){if(tr.type===1){var fr=SOCKFS.createSocket(tr.family,tr.type,tr.protocol),hr=SOCKFS.websocket_sock_ops.createPeer(fr,dr);fr.daddr=hr.addr,fr.dport=hr.port,tr.pending.push(fr),SOCKFS.emit("connection",fr.stream.fd)}else SOCKFS.websocket_sock_ops.createPeer(tr,dr),SOCKFS.emit("connection",tr.stream.fd)}),tr.server.on("close",function(){SOCKFS.emit("close",tr.stream.fd),tr.server=null}),tr.server.on("error",function(dr){tr.error=23,SOCKFS.emit("error",[tr.stream.fd,tr.error,"EHOSTUNREACH: Host is unreachable"])})},accept(tr){if(!tr.server||!tr.pending.length)throw new FS.ErrnoError(28);var rr=tr.pending.shift();return rr.stream.flags=tr.stream.flags,rr},getname(tr,rr){var ir,lr;if(rr){if(tr.daddr===void 0||tr.dport===void 0)throw new FS.ErrnoError(53);ir=tr.daddr,lr=tr.dport}else ir=tr.saddr||0,lr=tr.sport||0;return{addr:ir,port:lr}},sendmsg(tr,rr,ir,lr,dr,fr){if(tr.type===2){if((dr===void 0||fr===void 0)&&(dr=tr.daddr,fr=tr.dport),dr===void 0||fr===void 0)throw new FS.ErrnoError(17)}else dr=tr.daddr,fr=tr.dport;var hr=SOCKFS.websocket_sock_ops.getPeer(tr,dr,fr);if(tr.type===1&&(!hr||hr.socket.readyState===hr.socket.CLOSING||hr.socket.readyState===hr.socket.CLOSED))throw new FS.ErrnoError(53);ArrayBuffer.isView(rr)&&(ir+=rr.byteOffset,rr=rr.buffer);var mr=rr.slice(ir,ir+lr);if(!hr||hr.socket.readyState!==hr.socket.OPEN)return tr.type===2&&(!hr||hr.socket.readyState===hr.socket.CLOSING||hr.socket.readyState===hr.socket.CLOSED)&&(hr=SOCKFS.websocket_sock_ops.createPeer(tr,dr,fr)),hr.msg_send_queue.push(mr),lr;try{return hr.socket.send(mr),lr}catch{throw new FS.ErrnoError(28)}},recvmsg(tr,rr){if(tr.type===1&&tr.server)throw new FS.ErrnoError(53);var ir=tr.recv_queue.shift();if(!ir){if(tr.type===1){var lr=SOCKFS.websocket_sock_ops.getPeer(tr,tr.daddr,tr.dport);if(!lr)throw new FS.ErrnoError(53);if(lr.socket.readyState===lr.socket.CLOSING||lr.socket.readyState===lr.socket.CLOSED)return null;throw new FS.ErrnoError(6)}throw new FS.ErrnoError(6)}var dr=ir.data.byteLength||ir.data.length,fr=ir.data.byteOffset||0,hr=ir.data.buffer||ir.data,mr=Math.min(rr,dr),gr={buffer:new Uint8Array(hr,fr,mr),addr:ir.addr,port:ir.port};if(tr.type===1&&mr<dr){var yr=dr-mr;ir.data=new Uint8Array(hr,fr+mr,yr),tr.recv_queue.unshift(ir)}return gr}}},getSocketFromFD=tr=>{var rr=SOCKFS.getSocket(tr);if(!rr)throw new FS.ErrnoError(8);return rr},inetNtop4=tr=>(tr&255)+"."+(tr>>8&255)+"."+(tr>>16&255)+"."+(tr>>24&255),inetNtop6=tr=>{var rr="",ir=0,lr=0,dr=0,fr=0,hr=0,mr=0,gr=[tr[0]&65535,tr[0]>>16,tr[1]&65535,tr[1]>>16,tr[2]&65535,tr[2]>>16,tr[3]&65535,tr[3]>>16],yr=!0,_r="";for(mr=0;mr<5;mr++)if(gr[mr]!==0){yr=!1;break}if(yr){if(_r=inetNtop4(gr[6]|gr[7]<<16),gr[5]===-1)return rr="::ffff:",rr+=_r,rr;if(gr[5]===0)return rr="::",_r==="0.0.0.0"&&(_r=""),_r==="0.0.0.1"&&(_r="1"),rr+=_r,rr}for(ir=0;ir<8;ir++)gr[ir]===0&&(ir-dr>1&&(hr=0),dr=ir,hr++),hr>lr&&(lr=hr,fr=ir-lr+1);for(ir=0;ir<8;ir++){if(lr>1&&gr[ir]===0&&ir>=fr&&ir<fr+lr){ir===fr&&(rr+=":",fr===0&&(rr+=":"));continue}rr+=Number(_ntohs(gr[ir]&65535)).toString(16),rr+=ir<7?":":""}return rr},readSockaddr=(tr,rr)=>{var ir=HEAP16[tr>>1],lr=_ntohs(HEAPU16[tr+2>>1]),dr;switch(ir){case 2:if(rr!==16)return{errno:28};dr=HEAP32[tr+4>>2],dr=inetNtop4(dr);break;case 10:if(rr!==28)return{errno:28};dr=[HEAP32[tr+8>>2],HEAP32[tr+12>>2],HEAP32[tr+16>>2],HEAP32[tr+20>>2]],dr=inetNtop6(dr);break;default:return{errno:5}}return{family:ir,addr:dr,port:lr}},inetPton4=tr=>{for(var rr=tr.split("."),ir=0;ir<4;ir++){var lr=Number(rr[ir]);if(isNaN(lr))return null;rr[ir]=lr}return(rr[0]|rr[1]<<8|rr[2]<<16|rr[3]<<24)>>>0},jstoi_q=tr=>parseInt(tr),inetPton6=tr=>{var rr,ir,lr,dr,fr=/^((?=.*::)(?!.*::.+::)(::)?([\dA-F]{1,4}:(:|\b)|){5}|([\dA-F]{1,4}:){6})((([\dA-F]{1,4}((?!\3)::|:\b|$))|(?!\2\3)){2}|(((2[0-4]|1\d|[1-9])?\d|25[0-5])\.?\b){4})$/i,hr=[];if(!fr.test(tr))return null;if(tr==="::")return[0,0,0,0,0,0,0,0];for(tr.startsWith("::")?tr=tr.replace("::","Z:"):tr=tr.replace("::",":Z:"),tr.indexOf(".")>0?(tr=tr.replace(new RegExp("[.]","g"),":"),rr=tr.split(":"),rr[rr.length-4]=jstoi_q(rr[rr.length-4])+jstoi_q(rr[rr.length-3])*256,rr[rr.length-3]=jstoi_q(rr[rr.length-2])+jstoi_q(rr[rr.length-1])*256,rr=rr.slice(0,rr.length-2)):rr=tr.split(":"),lr=0,dr=0,ir=0;ir<rr.length;ir++)if(typeof rr[ir]=="string")if(rr[ir]==="Z"){for(dr=0;dr<8-rr.length+1;dr++)hr[ir+dr]=0;lr=dr-1}else hr[ir+lr]=_htons(parseInt(rr[ir],16));else hr[ir+lr]=rr[ir];return[hr[1]<<16|hr[0],hr[3]<<16|hr[2],hr[5]<<16|hr[4],hr[7]<<16|hr[6]]},DNS={address_map:{id:1,addrs:{},names:{}},lookup_name(tr){var rr=inetPton4(tr);if(rr!==null||(rr=inetPton6(tr),rr!==null))return tr;var ir;if(DNS.address_map.addrs[tr])ir=DNS.address_map.addrs[tr];else{var lr=DNS.address_map.id++;assert(lr<65535,"exceeded max address mappings of 65535"),ir="172.29."+(lr&255)+"."+(lr&65280),DNS.address_map.names[ir]=tr,DNS.address_map.addrs[tr]=ir}return ir},lookup_addr(tr){return DNS.address_map.names[tr]?DNS.address_map.names[tr]:null}},getSocketAddress=(tr,rr)=>{var ir=readSockaddr(tr,rr);if(ir.errno)throw new FS.ErrnoError(ir.errno);return ir.addr=DNS.lookup_addr(ir.addr)||ir.addr,ir};function ___syscall_bind(tr,rr,ir,lr,dr,fr){try{var hr=getSocketFromFD(tr),mr=getSocketAddress(rr,ir);return hr.sock_ops.bind(hr,mr.addr,mr.port),0}catch(gr){if(typeof FS>"u"||gr.name!=="ErrnoError")throw gr;return-gr.errno}}___syscall_bind.sig="iippiii";function ___syscall_chdir(tr){try{return tr=SYSCALLS.getStr(tr),FS.chdir(tr),0}catch(rr){if(typeof FS>"u"||rr.name!=="ErrnoError")throw rr;return-rr.errno}}___syscall_chdir.sig="ip";function ___syscall_chmod(tr,rr){try{return tr=SYSCALLS.getStr(tr),FS.chmod(tr,rr),0}catch(ir){if(typeof FS>"u"||ir.name!=="ErrnoError")throw ir;return-ir.errno}}___syscall_chmod.sig="ipi";function ___syscall_connect(tr,rr,ir,lr,dr,fr){try{var hr=getSocketFromFD(tr),mr=getSocketAddress(rr,ir);return hr.sock_ops.connect(hr,mr.addr,mr.port),0}catch(gr){if(typeof FS>"u"||gr.name!=="ErrnoError")throw gr;return-gr.errno}}___syscall_connect.sig="iippiii";function ___syscall_dup(tr){try{var rr=SYSCALLS.getStreamFromFD(tr);return FS.dupStream(rr).fd}catch(ir){if(typeof FS>"u"||ir.name!=="ErrnoError")throw ir;return-ir.errno}}___syscall_dup.sig="ii";function ___syscall_dup3(tr,rr,ir){try{var lr=SYSCALLS.getStreamFromFD(tr);if(lr.fd===rr)return-28;if(rr<0||rr>=FS.MAX_OPEN_FDS)return-8;var dr=FS.getStream(rr);return dr&&FS.close(dr),FS.dupStream(lr,rr).fd}catch(fr){if(typeof FS>"u"||fr.name!=="ErrnoError")throw fr;return-fr.errno}}___syscall_dup3.sig="iiii";function ___syscall_faccessat(tr,rr,ir,lr){try{if(rr=SYSCALLS.getStr(rr),rr=SYSCALLS.calculateAt(tr,rr),ir&-8)return-28;var dr=FS.lookupPath(rr,{follow:!0}),fr=dr.node;if(!fr)return-44;var hr="";return ir&4&&(hr+="r"),ir&2&&(hr+="w"),ir&1&&(hr+="x"),hr&&FS.nodePermissions(fr,hr)?-2:0}catch(mr){if(typeof FS>"u"||mr.name!=="ErrnoError")throw mr;return-mr.errno}}___syscall_faccessat.sig="iipii";var ___syscall_fadvise64=(tr,rr,ir,lr)=>0;___syscall_fadvise64.sig="iijji";var INT53_MAX=9007199254740992,INT53_MIN=-9007199254740992,bigintToI53Checked=tr=>tr<INT53_MIN||tr>INT53_MAX?NaN:Number(tr);function ___syscall_fallocate(tr,rr,ir,lr){ir=bigintToI53Checked(ir),lr=bigintToI53Checked(lr);try{if(isNaN(ir))return 61;var dr=SYSCALLS.getStreamFromFD(tr);return FS.allocate(dr,ir,lr),0}catch(fr){if(typeof FS>"u"||fr.name!=="ErrnoError")throw fr;return-fr.errno}}___syscall_fallocate.sig="iiijj";var syscallGetVarargI=()=>{var tr=HEAP32[+SYSCALLS.varargs>>2];return SYSCALLS.varargs+=4,tr},syscallGetVarargP=syscallGetVarargI;function ___syscall_fcntl64(tr,rr,ir){SYSCALLS.varargs=ir;try{var lr=SYSCALLS.getStreamFromFD(tr);switch(rr){case 0:{var dr=syscallGetVarargI();if(dr<0)return-28;for(;FS.streams[dr];)dr++;var fr;return fr=FS.dupStream(lr,dr),fr.fd}case 1:case 2:return 0;case 3:return lr.flags;case 4:{var dr=syscallGetVarargI();return lr.flags|=dr,0}case 12:{var dr=syscallGetVarargP(),hr=0;return HEAP16[dr+hr>>1]=2,0}case 13:case 14:return 0}return-28}catch(mr){if(typeof FS>"u"||mr.name!=="ErrnoError")throw mr;return-mr.errno}}___syscall_fcntl64.sig="iiip";function ___syscall_fdatasync(tr){try{return SYSCALLS.getStreamFromFD(tr),0}catch(rr){if(typeof FS>"u"||rr.name!=="ErrnoError")throw rr;return-rr.errno}}___syscall_fdatasync.sig="ii";function ___syscall_fstat64(tr,rr){try{var ir=SYSCALLS.getStreamFromFD(tr);return SYSCALLS.doStat(FS.stat,ir.path,rr)}catch(lr){if(typeof FS>"u"||lr.name!=="ErrnoError")throw lr;return-lr.errno}}___syscall_fstat64.sig="iip";function ___syscall_ftruncate64(tr,rr){rr=bigintToI53Checked(rr);try{return isNaN(rr)?61:(FS.ftruncate(tr,rr),0)}catch(ir){if(typeof FS>"u"||ir.name!=="ErrnoError")throw ir;return-ir.errno}}___syscall_ftruncate64.sig="iij";var stringToUTF8=(tr,rr,ir)=>stringToUTF8Array(tr,HEAPU8,rr,ir);function ___syscall_getcwd(tr,rr){try{if(rr===0)return-28;var ir=FS.cwd(),lr=lengthBytesUTF8(ir)+1;return rr<lr?-68:(stringToUTF8(ir,tr,rr),lr)}catch(dr){if(typeof FS>"u"||dr.name!=="ErrnoError")throw dr;return-dr.errno}}___syscall_getcwd.sig="ipp";function ___syscall_getdents64(tr,rr,ir){try{var lr=SYSCALLS.getStreamFromFD(tr);lr.getdents||(lr.getdents=FS.readdir(lr.path));for(var dr=280,fr=0,hr=FS.llseek(lr,0,1),mr=Math.floor(hr/dr),gr=Math.min(lr.getdents.length,mr+Math.floor(ir/dr)),yr=mr;yr<gr;yr++){var _r,br,vr=lr.getdents[yr];if(vr===".")_r=lr.node.id,br=4;else if(vr===".."){var wr=FS.lookupPath(lr.path,{parent:!0});_r=wr.node.id,br=4}else{var xr;try{xr=FS.lookupNode(lr.node,vr)}catch(Sr){if((Sr==null?void 0:Sr.errno)===28)continue;throw Sr}_r=xr.id,br=FS.isChrdev(xr.mode)?2:FS.isDir(xr.mode)?4:FS.isLink(xr.mode)?10:8}HEAP64[rr+fr>>3]=BigInt(_r),HEAP64[rr+fr+8>>3]=BigInt((yr+1)*dr),HEAP16[rr+fr+16>>1]=280,HEAP8[rr+fr+18]=br,stringToUTF8(vr,rr+fr+19,256),fr+=dr}return FS.llseek(lr,yr*dr,0),fr}catch(Sr){if(typeof FS>"u"||Sr.name!=="ErrnoError")throw Sr;return-Sr.errno}}___syscall_getdents64.sig="iipp";var writeSockaddr=(tr,rr,ir,lr,dr)=>{switch(rr){case 2:ir=inetPton4(ir),zeroMemory(tr,16),dr&&(HEAP32[dr>>2]=16),HEAP16[tr>>1]=rr,HEAP32[tr+4>>2]=ir,HEAP16[tr+2>>1]=_htons(lr);break;case 10:ir=inetPton6(ir),zeroMemory(tr,28),dr&&(HEAP32[dr>>2]=28),HEAP32[tr>>2]=rr,HEAP32[tr+8>>2]=ir[0],HEAP32[tr+12>>2]=ir[1],HEAP32[tr+16>>2]=ir[2],HEAP32[tr+20>>2]=ir[3],HEAP16[tr+2>>1]=_htons(lr);break;default:return 5}return 0};function ___syscall_getsockname(tr,rr,ir,lr,dr,fr){try{var hr=getSocketFromFD(tr);return writeSockaddr(rr,hr.family,DNS.lookup_name(hr.saddr||"0.0.0.0"),hr.sport,ir),0}catch(mr){if(typeof FS>"u"||mr.name!=="ErrnoError")throw mr;return-mr.errno}}___syscall_getsockname.sig="iippiii";function ___syscall_getsockopt(tr,rr,ir,lr,dr,fr){try{var hr=getSocketFromFD(tr);return rr===1&&ir===4?(HEAP32[lr>>2]=hr.error,HEAP32[dr>>2]=4,hr.error=null,0):-50}catch(mr){if(typeof FS>"u"||mr.name!=="ErrnoError")throw mr;return-mr.errno}}___syscall_getsockopt.sig="iiiippi";function ___syscall_ioctl(tr,rr,ir){SYSCALLS.varargs=ir;try{var lr=SYSCALLS.getStreamFromFD(tr);switch(rr){case 21509:return lr.tty?0:-59;case 21505:{if(!lr.tty)return-59;if(lr.tty.ops.ioctl_tcgets){var dr=lr.tty.ops.ioctl_tcgets(lr),fr=syscallGetVarargP();HEAP32[fr>>2]=dr.c_iflag||0,HEAP32[fr+4>>2]=dr.c_oflag||0,HEAP32[fr+8>>2]=dr.c_cflag||0,HEAP32[fr+12>>2]=dr.c_lflag||0;for(var hr=0;hr<32;hr++)HEAP8[fr+hr+17]=dr.c_cc[hr]||0;return 0}return 0}case 21510:case 21511:case 21512:return lr.tty?0:-59;case 21506:case 21507:case 21508:{if(!lr.tty)return-59;if(lr.tty.ops.ioctl_tcsets){for(var fr=syscallGetVarargP(),mr=HEAP32[fr>>2],gr=HEAP32[fr+4>>2],yr=HEAP32[fr+8>>2],_r=HEAP32[fr+12>>2],br=[],hr=0;hr<32;hr++)br.push(HEAP8[fr+hr+17]);return lr.tty.ops.ioctl_tcsets(lr.tty,rr,{c_iflag:mr,c_oflag:gr,c_cflag:yr,c_lflag:_r,c_cc:br})}return 0}case 21519:{if(!lr.tty)return-59;var fr=syscallGetVarargP();return HEAP32[fr>>2]=0,0}case 21520:return lr.tty?-28:-59;case 21531:{var fr=syscallGetVarargP();return FS.ioctl(lr,rr,fr)}case 21523:{if(!lr.tty)return-59;if(lr.tty.ops.ioctl_tiocgwinsz){var vr=lr.tty.ops.ioctl_tiocgwinsz(lr.tty),fr=syscallGetVarargP();HEAP16[fr>>1]=vr[0],HEAP16[fr+2>>1]=vr[1]}return 0}case 21524:return lr.tty?0:-59;case 21515:return lr.tty?0:-59;default:return-28}}catch(wr){if(typeof FS>"u"||wr.name!=="ErrnoError")throw wr;return-wr.errno}}___syscall_ioctl.sig="iiip";function ___syscall_lstat64(tr,rr){try{return tr=SYSCALLS.getStr(tr),SYSCALLS.doStat(FS.lstat,tr,rr)}catch(ir){if(typeof FS>"u"||ir.name!=="ErrnoError")throw ir;return-ir.errno}}___syscall_lstat64.sig="ipp";function ___syscall_mkdirat(tr,rr,ir){try{return rr=SYSCALLS.getStr(rr),rr=SYSCALLS.calculateAt(tr,rr),FS.mkdir(rr,ir,0),0}catch(lr){if(typeof FS>"u"||lr.name!=="ErrnoError")throw lr;return-lr.errno}}___syscall_mkdirat.sig="iipi";function ___syscall_newfstatat(tr,rr,ir,lr){try{rr=SYSCALLS.getStr(rr);var dr=lr&256,fr=lr&4096;return lr=lr&-6401,rr=SYSCALLS.calculateAt(tr,rr,fr),SYSCALLS.doStat(dr?FS.lstat:FS.stat,rr,ir)}catch(hr){if(typeof FS>"u"||hr.name!=="ErrnoError")throw hr;return-hr.errno}}___syscall_newfstatat.sig="iippi";function ___syscall_openat(tr,rr,ir,lr){SYSCALLS.varargs=lr;try{rr=SYSCALLS.getStr(rr),rr=SYSCALLS.calculateAt(tr,rr);var dr=lr?syscallGetVarargI():0;return FS.open(rr,ir,dr).fd}catch(fr){if(typeof FS>"u"||fr.name!=="ErrnoError")throw fr;return-fr.errno}}___syscall_openat.sig="iipip";var PIPEFS={BUCKET_BUFFER_SIZE:8192,mount(tr){return FS.createNode(null,"/",16895,0)},createPipe(){var tr={buckets:[],refcnt:2};tr.buckets.push({buffer:new Uint8Array(PIPEFS.BUCKET_BUFFER_SIZE),offset:0,roffset:0});var rr=PIPEFS.nextname(),ir=PIPEFS.nextname(),lr=FS.createNode(PIPEFS.root,rr,4096,0),dr=FS.createNode(PIPEFS.root,ir,4096,0);lr.pipe=tr,dr.pipe=tr;var fr=FS.createStream({path:rr,node:lr,flags:0,seekable:!1,stream_ops:PIPEFS.stream_ops});lr.stream=fr;var hr=FS.createStream({path:ir,node:dr,flags:1,seekable:!1,stream_ops:PIPEFS.stream_ops});return dr.stream=hr,{readable_fd:fr.fd,writable_fd:hr.fd}},stream_ops:{poll(tr){var rr=tr.node.pipe;if((tr.flags&2097155)===1)return 260;if(rr.buckets.length>0)for(var ir=0;ir<rr.buckets.length;ir++){var lr=rr.buckets[ir];if(lr.offset-lr.roffset>0)return 65}return 0},ioctl(tr,rr,ir){return 28},fsync(tr){return 28},read(tr,rr,ir,lr,dr){for(var fr=tr.node.pipe,hr=0,mr=0;mr<fr.buckets.length;mr++){var gr=fr.buckets[mr];hr+=gr.offset-gr.roffset}var yr=rr.subarray(ir,ir+lr);if(lr<=0)return 0;if(hr==0)throw new FS.ErrnoError(6);for(var _r=Math.min(hr,lr),br=_r,vr=0,mr=0;mr<fr.buckets.length;mr++){var wr=fr.buckets[mr],xr=wr.offset-wr.roffset;if(_r<=xr){var Sr=wr.buffer.subarray(wr.roffset,wr.offset);_r<xr?(Sr=Sr.subarray(0,_r),wr.roffset+=_r):vr++,yr.set(Sr);break}else{var Sr=wr.buffer.subarray(wr.roffset,wr.offset);yr.set(Sr),yr=yr.subarray(Sr.byteLength),_r-=Sr.byteLength,vr++}}return vr&&vr==fr.buckets.length&&(vr--,fr.buckets[vr].offset=0,fr.buckets[vr].roffset=0),fr.buckets.splice(0,vr),br},write(tr,rr,ir,lr,dr){var fr=tr.node.pipe,hr=rr.subarray(ir,ir+lr),mr=hr.byteLength;if(mr<=0)return 0;var gr=null;fr.buckets.length==0?(gr={buffer:new Uint8Array(PIPEFS.BUCKET_BUFFER_SIZE),offset:0,roffset:0},fr.buckets.push(gr)):gr=fr.buckets[fr.buckets.length-1],assert(gr.offset<=PIPEFS.BUCKET_BUFFER_SIZE);var yr=PIPEFS.BUCKET_BUFFER_SIZE-gr.offset;if(yr>=mr)return gr.buffer.set(hr,gr.offset),gr.offset+=mr,mr;yr>0&&(gr.buffer.set(hr.subarray(0,yr),gr.offset),gr.offset+=yr,hr=hr.subarray(yr,hr.byteLength));for(var _r=hr.byteLength/PIPEFS.BUCKET_BUFFER_SIZE|0,br=hr.byteLength%PIPEFS.BUCKET_BUFFER_SIZE,vr=0;vr<_r;vr++){var wr={buffer:new Uint8Array(PIPEFS.BUCKET_BUFFER_SIZE),offset:PIPEFS.BUCKET_BUFFER_SIZE,roffset:0};fr.buckets.push(wr),wr.buffer.set(hr.subarray(0,PIPEFS.BUCKET_BUFFER_SIZE)),hr=hr.subarray(PIPEFS.BUCKET_BUFFER_SIZE,hr.byteLength)}if(br>0){var wr={buffer:new Uint8Array(PIPEFS.BUCKET_BUFFER_SIZE),offset:hr.byteLength,roffset:0};fr.buckets.push(wr),wr.buffer.set(hr)}return mr},close(tr){var rr=tr.node.pipe;rr.refcnt--,rr.refcnt===0&&(rr.buckets=null)}},nextname(){return PIPEFS.nextname.current||(PIPEFS.nextname.current=0),"pipe["+PIPEFS.nextname.current+++"]"}};function ___syscall_pipe(tr){try{if(tr==0)throw new FS.ErrnoError(21);var rr=PIPEFS.createPipe();return HEAP32[tr>>2]=rr.readable_fd,HEAP32[tr+4>>2]=rr.writable_fd,0}catch(ir){if(typeof FS>"u"||ir.name!=="ErrnoError")throw ir;return-ir.errno}}___syscall_pipe.sig="ip";function ___syscall_poll(tr,rr,ir){try{for(var lr=0,dr=0;dr<rr;dr++){var fr=tr+8*dr,hr=HEAP32[fr>>2],mr=HEAP16[fr+4>>1],gr=32,yr=FS.getStream(hr);yr&&(gr=SYSCALLS.DEFAULT_POLLMASK,yr.stream_ops.poll&&(gr=yr.stream_ops.poll(yr,-1))),gr&=mr|8|16,gr&&lr++,HEAP16[fr+6>>1]=gr}return lr}catch(_r){if(typeof FS>"u"||_r.name!=="ErrnoError")throw _r;return-_r.errno}}___syscall_poll.sig="ipii";function ___syscall_readlinkat(tr,rr,ir,lr){try{if(rr=SYSCALLS.getStr(rr),rr=SYSCALLS.calculateAt(tr,rr),lr<=0)return-28;var dr=FS.readlink(rr),fr=Math.min(lr,lengthBytesUTF8(dr)),hr=HEAP8[ir+fr];return stringToUTF8(dr,ir,lr+1),HEAP8[ir+fr]=hr,fr}catch(mr){if(typeof FS>"u"||mr.name!=="ErrnoError")throw mr;return-mr.errno}}___syscall_readlinkat.sig="iippp";function ___syscall_recvfrom(tr,rr,ir,lr,dr,fr){try{var hr=getSocketFromFD(tr),mr=hr.sock_ops.recvmsg(hr,ir);if(!mr)return 0;if(dr)var gr=writeSockaddr(dr,hr.family,DNS.lookup_name(mr.addr),mr.port,fr);return HEAPU8.set(mr.buffer,rr),mr.buffer.byteLength}catch(yr){if(typeof FS>"u"||yr.name!=="ErrnoError")throw yr;return-yr.errno}}___syscall_recvfrom.sig="iippipp";function ___syscall_renameat(tr,rr,ir,lr){try{return rr=SYSCALLS.getStr(rr),lr=SYSCALLS.getStr(lr),rr=SYSCALLS.calculateAt(tr,rr),lr=SYSCALLS.calculateAt(ir,lr),FS.rename(rr,lr),0}catch(dr){if(typeof FS>"u"||dr.name!=="ErrnoError")throw dr;return-dr.errno}}___syscall_renameat.sig="iipip";function ___syscall_rmdir(tr){try{return tr=SYSCALLS.getStr(tr),FS.rmdir(tr),0}catch(rr){if(typeof FS>"u"||rr.name!=="ErrnoError")throw rr;return-rr.errno}}___syscall_rmdir.sig="ip";function ___syscall_sendto(tr,rr,ir,lr,dr,fr){try{var hr=getSocketFromFD(tr);if(!dr)return FS.write(hr.stream,HEAP8,rr,ir);var mr=getSocketAddress(dr,fr);return hr.sock_ops.sendmsg(hr,HEAP8,rr,ir,mr.addr,mr.port)}catch(gr){if(typeof FS>"u"||gr.name!=="ErrnoError")throw gr;return-gr.errno}}___syscall_sendto.sig="iippipp";function ___syscall_socket(tr,rr,ir){try{var lr=SOCKFS.createSocket(tr,rr,ir);return lr.stream.fd}catch(dr){if(typeof FS>"u"||dr.name!=="ErrnoError")throw dr;return-dr.errno}}___syscall_socket.sig="iiiiiii";function ___syscall_stat64(tr,rr){try{return tr=SYSCALLS.getStr(tr),SYSCALLS.doStat(FS.stat,tr,rr)}catch(ir){if(typeof FS>"u"||ir.name!=="ErrnoError")throw ir;return-ir.errno}}___syscall_stat64.sig="ipp";function ___syscall_symlinkat(tr,rr,ir){try{return tr=SYSCALLS.getStr(tr),ir=SYSCALLS.getStr(ir),ir=SYSCALLS.calculateAt(rr,ir),FS.symlink(tr,ir),0}catch(lr){if(typeof FS>"u"||lr.name!=="ErrnoError")throw lr;return-lr.errno}}___syscall_symlinkat.sig="ipip";function ___syscall_truncate64(tr,rr){rr=bigintToI53Checked(rr);try{return isNaN(rr)?61:(tr=SYSCALLS.getStr(tr),FS.truncate(tr,rr),0)}catch(ir){if(typeof FS>"u"||ir.name!=="ErrnoError")throw ir;return-ir.errno}}___syscall_truncate64.sig="ipj";function ___syscall_unlinkat(tr,rr,ir){try{return rr=SYSCALLS.getStr(rr),rr=SYSCALLS.calculateAt(tr,rr),ir===0?FS.unlink(rr):ir===512?FS.rmdir(rr):abort("Invalid flags passed to unlinkat"),0}catch(lr){if(typeof FS>"u"||lr.name!=="ErrnoError")throw lr;return-lr.errno}}___syscall_unlinkat.sig="iipi";var ___table_base=new WebAssembly.Global({value:"i32",mutable:!1},1),__abort_js=()=>abort("");__abort_js.sig="v";var ENV={},stackAlloc=tr=>__emscripten_stack_alloc(tr),stringToUTF8OnStack=tr=>{var rr=lengthBytesUTF8(tr)+1,ir=stackAlloc(rr);return stringToUTF8(tr,ir,rr),ir},dlSetError=tr=>{var rr=stackSave(),ir=stringToUTF8OnStack(tr);___dl_seterr(ir,0),stackRestore(rr)},dlopenInternal=(tr,rr)=>{var ir=UTF8ToString(tr+36),lr=HEAP32[tr+4>>2];ir=PATH.normalize(ir);var dr=!!(lr&256),fr=dr?null:{},hr={global:dr,nodelete:!!(lr&4096),loadAsync:rr.loadAsync};try{return loadDynamicLibrary(ir,hr,fr,tr)}catch(mr){return dlSetError(`Could not load dynamic lib: ${ir}
566
566
  ${mr}`),0}},__dlopen_js=tr=>dlopenInternal(tr,{loadAsync:!1});__dlopen_js.sig="pp";var __dlsym_js=(tr,rr,ir)=>{rr=UTF8ToString(rr);var lr,dr,fr=LDSO.loadedLibsByHandle[tr];if(!fr.exports.hasOwnProperty(rr)||fr.exports[rr].stub)return dlSetError(`Tried to lookup unknown symbol "${rr}" in dynamic lib: ${fr.name}`),0;if(dr=Object.keys(fr.exports).indexOf(rr),lr=fr.exports[rr],typeof lr=="function"){var hr=getFunctionAddress(lr);hr?lr=hr:(lr=addFunction(lr,lr.sig),HEAPU32[ir>>2]=dr)}return lr};__dlsym_js.sig="pppp";var __emscripten_memcpy_js=(tr,rr,ir)=>HEAPU8.copyWithin(tr,rr,rr+ir);__emscripten_memcpy_js.sig="vppp";var runtimeKeepaliveCounter=0,__emscripten_runtime_keepalive_clear=()=>{noExitRuntime=!1,runtimeKeepaliveCounter=0};__emscripten_runtime_keepalive_clear.sig="v";var __emscripten_system=tr=>{if(ENVIRONMENT_IS_NODE){if(!tr)return 1;var rr=UTF8ToString(tr);if(!rr.length)return 0;var ir=require("child_process"),lr=ir.spawnSync(rr,[],{shell:!0,stdio:"inherit"}),dr=(hr,mr)=>hr<<8|mr;if(lr.status===null){var fr=hr=>{switch(hr){case"SIGHUP":return 1;case"SIGQUIT":return 3;case"SIGFPE":return 8;case"SIGKILL":return 9;case"SIGALRM":return 14;case"SIGTERM":return 15;default:return 2}};return dr(0,fr(lr.signal))}return dr(lr.status,0)}return tr?-52:0};__emscripten_system.sig="ip";var __emscripten_throw_longjmp=()=>{throw 1/0};__emscripten_throw_longjmp.sig="v";function __gmtime_js(tr,rr){tr=bigintToI53Checked(tr);var ir=new Date(tr*1e3);HEAP32[rr>>2]=ir.getUTCSeconds(),HEAP32[rr+4>>2]=ir.getUTCMinutes(),HEAP32[rr+8>>2]=ir.getUTCHours(),HEAP32[rr+12>>2]=ir.getUTCDate(),HEAP32[rr+16>>2]=ir.getUTCMonth(),HEAP32[rr+20>>2]=ir.getUTCFullYear()-1900,HEAP32[rr+24>>2]=ir.getUTCDay();var lr=Date.UTC(ir.getUTCFullYear(),0,1,0,0,0,0),dr=(ir.getTime()-lr)/(1e3*60*60*24)|0;HEAP32[rr+28>>2]=dr}__gmtime_js.sig="vjp";var isLeapYear=tr=>tr%4===0&&(tr%100!==0||tr%400===0),MONTH_DAYS_LEAP_CUMULATIVE=[0,31,60,91,121,152,182,213,244,274,305,335],MONTH_DAYS_REGULAR_CUMULATIVE=[0,31,59,90,120,151,181,212,243,273,304,334],ydayFromDate=tr=>{var rr=isLeapYear(tr.getFullYear()),ir=rr?MONTH_DAYS_LEAP_CUMULATIVE:MONTH_DAYS_REGULAR_CUMULATIVE,lr=ir[tr.getMonth()]+tr.getDate()-1;return lr};function __localtime_js(tr,rr){tr=bigintToI53Checked(tr);var ir=new Date(tr*1e3);HEAP32[rr>>2]=ir.getSeconds(),HEAP32[rr+4>>2]=ir.getMinutes(),HEAP32[rr+8>>2]=ir.getHours(),HEAP32[rr+12>>2]=ir.getDate(),HEAP32[rr+16>>2]=ir.getMonth(),HEAP32[rr+20>>2]=ir.getFullYear()-1900,HEAP32[rr+24>>2]=ir.getDay();var lr=ydayFromDate(ir)|0;HEAP32[rr+28>>2]=lr,HEAP32[rr+36>>2]=-(ir.getTimezoneOffset()*60);var dr=new Date(ir.getFullYear(),0,1),fr=new Date(ir.getFullYear(),6,1).getTimezoneOffset(),hr=dr.getTimezoneOffset(),mr=(fr!=hr&&ir.getTimezoneOffset()==Math.min(hr,fr))|0;HEAP32[rr+32>>2]=mr}__localtime_js.sig="vjp";function __mmap_js(tr,rr,ir,lr,dr,fr,hr){dr=bigintToI53Checked(dr);try{if(isNaN(dr))return 61;var mr=SYSCALLS.getStreamFromFD(lr),gr=FS.mmap(mr,tr,dr,rr,ir),yr=gr.ptr;return HEAP32[fr>>2]=gr.allocated,HEAPU32[hr>>2]=yr,0}catch(_r){if(typeof FS>"u"||_r.name!=="ErrnoError")throw _r;return-_r.errno}}__mmap_js.sig="ipiiijpp";function __munmap_js(tr,rr,ir,lr,dr,fr){fr=bigintToI53Checked(fr);try{var hr=SYSCALLS.getStreamFromFD(dr);ir&2&&SYSCALLS.doMsync(tr,hr,rr,lr,fr)}catch(mr){if(typeof FS>"u"||mr.name!=="ErrnoError")throw mr;return-mr.errno}}__munmap_js.sig="ippiiij";var timers={},handleException=tr=>{if(tr instanceof ExitStatus||tr=="unwind")return EXITSTATUS;quit_(1,tr)},keepRuntimeAlive=()=>noExitRuntime||runtimeKeepaliveCounter>0,_proc_exit=tr=>{var rr;EXITSTATUS=tr,keepRuntimeAlive()||((rr=Module.onExit)==null||rr.call(Module,tr),ABORT=!0),quit_(tr,new ExitStatus(tr))};_proc_exit.sig="vi";var exitJS=(tr,rr)=>{EXITSTATUS=tr,_proc_exit(tr)},_exit=exitJS;_exit.sig="vi";var maybeExit=()=>{if(!keepRuntimeAlive())try{_exit(EXITSTATUS)}catch(tr){handleException(tr)}},callUserCallback=tr=>{if(!ABORT)try{tr(),maybeExit()}catch(rr){handleException(rr)}},_emscripten_get_now=()=>performance.now();_emscripten_get_now.sig="d";var __setitimer_js=(tr,rr)=>{if(timers[tr]&&(clearTimeout(timers[tr].id),delete timers[tr]),!rr)return 0;var ir=setTimeout(()=>{delete timers[tr],callUserCallback(()=>__emscripten_timeout(tr,_emscripten_get_now()))},rr);return timers[tr]={id:ir,timeout_ms:rr},0};__setitimer_js.sig="iid";var __tzset_js=(tr,rr,ir,lr)=>{var dr=new Date().getFullYear(),fr=new Date(dr,0,1),hr=new Date(dr,6,1),mr=fr.getTimezoneOffset(),gr=hr.getTimezoneOffset(),yr=Math.max(mr,gr);HEAPU32[tr>>2]=yr*60,HEAP32[rr>>2]=+(mr!=gr);var _r=wr=>{var xr=wr>=0?"-":"+",Sr=Math.abs(wr),Ar=String(Math.floor(Sr/60)).padStart(2,"0"),Ir=String(Sr%60).padStart(2,"0");return`UTC${xr}${Ar}${Ir}`},br=_r(mr),vr=_r(gr);gr<mr?(stringToUTF8(br,ir,17),stringToUTF8(vr,lr,17)):(stringToUTF8(br,lr,17),stringToUTF8(vr,ir,17))};__tzset_js.sig="vpppp";var _emscripten_date_now=()=>Date.now();_emscripten_date_now.sig="d";var checkWasiClock=tr=>tr>=0&&tr<=3;function _clock_time_get(tr,rr,ir){if(!checkWasiClock(tr))return 28;var lr;tr===0?lr=_emscripten_date_now():lr=_emscripten_get_now();var dr=Math.round(lr*1e3*1e3);return HEAP64[ir>>3]=BigInt(dr),0}_clock_time_get.sig="iijp";var readEmAsmArgsArray=[],readEmAsmArgs=(tr,rr)=>{readEmAsmArgsArray.length=0;for(var ir;ir=HEAPU8[tr++];){var lr=ir!=105;lr&=ir!=112,rr+=lr&&rr%8?4:0,readEmAsmArgsArray.push(ir==112?HEAPU32[rr>>2]:ir==106?HEAP64[rr>>3]:ir==105?HEAP32[rr>>2]:HEAPF64[rr>>3]),rr+=lr?8:4}return readEmAsmArgsArray},runEmAsmFunction=(tr,rr,ir)=>{var lr=readEmAsmArgs(rr,ir);return ASM_CONSTS[tr](...lr)},_emscripten_asm_const_int=(tr,rr,ir)=>runEmAsmFunction(tr,rr,ir);_emscripten_asm_const_int.sig="ippp";var _emscripten_force_exit=tr=>{__emscripten_runtime_keepalive_clear(),_exit(tr)};_emscripten_force_exit.sig="vi";var getHeapMax=()=>2147483648,growMemory=tr=>{var rr=wasmMemory.buffer,ir=(tr-rr.byteLength+65535)/65536|0;try{return wasmMemory.grow(ir),updateMemoryViews(),1}catch{}},_emscripten_resize_heap=tr=>{var rr=HEAPU8.length;tr>>>=0;var ir=getHeapMax();if(tr>ir)return!1;for(var lr=1;lr<=4;lr*=2){var dr=rr*(1+.2/lr);dr=Math.min(dr,tr+100663296);var fr=Math.min(ir,alignMemory(Math.max(tr,dr),65536)),hr=growMemory(fr);if(hr)return!0}return!1};_emscripten_resize_heap.sig="ip";var _emscripten_set_main_loop_timing=(tr,rr)=>{if(MainLoop.timingMode=tr,MainLoop.timingValue=rr,!MainLoop.func)return 1;if(MainLoop.running||(MainLoop.running=!0),tr==0)MainLoop.scheduler=function(){var fr=Math.max(0,MainLoop.tickStartTime+rr-_emscripten_get_now())|0;setTimeout(MainLoop.runner,fr)},MainLoop.method="timeout";else if(tr==1)MainLoop.scheduler=function(){MainLoop.requestAnimationFrame(MainLoop.runner)},MainLoop.method="rAF";else if(tr==2){if(typeof MainLoop.setImmediate>"u")if(typeof setImmediate>"u"){var ir=[],lr="setimmediate",dr=fr=>{(fr.data===lr||fr.data.target===lr)&&(fr.stopPropagation(),ir.shift()())};addEventListener("message",dr,!0),MainLoop.setImmediate=fr=>{ir.push(fr),ENVIRONMENT_IS_WORKER?(Module.setImmediates??(Module.setImmediates=[]),Module.setImmediates.push(fr),postMessage({target:lr})):postMessage(lr,"*")}}else MainLoop.setImmediate=setImmediate;MainLoop.scheduler=function(){MainLoop.setImmediate(MainLoop.runner)},MainLoop.method="immediate"}return 0};_emscripten_set_main_loop_timing.sig="iii";var MainLoop={running:!1,scheduler:null,method:"",currentlyRunningMainloop:0,func:null,arg:0,timingMode:0,timingValue:0,currentFrameNumber:0,queue:[],preMainLoop:[],postMainLoop:[],pause(){MainLoop.scheduler=null,MainLoop.currentlyRunningMainloop++},resume(){MainLoop.currentlyRunningMainloop++;var tr=MainLoop.timingMode,rr=MainLoop.timingValue,ir=MainLoop.func;MainLoop.func=null,setMainLoop(ir,0,!1,MainLoop.arg,!0),_emscripten_set_main_loop_timing(tr,rr),MainLoop.scheduler()},updateStatus(){if(Module.setStatus){var tr=Module.statusMessage||"Please wait...",rr=MainLoop.remainingBlockers??0,ir=MainLoop.expectedBlockers??0;rr?rr<ir?Module.setStatus("{message} ({expected - remaining}/{expected})"):Module.setStatus(tr):Module.setStatus("")}},init(){Module.preMainLoop&&MainLoop.preMainLoop.push(Module.preMainLoop),Module.postMainLoop&&MainLoop.postMainLoop.push(Module.postMainLoop)},runIter(tr){if(!ABORT){for(var rr of MainLoop.preMainLoop)if(rr()===!1)return;callUserCallback(tr);for(var ir of MainLoop.postMainLoop)ir()}},nextRAF:0,fakeRequestAnimationFrame(tr){var rr=Date.now();if(MainLoop.nextRAF===0)MainLoop.nextRAF=rr+1e3/60;else for(;rr+2>=MainLoop.nextRAF;)MainLoop.nextRAF+=1e3/60;var ir=Math.max(MainLoop.nextRAF-rr,0);setTimeout(tr,ir)},requestAnimationFrame(tr){if(typeof requestAnimationFrame=="function"){requestAnimationFrame(tr);return}var rr=MainLoop.fakeRequestAnimationFrame;rr(tr)}},setMainLoop=(tr,rr,ir,lr,dr)=>{MainLoop.func=tr,MainLoop.arg=lr;var fr=MainLoop.currentlyRunningMainloop;function hr(){return fr<MainLoop.currentlyRunningMainloop?(maybeExit(),!1):!0}if(MainLoop.running=!1,MainLoop.runner=function(){if(!ABORT){if(MainLoop.queue.length>0){var mr=MainLoop.queue.shift();if(mr.func(mr.arg),MainLoop.remainingBlockers){var gr=MainLoop.remainingBlockers,yr=gr%1==0?gr-1:Math.floor(gr);mr.counted?MainLoop.remainingBlockers=yr:(yr=yr+.5,MainLoop.remainingBlockers=(8*gr+yr)/9)}if(MainLoop.updateStatus(),!hr())return;setTimeout(MainLoop.runner,0);return}if(hr()){if(MainLoop.currentFrameNumber=MainLoop.currentFrameNumber+1|0,MainLoop.timingMode==1&&MainLoop.timingValue>1&&MainLoop.currentFrameNumber%MainLoop.timingValue!=0){MainLoop.scheduler();return}else MainLoop.timingMode==0&&(MainLoop.tickStartTime=_emscripten_get_now());MainLoop.runIter(tr),hr()&&MainLoop.scheduler()}}},dr||(rr&&rr>0?_emscripten_set_main_loop_timing(0,1e3/rr):_emscripten_set_main_loop_timing(1,1),MainLoop.scheduler()),ir)throw"unwind"},_emscripten_set_main_loop=(tr,rr,ir)=>{var lr=getWasmTableEntry(tr);setMainLoop(lr,rr,ir)};_emscripten_set_main_loop.sig="vpii";var getExecutableName=()=>thisProgram||"./this.program",getEnvStrings=()=>{if(!getEnvStrings.strings){var tr=(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",rr={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:tr,_:getExecutableName()};for(var ir in ENV)ENV[ir]===void 0?delete rr[ir]:rr[ir]=ENV[ir];var lr=[];for(var ir in rr)lr.push(`${ir}=${rr[ir]}`);getEnvStrings.strings=lr}return getEnvStrings.strings},stringToAscii=(tr,rr)=>{for(var ir=0;ir<tr.length;++ir)HEAP8[rr++]=tr.charCodeAt(ir);HEAP8[rr]=0},_environ_get=(tr,rr)=>{var ir=0;return getEnvStrings().forEach((lr,dr)=>{var fr=rr+ir;HEAPU32[tr+dr*4>>2]=fr,stringToAscii(lr,fr),ir+=lr.length+1}),0};_environ_get.sig="ipp";var _environ_sizes_get=(tr,rr)=>{var ir=getEnvStrings();HEAPU32[tr>>2]=ir.length;var lr=0;return ir.forEach(dr=>lr+=dr.length+1),HEAPU32[rr>>2]=lr,0};_environ_sizes_get.sig="ipp";function _fd_close(tr){try{var rr=SYSCALLS.getStreamFromFD(tr);return FS.close(rr),0}catch(ir){if(typeof FS>"u"||ir.name!=="ErrnoError")throw ir;return ir.errno}}_fd_close.sig="ii";function _fd_fdstat_get(tr,rr){try{var ir=0,lr=0,dr=0,fr=SYSCALLS.getStreamFromFD(tr),hr=fr.tty?2:FS.isDir(fr.mode)?3:FS.isLink(fr.mode)?7:4;return HEAP8[rr]=hr,HEAP16[rr+2>>1]=dr,HEAP64[rr+8>>3]=BigInt(ir),HEAP64[rr+16>>3]=BigInt(lr),0}catch(mr){if(typeof FS>"u"||mr.name!=="ErrnoError")throw mr;return mr.errno}}_fd_fdstat_get.sig="iip";var doReadv=(tr,rr,ir,lr)=>{for(var dr=0,fr=0;fr<ir;fr++){var hr=HEAPU32[rr>>2],mr=HEAPU32[rr+4>>2];rr+=8;var gr=FS.read(tr,HEAP8,hr,mr,lr);if(gr<0)return-1;if(dr+=gr,gr<mr)break;typeof lr<"u"&&(lr+=gr)}return dr};function _fd_pread(tr,rr,ir,lr,dr){lr=bigintToI53Checked(lr);try{if(isNaN(lr))return 61;var fr=SYSCALLS.getStreamFromFD(tr),hr=doReadv(fr,rr,ir,lr);return HEAPU32[dr>>2]=hr,0}catch(mr){if(typeof FS>"u"||mr.name!=="ErrnoError")throw mr;return mr.errno}}_fd_pread.sig="iippjp";var doWritev=(tr,rr,ir,lr)=>{for(var dr=0,fr=0;fr<ir;fr++){var hr=HEAPU32[rr>>2],mr=HEAPU32[rr+4>>2];rr+=8;var gr=FS.write(tr,HEAP8,hr,mr,lr);if(gr<0)return-1;if(dr+=gr,gr<mr)break;typeof lr<"u"&&(lr+=gr)}return dr};function _fd_pwrite(tr,rr,ir,lr,dr){lr=bigintToI53Checked(lr);try{if(isNaN(lr))return 61;var fr=SYSCALLS.getStreamFromFD(tr),hr=doWritev(fr,rr,ir,lr);return HEAPU32[dr>>2]=hr,0}catch(mr){if(typeof FS>"u"||mr.name!=="ErrnoError")throw mr;return mr.errno}}_fd_pwrite.sig="iippjp";function _fd_read(tr,rr,ir,lr){try{var dr=SYSCALLS.getStreamFromFD(tr),fr=doReadv(dr,rr,ir);return HEAPU32[lr>>2]=fr,0}catch(hr){if(typeof FS>"u"||hr.name!=="ErrnoError")throw hr;return hr.errno}}_fd_read.sig="iippp";function _fd_seek(tr,rr,ir,lr){rr=bigintToI53Checked(rr);try{if(isNaN(rr))return 61;var dr=SYSCALLS.getStreamFromFD(tr);return FS.llseek(dr,rr,ir),HEAP64[lr>>3]=BigInt(dr.position),dr.getdents&&rr===0&&ir===0&&(dr.getdents=null),0}catch(fr){if(typeof FS>"u"||fr.name!=="ErrnoError")throw fr;return fr.errno}}_fd_seek.sig="iijip";function _fd_sync(tr){var ir;try{var rr=SYSCALLS.getStreamFromFD(tr);return(ir=rr.stream_ops)!=null&&ir.fsync?rr.stream_ops.fsync(rr):0}catch(lr){if(typeof FS>"u"||lr.name!=="ErrnoError")throw lr;return lr.errno}}_fd_sync.sig="ii";function _fd_write(tr,rr,ir,lr){try{var dr=SYSCALLS.getStreamFromFD(tr),fr=doWritev(dr,rr,ir);return HEAPU32[lr>>2]=fr,0}catch(hr){if(typeof FS>"u"||hr.name!=="ErrnoError")throw hr;return hr.errno}}_fd_write.sig="iippp";var _getaddrinfo=(tr,rr,ir,lr)=>{var dr=0,fr=0,hr=0,mr=0,gr=0,yr=0,_r;function br(vr,wr,xr,Sr,Ar,Ir){var Mr,Or,$r,Dr;return Or=vr===10?28:16,Ar=vr===10?inetNtop6(Ar):inetNtop4(Ar),Mr=_malloc(Or),Dr=writeSockaddr(Mr,vr,Ar,Ir),assert(!Dr),$r=_malloc(32),HEAP32[$r+4>>2]=vr,HEAP32[$r+8>>2]=wr,HEAP32[$r+12>>2]=xr,HEAPU32[$r+24>>2]=Sr,HEAPU32[$r+20>>2]=Mr,vr===10?HEAP32[$r+16>>2]=28:HEAP32[$r+16>>2]=16,HEAP32[$r+28>>2]=0,$r}if(ir&&(hr=HEAP32[ir>>2],mr=HEAP32[ir+4>>2],gr=HEAP32[ir+8>>2],yr=HEAP32[ir+12>>2]),gr&&!yr&&(yr=gr===2?17:6),!gr&&yr&&(gr=yr===17?2:1),yr===0&&(yr=6),gr===0&&(gr=1),!tr&&!rr)return-2;if(hr&-1088||ir!==0&&HEAP32[ir>>2]&2&&!tr)return-1;if(hr&32)return-2;if(gr!==0&&gr!==1&&gr!==2)return-7;if(mr!==0&&mr!==2&&mr!==10)return-6;if(rr&&(rr=UTF8ToString(rr),fr=parseInt(rr,10),isNaN(fr)))return hr&1024?-2:-8;if(!tr)return mr===0&&(mr=2),hr&1||(mr===2?dr=_htonl(2130706433):dr=[0,0,0,_htonl(1)]),_r=br(mr,gr,yr,null,dr,fr),HEAPU32[lr>>2]=_r,0;if(tr=UTF8ToString(tr),dr=inetPton4(tr),dr!==null)if(mr===0||mr===2)mr=2;else if(mr===10&&hr&8)dr=[0,0,_htonl(65535),dr],mr=10;else return-2;else if(dr=inetPton6(tr),dr!==null)if(mr===0||mr===10)mr=10;else return-2;return dr!=null?(_r=br(mr,gr,yr,tr,dr,fr),HEAPU32[lr>>2]=_r,0):hr&4?-2:(tr=DNS.lookup_name(tr),dr=inetPton4(tr),mr===0?mr=2:mr===10&&(dr=[0,0,_htonl(65535),dr]),_r=br(mr,gr,yr,null,dr,fr),HEAPU32[lr>>2]=_r,0)};_getaddrinfo.sig="ipppp";var _getnameinfo=(tr,rr,ir,lr,dr,fr,hr)=>{var mr=readSockaddr(tr,rr);if(mr.errno)return-6;var gr=mr.port,yr=mr.addr,_r=!1;if(ir&&lr){var br;if(hr&1||!(br=DNS.lookup_addr(yr))){if(hr&8)return-2}else yr=br;var vr=stringToUTF8(yr,ir,lr);vr+1>=lr&&(_r=!0)}if(dr&&fr){gr=""+gr;var vr=stringToUTF8(gr,dr,fr);vr+1>=fr&&(_r=!0)}return _r?-12:0};_getnameinfo.sig="ipipipii";var stringToNewUTF8=tr=>{var rr=lengthBytesUTF8(tr)+1,ir=_malloc(rr);return ir&&stringToUTF8(tr,ir,rr),ir},getCFunc=tr=>{var rr=Module["_"+tr];return rr},writeArrayToMemory=(tr,rr)=>{HEAP8.set(tr,rr)},ccall=(tr,rr,ir,lr,dr)=>{var fr={string:xr=>{var Sr=0;return xr!=null&&xr!==0&&(Sr=stringToUTF8OnStack(xr)),Sr},array:xr=>{var Sr=stackAlloc(xr.length);return writeArrayToMemory(xr,Sr),Sr}};function hr(xr){return rr==="string"?UTF8ToString(xr):rr==="boolean"?!!xr:xr}var mr=getCFunc(tr),gr=[],yr=0;if(lr)for(var _r=0;_r<lr.length;_r++){var br=fr[ir[_r]];br?(yr===0&&(yr=stackSave()),gr[_r]=br(lr[_r])):gr[_r]=lr[_r]}var vr=mr(...gr);function wr(xr){return yr!==0&&stackRestore(yr),hr(xr)}return vr=wr(vr),vr},cwrap=(tr,rr,ir,lr)=>{var dr=!ir||ir.every(hr=>hr==="number"||hr==="boolean"),fr=rr!=="string";return fr&&dr&&!lr?getCFunc(tr):(...hr)=>ccall(tr,rr,ir,hr)},FS_createPath=FS.createPath,FS_unlink=tr=>FS.unlink(tr),FS_createLazyFile=FS.createLazyFile,FS_createDevice=FS.createDevice,setTempRet0=tr=>__emscripten_tempret_set(tr),_setTempRet0=setTempRet0;Module._setTempRet0=_setTempRet0;var getTempRet0=tr=>__emscripten_tempret_get(),_getTempRet0=getTempRet0;Module._getTempRet0=_getTempRet0,registerWasmPlugin(),FS.createPreloadedFile=FS_createPreloadedFile,FS.staticInit(),Module.FS_createPath=FS.createPath,Module.FS_createDataFile=FS.createDataFile,Module.FS_createPreloadedFile=FS.createPreloadedFile,Module.FS_unlink=FS.unlink,Module.FS_createLazyFile=FS.createLazyFile,Module.FS_createDevice=FS.createDevice,MEMFS.doesNotExistError=new FS.ErrnoError(44),MEMFS.doesNotExistError.stack="<generic error, no stack>",ENVIRONMENT_IS_NODE&&NODEFS.staticInit(),Module.requestAnimationFrame=MainLoop.requestAnimationFrame,Module.pauseMainLoop=MainLoop.pause,Module.resumeMainLoop=MainLoop.resume,MainLoop.init();var wasmImports={__assert_fail:___assert_fail,__call_sighandler:___call_sighandler,__heap_base:___heap_base,__indirect_function_table:wasmTable,__memory_base:___memory_base,__stack_pointer:___stack_pointer,__syscall__newselect:___syscall__newselect,__syscall_bind:___syscall_bind,__syscall_chdir:___syscall_chdir,__syscall_chmod:___syscall_chmod,__syscall_connect:___syscall_connect,__syscall_dup:___syscall_dup,__syscall_dup3:___syscall_dup3,__syscall_faccessat:___syscall_faccessat,__syscall_fadvise64:___syscall_fadvise64,__syscall_fallocate:___syscall_fallocate,__syscall_fcntl64:___syscall_fcntl64,__syscall_fdatasync:___syscall_fdatasync,__syscall_fstat64:___syscall_fstat64,__syscall_ftruncate64:___syscall_ftruncate64,__syscall_getcwd:___syscall_getcwd,__syscall_getdents64:___syscall_getdents64,__syscall_getsockname:___syscall_getsockname,__syscall_getsockopt:___syscall_getsockopt,__syscall_ioctl:___syscall_ioctl,__syscall_lstat64:___syscall_lstat64,__syscall_mkdirat:___syscall_mkdirat,__syscall_newfstatat:___syscall_newfstatat,__syscall_openat:___syscall_openat,__syscall_pipe:___syscall_pipe,__syscall_poll:___syscall_poll,__syscall_readlinkat:___syscall_readlinkat,__syscall_recvfrom:___syscall_recvfrom,__syscall_renameat:___syscall_renameat,__syscall_rmdir:___syscall_rmdir,__syscall_sendto:___syscall_sendto,__syscall_socket:___syscall_socket,__syscall_stat64:___syscall_stat64,__syscall_symlinkat:___syscall_symlinkat,__syscall_truncate64:___syscall_truncate64,__syscall_unlinkat:___syscall_unlinkat,__table_base:___table_base,_abort_js:__abort_js,_dlopen_js:__dlopen_js,_dlsym_js:__dlsym_js,_emscripten_memcpy_js:__emscripten_memcpy_js,_emscripten_runtime_keepalive_clear:__emscripten_runtime_keepalive_clear,_emscripten_system:__emscripten_system,_emscripten_throw_longjmp:__emscripten_throw_longjmp,_gmtime_js:__gmtime_js,_localtime_js:__localtime_js,_mmap_js:__mmap_js,_munmap_js:__munmap_js,_setitimer_js:__setitimer_js,_tzset_js:__tzset_js,clock_time_get:_clock_time_get,emscripten_asm_const_int:_emscripten_asm_const_int,emscripten_date_now:_emscripten_date_now,emscripten_force_exit:_emscripten_force_exit,emscripten_get_now:_emscripten_get_now,emscripten_resize_heap:_emscripten_resize_heap,emscripten_set_main_loop:_emscripten_set_main_loop,environ_get:_environ_get,environ_sizes_get:_environ_sizes_get,exit:_exit,fd_close:_fd_close,fd_fdstat_get:_fd_fdstat_get,fd_pread:_fd_pread,fd_pwrite:_fd_pwrite,fd_read:_fd_read,fd_seek:_fd_seek,fd_sync:_fd_sync,fd_write:_fd_write,getTempRet0:_getTempRet0,getaddrinfo:_getaddrinfo,getnameinfo:_getnameinfo,invoke_di,invoke_i,invoke_id,invoke_ii,invoke_iii,invoke_iiii,invoke_iiiii,invoke_iiiiii,invoke_iiiiiii,invoke_iiiiiiii,invoke_iiiiiiiii,invoke_iiiiiiiiii,invoke_iiiiiiiiiiiiiiiii,invoke_iiiiiji,invoke_iiiij,invoke_iiiijii,invoke_iiij,invoke_iiji,invoke_ij,invoke_ijiiiii,invoke_ijiiiiii,invoke_ji,invoke_jii,invoke_jiiii,invoke_jiiiii,invoke_jiiiiiiii,invoke_v,invoke_vi,invoke_vid,invoke_vii,invoke_viii,invoke_viiii,invoke_viiiii,invoke_viiiiii,invoke_viiiiiii,invoke_viiiiiiii,invoke_viiiiiiiii,invoke_viiiiiiiiiiii,invoke_viiij,invoke_viij,invoke_viiji,invoke_viijii,invoke_viijiiii,invoke_vij,invoke_viji,invoke_vijiji,invoke_vj,invoke_vji,is_web_env,memory:wasmMemory,proc_exit:_proc_exit,setTempRet0:_setTempRet0},wasmExports;createWasm(),Module._ScanKeywordLookup=(tr,rr)=>(Module._ScanKeywordLookup=wasmExports.ScanKeywordLookup)(tr,rr),Module._pg_snprintf=(tr,rr,ir,lr)=>(Module._pg_snprintf=wasmExports.pg_snprintf)(tr,rr,ir,lr),Module._strlen=tr=>(Module._strlen=wasmExports.strlen)(tr),Module._memset=(tr,rr,ir)=>(Module._memset=wasmExports.memset)(tr,rr,ir),Module._strchr=(tr,rr)=>(Module._strchr=wasmExports.strchr)(tr,rr),Module._PQserverVersion=tr=>(Module._PQserverVersion=wasmExports.PQserverVersion)(tr),Module._strstr=(tr,rr)=>(Module._strstr=wasmExports.strstr)(tr,rr),Module._pg_fprintf=(tr,rr,ir)=>(Module._pg_fprintf=wasmExports.pg_fprintf)(tr,rr,ir),Module._strspn=(tr,rr)=>(Module._strspn=wasmExports.strspn)(tr,rr);var _malloc=Module._malloc=tr=>(_malloc=Module._malloc=wasmExports.malloc)(tr);Module._pg_strcasecmp=(tr,rr)=>(Module._pg_strcasecmp=wasmExports.pg_strcasecmp)(tr,rr),Module._strcmp=(tr,rr)=>(Module._strcmp=wasmExports.strcmp)(tr,rr),Module._free=tr=>(Module._free=wasmExports.free)(tr),Module._pg_tolower=tr=>(Module._pg_tolower=wasmExports.pg_tolower)(tr),Module._memchr=(tr,rr,ir)=>(Module._memchr=wasmExports.memchr)(tr,rr,ir),Module._getenv=tr=>(Module._getenv=wasmExports.getenv)(tr),Module._fileno=tr=>(Module._fileno=wasmExports.fileno)(tr),Module._isatty=tr=>(Module._isatty=wasmExports.isatty)(tr),Module._strdup=tr=>(Module._strdup=wasmExports.strdup)(tr),Module.___errno_location=()=>(Module.___errno_location=wasmExports.__errno_location)();var _fflush=Module._fflush=tr=>(_fflush=Module._fflush=wasmExports.fflush)(tr);Module._pg_vsnprintf=(tr,rr,ir,lr)=>(Module._pg_vsnprintf=wasmExports.pg_vsnprintf)(tr,rr,ir,lr),Module._pg_malloc_extended=(tr,rr)=>(Module._pg_malloc_extended=wasmExports.pg_malloc_extended)(tr,rr),Module._PageInit=(tr,rr,ir)=>(Module._PageInit=wasmExports.PageInit)(tr,rr,ir),Module._pg_checksum_page=(tr,rr)=>(Module._pg_checksum_page=wasmExports.pg_checksum_page)(tr,rr),Module._errstart=(tr,rr)=>(Module._errstart=wasmExports.errstart)(tr,rr),Module._errcode=tr=>(Module._errcode=wasmExports.errcode)(tr),Module._errmsg=(tr,rr)=>(Module._errmsg=wasmExports.errmsg)(tr,rr),Module._errfinish=(tr,rr,ir)=>(Module._errfinish=wasmExports.errfinish)(tr,rr,ir),Module._PageAddItemExtended=(tr,rr,ir,lr,dr)=>(Module._PageAddItemExtended=wasmExports.PageAddItemExtended)(tr,rr,ir,lr,dr),Module._errstart_cold=(tr,rr)=>(Module._errstart_cold=wasmExports.errstart_cold)(tr,rr),Module._puts=tr=>(Module._puts=wasmExports.puts)(tr),Module._errmsg_internal=(tr,rr)=>(Module._errmsg_internal=wasmExports.errmsg_internal)(tr,rr),Module._memmove=(tr,rr,ir)=>(Module._memmove=wasmExports.memmove)(tr,rr,ir),Module._memcpy=(tr,rr,ir)=>(Module._memcpy=wasmExports.memcpy)(tr,rr,ir),Module._palloc=tr=>(Module._palloc=wasmExports.palloc)(tr),Module._pfree=tr=>(Module._pfree=wasmExports.pfree)(tr),Module._PageGetFreeSpace=tr=>(Module._PageGetFreeSpace=wasmExports.PageGetFreeSpace)(tr),Module._PageGetExactFreeSpace=tr=>(Module._PageGetExactFreeSpace=wasmExports.PageGetExactFreeSpace)(tr),Module._PageGetHeapFreeSpace=tr=>(Module._PageGetHeapFreeSpace=wasmExports.PageGetHeapFreeSpace)(tr),Module._PageIndexMultiDelete=(tr,rr,ir)=>(Module._PageIndexMultiDelete=wasmExports.PageIndexMultiDelete)(tr,rr,ir),Module._PageIndexTupleOverwrite=(tr,rr,ir,lr)=>(Module._PageIndexTupleOverwrite=wasmExports.PageIndexTupleOverwrite)(tr,rr,ir,lr),Module._ItemPointerEquals=(tr,rr)=>(Module._ItemPointerEquals=wasmExports.ItemPointerEquals)(tr,rr),Module._ItemPointerCompare=(tr,rr)=>(Module._ItemPointerCompare=wasmExports.ItemPointerCompare)(tr,rr),Module._add_size=(tr,rr)=>(Module._add_size=wasmExports.add_size)(tr,rr),Module._ShmemInitStruct=(tr,rr,ir)=>(Module._ShmemInitStruct=wasmExports.ShmemInitStruct)(tr,rr,ir),Module._s_init_lock_sema=(tr,rr)=>(Module._s_init_lock_sema=wasmExports.s_init_lock_sema)(tr,rr),Module._LWLockAcquire=(tr,rr)=>(Module._LWLockAcquire=wasmExports.LWLockAcquire)(tr,rr),Module._LWLockRelease=tr=>(Module._LWLockRelease=wasmExports.LWLockRelease)(tr),Module._on_shmem_exit=(tr,rr)=>(Module._on_shmem_exit=wasmExports.on_shmem_exit)(tr,rr),Module._tas_sema=tr=>(Module._tas_sema=wasmExports.tas_sema)(tr),Module._s_lock=(tr,rr,ir,lr)=>(Module._s_lock=wasmExports.s_lock)(tr,rr,ir,lr),Module._s_unlock_sema=tr=>(Module._s_unlock_sema=wasmExports.s_unlock_sema)(tr),Module._StartTransactionCommand=()=>(Module._StartTransactionCommand=wasmExports.StartTransactionCommand)(),Module._CommitTransactionCommand=()=>(Module._CommitTransactionCommand=wasmExports.CommitTransactionCommand)(),Module._WaitLatch=(tr,rr,ir,lr)=>(Module._WaitLatch=wasmExports.WaitLatch)(tr,rr,ir,lr),Module._ResetLatch=tr=>(Module._ResetLatch=wasmExports.ResetLatch)(tr),Module._ProcessInterrupts=()=>(Module._ProcessInterrupts=wasmExports.ProcessInterrupts)(),Module._MemoryContextAlloc=(tr,rr)=>(Module._MemoryContextAlloc=wasmExports.MemoryContextAlloc)(tr,rr),Module._AllocateDir=tr=>(Module._AllocateDir=wasmExports.AllocateDir)(tr),Module._ReadDir=(tr,rr)=>(Module._ReadDir=wasmExports.ReadDir)(tr,rr),Module._strncmp=(tr,rr,ir)=>(Module._strncmp=wasmExports.strncmp)(tr,rr,ir),Module._unlink=tr=>(Module._unlink=wasmExports.unlink)(tr),Module._errcode_for_file_access=()=>(Module._errcode_for_file_access=wasmExports.errcode_for_file_access)(),Module._FreeDir=tr=>(Module._FreeDir=wasmExports.FreeDir)(tr),Module._pg_prng_uint32=tr=>(Module._pg_prng_uint32=wasmExports.pg_prng_uint32)(tr),Module._dsm_create=(tr,rr)=>(Module._dsm_create=wasmExports.dsm_create)(tr,rr),Module._dsm_attach=tr=>(Module._dsm_attach=wasmExports.dsm_attach)(tr),Module._dsm_detach=tr=>(Module._dsm_detach=wasmExports.dsm_detach)(tr),Module._dsm_segment_address=tr=>(Module._dsm_segment_address=wasmExports.dsm_segment_address)(tr),Module._dsm_segment_handle=tr=>(Module._dsm_segment_handle=wasmExports.dsm_segment_handle)(tr),Module._MemoryContextAllocZero=(tr,rr)=>(Module._MemoryContextAllocZero=wasmExports.MemoryContextAllocZero)(tr,rr),Module._read=(tr,rr,ir)=>(Module._read=wasmExports.read)(tr,rr,ir),Module._hash_create=(tr,rr,ir,lr)=>(Module._hash_create=wasmExports.hash_create)(tr,rr,ir,lr),Module._hash_destroy=tr=>(Module._hash_destroy=wasmExports.hash_destroy)(tr),Module._hash_seq_init=(tr,rr)=>(Module._hash_seq_init=wasmExports.hash_seq_init)(tr,rr),Module._hash_seq_search=tr=>(Module._hash_seq_search=wasmExports.hash_seq_search)(tr),Module._hash_search=(tr,rr,ir,lr)=>(Module._hash_search=wasmExports.hash_search)(tr,rr,ir,lr),Module._initStringInfo=tr=>(Module._initStringInfo=wasmExports.initStringInfo)(tr),Module._appendStringInfo=(tr,rr,ir)=>(Module._appendStringInfo=wasmExports.appendStringInfo)(tr,rr,ir),Module._GetCurrentTimestamp=()=>(Module._GetCurrentTimestamp=wasmExports.GetCurrentTimestamp)(),Module._pg_usleep=tr=>(Module._pg_usleep=wasmExports.pg_usleep)(tr),Module._errdetail=(tr,rr)=>(Module._errdetail=wasmExports.errdetail)(tr,rr),Module._TransactionIdDidCommit=tr=>(Module._TransactionIdDidCommit=wasmExports.TransactionIdDidCommit)(tr),Module._TransactionIdPrecedes=(tr,rr)=>(Module._TransactionIdPrecedes=wasmExports.TransactionIdPrecedes)(tr,rr),Module._XLogBeginInsert=()=>(Module._XLogBeginInsert=wasmExports.XLogBeginInsert)(),Module._XLogRegisterData=(tr,rr)=>(Module._XLogRegisterData=wasmExports.XLogRegisterData)(tr,rr),Module._XLogInsert=(tr,rr)=>(Module._XLogInsert=wasmExports.XLogInsert)(tr,rr),Module._ConditionVariableInit=tr=>(Module._ConditionVariableInit=wasmExports.ConditionVariableInit)(tr),Module._ConditionVariableCancelSleep=()=>(Module._ConditionVariableCancelSleep=wasmExports.ConditionVariableCancelSleep)(),Module._ConditionVariableSleep=(tr,rr)=>(Module._ConditionVariableSleep=wasmExports.ConditionVariableSleep)(tr,rr),Module.___wasm_setjmp=(tr,rr,ir)=>(Module.___wasm_setjmp=wasmExports.__wasm_setjmp)(tr,rr,ir),Module.___wasm_setjmp_test=(tr,rr)=>(Module.___wasm_setjmp_test=wasmExports.__wasm_setjmp_test)(tr,rr),Module._pg_re_throw=()=>(Module._pg_re_throw=wasmExports.pg_re_throw)(),Module._emscripten_longjmp=(tr,rr)=>(Module._emscripten_longjmp=wasmExports.emscripten_longjmp)(tr,rr),Module._procsignal_sigusr1_handler=tr=>(Module._procsignal_sigusr1_handler=wasmExports.procsignal_sigusr1_handler)(tr),Module._close=tr=>(Module._close=wasmExports.close)(tr),Module._ReleaseExternalFD=()=>(Module._ReleaseExternalFD=wasmExports.ReleaseExternalFD)(),Module._fcntl=(tr,rr,ir)=>(Module._fcntl=wasmExports.fcntl)(tr,rr,ir),Module._pqsignal=(tr,rr)=>(Module._pqsignal=wasmExports.pqsignal)(tr,rr),Module._write=(tr,rr,ir)=>(Module._write=wasmExports.write)(tr,rr,ir),Module._AddWaitEventToSet=(tr,rr,ir,lr,dr)=>(Module._AddWaitEventToSet=wasmExports.AddWaitEventToSet)(tr,rr,ir,lr,dr),Module._clock_gettime=(tr,rr)=>(Module._clock_gettime=wasmExports.clock_gettime)(tr,rr),Module._poll=(tr,rr,ir)=>(Module._poll=wasmExports.poll)(tr,rr,ir),Module._WaitLatchOrSocket=(tr,rr,ir,lr,dr)=>(Module._WaitLatchOrSocket=wasmExports.WaitLatchOrSocket)(tr,rr,ir,lr,dr),Module._GetNumRegisteredWaitEvents=tr=>(Module._GetNumRegisteredWaitEvents=wasmExports.GetNumRegisteredWaitEvents)(tr),Module._ShmemInitHash=(tr,rr,ir,lr,dr)=>(Module._ShmemInitHash=wasmExports.ShmemInitHash)(tr,rr,ir,lr,dr),Module._InitMaterializedSRF=(tr,rr)=>(Module._InitMaterializedSRF=wasmExports.InitMaterializedSRF)(tr,rr),Module._cstring_to_text=tr=>(Module._cstring_to_text=wasmExports.cstring_to_text)(tr),Module._Int64GetDatum=tr=>(Module._Int64GetDatum=wasmExports.Int64GetDatum)(tr),Module._tuplestore_putvalues=(tr,rr,ir,lr)=>(Module._tuplestore_putvalues=wasmExports.tuplestore_putvalues)(tr,rr,ir,lr),Module._shm_toc_allocate=(tr,rr)=>(Module._shm_toc_allocate=wasmExports.shm_toc_allocate)(tr,rr),Module._shm_toc_insert=(tr,rr,ir)=>(Module._shm_toc_insert=wasmExports.shm_toc_insert)(tr,rr,ir),Module._shm_toc_lookup=(tr,rr,ir)=>(Module._shm_toc_lookup=wasmExports.shm_toc_lookup)(tr,rr,ir),Module._superuser_arg=tr=>(Module._superuser_arg=wasmExports.superuser_arg)(tr),Module._superuser=()=>(Module._superuser=wasmExports.superuser)(),Module._GetUserId=()=>(Module._GetUserId=wasmExports.GetUserId)(),Module._has_privs_of_role=(tr,rr)=>(Module._has_privs_of_role=wasmExports.has_privs_of_role)(tr,rr),Module._errmsg_plural=(tr,rr,ir,lr)=>(Module._errmsg_plural=wasmExports.errmsg_plural)(tr,rr,ir,lr),Module._errhint=(tr,rr)=>(Module._errhint=wasmExports.errhint)(tr,rr),Module._fstat=(tr,rr)=>(Module._fstat=wasmExports.fstat)(tr,rr),Module._ftruncate=(tr,rr)=>(Module._ftruncate=wasmExports.ftruncate)(tr,rr),Module._RequestAddinShmemSpace=tr=>(Module._RequestAddinShmemSpace=wasmExports.RequestAddinShmemSpace)(tr),Module._hash_estimate_size=(tr,rr)=>(Module._hash_estimate_size=wasmExports.hash_estimate_size)(tr,rr),Module._pg_sprintf=(tr,rr,ir)=>(Module._pg_sprintf=wasmExports.pg_sprintf)(tr,rr,ir),Module._SetConfigOption=(tr,rr,ir,lr)=>(Module._SetConfigOption=wasmExports.SetConfigOption)(tr,rr,ir,lr),Module._pg_printf=(tr,rr)=>(Module._pg_printf=wasmExports.pg_printf)(tr,rr),Module._before_shmem_exit=(tr,rr)=>(Module._before_shmem_exit=wasmExports.before_shmem_exit)(tr,rr),Module._cancel_before_shmem_exit=(tr,rr)=>(Module._cancel_before_shmem_exit=wasmExports.cancel_before_shmem_exit)(tr,rr),Module._pg_qsort=(tr,rr,ir,lr)=>(Module._pg_qsort=wasmExports.pg_qsort)(tr,rr,ir,lr),Module._TransactionIdIsInProgress=tr=>(Module._TransactionIdIsInProgress=wasmExports.TransactionIdIsInProgress)(tr),Module._TransactionIdIsCurrentTransactionId=tr=>(Module._TransactionIdIsCurrentTransactionId=wasmExports.TransactionIdIsCurrentTransactionId)(tr),Module._RecoveryInProgress=()=>(Module._RecoveryInProgress=wasmExports.RecoveryInProgress)(),Module._GetOldestNonRemovableTransactionId=tr=>(Module._GetOldestNonRemovableTransactionId=wasmExports.GetOldestNonRemovableTransactionId)(tr),Module._GetCurrentCommandId=tr=>(Module._GetCurrentCommandId=wasmExports.GetCurrentCommandId)(tr),Module._BackendXidGetPid=tr=>(Module._BackendXidGetPid=wasmExports.BackendXidGetPid)(tr),Module._lappend_int=(tr,rr)=>(Module._lappend_int=wasmExports.lappend_int)(tr,rr),Module._index_close=(tr,rr)=>(Module._index_close=wasmExports.index_close)(tr,rr),Module._table_close=(tr,rr)=>(Module._table_close=wasmExports.table_close)(tr,rr),Module._CommandCounterIncrement=()=>(Module._CommandCounterIncrement=wasmExports.CommandCounterIncrement)(),Module._GetActiveSnapshot=()=>(Module._GetActiveSnapshot=wasmExports.GetActiveSnapshot)(),Module._ScanKeyInit=(tr,rr,ir,lr,dr)=>(Module._ScanKeyInit=wasmExports.ScanKeyInit)(tr,rr,ir,lr,dr),Module._table_open=(tr,rr)=>(Module._table_open=wasmExports.table_open)(tr,rr),Module._systable_beginscan=(tr,rr,ir,lr,dr,fr)=>(Module._systable_beginscan=wasmExports.systable_beginscan)(tr,rr,ir,lr,dr,fr),Module._systable_getnext=tr=>(Module._systable_getnext=wasmExports.systable_getnext)(tr),Module._systable_endscan=tr=>(Module._systable_endscan=wasmExports.systable_endscan)(tr),Module._index_open=(tr,rr)=>(Module._index_open=wasmExports.index_open)(tr,rr),Module._systable_beginscan_ordered=(tr,rr,ir,lr,dr)=>(Module._systable_beginscan_ordered=wasmExports.systable_beginscan_ordered)(tr,rr,ir,lr,dr),Module._systable_getnext_ordered=(tr,rr)=>(Module._systable_getnext_ordered=wasmExports.systable_getnext_ordered)(tr,rr),Module._systable_endscan_ordered=tr=>(Module._systable_endscan_ordered=wasmExports.systable_endscan_ordered)(tr),Module._heap_form_tuple=(tr,rr,ir)=>(Module._heap_form_tuple=wasmExports.heap_form_tuple)(tr,rr,ir),Module._heap_freetuple=tr=>(Module._heap_freetuple=wasmExports.heap_freetuple)(tr),Module._AllocSetContextCreateInternal=(tr,rr,ir,lr,dr)=>(Module._AllocSetContextCreateInternal=wasmExports.AllocSetContextCreateInternal)(tr,rr,ir,lr,dr),Module._list_free_deep=tr=>(Module._list_free_deep=wasmExports.list_free_deep)(tr),Module._lappend=(tr,rr)=>(Module._lappend=wasmExports.lappend)(tr,rr),Module._LockBuffer=(tr,rr)=>(Module._LockBuffer=wasmExports.LockBuffer)(tr,rr),Module._GetFreeIndexPage=tr=>(Module._GetFreeIndexPage=wasmExports.GetFreeIndexPage)(tr),Module._RecordFreeIndexPage=(tr,rr)=>(Module._RecordFreeIndexPage=wasmExports.RecordFreeIndexPage)(tr,rr),Module._IndexFreeSpaceMapVacuum=tr=>(Module._IndexFreeSpaceMapVacuum=wasmExports.IndexFreeSpaceMapVacuum)(tr),Module._UnlockReleaseBuffer=tr=>(Module._UnlockReleaseBuffer=wasmExports.UnlockReleaseBuffer)(tr),Module._smgropen=(tr,rr)=>(Module._smgropen=wasmExports.smgropen)(tr,rr),Module._smgrsetowner=(tr,rr)=>(Module._smgrsetowner=wasmExports.smgrsetowner)(tr,rr),Module._RelationGetNumberOfBlocksInFork=(tr,rr)=>(Module._RelationGetNumberOfBlocksInFork=wasmExports.RelationGetNumberOfBlocksInFork)(tr,rr),Module._ReleaseBuffer=tr=>(Module._ReleaseBuffer=wasmExports.ReleaseBuffer)(tr),Module._GetRecordedFreeSpace=(tr,rr)=>(Module._GetRecordedFreeSpace=wasmExports.GetRecordedFreeSpace)(tr,rr),Module._smgrexists=(tr,rr)=>(Module._smgrexists=wasmExports.smgrexists)(tr,rr),Module._ReadBufferExtended=(tr,rr,ir,lr,dr)=>(Module._ReadBufferExtended=wasmExports.ReadBufferExtended)(tr,rr,ir,lr,dr),Module._MarkBufferDirty=tr=>(Module._MarkBufferDirty=wasmExports.MarkBufferDirty)(tr),Module._log_newpage_buffer=(tr,rr)=>(Module._log_newpage_buffer=wasmExports.log_newpage_buffer)(tr,rr),Module._copy_file=(tr,rr)=>(Module._copy_file=wasmExports.copy_file)(tr,rr),Module._fd_fsync_fname=(tr,rr)=>(Module._fd_fsync_fname=wasmExports.fd_fsync_fname)(tr,rr),Module._OpenTransientFile=(tr,rr)=>(Module._OpenTransientFile=wasmExports.OpenTransientFile)(tr,rr),Module._CloseTransientFile=tr=>(Module._CloseTransientFile=wasmExports.CloseTransientFile)(tr),Module._hash_bytes=(tr,rr)=>(Module._hash_bytes=wasmExports.hash_bytes)(tr,rr),Module._pstrdup=tr=>(Module._pstrdup=wasmExports.pstrdup)(tr),Module._repalloc=(tr,rr)=>(Module._repalloc=wasmExports.repalloc)(tr,rr),Module._wasm_OpenPipeStream=(tr,rr)=>(Module._wasm_OpenPipeStream=wasmExports.wasm_OpenPipeStream)(tr,rr),Module._access=(tr,rr)=>(Module._access=wasmExports.access)(tr,rr),Module._fopen=(tr,rr)=>(Module._fopen=wasmExports.fopen)(tr,rr),Module._fiprintf=(tr,rr,ir)=>(Module._fiprintf=wasmExports.fiprintf)(tr,rr,ir),Module._fclose=tr=>(Module._fclose=wasmExports.fclose)(tr),Module._fsync_fname_ext=(tr,rr,ir,lr)=>(Module._fsync_fname_ext=wasmExports.fsync_fname_ext)(tr,rr,ir,lr),Module._fd_durable_rename=(tr,rr,ir)=>(Module._fd_durable_rename=wasmExports.fd_durable_rename)(tr,rr,ir),Module._rename=(tr,rr)=>(Module._rename=wasmExports.rename)(tr,rr),Module._strlcpy=(tr,rr,ir)=>(Module._strlcpy=wasmExports.strlcpy)(tr,rr,ir),Module._dup=tr=>(Module._dup=wasmExports.dup)(tr),Module._open=(tr,rr,ir)=>(Module._open=wasmExports.open)(tr,rr,ir),Module._AcquireExternalFD=()=>(Module._AcquireExternalFD=wasmExports.AcquireExternalFD)(),Module._realloc=(tr,rr)=>(Module._realloc=wasmExports.realloc)(tr,rr),Module._stat=(tr,rr)=>(Module._stat=wasmExports.stat)(tr,rr),Module._pwrite=(tr,rr,ir,lr)=>(Module._pwrite=wasmExports.pwrite)(tr,rr,ir,lr),Module._lseek=(tr,rr,ir)=>(Module._lseek=wasmExports.lseek)(tr,rr,ir),Module._AllocateFile=(tr,rr)=>(Module._AllocateFile=wasmExports.AllocateFile)(tr,rr),Module._GetCurrentSubTransactionId=()=>(Module._GetCurrentSubTransactionId=wasmExports.GetCurrentSubTransactionId)(),Module._FreeFile=tr=>(Module._FreeFile=wasmExports.FreeFile)(tr),Module._pclose=tr=>(Module._pclose=wasmExports.pclose)(tr),Module._ClosePipeStream=tr=>(Module._ClosePipeStream=wasmExports.ClosePipeStream)(tr),Module._pg_prng_uint64_range=(tr,rr,ir)=>(Module._pg_prng_uint64_range=wasmExports.pg_prng_uint64_range)(tr,rr,ir),Module._AtEOSubXact_Files=(tr,rr,ir)=>(Module._AtEOSubXact_Files=wasmExports.AtEOSubXact_Files)(tr,rr,ir),Module._pre_format_elog_string=(tr,rr)=>(Module._pre_format_elog_string=wasmExports.pre_format_elog_string)(tr,rr),Module._format_elog_string=(tr,rr)=>(Module._format_elog_string=wasmExports.format_elog_string)(tr,rr),Module._list_free=tr=>(Module._list_free=wasmExports.list_free)(tr),Module._guc_malloc=(tr,rr)=>(Module._guc_malloc=wasmExports.guc_malloc)(tr,rr),Module._MemoryContextDelete=tr=>(Module._MemoryContextDelete=wasmExports.MemoryContextDelete)(tr),Module._strtoul=(tr,rr,ir)=>(Module._strtoul=wasmExports.strtoul)(tr,rr,ir),Module._hash_get_num_entries=tr=>(Module._hash_get_num_entries=wasmExports.hash_get_num_entries)(tr),Module._LWLockInitialize=(tr,rr)=>(Module._LWLockInitialize=wasmExports.LWLockInitialize)(tr,rr),Module._PrefetchBuffer=(tr,rr,ir,lr)=>(Module._PrefetchBuffer=wasmExports.PrefetchBuffer)(tr,rr,ir,lr),Module._LockBufHdr=tr=>(Module._LockBufHdr=wasmExports.LockBufHdr)(tr),Module._ReadBuffer=(tr,rr)=>(Module._ReadBuffer=wasmExports.ReadBuffer)(tr,rr),Module._pgstat_assoc_relation=tr=>(Module._pgstat_assoc_relation=wasmExports.pgstat_assoc_relation)(tr),Module._ExtendBufferedRel=(tr,rr,ir,lr)=>(Module._ExtendBufferedRel=wasmExports.ExtendBufferedRel)(tr,rr,ir,lr),Module._LockBufferForCleanup=tr=>(Module._LockBufferForCleanup=wasmExports.LockBufferForCleanup)(tr),Module._smgrread=(tr,rr,ir,lr)=>(Module._smgrread=wasmExports.smgrread)(tr,rr,ir,lr),Module._LockRelationForExtension=(tr,rr)=>(Module._LockRelationForExtension=wasmExports.LockRelationForExtension)(tr,rr),Module._UnlockRelationForExtension=(tr,rr)=>(Module._UnlockRelationForExtension=wasmExports.UnlockRelationForExtension)(tr,rr),Module._BufferGetBlockNumber=tr=>(Module._BufferGetBlockNumber=wasmExports.BufferGetBlockNumber)(tr),Module._bsearch=(tr,rr,ir,lr,dr)=>(Module._bsearch=wasmExports.bsearch)(tr,rr,ir,lr,dr),Module._set_errcontext_domain=tr=>(Module._set_errcontext_domain=wasmExports.set_errcontext_domain)(tr),Module._errcontext_msg=(tr,rr)=>(Module._errcontext_msg=wasmExports.errcontext_msg)(tr,rr),Module._GetAccessStrategy=tr=>(Module._GetAccessStrategy=wasmExports.GetAccessStrategy)(tr),Module._FreeAccessStrategy=tr=>(Module._FreeAccessStrategy=wasmExports.FreeAccessStrategy)(tr),Module._ConditionalLockBuffer=tr=>(Module._ConditionalLockBuffer=wasmExports.ConditionalLockBuffer)(tr),Module._TestForOldSnapshot_impl=(tr,rr)=>(Module._TestForOldSnapshot_impl=wasmExports.TestForOldSnapshot_impl)(tr,rr);var _calloc=Module._calloc=(tr,rr)=>(_calloc=Module._calloc=wasmExports.calloc)(tr,rr);Module._have_free_buffer=()=>(Module._have_free_buffer=wasmExports.have_free_buffer)(),Module._palloc0=tr=>(Module._palloc0=wasmExports.palloc0)(tr),Module._resetStringInfo=tr=>(Module._resetStringInfo=wasmExports.resetStringInfo)(tr),Module._appendStringInfoChar=(tr,rr)=>(Module._appendStringInfoChar=wasmExports.appendStringInfoChar)(tr,rr),Module._appendBinaryStringInfo=(tr,rr,ir)=>(Module._appendBinaryStringInfo=wasmExports.appendBinaryStringInfo)(tr,rr,ir),Module._errdetail_internal=(tr,rr)=>(Module._errdetail_internal=wasmExports.errdetail_internal)(tr,rr),Module._strcpy=(tr,rr)=>(Module._strcpy=wasmExports.strcpy)(tr,rr),Module._LWLockRegisterTranche=(tr,rr)=>(Module._LWLockRegisterTranche=wasmExports.LWLockRegisterTranche)(tr,rr),Module._GetNamedLWLockTranche=tr=>(Module._GetNamedLWLockTranche=wasmExports.GetNamedLWLockTranche)(tr),Module._LWLockNewTrancheId=()=>(Module._LWLockNewTrancheId=wasmExports.LWLockNewTrancheId)(),Module._RequestNamedLWLockTranche=(tr,rr)=>(Module._RequestNamedLWLockTranche=wasmExports.RequestNamedLWLockTranche)(tr,rr),Module._pg_prng_double=tr=>(Module._pg_prng_double=wasmExports.pg_prng_double)(tr),Module._getpid=()=>(Module._getpid=wasmExports.getpid)(),Module._GetTransactionSnapshot=()=>(Module._GetTransactionSnapshot=wasmExports.GetTransactionSnapshot)(),Module._ConditionVariableSignal=tr=>(Module._ConditionVariableSignal=wasmExports.ConditionVariableSignal)(tr),Module._LockPage=(tr,rr,ir)=>(Module._LockPage=wasmExports.LockPage)(tr,rr,ir),Module._UnlockPage=(tr,rr,ir)=>(Module._UnlockPage=wasmExports.UnlockPage)(tr,rr,ir),Module._pgstat_progress_update_param=(tr,rr)=>(Module._pgstat_progress_update_param=wasmExports.pgstat_progress_update_param)(tr,rr),Module._list_make1_impl=(tr,rr)=>(Module._list_make1_impl=wasmExports.list_make1_impl)(tr,rr),Module._psprintf=(tr,rr)=>(Module._psprintf=wasmExports.psprintf)(tr,rr),Module._smgrtruncate=(tr,rr,ir,lr)=>(Module._smgrtruncate=wasmExports.smgrtruncate)(tr,rr,ir,lr),Module._log=tr=>(Module._log=wasmExports.log)(tr),Module._pairingheap_allocate=(tr,rr)=>(Module._pairingheap_allocate=wasmExports.pairingheap_allocate)(tr,rr),Module._pairingheap_add=(tr,rr)=>(Module._pairingheap_add=wasmExports.pairingheap_add)(tr,rr),Module._pairingheap_first=tr=>(Module._pairingheap_first=wasmExports.pairingheap_first)(tr),Module._pairingheap_remove_first=tr=>(Module._pairingheap_remove_first=wasmExports.pairingheap_remove_first)(tr),Module._bloom_create=(tr,rr,ir)=>(Module._bloom_create=wasmExports.bloom_create)(tr,rr,ir),Module._bloom_free=tr=>(Module._bloom_free=wasmExports.bloom_free)(tr),Module._bloom_add_element=(tr,rr,ir)=>(Module._bloom_add_element=wasmExports.bloom_add_element)(tr,rr,ir),Module._hash_bytes_extended=(tr,rr,ir)=>(Module._hash_bytes_extended=wasmExports.hash_bytes_extended)(tr,rr,ir),Module._bloom_lacks_element=(tr,rr,ir)=>(Module._bloom_lacks_element=wasmExports.bloom_lacks_element)(tr,rr,ir),Module._bloom_prop_bits_set=tr=>(Module._bloom_prop_bits_set=wasmExports.bloom_prop_bits_set)(tr),Module._pg_popcount=(tr,rr)=>(Module._pg_popcount=wasmExports.pg_popcount)(tr,rr),Module._memcmp=(tr,rr,ir)=>(Module._memcmp=wasmExports.memcmp)(tr,rr,ir),Module._bms_make_singleton=tr=>(Module._bms_make_singleton=wasmExports.bms_make_singleton)(tr),Module._bms_add_members=(tr,rr)=>(Module._bms_add_members=wasmExports.bms_add_members)(tr,rr),Module._bms_add_member=(tr,rr)=>(Module._bms_add_member=wasmExports.bms_add_member)(tr,rr),Module._bms_del_member=(tr,rr)=>(Module._bms_del_member=wasmExports.bms_del_member)(tr,rr),Module._check_stack_depth=()=>(Module._check_stack_depth=wasmExports.check_stack_depth)(),Module._parser_errposition=(tr,rr)=>(Module._parser_errposition=wasmExports.parser_errposition)(tr,rr),Module._makeVar=(tr,rr,ir,lr,dr,fr)=>(Module._makeVar=wasmExports.makeVar)(tr,rr,ir,lr,dr,fr),Module._bms_union=(tr,rr)=>(Module._bms_union=wasmExports.bms_union)(tr,rr),Module._varstr_levenshtein_less_equal=(tr,rr,ir,lr,dr,fr,hr,mr,gr)=>(Module._varstr_levenshtein_less_equal=wasmExports.varstr_levenshtein_less_equal)(tr,rr,ir,lr,dr,fr,hr,mr,gr),Module._SearchSysCacheExists=(tr,rr,ir,lr,dr)=>(Module._SearchSysCacheExists=wasmExports.SearchSysCacheExists)(tr,rr,ir,lr,dr),Module._MemoryContextAllocZeroAligned=(tr,rr)=>(Module._MemoryContextAllocZeroAligned=wasmExports.MemoryContextAllocZeroAligned)(tr,rr),Module._makeString=tr=>(Module._makeString=wasmExports.makeString)(tr),Module._addRTEPermissionInfo=(tr,rr)=>(Module._addRTEPermissionInfo=wasmExports.addRTEPermissionInfo)(tr,rr),Module._copyObjectImpl=tr=>(Module._copyObjectImpl=wasmExports.copyObjectImpl)(tr),Module._exprType=tr=>(Module._exprType=wasmExports.exprType)(tr),Module._lappend_oid=(tr,rr)=>(Module._lappend_oid=wasmExports.lappend_oid)(tr,rr),Module._exprTypmod=tr=>(Module._exprTypmod=wasmExports.exprTypmod)(tr),Module._exprLocation=tr=>(Module._exprLocation=wasmExports.exprLocation)(tr),Module._CreateTemplateTupleDesc=tr=>(Module._CreateTemplateTupleDesc=wasmExports.CreateTemplateTupleDesc)(tr),Module._TupleDescInitEntry=(tr,rr,ir,lr,dr,fr)=>(Module._TupleDescInitEntry=wasmExports.TupleDescInitEntry)(tr,rr,ir,lr,dr,fr),Module._TupleDescInitEntryCollation=(tr,rr,ir)=>(Module._TupleDescInitEntryCollation=wasmExports.TupleDescInitEntryCollation)(tr,rr,ir),Module._typenameTypeIdAndMod=(tr,rr,ir,lr)=>(Module._typenameTypeIdAndMod=wasmExports.typenameTypeIdAndMod)(tr,rr,ir,lr),Module._format_type_be=tr=>(Module._format_type_be=wasmExports.format_type_be)(tr),Module._list_concat=(tr,rr)=>(Module._list_concat=wasmExports.list_concat)(tr,rr),Module._list_copy=tr=>(Module._list_copy=wasmExports.list_copy)(tr),Module._relation_open=(tr,rr)=>(Module._relation_open=wasmExports.relation_open)(tr,rr),Module._relation_close=(tr,rr)=>(Module._relation_close=wasmExports.relation_close)(tr,rr),Module._makeTargetEntry=(tr,rr,ir,lr)=>(Module._makeTargetEntry=wasmExports.makeTargetEntry)(tr,rr,ir,lr),Module._get_attname=(tr,rr,ir)=>(Module._get_attname=wasmExports.get_attname)(tr,rr,ir),Module._SearchSysCache2=(tr,rr,ir)=>(Module._SearchSysCache2=wasmExports.SearchSysCache2)(tr,rr,ir),Module._ReleaseSysCache=tr=>(Module._ReleaseSysCache=wasmExports.ReleaseSysCache)(tr),Module._RangeVarGetRelidExtended=(tr,rr,ir,lr,dr)=>(Module._RangeVarGetRelidExtended=wasmExports.RangeVarGetRelidExtended)(tr,rr,ir,lr,dr),Module._pg_mbstrlen_with_len=(tr,rr)=>(Module._pg_mbstrlen_with_len=wasmExports.pg_mbstrlen_with_len)(tr,rr),Module._errposition=tr=>(Module._errposition=wasmExports.errposition)(tr),Module._numeric_in=tr=>(Module._numeric_in=wasmExports.numeric_in)(tr),Module._DirectFunctionCall3Coll=(tr,rr,ir,lr,dr)=>(Module._DirectFunctionCall3Coll=wasmExports.DirectFunctionCall3Coll)(tr,rr,ir,lr,dr),Module._bit_in=tr=>(Module._bit_in=wasmExports.bit_in)(tr),Module._NameListToString=tr=>(Module._NameListToString=wasmExports.NameListToString)(tr),Module._appendStringInfoString=(tr,rr)=>(Module._appendStringInfoString=wasmExports.appendStringInfoString)(tr,rr),Module._lookup_type_cache=(tr,rr)=>(Module._lookup_type_cache=wasmExports.lookup_type_cache)(tr,rr),Module._CacheRegisterSyscacheCallback=(tr,rr,ir)=>(Module._CacheRegisterSyscacheCallback=wasmExports.CacheRegisterSyscacheCallback)(tr,rr,ir),Module._SearchSysCache1=(tr,rr)=>(Module._SearchSysCache1=wasmExports.SearchSysCache1)(tr,rr),Module._list_make2_impl=(tr,rr,ir)=>(Module._list_make2_impl=wasmExports.list_make2_impl)(tr,rr,ir),Module._get_base_element_type=tr=>(Module._get_base_element_type=wasmExports.get_base_element_type)(tr),Module._downcase_truncate_identifier=(tr,rr,ir)=>(Module._downcase_truncate_identifier=wasmExports.downcase_truncate_identifier)(tr,rr,ir),Module._pg_database_encoding_max_length=()=>(Module._pg_database_encoding_max_length=wasmExports.pg_database_encoding_max_length)(),Module._truncate_identifier=(tr,rr,ir)=>(Module._truncate_identifier=wasmExports.truncate_identifier)(tr,rr,ir),Module._scanner_isspace=tr=>(Module._scanner_isspace=wasmExports.scanner_isspace)(tr),Module._get_typcollation=tr=>(Module._get_typcollation=wasmExports.get_typcollation)(tr),Module._list_delete_cell=(tr,rr)=>(Module._list_delete_cell=wasmExports.list_delete_cell)(tr,rr),Module._makeTypeNameFromNameList=tr=>(Module._makeTypeNameFromNameList=wasmExports.makeTypeNameFromNameList)(tr),Module._SysCacheGetAttrNotNull=(tr,rr,ir)=>(Module._SysCacheGetAttrNotNull=wasmExports.SysCacheGetAttrNotNull)(tr,rr,ir),Module._text_to_cstring=tr=>(Module._text_to_cstring=wasmExports.text_to_cstring)(tr),Module._stringToNode=tr=>(Module._stringToNode=wasmExports.stringToNode)(tr),Module._bms_is_member=(tr,rr)=>(Module._bms_is_member=wasmExports.bms_is_member)(tr,rr),Module._bms_free=tr=>(Module._bms_free=wasmExports.bms_free)(tr),Module._core_yylex=(tr,rr,ir)=>(Module._core_yylex=wasmExports.core_yylex)(tr,rr,ir),Module._getc=tr=>(Module._getc=wasmExports.getc)(tr),Module._ferror=tr=>(Module._ferror=wasmExports.ferror)(tr),Module._fread=(tr,rr,ir,lr)=>(Module._fread=wasmExports.fread)(tr,rr,ir,lr),Module._clearerr=tr=>(Module._clearerr=wasmExports.clearerr)(tr),Module._scanner_init=(tr,rr,ir,lr)=>(Module._scanner_init=wasmExports.scanner_init)(tr,rr,ir,lr),Module._scanner_finish=tr=>(Module._scanner_finish=wasmExports.scanner_finish)(tr),Module._get_namespace_name=tr=>(Module._get_namespace_name=wasmExports.get_namespace_name)(tr),Module._lookup_rowtype_tupdesc=(tr,rr)=>(Module._lookup_rowtype_tupdesc=wasmExports.lookup_rowtype_tupdesc)(tr,rr),Module._DecrTupleDescRefCount=tr=>(Module._DecrTupleDescRefCount=wasmExports.DecrTupleDescRefCount)(tr),Module._relation_openrv=(tr,rr)=>(Module._relation_openrv=wasmExports.relation_openrv)(tr,rr),Module._errdetail_relkind_not_supported=tr=>(Module._errdetail_relkind_not_supported=wasmExports.errdetail_relkind_not_supported)(tr),Module._object_aclcheck=(tr,rr,ir,lr)=>(Module._object_aclcheck=wasmExports.object_aclcheck)(tr,rr,ir,lr),Module._aclcheck_error=(tr,rr,ir)=>(Module._aclcheck_error=wasmExports.aclcheck_error)(tr,rr,ir),Module._pg_class_aclcheck=(tr,rr,ir)=>(Module._pg_class_aclcheck=wasmExports.pg_class_aclcheck)(tr,rr,ir),Module._get_relkind_objtype=tr=>(Module._get_relkind_objtype=wasmExports.get_relkind_objtype)(tr),Module._list_make3_impl=(tr,rr,ir,lr)=>(Module._list_make3_impl=wasmExports.list_make3_impl)(tr,rr,ir,lr),Module._quote_qualified_identifier=(tr,rr)=>(Module._quote_qualified_identifier=wasmExports.quote_qualified_identifier)(tr,rr),Module._table_openrv=(tr,rr)=>(Module._table_openrv=wasmExports.table_openrv)(tr,rr),Module._equal=(tr,rr)=>(Module._equal=wasmExports.equal)(tr,rr),Module._RelationGetIndexList=tr=>(Module._RelationGetIndexList=wasmExports.RelationGetIndexList)(tr),Module._pg_detoast_datum=tr=>(Module._pg_detoast_datum=wasmExports.pg_detoast_datum)(tr),Module._SysCacheGetAttr=(tr,rr,ir,lr)=>(Module._SysCacheGetAttr=wasmExports.SysCacheGetAttr)(tr,rr,ir,lr),Module._deconstruct_array_builtin=(tr,rr,ir,lr,dr)=>(Module._deconstruct_array_builtin=wasmExports.deconstruct_array_builtin)(tr,rr,ir,lr,dr),Module._untransformRelOptions=tr=>(Module._untransformRelOptions=wasmExports.untransformRelOptions)(tr),Module._transformExpr=(tr,rr,ir)=>(Module._transformExpr=wasmExports.transformExpr)(tr,rr,ir),Module._get_rel_namespace=tr=>(Module._get_rel_namespace=wasmExports.get_rel_namespace)(tr),Module._get_rel_name=tr=>(Module._get_rel_name=wasmExports.get_rel_name)(tr),Module._makeRangeVar=(tr,rr,ir)=>(Module._makeRangeVar=wasmExports.makeRangeVar)(tr,rr,ir),Module._makeDefElem=(tr,rr,ir)=>(Module._makeDefElem=wasmExports.makeDefElem)(tr,rr,ir),Module._makeRangeVarFromNameList=tr=>(Module._makeRangeVarFromNameList=wasmExports.makeRangeVarFromNameList)(tr),Module._coerce_to_target_type=(tr,rr,ir,lr,dr,fr,hr,mr)=>(Module._coerce_to_target_type=wasmExports.coerce_to_target_type)(tr,rr,ir,lr,dr,fr,hr,mr),Module._LookupTypeName=(tr,rr,ir,lr)=>(Module._LookupTypeName=wasmExports.LookupTypeName)(tr,rr,ir,lr),Module._GetSysCacheOid=(tr,rr,ir,lr,dr,fr)=>(Module._GetSysCacheOid=wasmExports.GetSysCacheOid)(tr,rr,ir,lr,dr,fr),Module._construct_array_builtin=(tr,rr,ir)=>(Module._construct_array_builtin=wasmExports.construct_array_builtin)(tr,rr,ir),Module._get_collation_oid=(tr,rr)=>(Module._get_collation_oid=wasmExports.get_collation_oid)(tr,rr),Module._typeStringToTypeName=(tr,rr)=>(Module._typeStringToTypeName=wasmExports.typeStringToTypeName)(tr,rr),Module._raw_parser=(tr,rr)=>(Module._raw_parser=wasmExports.raw_parser)(tr,rr),Module._errsave_start=(tr,rr)=>(Module._errsave_start=wasmExports.errsave_start)(tr,rr),Module._errsave_finish=(tr,rr,ir,lr)=>(Module._errsave_finish=wasmExports.errsave_finish)(tr,rr,ir,lr),Module._defGetBoolean=tr=>(Module._defGetBoolean=wasmExports.defGetBoolean)(tr),Module._list_delete_last=tr=>(Module._list_delete_last=wasmExports.list_delete_last)(tr),Module._format_type_with_typemod=(tr,rr)=>(Module._format_type_with_typemod=wasmExports.format_type_with_typemod)(tr,rr),Module._list_member=(tr,rr)=>(Module._list_member=wasmExports.list_member)(tr,rr),Module._list_member_int=(tr,rr)=>(Module._list_member_int=wasmExports.list_member_int)(tr,rr),Module._list_sort=(tr,rr)=>(Module._list_sort=wasmExports.list_sort)(tr,rr),Module._get_element_type=tr=>(Module._get_element_type=wasmExports.get_element_type)(tr),Module._makeBoolean=tr=>(Module._makeBoolean=wasmExports.makeBoolean)(tr),Module._makeInteger=tr=>(Module._makeInteger=wasmExports.makeInteger)(tr),Module._makeTypeName=tr=>(Module._makeTypeName=wasmExports.makeTypeName)(tr),Module._list_make4_impl=(tr,rr,ir,lr,dr)=>(Module._list_make4_impl=wasmExports.list_make4_impl)(tr,rr,ir,lr,dr),Module._isxdigit=tr=>(Module._isxdigit=wasmExports.isxdigit)(tr),Module._strip_implicit_coercions=tr=>(Module._strip_implicit_coercions=wasmExports.strip_implicit_coercions)(tr),Module._SearchSysCacheList=(tr,rr,ir,lr,dr)=>(Module._SearchSysCacheList=wasmExports.SearchSysCacheList)(tr,rr,ir,lr,dr),Module._ReleaseCatCacheList=tr=>(Module._ReleaseCatCacheList=wasmExports.ReleaseCatCacheList)(tr),Module._get_sortgroupref_tle=(tr,rr)=>(Module._get_sortgroupref_tle=wasmExports.get_sortgroupref_tle)(tr,rr),Module._type_is_rowtype=tr=>(Module._type_is_rowtype=wasmExports.type_is_rowtype)(tr),Module._bms_next_member=(tr,rr)=>(Module._bms_next_member=wasmExports.bms_next_member)(tr,rr),Module._MemoryContextReset=tr=>(Module._MemoryContextReset=wasmExports.MemoryContextReset)(tr),Module._abort=()=>(Module._abort=wasmExports.abort)(),Module._heap_getnext=(tr,rr)=>(Module._heap_getnext=wasmExports.heap_getnext)(tr,rr),Module._OidOutputFunctionCall=(tr,rr)=>(Module._OidOutputFunctionCall=wasmExports.OidOutputFunctionCall)(tr,rr),Module._atoi=tr=>(Module._atoi=wasmExports.atoi)(tr),Module._GetConfigOption=(tr,rr,ir)=>(Module._GetConfigOption=wasmExports.GetConfigOption)(tr,rr,ir),Module._pg_strong_random=(tr,rr)=>(Module._pg_strong_random=wasmExports.pg_strong_random)(tr,rr),Module._pg_prng_seed_check=tr=>(Module._pg_prng_seed_check=wasmExports.pg_prng_seed_check)(tr),Module._pg_prng_seed=(tr,rr)=>(Module._pg_prng_seed=wasmExports.pg_prng_seed)(tr,rr),Module._fputc=(tr,rr)=>(Module._fputc=wasmExports.fputc)(tr,rr),Module._time=tr=>(Module._time=wasmExports.time)(tr),Module._TimestampDifferenceMilliseconds=(tr,rr)=>(Module._TimestampDifferenceMilliseconds=wasmExports.TimestampDifferenceMilliseconds)(tr,rr),Module._ProcessConfigFile=tr=>(Module._ProcessConfigFile=wasmExports.ProcessConfigFile)(tr),Module._send=(tr,rr,ir,lr)=>(Module._send=wasmExports.send)(tr,rr,ir,lr),Module._parse_bool=(tr,rr)=>(Module._parse_bool=wasmExports.parse_bool)(tr,rr),Module._enlargeStringInfo=(tr,rr)=>(Module._enlargeStringInfo=wasmExports.enlargeStringInfo)(tr,rr),Module._BackgroundWorkerInitializeConnectionByOid=(tr,rr,ir)=>(Module._BackgroundWorkerInitializeConnectionByOid=wasmExports.BackgroundWorkerInitializeConnectionByOid)(tr,rr,ir),Module._BackgroundWorkerUnblockSignals=()=>(Module._BackgroundWorkerUnblockSignals=wasmExports.BackgroundWorkerUnblockSignals)(),Module._pg_getnameinfo_all=(tr,rr,ir,lr,dr,fr,hr)=>(Module._pg_getnameinfo_all=wasmExports.pg_getnameinfo_all)(tr,rr,ir,lr,dr,fr,hr),Module._gai_strerror=tr=>(Module._gai_strerror=wasmExports.gai_strerror)(tr),Module._SignalHandlerForConfigReload=tr=>(Module._SignalHandlerForConfigReload=wasmExports.SignalHandlerForConfigReload)(tr),Module._fwrite=(tr,rr,ir,lr)=>(Module._fwrite=wasmExports.fwrite)(tr,rr,ir,lr),Module._SignalHandlerForShutdownRequest=tr=>(Module._SignalHandlerForShutdownRequest=wasmExports.SignalHandlerForShutdownRequest)(tr),Module._EmitErrorReport=()=>(Module._EmitErrorReport=wasmExports.EmitErrorReport)(),Module._FlushErrorState=()=>(Module._FlushErrorState=wasmExports.FlushErrorState)(),Module._die=tr=>(Module._die=wasmExports.die)(tr),Module._MultiXactIdPrecedes=(tr,rr)=>(Module._MultiXactIdPrecedes=wasmExports.MultiXactIdPrecedes)(tr,rr),Module._CreateTupleDescCopy=tr=>(Module._CreateTupleDescCopy=wasmExports.CreateTupleDescCopy)(tr),Module._pgstat_report_activity=(tr,rr)=>(Module._pgstat_report_activity=wasmExports.pgstat_report_activity)(tr,rr),Module._DirectFunctionCall2Coll=(tr,rr,ir,lr)=>(Module._DirectFunctionCall2Coll=wasmExports.DirectFunctionCall2Coll)(tr,rr,ir,lr),Module._RegisterBackgroundWorker=tr=>(Module._RegisterBackgroundWorker=wasmExports.RegisterBackgroundWorker)(tr),Module._RegisterDynamicBackgroundWorker=(tr,rr)=>(Module._RegisterDynamicBackgroundWorker=wasmExports.RegisterDynamicBackgroundWorker)(tr,rr),Module._WaitForBackgroundWorkerStartup=(tr,rr)=>(Module._WaitForBackgroundWorkerStartup=wasmExports.WaitForBackgroundWorkerStartup)(tr,rr),Module._WaitForBackgroundWorkerShutdown=tr=>(Module._WaitForBackgroundWorkerShutdown=wasmExports.WaitForBackgroundWorkerShutdown)(tr),Module._GetXLogReplayRecPtr=tr=>(Module._GetXLogReplayRecPtr=wasmExports.GetXLogReplayRecPtr)(tr),Module._gettimeofday=(tr,rr)=>(Module._gettimeofday=wasmExports.gettimeofday)(tr,rr),Module._sscanf=(tr,rr,ir)=>(Module._sscanf=wasmExports.sscanf)(tr,rr,ir),Module._get_call_result_type=(tr,rr,ir)=>(Module._get_call_result_type=wasmExports.get_call_result_type)(tr,rr,ir),Module._HeapTupleHeaderGetDatum=tr=>(Module._HeapTupleHeaderGetDatum=wasmExports.HeapTupleHeaderGetDatum)(tr),Module._wal_segment_close=tr=>(Module._wal_segment_close=wasmExports.wal_segment_close)(tr),Module._wal_segment_open=(tr,rr,ir)=>(Module._wal_segment_open=wasmExports.wal_segment_open)(tr,rr,ir),Module._GetFlushRecPtr=tr=>(Module._GetFlushRecPtr=wasmExports.GetFlushRecPtr)(tr),Module._XLogReadRecord=(tr,rr)=>(Module._XLogReadRecord=wasmExports.XLogReadRecord)(tr,rr),Module._RmgrNotFound=tr=>(Module._RmgrNotFound=wasmExports.RmgrNotFound)(tr),Module._CacheRegisterRelcacheCallback=(tr,rr)=>(Module._CacheRegisterRelcacheCallback=wasmExports.CacheRegisterRelcacheCallback)(tr,rr),Module._free_attrmap=tr=>(Module._free_attrmap=wasmExports.free_attrmap)(tr),Module._BuildIndexInfo=tr=>(Module._BuildIndexInfo=wasmExports.BuildIndexInfo)(tr),Module._hash_seq_term=tr=>(Module._hash_seq_term=wasmExports.hash_seq_term)(tr),Module._PushActiveSnapshot=tr=>(Module._PushActiveSnapshot=wasmExports.PushActiveSnapshot)(tr),Module._PopActiveSnapshot=()=>(Module._PopActiveSnapshot=wasmExports.PopActiveSnapshot)(),Module._MakePerTupleExprContext=tr=>(Module._MakePerTupleExprContext=wasmExports.MakePerTupleExprContext)(tr),Module._ExecInitExpr=(tr,rr)=>(Module._ExecInitExpr=wasmExports.ExecInitExpr)(tr,rr),Module._FreeExecutorState=tr=>(Module._FreeExecutorState=wasmExports.FreeExecutorState)(tr),Module._list_member_oid=(tr,rr)=>(Module._list_member_oid=wasmExports.list_member_oid)(tr,rr),Module._MemoryContextStrdup=(tr,rr)=>(Module._MemoryContextStrdup=wasmExports.MemoryContextStrdup)(tr,rr),Module._pq_getmsgint=(tr,rr)=>(Module._pq_getmsgint=wasmExports.pq_getmsgint)(tr,rr),Module._CreateExecutorState=()=>(Module._CreateExecutorState=wasmExports.CreateExecutorState)(),Module._ExecInitRangeTable=(tr,rr,ir)=>(Module._ExecInitRangeTable=wasmExports.ExecInitRangeTable)(tr,rr,ir),Module._getTypeInputInfo=(tr,rr,ir)=>(Module._getTypeInputInfo=wasmExports.getTypeInputInfo)(tr,rr,ir),Module._ExecStoreVirtualTuple=tr=>(Module._ExecStoreVirtualTuple=wasmExports.ExecStoreVirtualTuple)(tr),Module._execute_attr_map_slot=(tr,rr,ir)=>(Module._execute_attr_map_slot=wasmExports.execute_attr_map_slot)(tr,rr,ir),Module._slot_getsomeattrs_int=(tr,rr)=>(Module._slot_getsomeattrs_int=wasmExports.slot_getsomeattrs_int)(tr,rr),Module._GetUserNameFromId=(tr,rr)=>(Module._GetUserNameFromId=wasmExports.GetUserNameFromId)(tr,rr),Module._makeStringInfo=()=>(Module._makeStringInfo=wasmExports.makeStringInfo)(),Module._list_member_xid=(tr,rr)=>(Module._list_member_xid=wasmExports.list_member_xid)(tr,rr),Module._lappend_xid=(tr,rr)=>(Module._lappend_xid=wasmExports.lappend_xid)(tr,rr),Module._tuplestore_end=tr=>(Module._tuplestore_end=wasmExports.tuplestore_end)(tr),Module._quote_literal_cstr=tr=>(Module._quote_literal_cstr=wasmExports.quote_literal_cstr)(tr),Module._MakeSingleTupleTableSlot=(tr,rr)=>(Module._MakeSingleTupleTableSlot=wasmExports.MakeSingleTupleTableSlot)(tr,rr),Module._ExecDropSingleTupleTableSlot=tr=>(Module._ExecDropSingleTupleTableSlot=wasmExports.ExecDropSingleTupleTableSlot)(tr),Module._tuplestore_tuple_count=tr=>(Module._tuplestore_tuple_count=wasmExports.tuplestore_tuple_count)(tr),Module._quote_identifier=tr=>(Module._quote_identifier=wasmExports.quote_identifier)(tr),Module._BeginCopyFrom=(tr,rr,ir,lr,dr,fr,hr,mr)=>(Module._BeginCopyFrom=wasmExports.BeginCopyFrom)(tr,rr,ir,lr,dr,fr,hr,mr),Module._array_contains_nulls=tr=>(Module._array_contains_nulls=wasmExports.array_contains_nulls)(tr),Module._format_procedure=tr=>(Module._format_procedure=wasmExports.format_procedure)(tr),Module._pg_detoast_datum_packed=tr=>(Module._pg_detoast_datum_packed=wasmExports.pg_detoast_datum_packed)(tr),Module._cstring_to_text_with_len=(tr,rr)=>(Module._cstring_to_text_with_len=wasmExports.cstring_to_text_with_len)(tr,rr),Module._GenerationContextCreate=(tr,rr,ir,lr,dr)=>(Module._GenerationContextCreate=wasmExports.GenerationContextCreate)(tr,rr,ir,lr,dr),Module._BeginInternalSubTransaction=tr=>(Module._BeginInternalSubTransaction=wasmExports.BeginInternalSubTransaction)(tr),Module._RollbackAndReleaseCurrentSubTransaction=()=>(Module._RollbackAndReleaseCurrentSubTransaction=wasmExports.RollbackAndReleaseCurrentSubTransaction)(),Module._CopyErrorData=()=>(Module._CopyErrorData=wasmExports.CopyErrorData)(),Module._FreeErrorData=tr=>(Module._FreeErrorData=wasmExports.FreeErrorData)(tr),Module._RelidByRelfilenumber=(tr,rr)=>(Module._RelidByRelfilenumber=wasmExports.RelidByRelfilenumber)(tr,rr),Module._RelationIdGetRelation=tr=>(Module._RelationIdGetRelation=wasmExports.RelationIdGetRelation)(tr),Module._heap_deform_tuple=(tr,rr,ir,lr)=>(Module._heap_deform_tuple=wasmExports.heap_deform_tuple)(tr,rr,ir,lr),Module._RelationClose=tr=>(Module._RelationClose=wasmExports.RelationClose)(tr),Module._nocachegetattr=(tr,rr,ir)=>(Module._nocachegetattr=wasmExports.nocachegetattr)(tr,rr,ir),Module._XLogReaderAllocate=(tr,rr,ir,lr)=>(Module._XLogReaderAllocate=wasmExports.XLogReaderAllocate)(tr,rr,ir,lr),Module._XLogReaderFree=tr=>(Module._XLogReaderFree=wasmExports.XLogReaderFree)(tr),Module._OutputPluginPrepareWrite=(tr,rr)=>(Module._OutputPluginPrepareWrite=wasmExports.OutputPluginPrepareWrite)(tr,rr),Module._OutputPluginWrite=(tr,rr)=>(Module._OutputPluginWrite=wasmExports.OutputPluginWrite)(tr,rr),Module._OutputPluginUpdateProgress=(tr,rr)=>(Module._OutputPluginUpdateProgress=wasmExports.OutputPluginUpdateProgress)(tr,rr),Module._replorigin_by_oid=(tr,rr,ir)=>(Module._replorigin_by_oid=wasmExports.replorigin_by_oid)(tr,rr,ir),Module._logicalrep_write_begin=(tr,rr)=>(Module._logicalrep_write_begin=wasmExports.logicalrep_write_begin)(tr,rr),Module._logicalrep_write_commit=(tr,rr,ir)=>(Module._logicalrep_write_commit=wasmExports.logicalrep_write_commit)(tr,rr,ir),Module._logicalrep_write_begin_prepare=(tr,rr)=>(Module._logicalrep_write_begin_prepare=wasmExports.logicalrep_write_begin_prepare)(tr,rr),Module._logicalrep_write_prepare=(tr,rr,ir)=>(Module._logicalrep_write_prepare=wasmExports.logicalrep_write_prepare)(tr,rr,ir),Module._logicalrep_write_commit_prepared=(tr,rr,ir)=>(Module._logicalrep_write_commit_prepared=wasmExports.logicalrep_write_commit_prepared)(tr,rr,ir),Module._logicalrep_write_rollback_prepared=(tr,rr,ir,lr)=>(Module._logicalrep_write_rollback_prepared=wasmExports.logicalrep_write_rollback_prepared)(tr,rr,ir,lr),Module._logicalrep_write_stream_prepare=(tr,rr,ir)=>(Module._logicalrep_write_stream_prepare=wasmExports.logicalrep_write_stream_prepare)(tr,rr,ir),Module._logicalrep_write_origin=(tr,rr,ir)=>(Module._logicalrep_write_origin=wasmExports.logicalrep_write_origin)(tr,rr,ir),Module._logicalrep_write_insert=(tr,rr,ir,lr,dr,fr)=>(Module._logicalrep_write_insert=wasmExports.logicalrep_write_insert)(tr,rr,ir,lr,dr,fr),Module._logicalrep_write_update=(tr,rr,ir,lr,dr,fr,hr)=>(Module._logicalrep_write_update=wasmExports.logicalrep_write_update)(tr,rr,ir,lr,dr,fr,hr),Module._logicalrep_write_delete=(tr,rr,ir,lr,dr,fr)=>(Module._logicalrep_write_delete=wasmExports.logicalrep_write_delete)(tr,rr,ir,lr,dr,fr),Module._logicalrep_write_truncate=(tr,rr,ir,lr,dr,fr)=>(Module._logicalrep_write_truncate=wasmExports.logicalrep_write_truncate)(tr,rr,ir,lr,dr,fr),Module._logicalrep_write_message=(tr,rr,ir,lr,dr,fr,hr)=>(Module._logicalrep_write_message=wasmExports.logicalrep_write_message)(tr,rr,ir,lr,dr,fr,hr),Module._logicalrep_write_rel=(tr,rr,ir,lr)=>(Module._logicalrep_write_rel=wasmExports.logicalrep_write_rel)(tr,rr,ir,lr),Module._logicalrep_write_typ=(tr,rr,ir)=>(Module._logicalrep_write_typ=wasmExports.logicalrep_write_typ)(tr,rr,ir),Module._logicalrep_write_stream_start=(tr,rr,ir)=>(Module._logicalrep_write_stream_start=wasmExports.logicalrep_write_stream_start)(tr,rr,ir),Module._logicalrep_write_stream_stop=tr=>(Module._logicalrep_write_stream_stop=wasmExports.logicalrep_write_stream_stop)(tr),Module._logicalrep_write_stream_commit=(tr,rr,ir)=>(Module._logicalrep_write_stream_commit=wasmExports.logicalrep_write_stream_commit)(tr,rr,ir),Module._logicalrep_write_stream_abort=(tr,rr,ir,lr,dr,fr)=>(Module._logicalrep_write_stream_abort=wasmExports.logicalrep_write_stream_abort)(tr,rr,ir,lr,dr,fr),Module._ProcessWalRcvInterrupts=()=>(Module._ProcessWalRcvInterrupts=wasmExports.ProcessWalRcvInterrupts)(),Module._timestamptz_to_str=tr=>(Module._timestamptz_to_str=wasmExports.timestamptz_to_str)(tr),Module._GetDatabaseEncodingName=()=>(Module._GetDatabaseEncodingName=wasmExports.GetDatabaseEncodingName)(),Module._PQconnectStartParams=(tr,rr,ir)=>(Module._PQconnectStartParams=wasmExports.PQconnectStartParams)(tr,rr,ir),Module._PQstatus=tr=>(Module._PQstatus=wasmExports.PQstatus)(tr),Module._PQsocket=tr=>(Module._PQsocket=wasmExports.PQsocket)(tr),Module._PQconnectPoll=tr=>(Module._PQconnectPoll=wasmExports.PQconnectPoll)(tr),Module._PQconnectionUsedPassword=tr=>(Module._PQconnectionUsedPassword=wasmExports.PQconnectionUsedPassword)(tr),Module._PQfinish=tr=>(Module._PQfinish=wasmExports.PQfinish)(tr),Module._PQresultStatus=tr=>(Module._PQresultStatus=wasmExports.PQresultStatus)(tr),Module._PQclear=tr=>(Module._PQclear=wasmExports.PQclear)(tr),Module._PQerrorMessage=tr=>(Module._PQerrorMessage=wasmExports.PQerrorMessage)(tr),Module._pchomp=tr=>(Module._pchomp=wasmExports.pchomp)(tr),Module._PQnfields=tr=>(Module._PQnfields=wasmExports.PQnfields)(tr),Module._PQntuples=tr=>(Module._PQntuples=wasmExports.PQntuples)(tr),Module._PQgetvalue=(tr,rr,ir)=>(Module._PQgetvalue=wasmExports.PQgetvalue)(tr,rr,ir),Module._pg_strtoint32=tr=>(Module._pg_strtoint32=wasmExports.pg_strtoint32)(tr),Module._PQconsumeInput=tr=>(Module._PQconsumeInput=wasmExports.PQconsumeInput)(tr),Module._pg_lsn_in=tr=>(Module._pg_lsn_in=wasmExports.pg_lsn_in)(tr),Module._DirectFunctionCall1Coll=(tr,rr,ir)=>(Module._DirectFunctionCall1Coll=wasmExports.DirectFunctionCall1Coll)(tr,rr,ir),Module._PQgetisnull=(tr,rr,ir)=>(Module._PQgetisnull=wasmExports.PQgetisnull)(tr,rr,ir),Module._tuplestore_begin_heap=(tr,rr,ir)=>(Module._tuplestore_begin_heap=wasmExports.tuplestore_begin_heap)(tr,rr,ir),Module._TupleDescGetAttInMetadata=tr=>(Module._TupleDescGetAttInMetadata=wasmExports.TupleDescGetAttInMetadata)(tr),Module._BuildTupleFromCStrings=(tr,rr)=>(Module._BuildTupleFromCStrings=wasmExports.BuildTupleFromCStrings)(tr,rr),Module._tuplestore_puttuple=(tr,rr)=>(Module._tuplestore_puttuple=wasmExports.tuplestore_puttuple)(tr,rr),Module._PQresultErrorField=(tr,rr)=>(Module._PQresultErrorField=wasmExports.PQresultErrorField)(tr,rr),Module._PQsendQuery=(tr,rr)=>(Module._PQsendQuery=wasmExports.PQsendQuery)(tr,rr),Module._PQisBusy=tr=>(Module._PQisBusy=wasmExports.PQisBusy)(tr),Module._PQgetResult=tr=>(Module._PQgetResult=wasmExports.PQgetResult)(tr),Module._ResourceOwnerDelete=tr=>(Module._ResourceOwnerDelete=wasmExports.ResourceOwnerDelete)(tr),Module._CreateDestReceiver=tr=>(Module._CreateDestReceiver=wasmExports.CreateDestReceiver)(tr),Module._defGetString=tr=>(Module._defGetString=wasmExports.defGetString)(tr),Module._pg_md5_encrypt=(tr,rr,ir,lr,dr)=>(Module._pg_md5_encrypt=wasmExports.pg_md5_encrypt)(tr,rr,ir,lr,dr),Module._plain_crypt_verify=(tr,rr,ir,lr)=>(Module._plain_crypt_verify=wasmExports.plain_crypt_verify)(tr,rr,ir,lr),Module._pg_b64_enc_len=tr=>(Module._pg_b64_enc_len=wasmExports.pg_b64_enc_len)(tr),Module._pg_b64_encode=(tr,rr,ir,lr)=>(Module._pg_b64_encode=wasmExports.pg_b64_encode)(tr,rr,ir,lr),Module._pg_b64_dec_len=tr=>(Module._pg_b64_dec_len=wasmExports.pg_b64_dec_len)(tr),Module._pg_b64_decode=(tr,rr,ir,lr)=>(Module._pg_b64_decode=wasmExports.pg_b64_decode)(tr,rr,ir,lr),Module._pg_hmac_create=tr=>(Module._pg_hmac_create=wasmExports.pg_hmac_create)(tr),Module._pg_hmac_init=(tr,rr,ir)=>(Module._pg_hmac_init=wasmExports.pg_hmac_init)(tr,rr,ir),Module._pg_hmac_update=(tr,rr,ir)=>(Module._pg_hmac_update=wasmExports.pg_hmac_update)(tr,rr,ir),Module._pg_hmac_final=(tr,rr,ir)=>(Module._pg_hmac_final=wasmExports.pg_hmac_final)(tr,rr,ir),Module._pg_hmac_error=tr=>(Module._pg_hmac_error=wasmExports.pg_hmac_error)(tr),Module._pg_hmac_free=tr=>(Module._pg_hmac_free=wasmExports.pg_hmac_free)(tr),Module._scram_H=(tr,rr,ir,lr,dr)=>(Module._scram_H=wasmExports.scram_H)(tr,rr,ir,lr,dr),Module._pg_saslprep=(tr,rr)=>(Module._pg_saslprep=wasmExports.pg_saslprep)(tr,rr),Module._scram_build_secret=(tr,rr,ir,lr,dr,fr,hr)=>(Module._scram_build_secret=wasmExports.scram_build_secret)(tr,rr,ir,lr,dr,fr,hr),Module._scram_SaltedPassword=(tr,rr,ir,lr,dr,fr,hr,mr)=>(Module._scram_SaltedPassword=wasmExports.scram_SaltedPassword)(tr,rr,ir,lr,dr,fr,hr,mr),Module._scram_ServerKey=(tr,rr,ir,lr,dr)=>(Module._scram_ServerKey=wasmExports.scram_ServerKey)(tr,rr,ir,lr,dr),Module._strtol=(tr,rr,ir)=>(Module._strtol=wasmExports.strtol)(tr,rr,ir),Module._replace_percent_placeholders=(tr,rr,ir,lr)=>(Module._replace_percent_placeholders=wasmExports.replace_percent_placeholders)(tr,rr,ir,lr),Module._fgets=(tr,rr,ir)=>(Module._fgets=wasmExports.fgets)(tr,rr,ir),Module._explicit_bzero=(tr,rr)=>(Module._explicit_bzero=wasmExports.explicit_bzero)(tr,rr),Module._wait_result_to_str=tr=>(Module._wait_result_to_str=wasmExports.wait_result_to_str)(tr),Module._pg_strip_crlf=tr=>(Module._pg_strip_crlf=wasmExports.pg_strip_crlf)(tr),Module._geteuid=()=>(Module._geteuid=wasmExports.geteuid)(),Module._getpeereid=(tr,rr,ir)=>(Module._getpeereid=wasmExports.getpeereid)(tr,rr,ir),Module._pg_getaddrinfo_all=(tr,rr,ir,lr)=>(Module._pg_getaddrinfo_all=wasmExports.pg_getaddrinfo_all)(tr,rr,ir,lr),Module._socket=(tr,rr,ir)=>(Module._socket=wasmExports.socket)(tr,rr,ir),Module._connect=(tr,rr,ir)=>(Module._connect=wasmExports.connect)(tr,rr,ir),Module._recv=(tr,rr,ir,lr)=>(Module._recv=wasmExports.recv)(tr,rr,ir,lr),Module._pg_freeaddrinfo_all=(tr,rr)=>(Module._pg_freeaddrinfo_all=wasmExports.pg_freeaddrinfo_all)(tr,rr),Module._pq_sendtext=(tr,rr,ir)=>(Module._pq_sendtext=wasmExports.pq_sendtext)(tr,rr,ir),Module._pq_sendfloat4=(tr,rr)=>(Module._pq_sendfloat4=wasmExports.pq_sendfloat4)(tr,rr),Module._pq_sendfloat8=(tr,rr)=>(Module._pq_sendfloat8=wasmExports.pq_sendfloat8)(tr,rr),Module._pq_begintypsend=tr=>(Module._pq_begintypsend=wasmExports.pq_begintypsend)(tr),Module._pq_endtypsend=tr=>(Module._pq_endtypsend=wasmExports.pq_endtypsend)(tr),Module._pq_getmsgfloat4=tr=>(Module._pq_getmsgfloat4=wasmExports.pq_getmsgfloat4)(tr),Module._pq_getmsgfloat8=tr=>(Module._pq_getmsgfloat8=wasmExports.pq_getmsgfloat8)(tr),Module._pq_getmsgtext=(tr,rr,ir)=>(Module._pq_getmsgtext=wasmExports.pq_getmsgtext)(tr,rr,ir),Module._feof=tr=>(Module._feof=wasmExports.feof)(tr),Module._pg_mb2wchar_with_len=(tr,rr,ir)=>(Module._pg_mb2wchar_with_len=wasmExports.pg_mb2wchar_with_len)(tr,rr,ir),Module._pg_regcomp=(tr,rr,ir,lr,dr)=>(Module._pg_regcomp=wasmExports.pg_regcomp)(tr,rr,ir,lr,dr),Module._pg_regerror=(tr,rr,ir,lr)=>(Module._pg_regerror=wasmExports.pg_regerror)(tr,rr,ir,lr),Module._get_role_oid=(tr,rr)=>(Module._get_role_oid=wasmExports.get_role_oid)(tr,rr),Module._strcat=(tr,rr)=>(Module._strcat=wasmExports.strcat)(tr,rr),Module._sigemptyset=tr=>(Module._sigemptyset=wasmExports.sigemptyset)(tr),Module._be_lo_unlink=tr=>(Module._be_lo_unlink=wasmExports.be_lo_unlink)(tr),Module._object_ownercheck=(tr,rr,ir)=>(Module._object_ownercheck=wasmExports.object_ownercheck)(tr,rr,ir),Module._text_to_cstring_buffer=(tr,rr,ir)=>(Module._text_to_cstring_buffer=wasmExports.text_to_cstring_buffer)(tr,rr,ir),Module._setsockopt=(tr,rr,ir,lr,dr)=>(Module._setsockopt=wasmExports.setsockopt)(tr,rr,ir,lr,dr),Module._getsockname=(tr,rr,ir)=>(Module._getsockname=wasmExports.getsockname)(tr,rr,ir),Module._pq_recvbuf_fill=(tr,rr)=>(Module._pq_recvbuf_fill=wasmExports.pq_recvbuf_fill)(tr,rr),Module._getsockopt=(tr,rr,ir,lr,dr)=>(Module._getsockopt=wasmExports.getsockopt)(tr,rr,ir,lr,dr),Module._getmissingattr=(tr,rr,ir)=>(Module._getmissingattr=wasmExports.getmissingattr)(tr,rr,ir),Module._get_rel_relkind=tr=>(Module._get_rel_relkind=wasmExports.get_rel_relkind)(tr),Module._MemoryContextSetIdentifier=(tr,rr)=>(Module._MemoryContextSetIdentifier=wasmExports.MemoryContextSetIdentifier)(tr,rr),Module._MemoryContextSetParent=(tr,rr)=>(Module._MemoryContextSetParent=wasmExports.MemoryContextSetParent)(tr,rr),Module._find_base_rel=(tr,rr)=>(Module._find_base_rel=wasmExports.find_base_rel)(tr,rr),Module._bms_equal=(tr,rr)=>(Module._bms_equal=wasmExports.bms_equal)(tr,rr),Module._bms_num_members=tr=>(Module._bms_num_members=wasmExports.bms_num_members)(tr),Module._fmgr_info_copy=(tr,rr,ir)=>(Module._fmgr_info_copy=wasmExports.fmgr_info_copy)(tr,rr,ir),Module._fmgr_info_cxt=(tr,rr,ir)=>(Module._fmgr_info_cxt=wasmExports.fmgr_info_cxt)(tr,rr,ir),Module._get_typlenbyvalalign=(tr,rr,ir,lr)=>(Module._get_typlenbyvalalign=wasmExports.get_typlenbyvalalign)(tr,rr,ir,lr),Module._deconstruct_array=(tr,rr,ir,lr,dr,fr,hr,mr)=>(Module._deconstruct_array=wasmExports.deconstruct_array)(tr,rr,ir,lr,dr,fr,hr,mr),Module._datumCopy=(tr,rr,ir)=>(Module._datumCopy=wasmExports.datumCopy)(tr,rr,ir),Module._qsort_arg=(tr,rr,ir,lr,dr)=>(Module._qsort_arg=wasmExports.qsort_arg)(tr,rr,ir,lr,dr),Module._FunctionCall2Coll=(tr,rr,ir,lr)=>(Module._FunctionCall2Coll=wasmExports.FunctionCall2Coll)(tr,rr,ir,lr),Module._datumIsEqual=(tr,rr,ir,lr)=>(Module._datumIsEqual=wasmExports.datumIsEqual)(tr,rr,ir,lr),Module._bms_overlap=(tr,rr)=>(Module._bms_overlap=wasmExports.bms_overlap)(tr,rr),Module._ExecPrepareExpr=(tr,rr)=>(Module._ExecPrepareExpr=wasmExports.ExecPrepareExpr)(tr,rr),Module._RegisterSnapshot=tr=>(Module._RegisterSnapshot=wasmExports.RegisterSnapshot)(tr),Module._UnregisterSnapshot=tr=>(Module._UnregisterSnapshot=wasmExports.UnregisterSnapshot)(tr),Module._get_fn_expr_argtype=(tr,rr)=>(Module._get_fn_expr_argtype=wasmExports.get_fn_expr_argtype)(tr,rr),Module._get_opfamily_member=(tr,rr,ir,lr)=>(Module._get_opfamily_member=wasmExports.get_opfamily_member)(tr,rr,ir,lr),Module._init_MultiFuncCall=tr=>(Module._init_MultiFuncCall=wasmExports.init_MultiFuncCall)(tr),Module._per_MultiFuncCall=tr=>(Module._per_MultiFuncCall=wasmExports.per_MultiFuncCall)(tr),Module._end_MultiFuncCall=(tr,rr)=>(Module._end_MultiFuncCall=wasmExports.end_MultiFuncCall)(tr,rr),Module._textToQualifiedNameList=tr=>(Module._textToQualifiedNameList=wasmExports.textToQualifiedNameList)(tr),Module._FunctionCall1Coll=(tr,rr,ir)=>(Module._FunctionCall1Coll=wasmExports.FunctionCall1Coll)(tr,rr,ir),Module._DirectFunctionCall4Coll=(tr,rr,ir,lr,dr,fr)=>(Module._DirectFunctionCall4Coll=wasmExports.DirectFunctionCall4Coll)(tr,rr,ir,lr,dr,fr),Module._pg_mblen=tr=>(Module._pg_mblen=wasmExports.pg_mblen)(tr),Module._tsearch_readline_begin=(tr,rr)=>(Module._tsearch_readline_begin=wasmExports.tsearch_readline_begin)(tr,rr),Module._tsearch_readline=tr=>(Module._tsearch_readline=wasmExports.tsearch_readline)(tr),Module._t_isspace=tr=>(Module._t_isspace=wasmExports.t_isspace)(tr),Module._lowerstr=tr=>(Module._lowerstr=wasmExports.lowerstr)(tr),Module._tsearch_readline_end=tr=>(Module._tsearch_readline_end=wasmExports.tsearch_readline_end)(tr),Module._t_isdigit=tr=>(Module._t_isdigit=wasmExports.t_isdigit)(tr),Module._pnstrdup=(tr,rr)=>(Module._pnstrdup=wasmExports.pnstrdup)(tr,rr),Module._get_tsearch_config_filename=(tr,rr)=>(Module._get_tsearch_config_filename=wasmExports.get_tsearch_config_filename)(tr,rr),Module._lookup_ts_dictionary_cache=tr=>(Module._lookup_ts_dictionary_cache=wasmExports.lookup_ts_dictionary_cache)(tr),Module._FunctionCall4Coll=(tr,rr,ir,lr,dr,fr)=>(Module._FunctionCall4Coll=wasmExports.FunctionCall4Coll)(tr,rr,ir,lr,dr,fr),Module._t_isalnum=tr=>(Module._t_isalnum=wasmExports.t_isalnum)(tr),Module._isalnum=tr=>(Module._isalnum=wasmExports.isalnum)(tr),Module._pg_any_to_server=(tr,rr,ir)=>(Module._pg_any_to_server=wasmExports.pg_any_to_server)(tr,rr,ir),Module._lowerstr_with_len=(tr,rr)=>(Module._lowerstr_with_len=wasmExports.lowerstr_with_len)(tr,rr),Module._tolower=tr=>(Module._tolower=wasmExports.tolower)(tr),Module._readstoplist=(tr,rr,ir)=>(Module._readstoplist=wasmExports.readstoplist)(tr,rr,ir),Module._searchstoplist=(tr,rr)=>(Module._searchstoplist=wasmExports.searchstoplist)(tr,rr),Module._GetDatabaseEncoding=()=>(Module._GetDatabaseEncoding=wasmExports.GetDatabaseEncoding)(),Module._vacuum_delay_point=()=>(Module._vacuum_delay_point=wasmExports.vacuum_delay_point)(),Module._get_restriction_variable=(tr,rr,ir,lr,dr,fr)=>(Module._get_restriction_variable=wasmExports.get_restriction_variable)(tr,rr,ir,lr,dr,fr),Module._get_attstatsslot=(tr,rr,ir,lr,dr)=>(Module._get_attstatsslot=wasmExports.get_attstatsslot)(tr,rr,ir,lr,dr),Module._free_attstatsslot=tr=>(Module._free_attstatsslot=wasmExports.free_attstatsslot)(tr),Module._Float8GetDatum=tr=>(Module._Float8GetDatum=wasmExports.Float8GetDatum)(tr),Module._ExecReScan=tr=>(Module._ExecReScan=wasmExports.ExecReScan)(tr),Module._ExecAsyncResponse=tr=>(Module._ExecAsyncResponse=wasmExports.ExecAsyncResponse)(tr),Module._ExecAsyncRequestDone=(tr,rr)=>(Module._ExecAsyncRequestDone=wasmExports.ExecAsyncRequestDone)(tr,rr),Module._ExecAsyncRequestPending=tr=>(Module._ExecAsyncRequestPending=wasmExports.ExecAsyncRequestPending)(tr),Module._tuplesort_end=tr=>(Module._tuplesort_end=wasmExports.tuplesort_end)(tr),Module._ExecInitExprList=(tr,rr)=>(Module._ExecInitExprList=wasmExports.ExecInitExprList)(tr,rr),Module._fmgr_info=(tr,rr)=>(Module._fmgr_info=wasmExports.fmgr_info)(tr,rr),Module._get_typlenbyval=(tr,rr,ir)=>(Module._get_typlenbyval=wasmExports.get_typlenbyval)(tr,rr,ir),Module._ExecForceStoreHeapTuple=(tr,rr,ir)=>(Module._ExecForceStoreHeapTuple=wasmExports.ExecForceStoreHeapTuple)(tr,rr,ir),Module._tuplesort_performsort=tr=>(Module._tuplesort_performsort=wasmExports.tuplesort_performsort)(tr),Module._tuplesort_begin_heap=(tr,rr,ir,lr,dr,fr,hr,mr,gr)=>(Module._tuplesort_begin_heap=wasmExports.tuplesort_begin_heap)(tr,rr,ir,lr,dr,fr,hr,mr,gr),Module._MemoryContextMemAllocated=(tr,rr)=>(Module._MemoryContextMemAllocated=wasmExports.MemoryContextMemAllocated)(tr,rr),Module._tuplesort_gettupleslot=(tr,rr,ir,lr,dr)=>(Module._tuplesort_gettupleslot=wasmExports.tuplesort_gettupleslot)(tr,rr,ir,lr,dr),Module._tuplesort_puttupleslot=(tr,rr)=>(Module._tuplesort_puttupleslot=wasmExports.tuplesort_puttupleslot)(tr,rr),Module._ExecStoreAllNullTuple=tr=>(Module._ExecStoreAllNullTuple=wasmExports.ExecStoreAllNullTuple)(tr),Module._MakeExpandedObjectReadOnlyInternal=tr=>(Module._MakeExpandedObjectReadOnlyInternal=wasmExports.MakeExpandedObjectReadOnlyInternal)(tr),Module._BlessTupleDesc=tr=>(Module._BlessTupleDesc=wasmExports.BlessTupleDesc)(tr),Module._pg_detoast_datum_copy=tr=>(Module._pg_detoast_datum_copy=wasmExports.pg_detoast_datum_copy)(tr),Module._construct_md_array=(tr,rr,ir,lr,dr,fr,hr,mr,gr)=>(Module._construct_md_array=wasmExports.construct_md_array)(tr,rr,ir,lr,dr,fr,hr,mr,gr),Module._ArrayGetNItems=(tr,rr)=>(Module._ArrayGetNItems=wasmExports.ArrayGetNItems)(tr,rr),Module._construct_empty_array=tr=>(Module._construct_empty_array=wasmExports.construct_empty_array)(tr),Module._DatumGetEOHP=tr=>(Module._DatumGetEOHP=wasmExports.DatumGetEOHP)(tr),Module._expanded_record_fetch_tupdesc=tr=>(Module._expanded_record_fetch_tupdesc=wasmExports.expanded_record_fetch_tupdesc)(tr),Module._expanded_record_fetch_field=(tr,rr,ir)=>(Module._expanded_record_fetch_field=wasmExports.expanded_record_fetch_field)(tr,rr,ir),Module._execute_attr_map_tuple=(tr,rr)=>(Module._execute_attr_map_tuple=wasmExports.execute_attr_map_tuple)(tr,rr),Module._MemoryContextAllocExtended=(tr,rr,ir)=>(Module._MemoryContextAllocExtended=wasmExports.MemoryContextAllocExtended)(tr,rr,ir),Module._lookup_rowtype_tupdesc_domain=(tr,rr,ir)=>(Module._lookup_rowtype_tupdesc_domain=wasmExports.lookup_rowtype_tupdesc_domain)(tr,rr,ir),Module._MemoryContextGetParent=tr=>(Module._MemoryContextGetParent=wasmExports.MemoryContextGetParent)(tr),Module._DeleteExpandedObject=tr=>(Module._DeleteExpandedObject=wasmExports.DeleteExpandedObject)(tr),Module._InstrAlloc=(tr,rr,ir)=>(Module._InstrAlloc=wasmExports.InstrAlloc)(tr,rr,ir),Module._ExprEvalPushStep=(tr,rr)=>(Module._ExprEvalPushStep=wasmExports.ExprEvalPushStep)(tr,rr),Module._getTypeOutputInfo=(tr,rr,ir)=>(Module._getTypeOutputInfo=wasmExports.getTypeOutputInfo)(tr,rr,ir),Module._ExecInitExprWithParams=(tr,rr)=>(Module._ExecInitExprWithParams=wasmExports.ExecInitExprWithParams)(tr,rr),Module._ExecOpenScanRelation=(tr,rr,ir)=>(Module._ExecOpenScanRelation=wasmExports.ExecOpenScanRelation)(tr,rr,ir),Module._FreeExprContext=(tr,rr)=>(Module._FreeExprContext=wasmExports.FreeExprContext)(tr,rr),Module._CreateExprContext=tr=>(Module._CreateExprContext=wasmExports.CreateExprContext)(tr),Module._ExecGetReturningSlot=(tr,rr)=>(Module._ExecGetReturningSlot=wasmExports.ExecGetReturningSlot)(tr,rr),Module._build_attrmap_by_name_if_req=(tr,rr,ir)=>(Module._build_attrmap_by_name_if_req=wasmExports.build_attrmap_by_name_if_req)(tr,rr,ir),Module._ExecGetResultRelCheckAsUser=(tr,rr)=>(Module._ExecGetResultRelCheckAsUser=wasmExports.ExecGetResultRelCheckAsUser)(tr,rr),Module._InstrEndLoop=tr=>(Module._InstrEndLoop=wasmExports.InstrEndLoop)(tr),Module._ExecStoreHeapTuple=(tr,rr,ir)=>(Module._ExecStoreHeapTuple=wasmExports.ExecStoreHeapTuple)(tr,rr,ir),Module._get_partition_ancestors=tr=>(Module._get_partition_ancestors=wasmExports.get_partition_ancestors)(tr),Module._pull_varattnos=(tr,rr,ir)=>(Module._pull_varattnos=wasmExports.pull_varattnos)(tr,rr,ir),Module._ExecFindJunkAttributeInTlist=(tr,rr)=>(Module._ExecFindJunkAttributeInTlist=wasmExports.ExecFindJunkAttributeInTlist)(tr,rr),Module._visibilitymap_get_status=(tr,rr,ir)=>(Module._visibilitymap_get_status=wasmExports.visibilitymap_get_status)(tr,rr,ir),Module._index_deform_tuple=(tr,rr,ir,lr)=>(Module._index_deform_tuple=wasmExports.index_deform_tuple)(tr,rr,ir,lr),Module._LaunchParallelWorkers=tr=>(Module._LaunchParallelWorkers=wasmExports.LaunchParallelWorkers)(tr),Module._standard_ExecutorStart=(tr,rr)=>(Module._standard_ExecutorStart=wasmExports.standard_ExecutorStart)(tr,rr),Module._GetCommandTagName=tr=>(Module._GetCommandTagName=wasmExports.GetCommandTagName)(tr),Module._standard_ExecutorRun=(tr,rr,ir,lr)=>(Module._standard_ExecutorRun=wasmExports.standard_ExecutorRun)(tr,rr,ir,lr),Module._EnterParallelMode=()=>(Module._EnterParallelMode=wasmExports.EnterParallelMode)(),Module._ExitParallelMode=()=>(Module._ExitParallelMode=wasmExports.ExitParallelMode)(),Module._standard_ExecutorFinish=tr=>(Module._standard_ExecutorFinish=wasmExports.standard_ExecutorFinish)(tr),Module._standard_ExecutorEnd=tr=>(Module._standard_ExecutorEnd=wasmExports.standard_ExecutorEnd)(tr),Module._MakeTupleTableSlot=(tr,rr)=>(Module._MakeTupleTableSlot=wasmExports.MakeTupleTableSlot)(tr,rr),Module._CreateParallelContext=(tr,rr,ir)=>(Module._CreateParallelContext=wasmExports.CreateParallelContext)(tr,rr,ir),Module._InitializeParallelDSM=tr=>(Module._InitializeParallelDSM=wasmExports.InitializeParallelDSM)(tr),Module._WaitForParallelWorkersToFinish=tr=>(Module._WaitForParallelWorkersToFinish=wasmExports.WaitForParallelWorkersToFinish)(tr),Module._DestroyParallelContext=tr=>(Module._DestroyParallelContext=wasmExports.DestroyParallelContext)(tr),Module._SPI_connect=()=>(Module._SPI_connect=wasmExports.SPI_connect)(),Module._SPI_connect_ext=tr=>(Module._SPI_connect_ext=wasmExports.SPI_connect_ext)(tr),Module._SPI_finish=()=>(Module._SPI_finish=wasmExports.SPI_finish)(),Module._SPI_commit=()=>(Module._SPI_commit=wasmExports.SPI_commit)(),Module._ReThrowError=tr=>(Module._ReThrowError=wasmExports.ReThrowError)(tr),Module._SPI_commit_and_chain=()=>(Module._SPI_commit_and_chain=wasmExports.SPI_commit_and_chain)(),Module._SPI_rollback=()=>(Module._SPI_rollback=wasmExports.SPI_rollback)(),Module._SPI_rollback_and_chain=()=>(Module._SPI_rollback_and_chain=wasmExports.SPI_rollback_and_chain)(),Module._SPI_execute=(tr,rr,ir)=>(Module._SPI_execute=wasmExports.SPI_execute)(tr,rr,ir),Module._EnsurePortalSnapshotExists=()=>(Module._EnsurePortalSnapshotExists=wasmExports.EnsurePortalSnapshotExists)(),Module._SPI_freetuptable=tr=>(Module._SPI_freetuptable=wasmExports.SPI_freetuptable)(tr),Module._ReleaseCachedPlan=(tr,rr)=>(Module._ReleaseCachedPlan=wasmExports.ReleaseCachedPlan)(tr,rr),Module._SPI_exec=(tr,rr)=>(Module._SPI_exec=wasmExports.SPI_exec)(tr,rr),Module._SPI_execute_extended=(tr,rr)=>(Module._SPI_execute_extended=wasmExports.SPI_execute_extended)(tr,rr),Module._makeParamList=tr=>(Module._makeParamList=wasmExports.makeParamList)(tr),Module._SPI_execp=(tr,rr,ir,lr)=>(Module._SPI_execp=wasmExports.SPI_execp)(tr,rr,ir,lr),Module._SPI_execute_plan_extended=(tr,rr)=>(Module._SPI_execute_plan_extended=wasmExports.SPI_execute_plan_extended)(tr,rr),Module._SPI_execute_plan_with_paramlist=(tr,rr,ir,lr)=>(Module._SPI_execute_plan_with_paramlist=wasmExports.SPI_execute_plan_with_paramlist)(tr,rr,ir,lr),Module._SPI_prepare=(tr,rr,ir)=>(Module._SPI_prepare=wasmExports.SPI_prepare)(tr,rr,ir),Module._SPI_prepare_extended=(tr,rr)=>(Module._SPI_prepare_extended=wasmExports.SPI_prepare_extended)(tr,rr),Module._SPI_keepplan=tr=>(Module._SPI_keepplan=wasmExports.SPI_keepplan)(tr),Module._SPI_freeplan=tr=>(Module._SPI_freeplan=wasmExports.SPI_freeplan)(tr),Module._SPI_copytuple=tr=>(Module._SPI_copytuple=wasmExports.SPI_copytuple)(tr),Module._SPI_returntuple=(tr,rr)=>(Module._SPI_returntuple=wasmExports.SPI_returntuple)(tr,rr),Module._SPI_fnumber=(tr,rr)=>(Module._SPI_fnumber=wasmExports.SPI_fnumber)(tr,rr),Module._SPI_fname=(tr,rr)=>(Module._SPI_fname=wasmExports.SPI_fname)(tr,rr),Module._SPI_getvalue=(tr,rr,ir)=>(Module._SPI_getvalue=wasmExports.SPI_getvalue)(tr,rr,ir),Module._SPI_getbinval=(tr,rr,ir,lr)=>(Module._SPI_getbinval=wasmExports.SPI_getbinval)(tr,rr,ir,lr),Module._SPI_gettype=(tr,rr)=>(Module._SPI_gettype=wasmExports.SPI_gettype)(tr,rr),Module._SPI_gettypeid=(tr,rr)=>(Module._SPI_gettypeid=wasmExports.SPI_gettypeid)(tr,rr),Module._SPI_getrelname=tr=>(Module._SPI_getrelname=wasmExports.SPI_getrelname)(tr),Module._SPI_palloc=tr=>(Module._SPI_palloc=wasmExports.SPI_palloc)(tr),Module._SPI_datumTransfer=(tr,rr,ir)=>(Module._SPI_datumTransfer=wasmExports.SPI_datumTransfer)(tr,rr,ir),Module._datumTransfer=(tr,rr,ir)=>(Module._datumTransfer=wasmExports.datumTransfer)(tr,rr,ir),Module._SPI_cursor_open_with_paramlist=(tr,rr,ir,lr)=>(Module._SPI_cursor_open_with_paramlist=wasmExports.SPI_cursor_open_with_paramlist)(tr,rr,ir,lr),Module._SPI_cursor_parse_open=(tr,rr,ir)=>(Module._SPI_cursor_parse_open=wasmExports.SPI_cursor_parse_open)(tr,rr,ir),Module._SPI_cursor_find=tr=>(Module._SPI_cursor_find=wasmExports.SPI_cursor_find)(tr),Module._SPI_cursor_fetch=(tr,rr,ir)=>(Module._SPI_cursor_fetch=wasmExports.SPI_cursor_fetch)(tr,rr,ir),Module._SPI_scroll_cursor_fetch=(tr,rr,ir)=>(Module._SPI_scroll_cursor_fetch=wasmExports.SPI_scroll_cursor_fetch)(tr,rr,ir),Module._SPI_scroll_cursor_move=(tr,rr,ir)=>(Module._SPI_scroll_cursor_move=wasmExports.SPI_scroll_cursor_move)(tr,rr,ir),Module._SPI_cursor_close=tr=>(Module._SPI_cursor_close=wasmExports.SPI_cursor_close)(tr),Module._SPI_result_code_string=tr=>(Module._SPI_result_code_string=wasmExports.SPI_result_code_string)(tr),Module._SPI_plan_get_plan_sources=tr=>(Module._SPI_plan_get_plan_sources=wasmExports.SPI_plan_get_plan_sources)(tr),Module._SPI_plan_get_cached_plan=tr=>(Module._SPI_plan_get_cached_plan=wasmExports.SPI_plan_get_cached_plan)(tr),Module._geterrposition=()=>(Module._geterrposition=wasmExports.geterrposition)(),Module._internalerrposition=tr=>(Module._internalerrposition=wasmExports.internalerrposition)(tr),Module._internalerrquery=tr=>(Module._internalerrquery=wasmExports.internalerrquery)(tr),Module._SPI_register_trigger_data=tr=>(Module._SPI_register_trigger_data=wasmExports.SPI_register_trigger_data)(tr),Module._EOH_get_flat_size=tr=>(Module._EOH_get_flat_size=wasmExports.EOH_get_flat_size)(tr),Module._EOH_flatten_into=(tr,rr,ir)=>(Module._EOH_flatten_into=wasmExports.EOH_flatten_into)(tr,rr,ir),Module._ExecFetchSlotHeapTuple=(tr,rr,ir)=>(Module._ExecFetchSlotHeapTuple=wasmExports.ExecFetchSlotHeapTuple)(tr,rr,ir),Module._InputFunctionCall=(tr,rr,ir,lr)=>(Module._InputFunctionCall=wasmExports.InputFunctionCall)(tr,rr,ir,lr),Module._convert_tuples_by_position=(tr,rr,ir)=>(Module._convert_tuples_by_position=wasmExports.convert_tuples_by_position)(tr,rr,ir),Module._SetTuplestoreDestReceiverParams=(tr,rr,ir,lr,dr,fr)=>(Module._SetTuplestoreDestReceiverParams=wasmExports.SetTuplestoreDestReceiverParams)(tr,rr,ir,lr,dr,fr),Module._detoast_external_attr=tr=>(Module._detoast_external_attr=wasmExports.detoast_external_attr)(tr),Module._bms_nonempty_difference=(tr,rr)=>(Module._bms_nonempty_difference=wasmExports.bms_nonempty_difference)(tr,rr),Module._table_parallelscan_estimate=(tr,rr)=>(Module._table_parallelscan_estimate=wasmExports.table_parallelscan_estimate)(tr,rr),Module._table_parallelscan_initialize=(tr,rr,ir)=>(Module._table_parallelscan_initialize=wasmExports.table_parallelscan_initialize)(tr,rr,ir),Module._table_beginscan_parallel=(tr,rr)=>(Module._table_beginscan_parallel=wasmExports.table_beginscan_parallel)(tr,rr),Module._BufferUsageAccumDiff=(tr,rr,ir)=>(Module._BufferUsageAccumDiff=wasmExports.BufferUsageAccumDiff)(tr,rr,ir),Module._WalUsageAccumDiff=(tr,rr,ir)=>(Module._WalUsageAccumDiff=wasmExports.WalUsageAccumDiff)(tr,rr,ir),Module._InstrUpdateTupleCount=(tr,rr)=>(Module._InstrUpdateTupleCount=wasmExports.InstrUpdateTupleCount)(tr,rr),Module._tuplesort_reset=tr=>(Module._tuplesort_reset=wasmExports.tuplesort_reset)(tr),Module._get_call_expr_argtype=(tr,rr)=>(Module._get_call_expr_argtype=wasmExports.get_call_expr_argtype)(tr,rr),Module._get_typtype=tr=>(Module._get_typtype=wasmExports.get_typtype)(tr),Module._pull_var_clause=(tr,rr)=>(Module._pull_var_clause=wasmExports.pull_var_clause)(tr,rr),Module._bms_is_subset=(tr,rr)=>(Module._bms_is_subset=wasmExports.bms_is_subset)(tr,rr),Module._bms_membership=tr=>(Module._bms_membership=wasmExports.bms_membership)(tr),Module._make_restrictinfo=(tr,rr,ir,lr,dr,fr,hr,mr,gr,yr)=>(Module._make_restrictinfo=wasmExports.make_restrictinfo)(tr,rr,ir,lr,dr,fr,hr,mr,gr,yr),Module._GetSysCacheHashValue=(tr,rr,ir,lr,dr)=>(Module._GetSysCacheHashValue=wasmExports.GetSysCacheHashValue)(tr,rr,ir,lr,dr),Module._tlist_member=(tr,rr)=>(Module._tlist_member=wasmExports.tlist_member)(tr,rr),Module._add_path=(tr,rr)=>(Module._add_path=wasmExports.add_path)(tr,rr),Module._contain_mutable_functions=tr=>(Module._contain_mutable_functions=wasmExports.contain_mutable_functions)(tr),Module._make_orclause=tr=>(Module._make_orclause=wasmExports.make_orclause)(tr),Module._extract_actual_clauses=(tr,rr)=>(Module._extract_actual_clauses=wasmExports.extract_actual_clauses)(tr,rr),Module._cost_sort=(tr,rr,ir,lr,dr,fr,hr,mr,gr)=>(Module._cost_sort=wasmExports.cost_sort)(tr,rr,ir,lr,dr,fr,hr,mr,gr),Module._pathkeys_contained_in=(tr,rr)=>(Module._pathkeys_contained_in=wasmExports.pathkeys_contained_in)(tr,rr),Module._change_plan_targetlist=(tr,rr,ir)=>(Module._change_plan_targetlist=wasmExports.change_plan_targetlist)(tr,rr,ir),Module._make_foreignscan=(tr,rr,ir,lr,dr,fr,hr,mr)=>(Module._make_foreignscan=wasmExports.make_foreignscan)(tr,rr,ir,lr,dr,fr,hr,mr),Module._list_member_ptr=(tr,rr)=>(Module._list_member_ptr=wasmExports.list_member_ptr)(tr,rr),Module._clamp_row_est=tr=>(Module._clamp_row_est=wasmExports.clamp_row_est)(tr),Module._standard_planner=(tr,rr,ir,lr)=>(Module._standard_planner=wasmExports.standard_planner)(tr,rr,ir,lr),Module._estimate_expression_value=(tr,rr)=>(Module._estimate_expression_value=wasmExports.estimate_expression_value)(tr,rr),Module._add_new_columns_to_pathtarget=(tr,rr)=>(Module._add_new_columns_to_pathtarget=wasmExports.add_new_columns_to_pathtarget)(tr,rr),Module._get_sortgroupref_clause_noerr=(tr,rr)=>(Module._get_sortgroupref_clause_noerr=wasmExports.get_sortgroupref_clause_noerr)(tr,rr),Module._get_agg_clause_costs=(tr,rr,ir)=>(Module._get_agg_clause_costs=wasmExports.get_agg_clause_costs)(tr,rr,ir),Module._grouping_is_sortable=tr=>(Module._grouping_is_sortable=wasmExports.grouping_is_sortable)(tr),Module._create_sort_path=(tr,rr,ir,lr,dr)=>(Module._create_sort_path=wasmExports.create_sort_path)(tr,rr,ir,lr,dr),Module._copy_pathtarget=tr=>(Module._copy_pathtarget=wasmExports.copy_pathtarget)(tr),Module._get_sortgrouplist_exprs=(tr,rr)=>(Module._get_sortgrouplist_exprs=wasmExports.get_sortgrouplist_exprs)(tr,rr),Module._estimate_num_groups=(tr,rr,ir,lr,dr)=>(Module._estimate_num_groups=wasmExports.estimate_num_groups)(tr,rr,ir,lr,dr),Module._cost_qual_eval=(tr,rr,ir)=>(Module._cost_qual_eval=wasmExports.cost_qual_eval)(tr,rr,ir),Module._plan_create_index_workers=(tr,rr)=>(Module._plan_create_index_workers=wasmExports.plan_create_index_workers)(tr,rr),Module._create_projection_path=(tr,rr,ir,lr)=>(Module._create_projection_path=wasmExports.create_projection_path)(tr,rr,ir,lr),Module._get_plan_rowmark=(tr,rr)=>(Module._get_plan_rowmark=wasmExports.get_plan_rowmark)(tr,rr),Module._find_join_rel=(tr,rr)=>(Module._find_join_rel=wasmExports.find_join_rel)(tr,rr),Module._make_canonical_pathkey=(tr,rr,ir,lr,dr)=>(Module._make_canonical_pathkey=wasmExports.make_canonical_pathkey)(tr,rr,ir,lr,dr),Module._eclass_useful_for_merging=(tr,rr,ir)=>(Module._eclass_useful_for_merging=wasmExports.eclass_useful_for_merging)(tr,rr,ir),Module._update_mergeclause_eclasses=(tr,rr)=>(Module._update_mergeclause_eclasses=wasmExports.update_mergeclause_eclasses)(tr,rr),Module._clauselist_selectivity=(tr,rr,ir,lr,dr)=>(Module._clauselist_selectivity=wasmExports.clauselist_selectivity)(tr,rr,ir,lr,dr),Module._join_clause_is_movable_to=(tr,rr)=>(Module._join_clause_is_movable_to=wasmExports.join_clause_is_movable_to)(tr,rr),Module._generate_implied_equalities_for_column=(tr,rr,ir,lr,dr)=>(Module._generate_implied_equalities_for_column=wasmExports.generate_implied_equalities_for_column)(tr,rr,ir,lr,dr),Module._get_tablespace_page_costs=(tr,rr,ir)=>(Module._get_tablespace_page_costs=wasmExports.get_tablespace_page_costs)(tr,rr,ir),Module._set_baserel_size_estimates=(tr,rr)=>(Module._set_baserel_size_estimates=wasmExports.set_baserel_size_estimates)(tr,rr),Module._add_to_flat_tlist=(tr,rr)=>(Module._add_to_flat_tlist=wasmExports.add_to_flat_tlist)(tr,rr),Module._get_baserel_parampathinfo=(tr,rr,ir)=>(Module._get_baserel_parampathinfo=wasmExports.get_baserel_parampathinfo)(tr,rr,ir),Module._create_foreignscan_path=(tr,rr,ir,lr,dr,fr,hr,mr,gr,yr)=>(Module._create_foreignscan_path=wasmExports.create_foreignscan_path)(tr,rr,ir,lr,dr,fr,hr,mr,gr,yr),Module._create_foreign_join_path=(tr,rr,ir,lr,dr,fr,hr,mr,gr,yr)=>(Module._create_foreign_join_path=wasmExports.create_foreign_join_path)(tr,rr,ir,lr,dr,fr,hr,mr,gr,yr),Module._create_foreign_upper_path=(tr,rr,ir,lr,dr,fr,hr,mr,gr)=>(Module._create_foreign_upper_path=wasmExports.create_foreign_upper_path)(tr,rr,ir,lr,dr,fr,hr,mr,gr),Module._adjust_limit_rows_costs=(tr,rr,ir,lr,dr)=>(Module._adjust_limit_rows_costs=wasmExports.adjust_limit_rows_costs)(tr,rr,ir,lr,dr),Module._SearchSysCacheAttName=(tr,rr)=>(Module._SearchSysCacheAttName=wasmExports.SearchSysCacheAttName)(tr,rr),Module._get_translated_update_targetlist=(tr,rr,ir,lr)=>(Module._get_translated_update_targetlist=wasmExports.get_translated_update_targetlist)(tr,rr,ir,lr),Module._add_row_identity_var=(tr,rr,ir,lr)=>(Module._add_row_identity_var=wasmExports.add_row_identity_var)(tr,rr,ir,lr),Module._get_rel_all_updated_cols=(tr,rr)=>(Module._get_rel_all_updated_cols=wasmExports.get_rel_all_updated_cols)(tr,rr),Module._list_append_unique_ptr=(tr,rr)=>(Module._list_append_unique_ptr=wasmExports.list_append_unique_ptr)(tr,rr),Module._palloc_extended=(tr,rr)=>(Module._palloc_extended=wasmExports.palloc_extended)(tr,rr),Module._pg_reg_getinitialstate=tr=>(Module._pg_reg_getinitialstate=wasmExports.pg_reg_getinitialstate)(tr),Module._pg_reg_getfinalstate=tr=>(Module._pg_reg_getfinalstate=wasmExports.pg_reg_getfinalstate)(tr),Module._pg_reg_getnumoutarcs=(tr,rr)=>(Module._pg_reg_getnumoutarcs=wasmExports.pg_reg_getnumoutarcs)(tr,rr),Module._pg_reg_getoutarcs=(tr,rr,ir,lr)=>(Module._pg_reg_getoutarcs=wasmExports.pg_reg_getoutarcs)(tr,rr,ir,lr),Module._pg_reg_getnumcolors=tr=>(Module._pg_reg_getnumcolors=wasmExports.pg_reg_getnumcolors)(tr),Module._pg_reg_colorisbegin=(tr,rr)=>(Module._pg_reg_colorisbegin=wasmExports.pg_reg_colorisbegin)(tr,rr),Module._pg_reg_colorisend=(tr,rr)=>(Module._pg_reg_colorisend=wasmExports.pg_reg_colorisend)(tr,rr),Module._pg_reg_getnumcharacters=(tr,rr)=>(Module._pg_reg_getnumcharacters=wasmExports.pg_reg_getnumcharacters)(tr,rr),Module._pg_reg_getcharacters=(tr,rr,ir,lr)=>(Module._pg_reg_getcharacters=wasmExports.pg_reg_getcharacters)(tr,rr,ir,lr),Module._toupper=tr=>(Module._toupper=wasmExports.toupper)(tr),Module._pg_initdb=()=>(Module._pg_initdb=wasmExports.pg_initdb)(),Module._pg_initdb_main=()=>(Module._pg_initdb_main=wasmExports.pg_initdb_main)(),Module.___cxa_throw=(tr,rr,ir)=>(Module.___cxa_throw=wasmExports.__cxa_throw)(tr,rr,ir),Module._main_repl=()=>(Module._main_repl=wasmExports.main_repl)(),Module._main=(tr,rr)=>(Module._main=wasmExports.__main_argc_argv)(tr,rr),Module._setenv=(tr,rr,ir)=>(Module._setenv=wasmExports.setenv)(tr,rr,ir),Module._pg_repl_raf=()=>(Module._pg_repl_raf=wasmExports.pg_repl_raf)(),Module._GetForeignDataWrapper=tr=>(Module._GetForeignDataWrapper=wasmExports.GetForeignDataWrapper)(tr),Module._GetForeignServer=tr=>(Module._GetForeignServer=wasmExports.GetForeignServer)(tr),Module._GetForeignServerExtended=(tr,rr)=>(Module._GetForeignServerExtended=wasmExports.GetForeignServerExtended)(tr,rr),Module._GetForeignServerByName=(tr,rr)=>(Module._GetForeignServerByName=wasmExports.GetForeignServerByName)(tr,rr),Module._GetUserMapping=(tr,rr)=>(Module._GetUserMapping=wasmExports.GetUserMapping)(tr,rr),Module._GetForeignTable=tr=>(Module._GetForeignTable=wasmExports.GetForeignTable)(tr),Module._GetForeignColumnOptions=(tr,rr)=>(Module._GetForeignColumnOptions=wasmExports.GetForeignColumnOptions)(tr,rr),Module._initClosestMatch=(tr,rr,ir)=>(Module._initClosestMatch=wasmExports.initClosestMatch)(tr,rr,ir),Module._updateClosestMatch=(tr,rr)=>(Module._updateClosestMatch=wasmExports.updateClosestMatch)(tr,rr),Module._getClosestMatch=tr=>(Module._getClosestMatch=wasmExports.getClosestMatch)(tr),Module._GetExistingLocalJoinPath=tr=>(Module._GetExistingLocalJoinPath=wasmExports.GetExistingLocalJoinPath)(tr),Module._BaseBackupAddTarget=(tr,rr,ir)=>(Module._BaseBackupAddTarget=wasmExports.BaseBackupAddTarget)(tr,rr,ir),Module._bbsink_forward_begin_backup=tr=>(Module._bbsink_forward_begin_backup=wasmExports.bbsink_forward_begin_backup)(tr),Module._bbsink_forward_archive_contents=(tr,rr)=>(Module._bbsink_forward_archive_contents=wasmExports.bbsink_forward_archive_contents)(tr,rr),Module._bbsink_forward_end_archive=tr=>(Module._bbsink_forward_end_archive=wasmExports.bbsink_forward_end_archive)(tr),Module._bbsink_forward_begin_archive=(tr,rr)=>(Module._bbsink_forward_begin_archive=wasmExports.bbsink_forward_begin_archive)(tr,rr),Module._bbsink_forward_begin_manifest=tr=>(Module._bbsink_forward_begin_manifest=wasmExports.bbsink_forward_begin_manifest)(tr),Module._bbsink_forward_manifest_contents=(tr,rr)=>(Module._bbsink_forward_manifest_contents=wasmExports.bbsink_forward_manifest_contents)(tr,rr),Module._bbsink_forward_end_manifest=tr=>(Module._bbsink_forward_end_manifest=wasmExports.bbsink_forward_end_manifest)(tr),Module._bbsink_forward_end_backup=(tr,rr,ir)=>(Module._bbsink_forward_end_backup=wasmExports.bbsink_forward_end_backup)(tr,rr,ir),Module._bbsink_forward_cleanup=tr=>(Module._bbsink_forward_cleanup=wasmExports.bbsink_forward_cleanup)(tr),Module._ResourceOwnerCreate=(tr,rr)=>(Module._ResourceOwnerCreate=wasmExports.ResourceOwnerCreate)(tr,rr),Module._escape_json=(tr,rr)=>(Module._escape_json=wasmExports.escape_json)(tr,rr),Module._exprIsLengthCoercion=(tr,rr)=>(Module._exprIsLengthCoercion=wasmExports.exprIsLengthCoercion)(tr,rr),Module._tbm_add_tuples=(tr,rr,ir,lr)=>(Module._tbm_add_tuples=wasmExports.tbm_add_tuples)(tr,rr,ir,lr),Module._appendStringInfoStringQuoted=(tr,rr,ir)=>(Module._appendStringInfoStringQuoted=wasmExports.appendStringInfoStringQuoted)(tr,rr,ir),Module._list_make5_impl=(tr,rr,ir,lr,dr,fr)=>(Module._list_make5_impl=wasmExports.list_make5_impl)(tr,rr,ir,lr,dr,fr),Module._list_delete=(tr,rr)=>(Module._list_delete=wasmExports.list_delete)(tr,rr),Module._CleanQuerytext=(tr,rr,ir)=>(Module._CleanQuerytext=wasmExports.CleanQuerytext)(tr,rr,ir),Module._EnableQueryId=()=>(Module._EnableQueryId=wasmExports.EnableQueryId)(),Module._get_rel_type_id=tr=>(Module._get_rel_type_id=wasmExports.get_rel_type_id)(tr),Module._set_config_option=(tr,rr,ir,lr,dr,fr,hr,mr)=>(Module._set_config_option=wasmExports.set_config_option)(tr,rr,ir,lr,dr,fr,hr,mr),Module._NewGUCNestLevel=()=>(Module._NewGUCNestLevel=wasmExports.NewGUCNestLevel)(),Module._AtEOXact_GUC=(tr,rr)=>(Module._AtEOXact_GUC=wasmExports.AtEOXact_GUC)(tr,rr),Module._parse_int=(tr,rr,ir,lr)=>(Module._parse_int=wasmExports.parse_int)(tr,rr,ir,lr),Module._strtod=(tr,rr)=>(Module._strtod=wasmExports.strtod)(tr,rr),Module._parse_real=(tr,rr,ir,lr)=>(Module._parse_real=wasmExports.parse_real)(tr,rr,ir,lr),Module._DefineCustomBoolVariable=(tr,rr,ir,lr,dr,fr,hr,mr,gr,yr)=>(Module._DefineCustomBoolVariable=wasmExports.DefineCustomBoolVariable)(tr,rr,ir,lr,dr,fr,hr,mr,gr,yr),Module._DefineCustomIntVariable=(tr,rr,ir,lr,dr,fr,hr,mr,gr,yr,_r,br)=>(Module._DefineCustomIntVariable=wasmExports.DefineCustomIntVariable)(tr,rr,ir,lr,dr,fr,hr,mr,gr,yr,_r,br),Module._DefineCustomRealVariable=(tr,rr,ir,lr,dr,fr,hr,mr,gr,yr,_r,br)=>(Module._DefineCustomRealVariable=wasmExports.DefineCustomRealVariable)(tr,rr,ir,lr,dr,fr,hr,mr,gr,yr,_r,br),Module._DefineCustomStringVariable=(tr,rr,ir,lr,dr,fr,hr,mr,gr,yr)=>(Module._DefineCustomStringVariable=wasmExports.DefineCustomStringVariable)(tr,rr,ir,lr,dr,fr,hr,mr,gr,yr),Module._DefineCustomEnumVariable=(tr,rr,ir,lr,dr,fr,hr,mr,gr,yr,_r)=>(Module._DefineCustomEnumVariable=wasmExports.DefineCustomEnumVariable)(tr,rr,ir,lr,dr,fr,hr,mr,gr,yr,_r),Module._MarkGUCPrefixReserved=tr=>(Module._MarkGUCPrefixReserved=wasmExports.MarkGUCPrefixReserved)(tr),Module._strcspn=(tr,rr)=>(Module._strcspn=wasmExports.strcspn)(tr,rr),Module._BlockSampler_Init=(tr,rr,ir,lr)=>(Module._BlockSampler_Init=wasmExports.BlockSampler_Init)(tr,rr,ir,lr),Module._sampler_random_init_state=(tr,rr)=>(Module._sampler_random_init_state=wasmExports.sampler_random_init_state)(tr,rr),Module._BlockSampler_HasMore=tr=>(Module._BlockSampler_HasMore=wasmExports.BlockSampler_HasMore)(tr),Module._BlockSampler_Next=tr=>(Module._BlockSampler_Next=wasmExports.BlockSampler_Next)(tr),Module._sampler_random_fract=tr=>(Module._sampler_random_fract=wasmExports.sampler_random_fract)(tr),Module._reservoir_init_selection_state=(tr,rr)=>(Module._reservoir_init_selection_state=wasmExports.reservoir_init_selection_state)(tr,rr),Module._reservoir_get_next_S=(tr,rr,ir)=>(Module._reservoir_get_next_S=wasmExports.reservoir_get_next_S)(tr,rr,ir),Module._canonicalize_path=tr=>(Module._canonicalize_path=wasmExports.canonicalize_path)(tr),Module.__bt_mkscankey=(tr,rr)=>(Module.__bt_mkscankey=wasmExports._bt_mkscankey)(tr,rr),Module._nocache_index_getattr=(tr,rr,ir)=>(Module._nocache_index_getattr=wasmExports.nocache_index_getattr)(tr,rr,ir),Module._tuplesort_estimate_shared=tr=>(Module._tuplesort_estimate_shared=wasmExports.tuplesort_estimate_shared)(tr),Module._tuplesort_initialize_shared=(tr,rr,ir)=>(Module._tuplesort_initialize_shared=wasmExports.tuplesort_initialize_shared)(tr,rr,ir),Module._tuplesort_attach_shared=(tr,rr)=>(Module._tuplesort_attach_shared=wasmExports.tuplesort_attach_shared)(tr,rr),Module._GetCurrentTransactionNestLevel=()=>(Module._GetCurrentTransactionNestLevel=wasmExports.GetCurrentTransactionNestLevel)(),Module._in_error_recursion_trouble=()=>(Module._in_error_recursion_trouble=wasmExports.in_error_recursion_trouble)(),Module._strrchr=(tr,rr)=>(Module._strrchr=wasmExports.strrchr)(tr,rr),Module._errhidestmt=tr=>(Module._errhidestmt=wasmExports.errhidestmt)(tr),Module._err_generic_string=(tr,rr)=>(Module._err_generic_string=wasmExports.err_generic_string)(tr,rr),Module._getinternalerrposition=()=>(Module._getinternalerrposition=wasmExports.getinternalerrposition)(),Module._GetErrorContextStack=()=>(Module._GetErrorContextStack=wasmExports.GetErrorContextStack)(),Module._SplitIdentifierString=(tr,rr,ir)=>(Module._SplitIdentifierString=wasmExports.SplitIdentifierString)(tr,rr,ir),Module._appendStringInfoSpaces=(tr,rr)=>(Module._appendStringInfoSpaces=wasmExports.appendStringInfoSpaces)(tr,rr),Module._unpack_sql_state=tr=>(Module._unpack_sql_state=wasmExports.unpack_sql_state)(tr),Module._CreateTupleDescCopyConstr=tr=>(Module._CreateTupleDescCopyConstr=wasmExports.CreateTupleDescCopyConstr)(tr),Module._CachedPlanAllowsSimpleValidityCheck=(tr,rr,ir)=>(Module._CachedPlanAllowsSimpleValidityCheck=wasmExports.CachedPlanAllowsSimpleValidityCheck)(tr,rr,ir),Module._CachedPlanIsSimplyValid=(tr,rr,ir)=>(Module._CachedPlanIsSimplyValid=wasmExports.CachedPlanIsSimplyValid)(tr,rr,ir),Module._GetCachedExpression=tr=>(Module._GetCachedExpression=wasmExports.GetCachedExpression)(tr),Module._FreeCachedExpression=tr=>(Module._FreeCachedExpression=wasmExports.FreeCachedExpression)(tr),Module._MemoryContextDeleteChildren=tr=>(Module._MemoryContextDeleteChildren=wasmExports.MemoryContextDeleteChildren)(tr),Module._is_publishable_relation=tr=>(Module._is_publishable_relation=wasmExports.is_publishable_relation)(tr),Module._GetRelationPublications=tr=>(Module._GetRelationPublications=wasmExports.GetRelationPublications)(tr),Module._GetSchemaPublications=tr=>(Module._GetSchemaPublications=wasmExports.GetSchemaPublications)(tr),Module._index_getprocid=(tr,rr,ir)=>(Module._index_getprocid=wasmExports.index_getprocid)(tr,rr,ir),Module._get_rel_relispartition=tr=>(Module._get_rel_relispartition=wasmExports.get_rel_relispartition)(tr),Module._get_func_namespace=tr=>(Module._get_func_namespace=wasmExports.get_func_namespace)(tr),Module._get_typsubscript=(tr,rr)=>(Module._get_typsubscript=wasmExports.get_typsubscript)(tr,rr),Module._get_namespace_name_or_temp=tr=>(Module._get_namespace_name_or_temp=wasmExports.get_namespace_name_or_temp)(tr),Module._texteq=tr=>(Module._texteq=wasmExports.texteq)(tr),Module._GetUserIdAndSecContext=(tr,rr)=>(Module._GetUserIdAndSecContext=wasmExports.GetUserIdAndSecContext)(tr,rr),Module._SetUserIdAndSecContext=(tr,rr)=>(Module._SetUserIdAndSecContext=wasmExports.SetUserIdAndSecContext)(tr,rr),Module._DirectFunctionCall5Coll=(tr,rr,ir,lr,dr,fr,hr)=>(Module._DirectFunctionCall5Coll=wasmExports.DirectFunctionCall5Coll)(tr,rr,ir,lr,dr,fr,hr),Module._CallerFInfoFunctionCall2=(tr,rr,ir,lr,dr)=>(Module._CallerFInfoFunctionCall2=wasmExports.CallerFInfoFunctionCall2)(tr,rr,ir,lr,dr),Module._FunctionCall0Coll=(tr,rr)=>(Module._FunctionCall0Coll=wasmExports.FunctionCall0Coll)(tr,rr),Module._OutputFunctionCall=(tr,rr)=>(Module._OutputFunctionCall=wasmExports.OutputFunctionCall)(tr,rr),Module._get_fn_expr_rettype=tr=>(Module._get_fn_expr_rettype=wasmExports.get_fn_expr_rettype)(tr),Module._has_fn_opclass_options=tr=>(Module._has_fn_opclass_options=wasmExports.has_fn_opclass_options)(tr),Module._get_fn_opclass_options=tr=>(Module._get_fn_opclass_options=wasmExports.get_fn_opclass_options)(tr),Module._CheckFunctionValidatorAccess=(tr,rr)=>(Module._CheckFunctionValidatorAccess=wasmExports.CheckFunctionValidatorAccess)(tr,rr),Module._resolve_polymorphic_argtypes=(tr,rr,ir,lr)=>(Module._resolve_polymorphic_argtypes=wasmExports.resolve_polymorphic_argtypes)(tr,rr,ir,lr),Module._get_func_arg_info=(tr,rr,ir,lr)=>(Module._get_func_arg_info=wasmExports.get_func_arg_info)(tr,rr,ir,lr),Module._dlsym=(tr,rr)=>(Module._dlsym=wasmExports.dlsym)(tr,rr),Module._dlopen=(tr,rr)=>(Module._dlopen=wasmExports.dlopen)(tr,rr),Module._dlerror=()=>(Module._dlerror=wasmExports.dlerror)(),Module._dlclose=tr=>(Module._dlclose=wasmExports.dlclose)(tr),Module._find_rendezvous_variable=tr=>(Module._find_rendezvous_variable=wasmExports.find_rendezvous_variable)(tr),Module._fscanf=(tr,rr,ir)=>(Module._fscanf=wasmExports.fscanf)(tr,rr,ir),Module._strlcat=(tr,rr,ir)=>(Module._strlcat=wasmExports.strlcat)(tr,rr,ir),Module._pg_bindtextdomain=tr=>(Module._pg_bindtextdomain=wasmExports.pg_bindtextdomain)(tr),Module._pg_do_encoding_conversion=(tr,rr,ir,lr)=>(Module._pg_do_encoding_conversion=wasmExports.pg_do_encoding_conversion)(tr,rr,ir,lr),Module._report_invalid_encoding=(tr,rr,ir)=>(Module._report_invalid_encoding=wasmExports.report_invalid_encoding)(tr,rr,ir),Module._pg_encoding_to_char_private=tr=>(Module._pg_encoding_to_char_private=wasmExports.pg_encoding_to_char_private)(tr),Module._MemoryContextAllocHuge=(tr,rr)=>(Module._MemoryContextAllocHuge=wasmExports.MemoryContextAllocHuge)(tr,rr),Module._namein=tr=>(Module._namein=wasmExports.namein)(tr),Module._pg_char_to_encoding_private=tr=>(Module._pg_char_to_encoding_private=wasmExports.pg_char_to_encoding_private)(tr),Module._pg_encoding_max_length=tr=>(Module._pg_encoding_max_length=wasmExports.pg_encoding_max_length)(tr),Module._pg_server_to_any=(tr,rr,ir)=>(Module._pg_server_to_any=wasmExports.pg_server_to_any)(tr,rr,ir),Module._pg_utf_mblen=tr=>(Module._pg_utf_mblen=wasmExports.pg_utf_mblen)(tr),Module._pg_wchar2mb_with_len=(tr,rr,ir)=>(Module._pg_wchar2mb_with_len=wasmExports.pg_wchar2mb_with_len)(tr,rr,ir),Module._pg_encoding_mblen=(tr,rr)=>(Module._pg_encoding_mblen=wasmExports.pg_encoding_mblen)(tr,rr),Module._check_encoding_conversion_args=(tr,rr,ir,lr,dr)=>(Module._check_encoding_conversion_args=wasmExports.check_encoding_conversion_args)(tr,rr,ir,lr,dr),Module._report_untranslatable_char=(tr,rr,ir,lr)=>(Module._report_untranslatable_char=wasmExports.report_untranslatable_char)(tr,rr,ir,lr),Module._local2local=(tr,rr,ir,lr,dr,fr,hr)=>(Module._local2local=wasmExports.local2local)(tr,rr,ir,lr,dr,fr,hr),Module._latin2mic=(tr,rr,ir,lr,dr,fr)=>(Module._latin2mic=wasmExports.latin2mic)(tr,rr,ir,lr,dr,fr),Module._mic2latin=(tr,rr,ir,lr,dr,fr)=>(Module._mic2latin=wasmExports.mic2latin)(tr,rr,ir,lr,dr,fr),Module._latin2mic_with_table=(tr,rr,ir,lr,dr,fr,hr)=>(Module._latin2mic_with_table=wasmExports.latin2mic_with_table)(tr,rr,ir,lr,dr,fr,hr),Module._mic2latin_with_table=(tr,rr,ir,lr,dr,fr,hr)=>(Module._mic2latin_with_table=wasmExports.mic2latin_with_table)(tr,rr,ir,lr,dr,fr,hr),Module._pg_encoding_verifymbchar=(tr,rr,ir)=>(Module._pg_encoding_verifymbchar=wasmExports.pg_encoding_verifymbchar)(tr,rr,ir),Module._float_overflow_error=()=>(Module._float_overflow_error=wasmExports.float_overflow_error)(),Module._float_underflow_error=()=>(Module._float_underflow_error=wasmExports.float_underflow_error)(),Module._float4in_internal=(tr,rr,ir,lr,dr)=>(Module._float4in_internal=wasmExports.float4in_internal)(tr,rr,ir,lr,dr),Module._strtof=(tr,rr)=>(Module._strtof=wasmExports.strtof)(tr,rr),Module._float_to_shortest_decimal_buf=(tr,rr)=>(Module._float_to_shortest_decimal_buf=wasmExports.float_to_shortest_decimal_buf)(tr,rr),Module._float8in_internal=(tr,rr,ir,lr,dr)=>(Module._float8in_internal=wasmExports.float8in_internal)(tr,rr,ir,lr,dr),Module._float8out_internal=tr=>(Module._float8out_internal=wasmExports.float8out_internal)(tr),Module._btfloat4cmp=tr=>(Module._btfloat4cmp=wasmExports.btfloat4cmp)(tr),Module._btfloat8cmp=tr=>(Module._btfloat8cmp=wasmExports.btfloat8cmp)(tr),Module._pow=(tr,rr)=>(Module._pow=wasmExports.pow)(tr,rr),Module._log10=tr=>(Module._log10=wasmExports.log10)(tr),Module._acos=tr=>(Module._acos=wasmExports.acos)(tr),Module._asin=tr=>(Module._asin=wasmExports.asin)(tr),Module._cos=tr=>(Module._cos=wasmExports.cos)(tr),Module._sin=tr=>(Module._sin=wasmExports.sin)(tr),Module._fmod=(tr,rr)=>(Module._fmod=wasmExports.fmod)(tr,rr),Module._construct_array=(tr,rr,ir,lr,dr,fr)=>(Module._construct_array=wasmExports.construct_array)(tr,rr,ir,lr,dr,fr),Module._try_relation_open=(tr,rr)=>(Module._try_relation_open=wasmExports.try_relation_open)(tr,rr),Module._forkname_to_number=tr=>(Module._forkname_to_number=wasmExports.forkname_to_number)(tr),Module._numeric_lt=tr=>(Module._numeric_lt=wasmExports.numeric_lt)(tr),Module._int64_to_numeric=tr=>(Module._int64_to_numeric=wasmExports.int64_to_numeric)(tr),Module._numeric_sub=tr=>(Module._numeric_sub=wasmExports.numeric_sub)(tr),Module._numeric_ge=tr=>(Module._numeric_ge=wasmExports.numeric_ge)(tr),Module._inet_in=tr=>(Module._inet_in=wasmExports.inet_in)(tr),Module._format_operator=tr=>(Module._format_operator=wasmExports.format_operator)(tr),Module._RelationIsVisible=tr=>(Module._RelationIsVisible=wasmExports.RelationIsVisible)(tr),Module._pg_get_indexdef_columns_extended=(tr,rr)=>(Module._pg_get_indexdef_columns_extended=wasmExports.pg_get_indexdef_columns_extended)(tr,rr),Module._accumArrayResult=(tr,rr,ir,lr,dr)=>(Module._accumArrayResult=wasmExports.accumArrayResult)(tr,rr,ir,lr,dr),Module._makeArrayResult=(tr,rr)=>(Module._makeArrayResult=wasmExports.makeArrayResult)(tr,rr),Module._init_local_reloptions=(tr,rr)=>(Module._init_local_reloptions=wasmExports.init_local_reloptions)(tr,rr),Module._add_local_int_reloption=(tr,rr,ir,lr,dr,fr,hr)=>(Module._add_local_int_reloption=wasmExports.add_local_int_reloption)(tr,rr,ir,lr,dr,fr,hr),Module._pg_inet_net_ntop=(tr,rr,ir,lr,dr)=>(Module._pg_inet_net_ntop=wasmExports.pg_inet_net_ntop)(tr,rr,ir,lr,dr),Module._network_cmp=tr=>(Module._network_cmp=wasmExports.network_cmp)(tr),Module._convert_network_to_scalar=(tr,rr,ir)=>(Module._convert_network_to_scalar=wasmExports.convert_network_to_scalar)(tr,rr,ir),Module._JsonbValueToJsonb=tr=>(Module._JsonbValueToJsonb=wasmExports.JsonbValueToJsonb)(tr),Module._pushJsonbValue=(tr,rr,ir)=>(Module._pushJsonbValue=wasmExports.pushJsonbValue)(tr,rr,ir),Module._numeric_cmp=tr=>(Module._numeric_cmp=wasmExports.numeric_cmp)(tr),Module._timetz_cmp=tr=>(Module._timetz_cmp=wasmExports.timetz_cmp)(tr),Module._date_cmp=tr=>(Module._date_cmp=wasmExports.date_cmp)(tr),Module._time_cmp=tr=>(Module._time_cmp=wasmExports.time_cmp)(tr),Module._timestamp_cmp=tr=>(Module._timestamp_cmp=wasmExports.timestamp_cmp)(tr),Module._domain_check=(tr,rr,ir,lr,dr)=>(Module._domain_check=wasmExports.domain_check)(tr,rr,ir,lr,dr),Module._initArrayResult=(tr,rr,ir)=>(Module._initArrayResult=wasmExports.initArrayResult)(tr,rr,ir),Module._path_is_prefix_of_path=(tr,rr)=>(Module._path_is_prefix_of_path=wasmExports.path_is_prefix_of_path)(tr,rr),Module._path_is_relative_and_below_cwd=tr=>(Module._path_is_relative_and_below_cwd=wasmExports.path_is_relative_and_below_cwd)(tr),Module._ArrayGetIntegerTypmods=(tr,rr)=>(Module._ArrayGetIntegerTypmods=wasmExports.ArrayGetIntegerTypmods)(tr,rr),Module._bpchareq=tr=>(Module._bpchareq=wasmExports.bpchareq)(tr),Module._varstr_cmp=(tr,rr,ir,lr,dr)=>(Module._varstr_cmp=wasmExports.varstr_cmp)(tr,rr,ir,lr,dr),Module._bpcharlt=tr=>(Module._bpcharlt=wasmExports.bpcharlt)(tr),Module._bpcharle=tr=>(Module._bpcharle=wasmExports.bpcharle)(tr),Module._bpchargt=tr=>(Module._bpchargt=wasmExports.bpchargt)(tr),Module._bpcharge=tr=>(Module._bpcharge=wasmExports.bpcharge)(tr),Module._bpcharcmp=tr=>(Module._bpcharcmp=wasmExports.bpcharcmp)(tr),Module._current_query=tr=>(Module._current_query=wasmExports.current_query)(tr),Module._str_tolower=(tr,rr,ir)=>(Module._str_tolower=wasmExports.str_tolower)(tr,rr,ir),Module._TransferExpandedObject=(tr,rr)=>(Module._TransferExpandedObject=wasmExports.TransferExpandedObject)(tr,rr),Module._macaddr_cmp=tr=>(Module._macaddr_cmp=wasmExports.macaddr_cmp)(tr),Module._macaddr_lt=tr=>(Module._macaddr_lt=wasmExports.macaddr_lt)(tr),Module._macaddr_le=tr=>(Module._macaddr_le=wasmExports.macaddr_le)(tr),Module._macaddr_eq=tr=>(Module._macaddr_eq=wasmExports.macaddr_eq)(tr),Module._macaddr_ge=tr=>(Module._macaddr_ge=wasmExports.macaddr_ge)(tr),Module._macaddr_gt=tr=>(Module._macaddr_gt=wasmExports.macaddr_gt)(tr),Module._quote_ident=tr=>(Module._quote_ident=wasmExports.quote_ident)(tr),Module._timestamp_in=tr=>(Module._timestamp_in=wasmExports.timestamp_in)(tr),Module._ParseDateTime=(tr,rr,ir,lr,dr,fr,hr)=>(Module._ParseDateTime=wasmExports.ParseDateTime)(tr,rr,ir,lr,dr,fr,hr),Module._DecodeDateTime=(tr,rr,ir,lr,dr,fr,hr,mr)=>(Module._DecodeDateTime=wasmExports.DecodeDateTime)(tr,rr,ir,lr,dr,fr,hr,mr),Module.___multi3=(tr,rr,ir,lr,dr)=>(Module.___multi3=wasmExports.__multi3)(tr,rr,ir,lr,dr),Module._timestamptz_in=tr=>(Module._timestamptz_in=wasmExports.timestamptz_in)(tr),Module._timestamp_eq=tr=>(Module._timestamp_eq=wasmExports.timestamp_eq)(tr),Module._timestamp_lt=tr=>(Module._timestamp_lt=wasmExports.timestamp_lt)(tr),Module._timestamp_gt=tr=>(Module._timestamp_gt=wasmExports.timestamp_gt)(tr),Module._timestamp_le=tr=>(Module._timestamp_le=wasmExports.timestamp_le)(tr),Module._timestamp_ge=tr=>(Module._timestamp_ge=wasmExports.timestamp_ge)(tr),Module._interval_eq=tr=>(Module._interval_eq=wasmExports.interval_eq)(tr),Module._interval_lt=tr=>(Module._interval_lt=wasmExports.interval_lt)(tr),Module._interval_gt=tr=>(Module._interval_gt=wasmExports.interval_gt)(tr),Module._interval_le=tr=>(Module._interval_le=wasmExports.interval_le)(tr),Module._interval_ge=tr=>(Module._interval_ge=wasmExports.interval_ge)(tr),Module._interval_cmp=tr=>(Module._interval_cmp=wasmExports.interval_cmp)(tr),Module._timestamp_mi=tr=>(Module._timestamp_mi=wasmExports.timestamp_mi)(tr),Module._interval_um=tr=>(Module._interval_um=wasmExports.interval_um)(tr),Module._interval_mi=tr=>(Module._interval_mi=wasmExports.interval_mi)(tr),Module._IsValidJsonNumber=(tr,rr)=>(Module._IsValidJsonNumber=wasmExports.IsValidJsonNumber)(tr,rr),Module._btnamecmp=tr=>(Module._btnamecmp=wasmExports.btnamecmp)(tr),Module._strncpy=(tr,rr,ir)=>(Module._strncpy=wasmExports.strncpy)(tr,rr,ir),Module._expand_array=(tr,rr,ir)=>(Module._expand_array=wasmExports.expand_array)(tr,rr,ir),Module._pg_get_encoding_from_locale=(tr,rr)=>(Module._pg_get_encoding_from_locale=wasmExports.pg_get_encoding_from_locale)(tr,rr),Module._localtime=tr=>(Module._localtime=wasmExports.localtime)(tr),Module._strftime=(tr,rr,ir,lr)=>(Module._strftime=wasmExports.strftime)(tr,rr,ir,lr),Module._numeric_is_nan=tr=>(Module._numeric_is_nan=wasmExports.numeric_is_nan)(tr),Module._numeric_eq=tr=>(Module._numeric_eq=wasmExports.numeric_eq)(tr),Module._numeric_gt=tr=>(Module._numeric_gt=wasmExports.numeric_gt)(tr),Module._numeric_le=tr=>(Module._numeric_le=wasmExports.numeric_le)(tr),Module._numeric_div=tr=>(Module._numeric_div=wasmExports.numeric_div)(tr),Module._numeric_float8_no_overflow=tr=>(Module._numeric_float8_no_overflow=wasmExports.numeric_float8_no_overflow)(tr),Module._numeric_float4=tr=>(Module._numeric_float4=wasmExports.numeric_float4)(tr),Module._date_eq=tr=>(Module._date_eq=wasmExports.date_eq)(tr),Module._date_lt=tr=>(Module._date_lt=wasmExports.date_lt)(tr),Module._date_le=tr=>(Module._date_le=wasmExports.date_le)(tr),Module._date_gt=tr=>(Module._date_gt=wasmExports.date_gt)(tr),Module._date_ge=tr=>(Module._date_ge=wasmExports.date_ge)(tr),Module._date_mi=tr=>(Module._date_mi=wasmExports.date_mi)(tr),Module._time_eq=tr=>(Module._time_eq=wasmExports.time_eq)(tr),Module._time_lt=tr=>(Module._time_lt=wasmExports.time_lt)(tr),Module._time_le=tr=>(Module._time_le=wasmExports.time_le)(tr),Module._time_gt=tr=>(Module._time_gt=wasmExports.time_gt)(tr),Module._time_ge=tr=>(Module._time_ge=wasmExports.time_ge)(tr),Module._time_mi_time=tr=>(Module._time_mi_time=wasmExports.time_mi_time)(tr),Module._get_extension_oid=(tr,rr)=>(Module._get_extension_oid=wasmExports.get_extension_oid)(tr,rr),Module._pg_ltoa=(tr,rr)=>(Module._pg_ltoa=wasmExports.pg_ltoa)(tr,rr),Module._varbit_in=tr=>(Module._varbit_in=wasmExports.varbit_in)(tr),Module._biteq=tr=>(Module._biteq=wasmExports.biteq)(tr),Module._bitlt=tr=>(Module._bitlt=wasmExports.bitlt)(tr),Module._bitle=tr=>(Module._bitle=wasmExports.bitle)(tr),Module._bitgt=tr=>(Module._bitgt=wasmExports.bitgt)(tr),Module._bitge=tr=>(Module._bitge=wasmExports.bitge)(tr),Module._bitcmp=tr=>(Module._bitcmp=wasmExports.bitcmp)(tr),Module._tidin=tr=>(Module._tidin=wasmExports.tidin)(tr),Module._tidout=tr=>(Module._tidout=wasmExports.tidout)(tr),Module._cash_cmp=tr=>(Module._cash_cmp=wasmExports.cash_cmp)(tr),Module._arraycontsel=tr=>(Module._arraycontsel=wasmExports.arraycontsel)(tr),Module._arraycontjoinsel=tr=>(Module._arraycontjoinsel=wasmExports.arraycontjoinsel)(tr),Module._text_lt=tr=>(Module._text_lt=wasmExports.text_lt)(tr),Module._text_le=tr=>(Module._text_le=wasmExports.text_le)(tr),Module._text_gt=tr=>(Module._text_gt=wasmExports.text_gt)(tr),Module._text_ge=tr=>(Module._text_ge=wasmExports.text_ge)(tr),Module._bttextcmp=tr=>(Module._bttextcmp=wasmExports.bttextcmp)(tr),Module._byteaeq=tr=>(Module._byteaeq=wasmExports.byteaeq)(tr),Module._bytealt=tr=>(Module._bytealt=wasmExports.bytealt)(tr),Module._byteale=tr=>(Module._byteale=wasmExports.byteale)(tr),Module._byteagt=tr=>(Module._byteagt=wasmExports.byteagt)(tr),Module._byteage=tr=>(Module._byteage=wasmExports.byteage)(tr),Module._byteacmp=tr=>(Module._byteacmp=wasmExports.byteacmp)(tr),Module._to_hex32=tr=>(Module._to_hex32=wasmExports.to_hex32)(tr),Module._varstr_levenshtein=(tr,rr,ir,lr,dr,fr,hr,mr)=>(Module._varstr_levenshtein=wasmExports.varstr_levenshtein)(tr,rr,ir,lr,dr,fr,hr,mr),Module._utf8_to_unicode=tr=>(Module._utf8_to_unicode=wasmExports.utf8_to_unicode)(tr),Module._format_type_extended=(tr,rr,ir)=>(Module._format_type_extended=wasmExports.format_type_extended)(tr,rr,ir),Module._array_create_iterator=(tr,rr,ir)=>(Module._array_create_iterator=wasmExports.array_create_iterator)(tr,rr,ir),Module._array_iterate=(tr,rr,ir)=>(Module._array_iterate=wasmExports.array_iterate)(tr,rr,ir),Module._make_expanded_record_from_typeid=(tr,rr,ir)=>(Module._make_expanded_record_from_typeid=wasmExports.make_expanded_record_from_typeid)(tr,rr,ir),Module._make_expanded_record_from_tupdesc=(tr,rr)=>(Module._make_expanded_record_from_tupdesc=wasmExports.make_expanded_record_from_tupdesc)(tr,rr),Module._make_expanded_record_from_exprecord=(tr,rr)=>(Module._make_expanded_record_from_exprecord=wasmExports.make_expanded_record_from_exprecord)(tr,rr),Module._expanded_record_set_tuple=(tr,rr,ir,lr)=>(Module._expanded_record_set_tuple=wasmExports.expanded_record_set_tuple)(tr,rr,ir,lr),Module._expanded_record_get_tuple=tr=>(Module._expanded_record_get_tuple=wasmExports.expanded_record_get_tuple)(tr),Module._deconstruct_expanded_record=tr=>(Module._deconstruct_expanded_record=wasmExports.deconstruct_expanded_record)(tr),Module._expanded_record_lookup_field=(tr,rr,ir)=>(Module._expanded_record_lookup_field=wasmExports.expanded_record_lookup_field)(tr,rr,ir),Module._expanded_record_set_field_internal=(tr,rr,ir,lr,dr,fr)=>(Module._expanded_record_set_field_internal=wasmExports.expanded_record_set_field_internal)(tr,rr,ir,lr,dr,fr),Module._expanded_record_set_fields=(tr,rr,ir,lr)=>(Module._expanded_record_set_fields=wasmExports.expanded_record_set_fields)(tr,rr,ir,lr),Module._macaddr8_cmp=tr=>(Module._macaddr8_cmp=wasmExports.macaddr8_cmp)(tr),Module._macaddr8_lt=tr=>(Module._macaddr8_lt=wasmExports.macaddr8_lt)(tr),Module._macaddr8_le=tr=>(Module._macaddr8_le=wasmExports.macaddr8_le)(tr),Module._macaddr8_eq=tr=>(Module._macaddr8_eq=wasmExports.macaddr8_eq)(tr),Module._macaddr8_ge=tr=>(Module._macaddr8_ge=wasmExports.macaddr8_ge)(tr),Module._macaddr8_gt=tr=>(Module._macaddr8_gt=wasmExports.macaddr8_gt)(tr),Module._enum_lt=tr=>(Module._enum_lt=wasmExports.enum_lt)(tr),Module._enum_le=tr=>(Module._enum_le=wasmExports.enum_le)(tr),Module._enum_ge=tr=>(Module._enum_ge=wasmExports.enum_ge)(tr),Module._enum_gt=tr=>(Module._enum_gt=wasmExports.enum_gt)(tr),Module._enum_cmp=tr=>(Module._enum_cmp=wasmExports.enum_cmp)(tr),Module._uuid_in=tr=>(Module._uuid_in=wasmExports.uuid_in)(tr),Module._uuid_out=tr=>(Module._uuid_out=wasmExports.uuid_out)(tr),Module._uuid_cmp=tr=>(Module._uuid_cmp=wasmExports.uuid_cmp)(tr),Module._gen_random_uuid=tr=>(Module._gen_random_uuid=wasmExports.gen_random_uuid)(tr),Module._generic_restriction_selectivity=(tr,rr,ir,lr,dr,fr)=>(Module._generic_restriction_selectivity=wasmExports.generic_restriction_selectivity)(tr,rr,ir,lr,dr,fr),Module._genericcostestimate=(tr,rr,ir,lr)=>(Module._genericcostestimate=wasmExports.genericcostestimate)(tr,rr,ir,lr),Module._pg_xml_init=tr=>(Module._pg_xml_init=wasmExports.pg_xml_init)(tr),Module._xmlInitParser=()=>(Module._xmlInitParser=wasmExports.xmlInitParser)(),Module._xml_ereport=(tr,rr,ir,lr)=>(Module._xml_ereport=wasmExports.xml_ereport)(tr,rr,ir,lr),Module._pg_xml_done=(tr,rr)=>(Module._pg_xml_done=wasmExports.pg_xml_done)(tr,rr),Module._xmlXPathNewContext=tr=>(Module._xmlXPathNewContext=wasmExports.xmlXPathNewContext)(tr),Module._xmlXPathFreeContext=tr=>(Module._xmlXPathFreeContext=wasmExports.xmlXPathFreeContext)(tr),Module._xmlFreeDoc=tr=>(Module._xmlFreeDoc=wasmExports.xmlFreeDoc)(tr),Module._xmlXPathCompile=tr=>(Module._xmlXPathCompile=wasmExports.xmlXPathCompile)(tr),Module._xmlXPathCompiledEval=(tr,rr)=>(Module._xmlXPathCompiledEval=wasmExports.xmlXPathCompiledEval)(tr,rr),Module._xmlXPathFreeCompExpr=tr=>(Module._xmlXPathFreeCompExpr=wasmExports.xmlXPathFreeCompExpr)(tr),Module._xmlStrdup=tr=>(Module._xmlStrdup=wasmExports.xmlStrdup)(tr),Module._strnlen=(tr,rr)=>(Module._strnlen=wasmExports.strnlen)(tr,rr),Module._xmlXPathCastNodeToString=tr=>(Module._xmlXPathCastNodeToString=wasmExports.xmlXPathCastNodeToString)(tr),Module._heap_modify_tuple_by_cols=(tr,rr,ir,lr,dr,fr)=>(Module._heap_modify_tuple_by_cols=wasmExports.heap_modify_tuple_by_cols)(tr,rr,ir,lr,dr,fr),Module._ResourceOwnerReleaseAllPlanCacheRefs=tr=>(Module._ResourceOwnerReleaseAllPlanCacheRefs=wasmExports.ResourceOwnerReleaseAllPlanCacheRefs)(tr),Module._RegisterResourceReleaseCallback=(tr,rr)=>(Module._RegisterResourceReleaseCallback=wasmExports.RegisterResourceReleaseCallback)(tr,rr),Module._PinPortal=tr=>(Module._PinPortal=wasmExports.PinPortal)(tr),Module._UnpinPortal=tr=>(Module._UnpinPortal=wasmExports.UnpinPortal)(tr),Module._btint2cmp=tr=>(Module._btint2cmp=wasmExports.btint2cmp)(tr),Module._btint4cmp=tr=>(Module._btint4cmp=wasmExports.btint4cmp)(tr),Module._btoidcmp=tr=>(Module._btoidcmp=wasmExports.btoidcmp)(tr),Module._btcharcmp=tr=>(Module._btcharcmp=wasmExports.btcharcmp)(tr),Module._btint8cmp=tr=>(Module._btint8cmp=wasmExports.btint8cmp)(tr),Module._btboolcmp=tr=>(Module._btboolcmp=wasmExports.btboolcmp)(tr),Module._GetPublicationByName=(tr,rr)=>(Module._GetPublicationByName=wasmExports.GetPublicationByName)(tr,rr),Module._GetTopMostAncestorInPublication=(tr,rr,ir)=>(Module._GetTopMostAncestorInPublication=wasmExports.GetTopMostAncestorInPublication)(tr,rr,ir),Module._pub_collist_to_bitmapset=(tr,rr,ir)=>(Module._pub_collist_to_bitmapset=wasmExports.pub_collist_to_bitmapset)(tr,rr,ir),Module._getExtensionOfObject=(tr,rr)=>(Module._getExtensionOfObject=wasmExports.getExtensionOfObject)(tr,rr),Module._visibilitymap_prepare_truncate=(tr,rr)=>(Module._visibilitymap_prepare_truncate=wasmExports.visibilitymap_prepare_truncate)(tr,rr),Module._log_newpage_range=(tr,rr,ir,lr,dr)=>(Module._log_newpage_range=wasmExports.log_newpage_range)(tr,rr,ir,lr,dr),Module._function_parse_error_transpose=tr=>(Module._function_parse_error_transpose=wasmExports.function_parse_error_transpose)(tr),Module._IndexGetRelation=(tr,rr)=>(Module._IndexGetRelation=wasmExports.IndexGetRelation)(tr,rr),Module._RelnameGetRelid=tr=>(Module._RelnameGetRelid=wasmExports.RelnameGetRelid)(tr),Module._standard_ProcessUtility=(tr,rr,ir,lr,dr,fr,hr,mr)=>(Module._standard_ProcessUtility=wasmExports.standard_ProcessUtility)(tr,rr,ir,lr,dr,fr,hr,mr),Module._Async_Notify=(tr,rr)=>(Module._Async_Notify=wasmExports.Async_Notify)(tr,rr),Module._sigaddset=(tr,rr)=>(Module._sigaddset=wasmExports.sigaddset)(tr,rr),Module._fsync_pgdata=(tr,rr)=>(Module._fsync_pgdata=wasmExports.fsync_pgdata)(tr,rr),Module._get_restricted_token=()=>(Module._get_restricted_token=wasmExports.get_restricted_token)(),Module._pg_malloc=tr=>(Module._pg_malloc=wasmExports.pg_malloc)(tr),Module._pg_realloc=(tr,rr)=>(Module._pg_realloc=wasmExports.pg_realloc)(tr,rr),Module._pg_strdup=tr=>(Module._pg_strdup=wasmExports.pg_strdup)(tr),Module._simple_prompt=(tr,rr)=>(Module._simple_prompt=wasmExports.simple_prompt)(tr,rr),Module._interactive_file=()=>(Module._interactive_file=wasmExports.interactive_file)(),Module._interactive_one=()=>(Module._interactive_one=wasmExports.interactive_one)(),Module._pg_shutdown=()=>(Module._pg_shutdown=wasmExports.pg_shutdown)(),Module._interactive_write=tr=>(Module._interactive_write=wasmExports.interactive_write)(tr),Module._interactive_read=()=>(Module._interactive_read=wasmExports.interactive_read)(),Module._visibilitymap_pin=(tr,rr,ir)=>(Module._visibilitymap_pin=wasmExports.visibilitymap_pin)(tr,rr,ir),Module._HeapTupleSatisfiesVacuum=(tr,rr,ir)=>(Module._HeapTupleSatisfiesVacuum=wasmExports.HeapTupleSatisfiesVacuum)(tr,rr,ir),Module._visibilitymap_clear=(tr,rr,ir,lr)=>(Module._visibilitymap_clear=wasmExports.visibilitymap_clear)(tr,rr,ir,lr),Module._vac_estimate_reltuples=(tr,rr,ir,lr)=>(Module._vac_estimate_reltuples=wasmExports.vac_estimate_reltuples)(tr,rr,ir,lr),Module._heap_tuple_needs_eventual_freeze=tr=>(Module._heap_tuple_needs_eventual_freeze=wasmExports.heap_tuple_needs_eventual_freeze)(tr),Module._HeapTupleSatisfiesUpdate=(tr,rr,ir)=>(Module._HeapTupleSatisfiesUpdate=wasmExports.HeapTupleSatisfiesUpdate)(tr,rr,ir),Module._HeapTupleGetUpdateXid=tr=>(Module._HeapTupleGetUpdateXid=wasmExports.HeapTupleGetUpdateXid)(tr),Module._HeapTupleSatisfiesVisibility=(tr,rr,ir)=>(Module._HeapTupleSatisfiesVisibility=wasmExports.HeapTupleSatisfiesVisibility)(tr,rr,ir),Module._GetMultiXactIdMembers=(tr,rr,ir,lr)=>(Module._GetMultiXactIdMembers=wasmExports.GetMultiXactIdMembers)(tr,rr,ir,lr),Module._XLogRecGetBlockTagExtended=(tr,rr,ir,lr,dr,fr)=>(Module._XLogRecGetBlockTagExtended=wasmExports.XLogRecGetBlockTagExtended)(tr,rr,ir,lr,dr,fr),Module._toast_open_indexes=(tr,rr,ir,lr)=>(Module._toast_open_indexes=wasmExports.toast_open_indexes)(tr,rr,ir,lr),Module._init_toast_snapshot=tr=>(Module._init_toast_snapshot=wasmExports.init_toast_snapshot)(tr),Module._toast_close_indexes=(tr,rr,ir)=>(Module._toast_close_indexes=wasmExports.toast_close_indexes)(tr,rr,ir),Module._index_getprocinfo=(tr,rr,ir)=>(Module._index_getprocinfo=wasmExports.index_getprocinfo)(tr,rr,ir),Module._identify_opfamily_groups=(tr,rr)=>(Module._identify_opfamily_groups=wasmExports.identify_opfamily_groups)(tr,rr),Module._check_amproc_signature=(tr,rr,ir,lr,dr,fr)=>(Module._check_amproc_signature=wasmExports.check_amproc_signature)(tr,rr,ir,lr,dr,fr),Module._check_amoptsproc_signature=tr=>(Module._check_amoptsproc_signature=wasmExports.check_amoptsproc_signature)(tr),Module._check_amop_signature=(tr,rr,ir,lr)=>(Module._check_amop_signature=wasmExports.check_amop_signature)(tr,rr,ir,lr),Module._RelationGetIndexScan=(tr,rr,ir)=>(Module._RelationGetIndexScan=wasmExports.RelationGetIndexScan)(tr,rr,ir),Module.__hash_get_indextuple_hashkey=tr=>(Module.__hash_get_indextuple_hashkey=wasmExports._hash_get_indextuple_hashkey)(tr),Module.__hash_getbuf=(tr,rr,ir,lr)=>(Module.__hash_getbuf=wasmExports._hash_getbuf)(tr,rr,ir,lr),Module.__hash_relbuf=(tr,rr)=>(Module.__hash_relbuf=wasmExports._hash_relbuf)(tr,rr),Module.__hash_getbuf_with_strategy=(tr,rr,ir,lr,dr)=>(Module.__hash_getbuf_with_strategy=wasmExports._hash_getbuf_with_strategy)(tr,rr,ir,lr,dr),Module._build_reloptions=(tr,rr,ir,lr,dr,fr)=>(Module._build_reloptions=wasmExports.build_reloptions)(tr,rr,ir,lr,dr,fr),Module._index_form_tuple=(tr,rr,ir)=>(Module._index_form_tuple=wasmExports.index_form_tuple)(tr,rr,ir),Module.__hash_ovflblkno_to_bitno=(tr,rr)=>(Module.__hash_ovflblkno_to_bitno=wasmExports._hash_ovflblkno_to_bitno)(tr,rr),Module._brin_build_desc=tr=>(Module._brin_build_desc=wasmExports.brin_build_desc)(tr),Module._brin_deform_tuple=(tr,rr,ir)=>(Module._brin_deform_tuple=wasmExports.brin_deform_tuple)(tr,rr,ir),Module._brin_free_desc=tr=>(Module._brin_free_desc=wasmExports.brin_free_desc)(tr),Module._XLogRecGetBlockRefInfo=(tr,rr,ir,lr,dr)=>(Module._XLogRecGetBlockRefInfo=wasmExports.XLogRecGetBlockRefInfo)(tr,rr,ir,lr,dr),Module._ginPostingListDecode=(tr,rr)=>(Module._ginPostingListDecode=wasmExports.ginPostingListDecode)(tr,rr),Module._add_reloption_kind=()=>(Module._add_reloption_kind=wasmExports.add_reloption_kind)(),Module._register_reloptions_validator=(tr,rr)=>(Module._register_reloptions_validator=wasmExports.register_reloptions_validator)(tr,rr),Module._add_int_reloption=(tr,rr,ir,lr,dr,fr,hr)=>(Module._add_int_reloption=wasmExports.add_int_reloption)(tr,rr,ir,lr,dr,fr,hr),Module._XLogFindNextRecord=(tr,rr)=>(Module._XLogFindNextRecord=wasmExports.XLogFindNextRecord)(tr,rr),Module._RestoreBlockImage=(tr,rr,ir)=>(Module._RestoreBlockImage=wasmExports.RestoreBlockImage)(tr,rr,ir),Module._GenericXLogStart=tr=>(Module._GenericXLogStart=wasmExports.GenericXLogStart)(tr),Module._GenericXLogRegisterBuffer=(tr,rr,ir)=>(Module._GenericXLogRegisterBuffer=wasmExports.GenericXLogRegisterBuffer)(tr,rr,ir),Module._GenericXLogFinish=tr=>(Module._GenericXLogFinish=wasmExports.GenericXLogFinish)(tr),Module._GenericXLogAbort=tr=>(Module._GenericXLogAbort=wasmExports.GenericXLogAbort)(tr),Module._read_local_xlog_page_no_wait=(tr,rr,ir,lr,dr)=>(Module._read_local_xlog_page_no_wait=wasmExports.read_local_xlog_page_no_wait)(tr,rr,ir,lr,dr),Module._XLogRecStoreStats=(tr,rr)=>(Module._XLogRecStoreStats=wasmExports.XLogRecStoreStats)(tr,rr),Module._ReadMultiXactIdRange=(tr,rr)=>(Module._ReadMultiXactIdRange=wasmExports.ReadMultiXactIdRange)(tr,rr),Module._MultiXactIdPrecedesOrEquals=(tr,rr)=>(Module._MultiXactIdPrecedesOrEquals=wasmExports.MultiXactIdPrecedesOrEquals)(tr,rr),Module._RegisterXactCallback=(tr,rr)=>(Module._RegisterXactCallback=wasmExports.RegisterXactCallback)(tr,rr),Module._RegisterSubXactCallback=(tr,rr)=>(Module._RegisterSubXactCallback=wasmExports.RegisterSubXactCallback)(tr,rr),Module._ReleaseCurrentSubTransaction=()=>(Module._ReleaseCurrentSubTransaction=wasmExports.ReleaseCurrentSubTransaction)(),Module._WaitForParallelWorkersToAttach=tr=>(Module._WaitForParallelWorkersToAttach=wasmExports.WaitForParallelWorkersToAttach)(tr),Module.__bt_allequalimage=(tr,rr)=>(Module.__bt_allequalimage=wasmExports._bt_allequalimage)(tr,rr),Module.__bt_checkpage=(tr,rr)=>(Module.__bt_checkpage=wasmExports._bt_checkpage)(tr,rr),Module.__bt_relbuf=(tr,rr)=>(Module.__bt_relbuf=wasmExports._bt_relbuf)(tr,rr),Module.__bt_metaversion=(tr,rr,ir)=>(Module.__bt_metaversion=wasmExports._bt_metaversion)(tr,rr,ir),Module.__bt_search=(tr,rr,ir,lr,dr,fr)=>(Module.__bt_search=wasmExports._bt_search)(tr,rr,ir,lr,dr,fr),Module.__bt_compare=(tr,rr,ir,lr)=>(Module.__bt_compare=wasmExports._bt_compare)(tr,rr,ir,lr),Module.__bt_binsrch_insert=(tr,rr)=>(Module.__bt_binsrch_insert=wasmExports._bt_binsrch_insert)(tr,rr),Module.__bt_freestack=tr=>(Module.__bt_freestack=wasmExports._bt_freestack)(tr),Module.__bt_form_posting=(tr,rr,ir)=>(Module.__bt_form_posting=wasmExports._bt_form_posting)(tr,rr,ir),Module.__bt_check_natts=(tr,rr,ir,lr)=>(Module.__bt_check_natts=wasmExports._bt_check_natts)(tr,rr,ir,lr),Module._gistcheckpage=(tr,rr)=>(Module._gistcheckpage=wasmExports.gistcheckpage)(tr,rr),Module._EndCopyFrom=tr=>(Module._EndCopyFrom=wasmExports.EndCopyFrom)(tr),Module._ProcessCopyOptions=(tr,rr,ir,lr)=>(Module._ProcessCopyOptions=wasmExports.ProcessCopyOptions)(tr,rr,ir,lr),Module._CopyFromErrorCallback=tr=>(Module._CopyFromErrorCallback=wasmExports.CopyFromErrorCallback)(tr),Module._NextCopyFrom=(tr,rr,ir,lr)=>(Module._NextCopyFrom=wasmExports.NextCopyFrom)(tr,rr,ir,lr),Module._nextval=tr=>(Module._nextval=wasmExports.nextval)(tr),Module._defGetStreamingMode=tr=>(Module._defGetStreamingMode=wasmExports.defGetStreamingMode)(tr),Module._ExplainBeginOutput=tr=>(Module._ExplainBeginOutput=wasmExports.ExplainBeginOutput)(tr),Module._NewExplainState=()=>(Module._NewExplainState=wasmExports.NewExplainState)(),Module._ExplainEndOutput=tr=>(Module._ExplainEndOutput=wasmExports.ExplainEndOutput)(tr),Module._ExplainPrintPlan=(tr,rr)=>(Module._ExplainPrintPlan=wasmExports.ExplainPrintPlan)(tr,rr),Module._ExplainPrintTriggers=(tr,rr)=>(Module._ExplainPrintTriggers=wasmExports.ExplainPrintTriggers)(tr,rr),Module._ExplainPrintJITSummary=(tr,rr)=>(Module._ExplainPrintJITSummary=wasmExports.ExplainPrintJITSummary)(tr,rr),Module._ExplainPropertyInteger=(tr,rr,ir,lr)=>(Module._ExplainPropertyInteger=wasmExports.ExplainPropertyInteger)(tr,rr,ir,lr),Module._ExplainQueryText=(tr,rr)=>(Module._ExplainQueryText=wasmExports.ExplainQueryText)(tr,rr),Module._ExplainPropertyText=(tr,rr,ir)=>(Module._ExplainPropertyText=wasmExports.ExplainPropertyText)(tr,rr,ir),Module._ExplainQueryParameters=(tr,rr,ir)=>(Module._ExplainQueryParameters=wasmExports.ExplainQueryParameters)(tr,rr,ir),Module._pg_is_ascii=tr=>(Module._pg_is_ascii=wasmExports.pg_is_ascii)(tr),Module._fputs=(tr,rr)=>(Module._fputs=wasmExports.fputs)(tr,rr),Module._popen=(tr,rr)=>(Module._popen=wasmExports.popen)(tr,rr),Module._float_to_shortest_decimal_bufn=(tr,rr)=>(Module._float_to_shortest_decimal_bufn=wasmExports.float_to_shortest_decimal_bufn)(tr,rr),Module._pg_prng_uint64=tr=>(Module._pg_prng_uint64=wasmExports.pg_prng_uint64)(tr),Module._scram_ClientKey=(tr,rr,ir,lr,dr)=>(Module._scram_ClientKey=wasmExports.scram_ClientKey)(tr,rr,ir,lr,dr),Module._pg_encoding_dsplen=(tr,rr)=>(Module._pg_encoding_dsplen=wasmExports.pg_encoding_dsplen)(tr,rr),Module._getcwd=(tr,rr)=>(Module._getcwd=wasmExports.getcwd)(tr,rr),Module._pg_get_user_home_dir=(tr,rr,ir)=>(Module._pg_get_user_home_dir=wasmExports.pg_get_user_home_dir)(tr,rr,ir),Module._nanosleep=(tr,rr)=>(Module._nanosleep=wasmExports.nanosleep)(tr,rr),Module._snprintf=(tr,rr,ir,lr)=>(Module._snprintf=wasmExports.snprintf)(tr,rr,ir,lr),Module._pg_strerror_r=(tr,rr,ir)=>(Module._pg_strerror_r=wasmExports.pg_strerror_r)(tr,rr,ir),Module._pthread_mutex_lock=tr=>(Module._pthread_mutex_lock=wasmExports.pthread_mutex_lock)(tr),Module._pthread_mutex_unlock=tr=>(Module._pthread_mutex_unlock=wasmExports.pthread_mutex_unlock)(tr),Module._strncat=(tr,rr,ir)=>(Module._strncat=wasmExports.strncat)(tr,rr,ir),Module._PQexec=(tr,rr)=>(Module._PQexec=wasmExports.PQexec)(tr,rr),Module._PQsetSingleRowMode=tr=>(Module._PQsetSingleRowMode=wasmExports.PQsetSingleRowMode)(tr),Module._PQcmdStatus=tr=>(Module._PQcmdStatus=wasmExports.PQcmdStatus)(tr),Module._pthread_sigmask=(tr,rr,ir)=>(Module._pthread_sigmask=wasmExports.pthread_sigmask)(tr,rr,ir),Module._sigismember=(tr,rr)=>(Module._sigismember=wasmExports.sigismember)(tr,rr),Module._sigpending=tr=>(Module._sigpending=wasmExports.sigpending)(tr),Module._sigwait=(tr,rr)=>(Module._sigwait=wasmExports.sigwait)(tr,rr),Module._isolat1ToUTF8=(tr,rr,ir,lr)=>(Module._isolat1ToUTF8=wasmExports.isolat1ToUTF8)(tr,rr,ir,lr),Module._UTF8Toisolat1=(tr,rr,ir,lr)=>(Module._UTF8Toisolat1=wasmExports.UTF8Toisolat1)(tr,rr,ir,lr),Module._vfprintf=(tr,rr,ir)=>(Module._vfprintf=wasmExports.vfprintf)(tr,rr,ir),Module._vsnprintf=(tr,rr,ir,lr)=>(Module._vsnprintf=wasmExports.vsnprintf)(tr,rr,ir,lr),Module._xmlParserValidityWarning=(tr,rr,ir)=>(Module._xmlParserValidityWarning=wasmExports.xmlParserValidityWarning)(tr,rr,ir),Module._xmlParserValidityError=(tr,rr,ir)=>(Module._xmlParserValidityError=wasmExports.xmlParserValidityError)(tr,rr,ir),Module._xmlParserError=(tr,rr,ir)=>(Module._xmlParserError=wasmExports.xmlParserError)(tr,rr,ir),Module._xmlParserWarning=(tr,rr,ir)=>(Module._xmlParserWarning=wasmExports.xmlParserWarning)(tr,rr,ir),Module._fprintf=(tr,rr,ir)=>(Module._fprintf=wasmExports.fprintf)(tr,rr,ir),Module.___xmlParserInputBufferCreateFilename=(tr,rr)=>(Module.___xmlParserInputBufferCreateFilename=wasmExports.__xmlParserInputBufferCreateFilename)(tr,rr),Module.___xmlOutputBufferCreateFilename=(tr,rr,ir)=>(Module.___xmlOutputBufferCreateFilename=wasmExports.__xmlOutputBufferCreateFilename)(tr,rr,ir),Module._xmlSAX2InternalSubset=(tr,rr,ir,lr)=>(Module._xmlSAX2InternalSubset=wasmExports.xmlSAX2InternalSubset)(tr,rr,ir,lr),Module._xmlSAX2IsStandalone=tr=>(Module._xmlSAX2IsStandalone=wasmExports.xmlSAX2IsStandalone)(tr),Module._xmlSAX2HasInternalSubset=tr=>(Module._xmlSAX2HasInternalSubset=wasmExports.xmlSAX2HasInternalSubset)(tr),Module._xmlSAX2HasExternalSubset=tr=>(Module._xmlSAX2HasExternalSubset=wasmExports.xmlSAX2HasExternalSubset)(tr),Module._xmlSAX2ResolveEntity=(tr,rr,ir)=>(Module._xmlSAX2ResolveEntity=wasmExports.xmlSAX2ResolveEntity)(tr,rr,ir),Module._xmlSAX2GetEntity=(tr,rr)=>(Module._xmlSAX2GetEntity=wasmExports.xmlSAX2GetEntity)(tr,rr),Module._xmlSAX2EntityDecl=(tr,rr,ir,lr,dr,fr)=>(Module._xmlSAX2EntityDecl=wasmExports.xmlSAX2EntityDecl)(tr,rr,ir,lr,dr,fr),Module._xmlSAX2NotationDecl=(tr,rr,ir,lr)=>(Module._xmlSAX2NotationDecl=wasmExports.xmlSAX2NotationDecl)(tr,rr,ir,lr),Module._xmlSAX2AttributeDecl=(tr,rr,ir,lr,dr,fr,hr)=>(Module._xmlSAX2AttributeDecl=wasmExports.xmlSAX2AttributeDecl)(tr,rr,ir,lr,dr,fr,hr),Module._xmlSAX2ElementDecl=(tr,rr,ir,lr)=>(Module._xmlSAX2ElementDecl=wasmExports.xmlSAX2ElementDecl)(tr,rr,ir,lr),Module._xmlSAX2UnparsedEntityDecl=(tr,rr,ir,lr,dr)=>(Module._xmlSAX2UnparsedEntityDecl=wasmExports.xmlSAX2UnparsedEntityDecl)(tr,rr,ir,lr,dr),Module._xmlSAX2SetDocumentLocator=(tr,rr)=>(Module._xmlSAX2SetDocumentLocator=wasmExports.xmlSAX2SetDocumentLocator)(tr,rr),Module._xmlSAX2StartDocument=tr=>(Module._xmlSAX2StartDocument=wasmExports.xmlSAX2StartDocument)(tr),Module._xmlSAX2EndDocument=tr=>(Module._xmlSAX2EndDocument=wasmExports.xmlSAX2EndDocument)(tr),Module._xmlSAX2StartElement=(tr,rr,ir)=>(Module._xmlSAX2StartElement=wasmExports.xmlSAX2StartElement)(tr,rr,ir),Module._xmlSAX2EndElement=(tr,rr)=>(Module._xmlSAX2EndElement=wasmExports.xmlSAX2EndElement)(tr,rr),Module._xmlSAX2Reference=(tr,rr)=>(Module._xmlSAX2Reference=wasmExports.xmlSAX2Reference)(tr,rr),Module._xmlSAX2Characters=(tr,rr,ir)=>(Module._xmlSAX2Characters=wasmExports.xmlSAX2Characters)(tr,rr,ir),Module._xmlSAX2ProcessingInstruction=(tr,rr,ir)=>(Module._xmlSAX2ProcessingInstruction=wasmExports.xmlSAX2ProcessingInstruction)(tr,rr,ir),Module._xmlSAX2Comment=(tr,rr)=>(Module._xmlSAX2Comment=wasmExports.xmlSAX2Comment)(tr,rr),Module._xmlSAX2GetParameterEntity=(tr,rr)=>(Module._xmlSAX2GetParameterEntity=wasmExports.xmlSAX2GetParameterEntity)(tr,rr),Module._xmlSAX2CDataBlock=(tr,rr,ir)=>(Module._xmlSAX2CDataBlock=wasmExports.xmlSAX2CDataBlock)(tr,rr,ir),Module._xmlSAX2ExternalSubset=(tr,rr,ir,lr)=>(Module._xmlSAX2ExternalSubset=wasmExports.xmlSAX2ExternalSubset)(tr,rr,ir,lr),Module._xmlSAX2GetPublicId=tr=>(Module._xmlSAX2GetPublicId=wasmExports.xmlSAX2GetPublicId)(tr),Module._xmlSAX2GetSystemId=tr=>(Module._xmlSAX2GetSystemId=wasmExports.xmlSAX2GetSystemId)(tr),Module._xmlSAX2GetLineNumber=tr=>(Module._xmlSAX2GetLineNumber=wasmExports.xmlSAX2GetLineNumber)(tr),Module._xmlSAX2GetColumnNumber=tr=>(Module._xmlSAX2GetColumnNumber=wasmExports.xmlSAX2GetColumnNumber)(tr),Module._xmlSAX2IgnorableWhitespace=(tr,rr,ir)=>(Module._xmlSAX2IgnorableWhitespace=wasmExports.xmlSAX2IgnorableWhitespace)(tr,rr,ir),Module._xmlHashDefaultDeallocator=(tr,rr)=>(Module._xmlHashDefaultDeallocator=wasmExports.xmlHashDefaultDeallocator)(tr,rr),Module._iconv_open=(tr,rr)=>(Module._iconv_open=wasmExports.iconv_open)(tr,rr),Module._iconv_close=tr=>(Module._iconv_close=wasmExports.iconv_close)(tr),Module._iconv=(tr,rr,ir,lr,dr)=>(Module._iconv=wasmExports.iconv)(tr,rr,ir,lr,dr),Module._UTF8ToHtml=(tr,rr,ir,lr)=>(Module._UTF8ToHtml=wasmExports.UTF8ToHtml)(tr,rr,ir,lr),Module._xmlReadMemory=(tr,rr,ir,lr,dr)=>(Module._xmlReadMemory=wasmExports.xmlReadMemory)(tr,rr,ir,lr,dr),Module._xmlSAX2StartElementNs=(tr,rr,ir,lr,dr,fr,hr,mr,gr)=>(Module._xmlSAX2StartElementNs=wasmExports.xmlSAX2StartElementNs)(tr,rr,ir,lr,dr,fr,hr,mr,gr),Module._xmlSAX2EndElementNs=(tr,rr,ir,lr)=>(Module._xmlSAX2EndElementNs=wasmExports.xmlSAX2EndElementNs)(tr,rr,ir,lr),Module.___cxa_atexit=(tr,rr,ir)=>(Module.___cxa_atexit=wasmExports.__cxa_atexit)(tr,rr,ir),Module._xmlDocGetRootElement=tr=>(Module._xmlDocGetRootElement=wasmExports.xmlDocGetRootElement)(tr),Module._xmlFileMatch=tr=>(Module._xmlFileMatch=wasmExports.xmlFileMatch)(tr),Module._xmlFileOpen=tr=>(Module._xmlFileOpen=wasmExports.xmlFileOpen)(tr),Module._xmlFileRead=(tr,rr,ir)=>(Module._xmlFileRead=wasmExports.xmlFileRead)(tr,rr,ir),Module._xmlFileClose=tr=>(Module._xmlFileClose=wasmExports.xmlFileClose)(tr),Module._gzread=(tr,rr,ir)=>(Module._gzread=wasmExports.gzread)(tr,rr,ir),Module._gzclose=tr=>(Module._gzclose=wasmExports.gzclose)(tr),Module._gzdirect=tr=>(Module._gzdirect=wasmExports.gzdirect)(tr),Module._gzdopen=(tr,rr)=>(Module._gzdopen=wasmExports.gzdopen)(tr,rr),Module._gzopen=(tr,rr)=>(Module._gzopen=wasmExports.gzopen)(tr,rr),Module._gzwrite=(tr,rr,ir)=>(Module._gzwrite=wasmExports.gzwrite)(tr,rr,ir),Module._xmlUCSIsCatNd=tr=>(Module._xmlUCSIsCatNd=wasmExports.xmlUCSIsCatNd)(tr),Module._xmlUCSIsCatP=tr=>(Module._xmlUCSIsCatP=wasmExports.xmlUCSIsCatP)(tr),Module._xmlUCSIsCatZ=tr=>(Module._xmlUCSIsCatZ=wasmExports.xmlUCSIsCatZ)(tr),Module._xmlUCSIsCatC=tr=>(Module._xmlUCSIsCatC=wasmExports.xmlUCSIsCatC)(tr),Module._xmlUCSIsCatL=tr=>(Module._xmlUCSIsCatL=wasmExports.xmlUCSIsCatL)(tr),Module._xmlUCSIsCatLu=tr=>(Module._xmlUCSIsCatLu=wasmExports.xmlUCSIsCatLu)(tr),Module._xmlUCSIsCatLl=tr=>(Module._xmlUCSIsCatLl=wasmExports.xmlUCSIsCatLl)(tr),Module._xmlUCSIsCatLt=tr=>(Module._xmlUCSIsCatLt=wasmExports.xmlUCSIsCatLt)(tr),Module._xmlUCSIsCatLm=tr=>(Module._xmlUCSIsCatLm=wasmExports.xmlUCSIsCatLm)(tr),Module._xmlUCSIsCatLo=tr=>(Module._xmlUCSIsCatLo=wasmExports.xmlUCSIsCatLo)(tr),Module._xmlUCSIsCatM=tr=>(Module._xmlUCSIsCatM=wasmExports.xmlUCSIsCatM)(tr),Module._xmlUCSIsCatMn=tr=>(Module._xmlUCSIsCatMn=wasmExports.xmlUCSIsCatMn)(tr),Module._xmlUCSIsCatMc=tr=>(Module._xmlUCSIsCatMc=wasmExports.xmlUCSIsCatMc)(tr),Module._xmlUCSIsCatMe=tr=>(Module._xmlUCSIsCatMe=wasmExports.xmlUCSIsCatMe)(tr),Module._xmlUCSIsCatN=tr=>(Module._xmlUCSIsCatN=wasmExports.xmlUCSIsCatN)(tr),Module._xmlUCSIsCatNl=tr=>(Module._xmlUCSIsCatNl=wasmExports.xmlUCSIsCatNl)(tr),Module._xmlUCSIsCatNo=tr=>(Module._xmlUCSIsCatNo=wasmExports.xmlUCSIsCatNo)(tr),Module._xmlUCSIsCatPc=tr=>(Module._xmlUCSIsCatPc=wasmExports.xmlUCSIsCatPc)(tr),Module._xmlUCSIsCatPd=tr=>(Module._xmlUCSIsCatPd=wasmExports.xmlUCSIsCatPd)(tr),Module._xmlUCSIsCatPs=tr=>(Module._xmlUCSIsCatPs=wasmExports.xmlUCSIsCatPs)(tr),Module._xmlUCSIsCatPe=tr=>(Module._xmlUCSIsCatPe=wasmExports.xmlUCSIsCatPe)(tr),Module._xmlUCSIsCatPi=tr=>(Module._xmlUCSIsCatPi=wasmExports.xmlUCSIsCatPi)(tr),Module._xmlUCSIsCatPf=tr=>(Module._xmlUCSIsCatPf=wasmExports.xmlUCSIsCatPf)(tr),Module._xmlUCSIsCatPo=tr=>(Module._xmlUCSIsCatPo=wasmExports.xmlUCSIsCatPo)(tr),Module._xmlUCSIsCatZs=tr=>(Module._xmlUCSIsCatZs=wasmExports.xmlUCSIsCatZs)(tr),Module._xmlUCSIsCatZl=tr=>(Module._xmlUCSIsCatZl=wasmExports.xmlUCSIsCatZl)(tr),Module._xmlUCSIsCatZp=tr=>(Module._xmlUCSIsCatZp=wasmExports.xmlUCSIsCatZp)(tr),Module._xmlUCSIsCatS=tr=>(Module._xmlUCSIsCatS=wasmExports.xmlUCSIsCatS)(tr),Module._xmlUCSIsCatSm=tr=>(Module._xmlUCSIsCatSm=wasmExports.xmlUCSIsCatSm)(tr),Module._xmlUCSIsCatSc=tr=>(Module._xmlUCSIsCatSc=wasmExports.xmlUCSIsCatSc)(tr),Module._xmlUCSIsCatSk=tr=>(Module._xmlUCSIsCatSk=wasmExports.xmlUCSIsCatSk)(tr),Module._xmlUCSIsCatSo=tr=>(Module._xmlUCSIsCatSo=wasmExports.xmlUCSIsCatSo)(tr),Module._xmlUCSIsCatCc=tr=>(Module._xmlUCSIsCatCc=wasmExports.xmlUCSIsCatCc)(tr),Module._xmlUCSIsCatCf=tr=>(Module._xmlUCSIsCatCf=wasmExports.xmlUCSIsCatCf)(tr),Module._xmlUCSIsCatCo=tr=>(Module._xmlUCSIsCatCo=wasmExports.xmlUCSIsCatCo)(tr),Module._xmlUCSIsAegeanNumbers=tr=>(Module._xmlUCSIsAegeanNumbers=wasmExports.xmlUCSIsAegeanNumbers)(tr),Module._xmlUCSIsAlphabeticPresentationForms=tr=>(Module._xmlUCSIsAlphabeticPresentationForms=wasmExports.xmlUCSIsAlphabeticPresentationForms)(tr),Module._xmlUCSIsArabic=tr=>(Module._xmlUCSIsArabic=wasmExports.xmlUCSIsArabic)(tr),Module._xmlUCSIsArabicPresentationFormsA=tr=>(Module._xmlUCSIsArabicPresentationFormsA=wasmExports.xmlUCSIsArabicPresentationFormsA)(tr),Module._xmlUCSIsArabicPresentationFormsB=tr=>(Module._xmlUCSIsArabicPresentationFormsB=wasmExports.xmlUCSIsArabicPresentationFormsB)(tr),Module._xmlUCSIsArmenian=tr=>(Module._xmlUCSIsArmenian=wasmExports.xmlUCSIsArmenian)(tr),Module._xmlUCSIsArrows=tr=>(Module._xmlUCSIsArrows=wasmExports.xmlUCSIsArrows)(tr),Module._xmlUCSIsBasicLatin=tr=>(Module._xmlUCSIsBasicLatin=wasmExports.xmlUCSIsBasicLatin)(tr),Module._xmlUCSIsBengali=tr=>(Module._xmlUCSIsBengali=wasmExports.xmlUCSIsBengali)(tr),Module._xmlUCSIsBlockElements=tr=>(Module._xmlUCSIsBlockElements=wasmExports.xmlUCSIsBlockElements)(tr),Module._xmlUCSIsBopomofo=tr=>(Module._xmlUCSIsBopomofo=wasmExports.xmlUCSIsBopomofo)(tr),Module._xmlUCSIsBopomofoExtended=tr=>(Module._xmlUCSIsBopomofoExtended=wasmExports.xmlUCSIsBopomofoExtended)(tr),Module._xmlUCSIsBoxDrawing=tr=>(Module._xmlUCSIsBoxDrawing=wasmExports.xmlUCSIsBoxDrawing)(tr),Module._xmlUCSIsBraillePatterns=tr=>(Module._xmlUCSIsBraillePatterns=wasmExports.xmlUCSIsBraillePatterns)(tr),Module._xmlUCSIsBuhid=tr=>(Module._xmlUCSIsBuhid=wasmExports.xmlUCSIsBuhid)(tr),Module._xmlUCSIsByzantineMusicalSymbols=tr=>(Module._xmlUCSIsByzantineMusicalSymbols=wasmExports.xmlUCSIsByzantineMusicalSymbols)(tr),Module._xmlUCSIsCJKCompatibility=tr=>(Module._xmlUCSIsCJKCompatibility=wasmExports.xmlUCSIsCJKCompatibility)(tr),Module._xmlUCSIsCJKCompatibilityForms=tr=>(Module._xmlUCSIsCJKCompatibilityForms=wasmExports.xmlUCSIsCJKCompatibilityForms)(tr),Module._xmlUCSIsCJKCompatibilityIdeographs=tr=>(Module._xmlUCSIsCJKCompatibilityIdeographs=wasmExports.xmlUCSIsCJKCompatibilityIdeographs)(tr),Module._xmlUCSIsCJKCompatibilityIdeographsSupplement=tr=>(Module._xmlUCSIsCJKCompatibilityIdeographsSupplement=wasmExports.xmlUCSIsCJKCompatibilityIdeographsSupplement)(tr),Module._xmlUCSIsCJKRadicalsSupplement=tr=>(Module._xmlUCSIsCJKRadicalsSupplement=wasmExports.xmlUCSIsCJKRadicalsSupplement)(tr),Module._xmlUCSIsCJKSymbolsandPunctuation=tr=>(Module._xmlUCSIsCJKSymbolsandPunctuation=wasmExports.xmlUCSIsCJKSymbolsandPunctuation)(tr),Module._xmlUCSIsCJKUnifiedIdeographs=tr=>(Module._xmlUCSIsCJKUnifiedIdeographs=wasmExports.xmlUCSIsCJKUnifiedIdeographs)(tr),Module._xmlUCSIsCJKUnifiedIdeographsExtensionA=tr=>(Module._xmlUCSIsCJKUnifiedIdeographsExtensionA=wasmExports.xmlUCSIsCJKUnifiedIdeographsExtensionA)(tr),Module._xmlUCSIsCJKUnifiedIdeographsExtensionB=tr=>(Module._xmlUCSIsCJKUnifiedIdeographsExtensionB=wasmExports.xmlUCSIsCJKUnifiedIdeographsExtensionB)(tr),Module._xmlUCSIsCherokee=tr=>(Module._xmlUCSIsCherokee=wasmExports.xmlUCSIsCherokee)(tr),Module._xmlUCSIsCombiningDiacriticalMarks=tr=>(Module._xmlUCSIsCombiningDiacriticalMarks=wasmExports.xmlUCSIsCombiningDiacriticalMarks)(tr),Module._xmlUCSIsCombiningDiacriticalMarksforSymbols=tr=>(Module._xmlUCSIsCombiningDiacriticalMarksforSymbols=wasmExports.xmlUCSIsCombiningDiacriticalMarksforSymbols)(tr),Module._xmlUCSIsCombiningHalfMarks=tr=>(Module._xmlUCSIsCombiningHalfMarks=wasmExports.xmlUCSIsCombiningHalfMarks)(tr),Module._xmlUCSIsCombiningMarksforSymbols=tr=>(Module._xmlUCSIsCombiningMarksforSymbols=wasmExports.xmlUCSIsCombiningMarksforSymbols)(tr),Module._xmlUCSIsControlPictures=tr=>(Module._xmlUCSIsControlPictures=wasmExports.xmlUCSIsControlPictures)(tr),Module._xmlUCSIsCurrencySymbols=tr=>(Module._xmlUCSIsCurrencySymbols=wasmExports.xmlUCSIsCurrencySymbols)(tr),Module._xmlUCSIsCypriotSyllabary=tr=>(Module._xmlUCSIsCypriotSyllabary=wasmExports.xmlUCSIsCypriotSyllabary)(tr),Module._xmlUCSIsCyrillic=tr=>(Module._xmlUCSIsCyrillic=wasmExports.xmlUCSIsCyrillic)(tr),Module._xmlUCSIsCyrillicSupplement=tr=>(Module._xmlUCSIsCyrillicSupplement=wasmExports.xmlUCSIsCyrillicSupplement)(tr),Module._xmlUCSIsDeseret=tr=>(Module._xmlUCSIsDeseret=wasmExports.xmlUCSIsDeseret)(tr),Module._xmlUCSIsDevanagari=tr=>(Module._xmlUCSIsDevanagari=wasmExports.xmlUCSIsDevanagari)(tr),Module._xmlUCSIsDingbats=tr=>(Module._xmlUCSIsDingbats=wasmExports.xmlUCSIsDingbats)(tr),Module._xmlUCSIsEnclosedAlphanumerics=tr=>(Module._xmlUCSIsEnclosedAlphanumerics=wasmExports.xmlUCSIsEnclosedAlphanumerics)(tr),Module._xmlUCSIsEnclosedCJKLettersandMonths=tr=>(Module._xmlUCSIsEnclosedCJKLettersandMonths=wasmExports.xmlUCSIsEnclosedCJKLettersandMonths)(tr),Module._xmlUCSIsEthiopic=tr=>(Module._xmlUCSIsEthiopic=wasmExports.xmlUCSIsEthiopic)(tr),Module._xmlUCSIsGeneralPunctuation=tr=>(Module._xmlUCSIsGeneralPunctuation=wasmExports.xmlUCSIsGeneralPunctuation)(tr),Module._xmlUCSIsGeometricShapes=tr=>(Module._xmlUCSIsGeometricShapes=wasmExports.xmlUCSIsGeometricShapes)(tr),Module._xmlUCSIsGeorgian=tr=>(Module._xmlUCSIsGeorgian=wasmExports.xmlUCSIsGeorgian)(tr),Module._xmlUCSIsGothic=tr=>(Module._xmlUCSIsGothic=wasmExports.xmlUCSIsGothic)(tr),Module._xmlUCSIsGreek=tr=>(Module._xmlUCSIsGreek=wasmExports.xmlUCSIsGreek)(tr),Module._xmlUCSIsGreekExtended=tr=>(Module._xmlUCSIsGreekExtended=wasmExports.xmlUCSIsGreekExtended)(tr),Module._xmlUCSIsGreekandCoptic=tr=>(Module._xmlUCSIsGreekandCoptic=wasmExports.xmlUCSIsGreekandCoptic)(tr),Module._xmlUCSIsGujarati=tr=>(Module._xmlUCSIsGujarati=wasmExports.xmlUCSIsGujarati)(tr),Module._xmlUCSIsGurmukhi=tr=>(Module._xmlUCSIsGurmukhi=wasmExports.xmlUCSIsGurmukhi)(tr),Module._xmlUCSIsHalfwidthandFullwidthForms=tr=>(Module._xmlUCSIsHalfwidthandFullwidthForms=wasmExports.xmlUCSIsHalfwidthandFullwidthForms)(tr),Module._xmlUCSIsHangulCompatibilityJamo=tr=>(Module._xmlUCSIsHangulCompatibilityJamo=wasmExports.xmlUCSIsHangulCompatibilityJamo)(tr),Module._xmlUCSIsHangulJamo=tr=>(Module._xmlUCSIsHangulJamo=wasmExports.xmlUCSIsHangulJamo)(tr),Module._xmlUCSIsHangulSyllables=tr=>(Module._xmlUCSIsHangulSyllables=wasmExports.xmlUCSIsHangulSyllables)(tr),Module._xmlUCSIsHanunoo=tr=>(Module._xmlUCSIsHanunoo=wasmExports.xmlUCSIsHanunoo)(tr),Module._xmlUCSIsHebrew=tr=>(Module._xmlUCSIsHebrew=wasmExports.xmlUCSIsHebrew)(tr),Module._xmlUCSIsHighPrivateUseSurrogates=tr=>(Module._xmlUCSIsHighPrivateUseSurrogates=wasmExports.xmlUCSIsHighPrivateUseSurrogates)(tr),Module._xmlUCSIsHighSurrogates=tr=>(Module._xmlUCSIsHighSurrogates=wasmExports.xmlUCSIsHighSurrogates)(tr),Module._xmlUCSIsHiragana=tr=>(Module._xmlUCSIsHiragana=wasmExports.xmlUCSIsHiragana)(tr),Module._xmlUCSIsIPAExtensions=tr=>(Module._xmlUCSIsIPAExtensions=wasmExports.xmlUCSIsIPAExtensions)(tr),Module._xmlUCSIsIdeographicDescriptionCharacters=tr=>(Module._xmlUCSIsIdeographicDescriptionCharacters=wasmExports.xmlUCSIsIdeographicDescriptionCharacters)(tr),Module._xmlUCSIsKanbun=tr=>(Module._xmlUCSIsKanbun=wasmExports.xmlUCSIsKanbun)(tr),Module._xmlUCSIsKangxiRadicals=tr=>(Module._xmlUCSIsKangxiRadicals=wasmExports.xmlUCSIsKangxiRadicals)(tr),Module._xmlUCSIsKannada=tr=>(Module._xmlUCSIsKannada=wasmExports.xmlUCSIsKannada)(tr),Module._xmlUCSIsKatakana=tr=>(Module._xmlUCSIsKatakana=wasmExports.xmlUCSIsKatakana)(tr),Module._xmlUCSIsKatakanaPhoneticExtensions=tr=>(Module._xmlUCSIsKatakanaPhoneticExtensions=wasmExports.xmlUCSIsKatakanaPhoneticExtensions)(tr),Module._xmlUCSIsKhmer=tr=>(Module._xmlUCSIsKhmer=wasmExports.xmlUCSIsKhmer)(tr),Module._xmlUCSIsKhmerSymbols=tr=>(Module._xmlUCSIsKhmerSymbols=wasmExports.xmlUCSIsKhmerSymbols)(tr),Module._xmlUCSIsLao=tr=>(Module._xmlUCSIsLao=wasmExports.xmlUCSIsLao)(tr),Module._xmlUCSIsLatin1Supplement=tr=>(Module._xmlUCSIsLatin1Supplement=wasmExports.xmlUCSIsLatin1Supplement)(tr),Module._xmlUCSIsLatinExtendedA=tr=>(Module._xmlUCSIsLatinExtendedA=wasmExports.xmlUCSIsLatinExtendedA)(tr),Module._xmlUCSIsLatinExtendedB=tr=>(Module._xmlUCSIsLatinExtendedB=wasmExports.xmlUCSIsLatinExtendedB)(tr),Module._xmlUCSIsLatinExtendedAdditional=tr=>(Module._xmlUCSIsLatinExtendedAdditional=wasmExports.xmlUCSIsLatinExtendedAdditional)(tr),Module._xmlUCSIsLetterlikeSymbols=tr=>(Module._xmlUCSIsLetterlikeSymbols=wasmExports.xmlUCSIsLetterlikeSymbols)(tr),Module._xmlUCSIsLimbu=tr=>(Module._xmlUCSIsLimbu=wasmExports.xmlUCSIsLimbu)(tr),Module._xmlUCSIsLinearBIdeograms=tr=>(Module._xmlUCSIsLinearBIdeograms=wasmExports.xmlUCSIsLinearBIdeograms)(tr),Module._xmlUCSIsLinearBSyllabary=tr=>(Module._xmlUCSIsLinearBSyllabary=wasmExports.xmlUCSIsLinearBSyllabary)(tr),Module._xmlUCSIsLowSurrogates=tr=>(Module._xmlUCSIsLowSurrogates=wasmExports.xmlUCSIsLowSurrogates)(tr),Module._xmlUCSIsMalayalam=tr=>(Module._xmlUCSIsMalayalam=wasmExports.xmlUCSIsMalayalam)(tr),Module._xmlUCSIsMathematicalAlphanumericSymbols=tr=>(Module._xmlUCSIsMathematicalAlphanumericSymbols=wasmExports.xmlUCSIsMathematicalAlphanumericSymbols)(tr),Module._xmlUCSIsMathematicalOperators=tr=>(Module._xmlUCSIsMathematicalOperators=wasmExports.xmlUCSIsMathematicalOperators)(tr),Module._xmlUCSIsMiscellaneousMathematicalSymbolsA=tr=>(Module._xmlUCSIsMiscellaneousMathematicalSymbolsA=wasmExports.xmlUCSIsMiscellaneousMathematicalSymbolsA)(tr),Module._xmlUCSIsMiscellaneousMathematicalSymbolsB=tr=>(Module._xmlUCSIsMiscellaneousMathematicalSymbolsB=wasmExports.xmlUCSIsMiscellaneousMathematicalSymbolsB)(tr),Module._xmlUCSIsMiscellaneousSymbols=tr=>(Module._xmlUCSIsMiscellaneousSymbols=wasmExports.xmlUCSIsMiscellaneousSymbols)(tr),Module._xmlUCSIsMiscellaneousSymbolsandArrows=tr=>(Module._xmlUCSIsMiscellaneousSymbolsandArrows=wasmExports.xmlUCSIsMiscellaneousSymbolsandArrows)(tr),Module._xmlUCSIsMiscellaneousTechnical=tr=>(Module._xmlUCSIsMiscellaneousTechnical=wasmExports.xmlUCSIsMiscellaneousTechnical)(tr),Module._xmlUCSIsMongolian=tr=>(Module._xmlUCSIsMongolian=wasmExports.xmlUCSIsMongolian)(tr),Module._xmlUCSIsMusicalSymbols=tr=>(Module._xmlUCSIsMusicalSymbols=wasmExports.xmlUCSIsMusicalSymbols)(tr),Module._xmlUCSIsMyanmar=tr=>(Module._xmlUCSIsMyanmar=wasmExports.xmlUCSIsMyanmar)(tr),Module._xmlUCSIsNumberForms=tr=>(Module._xmlUCSIsNumberForms=wasmExports.xmlUCSIsNumberForms)(tr),Module._xmlUCSIsOgham=tr=>(Module._xmlUCSIsOgham=wasmExports.xmlUCSIsOgham)(tr),Module._xmlUCSIsOldItalic=tr=>(Module._xmlUCSIsOldItalic=wasmExports.xmlUCSIsOldItalic)(tr),Module._xmlUCSIsOpticalCharacterRecognition=tr=>(Module._xmlUCSIsOpticalCharacterRecognition=wasmExports.xmlUCSIsOpticalCharacterRecognition)(tr),Module._xmlUCSIsOriya=tr=>(Module._xmlUCSIsOriya=wasmExports.xmlUCSIsOriya)(tr),Module._xmlUCSIsOsmanya=tr=>(Module._xmlUCSIsOsmanya=wasmExports.xmlUCSIsOsmanya)(tr),Module._xmlUCSIsPhoneticExtensions=tr=>(Module._xmlUCSIsPhoneticExtensions=wasmExports.xmlUCSIsPhoneticExtensions)(tr),Module._xmlUCSIsPrivateUse=tr=>(Module._xmlUCSIsPrivateUse=wasmExports.xmlUCSIsPrivateUse)(tr),Module._xmlUCSIsPrivateUseArea=tr=>(Module._xmlUCSIsPrivateUseArea=wasmExports.xmlUCSIsPrivateUseArea)(tr),Module._xmlUCSIsRunic=tr=>(Module._xmlUCSIsRunic=wasmExports.xmlUCSIsRunic)(tr),Module._xmlUCSIsShavian=tr=>(Module._xmlUCSIsShavian=wasmExports.xmlUCSIsShavian)(tr),Module._xmlUCSIsSinhala=tr=>(Module._xmlUCSIsSinhala=wasmExports.xmlUCSIsSinhala)(tr),Module._xmlUCSIsSmallFormVariants=tr=>(Module._xmlUCSIsSmallFormVariants=wasmExports.xmlUCSIsSmallFormVariants)(tr),Module._xmlUCSIsSpacingModifierLetters=tr=>(Module._xmlUCSIsSpacingModifierLetters=wasmExports.xmlUCSIsSpacingModifierLetters)(tr),Module._xmlUCSIsSpecials=tr=>(Module._xmlUCSIsSpecials=wasmExports.xmlUCSIsSpecials)(tr),Module._xmlUCSIsSuperscriptsandSubscripts=tr=>(Module._xmlUCSIsSuperscriptsandSubscripts=wasmExports.xmlUCSIsSuperscriptsandSubscripts)(tr),Module._xmlUCSIsSupplementalArrowsA=tr=>(Module._xmlUCSIsSupplementalArrowsA=wasmExports.xmlUCSIsSupplementalArrowsA)(tr),Module._xmlUCSIsSupplementalArrowsB=tr=>(Module._xmlUCSIsSupplementalArrowsB=wasmExports.xmlUCSIsSupplementalArrowsB)(tr),Module._xmlUCSIsSupplementalMathematicalOperators=tr=>(Module._xmlUCSIsSupplementalMathematicalOperators=wasmExports.xmlUCSIsSupplementalMathematicalOperators)(tr),Module._xmlUCSIsSupplementaryPrivateUseAreaA=tr=>(Module._xmlUCSIsSupplementaryPrivateUseAreaA=wasmExports.xmlUCSIsSupplementaryPrivateUseAreaA)(tr),Module._xmlUCSIsSupplementaryPrivateUseAreaB=tr=>(Module._xmlUCSIsSupplementaryPrivateUseAreaB=wasmExports.xmlUCSIsSupplementaryPrivateUseAreaB)(tr),Module._xmlUCSIsSyriac=tr=>(Module._xmlUCSIsSyriac=wasmExports.xmlUCSIsSyriac)(tr),Module._xmlUCSIsTagalog=tr=>(Module._xmlUCSIsTagalog=wasmExports.xmlUCSIsTagalog)(tr),Module._xmlUCSIsTagbanwa=tr=>(Module._xmlUCSIsTagbanwa=wasmExports.xmlUCSIsTagbanwa)(tr),Module._xmlUCSIsTags=tr=>(Module._xmlUCSIsTags=wasmExports.xmlUCSIsTags)(tr),Module._xmlUCSIsTaiLe=tr=>(Module._xmlUCSIsTaiLe=wasmExports.xmlUCSIsTaiLe)(tr),Module._xmlUCSIsTaiXuanJingSymbols=tr=>(Module._xmlUCSIsTaiXuanJingSymbols=wasmExports.xmlUCSIsTaiXuanJingSymbols)(tr),Module._xmlUCSIsTamil=tr=>(Module._xmlUCSIsTamil=wasmExports.xmlUCSIsTamil)(tr),Module._xmlUCSIsTelugu=tr=>(Module._xmlUCSIsTelugu=wasmExports.xmlUCSIsTelugu)(tr),Module._xmlUCSIsThaana=tr=>(Module._xmlUCSIsThaana=wasmExports.xmlUCSIsThaana)(tr),Module._xmlUCSIsThai=tr=>(Module._xmlUCSIsThai=wasmExports.xmlUCSIsThai)(tr),Module._xmlUCSIsTibetan=tr=>(Module._xmlUCSIsTibetan=wasmExports.xmlUCSIsTibetan)(tr),Module._xmlUCSIsUgaritic=tr=>(Module._xmlUCSIsUgaritic=wasmExports.xmlUCSIsUgaritic)(tr),Module._xmlUCSIsUnifiedCanadianAboriginalSyllabics=tr=>(Module._xmlUCSIsUnifiedCanadianAboriginalSyllabics=wasmExports.xmlUCSIsUnifiedCanadianAboriginalSyllabics)(tr),Module._xmlUCSIsVariationSelectors=tr=>(Module._xmlUCSIsVariationSelectors=wasmExports.xmlUCSIsVariationSelectors)(tr),Module._xmlUCSIsVariationSelectorsSupplement=tr=>(Module._xmlUCSIsVariationSelectorsSupplement=wasmExports.xmlUCSIsVariationSelectorsSupplement)(tr),Module._xmlUCSIsYiRadicals=tr=>(Module._xmlUCSIsYiRadicals=wasmExports.xmlUCSIsYiRadicals)(tr),Module._xmlUCSIsYiSyllables=tr=>(Module._xmlUCSIsYiSyllables=wasmExports.xmlUCSIsYiSyllables)(tr),Module._xmlUCSIsYijingHexagramSymbols=tr=>(Module._xmlUCSIsYijingHexagramSymbols=wasmExports.xmlUCSIsYijingHexagramSymbols)(tr),Module._xmlUCSIsCatCs=tr=>(Module._xmlUCSIsCatCs=wasmExports.xmlUCSIsCatCs)(tr),Module.___small_fprintf=(tr,rr,ir)=>(Module.___small_fprintf=wasmExports.__small_fprintf)(tr,rr,ir),Module._xmlXPathBooleanFunction=(tr,rr)=>(Module._xmlXPathBooleanFunction=wasmExports.xmlXPathBooleanFunction)(tr,rr),Module._xmlXPathCeilingFunction=(tr,rr)=>(Module._xmlXPathCeilingFunction=wasmExports.xmlXPathCeilingFunction)(tr,rr),Module._xmlXPathCountFunction=(tr,rr)=>(Module._xmlXPathCountFunction=wasmExports.xmlXPathCountFunction)(tr,rr),Module._xmlXPathConcatFunction=(tr,rr)=>(Module._xmlXPathConcatFunction=wasmExports.xmlXPathConcatFunction)(tr,rr),Module._xmlXPathContainsFunction=(tr,rr)=>(Module._xmlXPathContainsFunction=wasmExports.xmlXPathContainsFunction)(tr,rr),Module._xmlXPathIdFunction=(tr,rr)=>(Module._xmlXPathIdFunction=wasmExports.xmlXPathIdFunction)(tr,rr),Module._xmlXPathFalseFunction=(tr,rr)=>(Module._xmlXPathFalseFunction=wasmExports.xmlXPathFalseFunction)(tr,rr),Module._xmlXPathFloorFunction=(tr,rr)=>(Module._xmlXPathFloorFunction=wasmExports.xmlXPathFloorFunction)(tr,rr),Module._xmlXPathLastFunction=(tr,rr)=>(Module._xmlXPathLastFunction=wasmExports.xmlXPathLastFunction)(tr,rr),Module._xmlXPathLangFunction=(tr,rr)=>(Module._xmlXPathLangFunction=wasmExports.xmlXPathLangFunction)(tr,rr),Module._xmlXPathLocalNameFunction=(tr,rr)=>(Module._xmlXPathLocalNameFunction=wasmExports.xmlXPathLocalNameFunction)(tr,rr),Module._xmlXPathNotFunction=(tr,rr)=>(Module._xmlXPathNotFunction=wasmExports.xmlXPathNotFunction)(tr,rr),Module._xmlXPathNamespaceURIFunction=(tr,rr)=>(Module._xmlXPathNamespaceURIFunction=wasmExports.xmlXPathNamespaceURIFunction)(tr,rr),Module._xmlXPathNormalizeFunction=(tr,rr)=>(Module._xmlXPathNormalizeFunction=wasmExports.xmlXPathNormalizeFunction)(tr,rr),Module._xmlXPathNumberFunction=(tr,rr)=>(Module._xmlXPathNumberFunction=wasmExports.xmlXPathNumberFunction)(tr,rr),Module._xmlXPathPositionFunction=(tr,rr)=>(Module._xmlXPathPositionFunction=wasmExports.xmlXPathPositionFunction)(tr,rr),Module._xmlXPathRoundFunction=(tr,rr)=>(Module._xmlXPathRoundFunction=wasmExports.xmlXPathRoundFunction)(tr,rr),Module._xmlXPathStringFunction=(tr,rr)=>(Module._xmlXPathStringFunction=wasmExports.xmlXPathStringFunction)(tr,rr),Module._xmlXPathStringLengthFunction=(tr,rr)=>(Module._xmlXPathStringLengthFunction=wasmExports.xmlXPathStringLengthFunction)(tr,rr),Module._xmlXPathStartsWithFunction=(tr,rr)=>(Module._xmlXPathStartsWithFunction=wasmExports.xmlXPathStartsWithFunction)(tr,rr),Module._xmlXPathSubstringFunction=(tr,rr)=>(Module._xmlXPathSubstringFunction=wasmExports.xmlXPathSubstringFunction)(tr,rr),Module._xmlXPathSubstringBeforeFunction=(tr,rr)=>(Module._xmlXPathSubstringBeforeFunction=wasmExports.xmlXPathSubstringBeforeFunction)(tr,rr),Module._xmlXPathSubstringAfterFunction=(tr,rr)=>(Module._xmlXPathSubstringAfterFunction=wasmExports.xmlXPathSubstringAfterFunction)(tr,rr),Module._xmlXPathSumFunction=(tr,rr)=>(Module._xmlXPathSumFunction=wasmExports.xmlXPathSumFunction)(tr,rr),Module._xmlXPathTrueFunction=(tr,rr)=>(Module._xmlXPathTrueFunction=wasmExports.xmlXPathTrueFunction)(tr,rr),Module._xmlXPathTranslateFunction=(tr,rr)=>(Module._xmlXPathTranslateFunction=wasmExports.xmlXPathTranslateFunction)(tr,rr),Module._xmlXPathNextSelf=(tr,rr)=>(Module._xmlXPathNextSelf=wasmExports.xmlXPathNextSelf)(tr,rr),Module._xmlXPathNextChild=(tr,rr)=>(Module._xmlXPathNextChild=wasmExports.xmlXPathNextChild)(tr,rr),Module._xmlXPathNextDescendant=(tr,rr)=>(Module._xmlXPathNextDescendant=wasmExports.xmlXPathNextDescendant)(tr,rr),Module._xmlXPathNextDescendantOrSelf=(tr,rr)=>(Module._xmlXPathNextDescendantOrSelf=wasmExports.xmlXPathNextDescendantOrSelf)(tr,rr),Module._xmlXPathNextParent=(tr,rr)=>(Module._xmlXPathNextParent=wasmExports.xmlXPathNextParent)(tr,rr),Module._xmlXPathNextAncestor=(tr,rr)=>(Module._xmlXPathNextAncestor=wasmExports.xmlXPathNextAncestor)(tr,rr),Module._xmlXPathNextAncestorOrSelf=(tr,rr)=>(Module._xmlXPathNextAncestorOrSelf=wasmExports.xmlXPathNextAncestorOrSelf)(tr,rr),Module._xmlXPathNextFollowingSibling=(tr,rr)=>(Module._xmlXPathNextFollowingSibling=wasmExports.xmlXPathNextFollowingSibling)(tr,rr),Module._xmlXPathNextPrecedingSibling=(tr,rr)=>(Module._xmlXPathNextPrecedingSibling=wasmExports.xmlXPathNextPrecedingSibling)(tr,rr),Module._xmlXPathNextFollowing=(tr,rr)=>(Module._xmlXPathNextFollowing=wasmExports.xmlXPathNextFollowing)(tr,rr),Module._xmlXPathNextNamespace=(tr,rr)=>(Module._xmlXPathNextNamespace=wasmExports.xmlXPathNextNamespace)(tr,rr),Module._xmlXPathNextAttribute=(tr,rr)=>(Module._xmlXPathNextAttribute=wasmExports.xmlXPathNextAttribute)(tr,rr),Module._zcalloc=(tr,rr,ir)=>(Module._zcalloc=wasmExports.zcalloc)(tr,rr,ir),Module._zcfree=(tr,rr)=>(Module._zcfree=wasmExports.zcfree)(tr,rr),Module._strerror=tr=>(Module._strerror=wasmExports.strerror)(tr);var ___dl_seterr=(tr,rr)=>(___dl_seterr=wasmExports.__dl_seterr)(tr,rr);Module._putc=(tr,rr)=>(Module._putc=wasmExports.putc)(tr,rr),Module._gmtime=tr=>(Module._gmtime=wasmExports.gmtime)(tr);var _htonl=tr=>(_htonl=wasmExports.htonl)(tr),_htons=tr=>(_htons=wasmExports.htons)(tr);Module._ioctl=(tr,rr,ir)=>(Module._ioctl=wasmExports.ioctl)(tr,rr,ir);var _emscripten_builtin_memalign=(tr,rr)=>(_emscripten_builtin_memalign=wasmExports.emscripten_builtin_memalign)(tr,rr),_ntohs=tr=>(_ntohs=wasmExports.ntohs)(tr);Module._srand=tr=>(Module._srand=wasmExports.srand)(tr),Module._rand=()=>(Module._rand=wasmExports.rand)();var __emscripten_timeout=(tr,rr)=>(__emscripten_timeout=wasmExports._emscripten_timeout)(tr,rr);Module.___floatsitf=(tr,rr)=>(Module.___floatsitf=wasmExports.__floatsitf)(tr,rr),Module.___multf3=(tr,rr,ir,lr,dr)=>(Module.___multf3=wasmExports.__multf3)(tr,rr,ir,lr,dr),Module.___extenddftf2=(tr,rr)=>(Module.___extenddftf2=wasmExports.__extenddftf2)(tr,rr),Module.___getf2=(tr,rr,ir,lr)=>(Module.___getf2=wasmExports.__getf2)(tr,rr,ir,lr),Module.___subtf3=(tr,rr,ir,lr,dr)=>(Module.___subtf3=wasmExports.__subtf3)(tr,rr,ir,lr,dr),Module.___letf2=(tr,rr,ir,lr)=>(Module.___letf2=wasmExports.__letf2)(tr,rr,ir,lr),Module.___lttf2=(tr,rr,ir,lr)=>(Module.___lttf2=wasmExports.__lttf2)(tr,rr,ir,lr);var _setThrew=(tr,rr)=>(_setThrew=wasmExports.setThrew)(tr,rr),__emscripten_tempret_set=tr=>(__emscripten_tempret_set=wasmExports._emscripten_tempret_set)(tr),__emscripten_tempret_get=()=>(__emscripten_tempret_get=wasmExports._emscripten_tempret_get)();Module.___fixtfsi=(tr,rr)=>(Module.___fixtfsi=wasmExports.__fixtfsi)(tr,rr);var __emscripten_stack_restore=tr=>(__emscripten_stack_restore=wasmExports._emscripten_stack_restore)(tr),__emscripten_stack_alloc=tr=>(__emscripten_stack_alloc=wasmExports._emscripten_stack_alloc)(tr),_emscripten_stack_get_current=()=>(_emscripten_stack_get_current=wasmExports.emscripten_stack_get_current)();Module._ScanKeywords=18770052,Module._stderr=18792480,Module._stdout=18792784,Module._TopMemoryContext=18830716,Module._MainLWLockArray=18800668,Module._MyProc=18802328,Module._MyProcPid=18824228,Module._MyLatch=18824260,Module._CurrentMemoryContext=18830712,Module._InterruptPending=18824092,Module._pg_global_prng_state=18936304,Module._CurrentResourceOwner=18830692,Module._InterruptHoldoffCount=18824132,Module._IsUnderPostmaster=18824165,Module._wal_level=18758340,Module._MyDatabaseId=18824148,Module._error_context_stack=18816816,Module._PG_exception_stack=18816820,Module.___THREW__=18950052,Module.___threwValue=18950056,Module._ShmemVariableCache=18849760,Module._shmem_startup_hook=18794508,Module._debug_query_string=18848300,Module._CritSectionCount=18824140,Module._old_snapshot_threshold=18823756,Module._TopTransactionResourceOwner=18830700,Module._LocalBufferBlockPointers=18800556,Module._BufferBlocks=18795304,Module._pgBufferUsage=18813728,Module._GUC_check_errdetail_string=18814680,Module._NBuffers=18690456,Module._BufferDescriptors=18795300,Module._ParallelWorkerNumber=18767008,Module._stdin=18792632,Module._ScanKeywordTokens=17487664,Module._post_parse_analyze_hook=18802584,Module._progname=18848060,Module._DataDir=18824144,Module._MyStartTime=18824232,Module._MyProcPort=18824248,Module._Log_directory=18803120,Module._Log_filename=18803124,Module._ConfigReloadPending=18803272,Module._ShutdownRequestPending=18803276,Module._process_shared_preload_libraries_in_progress=18824080,Module._wal_segment_size=18758360,Module._application_name=18815988,Module._XactIsoLevel=18758700,Module._RmgrTable=18758816,Module._CacheMemoryContext=18830728,Module._TopTransactionContext=18830736,Module._TTSOpsVirtual=18638668,Module._WalReceiverFunctions=18803712,Module._TTSOpsMinimalTuple=18638764,Module._cluster_name=18640444,Module._work_mem=18690432,Module._ClientAuthentication_hook=18804032,Module._cma_rsize=18848108,Module._SOCKET_DATA=18854312,Module._SOCKET_FILE=18854308,Module._TTSOpsHeapTuple=18638716,Module._SnapshotAnyData=18690240,Module._ExecutorStart_hook=18813600,Module._ExecutorRun_hook=18813604,Module._ExecutorFinish_hook=18813608,Module._ExecutorEnd_hook=18813612,Module._SPI_processed=18813624,Module._SPI_tuptable=18813632,Module._SPI_result=18813636,Module._pgWalUsage=18813840,Module._cpu_operator_cost=18638912,Module._planner_hook=18813876,Module._maintenance_work_mem=18690448,Module._max_parallel_maintenance_workers=18690452,Module._cpu_tuple_cost=18638896,Module._seq_page_cost=18638880,Module._check_function_bodies=18640389,Module._quote_all_identifiers=18848065,Module._extra_float_digits=18692128,Module._IntervalStyle=18824172,Module._pg_crc32_table=18115504,Module._oldSnapshotControl=18823760,Module._shmem_request_hook=18824084,Module._DateStyle=18690420,Module._pg_number_of_ones=18433360,Module._xmlStructuredError=18936668,Module._xmlStructuredErrorContext=18936676,Module._xmlGenericErrorContext=18936672,Module._xmlGenericError=18774356,Module._xmlIsBaseCharGroup=18774120,Module._xmlIsDigitGroup=18774152,Module._xmlIsCombiningGroup=18774136,Module._xmlIsExtenderGroup=18774168,Module._xmlFree=18774320,Module._ProcessUtility_hook=18848012,Module._single_mode_feed=18848076,Module._cma_wsize=18848116,Module._check_password_hook=18850784,Module._IDB_STAGE=18854320,Module._IDB_PIPE_FP=18854316,Module._pg_scram_mech=18774064,Module._pg_g_threadlock=18772168,Module._pgresStatus=18773856,Module._xmlIsPubidChar_tab=18433648,Module._xmlGetWarningsDefaultValue=18774348,Module._xmlMalloc=18774324,Module._xmlRealloc=18774332,Module._xmlLastError=18936688,Module._xmlMallocAtomic=18774328,Module._xmlMemStrdup=18774336,Module._xmlBufferAllocScheme=18774340,Module._xmlDefaultBufferSize=18774344,Module._xmlParserDebugEntities=18936628,Module._xmlDoValidityCheckingDefaultValue=18936632,Module._xmlLoadExtDtdDefaultValue=18936636,Module._xmlPedanticParserDefaultValue=18936640,Module._xmlLineNumbersDefaultValue=18936644,Module._xmlKeepBlanksDefaultValue=18774352,Module._xmlSubstituteEntitiesDefaultValue=18936648,Module._xmlRegisterNodeDefaultValue=18936652,Module._xmlDeregisterNodeDefaultValue=18936656,Module._xmlParserInputBufferCreateFilenameValue=18936660,Module._xmlOutputBufferCreateFilenameValue=18936664,Module._xmlIndentTreeOutput=18774360,Module._xmlTreeIndentString=18774364,Module._xmlSaveNoEmptyTags=18936680,Module._xmlDefaultSAXHandler=18774368,Module._xmlDefaultSAXLocator=18774480,Module._xmlParserMaxDepth=18775140,Module._xmlStringText=18435456,Module._xmlStringComment=18435471,Module._xmlStringTextNoenc=18435461,Module._xmlXPathNAN=18937352,Module._xmlXPathNINF=18937368,Module._xmlXPathPINF=18937360,Module._z_errmsg=18791696,Module.__length_code=18455120,Module.__dist_code=18454608;function invoke_i(tr){var rr=stackSave();try{return getWasmTableEntry(tr)()}catch(ir){if(stackRestore(rr),ir!==ir+0)throw ir;_setThrew(1,0)}}function invoke_v(tr){var rr=stackSave();try{getWasmTableEntry(tr)()}catch(ir){if(stackRestore(rr),ir!==ir+0)throw ir;_setThrew(1,0)}}function invoke_vi(tr,rr){var ir=stackSave();try{getWasmTableEntry(tr)(rr)}catch(lr){if(stackRestore(ir),lr!==lr+0)throw lr;_setThrew(1,0)}}function invoke_iii(tr,rr,ir){var lr=stackSave();try{return getWasmTableEntry(tr)(rr,ir)}catch(dr){if(stackRestore(lr),dr!==dr+0)throw dr;_setThrew(1,0)}}function invoke_iiiiii(tr,rr,ir,lr,dr,fr){var hr=stackSave();try{return getWasmTableEntry(tr)(rr,ir,lr,dr,fr)}catch(mr){if(stackRestore(hr),mr!==mr+0)throw mr;_setThrew(1,0)}}function invoke_viii(tr,rr,ir,lr){var dr=stackSave();try{getWasmTableEntry(tr)(rr,ir,lr)}catch(fr){if(stackRestore(dr),fr!==fr+0)throw fr;_setThrew(1,0)}}function invoke_viiiiiii(tr,rr,ir,lr,dr,fr,hr,mr){var gr=stackSave();try{getWasmTableEntry(tr)(rr,ir,lr,dr,fr,hr,mr)}catch(yr){if(stackRestore(gr),yr!==yr+0)throw yr;_setThrew(1,0)}}function invoke_iiii(tr,rr,ir,lr){var dr=stackSave();try{return getWasmTableEntry(tr)(rr,ir,lr)}catch(fr){if(stackRestore(dr),fr!==fr+0)throw fr;_setThrew(1,0)}}function invoke_viiii(tr,rr,ir,lr,dr){var fr=stackSave();try{getWasmTableEntry(tr)(rr,ir,lr,dr)}catch(hr){if(stackRestore(fr),hr!==hr+0)throw hr;_setThrew(1,0)}}function invoke_iiiii(tr,rr,ir,lr,dr){var fr=stackSave();try{return getWasmTableEntry(tr)(rr,ir,lr,dr)}catch(hr){if(stackRestore(fr),hr!==hr+0)throw hr;_setThrew(1,0)}}function invoke_vii(tr,rr,ir){var lr=stackSave();try{getWasmTableEntry(tr)(rr,ir)}catch(dr){if(stackRestore(lr),dr!==dr+0)throw dr;_setThrew(1,0)}}function invoke_ii(tr,rr){var ir=stackSave();try{return getWasmTableEntry(tr)(rr)}catch(lr){if(stackRestore(ir),lr!==lr+0)throw lr;_setThrew(1,0)}}function invoke_viiiiiiii(tr,rr,ir,lr,dr,fr,hr,mr,gr){var yr=stackSave();try{getWasmTableEntry(tr)(rr,ir,lr,dr,fr,hr,mr,gr)}catch(_r){if(stackRestore(yr),_r!==_r+0)throw _r;_setThrew(1,0)}}function invoke_viiiii(tr,rr,ir,lr,dr,fr){var hr=stackSave();try{getWasmTableEntry(tr)(rr,ir,lr,dr,fr)}catch(mr){if(stackRestore(hr),mr!==mr+0)throw mr;_setThrew(1,0)}}function invoke_ij(tr,rr){var ir=stackSave();try{return getWasmTableEntry(tr)(rr)}catch(lr){if(stackRestore(ir),lr!==lr+0)throw lr;_setThrew(1,0)}}function invoke_ji(tr,rr){var ir=stackSave();try{return getWasmTableEntry(tr)(rr)}catch(lr){if(stackRestore(ir),lr!==lr+0)throw lr;return _setThrew(1,0),0n}}function invoke_ijiiiiii(tr,rr,ir,lr,dr,fr,hr,mr){var gr=stackSave();try{return getWasmTableEntry(tr)(rr,ir,lr,dr,fr,hr,mr)}catch(yr){if(stackRestore(gr),yr!==yr+0)throw yr;_setThrew(1,0)}}function invoke_vij(tr,rr,ir){var lr=stackSave();try{getWasmTableEntry(tr)(rr,ir)}catch(dr){if(stackRestore(lr),dr!==dr+0)throw dr;_setThrew(1,0)}}function invoke_vj(tr,rr){var ir=stackSave();try{getWasmTableEntry(tr)(rr)}catch(lr){if(stackRestore(ir),lr!==lr+0)throw lr;_setThrew(1,0)}}function invoke_viijii(tr,rr,ir,lr,dr,fr){var hr=stackSave();try{getWasmTableEntry(tr)(rr,ir,lr,dr,fr)}catch(mr){if(stackRestore(hr),mr!==mr+0)throw mr;_setThrew(1,0)}}function invoke_iiiiiji(tr,rr,ir,lr,dr,fr,hr){var mr=stackSave();try{return getWasmTableEntry(tr)(rr,ir,lr,dr,fr,hr)}catch(gr){if(stackRestore(mr),gr!==gr+0)throw gr;_setThrew(1,0)}}function invoke_viijiiii(tr,rr,ir,lr,dr,fr,hr,mr){var gr=stackSave();try{getWasmTableEntry(tr)(rr,ir,lr,dr,fr,hr,mr)}catch(yr){if(stackRestore(gr),yr!==yr+0)throw yr;_setThrew(1,0)}}function invoke_viij(tr,rr,ir,lr){var dr=stackSave();try{getWasmTableEntry(tr)(rr,ir,lr)}catch(fr){if(stackRestore(dr),fr!==fr+0)throw fr;_setThrew(1,0)}}function invoke_jiiiiiiii(tr,rr,ir,lr,dr,fr,hr,mr,gr){var yr=stackSave();try{return getWasmTableEntry(tr)(rr,ir,lr,dr,fr,hr,mr,gr)}catch(_r){if(stackRestore(yr),_r!==_r+0)throw _r;return _setThrew(1,0),0n}}function invoke_jiiiii(tr,rr,ir,lr,dr,fr){var hr=stackSave();try{return getWasmTableEntry(tr)(rr,ir,lr,dr,fr)}catch(mr){if(stackRestore(hr),mr!==mr+0)throw mr;return _setThrew(1,0),0n}}function invoke_iiiiiiiii(tr,rr,ir,lr,dr,fr,hr,mr,gr){var yr=stackSave();try{return getWasmTableEntry(tr)(rr,ir,lr,dr,fr,hr,mr,gr)}catch(_r){if(stackRestore(yr),_r!==_r+0)throw _r;_setThrew(1,0)}}function invoke_vji(tr,rr,ir){var lr=stackSave();try{getWasmTableEntry(tr)(rr,ir)}catch(dr){if(stackRestore(lr),dr!==dr+0)throw dr;_setThrew(1,0)}}function invoke_iiiijii(tr,rr,ir,lr,dr,fr,hr){var mr=stackSave();try{return getWasmTableEntry(tr)(rr,ir,lr,dr,fr,hr)}catch(gr){if(stackRestore(mr),gr!==gr+0)throw gr;_setThrew(1,0)}}function invoke_vijiji(tr,rr,ir,lr,dr,fr){var hr=stackSave();try{getWasmTableEntry(tr)(rr,ir,lr,dr,fr)}catch(mr){if(stackRestore(hr),mr!==mr+0)throw mr;_setThrew(1,0)}}function invoke_viji(tr,rr,ir,lr){var dr=stackSave();try{getWasmTableEntry(tr)(rr,ir,lr)}catch(fr){if(stackRestore(dr),fr!==fr+0)throw fr;_setThrew(1,0)}}function invoke_iiij(tr,rr,ir,lr){var dr=stackSave();try{return getWasmTableEntry(tr)(rr,ir,lr)}catch(fr){if(stackRestore(dr),fr!==fr+0)throw fr;_setThrew(1,0)}}function invoke_iiiiiiii(tr,rr,ir,lr,dr,fr,hr,mr){var gr=stackSave();try{return getWasmTableEntry(tr)(rr,ir,lr,dr,fr,hr,mr)}catch(yr){if(stackRestore(gr),yr!==yr+0)throw yr;_setThrew(1,0)}}function invoke_iiiiiii(tr,rr,ir,lr,dr,fr,hr){var mr=stackSave();try{return getWasmTableEntry(tr)(rr,ir,lr,dr,fr,hr)}catch(gr){if(stackRestore(mr),gr!==gr+0)throw gr;_setThrew(1,0)}}function invoke_di(tr,rr){var ir=stackSave();try{return getWasmTableEntry(tr)(rr)}catch(lr){if(stackRestore(ir),lr!==lr+0)throw lr;_setThrew(1,0)}}function invoke_id(tr,rr){var ir=stackSave();try{return getWasmTableEntry(tr)(rr)}catch(lr){if(stackRestore(ir),lr!==lr+0)throw lr;_setThrew(1,0)}}function invoke_ijiiiii(tr,rr,ir,lr,dr,fr,hr){var mr=stackSave();try{return getWasmTableEntry(tr)(rr,ir,lr,dr,fr,hr)}catch(gr){if(stackRestore(mr),gr!==gr+0)throw gr;_setThrew(1,0)}}function invoke_jiiii(tr,rr,ir,lr,dr){var fr=stackSave();try{return getWasmTableEntry(tr)(rr,ir,lr,dr)}catch(hr){if(stackRestore(fr),hr!==hr+0)throw hr;return _setThrew(1,0),0n}}function invoke_viiiiii(tr,rr,ir,lr,dr,fr,hr){var mr=stackSave();try{getWasmTableEntry(tr)(rr,ir,lr,dr,fr,hr)}catch(gr){if(stackRestore(mr),gr!==gr+0)throw gr;_setThrew(1,0)}}function invoke_viiiiiiiiiiii(tr,rr,ir,lr,dr,fr,hr,mr,gr,yr,_r,br,vr){var wr=stackSave();try{getWasmTableEntry(tr)(rr,ir,lr,dr,fr,hr,mr,gr,yr,_r,br,vr)}catch(xr){if(stackRestore(wr),xr!==xr+0)throw xr;_setThrew(1,0)}}function invoke_jii(tr,rr,ir){var lr=stackSave();try{return getWasmTableEntry(tr)(rr,ir)}catch(dr){if(stackRestore(lr),dr!==dr+0)throw dr;return _setThrew(1,0),0n}}function invoke_iiiij(tr,rr,ir,lr,dr){var fr=stackSave();try{return getWasmTableEntry(tr)(rr,ir,lr,dr)}catch(hr){if(stackRestore(fr),hr!==hr+0)throw hr;_setThrew(1,0)}}function invoke_iiiiiiiiii(tr,rr,ir,lr,dr,fr,hr,mr,gr,yr){var _r=stackSave();try{return getWasmTableEntry(tr)(rr,ir,lr,dr,fr,hr,mr,gr,yr)}catch(br){if(stackRestore(_r),br!==br+0)throw br;_setThrew(1,0)}}function invoke_viiji(tr,rr,ir,lr,dr){var fr=stackSave();try{getWasmTableEntry(tr)(rr,ir,lr,dr)}catch(hr){if(stackRestore(fr),hr!==hr+0)throw hr;_setThrew(1,0)}}function invoke_iiji(tr,rr,ir,lr){var dr=stackSave();try{return getWasmTableEntry(tr)(rr,ir,lr)}catch(fr){if(stackRestore(dr),fr!==fr+0)throw fr;_setThrew(1,0)}}function invoke_vid(tr,rr,ir){var lr=stackSave();try{getWasmTableEntry(tr)(rr,ir)}catch(dr){if(stackRestore(lr),dr!==dr+0)throw dr;_setThrew(1,0)}}function invoke_viiiiiiiii(tr,rr,ir,lr,dr,fr,hr,mr,gr,yr){var _r=stackSave();try{getWasmTableEntry(tr)(rr,ir,lr,dr,fr,hr,mr,gr,yr)}catch(br){if(stackRestore(_r),br!==br+0)throw br;_setThrew(1,0)}}function invoke_viiij(tr,rr,ir,lr,dr){var fr=stackSave();try{getWasmTableEntry(tr)(rr,ir,lr,dr)}catch(hr){if(stackRestore(fr),hr!==hr+0)throw hr;_setThrew(1,0)}}function invoke_iiiiiiiiiiiiiiiii(tr,rr,ir,lr,dr,fr,hr,mr,gr,yr,_r,br,vr,wr,xr,Sr,Ar){var Ir=stackSave();try{return getWasmTableEntry(tr)(rr,ir,lr,dr,fr,hr,mr,gr,yr,_r,br,vr,wr,xr,Sr,Ar)}catch(Mr){if(stackRestore(Ir),Mr!==Mr+0)throw Mr;_setThrew(1,0)}}Module.addRunDependency=addRunDependency,Module.removeRunDependency=removeRunDependency,Module.callMain=callMain,Module.ccall=ccall,Module.cwrap=cwrap,Module.setValue=setValue,Module.getValue=getValue,Module.UTF8ToString=UTF8ToString,Module.stringToNewUTF8=stringToNewUTF8,Module.stringToUTF8OnStack=stringToUTF8OnStack,Module.FS_createPreloadedFile=FS_createPreloadedFile,Module.FS_unlink=FS_unlink,Module.FS_createPath=FS_createPath,Module.FS_createDevice=FS_createDevice,Module.FS=FS,Module.FS_createDataFile=FS_createDataFile,Module.FS_createLazyFile=FS_createLazyFile;var calledRun;dependenciesFulfilled=function tr(){calledRun||run(),calledRun||(dependenciesFulfilled=tr)};function callMain(tr=[]){var rr=resolveGlobalSymbol("main").sym;if(rr){tr.unshift(thisProgram);var ir=tr.length,lr=stackAlloc((ir+1)*4),dr=lr;tr.forEach(hr=>{HEAPU32[dr>>2]=stringToUTF8OnStack(hr),dr+=4}),HEAPU32[dr>>2]=0;try{var fr=rr(ir,lr);return exitJS(fr),fr}catch(hr){return handleException(hr)}}}function run(tr=arguments_){if(runDependencies>0||(preRun(),runDependencies>0))return;function rr(){var ir;calledRun||(calledRun=!0,Module.calledRun=!0,!ABORT&&(initRuntime(),preMain(),readyPromiseResolve(Module),(ir=Module.onRuntimeInitialized)==null||ir.call(Module),shouldRunNow&&callMain(tr),postRun()))}Module.setStatus?(Module.setStatus("Running..."),setTimeout(()=>{setTimeout(()=>Module.setStatus(""),1),rr()},1)):rr()}if(Module.preInit)for(typeof Module.preInit=="function"&&(Module.preInit=[Module.preInit]);Module.preInit.length>0;)Module.preInit.pop()();var shouldRunNow=!0;return Module.noInitialRun&&(shouldRunNow=!1),run(),moduleRtn=readyPromise,moduleRtn}})(),ke=Qe,Te=ke,Y,W,j$1,J,$$1,_e,ie,me,Z,ae,oe,se,V,G,k$1,K,O$1,qe,re,pe=class nd extends z$1{constructor(rr={},ir={}){super(),R$3(this,O$1),R$3(this,Y,!1),R$3(this,W,!1),R$3(this,j$1,!1),R$3(this,J,!1),R$3(this,$$1,!1),R$3(this,_e,new H$1),R$3(this,ie,new H$1),R$3(this,me,new H$1),R$3(this,Z,!1),this.debug=0,R$3(this,ae),R$3(this,oe,[]),R$3(this,se,new ye),R$3(this,V),R$3(this,G),R$3(this,k$1,new Map),R$3(this,K,new Set),typeof rr=="string"?ir={dataDir:rr,...ir}:ir=rr,this.dataDir=ir.dataDir,ir.parsers!==void 0&&(this.parsers={...this.parsers,...ir.parsers}),ir.serializers!==void 0&&(this.serializers={...this.serializers,...ir.serializers}),(ir==null?void 0:ir.debug)!==void 0&&(this.debug=ir.debug),(ir==null?void 0:ir.relaxedDurability)!==void 0&&x$3(this,$$1,ir.relaxedDurability),x$3(this,ae,ir.extensions??{}),this.waitReady=T$1(this,O$1,qe).call(this,ir??{})}static async create(rr,ir){let lr=typeof rr=="string"?{dataDir:rr,...ir??{}}:rr??{},dr=new nd(lr);return await dr.waitReady,dr}get Module(){return this.mod}get ready(){return h$2(this,Y)&&!h$2(this,W)&&!h$2(this,j$1)}get closed(){return h$2(this,j$1)}async close(){await this._checkReady(),x$3(this,W,!0);for(let rr of h$2(this,oe))await rr();try{await this.execProtocol(O$2.end()),this.mod._pg_shutdown()}catch(rr){let ir=rr;if(!(ir.name==="ExitStatus"&&ir.status===0))throw rr}await this.fs.closeFs(),x$3(this,j$1,!0),x$3(this,W,!1)}async[Symbol.asyncDispose](){await this.close()}async _handleBlob(rr){x$3(this,V,rr?await rr.arrayBuffer():void 0)}async _cleanupBlob(){x$3(this,V,void 0)}async _getWrittenBlob(){if(!h$2(this,G))return;let rr=new Blob(h$2(this,G));return x$3(this,G,void 0),rr}async _checkReady(){if(h$2(this,W))throw new Error("PGlite is closing");if(h$2(this,j$1))throw new Error("PGlite is closed");h$2(this,Y)||await this.waitReady}execProtocolRawSync(rr){let ir=rr.length,lr=this.mod;lr._interactive_write(ir),lr.HEAPU8.set(rr,1),lr._interactive_one();let dr=ir+2,fr=dr+lr._interactive_read();return lr.HEAPU8.subarray(dr,fr)}async execProtocolRaw(rr,{syncToFs:ir=!0}={}){let lr=rr.length,dr=this.mod;dr._interactive_write(lr),dr.HEAPU8.set(rr,1),dr._interactive_one();let fr=lr+2,hr=fr+dr._interactive_read(),mr=dr.HEAPU8.subarray(fr,hr);return ir&&await this.syncToFs(),mr}async execProtocol(rr,{syncToFs:ir=!0,throwOnError:lr=!0,onNotice:dr}={}){let fr=await this.execProtocolRaw(rr,{syncToFs:ir}),hr=[];return h$2(this,se).parse(fr,mr=>{if(mr instanceof E$1){if(x$3(this,se,new ye),lr)throw mr}else if(mr instanceof ne)this.debug>0&&console.warn(mr),dr&&dr(mr);else if(mr instanceof ee$1)switch(mr.text){case"BEGIN":x$3(this,J,!0);break;case"COMMIT":case"ROLLBACK":x$3(this,J,!1);break}else if(mr instanceof X){let gr=h$2(this,k$1).get(mr.channel);gr&&gr.forEach(yr=>{queueMicrotask(()=>yr(mr.payload))}),h$2(this,K).forEach(yr=>{queueMicrotask(()=>yr(mr.channel,mr.payload))})}hr.push(mr)}),{messages:hr,data:fr}}isInTransaction(){return h$2(this,J)}async syncToFs(){if(h$2(this,Z))return;x$3(this,Z,!0);let rr=async()=>{await h$2(this,me).runExclusive(async()=>{x$3(this,Z,!1),await this.fs.syncToFs(h$2(this,$$1))})};h$2(this,$$1)?rr():await rr()}async listen(rr,ir){var dr;let lr=Nr(rr);h$2(this,k$1).has(lr)||h$2(this,k$1).set(lr,new Set),h$2(this,k$1).get(lr).add(ir);try{await this.exec(`LISTEN ${rr}`)}catch(fr){throw h$2(this,k$1).get(lr).delete(ir),((dr=h$2(this,k$1).get(lr))==null?void 0:dr.size)===0&&h$2(this,k$1).delete(lr),fr}return async()=>{await this.unlisten(lr,ir)}}async unlisten(rr,ir){var dr,fr;let lr=Nr(rr);ir?((dr=h$2(this,k$1).get(lr))==null||dr.delete(ir),((fr=h$2(this,k$1).get(lr))==null?void 0:fr.size)===0&&(await this.exec(`UNLISTEN ${rr}`),h$2(this,k$1).delete(lr))):(await this.exec(`UNLISTEN ${rr}`),h$2(this,k$1).delete(lr))}onNotification(rr){return h$2(this,K).add(rr),()=>{h$2(this,K).delete(rr)}}offNotification(rr){h$2(this,K).delete(rr)}async dumpDataDir(rr){var lr;let ir=((lr=this.dataDir)==null?void 0:lr.split("/").pop())??"pgdata";return this.fs.dumpTar(ir,rr)}_runExclusiveQuery(rr){return h$2(this,_e).runExclusive(rr)}_runExclusiveTransaction(rr){return h$2(this,ie).runExclusive(rr)}async clone(){let rr=await this.dumpDataDir("none");return new nd({loadDataDir:rr})}};Y=new WeakMap,W=new WeakMap,j$1=new WeakMap,J=new WeakMap,$$1=new WeakMap,_e=new WeakMap,ie=new WeakMap,me=new WeakMap,Z=new WeakMap,ae=new WeakMap,oe=new WeakMap,se=new WeakMap,V=new WeakMap,G=new WeakMap,k$1=new WeakMap,K=new WeakMap,O$1=new WeakSet,qe=async function(tr){if(tr.fs)this.fs=tr.fs;else{let{dataDir:yr,fsType:_r}=Fe(tr.dataDir);this.fs=await Ae(yr,_r)}let rr={},ir=[],lr=[`PGDATA=${C$1}`,`PREFIX=${Vr}`,`PGUSER=${tr.username??"postgres"}`,`PGDATABASE=${tr.database??"template1"}`,"MODE=REACT","REPL=N",...this.debug?["-d",this.debug.toString()]:[]];tr.wasmModule||Rr();let dr=tr.fsBundle?tr.fsBundle.arrayBuffer():Er(),fr;dr.then(yr=>{fr=yr});let hr={WASM_PREFIX:Vr,arguments:lr,INITIAL_MEMORY:tr.initialMemory,noExitRuntime:!0,...this.debug>0?{print:console.info,printErr:console.error}:{print:()=>{},printErr:()=>{}},instantiateWasm:(yr,_r)=>(Tr(yr,tr.wasmModule).then(({instance:br,module:vr})=>{_r(br,vr)}),{}),getPreloadedPackage:(yr,_r)=>{if(yr==="postgres.data"){if(fr.byteLength!==_r)throw new Error(`Invalid FS bundle size: ${fr.byteLength} !== ${_r}`);return fr}throw new Error(`Unknown package: ${yr}`)},preRun:[yr=>{let _r=yr.FS.makedev(64,0),br={open:vr=>{},close:vr=>{},read:(vr,wr,xr,Sr,Ar)=>{let Ir=h$2(this,V);if(!Ir)throw new Error("No /dev/blob File or Blob provided to read from");let Mr=new Uint8Array(Ir);if(Ar>=Mr.length)return 0;let Or=Math.min(Mr.length-Ar,Sr);for(let $r=0;$r<Or;$r++)wr[xr+$r]=Mr[Ar+$r];return Or},write:(vr,wr,xr,Sr,Ar)=>(h$2(this,G)??x$3(this,G,[]),h$2(this,G).push(wr.slice(xr,xr+Sr)),Sr),llseek:(vr,wr,xr)=>{let Sr=h$2(this,V);if(!Sr)throw new Error("No /dev/blob File or Blob provided to llseek");let Ar=wr;if(xr===1?Ar+=vr.position:xr===2&&(Ar=new Uint8Array(Sr).length),Ar<0)throw new yr.FS.ErrnoError(28);return Ar}};yr.FS.registerDevice(_r,br),yr.FS.mkdev("/dev/blob",_r)}]},{emscriptenOpts:mr}=await this.fs.init(this,hr);hr=mr;for(let[yr,_r]of Object.entries(h$2(this,ae)))if(_r instanceof URL)rr[yr]=ge(_r);else{let br=await _r.setup(this,hr);if(br.emscriptenOpts&&(hr=br.emscriptenOpts),br.namespaceObj){let vr=this;vr[yr]=br.namespaceObj}br.bundlePath&&(rr[yr]=ge(br.bundlePath)),br.init&&ir.push(br.init),br.close&&h$2(this,oe).push(br.close)}if(hr.pg_extensions=rr,await dr,this.mod=await Te(hr),await this.fs.initialSyncFs(),tr.loadDataDir){if(this.mod.FS.analyzePath(C$1+"/PG_VERSION").exists)throw new Error("Database already exists, cannot load from tarball");T$1(this,O$1,re).call(this,"pglite: loading data from tarball"),await ce$1(this.mod.FS,tr.loadDataDir,C$1)}this.mod.FS.analyzePath(C$1+"/PG_VERSION").exists?T$1(this,O$1,re).call(this,"pglite: found DB, resuming"):T$1(this,O$1,re).call(this,"pglite: no db"),await Pe(this.mod,(...yr)=>T$1(this,O$1,re).call(this,...yr));let gr=this.mod._pg_initdb();if(!gr)throw new Error("INITDB failed to return value");if(gr&1)throw new Error("INITDB failed");if(gr&2){let yr=tr.username??"postgres",_r=tr.database??"template1";if(gr&4){if(!(gr&12))throw new Error("Invalid db/user combination")}else if(_r!=="template1"&&yr!=="postgres")throw new Error("INITDB created a new datadir, but an alternative db/user was requested")}await this.syncToFs(),x$3(this,Y,!0),await this.exec("SET search_path TO public;"),await this._initArrayTypes();for(let yr of ir)await yr()},re=function(...tr){this.debug>0&&console.log(...tr)};var Ue=pe;u$2();const initSql=`
567
567
 
@@ -818,8 +818,8 @@ if (cid) {
818
818
  `);super(fr),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiTypeError"}),ir.cause&&(this.cause=ir.cause),this.details=lr,this.docsPath=dr,this.metaMessages=ir.metaMessages,this.shortMessage=rr}};function execTyped(tr,rr){const ir=tr.exec(rr);return ir==null?void 0:ir.groups}const bytesRegex=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,integerRegex=/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/,isTupleRegex=/^\(.+?\).*?$/,tupleRegex=/^tuple(?<array>(\[(\d*)\])*)$/;function formatAbiParameter(tr){let rr=tr.type;if(tupleRegex.test(tr.type)&&"components"in tr){rr="(";const ir=tr.components.length;for(let dr=0;dr<ir;dr++){const fr=tr.components[dr];rr+=formatAbiParameter(fr),dr<ir-1&&(rr+=", ")}const lr=execTyped(tupleRegex,tr.type);return rr+=`)${(lr==null?void 0:lr.array)??""}`,formatAbiParameter({...tr,type:rr})}return"indexed"in tr&&tr.indexed&&(rr=`${rr} indexed`),tr.name?`${rr} ${tr.name}`:rr}function formatAbiParameters(tr){let rr="";const ir=tr.length;for(let lr=0;lr<ir;lr++){const dr=tr[lr];rr+=formatAbiParameter(dr),lr!==ir-1&&(rr+=", ")}return rr}function formatAbiItem(tr){var rr;return tr.type==="function"?`function ${tr.name}(${formatAbiParameters(tr.inputs)})${tr.stateMutability&&tr.stateMutability!=="nonpayable"?` ${tr.stateMutability}`:""}${(rr=tr.outputs)!=null&&rr.length?` returns (${formatAbiParameters(tr.outputs)})`:""}`:tr.type==="event"?`event ${tr.name}(${formatAbiParameters(tr.inputs)})`:tr.type==="error"?`error ${tr.name}(${formatAbiParameters(tr.inputs)})`:tr.type==="constructor"?`constructor(${formatAbiParameters(tr.inputs)})${tr.stateMutability==="payable"?" payable":""}`:tr.type==="fallback"?`fallback() external${tr.stateMutability==="payable"?" payable":""}`:"receive() external payable"}const errorSignatureRegex=/^error (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;function isErrorSignature(tr){return errorSignatureRegex.test(tr)}function execErrorSignature(tr){return execTyped(errorSignatureRegex,tr)}const eventSignatureRegex=/^event (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;function isEventSignature(tr){return eventSignatureRegex.test(tr)}function execEventSignature(tr){return execTyped(eventSignatureRegex,tr)}const functionSignatureRegex=/^function (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)(?: (?<scope>external|public{1}))?(?: (?<stateMutability>pure|view|nonpayable|payable{1}))?(?: returns\s?\((?<returns>.*?)\))?$/;function isFunctionSignature(tr){return functionSignatureRegex.test(tr)}function execFunctionSignature(tr){return execTyped(functionSignatureRegex,tr)}const structSignatureRegex=/^struct (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*) \{(?<properties>.*?)\}$/;function isStructSignature(tr){return structSignatureRegex.test(tr)}function execStructSignature(tr){return execTyped(structSignatureRegex,tr)}const constructorSignatureRegex=/^constructor\((?<parameters>.*?)\)(?:\s(?<stateMutability>payable{1}))?$/;function isConstructorSignature(tr){return constructorSignatureRegex.test(tr)}function execConstructorSignature(tr){return execTyped(constructorSignatureRegex,tr)}const fallbackSignatureRegex=/^fallback\(\) external(?:\s(?<stateMutability>payable{1}))?$/;function isFallbackSignature(tr){return fallbackSignatureRegex.test(tr)}function execFallbackSignature(tr){return execTyped(fallbackSignatureRegex,tr)}const receiveSignatureRegex=/^receive\(\) external payable$/;function isReceiveSignature(tr){return receiveSignatureRegex.test(tr)}const eventModifiers=new Set(["indexed"]),functionModifiers=new Set(["calldata","memory","storage"]);class UnknownTypeError extends BaseError$3{constructor({type:rr}){super("Unknown type.",{metaMessages:[`Type "${rr}" is not a valid ABI type. Perhaps you forgot to include a struct signature?`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownTypeError"})}}class UnknownSolidityTypeError extends BaseError$3{constructor({type:rr}){super("Unknown type.",{metaMessages:[`Type "${rr}" is not a valid ABI type.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSolidityTypeError"})}}class InvalidParameterError extends BaseError$3{constructor({param:rr}){super("Invalid ABI parameter.",{details:rr}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParameterError"})}}class SolidityProtectedKeywordError extends BaseError$3{constructor({param:rr,name:ir}){super("Invalid ABI parameter.",{details:rr,metaMessages:[`"${ir}" is a protected Solidity keyword. More info: https://docs.soliditylang.org/en/latest/cheatsheet.html`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SolidityProtectedKeywordError"})}}class InvalidModifierError extends BaseError$3{constructor({param:rr,type:ir,modifier:lr}){super("Invalid ABI parameter.",{details:rr,metaMessages:[`Modifier "${lr}" not allowed${ir?` in "${ir}" type`:""}.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidModifierError"})}}class InvalidFunctionModifierError extends BaseError$3{constructor({param:rr,type:ir,modifier:lr}){super("Invalid ABI parameter.",{details:rr,metaMessages:[`Modifier "${lr}" not allowed${ir?` in "${ir}" type`:""}.`,`Data location can only be specified for array, struct, or mapping types, but "${lr}" was given.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidFunctionModifierError"})}}class InvalidAbiTypeParameterError extends BaseError$3{constructor({abiParameter:rr}){super("Invalid ABI parameter.",{details:JSON.stringify(rr,null,2),metaMessages:["ABI parameter type is invalid."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiTypeParameterError"})}}class InvalidSignatureError extends BaseError$3{constructor({signature:rr,type:ir}){super(`Invalid ${ir} signature.`,{details:rr}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidSignatureError"})}}class UnknownSignatureError extends BaseError$3{constructor({signature:rr}){super("Unknown signature.",{details:rr}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSignatureError"})}}class InvalidStructSignatureError extends BaseError$3{constructor({signature:rr}){super("Invalid struct signature.",{details:rr,metaMessages:["No properties exist."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidStructSignatureError"})}}class CircularReferenceError extends BaseError$3{constructor({type:rr}){super("Circular reference detected.",{metaMessages:[`Struct "${rr}" is a circular reference.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"CircularReferenceError"})}}class InvalidParenthesisError extends BaseError$3{constructor({current:rr,depth:ir}){super("Unbalanced parentheses.",{metaMessages:[`"${rr.trim()}" has too many ${ir>0?"opening":"closing"} parentheses.`],details:`Depth "${ir}"`}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParenthesisError"})}}function getParameterCacheKey(tr,rr,ir){let lr="";if(ir)for(const dr of Object.entries(ir)){if(!dr)continue;let fr="";for(const hr of dr[1])fr+=`[${hr.type}${hr.name?`:${hr.name}`:""}]`;lr+=`(${dr[0]}{${fr}})`}return rr?`${rr}:${tr}${lr}`:tr}const parameterCache=new Map([["address",{type:"address"}],["bool",{type:"bool"}],["bytes",{type:"bytes"}],["bytes32",{type:"bytes32"}],["int",{type:"int256"}],["int256",{type:"int256"}],["string",{type:"string"}],["uint",{type:"uint256"}],["uint8",{type:"uint8"}],["uint16",{type:"uint16"}],["uint24",{type:"uint24"}],["uint32",{type:"uint32"}],["uint64",{type:"uint64"}],["uint96",{type:"uint96"}],["uint112",{type:"uint112"}],["uint160",{type:"uint160"}],["uint192",{type:"uint192"}],["uint256",{type:"uint256"}],["address owner",{type:"address",name:"owner"}],["address to",{type:"address",name:"to"}],["bool approved",{type:"bool",name:"approved"}],["bytes _data",{type:"bytes",name:"_data"}],["bytes data",{type:"bytes",name:"data"}],["bytes signature",{type:"bytes",name:"signature"}],["bytes32 hash",{type:"bytes32",name:"hash"}],["bytes32 r",{type:"bytes32",name:"r"}],["bytes32 root",{type:"bytes32",name:"root"}],["bytes32 s",{type:"bytes32",name:"s"}],["string name",{type:"string",name:"name"}],["string symbol",{type:"string",name:"symbol"}],["string tokenURI",{type:"string",name:"tokenURI"}],["uint tokenId",{type:"uint256",name:"tokenId"}],["uint8 v",{type:"uint8",name:"v"}],["uint256 balance",{type:"uint256",name:"balance"}],["uint256 tokenId",{type:"uint256",name:"tokenId"}],["uint256 value",{type:"uint256",name:"value"}],["event:address indexed from",{type:"address",name:"from",indexed:!0}],["event:address indexed to",{type:"address",name:"to",indexed:!0}],["event:uint indexed tokenId",{type:"uint256",name:"tokenId",indexed:!0}],["event:uint256 indexed tokenId",{type:"uint256",name:"tokenId",indexed:!0}]]);function parseSignature(tr,rr={}){if(isFunctionSignature(tr))return parseFunctionSignature(tr,rr);if(isEventSignature(tr))return parseEventSignature(tr,rr);if(isErrorSignature(tr))return parseErrorSignature(tr,rr);if(isConstructorSignature(tr))return parseConstructorSignature(tr,rr);if(isFallbackSignature(tr))return parseFallbackSignature(tr);if(isReceiveSignature(tr))return{type:"receive",stateMutability:"payable"};throw new UnknownSignatureError({signature:tr})}function parseFunctionSignature(tr,rr={}){const ir=execFunctionSignature(tr);if(!ir)throw new InvalidSignatureError({signature:tr,type:"function"});const lr=splitParameters(ir.parameters),dr=[],fr=lr.length;for(let mr=0;mr<fr;mr++)dr.push(parseAbiParameter(lr[mr],{modifiers:functionModifiers,structs:rr,type:"function"}));const hr=[];if(ir.returns){const mr=splitParameters(ir.returns),gr=mr.length;for(let yr=0;yr<gr;yr++)hr.push(parseAbiParameter(mr[yr],{modifiers:functionModifiers,structs:rr,type:"function"}))}return{name:ir.name,type:"function",stateMutability:ir.stateMutability??"nonpayable",inputs:dr,outputs:hr}}function parseEventSignature(tr,rr={}){const ir=execEventSignature(tr);if(!ir)throw new InvalidSignatureError({signature:tr,type:"event"});const lr=splitParameters(ir.parameters),dr=[],fr=lr.length;for(let hr=0;hr<fr;hr++)dr.push(parseAbiParameter(lr[hr],{modifiers:eventModifiers,structs:rr,type:"event"}));return{name:ir.name,type:"event",inputs:dr}}function parseErrorSignature(tr,rr={}){const ir=execErrorSignature(tr);if(!ir)throw new InvalidSignatureError({signature:tr,type:"error"});const lr=splitParameters(ir.parameters),dr=[],fr=lr.length;for(let hr=0;hr<fr;hr++)dr.push(parseAbiParameter(lr[hr],{structs:rr,type:"error"}));return{name:ir.name,type:"error",inputs:dr}}function parseConstructorSignature(tr,rr={}){const ir=execConstructorSignature(tr);if(!ir)throw new InvalidSignatureError({signature:tr,type:"constructor"});const lr=splitParameters(ir.parameters),dr=[],fr=lr.length;for(let hr=0;hr<fr;hr++)dr.push(parseAbiParameter(lr[hr],{structs:rr,type:"constructor"}));return{type:"constructor",stateMutability:ir.stateMutability??"nonpayable",inputs:dr}}function parseFallbackSignature(tr){const rr=execFallbackSignature(tr);if(!rr)throw new InvalidSignatureError({signature:tr,type:"fallback"});return{type:"fallback",stateMutability:rr.stateMutability??"nonpayable"}}const abiParameterWithoutTupleRegex=/^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,abiParameterWithTupleRegex=/^\((?<type>.+?)\)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,dynamicIntegerRegex=/^u?int$/;function parseAbiParameter(tr,rr){var br,vr;const ir=getParameterCacheKey(tr,rr==null?void 0:rr.type,rr==null?void 0:rr.structs);if(parameterCache.has(ir))return parameterCache.get(ir);const lr=isTupleRegex.test(tr),dr=execTyped(lr?abiParameterWithTupleRegex:abiParameterWithoutTupleRegex,tr);if(!dr)throw new InvalidParameterError({param:tr});if(dr.name&&isSolidityKeyword(dr.name))throw new SolidityProtectedKeywordError({param:tr,name:dr.name});const fr=dr.name?{name:dr.name}:{},hr=dr.modifier==="indexed"?{indexed:!0}:{},mr=(rr==null?void 0:rr.structs)??{};let gr,yr={};if(lr){gr="tuple";const wr=splitParameters(dr.type),xr=[],Sr=wr.length;for(let Ar=0;Ar<Sr;Ar++)xr.push(parseAbiParameter(wr[Ar],{structs:mr}));yr={components:xr}}else if(dr.type in mr)gr="tuple",yr={components:mr[dr.type]};else if(dynamicIntegerRegex.test(dr.type))gr=`${dr.type}256`;else if(gr=dr.type,(rr==null?void 0:rr.type)!=="struct"&&!isSolidityType(gr))throw new UnknownSolidityTypeError({type:gr});if(dr.modifier){if(!((vr=(br=rr==null?void 0:rr.modifiers)==null?void 0:br.has)!=null&&vr.call(br,dr.modifier)))throw new InvalidModifierError({param:tr,type:rr==null?void 0:rr.type,modifier:dr.modifier});if(functionModifiers.has(dr.modifier)&&!isValidDataLocation(gr,!!dr.array))throw new InvalidFunctionModifierError({param:tr,type:rr==null?void 0:rr.type,modifier:dr.modifier})}const _r={type:`${gr}${dr.array??""}`,...fr,...hr,...yr};return parameterCache.set(ir,_r),_r}function splitParameters(tr,rr=[],ir="",lr=0){const dr=tr.trim().length;for(let fr=0;fr<dr;fr++){const hr=tr[fr],mr=tr.slice(fr+1);switch(hr){case",":return lr===0?splitParameters(mr,[...rr,ir.trim()]):splitParameters(mr,rr,`${ir}${hr}`,lr);case"(":return splitParameters(mr,rr,`${ir}${hr}`,lr+1);case")":return splitParameters(mr,rr,`${ir}${hr}`,lr-1);default:return splitParameters(mr,rr,`${ir}${hr}`,lr)}}if(ir==="")return rr;if(lr!==0)throw new InvalidParenthesisError({current:ir,depth:lr});return rr.push(ir.trim()),rr}function isSolidityType(tr){return tr==="address"||tr==="bool"||tr==="function"||tr==="string"||bytesRegex.test(tr)||integerRegex.test(tr)}const protectedKeywordsRegex=/^(?:after|alias|anonymous|apply|auto|byte|calldata|case|catch|constant|copyof|default|defined|error|event|external|false|final|function|immutable|implements|in|indexed|inline|internal|let|mapping|match|memory|mutable|null|of|override|partial|private|promise|public|pure|reference|relocatable|return|returns|sizeof|static|storage|struct|super|supports|switch|this|true|try|typedef|typeof|var|view|virtual)$/;function isSolidityKeyword(tr){return tr==="address"||tr==="bool"||tr==="function"||tr==="string"||tr==="tuple"||bytesRegex.test(tr)||integerRegex.test(tr)||protectedKeywordsRegex.test(tr)}function isValidDataLocation(tr,rr){return rr||tr==="bytes"||tr==="string"||tr==="tuple"}function parseStructs(tr){const rr={},ir=tr.length;for(let hr=0;hr<ir;hr++){const mr=tr[hr];if(!isStructSignature(mr))continue;const gr=execStructSignature(mr);if(!gr)throw new InvalidSignatureError({signature:mr,type:"struct"});const yr=gr.properties.split(";"),_r=[],br=yr.length;for(let vr=0;vr<br;vr++){const xr=yr[vr].trim();if(!xr)continue;const Sr=parseAbiParameter(xr,{type:"struct"});_r.push(Sr)}if(!_r.length)throw new InvalidStructSignatureError({signature:mr});rr[gr.name]=_r}const lr={},dr=Object.entries(rr),fr=dr.length;for(let hr=0;hr<fr;hr++){const[mr,gr]=dr[hr];lr[mr]=resolveStructs(gr,rr)}return lr}const typeWithoutTupleRegex=/^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*)(?<array>(?:\[\d*?\])+?)?$/;function resolveStructs(tr,rr,ir=new Set){const lr=[],dr=tr.length;for(let fr=0;fr<dr;fr++){const hr=tr[fr];if(isTupleRegex.test(hr.type))lr.push(hr);else{const gr=execTyped(typeWithoutTupleRegex,hr.type);if(!(gr!=null&&gr.type))throw new InvalidAbiTypeParameterError({abiParameter:hr});const{array:yr,type:_r}=gr;if(_r in rr){if(ir.has(_r))throw new CircularReferenceError({type:_r});lr.push({...hr,type:`tuple${yr??""}`,components:resolveStructs(rr[_r]??[],rr,new Set([...ir,_r]))})}else if(isSolidityType(_r))lr.push(hr);else throw new UnknownTypeError({type:_r})}}return lr}function parseAbi(tr){const rr=parseStructs(tr),ir=[],lr=tr.length;for(let dr=0;dr<lr;dr++){const fr=tr[dr];isStructSignature(fr)||ir.push(parseSignature(fr,rr))}return ir}function normalizeSignature(tr){let rr=!0,ir="",lr=0,dr="",fr=!1;for(let hr=0;hr<tr.length;hr++){const mr=tr[hr];if(["(",")",","].includes(mr)&&(rr=!0),mr==="("&&lr++,mr===")"&&lr--,!!rr){if(lr===0){if(mr===" "&&["event","function",""].includes(dr))dr="";else if(dr+=mr,mr===")"){fr=!0;break}continue}if(mr===" "){tr[hr-1]!==","&&ir!==","&&ir!==",("&&(ir="",rr=!1);continue}dr+=mr,ir+=mr}}if(!fr)throw new BaseError$4("Unable to normalize signature.");return dr}const toSignature=tr=>{const rr=typeof tr=="string"?tr:formatAbiItem(tr);return normalizeSignature(rr)};function toSignatureHash(tr){return hashSignature(toSignature(tr))}const toEventSelector=toSignatureHash,toFunctionSelector=tr=>slice(toSignatureHash(tr),0,4);function getAbiItem(tr){const{abi:rr,args:ir=[],name:lr}=tr,dr=isHex(lr,{strict:!1}),fr=rr.filter(mr=>dr?mr.type==="function"?toFunctionSelector(mr)===lr:mr.type==="event"?toEventSelector(mr)===lr:!1:"name"in mr&&mr.name===lr);if(fr.length===0)return;if(fr.length===1)return fr[0];let hr;for(const mr of fr){if(!("inputs"in mr))continue;if(!ir||ir.length===0){if(!mr.inputs||mr.inputs.length===0)return mr;continue}if(!mr.inputs||mr.inputs.length===0||mr.inputs.length!==ir.length)continue;if(ir.every((yr,_r)=>{const br="inputs"in mr&&mr.inputs[_r];return br?isArgOfType(yr,br):!1})){if(hr&&"inputs"in hr&&hr.inputs){const yr=getAmbiguousTypes(mr.inputs,hr.inputs,ir);if(yr)throw new AbiItemAmbiguityError({abiItem:mr,type:yr[0]},{abiItem:hr,type:yr[1]})}hr=mr}}return hr||fr[0]}function isArgOfType(tr,rr){const ir=typeof tr,lr=rr.type;switch(lr){case"address":return isAddress(tr,{strict:!1});case"bool":return ir==="boolean";case"function":return ir==="string";case"string":return ir==="string";default:return lr==="tuple"&&"components"in rr?Object.values(rr.components).every((dr,fr)=>isArgOfType(Object.values(tr)[fr],dr)):/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/.test(lr)?ir==="number"||ir==="bigint":/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(lr)?ir==="string"||tr instanceof Uint8Array:/[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(lr)?Array.isArray(tr)&&tr.every(dr=>isArgOfType(dr,{...rr,type:lr.replace(/(\[[0-9]{0,}\])$/,"")})):!1}}function getAmbiguousTypes(tr,rr,ir){for(const lr in tr){const dr=tr[lr],fr=rr[lr];if(dr.type==="tuple"&&fr.type==="tuple"&&"components"in dr&&"components"in fr)return getAmbiguousTypes(dr.components,fr.components,ir[lr]);const hr=[dr.type,fr.type];if(hr.includes("address")&&hr.includes("bytes20")?!0:hr.includes("address")&&hr.includes("string")?isAddress(ir[lr],{strict:!1}):hr.includes("address")&&hr.includes("bytes")?isAddress(ir[lr],{strict:!1}):!1)return hr}}const docsPath$3="/docs/contract/decodeFunctionResult";function decodeFunctionResult(tr){const{abi:rr,args:ir,functionName:lr,data:dr}=tr;let fr=rr[0];if(lr){const mr=getAbiItem({abi:rr,args:ir,name:lr});if(!mr)throw new AbiFunctionNotFoundError(lr,{docsPath:docsPath$3});fr=mr}if(fr.type!=="function")throw new AbiFunctionNotFoundError(void 0,{docsPath:docsPath$3});if(!fr.outputs)throw new AbiFunctionOutputsNotFoundError(fr.name,{docsPath:docsPath$3});const hr=decodeAbiParameters(fr.outputs,dr);if(hr&&hr.length>1)return hr;if(hr&&hr.length===1)return hr[0]}const docsPath$2="/docs/contract/encodeFunctionData";function prepareEncodeFunctionData(tr){const{abi:rr,args:ir,functionName:lr}=tr;let dr=rr[0];if(lr){const fr=getAbiItem({abi:rr,args:ir,name:lr});if(!fr)throw new AbiFunctionNotFoundError(lr,{docsPath:docsPath$2});dr=fr}if(dr.type!=="function")throw new AbiFunctionNotFoundError(void 0,{docsPath:docsPath$2});return{abi:[dr],functionName:toFunctionSelector(formatAbiItem$1(dr))}}function encodeFunctionData(tr){const{args:rr}=tr,{abi:ir,functionName:lr}=(()=>{var mr;return tr.abi.length===1&&((mr=tr.functionName)!=null&&mr.startsWith("0x"))?tr:prepareEncodeFunctionData(tr)})(),dr=ir[0],fr=lr,hr="inputs"in dr&&dr.inputs?encodeAbiParameters(dr.inputs,rr??[]):void 0;return concatHex([fr,hr??"0x"])}function getChainContractAddress({blockNumber:tr,chain:rr,contract:ir}){var dr;const lr=(dr=rr==null?void 0:rr.contracts)==null?void 0:dr[ir];if(!lr)throw new ChainDoesNotSupportContract({chain:rr,contract:{name:ir}});if(tr&&lr.blockCreated&&lr.blockCreated>tr)throw new ChainDoesNotSupportContract({blockNumber:tr,chain:rr,contract:{name:ir,blockCreated:lr.blockCreated}});return lr.address}const panicReasons={1:"An `assert` condition failed.",17:"Arithmetic operation resulted in underflow or overflow.",18:"Division or modulo by zero (e.g. `5 / 0` or `23 % 0`).",33:"Attempted to convert to an invalid type.",34:"Attempted to access a storage byte array that is incorrectly encoded.",49:"Performed `.pop()` on an empty array",50:"Array index is out of bounds.",65:"Allocated too much memory or created an array which is too large.",81:"Attempted to call a zero-initialized variable of internal function type."},solidityError={inputs:[{name:"message",type:"string"}],name:"Error",type:"error"},solidityPanic={inputs:[{name:"reason",type:"uint256"}],name:"Panic",type:"error"};function decodeErrorResult(tr){const{abi:rr,data:ir}=tr,lr=slice(ir,0,4);if(lr==="0x")throw new AbiDecodingZeroDataError;const fr=[...rr||[],solidityError,solidityPanic].find(hr=>hr.type==="error"&&lr===toFunctionSelector(formatAbiItem$1(hr)));if(!fr)throw new AbiErrorSignatureNotFoundError(lr,{docsPath:"/docs/contract/decodeErrorResult"});return{abiItem:fr,args:"inputs"in fr&&fr.inputs&&fr.inputs.length>0?decodeAbiParameters(fr.inputs,slice(ir,4)):void 0,errorName:fr.name}}function formatAbiItemWithArgs({abiItem:tr,args:rr,includeFunctionName:ir=!0,includeName:lr=!1}){if("name"in tr&&"inputs"in tr&&tr.inputs)return`${ir?tr.name:""}(${tr.inputs.map((dr,fr)=>`${lr&&dr.name?`${dr.name}: `:""}${typeof rr[fr]=="object"?stringify(rr[fr]):rr[fr]}`).join(", ")})`}class CallExecutionError extends BaseError$4{constructor(rr,{account:ir,docsPath:lr,chain:dr,data:fr,gas:hr,gasPrice:mr,maxFeePerGas:gr,maxPriorityFeePerGas:yr,nonce:_r,to:br,value:vr,stateOverride:wr}){var Ar;const xr=ir?parseAccount(ir):void 0;let Sr=prettyPrint({from:xr==null?void 0:xr.address,to:br,value:typeof vr<"u"&&`${formatEther(vr)} ${((Ar=dr==null?void 0:dr.nativeCurrency)==null?void 0:Ar.symbol)||"ETH"}`,data:fr,gas:hr,gasPrice:typeof mr<"u"&&`${formatGwei(mr)} gwei`,maxFeePerGas:typeof gr<"u"&&`${formatGwei(gr)} gwei`,maxPriorityFeePerGas:typeof yr<"u"&&`${formatGwei(yr)} gwei`,nonce:_r});wr&&(Sr+=`
819
819
  ${prettyStateOverride(wr)}`),super(rr.shortMessage,{cause:rr,docsPath:lr,metaMessages:[...rr.metaMessages?[...rr.metaMessages," "]:[],"Raw Call Arguments:",Sr].filter(Boolean),name:"CallExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=rr}}class ContractFunctionExecutionError extends BaseError$4{constructor(rr,{abi:ir,args:lr,contractAddress:dr,docsPath:fr,functionName:hr,sender:mr}){const gr=getAbiItem({abi:ir,args:lr,name:hr}),yr=gr?formatAbiItemWithArgs({abiItem:gr,args:lr,includeFunctionName:!1,includeName:!1}):void 0,_r=gr?formatAbiItem$1(gr,{includeName:!0}):void 0,br=prettyPrint({address:dr&&getContractAddress(dr),function:_r,args:yr&&yr!=="()"&&`${[...Array((hr==null?void 0:hr.length)??0).keys()].map(()=>" ").join("")}${yr}`,sender:mr});super(rr.shortMessage||`An unknown error occurred while executing the contract function "${hr}".`,{cause:rr,docsPath:fr,metaMessages:[...rr.metaMessages?[...rr.metaMessages," "]:[],br&&"Contract Call:",br].filter(Boolean),name:"ContractFunctionExecutionError"}),Object.defineProperty(this,"abi",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"args",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"contractAddress",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"formattedArgs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"functionName",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sender",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abi=ir,this.args=lr,this.cause=rr,this.contractAddress=dr,this.functionName=hr,this.sender=mr}}class ContractFunctionRevertedError extends BaseError$4{constructor({abi:rr,data:ir,functionName:lr,message:dr}){let fr,hr,mr,gr;if(ir&&ir!=="0x")try{hr=decodeErrorResult({abi:rr,data:ir});const{abiItem:_r,errorName:br,args:vr}=hr;if(br==="Error")gr=vr[0];else if(br==="Panic"){const[wr]=vr;gr=panicReasons[wr]}else{const wr=_r?formatAbiItem$1(_r,{includeName:!0}):void 0,xr=_r&&vr?formatAbiItemWithArgs({abiItem:_r,args:vr,includeFunctionName:!1,includeName:!1}):void 0;mr=[wr?`Error: ${wr}`:"",xr&&xr!=="()"?` ${[...Array((br==null?void 0:br.length)??0).keys()].map(()=>" ").join("")}${xr}`:""]}}catch(_r){fr=_r}else dr&&(gr=dr);let yr;fr instanceof AbiErrorSignatureNotFoundError&&(yr=fr.signature,mr=[`Unable to decode signature "${yr}" as it was not found on the provided ABI.`,"Make sure you are using the correct ABI and that the error exists on it.",`You can look up the decoded signature here: https://openchain.xyz/signatures?query=${yr}.`]),super(gr&&gr!=="execution reverted"||yr?[`The contract function "${lr}" reverted with the following ${yr?"signature":"reason"}:`,gr||yr].join(`
820
820
  `):`The contract function "${lr}" reverted.`,{cause:fr,metaMessages:mr,name:"ContractFunctionRevertedError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"raw",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"reason",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"signature",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=hr,this.raw=ir,this.reason=gr,this.signature=yr}}class ContractFunctionZeroDataError extends BaseError$4{constructor({functionName:rr}){super(`The contract function "${rr}" returned no data ("0x").`,{metaMessages:["This could be due to any of the following:",` - The contract does not have the function "${rr}",`," - The parameters passed to the contract function may be invalid, or"," - The address is not a contract."],name:"ContractFunctionZeroDataError"})}}class CounterfactualDeploymentFailedError extends BaseError$4{constructor({factory:rr}){super(`Deployment for counterfactual contract call failed${rr?` for factory "${rr}".`:""}`,{metaMessages:["Please ensure:","- The `factory` is a valid contract deployment factory (ie. Create2 Factory, ERC-4337 Factory, etc).","- The `factoryData` is a valid encoded function call for contract deployment function on the factory."],name:"CounterfactualDeploymentFailedError"})}}class RawContractError extends BaseError$4{constructor({data:rr,message:ir}){super(ir||"",{name:"RawContractError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:3}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=rr}}function isNullUniversalResolverError(tr,rr){var lr,dr,fr,hr,mr,gr;if(!(tr instanceof BaseError$4))return!1;const ir=tr.walk(yr=>yr instanceof ContractFunctionRevertedError);return ir instanceof ContractFunctionRevertedError?!!(((lr=ir.data)==null?void 0:lr.errorName)==="ResolverNotFound"||((dr=ir.data)==null?void 0:dr.errorName)==="ResolverWildcardNotSupported"||((fr=ir.data)==null?void 0:fr.errorName)==="ResolverNotContract"||((hr=ir.data)==null?void 0:hr.errorName)==="ResolverError"||((mr=ir.data)==null?void 0:mr.errorName)==="HttpError"||(gr=ir.reason)!=null&&gr.includes("Wildcard on non-extended resolvers is not supported")||rr==="reverse"&&ir.reason===panicReasons[50]):!1}function decodeFunctionData(tr){const{abi:rr,data:ir}=tr,lr=slice(ir,0,4),dr=rr.find(fr=>fr.type==="function"&&lr===toFunctionSelector(formatAbiItem$1(fr)));if(!dr)throw new AbiFunctionSignatureNotFoundError(lr,{docsPath:"/docs/contract/decodeFunctionData"});return{functionName:dr.name,args:"inputs"in dr&&dr.inputs&&dr.inputs.length>0?decodeAbiParameters(dr.inputs,slice(ir,4)):void 0}}const docsPath$1="/docs/contract/encodeErrorResult";function encodeErrorResult(tr){const{abi:rr,errorName:ir,args:lr}=tr;let dr=rr[0];if(ir){const gr=getAbiItem({abi:rr,args:lr,name:ir});if(!gr)throw new AbiErrorNotFoundError(ir,{docsPath:docsPath$1});dr=gr}if(dr.type!=="error")throw new AbiErrorNotFoundError(void 0,{docsPath:docsPath$1});const fr=formatAbiItem$1(dr),hr=toFunctionSelector(fr);let mr="0x";if(lr&&lr.length>0){if(!dr.inputs)throw new AbiErrorInputsNotFoundError(dr.name,{docsPath:docsPath$1});mr=encodeAbiParameters(dr.inputs,lr)}return concatHex([hr,mr])}const docsPath="/docs/contract/encodeFunctionResult";function encodeFunctionResult(tr){const{abi:rr,functionName:ir,result:lr}=tr;let dr=rr[0];if(ir){const hr=getAbiItem({abi:rr,name:ir});if(!hr)throw new AbiFunctionNotFoundError(ir,{docsPath});dr=hr}if(dr.type!=="function")throw new AbiFunctionNotFoundError(void 0,{docsPath});if(!dr.outputs)throw new AbiFunctionOutputsNotFoundError(dr.name,{docsPath});const fr=(()=>{if(dr.outputs.length===0)return[];if(dr.outputs.length===1)return[lr];if(Array.isArray(lr))return lr;throw new InvalidArrayError(lr)})();return encodeAbiParameters(dr.outputs,fr)}const localBatchGatewayUrl="x-batch-gateway:true";async function localBatchGatewayRequest(tr){const{data:rr,ccipRequest:ir}=tr,{args:[lr]}=decodeFunctionData({abi:batchGatewayAbi,data:rr}),dr=[],fr=[];return await Promise.all(lr.map(async(hr,mr)=>{try{fr[mr]=hr.urls.includes(localBatchGatewayUrl)?await localBatchGatewayRequest({data:hr.data,ccipRequest:ir}):await ir(hr),dr[mr]=!1}catch(gr){dr[mr]=!0,fr[mr]=encodeError(gr)}})),encodeFunctionResult({abi:batchGatewayAbi,functionName:"query",result:[dr,fr]})}function encodeError(tr){return tr.name==="HttpRequestError"&&tr.status?encodeErrorResult({abi:batchGatewayAbi,errorName:"HttpError",args:[tr.status,tr.shortMessage]}):encodeErrorResult({abi:[solidityError],errorName:"Error",args:["shortMessage"in tr?tr.shortMessage:tr.message]})}function encodedLabelToLabelhash(tr){if(tr.length!==66||tr.indexOf("[")!==0||tr.indexOf("]")!==65)return null;const rr=`0x${tr.slice(1,65)}`;return isHex(rr)?rr:null}function namehash(tr){let rr=new Uint8Array(32).fill(0);if(!tr)return bytesToHex(rr);const ir=tr.split(".");for(let lr=ir.length-1;lr>=0;lr-=1){const dr=encodedLabelToLabelhash(ir[lr]),fr=dr?toBytes(dr):keccak256(stringToBytes(ir[lr]),"bytes");rr=keccak256(concat([rr,fr]),"bytes")}return bytesToHex(rr)}function encodeLabelhash(tr){return`[${tr.slice(2)}]`}function labelhash(tr){const rr=new Uint8Array(32).fill(0);return tr?encodedLabelToLabelhash(tr)||keccak256(stringToBytes(tr)):bytesToHex(rr)}function packetToBytes(tr){const rr=tr.replace(/^\.|\.$/gm,"");if(rr.length===0)return new Uint8Array(1);const ir=new Uint8Array(stringToBytes(rr).byteLength+2);let lr=0;const dr=rr.split(".");for(let fr=0;fr<dr.length;fr++){let hr=stringToBytes(dr[fr]);hr.byteLength>255&&(hr=stringToBytes(encodeLabelhash(labelhash(dr[fr])))),ir[lr]=hr.length,ir.set(hr,lr+1),lr+=hr.length+1}return ir.byteLength!==lr+1?ir.slice(0,lr+1):ir}const EXECUTION_REVERTED_ERROR_CODE=3;function getContractError(tr,{abi:rr,address:ir,args:lr,docsPath:dr,functionName:fr,sender:hr}){const mr=tr instanceof RawContractError?tr:tr instanceof BaseError$4?tr.walk(xr=>"data"in xr)||tr.walk():{},{code:gr,data:yr,details:_r,message:br,shortMessage:vr}=mr,wr=tr instanceof AbiDecodingZeroDataError?new ContractFunctionZeroDataError({functionName:fr}):[EXECUTION_REVERTED_ERROR_CODE,InternalRpcError.code].includes(gr)&&(yr||_r||br||vr)?new ContractFunctionRevertedError({abi:rr,data:typeof yr=="object"?yr.data:yr,functionName:fr,message:mr instanceof RpcRequestError?_r:vr??br}):tr;return new ContractFunctionExecutionError(wr,{abi:rr,args:lr,contractAddress:ir,docsPath:dr,functionName:fr,sender:hr})}const version$4="0.1.1";function getVersion$2(){return version$4}let BaseError$2=class Cd extends Error{constructor(rr,ir={}){const lr=(()=>{var gr;if(ir.cause instanceof Cd){if(ir.cause.details)return ir.cause.details;if(ir.cause.shortMessage)return ir.cause.shortMessage}return ir.cause&&"details"in ir.cause&&typeof ir.cause.details=="string"?ir.cause.details:(gr=ir.cause)!=null&&gr.message?ir.cause.message:ir.details})(),dr=ir.cause instanceof Cd&&ir.cause.docsPath||ir.docsPath,hr=`https://oxlib.sh${dr??""}`,mr=[rr||"An error occurred.",...ir.metaMessages?["",...ir.metaMessages]:[],...lr||dr?["",lr?`Details: ${lr}`:void 0,dr?`See: ${hr}`:void 0]:[]].filter(gr=>typeof gr=="string").join(`
821
- `);super(mr,ir.cause?{cause:ir.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:`ox@${getVersion$2()}`}),this.cause=ir.cause,this.details=lr,this.docs=hr,this.docsPath=dr,this.shortMessage=rr}walk(rr){return walk(this,rr)}};function walk(tr,rr){return rr!=null&&rr(tr)?tr:tr&&typeof tr=="object"&&"cause"in tr&&tr.cause?walk(tr.cause,rr):rr?null:tr}function pad(tr,rr={}){const{dir:ir,size:lr=32}=rr;if(lr===0)return tr;const dr=tr.replace("0x","");if(dr.length>lr*2)throw new SizeExceedsPaddingSizeError({size:Math.ceil(dr.length/2),targetSize:lr,type:"Hex"});return`0x${dr[ir==="right"?"padEnd":"padStart"](lr*2,"0")}`}function fromNumber(tr,rr={}){const{signed:ir,size:lr}=rr,dr=BigInt(tr);let fr;lr?ir?fr=(1n<<BigInt(lr)*8n-1n)-1n:fr=2n**(BigInt(lr)*8n)-1n:typeof tr=="number"&&(fr=BigInt(Number.MAX_SAFE_INTEGER));const hr=typeof fr=="bigint"&&ir?-fr-1n:0;if(fr&&dr>fr||dr<hr){const yr=typeof tr=="bigint"?"n":"";throw new IntegerOutOfRangeError({max:fr?`${fr}${yr}`:void 0,min:`${hr}${yr}`,signed:ir,size:lr,value:`${tr}${yr}`})}const gr=`0x${(ir&&dr<0?(1n<<BigInt(lr*8))+BigInt(dr):dr).toString(16)}`;return lr?padLeft(gr,lr):gr}function padLeft(tr,rr){return pad(tr,{dir:"left",size:rr})}class IntegerOutOfRangeError extends BaseError$2{constructor({max:rr,min:ir,signed:lr,size:dr,value:fr}){super(`Number \`${fr}\` is not in safe${dr?` ${dr*8}-bit`:""}${lr?" signed":" unsigned"} integer range ${rr?`(\`${ir}\` to \`${rr}\`)`:`(above \`${ir}\`)`}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.IntegerOutOfRangeError"})}}class SizeExceedsPaddingSizeError extends BaseError$2{constructor({size:rr,targetSize:ir,type:lr}){super(`${lr.charAt(0).toUpperCase()}${lr.slice(1).toLowerCase()} size (\`${rr}\`) exceeds padding size (\`${ir}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SizeExceedsPaddingSizeError"})}}function toRpc$1(tr){return{address:tr.address,amount:fromNumber(tr.amount),index:fromNumber(tr.index),validatorIndex:fromNumber(tr.validatorIndex)}}function toRpc(tr){return{...typeof tr.baseFeePerGas=="bigint"&&{baseFeePerGas:fromNumber(tr.baseFeePerGas)},...typeof tr.blobBaseFee=="bigint"&&{blobBaseFee:fromNumber(tr.blobBaseFee)},...typeof tr.feeRecipient=="string"&&{feeRecipient:tr.feeRecipient},...typeof tr.gasLimit=="bigint"&&{gasLimit:fromNumber(tr.gasLimit)},...typeof tr.number=="bigint"&&{number:fromNumber(tr.number)},...typeof tr.prevRandao=="bigint"&&{prevRandao:fromNumber(tr.prevRandao)},...typeof tr.time=="bigint"&&{time:fromNumber(tr.time)},...tr.withdrawals&&{withdrawals:tr.withdrawals.map(toRpc$1)}}}const aggregate3Signature="0x82ad56cb",deploylessCallViaBytecodeBytecode="0x608060405234801561001057600080fd5b5060405161018e38038061018e83398101604081905261002f91610124565b6000808351602085016000f59050803b61004857600080fd5b6000808351602085016000855af16040513d6000823e81610067573d81fd5b3d81f35b634e487b7160e01b600052604160045260246000fd5b600082601f83011261009257600080fd5b81516001600160401b038111156100ab576100ab61006b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156100d9576100d961006b565b6040528181528382016020018510156100f157600080fd5b60005b82811015610110576020818601810151838301820152016100f4565b506000918101602001919091529392505050565b6000806040838503121561013757600080fd5b82516001600160401b0381111561014d57600080fd5b61015985828601610081565b602085015190935090506001600160401b0381111561017757600080fd5b61018385828601610081565b915050925092905056fe",deploylessCallViaFactoryBytecode="0x608060405234801561001057600080fd5b506040516102c03803806102c083398101604081905261002f916101e6565b836001600160a01b03163b6000036100e457600080836001600160a01b03168360405161005c9190610270565b6000604051808303816000865af19150503d8060008114610099576040519150601f19603f3d011682016040523d82523d6000602084013e61009e565b606091505b50915091508115806100b857506001600160a01b0386163b155b156100e1578060405163101bb98d60e01b81526004016100d8919061028c565b60405180910390fd5b50505b6000808451602086016000885af16040513d6000823e81610103573d81fd5b3d81f35b80516001600160a01b038116811461011e57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561015457818101518382015260200161013c565b50506000910152565b600082601f83011261016e57600080fd5b81516001600160401b0381111561018757610187610123565b604051601f8201601f19908116603f011681016001600160401b03811182821017156101b5576101b5610123565b6040528181528382016020018510156101cd57600080fd5b6101de826020830160208701610139565b949350505050565b600080600080608085870312156101fc57600080fd5b61020585610107565b60208601519094506001600160401b0381111561022157600080fd5b61022d8782880161015d565b93505061023c60408601610107565b60608601519092506001600160401b0381111561025857600080fd5b6102648782880161015d565b91505092959194509250565b60008251610282818460208701610139565b9190910192915050565b60208152600082518060208401526102ab816040850160208701610139565b601f01601f1916919091016040019291505056fe";function getCallError(tr,{docsPath:rr,...ir}){const lr=(()=>{const dr=getNodeError(tr,ir);return dr instanceof UnknownNodeError?tr:dr})();return new CallExecutionError(lr,{docsPath:rr,...ir})}function withResolvers(){let tr=()=>{},rr=()=>{};return{promise:new Promise((lr,dr)=>{tr=lr,rr=dr}),resolve:tr,reject:rr}}const schedulerCache=new Map;function createBatchScheduler({fn:tr,id:rr,shouldSplitBatch:ir,wait:lr=0,sort:dr}){const fr=async()=>{const _r=gr();hr();const br=_r.map(({args:vr})=>vr);br.length!==0&&tr(br).then(vr=>{dr&&Array.isArray(vr)&&vr.sort(dr);for(let wr=0;wr<_r.length;wr++){const{resolve:xr}=_r[wr];xr==null||xr([vr[wr],vr])}}).catch(vr=>{for(let wr=0;wr<_r.length;wr++){const{reject:xr}=_r[wr];xr==null||xr(vr)}})},hr=()=>schedulerCache.delete(rr),mr=()=>gr().map(({args:_r})=>_r),gr=()=>schedulerCache.get(rr)||[],yr=_r=>schedulerCache.set(rr,[...gr(),_r]);return{flush:hr,async schedule(_r){const{promise:br,resolve:vr,reject:wr}=withResolvers();return(ir==null?void 0:ir([...mr(),_r]))&&fr(),gr().length>0?(yr({args:_r,resolve:vr,reject:wr}),br):(yr({args:_r,resolve:vr,reject:wr}),setTimeout(fr,lr),br)}}}async function call(tr,rr){var Xn,Lr,Gr,Hn;const{account:ir=tr.account,authorizationList:lr,batch:dr=!!((Xn=tr.batch)!=null&&Xn.multicall),blockNumber:fr,blockTag:hr=tr.experimental_blockTag??"latest",accessList:mr,blobs:gr,blockOverrides:yr,code:_r,data:br,factory:vr,factoryData:wr,gas:xr,gasPrice:Sr,maxFeePerBlobGas:Ar,maxFeePerGas:Ir,maxPriorityFeePerGas:Mr,nonce:Or,to:$r,value:Dr,stateOverride:zr,...Fr}=rr,Jr=ir?parseAccount(ir):void 0;if(_r&&(vr||wr))throw new BaseError$4("Cannot provide both `code` & `factory`/`factoryData` as parameters.");if(_r&&$r)throw new BaseError$4("Cannot provide both `code` & `to` as parameters.");const $n=_r&&br,Qr=vr&&wr&&$r&&br,Zn=$n||Qr,qn=$n?toDeploylessCallViaBytecodeData({code:_r,data:br}):Qr?toDeploylessCallViaFactoryData({data:br,factory:vr,factoryData:wr,to:$r}):br;try{assertRequest(rr);const oi=(typeof fr=="bigint"?numberToHex(fr):void 0)||hr,ri=yr?toRpc(yr):void 0,ti=serializeStateOverride(zr),si=(Hn=(Gr=(Lr=tr.chain)==null?void 0:Lr.formatters)==null?void 0:Gr.transactionRequest)==null?void 0:Hn.format,ni=(si||formatTransactionRequest)({...extract(Fr,{format:si}),from:Jr==null?void 0:Jr.address,accessList:mr,authorizationList:lr,blobs:gr,data:qn,gas:xr,gasPrice:Sr,maxFeePerBlobGas:Ar,maxFeePerGas:Ir,maxPriorityFeePerGas:Mr,nonce:Or,to:Zn?void 0:$r,value:Dr});if(dr&&shouldPerformMulticall({request:ni})&&!ti&&!ri)try{return await scheduleMulticall(tr,{...ni,blockNumber:fr,blockTag:hr})}catch(ai){if(!(ai instanceof ClientChainNotConfiguredError)&&!(ai instanceof ChainDoesNotSupportContract))throw ai}const Yn=(()=>{const ai=[ni,oi];return ti&&ri?[...ai,ti,ri]:ti?[...ai,ti]:ri?[...ai,{},ri]:ai})(),ei=await tr.request({method:"eth_call",params:Yn});return ei==="0x"?{data:void 0}:{data:ei}}catch(ii){const oi=getRevertErrorData(ii),{offchainLookup:ri,offchainLookupSignature:ti}=await __vitePreload(async()=>{const{offchainLookup:si,offchainLookupSignature:Jn}=await import("./ccip.B4gPk9T8.js");return{offchainLookup:si,offchainLookupSignature:Jn}},[],import.meta.url);if(tr.ccipRead!==!1&&(oi==null?void 0:oi.slice(0,10))===ti&&$r)return{data:await ri(tr,{data:oi,to:$r})};throw Zn&&(oi==null?void 0:oi.slice(0,10))==="0x101bb98d"?new CounterfactualDeploymentFailedError({factory:vr}):getCallError(ii,{...rr,account:Jr,chain:tr.chain})}}function shouldPerformMulticall({request:tr}){const{data:rr,to:ir,...lr}=tr;return!(!rr||rr.startsWith(aggregate3Signature)||!ir||Object.values(lr).filter(dr=>typeof dr<"u").length>0)}async function scheduleMulticall(tr,rr){var Sr;const{batchSize:ir=1024,wait:lr=0}=typeof((Sr=tr.batch)==null?void 0:Sr.multicall)=="object"?tr.batch.multicall:{},{blockNumber:dr,blockTag:fr=tr.experimental_blockTag??"latest",data:hr,multicallAddress:mr,to:gr}=rr;let yr=mr;if(!yr){if(!tr.chain)throw new ClientChainNotConfiguredError;yr=getChainContractAddress({blockNumber:dr,chain:tr.chain,contract:"multicall3"})}const br=(typeof dr=="bigint"?numberToHex(dr):void 0)||fr,{schedule:vr}=createBatchScheduler({id:`${tr.uid}.${br}`,wait:lr,shouldSplitBatch(Ar){return Ar.reduce((Mr,{data:Or})=>Mr+(Or.length-2),0)>ir*2},fn:async Ar=>{const Ir=Ar.map($r=>({allowFailure:!0,callData:$r.data,target:$r.to})),Mr=encodeFunctionData({abi:multicall3Abi,args:[Ir],functionName:"aggregate3"}),Or=await tr.request({method:"eth_call",params:[{data:Mr,to:yr},br]});return decodeFunctionResult({abi:multicall3Abi,args:[Ir],functionName:"aggregate3",data:Or||"0x"})}}),[{returnData:wr,success:xr}]=await vr({data:hr,to:gr});if(!xr)throw new RawContractError({data:wr});return wr==="0x"?{data:void 0}:{data:wr}}function toDeploylessCallViaBytecodeData(tr){const{code:rr,data:ir}=tr;return encodeDeployData({abi:parseAbi(["constructor(bytes, bytes)"]),bytecode:deploylessCallViaBytecodeBytecode,args:[rr,ir]})}function toDeploylessCallViaFactoryData(tr){const{data:rr,factory:ir,factoryData:lr,to:dr}=tr;return encodeDeployData({abi:parseAbi(["constructor(address, bytes, address, bytes)"]),bytecode:deploylessCallViaFactoryBytecode,args:[dr,rr,ir,lr]})}function getRevertErrorData(tr){var ir;if(!(tr instanceof BaseError$4))return;const rr=tr.walk();return typeof(rr==null?void 0:rr.data)=="object"?(ir=rr.data)==null?void 0:ir.data:rr.data}async function readContract(tr,rr){const{abi:ir,address:lr,args:dr,functionName:fr,...hr}=rr,mr=encodeFunctionData({abi:ir,args:dr,functionName:fr});try{const{data:gr}=await getAction$1(tr,call,"call")({...hr,data:mr,to:lr});return decodeFunctionResult({abi:ir,args:dr,functionName:fr,data:gr||"0x"})}catch(gr){throw getContractError(gr,{abi:ir,address:lr,args:dr,docsPath:"/docs/contract/readContract",functionName:fr})}}class EnsAvatarInvalidMetadataError extends BaseError$4{constructor({data:rr}){super("Unable to extract image from metadata. The metadata may be malformed or invalid.",{metaMessages:["- Metadata must be a JSON object with at least an `image`, `image_url` or `image_data` property.","",`Provided data: ${JSON.stringify(rr)}`],name:"EnsAvatarInvalidMetadataError"})}}class EnsAvatarInvalidNftUriError extends BaseError$4{constructor({reason:rr}){super(`ENS NFT avatar URI is invalid. ${rr}`,{name:"EnsAvatarInvalidNftUriError"})}}class EnsAvatarUriResolutionError extends BaseError$4{constructor({uri:rr}){super(`Unable to resolve ENS avatar URI "${rr}". The URI may be malformed, invalid, or does not respond with a valid image.`,{name:"EnsAvatarUriResolutionError"})}}class EnsAvatarUnsupportedNamespaceError extends BaseError$4{constructor({namespace:rr}){super(`ENS NFT avatar namespace "${rr}" is not supported. Must be "erc721" or "erc1155".`,{name:"EnsAvatarUnsupportedNamespaceError"})}}const networkRegex=/(?<protocol>https?:\/\/[^\/]*|ipfs:\/|ipns:\/|ar:\/)?(?<root>\/)?(?<subpath>ipfs\/|ipns\/)?(?<target>[\w\-.]+)(?<subtarget>\/.*)?/,ipfsHashRegex=/^(Qm[1-9A-HJ-NP-Za-km-z]{44,}|b[A-Za-z2-7]{58,}|B[A-Z2-7]{58,}|z[1-9A-HJ-NP-Za-km-z]{48,}|F[0-9A-F]{50,})(\/(?<target>[\w\-.]+))?(?<subtarget>\/.*)?$/,base64Regex=/^data:([a-zA-Z\-/+]*);base64,([^"].*)/,dataURIRegex=/^data:([a-zA-Z\-/+]*)?(;[a-zA-Z0-9].*?)?(,)/;async function isImageUri(tr){try{const rr=await fetch(tr,{method:"HEAD"});if(rr.status===200){const ir=rr.headers.get("content-type");return ir==null?void 0:ir.startsWith("image/")}return!1}catch(rr){return typeof rr=="object"&&typeof rr.response<"u"||!globalThis.hasOwnProperty("Image")?!1:new Promise(ir=>{const lr=new Image;lr.onload=()=>{ir(!0)},lr.onerror=()=>{ir(!1)},lr.src=tr})}}function getGateway(tr,rr){return tr?tr.endsWith("/")?tr.slice(0,-1):tr:rr}function resolveAvatarUri({uri:tr,gatewayUrls:rr}){const ir=base64Regex.test(tr);if(ir)return{uri:tr,isOnChain:!0,isEncoded:ir};const lr=getGateway(rr==null?void 0:rr.ipfs,"https://ipfs.io"),dr=getGateway(rr==null?void 0:rr.arweave,"https://arweave.net"),fr=tr.match(networkRegex),{protocol:hr,subpath:mr,target:gr,subtarget:yr=""}=(fr==null?void 0:fr.groups)||{},_r=hr==="ipns:/"||mr==="ipns/",br=hr==="ipfs:/"||mr==="ipfs/"||ipfsHashRegex.test(tr);if(tr.startsWith("http")&&!_r&&!br){let wr=tr;return rr!=null&&rr.arweave&&(wr=tr.replace(/https:\/\/arweave.net/g,rr==null?void 0:rr.arweave)),{uri:wr,isOnChain:!1,isEncoded:!1}}if((_r||br)&&gr)return{uri:`${lr}/${_r?"ipns":"ipfs"}/${gr}${yr}`,isOnChain:!1,isEncoded:!1};if(hr==="ar:/"&&gr)return{uri:`${dr}/${gr}${yr||""}`,isOnChain:!1,isEncoded:!1};let vr=tr.replace(dataURIRegex,"");if(vr.startsWith("<svg")&&(vr=`data:image/svg+xml;base64,${btoa(vr)}`),vr.startsWith("data:")||vr.startsWith("{"))return{uri:vr,isOnChain:!0,isEncoded:!1};throw new EnsAvatarUriResolutionError({uri:tr})}function getJsonImage(tr){if(typeof tr!="object"||!("image"in tr)&&!("image_url"in tr)&&!("image_data"in tr))throw new EnsAvatarInvalidMetadataError({data:tr});return tr.image||tr.image_url||tr.image_data}async function getMetadataAvatarUri({gatewayUrls:tr,uri:rr}){try{const ir=await fetch(rr).then(dr=>dr.json());return await parseAvatarUri({gatewayUrls:tr,uri:getJsonImage(ir)})}catch{throw new EnsAvatarUriResolutionError({uri:rr})}}async function parseAvatarUri({gatewayUrls:tr,uri:rr}){const{uri:ir,isOnChain:lr}=resolveAvatarUri({uri:rr,gatewayUrls:tr});if(lr||await isImageUri(ir))return ir;throw new EnsAvatarUriResolutionError({uri:rr})}function parseNftUri(tr){let rr=tr;rr.startsWith("did:nft:")&&(rr=rr.replace("did:nft:","").replace(/_/g,"/"));const[ir,lr,dr]=rr.split("/"),[fr,hr]=ir.split(":"),[mr,gr]=lr.split(":");if(!fr||fr.toLowerCase()!=="eip155")throw new EnsAvatarInvalidNftUriError({reason:"Only EIP-155 supported"});if(!hr)throw new EnsAvatarInvalidNftUriError({reason:"Chain ID not found"});if(!gr)throw new EnsAvatarInvalidNftUriError({reason:"Contract address not found"});if(!dr)throw new EnsAvatarInvalidNftUriError({reason:"Token ID not found"});if(!mr)throw new EnsAvatarInvalidNftUriError({reason:"ERC namespace not found"});return{chainID:Number.parseInt(hr),namespace:mr.toLowerCase(),contractAddress:gr,tokenID:dr}}async function getNftTokenUri(tr,{nft:rr}){if(rr.namespace==="erc721")return readContract(tr,{address:rr.contractAddress,abi:[{name:"tokenURI",type:"function",stateMutability:"view",inputs:[{name:"tokenId",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"tokenURI",args:[BigInt(rr.tokenID)]});if(rr.namespace==="erc1155")return readContract(tr,{address:rr.contractAddress,abi:[{name:"uri",type:"function",stateMutability:"view",inputs:[{name:"_id",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"uri",args:[BigInt(rr.tokenID)]});throw new EnsAvatarUnsupportedNamespaceError({namespace:rr.namespace})}async function parseAvatarRecord(tr,{gatewayUrls:rr,record:ir}){return/eip155:/i.test(ir)?parseNftAvatarUri(tr,{gatewayUrls:rr,record:ir}):parseAvatarUri({uri:ir,gatewayUrls:rr})}async function parseNftAvatarUri(tr,{gatewayUrls:rr,record:ir}){const lr=parseNftUri(ir),dr=await getNftTokenUri(tr,{nft:lr}),{uri:fr,isOnChain:hr,isEncoded:mr}=resolveAvatarUri({uri:dr,gatewayUrls:rr});if(hr&&(fr.includes("data:application/json;base64,")||fr.startsWith("{"))){const yr=mr?atob(fr.replace("data:application/json;base64,","")):fr,_r=JSON.parse(yr);return parseAvatarUri({uri:getJsonImage(_r),gatewayUrls:rr})}let gr=lr.tokenID;return lr.namespace==="erc1155"&&(gr=gr.replace("0x","").padStart(64,"0")),getMetadataAvatarUri({gatewayUrls:rr,uri:fr.replace(/(?:0x)?{id}/,gr)})}async function getEnsText(tr,rr){const{blockNumber:ir,blockTag:lr,key:dr,name:fr,gatewayUrls:hr,strict:mr}=rr,{chain:gr}=tr,yr=(()=>{if(rr.universalResolverAddress)return rr.universalResolverAddress;if(!gr)throw new Error("client chain not configured. universalResolverAddress is required.");return getChainContractAddress({blockNumber:ir,chain:gr,contract:"ensUniversalResolver"})})(),_r=gr==null?void 0:gr.ensTlds;if(_r&&!_r.some(br=>fr.endsWith(br)))return null;try{const br={address:yr,abi:universalResolverResolveAbi,functionName:"resolve",args:[toHex(packetToBytes(fr)),encodeFunctionData({abi:textResolverAbi,functionName:"text",args:[namehash(fr),dr]}),hr??[localBatchGatewayUrl]],blockNumber:ir,blockTag:lr},wr=await getAction$1(tr,readContract,"readContract")(br);if(wr[0]==="0x")return null;const xr=decodeFunctionResult({abi:textResolverAbi,functionName:"text",data:wr[0]});return xr===""?null:xr}catch(br){if(mr)throw br;if(isNullUniversalResolverError(br,"resolve"))return null;throw br}}async function getEnsAvatar$1(tr,{blockNumber:rr,blockTag:ir,assetGatewayUrls:lr,name:dr,gatewayUrls:fr,strict:hr,universalResolverAddress:mr}){const gr=await getAction$1(tr,getEnsText,"getEnsText")({blockNumber:rr,blockTag:ir,key:"avatar",name:dr,universalResolverAddress:mr,gatewayUrls:fr,strict:hr});if(!gr)return null;try{return await parseAvatarRecord(tr,{record:gr,gatewayUrls:lr})}catch{return null}}async function getEnsName$1(tr,{address:rr,blockNumber:ir,blockTag:lr,gatewayUrls:dr,strict:fr,universalResolverAddress:hr}){let mr=hr;if(!mr){if(!tr.chain)throw new Error("client chain not configured. universalResolverAddress is required.");mr=getChainContractAddress({blockNumber:ir,chain:tr.chain,contract:"ensUniversalResolver"})}const gr=`${rr.toLowerCase().substring(2)}.addr.reverse`;try{const yr={address:mr,abi:universalResolverReverseAbi,functionName:"reverse",args:[toHex(packetToBytes(gr))],blockNumber:ir,blockTag:lr},_r=getAction$1(tr,readContract,"readContract"),[br,vr]=dr?await _r({...yr,args:[...yr.args,dr]}):await _r(yr);return rr.toLowerCase()!==vr.toLowerCase()?null:br}catch(yr){if(fr)throw yr;if(isNullUniversalResolverError(yr,"reverse"))return null;throw yr}}const promiseCache=new LruMap(8192);function withDedupe(tr,{enabled:rr=!0,id:ir}){if(!rr||!ir)return tr();if(promiseCache.get(ir))return promiseCache.get(ir);const lr=tr().finally(()=>promiseCache.delete(ir));return promiseCache.set(ir,lr),lr}async function wait(tr){return new Promise(rr=>setTimeout(rr,tr))}function withRetry(tr,{delay:rr=100,retryCount:ir=2,shouldRetry:lr=()=>!0}={}){return new Promise((dr,fr)=>{const hr=async({count:mr=0}={})=>{const gr=async({error:yr})=>{const _r=typeof rr=="function"?rr({count:mr,error:yr}):rr;_r&&await wait(_r),hr({count:mr+1})};try{const yr=await tr();dr(yr)}catch(yr){if(mr<ir&&await lr({count:mr,error:yr}))return gr({error:yr});fr(yr)}};hr()})}function buildRequest(tr,rr={}){return async(ir,lr={})=>{var br;const{dedupe:dr=!1,methods:fr,retryDelay:hr=150,retryCount:mr=3,uid:gr}={...rr,...lr},{method:yr}=ir;if((br=fr==null?void 0:fr.exclude)!=null&&br.includes(yr))throw new MethodNotSupportedRpcError(new Error("method not supported"),{method:yr});if(fr!=null&&fr.include&&!fr.include.includes(yr))throw new MethodNotSupportedRpcError(new Error("method not supported"),{method:yr});const _r=dr?stringToHex(`${gr}.${stringify(ir)}`):void 0;return withDedupe(()=>withRetry(async()=>{try{return await tr(ir)}catch(vr){const wr=vr;switch(wr.code){case ParseRpcError.code:throw new ParseRpcError(wr);case InvalidRequestRpcError.code:throw new InvalidRequestRpcError(wr);case MethodNotFoundRpcError.code:throw new MethodNotFoundRpcError(wr,{method:ir.method});case InvalidParamsRpcError.code:throw new InvalidParamsRpcError(wr);case InternalRpcError.code:throw new InternalRpcError(wr);case InvalidInputRpcError.code:throw new InvalidInputRpcError(wr);case ResourceNotFoundRpcError.code:throw new ResourceNotFoundRpcError(wr);case ResourceUnavailableRpcError.code:throw new ResourceUnavailableRpcError(wr);case TransactionRejectedRpcError.code:throw new TransactionRejectedRpcError(wr);case MethodNotSupportedRpcError.code:throw new MethodNotSupportedRpcError(wr,{method:ir.method});case LimitExceededRpcError.code:throw new LimitExceededRpcError(wr);case JsonRpcVersionUnsupportedError.code:throw new JsonRpcVersionUnsupportedError(wr);case UserRejectedRequestError.code:throw new UserRejectedRequestError(wr);case UnauthorizedProviderError.code:throw new UnauthorizedProviderError(wr);case UnsupportedProviderMethodError.code:throw new UnsupportedProviderMethodError(wr);case ProviderDisconnectedError.code:throw new ProviderDisconnectedError(wr);case ChainDisconnectedError.code:throw new ChainDisconnectedError(wr);case SwitchChainError.code:throw new SwitchChainError(wr);case UnsupportedNonOptionalCapabilityError.code:throw new UnsupportedNonOptionalCapabilityError(wr);case UnsupportedChainIdError.code:throw new UnsupportedChainIdError(wr);case DuplicateIdError.code:throw new DuplicateIdError(wr);case UnknownBundleIdError.code:throw new UnknownBundleIdError(wr);case BundleTooLargeError.code:throw new BundleTooLargeError(wr);case AtomicReadyWalletRejectedUpgradeError.code:throw new AtomicReadyWalletRejectedUpgradeError(wr);case AtomicityNotSupportedError.code:throw new AtomicityNotSupportedError(wr);case 5e3:throw new UserRejectedRequestError(wr);default:throw vr instanceof BaseError$4?vr:new UnknownRpcError(wr)}}},{delay:({count:vr,error:wr})=>{var xr;if(wr&&wr instanceof HttpRequestError){const Sr=(xr=wr==null?void 0:wr.headers)==null?void 0:xr.get("Retry-After");if(Sr!=null&&Sr.match(/\d/))return Number.parseInt(Sr)*1e3}return~~(1<<vr)*hr},retryCount:mr,shouldRetry:({error:vr})=>shouldRetry(vr)}),{enabled:dr,id:_r})}}function shouldRetry(tr){return"code"in tr&&typeof tr.code=="number"?tr.code===-1||tr.code===LimitExceededRpcError.code||tr.code===InternalRpcError.code:tr instanceof HttpRequestError&&tr.status?tr.status===403||tr.status===408||tr.status===413||tr.status===429||tr.status===500||tr.status===502||tr.status===503||tr.status===504:!0}function defineChain(tr){return{formatters:void 0,fees:void 0,serializers:void 0,...tr}}function withTimeout(tr,{errorInstance:rr=new Error("timed out"),timeout:ir,signal:lr}){return new Promise((dr,fr)=>{(async()=>{let hr;try{const mr=new AbortController;ir>0&&(hr=setTimeout(()=>{lr?mr.abort():fr(rr)},ir)),dr(await tr({signal:(mr==null?void 0:mr.signal)||null}))}catch(mr){(mr==null?void 0:mr.name)==="AbortError"&&fr(rr),fr(mr)}finally{clearTimeout(hr)}})()})}function createIdStore(){return{current:0,take(){return this.current++},reset(){this.current=0}}}const idCache=createIdStore();function getHttpRpcClient(tr,rr={}){return{async request(ir){var br;const{body:lr,onRequest:dr=rr.onRequest,onResponse:fr=rr.onResponse,timeout:hr=rr.timeout??1e4}=ir,mr={...rr.fetchOptions??{},...ir.fetchOptions??{}},{headers:gr,method:yr,signal:_r}=mr;try{const vr=await withTimeout(async({signal:xr})=>{const Sr={...mr,body:Array.isArray(lr)?stringify(lr.map(Or=>({jsonrpc:"2.0",id:Or.id??idCache.take(),...Or}))):stringify({jsonrpc:"2.0",id:lr.id??idCache.take(),...lr}),headers:{"Content-Type":"application/json",...gr},method:yr||"POST",signal:_r||(hr>0?xr:null)},Ar=new Request(tr,Sr),Ir=await(dr==null?void 0:dr(Ar,Sr))??{...Sr,url:tr};return await fetch(Ir.url??tr,Ir)},{errorInstance:new TimeoutError({body:lr,url:tr}),timeout:hr,signal:!0});fr&&await fr(vr);let wr;if((br=vr.headers.get("Content-Type"))!=null&&br.startsWith("application/json"))wr=await vr.json();else{wr=await vr.text();try{wr=JSON.parse(wr||"{}")}catch(xr){if(vr.ok)throw xr;wr={error:wr}}}if(!vr.ok)throw new HttpRequestError({body:lr,details:stringify(wr.error)||vr.statusText,headers:vr.headers,status:vr.status,url:tr});return wr}catch(vr){throw vr instanceof HttpRequestError||vr instanceof TimeoutError?vr:new HttpRequestError({body:lr,cause:vr,url:tr})}}}}function getAction(tr,rr,ir){const lr=tr[rr.name];if(typeof lr=="function")return lr;const dr=tr[ir];return typeof dr=="function"?dr:fr=>rr(tr,fr)}const version$3="2.19.0",getVersion$1=()=>`@wagmi/core@${version$3}`;var __classPrivateFieldGet=function(tr,rr,ir,lr){if(ir==="a"&&!lr)throw new TypeError("Private accessor was defined without a getter");if(typeof rr=="function"?tr!==rr||!lr:!rr.has(tr))throw new TypeError("Cannot read private member from an object whose class did not declare it");return ir==="m"?lr:ir==="a"?lr.call(tr):lr?lr.value:rr.get(tr)},_BaseError_instances,_BaseError_walk;let BaseError$1=class Td extends Error{get docsBaseUrl(){return"https://wagmi.sh/core"}get version(){return getVersion$1()}constructor(rr,ir={}){var fr;super(),_BaseError_instances.add(this),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"WagmiCoreError"});const lr=ir.cause instanceof Td?ir.cause.details:(fr=ir.cause)!=null&&fr.message?ir.cause.message:ir.details,dr=ir.cause instanceof Td&&ir.cause.docsPath||ir.docsPath;this.message=[rr||"An error occurred.","",...ir.metaMessages?[...ir.metaMessages,""]:[],...dr?[`Docs: ${this.docsBaseUrl}${dr}.html${ir.docsSlug?`#${ir.docsSlug}`:""}`]:[],...lr?[`Details: ${lr}`]:[],`Version: ${this.version}`].join(`
822
- `),ir.cause&&(this.cause=ir.cause),this.details=lr,this.docsPath=dr,this.metaMessages=ir.metaMessages,this.shortMessage=rr}walk(rr){return __classPrivateFieldGet(this,_BaseError_instances,"m",_BaseError_walk).call(this,this,rr)}};_BaseError_instances=new WeakSet,_BaseError_walk=function tr(rr,ir){return ir!=null&&ir(rr)?rr:rr.cause?__classPrivateFieldGet(this,_BaseError_instances,"m",tr).call(this,rr.cause,ir):rr};class ChainNotConfiguredError extends BaseError$1{constructor(){super("Chain not configured."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ChainNotConfiguredError"})}}const size$1=256;let index$1=size$1,buffer$1;function uid$1(tr=11){if(!buffer$1||index$1+tr>size$1*2){buffer$1="",index$1=0;for(let rr=0;rr<size$1;rr++)buffer$1+=(256+Math.random()*256|0).toString(16).substring(1)}return buffer$1.substring(index$1,index$1+++tr)}function createClient(tr){const{batch:rr,chain:ir,ccipRead:lr,key:dr="base",name:fr="Base Client",type:hr="base"}=tr,mr=tr.experimental_blockTag??(typeof(ir==null?void 0:ir.experimental_preconfirmationTime)=="number"?"pending":void 0),gr=(ir==null?void 0:ir.blockTime)??12e3,yr=Math.min(Math.max(Math.floor(gr/2),500),4e3),_r=tr.pollingInterval??yr,br=tr.cacheTime??_r,vr=tr.account?parseAccount(tr.account):void 0,{config:wr,request:xr,value:Sr}=tr.transport({chain:ir,pollingInterval:_r}),Ar={...wr,...Sr},Ir={account:vr,batch:rr,cacheTime:br,ccipRead:lr,chain:ir,key:dr,name:fr,pollingInterval:_r,request:xr,transport:Ar,type:hr,uid:uid$1(),...mr?{experimental_blockTag:mr}:{}};function Mr(Or){return $r=>{const Dr=$r(Or);for(const Fr in Ir)delete Dr[Fr];const zr={...Or,...Dr};return Object.assign(zr,{extend:Mr(zr)})}}return Object.assign(Ir,{extend:Mr(Ir)})}function createTransport({key:tr,methods:rr,name:ir,request:lr,retryCount:dr=3,retryDelay:fr=150,timeout:hr,type:mr},gr){const yr=uid$1();return{config:{key:tr,methods:rr,name:ir,request:lr,retryCount:dr,retryDelay:fr,timeout:hr,type:mr},request:buildRequest(lr,{methods:rr,retryCount:dr,retryDelay:fr,uid:yr}),value:gr}}class UrlRequiredError extends BaseError$4{constructor(){super("No URL was provided to the Transport. Please provide a valid RPC URL to the Transport.",{docsPath:"/docs/clients/intro",name:"UrlRequiredError"})}}function http(tr,rr={}){const{batch:ir,fetchOptions:lr,key:dr="http",methods:fr,name:hr="HTTP JSON-RPC",onFetchRequest:mr,onFetchResponse:gr,retryDelay:yr,raw:_r}=rr;return({chain:br,retryCount:vr,timeout:wr})=>{const{batchSize:xr=1e3,wait:Sr=0}=typeof ir=="object"?ir:{},Ar=rr.retryCount??vr,Ir=wr??rr.timeout??1e4,Mr=br==null?void 0:br.rpcUrls.default.http[0];if(!Mr)throw new UrlRequiredError;const Or=getHttpRpcClient(Mr,{fetchOptions:lr,onRequest:mr,onResponse:gr,timeout:Ir});return createTransport({key:dr,methods:fr,name:hr,async request({method:$r,params:Dr}){const zr={method:$r,params:Dr},{schedule:Fr}=createBatchScheduler({id:Mr,wait:Sr,shouldSplitBatch(Zn){return Zn.length>xr},fn:Zn=>Or.request({body:Zn}),sort:(Zn,qn)=>Zn.id-qn.id}),Jr=async Zn=>ir?Fr(Zn):[await Or.request({body:Zn})],[{error:$n,result:Qr}]=await Jr(zr);if(_r)return{error:$n,result:Qr};if($n)throw new RpcRequestError({body:zr,error:$n,url:Mr});return Qr},retryCount:Ar,retryDelay:yr,timeout:Ir,type:"http"},{fetchOptions:lr,url:Mr})}}function getChainId(tr){return tr.state.chainId}function getEnsAvatar(tr,rr){const{chainId:ir,...lr}=rr,dr=tr.getClient({chainId:ir});return getAction(dr,getEnsAvatar$1,"getEnsAvatar")(lr)}function getEnsName(tr,rr){const{chainId:ir,...lr}=rr,dr=tr.getClient({chainId:ir});return getAction(dr,getEnsName$1,"getEnsName")(lr)}let isReconnecting=!1;async function reconnect(tr,rr={}){var yr,_r;if(isReconnecting)return[];isReconnecting=!0,tr.setState(br=>({...br,status:br.current?"reconnecting":"connecting"}));const ir=[];if((yr=rr.connectors)!=null&&yr.length)for(const br of rr.connectors){let vr;typeof br=="function"?vr=tr._internal.connectors.setup(br):vr=br,ir.push(vr)}else ir.push(...tr.connectors);let lr;try{lr=await((_r=tr.storage)==null?void 0:_r.getItem("recentConnectorId"))}catch{}const dr={};for(const[,br]of tr.state.connections)dr[br.connector.id]=1;lr&&(dr[lr]=0);const fr=Object.keys(dr).length>0?[...ir].sort((br,vr)=>(dr[br.id]??10)-(dr[vr.id]??10)):ir;let hr=!1;const mr=[],gr=[];for(const br of fr){const vr=await br.getProvider().catch(()=>{});if(!vr||gr.some(Sr=>Sr===vr)||!await br.isAuthorized())continue;const xr=await br.connect({isReconnecting:!0}).catch(()=>null);xr&&(br.emitter.off("connect",tr._internal.events.connect),br.emitter.on("change",tr._internal.events.change),br.emitter.on("disconnect",tr._internal.events.disconnect),tr.setState(Sr=>{const Ar=new Map(hr?Sr.connections:new Map).set(br.uid,{accounts:xr.accounts,chainId:xr.chainId,connector:br});return{...Sr,current:hr?Sr.current:br.uid,connections:Ar}}),mr.push({accounts:xr.accounts,chainId:xr.chainId,connector:br}),gr.push(vr),hr=!0)}return(tr.state.status==="reconnecting"||tr.state.status==="connecting")&&(hr?tr.setState(br=>({...br,status:"connected"})):tr.setState(br=>({...br,connections:new Map,current:null,status:"disconnected"}))),isReconnecting=!1,mr}class ProviderNotFoundError extends BaseError$1{constructor(){super("Provider not found."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ProviderNotFoundError"})}}function watchChainId(tr,rr){const{onChange:ir}=rr;return tr.subscribe(lr=>lr.chainId,ir)}function createConnector(tr){return tr}injected.type="injected";function injected(tr={}){const{shimDisconnect:rr=!0,unstable_shimAsyncInject:ir}=tr;function lr(){const gr=tr.target;if(typeof gr=="function"){const yr=gr();if(yr)return yr}return typeof gr=="object"?gr:typeof gr=="string"?{...targetMap[gr]??{id:gr,name:`${gr[0].toUpperCase()}${gr.slice(1)}`,provider:`is${gr[0].toUpperCase()}${gr.slice(1)}`}}:{id:"injected",name:"Injected",provider(yr){return yr==null?void 0:yr.ethereum}}}let dr,fr,hr,mr;return gr=>({get icon(){return lr().icon},get id(){return lr().id},get name(){return lr().name},get supportsSimulation(){return!0},type:injected.type,async setup(){const yr=await this.getProvider();yr!=null&&yr.on&&tr.target&&(hr||(hr=this.onConnect.bind(this),yr.on("connect",hr)),dr||(dr=this.onAccountsChanged.bind(this),yr.on("accountsChanged",dr)))},async connect({chainId:yr,isReconnecting:_r}={}){var wr,xr,Sr,Ar,Ir,Mr;const br=await this.getProvider();if(!br)throw new ProviderNotFoundError;let vr=[];if(_r)vr=await this.getAccounts().catch(()=>[]);else if(rr)try{vr=(Ar=(Sr=(xr=(wr=(await br.request({method:"wallet_requestPermissions",params:[{eth_accounts:{}}]}))[0])==null?void 0:wr.caveats)==null?void 0:xr[0])==null?void 0:Sr.value)==null?void 0:Ar.map($r=>getAddress($r)),vr.length>0&&(vr=await this.getAccounts())}catch(Or){const $r=Or;if($r.code===UserRejectedRequestError.code)throw new UserRejectedRequestError($r);if($r.code===ResourceUnavailableRpcError.code)throw $r}try{!(vr!=null&&vr.length)&&!_r&&(vr=(await br.request({method:"eth_requestAccounts"})).map(Dr=>getAddress(Dr))),hr&&(br.removeListener("connect",hr),hr=void 0),dr||(dr=this.onAccountsChanged.bind(this),br.on("accountsChanged",dr)),fr||(fr=this.onChainChanged.bind(this),br.on("chainChanged",fr)),mr||(mr=this.onDisconnect.bind(this),br.on("disconnect",mr));let Or=await this.getChainId();if(yr&&Or!==yr){const $r=await this.switchChain({chainId:yr}).catch(Dr=>{if(Dr.code===UserRejectedRequestError.code)throw Dr;return{id:Or}});Or=($r==null?void 0:$r.id)??Or}return rr&&await((Ir=gr.storage)==null?void 0:Ir.removeItem(`${this.id}.disconnected`)),tr.target||await((Mr=gr.storage)==null?void 0:Mr.setItem("injected.connected",!0)),{accounts:vr,chainId:Or}}catch(Or){const $r=Or;throw $r.code===UserRejectedRequestError.code?new UserRejectedRequestError($r):$r.code===ResourceUnavailableRpcError.code?new ResourceUnavailableRpcError($r):$r}},async disconnect(){var _r,br;const yr=await this.getProvider();if(!yr)throw new ProviderNotFoundError;fr&&(yr.removeListener("chainChanged",fr),fr=void 0),mr&&(yr.removeListener("disconnect",mr),mr=void 0),hr||(hr=this.onConnect.bind(this),yr.on("connect",hr));try{await withTimeout(()=>yr.request({method:"wallet_revokePermissions",params:[{eth_accounts:{}}]}),{timeout:100})}catch{}rr&&await((_r=gr.storage)==null?void 0:_r.setItem(`${this.id}.disconnected`,!0)),tr.target||await((br=gr.storage)==null?void 0:br.removeItem("injected.connected"))},async getAccounts(){const yr=await this.getProvider();if(!yr)throw new ProviderNotFoundError;return(await yr.request({method:"eth_accounts"})).map(br=>getAddress(br))},async getChainId(){const yr=await this.getProvider();if(!yr)throw new ProviderNotFoundError;const _r=await yr.request({method:"eth_chainId"});return Number(_r)},async getProvider(){if(typeof window>"u")return;let yr;const _r=lr();return typeof _r.provider=="function"?yr=_r.provider(window):typeof _r.provider=="string"?yr=findProvider(window,_r.provider):yr=_r.provider,yr&&!yr.removeListener&&("off"in yr&&typeof yr.off=="function"?yr.removeListener=yr.off:yr.removeListener=()=>{}),yr},async isAuthorized(){var yr,_r;try{if(rr&&await((yr=gr.storage)==null?void 0:yr.getItem(`${this.id}.disconnected`))||!tr.target&&!await((_r=gr.storage)==null?void 0:_r.getItem("injected.connected")))return!1;if(!await this.getProvider()){if(ir!==void 0&&ir!==!1){const xr=async()=>(typeof window<"u"&&window.removeEventListener("ethereum#initialized",xr),!!await this.getProvider()),Sr=typeof ir=="number"?ir:1e3;if(await Promise.race([...typeof window<"u"?[new Promise(Ir=>window.addEventListener("ethereum#initialized",()=>Ir(xr()),{once:!0}))]:[],new Promise(Ir=>setTimeout(()=>Ir(xr()),Sr))]))return!0}throw new ProviderNotFoundError}return!!(await withRetry(()=>this.getAccounts())).length}catch{return!1}},async switchChain({addEthereumChainParameter:yr,chainId:_r}){var xr,Sr,Ar,Ir;const br=await this.getProvider();if(!br)throw new ProviderNotFoundError;const vr=gr.chains.find(Mr=>Mr.id===_r);if(!vr)throw new SwitchChainError(new ChainNotConfiguredError);const wr=new Promise(Mr=>{const Or=($r=>{"chainId"in $r&&$r.chainId===_r&&(gr.emitter.off("change",Or),Mr())});gr.emitter.on("change",Or)});try{return await Promise.all([br.request({method:"wallet_switchEthereumChain",params:[{chainId:numberToHex(_r)}]}).then(async()=>{await this.getChainId()===_r&&gr.emitter.emit("change",{chainId:_r})}),wr]),vr}catch(Mr){const Or=Mr;if(Or.code===4902||((Sr=(xr=Or==null?void 0:Or.data)==null?void 0:xr.originalError)==null?void 0:Sr.code)===4902)try{const{default:$r,...Dr}=vr.blockExplorers??{};let zr;yr!=null&&yr.blockExplorerUrls?zr=yr.blockExplorerUrls:$r&&(zr=[$r.url,...Object.values(Dr).map($n=>$n.url)]);let Fr;(Ar=yr==null?void 0:yr.rpcUrls)!=null&&Ar.length?Fr=yr.rpcUrls:Fr=[((Ir=vr.rpcUrls.default)==null?void 0:Ir.http[0])??""];const Jr={blockExplorerUrls:zr,chainId:numberToHex(_r),chainName:(yr==null?void 0:yr.chainName)??vr.name,iconUrls:yr==null?void 0:yr.iconUrls,nativeCurrency:(yr==null?void 0:yr.nativeCurrency)??vr.nativeCurrency,rpcUrls:Fr};return await Promise.all([br.request({method:"wallet_addEthereumChain",params:[Jr]}).then(async()=>{if(await this.getChainId()===_r)gr.emitter.emit("change",{chainId:_r});else throw new UserRejectedRequestError(new Error("User rejected switch after adding network."))}),wr]),vr}catch($r){throw new UserRejectedRequestError($r)}throw Or.code===UserRejectedRequestError.code?new UserRejectedRequestError(Or):new SwitchChainError(Or)}},async onAccountsChanged(yr){var _r;if(yr.length===0)this.onDisconnect();else if(gr.emitter.listenerCount("connect")){const br=(await this.getChainId()).toString();this.onConnect({chainId:br}),rr&&await((_r=gr.storage)==null?void 0:_r.removeItem(`${this.id}.disconnected`))}else gr.emitter.emit("change",{accounts:yr.map(br=>getAddress(br))})},onChainChanged(yr){const _r=Number(yr);gr.emitter.emit("change",{chainId:_r})},async onConnect(yr){const _r=await this.getAccounts();if(_r.length===0)return;const br=Number(yr.chainId);gr.emitter.emit("connect",{accounts:_r,chainId:br});const vr=await this.getProvider();vr&&(hr&&(vr.removeListener("connect",hr),hr=void 0),dr||(dr=this.onAccountsChanged.bind(this),vr.on("accountsChanged",dr)),fr||(fr=this.onChainChanged.bind(this),vr.on("chainChanged",fr)),mr||(mr=this.onDisconnect.bind(this),vr.on("disconnect",mr)))},async onDisconnect(yr){const _r=await this.getProvider();yr&&yr.code===1013&&_r&&(await this.getAccounts()).length||(gr.emitter.emit("disconnect"),_r&&(fr&&(_r.removeListener("chainChanged",fr),fr=void 0),mr&&(_r.removeListener("disconnect",mr),mr=void 0),hr||(hr=this.onConnect.bind(this),_r.on("connect",hr))))}})}const targetMap={coinbaseWallet:{id:"coinbaseWallet",name:"Coinbase Wallet",provider(tr){return tr!=null&&tr.coinbaseWalletExtension?tr.coinbaseWalletExtension:findProvider(tr,"isCoinbaseWallet")}},metaMask:{id:"metaMask",name:"MetaMask",provider(tr){return findProvider(tr,rr=>{if(!rr.isMetaMask||rr.isBraveWallet&&!rr._events&&!rr._state)return!1;const ir=["isApexWallet","isAvalanche","isBitKeep","isBlockWallet","isKuCoinWallet","isMathWallet","isOkxWallet","isOKExWallet","isOneInchIOSWallet","isOneInchAndroidWallet","isOpera","isPhantom","isPortal","isRabby","isTokenPocket","isTokenary","isUniswapWallet","isZerion"];for(const lr of ir)if(rr[lr])return!1;return!0})}},phantom:{id:"phantom",name:"Phantom",provider(tr){var rr,ir;return(rr=tr==null?void 0:tr.phantom)!=null&&rr.ethereum?(ir=tr.phantom)==null?void 0:ir.ethereum:findProvider(tr,"isPhantom")}}};function findProvider(tr,rr){function ir(dr){return typeof rr=="function"?rr(dr):typeof rr=="string"?dr[rr]:!0}const lr=tr.ethereum;if(lr!=null&&lr.providers)return lr.providers.find(dr=>ir(dr));if(lr&&ir(lr))return lr}function requestProviders(tr){if(typeof window>"u")return;const rr=ir=>tr(ir.detail);return window.addEventListener("eip6963:announceProvider",rr),window.dispatchEvent(new CustomEvent("eip6963:requestProvider")),()=>window.removeEventListener("eip6963:announceProvider",rr)}function createStore$1(){const tr=new Set;let rr=[];const ir=()=>requestProviders(dr=>{rr.some(({info:fr})=>fr.uuid===dr.info.uuid)||(rr=[...rr,dr],tr.forEach(fr=>fr(rr,{added:[dr]})))});let lr=ir();return{_listeners(){return tr},clear(){tr.forEach(dr=>dr([],{removed:[...rr]})),rr=[]},destroy(){this.clear(),tr.clear(),lr==null||lr()},findProvider({rdns:dr}){return rr.find(fr=>fr.info.rdns===dr)},getProviders(){return rr},reset(){this.clear(),lr==null||lr(),lr=ir()},subscribe(dr,{emitImmediately:fr}={}){return tr.add(dr),fr&&dr(rr,{added:rr}),()=>tr.delete(dr)}}}const subscribeWithSelectorImpl=tr=>(rr,ir,lr)=>{const dr=lr.subscribe;return lr.subscribe=(hr,mr,gr)=>{let yr=hr;if(mr){const _r=(gr==null?void 0:gr.equalityFn)||Object.is;let br=hr(lr.getState());yr=vr=>{const wr=hr(vr);if(!_r(br,wr)){const xr=br;mr(br=wr,xr)}},gr!=null&&gr.fireImmediately&&mr(br,br)}return dr(yr)},tr(rr,ir,lr)},subscribeWithSelector=subscribeWithSelectorImpl;function createJSONStorage(tr,rr){let ir;try{ir=tr()}catch{return}return{getItem:dr=>{var fr;const hr=gr=>gr===null?null:JSON.parse(gr,void 0),mr=(fr=ir.getItem(dr))!=null?fr:null;return mr instanceof Promise?mr.then(hr):hr(mr)},setItem:(dr,fr)=>ir.setItem(dr,JSON.stringify(fr,void 0)),removeItem:dr=>ir.removeItem(dr)}}const toThenable=tr=>rr=>{try{const ir=tr(rr);return ir instanceof Promise?ir:{then(lr){return toThenable(lr)(ir)},catch(lr){return this}}}catch(ir){return{then(lr){return this},catch(lr){return toThenable(lr)(ir)}}}},persistImpl=(tr,rr)=>(ir,lr,dr)=>{let fr={storage:createJSONStorage(()=>localStorage),partialize:Sr=>Sr,version:0,merge:(Sr,Ar)=>({...Ar,...Sr}),...rr},hr=!1;const mr=new Set,gr=new Set;let yr=fr.storage;if(!yr)return tr((...Sr)=>{console.warn(`[zustand persist middleware] Unable to update item '${fr.name}', the given storage is currently unavailable.`),ir(...Sr)},lr,dr);const _r=()=>{const Sr=fr.partialize({...lr()});return yr.setItem(fr.name,{state:Sr,version:fr.version})},br=dr.setState;dr.setState=(Sr,Ar)=>{br(Sr,Ar),_r()};const vr=tr((...Sr)=>{ir(...Sr),_r()},lr,dr);dr.getInitialState=()=>vr;let wr;const xr=()=>{var Sr,Ar;if(!yr)return;hr=!1,mr.forEach(Mr=>{var Or;return Mr((Or=lr())!=null?Or:vr)});const Ir=((Ar=fr.onRehydrateStorage)==null?void 0:Ar.call(fr,(Sr=lr())!=null?Sr:vr))||void 0;return toThenable(yr.getItem.bind(yr))(fr.name).then(Mr=>{if(Mr)if(typeof Mr.version=="number"&&Mr.version!==fr.version){if(fr.migrate)return[!0,fr.migrate(Mr.state,Mr.version)];console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,Mr.state];return[!1,void 0]}).then(Mr=>{var Or;const[$r,Dr]=Mr;if(wr=fr.merge(Dr,(Or=lr())!=null?Or:vr),ir(wr,!0),$r)return _r()}).then(()=>{Ir==null||Ir(wr,void 0),wr=lr(),hr=!0,gr.forEach(Mr=>Mr(wr))}).catch(Mr=>{Ir==null||Ir(void 0,Mr)})};return dr.persist={setOptions:Sr=>{fr={...fr,...Sr},Sr.storage&&(yr=Sr.storage)},clearStorage:()=>{yr==null||yr.removeItem(fr.name)},getOptions:()=>fr,rehydrate:()=>xr(),hasHydrated:()=>hr,onHydrate:Sr=>(mr.add(Sr),()=>{mr.delete(Sr)}),onFinishHydration:Sr=>(gr.add(Sr),()=>{gr.delete(Sr)})},fr.skipHydration||xr(),wr||vr},persist=persistImpl,createStoreImpl=tr=>{let rr;const ir=new Set,lr=(yr,_r)=>{const br=typeof yr=="function"?yr(rr):yr;if(!Object.is(br,rr)){const vr=rr;rr=_r??(typeof br!="object"||br===null)?br:Object.assign({},rr,br),ir.forEach(wr=>wr(rr,vr))}},dr=()=>rr,mr={setState:lr,getState:dr,getInitialState:()=>gr,subscribe:yr=>(ir.add(yr),()=>ir.delete(yr))},gr=rr=tr(lr,dr,mr);return mr},createStore=tr=>tr?createStoreImpl(tr):createStoreImpl;var eventemitter3={exports:{}},hasRequiredEventemitter3;function requireEventemitter3(){return hasRequiredEventemitter3||(hasRequiredEventemitter3=1,(function(tr){var rr=Object.prototype.hasOwnProperty,ir="~";function lr(){}Object.create&&(lr.prototype=Object.create(null),new lr().__proto__||(ir=!1));function dr(gr,yr,_r){this.fn=gr,this.context=yr,this.once=_r||!1}function fr(gr,yr,_r,br,vr){if(typeof _r!="function")throw new TypeError("The listener must be a function");var wr=new dr(_r,br||gr,vr),xr=ir?ir+yr:yr;return gr._events[xr]?gr._events[xr].fn?gr._events[xr]=[gr._events[xr],wr]:gr._events[xr].push(wr):(gr._events[xr]=wr,gr._eventsCount++),gr}function hr(gr,yr){--gr._eventsCount===0?gr._events=new lr:delete gr._events[yr]}function mr(){this._events=new lr,this._eventsCount=0}mr.prototype.eventNames=function(){var yr=[],_r,br;if(this._eventsCount===0)return yr;for(br in _r=this._events)rr.call(_r,br)&&yr.push(ir?br.slice(1):br);return Object.getOwnPropertySymbols?yr.concat(Object.getOwnPropertySymbols(_r)):yr},mr.prototype.listeners=function(yr){var _r=ir?ir+yr:yr,br=this._events[_r];if(!br)return[];if(br.fn)return[br.fn];for(var vr=0,wr=br.length,xr=new Array(wr);vr<wr;vr++)xr[vr]=br[vr].fn;return xr},mr.prototype.listenerCount=function(yr){var _r=ir?ir+yr:yr,br=this._events[_r];return br?br.fn?1:br.length:0},mr.prototype.emit=function(yr,_r,br,vr,wr,xr){var Sr=ir?ir+yr:yr;if(!this._events[Sr])return!1;var Ar=this._events[Sr],Ir=arguments.length,Mr,Or;if(Ar.fn){switch(Ar.once&&this.removeListener(yr,Ar.fn,void 0,!0),Ir){case 1:return Ar.fn.call(Ar.context),!0;case 2:return Ar.fn.call(Ar.context,_r),!0;case 3:return Ar.fn.call(Ar.context,_r,br),!0;case 4:return Ar.fn.call(Ar.context,_r,br,vr),!0;case 5:return Ar.fn.call(Ar.context,_r,br,vr,wr),!0;case 6:return Ar.fn.call(Ar.context,_r,br,vr,wr,xr),!0}for(Or=1,Mr=new Array(Ir-1);Or<Ir;Or++)Mr[Or-1]=arguments[Or];Ar.fn.apply(Ar.context,Mr)}else{var $r=Ar.length,Dr;for(Or=0;Or<$r;Or++)switch(Ar[Or].once&&this.removeListener(yr,Ar[Or].fn,void 0,!0),Ir){case 1:Ar[Or].fn.call(Ar[Or].context);break;case 2:Ar[Or].fn.call(Ar[Or].context,_r);break;case 3:Ar[Or].fn.call(Ar[Or].context,_r,br);break;case 4:Ar[Or].fn.call(Ar[Or].context,_r,br,vr);break;default:if(!Mr)for(Dr=1,Mr=new Array(Ir-1);Dr<Ir;Dr++)Mr[Dr-1]=arguments[Dr];Ar[Or].fn.apply(Ar[Or].context,Mr)}}return!0},mr.prototype.on=function(yr,_r,br){return fr(this,yr,_r,br,!1)},mr.prototype.once=function(yr,_r,br){return fr(this,yr,_r,br,!0)},mr.prototype.removeListener=function(yr,_r,br,vr){var wr=ir?ir+yr:yr;if(!this._events[wr])return this;if(!_r)return hr(this,wr),this;var xr=this._events[wr];if(xr.fn)xr.fn===_r&&(!vr||xr.once)&&(!br||xr.context===br)&&hr(this,wr);else{for(var Sr=0,Ar=[],Ir=xr.length;Sr<Ir;Sr++)(xr[Sr].fn!==_r||vr&&!xr[Sr].once||br&&xr[Sr].context!==br)&&Ar.push(xr[Sr]);Ar.length?this._events[wr]=Ar.length===1?Ar[0]:Ar:hr(this,wr)}return this},mr.prototype.removeAllListeners=function(yr){var _r;return yr?(_r=ir?ir+yr:yr,this._events[_r]&&hr(this,_r)):(this._events=new lr,this._eventsCount=0),this},mr.prototype.off=mr.prototype.removeListener,mr.prototype.addListener=mr.prototype.on,mr.prefixed=ir,mr.EventEmitter=mr,tr.exports=mr})(eventemitter3)),eventemitter3.exports}var eventemitter3Exports=requireEventemitter3();const EventEmitter$1=getDefaultExportFromCjs(eventemitter3Exports);class Emitter{constructor(rr){Object.defineProperty(this,"uid",{enumerable:!0,configurable:!0,writable:!0,value:rr}),Object.defineProperty(this,"_emitter",{enumerable:!0,configurable:!0,writable:!0,value:new EventEmitter$1})}on(rr,ir){this._emitter.on(rr,ir)}once(rr,ir){this._emitter.once(rr,ir)}off(rr,ir){this._emitter.off(rr,ir)}emit(rr,...ir){const lr=ir[0];this._emitter.emit(rr,{uid:this.uid,...lr})}listenerCount(rr){return this._emitter.listenerCount(rr)}}function createEmitter(tr){return new Emitter(tr)}function deserialize(tr,rr){return JSON.parse(tr,(ir,lr)=>{let dr=lr;return(dr==null?void 0:dr.__type)==="bigint"&&(dr=BigInt(dr.value)),(dr==null?void 0:dr.__type)==="Map"&&(dr=new Map(dr.value)),(rr==null?void 0:rr(ir,dr))??dr})}function getReferenceKey(tr,rr){return tr.slice(0,rr).join(".")||"."}function getCutoff(tr,rr){const{length:ir}=tr;for(let lr=0;lr<ir;++lr)if(tr[lr]===rr)return lr+1;return 0}function createReplacer(tr,rr){const ir=typeof tr=="function",lr=typeof rr=="function",dr=[],fr=[];return function(mr,gr){if(typeof gr=="object")if(dr.length){const yr=getCutoff(dr,this);yr===0?dr[dr.length]=this:(dr.splice(yr),fr.splice(yr)),fr[fr.length]=mr;const _r=getCutoff(dr,gr);if(_r!==0)return lr?rr.call(this,mr,gr,getReferenceKey(fr,_r)):`[ref=${getReferenceKey(fr,_r)}]`}else dr[0]=gr,fr[0]=mr;return ir?tr.call(this,mr,gr):gr}}function serialize(tr,rr,ir,lr){return JSON.stringify(tr,createReplacer((dr,fr)=>{let hr=fr;return typeof hr=="bigint"&&(hr={__type:"bigint",value:fr.toString()}),hr instanceof Map&&(hr={__type:"Map",value:Array.from(fr.entries())}),(rr==null?void 0:rr(dr,hr))??hr},lr),ir??void 0)}function createStorage(tr){const{deserialize:rr=deserialize,key:ir="wagmi",serialize:lr=serialize,storage:dr=noopStorage}=tr;function fr(hr){return hr instanceof Promise?hr.then(mr=>mr).catch(()=>null):hr}return{...dr,key:ir,async getItem(hr,mr){const gr=dr.getItem(`${ir}.${hr}`),yr=await fr(gr);return yr?rr(yr)??null:mr??null},async setItem(hr,mr){const gr=`${ir}.${hr}`;mr===null?await fr(dr.removeItem(gr)):await fr(dr.setItem(gr,lr(mr)))},async removeItem(hr){await fr(dr.removeItem(`${ir}.${hr}`))}}}const noopStorage={getItem:()=>null,setItem:()=>{},removeItem:()=>{}};function getDefaultStorage(){const tr=typeof window<"u"&&window.localStorage?window.localStorage:noopStorage;return{getItem(rr){return tr.getItem(rr)},removeItem(rr){tr.removeItem(rr)},setItem(rr,ir){try{tr.setItem(rr,ir)}catch{}}}}const size=256;let index=size,buffer;function uid(tr=11){if(!buffer||index+tr>size*2){buffer="",index=0;for(let rr=0;rr<size;rr++)buffer+=(256+Math.random()*256|0).toString(16).substring(1)}return buffer.substring(index,index+++tr)}function createConfig(tr){const{multiInjectedProviderDiscovery:rr=!0,storage:ir=createStorage({storage:getDefaultStorage()}),syncConnectedChain:lr=!0,ssr:dr=!1,...fr}=tr,hr=typeof window<"u"&&rr?createStore$1():void 0,mr=createStore(()=>fr.chains),gr=createStore(()=>{const Dr=[],zr=new Set;for(const Fr of fr.connectors??[]){const Jr=yr(Fr);if(Dr.push(Jr),!dr&&Jr.rdns){const $n=typeof Jr.rdns=="string"?[Jr.rdns]:Jr.rdns;for(const Qr of $n)zr.add(Qr)}}if(!dr&&hr){const Fr=hr.getProviders();for(const Jr of Fr)zr.has(Jr.info.rdns)||Dr.push(yr(_r(Jr)))}return Dr});function yr(Dr){var Jr;const zr=createEmitter(uid()),Fr={...Dr({emitter:zr,chains:mr.getState(),storage:ir,transports:fr.transports}),emitter:zr,uid:zr.uid};return zr.on("connect",Or),(Jr=Fr.setup)==null||Jr.call(Fr),Fr}function _r(Dr){const{info:zr}=Dr,Fr=Dr.provider;return injected({target:{...zr,id:zr.rdns,provider:Fr}})}const br=new Map;function vr(Dr={}){const zr=Dr.chainId??Ar.getState().chainId,Fr=mr.getState().find($n=>$n.id===zr);if(Dr.chainId&&!Fr)throw new ChainNotConfiguredError;{const $n=br.get(Ar.getState().chainId);if($n&&!Fr)return $n;if(!Fr)throw new ChainNotConfiguredError}{const $n=br.get(zr);if($n)return $n}let Jr;if(fr.client)Jr=fr.client({chain:Fr});else{const $n=Fr.id,Qr=mr.getState().map(Xn=>Xn.id),Zn={},qn=Object.entries(fr);for(const[Xn,Lr]of qn)if(!(Xn==="chains"||Xn==="client"||Xn==="connectors"||Xn==="transports"))if(typeof Lr=="object")if($n in Lr)Zn[Xn]=Lr[$n];else{if(Qr.some(Hn=>Hn in Lr))continue;Zn[Xn]=Lr}else Zn[Xn]=Lr;Jr=createClient({...Zn,chain:Fr,batch:Zn.batch??{multicall:!0},transport:Xn=>fr.transports[$n]({...Xn,connectors:gr})})}return br.set(zr,Jr),Jr}function wr(){return{chainId:mr.getState()[0].id,connections:new Map,current:null,status:"disconnected"}}let xr;const Sr="0.0.0-canary-";version$3.startsWith(Sr)?xr=Number.parseInt(version$3.replace(Sr,"")):xr=Number.parseInt(version$3.split(".")[0]??"0");const Ar=createStore(subscribeWithSelector(ir?persist(wr,{migrate(Dr,zr){if(zr===xr)return Dr;const Fr=wr(),Jr=Ir(Dr,Fr.chainId);return{...Fr,chainId:Jr}},name:"store",partialize(Dr){return{connections:{__type:"Map",value:Array.from(Dr.connections.entries()).map(([zr,Fr])=>{const{id:Jr,name:$n,type:Qr,uid:Zn}=Fr.connector;return[zr,{...Fr,connector:{id:Jr,name:$n,type:Qr,uid:Zn}}]})},chainId:Dr.chainId,current:Dr.current}},merge(Dr,zr){typeof Dr=="object"&&Dr&&"status"in Dr&&delete Dr.status;const Fr=Ir(Dr,zr.chainId);return{...zr,...Dr,chainId:Fr}},skipHydration:dr,storage:ir,version:xr}):wr));Ar.setState(wr());function Ir(Dr,zr){return Dr&&typeof Dr=="object"&&"chainId"in Dr&&typeof Dr.chainId=="number"&&mr.getState().some(Fr=>Fr.id===Dr.chainId)?Dr.chainId:zr}lr&&Ar.subscribe(({connections:Dr,current:zr})=>{var Fr;return zr?(Fr=Dr.get(zr))==null?void 0:Fr.chainId:void 0},Dr=>{if(mr.getState().some(Fr=>Fr.id===Dr))return Ar.setState(Fr=>({...Fr,chainId:Dr??Fr.chainId}))}),hr==null||hr.subscribe(Dr=>{const zr=new Set,Fr=new Set;for(const $n of gr.getState())if(zr.add($n.id),$n.rdns){const Qr=typeof $n.rdns=="string"?[$n.rdns]:$n.rdns;for(const Zn of Qr)Fr.add(Zn)}const Jr=[];for(const $n of Dr){if(Fr.has($n.info.rdns))continue;const Qr=yr(_r($n));zr.has(Qr.id)||Jr.push(Qr)}ir&&!Ar.persist.hasHydrated()||gr.setState($n=>[...$n,...Jr],!0)});function Mr(Dr){Ar.setState(zr=>{const Fr=zr.connections.get(Dr.uid);return Fr?{...zr,connections:new Map(zr.connections).set(Dr.uid,{accounts:Dr.accounts??Fr.accounts,chainId:Dr.chainId??Fr.chainId,connector:Fr.connector})}:zr})}function Or(Dr){Ar.getState().status==="connecting"||Ar.getState().status==="reconnecting"||Ar.setState(zr=>{const Fr=gr.getState().find(Jr=>Jr.uid===Dr.uid);return Fr?(Fr.emitter.listenerCount("connect")&&Fr.emitter.off("connect",Mr),Fr.emitter.listenerCount("change")||Fr.emitter.on("change",Mr),Fr.emitter.listenerCount("disconnect")||Fr.emitter.on("disconnect",$r),{...zr,connections:new Map(zr.connections).set(Dr.uid,{accounts:Dr.accounts,chainId:Dr.chainId,connector:Fr}),current:Dr.uid,status:"connected"}):zr})}function $r(Dr){Ar.setState(zr=>{const Fr=zr.connections.get(Dr.uid);if(Fr){const $n=Fr.connector;$n.emitter.listenerCount("change")&&Fr.connector.emitter.off("change",Mr),$n.emitter.listenerCount("disconnect")&&Fr.connector.emitter.off("disconnect",$r),$n.emitter.listenerCount("connect")||Fr.connector.emitter.on("connect",Or)}if(zr.connections.delete(Dr.uid),zr.connections.size===0)return{...zr,connections:new Map,current:null,status:"disconnected"};const Jr=zr.connections.values().next().value;return{...zr,connections:new Map(zr.connections),current:Jr.connector.uid}})}return{get chains(){return mr.getState()},get connectors(){return gr.getState()},storage:ir,getClient:vr,get state(){return Ar.getState()},setState(Dr){let zr;typeof Dr=="function"?zr=Dr(Ar.getState()):zr=Dr;const Fr=wr();typeof zr!="object"&&(zr=Fr),Object.keys(Fr).some($n=>!($n in zr))&&(zr=Fr),Ar.setState(zr,!0)},subscribe(Dr,zr,Fr){return Ar.subscribe(Dr,zr,Fr?{...Fr,fireImmediately:Fr.emitImmediately}:void 0)},_internal:{mipd:hr,store:Ar,ssr:!!dr,syncConnectedChain:lr,transports:fr.transports,chains:{setState(Dr){const zr=typeof Dr=="function"?Dr(mr.getState()):Dr;if(zr.length!==0)return mr.setState(zr,!0)},subscribe(Dr){return mr.subscribe(Dr)}},connectors:{providerDetailToConnector:_r,setup:yr,setState(Dr){return gr.setState(typeof Dr=="function"?Dr(gr.getState()):Dr,!0)},subscribe(Dr){return gr.subscribe(Dr)}},events:{change:Mr,connect:Or,disconnect:$r}}}}function hydrate(tr,rr){const{initialState:ir,reconnectOnMount:lr}=rr;return ir&&!tr._internal.store.persist.hasHydrated()&&tr.setState({...ir,chainId:tr.chains.some(dr=>dr.id===ir.chainId)?ir.chainId:tr.chains[0].id,connections:lr?ir.connections:new Map,status:lr?"reconnecting":"disconnected"}),{async onMount(){tr._internal.ssr&&(await tr._internal.store.persist.rehydrate(),tr._internal.mipd&&tr._internal.connectors.setState(dr=>{var gr;const fr=new Set;for(const yr of dr??[])if(yr.rdns){const _r=Array.isArray(yr.rdns)?yr.rdns:[yr.rdns];for(const br of _r)fr.add(br)}const hr=[],mr=((gr=tr._internal.mipd)==null?void 0:gr.getProviders())??[];for(const yr of mr){if(fr.has(yr.info.rdns))continue;const _r=tr._internal.connectors.providerDetailToConnector(yr),br=tr._internal.connectors.setup(_r);hr.push(br)}return[...dr,...hr]})),lr?reconnect(tr):tr.storage&&tr.setState(dr=>({...dr,connections:new Map}))}}}function Hydrate(tr){const{children:rr,config:ir,initialState:lr,reconnectOnMount:dr=!0}=tr,{onMount:fr}=hydrate(ir,{initialState:lr,reconnectOnMount:dr});ir._internal.ssr||fr();const hr=useRef(!0);return useEffect(()=>{if(hr.current&&ir._internal.ssr)return fr(),()=>{hr.current=!1}},[]),rr}const WagmiContext$1=createContext(void 0);function WagmiProvider(tr){const{children:rr,config:ir}=tr,lr={value:ir};return createElement(Hydrate,tr,createElement(WagmiContext$1.Provider,lr,rr))}const version$2="2.16.4",getVersion=()=>`wagmi@${version$2}`;class BaseError extends BaseError$1{constructor(){super(...arguments),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"WagmiError"})}get docsBaseUrl(){return"https://wagmi.sh/react"}get version(){return getVersion()}}class WagmiProviderNotFoundError extends BaseError{constructor(){super("`useConfig` must be used within `WagmiProvider`.",{docsPath:"/api/WagmiProvider"}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"WagmiProviderNotFoundError"})}}function useConfig(tr={}){const rr=tr.config??useContext(WagmiContext$1);if(!rr)throw new WagmiProviderNotFoundError;return rr}function hashFn(tr){return JSON.stringify(tr,(rr,ir)=>isPlainObject$1(ir)?Object.keys(ir).sort().reduce((lr,dr)=>(lr[dr]=ir[dr],lr),{}):typeof ir=="bigint"?ir.toString():ir)}function isPlainObject$1(tr){if(!hasObjectPrototype(tr))return!1;const rr=tr.constructor;if(typeof rr>"u")return!0;const ir=rr.prototype;return!(!hasObjectPrototype(ir)||!ir.hasOwnProperty("isPrototypeOf"))}function hasObjectPrototype(tr){return Object.prototype.toString.call(tr)==="[object Object]"}function filterQueryOptions(tr){const{_defaulted:rr,behavior:ir,gcTime:lr,initialData:dr,initialDataUpdatedAt:fr,maxPages:hr,meta:mr,networkMode:gr,queryFn:yr,queryHash:_r,queryKey:br,queryKeyHashFn:vr,retry:wr,retryDelay:xr,structuralSharing:Sr,getPreviousPageParam:Ar,getNextPageParam:Ir,initialPageParam:Mr,_optimisticResults:Or,enabled:$r,notifyOnChangeProps:Dr,placeholderData:zr,refetchInterval:Fr,refetchIntervalInBackground:Jr,refetchOnMount:$n,refetchOnReconnect:Qr,refetchOnWindowFocus:Zn,retryOnMount:qn,select:Xn,staleTime:Lr,suspense:Gr,throwOnError:Hn,config:ii,connector:oi,query:ri,...ti}=tr;return ti}function getEnsAvatarQueryOptions(tr,rr={}){return{async queryFn({queryKey:ir}){const{name:lr,scopeKey:dr,...fr}=ir[1];if(!lr)throw new Error("name is required");return getEnsAvatar(tr,{...fr,name:lr})},queryKey:getEnsAvatarQueryKey(rr)}}function getEnsAvatarQueryKey(tr={}){return["ensAvatar",filterQueryOptions(tr)]}function getEnsNameQueryOptions(tr,rr={}){return{async queryFn({queryKey:ir}){const{address:lr,scopeKey:dr,...fr}=ir[1];if(!lr)throw new Error("address is required");return getEnsName(tr,{...fr,address:lr})},queryKey:getEnsNameQueryKey(rr)}}function getEnsNameQueryKey(tr={}){return["ensName",filterQueryOptions(tr)]}function useQuery(tr){const rr=useQuery$1({...tr,queryKeyHashFn:hashFn});return rr.queryKey=tr.queryKey,rr}function useChainId(tr={}){const rr=useConfig(tr);return useSyncExternalStore(ir=>watchChainId(rr,{onChange:ir}),()=>getChainId(rr),()=>getChainId(rr))}function useEnsAvatar(tr={}){const{name:rr,query:ir={}}=tr,lr=useConfig(tr),dr=useChainId({config:lr}),fr=getEnsAvatarQueryOptions(lr,{...tr,chainId:tr.chainId??dr}),hr=!!(rr&&(ir.enabled??!0));return useQuery({...ir,...fr,enabled:hr})}function useEnsName(tr={}){const{address:rr,query:ir={}}=tr,lr=useConfig(tr),dr=useChainId({config:lr}),fr=getEnsNameQueryOptions(lr,{...tr,chainId:tr.chainId??dr}),hr=!!(rr&&(ir.enabled??!0));return useQuery({...ir,...fr,enabled:hr})}function ENSAvatar(tr){const{address:rr,chainId:ir=1,size:lr="14px"}=tr,dr={width:lr,height:lr},fr=useEnsName({address:rr,chainId:ir}),hr=fr.data??void 0,mr=useEnsAvatar({name:hr}),gr=mr.data??ImgPowerhouse;return fr.isLoading||mr.isLoading?jsx$1("div",{className:"fade-out flex-none animate-pulse rounded-full bg-gray-400",style:dr}):jsx$1("img",{alt:"ENS Avatar",className:"flex-none rounded-full object-contain",src:gr,style:dr})}const FormInput=forwardRef(function tr(rr,ir){const{icon:lr,errorMessage:dr,isDirty:fr,containerClassName:hr,inputClassName:mr,errorMessageClassName:gr,hideErrors:yr=!1,..._r}=rr,br=rr.type??"text",vr=!!dr;return jsxs("div",{children:[jsxs("div",{className:twMerge("mb-1 flex gap-2 rounded-md border border-gray-200 bg-gray-50 p-3 text-black placeholder:text-gray-50",vr&&"border-red-900",hr),children:[lr&&jsx$1("span",{className:twJoin((!fr||vr)&&"text-slate-200"),children:lr}),jsx$1("input",{..._r,className:twMerge("w-full bg-transparent font-semibold outline-none",mr),ref:ir,type:br})]}),jsx$1("p",{className:twMerge("hidden min-h-4 text-xs text-red-900",vr&&"block",yr&&"hidden",gr),children:dr})]})});function AddLocalDriveForm(tr){var fr;const{register:rr,handleSubmit:ir,control:lr,formState:{errors:dr}}=useForm({defaultValues:{name:"",sharingType:LOCAL,availableOffline:!1,appId:tr.appOptions[0].id}});return jsx$1("form",{onSubmit:ir(tr.onSubmit),className:"flex flex-col gap-4",children:jsxs("div",{className:"flex flex-col gap-4",children:[jsxs("div",{children:[jsx$1(Label,{htmlFor:"driveName",className:"text-sm font-medium text-gray-800",children:"Drive Name"}),jsx$1(FormInput,{...rr("name",{required:"Drive name is required"}),errorMessage:(fr=dr.name)==null?void 0:fr.message,placeholder:"Drive name"})]}),jsxs("div",{children:[jsx$1(Label,{htmlFor:"driveApp",className:"text-sm font-medium text-gray-800",children:"Drive App"}),jsx$1(AppFormInput,{control:lr,appOptions:tr.appOptions})]}),jsxs("div",{children:[jsx$1(Label,{htmlFor:"sharingType",className:"text-sm font-medium text-gray-800",children:"Location"}),jsx$1(SharingTypeFormInput,{control:lr})]}),jsx$1("div",{children:jsx$1(AvailableOfflineToggle,{...rr("availableOffline")})}),jsx$1(Button$1,{className:"mt-2 w-full",type:"submit",children:"Create new drive"})]})})}function AddRemoteDriveForm(tr){const{sharingType:rr=PUBLIC,requestPublicDrive:ir}=tr,[lr,dr]=useState(),[fr,hr]=useState(!1),[mr,gr]=useState(!0),[yr,_r]=useState(!1),[br,vr]=useState(""),[wr,xr]=useState(""),[Sr,Ar]=useDebounceValue(wr,500),{register:Ir,handleSubmit:Mr,setValue:Or}=useForm({mode:"onBlur",defaultValues:{availableOffline:(lr==null?void 0:lr.availableOffline)??!1}});useEffect(()=>{Ar(wr)},[wr]),useEffect(()=>{if(_r(!1),Sr==="")return;Dr().catch(console.error);async function Dr(){try{const{id:zr,name:Fr}=await ir(Sr);dr({id:zr,name:Fr,sharingType:rr,location:SWITCHBOARD,availableOffline:!0}),Or("availableOffline",!0),gr(!0),vr("")}catch(zr){dr(void 0),gr(!1),vr(zr.message)}}},[Sr,Or,rr]);function $r({availableOffline:Dr}){lr&&tr.onSubmit({...lr,availableOffline:Dr,url:Sr})}return jsx$1("form",{onSubmit:Mr($r),children:yr?jsxs(Fragment,{children:[jsx$1(DriveName,{driveName:(lr==null?void 0:lr.name)??"New drive"}),jsx$1(Divider,{className:"my-3"}),jsxs(Disclosure,{isOpen:fr,onOpenChange:()=>hr(!fr),title:"Location",children:[jsx$1(LocationInfo,{location:SWITCHBOARD}),jsx$1(AvailableOfflineToggle,{...Ir("availableOffline")})]}),jsx$1(Button$1,{className:"mt-4 w-full",color:"dark",type:"submit",children:"Add new drive"})]}):jsxs(Fragment,{children:[jsx$1(FormInput,{errorMessage:br,onChange:Dr=>xr(Dr.target.value),placeholder:"Drive URL",required:!0,type:"url",value:wr}),jsx$1(Button$1,{className:"mt-4 w-full py-2 text-base",color:"dark",size:"small",disabled:!mr||wr==="",onClick:Dr=>{Dr.preventDefault(),_r(!0)},type:"button",children:"Add drive"})]})})}function DriveSettingsForm(tr){const{drive:rr,sharingType:ir,availableOffline:lr,onSubmit:dr,handleDeleteDrive:fr}=tr,hr=rr.header.name,[mr,gr]=useState(!1),[yr,_r]=useState(!1),[br,vr]=useState(!1),{register:wr,handleSubmit:xr,control:Sr}=useForm({mode:"onBlur",defaultValues:{name:hr,sharingType:ir,availableOffline:lr}}),Ar=ir===PUBLIC?SWITCHBOARD:ir;return jsxs("form",{onSubmit:xr(dr),children:[jsx$1(DriveNameInput,{...wr("name")}),jsx$1(Divider,{className:"my-4"}),jsx$1(Label,{htmlFor:"sharingType",children:"Sharing settings"}),jsx$1(SharingTypeFormInput,{control:Sr}),jsx$1(Divider,{className:"my-3"}),jsxs(Disclosure,{isOpen:mr,onOpenChange:()=>gr(!mr),title:"Location",children:[jsx$1(LocationInfo,{location:Ar}),jsx$1(AvailableOfflineToggle,{...wr("availableOffline")})]}),jsx$1(Divider,{className:"my-3"}),jsx$1(Disclosure,{isOpen:yr,onOpenChange:()=>_r(!yr),title:"Danger zone",children:jsxs("button",{className:"flex gap-2 py-3 font-semibold text-red-900 transition hover:brightness-125",onClick:()=>vr(!0),type:"button",children:[jsx$1(Icon,{name:"Trash"}),"Delete drive"]})}),br&&yr?jsx$1(DeleteDrive,{drive:rr,handleDeleteDrive:fr,onCancel:()=>vr(!1)}):jsxs(Fragment,{children:[jsx$1(Divider,{className:"my-3"}),jsx$1(Button$1,{className:"mb-4 w-full",type:"submit",children:"Confirm"})]})]})}function appToInputOption(tr){return{value:tr.id,displayValue:tr.name,icon:jsx$1(Icon,{name:"PowerhouseLogoSmall"}),description:"Built by Powerhouse"}}function AppFormInput(tr){const{control:rr,appOptions:ir,...lr}=tr,dr=ir.map(appToInputOption);return jsx$1(Controller,{control:rr,name:"appId",render:({field:fr})=>jsx$1(Select,{...lr,...fr,id:"appId",items:dr})})}const AvailableOfflineToggle=forwardRef(function tr(rr,ir){return jsxs("div",{className:"flex items-center rounded-md border border-gray-200 bg-gray-50 p-3 text-gray-900",children:[jsxs("div",{className:"flex-1",children:[jsx$1("label",{className:"font-medium text-gray-900",htmlFor:"availableOffline",children:"Make available offline"}),jsxs("p",{className:"text-xs text-gray-600",children:["Check this options if you keep a local backup",jsx$1("br",{}),"available at all times."]})]}),jsx$1(Toggle,{id:"availableOffline",ref:ir,...rr})]})});function DeleteDrive(tr){const{drive:rr,handleDeleteDrive:ir,onCancel:lr}=tr,[dr,fr]=useState(""),hr=dr===rr.header.name;function mr(){hr&&ir()}return jsxs("div",{children:[jsx$1("p",{className:"mb-2 rounded-md bg-slate-50 p-4 text-center text-slate-200",children:"Are you sure you want to delete this drive? All files and subfolders within it will be removed. Do you want to proceed?"}),jsx$1(DriveNameInput,{icon:jsx$1(Icon,{name:"Lock"}),onChange:gr=>fr(gr.target.value),placeholder:"Enter drive name...",value:dr}),jsxs("div",{className:"flex gap-3",children:[jsx$1(Button$1,{className:"w-full",color:"light",onClick:lr,children:"Cancel"}),jsx$1(Button$1,{className:"w-full",color:"red",disabled:!hr,onClick:mr,children:"Delete"})]})]})}function DriveName(tr){return jsxs("div",{className:"flex gap-2 rounded-xl bg-gray-100 p-3 font-semibold text-gray-500",children:[jsx$1(Icon,{className:"text-gray-600",name:"Drive"}),tr.driveName]})}const DriveNameInput=forwardRef(function tr(rr,ir){return jsx$1(FormInput,{...rr,icon:rr.icon??jsx$1(Icon,{name:"Drive"}),id:"driveName",placeholder:"Drive name",ref:ir})});function Label(tr){const{children:rr,className:ir,...lr}=tr;return jsx$1("label",{...lr,className:twMerge("block font-semibold text-gray-500",ir),children:rr})}function LocationInfo(tr){const{location:rr,className:ir,...lr}=tr,dr=locationInfoByLocation[rr];return jsxs("div",{...lr,className:twMerge("my-3 flex items-center gap-2 rounded-xl border border-gray-100 p-3 text-gray-800 shadow",ir),children:[dr.icon,jsxs("div",{children:[jsx$1("p",{children:dr.title}),jsx$1("p",{className:"text-xs text-slate-200",children:dr.description})]})]})}const DUPLICATE="DUPLICATE",RENAME="RENAME",DELETE="DELETE",SETTINGS="SETTINGS",REMOVE_TRIGGER="REMOVE_TRIGGER",ADD_TRIGGER="ADD_TRIGGER",ADD_INVALID_TRIGGER="ADD_INVALID_TRIGGER",defaultFileOptions=[RENAME,DELETE,DUPLICATE],defaultFolderOptions=[RENAME,DELETE,DUPLICATE],sharingTypeOptions=[{value:"LOCAL",icon:jsx$1(Icon,{name:"Lock"}),description:"Only available to you"},{value:"CLOUD",icon:jsx$1(Icon,{name:"People"}),description:"Only available to people in this drive"},{value:"PUBLIC",icon:jsx$1(Icon,{name:"Globe"}),description:"Available to everyone",disabled:!0}],locationInfoByLocation={CLOUD:{title:"Secure cloud",description:"End to end encryption between members.",icon:jsx$1(Icon,{name:"Lock"})},LOCAL:{title:"Local",description:"Private and only available to you.",icon:jsx$1(Icon,{name:"Hdd"})},SWITCHBOARD:{title:"Switchboard",description:"Public and available to everyone.",icon:jsx$1(Icon,{name:"Drive"})}},debugNodeOptionsMap={[ADD_TRIGGER]:{label:"Add Trigger",icon:jsx$1(Icon,{className:"text-orange-900",name:"Plus"})},[REMOVE_TRIGGER]:{label:"Remove Trigger",icon:jsx$1(Icon,{className:"text-orange-900",name:"Xmark"})},[ADD_INVALID_TRIGGER]:{label:"Add Trigger",icon:jsx$1(Icon,{className:"text-orange-900",name:"Exclamation"})}},normalNodeOptionsMap={[DUPLICATE]:{label:"Duplicate",icon:jsx$1(Icon,{name:"FilesEarmark"})},[RENAME]:{label:"Rename",icon:jsx$1(Icon,{name:"Pencil"})},[DELETE]:{label:"Delete",icon:jsx$1(Icon,{name:"Trash"}),className:"text-red-900"},[SETTINGS]:{label:"Settings",icon:jsx$1(Icon,{name:"Gear"})}},nodeOptionsMap={...debugNodeOptionsMap,...normalNodeOptionsMap},Select=fixedForwardRef(function tr(rr,ir){const{items:lr,value:dr,id:fr,onChange:hr,containerClassName:mr,menuClassName:gr,itemClassName:yr,absolutePositionMenu:_r=!1,borderRadius:br="6px"}=rr,[vr,wr]=useState(!1),xr=Ar(dr)??lr[0];function Sr(Mr){Mr.disabled||(hr(Mr.value),wr(!1))}function Ar(Mr){return lr.find(Or=>Or.value===Mr)}const Ir=lr.filter(Mr=>Mr.value!==dr);return jsxs("div",{className:twMerge("border border-gray-200 bg-gray-50 text-gray-800 transition-[border-radius]",_r&&"relative",mr),"data-open":vr,ref:ir,style:{borderRadius:br},children:[jsxs("div",{className:twMerge("flex min-w-[360px] cursor-pointer items-center justify-between pr-3 text-gray-800 outline-none",gr),id:fr,onClick:()=>wr(!vr),children:[jsx$1(ItemContainer,{...xr,className:yr}),jsx$1(Icon,{className:twJoin("transition",vr?"":"-rotate-90"),name:"ChevronDown"})]}),jsx$1("div",{className:twMerge("max-h-0 w-full overflow-hidden bg-inherit transition-[max-height] ease-in-out",vr&&"max-h-screen",_r&&"absolute"),style:{borderRadius:`0 0 ${br} ${br}`},children:Ir.map(Mr=>jsx$1(ItemContainer,{...Mr,className:yr,onItemClick:()=>Sr(Mr)},Mr.value))})]})});function ItemContainer(tr){const{className:rr,disabled:ir,onItemClick:lr,icon:dr,displayValue:fr,value:hr,description:mr}=tr;return jsxs("div",{className:twMerge(ir?"cursor-not-allowed text-gray-500":"text-gray-800","flex size-full cursor-pointer items-center gap-2 bg-inherit py-3 pl-3 text-start outline-none",rr),onClick:lr,children:[dr,jsxs("div",{children:[jsx$1("p",{className:"capitalize text-inherit",children:fr??hr.toLowerCase()}),jsx$1("p",{className:"text-xs text-gray-600",children:mr})]})]})}function SharingTypeFormInput(tr){const{control:rr,...ir}=tr;return jsx$1(Controller,{control:rr,name:"sharingType",render:({field:lr})=>jsx$1(Select,{...ir,...lr,id:"sharingType",items:sharingTypeOptions})})}const HomeBgAvif=""+new URL("home-bg-BRYzhkhi.avif",import.meta.url).href,HomeBg=""+new URL("home-bg-BEhF9NuW.png",import.meta.url).href;function HomeBackgroundImage(){return jsxs("picture",{className:"pointer-events-none absolute inset-8 z-0 size-[calc(100%-32px)] object-contain",children:[jsx$1("source",{srcSet:HomeBgAvif,type:"image/avif"}),jsx$1("img",{src:HomeBg,alt:"background",className:"object-contain"})]})}const HomeScreen=function tr(rr){const{children:ir,containerClassName:lr}=rr;return jsx$1("div",{className:twMerge("container relative mx-auto flex h-full flex-col",lr),children:jsxs("div",{className:"m-8 flex flex-wrap justify-center gap-4 pt-12",children:[jsx$1(HomeBackgroundImage,{}),ir]})})};function AddDriveModal$1(tr){function rr(){lr(!1)}const{open:ir,onOpenChange:lr,onAddRemoteDrive:dr,onAddLocalDrive:fr,requestPublicDrive:hr,modalProps:mr,containerProps:gr}=tr;return jsx$1(Modal,{...mr,contentProps:{className:"rounded-2xl"},onOpenChange:lr,open:ir,children:jsx$1("div",{...gr,className:twMerge("w-[408px] rounded-2xl p-6",gr==null?void 0:gr.className),children:jsxs(Tabs,{defaultValue:"Create Drive",children:[jsx$1(TabContent,{label:"Create Drive",description:"Create a new drive",children:jsx$1(AddLocalDriveForm,{onCancel:rr,onSubmit:fr,appOptions:tr.appOptions})}),jsx$1(TabContent,{label:"Add Drive",description:"Add a drive",children:jsx$1(AddRemoteDriveForm,{sharingType:"PUBLIC",onSubmit:dr,onCancel:rr,requestPublicDrive:hr})}),jsx$1(TabContent,{label:"New Shortcut",description:"Create a new shortcut",disabled:!0,children:"test"})]})})})}const buttonStyles$3="min-h-[48px] min-w-[142px] text-base font-semibold py-3 px-6 rounded-xl outline-none active:opacity-75 hover:scale-105 transform transition-all";function ConnectConfirmationModal(tr){const{body:rr,header:ir,children:lr,onCancel:dr,onOpenChange:fr,onContinue:hr,cancelLabel:mr,continueLabel:gr,overlayProps:yr,contentProps:_r,bodyProps:br={},headerProps:vr={},containerProps:wr={},cancelButtonProps:xr={},continueButtonProps:Sr={},buttonContainerProps:Ar={},...Ir}=tr;return jsx$1(Modal,{contentProps:{..._r,className:twMerge("rounded-3xl",_r==null?void 0:_r.className)},onOpenChange:fr,overlayProps:{...yr,className:yr==null?void 0:yr.className},...Ir,children:jsxs("div",{...mergeClassNameProps(wr,"w-[400px] p-6 text-slate-300"),children:[jsx$1("div",{...mergeClassNameProps(vr,"border-b border-slate-50 pb-2 text-2xl font-bold text-gray-800"),children:ir}),jsxs("div",{...mergeClassNameProps(br,"my-6 rounded-md bg-slate-50 p-4 text-center"),children:[rr,lr]}),jsxs("div",{...mergeClassNameProps(Ar,"mt-8 flex justify-between gap-3"),children:[jsx$1("button",{onClick:dr,...mergeClassNameProps(xr,twMerge(buttonStyles$3,"flex-1 bg-slate-50 text-slate-800")),children:mr}),jsx$1("button",{onClick:hr,...mergeClassNameProps(Sr,twMerge(buttonStyles$3,"flex-1 bg-gray-800 text-gray-50")),children:gr})]})]})})}const buttonStyles$2="min-h-[48px] min-w-[142px] text-base font-semibold py-3 px-6 rounded-xl outline-none active:opacity-75 hover:scale-105 transform transition-all",CLOSE_ANIMATION_DURATION=300;function CreateDocumentModal$1(tr){const{onOpenChange:rr,onContinue:ir,overlayProps:lr,contentProps:dr,...fr}=tr,[hr,mr]=useState(""),[gr,yr]=useState(!1),_r=()=>{rr==null||rr(!1),setTimeout(()=>mr(""),CLOSE_ANIMATION_DURATION)},br=useCallback(()=>{gr&&(ir(hr),setTimeout(()=>mr(""),CLOSE_ANIMATION_DURATION))},[gr,hr,ir]);return jsx$1(Modal,{contentProps:{...dr,className:twMerge("rounded-3xl",dr==null?void 0:dr.className)},onOpenChange:rr,overlayProps:{...lr,className:lr==null?void 0:lr.className},...fr,children:jsxs("div",{className:"w-[400px] p-6 text-slate-300",children:[jsx$1("div",{className:"border-b border-slate-50 pb-2 text-2xl font-bold text-gray-800",children:"Create a new document"}),jsxs("div",{className:"my-6",children:[!gr&&hr&&jsx$1("div",{className:"mb-2 text-red-500",children:"Document name must be valid URL characters."}),jsx$1(FormInput,{icon:jsx$1(Icon,{name:"BrickGlobe"}),onChange:vr=>{const wr=vr.target.value;mr(wr),yr(isValidName(wr))},placeholder:"Document name",required:!0,value:hr})]}),jsxs("div",{className:"mt-8 flex justify-between gap-3",children:[jsx$1("button",{className:twMerge(buttonStyles$2,"flex-1 bg-slate-50 text-slate-800"),onClick:_r,children:"Cancel"}),jsx$1(Button$1,{className:twMerge(buttonStyles$2,"flex-1 bg-gray-800 text-gray-50"),onClick:br,disabled:!gr,children:"Create"})]})]})})}const ConnectDeleteDriveModal=tr=>{const{inputPlaceholder:rr,body:ir,driveName:lr,...dr}=tr,[fr,hr]=useState("");return jsx$1(ConnectConfirmationModal,{bodyProps:{className:"p-0 bg-white my-0"},containerProps:{className:"w-[450px]"},continueButtonProps:{disabled:fr!==lr,className:fr!==lr?"bg-red-600 hover:scale-100 cursor-not-allowed active:opacity-100":"bg-red-900"},...dr,children:jsxs("div",{children:[jsx$1("div",{className:"my-6 rounded-md bg-slate-50 p-4 text-center",children:ir}),jsx$1("div",{children:jsx$1(FormInput,{hideErrors:!0,icon:jsx$1(Icon,{name:"Lock"}),onChange:mr=>hr(mr.target.value),placeholder:rr,value:fr})})]})})};function ConnectDeleteItemModal(tr){const{onDelete:rr,deleteLabel:ir,...lr}=tr;return jsx$1(ConnectConfirmationModal,{...lr,containerProps:{className:"w-[450px]"},continueButtonProps:{className:"bg-red-900"},continueLabel:ir,onContinue:rr})}function DriveSettingsModal$1(tr){const{drive:rr,open:ir,sharingType:lr,availableOffline:dr,onOpenChange:fr,onDeleteDrive:hr,onRenameDrive:mr,onChangeSharingType:gr,onChangeAvailableOffline:yr,modalProps:_r,containerProps:br}=tr,vr=Sr=>{Sr.name!==rr.header.name&&mr(rr,Sr.name),Sr.sharingType!==lr&&gr(rr,Sr.sharingType),Sr.availableOffline!==dr&&yr(rr,Sr.availableOffline),fr(!1)};function wr(){hr(rr),fr(!1)}function xr(){fr(!1)}return jsx$1(Modal,{..._r,contentProps:{className:"rounded-2xl"},onOpenChange:fr,open:ir,children:jsxs("div",{...br,className:twMerge("max-w-[408px] rounded-2xl p-6",br==null?void 0:br.className),children:[jsxs("div",{className:"flex justify-between",children:[jsx$1("h1",{className:"text-xl font-bold",children:"Drive settings"}),jsx$1("button",{className:"flex size-8 items-center justify-center rounded-md bg-gray-100 text-gray-500 outline-none hover:text-gray-900",onClick:xr,tabIndex:-1,children:jsx$1(Icon,{name:"XmarkLight",size:24})})]}),jsx$1(Divider,{className:"my-4"}),jsx$1(DriveSettingsForm,{handleCancel:xr,handleDeleteDrive:wr,onSubmit:vr,drive:rr,sharingType:lr,availableOffline:dr})]})})}const buttonStyles$1="min-h-[48px] min-w-[142px] text-base font-semibold py-3 px-6 rounded-xl outline-none active:opacity-75 hover:scale-105 transform transition-all";function ReadRequiredModal(tr){const{body:rr,header:ir,children:lr,onOpenChange:dr,onContinue:fr,closeLabel:hr,overlayProps:mr,contentProps:gr,bodyProps:yr={},headerProps:_r={},containerProps:br={},continueButtonProps:vr={},buttonContainerProps:wr={},...xr}=tr,[Sr,Ar]=useState(!0),Ir=useRef(null);return useEffect(()=>{const Mr=()=>{const $r=Ir.current;$r&&($r.scrollHeight>$r.clientHeight?(Ar(!0),$r.addEventListener("scroll",Or)):Ar(!1))},Or=()=>{const $r=Ir.current;$r&&$r.scrollHeight-Math.ceil($r.scrollTop)===$r.clientHeight&&Ar(!1)};return requestAnimationFrame(Mr),()=>{const $r=Ir.current;$r&&$r.removeEventListener("scroll",Or)}},[]),jsx$1(Modal,{contentProps:{...gr,className:twMerge("rounded-3xl outline-none",gr==null?void 0:gr.className)},onOpenChange:dr,overlayProps:{...mr,className:mr==null?void 0:mr.className},...xr,children:jsxs("div",{...mergeClassNameProps(br,"w-[500px] p-6 text-slate-300"),children:[jsx$1("div",{...mergeClassNameProps(_r,"border-b border-slate-50 pb-2 text-2xl font-bold text-gray-800"),children:ir}),jsxs("div",{ref:Ir,...mergeClassNameProps(yr,"my-6 max-h-[245px] overflow-scroll rounded-md bg-slate-50 p-4 text-center"),children:[rr,lr]}),jsx$1("div",{...mergeClassNameProps(wr,"mt-8 flex justify-between gap-3"),children:jsx$1("button",{disabled:Sr,onClick:fr,...mergeClassNameProps(vr,twMerge(buttonStyles$1,"flex-1 bg-gray-800 text-gray-50",Sr&&"cursor-not-allowed bg-gray-300 hover:scale-100")),children:hr})})]})})}const REQUIRED_DEPENDENCIES=["@powerhousedao/design-system","document-drive","document-model"],PackageJsonSchema=objectType({version:stringType({message:"Missing version field in package.json"}),dependencies:recordType(stringType(),stringType()).nullable(),devDependencies:recordType(stringType(),stringType()).nullable()}).refine(tr=>tr.dependencies!=null||tr.devDependencies!=null,"package.json must have either dependencies or devDependencies").transform(tr=>{const rr={...tr.dependencies,...tr.devDependencies},ir=REQUIRED_DEPENDENCIES.filter(lr=>!rr[lr]||typeof rr[lr]!="string");return ir.length>0?(console.error("Missing or invalid dependencies:",ir,"Available dependencies:",Object.keys(rr)),!1):{version:tr.version,dependencies:Object.fromEntries(REQUIRED_DEPENDENCIES.map(lr=>[lr,rr[lr]]))}});function verifyPackageJsonFields(tr){const rr=PackageJsonSchema.safeParse(tr);return rr.success?rr.data:(console.error("Package.json validation failed:",rr.error.format()),!1)}function DependencyVersions(tr){const[rr,ir]=useState(!1),{packageJson:lr,phCliVersion:dr}=tr,fr=verifyPackageJsonFields(lr);return fr?jsx$1(Disclosure,{isOpen:rr,onOpenChange:()=>ir(!rr),title:`App version: ${fr.version}`,toggleClassName:"text-gray-900 text-sm",children:jsxs("ul",{className:"text-sm text-gray-600",children:[REQUIRED_DEPENDENCIES.map(hr=>jsxs("li",{className:"my-1 flex justify-between pr-1",children:[jsxs("span",{children:[hr.replace("@powerhousedao/",""),":"]}),jsx$1("span",{className:"font-normal",children:fr.dependencies[hr]})]},hr)),dr&&jsxs("li",{className:"my-1 flex justify-between pr-1",children:[jsx$1("span",{children:"@powerhousedao/ph-cli:"}),jsx$1("span",{className:"font-normal",children:dr})]},"ph-cli")]})}):(console.error("Failed to validate package.json data"),null)}function About$1(tr){const{packageJson:rr,phCliVersion:ir}=tr;return jsxs("div",{className:"bg-white p-3",children:[jsx$1("h2",{className:"font-semibold",children:"About"}),jsx$1("p",{className:"text-sm font-normal text-gray-600",children:"Connect is the hub for your most important documents and processes translated into software. Easily capture data in a structured way with Connect."}),jsx$1("div",{className:"my-4",children:jsx$1(DependencyVersions,{packageJson:rr,phCliVersion:ir})})]})}const SWITCHBOARD="SWITCHBOARD",LOCAL="LOCAL",CLOUD="CLOUD",PUBLIC="PUBLIC";function DangerZone$1(tr){const{className:rr,...ir}=tr;return jsxs("div",{className:cn$2("h-full rounded-lg bg-white p-3",rr),children:[jsx$1("h2",{className:"mb-4 font-semibold",children:"Modify Drives"}),jsx$1(ModifyDrives,{...ir}),jsx$1("h2",{className:"my-4 font-semibold",children:"Local Storage"}),jsx$1(LocalStorage,{...ir})]})}function ModifyDrives(tr){const{className:rr,...ir}=tr;return jsx$1("div",{className:rr,children:jsx$1(DriveList,{...ir})})}function DriveList(tr){const{className:rr,...ir}=tr;return jsx$1("div",{className:rr,children:tr.drives.map(lr=>jsx$1(Drive,{drive:lr,...ir},lr.header.id))})}function Drive(tr){const{drive:rr,className:ir,onDeleteDrive:lr}=tr,[dr,fr]=useState(!1),hr=jsx$1(Icon,{name:"Hdd",size:16,className:"flex-none"}),mr=jsx$1(Icon,{name:"Server",size:16,className:"flex-none"}),gr=rr.state.global.icon?jsx$1("img",{alt:"drive icon",className:"size-4 flex-none object-contain",src:rr.state.global.icon}):jsx$1(Icon,{name:"M",size:16,className:"flex-none"});function yr(){const br=getDriveSharingType(rr);return br===PUBLIC?gr:br===CLOUD?mr:hr}const _r=yr();return jsxs("div",{className:cn$2("mb-4 flex w-96 items-center gap-2 rounded-md border border-gray-200 bg-gray-50 px-3 py-2 shadow-sm last-of-type:mb-0",ir),children:[_r,jsxs("div",{children:[jsx$1("span",{className:"block text-sm font-medium leading-[18px]",children:capitalCase(rr.header.name)}),jsxs("div",{className:"flex items-baseline gap-x-2 leading-[18px]",children:[jsxs("span",{className:"text-sm text-gray-600",children:[capitalCase(getDriveSharingType(rr))," App"]}),jsxs("a",{className:"group flex items-center gap-x-2 text-sm text-slate-500 transition-colors hover:text-[#9896FF]",children:["By Powerhouse",jsx$1("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 12 12",className:"size-4 text-gray-400 transition-colors group-hover:text-inherit",children:jsx$1("path",{d:"M7.99365 11.9939C9.46632 11.9939 10.6603 10.7999 10.6603 9.32722V7.32722C10.6603 6.95922 10.3617 6.66056 9.99365 6.66056C9.62565 6.66056 9.32699 6.95922 9.32699 7.32722V9.32722C9.32699 10.0639 8.73032 10.6606 7.99365 10.6606H2.66032C1.92365 10.6606 1.32699 10.0639 1.32699 9.32722V3.99389C1.32699 3.25723 1.92365 2.66056 2.66032 2.66056H4.66032C5.02832 2.66056 5.32699 2.36189 5.32699 1.99389C5.32699 1.6259 5.02832 1.32723 4.66032 1.32723H2.66032C1.18765 1.32723 -0.00634766 2.52123 -0.00634766 3.99389V9.32722C-0.00634766 10.7999 1.18765 11.9939 2.66032 11.9939H7.99365ZM5.32699 7.32722C5.49765 7.32722 5.67565 7.26989 5.80632 7.13989L10.1396 2.80656L11.9937 4.66056V-0.00610352H7.32699L9.18099 1.8479L4.84766 6.18123C4.58766 6.4419 4.58766 6.87922 4.84766 7.13989C4.97832 7.26989 5.15632 7.32722 5.32699 7.32722Z",fill:"currentColor"})})]})]})]}),jsx$1(ConnectDropdownMenu,{items:[{id:"delete-drive",label:"Delete",icon:jsx$1(Icon,{name:"Trash"}),className:"text-red-900"}],onItemClick:br=>{br==="delete-drive"&&lr(rr)},onOpenChange:fr,open:dr,children:jsx$1("button",{className:"group ml-auto flex-none",onClick:br=>{br.stopPropagation(),fr(!0)},children:jsx$1(Icon,{className:"text-gray-600 group-hover:text-gray-900",name:"VerticalDots",size:16})})})]})}function LocalStorage(tr){const{onClearStorage:rr}=tr;return jsx$1("div",{children:jsxs("button",{className:"flex items-center gap-x-2 rounded-md border border-gray-300 bg-transparent px-3 py-1 text-sm font-medium text-red-900 transition-colors hover:bg-gray-100",onClick:rr,children:["Clear Storage ",jsx$1(Icon,{name:"Trash",size:16})]})})}function DefaultEditor$1(tr){const{className:rr,...ir}=tr;return jsx$1("div",{className:twMerge("rounded-lg p-3",rr),children:jsx$1(DefaultEditorSelect,{...ir})})}function DefaultEditorSelect(tr){const{documentModelEditor:rr,setDocumentModelEditor:ir,documentModelEditorOptions:lr,className:dr}=tr;return jsxs("div",{children:[jsx$1("h3",{className:"mb-4 font-semibold text-gray-900",children:"Default Editor Selection"}),jsx$1(SelectFieldRaw,{className:twMerge("min-w-36 max-w-fit",dr),name:"default-editor",required:!0,value:rr,options:lr,multiple:!1,onChange:fr=>ir(fr)})]})}const ProviderIconMap={npm:{icon:"Npm"},github:{icon:"Github",size:28},local:{icon:"Hdd"}},PackageItem=({packageName:tr,provider:rr})=>{const ir=rr&&ProviderIconMap[rr];return jsxs("div",{className:"flex w-full items-center justify-between px-2 py-1",children:[jsx$1("p",{className:"font-medium",children:tr}),ir&&jsx$1(Icon,{name:ir.icon,size:ir.size})]})},PackageManagerInput=tr=>{const{onInstall:rr,packageOptions:ir,className:lr}=tr,[dr,fr]=useState(""),[hr,mr]=useState(!1),[gr,yr]=useState(),_r=useCallback(()=>{const xr=rr(dr);xr?(mr(!0),xr.then(()=>fr("")).catch(yr).finally(()=>mr(!1))):(fr(""),yr(void 0))},[rr,dr]),br=useCallback(xr=>{fr(xr.target.value)},[]),vr=gr?typeof gr=="string"?gr:gr instanceof Error?gr.message:gr:" ",wr=useMemo(()=>{const xr=ir==null?void 0:ir.map(Sr=>({...Sr,value:Sr.packageName}));return ir!=null&&ir.length?{autoComplete:!0,initialOptions:xr,fetchOptionsCallback:Sr=>(xr==null?void 0:xr.filter(Ar=>Ar.packageName.toLowerCase().includes(Sr.toLowerCase())))??[],renderOption:Sr=>jsx$1(PackageItem,{...Sr})}:{autoComplete:!1}},[ir]);return jsxs("div",{className:lr,children:[jsx$1("h3",{className:"mb-4 font-semibold text-gray-900",children:"Install Package"}),jsxs("div",{className:"flex items-center gap-4",children:[ir!=null&&ir.length?jsx$1(IdAutocomplete,{...wr,onChange:fr}):jsx$1(Input$2,{name:"package",className:"max-w-xs text-gray-700",value:dr,onChange:br,onSubmit:_r,disabled:hr}),jsx$1(Button$1,{className:"h-9 rounded-md text-sm",onClick:_r,disabled:hr,children:"Install"})]}),jsx$1("p",{className:"mb-3 ml-2 h-3 text-sm text-red-800",children:vr})]})},PackageDetail=({label:tr,value:rr})=>jsxs("div",{className:"flex items-start gap-2 text-sm",children:[jsxs("p",{className:"text-gray-600",children:[tr,":"]}),jsx$1("p",{className:"text-gray-600",children:rr})]}),PackageManagerListItem=tr=>{const{package:{name:rr,description:ir,category:lr,publisher:dr,publisherUrl:fr,modules:hr,id:mr,removable:gr},mutable:yr,onUninstall:_r,className:br}=tr,[vr,wr]=useState(!1);return jsxs("li",{className:twMerge("relative flex flex-col items-start rounded-md border border-gray-200 p-3 text-sm leading-5 shadow-sm",br),children:[jsx$1("h3",{className:"font-semibold text-gray-900",children:rr}),jsx$1(PackageDetail,{label:"Description",value:ir}),jsx$1(PackageDetail,{label:"Category",value:lr}),jsx$1(PackageDetail,{label:"Publisher",value:dr}),jsx$1(PackageDetail,{label:"Publisher URL",value:jsx$1("a",{className:"underline",href:fr,children:fr})}),jsx$1("p",{className:"text-sm text-gray-600",children:"Modules included:"}),jsx$1("ul",{className:"list-disc pl-5",children:hr.map(xr=>jsx$1("li",{children:jsx$1("span",{className:"text-gray-600",children:xr})},xr))}),yr&&gr&&jsx$1(ConnectDropdownMenu,{items:[{id:"uninstall",label:"Uninstall",icon:jsx$1(Icon,{name:"Trash"}),className:"text-red-900"}],onItemClick:xr=>{xr==="uninstall"&&_r(mr)},onOpenChange:wr,open:vr,children:jsx$1("button",{className:"group absolute right-3 top-3",onClick:xr=>{xr.stopPropagation(),wr(!0)},children:jsx$1(Icon,{className:"text-gray-600 group-hover:text-gray-900",name:"VerticalDots"})})})]})},PackageManagerList=tr=>{const{className:rr,packages:ir,onUninstall:lr,mutable:dr,...fr}=tr,hr=useCallback(mr=>{lr(mr)},[lr]);return jsxs("div",{...fr,className:twMerge("flex max-h-[370px] flex-col items-stretch overflow-hidden",rr),children:[jsx$1("h3",{className:"mb-4 font-semibold text-gray-900",children:"Installed Packages"}),jsx$1("div",{className:"flex-1 overflow-y-auto pr-2",children:jsx$1("ul",{className:"flex flex-col items-stretch gap-4 pr-2",children:ir.map(mr=>jsx$1(PackageManagerListItem,{package:mr,onUninstall:hr,mutable:dr},mr.id))})})]})},PackageManagerReactorSelect=tr=>{const{reactorOptions:rr,reactor:ir,onReactorChange:lr,...dr}=tr,fr=useCallback(hr=>{lr(Array.isArray(hr)?hr.at(-1):hr)},[lr]);return jsxs("div",{...dr,children:[jsx$1("h3",{className:"mb-4 font-semibold text-gray-900",children:"Select Reactor"}),jsx$1(SelectFieldRaw,{className:"min-w-36 max-w-fit",name:"reactor",required:!0,value:ir,options:rr,multiple:!1,onChange:fr})]})},PackageManager$1=tr=>{const{className:rr,reactorOptions:ir,reactor:lr,onReactorChange:dr,onInstall:fr,packages:hr,onUninstall:mr,mutable:gr,packageOptions:yr,..._r}=tr,br=useMemo(()=>yr==null?void 0:yr.filter(vr=>!hr.find(wr=>wr.name===vr.packageName)),[hr,yr]);return jsxs("div",{..._r,className:twMerge("flex h-full flex-1 flex-col rounded-lg p-3",rr),children:[jsx$1(PackageManagerReactorSelect,{reactor:lr,reactorOptions:ir,onReactorChange:dr,className:"mb-4"}),gr&&jsx$1(PackageManagerInput,{onInstall:fr,packageOptions:br}),jsx$1(PackageManagerList,{packages:hr,onUninstall:mr,mutable:gr})]})};function SettingsModal$1(tr){var wr,xr;const{title:rr,overlayProps:ir,contentProps:lr,onOpenChange:dr,tabs:fr,defaultTab:hr,...mr}=tr,[gr,yr]=useState(hr??((wr=fr.at(0))==null?void 0:wr.id)),_r=fr.map(Sr=>jsx$1("button",{type:"button",onClick:()=>yr(Sr.id),children:jsxs("div",{className:twMerge("flex h-9 w-48 cursor-pointer items-center gap-x-2 rounded-md pl-3 hover:bg-slate-50",gr===Sr.id?"bg-slate-50":"bg-transparent"),children:[Sr.icon,jsx$1("span",{children:Sr.label})]})},Sr.id)),vr=(xr=fr.find(Sr=>Sr.id===gr))==null?void 0:xr.content;return jsxs(Modal,{contentProps:{...lr,className:twMerge("min-h-full w-full max-w-4xl rounded-xl",lr==null?void 0:lr.className),style:{...lr==null?void 0:lr.style,boxShadow:"0px 0px 16px 4px rgba(0, 0, 0, 0.04), 0px 33px 32px -16px rgba(0, 0, 0, 0.10)"}},onOpenChange:dr,overlayProps:{...ir,className:twMerge("py-28",ir==null?void 0:ir.className)},...mr,children:[jsxs("div",{className:"flex justify-between border-b border-slate-50 p-4",children:[jsx$1("h1",{className:"text-center text-xl font-semibold",children:rr}),jsx$1("button",{type:"button",className:"flex size-6 items-center justify-center rounded-md outline-none",onClick:()=>dr==null?void 0:dr(!1),children:jsx$1(Icon,{name:"XmarkLight",size:24})})]}),jsxs("div",{className:"flex flex-1",children:[jsx$1("div",{className:"flex flex-col gap-y-1 p-3 pt-6",children:_r}),jsx$1("div",{className:"m-6 flex h-full flex-1 flex-col overflow-hidden rounded-lg border border-slate-50",children:typeof vr=="function"?jsx$1(vr,{}):vr})]})]})}const buttonStyles="min-h-[48px] min-w-[142px] text-base font-semibold py-3 px-6 rounded-xl outline-none active:opacity-75 hover:scale-105 transform transition-all";function ConnectUpgradeDriveModal(tr){const{body:rr,header:ir,onOpenChange:lr,onContinue:dr,cancelLabel:fr,continueLabel:hr,overlayProps:mr,contentProps:gr,...yr}=tr;return jsx$1(Modal,{contentProps:{...gr,className:twMerge("rounded-3xl",gr==null?void 0:gr.className)},onOpenChange:lr,overlayProps:{...mr,className:mr==null?void 0:mr.className},...yr,children:jsxs("div",{className:"w-[400px] p-6 text-slate-300",children:[jsx$1("div",{className:"border-b border-slate-50 pb-2 text-2xl font-bold text-gray-800",children:ir}),jsx$1("div",{className:"my-6 rounded-md bg-slate-50 p-4 text-center",children:rr}),jsxs("div",{className:"mt-8 flex justify-between gap-3",children:[jsx$1("button",{className:twMerge(buttonStyles,"flex-1 bg-slate-50 text-slate-800"),onClick:()=>lr==null?void 0:lr(!1),children:fr}),jsx$1("button",{className:twMerge(buttonStyles,"flex-1 bg-gray-800 text-gray-50"),onClick:dr,children:hr})]})]})})}const renownShortHover=""+new URL("renown-short-hover-BiSLBV7L.png",import.meta.url).href,renownShort="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJAAAACQCAYAAADnRuK4AAAACXBIWXMAACxLAAAsSwGlPZapAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAtmSURBVHgB7Z3dbtvmGcefl5LsqHYCq0C6tEUCZ0kDzAFqd0NTYAmweAfr0YD0CrpeQboriH0H6RUsu4ChAYodtCdJD3LQBGttILEBJ4tdJ2uzBoi0yIpsi+S790+ZDkmREilSHySfX6FKpkgliH5+nuf9pKAEkFLO1Bu7VzRNzEuiWfXzglDHSIgZYsYC9b1sCaEeJFZMU66WCnS7XC5vUUwE9Qmk2dndvar+ZpetB5NCxIr6Hr+II1NkgQ7FMeTnHGGygxLhRkGj5agiRRKo3mxeY3EyjkZLR8vl5bCnhxKo2WzOGqb4UpJcCDpH1T+E/wpKY+3gU4XoO0MyCaKyhvVsqifTNNWzVM8y8Hz1rW2pr3ExTDTq+Q3vNPc/lYZ+3S/qwI+iVlDSCJYlZcgDiVqGQdLXJVGTJD47NjV5s9vndP3W6429a8rZpY6LIE6hoB4aMenHMMxgkXqktECBguSBNHhwxMkWiEgt3SRDpbgOukjka8HLxt4VQeaX3uOlIkedrKPr7WjkRWiFv0yXJ/7ecdx7AAWzbsgfnDUPgs1EsWgVykz2QTTaa+melCZqRU1+4C2sO8KJSoe3vAXzZInlyRMoTxAw3MgZXbXEvee6BELdg6EI5zGkLa538gcCRkk1lNzIhXqjseQ8cmiGlbpM2nS+WdA0migViMkvKKx1V00kavr+5OlKRdTw02EEUqnrmvNCBJ1SkQvmvFMsauROQHKmOPHqc/sn6y2/6MMtLsams2X2OgpZhrQM92h6u6OQ5WHadItCliWqSL7quqDAdQ/jpqB5nBDaH6wnv/R1ZKLILS/GBbqEdvdarmP6/pGK5k1f1qg6y8N4gBHevsBSafeKOuSeoqGxPEwAXjcwvUfVQGLedZLGxTPjj9cNKWhWw/9cJ3EAYgLwuqHaZvM4Nus+zAYxAXSkMDGj9TiHYQ7pVEP1BxEzFL6+9T3tvGrS4u/fpzcrRykrcMU8BLb/85yePa/STmOX1h49oSzBAg2BJ0qgw9dPn1OWYIEGzH5LtyKQ8+dnv1QpK7BAA2ZbRRxI42T1wSZlBRZowKw/2u44hnpov9WiLMACDRCI8qK64/ve2sZTygIs0ABZvf848L31je1MRCEWaEA82vxZRaBa4Puoi1bvp78WYoEGxOra457nrD18kvoWGQs0AFYfPLY6DcOdm+4oxAIlzE6jSSsRpEChvbaR3t5pFihBUBR/fft7isq9lY3UpjIWKEHufLceOnV1XHtvzYpeaYMFSgjUPds/9T/OBfEQvdLWtGeBEgDyrCRQDFsS3UqXRCxQTJKSx+ZFbSdVErFAMbi38jBReWwg0Vff3E1FTcQC9YHV2lJRYm1jmwaFXRONu0Si3mi69qEqT5aICQb9NnfurvXd2uqHhfO/pvnzp2kcaHpWp7JAIUHUWX2wNdCo0403Z6Zp8eL7ND1VplHCAvXBuuopXlHFsndi2Cg4O/u2FY1GJRILFBJEnEebz2j94fZQ01UYpqeO0InjlZGIxAL1ADUOJsFjOsY4RJxenHr3OJ05/Tadeuc4DQMWKAC0dtqtnvGKNmGZKBXp4oU5S6hB4hWIm/EHoO8lrfIAa/XHT8NfMsQCHXDirYqqK9J7FytEoLmzp2jYcArzgCiEqRWYUTjuEQnSWPWPSlsoqocB10ARwIJATH7vNrd5FECc35w7SXPnTlmvhwkL1AdokY1DRBqlODYsUAzQmTiqOcwnVTP90kdzIxPHhgWKSXuQ819Di0YQ5sMPzlk90OMAC5QQd1c2rCGOQYIe548v/856Hhe8AvEGU31yYeGcFR0GldLQpbB4aX7kKasXLFAMMM0CJC3RGZWuLqle5TQwcoGGUUsMMgUkLVGa5AEjF+gf/7xDwwQyTb9RpomJIlVmpg96oON1wiUlEeb8pEkekLsUhohnRz10FNpfOiRCr26/rR1IhPGofgtriL14cZ7SBtdAB2AaBx5YZXF29p2+ppBCov/+UlMDs3WKyri1tsLCg6keEJ3QYYjU+mjr50jXosWEaadRW04fLryXSnkACxQARMLk+ah1DUSYP6iJwoDmOoYm0goL1ANEI4gUhTk1XhV2asjFC+cpzbBAIUAqiypRmCiEc9KaumxYoJBAoij7+PSaoAZxxmV8Kw4sUASwj8+LavgWVrcodEa19NIefQALFBGshw9LtyiUhegDWKCIWP1FEXYT84tCGK7IQvQBqe1IxBdwJuRvcbW6Qy/+V09s3A1Ne0SXMODWTugXcq4xO3s6G9EHpFcgNZ61EKG/BSQ1NRU9zVi5OlHqPXfKnvhuD3HYq0qzQq5SGH7z//ynj2LXH+077oSfaO9cNfqrDMkDclcD2Ss4464BQy0UFqS7k+8et0bbo0bNcSe3g6noAf7qm+/6Xv8eNQ3+UY2RZZHctsKsIjxGMVvtY8Q9i+S6GR9nR4s0r6NPklwLlKW7J4+KXAs07ise0gD3RDOxyLVAadiBbNzJtUAvYrSksjKWFZdcC/TvzWhznp1gKIXJsUDYEzFKb7KXSmWamBwLtP7waay+nCwNiMYhlwJh7VfcHedPvJXe/RSTJFcdIdbCwfubsVIXwDykMFM58kBqBdp51bSW3IShgY0zlTRJDT9kaUJYXNIrkJJhFNvNofbh+uc13BMdkYsp2z1j0LBAEcjCQsCkYYFCghmMC2Ny07dxggUKgXWzt0vp27tnGPB8hh6My/7M4wr/qwQAYbDJVJq3XhkGLJAPuJ0AVk9w1OkN10A+oJeZ5QkHC+QD7tCDladMb1L7a4be4I8Xfxv4fpwbo2Cm4trGU262hyCzESjuLZE4CoUjswLZ99bqFzsKMd3JdA3EUWjwZFogjkKDJ/OtMI5CgyXzAtkbPPULR6Hu5KIfaO69eMMRHIWCyYVA7W3l+p8Ez1EomNz0RM/H3BmMo5A/uRGo187xveAo5E+uxsI4CiVPrgTiKJQ8uRuN5yiULLkTiKNQsuRyPhDulBMHjkKvyaVAWJocZ30XR6HX5HZG4pmYtzvgKNQmtwLFHWTlKNQmtwLFneoBOArlfFI9R6H4iHqjKZ0HypO8cRITTHPPHXFVBJKuG19JSQzji58amiRR630awygzTLcbgmhLE0KsOA+a7A8TgFcNKZRAZJo/Og8apkkM44fpdcOUq0hhrggkuQhiAjA9bsAdzWjt3nSdpHIYO8R4QWAxPfWNUaDbWqVSqSmVbjvf0E2DGMaJ2VFAy5VKubzV7kiU9K3zTUPnOohx0zLcTphSfIFnSyBd373u7A+Ca7rBUYhpYyh5vLUx0heeLYGsNGa2jbLRdZNrIcYSxxt9BGk3kL7arw+oVqszxYnJTXXocLpesahRqVAgJr/s64YVgZzoGp22BTocTA2KQpzK8ouuxPHKo6qfZVseILwX1Ru7P6jAteA8NqlGrDVNEJMfkLp29933lBWq53n6jbJr27aO6Ry6Jj/xDrBi2gJ3MOYHQzXZ91rezCNrLUGL3nM7BEJ4klL81XWpesBGTmfZB2nLL2BIKnzmTF02vhPKjk2Xb5BJy97jLVUToajiaJQ9rNaW+m7x6MRcPjY1edPvuq6FTb3eXFKKXeu4SCXDYkGzHkz6QdTRffp62pjLR6emloKu7VkZv3zZuCIK4m/O5v3hxQciFVSBjddMeoAsuolWlgwQR9aEKmWmkY26EOpbrzabsyVJt9SfMxt0DlppmmiLhNf4YJZqPLAFQXGMEXW/gVEnmCPWEvITv5qn41yKQFBKY7KCtPoCjx4tL4W9InKIQDQqGOaSENqnxGSEtjj69JHrFeGd4tydvnNMWyS6rMLdVW/HI5MShBoQNejbfsR5/REJcCiTJZKYl4Jm1QfPEjMmyBoWT2AOj+rQ+REzCY2pIzf7lcbJ/wH9VD8KK3ri6QAAAABJRU5ErkJggg==",SidebarLogin=({onLogin:tr})=>{const rr=jsx$1(AccountPopoverLogin,{onLogin:tr});return jsx$1(AccountPopover,{content:rr,children:jsxs("div",{className:twMerge("group/sidebar-footer flex w-full items-baseline justify-start text-sm font-semibold leading-10 text-gray-600",tr?"cursor-pointer":"cursor-wait"),children:[jsx$1("img",{width:42,height:42,loading:"lazy",className:"group-hover/sidebar-footer:hidden",src:renownShort,alt:"Renown Login"}),jsx$1("img",{width:42,height:42,loading:"lazy",className:"hidden group-hover/sidebar-footer:block",src:renownShortHover,alt:"Renown Login Hover"})]})})},SidebarUser=({address:tr,etherscanUrl:rr,onDisconnect:ir})=>{const{data:lr}=useEnsName({address:tr}),fr=jsx$1(AccountPopoverUser,{address:tr,username:lr,onDisconnect:ir,etherscanUrl:rr});return jsx$1(AccountPopover,{content:fr,children:jsx$1("div",{className:"flex items-center justify-center rounded-sm",children:jsx$1(ENSAvatar,{address:tr,size:"40px"})})})},ConnectSidebarFooter=({address:tr,className:rr,onLogin:ir,onClickSettings:lr,onDisconnect:dr,etherscanUrl:fr="",...hr})=>jsxs(SidebarFooter,{...hr,className:twMerge("flex flex-col gap-2 border-t border-gray-300 px-2 py-4",rr),children:[jsx$1("div",{children:tr?jsx$1(SidebarUser,{address:tr,onDisconnect:dr,etherscanUrl:fr}):jsx$1(SidebarLogin,{onLogin:ir})}),jsxs("button",{"aria-label":"Settings",type:"button",className:twMerge("mt-3 flex w-full items-center justify-center outline-none",lr?"cursor-pointer":"cursor-wait"),onClick:lr,children:[jsx$1(Icon,{className:"text-gray-600",name:"Settings"}),jsx$1("span",{className:"hidden text-sm font-semibold leading-6 text-gray-800",children:"Settings"})]})]}),ConnectSidebarHeader=({onClick:tr,className:rr,children:ir,...lr})=>jsx$1(SidebarHeader,{...lr,className:twMerge("flex justify-center gap-4 border-b border-gray-300 py-4",rr),children:jsx$1("button",{"aria-label":"Home",className:tr?"cursor-pointer":"cursor-wait",onClick:tr,type:"button",children:jsx$1(Icon,{className:"text-gray-600",name:"ConnectSmall",size:24})})}),ConnectSidebar=({onClick:tr,address:rr,headerContent:ir,onClickSettings:lr,maxWidth:dr="304px",minWidth:fr="58px",onLogin:hr,onDisconnect:mr,etherscanUrl:gr,...yr})=>jsxs(Sidebar,{...yr,maxWidth:dr,minWidth:fr,children:[jsxs(SidebarPanel,{children:[jsx$1(ConnectSidebarHeader,{onClick:tr,children:ir}),jsx$1("div",{className:"flex flex-col",children:yr.children})]}),jsx$1(ConnectSidebarFooter,{address:rr,onClickSettings:lr,onLogin:hr,onDisconnect:mr,etherscanUrl:gr})]});function TabContent(tr){const{children:rr}=tr;return jsx$1("div",{children:rr})}var TABS_NAME="Tabs",[createTabsContext,createTabsScope]=createContextScope(TABS_NAME,[createRovingFocusGroupScope]),useRovingFocusGroupScope=createRovingFocusGroupScope(),[TabsProvider,useTabsContext]=createTabsContext(TABS_NAME),Tabs$1=React.forwardRef((tr,rr)=>{const{__scopeTabs:ir,value:lr,onValueChange:dr,defaultValue:fr,orientation:hr="horizontal",dir:mr,activationMode:gr="automatic",...yr}=tr,_r=useDirection(mr),[br,vr]=useControllableState({prop:lr,onChange:dr,defaultProp:fr??"",caller:TABS_NAME});return jsx$1(TabsProvider,{scope:ir,baseId:useId(),value:br,onValueChange:vr,orientation:hr,dir:_r,activationMode:gr,children:jsx$1(Primitive.div,{dir:_r,"data-orientation":hr,...yr,ref:rr})})});Tabs$1.displayName=TABS_NAME;var TAB_LIST_NAME="TabsList",TabsList=React.forwardRef((tr,rr)=>{const{__scopeTabs:ir,loop:lr=!0,...dr}=tr,fr=useTabsContext(TAB_LIST_NAME,ir),hr=useRovingFocusGroupScope(ir);return jsx$1(Root$3,{asChild:!0,...hr,orientation:fr.orientation,dir:fr.dir,loop:lr,children:jsx$1(Primitive.div,{role:"tablist","aria-orientation":fr.orientation,...dr,ref:rr})})});TabsList.displayName=TAB_LIST_NAME;var TRIGGER_NAME="TabsTrigger",TabsTrigger=React.forwardRef((tr,rr)=>{const{__scopeTabs:ir,value:lr,disabled:dr=!1,...fr}=tr,hr=useTabsContext(TRIGGER_NAME,ir),mr=useRovingFocusGroupScope(ir),gr=makeTriggerId(hr.baseId,lr),yr=makeContentId(hr.baseId,lr),_r=lr===hr.value;return jsx$1(Item,{asChild:!0,...mr,focusable:!dr,active:_r,children:jsx$1(Primitive.button,{type:"button",role:"tab","aria-selected":_r,"aria-controls":yr,"data-state":_r?"active":"inactive","data-disabled":dr?"":void 0,disabled:dr,id:gr,...fr,ref:rr,onMouseDown:composeEventHandlers(tr.onMouseDown,br=>{!dr&&br.button===0&&br.ctrlKey===!1?hr.onValueChange(lr):br.preventDefault()}),onKeyDown:composeEventHandlers(tr.onKeyDown,br=>{[" ","Enter"].includes(br.key)&&hr.onValueChange(lr)}),onFocus:composeEventHandlers(tr.onFocus,()=>{const br=hr.activationMode!=="manual";!_r&&!dr&&br&&hr.onValueChange(lr)})})})});TabsTrigger.displayName=TRIGGER_NAME;var CONTENT_NAME="TabsContent",TabsContent=React.forwardRef((tr,rr)=>{const{__scopeTabs:ir,value:lr,forceMount:dr,children:fr,...hr}=tr,mr=useTabsContext(CONTENT_NAME,ir),gr=makeTriggerId(mr.baseId,lr),yr=makeContentId(mr.baseId,lr),_r=lr===mr.value,br=React.useRef(_r);return React.useEffect(()=>{const vr=requestAnimationFrame(()=>br.current=!1);return()=>cancelAnimationFrame(vr)},[]),jsx$1(Presence,{present:dr||_r,children:({present:vr})=>jsx$1(Primitive.div,{"data-state":_r?"active":"inactive","data-orientation":mr.orientation,role:"tabpanel","aria-labelledby":gr,hidden:!vr,id:yr,tabIndex:0,...hr,ref:rr,style:{...tr.style,animationDuration:br.current?"0s":void 0},children:vr&&fr})})});TabsContent.displayName=CONTENT_NAME;function makeTriggerId(tr,rr){return`${tr}-trigger-${rr}`}function makeContentId(tr,rr){return`${tr}-content-${rr}`}var Root2=Tabs$1,List=TabsList,Trigger=TabsTrigger,Content$1=TabsContent;function Tabs({children:tr,defaultValue:rr}){return jsxs(Root2,{defaultValue:rr,className:"flex flex-col gap-2",children:[jsx$1("div",{className:"flex w-full justify-between",children:jsx$1(List,{className:"flex w-full gap-x-2 rounded-xl bg-slate-50 p-1 text-sm font-semibold text-gray-600 outline-none",children:React__default.Children.map(tr,(ir,lr)=>{if(!React__default.isValidElement(ir))return;const{label:dr,disabled:fr}=ir.props;return jsx$1(Trigger,{className:"data-[state='active']:tab-shadow ata-disabled:cursor-not-allowed data-disabled:text-gray-400 flex h-7 flex-1 items-center justify-center rounded-lg transition duration-300 data-[state='active']:bg-gray-50 data-[state='active']:text-gray-900",value:dr,disabled:fr??!1,children:dr},dr)})})}),jsx$1("div",{className:"mt-3 rounded-md bg-white",children:React__default.Children.map(tr,(ir,lr)=>{if(!React__default.isValidElement(ir))return;const{label:dr}=ir.props;return jsx$1(Content$1,{value:dr,children:ir},lr)})})]})}const c$1=tr=>typeof tr=="number"&&!isNaN(tr),d=tr=>typeof tr=="string",u=tr=>typeof tr=="function",p=tr=>d(tr)||u(tr)?tr:null,m=tr=>isValidElement(tr)||d(tr)||u(tr)||c$1(tr);function f(tr,rr,ir){ir===void 0&&(ir=300);const{scrollHeight:lr,style:dr}=tr;requestAnimationFrame(()=>{dr.minHeight="initial",dr.height=lr+"px",dr.transition=`all ${ir}ms`,requestAnimationFrame(()=>{dr.height="0",dr.padding="0",dr.margin="0",setTimeout(rr,ir)})})}function g(tr){let{enter:rr,exit:ir,appendPosition:lr=!1,collapse:dr=!0,collapseDuration:fr=300}=tr;return function(hr){let{children:mr,position:gr,preventExitTransition:yr,done:_r,nodeRef:br,isIn:vr,playToast:wr}=hr;const xr=lr?`${rr}--${gr}`:rr,Sr=lr?`${ir}--${gr}`:ir,Ar=useRef(0);return useLayoutEffect(()=>{const Ir=br.current,Mr=xr.split(" "),Or=$r=>{$r.target===br.current&&(wr(),Ir.removeEventListener("animationend",Or),Ir.removeEventListener("animationcancel",Or),Ar.current===0&&$r.type!=="animationcancel"&&Ir.classList.remove(...Mr))};Ir.classList.add(...Mr),Ir.addEventListener("animationend",Or),Ir.addEventListener("animationcancel",Or)},[]),useEffect(()=>{const Ir=br.current,Mr=()=>{Ir.removeEventListener("animationend",Mr),dr?f(Ir,_r,fr):_r()};vr||(yr?Mr():(Ar.current=1,Ir.className+=` ${Sr}`,Ir.addEventListener("animationend",Mr)))},[vr]),React__default.createElement(React__default.Fragment,null,mr)}}function y(tr,rr){return tr!=null?{content:tr.content,containerId:tr.props.containerId,id:tr.props.toastId,theme:tr.props.theme,type:tr.props.type,data:tr.props.data||{},isLoading:tr.props.isLoading,icon:tr.props.icon,status:rr}:{}}const v=new Map;let h=[];const T=new Set,E=tr=>T.forEach(rr=>rr(tr)),b=()=>v.size>0;function I(tr,rr){var ir;if(rr)return!((ir=v.get(rr))==null||!ir.isToastActive(tr));let lr=!1;return v.forEach(dr=>{dr.isToastActive(tr)&&(lr=!0)}),lr}function _(tr,rr){m(tr)&&(b()||h.push({content:tr,options:rr}),v.forEach(ir=>{ir.buildToast(tr,rr)}))}function C(tr,rr){v.forEach(ir=>{rr!=null&&rr!=null&&rr.containerId?(rr==null?void 0:rr.containerId)===ir.id&&ir.toggle(tr,rr==null?void 0:rr.id):ir.toggle(tr,rr==null?void 0:rr.id)})}function L(tr){const{subscribe:rr,getSnapshot:ir,setProps:lr}=useRef((function(fr){const hr=fr.containerId||1;return{subscribe(mr){const gr=(function(_r,br,vr){let wr=1,xr=0,Sr=[],Ar=[],Ir=[],Mr=br;const Or=new Map,$r=new Set,Dr=()=>{Ir=Array.from(Or.values()),$r.forEach(Jr=>Jr())},zr=Jr=>{Ar=Jr==null?[]:Ar.filter($n=>$n!==Jr),Dr()},Fr=Jr=>{const{toastId:$n,onOpen:Qr,updateId:Zn,children:qn}=Jr.props,Xn=Zn==null;Jr.staleId&&Or.delete(Jr.staleId),Or.set($n,Jr),Ar=[...Ar,Jr.props.toastId].filter(Lr=>Lr!==Jr.staleId),Dr(),vr(y(Jr,Xn?"added":"updated")),Xn&&u(Qr)&&Qr(isValidElement(qn)&&qn.props)};return{id:_r,props:Mr,observe:Jr=>($r.add(Jr),()=>$r.delete(Jr)),toggle:(Jr,$n)=>{Or.forEach(Qr=>{$n!=null&&$n!==Qr.props.toastId||u(Qr.toggle)&&Qr.toggle(Jr)})},removeToast:zr,toasts:Or,clearQueue:()=>{xr-=Sr.length,Sr=[]},buildToast:(Jr,$n)=>{if((Jn=>{let{containerId:ni,toastId:Yn,updateId:ei}=Jn;const ai=ni?ni!==_r:_r!==1,pi=Or.has(Yn)&&ei==null;return ai||pi})($n))return;const{toastId:Qr,updateId:Zn,data:qn,staleId:Xn,delay:Lr}=$n,Gr=()=>{zr(Qr)},Hn=Zn==null;Hn&&xr++;const ii={...Mr,style:Mr.toastStyle,key:wr++,...Object.fromEntries(Object.entries($n).filter(Jn=>{let[ni,Yn]=Jn;return Yn!=null})),toastId:Qr,updateId:Zn,data:qn,closeToast:Gr,isIn:!1,className:p($n.className||Mr.toastClassName),bodyClassName:p($n.bodyClassName||Mr.bodyClassName),progressClassName:p($n.progressClassName||Mr.progressClassName),autoClose:!$n.isLoading&&(oi=$n.autoClose,ri=Mr.autoClose,oi===!1||c$1(oi)&&oi>0?oi:ri),deleteToast(){const Jn=Or.get(Qr),{onClose:ni,children:Yn}=Jn.props;u(ni)&&ni(isValidElement(Yn)&&Yn.props),vr(y(Jn,"removed")),Or.delete(Qr),xr--,xr<0&&(xr=0),Sr.length>0?Fr(Sr.shift()):Dr()}};var oi,ri;ii.closeButton=Mr.closeButton,$n.closeButton===!1||m($n.closeButton)?ii.closeButton=$n.closeButton:$n.closeButton===!0&&(ii.closeButton=!m(Mr.closeButton)||Mr.closeButton);let ti=Jr;isValidElement(Jr)&&!d(Jr.type)?ti=cloneElement(Jr,{closeToast:Gr,toastProps:ii,data:qn}):u(Jr)&&(ti=Jr({closeToast:Gr,toastProps:ii,data:qn}));const si={content:ti,props:ii,staleId:Xn};Mr.limit&&Mr.limit>0&&xr>Mr.limit&&Hn?Sr.push(si):c$1(Lr)?setTimeout(()=>{Fr(si)},Lr):Fr(si)},setProps(Jr){Mr=Jr},setToggle:(Jr,$n)=>{Or.get(Jr).toggle=$n},isToastActive:Jr=>Ar.some($n=>$n===Jr),getSnapshot:()=>Ir}})(hr,fr,E);v.set(hr,gr);const yr=gr.observe(mr);return h.forEach(_r=>_(_r.content,_r.options)),h=[],()=>{yr(),v.delete(hr)}},setProps(mr){var gr;(gr=v.get(hr))==null||gr.setProps(mr)},getSnapshot(){var mr;return(mr=v.get(hr))==null?void 0:mr.getSnapshot()}}})(tr)).current;lr(tr);const dr=useSyncExternalStore(rr,ir,ir);return{getToastToRender:function(fr){if(!dr)return[];const hr=new Map;return tr.newestOnTop&&dr.reverse(),dr.forEach(mr=>{const{position:gr}=mr.props;hr.has(gr)||hr.set(gr,[]),hr.get(gr).push(mr)}),Array.from(hr,mr=>fr(mr[0],mr[1]))},isToastActive:I,count:dr==null?void 0:dr.length}}function N(tr){const[rr,ir]=useState(!1),[lr,dr]=useState(!1),fr=useRef(null),hr=useRef({start:0,delta:0,removalDistance:0,canCloseOnClick:!0,canDrag:!1,didMove:!1}).current,{autoClose:mr,pauseOnHover:gr,closeToast:yr,onClick:_r,closeOnClick:br}=tr;var vr,wr;function xr(){ir(!0)}function Sr(){ir(!1)}function Ar(Or){const $r=fr.current;hr.canDrag&&$r&&(hr.didMove=!0,rr&&Sr(),hr.delta=tr.draggableDirection==="x"?Or.clientX-hr.start:Or.clientY-hr.start,hr.start!==Or.clientX&&(hr.canCloseOnClick=!1),$r.style.transform=`translate3d(${tr.draggableDirection==="x"?`${hr.delta}px, var(--y)`:`0, calc(${hr.delta}px + var(--y))`},0)`,$r.style.opacity=""+(1-Math.abs(hr.delta/hr.removalDistance)))}function Ir(){document.removeEventListener("pointermove",Ar),document.removeEventListener("pointerup",Ir);const Or=fr.current;if(hr.canDrag&&hr.didMove&&Or){if(hr.canDrag=!1,Math.abs(hr.delta)>hr.removalDistance)return dr(!0),tr.closeToast(),void tr.collapseAll();Or.style.transition="transform 0.2s, opacity 0.2s",Or.style.removeProperty("transform"),Or.style.removeProperty("opacity")}}(wr=v.get((vr={id:tr.toastId,containerId:tr.containerId,fn:ir}).containerId||1))==null||wr.setToggle(vr.id,vr.fn),useEffect(()=>{if(tr.pauseOnFocusLoss)return document.hasFocus()||Sr(),window.addEventListener("focus",xr),window.addEventListener("blur",Sr),()=>{window.removeEventListener("focus",xr),window.removeEventListener("blur",Sr)}},[tr.pauseOnFocusLoss]);const Mr={onPointerDown:function(Or){if(tr.draggable===!0||tr.draggable===Or.pointerType){hr.didMove=!1,document.addEventListener("pointermove",Ar),document.addEventListener("pointerup",Ir);const $r=fr.current;hr.canCloseOnClick=!0,hr.canDrag=!0,$r.style.transition="none",tr.draggableDirection==="x"?(hr.start=Or.clientX,hr.removalDistance=$r.offsetWidth*(tr.draggablePercent/100)):(hr.start=Or.clientY,hr.removalDistance=$r.offsetHeight*(tr.draggablePercent===80?1.5*tr.draggablePercent:tr.draggablePercent)/100)}},onPointerUp:function(Or){const{top:$r,bottom:Dr,left:zr,right:Fr}=fr.current.getBoundingClientRect();Or.nativeEvent.type!=="touchend"&&tr.pauseOnHover&&Or.clientX>=zr&&Or.clientX<=Fr&&Or.clientY>=$r&&Or.clientY<=Dr?Sr():xr()}};return mr&&gr&&(Mr.onMouseEnter=Sr,tr.stacked||(Mr.onMouseLeave=xr)),br&&(Mr.onClick=Or=>{_r&&_r(Or),hr.canCloseOnClick&&yr()}),{playToast:xr,pauseToast:Sr,isRunning:rr,preventExitTransition:lr,toastRef:fr,eventHandlers:Mr}}function $(tr){let{delay:rr,isRunning:ir,closeToast:lr,type:dr="default",hide:fr,className:hr,style:mr,controlledProgress:gr,progress:yr,rtl:_r,isIn:br,theme:vr}=tr;const wr=fr||gr&&yr===0,xr={...mr,animationDuration:`${rr}ms`,animationPlayState:ir?"running":"paused"};gr&&(xr.transform=`scaleX(${yr})`);const Sr=clsx("Toastify__progress-bar",gr?"Toastify__progress-bar--controlled":"Toastify__progress-bar--animated",`Toastify__progress-bar-theme--${vr}`,`Toastify__progress-bar--${dr}`,{"Toastify__progress-bar--rtl":_r}),Ar=u(hr)?hr({rtl:_r,type:dr,defaultClassName:Sr}):clsx(Sr,hr),Ir={[gr&&yr>=1?"onTransitionEnd":"onAnimationEnd"]:gr&&yr<1?null:()=>{br&&lr()}};return React__default.createElement("div",{className:"Toastify__progress-bar--wrp","data-hidden":wr},React__default.createElement("div",{className:`Toastify__progress-bar--bg Toastify__progress-bar-theme--${vr} Toastify__progress-bar--${dr}`}),React__default.createElement("div",{role:"progressbar","aria-hidden":wr?"true":"false","aria-label":"notification timer",className:Ar,style:xr,...Ir}))}let w=1;const k=()=>""+w++;function P(tr){return tr&&(d(tr.toastId)||c$1(tr.toastId))?tr.toastId:k()}function M(tr,rr){return _(tr,rr),rr.toastId}function x(tr,rr){return{...rr,type:rr&&rr.type||tr,toastId:P(rr)}}function A(tr){return(rr,ir)=>M(rr,x(tr,ir))}function B(tr,rr){return M(tr,x("default",rr))}B.loading=(tr,rr)=>M(tr,x("default",{isLoading:!0,autoClose:!1,closeOnClick:!1,closeButton:!1,draggable:!1,...rr})),B.promise=function(tr,rr,ir){let lr,{pending:dr,error:fr,success:hr}=rr;dr&&(lr=d(dr)?B.loading(dr,ir):B.loading(dr.render,{...ir,...dr}));const mr={isLoading:null,autoClose:null,closeOnClick:null,closeButton:null,draggable:null},gr=(_r,br,vr)=>{if(br==null)return void B.dismiss(lr);const wr={type:_r,...mr,...ir,data:vr},xr=d(br)?{render:br}:br;return lr?B.update(lr,{...wr,...xr}):B(xr.render,{...wr,...xr}),vr},yr=u(tr)?tr():tr;return yr.then(_r=>gr("success",hr,_r)).catch(_r=>gr("error",fr,_r)),yr},B.success=A("success"),B.info=A("info"),B.error=A("error"),B.warning=A("warning"),B.warn=B.warning,B.dark=(tr,rr)=>M(tr,x("default",{theme:"dark",...rr})),B.dismiss=function(tr){(function(rr){var ir;if(b()){if(rr==null||d(ir=rr)||c$1(ir))v.forEach(lr=>{lr.removeToast(rr)});else if(rr&&("containerId"in rr||"id"in rr)){const lr=v.get(rr.containerId);lr?lr.removeToast(rr.id):v.forEach(dr=>{dr.removeToast(rr.id)})}}else h=h.filter(lr=>rr!=null&&lr.options.toastId!==rr)})(tr)},B.clearWaitingQueue=function(tr){tr===void 0&&(tr={}),v.forEach(rr=>{!rr.props.limit||tr.containerId&&rr.id!==tr.containerId||rr.clearQueue()})},B.isActive=I,B.update=function(tr,rr){rr===void 0&&(rr={});const ir=((lr,dr)=>{var fr;let{containerId:hr}=dr;return(fr=v.get(hr||1))==null?void 0:fr.toasts.get(lr)})(tr,rr);if(ir){const{props:lr,content:dr}=ir,fr={delay:100,...lr,...rr,toastId:rr.toastId||tr,updateId:k()};fr.toastId!==tr&&(fr.staleId=tr);const hr=fr.render||dr;delete fr.render,M(hr,fr)}},B.done=tr=>{B.update(tr,{progress:1})},B.onChange=function(tr){return T.add(tr),()=>{T.delete(tr)}},B.play=tr=>C(!0,tr),B.pause=tr=>C(!1,tr);const O=typeof window<"u"?useLayoutEffect:useEffect,D=tr=>{let{theme:rr,type:ir,isLoading:lr,...dr}=tr;return React__default.createElement("svg",{viewBox:"0 0 24 24",width:"100%",height:"100%",fill:rr==="colored"?"currentColor":`var(--toastify-icon-color-${ir})`,...dr})},z={info:function(tr){return React__default.createElement(D,{...tr},React__default.createElement("path",{d:"M12 0a12 12 0 1012 12A12.013 12.013 0 0012 0zm.25 5a1.5 1.5 0 11-1.5 1.5 1.5 1.5 0 011.5-1.5zm2.25 13.5h-4a1 1 0 010-2h.75a.25.25 0 00.25-.25v-4.5a.25.25 0 00-.25-.25h-.75a1 1 0 010-2h1a2 2 0 012 2v4.75a.25.25 0 00.25.25h.75a1 1 0 110 2z"}))},warning:function(tr){return React__default.createElement(D,{...tr},React__default.createElement("path",{d:"M23.32 17.191L15.438 2.184C14.728.833 13.416 0 11.996 0c-1.42 0-2.733.833-3.443 2.184L.533 17.448a4.744 4.744 0 000 4.368C1.243 23.167 2.555 24 3.975 24h16.05C22.22 24 24 22.044 24 19.632c0-.904-.251-1.746-.68-2.44zm-9.622 1.46c0 1.033-.724 1.823-1.698 1.823s-1.698-.79-1.698-1.822v-.043c0-1.028.724-1.822 1.698-1.822s1.698.79 1.698 1.822v.043zm.039-12.285l-.84 8.06c-.057.581-.408.943-.897.943-.49 0-.84-.367-.896-.942l-.84-8.065c-.057-.624.25-1.095.779-1.095h1.91c.528.005.84.476.784 1.1z"}))},success:function(tr){return React__default.createElement(D,{...tr},React__default.createElement("path",{d:"M12 0a12 12 0 1012 12A12.014 12.014 0 0012 0zm6.927 8.2l-6.845 9.289a1.011 1.011 0 01-1.43.188l-4.888-3.908a1 1 0 111.25-1.562l4.076 3.261 6.227-8.451a1 1 0 111.61 1.183z"}))},error:function(tr){return React__default.createElement(D,{...tr},React__default.createElement("path",{d:"M11.983 0a12.206 12.206 0 00-8.51 3.653A11.8 11.8 0 000 12.207 11.779 11.779 0 0011.8 24h.214A12.111 12.111 0 0024 11.791 11.766 11.766 0 0011.983 0zM10.5 16.542a1.476 1.476 0 011.449-1.53h.027a1.527 1.527 0 011.523 1.47 1.475 1.475 0 01-1.449 1.53h-.027a1.529 1.529 0 01-1.523-1.47zM11 12.5v-6a1 1 0 012 0v6a1 1 0 11-2 0z"}))},spinner:function(){return React__default.createElement("div",{className:"Toastify__spinner"})}},R=tr=>{const{isRunning:rr,preventExitTransition:ir,toastRef:lr,eventHandlers:dr,playToast:fr}=N(tr),{closeButton:hr,children:mr,autoClose:gr,onClick:yr,type:_r,hideProgressBar:br,closeToast:vr,transition:wr,position:xr,className:Sr,style:Ar,bodyClassName:Ir,bodyStyle:Mr,progressClassName:Or,progressStyle:$r,updateId:Dr,role:zr,progress:Fr,rtl:Jr,toastId:$n,deleteToast:Qr,isIn:Zn,isLoading:qn,closeOnClick:Xn,theme:Lr}=tr,Gr=clsx("Toastify__toast",`Toastify__toast-theme--${Lr}`,`Toastify__toast--${_r}`,{"Toastify__toast--rtl":Jr},{"Toastify__toast--close-on-click":Xn}),Hn=u(Sr)?Sr({rtl:Jr,position:xr,type:_r,defaultClassName:Gr}):clsx(Gr,Sr),ii=(function(si){let{theme:Jn,type:ni,isLoading:Yn,icon:ei}=si,ai=null;const pi={theme:Jn,type:ni};return ei===!1||(u(ei)?ai=ei({...pi,isLoading:Yn}):isValidElement(ei)?ai=cloneElement(ei,pi):Yn?ai=z.spinner():(bi=>bi in z)(ni)&&(ai=z[ni](pi))),ai})(tr),oi=!!Fr||!gr,ri={closeToast:vr,type:_r,theme:Lr};let ti=null;return hr===!1||(ti=u(hr)?hr(ri):isValidElement(hr)?cloneElement(hr,ri):(function(si){let{closeToast:Jn,theme:ni,ariaLabel:Yn="close"}=si;return React__default.createElement("button",{className:`Toastify__close-button Toastify__close-button--${ni}`,type:"button",onClick:ei=>{ei.stopPropagation(),Jn(ei)},"aria-label":Yn},React__default.createElement("svg",{"aria-hidden":"true",viewBox:"0 0 14 16"},React__default.createElement("path",{fillRule:"evenodd",d:"M7.71 8.23l3.75 3.75-1.48 1.48-3.75-3.75-3.75 3.75L1 11.98l3.75-3.75L1 4.48 2.48 3l3.75 3.75L9.98 3l1.48 1.48-3.75 3.75z"})))})(ri)),React__default.createElement(wr,{isIn:Zn,done:Qr,position:xr,preventExitTransition:ir,nodeRef:lr,playToast:fr},React__default.createElement("div",{id:$n,onClick:yr,"data-in":Zn,className:Hn,...dr,style:Ar,ref:lr},React__default.createElement("div",{...Zn&&{role:zr},className:u(Ir)?Ir({type:_r}):clsx("Toastify__toast-body",Ir),style:Mr},ii!=null&&React__default.createElement("div",{className:clsx("Toastify__toast-icon",{"Toastify--animate-icon Toastify__zoom-enter":!qn})},ii),React__default.createElement("div",null,mr)),ti,React__default.createElement($,{...Dr&&!oi?{key:`pb-${Dr}`}:{},rtl:Jr,theme:Lr,delay:gr,isRunning:rr,isIn:Zn,closeToast:vr,hide:br,type:_r,style:$r,className:Or,controlledProgress:oi,progress:Fr||0})))},S=function(tr,rr){return rr===void 0&&(rr=!1),{enter:`Toastify--animate Toastify__${tr}-enter`,exit:`Toastify--animate Toastify__${tr}-exit`,appendPosition:rr}},H=g(S("bounce",!0));g(S("slide",!0));g(S("zoom"));g(S("flip"));const q={position:"top-right",transition:H,autoClose:5e3,closeButton:!0,pauseOnHover:!0,pauseOnFocusLoss:!0,draggable:"touch",draggablePercent:80,draggableDirection:"x",role:"alert",theme:"light"};function Q(tr){let rr={...q,...tr};const ir=tr.stacked,[lr,dr]=useState(!0),fr=useRef(null),{getToastToRender:hr,isToastActive:mr,count:gr}=L(rr),{className:yr,style:_r,rtl:br,containerId:vr}=rr;function wr(Sr){const Ar=clsx("Toastify__toast-container",`Toastify__toast-container--${Sr}`,{"Toastify__toast-container--rtl":br});return u(yr)?yr({position:Sr,rtl:br,defaultClassName:Ar}):clsx(Ar,p(yr))}function xr(){ir&&(dr(!0),B.play())}return O(()=>{if(ir){var Sr;const Ar=fr.current.querySelectorAll('[data-in="true"]'),Ir=12,Mr=(Sr=rr.position)==null?void 0:Sr.includes("top");let Or=0,$r=0;Array.from(Ar).reverse().forEach((Dr,zr)=>{const Fr=Dr;Fr.classList.add("Toastify__toast--stacked"),zr>0&&(Fr.dataset.collapsed=`${lr}`),Fr.dataset.pos||(Fr.dataset.pos=Mr?"top":"bot");const Jr=Or*(lr?.2:1)+(lr?0:Ir*zr);Fr.style.setProperty("--y",`${Mr?Jr:-1*Jr}px`),Fr.style.setProperty("--g",`${Ir}`),Fr.style.setProperty("--s",""+(1-(lr?$r:0))),Or+=Fr.offsetHeight,$r+=.025})}},[lr,gr,ir]),React__default.createElement("div",{ref:fr,className:"Toastify",id:vr,onMouseEnter:()=>{ir&&(dr(!1),B.pause())},onMouseLeave:xr},hr((Sr,Ar)=>{const Ir=Ar.length?{..._r}:{..._r,pointerEvents:"none"};return React__default.createElement("div",{className:wr(Sr),style:Ir,key:`container-${Sr}`},Ar.map(Mr=>{let{content:Or,props:$r}=Mr;return React__default.createElement(R,{...$r,stacked:ir,collapseAll:xr,isIn:mr($r.toastId,$r.containerId),style:$r.style,key:`toast-${$r.key}`},Or)}))}))}function isConnectTypeOptions(tr){return tr==="connect-success"||tr==="connect-warning"||tr==="connect-loading"||tr==="connect-deleted"}function getDefaultOptions(tr){if(isConnectTypeOptions(tr)){const rr={};switch(tr){case"connect-success":rr.type="success",rr.icon=jsx$1(Icon,{className:"text-green-800",name:"CheckCircleFill",size:24});break;case"connect-warning":rr.type="warning",rr.icon=jsx$1(Icon,{className:"text-gray-600",name:"WarningFill",size:24});break;case"connect-loading":rr.type="default",rr.icon=jsx$1(Icon,{className:"text-gray-600",name:"ClockFill",size:24});break;case"connect-deleted":rr.type="error",rr.icon=jsx$1(Icon,{className:"text-red-800",name:"TrashFill",size:24});break}return rr}return{type:tr}}function toast$1(tr,rr){const{type:ir="default",...lr}=rr||{},dr=getDefaultOptions(ir);return B(tr,{...dr,...lr})}const CloseButton=({closeToast:tr})=>jsx$1("button",{className:"flex items-center text-gray-500 hover:text-gray-600",onClick:tr,children:jsx$1(Icon,{name:"XmarkLight",size:16})}),ToastContainer=tr=>jsx$1(Q,{closeButton:CloseButton,...tr}),Toggle=forwardRef(function tr(rr,ir){return jsxs("label",{className:"relative cursor-pointer items-center",htmlFor:rr.id,children:[jsx$1("input",{className:"peer sr-only",ref:ir,type:"checkbox",value:"",...rr}),jsx$1("div",{className:"peer h-6 w-11 rounded-full bg-gray-500 after:absolute after:start-0.5 after:top-0.5 after:size-5 after:rounded-full after:border after:border-none after:bg-gray-50 after:transition-all peer-checked:bg-blue-900 peer-checked:after:translate-x-full peer-focus:outline-none"})]})}),mainnet=defineChain({id:1,name:"Ethereum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},blockTime:12e3,rpcUrls:{default:{http:["https://eth.merkle.io"]}},blockExplorers:{default:{name:"Etherscan",url:"https://etherscan.io",apiUrl:"https://api.etherscan.io/api"}},contracts:{ensRegistry:{address:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},ensUniversalResolver:{address:"0xce01f8eee7E479C928F8919abD53E553a36CeF67",blockCreated:19258213},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:14353601}}}),wagmiConfig=createConfig({chains:[mainnet],transports:{[mainnet.id]:http()}}),defaultQueryClient=new QueryClient;function WagmiContext(tr){const{children:rr,wagmiProviderProps:ir,queryClientProviderProps:lr}=tr,{config:dr=wagmiConfig,...fr}=ir??{},{client:hr=defaultQueryClient,...mr}=lr??{};return jsx$1(WagmiProvider,{config:dr,...fr,children:jsx$1(QueryClientProvider,{client:hr,...mr,children:rr})})}const name="@powerhousedao/connect",productName="Powerhouse-Connect",version$1="5.0.0-staging.24",description="Powerhouse Connect",main="./dist/index.html",type="module",engines={node:">=22.0.0"},files$1=["dist","nginx.conf","nginx.sh","scripts"],license="AGPL-3.0-only",author="acaldas@powerhouse.inc",repository={type:"git",url:"https://github.com/powerhouse-inc/powerhouse"},bugs={url:"https://github.com/powerhouse-inc/powerhouse/issues"},homepage="https://github.com/powerhouse-inc/powerhouse#readme",scripts={"build:tsc":"tsc --build",prepublishOnly:"npm run build",lint:"eslint .","lint:fix":"eslint --fix .","lint:nx":"eslint --quiet --fix .",format:'prettier --write "**/*.+(js|ts|jsx|tsx|json)"',dev:"vite dev",prebuild:"npm run clean && tsc --build --noEmit",build:"NODE_OPTIONS=--max-old-space-size=6144 vite build",preview:"vite preview",e2e:"playwright test","cy:open":"cypress open","build:service-worker":"tsc --build ./tsconfig.sw.json",clean:"rimraf dist","clean:node_modules":"rimraf node_modules","docker:build":"docker build -f ./Dockerfile --tag connect-test-dev --build-arg TAG=dev .","docker:run":"docker run -it -p 4000:4000 -v $(realpath ../../../monorepo):/monorepo -v $(pwd)/nginx.conf:/etc/nginx/nginx.conf.template -e PH_USE_LOCAL=true -e PH_CONNECT_BASE_PATH=/develop/powerhouse/connect -e PORT=4000 connect-test-dev"},devDependencies={"@didtools/key-webcrypto":"^0.2.0","@playwright/test":"^1.41.2","@powerhousedao/builder-tools":"workspace:*","@powerhousedao/common":"workspace:*","@powerhousedao/config":"workspace:*","@powerhousedao/design-system":"workspace:*","@powerhousedao/diff-analyzer":"^0.0.0-dev.10","@powerhousedao/reactor-browser":"workspace:*","@renown/sdk":"workspace:*","@rollup/plugin-node-resolve":"^15.2.3","@sentry/browser":"^9.1.0","@sentry/react":"^7.109.0","@sentry/vite-plugin":"^2.23.0","@tailwindcss/vite":"^4.1.4","@tanstack/react-virtual":"^3.8.1","@types/node":"^22.15.17","@types/react":"^18.2.79","@types/react-dom":"^18.2.18","@types/uuid":"^9.0.7","@types/wicg-file-system-access":"^2020.9.6","@vitejs/plugin-basic-ssl":"^2.0.0","@vitejs/plugin-react":"^4.4.1",asar:"^3.2.0","did-jwt":"^8.0.14","did-jwt-vc":"^4.0.12","did-key-creator":"^1.2.0","document-drive":"workspace:*","document-model":"workspace:*",esbuild:"^0.24.0","fast-deep-equal":"^3.1.3",graphql:"^16.11.0","graphql-request":"^6.1.0",i18next:"^23.7.6",localforage:"^1.10.0",playwright:"^1.41.2","playwright-core":"^1.41.2",react:"^18.3.1","react-dom":"^18.3.1","react-error-boundary":"^4.0.11","react-hotkeys-hook":"^4.5.0","react-i18next":"^13.5.0","react-router-dom":"^6.11.2","tailwind-merge":"^3.0.2",tailwindcss:"^4.1.4",uint8arrays:"^5.1.0",uuid:"^9.0.1",viem:"^2.8.13",vite:"^6.3.3","vite-envs":"^4.6.0","vite-plugin-html":"^3.2.2","vite-plugin-node-polyfills":"^0.24.0","vite-plugin-svgr":"^4.3.0","vite-tsconfig-paths":"^5.1.4","xvfb-maybe":"^0.2.1"},optionalDependencies={"@esbuild/linux-x64":"^0.21.4","@rollup/rollup-linux-x64-musl":"4.14.3"},packageJson={name,productName,version:version$1,description,main,type,engines,files:files$1,license,author,repository,bugs,homepage,scripts,devDependencies,optionalDependencies};function getBasePath(){if(typeof document>"u")return"/";const tr=document.querySelector("base");return(tr==null?void 0:tr.getAttribute("href"))||"/"}const version=packageJson.version,APP_VERSION=window.__VITE_ENVS.APP_VERSION||version,WARN_OUTDATED_APP=window.__VITE_ENVS.PH_CONNECT_WARN_OUTDATED_APP||"false",PH_CONNECT_STUDIO_MODE=window.__VITE_ENVS.PH_CONNECT_STUDIO_MODE||"false",DISABLE_ADD_DRIVE=window.__VITE_ENVS.PH_CONNECT_DISABLE_ADD_DRIVE||"false",SEARCH_BAR_ENABLED=window.__VITE_ENVS.PH_CONNECT_SEARCH_BAR_ENABLED||void 0,PH_CONNECT_ROUTER_BASENAME=getBasePath()||"/",PH_CONNECT_SENTRY_DSN=window.__VITE_ENVS.PH_CONNECT_SENTRY_DSN||"",PH_CONNECT_SENTRY_ENV=window.__VITE_ENVS.PH_CONNECT_SENTRY_ENV||"dev",PH_CONNECT_SENTRY_TRACING_ENABLED=window.__VITE_ENVS.PH_CONNECT_SENTRY_TRACING_ENABLED||"false",GA_TRACKING_ID=window.__VITE_ENVS.PH_CONNECT_GA_TRACKING_ID,PH_CONNECT_CLI_VERSION=window.__VITE_ENVS.PH_CONNECT_CLI_VERSION||void 0,PH_CONNECT_ANALYTICS_DATABASE_NAME=window.__VITE_ENVS.PH_CONNECT_ANALYTICS_DATABASE_NAME||`${PH_CONNECT_ROUTER_BASENAME.replace(/\//g,"")}:analytics`,PH_CONNECT_ANALYTICS_DATABASE_WORKER_DISABLED=window.__VITE_ENVS.PH_CONNECT_ANALYTICS_DATABASE_WORKER_DISABLED||"false",PH_CONNECT_DIFF_ANALYTICS_ENABLED=window.__VITE_ENVS.PH_CONNECT_DIFF_ANALYTICS_ENABLED||"false",PH_CONNECT_DRIVE_ANALYTICS_ENABLED=window.__VITE_ENVS.PH_CONNECT_DRIVE_ANALYTICS_ENABLED||"false",PH_CONNECT_EXTERNAL_PROCESSORS_ENABLED=window.__VITE_ENVS.PH_CONNECT_EXTERNAL_PROCESSORS_ENABLED||"true",LOG_LEVEL=isLogLevel(window.__VITE_ENVS.LOG_LEVEL)?window.__VITE_ENVS.LOG_LEVEL:"info";setLogLevel(LOG_LEVEL);logger$6.debug(`Setting log level to ${window.__VITE_ENVS.LOG_LEVEL}.`);const connectConfig={appVersion:APP_VERSION,studioMode:PH_CONNECT_STUDIO_MODE.toString()==="true",warnOutdatedApp:WARN_OUTDATED_APP==="true",routerBasename:PH_CONNECT_ROUTER_BASENAME,analytics:{databaseName:PH_CONNECT_ANALYTICS_DATABASE_NAME,useWorker:PH_CONNECT_ANALYTICS_DATABASE_WORKER_DISABLED!=="true",driveAnalyticsEnabled:PH_CONNECT_DRIVE_ANALYTICS_ENABLED==="true",diffProcessorEnabled:PH_CONNECT_DIFF_ANALYTICS_ENABLED==="true",externalProcessorsEnabled:PH_CONNECT_EXTERNAL_PROCESSORS_ENABLED==="true"},sentry:{dsn:PH_CONNECT_SENTRY_DSN,env:PH_CONNECT_SENTRY_ENV,tracing:PH_CONNECT_SENTRY_TRACING_ENABLED==="true"},content:{showSearchBar:SEARCH_BAR_ENABLED==="true"},drives:{addDriveEnabled:DISABLE_ADD_DRIVE!=="true"},gaTrackingId:GA_TRACKING_ID,phCliVersion:PH_CONNECT_CLI_VERSION},namespace$1=connectConfig.routerBasename,ACCEPTED_COOKIES_KEY_STORAGE=`${namespace$1}:acceptedCookies`,listeners$1=new Set;let cookies=getInitial$1();function getInitial$1(){try{const tr=localStorage.getItem(ACCEPTED_COOKIES_KEY_STORAGE);return tr?JSON.parse(tr):{analytics:!1,marketing:!1,functional:!1}}catch{return{analytics:!1,marketing:!1,functional:!1}}}function getCookies(){return cookies}function setCookies(tr){cookies=tr(cookies),localStorage.setItem(ACCEPTED_COOKIES_KEY_STORAGE,JSON.stringify(cookies)),listeners$1.forEach(rr=>rr())}function subscribe$1(tr){return listeners$1.add(tr),()=>listeners$1.delete(tr)}const useAcceptedCookies=()=>[useSyncExternalStore(subscribe$1,getCookies,getCookies),setCookies];function gtag(...tr){var rr;(rr=window.dataLayer)==null||rr.push(...tr)}const Analytics=()=>{const tr=connectConfig.gaTrackingId,[{analytics:rr}]=useAcceptedCookies(),ir=tr&&rr;return useEffect(()=>{if(ir){const lr=document.createElement("script");return lr.src=`https://www.googletagmanager.com/gtag/js?id=${tr}`,lr.async=!0,document.head.appendChild(lr),window.dataLayer=window.dataLayer||[],gtag("js",new Date),gtag("config",tr),()=>{document.head.removeChild(lr)}}},[ir,tr]),null},SentryProvider=({children:tr})=>(useInitSentry(),tr);class DocumentEditorDebugTools{constructor(rr){ki(this,"document");ki(this,"operations",[]);rr&&(this.document=rr)}operationsToTableObject(rr){return rr.map(ir=>({...ir,input:JSON.stringify(ir.action.input)}))}setDocument(rr){this.document=rr}getDocument(){return this.document}getOperations(){return this.operations}pushOperation(rr){this.operations.push(rr)}operationsTable(){var ir;this.document||console.warn("No document");const rr=Object.values(((ir=this.document)==null?void 0:ir.operations)||{}).flatMap(lr=>lr).sort((lr,dr)=>lr.index-dr.index);console.table(this.operationsToTableObject(rr))}scopeOperationsTable(rr){var lr;this.document||console.warn("No document");const ir=((lr=this.document)==null?void 0:lr.operations[rr])||[];console.table(this.operationsToTableObject(ir))}operationsLog(){console.log(this.operations)}operationsLogTable(){console.table(this.operationsToTableObject(this.operations))}clear(){this.operations=[],this.document=void 0}}const SUPPORTED_STRATEGIES=["preserve-all","preserve-by-url-and-detach"],getDrivePreservationStrategy=()=>{const tr=window.__VITE_ENVS.PH_CONNECT_DRIVES_PRESERVE_STRATEGY;return tr&&(ir=>SUPPORTED_STRATEGIES.includes(ir))(tr)?tr:"preserve-by-url-and-detach"},createRemoveOldRemoteDrivesConfig=tr=>{if(tr.length===0)return{strategy:"preserve-all"};switch(getDrivePreservationStrategy()){case"preserve-all":return{strategy:"preserve-all"};case"preserve-by-url-and-detach":return{strategy:"preserve-by-url-and-detach",urls:tr};default:return{strategy:"preserve-by-url-and-detach",urls:tr}}},DEFAULT_DRIVES_URL=window.__VITE_ENVS.PH_CONNECT_DEFAULT_DRIVES_URL||void 0,defaultDrivesUrl=DEFAULT_DRIVES_URL?DEFAULT_DRIVES_URL.split(","):[],getReactorDefaultDrivesConfig=()=>({defaultDrives:{remoteDrives:defaultDrivesUrl.map(rr=>({url:rr,options:{sharingType:"PUBLIC",availableOffline:!0,listeners:[{block:!0,callInfo:{data:rr,name:"switchboard-push",transmitterType:"SwitchboardPush"},filter:{branch:["main"],documentId:["*"],documentType:["*"],scope:["global"]},label:"Switchboard Sync",listenerId:"1",system:!0}],triggers:[]}})),removeOldRemoteDrives:createRemoveOldRemoteDrivesConfig(defaultDrivesUrl)}});function createBrowserStorage(tr){return new BrowserStorage$1(tr)}function createBrowserDocumentDriveServer(tr,rr){return new ReactorBuilder(tr).withStorage(rr).withCache(new InMemoryCache).withQueueManager(new EventQueueManager).withOptions({...getReactorDefaultDrivesConfig()}).build()}const VERSION_CHECK_INTERVAL=parseInt(window.__VITE_ENVS.PH_CONNECT_VERSION_CHECK_INTERVAL)||3600*1e3,basePath=connectConfig.routerBasename,serviceWorkerScriptPath=[basePath,"service-worker.js"].join("/").replace(/\/{2,}/gm,"/");var cl,hf,Ic;class ServiceWorkerManager{constructor(rr=!1){Ri(this,cl);ki(this,"ready",!1);ki(this,"debug",!1);ki(this,"registration",null);this.debug=rr}setDebug(rr){this.debug=rr}registerServiceWorker(rr=!1){if(this.debug=rr,!("serviceWorker"in navigator)){console.warn("Service Worker not available");return}window.addEventListener("load",async()=>{try{const ir=await navigator.serviceWorker.getRegistration();if(ir)await ir.update(),Bi(this,cl,Ic).call(this,ir);else{const dr=await navigator.serviceWorker.register(serviceWorkerScriptPath);Bi(this,cl,Ic).call(this,dr),dr.addEventListener("updatefound",()=>{Bi(this,cl,Ic).call(this,dr)})}const lr=setInterval(async()=>{const dr=await navigator.serviceWorker.getRegistration();dr?await dr.update():(clearInterval(lr),this.registerServiceWorker())},VERSION_CHECK_INTERVAL)}catch(ir){console.error("ServiceWorker registration failed: ",ir)}})}}cl=new WeakSet,hf=function(rr){this.debug&&console.log("ServiceWorker message: ",rr);const ir="type"in rr.data?rr:null;switch(ir==null?void 0:ir.data.type){case"NEW_VERSION_AVAILABLE":{if(ir.data.version===connectConfig.appVersion)return;ir.data.requiresHardRefresh&&(this.debug&&console.log("New version available"),window.location.reload());break}default:{console.warn("Unhandled message:",ir);break}}},Ic=function(rr){this.debug&&console.log("ServiceWorker registered: ",rr),navigator.serviceWorker.addEventListener("message",Bi(this,cl,hf).bind(this)),this.registration=rr,this.ready=!0};const serviceWorkerManager=new ServiceWorkerManager,validateDocument=tr=>{const rr=[];if(tr.header.documentType!=="powerhouse/document-model")return rr;const ir=tr,lr=ir.state.global.specifications[0],dr=Object.keys(lr.state).reduce((mr,gr)=>{const yr=gr;return[...mr,...validateInitialState(lr.state[yr].initialValue,yr!=="global").map(_r=>({..._r,message:`${_r.message}. Scope: ${yr}`,details:{..._r.details,scope:yr}}))]},[]),fr=Object.keys(lr.state).reduce((mr,gr)=>{var br;const yr=gr,_r=yr==="global";return[...mr,...validateStateSchemaName(lr.state[yr].schema,ir.header.name||((br=ir.state.global)==null?void 0:br.name)||"",_r?"":yr,!_r).map(vr=>({...vr,message:`${vr.message}. Scope: ${yr}`,details:{...vr.details,scope:yr}}))]},[]),hr=validateModules(lr.modules);return[...dr,...fr,...hr]},logger$2=childLogger(["reactor-analytics"]);function createPgLiteFactoryWorker(tr){return async()=>{const rr=(await __vitePreload(async()=>{const{default:fr}=await import("./pglite-worker.BmajlV4J.js");return{default:fr}},[],import.meta.url)).default,{PGliteWorker:ir}=await __vitePreload(async()=>{const{PGliteWorker:fr}=await import("./index.CYF9Wn1v.js");return{PGliteWorker:fr}},[],import.meta.url),lr=new rr({name:"pglite-worker"});lr.onmessage=fr=>{logger$2.verbose(fr.data)},lr.onerror=fr=>{throw logger$2.error(fr.message),fr.error};const dr=new ir(lr,{meta:{databaseName:tr},extensions:{live:j}});return await dr.waitReady,dr}}async function registerExternalProcessors(tr,rr,ir,lr,dr){return await tr.registerFactory(lr,dr({analyticsStore:rr,relationalDb:ir}))}async function registerDiffAnalyzer(tr,rr){const{processorFactory:ir}=await __vitePreload(async()=>{const{processorFactory:dr}=await import("./index.JK7MVe59.js");return{processorFactory:dr}},[],import.meta.url),lr=dr=>ir({analyticsStore:rr})(dr.id);return await tr.registerFactory("@powerhousedao/diff-analyzer",lr)}async function registerDriveAnalytics(tr,rr){const{processorFactory:ir}=await __vitePreload(async()=>{const{processorFactory:lr}=await import("./index.CCqDl19I.js");return{processorFactory:lr}},[],import.meta.url);return await tr.registerFactory("@powerhousedao/common/drive-analytics",ir({analyticsStore:rr}))}function DiffAnalyzerProcessor(){const tr=useAnalyticsStoreAsync(),rr=useProcessorManager(),ir=useRef(!1);return useEffect(()=>{!tr.data||!rr||ir.current||(ir.current=!0,registerDiffAnalyzer(rr,tr.data).catch(logger$2.error))},[tr.data,rr]),null}function DriveAnalyticsProcessor(){const tr=useAnalyticsStoreAsync(),rr=useProcessorManager(),ir=useRef(!1);return useEffect(()=>{!tr.data||!rr||ir.current||(ir.current=!0,registerDriveAnalytics(rr,tr.data).then(()=>{logger$2.verbose("Drive analytics processor registered")}).catch(logger$2.error))},[tr.data,rr]),null}function ExternalProcessors(){const tr=useProcessors(),rr=useAnalyticsStoreAsync(),ir=useRelationalDb(),lr=useProcessorManager(),dr=useRef(!1);return useEffect(()=>{if(!(!rr.data||!lr||dr.current||tr.length===0||!ir.db)){dr.current=!0;for(const fr of tr)registerExternalProcessors(lr,rr.data,ir.db,generateId(),fr).catch(logger$2.error)}},[rr.data,lr,ir,tr]),null}function ProcessorManagerProvider({children:tr}){const rr=connectConfig.analytics.useWorker?createPgLiteFactoryWorker(connectConfig.analytics.databaseName):void 0,ir=useSetPGliteDB();return useEffect(()=>{if(!rr){ir({db:null,isLoading:!1,error:null});return}rr().then(lr=>{ir({db:lr,isLoading:!1,error:null})}).catch(lr=>{const dr=lr instanceof Error?lr:new Error(String(lr));ir({db:null,isLoading:!1,error:dr})})},[]),jsx$1(AnalyticsProvider,{options:{databaseName:connectConfig.analytics.databaseName,pgLiteFactory:rr},children:jsxs(Fragment,{children:[connectConfig.analytics.diffProcessorEnabled&&jsx$1(DiffAnalyzerProcessor,{}),connectConfig.analytics.driveAnalyticsEnabled&&jsx$1(DriveAnalyticsProcessor,{}),connectConfig.analytics.externalProcessorsEnabled&&jsx$1(ExternalProcessors,{}),tr]})})}/**
821
+ `);super(mr,ir.cause?{cause:ir.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:`ox@${getVersion$2()}`}),this.cause=ir.cause,this.details=lr,this.docs=hr,this.docsPath=dr,this.shortMessage=rr}walk(rr){return walk(this,rr)}};function walk(tr,rr){return rr!=null&&rr(tr)?tr:tr&&typeof tr=="object"&&"cause"in tr&&tr.cause?walk(tr.cause,rr):rr?null:tr}function pad(tr,rr={}){const{dir:ir,size:lr=32}=rr;if(lr===0)return tr;const dr=tr.replace("0x","");if(dr.length>lr*2)throw new SizeExceedsPaddingSizeError({size:Math.ceil(dr.length/2),targetSize:lr,type:"Hex"});return`0x${dr[ir==="right"?"padEnd":"padStart"](lr*2,"0")}`}function fromNumber(tr,rr={}){const{signed:ir,size:lr}=rr,dr=BigInt(tr);let fr;lr?ir?fr=(1n<<BigInt(lr)*8n-1n)-1n:fr=2n**(BigInt(lr)*8n)-1n:typeof tr=="number"&&(fr=BigInt(Number.MAX_SAFE_INTEGER));const hr=typeof fr=="bigint"&&ir?-fr-1n:0;if(fr&&dr>fr||dr<hr){const yr=typeof tr=="bigint"?"n":"";throw new IntegerOutOfRangeError({max:fr?`${fr}${yr}`:void 0,min:`${hr}${yr}`,signed:ir,size:lr,value:`${tr}${yr}`})}const gr=`0x${(ir&&dr<0?(1n<<BigInt(lr*8))+BigInt(dr):dr).toString(16)}`;return lr?padLeft(gr,lr):gr}function padLeft(tr,rr){return pad(tr,{dir:"left",size:rr})}class IntegerOutOfRangeError extends BaseError$2{constructor({max:rr,min:ir,signed:lr,size:dr,value:fr}){super(`Number \`${fr}\` is not in safe${dr?` ${dr*8}-bit`:""}${lr?" signed":" unsigned"} integer range ${rr?`(\`${ir}\` to \`${rr}\`)`:`(above \`${ir}\`)`}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.IntegerOutOfRangeError"})}}class SizeExceedsPaddingSizeError extends BaseError$2{constructor({size:rr,targetSize:ir,type:lr}){super(`${lr.charAt(0).toUpperCase()}${lr.slice(1).toLowerCase()} size (\`${rr}\`) exceeds padding size (\`${ir}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SizeExceedsPaddingSizeError"})}}function toRpc$1(tr){return{address:tr.address,amount:fromNumber(tr.amount),index:fromNumber(tr.index),validatorIndex:fromNumber(tr.validatorIndex)}}function toRpc(tr){return{...typeof tr.baseFeePerGas=="bigint"&&{baseFeePerGas:fromNumber(tr.baseFeePerGas)},...typeof tr.blobBaseFee=="bigint"&&{blobBaseFee:fromNumber(tr.blobBaseFee)},...typeof tr.feeRecipient=="string"&&{feeRecipient:tr.feeRecipient},...typeof tr.gasLimit=="bigint"&&{gasLimit:fromNumber(tr.gasLimit)},...typeof tr.number=="bigint"&&{number:fromNumber(tr.number)},...typeof tr.prevRandao=="bigint"&&{prevRandao:fromNumber(tr.prevRandao)},...typeof tr.time=="bigint"&&{time:fromNumber(tr.time)},...tr.withdrawals&&{withdrawals:tr.withdrawals.map(toRpc$1)}}}const aggregate3Signature="0x82ad56cb",deploylessCallViaBytecodeBytecode="0x608060405234801561001057600080fd5b5060405161018e38038061018e83398101604081905261002f91610124565b6000808351602085016000f59050803b61004857600080fd5b6000808351602085016000855af16040513d6000823e81610067573d81fd5b3d81f35b634e487b7160e01b600052604160045260246000fd5b600082601f83011261009257600080fd5b81516001600160401b038111156100ab576100ab61006b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156100d9576100d961006b565b6040528181528382016020018510156100f157600080fd5b60005b82811015610110576020818601810151838301820152016100f4565b506000918101602001919091529392505050565b6000806040838503121561013757600080fd5b82516001600160401b0381111561014d57600080fd5b61015985828601610081565b602085015190935090506001600160401b0381111561017757600080fd5b61018385828601610081565b915050925092905056fe",deploylessCallViaFactoryBytecode="0x608060405234801561001057600080fd5b506040516102c03803806102c083398101604081905261002f916101e6565b836001600160a01b03163b6000036100e457600080836001600160a01b03168360405161005c9190610270565b6000604051808303816000865af19150503d8060008114610099576040519150601f19603f3d011682016040523d82523d6000602084013e61009e565b606091505b50915091508115806100b857506001600160a01b0386163b155b156100e1578060405163101bb98d60e01b81526004016100d8919061028c565b60405180910390fd5b50505b6000808451602086016000885af16040513d6000823e81610103573d81fd5b3d81f35b80516001600160a01b038116811461011e57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561015457818101518382015260200161013c565b50506000910152565b600082601f83011261016e57600080fd5b81516001600160401b0381111561018757610187610123565b604051601f8201601f19908116603f011681016001600160401b03811182821017156101b5576101b5610123565b6040528181528382016020018510156101cd57600080fd5b6101de826020830160208701610139565b949350505050565b600080600080608085870312156101fc57600080fd5b61020585610107565b60208601519094506001600160401b0381111561022157600080fd5b61022d8782880161015d565b93505061023c60408601610107565b60608601519092506001600160401b0381111561025857600080fd5b6102648782880161015d565b91505092959194509250565b60008251610282818460208701610139565b9190910192915050565b60208152600082518060208401526102ab816040850160208701610139565b601f01601f1916919091016040019291505056fe";function getCallError(tr,{docsPath:rr,...ir}){const lr=(()=>{const dr=getNodeError(tr,ir);return dr instanceof UnknownNodeError?tr:dr})();return new CallExecutionError(lr,{docsPath:rr,...ir})}function withResolvers(){let tr=()=>{},rr=()=>{};return{promise:new Promise((lr,dr)=>{tr=lr,rr=dr}),resolve:tr,reject:rr}}const schedulerCache=new Map;function createBatchScheduler({fn:tr,id:rr,shouldSplitBatch:ir,wait:lr=0,sort:dr}){const fr=async()=>{const _r=gr();hr();const br=_r.map(({args:vr})=>vr);br.length!==0&&tr(br).then(vr=>{dr&&Array.isArray(vr)&&vr.sort(dr);for(let wr=0;wr<_r.length;wr++){const{resolve:xr}=_r[wr];xr==null||xr([vr[wr],vr])}}).catch(vr=>{for(let wr=0;wr<_r.length;wr++){const{reject:xr}=_r[wr];xr==null||xr(vr)}})},hr=()=>schedulerCache.delete(rr),mr=()=>gr().map(({args:_r})=>_r),gr=()=>schedulerCache.get(rr)||[],yr=_r=>schedulerCache.set(rr,[...gr(),_r]);return{flush:hr,async schedule(_r){const{promise:br,resolve:vr,reject:wr}=withResolvers();return(ir==null?void 0:ir([...mr(),_r]))&&fr(),gr().length>0?(yr({args:_r,resolve:vr,reject:wr}),br):(yr({args:_r,resolve:vr,reject:wr}),setTimeout(fr,lr),br)}}}async function call(tr,rr){var Xn,Lr,Gr,Hn;const{account:ir=tr.account,authorizationList:lr,batch:dr=!!((Xn=tr.batch)!=null&&Xn.multicall),blockNumber:fr,blockTag:hr=tr.experimental_blockTag??"latest",accessList:mr,blobs:gr,blockOverrides:yr,code:_r,data:br,factory:vr,factoryData:wr,gas:xr,gasPrice:Sr,maxFeePerBlobGas:Ar,maxFeePerGas:Ir,maxPriorityFeePerGas:Mr,nonce:Or,to:$r,value:Dr,stateOverride:zr,...Fr}=rr,Jr=ir?parseAccount(ir):void 0;if(_r&&(vr||wr))throw new BaseError$4("Cannot provide both `code` & `factory`/`factoryData` as parameters.");if(_r&&$r)throw new BaseError$4("Cannot provide both `code` & `to` as parameters.");const $n=_r&&br,Qr=vr&&wr&&$r&&br,Zn=$n||Qr,qn=$n?toDeploylessCallViaBytecodeData({code:_r,data:br}):Qr?toDeploylessCallViaFactoryData({data:br,factory:vr,factoryData:wr,to:$r}):br;try{assertRequest(rr);const oi=(typeof fr=="bigint"?numberToHex(fr):void 0)||hr,ri=yr?toRpc(yr):void 0,ti=serializeStateOverride(zr),si=(Hn=(Gr=(Lr=tr.chain)==null?void 0:Lr.formatters)==null?void 0:Gr.transactionRequest)==null?void 0:Hn.format,ni=(si||formatTransactionRequest)({...extract(Fr,{format:si}),from:Jr==null?void 0:Jr.address,accessList:mr,authorizationList:lr,blobs:gr,data:qn,gas:xr,gasPrice:Sr,maxFeePerBlobGas:Ar,maxFeePerGas:Ir,maxPriorityFeePerGas:Mr,nonce:Or,to:Zn?void 0:$r,value:Dr});if(dr&&shouldPerformMulticall({request:ni})&&!ti&&!ri)try{return await scheduleMulticall(tr,{...ni,blockNumber:fr,blockTag:hr})}catch(ai){if(!(ai instanceof ClientChainNotConfiguredError)&&!(ai instanceof ChainDoesNotSupportContract))throw ai}const Yn=(()=>{const ai=[ni,oi];return ti&&ri?[...ai,ti,ri]:ti?[...ai,ti]:ri?[...ai,{},ri]:ai})(),ei=await tr.request({method:"eth_call",params:Yn});return ei==="0x"?{data:void 0}:{data:ei}}catch(ii){const oi=getRevertErrorData(ii),{offchainLookup:ri,offchainLookupSignature:ti}=await __vitePreload(async()=>{const{offchainLookup:si,offchainLookupSignature:Jn}=await import("./ccip.DqmhJKD0.js");return{offchainLookup:si,offchainLookupSignature:Jn}},[],import.meta.url);if(tr.ccipRead!==!1&&(oi==null?void 0:oi.slice(0,10))===ti&&$r)return{data:await ri(tr,{data:oi,to:$r})};throw Zn&&(oi==null?void 0:oi.slice(0,10))==="0x101bb98d"?new CounterfactualDeploymentFailedError({factory:vr}):getCallError(ii,{...rr,account:Jr,chain:tr.chain})}}function shouldPerformMulticall({request:tr}){const{data:rr,to:ir,...lr}=tr;return!(!rr||rr.startsWith(aggregate3Signature)||!ir||Object.values(lr).filter(dr=>typeof dr<"u").length>0)}async function scheduleMulticall(tr,rr){var Sr;const{batchSize:ir=1024,wait:lr=0}=typeof((Sr=tr.batch)==null?void 0:Sr.multicall)=="object"?tr.batch.multicall:{},{blockNumber:dr,blockTag:fr=tr.experimental_blockTag??"latest",data:hr,multicallAddress:mr,to:gr}=rr;let yr=mr;if(!yr){if(!tr.chain)throw new ClientChainNotConfiguredError;yr=getChainContractAddress({blockNumber:dr,chain:tr.chain,contract:"multicall3"})}const br=(typeof dr=="bigint"?numberToHex(dr):void 0)||fr,{schedule:vr}=createBatchScheduler({id:`${tr.uid}.${br}`,wait:lr,shouldSplitBatch(Ar){return Ar.reduce((Mr,{data:Or})=>Mr+(Or.length-2),0)>ir*2},fn:async Ar=>{const Ir=Ar.map($r=>({allowFailure:!0,callData:$r.data,target:$r.to})),Mr=encodeFunctionData({abi:multicall3Abi,args:[Ir],functionName:"aggregate3"}),Or=await tr.request({method:"eth_call",params:[{data:Mr,to:yr},br]});return decodeFunctionResult({abi:multicall3Abi,args:[Ir],functionName:"aggregate3",data:Or||"0x"})}}),[{returnData:wr,success:xr}]=await vr({data:hr,to:gr});if(!xr)throw new RawContractError({data:wr});return wr==="0x"?{data:void 0}:{data:wr}}function toDeploylessCallViaBytecodeData(tr){const{code:rr,data:ir}=tr;return encodeDeployData({abi:parseAbi(["constructor(bytes, bytes)"]),bytecode:deploylessCallViaBytecodeBytecode,args:[rr,ir]})}function toDeploylessCallViaFactoryData(tr){const{data:rr,factory:ir,factoryData:lr,to:dr}=tr;return encodeDeployData({abi:parseAbi(["constructor(address, bytes, address, bytes)"]),bytecode:deploylessCallViaFactoryBytecode,args:[dr,rr,ir,lr]})}function getRevertErrorData(tr){var ir;if(!(tr instanceof BaseError$4))return;const rr=tr.walk();return typeof(rr==null?void 0:rr.data)=="object"?(ir=rr.data)==null?void 0:ir.data:rr.data}async function readContract(tr,rr){const{abi:ir,address:lr,args:dr,functionName:fr,...hr}=rr,mr=encodeFunctionData({abi:ir,args:dr,functionName:fr});try{const{data:gr}=await getAction$1(tr,call,"call")({...hr,data:mr,to:lr});return decodeFunctionResult({abi:ir,args:dr,functionName:fr,data:gr||"0x"})}catch(gr){throw getContractError(gr,{abi:ir,address:lr,args:dr,docsPath:"/docs/contract/readContract",functionName:fr})}}class EnsAvatarInvalidMetadataError extends BaseError$4{constructor({data:rr}){super("Unable to extract image from metadata. The metadata may be malformed or invalid.",{metaMessages:["- Metadata must be a JSON object with at least an `image`, `image_url` or `image_data` property.","",`Provided data: ${JSON.stringify(rr)}`],name:"EnsAvatarInvalidMetadataError"})}}class EnsAvatarInvalidNftUriError extends BaseError$4{constructor({reason:rr}){super(`ENS NFT avatar URI is invalid. ${rr}`,{name:"EnsAvatarInvalidNftUriError"})}}class EnsAvatarUriResolutionError extends BaseError$4{constructor({uri:rr}){super(`Unable to resolve ENS avatar URI "${rr}". The URI may be malformed, invalid, or does not respond with a valid image.`,{name:"EnsAvatarUriResolutionError"})}}class EnsAvatarUnsupportedNamespaceError extends BaseError$4{constructor({namespace:rr}){super(`ENS NFT avatar namespace "${rr}" is not supported. Must be "erc721" or "erc1155".`,{name:"EnsAvatarUnsupportedNamespaceError"})}}const networkRegex=/(?<protocol>https?:\/\/[^\/]*|ipfs:\/|ipns:\/|ar:\/)?(?<root>\/)?(?<subpath>ipfs\/|ipns\/)?(?<target>[\w\-.]+)(?<subtarget>\/.*)?/,ipfsHashRegex=/^(Qm[1-9A-HJ-NP-Za-km-z]{44,}|b[A-Za-z2-7]{58,}|B[A-Z2-7]{58,}|z[1-9A-HJ-NP-Za-km-z]{48,}|F[0-9A-F]{50,})(\/(?<target>[\w\-.]+))?(?<subtarget>\/.*)?$/,base64Regex=/^data:([a-zA-Z\-/+]*);base64,([^"].*)/,dataURIRegex=/^data:([a-zA-Z\-/+]*)?(;[a-zA-Z0-9].*?)?(,)/;async function isImageUri(tr){try{const rr=await fetch(tr,{method:"HEAD"});if(rr.status===200){const ir=rr.headers.get("content-type");return ir==null?void 0:ir.startsWith("image/")}return!1}catch(rr){return typeof rr=="object"&&typeof rr.response<"u"||!globalThis.hasOwnProperty("Image")?!1:new Promise(ir=>{const lr=new Image;lr.onload=()=>{ir(!0)},lr.onerror=()=>{ir(!1)},lr.src=tr})}}function getGateway(tr,rr){return tr?tr.endsWith("/")?tr.slice(0,-1):tr:rr}function resolveAvatarUri({uri:tr,gatewayUrls:rr}){const ir=base64Regex.test(tr);if(ir)return{uri:tr,isOnChain:!0,isEncoded:ir};const lr=getGateway(rr==null?void 0:rr.ipfs,"https://ipfs.io"),dr=getGateway(rr==null?void 0:rr.arweave,"https://arweave.net"),fr=tr.match(networkRegex),{protocol:hr,subpath:mr,target:gr,subtarget:yr=""}=(fr==null?void 0:fr.groups)||{},_r=hr==="ipns:/"||mr==="ipns/",br=hr==="ipfs:/"||mr==="ipfs/"||ipfsHashRegex.test(tr);if(tr.startsWith("http")&&!_r&&!br){let wr=tr;return rr!=null&&rr.arweave&&(wr=tr.replace(/https:\/\/arweave.net/g,rr==null?void 0:rr.arweave)),{uri:wr,isOnChain:!1,isEncoded:!1}}if((_r||br)&&gr)return{uri:`${lr}/${_r?"ipns":"ipfs"}/${gr}${yr}`,isOnChain:!1,isEncoded:!1};if(hr==="ar:/"&&gr)return{uri:`${dr}/${gr}${yr||""}`,isOnChain:!1,isEncoded:!1};let vr=tr.replace(dataURIRegex,"");if(vr.startsWith("<svg")&&(vr=`data:image/svg+xml;base64,${btoa(vr)}`),vr.startsWith("data:")||vr.startsWith("{"))return{uri:vr,isOnChain:!0,isEncoded:!1};throw new EnsAvatarUriResolutionError({uri:tr})}function getJsonImage(tr){if(typeof tr!="object"||!("image"in tr)&&!("image_url"in tr)&&!("image_data"in tr))throw new EnsAvatarInvalidMetadataError({data:tr});return tr.image||tr.image_url||tr.image_data}async function getMetadataAvatarUri({gatewayUrls:tr,uri:rr}){try{const ir=await fetch(rr).then(dr=>dr.json());return await parseAvatarUri({gatewayUrls:tr,uri:getJsonImage(ir)})}catch{throw new EnsAvatarUriResolutionError({uri:rr})}}async function parseAvatarUri({gatewayUrls:tr,uri:rr}){const{uri:ir,isOnChain:lr}=resolveAvatarUri({uri:rr,gatewayUrls:tr});if(lr||await isImageUri(ir))return ir;throw new EnsAvatarUriResolutionError({uri:rr})}function parseNftUri(tr){let rr=tr;rr.startsWith("did:nft:")&&(rr=rr.replace("did:nft:","").replace(/_/g,"/"));const[ir,lr,dr]=rr.split("/"),[fr,hr]=ir.split(":"),[mr,gr]=lr.split(":");if(!fr||fr.toLowerCase()!=="eip155")throw new EnsAvatarInvalidNftUriError({reason:"Only EIP-155 supported"});if(!hr)throw new EnsAvatarInvalidNftUriError({reason:"Chain ID not found"});if(!gr)throw new EnsAvatarInvalidNftUriError({reason:"Contract address not found"});if(!dr)throw new EnsAvatarInvalidNftUriError({reason:"Token ID not found"});if(!mr)throw new EnsAvatarInvalidNftUriError({reason:"ERC namespace not found"});return{chainID:Number.parseInt(hr),namespace:mr.toLowerCase(),contractAddress:gr,tokenID:dr}}async function getNftTokenUri(tr,{nft:rr}){if(rr.namespace==="erc721")return readContract(tr,{address:rr.contractAddress,abi:[{name:"tokenURI",type:"function",stateMutability:"view",inputs:[{name:"tokenId",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"tokenURI",args:[BigInt(rr.tokenID)]});if(rr.namespace==="erc1155")return readContract(tr,{address:rr.contractAddress,abi:[{name:"uri",type:"function",stateMutability:"view",inputs:[{name:"_id",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"uri",args:[BigInt(rr.tokenID)]});throw new EnsAvatarUnsupportedNamespaceError({namespace:rr.namespace})}async function parseAvatarRecord(tr,{gatewayUrls:rr,record:ir}){return/eip155:/i.test(ir)?parseNftAvatarUri(tr,{gatewayUrls:rr,record:ir}):parseAvatarUri({uri:ir,gatewayUrls:rr})}async function parseNftAvatarUri(tr,{gatewayUrls:rr,record:ir}){const lr=parseNftUri(ir),dr=await getNftTokenUri(tr,{nft:lr}),{uri:fr,isOnChain:hr,isEncoded:mr}=resolveAvatarUri({uri:dr,gatewayUrls:rr});if(hr&&(fr.includes("data:application/json;base64,")||fr.startsWith("{"))){const yr=mr?atob(fr.replace("data:application/json;base64,","")):fr,_r=JSON.parse(yr);return parseAvatarUri({uri:getJsonImage(_r),gatewayUrls:rr})}let gr=lr.tokenID;return lr.namespace==="erc1155"&&(gr=gr.replace("0x","").padStart(64,"0")),getMetadataAvatarUri({gatewayUrls:rr,uri:fr.replace(/(?:0x)?{id}/,gr)})}async function getEnsText(tr,rr){const{blockNumber:ir,blockTag:lr,key:dr,name:fr,gatewayUrls:hr,strict:mr}=rr,{chain:gr}=tr,yr=(()=>{if(rr.universalResolverAddress)return rr.universalResolverAddress;if(!gr)throw new Error("client chain not configured. universalResolverAddress is required.");return getChainContractAddress({blockNumber:ir,chain:gr,contract:"ensUniversalResolver"})})(),_r=gr==null?void 0:gr.ensTlds;if(_r&&!_r.some(br=>fr.endsWith(br)))return null;try{const br={address:yr,abi:universalResolverResolveAbi,functionName:"resolve",args:[toHex(packetToBytes(fr)),encodeFunctionData({abi:textResolverAbi,functionName:"text",args:[namehash(fr),dr]}),hr??[localBatchGatewayUrl]],blockNumber:ir,blockTag:lr},wr=await getAction$1(tr,readContract,"readContract")(br);if(wr[0]==="0x")return null;const xr=decodeFunctionResult({abi:textResolverAbi,functionName:"text",data:wr[0]});return xr===""?null:xr}catch(br){if(mr)throw br;if(isNullUniversalResolverError(br,"resolve"))return null;throw br}}async function getEnsAvatar$1(tr,{blockNumber:rr,blockTag:ir,assetGatewayUrls:lr,name:dr,gatewayUrls:fr,strict:hr,universalResolverAddress:mr}){const gr=await getAction$1(tr,getEnsText,"getEnsText")({blockNumber:rr,blockTag:ir,key:"avatar",name:dr,universalResolverAddress:mr,gatewayUrls:fr,strict:hr});if(!gr)return null;try{return await parseAvatarRecord(tr,{record:gr,gatewayUrls:lr})}catch{return null}}async function getEnsName$1(tr,{address:rr,blockNumber:ir,blockTag:lr,gatewayUrls:dr,strict:fr,universalResolverAddress:hr}){let mr=hr;if(!mr){if(!tr.chain)throw new Error("client chain not configured. universalResolverAddress is required.");mr=getChainContractAddress({blockNumber:ir,chain:tr.chain,contract:"ensUniversalResolver"})}const gr=`${rr.toLowerCase().substring(2)}.addr.reverse`;try{const yr={address:mr,abi:universalResolverReverseAbi,functionName:"reverse",args:[toHex(packetToBytes(gr))],blockNumber:ir,blockTag:lr},_r=getAction$1(tr,readContract,"readContract"),[br,vr]=dr?await _r({...yr,args:[...yr.args,dr]}):await _r(yr);return rr.toLowerCase()!==vr.toLowerCase()?null:br}catch(yr){if(fr)throw yr;if(isNullUniversalResolverError(yr,"reverse"))return null;throw yr}}const promiseCache=new LruMap(8192);function withDedupe(tr,{enabled:rr=!0,id:ir}){if(!rr||!ir)return tr();if(promiseCache.get(ir))return promiseCache.get(ir);const lr=tr().finally(()=>promiseCache.delete(ir));return promiseCache.set(ir,lr),lr}async function wait(tr){return new Promise(rr=>setTimeout(rr,tr))}function withRetry(tr,{delay:rr=100,retryCount:ir=2,shouldRetry:lr=()=>!0}={}){return new Promise((dr,fr)=>{const hr=async({count:mr=0}={})=>{const gr=async({error:yr})=>{const _r=typeof rr=="function"?rr({count:mr,error:yr}):rr;_r&&await wait(_r),hr({count:mr+1})};try{const yr=await tr();dr(yr)}catch(yr){if(mr<ir&&await lr({count:mr,error:yr}))return gr({error:yr});fr(yr)}};hr()})}function buildRequest(tr,rr={}){return async(ir,lr={})=>{var br;const{dedupe:dr=!1,methods:fr,retryDelay:hr=150,retryCount:mr=3,uid:gr}={...rr,...lr},{method:yr}=ir;if((br=fr==null?void 0:fr.exclude)!=null&&br.includes(yr))throw new MethodNotSupportedRpcError(new Error("method not supported"),{method:yr});if(fr!=null&&fr.include&&!fr.include.includes(yr))throw new MethodNotSupportedRpcError(new Error("method not supported"),{method:yr});const _r=dr?stringToHex(`${gr}.${stringify(ir)}`):void 0;return withDedupe(()=>withRetry(async()=>{try{return await tr(ir)}catch(vr){const wr=vr;switch(wr.code){case ParseRpcError.code:throw new ParseRpcError(wr);case InvalidRequestRpcError.code:throw new InvalidRequestRpcError(wr);case MethodNotFoundRpcError.code:throw new MethodNotFoundRpcError(wr,{method:ir.method});case InvalidParamsRpcError.code:throw new InvalidParamsRpcError(wr);case InternalRpcError.code:throw new InternalRpcError(wr);case InvalidInputRpcError.code:throw new InvalidInputRpcError(wr);case ResourceNotFoundRpcError.code:throw new ResourceNotFoundRpcError(wr);case ResourceUnavailableRpcError.code:throw new ResourceUnavailableRpcError(wr);case TransactionRejectedRpcError.code:throw new TransactionRejectedRpcError(wr);case MethodNotSupportedRpcError.code:throw new MethodNotSupportedRpcError(wr,{method:ir.method});case LimitExceededRpcError.code:throw new LimitExceededRpcError(wr);case JsonRpcVersionUnsupportedError.code:throw new JsonRpcVersionUnsupportedError(wr);case UserRejectedRequestError.code:throw new UserRejectedRequestError(wr);case UnauthorizedProviderError.code:throw new UnauthorizedProviderError(wr);case UnsupportedProviderMethodError.code:throw new UnsupportedProviderMethodError(wr);case ProviderDisconnectedError.code:throw new ProviderDisconnectedError(wr);case ChainDisconnectedError.code:throw new ChainDisconnectedError(wr);case SwitchChainError.code:throw new SwitchChainError(wr);case UnsupportedNonOptionalCapabilityError.code:throw new UnsupportedNonOptionalCapabilityError(wr);case UnsupportedChainIdError.code:throw new UnsupportedChainIdError(wr);case DuplicateIdError.code:throw new DuplicateIdError(wr);case UnknownBundleIdError.code:throw new UnknownBundleIdError(wr);case BundleTooLargeError.code:throw new BundleTooLargeError(wr);case AtomicReadyWalletRejectedUpgradeError.code:throw new AtomicReadyWalletRejectedUpgradeError(wr);case AtomicityNotSupportedError.code:throw new AtomicityNotSupportedError(wr);case 5e3:throw new UserRejectedRequestError(wr);default:throw vr instanceof BaseError$4?vr:new UnknownRpcError(wr)}}},{delay:({count:vr,error:wr})=>{var xr;if(wr&&wr instanceof HttpRequestError){const Sr=(xr=wr==null?void 0:wr.headers)==null?void 0:xr.get("Retry-After");if(Sr!=null&&Sr.match(/\d/))return Number.parseInt(Sr)*1e3}return~~(1<<vr)*hr},retryCount:mr,shouldRetry:({error:vr})=>shouldRetry(vr)}),{enabled:dr,id:_r})}}function shouldRetry(tr){return"code"in tr&&typeof tr.code=="number"?tr.code===-1||tr.code===LimitExceededRpcError.code||tr.code===InternalRpcError.code:tr instanceof HttpRequestError&&tr.status?tr.status===403||tr.status===408||tr.status===413||tr.status===429||tr.status===500||tr.status===502||tr.status===503||tr.status===504:!0}function defineChain(tr){return{formatters:void 0,fees:void 0,serializers:void 0,...tr}}function withTimeout(tr,{errorInstance:rr=new Error("timed out"),timeout:ir,signal:lr}){return new Promise((dr,fr)=>{(async()=>{let hr;try{const mr=new AbortController;ir>0&&(hr=setTimeout(()=>{lr?mr.abort():fr(rr)},ir)),dr(await tr({signal:(mr==null?void 0:mr.signal)||null}))}catch(mr){(mr==null?void 0:mr.name)==="AbortError"&&fr(rr),fr(mr)}finally{clearTimeout(hr)}})()})}function createIdStore(){return{current:0,take(){return this.current++},reset(){this.current=0}}}const idCache=createIdStore();function getHttpRpcClient(tr,rr={}){return{async request(ir){var br;const{body:lr,onRequest:dr=rr.onRequest,onResponse:fr=rr.onResponse,timeout:hr=rr.timeout??1e4}=ir,mr={...rr.fetchOptions??{},...ir.fetchOptions??{}},{headers:gr,method:yr,signal:_r}=mr;try{const vr=await withTimeout(async({signal:xr})=>{const Sr={...mr,body:Array.isArray(lr)?stringify(lr.map(Or=>({jsonrpc:"2.0",id:Or.id??idCache.take(),...Or}))):stringify({jsonrpc:"2.0",id:lr.id??idCache.take(),...lr}),headers:{"Content-Type":"application/json",...gr},method:yr||"POST",signal:_r||(hr>0?xr:null)},Ar=new Request(tr,Sr),Ir=await(dr==null?void 0:dr(Ar,Sr))??{...Sr,url:tr};return await fetch(Ir.url??tr,Ir)},{errorInstance:new TimeoutError({body:lr,url:tr}),timeout:hr,signal:!0});fr&&await fr(vr);let wr;if((br=vr.headers.get("Content-Type"))!=null&&br.startsWith("application/json"))wr=await vr.json();else{wr=await vr.text();try{wr=JSON.parse(wr||"{}")}catch(xr){if(vr.ok)throw xr;wr={error:wr}}}if(!vr.ok)throw new HttpRequestError({body:lr,details:stringify(wr.error)||vr.statusText,headers:vr.headers,status:vr.status,url:tr});return wr}catch(vr){throw vr instanceof HttpRequestError||vr instanceof TimeoutError?vr:new HttpRequestError({body:lr,cause:vr,url:tr})}}}}function getAction(tr,rr,ir){const lr=tr[rr.name];if(typeof lr=="function")return lr;const dr=tr[ir];return typeof dr=="function"?dr:fr=>rr(tr,fr)}const version$3="2.19.0",getVersion$1=()=>`@wagmi/core@${version$3}`;var __classPrivateFieldGet=function(tr,rr,ir,lr){if(ir==="a"&&!lr)throw new TypeError("Private accessor was defined without a getter");if(typeof rr=="function"?tr!==rr||!lr:!rr.has(tr))throw new TypeError("Cannot read private member from an object whose class did not declare it");return ir==="m"?lr:ir==="a"?lr.call(tr):lr?lr.value:rr.get(tr)},_BaseError_instances,_BaseError_walk;let BaseError$1=class Td extends Error{get docsBaseUrl(){return"https://wagmi.sh/core"}get version(){return getVersion$1()}constructor(rr,ir={}){var fr;super(),_BaseError_instances.add(this),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"WagmiCoreError"});const lr=ir.cause instanceof Td?ir.cause.details:(fr=ir.cause)!=null&&fr.message?ir.cause.message:ir.details,dr=ir.cause instanceof Td&&ir.cause.docsPath||ir.docsPath;this.message=[rr||"An error occurred.","",...ir.metaMessages?[...ir.metaMessages,""]:[],...dr?[`Docs: ${this.docsBaseUrl}${dr}.html${ir.docsSlug?`#${ir.docsSlug}`:""}`]:[],...lr?[`Details: ${lr}`]:[],`Version: ${this.version}`].join(`
822
+ `),ir.cause&&(this.cause=ir.cause),this.details=lr,this.docsPath=dr,this.metaMessages=ir.metaMessages,this.shortMessage=rr}walk(rr){return __classPrivateFieldGet(this,_BaseError_instances,"m",_BaseError_walk).call(this,this,rr)}};_BaseError_instances=new WeakSet,_BaseError_walk=function tr(rr,ir){return ir!=null&&ir(rr)?rr:rr.cause?__classPrivateFieldGet(this,_BaseError_instances,"m",tr).call(this,rr.cause,ir):rr};class ChainNotConfiguredError extends BaseError$1{constructor(){super("Chain not configured."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ChainNotConfiguredError"})}}const size$1=256;let index$1=size$1,buffer$1;function uid$1(tr=11){if(!buffer$1||index$1+tr>size$1*2){buffer$1="",index$1=0;for(let rr=0;rr<size$1;rr++)buffer$1+=(256+Math.random()*256|0).toString(16).substring(1)}return buffer$1.substring(index$1,index$1+++tr)}function createClient(tr){const{batch:rr,chain:ir,ccipRead:lr,key:dr="base",name:fr="Base Client",type:hr="base"}=tr,mr=tr.experimental_blockTag??(typeof(ir==null?void 0:ir.experimental_preconfirmationTime)=="number"?"pending":void 0),gr=(ir==null?void 0:ir.blockTime)??12e3,yr=Math.min(Math.max(Math.floor(gr/2),500),4e3),_r=tr.pollingInterval??yr,br=tr.cacheTime??_r,vr=tr.account?parseAccount(tr.account):void 0,{config:wr,request:xr,value:Sr}=tr.transport({chain:ir,pollingInterval:_r}),Ar={...wr,...Sr},Ir={account:vr,batch:rr,cacheTime:br,ccipRead:lr,chain:ir,key:dr,name:fr,pollingInterval:_r,request:xr,transport:Ar,type:hr,uid:uid$1(),...mr?{experimental_blockTag:mr}:{}};function Mr(Or){return $r=>{const Dr=$r(Or);for(const Fr in Ir)delete Dr[Fr];const zr={...Or,...Dr};return Object.assign(zr,{extend:Mr(zr)})}}return Object.assign(Ir,{extend:Mr(Ir)})}function createTransport({key:tr,methods:rr,name:ir,request:lr,retryCount:dr=3,retryDelay:fr=150,timeout:hr,type:mr},gr){const yr=uid$1();return{config:{key:tr,methods:rr,name:ir,request:lr,retryCount:dr,retryDelay:fr,timeout:hr,type:mr},request:buildRequest(lr,{methods:rr,retryCount:dr,retryDelay:fr,uid:yr}),value:gr}}class UrlRequiredError extends BaseError$4{constructor(){super("No URL was provided to the Transport. Please provide a valid RPC URL to the Transport.",{docsPath:"/docs/clients/intro",name:"UrlRequiredError"})}}function http(tr,rr={}){const{batch:ir,fetchOptions:lr,key:dr="http",methods:fr,name:hr="HTTP JSON-RPC",onFetchRequest:mr,onFetchResponse:gr,retryDelay:yr,raw:_r}=rr;return({chain:br,retryCount:vr,timeout:wr})=>{const{batchSize:xr=1e3,wait:Sr=0}=typeof ir=="object"?ir:{},Ar=rr.retryCount??vr,Ir=wr??rr.timeout??1e4,Mr=br==null?void 0:br.rpcUrls.default.http[0];if(!Mr)throw new UrlRequiredError;const Or=getHttpRpcClient(Mr,{fetchOptions:lr,onRequest:mr,onResponse:gr,timeout:Ir});return createTransport({key:dr,methods:fr,name:hr,async request({method:$r,params:Dr}){const zr={method:$r,params:Dr},{schedule:Fr}=createBatchScheduler({id:Mr,wait:Sr,shouldSplitBatch(Zn){return Zn.length>xr},fn:Zn=>Or.request({body:Zn}),sort:(Zn,qn)=>Zn.id-qn.id}),Jr=async Zn=>ir?Fr(Zn):[await Or.request({body:Zn})],[{error:$n,result:Qr}]=await Jr(zr);if(_r)return{error:$n,result:Qr};if($n)throw new RpcRequestError({body:zr,error:$n,url:Mr});return Qr},retryCount:Ar,retryDelay:yr,timeout:Ir,type:"http"},{fetchOptions:lr,url:Mr})}}function getChainId(tr){return tr.state.chainId}function getEnsAvatar(tr,rr){const{chainId:ir,...lr}=rr,dr=tr.getClient({chainId:ir});return getAction(dr,getEnsAvatar$1,"getEnsAvatar")(lr)}function getEnsName(tr,rr){const{chainId:ir,...lr}=rr,dr=tr.getClient({chainId:ir});return getAction(dr,getEnsName$1,"getEnsName")(lr)}let isReconnecting=!1;async function reconnect(tr,rr={}){var yr,_r;if(isReconnecting)return[];isReconnecting=!0,tr.setState(br=>({...br,status:br.current?"reconnecting":"connecting"}));const ir=[];if((yr=rr.connectors)!=null&&yr.length)for(const br of rr.connectors){let vr;typeof br=="function"?vr=tr._internal.connectors.setup(br):vr=br,ir.push(vr)}else ir.push(...tr.connectors);let lr;try{lr=await((_r=tr.storage)==null?void 0:_r.getItem("recentConnectorId"))}catch{}const dr={};for(const[,br]of tr.state.connections)dr[br.connector.id]=1;lr&&(dr[lr]=0);const fr=Object.keys(dr).length>0?[...ir].sort((br,vr)=>(dr[br.id]??10)-(dr[vr.id]??10)):ir;let hr=!1;const mr=[],gr=[];for(const br of fr){const vr=await br.getProvider().catch(()=>{});if(!vr||gr.some(Sr=>Sr===vr)||!await br.isAuthorized())continue;const xr=await br.connect({isReconnecting:!0}).catch(()=>null);xr&&(br.emitter.off("connect",tr._internal.events.connect),br.emitter.on("change",tr._internal.events.change),br.emitter.on("disconnect",tr._internal.events.disconnect),tr.setState(Sr=>{const Ar=new Map(hr?Sr.connections:new Map).set(br.uid,{accounts:xr.accounts,chainId:xr.chainId,connector:br});return{...Sr,current:hr?Sr.current:br.uid,connections:Ar}}),mr.push({accounts:xr.accounts,chainId:xr.chainId,connector:br}),gr.push(vr),hr=!0)}return(tr.state.status==="reconnecting"||tr.state.status==="connecting")&&(hr?tr.setState(br=>({...br,status:"connected"})):tr.setState(br=>({...br,connections:new Map,current:null,status:"disconnected"}))),isReconnecting=!1,mr}class ProviderNotFoundError extends BaseError$1{constructor(){super("Provider not found."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ProviderNotFoundError"})}}function watchChainId(tr,rr){const{onChange:ir}=rr;return tr.subscribe(lr=>lr.chainId,ir)}function createConnector(tr){return tr}injected.type="injected";function injected(tr={}){const{shimDisconnect:rr=!0,unstable_shimAsyncInject:ir}=tr;function lr(){const gr=tr.target;if(typeof gr=="function"){const yr=gr();if(yr)return yr}return typeof gr=="object"?gr:typeof gr=="string"?{...targetMap[gr]??{id:gr,name:`${gr[0].toUpperCase()}${gr.slice(1)}`,provider:`is${gr[0].toUpperCase()}${gr.slice(1)}`}}:{id:"injected",name:"Injected",provider(yr){return yr==null?void 0:yr.ethereum}}}let dr,fr,hr,mr;return gr=>({get icon(){return lr().icon},get id(){return lr().id},get name(){return lr().name},get supportsSimulation(){return!0},type:injected.type,async setup(){const yr=await this.getProvider();yr!=null&&yr.on&&tr.target&&(hr||(hr=this.onConnect.bind(this),yr.on("connect",hr)),dr||(dr=this.onAccountsChanged.bind(this),yr.on("accountsChanged",dr)))},async connect({chainId:yr,isReconnecting:_r}={}){var wr,xr,Sr,Ar,Ir,Mr;const br=await this.getProvider();if(!br)throw new ProviderNotFoundError;let vr=[];if(_r)vr=await this.getAccounts().catch(()=>[]);else if(rr)try{vr=(Ar=(Sr=(xr=(wr=(await br.request({method:"wallet_requestPermissions",params:[{eth_accounts:{}}]}))[0])==null?void 0:wr.caveats)==null?void 0:xr[0])==null?void 0:Sr.value)==null?void 0:Ar.map($r=>getAddress($r)),vr.length>0&&(vr=await this.getAccounts())}catch(Or){const $r=Or;if($r.code===UserRejectedRequestError.code)throw new UserRejectedRequestError($r);if($r.code===ResourceUnavailableRpcError.code)throw $r}try{!(vr!=null&&vr.length)&&!_r&&(vr=(await br.request({method:"eth_requestAccounts"})).map(Dr=>getAddress(Dr))),hr&&(br.removeListener("connect",hr),hr=void 0),dr||(dr=this.onAccountsChanged.bind(this),br.on("accountsChanged",dr)),fr||(fr=this.onChainChanged.bind(this),br.on("chainChanged",fr)),mr||(mr=this.onDisconnect.bind(this),br.on("disconnect",mr));let Or=await this.getChainId();if(yr&&Or!==yr){const $r=await this.switchChain({chainId:yr}).catch(Dr=>{if(Dr.code===UserRejectedRequestError.code)throw Dr;return{id:Or}});Or=($r==null?void 0:$r.id)??Or}return rr&&await((Ir=gr.storage)==null?void 0:Ir.removeItem(`${this.id}.disconnected`)),tr.target||await((Mr=gr.storage)==null?void 0:Mr.setItem("injected.connected",!0)),{accounts:vr,chainId:Or}}catch(Or){const $r=Or;throw $r.code===UserRejectedRequestError.code?new UserRejectedRequestError($r):$r.code===ResourceUnavailableRpcError.code?new ResourceUnavailableRpcError($r):$r}},async disconnect(){var _r,br;const yr=await this.getProvider();if(!yr)throw new ProviderNotFoundError;fr&&(yr.removeListener("chainChanged",fr),fr=void 0),mr&&(yr.removeListener("disconnect",mr),mr=void 0),hr||(hr=this.onConnect.bind(this),yr.on("connect",hr));try{await withTimeout(()=>yr.request({method:"wallet_revokePermissions",params:[{eth_accounts:{}}]}),{timeout:100})}catch{}rr&&await((_r=gr.storage)==null?void 0:_r.setItem(`${this.id}.disconnected`,!0)),tr.target||await((br=gr.storage)==null?void 0:br.removeItem("injected.connected"))},async getAccounts(){const yr=await this.getProvider();if(!yr)throw new ProviderNotFoundError;return(await yr.request({method:"eth_accounts"})).map(br=>getAddress(br))},async getChainId(){const yr=await this.getProvider();if(!yr)throw new ProviderNotFoundError;const _r=await yr.request({method:"eth_chainId"});return Number(_r)},async getProvider(){if(typeof window>"u")return;let yr;const _r=lr();return typeof _r.provider=="function"?yr=_r.provider(window):typeof _r.provider=="string"?yr=findProvider(window,_r.provider):yr=_r.provider,yr&&!yr.removeListener&&("off"in yr&&typeof yr.off=="function"?yr.removeListener=yr.off:yr.removeListener=()=>{}),yr},async isAuthorized(){var yr,_r;try{if(rr&&await((yr=gr.storage)==null?void 0:yr.getItem(`${this.id}.disconnected`))||!tr.target&&!await((_r=gr.storage)==null?void 0:_r.getItem("injected.connected")))return!1;if(!await this.getProvider()){if(ir!==void 0&&ir!==!1){const xr=async()=>(typeof window<"u"&&window.removeEventListener("ethereum#initialized",xr),!!await this.getProvider()),Sr=typeof ir=="number"?ir:1e3;if(await Promise.race([...typeof window<"u"?[new Promise(Ir=>window.addEventListener("ethereum#initialized",()=>Ir(xr()),{once:!0}))]:[],new Promise(Ir=>setTimeout(()=>Ir(xr()),Sr))]))return!0}throw new ProviderNotFoundError}return!!(await withRetry(()=>this.getAccounts())).length}catch{return!1}},async switchChain({addEthereumChainParameter:yr,chainId:_r}){var xr,Sr,Ar,Ir;const br=await this.getProvider();if(!br)throw new ProviderNotFoundError;const vr=gr.chains.find(Mr=>Mr.id===_r);if(!vr)throw new SwitchChainError(new ChainNotConfiguredError);const wr=new Promise(Mr=>{const Or=($r=>{"chainId"in $r&&$r.chainId===_r&&(gr.emitter.off("change",Or),Mr())});gr.emitter.on("change",Or)});try{return await Promise.all([br.request({method:"wallet_switchEthereumChain",params:[{chainId:numberToHex(_r)}]}).then(async()=>{await this.getChainId()===_r&&gr.emitter.emit("change",{chainId:_r})}),wr]),vr}catch(Mr){const Or=Mr;if(Or.code===4902||((Sr=(xr=Or==null?void 0:Or.data)==null?void 0:xr.originalError)==null?void 0:Sr.code)===4902)try{const{default:$r,...Dr}=vr.blockExplorers??{};let zr;yr!=null&&yr.blockExplorerUrls?zr=yr.blockExplorerUrls:$r&&(zr=[$r.url,...Object.values(Dr).map($n=>$n.url)]);let Fr;(Ar=yr==null?void 0:yr.rpcUrls)!=null&&Ar.length?Fr=yr.rpcUrls:Fr=[((Ir=vr.rpcUrls.default)==null?void 0:Ir.http[0])??""];const Jr={blockExplorerUrls:zr,chainId:numberToHex(_r),chainName:(yr==null?void 0:yr.chainName)??vr.name,iconUrls:yr==null?void 0:yr.iconUrls,nativeCurrency:(yr==null?void 0:yr.nativeCurrency)??vr.nativeCurrency,rpcUrls:Fr};return await Promise.all([br.request({method:"wallet_addEthereumChain",params:[Jr]}).then(async()=>{if(await this.getChainId()===_r)gr.emitter.emit("change",{chainId:_r});else throw new UserRejectedRequestError(new Error("User rejected switch after adding network."))}),wr]),vr}catch($r){throw new UserRejectedRequestError($r)}throw Or.code===UserRejectedRequestError.code?new UserRejectedRequestError(Or):new SwitchChainError(Or)}},async onAccountsChanged(yr){var _r;if(yr.length===0)this.onDisconnect();else if(gr.emitter.listenerCount("connect")){const br=(await this.getChainId()).toString();this.onConnect({chainId:br}),rr&&await((_r=gr.storage)==null?void 0:_r.removeItem(`${this.id}.disconnected`))}else gr.emitter.emit("change",{accounts:yr.map(br=>getAddress(br))})},onChainChanged(yr){const _r=Number(yr);gr.emitter.emit("change",{chainId:_r})},async onConnect(yr){const _r=await this.getAccounts();if(_r.length===0)return;const br=Number(yr.chainId);gr.emitter.emit("connect",{accounts:_r,chainId:br});const vr=await this.getProvider();vr&&(hr&&(vr.removeListener("connect",hr),hr=void 0),dr||(dr=this.onAccountsChanged.bind(this),vr.on("accountsChanged",dr)),fr||(fr=this.onChainChanged.bind(this),vr.on("chainChanged",fr)),mr||(mr=this.onDisconnect.bind(this),vr.on("disconnect",mr)))},async onDisconnect(yr){const _r=await this.getProvider();yr&&yr.code===1013&&_r&&(await this.getAccounts()).length||(gr.emitter.emit("disconnect"),_r&&(fr&&(_r.removeListener("chainChanged",fr),fr=void 0),mr&&(_r.removeListener("disconnect",mr),mr=void 0),hr||(hr=this.onConnect.bind(this),_r.on("connect",hr))))}})}const targetMap={coinbaseWallet:{id:"coinbaseWallet",name:"Coinbase Wallet",provider(tr){return tr!=null&&tr.coinbaseWalletExtension?tr.coinbaseWalletExtension:findProvider(tr,"isCoinbaseWallet")}},metaMask:{id:"metaMask",name:"MetaMask",provider(tr){return findProvider(tr,rr=>{if(!rr.isMetaMask||rr.isBraveWallet&&!rr._events&&!rr._state)return!1;const ir=["isApexWallet","isAvalanche","isBitKeep","isBlockWallet","isKuCoinWallet","isMathWallet","isOkxWallet","isOKExWallet","isOneInchIOSWallet","isOneInchAndroidWallet","isOpera","isPhantom","isPortal","isRabby","isTokenPocket","isTokenary","isUniswapWallet","isZerion"];for(const lr of ir)if(rr[lr])return!1;return!0})}},phantom:{id:"phantom",name:"Phantom",provider(tr){var rr,ir;return(rr=tr==null?void 0:tr.phantom)!=null&&rr.ethereum?(ir=tr.phantom)==null?void 0:ir.ethereum:findProvider(tr,"isPhantom")}}};function findProvider(tr,rr){function ir(dr){return typeof rr=="function"?rr(dr):typeof rr=="string"?dr[rr]:!0}const lr=tr.ethereum;if(lr!=null&&lr.providers)return lr.providers.find(dr=>ir(dr));if(lr&&ir(lr))return lr}function requestProviders(tr){if(typeof window>"u")return;const rr=ir=>tr(ir.detail);return window.addEventListener("eip6963:announceProvider",rr),window.dispatchEvent(new CustomEvent("eip6963:requestProvider")),()=>window.removeEventListener("eip6963:announceProvider",rr)}function createStore$1(){const tr=new Set;let rr=[];const ir=()=>requestProviders(dr=>{rr.some(({info:fr})=>fr.uuid===dr.info.uuid)||(rr=[...rr,dr],tr.forEach(fr=>fr(rr,{added:[dr]})))});let lr=ir();return{_listeners(){return tr},clear(){tr.forEach(dr=>dr([],{removed:[...rr]})),rr=[]},destroy(){this.clear(),tr.clear(),lr==null||lr()},findProvider({rdns:dr}){return rr.find(fr=>fr.info.rdns===dr)},getProviders(){return rr},reset(){this.clear(),lr==null||lr(),lr=ir()},subscribe(dr,{emitImmediately:fr}={}){return tr.add(dr),fr&&dr(rr,{added:rr}),()=>tr.delete(dr)}}}const subscribeWithSelectorImpl=tr=>(rr,ir,lr)=>{const dr=lr.subscribe;return lr.subscribe=(hr,mr,gr)=>{let yr=hr;if(mr){const _r=(gr==null?void 0:gr.equalityFn)||Object.is;let br=hr(lr.getState());yr=vr=>{const wr=hr(vr);if(!_r(br,wr)){const xr=br;mr(br=wr,xr)}},gr!=null&&gr.fireImmediately&&mr(br,br)}return dr(yr)},tr(rr,ir,lr)},subscribeWithSelector=subscribeWithSelectorImpl;function createJSONStorage(tr,rr){let ir;try{ir=tr()}catch{return}return{getItem:dr=>{var fr;const hr=gr=>gr===null?null:JSON.parse(gr,void 0),mr=(fr=ir.getItem(dr))!=null?fr:null;return mr instanceof Promise?mr.then(hr):hr(mr)},setItem:(dr,fr)=>ir.setItem(dr,JSON.stringify(fr,void 0)),removeItem:dr=>ir.removeItem(dr)}}const toThenable=tr=>rr=>{try{const ir=tr(rr);return ir instanceof Promise?ir:{then(lr){return toThenable(lr)(ir)},catch(lr){return this}}}catch(ir){return{then(lr){return this},catch(lr){return toThenable(lr)(ir)}}}},persistImpl=(tr,rr)=>(ir,lr,dr)=>{let fr={storage:createJSONStorage(()=>localStorage),partialize:Sr=>Sr,version:0,merge:(Sr,Ar)=>({...Ar,...Sr}),...rr},hr=!1;const mr=new Set,gr=new Set;let yr=fr.storage;if(!yr)return tr((...Sr)=>{console.warn(`[zustand persist middleware] Unable to update item '${fr.name}', the given storage is currently unavailable.`),ir(...Sr)},lr,dr);const _r=()=>{const Sr=fr.partialize({...lr()});return yr.setItem(fr.name,{state:Sr,version:fr.version})},br=dr.setState;dr.setState=(Sr,Ar)=>{br(Sr,Ar),_r()};const vr=tr((...Sr)=>{ir(...Sr),_r()},lr,dr);dr.getInitialState=()=>vr;let wr;const xr=()=>{var Sr,Ar;if(!yr)return;hr=!1,mr.forEach(Mr=>{var Or;return Mr((Or=lr())!=null?Or:vr)});const Ir=((Ar=fr.onRehydrateStorage)==null?void 0:Ar.call(fr,(Sr=lr())!=null?Sr:vr))||void 0;return toThenable(yr.getItem.bind(yr))(fr.name).then(Mr=>{if(Mr)if(typeof Mr.version=="number"&&Mr.version!==fr.version){if(fr.migrate)return[!0,fr.migrate(Mr.state,Mr.version)];console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,Mr.state];return[!1,void 0]}).then(Mr=>{var Or;const[$r,Dr]=Mr;if(wr=fr.merge(Dr,(Or=lr())!=null?Or:vr),ir(wr,!0),$r)return _r()}).then(()=>{Ir==null||Ir(wr,void 0),wr=lr(),hr=!0,gr.forEach(Mr=>Mr(wr))}).catch(Mr=>{Ir==null||Ir(void 0,Mr)})};return dr.persist={setOptions:Sr=>{fr={...fr,...Sr},Sr.storage&&(yr=Sr.storage)},clearStorage:()=>{yr==null||yr.removeItem(fr.name)},getOptions:()=>fr,rehydrate:()=>xr(),hasHydrated:()=>hr,onHydrate:Sr=>(mr.add(Sr),()=>{mr.delete(Sr)}),onFinishHydration:Sr=>(gr.add(Sr),()=>{gr.delete(Sr)})},fr.skipHydration||xr(),wr||vr},persist=persistImpl,createStoreImpl=tr=>{let rr;const ir=new Set,lr=(yr,_r)=>{const br=typeof yr=="function"?yr(rr):yr;if(!Object.is(br,rr)){const vr=rr;rr=_r??(typeof br!="object"||br===null)?br:Object.assign({},rr,br),ir.forEach(wr=>wr(rr,vr))}},dr=()=>rr,mr={setState:lr,getState:dr,getInitialState:()=>gr,subscribe:yr=>(ir.add(yr),()=>ir.delete(yr))},gr=rr=tr(lr,dr,mr);return mr},createStore=tr=>tr?createStoreImpl(tr):createStoreImpl;var eventemitter3={exports:{}},hasRequiredEventemitter3;function requireEventemitter3(){return hasRequiredEventemitter3||(hasRequiredEventemitter3=1,(function(tr){var rr=Object.prototype.hasOwnProperty,ir="~";function lr(){}Object.create&&(lr.prototype=Object.create(null),new lr().__proto__||(ir=!1));function dr(gr,yr,_r){this.fn=gr,this.context=yr,this.once=_r||!1}function fr(gr,yr,_r,br,vr){if(typeof _r!="function")throw new TypeError("The listener must be a function");var wr=new dr(_r,br||gr,vr),xr=ir?ir+yr:yr;return gr._events[xr]?gr._events[xr].fn?gr._events[xr]=[gr._events[xr],wr]:gr._events[xr].push(wr):(gr._events[xr]=wr,gr._eventsCount++),gr}function hr(gr,yr){--gr._eventsCount===0?gr._events=new lr:delete gr._events[yr]}function mr(){this._events=new lr,this._eventsCount=0}mr.prototype.eventNames=function(){var yr=[],_r,br;if(this._eventsCount===0)return yr;for(br in _r=this._events)rr.call(_r,br)&&yr.push(ir?br.slice(1):br);return Object.getOwnPropertySymbols?yr.concat(Object.getOwnPropertySymbols(_r)):yr},mr.prototype.listeners=function(yr){var _r=ir?ir+yr:yr,br=this._events[_r];if(!br)return[];if(br.fn)return[br.fn];for(var vr=0,wr=br.length,xr=new Array(wr);vr<wr;vr++)xr[vr]=br[vr].fn;return xr},mr.prototype.listenerCount=function(yr){var _r=ir?ir+yr:yr,br=this._events[_r];return br?br.fn?1:br.length:0},mr.prototype.emit=function(yr,_r,br,vr,wr,xr){var Sr=ir?ir+yr:yr;if(!this._events[Sr])return!1;var Ar=this._events[Sr],Ir=arguments.length,Mr,Or;if(Ar.fn){switch(Ar.once&&this.removeListener(yr,Ar.fn,void 0,!0),Ir){case 1:return Ar.fn.call(Ar.context),!0;case 2:return Ar.fn.call(Ar.context,_r),!0;case 3:return Ar.fn.call(Ar.context,_r,br),!0;case 4:return Ar.fn.call(Ar.context,_r,br,vr),!0;case 5:return Ar.fn.call(Ar.context,_r,br,vr,wr),!0;case 6:return Ar.fn.call(Ar.context,_r,br,vr,wr,xr),!0}for(Or=1,Mr=new Array(Ir-1);Or<Ir;Or++)Mr[Or-1]=arguments[Or];Ar.fn.apply(Ar.context,Mr)}else{var $r=Ar.length,Dr;for(Or=0;Or<$r;Or++)switch(Ar[Or].once&&this.removeListener(yr,Ar[Or].fn,void 0,!0),Ir){case 1:Ar[Or].fn.call(Ar[Or].context);break;case 2:Ar[Or].fn.call(Ar[Or].context,_r);break;case 3:Ar[Or].fn.call(Ar[Or].context,_r,br);break;case 4:Ar[Or].fn.call(Ar[Or].context,_r,br,vr);break;default:if(!Mr)for(Dr=1,Mr=new Array(Ir-1);Dr<Ir;Dr++)Mr[Dr-1]=arguments[Dr];Ar[Or].fn.apply(Ar[Or].context,Mr)}}return!0},mr.prototype.on=function(yr,_r,br){return fr(this,yr,_r,br,!1)},mr.prototype.once=function(yr,_r,br){return fr(this,yr,_r,br,!0)},mr.prototype.removeListener=function(yr,_r,br,vr){var wr=ir?ir+yr:yr;if(!this._events[wr])return this;if(!_r)return hr(this,wr),this;var xr=this._events[wr];if(xr.fn)xr.fn===_r&&(!vr||xr.once)&&(!br||xr.context===br)&&hr(this,wr);else{for(var Sr=0,Ar=[],Ir=xr.length;Sr<Ir;Sr++)(xr[Sr].fn!==_r||vr&&!xr[Sr].once||br&&xr[Sr].context!==br)&&Ar.push(xr[Sr]);Ar.length?this._events[wr]=Ar.length===1?Ar[0]:Ar:hr(this,wr)}return this},mr.prototype.removeAllListeners=function(yr){var _r;return yr?(_r=ir?ir+yr:yr,this._events[_r]&&hr(this,_r)):(this._events=new lr,this._eventsCount=0),this},mr.prototype.off=mr.prototype.removeListener,mr.prototype.addListener=mr.prototype.on,mr.prefixed=ir,mr.EventEmitter=mr,tr.exports=mr})(eventemitter3)),eventemitter3.exports}var eventemitter3Exports=requireEventemitter3();const EventEmitter$1=getDefaultExportFromCjs(eventemitter3Exports);class Emitter{constructor(rr){Object.defineProperty(this,"uid",{enumerable:!0,configurable:!0,writable:!0,value:rr}),Object.defineProperty(this,"_emitter",{enumerable:!0,configurable:!0,writable:!0,value:new EventEmitter$1})}on(rr,ir){this._emitter.on(rr,ir)}once(rr,ir){this._emitter.once(rr,ir)}off(rr,ir){this._emitter.off(rr,ir)}emit(rr,...ir){const lr=ir[0];this._emitter.emit(rr,{uid:this.uid,...lr})}listenerCount(rr){return this._emitter.listenerCount(rr)}}function createEmitter(tr){return new Emitter(tr)}function deserialize(tr,rr){return JSON.parse(tr,(ir,lr)=>{let dr=lr;return(dr==null?void 0:dr.__type)==="bigint"&&(dr=BigInt(dr.value)),(dr==null?void 0:dr.__type)==="Map"&&(dr=new Map(dr.value)),(rr==null?void 0:rr(ir,dr))??dr})}function getReferenceKey(tr,rr){return tr.slice(0,rr).join(".")||"."}function getCutoff(tr,rr){const{length:ir}=tr;for(let lr=0;lr<ir;++lr)if(tr[lr]===rr)return lr+1;return 0}function createReplacer(tr,rr){const ir=typeof tr=="function",lr=typeof rr=="function",dr=[],fr=[];return function(mr,gr){if(typeof gr=="object")if(dr.length){const yr=getCutoff(dr,this);yr===0?dr[dr.length]=this:(dr.splice(yr),fr.splice(yr)),fr[fr.length]=mr;const _r=getCutoff(dr,gr);if(_r!==0)return lr?rr.call(this,mr,gr,getReferenceKey(fr,_r)):`[ref=${getReferenceKey(fr,_r)}]`}else dr[0]=gr,fr[0]=mr;return ir?tr.call(this,mr,gr):gr}}function serialize(tr,rr,ir,lr){return JSON.stringify(tr,createReplacer((dr,fr)=>{let hr=fr;return typeof hr=="bigint"&&(hr={__type:"bigint",value:fr.toString()}),hr instanceof Map&&(hr={__type:"Map",value:Array.from(fr.entries())}),(rr==null?void 0:rr(dr,hr))??hr},lr),ir??void 0)}function createStorage(tr){const{deserialize:rr=deserialize,key:ir="wagmi",serialize:lr=serialize,storage:dr=noopStorage}=tr;function fr(hr){return hr instanceof Promise?hr.then(mr=>mr).catch(()=>null):hr}return{...dr,key:ir,async getItem(hr,mr){const gr=dr.getItem(`${ir}.${hr}`),yr=await fr(gr);return yr?rr(yr)??null:mr??null},async setItem(hr,mr){const gr=`${ir}.${hr}`;mr===null?await fr(dr.removeItem(gr)):await fr(dr.setItem(gr,lr(mr)))},async removeItem(hr){await fr(dr.removeItem(`${ir}.${hr}`))}}}const noopStorage={getItem:()=>null,setItem:()=>{},removeItem:()=>{}};function getDefaultStorage(){const tr=typeof window<"u"&&window.localStorage?window.localStorage:noopStorage;return{getItem(rr){return tr.getItem(rr)},removeItem(rr){tr.removeItem(rr)},setItem(rr,ir){try{tr.setItem(rr,ir)}catch{}}}}const size=256;let index=size,buffer;function uid(tr=11){if(!buffer||index+tr>size*2){buffer="",index=0;for(let rr=0;rr<size;rr++)buffer+=(256+Math.random()*256|0).toString(16).substring(1)}return buffer.substring(index,index+++tr)}function createConfig(tr){const{multiInjectedProviderDiscovery:rr=!0,storage:ir=createStorage({storage:getDefaultStorage()}),syncConnectedChain:lr=!0,ssr:dr=!1,...fr}=tr,hr=typeof window<"u"&&rr?createStore$1():void 0,mr=createStore(()=>fr.chains),gr=createStore(()=>{const Dr=[],zr=new Set;for(const Fr of fr.connectors??[]){const Jr=yr(Fr);if(Dr.push(Jr),!dr&&Jr.rdns){const $n=typeof Jr.rdns=="string"?[Jr.rdns]:Jr.rdns;for(const Qr of $n)zr.add(Qr)}}if(!dr&&hr){const Fr=hr.getProviders();for(const Jr of Fr)zr.has(Jr.info.rdns)||Dr.push(yr(_r(Jr)))}return Dr});function yr(Dr){var Jr;const zr=createEmitter(uid()),Fr={...Dr({emitter:zr,chains:mr.getState(),storage:ir,transports:fr.transports}),emitter:zr,uid:zr.uid};return zr.on("connect",Or),(Jr=Fr.setup)==null||Jr.call(Fr),Fr}function _r(Dr){const{info:zr}=Dr,Fr=Dr.provider;return injected({target:{...zr,id:zr.rdns,provider:Fr}})}const br=new Map;function vr(Dr={}){const zr=Dr.chainId??Ar.getState().chainId,Fr=mr.getState().find($n=>$n.id===zr);if(Dr.chainId&&!Fr)throw new ChainNotConfiguredError;{const $n=br.get(Ar.getState().chainId);if($n&&!Fr)return $n;if(!Fr)throw new ChainNotConfiguredError}{const $n=br.get(zr);if($n)return $n}let Jr;if(fr.client)Jr=fr.client({chain:Fr});else{const $n=Fr.id,Qr=mr.getState().map(Xn=>Xn.id),Zn={},qn=Object.entries(fr);for(const[Xn,Lr]of qn)if(!(Xn==="chains"||Xn==="client"||Xn==="connectors"||Xn==="transports"))if(typeof Lr=="object")if($n in Lr)Zn[Xn]=Lr[$n];else{if(Qr.some(Hn=>Hn in Lr))continue;Zn[Xn]=Lr}else Zn[Xn]=Lr;Jr=createClient({...Zn,chain:Fr,batch:Zn.batch??{multicall:!0},transport:Xn=>fr.transports[$n]({...Xn,connectors:gr})})}return br.set(zr,Jr),Jr}function wr(){return{chainId:mr.getState()[0].id,connections:new Map,current:null,status:"disconnected"}}let xr;const Sr="0.0.0-canary-";version$3.startsWith(Sr)?xr=Number.parseInt(version$3.replace(Sr,"")):xr=Number.parseInt(version$3.split(".")[0]??"0");const Ar=createStore(subscribeWithSelector(ir?persist(wr,{migrate(Dr,zr){if(zr===xr)return Dr;const Fr=wr(),Jr=Ir(Dr,Fr.chainId);return{...Fr,chainId:Jr}},name:"store",partialize(Dr){return{connections:{__type:"Map",value:Array.from(Dr.connections.entries()).map(([zr,Fr])=>{const{id:Jr,name:$n,type:Qr,uid:Zn}=Fr.connector;return[zr,{...Fr,connector:{id:Jr,name:$n,type:Qr,uid:Zn}}]})},chainId:Dr.chainId,current:Dr.current}},merge(Dr,zr){typeof Dr=="object"&&Dr&&"status"in Dr&&delete Dr.status;const Fr=Ir(Dr,zr.chainId);return{...zr,...Dr,chainId:Fr}},skipHydration:dr,storage:ir,version:xr}):wr));Ar.setState(wr());function Ir(Dr,zr){return Dr&&typeof Dr=="object"&&"chainId"in Dr&&typeof Dr.chainId=="number"&&mr.getState().some(Fr=>Fr.id===Dr.chainId)?Dr.chainId:zr}lr&&Ar.subscribe(({connections:Dr,current:zr})=>{var Fr;return zr?(Fr=Dr.get(zr))==null?void 0:Fr.chainId:void 0},Dr=>{if(mr.getState().some(Fr=>Fr.id===Dr))return Ar.setState(Fr=>({...Fr,chainId:Dr??Fr.chainId}))}),hr==null||hr.subscribe(Dr=>{const zr=new Set,Fr=new Set;for(const $n of gr.getState())if(zr.add($n.id),$n.rdns){const Qr=typeof $n.rdns=="string"?[$n.rdns]:$n.rdns;for(const Zn of Qr)Fr.add(Zn)}const Jr=[];for(const $n of Dr){if(Fr.has($n.info.rdns))continue;const Qr=yr(_r($n));zr.has(Qr.id)||Jr.push(Qr)}ir&&!Ar.persist.hasHydrated()||gr.setState($n=>[...$n,...Jr],!0)});function Mr(Dr){Ar.setState(zr=>{const Fr=zr.connections.get(Dr.uid);return Fr?{...zr,connections:new Map(zr.connections).set(Dr.uid,{accounts:Dr.accounts??Fr.accounts,chainId:Dr.chainId??Fr.chainId,connector:Fr.connector})}:zr})}function Or(Dr){Ar.getState().status==="connecting"||Ar.getState().status==="reconnecting"||Ar.setState(zr=>{const Fr=gr.getState().find(Jr=>Jr.uid===Dr.uid);return Fr?(Fr.emitter.listenerCount("connect")&&Fr.emitter.off("connect",Mr),Fr.emitter.listenerCount("change")||Fr.emitter.on("change",Mr),Fr.emitter.listenerCount("disconnect")||Fr.emitter.on("disconnect",$r),{...zr,connections:new Map(zr.connections).set(Dr.uid,{accounts:Dr.accounts,chainId:Dr.chainId,connector:Fr}),current:Dr.uid,status:"connected"}):zr})}function $r(Dr){Ar.setState(zr=>{const Fr=zr.connections.get(Dr.uid);if(Fr){const $n=Fr.connector;$n.emitter.listenerCount("change")&&Fr.connector.emitter.off("change",Mr),$n.emitter.listenerCount("disconnect")&&Fr.connector.emitter.off("disconnect",$r),$n.emitter.listenerCount("connect")||Fr.connector.emitter.on("connect",Or)}if(zr.connections.delete(Dr.uid),zr.connections.size===0)return{...zr,connections:new Map,current:null,status:"disconnected"};const Jr=zr.connections.values().next().value;return{...zr,connections:new Map(zr.connections),current:Jr.connector.uid}})}return{get chains(){return mr.getState()},get connectors(){return gr.getState()},storage:ir,getClient:vr,get state(){return Ar.getState()},setState(Dr){let zr;typeof Dr=="function"?zr=Dr(Ar.getState()):zr=Dr;const Fr=wr();typeof zr!="object"&&(zr=Fr),Object.keys(Fr).some($n=>!($n in zr))&&(zr=Fr),Ar.setState(zr,!0)},subscribe(Dr,zr,Fr){return Ar.subscribe(Dr,zr,Fr?{...Fr,fireImmediately:Fr.emitImmediately}:void 0)},_internal:{mipd:hr,store:Ar,ssr:!!dr,syncConnectedChain:lr,transports:fr.transports,chains:{setState(Dr){const zr=typeof Dr=="function"?Dr(mr.getState()):Dr;if(zr.length!==0)return mr.setState(zr,!0)},subscribe(Dr){return mr.subscribe(Dr)}},connectors:{providerDetailToConnector:_r,setup:yr,setState(Dr){return gr.setState(typeof Dr=="function"?Dr(gr.getState()):Dr,!0)},subscribe(Dr){return gr.subscribe(Dr)}},events:{change:Mr,connect:Or,disconnect:$r}}}}function hydrate(tr,rr){const{initialState:ir,reconnectOnMount:lr}=rr;return ir&&!tr._internal.store.persist.hasHydrated()&&tr.setState({...ir,chainId:tr.chains.some(dr=>dr.id===ir.chainId)?ir.chainId:tr.chains[0].id,connections:lr?ir.connections:new Map,status:lr?"reconnecting":"disconnected"}),{async onMount(){tr._internal.ssr&&(await tr._internal.store.persist.rehydrate(),tr._internal.mipd&&tr._internal.connectors.setState(dr=>{var gr;const fr=new Set;for(const yr of dr??[])if(yr.rdns){const _r=Array.isArray(yr.rdns)?yr.rdns:[yr.rdns];for(const br of _r)fr.add(br)}const hr=[],mr=((gr=tr._internal.mipd)==null?void 0:gr.getProviders())??[];for(const yr of mr){if(fr.has(yr.info.rdns))continue;const _r=tr._internal.connectors.providerDetailToConnector(yr),br=tr._internal.connectors.setup(_r);hr.push(br)}return[...dr,...hr]})),lr?reconnect(tr):tr.storage&&tr.setState(dr=>({...dr,connections:new Map}))}}}function Hydrate(tr){const{children:rr,config:ir,initialState:lr,reconnectOnMount:dr=!0}=tr,{onMount:fr}=hydrate(ir,{initialState:lr,reconnectOnMount:dr});ir._internal.ssr||fr();const hr=useRef(!0);return useEffect(()=>{if(hr.current&&ir._internal.ssr)return fr(),()=>{hr.current=!1}},[]),rr}const WagmiContext$1=createContext(void 0);function WagmiProvider(tr){const{children:rr,config:ir}=tr,lr={value:ir};return createElement(Hydrate,tr,createElement(WagmiContext$1.Provider,lr,rr))}const version$2="2.16.4",getVersion=()=>`wagmi@${version$2}`;class BaseError extends BaseError$1{constructor(){super(...arguments),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"WagmiError"})}get docsBaseUrl(){return"https://wagmi.sh/react"}get version(){return getVersion()}}class WagmiProviderNotFoundError extends BaseError{constructor(){super("`useConfig` must be used within `WagmiProvider`.",{docsPath:"/api/WagmiProvider"}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"WagmiProviderNotFoundError"})}}function useConfig(tr={}){const rr=tr.config??useContext(WagmiContext$1);if(!rr)throw new WagmiProviderNotFoundError;return rr}function hashFn(tr){return JSON.stringify(tr,(rr,ir)=>isPlainObject$1(ir)?Object.keys(ir).sort().reduce((lr,dr)=>(lr[dr]=ir[dr],lr),{}):typeof ir=="bigint"?ir.toString():ir)}function isPlainObject$1(tr){if(!hasObjectPrototype(tr))return!1;const rr=tr.constructor;if(typeof rr>"u")return!0;const ir=rr.prototype;return!(!hasObjectPrototype(ir)||!ir.hasOwnProperty("isPrototypeOf"))}function hasObjectPrototype(tr){return Object.prototype.toString.call(tr)==="[object Object]"}function filterQueryOptions(tr){const{_defaulted:rr,behavior:ir,gcTime:lr,initialData:dr,initialDataUpdatedAt:fr,maxPages:hr,meta:mr,networkMode:gr,queryFn:yr,queryHash:_r,queryKey:br,queryKeyHashFn:vr,retry:wr,retryDelay:xr,structuralSharing:Sr,getPreviousPageParam:Ar,getNextPageParam:Ir,initialPageParam:Mr,_optimisticResults:Or,enabled:$r,notifyOnChangeProps:Dr,placeholderData:zr,refetchInterval:Fr,refetchIntervalInBackground:Jr,refetchOnMount:$n,refetchOnReconnect:Qr,refetchOnWindowFocus:Zn,retryOnMount:qn,select:Xn,staleTime:Lr,suspense:Gr,throwOnError:Hn,config:ii,connector:oi,query:ri,...ti}=tr;return ti}function getEnsAvatarQueryOptions(tr,rr={}){return{async queryFn({queryKey:ir}){const{name:lr,scopeKey:dr,...fr}=ir[1];if(!lr)throw new Error("name is required");return getEnsAvatar(tr,{...fr,name:lr})},queryKey:getEnsAvatarQueryKey(rr)}}function getEnsAvatarQueryKey(tr={}){return["ensAvatar",filterQueryOptions(tr)]}function getEnsNameQueryOptions(tr,rr={}){return{async queryFn({queryKey:ir}){const{address:lr,scopeKey:dr,...fr}=ir[1];if(!lr)throw new Error("address is required");return getEnsName(tr,{...fr,address:lr})},queryKey:getEnsNameQueryKey(rr)}}function getEnsNameQueryKey(tr={}){return["ensName",filterQueryOptions(tr)]}function useQuery(tr){const rr=useQuery$1({...tr,queryKeyHashFn:hashFn});return rr.queryKey=tr.queryKey,rr}function useChainId(tr={}){const rr=useConfig(tr);return useSyncExternalStore(ir=>watchChainId(rr,{onChange:ir}),()=>getChainId(rr),()=>getChainId(rr))}function useEnsAvatar(tr={}){const{name:rr,query:ir={}}=tr,lr=useConfig(tr),dr=useChainId({config:lr}),fr=getEnsAvatarQueryOptions(lr,{...tr,chainId:tr.chainId??dr}),hr=!!(rr&&(ir.enabled??!0));return useQuery({...ir,...fr,enabled:hr})}function useEnsName(tr={}){const{address:rr,query:ir={}}=tr,lr=useConfig(tr),dr=useChainId({config:lr}),fr=getEnsNameQueryOptions(lr,{...tr,chainId:tr.chainId??dr}),hr=!!(rr&&(ir.enabled??!0));return useQuery({...ir,...fr,enabled:hr})}function ENSAvatar(tr){const{address:rr,chainId:ir=1,size:lr="14px"}=tr,dr={width:lr,height:lr},fr=useEnsName({address:rr,chainId:ir}),hr=fr.data??void 0,mr=useEnsAvatar({name:hr}),gr=mr.data??ImgPowerhouse;return fr.isLoading||mr.isLoading?jsx$1("div",{className:"fade-out flex-none animate-pulse rounded-full bg-gray-400",style:dr}):jsx$1("img",{alt:"ENS Avatar",className:"flex-none rounded-full object-contain",src:gr,style:dr})}const FormInput=forwardRef(function tr(rr,ir){const{icon:lr,errorMessage:dr,isDirty:fr,containerClassName:hr,inputClassName:mr,errorMessageClassName:gr,hideErrors:yr=!1,..._r}=rr,br=rr.type??"text",vr=!!dr;return jsxs("div",{children:[jsxs("div",{className:twMerge("mb-1 flex gap-2 rounded-md border border-gray-200 bg-gray-50 p-3 text-black placeholder:text-gray-50",vr&&"border-red-900",hr),children:[lr&&jsx$1("span",{className:twJoin((!fr||vr)&&"text-slate-200"),children:lr}),jsx$1("input",{..._r,className:twMerge("w-full bg-transparent font-semibold outline-none",mr),ref:ir,type:br})]}),jsx$1("p",{className:twMerge("hidden min-h-4 text-xs text-red-900",vr&&"block",yr&&"hidden",gr),children:dr})]})});function AddLocalDriveForm(tr){var fr;const{register:rr,handleSubmit:ir,control:lr,formState:{errors:dr}}=useForm({defaultValues:{name:"",sharingType:LOCAL,availableOffline:!1,appId:tr.appOptions[0].id}});return jsx$1("form",{onSubmit:ir(tr.onSubmit),className:"flex flex-col gap-4",children:jsxs("div",{className:"flex flex-col gap-4",children:[jsxs("div",{children:[jsx$1(Label,{htmlFor:"driveName",className:"text-sm font-medium text-gray-800",children:"Drive Name"}),jsx$1(FormInput,{...rr("name",{required:"Drive name is required"}),errorMessage:(fr=dr.name)==null?void 0:fr.message,placeholder:"Drive name"})]}),jsxs("div",{children:[jsx$1(Label,{htmlFor:"driveApp",className:"text-sm font-medium text-gray-800",children:"Drive App"}),jsx$1(AppFormInput,{control:lr,appOptions:tr.appOptions})]}),jsxs("div",{children:[jsx$1(Label,{htmlFor:"sharingType",className:"text-sm font-medium text-gray-800",children:"Location"}),jsx$1(SharingTypeFormInput,{control:lr})]}),jsx$1("div",{children:jsx$1(AvailableOfflineToggle,{...rr("availableOffline")})}),jsx$1(Button$1,{className:"mt-2 w-full",type:"submit",children:"Create new drive"})]})})}function AddRemoteDriveForm(tr){const{sharingType:rr=PUBLIC,requestPublicDrive:ir}=tr,[lr,dr]=useState(),[fr,hr]=useState(!1),[mr,gr]=useState(!0),[yr,_r]=useState(!1),[br,vr]=useState(""),[wr,xr]=useState(""),[Sr,Ar]=useDebounceValue(wr,500),{register:Ir,handleSubmit:Mr,setValue:Or}=useForm({mode:"onBlur",defaultValues:{availableOffline:(lr==null?void 0:lr.availableOffline)??!1}});useEffect(()=>{Ar(wr)},[wr]),useEffect(()=>{if(_r(!1),Sr==="")return;Dr().catch(console.error);async function Dr(){try{const{id:zr,name:Fr}=await ir(Sr);dr({id:zr,name:Fr,sharingType:rr,location:SWITCHBOARD,availableOffline:!0}),Or("availableOffline",!0),gr(!0),vr("")}catch(zr){dr(void 0),gr(!1),vr(zr.message)}}},[Sr,Or,rr]);function $r({availableOffline:Dr}){lr&&tr.onSubmit({...lr,availableOffline:Dr,url:Sr})}return jsx$1("form",{onSubmit:Mr($r),children:yr?jsxs(Fragment,{children:[jsx$1(DriveName,{driveName:(lr==null?void 0:lr.name)??"New drive"}),jsx$1(Divider,{className:"my-3"}),jsxs(Disclosure,{isOpen:fr,onOpenChange:()=>hr(!fr),title:"Location",children:[jsx$1(LocationInfo,{location:SWITCHBOARD}),jsx$1(AvailableOfflineToggle,{...Ir("availableOffline")})]}),jsx$1(Button$1,{className:"mt-4 w-full",color:"dark",type:"submit",children:"Add new drive"})]}):jsxs(Fragment,{children:[jsx$1(FormInput,{errorMessage:br,onChange:Dr=>xr(Dr.target.value),placeholder:"Drive URL",required:!0,type:"url",value:wr}),jsx$1(Button$1,{className:"mt-4 w-full py-2 text-base",color:"dark",size:"small",disabled:!mr||wr==="",onClick:Dr=>{Dr.preventDefault(),_r(!0)},type:"button",children:"Add drive"})]})})}function DriveSettingsForm(tr){const{drive:rr,sharingType:ir,availableOffline:lr,onSubmit:dr,handleDeleteDrive:fr}=tr,hr=rr.header.name,[mr,gr]=useState(!1),[yr,_r]=useState(!1),[br,vr]=useState(!1),{register:wr,handleSubmit:xr,control:Sr}=useForm({mode:"onBlur",defaultValues:{name:hr,sharingType:ir,availableOffline:lr}}),Ar=ir===PUBLIC?SWITCHBOARD:ir;return jsxs("form",{onSubmit:xr(dr),children:[jsx$1(DriveNameInput,{...wr("name")}),jsx$1(Divider,{className:"my-4"}),jsx$1(Label,{htmlFor:"sharingType",children:"Sharing settings"}),jsx$1(SharingTypeFormInput,{control:Sr}),jsx$1(Divider,{className:"my-3"}),jsxs(Disclosure,{isOpen:mr,onOpenChange:()=>gr(!mr),title:"Location",children:[jsx$1(LocationInfo,{location:Ar}),jsx$1(AvailableOfflineToggle,{...wr("availableOffline")})]}),jsx$1(Divider,{className:"my-3"}),jsx$1(Disclosure,{isOpen:yr,onOpenChange:()=>_r(!yr),title:"Danger zone",children:jsxs("button",{className:"flex gap-2 py-3 font-semibold text-red-900 transition hover:brightness-125",onClick:()=>vr(!0),type:"button",children:[jsx$1(Icon,{name:"Trash"}),"Delete drive"]})}),br&&yr?jsx$1(DeleteDrive,{drive:rr,handleDeleteDrive:fr,onCancel:()=>vr(!1)}):jsxs(Fragment,{children:[jsx$1(Divider,{className:"my-3"}),jsx$1(Button$1,{className:"mb-4 w-full",type:"submit",children:"Confirm"})]})]})}function appToInputOption(tr){return{value:tr.id,displayValue:tr.name,icon:jsx$1(Icon,{name:"PowerhouseLogoSmall"}),description:"Built by Powerhouse"}}function AppFormInput(tr){const{control:rr,appOptions:ir,...lr}=tr,dr=ir.map(appToInputOption);return jsx$1(Controller,{control:rr,name:"appId",render:({field:fr})=>jsx$1(Select,{...lr,...fr,id:"appId",items:dr})})}const AvailableOfflineToggle=forwardRef(function tr(rr,ir){return jsxs("div",{className:"flex items-center rounded-md border border-gray-200 bg-gray-50 p-3 text-gray-900",children:[jsxs("div",{className:"flex-1",children:[jsx$1("label",{className:"font-medium text-gray-900",htmlFor:"availableOffline",children:"Make available offline"}),jsxs("p",{className:"text-xs text-gray-600",children:["Check this options if you keep a local backup",jsx$1("br",{}),"available at all times."]})]}),jsx$1(Toggle,{id:"availableOffline",ref:ir,...rr})]})});function DeleteDrive(tr){const{drive:rr,handleDeleteDrive:ir,onCancel:lr}=tr,[dr,fr]=useState(""),hr=dr===rr.header.name;function mr(){hr&&ir()}return jsxs("div",{children:[jsx$1("p",{className:"mb-2 rounded-md bg-slate-50 p-4 text-center text-slate-200",children:"Are you sure you want to delete this drive? All files and subfolders within it will be removed. Do you want to proceed?"}),jsx$1(DriveNameInput,{icon:jsx$1(Icon,{name:"Lock"}),onChange:gr=>fr(gr.target.value),placeholder:"Enter drive name...",value:dr}),jsxs("div",{className:"flex gap-3",children:[jsx$1(Button$1,{className:"w-full",color:"light",onClick:lr,children:"Cancel"}),jsx$1(Button$1,{className:"w-full",color:"red",disabled:!hr,onClick:mr,children:"Delete"})]})]})}function DriveName(tr){return jsxs("div",{className:"flex gap-2 rounded-xl bg-gray-100 p-3 font-semibold text-gray-500",children:[jsx$1(Icon,{className:"text-gray-600",name:"Drive"}),tr.driveName]})}const DriveNameInput=forwardRef(function tr(rr,ir){return jsx$1(FormInput,{...rr,icon:rr.icon??jsx$1(Icon,{name:"Drive"}),id:"driveName",placeholder:"Drive name",ref:ir})});function Label(tr){const{children:rr,className:ir,...lr}=tr;return jsx$1("label",{...lr,className:twMerge("block font-semibold text-gray-500",ir),children:rr})}function LocationInfo(tr){const{location:rr,className:ir,...lr}=tr,dr=locationInfoByLocation[rr];return jsxs("div",{...lr,className:twMerge("my-3 flex items-center gap-2 rounded-xl border border-gray-100 p-3 text-gray-800 shadow",ir),children:[dr.icon,jsxs("div",{children:[jsx$1("p",{children:dr.title}),jsx$1("p",{className:"text-xs text-slate-200",children:dr.description})]})]})}const DUPLICATE="DUPLICATE",RENAME="RENAME",DELETE="DELETE",SETTINGS="SETTINGS",REMOVE_TRIGGER="REMOVE_TRIGGER",ADD_TRIGGER="ADD_TRIGGER",ADD_INVALID_TRIGGER="ADD_INVALID_TRIGGER",defaultFileOptions=[RENAME,DELETE,DUPLICATE],defaultFolderOptions=[RENAME,DELETE,DUPLICATE],sharingTypeOptions=[{value:"LOCAL",icon:jsx$1(Icon,{name:"Lock"}),description:"Only available to you"},{value:"CLOUD",icon:jsx$1(Icon,{name:"People"}),description:"Only available to people in this drive"},{value:"PUBLIC",icon:jsx$1(Icon,{name:"Globe"}),description:"Available to everyone",disabled:!0}],locationInfoByLocation={CLOUD:{title:"Secure cloud",description:"End to end encryption between members.",icon:jsx$1(Icon,{name:"Lock"})},LOCAL:{title:"Local",description:"Private and only available to you.",icon:jsx$1(Icon,{name:"Hdd"})},SWITCHBOARD:{title:"Switchboard",description:"Public and available to everyone.",icon:jsx$1(Icon,{name:"Drive"})}},debugNodeOptionsMap={[ADD_TRIGGER]:{label:"Add Trigger",icon:jsx$1(Icon,{className:"text-orange-900",name:"Plus"})},[REMOVE_TRIGGER]:{label:"Remove Trigger",icon:jsx$1(Icon,{className:"text-orange-900",name:"Xmark"})},[ADD_INVALID_TRIGGER]:{label:"Add Trigger",icon:jsx$1(Icon,{className:"text-orange-900",name:"Exclamation"})}},normalNodeOptionsMap={[DUPLICATE]:{label:"Duplicate",icon:jsx$1(Icon,{name:"FilesEarmark"})},[RENAME]:{label:"Rename",icon:jsx$1(Icon,{name:"Pencil"})},[DELETE]:{label:"Delete",icon:jsx$1(Icon,{name:"Trash"}),className:"text-red-900"},[SETTINGS]:{label:"Settings",icon:jsx$1(Icon,{name:"Gear"})}},nodeOptionsMap={...debugNodeOptionsMap,...normalNodeOptionsMap},Select=fixedForwardRef(function tr(rr,ir){const{items:lr,value:dr,id:fr,onChange:hr,containerClassName:mr,menuClassName:gr,itemClassName:yr,absolutePositionMenu:_r=!1,borderRadius:br="6px"}=rr,[vr,wr]=useState(!1),xr=Ar(dr)??lr[0];function Sr(Mr){Mr.disabled||(hr(Mr.value),wr(!1))}function Ar(Mr){return lr.find(Or=>Or.value===Mr)}const Ir=lr.filter(Mr=>Mr.value!==dr);return jsxs("div",{className:twMerge("border border-gray-200 bg-gray-50 text-gray-800 transition-[border-radius]",_r&&"relative",mr),"data-open":vr,ref:ir,style:{borderRadius:br},children:[jsxs("div",{className:twMerge("flex min-w-[360px] cursor-pointer items-center justify-between pr-3 text-gray-800 outline-none",gr),id:fr,onClick:()=>wr(!vr),children:[jsx$1(ItemContainer,{...xr,className:yr}),jsx$1(Icon,{className:twJoin("transition",vr?"":"-rotate-90"),name:"ChevronDown"})]}),jsx$1("div",{className:twMerge("max-h-0 w-full overflow-hidden bg-inherit transition-[max-height] ease-in-out",vr&&"max-h-screen",_r&&"absolute"),style:{borderRadius:`0 0 ${br} ${br}`},children:Ir.map(Mr=>jsx$1(ItemContainer,{...Mr,className:yr,onItemClick:()=>Sr(Mr)},Mr.value))})]})});function ItemContainer(tr){const{className:rr,disabled:ir,onItemClick:lr,icon:dr,displayValue:fr,value:hr,description:mr}=tr;return jsxs("div",{className:twMerge(ir?"cursor-not-allowed text-gray-500":"text-gray-800","flex size-full cursor-pointer items-center gap-2 bg-inherit py-3 pl-3 text-start outline-none",rr),onClick:lr,children:[dr,jsxs("div",{children:[jsx$1("p",{className:"capitalize text-inherit",children:fr??hr.toLowerCase()}),jsx$1("p",{className:"text-xs text-gray-600",children:mr})]})]})}function SharingTypeFormInput(tr){const{control:rr,...ir}=tr;return jsx$1(Controller,{control:rr,name:"sharingType",render:({field:lr})=>jsx$1(Select,{...ir,...lr,id:"sharingType",items:sharingTypeOptions})})}const HomeBgAvif=""+new URL("home-bg-BRYzhkhi.avif",import.meta.url).href,HomeBg=""+new URL("home-bg-BEhF9NuW.png",import.meta.url).href;function HomeBackgroundImage(){return jsxs("picture",{className:"pointer-events-none absolute inset-8 z-0 size-[calc(100%-32px)] object-contain",children:[jsx$1("source",{srcSet:HomeBgAvif,type:"image/avif"}),jsx$1("img",{src:HomeBg,alt:"background",className:"object-contain"})]})}const HomeScreen=function tr(rr){const{children:ir,containerClassName:lr}=rr;return jsx$1("div",{className:twMerge("container relative mx-auto flex h-full flex-col",lr),children:jsxs("div",{className:"m-8 flex flex-wrap justify-center gap-4 pt-12",children:[jsx$1(HomeBackgroundImage,{}),ir]})})};function AddDriveModal$1(tr){function rr(){lr(!1)}const{open:ir,onOpenChange:lr,onAddRemoteDrive:dr,onAddLocalDrive:fr,requestPublicDrive:hr,modalProps:mr,containerProps:gr}=tr;return jsx$1(Modal,{...mr,contentProps:{className:"rounded-2xl"},onOpenChange:lr,open:ir,children:jsx$1("div",{...gr,className:twMerge("w-[408px] rounded-2xl p-6",gr==null?void 0:gr.className),children:jsxs(Tabs,{defaultValue:"Create Drive",children:[jsx$1(TabContent,{label:"Create Drive",description:"Create a new drive",children:jsx$1(AddLocalDriveForm,{onCancel:rr,onSubmit:fr,appOptions:tr.appOptions})}),jsx$1(TabContent,{label:"Add Drive",description:"Add a drive",children:jsx$1(AddRemoteDriveForm,{sharingType:"PUBLIC",onSubmit:dr,onCancel:rr,requestPublicDrive:hr})}),jsx$1(TabContent,{label:"New Shortcut",description:"Create a new shortcut",disabled:!0,children:"test"})]})})})}const buttonStyles$3="min-h-[48px] min-w-[142px] text-base font-semibold py-3 px-6 rounded-xl outline-none active:opacity-75 hover:scale-105 transform transition-all";function ConnectConfirmationModal(tr){const{body:rr,header:ir,children:lr,onCancel:dr,onOpenChange:fr,onContinue:hr,cancelLabel:mr,continueLabel:gr,overlayProps:yr,contentProps:_r,bodyProps:br={},headerProps:vr={},containerProps:wr={},cancelButtonProps:xr={},continueButtonProps:Sr={},buttonContainerProps:Ar={},...Ir}=tr;return jsx$1(Modal,{contentProps:{..._r,className:twMerge("rounded-3xl",_r==null?void 0:_r.className)},onOpenChange:fr,overlayProps:{...yr,className:yr==null?void 0:yr.className},...Ir,children:jsxs("div",{...mergeClassNameProps(wr,"w-[400px] p-6 text-slate-300"),children:[jsx$1("div",{...mergeClassNameProps(vr,"border-b border-slate-50 pb-2 text-2xl font-bold text-gray-800"),children:ir}),jsxs("div",{...mergeClassNameProps(br,"my-6 rounded-md bg-slate-50 p-4 text-center"),children:[rr,lr]}),jsxs("div",{...mergeClassNameProps(Ar,"mt-8 flex justify-between gap-3"),children:[jsx$1("button",{onClick:dr,...mergeClassNameProps(xr,twMerge(buttonStyles$3,"flex-1 bg-slate-50 text-slate-800")),children:mr}),jsx$1("button",{onClick:hr,...mergeClassNameProps(Sr,twMerge(buttonStyles$3,"flex-1 bg-gray-800 text-gray-50")),children:gr})]})]})})}const buttonStyles$2="min-h-[48px] min-w-[142px] text-base font-semibold py-3 px-6 rounded-xl outline-none active:opacity-75 hover:scale-105 transform transition-all",CLOSE_ANIMATION_DURATION=300;function CreateDocumentModal$1(tr){const{onOpenChange:rr,onContinue:ir,overlayProps:lr,contentProps:dr,...fr}=tr,[hr,mr]=useState(""),[gr,yr]=useState(!1),_r=()=>{rr==null||rr(!1),setTimeout(()=>mr(""),CLOSE_ANIMATION_DURATION)},br=useCallback(()=>{gr&&(ir(hr),setTimeout(()=>mr(""),CLOSE_ANIMATION_DURATION))},[gr,hr,ir]);return jsx$1(Modal,{contentProps:{...dr,className:twMerge("rounded-3xl",dr==null?void 0:dr.className)},onOpenChange:rr,overlayProps:{...lr,className:lr==null?void 0:lr.className},...fr,children:jsxs("div",{className:"w-[400px] p-6 text-slate-300",children:[jsx$1("div",{className:"border-b border-slate-50 pb-2 text-2xl font-bold text-gray-800",children:"Create a new document"}),jsxs("div",{className:"my-6",children:[!gr&&hr&&jsx$1("div",{className:"mb-2 text-red-500",children:"Document name must be valid URL characters."}),jsx$1(FormInput,{icon:jsx$1(Icon,{name:"BrickGlobe"}),onChange:vr=>{const wr=vr.target.value;mr(wr),yr(isValidName(wr))},placeholder:"Document name",required:!0,value:hr})]}),jsxs("div",{className:"mt-8 flex justify-between gap-3",children:[jsx$1("button",{className:twMerge(buttonStyles$2,"flex-1 bg-slate-50 text-slate-800"),onClick:_r,children:"Cancel"}),jsx$1(Button$1,{className:twMerge(buttonStyles$2,"flex-1 bg-gray-800 text-gray-50"),onClick:br,disabled:!gr,children:"Create"})]})]})})}const ConnectDeleteDriveModal=tr=>{const{inputPlaceholder:rr,body:ir,driveName:lr,...dr}=tr,[fr,hr]=useState("");return jsx$1(ConnectConfirmationModal,{bodyProps:{className:"p-0 bg-white my-0"},containerProps:{className:"w-[450px]"},continueButtonProps:{disabled:fr!==lr,className:fr!==lr?"bg-red-600 hover:scale-100 cursor-not-allowed active:opacity-100":"bg-red-900"},...dr,children:jsxs("div",{children:[jsx$1("div",{className:"my-6 rounded-md bg-slate-50 p-4 text-center",children:ir}),jsx$1("div",{children:jsx$1(FormInput,{hideErrors:!0,icon:jsx$1(Icon,{name:"Lock"}),onChange:mr=>hr(mr.target.value),placeholder:rr,value:fr})})]})})};function ConnectDeleteItemModal(tr){const{onDelete:rr,deleteLabel:ir,...lr}=tr;return jsx$1(ConnectConfirmationModal,{...lr,containerProps:{className:"w-[450px]"},continueButtonProps:{className:"bg-red-900"},continueLabel:ir,onContinue:rr})}function DriveSettingsModal$1(tr){const{drive:rr,open:ir,sharingType:lr,availableOffline:dr,onOpenChange:fr,onDeleteDrive:hr,onRenameDrive:mr,onChangeSharingType:gr,onChangeAvailableOffline:yr,modalProps:_r,containerProps:br}=tr,vr=Sr=>{Sr.name!==rr.header.name&&mr(rr,Sr.name),Sr.sharingType!==lr&&gr(rr,Sr.sharingType),Sr.availableOffline!==dr&&yr(rr,Sr.availableOffline),fr(!1)};function wr(){hr(rr),fr(!1)}function xr(){fr(!1)}return jsx$1(Modal,{..._r,contentProps:{className:"rounded-2xl"},onOpenChange:fr,open:ir,children:jsxs("div",{...br,className:twMerge("max-w-[408px] rounded-2xl p-6",br==null?void 0:br.className),children:[jsxs("div",{className:"flex justify-between",children:[jsx$1("h1",{className:"text-xl font-bold",children:"Drive settings"}),jsx$1("button",{className:"flex size-8 items-center justify-center rounded-md bg-gray-100 text-gray-500 outline-none hover:text-gray-900",onClick:xr,tabIndex:-1,children:jsx$1(Icon,{name:"XmarkLight",size:24})})]}),jsx$1(Divider,{className:"my-4"}),jsx$1(DriveSettingsForm,{handleCancel:xr,handleDeleteDrive:wr,onSubmit:vr,drive:rr,sharingType:lr,availableOffline:dr})]})})}const buttonStyles$1="min-h-[48px] min-w-[142px] text-base font-semibold py-3 px-6 rounded-xl outline-none active:opacity-75 hover:scale-105 transform transition-all";function ReadRequiredModal(tr){const{body:rr,header:ir,children:lr,onOpenChange:dr,onContinue:fr,closeLabel:hr,overlayProps:mr,contentProps:gr,bodyProps:yr={},headerProps:_r={},containerProps:br={},continueButtonProps:vr={},buttonContainerProps:wr={},...xr}=tr,[Sr,Ar]=useState(!0),Ir=useRef(null);return useEffect(()=>{const Mr=()=>{const $r=Ir.current;$r&&($r.scrollHeight>$r.clientHeight?(Ar(!0),$r.addEventListener("scroll",Or)):Ar(!1))},Or=()=>{const $r=Ir.current;$r&&$r.scrollHeight-Math.ceil($r.scrollTop)===$r.clientHeight&&Ar(!1)};return requestAnimationFrame(Mr),()=>{const $r=Ir.current;$r&&$r.removeEventListener("scroll",Or)}},[]),jsx$1(Modal,{contentProps:{...gr,className:twMerge("rounded-3xl outline-none",gr==null?void 0:gr.className)},onOpenChange:dr,overlayProps:{...mr,className:mr==null?void 0:mr.className},...xr,children:jsxs("div",{...mergeClassNameProps(br,"w-[500px] p-6 text-slate-300"),children:[jsx$1("div",{...mergeClassNameProps(_r,"border-b border-slate-50 pb-2 text-2xl font-bold text-gray-800"),children:ir}),jsxs("div",{ref:Ir,...mergeClassNameProps(yr,"my-6 max-h-[245px] overflow-scroll rounded-md bg-slate-50 p-4 text-center"),children:[rr,lr]}),jsx$1("div",{...mergeClassNameProps(wr,"mt-8 flex justify-between gap-3"),children:jsx$1("button",{disabled:Sr,onClick:fr,...mergeClassNameProps(vr,twMerge(buttonStyles$1,"flex-1 bg-gray-800 text-gray-50",Sr&&"cursor-not-allowed bg-gray-300 hover:scale-100")),children:hr})})]})})}const REQUIRED_DEPENDENCIES=["@powerhousedao/design-system","document-drive","document-model"],PackageJsonSchema=objectType({version:stringType({message:"Missing version field in package.json"}),dependencies:recordType(stringType(),stringType()).nullable(),devDependencies:recordType(stringType(),stringType()).nullable()}).refine(tr=>tr.dependencies!=null||tr.devDependencies!=null,"package.json must have either dependencies or devDependencies").transform(tr=>{const rr={...tr.dependencies,...tr.devDependencies},ir=REQUIRED_DEPENDENCIES.filter(lr=>!rr[lr]||typeof rr[lr]!="string");return ir.length>0?(console.error("Missing or invalid dependencies:",ir,"Available dependencies:",Object.keys(rr)),!1):{version:tr.version,dependencies:Object.fromEntries(REQUIRED_DEPENDENCIES.map(lr=>[lr,rr[lr]]))}});function verifyPackageJsonFields(tr){const rr=PackageJsonSchema.safeParse(tr);return rr.success?rr.data:(console.error("Package.json validation failed:",rr.error.format()),!1)}function DependencyVersions(tr){const[rr,ir]=useState(!1),{packageJson:lr,phCliVersion:dr}=tr,fr=verifyPackageJsonFields(lr);return fr?jsx$1(Disclosure,{isOpen:rr,onOpenChange:()=>ir(!rr),title:`App version: ${fr.version}`,toggleClassName:"text-gray-900 text-sm",children:jsxs("ul",{className:"text-sm text-gray-600",children:[REQUIRED_DEPENDENCIES.map(hr=>jsxs("li",{className:"my-1 flex justify-between pr-1",children:[jsxs("span",{children:[hr.replace("@powerhousedao/",""),":"]}),jsx$1("span",{className:"font-normal",children:fr.dependencies[hr]})]},hr)),dr&&jsxs("li",{className:"my-1 flex justify-between pr-1",children:[jsx$1("span",{children:"@powerhousedao/ph-cli:"}),jsx$1("span",{className:"font-normal",children:dr})]},"ph-cli")]})}):(console.error("Failed to validate package.json data"),null)}function About$1(tr){const{packageJson:rr,phCliVersion:ir}=tr;return jsxs("div",{className:"bg-white p-3",children:[jsx$1("h2",{className:"font-semibold",children:"About"}),jsx$1("p",{className:"text-sm font-normal text-gray-600",children:"Connect is the hub for your most important documents and processes translated into software. Easily capture data in a structured way with Connect."}),jsx$1("div",{className:"my-4",children:jsx$1(DependencyVersions,{packageJson:rr,phCliVersion:ir})})]})}const SWITCHBOARD="SWITCHBOARD",LOCAL="LOCAL",CLOUD="CLOUD",PUBLIC="PUBLIC";function DangerZone$1(tr){const{className:rr,...ir}=tr;return jsxs("div",{className:cn$2("h-full rounded-lg bg-white p-3",rr),children:[jsx$1("h2",{className:"mb-4 font-semibold",children:"Modify Drives"}),jsx$1(ModifyDrives,{...ir}),jsx$1("h2",{className:"my-4 font-semibold",children:"Local Storage"}),jsx$1(LocalStorage,{...ir})]})}function ModifyDrives(tr){const{className:rr,...ir}=tr;return jsx$1("div",{className:rr,children:jsx$1(DriveList,{...ir})})}function DriveList(tr){const{className:rr,...ir}=tr;return jsx$1("div",{className:rr,children:tr.drives.map(lr=>jsx$1(Drive,{drive:lr,...ir},lr.header.id))})}function Drive(tr){const{drive:rr,className:ir,onDeleteDrive:lr}=tr,[dr,fr]=useState(!1),hr=jsx$1(Icon,{name:"Hdd",size:16,className:"flex-none"}),mr=jsx$1(Icon,{name:"Server",size:16,className:"flex-none"}),gr=rr.state.global.icon?jsx$1("img",{alt:"drive icon",className:"size-4 flex-none object-contain",src:rr.state.global.icon}):jsx$1(Icon,{name:"M",size:16,className:"flex-none"});function yr(){const br=getDriveSharingType(rr);return br===PUBLIC?gr:br===CLOUD?mr:hr}const _r=yr();return jsxs("div",{className:cn$2("mb-4 flex w-96 items-center gap-2 rounded-md border border-gray-200 bg-gray-50 px-3 py-2 shadow-sm last-of-type:mb-0",ir),children:[_r,jsxs("div",{children:[jsx$1("span",{className:"block text-sm font-medium leading-[18px]",children:capitalCase(rr.header.name)}),jsxs("div",{className:"flex items-baseline gap-x-2 leading-[18px]",children:[jsxs("span",{className:"text-sm text-gray-600",children:[capitalCase(getDriveSharingType(rr))," App"]}),jsxs("a",{className:"group flex items-center gap-x-2 text-sm text-slate-500 transition-colors hover:text-[#9896FF]",children:["By Powerhouse",jsx$1("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 12 12",className:"size-4 text-gray-400 transition-colors group-hover:text-inherit",children:jsx$1("path",{d:"M7.99365 11.9939C9.46632 11.9939 10.6603 10.7999 10.6603 9.32722V7.32722C10.6603 6.95922 10.3617 6.66056 9.99365 6.66056C9.62565 6.66056 9.32699 6.95922 9.32699 7.32722V9.32722C9.32699 10.0639 8.73032 10.6606 7.99365 10.6606H2.66032C1.92365 10.6606 1.32699 10.0639 1.32699 9.32722V3.99389C1.32699 3.25723 1.92365 2.66056 2.66032 2.66056H4.66032C5.02832 2.66056 5.32699 2.36189 5.32699 1.99389C5.32699 1.6259 5.02832 1.32723 4.66032 1.32723H2.66032C1.18765 1.32723 -0.00634766 2.52123 -0.00634766 3.99389V9.32722C-0.00634766 10.7999 1.18765 11.9939 2.66032 11.9939H7.99365ZM5.32699 7.32722C5.49765 7.32722 5.67565 7.26989 5.80632 7.13989L10.1396 2.80656L11.9937 4.66056V-0.00610352H7.32699L9.18099 1.8479L4.84766 6.18123C4.58766 6.4419 4.58766 6.87922 4.84766 7.13989C4.97832 7.26989 5.15632 7.32722 5.32699 7.32722Z",fill:"currentColor"})})]})]})]}),jsx$1(ConnectDropdownMenu,{items:[{id:"delete-drive",label:"Delete",icon:jsx$1(Icon,{name:"Trash"}),className:"text-red-900"}],onItemClick:br=>{br==="delete-drive"&&lr(rr)},onOpenChange:fr,open:dr,children:jsx$1("button",{className:"group ml-auto flex-none",onClick:br=>{br.stopPropagation(),fr(!0)},children:jsx$1(Icon,{className:"text-gray-600 group-hover:text-gray-900",name:"VerticalDots",size:16})})})]})}function LocalStorage(tr){const{onClearStorage:rr}=tr;return jsx$1("div",{children:jsxs("button",{className:"flex items-center gap-x-2 rounded-md border border-gray-300 bg-transparent px-3 py-1 text-sm font-medium text-red-900 transition-colors hover:bg-gray-100",onClick:rr,children:["Clear Storage ",jsx$1(Icon,{name:"Trash",size:16})]})})}function DefaultEditor$1(tr){const{className:rr,...ir}=tr;return jsx$1("div",{className:twMerge("rounded-lg p-3",rr),children:jsx$1(DefaultEditorSelect,{...ir})})}function DefaultEditorSelect(tr){const{documentModelEditor:rr,setDocumentModelEditor:ir,documentModelEditorOptions:lr,className:dr}=tr;return jsxs("div",{children:[jsx$1("h3",{className:"mb-4 font-semibold text-gray-900",children:"Default Editor Selection"}),jsx$1(SelectFieldRaw,{className:twMerge("min-w-36 max-w-fit",dr),name:"default-editor",required:!0,value:rr,options:lr,multiple:!1,onChange:fr=>ir(fr)})]})}const ProviderIconMap={npm:{icon:"Npm"},github:{icon:"Github",size:28},local:{icon:"Hdd"}},PackageItem=({packageName:tr,provider:rr})=>{const ir=rr&&ProviderIconMap[rr];return jsxs("div",{className:"flex w-full items-center justify-between px-2 py-1",children:[jsx$1("p",{className:"font-medium",children:tr}),ir&&jsx$1(Icon,{name:ir.icon,size:ir.size})]})},PackageManagerInput=tr=>{const{onInstall:rr,packageOptions:ir,className:lr}=tr,[dr,fr]=useState(""),[hr,mr]=useState(!1),[gr,yr]=useState(),_r=useCallback(()=>{const xr=rr(dr);xr?(mr(!0),xr.then(()=>fr("")).catch(yr).finally(()=>mr(!1))):(fr(""),yr(void 0))},[rr,dr]),br=useCallback(xr=>{fr(xr.target.value)},[]),vr=gr?typeof gr=="string"?gr:gr instanceof Error?gr.message:gr:" ",wr=useMemo(()=>{const xr=ir==null?void 0:ir.map(Sr=>({...Sr,value:Sr.packageName}));return ir!=null&&ir.length?{autoComplete:!0,initialOptions:xr,fetchOptionsCallback:Sr=>(xr==null?void 0:xr.filter(Ar=>Ar.packageName.toLowerCase().includes(Sr.toLowerCase())))??[],renderOption:Sr=>jsx$1(PackageItem,{...Sr})}:{autoComplete:!1}},[ir]);return jsxs("div",{className:lr,children:[jsx$1("h3",{className:"mb-4 font-semibold text-gray-900",children:"Install Package"}),jsxs("div",{className:"flex items-center gap-4",children:[ir!=null&&ir.length?jsx$1(IdAutocomplete,{...wr,onChange:fr}):jsx$1(Input$2,{name:"package",className:"max-w-xs text-gray-700",value:dr,onChange:br,onSubmit:_r,disabled:hr}),jsx$1(Button$1,{className:"h-9 rounded-md text-sm",onClick:_r,disabled:hr,children:"Install"})]}),jsx$1("p",{className:"mb-3 ml-2 h-3 text-sm text-red-800",children:vr})]})},PackageDetail=({label:tr,value:rr})=>jsxs("div",{className:"flex items-start gap-2 text-sm",children:[jsxs("p",{className:"text-gray-600",children:[tr,":"]}),jsx$1("p",{className:"text-gray-600",children:rr})]}),PackageManagerListItem=tr=>{const{package:{name:rr,description:ir,category:lr,publisher:dr,publisherUrl:fr,modules:hr,id:mr,removable:gr},mutable:yr,onUninstall:_r,className:br}=tr,[vr,wr]=useState(!1);return jsxs("li",{className:twMerge("relative flex flex-col items-start rounded-md border border-gray-200 p-3 text-sm leading-5 shadow-sm",br),children:[jsx$1("h3",{className:"font-semibold text-gray-900",children:rr}),jsx$1(PackageDetail,{label:"Description",value:ir}),jsx$1(PackageDetail,{label:"Category",value:lr}),jsx$1(PackageDetail,{label:"Publisher",value:dr}),jsx$1(PackageDetail,{label:"Publisher URL",value:jsx$1("a",{className:"underline",href:fr,children:fr})}),jsx$1("p",{className:"text-sm text-gray-600",children:"Modules included:"}),jsx$1("ul",{className:"list-disc pl-5",children:hr.map(xr=>jsx$1("li",{children:jsx$1("span",{className:"text-gray-600",children:xr})},xr))}),yr&&gr&&jsx$1(ConnectDropdownMenu,{items:[{id:"uninstall",label:"Uninstall",icon:jsx$1(Icon,{name:"Trash"}),className:"text-red-900"}],onItemClick:xr=>{xr==="uninstall"&&_r(mr)},onOpenChange:wr,open:vr,children:jsx$1("button",{className:"group absolute right-3 top-3",onClick:xr=>{xr.stopPropagation(),wr(!0)},children:jsx$1(Icon,{className:"text-gray-600 group-hover:text-gray-900",name:"VerticalDots"})})})]})},PackageManagerList=tr=>{const{className:rr,packages:ir,onUninstall:lr,mutable:dr,...fr}=tr,hr=useCallback(mr=>{lr(mr)},[lr]);return jsxs("div",{...fr,className:twMerge("flex max-h-[370px] flex-col items-stretch overflow-hidden",rr),children:[jsx$1("h3",{className:"mb-4 font-semibold text-gray-900",children:"Installed Packages"}),jsx$1("div",{className:"flex-1 overflow-y-auto pr-2",children:jsx$1("ul",{className:"flex flex-col items-stretch gap-4 pr-2",children:ir.map(mr=>jsx$1(PackageManagerListItem,{package:mr,onUninstall:hr,mutable:dr},mr.id))})})]})},PackageManagerReactorSelect=tr=>{const{reactorOptions:rr,reactor:ir,onReactorChange:lr,...dr}=tr,fr=useCallback(hr=>{lr(Array.isArray(hr)?hr.at(-1):hr)},[lr]);return jsxs("div",{...dr,children:[jsx$1("h3",{className:"mb-4 font-semibold text-gray-900",children:"Select Reactor"}),jsx$1(SelectFieldRaw,{className:"min-w-36 max-w-fit",name:"reactor",required:!0,value:ir,options:rr,multiple:!1,onChange:fr})]})},PackageManager$1=tr=>{const{className:rr,reactorOptions:ir,reactor:lr,onReactorChange:dr,onInstall:fr,packages:hr,onUninstall:mr,mutable:gr,packageOptions:yr,..._r}=tr,br=useMemo(()=>yr==null?void 0:yr.filter(vr=>!hr.find(wr=>wr.name===vr.packageName)),[hr,yr]);return jsxs("div",{..._r,className:twMerge("flex h-full flex-1 flex-col rounded-lg p-3",rr),children:[jsx$1(PackageManagerReactorSelect,{reactor:lr,reactorOptions:ir,onReactorChange:dr,className:"mb-4"}),gr&&jsx$1(PackageManagerInput,{onInstall:fr,packageOptions:br}),jsx$1(PackageManagerList,{packages:hr,onUninstall:mr,mutable:gr})]})};function SettingsModal$1(tr){var wr,xr;const{title:rr,overlayProps:ir,contentProps:lr,onOpenChange:dr,tabs:fr,defaultTab:hr,...mr}=tr,[gr,yr]=useState(hr??((wr=fr.at(0))==null?void 0:wr.id)),_r=fr.map(Sr=>jsx$1("button",{type:"button",onClick:()=>yr(Sr.id),children:jsxs("div",{className:twMerge("flex h-9 w-48 cursor-pointer items-center gap-x-2 rounded-md pl-3 hover:bg-slate-50",gr===Sr.id?"bg-slate-50":"bg-transparent"),children:[Sr.icon,jsx$1("span",{children:Sr.label})]})},Sr.id)),vr=(xr=fr.find(Sr=>Sr.id===gr))==null?void 0:xr.content;return jsxs(Modal,{contentProps:{...lr,className:twMerge("min-h-full w-full max-w-4xl rounded-xl",lr==null?void 0:lr.className),style:{...lr==null?void 0:lr.style,boxShadow:"0px 0px 16px 4px rgba(0, 0, 0, 0.04), 0px 33px 32px -16px rgba(0, 0, 0, 0.10)"}},onOpenChange:dr,overlayProps:{...ir,className:twMerge("py-28",ir==null?void 0:ir.className)},...mr,children:[jsxs("div",{className:"flex justify-between border-b border-slate-50 p-4",children:[jsx$1("h1",{className:"text-center text-xl font-semibold",children:rr}),jsx$1("button",{type:"button",className:"flex size-6 items-center justify-center rounded-md outline-none",onClick:()=>dr==null?void 0:dr(!1),children:jsx$1(Icon,{name:"XmarkLight",size:24})})]}),jsxs("div",{className:"flex flex-1",children:[jsx$1("div",{className:"flex flex-col gap-y-1 p-3 pt-6",children:_r}),jsx$1("div",{className:"m-6 flex h-full flex-1 flex-col overflow-hidden rounded-lg border border-slate-50",children:typeof vr=="function"?jsx$1(vr,{}):vr})]})]})}const buttonStyles="min-h-[48px] min-w-[142px] text-base font-semibold py-3 px-6 rounded-xl outline-none active:opacity-75 hover:scale-105 transform transition-all";function ConnectUpgradeDriveModal(tr){const{body:rr,header:ir,onOpenChange:lr,onContinue:dr,cancelLabel:fr,continueLabel:hr,overlayProps:mr,contentProps:gr,...yr}=tr;return jsx$1(Modal,{contentProps:{...gr,className:twMerge("rounded-3xl",gr==null?void 0:gr.className)},onOpenChange:lr,overlayProps:{...mr,className:mr==null?void 0:mr.className},...yr,children:jsxs("div",{className:"w-[400px] p-6 text-slate-300",children:[jsx$1("div",{className:"border-b border-slate-50 pb-2 text-2xl font-bold text-gray-800",children:ir}),jsx$1("div",{className:"my-6 rounded-md bg-slate-50 p-4 text-center",children:rr}),jsxs("div",{className:"mt-8 flex justify-between gap-3",children:[jsx$1("button",{className:twMerge(buttonStyles,"flex-1 bg-slate-50 text-slate-800"),onClick:()=>lr==null?void 0:lr(!1),children:fr}),jsx$1("button",{className:twMerge(buttonStyles,"flex-1 bg-gray-800 text-gray-50"),onClick:dr,children:hr})]})]})})}const renownShortHover=""+new URL("renown-short-hover-BiSLBV7L.png",import.meta.url).href,renownShort="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJAAAACQCAYAAADnRuK4AAAACXBIWXMAACxLAAAsSwGlPZapAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAtmSURBVHgB7Z3dbtvmGcefl5LsqHYCq0C6tEUCZ0kDzAFqd0NTYAmweAfr0YD0CrpeQboriH0H6RUsu4ChAYodtCdJD3LQBGttILEBJ4tdJ2uzBoi0yIpsi+S790+ZDkmREilSHySfX6FKpkgliH5+nuf9pKAEkFLO1Bu7VzRNzEuiWfXzglDHSIgZYsYC9b1sCaEeJFZMU66WCnS7XC5vUUwE9Qmk2dndvar+ZpetB5NCxIr6Hr+II1NkgQ7FMeTnHGGygxLhRkGj5agiRRKo3mxeY3EyjkZLR8vl5bCnhxKo2WzOGqb4UpJcCDpH1T+E/wpKY+3gU4XoO0MyCaKyhvVsqifTNNWzVM8y8Hz1rW2pr3ExTDTq+Q3vNPc/lYZ+3S/qwI+iVlDSCJYlZcgDiVqGQdLXJVGTJD47NjV5s9vndP3W6429a8rZpY6LIE6hoB4aMenHMMxgkXqktECBguSBNHhwxMkWiEgt3SRDpbgOukjka8HLxt4VQeaX3uOlIkedrKPr7WjkRWiFv0yXJ/7ecdx7AAWzbsgfnDUPgs1EsWgVykz2QTTaa+melCZqRU1+4C2sO8KJSoe3vAXzZInlyRMoTxAw3MgZXbXEvee6BELdg6EI5zGkLa538gcCRkk1lNzIhXqjseQ8cmiGlbpM2nS+WdA0migViMkvKKx1V00kavr+5OlKRdTw02EEUqnrmvNCBJ1SkQvmvFMsauROQHKmOPHqc/sn6y2/6MMtLsams2X2OgpZhrQM92h6u6OQ5WHadItCliWqSL7quqDAdQ/jpqB5nBDaH6wnv/R1ZKLILS/GBbqEdvdarmP6/pGK5k1f1qg6y8N4gBHevsBSafeKOuSeoqGxPEwAXjcwvUfVQGLedZLGxTPjj9cNKWhWw/9cJ3EAYgLwuqHaZvM4Nus+zAYxAXSkMDGj9TiHYQ7pVEP1BxEzFL6+9T3tvGrS4u/fpzcrRykrcMU8BLb/85yePa/STmOX1h49oSzBAg2BJ0qgw9dPn1OWYIEGzH5LtyKQ8+dnv1QpK7BAA2ZbRRxI42T1wSZlBRZowKw/2u44hnpov9WiLMACDRCI8qK64/ve2sZTygIs0ABZvf848L31je1MRCEWaEA82vxZRaBa4Puoi1bvp78WYoEGxOra457nrD18kvoWGQs0AFYfPLY6DcOdm+4oxAIlzE6jSSsRpEChvbaR3t5pFihBUBR/fft7isq9lY3UpjIWKEHufLceOnV1XHtvzYpeaYMFSgjUPds/9T/OBfEQvdLWtGeBEgDyrCRQDFsS3UqXRCxQTJKSx+ZFbSdVErFAMbi38jBReWwg0Vff3E1FTcQC9YHV2lJRYm1jmwaFXRONu0Si3mi69qEqT5aICQb9NnfurvXd2uqHhfO/pvnzp2kcaHpWp7JAIUHUWX2wNdCo0403Z6Zp8eL7ND1VplHCAvXBuuopXlHFsndi2Cg4O/u2FY1GJRILFBJEnEebz2j94fZQ01UYpqeO0InjlZGIxAL1ADUOJsFjOsY4RJxenHr3OJ05/Tadeuc4DQMWKAC0dtqtnvGKNmGZKBXp4oU5S6hB4hWIm/EHoO8lrfIAa/XHT8NfMsQCHXDirYqqK9J7FytEoLmzp2jYcArzgCiEqRWYUTjuEQnSWPWPSlsoqocB10ARwIJATH7vNrd5FECc35w7SXPnTlmvhwkL1AdokY1DRBqlODYsUAzQmTiqOcwnVTP90kdzIxPHhgWKSXuQ819Di0YQ5sMPzlk90OMAC5QQd1c2rCGOQYIe548v/856Hhe8AvEGU31yYeGcFR0GldLQpbB4aX7kKasXLFAMMM0CJC3RGZWuLqle5TQwcoGGUUsMMgUkLVGa5AEjF+gf/7xDwwQyTb9RpomJIlVmpg96oON1wiUlEeb8pEkekLsUhohnRz10FNpfOiRCr26/rR1IhPGofgtriL14cZ7SBtdAB2AaBx5YZXF29p2+ppBCov/+UlMDs3WKyri1tsLCg6keEJ3QYYjU+mjr50jXosWEaadRW04fLryXSnkACxQARMLk+ah1DUSYP6iJwoDmOoYm0goL1ANEI4gUhTk1XhV2asjFC+cpzbBAIUAqiypRmCiEc9KaumxYoJBAoij7+PSaoAZxxmV8Kw4sUASwj8+LavgWVrcodEa19NIefQALFBGshw9LtyiUhegDWKCIWP1FEXYT84tCGK7IQvQBqe1IxBdwJuRvcbW6Qy/+V09s3A1Ne0SXMODWTugXcq4xO3s6G9EHpFcgNZ61EKG/BSQ1NRU9zVi5OlHqPXfKnvhuD3HYq0qzQq5SGH7z//ynj2LXH+077oSfaO9cNfqrDMkDclcD2Ss4464BQy0UFqS7k+8et0bbo0bNcSe3g6noAf7qm+/6Xv8eNQ3+UY2RZZHctsKsIjxGMVvtY8Q9i+S6GR9nR4s0r6NPklwLlKW7J4+KXAs07ise0gD3RDOxyLVAadiBbNzJtUAvYrSksjKWFZdcC/TvzWhznp1gKIXJsUDYEzFKb7KXSmWamBwLtP7waay+nCwNiMYhlwJh7VfcHedPvJXe/RSTJFcdIdbCwfubsVIXwDykMFM58kBqBdp51bSW3IShgY0zlTRJDT9kaUJYXNIrkJJhFNvNofbh+uc13BMdkYsp2z1j0LBAEcjCQsCkYYFCghmMC2Ny07dxggUKgXWzt0vp27tnGPB8hh6My/7M4wr/qwQAYbDJVJq3XhkGLJAPuJ0AVk9w1OkN10A+oJeZ5QkHC+QD7tCDladMb1L7a4be4I8Xfxv4fpwbo2Cm4trGU262hyCzESjuLZE4CoUjswLZ99bqFzsKMd3JdA3EUWjwZFogjkKDJ/OtMI5CgyXzAtkbPPULR6Hu5KIfaO69eMMRHIWCyYVA7W3l+p8Ez1EomNz0RM/H3BmMo5A/uRGo187xveAo5E+uxsI4CiVPrgTiKJQ8uRuN5yiULLkTiKNQsuRyPhDulBMHjkKvyaVAWJocZ30XR6HX5HZG4pmYtzvgKNQmtwLFHWTlKNQmtwLFneoBOArlfFI9R6H4iHqjKZ0HypO8cRITTHPPHXFVBJKuG19JSQzji58amiRR630awygzTLcbgmhLE0KsOA+a7A8TgFcNKZRAZJo/Og8apkkM44fpdcOUq0hhrggkuQhiAjA9bsAdzWjt3nSdpHIYO8R4QWAxPfWNUaDbWqVSqSmVbjvf0E2DGMaJ2VFAy5VKubzV7kiU9K3zTUPnOohx0zLcTphSfIFnSyBd373u7A+Ca7rBUYhpYyh5vLUx0heeLYGsNGa2jbLRdZNrIcYSxxt9BGk3kL7arw+oVqszxYnJTXXocLpesahRqVAgJr/s64YVgZzoGp22BTocTA2KQpzK8ouuxPHKo6qfZVseILwX1Ru7P6jAteA8NqlGrDVNEJMfkLp29933lBWq53n6jbJr27aO6Ry6Jj/xDrBi2gJ3MOYHQzXZ91rezCNrLUGL3nM7BEJ4klL81XWpesBGTmfZB2nLL2BIKnzmTF02vhPKjk2Xb5BJy97jLVUToajiaJQ9rNaW+m7x6MRcPjY1edPvuq6FTb3eXFKKXeu4SCXDYkGzHkz6QdTRffp62pjLR6emloKu7VkZv3zZuCIK4m/O5v3hxQciFVSBjddMeoAsuolWlgwQR9aEKmWmkY26EOpbrzabsyVJt9SfMxt0DlppmmiLhNf4YJZqPLAFQXGMEXW/gVEnmCPWEvITv5qn41yKQFBKY7KCtPoCjx4tL4W9InKIQDQqGOaSENqnxGSEtjj69JHrFeGd4tydvnNMWyS6rMLdVW/HI5MShBoQNejbfsR5/REJcCiTJZKYl4Jm1QfPEjMmyBoWT2AOj+rQ+REzCY2pIzf7lcbJ/wH9VD8KK3ri6QAAAABJRU5ErkJggg==",SidebarLogin=({onLogin:tr})=>{const rr=jsx$1(AccountPopoverLogin,{onLogin:tr});return jsx$1(AccountPopover,{content:rr,children:jsxs("div",{className:twMerge("group/sidebar-footer flex w-full items-baseline justify-start text-sm font-semibold leading-10 text-gray-600",tr?"cursor-pointer":"cursor-wait"),children:[jsx$1("img",{width:42,height:42,loading:"lazy",className:"group-hover/sidebar-footer:hidden",src:renownShort,alt:"Renown Login"}),jsx$1("img",{width:42,height:42,loading:"lazy",className:"hidden group-hover/sidebar-footer:block",src:renownShortHover,alt:"Renown Login Hover"})]})})},SidebarUser=({address:tr,etherscanUrl:rr,onDisconnect:ir})=>{const{data:lr}=useEnsName({address:tr}),fr=jsx$1(AccountPopoverUser,{address:tr,username:lr,onDisconnect:ir,etherscanUrl:rr});return jsx$1(AccountPopover,{content:fr,children:jsx$1("div",{className:"flex items-center justify-center rounded-sm",children:jsx$1(ENSAvatar,{address:tr,size:"40px"})})})},ConnectSidebarFooter=({address:tr,className:rr,onLogin:ir,onClickSettings:lr,onDisconnect:dr,etherscanUrl:fr="",...hr})=>jsxs(SidebarFooter,{...hr,className:twMerge("flex flex-col gap-2 border-t border-gray-300 px-2 py-4",rr),children:[jsx$1("div",{children:tr?jsx$1(SidebarUser,{address:tr,onDisconnect:dr,etherscanUrl:fr}):jsx$1(SidebarLogin,{onLogin:ir})}),jsxs("button",{"aria-label":"Settings",type:"button",className:twMerge("mt-3 flex w-full items-center justify-center outline-none",lr?"cursor-pointer":"cursor-wait"),onClick:lr,children:[jsx$1(Icon,{className:"text-gray-600",name:"Settings"}),jsx$1("span",{className:"hidden text-sm font-semibold leading-6 text-gray-800",children:"Settings"})]})]}),ConnectSidebarHeader=({onClick:tr,className:rr,children:ir,...lr})=>jsx$1(SidebarHeader,{...lr,className:twMerge("flex justify-center gap-4 border-b border-gray-300 py-4",rr),children:jsx$1("button",{"aria-label":"Home",className:tr?"cursor-pointer":"cursor-wait",onClick:tr,type:"button",children:jsx$1(Icon,{className:"text-gray-600",name:"ConnectSmall",size:24})})}),ConnectSidebar=({onClick:tr,address:rr,headerContent:ir,onClickSettings:lr,maxWidth:dr="304px",minWidth:fr="58px",onLogin:hr,onDisconnect:mr,etherscanUrl:gr,...yr})=>jsxs(Sidebar,{...yr,maxWidth:dr,minWidth:fr,children:[jsxs(SidebarPanel,{children:[jsx$1(ConnectSidebarHeader,{onClick:tr,children:ir}),jsx$1("div",{className:"flex flex-col",children:yr.children})]}),jsx$1(ConnectSidebarFooter,{address:rr,onClickSettings:lr,onLogin:hr,onDisconnect:mr,etherscanUrl:gr})]});function TabContent(tr){const{children:rr}=tr;return jsx$1("div",{children:rr})}var TABS_NAME="Tabs",[createTabsContext,createTabsScope]=createContextScope(TABS_NAME,[createRovingFocusGroupScope]),useRovingFocusGroupScope=createRovingFocusGroupScope(),[TabsProvider,useTabsContext]=createTabsContext(TABS_NAME),Tabs$1=React.forwardRef((tr,rr)=>{const{__scopeTabs:ir,value:lr,onValueChange:dr,defaultValue:fr,orientation:hr="horizontal",dir:mr,activationMode:gr="automatic",...yr}=tr,_r=useDirection(mr),[br,vr]=useControllableState({prop:lr,onChange:dr,defaultProp:fr??"",caller:TABS_NAME});return jsx$1(TabsProvider,{scope:ir,baseId:useId(),value:br,onValueChange:vr,orientation:hr,dir:_r,activationMode:gr,children:jsx$1(Primitive.div,{dir:_r,"data-orientation":hr,...yr,ref:rr})})});Tabs$1.displayName=TABS_NAME;var TAB_LIST_NAME="TabsList",TabsList=React.forwardRef((tr,rr)=>{const{__scopeTabs:ir,loop:lr=!0,...dr}=tr,fr=useTabsContext(TAB_LIST_NAME,ir),hr=useRovingFocusGroupScope(ir);return jsx$1(Root$3,{asChild:!0,...hr,orientation:fr.orientation,dir:fr.dir,loop:lr,children:jsx$1(Primitive.div,{role:"tablist","aria-orientation":fr.orientation,...dr,ref:rr})})});TabsList.displayName=TAB_LIST_NAME;var TRIGGER_NAME="TabsTrigger",TabsTrigger=React.forwardRef((tr,rr)=>{const{__scopeTabs:ir,value:lr,disabled:dr=!1,...fr}=tr,hr=useTabsContext(TRIGGER_NAME,ir),mr=useRovingFocusGroupScope(ir),gr=makeTriggerId(hr.baseId,lr),yr=makeContentId(hr.baseId,lr),_r=lr===hr.value;return jsx$1(Item,{asChild:!0,...mr,focusable:!dr,active:_r,children:jsx$1(Primitive.button,{type:"button",role:"tab","aria-selected":_r,"aria-controls":yr,"data-state":_r?"active":"inactive","data-disabled":dr?"":void 0,disabled:dr,id:gr,...fr,ref:rr,onMouseDown:composeEventHandlers(tr.onMouseDown,br=>{!dr&&br.button===0&&br.ctrlKey===!1?hr.onValueChange(lr):br.preventDefault()}),onKeyDown:composeEventHandlers(tr.onKeyDown,br=>{[" ","Enter"].includes(br.key)&&hr.onValueChange(lr)}),onFocus:composeEventHandlers(tr.onFocus,()=>{const br=hr.activationMode!=="manual";!_r&&!dr&&br&&hr.onValueChange(lr)})})})});TabsTrigger.displayName=TRIGGER_NAME;var CONTENT_NAME="TabsContent",TabsContent=React.forwardRef((tr,rr)=>{const{__scopeTabs:ir,value:lr,forceMount:dr,children:fr,...hr}=tr,mr=useTabsContext(CONTENT_NAME,ir),gr=makeTriggerId(mr.baseId,lr),yr=makeContentId(mr.baseId,lr),_r=lr===mr.value,br=React.useRef(_r);return React.useEffect(()=>{const vr=requestAnimationFrame(()=>br.current=!1);return()=>cancelAnimationFrame(vr)},[]),jsx$1(Presence,{present:dr||_r,children:({present:vr})=>jsx$1(Primitive.div,{"data-state":_r?"active":"inactive","data-orientation":mr.orientation,role:"tabpanel","aria-labelledby":gr,hidden:!vr,id:yr,tabIndex:0,...hr,ref:rr,style:{...tr.style,animationDuration:br.current?"0s":void 0},children:vr&&fr})})});TabsContent.displayName=CONTENT_NAME;function makeTriggerId(tr,rr){return`${tr}-trigger-${rr}`}function makeContentId(tr,rr){return`${tr}-content-${rr}`}var Root2=Tabs$1,List=TabsList,Trigger=TabsTrigger,Content$1=TabsContent;function Tabs({children:tr,defaultValue:rr}){return jsxs(Root2,{defaultValue:rr,className:"flex flex-col gap-2",children:[jsx$1("div",{className:"flex w-full justify-between",children:jsx$1(List,{className:"flex w-full gap-x-2 rounded-xl bg-slate-50 p-1 text-sm font-semibold text-gray-600 outline-none",children:React__default.Children.map(tr,(ir,lr)=>{if(!React__default.isValidElement(ir))return;const{label:dr,disabled:fr}=ir.props;return jsx$1(Trigger,{className:"data-[state='active']:tab-shadow ata-disabled:cursor-not-allowed data-disabled:text-gray-400 flex h-7 flex-1 items-center justify-center rounded-lg transition duration-300 data-[state='active']:bg-gray-50 data-[state='active']:text-gray-900",value:dr,disabled:fr??!1,children:dr},dr)})})}),jsx$1("div",{className:"mt-3 rounded-md bg-white",children:React__default.Children.map(tr,(ir,lr)=>{if(!React__default.isValidElement(ir))return;const{label:dr}=ir.props;return jsx$1(Content$1,{value:dr,children:ir},lr)})})]})}const c$1=tr=>typeof tr=="number"&&!isNaN(tr),d=tr=>typeof tr=="string",u=tr=>typeof tr=="function",p=tr=>d(tr)||u(tr)?tr:null,m=tr=>isValidElement(tr)||d(tr)||u(tr)||c$1(tr);function f(tr,rr,ir){ir===void 0&&(ir=300);const{scrollHeight:lr,style:dr}=tr;requestAnimationFrame(()=>{dr.minHeight="initial",dr.height=lr+"px",dr.transition=`all ${ir}ms`,requestAnimationFrame(()=>{dr.height="0",dr.padding="0",dr.margin="0",setTimeout(rr,ir)})})}function g(tr){let{enter:rr,exit:ir,appendPosition:lr=!1,collapse:dr=!0,collapseDuration:fr=300}=tr;return function(hr){let{children:mr,position:gr,preventExitTransition:yr,done:_r,nodeRef:br,isIn:vr,playToast:wr}=hr;const xr=lr?`${rr}--${gr}`:rr,Sr=lr?`${ir}--${gr}`:ir,Ar=useRef(0);return useLayoutEffect(()=>{const Ir=br.current,Mr=xr.split(" "),Or=$r=>{$r.target===br.current&&(wr(),Ir.removeEventListener("animationend",Or),Ir.removeEventListener("animationcancel",Or),Ar.current===0&&$r.type!=="animationcancel"&&Ir.classList.remove(...Mr))};Ir.classList.add(...Mr),Ir.addEventListener("animationend",Or),Ir.addEventListener("animationcancel",Or)},[]),useEffect(()=>{const Ir=br.current,Mr=()=>{Ir.removeEventListener("animationend",Mr),dr?f(Ir,_r,fr):_r()};vr||(yr?Mr():(Ar.current=1,Ir.className+=` ${Sr}`,Ir.addEventListener("animationend",Mr)))},[vr]),React__default.createElement(React__default.Fragment,null,mr)}}function y(tr,rr){return tr!=null?{content:tr.content,containerId:tr.props.containerId,id:tr.props.toastId,theme:tr.props.theme,type:tr.props.type,data:tr.props.data||{},isLoading:tr.props.isLoading,icon:tr.props.icon,status:rr}:{}}const v=new Map;let h=[];const T=new Set,E=tr=>T.forEach(rr=>rr(tr)),b=()=>v.size>0;function I(tr,rr){var ir;if(rr)return!((ir=v.get(rr))==null||!ir.isToastActive(tr));let lr=!1;return v.forEach(dr=>{dr.isToastActive(tr)&&(lr=!0)}),lr}function _(tr,rr){m(tr)&&(b()||h.push({content:tr,options:rr}),v.forEach(ir=>{ir.buildToast(tr,rr)}))}function C(tr,rr){v.forEach(ir=>{rr!=null&&rr!=null&&rr.containerId?(rr==null?void 0:rr.containerId)===ir.id&&ir.toggle(tr,rr==null?void 0:rr.id):ir.toggle(tr,rr==null?void 0:rr.id)})}function L(tr){const{subscribe:rr,getSnapshot:ir,setProps:lr}=useRef((function(fr){const hr=fr.containerId||1;return{subscribe(mr){const gr=(function(_r,br,vr){let wr=1,xr=0,Sr=[],Ar=[],Ir=[],Mr=br;const Or=new Map,$r=new Set,Dr=()=>{Ir=Array.from(Or.values()),$r.forEach(Jr=>Jr())},zr=Jr=>{Ar=Jr==null?[]:Ar.filter($n=>$n!==Jr),Dr()},Fr=Jr=>{const{toastId:$n,onOpen:Qr,updateId:Zn,children:qn}=Jr.props,Xn=Zn==null;Jr.staleId&&Or.delete(Jr.staleId),Or.set($n,Jr),Ar=[...Ar,Jr.props.toastId].filter(Lr=>Lr!==Jr.staleId),Dr(),vr(y(Jr,Xn?"added":"updated")),Xn&&u(Qr)&&Qr(isValidElement(qn)&&qn.props)};return{id:_r,props:Mr,observe:Jr=>($r.add(Jr),()=>$r.delete(Jr)),toggle:(Jr,$n)=>{Or.forEach(Qr=>{$n!=null&&$n!==Qr.props.toastId||u(Qr.toggle)&&Qr.toggle(Jr)})},removeToast:zr,toasts:Or,clearQueue:()=>{xr-=Sr.length,Sr=[]},buildToast:(Jr,$n)=>{if((Jn=>{let{containerId:ni,toastId:Yn,updateId:ei}=Jn;const ai=ni?ni!==_r:_r!==1,pi=Or.has(Yn)&&ei==null;return ai||pi})($n))return;const{toastId:Qr,updateId:Zn,data:qn,staleId:Xn,delay:Lr}=$n,Gr=()=>{zr(Qr)},Hn=Zn==null;Hn&&xr++;const ii={...Mr,style:Mr.toastStyle,key:wr++,...Object.fromEntries(Object.entries($n).filter(Jn=>{let[ni,Yn]=Jn;return Yn!=null})),toastId:Qr,updateId:Zn,data:qn,closeToast:Gr,isIn:!1,className:p($n.className||Mr.toastClassName),bodyClassName:p($n.bodyClassName||Mr.bodyClassName),progressClassName:p($n.progressClassName||Mr.progressClassName),autoClose:!$n.isLoading&&(oi=$n.autoClose,ri=Mr.autoClose,oi===!1||c$1(oi)&&oi>0?oi:ri),deleteToast(){const Jn=Or.get(Qr),{onClose:ni,children:Yn}=Jn.props;u(ni)&&ni(isValidElement(Yn)&&Yn.props),vr(y(Jn,"removed")),Or.delete(Qr),xr--,xr<0&&(xr=0),Sr.length>0?Fr(Sr.shift()):Dr()}};var oi,ri;ii.closeButton=Mr.closeButton,$n.closeButton===!1||m($n.closeButton)?ii.closeButton=$n.closeButton:$n.closeButton===!0&&(ii.closeButton=!m(Mr.closeButton)||Mr.closeButton);let ti=Jr;isValidElement(Jr)&&!d(Jr.type)?ti=cloneElement(Jr,{closeToast:Gr,toastProps:ii,data:qn}):u(Jr)&&(ti=Jr({closeToast:Gr,toastProps:ii,data:qn}));const si={content:ti,props:ii,staleId:Xn};Mr.limit&&Mr.limit>0&&xr>Mr.limit&&Hn?Sr.push(si):c$1(Lr)?setTimeout(()=>{Fr(si)},Lr):Fr(si)},setProps(Jr){Mr=Jr},setToggle:(Jr,$n)=>{Or.get(Jr).toggle=$n},isToastActive:Jr=>Ar.some($n=>$n===Jr),getSnapshot:()=>Ir}})(hr,fr,E);v.set(hr,gr);const yr=gr.observe(mr);return h.forEach(_r=>_(_r.content,_r.options)),h=[],()=>{yr(),v.delete(hr)}},setProps(mr){var gr;(gr=v.get(hr))==null||gr.setProps(mr)},getSnapshot(){var mr;return(mr=v.get(hr))==null?void 0:mr.getSnapshot()}}})(tr)).current;lr(tr);const dr=useSyncExternalStore(rr,ir,ir);return{getToastToRender:function(fr){if(!dr)return[];const hr=new Map;return tr.newestOnTop&&dr.reverse(),dr.forEach(mr=>{const{position:gr}=mr.props;hr.has(gr)||hr.set(gr,[]),hr.get(gr).push(mr)}),Array.from(hr,mr=>fr(mr[0],mr[1]))},isToastActive:I,count:dr==null?void 0:dr.length}}function N(tr){const[rr,ir]=useState(!1),[lr,dr]=useState(!1),fr=useRef(null),hr=useRef({start:0,delta:0,removalDistance:0,canCloseOnClick:!0,canDrag:!1,didMove:!1}).current,{autoClose:mr,pauseOnHover:gr,closeToast:yr,onClick:_r,closeOnClick:br}=tr;var vr,wr;function xr(){ir(!0)}function Sr(){ir(!1)}function Ar(Or){const $r=fr.current;hr.canDrag&&$r&&(hr.didMove=!0,rr&&Sr(),hr.delta=tr.draggableDirection==="x"?Or.clientX-hr.start:Or.clientY-hr.start,hr.start!==Or.clientX&&(hr.canCloseOnClick=!1),$r.style.transform=`translate3d(${tr.draggableDirection==="x"?`${hr.delta}px, var(--y)`:`0, calc(${hr.delta}px + var(--y))`},0)`,$r.style.opacity=""+(1-Math.abs(hr.delta/hr.removalDistance)))}function Ir(){document.removeEventListener("pointermove",Ar),document.removeEventListener("pointerup",Ir);const Or=fr.current;if(hr.canDrag&&hr.didMove&&Or){if(hr.canDrag=!1,Math.abs(hr.delta)>hr.removalDistance)return dr(!0),tr.closeToast(),void tr.collapseAll();Or.style.transition="transform 0.2s, opacity 0.2s",Or.style.removeProperty("transform"),Or.style.removeProperty("opacity")}}(wr=v.get((vr={id:tr.toastId,containerId:tr.containerId,fn:ir}).containerId||1))==null||wr.setToggle(vr.id,vr.fn),useEffect(()=>{if(tr.pauseOnFocusLoss)return document.hasFocus()||Sr(),window.addEventListener("focus",xr),window.addEventListener("blur",Sr),()=>{window.removeEventListener("focus",xr),window.removeEventListener("blur",Sr)}},[tr.pauseOnFocusLoss]);const Mr={onPointerDown:function(Or){if(tr.draggable===!0||tr.draggable===Or.pointerType){hr.didMove=!1,document.addEventListener("pointermove",Ar),document.addEventListener("pointerup",Ir);const $r=fr.current;hr.canCloseOnClick=!0,hr.canDrag=!0,$r.style.transition="none",tr.draggableDirection==="x"?(hr.start=Or.clientX,hr.removalDistance=$r.offsetWidth*(tr.draggablePercent/100)):(hr.start=Or.clientY,hr.removalDistance=$r.offsetHeight*(tr.draggablePercent===80?1.5*tr.draggablePercent:tr.draggablePercent)/100)}},onPointerUp:function(Or){const{top:$r,bottom:Dr,left:zr,right:Fr}=fr.current.getBoundingClientRect();Or.nativeEvent.type!=="touchend"&&tr.pauseOnHover&&Or.clientX>=zr&&Or.clientX<=Fr&&Or.clientY>=$r&&Or.clientY<=Dr?Sr():xr()}};return mr&&gr&&(Mr.onMouseEnter=Sr,tr.stacked||(Mr.onMouseLeave=xr)),br&&(Mr.onClick=Or=>{_r&&_r(Or),hr.canCloseOnClick&&yr()}),{playToast:xr,pauseToast:Sr,isRunning:rr,preventExitTransition:lr,toastRef:fr,eventHandlers:Mr}}function $(tr){let{delay:rr,isRunning:ir,closeToast:lr,type:dr="default",hide:fr,className:hr,style:mr,controlledProgress:gr,progress:yr,rtl:_r,isIn:br,theme:vr}=tr;const wr=fr||gr&&yr===0,xr={...mr,animationDuration:`${rr}ms`,animationPlayState:ir?"running":"paused"};gr&&(xr.transform=`scaleX(${yr})`);const Sr=clsx("Toastify__progress-bar",gr?"Toastify__progress-bar--controlled":"Toastify__progress-bar--animated",`Toastify__progress-bar-theme--${vr}`,`Toastify__progress-bar--${dr}`,{"Toastify__progress-bar--rtl":_r}),Ar=u(hr)?hr({rtl:_r,type:dr,defaultClassName:Sr}):clsx(Sr,hr),Ir={[gr&&yr>=1?"onTransitionEnd":"onAnimationEnd"]:gr&&yr<1?null:()=>{br&&lr()}};return React__default.createElement("div",{className:"Toastify__progress-bar--wrp","data-hidden":wr},React__default.createElement("div",{className:`Toastify__progress-bar--bg Toastify__progress-bar-theme--${vr} Toastify__progress-bar--${dr}`}),React__default.createElement("div",{role:"progressbar","aria-hidden":wr?"true":"false","aria-label":"notification timer",className:Ar,style:xr,...Ir}))}let w=1;const k=()=>""+w++;function P(tr){return tr&&(d(tr.toastId)||c$1(tr.toastId))?tr.toastId:k()}function M(tr,rr){return _(tr,rr),rr.toastId}function x(tr,rr){return{...rr,type:rr&&rr.type||tr,toastId:P(rr)}}function A(tr){return(rr,ir)=>M(rr,x(tr,ir))}function B(tr,rr){return M(tr,x("default",rr))}B.loading=(tr,rr)=>M(tr,x("default",{isLoading:!0,autoClose:!1,closeOnClick:!1,closeButton:!1,draggable:!1,...rr})),B.promise=function(tr,rr,ir){let lr,{pending:dr,error:fr,success:hr}=rr;dr&&(lr=d(dr)?B.loading(dr,ir):B.loading(dr.render,{...ir,...dr}));const mr={isLoading:null,autoClose:null,closeOnClick:null,closeButton:null,draggable:null},gr=(_r,br,vr)=>{if(br==null)return void B.dismiss(lr);const wr={type:_r,...mr,...ir,data:vr},xr=d(br)?{render:br}:br;return lr?B.update(lr,{...wr,...xr}):B(xr.render,{...wr,...xr}),vr},yr=u(tr)?tr():tr;return yr.then(_r=>gr("success",hr,_r)).catch(_r=>gr("error",fr,_r)),yr},B.success=A("success"),B.info=A("info"),B.error=A("error"),B.warning=A("warning"),B.warn=B.warning,B.dark=(tr,rr)=>M(tr,x("default",{theme:"dark",...rr})),B.dismiss=function(tr){(function(rr){var ir;if(b()){if(rr==null||d(ir=rr)||c$1(ir))v.forEach(lr=>{lr.removeToast(rr)});else if(rr&&("containerId"in rr||"id"in rr)){const lr=v.get(rr.containerId);lr?lr.removeToast(rr.id):v.forEach(dr=>{dr.removeToast(rr.id)})}}else h=h.filter(lr=>rr!=null&&lr.options.toastId!==rr)})(tr)},B.clearWaitingQueue=function(tr){tr===void 0&&(tr={}),v.forEach(rr=>{!rr.props.limit||tr.containerId&&rr.id!==tr.containerId||rr.clearQueue()})},B.isActive=I,B.update=function(tr,rr){rr===void 0&&(rr={});const ir=((lr,dr)=>{var fr;let{containerId:hr}=dr;return(fr=v.get(hr||1))==null?void 0:fr.toasts.get(lr)})(tr,rr);if(ir){const{props:lr,content:dr}=ir,fr={delay:100,...lr,...rr,toastId:rr.toastId||tr,updateId:k()};fr.toastId!==tr&&(fr.staleId=tr);const hr=fr.render||dr;delete fr.render,M(hr,fr)}},B.done=tr=>{B.update(tr,{progress:1})},B.onChange=function(tr){return T.add(tr),()=>{T.delete(tr)}},B.play=tr=>C(!0,tr),B.pause=tr=>C(!1,tr);const O=typeof window<"u"?useLayoutEffect:useEffect,D=tr=>{let{theme:rr,type:ir,isLoading:lr,...dr}=tr;return React__default.createElement("svg",{viewBox:"0 0 24 24",width:"100%",height:"100%",fill:rr==="colored"?"currentColor":`var(--toastify-icon-color-${ir})`,...dr})},z={info:function(tr){return React__default.createElement(D,{...tr},React__default.createElement("path",{d:"M12 0a12 12 0 1012 12A12.013 12.013 0 0012 0zm.25 5a1.5 1.5 0 11-1.5 1.5 1.5 1.5 0 011.5-1.5zm2.25 13.5h-4a1 1 0 010-2h.75a.25.25 0 00.25-.25v-4.5a.25.25 0 00-.25-.25h-.75a1 1 0 010-2h1a2 2 0 012 2v4.75a.25.25 0 00.25.25h.75a1 1 0 110 2z"}))},warning:function(tr){return React__default.createElement(D,{...tr},React__default.createElement("path",{d:"M23.32 17.191L15.438 2.184C14.728.833 13.416 0 11.996 0c-1.42 0-2.733.833-3.443 2.184L.533 17.448a4.744 4.744 0 000 4.368C1.243 23.167 2.555 24 3.975 24h16.05C22.22 24 24 22.044 24 19.632c0-.904-.251-1.746-.68-2.44zm-9.622 1.46c0 1.033-.724 1.823-1.698 1.823s-1.698-.79-1.698-1.822v-.043c0-1.028.724-1.822 1.698-1.822s1.698.79 1.698 1.822v.043zm.039-12.285l-.84 8.06c-.057.581-.408.943-.897.943-.49 0-.84-.367-.896-.942l-.84-8.065c-.057-.624.25-1.095.779-1.095h1.91c.528.005.84.476.784 1.1z"}))},success:function(tr){return React__default.createElement(D,{...tr},React__default.createElement("path",{d:"M12 0a12 12 0 1012 12A12.014 12.014 0 0012 0zm6.927 8.2l-6.845 9.289a1.011 1.011 0 01-1.43.188l-4.888-3.908a1 1 0 111.25-1.562l4.076 3.261 6.227-8.451a1 1 0 111.61 1.183z"}))},error:function(tr){return React__default.createElement(D,{...tr},React__default.createElement("path",{d:"M11.983 0a12.206 12.206 0 00-8.51 3.653A11.8 11.8 0 000 12.207 11.779 11.779 0 0011.8 24h.214A12.111 12.111 0 0024 11.791 11.766 11.766 0 0011.983 0zM10.5 16.542a1.476 1.476 0 011.449-1.53h.027a1.527 1.527 0 011.523 1.47 1.475 1.475 0 01-1.449 1.53h-.027a1.529 1.529 0 01-1.523-1.47zM11 12.5v-6a1 1 0 012 0v6a1 1 0 11-2 0z"}))},spinner:function(){return React__default.createElement("div",{className:"Toastify__spinner"})}},R=tr=>{const{isRunning:rr,preventExitTransition:ir,toastRef:lr,eventHandlers:dr,playToast:fr}=N(tr),{closeButton:hr,children:mr,autoClose:gr,onClick:yr,type:_r,hideProgressBar:br,closeToast:vr,transition:wr,position:xr,className:Sr,style:Ar,bodyClassName:Ir,bodyStyle:Mr,progressClassName:Or,progressStyle:$r,updateId:Dr,role:zr,progress:Fr,rtl:Jr,toastId:$n,deleteToast:Qr,isIn:Zn,isLoading:qn,closeOnClick:Xn,theme:Lr}=tr,Gr=clsx("Toastify__toast",`Toastify__toast-theme--${Lr}`,`Toastify__toast--${_r}`,{"Toastify__toast--rtl":Jr},{"Toastify__toast--close-on-click":Xn}),Hn=u(Sr)?Sr({rtl:Jr,position:xr,type:_r,defaultClassName:Gr}):clsx(Gr,Sr),ii=(function(si){let{theme:Jn,type:ni,isLoading:Yn,icon:ei}=si,ai=null;const pi={theme:Jn,type:ni};return ei===!1||(u(ei)?ai=ei({...pi,isLoading:Yn}):isValidElement(ei)?ai=cloneElement(ei,pi):Yn?ai=z.spinner():(bi=>bi in z)(ni)&&(ai=z[ni](pi))),ai})(tr),oi=!!Fr||!gr,ri={closeToast:vr,type:_r,theme:Lr};let ti=null;return hr===!1||(ti=u(hr)?hr(ri):isValidElement(hr)?cloneElement(hr,ri):(function(si){let{closeToast:Jn,theme:ni,ariaLabel:Yn="close"}=si;return React__default.createElement("button",{className:`Toastify__close-button Toastify__close-button--${ni}`,type:"button",onClick:ei=>{ei.stopPropagation(),Jn(ei)},"aria-label":Yn},React__default.createElement("svg",{"aria-hidden":"true",viewBox:"0 0 14 16"},React__default.createElement("path",{fillRule:"evenodd",d:"M7.71 8.23l3.75 3.75-1.48 1.48-3.75-3.75-3.75 3.75L1 11.98l3.75-3.75L1 4.48 2.48 3l3.75 3.75L9.98 3l1.48 1.48-3.75 3.75z"})))})(ri)),React__default.createElement(wr,{isIn:Zn,done:Qr,position:xr,preventExitTransition:ir,nodeRef:lr,playToast:fr},React__default.createElement("div",{id:$n,onClick:yr,"data-in":Zn,className:Hn,...dr,style:Ar,ref:lr},React__default.createElement("div",{...Zn&&{role:zr},className:u(Ir)?Ir({type:_r}):clsx("Toastify__toast-body",Ir),style:Mr},ii!=null&&React__default.createElement("div",{className:clsx("Toastify__toast-icon",{"Toastify--animate-icon Toastify__zoom-enter":!qn})},ii),React__default.createElement("div",null,mr)),ti,React__default.createElement($,{...Dr&&!oi?{key:`pb-${Dr}`}:{},rtl:Jr,theme:Lr,delay:gr,isRunning:rr,isIn:Zn,closeToast:vr,hide:br,type:_r,style:$r,className:Or,controlledProgress:oi,progress:Fr||0})))},S=function(tr,rr){return rr===void 0&&(rr=!1),{enter:`Toastify--animate Toastify__${tr}-enter`,exit:`Toastify--animate Toastify__${tr}-exit`,appendPosition:rr}},H=g(S("bounce",!0));g(S("slide",!0));g(S("zoom"));g(S("flip"));const q={position:"top-right",transition:H,autoClose:5e3,closeButton:!0,pauseOnHover:!0,pauseOnFocusLoss:!0,draggable:"touch",draggablePercent:80,draggableDirection:"x",role:"alert",theme:"light"};function Q(tr){let rr={...q,...tr};const ir=tr.stacked,[lr,dr]=useState(!0),fr=useRef(null),{getToastToRender:hr,isToastActive:mr,count:gr}=L(rr),{className:yr,style:_r,rtl:br,containerId:vr}=rr;function wr(Sr){const Ar=clsx("Toastify__toast-container",`Toastify__toast-container--${Sr}`,{"Toastify__toast-container--rtl":br});return u(yr)?yr({position:Sr,rtl:br,defaultClassName:Ar}):clsx(Ar,p(yr))}function xr(){ir&&(dr(!0),B.play())}return O(()=>{if(ir){var Sr;const Ar=fr.current.querySelectorAll('[data-in="true"]'),Ir=12,Mr=(Sr=rr.position)==null?void 0:Sr.includes("top");let Or=0,$r=0;Array.from(Ar).reverse().forEach((Dr,zr)=>{const Fr=Dr;Fr.classList.add("Toastify__toast--stacked"),zr>0&&(Fr.dataset.collapsed=`${lr}`),Fr.dataset.pos||(Fr.dataset.pos=Mr?"top":"bot");const Jr=Or*(lr?.2:1)+(lr?0:Ir*zr);Fr.style.setProperty("--y",`${Mr?Jr:-1*Jr}px`),Fr.style.setProperty("--g",`${Ir}`),Fr.style.setProperty("--s",""+(1-(lr?$r:0))),Or+=Fr.offsetHeight,$r+=.025})}},[lr,gr,ir]),React__default.createElement("div",{ref:fr,className:"Toastify",id:vr,onMouseEnter:()=>{ir&&(dr(!1),B.pause())},onMouseLeave:xr},hr((Sr,Ar)=>{const Ir=Ar.length?{..._r}:{..._r,pointerEvents:"none"};return React__default.createElement("div",{className:wr(Sr),style:Ir,key:`container-${Sr}`},Ar.map(Mr=>{let{content:Or,props:$r}=Mr;return React__default.createElement(R,{...$r,stacked:ir,collapseAll:xr,isIn:mr($r.toastId,$r.containerId),style:$r.style,key:`toast-${$r.key}`},Or)}))}))}function isConnectTypeOptions(tr){return tr==="connect-success"||tr==="connect-warning"||tr==="connect-loading"||tr==="connect-deleted"}function getDefaultOptions(tr){if(isConnectTypeOptions(tr)){const rr={};switch(tr){case"connect-success":rr.type="success",rr.icon=jsx$1(Icon,{className:"text-green-800",name:"CheckCircleFill",size:24});break;case"connect-warning":rr.type="warning",rr.icon=jsx$1(Icon,{className:"text-gray-600",name:"WarningFill",size:24});break;case"connect-loading":rr.type="default",rr.icon=jsx$1(Icon,{className:"text-gray-600",name:"ClockFill",size:24});break;case"connect-deleted":rr.type="error",rr.icon=jsx$1(Icon,{className:"text-red-800",name:"TrashFill",size:24});break}return rr}return{type:tr}}function toast$1(tr,rr){const{type:ir="default",...lr}=rr||{},dr=getDefaultOptions(ir);return B(tr,{...dr,...lr})}const CloseButton=({closeToast:tr})=>jsx$1("button",{className:"flex items-center text-gray-500 hover:text-gray-600",onClick:tr,children:jsx$1(Icon,{name:"XmarkLight",size:16})}),ToastContainer=tr=>jsx$1(Q,{closeButton:CloseButton,...tr}),Toggle=forwardRef(function tr(rr,ir){return jsxs("label",{className:"relative cursor-pointer items-center",htmlFor:rr.id,children:[jsx$1("input",{className:"peer sr-only",ref:ir,type:"checkbox",value:"",...rr}),jsx$1("div",{className:"peer h-6 w-11 rounded-full bg-gray-500 after:absolute after:start-0.5 after:top-0.5 after:size-5 after:rounded-full after:border after:border-none after:bg-gray-50 after:transition-all peer-checked:bg-blue-900 peer-checked:after:translate-x-full peer-focus:outline-none"})]})}),mainnet=defineChain({id:1,name:"Ethereum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},blockTime:12e3,rpcUrls:{default:{http:["https://eth.merkle.io"]}},blockExplorers:{default:{name:"Etherscan",url:"https://etherscan.io",apiUrl:"https://api.etherscan.io/api"}},contracts:{ensRegistry:{address:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},ensUniversalResolver:{address:"0xce01f8eee7E479C928F8919abD53E553a36CeF67",blockCreated:19258213},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:14353601}}}),wagmiConfig=createConfig({chains:[mainnet],transports:{[mainnet.id]:http()}}),defaultQueryClient=new QueryClient;function WagmiContext(tr){const{children:rr,wagmiProviderProps:ir,queryClientProviderProps:lr}=tr,{config:dr=wagmiConfig,...fr}=ir??{},{client:hr=defaultQueryClient,...mr}=lr??{};return jsx$1(WagmiProvider,{config:dr,...fr,children:jsx$1(QueryClientProvider,{client:hr,...mr,children:rr})})}const name="@powerhousedao/connect",productName="Powerhouse-Connect",version$1="5.0.0-staging.26",description="Powerhouse Connect",main="./dist/index.html",type="module",engines={node:">=22.0.0"},files$1=["dist","nginx.conf","nginx.sh","scripts"],license="AGPL-3.0-only",author="acaldas@powerhouse.inc",repository={type:"git",url:"https://github.com/powerhouse-inc/powerhouse"},bugs={url:"https://github.com/powerhouse-inc/powerhouse/issues"},homepage="https://github.com/powerhouse-inc/powerhouse#readme",scripts={"build:tsc":"tsc --build",prepublishOnly:"npm run build",lint:"eslint .","lint:fix":"eslint --fix .","lint:nx":"eslint --quiet --fix .",format:'prettier --write "**/*.+(js|ts|jsx|tsx|json)"',dev:"vite dev",prebuild:"npm run clean && tsc --build --noEmit",build:"NODE_OPTIONS=--max-old-space-size=6144 vite build",preview:"vite preview",e2e:"playwright test","cy:open":"cypress open","build:service-worker":"tsc --build ./tsconfig.sw.json",clean:"rimraf dist","clean:node_modules":"rimraf node_modules","docker:build":"docker build -f ./Dockerfile --tag connect-test-dev --build-arg TAG=dev .","docker:run":"docker run -it -p 4000:4000 -v $(realpath ../../../monorepo):/monorepo -v $(pwd)/nginx.conf:/etc/nginx/nginx.conf.template -e PH_USE_LOCAL=true -e PH_CONNECT_BASE_PATH=/develop/powerhouse/connect -e PORT=4000 connect-test-dev"},devDependencies={"@didtools/key-webcrypto":"^0.2.0","@playwright/test":"^1.41.2","@powerhousedao/builder-tools":"workspace:*","@powerhousedao/common":"workspace:*","@powerhousedao/config":"workspace:*","@powerhousedao/design-system":"workspace:*","@powerhousedao/diff-analyzer":"^0.0.0-dev.10","@powerhousedao/reactor-browser":"workspace:*","@renown/sdk":"workspace:*","@rollup/plugin-node-resolve":"^15.2.3","@sentry/browser":"^9.1.0","@sentry/react":"^7.109.0","@sentry/vite-plugin":"^2.23.0","@tailwindcss/vite":"^4.1.4","@tanstack/react-virtual":"^3.8.1","@types/node":"^22.15.17","@types/react":"^18.2.79","@types/react-dom":"^18.2.18","@types/uuid":"^9.0.7","@types/wicg-file-system-access":"^2020.9.6","@vitejs/plugin-basic-ssl":"^2.0.0","@vitejs/plugin-react":"^4.4.1",asar:"^3.2.0","did-jwt":"^8.0.14","did-jwt-vc":"^4.0.12","did-key-creator":"^1.2.0","document-drive":"workspace:*","document-model":"workspace:*",esbuild:"^0.24.0","fast-deep-equal":"^3.1.3",graphql:"^16.11.0","graphql-request":"^6.1.0",i18next:"^23.7.6",localforage:"^1.10.0",playwright:"^1.41.2","playwright-core":"^1.41.2",react:"^18.3.1","react-dom":"^18.3.1","react-error-boundary":"^4.0.11","react-hotkeys-hook":"^4.5.0","react-i18next":"^13.5.0","react-router-dom":"^6.11.2","tailwind-merge":"^3.0.2",tailwindcss:"^4.1.4",uint8arrays:"^5.1.0",uuid:"^9.0.1",viem:"^2.8.13",vite:"^6.3.3","vite-envs":"^4.6.0","vite-plugin-html":"^3.2.2","vite-plugin-node-polyfills":"^0.24.0","vite-plugin-svgr":"^4.3.0","vite-tsconfig-paths":"^5.1.4","xvfb-maybe":"^0.2.1"},optionalDependencies={"@esbuild/linux-x64":"^0.21.4","@rollup/rollup-linux-x64-musl":"4.14.3"},packageJson={name,productName,version:version$1,description,main,type,engines,files:files$1,license,author,repository,bugs,homepage,scripts,devDependencies,optionalDependencies};function getBasePath(){if(typeof document>"u")return"/";const tr=document.querySelector("base");return(tr==null?void 0:tr.getAttribute("href"))||"/"}const version=packageJson.version,APP_VERSION=window.__VITE_ENVS.APP_VERSION||version,WARN_OUTDATED_APP=window.__VITE_ENVS.PH_CONNECT_WARN_OUTDATED_APP||"false",PH_CONNECT_STUDIO_MODE=window.__VITE_ENVS.PH_CONNECT_STUDIO_MODE||"false",DISABLE_ADD_DRIVE=window.__VITE_ENVS.PH_CONNECT_DISABLE_ADD_DRIVE||"false",SEARCH_BAR_ENABLED=window.__VITE_ENVS.PH_CONNECT_SEARCH_BAR_ENABLED||void 0,PH_CONNECT_ROUTER_BASENAME=getBasePath()||"/",PH_CONNECT_SENTRY_DSN=window.__VITE_ENVS.PH_CONNECT_SENTRY_DSN||"",PH_CONNECT_SENTRY_ENV=window.__VITE_ENVS.PH_CONNECT_SENTRY_ENV||"dev",PH_CONNECT_SENTRY_TRACING_ENABLED=window.__VITE_ENVS.PH_CONNECT_SENTRY_TRACING_ENABLED||"false",GA_TRACKING_ID=window.__VITE_ENVS.PH_CONNECT_GA_TRACKING_ID,PH_CONNECT_CLI_VERSION=window.__VITE_ENVS.PH_CONNECT_CLI_VERSION||void 0,PH_CONNECT_ANALYTICS_DATABASE_NAME=window.__VITE_ENVS.PH_CONNECT_ANALYTICS_DATABASE_NAME||`${PH_CONNECT_ROUTER_BASENAME.replace(/\//g,"")}:analytics`,PH_CONNECT_ANALYTICS_DATABASE_WORKER_DISABLED=window.__VITE_ENVS.PH_CONNECT_ANALYTICS_DATABASE_WORKER_DISABLED||"false",PH_CONNECT_DIFF_ANALYTICS_ENABLED=window.__VITE_ENVS.PH_CONNECT_DIFF_ANALYTICS_ENABLED||"false",PH_CONNECT_DRIVE_ANALYTICS_ENABLED=window.__VITE_ENVS.PH_CONNECT_DRIVE_ANALYTICS_ENABLED||"false",PH_CONNECT_EXTERNAL_PROCESSORS_ENABLED=window.__VITE_ENVS.PH_CONNECT_EXTERNAL_PROCESSORS_ENABLED||"true",LOG_LEVEL=isLogLevel(window.__VITE_ENVS.LOG_LEVEL)?window.__VITE_ENVS.LOG_LEVEL:"info";setLogLevel(LOG_LEVEL);logger$6.debug(`Setting log level to ${window.__VITE_ENVS.LOG_LEVEL}.`);const connectConfig={appVersion:APP_VERSION,studioMode:PH_CONNECT_STUDIO_MODE.toString()==="true",warnOutdatedApp:WARN_OUTDATED_APP==="true",routerBasename:PH_CONNECT_ROUTER_BASENAME,analytics:{databaseName:PH_CONNECT_ANALYTICS_DATABASE_NAME,useWorker:PH_CONNECT_ANALYTICS_DATABASE_WORKER_DISABLED!=="true",driveAnalyticsEnabled:PH_CONNECT_DRIVE_ANALYTICS_ENABLED==="true",diffProcessorEnabled:PH_CONNECT_DIFF_ANALYTICS_ENABLED==="true",externalProcessorsEnabled:PH_CONNECT_EXTERNAL_PROCESSORS_ENABLED==="true"},sentry:{dsn:PH_CONNECT_SENTRY_DSN,env:PH_CONNECT_SENTRY_ENV,tracing:PH_CONNECT_SENTRY_TRACING_ENABLED==="true"},content:{showSearchBar:SEARCH_BAR_ENABLED==="true"},drives:{addDriveEnabled:DISABLE_ADD_DRIVE!=="true"},gaTrackingId:GA_TRACKING_ID,phCliVersion:PH_CONNECT_CLI_VERSION},namespace$1=connectConfig.routerBasename,ACCEPTED_COOKIES_KEY_STORAGE=`${namespace$1}:acceptedCookies`,listeners$1=new Set;let cookies=getInitial$1();function getInitial$1(){try{const tr=localStorage.getItem(ACCEPTED_COOKIES_KEY_STORAGE);return tr?JSON.parse(tr):{analytics:!1,marketing:!1,functional:!1}}catch{return{analytics:!1,marketing:!1,functional:!1}}}function getCookies(){return cookies}function setCookies(tr){cookies=tr(cookies),localStorage.setItem(ACCEPTED_COOKIES_KEY_STORAGE,JSON.stringify(cookies)),listeners$1.forEach(rr=>rr())}function subscribe$1(tr){return listeners$1.add(tr),()=>listeners$1.delete(tr)}const useAcceptedCookies=()=>[useSyncExternalStore(subscribe$1,getCookies,getCookies),setCookies];function gtag(...tr){var rr;(rr=window.dataLayer)==null||rr.push(...tr)}const Analytics=()=>{const tr=connectConfig.gaTrackingId,[{analytics:rr}]=useAcceptedCookies(),ir=tr&&rr;return useEffect(()=>{if(ir){const lr=document.createElement("script");return lr.src=`https://www.googletagmanager.com/gtag/js?id=${tr}`,lr.async=!0,document.head.appendChild(lr),window.dataLayer=window.dataLayer||[],gtag("js",new Date),gtag("config",tr),()=>{document.head.removeChild(lr)}}},[ir,tr]),null},SentryProvider=({children:tr})=>(useInitSentry(),tr);class DocumentEditorDebugTools{constructor(rr){ki(this,"document");ki(this,"operations",[]);rr&&(this.document=rr)}operationsToTableObject(rr){return rr.map(ir=>({...ir,input:JSON.stringify(ir.action.input)}))}setDocument(rr){this.document=rr}getDocument(){return this.document}getOperations(){return this.operations}pushOperation(rr){this.operations.push(rr)}operationsTable(){var ir;this.document||console.warn("No document");const rr=Object.values(((ir=this.document)==null?void 0:ir.operations)||{}).flatMap(lr=>lr).sort((lr,dr)=>lr.index-dr.index);console.table(this.operationsToTableObject(rr))}scopeOperationsTable(rr){var lr;this.document||console.warn("No document");const ir=((lr=this.document)==null?void 0:lr.operations[rr])||[];console.table(this.operationsToTableObject(ir))}operationsLog(){console.log(this.operations)}operationsLogTable(){console.table(this.operationsToTableObject(this.operations))}clear(){this.operations=[],this.document=void 0}}const SUPPORTED_STRATEGIES=["preserve-all","preserve-by-url-and-detach"],getDrivePreservationStrategy=()=>{const tr=window.__VITE_ENVS.PH_CONNECT_DRIVES_PRESERVE_STRATEGY;return tr&&(ir=>SUPPORTED_STRATEGIES.includes(ir))(tr)?tr:"preserve-by-url-and-detach"},createRemoveOldRemoteDrivesConfig=tr=>{if(tr.length===0)return{strategy:"preserve-all"};switch(getDrivePreservationStrategy()){case"preserve-all":return{strategy:"preserve-all"};case"preserve-by-url-and-detach":return{strategy:"preserve-by-url-and-detach",urls:tr};default:return{strategy:"preserve-by-url-and-detach",urls:tr}}},DEFAULT_DRIVES_URL=window.__VITE_ENVS.PH_CONNECT_DEFAULT_DRIVES_URL||void 0,defaultDrivesUrl=DEFAULT_DRIVES_URL?DEFAULT_DRIVES_URL.split(","):[],getReactorDefaultDrivesConfig=()=>({defaultDrives:{remoteDrives:defaultDrivesUrl.map(rr=>({url:rr,options:{sharingType:"PUBLIC",availableOffline:!0,listeners:[{block:!0,callInfo:{data:rr,name:"switchboard-push",transmitterType:"SwitchboardPush"},filter:{branch:["main"],documentId:["*"],documentType:["*"],scope:["global"]},label:"Switchboard Sync",listenerId:"1",system:!0}],triggers:[]}})),removeOldRemoteDrives:createRemoveOldRemoteDrivesConfig(defaultDrivesUrl)}});function createBrowserStorage(tr){return new BrowserStorage$1(tr)}function createBrowserDocumentDriveServer(tr,rr){return new ReactorBuilder(tr).withStorage(rr).withCache(new InMemoryCache).withQueueManager(new EventQueueManager).withOptions({...getReactorDefaultDrivesConfig()}).build()}const VERSION_CHECK_INTERVAL=parseInt(window.__VITE_ENVS.PH_CONNECT_VERSION_CHECK_INTERVAL)||3600*1e3,basePath=connectConfig.routerBasename,serviceWorkerScriptPath=[basePath,"service-worker.js"].join("/").replace(/\/{2,}/gm,"/");var cl,hf,Ic;class ServiceWorkerManager{constructor(rr=!1){Ri(this,cl);ki(this,"ready",!1);ki(this,"debug",!1);ki(this,"registration",null);this.debug=rr}setDebug(rr){this.debug=rr}registerServiceWorker(rr=!1){if(this.debug=rr,!("serviceWorker"in navigator)){console.warn("Service Worker not available");return}window.addEventListener("load",async()=>{try{const ir=await navigator.serviceWorker.getRegistration();if(ir)await ir.update(),Bi(this,cl,Ic).call(this,ir);else{const dr=await navigator.serviceWorker.register(serviceWorkerScriptPath);Bi(this,cl,Ic).call(this,dr),dr.addEventListener("updatefound",()=>{Bi(this,cl,Ic).call(this,dr)})}const lr=setInterval(async()=>{const dr=await navigator.serviceWorker.getRegistration();dr?await dr.update():(clearInterval(lr),this.registerServiceWorker())},VERSION_CHECK_INTERVAL)}catch(ir){console.error("ServiceWorker registration failed: ",ir)}})}}cl=new WeakSet,hf=function(rr){this.debug&&console.log("ServiceWorker message: ",rr);const ir="type"in rr.data?rr:null;switch(ir==null?void 0:ir.data.type){case"NEW_VERSION_AVAILABLE":{if(ir.data.version===connectConfig.appVersion)return;ir.data.requiresHardRefresh&&(this.debug&&console.log("New version available"),window.location.reload());break}default:{console.warn("Unhandled message:",ir);break}}},Ic=function(rr){this.debug&&console.log("ServiceWorker registered: ",rr),navigator.serviceWorker.addEventListener("message",Bi(this,cl,hf).bind(this)),this.registration=rr,this.ready=!0};const serviceWorkerManager=new ServiceWorkerManager,validateDocument=tr=>{const rr=[];if(tr.header.documentType!=="powerhouse/document-model")return rr;const ir=tr,lr=ir.state.global.specifications[0],dr=Object.keys(lr.state).reduce((mr,gr)=>{const yr=gr;return[...mr,...validateInitialState(lr.state[yr].initialValue,yr!=="global").map(_r=>({..._r,message:`${_r.message}. Scope: ${yr}`,details:{..._r.details,scope:yr}}))]},[]),fr=Object.keys(lr.state).reduce((mr,gr)=>{var br;const yr=gr,_r=yr==="global";return[...mr,...validateStateSchemaName(lr.state[yr].schema,ir.header.name||((br=ir.state.global)==null?void 0:br.name)||"",_r?"":yr,!_r).map(vr=>({...vr,message:`${vr.message}. Scope: ${yr}`,details:{...vr.details,scope:yr}}))]},[]),hr=validateModules(lr.modules);return[...dr,...fr,...hr]},logger$2=childLogger(["reactor-analytics"]);function createPgLiteFactoryWorker(tr){return async()=>{const rr=(await __vitePreload(async()=>{const{default:fr}=await import("./pglite-worker.BmajlV4J.js");return{default:fr}},[],import.meta.url)).default,{PGliteWorker:ir}=await __vitePreload(async()=>{const{PGliteWorker:fr}=await import("./index.Vc7_nzpo.js");return{PGliteWorker:fr}},[],import.meta.url),lr=new rr({name:"pglite-worker"});lr.onmessage=fr=>{logger$2.verbose(fr.data)},lr.onerror=fr=>{throw logger$2.error(fr.message),fr.error};const dr=new ir(lr,{meta:{databaseName:tr},extensions:{live:j}});return await dr.waitReady,dr}}async function registerExternalProcessors(tr,rr,ir,lr,dr){return await tr.registerFactory(lr,dr({analyticsStore:rr,relationalDb:ir}))}async function registerDiffAnalyzer(tr,rr){const{processorFactory:ir}=await __vitePreload(async()=>{const{processorFactory:dr}=await import("./index.C_h1SBrG.js");return{processorFactory:dr}},[],import.meta.url),lr=dr=>ir({analyticsStore:rr})(dr.id);return await tr.registerFactory("@powerhousedao/diff-analyzer",lr)}async function registerDriveAnalytics(tr,rr){const{processorFactory:ir}=await __vitePreload(async()=>{const{processorFactory:lr}=await import("./index.Bli07gDj.js");return{processorFactory:lr}},[],import.meta.url);return await tr.registerFactory("@powerhousedao/common/drive-analytics",ir({analyticsStore:rr}))}function DiffAnalyzerProcessor(){const tr=useAnalyticsStoreAsync(),rr=useProcessorManager(),ir=useRef(!1);return useEffect(()=>{!tr.data||!rr||ir.current||(ir.current=!0,registerDiffAnalyzer(rr,tr.data).catch(logger$2.error))},[tr.data,rr]),null}function DriveAnalyticsProcessor(){const tr=useAnalyticsStoreAsync(),rr=useProcessorManager(),ir=useRef(!1);return useEffect(()=>{!tr.data||!rr||ir.current||(ir.current=!0,registerDriveAnalytics(rr,tr.data).then(()=>{logger$2.verbose("Drive analytics processor registered")}).catch(logger$2.error))},[tr.data,rr]),null}function ExternalProcessors(){const tr=useProcessors(),rr=useAnalyticsStoreAsync(),ir=useRelationalDb(),lr=useProcessorManager(),dr=useRef(!1);return useEffect(()=>{if(!(!rr.data||!lr||dr.current||tr.length===0||!ir.db)){dr.current=!0;for(const fr of tr)registerExternalProcessors(lr,rr.data,ir.db,generateId(),fr).catch(logger$2.error)}},[rr.data,lr,ir,tr]),null}function ProcessorManagerProvider({children:tr}){const rr=connectConfig.analytics.useWorker?createPgLiteFactoryWorker(connectConfig.analytics.databaseName):void 0,ir=useSetPGliteDB();return useEffect(()=>{if(!rr){ir({db:null,isLoading:!1,error:null});return}rr().then(lr=>{ir({db:lr,isLoading:!1,error:null})}).catch(lr=>{const dr=lr instanceof Error?lr:new Error(String(lr));ir({db:null,isLoading:!1,error:dr})})},[]),jsx$1(AnalyticsProvider,{options:{databaseName:connectConfig.analytics.databaseName,pgLiteFactory:rr},children:jsxs(Fragment,{children:[connectConfig.analytics.diffProcessorEnabled&&jsx$1(DiffAnalyzerProcessor,{}),connectConfig.analytics.driveAnalyticsEnabled&&jsx$1(DriveAnalyticsProcessor,{}),connectConfig.analytics.externalProcessorsEnabled&&jsx$1(ExternalProcessors,{}),tr]})})}/**
823
823
  * @remix-run/router v1.23.0
824
824
  *
825
825
  * Copyright (c) Remix Software Inc.
@@ -847,13 +847,13 @@ ${prettyStateOverride(wr)}`),super(rr.shortMessage,{cause:rr,docsPath:lr,metaMes
847
847
  * LICENSE.md file in the root directory of this source tree.
848
848
  *
849
849
  * @license MIT
850
- */function _extends(){return _extends=Object.assign?Object.assign.bind():function(tr){for(var rr=1;rr<arguments.length;rr++){var ir=arguments[rr];for(var lr in ir)Object.prototype.hasOwnProperty.call(ir,lr)&&(tr[lr]=ir[lr])}return tr},_extends.apply(this,arguments)}const REACT_ROUTER_VERSION="6";try{window.__reactRouterVersion=REACT_ROUTER_VERSION}catch(tr){}function createBrowserRouter(tr,rr){return createRouter$1({basename:rr==null?void 0:rr.basename,future:_extends({},rr==null?void 0:rr.future,{v7_prependBasename:!0}),history:createBrowserHistory({window:rr==null?void 0:rr.window}),hydrationData:(rr==null?void 0:rr.hydrationData)||parseHydrationData(),routes:tr,mapRouteProperties,dataStrategy:rr==null?void 0:rr.dataStrategy,patchRoutesOnNavigation:rr==null?void 0:rr.patchRoutesOnNavigation,window:rr==null?void 0:rr.window}).initialize()}function parseHydrationData(){var tr;let rr=(tr=window)==null?void 0:tr.__staticRouterHydrationData;return rr&&rr.errors&&(rr=_extends({},rr,{errors:deserializeErrors(rr.errors)})),rr}function deserializeErrors(tr){if(!tr)return null;let rr=Object.entries(tr),ir={};for(let[lr,dr]of rr)if(dr&&dr.__type==="RouteErrorResponse")ir[lr]=new ErrorResponseImpl(dr.status,dr.statusText,dr.data,dr.internal===!0);else if(dr&&dr.__type==="Error"){if(dr.__subType){let fr=window[dr.__subType];if(typeof fr=="function")try{let hr=new fr(dr.message);hr.stack="",ir[lr]=hr}catch{}}if(ir[lr]==null){let fr=new Error(dr.message);fr.stack="",ir[lr]=fr}}else ir[lr]=dr;return ir}const ViewTransitionContext=React.createContext({isTransitioning:!1}),FetchersContext=React.createContext(new Map),START_TRANSITION="startTransition",startTransitionImpl=React[START_TRANSITION],FLUSH_SYNC="flushSync",flushSyncImpl=ReactDOM[FLUSH_SYNC];function startTransitionSafe(tr){startTransitionImpl?startTransitionImpl(tr):tr()}function flushSyncSafe(tr){flushSyncImpl?flushSyncImpl(tr):tr()}class Deferred{constructor(){this.status="pending",this.promise=new Promise((rr,ir)=>{this.resolve=lr=>{this.status==="pending"&&(this.status="resolved",rr(lr))},this.reject=lr=>{this.status==="pending"&&(this.status="rejected",ir(lr))}})}}function RouterProvider(tr){let{fallbackElement:rr,router:ir,future:lr}=tr,[dr,fr]=React.useState(ir.state),[hr,mr]=React.useState(),[gr,yr]=React.useState({isTransitioning:!1}),[_r,br]=React.useState(),[vr,wr]=React.useState(),[xr,Sr]=React.useState(),Ar=React.useRef(new Map),{v7_startTransition:Ir}=lr||{},Mr=React.useCallback(Jr=>{Ir?startTransitionSafe(Jr):Jr()},[Ir]),Or=React.useCallback((Jr,$n)=>{let{deletedFetchers:Qr,flushSync:Zn,viewTransitionOpts:qn}=$n;Jr.fetchers.forEach((Lr,Gr)=>{Lr.data!==void 0&&Ar.current.set(Gr,Lr.data)}),Qr.forEach(Lr=>Ar.current.delete(Lr));let Xn=ir.window==null||ir.window.document==null||typeof ir.window.document.startViewTransition!="function";if(!qn||Xn){Zn?flushSyncSafe(()=>fr(Jr)):Mr(()=>fr(Jr));return}if(Zn){flushSyncSafe(()=>{vr&&(_r&&_r.resolve(),vr.skipTransition()),yr({isTransitioning:!0,flushSync:!0,currentLocation:qn.currentLocation,nextLocation:qn.nextLocation})});let Lr=ir.window.document.startViewTransition(()=>{flushSyncSafe(()=>fr(Jr))});Lr.finished.finally(()=>{flushSyncSafe(()=>{br(void 0),wr(void 0),mr(void 0),yr({isTransitioning:!1})})}),flushSyncSafe(()=>wr(Lr));return}vr?(_r&&_r.resolve(),vr.skipTransition(),Sr({state:Jr,currentLocation:qn.currentLocation,nextLocation:qn.nextLocation})):(mr(Jr),yr({isTransitioning:!0,flushSync:!1,currentLocation:qn.currentLocation,nextLocation:qn.nextLocation}))},[ir.window,vr,_r,Ar,Mr]);React.useLayoutEffect(()=>ir.subscribe(Or),[ir,Or]),React.useEffect(()=>{gr.isTransitioning&&!gr.flushSync&&br(new Deferred)},[gr]),React.useEffect(()=>{if(_r&&hr&&ir.window){let Jr=hr,$n=_r.promise,Qr=ir.window.document.startViewTransition(async()=>{Mr(()=>fr(Jr)),await $n});Qr.finished.finally(()=>{br(void 0),wr(void 0),mr(void 0),yr({isTransitioning:!1})}),wr(Qr)}},[Mr,hr,_r,ir.window]),React.useEffect(()=>{_r&&hr&&dr.location.key===hr.location.key&&_r.resolve()},[_r,vr,dr.location,hr]),React.useEffect(()=>{!gr.isTransitioning&&xr&&(mr(xr.state),yr({isTransitioning:!0,flushSync:!1,currentLocation:xr.currentLocation,nextLocation:xr.nextLocation}),Sr(void 0))},[gr.isTransitioning,xr]),React.useEffect(()=>{},[]);let $r=React.useMemo(()=>({createHref:ir.createHref,encodeLocation:ir.encodeLocation,go:Jr=>ir.navigate(Jr),push:(Jr,$n,Qr)=>ir.navigate(Jr,{state:$n,preventScrollReset:Qr==null?void 0:Qr.preventScrollReset}),replace:(Jr,$n,Qr)=>ir.navigate(Jr,{replace:!0,state:$n,preventScrollReset:Qr==null?void 0:Qr.preventScrollReset})}),[ir]),Dr=ir.basename||"/",zr=React.useMemo(()=>({router:ir,navigator:$r,static:!1,basename:Dr}),[ir,$r,Dr]),Fr=React.useMemo(()=>({v7_relativeSplatPath:ir.future.v7_relativeSplatPath}),[ir.future.v7_relativeSplatPath]);return React.useEffect(()=>void 0,[lr,ir.future]),React.createElement(React.Fragment,null,React.createElement(DataRouterContext.Provider,{value:zr},React.createElement(DataRouterStateContext.Provider,{value:dr},React.createElement(FetchersContext.Provider,{value:Ar.current},React.createElement(ViewTransitionContext.Provider,{value:gr},React.createElement(Router$1,{basename:Dr,location:dr.location,navigationType:dr.historyAction,navigator:$r,future:Fr},dr.initialized||ir.future.v7_partialHydration?React.createElement(MemoizedDataRoutes,{routes:ir.routes,future:ir.future,state:dr}):rr))))),null)}const MemoizedDataRoutes=React.memo(DataRoutes);function DataRoutes(tr){let{routes:rr,future:ir,state:lr}=tr;return useRoutesImpl(rr,void 0,lr,ir)}var DataRouterHook;(function(tr){tr.UseScrollRestoration="useScrollRestoration",tr.UseSubmit="useSubmit",tr.UseSubmitFetcher="useSubmitFetcher",tr.UseFetcher="useFetcher",tr.useViewTransitionState="useViewTransitionState"})(DataRouterHook||(DataRouterHook={}));var DataRouterStateHook;(function(tr){tr.UseFetcher="useFetcher",tr.UseFetchers="useFetchers",tr.UseScrollRestoration="useScrollRestoration"})(DataRouterStateHook||(DataRouterStateHook={}));const Content=React__default.lazy(()=>__vitePreload(()=>import("./content.EqFpXqQo.js"),__vite__mapDeps([0,1,2]),import.meta.url)),Root=React__default.lazy(()=>__vitePreload(()=>import("./root._-_EHvJY.js"),__vite__mapDeps([3,1]),import.meta.url)),AtlasImport=React__default.lazy(()=>__vitePreload(()=>import("./atlas-import.huSz2S1P.js"),[],import.meta.url).then(tr=>({default:tr.AtlasImport}))),routerBasename=connectConfig.routerBasename.endsWith("/")?connectConfig.routerBasename.slice(0,-1):connectConfig.routerBasename;function createRouter(tr){return createBrowserRouter(tr,{basename:routerBasename,future:{v7_fetcherPersist:!0,v7_relativeSplatPath:!0}})}function createRoutes(){return[{element:jsx$1(Suspense,{name:"RouteRoot",children:jsx$1(Root,{})}),children:[{index:!0,path:"d?/:driveId?/*?",element:jsx$1(Suspense,{name:"Drive",children:jsx$1(Content,{})})},{path:"import/:documentId",element:jsx$1(Suspense,{name:"AtlasImport",children:jsx$1(AtlasImport,{})})}]}]}const routes=createRoutes(),router=createRouter(routes),Router=()=>jsx$1(RouterProvider,{router});window.__VITE_ENVS.MODE==="development"?window.documentEditorDebugTools=new DocumentEditorDebugTools:serviceWorkerManager.registerServiceWorker(!1);const App=()=>jsx$1(SentryProvider,{children:jsx$1(WagmiContext,{children:jsxs(ProcessorManagerProvider,{children:[jsx$1(ToastContainer,{position:"bottom-right",containerId:"connect"}),jsx$1(Router,{}),jsx$1(Analytics,{})]})})});var voidElements,hasRequiredVoidElements;function requireVoidElements(){return hasRequiredVoidElements||(hasRequiredVoidElements=1,voidElements={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0}),voidElements}var voidElementsExports=requireVoidElements();const e=getDefaultExportFromCjs(voidElementsExports);var t$1=/\s([^'"/\s><]+?)[\s/>]|([^\s=]+)=\s?(".*?"|'.*?')/g;function n(tr){var rr={type:"tag",name:"",voidElement:!1,attrs:{},children:[]},ir=tr.match(/<\/?([^\s]+?)[/\s>]/);if(ir&&(rr.name=ir[1],(e[ir[1]]||tr.charAt(tr.length-2)==="/")&&(rr.voidElement=!0),rr.name.startsWith("!--"))){var lr=tr.indexOf("-->");return{type:"comment",comment:lr!==-1?tr.slice(4,lr):""}}for(var dr=new RegExp(t$1),fr=null;(fr=dr.exec(tr))!==null;)if(fr[0].trim())if(fr[1]){var hr=fr[1].trim(),mr=[hr,""];hr.indexOf("=")>-1&&(mr=hr.split("=")),rr.attrs[mr[0]]=mr[1],dr.lastIndex--}else fr[2]&&(rr.attrs[fr[2]]=fr[3].trim().substring(1,fr[3].length-1));return rr}var r=/<[a-zA-Z0-9\-\!\/](?:"[^"]*"|'[^']*'|[^'">])*>/g,i=/^\s*$/,s=Object.create(null);function a(tr,rr){switch(rr.type){case"text":return tr+rr.content;case"tag":return tr+="<"+rr.name+(rr.attrs?(function(ir){var lr=[];for(var dr in ir)lr.push(dr+'="'+ir[dr]+'"');return lr.length?" "+lr.join(" "):""})(rr.attrs):"")+(rr.voidElement?"/>":">"),rr.voidElement?tr:tr+rr.children.reduce(a,"")+"</"+rr.name+">";case"comment":return tr+"<!--"+rr.comment+"-->"}}var c={parse:function(tr,rr){rr||(rr={}),rr.components||(rr.components=s);var ir,lr=[],dr=[],fr=-1,hr=!1;if(tr.indexOf("<")!==0){var mr=tr.indexOf("<");lr.push({type:"text",content:mr===-1?tr:tr.substring(0,mr)})}return tr.replace(r,function(gr,yr){if(hr){if(gr!=="</"+ir.name+">")return;hr=!1}var _r,br=gr.charAt(1)!=="/",vr=gr.startsWith("<!--"),wr=yr+gr.length,xr=tr.charAt(wr);if(vr){var Sr=n(gr);return fr<0?(lr.push(Sr),lr):((_r=dr[fr]).children.push(Sr),lr)}if(br&&(fr++,(ir=n(gr)).type==="tag"&&rr.components[ir.name]&&(ir.type="component",hr=!0),ir.voidElement||hr||!xr||xr==="<"||ir.children.push({type:"text",content:tr.slice(wr,tr.indexOf("<",wr))}),fr===0&&lr.push(ir),(_r=dr[fr-1])&&_r.children.push(ir),dr[fr]=ir),(!br||ir.voidElement)&&(fr>-1&&(ir.voidElement||ir.name===gr.slice(2,-1))&&(fr--,ir=fr===-1?lr:dr[fr]),!hr&&xr!=="<"&&xr)){_r=fr===-1?lr:dr[fr].children;var Ar=tr.indexOf("<",wr),Ir=tr.slice(wr,Ar===-1?void 0:Ar);i.test(Ir)&&(Ir=" "),(Ar>-1&&fr+_r.length>=0||Ir!==" ")&&_r.push({type:"text",content:Ir})}}),lr},stringify:function(tr){return tr.reduce(function(rr,ir){return rr+a("",ir)},"")}};function warn(){if(console&&console.warn){for(var tr=arguments.length,rr=new Array(tr),ir=0;ir<tr;ir++)rr[ir]=arguments[ir];typeof rr[0]=="string"&&(rr[0]=`react-i18next:: ${rr[0]}`),console.warn(...rr)}}const alreadyWarned={};function warnOnce(){for(var tr=arguments.length,rr=new Array(tr),ir=0;ir<tr;ir++)rr[ir]=arguments[ir];typeof rr[0]=="string"&&alreadyWarned[rr[0]]||(typeof rr[0]=="string"&&(alreadyWarned[rr[0]]=new Date),warn(...rr))}const loadedClb=(tr,rr)=>()=>{if(tr.isInitialized)rr();else{const ir=()=>{setTimeout(()=>{tr.off("initialized",ir)},0),rr()};tr.on("initialized",ir)}};function loadNamespaces(tr,rr,ir){tr.loadNamespaces(rr,loadedClb(tr,ir))}function loadLanguages(tr,rr,ir,lr){typeof ir=="string"&&(ir=[ir]),ir.forEach(dr=>{tr.options.ns.indexOf(dr)<0&&tr.options.ns.push(dr)}),tr.loadLanguages(rr,loadedClb(tr,lr))}function oldI18nextHasLoadedNamespace(tr,rr){let ir=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const lr=rr.languages[0],dr=rr.options?rr.options.fallbackLng:!1,fr=rr.languages[rr.languages.length-1];if(lr.toLowerCase()==="cimode")return!0;const hr=(mr,gr)=>{const yr=rr.services.backendConnector.state[`${mr}|${gr}`];return yr===-1||yr===2};return ir.bindI18n&&ir.bindI18n.indexOf("languageChanging")>-1&&rr.services.backendConnector.backend&&rr.isLanguageChangingTo&&!hr(rr.isLanguageChangingTo,tr)?!1:!!(rr.hasResourceBundle(lr,tr)||!rr.services.backendConnector.backend||rr.options.resources&&!rr.options.partialBundledLanguages||hr(lr,tr)&&(!dr||hr(fr,tr)))}function hasLoadedNamespace(tr,rr){let ir=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return!rr.languages||!rr.languages.length?(warnOnce("i18n.languages were undefined or empty",rr.languages),!0):rr.options.ignoreJSONStructure!==void 0?rr.hasLoadedNamespace(tr,{lng:ir.lng,precheck:(dr,fr)=>{if(ir.bindI18n&&ir.bindI18n.indexOf("languageChanging")>-1&&dr.services.backendConnector.backend&&dr.isLanguageChangingTo&&!fr(dr.isLanguageChangingTo,tr))return!1}}):oldI18nextHasLoadedNamespace(tr,rr,ir)}const matchHtmlEntity=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,htmlEntities={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"©","&#169;":"©","&reg;":"®","&#174;":"®","&hellip;":"…","&#8230;":"…","&#x2F;":"/","&#47;":"/"},unescapeHtmlEntity=tr=>htmlEntities[tr],unescape$1=tr=>tr.replace(matchHtmlEntity,unescapeHtmlEntity);let defaultOptions={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:unescape$1};function setDefaults(){let tr=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};defaultOptions={...defaultOptions,...tr}}function getDefaults(){return defaultOptions}let i18nInstance;function setI18n(tr){i18nInstance=tr}function getI18n(){return i18nInstance}function hasChildren(tr,rr){if(!tr)return!1;const ir=tr.props?tr.props.children:tr.children;return rr?ir.length>0:!!ir}function getChildren(tr){if(!tr)return[];const rr=tr.props?tr.props.children:tr.children;return tr.props&&tr.props.i18nIsDynamicList?getAsArray(rr):rr}function hasValidReactChildren(tr){return Object.prototype.toString.call(tr)!=="[object Array]"?!1:tr.every(rr=>isValidElement(rr))}function getAsArray(tr){return Array.isArray(tr)?tr:[tr]}function mergeProps(tr,rr){const ir={...rr};return ir.props=Object.assign(tr.props,rr.props),ir}function nodesToString(tr,rr){if(!tr)return"";let ir="";const lr=getAsArray(tr),dr=rr.transSupportBasicHtmlNodes&&rr.transKeepBasicHtmlNodesFor?rr.transKeepBasicHtmlNodesFor:[];return lr.forEach((fr,hr)=>{if(typeof fr=="string")ir+=`${fr}`;else if(isValidElement(fr)){const mr=Object.keys(fr.props).length,gr=dr.indexOf(fr.type)>-1,yr=fr.props.children;if(!yr&&gr&&mr===0)ir+=`<${fr.type}/>`;else if(!yr&&(!gr||mr!==0))ir+=`<${hr}></${hr}>`;else if(fr.props.i18nIsDynamicList)ir+=`<${hr}></${hr}>`;else if(gr&&mr===1&&typeof yr=="string")ir+=`<${fr.type}>${yr}</${fr.type}>`;else{const _r=nodesToString(yr,rr);ir+=`<${hr}>${_r}</${hr}>`}}else if(fr===null)warn("Trans: the passed in value is invalid - seems you passed in a null child.");else if(typeof fr=="object"){const{format:mr,...gr}=fr,yr=Object.keys(gr);if(yr.length===1){const _r=mr?`${yr[0]}, ${mr}`:yr[0];ir+=`{{${_r}}}`}else warn("react-i18next: the passed in object contained more than one variable - the object should look like {{ value, format }} where format is optional.",fr)}else warn("Trans: the passed in value is invalid - seems you passed in a variable like {number} - please pass in variables for interpolation as full objects like {{number}}.",fr)}),ir}function renderNodes(tr,rr,ir,lr,dr,fr){if(rr==="")return[];const hr=lr.transKeepBasicHtmlNodesFor||[],mr=rr&&new RegExp(hr.map(Ar=>`<${Ar}`).join("|")).test(rr);if(!tr&&!mr&&!fr)return[rr];const gr={};function yr(Ar){getAsArray(Ar).forEach(Mr=>{typeof Mr!="string"&&(hasChildren(Mr)?yr(getChildren(Mr)):typeof Mr=="object"&&!isValidElement(Mr)&&Object.assign(gr,Mr))})}yr(tr);const _r=c.parse(`<0>${rr}</0>`),br={...gr,...dr};function vr(Ar,Ir,Mr){const Or=getChildren(Ar),$r=xr(Or,Ir.children,Mr);return hasValidReactChildren(Or)&&$r.length===0||Ar.props&&Ar.props.i18nIsDynamicList?Or:$r}function wr(Ar,Ir,Mr,Or,$r){Ar.dummy?(Ar.children=Ir,Mr.push(cloneElement(Ar,{key:Or},$r?void 0:Ir))):Mr.push(...Children.map([Ar],Dr=>{const zr={...Dr.props};return delete zr.i18nIsDynamicList,React__default.createElement(Dr.type,_extends$3({},zr,{key:Or,ref:Dr.ref},$r?{}:{children:Ir}))}))}function xr(Ar,Ir,Mr){const Or=getAsArray(Ar);return getAsArray(Ir).reduce((Dr,zr,Fr)=>{const Jr=zr.children&&zr.children[0]&&zr.children[0].content&&ir.services.interpolator.interpolate(zr.children[0].content,br,ir.language);if(zr.type==="tag"){let $n=Or[parseInt(zr.name,10)];Mr.length===1&&!$n&&($n=Mr[0][zr.name]),$n||($n={});const Qr=Object.keys(zr.attrs).length!==0?mergeProps({props:zr.attrs},$n):$n,Zn=isValidElement(Qr),qn=Zn&&hasChildren(zr,!0)&&!zr.voidElement,Xn=mr&&typeof Qr=="object"&&Qr.dummy&&!Zn,Lr=typeof tr=="object"&&tr!==null&&Object.hasOwnProperty.call(tr,zr.name);if(typeof Qr=="string"){const Gr=ir.services.interpolator.interpolate(Qr,br,ir.language);Dr.push(Gr)}else if(hasChildren(Qr)||qn){const Gr=vr(Qr,zr,Mr);wr(Qr,Gr,Dr,Fr)}else if(Xn){const Gr=xr(Or,zr.children,Mr);wr(Qr,Gr,Dr,Fr)}else if(Number.isNaN(parseFloat(zr.name)))if(Lr){const Gr=vr(Qr,zr,Mr);wr(Qr,Gr,Dr,Fr,zr.voidElement)}else if(lr.transSupportBasicHtmlNodes&&hr.indexOf(zr.name)>-1)if(zr.voidElement)Dr.push(createElement(zr.name,{key:`${zr.name}-${Fr}`}));else{const Gr=xr(Or,zr.children,Mr);Dr.push(createElement(zr.name,{key:`${zr.name}-${Fr}`},Gr))}else if(zr.voidElement)Dr.push(`<${zr.name} />`);else{const Gr=xr(Or,zr.children,Mr);Dr.push(`<${zr.name}>${Gr}</${zr.name}>`)}else if(typeof Qr=="object"&&!Zn){const Gr=zr.children[0]?Jr:null;Gr&&Dr.push(Gr)}else wr(Qr,Jr,Dr,Fr,zr.children.length!==1||!Jr)}else if(zr.type==="text"){const $n=lr.transWrapTextNodes,Qr=fr?lr.unescape(ir.services.interpolator.interpolate(zr.content,br,ir.language)):ir.services.interpolator.interpolate(zr.content,br,ir.language);$n?Dr.push(createElement($n,{key:`${zr.name}-${Fr}`},Qr)):Dr.push(Qr)}return Dr},[])}const Sr=xr([{dummy:!0,children:tr||[]}],_r,getAsArray(tr||[]));return getChildren(Sr[0])}function Trans$1(tr){let{children:rr,count:ir,parent:lr,i18nKey:dr,context:fr,tOptions:hr={},values:mr,defaults:gr,components:yr,ns:_r,i18n:br,t:vr,shouldUnescape:wr,...xr}=tr;const Sr=br||getI18n();if(!Sr)return warnOnce("You will need to pass in an i18next instance by using i18nextReactModule"),rr;const Ar=vr||Sr.t.bind(Sr)||(qn=>qn);fr&&(hr.context=fr);const Ir={...getDefaults(),...Sr.options&&Sr.options.react};let Mr=_r||Ar.ns||Sr.options&&Sr.options.defaultNS;Mr=typeof Mr=="string"?[Mr]:Mr||["translation"];const Or=nodesToString(rr,Ir),$r=gr||Or||Ir.transEmptyNodeValue||dr,{hashTransKey:Dr}=Ir,zr=dr||(Dr?Dr(Or||$r):Or||$r);Sr.options&&Sr.options.interpolation&&Sr.options.interpolation.defaultVariables&&(mr=mr&&Object.keys(mr).length>0?{...mr,...Sr.options.interpolation.defaultVariables}:{...Sr.options.interpolation.defaultVariables});const Fr=mr?hr.interpolation:{interpolation:{...hr.interpolation,prefix:"#$?",suffix:"?$#"}},Jr={...hr,count:ir,...mr,...Fr,defaultValue:$r,ns:Mr},$n=zr?Ar(zr,Jr):$r;yr&&Object.keys(yr).forEach(qn=>{const Xn=yr[qn];if(typeof Xn.type=="function"||!Xn.props||!Xn.props.children||$n.indexOf(`${qn}/>`)<0&&$n.indexOf(`${qn} />`)<0)return;function Lr(){return React__default.createElement(React__default.Fragment,null,Xn)}yr[qn]=React__default.createElement(Lr,null)});const Qr=renderNodes(yr||rr,$n,Sr,Ir,Jr,wr),Zn=lr!==void 0?lr:Ir.defaultTransParent;return Zn?createElement(Zn,xr,Qr):Qr}const initReactI18next={type:"3rdParty",init(tr){setDefaults(tr.options.react),setI18n(tr)}},I18nContext=createContext();class ReportNamespaces{constructor(){this.usedNamespaces={}}addUsedNamespaces(rr){rr.forEach(ir=>{this.usedNamespaces[ir]||(this.usedNamespaces[ir]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}function Trans(tr){let{children:rr,count:ir,parent:lr,i18nKey:dr,context:fr,tOptions:hr={},values:mr,defaults:gr,components:yr,ns:_r,i18n:br,t:vr,shouldUnescape:wr,...xr}=tr;const{i18n:Sr,defaultNS:Ar}=useContext(I18nContext)||{},Ir=br||Sr||getI18n(),Mr=vr||Ir&&Ir.t.bind(Ir);return Trans$1({children:rr,count:ir,parent:lr,i18nKey:dr,context:fr,tOptions:hr,values:mr,defaults:gr,components:yr,ns:_r||Mr&&Mr.ns||Ar||Ir&&Ir.options&&Ir.options.defaultNS,i18n:Ir,t:vr,shouldUnescape:wr,...xr})}const usePrevious=(tr,rr)=>{const ir=useRef();return useEffect(()=>{ir.current=tr},[tr,rr]),ir.current};function useTranslation(tr){let rr=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{i18n:ir}=rr,{i18n:lr,defaultNS:dr}=useContext(I18nContext)||{},fr=ir||lr||getI18n();if(fr&&!fr.reportNamespaces&&(fr.reportNamespaces=new ReportNamespaces),!fr){warnOnce("You will need to pass in an i18next instance by using initReactI18next");const Or=(Dr,zr)=>typeof zr=="string"?zr:zr&&typeof zr=="object"&&typeof zr.defaultValue=="string"?zr.defaultValue:Array.isArray(Dr)?Dr[Dr.length-1]:Dr,$r=[Or,{},!1];return $r.t=Or,$r.i18n={},$r.ready=!1,$r}fr.options.react&&fr.options.react.wait!==void 0&&warnOnce("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const hr={...getDefaults(),...fr.options.react,...rr},{useSuspense:mr,keyPrefix:gr}=hr;let yr=dr||fr.options&&fr.options.defaultNS;yr=typeof yr=="string"?[yr]:yr||["translation"],fr.reportNamespaces.addUsedNamespaces&&fr.reportNamespaces.addUsedNamespaces(yr);const _r=(fr.isInitialized||fr.initializedStoreOnce)&&yr.every(Or=>hasLoadedNamespace(Or,fr,hr));function br(){return fr.getFixedT(rr.lng||null,hr.nsMode==="fallback"?yr:yr[0],gr)}const[vr,wr]=useState(br);let xr=yr.join();rr.lng&&(xr=`${rr.lng}${xr}`);const Sr=usePrevious(xr),Ar=useRef(!0);useEffect(()=>{const{bindI18n:Or,bindI18nStore:$r}=hr;Ar.current=!0,!_r&&!mr&&(rr.lng?loadLanguages(fr,rr.lng,yr,()=>{Ar.current&&wr(br)}):loadNamespaces(fr,yr,()=>{Ar.current&&wr(br)})),_r&&Sr&&Sr!==xr&&Ar.current&&wr(br);function Dr(){Ar.current&&wr(br)}return Or&&fr&&fr.on(Or,Dr),$r&&fr&&fr.store.on($r,Dr),()=>{Ar.current=!1,Or&&fr&&Or.split(" ").forEach(zr=>fr.off(zr,Dr)),$r&&fr&&$r.split(" ").forEach(zr=>fr.store.off(zr,Dr))}},[fr,xr]);const Ir=useRef(!0);useEffect(()=>{Ar.current&&!Ir.current&&wr(br),Ir.current=!1},[fr,gr]);const Mr=[vr,fr,_r];if(Mr.t=vr,Mr.i18n=fr,Mr.ready=_r,_r||!_r&&!mr)return Mr;throw new Promise(Or=>{rr.lng?loadLanguages(fr,rr.lng,yr,()=>Or()):loadNamespaces(fr,yr,()=>Or())})}const namespace=connectConfig.routerBasename,COOKIE_BANNER_KEY_STORAGE=`${namespace}:display-cookie-banner`,listeners=new Set;let bannerShown=getInitial();function getInitial(){try{return localStorage.getItem(COOKIE_BANNER_KEY_STORAGE)!=="false"}catch(tr){return console.error(tr),!0}}function getCookieBannerState(){return bannerShown}function setCookieBannerState(tr){bannerShown=tr,localStorage.setItem(COOKIE_BANNER_KEY_STORAGE,JSON.stringify(tr))}function subscribe(tr){return listeners.add(tr),()=>listeners.delete(tr)}const useCookieBanner=()=>[useSyncExternalStore(subscribe,getCookieBannerState,getCookieBannerState),setCookieBannerState],isString$1=tr=>typeof tr=="string",defer=()=>{let tr,rr;const ir=new Promise((lr,dr)=>{tr=lr,rr=dr});return ir.resolve=tr,ir.reject=rr,ir},makeString=tr=>tr==null?"":""+tr,copy=(tr,rr,ir)=>{tr.forEach(lr=>{rr[lr]&&(ir[lr]=rr[lr])})},lastOfPathSeparatorRegExp=/###/g,cleanKey=tr=>tr&&tr.indexOf("###")>-1?tr.replace(lastOfPathSeparatorRegExp,"."):tr,canNotTraverseDeeper=tr=>!tr||isString$1(tr),getLastOfPath=(tr,rr,ir)=>{const lr=isString$1(rr)?rr.split("."):rr;let dr=0;for(;dr<lr.length-1;){if(canNotTraverseDeeper(tr))return{};const fr=cleanKey(lr[dr]);!tr[fr]&&ir&&(tr[fr]=new ir),Object.prototype.hasOwnProperty.call(tr,fr)?tr=tr[fr]:tr={},++dr}return canNotTraverseDeeper(tr)?{}:{obj:tr,k:cleanKey(lr[dr])}},setPath=(tr,rr,ir)=>{const{obj:lr,k:dr}=getLastOfPath(tr,rr,Object);if(lr!==void 0||rr.length===1){lr[dr]=ir;return}let fr=rr[rr.length-1],hr=rr.slice(0,rr.length-1),mr=getLastOfPath(tr,hr,Object);for(;mr.obj===void 0&&hr.length;)fr=`${hr[hr.length-1]}.${fr}`,hr=hr.slice(0,hr.length-1),mr=getLastOfPath(tr,hr,Object),mr&&mr.obj&&typeof mr.obj[`${mr.k}.${fr}`]<"u"&&(mr.obj=void 0);mr.obj[`${mr.k}.${fr}`]=ir},pushPath=(tr,rr,ir,lr)=>{const{obj:dr,k:fr}=getLastOfPath(tr,rr,Object);dr[fr]=dr[fr]||[],dr[fr].push(ir)},getPath=(tr,rr)=>{const{obj:ir,k:lr}=getLastOfPath(tr,rr);if(ir)return ir[lr]},getPathWithDefaults=(tr,rr,ir)=>{const lr=getPath(tr,ir);return lr!==void 0?lr:getPath(rr,ir)},deepExtend=(tr,rr,ir)=>{for(const lr in rr)lr!=="__proto__"&&lr!=="constructor"&&(lr in tr?isString$1(tr[lr])||tr[lr]instanceof String||isString$1(rr[lr])||rr[lr]instanceof String?ir&&(tr[lr]=rr[lr]):deepExtend(tr[lr],rr[lr],ir):tr[lr]=rr[lr]);return tr},regexEscape=tr=>tr.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var _entityMap={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};const escape=tr=>isString$1(tr)?tr.replace(/[&<>"'\/]/g,rr=>_entityMap[rr]):tr;class RegExpCache{constructor(rr){this.capacity=rr,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(rr){const ir=this.regExpMap.get(rr);if(ir!==void 0)return ir;const lr=new RegExp(rr);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(rr,lr),this.regExpQueue.push(rr),lr}}const chars=[" ",",","?","!",";"],looksLikeObjectPathRegExpCache=new RegExpCache(20),looksLikeObjectPath=(tr,rr,ir)=>{rr=rr||"",ir=ir||"";const lr=chars.filter(hr=>rr.indexOf(hr)<0&&ir.indexOf(hr)<0);if(lr.length===0)return!0;const dr=looksLikeObjectPathRegExpCache.getRegExp(`(${lr.map(hr=>hr==="?"?"\\?":hr).join("|")})`);let fr=!dr.test(tr);if(!fr){const hr=tr.indexOf(ir);hr>0&&!dr.test(tr.substring(0,hr))&&(fr=!0)}return fr},deepFind=function(tr,rr){let ir=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(!tr)return;if(tr[rr])return tr[rr];const lr=rr.split(ir);let dr=tr;for(let fr=0;fr<lr.length;){if(!dr||typeof dr!="object")return;let hr,mr="";for(let gr=fr;gr<lr.length;++gr)if(gr!==fr&&(mr+=ir),mr+=lr[gr],hr=dr[mr],hr!==void 0){if(["string","number","boolean"].indexOf(typeof hr)>-1&&gr<lr.length-1)continue;fr+=gr-fr+1;break}dr=hr}return dr},getCleanedCode=tr=>tr&&tr.replace("_","-"),consoleLogger={type:"logger",log(tr){this.output("log",tr)},warn(tr){this.output("warn",tr)},error(tr){this.output("error",tr)},output(tr,rr){console&&console[tr]&&console[tr].apply(console,rr)}};class Logger{constructor(rr){let ir=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.init(rr,ir)}init(rr){let ir=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=ir.prefix||"i18next:",this.logger=rr||consoleLogger,this.options=ir,this.debug=ir.debug}log(){for(var rr=arguments.length,ir=new Array(rr),lr=0;lr<rr;lr++)ir[lr]=arguments[lr];return this.forward(ir,"log","",!0)}warn(){for(var rr=arguments.length,ir=new Array(rr),lr=0;lr<rr;lr++)ir[lr]=arguments[lr];return this.forward(ir,"warn","",!0)}error(){for(var rr=arguments.length,ir=new Array(rr),lr=0;lr<rr;lr++)ir[lr]=arguments[lr];return this.forward(ir,"error","")}deprecate(){for(var rr=arguments.length,ir=new Array(rr),lr=0;lr<rr;lr++)ir[lr]=arguments[lr];return this.forward(ir,"warn","WARNING DEPRECATED: ",!0)}forward(rr,ir,lr,dr){return dr&&!this.debug?null:(isString$1(rr[0])&&(rr[0]=`${lr}${this.prefix} ${rr[0]}`),this.logger[ir](rr))}create(rr){return new Logger(this.logger,{prefix:`${this.prefix}:${rr}:`,...this.options})}clone(rr){return rr=rr||this.options,rr.prefix=rr.prefix||this.prefix,new Logger(this.logger,rr)}}var baseLogger=new Logger;class EventEmitter{constructor(){this.observers={}}on(rr,ir){return rr.split(" ").forEach(lr=>{this.observers[lr]||(this.observers[lr]=new Map);const dr=this.observers[lr].get(ir)||0;this.observers[lr].set(ir,dr+1)}),this}off(rr,ir){if(this.observers[rr]){if(!ir){delete this.observers[rr];return}this.observers[rr].delete(ir)}}emit(rr){for(var ir=arguments.length,lr=new Array(ir>1?ir-1:0),dr=1;dr<ir;dr++)lr[dr-1]=arguments[dr];this.observers[rr]&&Array.from(this.observers[rr].entries()).forEach(hr=>{let[mr,gr]=hr;for(let yr=0;yr<gr;yr++)mr(...lr)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(hr=>{let[mr,gr]=hr;for(let yr=0;yr<gr;yr++)mr.apply(mr,[rr,...lr])})}}class ResourceStore extends EventEmitter{constructor(rr){let ir=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=rr||{},this.options=ir,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(rr){this.options.ns.indexOf(rr)<0&&this.options.ns.push(rr)}removeNamespaces(rr){const ir=this.options.ns.indexOf(rr);ir>-1&&this.options.ns.splice(ir,1)}getResource(rr,ir,lr){let dr=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const fr=dr.keySeparator!==void 0?dr.keySeparator:this.options.keySeparator,hr=dr.ignoreJSONStructure!==void 0?dr.ignoreJSONStructure:this.options.ignoreJSONStructure;let mr;rr.indexOf(".")>-1?mr=rr.split("."):(mr=[rr,ir],lr&&(Array.isArray(lr)?mr.push(...lr):isString$1(lr)&&fr?mr.push(...lr.split(fr)):mr.push(lr)));const gr=getPath(this.data,mr);return!gr&&!ir&&!lr&&rr.indexOf(".")>-1&&(rr=mr[0],ir=mr[1],lr=mr.slice(2).join(".")),gr||!hr||!isString$1(lr)?gr:deepFind(this.data&&this.data[rr]&&this.data[rr][ir],lr,fr)}addResource(rr,ir,lr,dr){let fr=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1};const hr=fr.keySeparator!==void 0?fr.keySeparator:this.options.keySeparator;let mr=[rr,ir];lr&&(mr=mr.concat(hr?lr.split(hr):lr)),rr.indexOf(".")>-1&&(mr=rr.split("."),dr=ir,ir=mr[1]),this.addNamespaces(ir),setPath(this.data,mr,dr),fr.silent||this.emit("added",rr,ir,lr,dr)}addResources(rr,ir,lr){let dr=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(const fr in lr)(isString$1(lr[fr])||Array.isArray(lr[fr]))&&this.addResource(rr,ir,fr,lr[fr],{silent:!0});dr.silent||this.emit("added",rr,ir,lr)}addResourceBundle(rr,ir,lr,dr,fr){let hr=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1,skipCopy:!1},mr=[rr,ir];rr.indexOf(".")>-1&&(mr=rr.split("."),dr=lr,lr=ir,ir=mr[1]),this.addNamespaces(ir);let gr=getPath(this.data,mr)||{};hr.skipCopy||(lr=JSON.parse(JSON.stringify(lr))),dr?deepExtend(gr,lr,fr):gr={...gr,...lr},setPath(this.data,mr,gr),hr.silent||this.emit("added",rr,ir,lr)}removeResourceBundle(rr,ir){this.hasResourceBundle(rr,ir)&&delete this.data[rr][ir],this.removeNamespaces(ir),this.emit("removed",rr,ir)}hasResourceBundle(rr,ir){return this.getResource(rr,ir)!==void 0}getResourceBundle(rr,ir){return ir||(ir=this.options.defaultNS),this.options.compatibilityAPI==="v1"?{...this.getResource(rr,ir)}:this.getResource(rr,ir)}getDataByLanguage(rr){return this.data[rr]}hasLanguageSomeTranslations(rr){const ir=this.getDataByLanguage(rr);return!!(ir&&Object.keys(ir)||[]).find(dr=>ir[dr]&&Object.keys(ir[dr]).length>0)}toJSON(){return this.data}}var postProcessor={processors:{},addPostProcessor(tr){this.processors[tr.name]=tr},handle(tr,rr,ir,lr,dr){return tr.forEach(fr=>{this.processors[fr]&&(rr=this.processors[fr].process(rr,ir,lr,dr))}),rr}};const checkedLoadedFor={};class Translator extends EventEmitter{constructor(rr){let ir=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),copy(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],rr,this),this.options=ir,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=baseLogger.create("translator")}changeLanguage(rr){rr&&(this.language=rr)}exists(rr){let ir=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(rr==null)return!1;const lr=this.resolve(rr,ir);return lr&&lr.res!==void 0}extractFromKey(rr,ir){let lr=ir.nsSeparator!==void 0?ir.nsSeparator:this.options.nsSeparator;lr===void 0&&(lr=":");const dr=ir.keySeparator!==void 0?ir.keySeparator:this.options.keySeparator;let fr=ir.ns||this.options.defaultNS||[];const hr=lr&&rr.indexOf(lr)>-1,mr=!this.options.userDefinedKeySeparator&&!ir.keySeparator&&!this.options.userDefinedNsSeparator&&!ir.nsSeparator&&!looksLikeObjectPath(rr,lr,dr);if(hr&&!mr){const gr=rr.match(this.interpolator.nestingRegexp);if(gr&&gr.length>0)return{key:rr,namespaces:isString$1(fr)?[fr]:fr};const yr=rr.split(lr);(lr!==dr||lr===dr&&this.options.ns.indexOf(yr[0])>-1)&&(fr=yr.shift()),rr=yr.join(dr)}return{key:rr,namespaces:isString$1(fr)?[fr]:fr}}translate(rr,ir,lr){if(typeof ir!="object"&&this.options.overloadTranslationOptionHandler&&(ir=this.options.overloadTranslationOptionHandler(arguments)),typeof ir=="object"&&(ir={...ir}),ir||(ir={}),rr==null)return"";Array.isArray(rr)||(rr=[String(rr)]);const dr=ir.returnDetails!==void 0?ir.returnDetails:this.options.returnDetails,fr=ir.keySeparator!==void 0?ir.keySeparator:this.options.keySeparator,{key:hr,namespaces:mr}=this.extractFromKey(rr[rr.length-1],ir),gr=mr[mr.length-1],yr=ir.lng||this.language,_r=ir.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(yr&&yr.toLowerCase()==="cimode"){if(_r){const $r=ir.nsSeparator||this.options.nsSeparator;return dr?{res:`${gr}${$r}${hr}`,usedKey:hr,exactUsedKey:hr,usedLng:yr,usedNS:gr,usedParams:this.getUsedParamsDetails(ir)}:`${gr}${$r}${hr}`}return dr?{res:hr,usedKey:hr,exactUsedKey:hr,usedLng:yr,usedNS:gr,usedParams:this.getUsedParamsDetails(ir)}:hr}const br=this.resolve(rr,ir);let vr=br&&br.res;const wr=br&&br.usedKey||hr,xr=br&&br.exactUsedKey||hr,Sr=Object.prototype.toString.apply(vr),Ar=["[object Number]","[object Function]","[object RegExp]"],Ir=ir.joinArrays!==void 0?ir.joinArrays:this.options.joinArrays,Mr=!this.i18nFormat||this.i18nFormat.handleAsObject,Or=!isString$1(vr)&&typeof vr!="boolean"&&typeof vr!="number";if(Mr&&vr&&Or&&Ar.indexOf(Sr)<0&&!(isString$1(Ir)&&Array.isArray(vr))){if(!ir.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const $r=this.options.returnedObjectHandler?this.options.returnedObjectHandler(wr,vr,{...ir,ns:mr}):`key '${hr} (${this.language})' returned an object instead of string.`;return dr?(br.res=$r,br.usedParams=this.getUsedParamsDetails(ir),br):$r}if(fr){const $r=Array.isArray(vr),Dr=$r?[]:{},zr=$r?xr:wr;for(const Fr in vr)if(Object.prototype.hasOwnProperty.call(vr,Fr)){const Jr=`${zr}${fr}${Fr}`;Dr[Fr]=this.translate(Jr,{...ir,joinArrays:!1,ns:mr}),Dr[Fr]===Jr&&(Dr[Fr]=vr[Fr])}vr=Dr}}else if(Mr&&isString$1(Ir)&&Array.isArray(vr))vr=vr.join(Ir),vr&&(vr=this.extendTranslation(vr,rr,ir,lr));else{let $r=!1,Dr=!1;const zr=ir.count!==void 0&&!isString$1(ir.count),Fr=Translator.hasDefaultValue(ir),Jr=zr?this.pluralResolver.getSuffix(yr,ir.count,ir):"",$n=ir.ordinal&&zr?this.pluralResolver.getSuffix(yr,ir.count,{ordinal:!1}):"",Qr=zr&&!ir.ordinal&&ir.count===0&&this.pluralResolver.shouldUseIntlApi(),Zn=Qr&&ir[`defaultValue${this.options.pluralSeparator}zero`]||ir[`defaultValue${Jr}`]||ir[`defaultValue${$n}`]||ir.defaultValue;!this.isValidLookup(vr)&&Fr&&($r=!0,vr=Zn),this.isValidLookup(vr)||(Dr=!0,vr=hr);const Xn=(ir.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&Dr?void 0:vr,Lr=Fr&&Zn!==vr&&this.options.updateMissing;if(Dr||$r||Lr){if(this.logger.log(Lr?"updateKey":"missingKey",yr,gr,hr,Lr?Zn:vr),fr){const oi=this.resolve(hr,{...ir,keySeparator:!1});oi&&oi.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let Gr=[];const Hn=this.languageUtils.getFallbackCodes(this.options.fallbackLng,ir.lng||this.language);if(this.options.saveMissingTo==="fallback"&&Hn&&Hn[0])for(let oi=0;oi<Hn.length;oi++)Gr.push(Hn[oi]);else this.options.saveMissingTo==="all"?Gr=this.languageUtils.toResolveHierarchy(ir.lng||this.language):Gr.push(ir.lng||this.language);const ii=(oi,ri,ti)=>{const si=Fr&&ti!==vr?ti:Xn;this.options.missingKeyHandler?this.options.missingKeyHandler(oi,gr,ri,si,Lr,ir):this.backendConnector&&this.backendConnector.saveMissing&&this.backendConnector.saveMissing(oi,gr,ri,si,Lr,ir),this.emit("missingKey",oi,gr,ri,vr)};this.options.saveMissing&&(this.options.saveMissingPlurals&&zr?Gr.forEach(oi=>{const ri=this.pluralResolver.getSuffixes(oi,ir);Qr&&ir[`defaultValue${this.options.pluralSeparator}zero`]&&ri.indexOf(`${this.options.pluralSeparator}zero`)<0&&ri.push(`${this.options.pluralSeparator}zero`),ri.forEach(ti=>{ii([oi],hr+ti,ir[`defaultValue${ti}`]||Zn)})}):ii(Gr,hr,Zn))}vr=this.extendTranslation(vr,rr,ir,br,lr),Dr&&vr===hr&&this.options.appendNamespaceToMissingKey&&(vr=`${gr}:${hr}`),(Dr||$r)&&this.options.parseMissingKeyHandler&&(this.options.compatibilityAPI!=="v1"?vr=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${gr}:${hr}`:hr,$r?vr:void 0):vr=this.options.parseMissingKeyHandler(vr))}return dr?(br.res=vr,br.usedParams=this.getUsedParamsDetails(ir),br):vr}extendTranslation(rr,ir,lr,dr,fr){var hr=this;if(this.i18nFormat&&this.i18nFormat.parse)rr=this.i18nFormat.parse(rr,{...this.options.interpolation.defaultVariables,...lr},lr.lng||this.language||dr.usedLng,dr.usedNS,dr.usedKey,{resolved:dr});else if(!lr.skipInterpolation){lr.interpolation&&this.interpolator.init({...lr,interpolation:{...this.options.interpolation,...lr.interpolation}});const yr=isString$1(rr)&&(lr&&lr.interpolation&&lr.interpolation.skipOnVariables!==void 0?lr.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let _r;if(yr){const vr=rr.match(this.interpolator.nestingRegexp);_r=vr&&vr.length}let br=lr.replace&&!isString$1(lr.replace)?lr.replace:lr;if(this.options.interpolation.defaultVariables&&(br={...this.options.interpolation.defaultVariables,...br}),rr=this.interpolator.interpolate(rr,br,lr.lng||this.language||dr.usedLng,lr),yr){const vr=rr.match(this.interpolator.nestingRegexp),wr=vr&&vr.length;_r<wr&&(lr.nest=!1)}!lr.lng&&this.options.compatibilityAPI!=="v1"&&dr&&dr.res&&(lr.lng=this.language||dr.usedLng),lr.nest!==!1&&(rr=this.interpolator.nest(rr,function(){for(var vr=arguments.length,wr=new Array(vr),xr=0;xr<vr;xr++)wr[xr]=arguments[xr];return fr&&fr[0]===wr[0]&&!lr.context?(hr.logger.warn(`It seems you are nesting recursively key: ${wr[0]} in key: ${ir[0]}`),null):hr.translate(...wr,ir)},lr)),lr.interpolation&&this.interpolator.reset()}const mr=lr.postProcess||this.options.postProcess,gr=isString$1(mr)?[mr]:mr;return rr!=null&&gr&&gr.length&&lr.applyPostProcessor!==!1&&(rr=postProcessor.handle(gr,rr,ir,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...dr,usedParams:this.getUsedParamsDetails(lr)},...lr}:lr,this)),rr}resolve(rr){let ir=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},lr,dr,fr,hr,mr;return isString$1(rr)&&(rr=[rr]),rr.forEach(gr=>{if(this.isValidLookup(lr))return;const yr=this.extractFromKey(gr,ir),_r=yr.key;dr=_r;let br=yr.namespaces;this.options.fallbackNS&&(br=br.concat(this.options.fallbackNS));const vr=ir.count!==void 0&&!isString$1(ir.count),wr=vr&&!ir.ordinal&&ir.count===0&&this.pluralResolver.shouldUseIntlApi(),xr=ir.context!==void 0&&(isString$1(ir.context)||typeof ir.context=="number")&&ir.context!=="",Sr=ir.lngs?ir.lngs:this.languageUtils.toResolveHierarchy(ir.lng||this.language,ir.fallbackLng);br.forEach(Ar=>{this.isValidLookup(lr)||(mr=Ar,!checkedLoadedFor[`${Sr[0]}-${Ar}`]&&this.utils&&this.utils.hasLoadedNamespace&&!this.utils.hasLoadedNamespace(mr)&&(checkedLoadedFor[`${Sr[0]}-${Ar}`]=!0,this.logger.warn(`key "${dr}" for languages "${Sr.join(", ")}" won't get resolved as namespace "${mr}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),Sr.forEach(Ir=>{if(this.isValidLookup(lr))return;hr=Ir;const Mr=[_r];if(this.i18nFormat&&this.i18nFormat.addLookupKeys)this.i18nFormat.addLookupKeys(Mr,_r,Ir,Ar,ir);else{let $r;vr&&($r=this.pluralResolver.getSuffix(Ir,ir.count,ir));const Dr=`${this.options.pluralSeparator}zero`,zr=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(vr&&(Mr.push(_r+$r),ir.ordinal&&$r.indexOf(zr)===0&&Mr.push(_r+$r.replace(zr,this.options.pluralSeparator)),wr&&Mr.push(_r+Dr)),xr){const Fr=`${_r}${this.options.contextSeparator}${ir.context}`;Mr.push(Fr),vr&&(Mr.push(Fr+$r),ir.ordinal&&$r.indexOf(zr)===0&&Mr.push(Fr+$r.replace(zr,this.options.pluralSeparator)),wr&&Mr.push(Fr+Dr))}}let Or;for(;Or=Mr.pop();)this.isValidLookup(lr)||(fr=Or,lr=this.getResource(Ir,Ar,Or,ir))}))})}),{res:lr,usedKey:dr,exactUsedKey:fr,usedLng:hr,usedNS:mr}}isValidLookup(rr){return rr!==void 0&&!(!this.options.returnNull&&rr===null)&&!(!this.options.returnEmptyString&&rr==="")}getResource(rr,ir,lr){let dr=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(rr,ir,lr,dr):this.resourceStore.getResource(rr,ir,lr,dr)}getUsedParamsDetails(){let rr=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const ir=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],lr=rr.replace&&!isString$1(rr.replace);let dr=lr?rr.replace:rr;if(lr&&typeof rr.count<"u"&&(dr.count=rr.count),this.options.interpolation.defaultVariables&&(dr={...this.options.interpolation.defaultVariables,...dr}),!lr){dr={...dr};for(const fr of ir)delete dr[fr]}return dr}static hasDefaultValue(rr){const ir="defaultValue";for(const lr in rr)if(Object.prototype.hasOwnProperty.call(rr,lr)&&ir===lr.substring(0,ir.length)&&rr[lr]!==void 0)return!0;return!1}}const capitalize=tr=>tr.charAt(0).toUpperCase()+tr.slice(1);class LanguageUtil{constructor(rr){this.options=rr,this.supportedLngs=this.options.supportedLngs||!1,this.logger=baseLogger.create("languageUtils")}getScriptPartFromCode(rr){if(rr=getCleanedCode(rr),!rr||rr.indexOf("-")<0)return null;const ir=rr.split("-");return ir.length===2||(ir.pop(),ir[ir.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(ir.join("-"))}getLanguagePartFromCode(rr){if(rr=getCleanedCode(rr),!rr||rr.indexOf("-")<0)return rr;const ir=rr.split("-");return this.formatLanguageCode(ir[0])}formatLanguageCode(rr){if(isString$1(rr)&&rr.indexOf("-")>-1){if(typeof Intl<"u"&&typeof Intl.getCanonicalLocales<"u")try{let dr=Intl.getCanonicalLocales(rr)[0];if(dr&&this.options.lowerCaseLng&&(dr=dr.toLowerCase()),dr)return dr}catch{}const ir=["hans","hant","latn","cyrl","cans","mong","arab"];let lr=rr.split("-");return this.options.lowerCaseLng?lr=lr.map(dr=>dr.toLowerCase()):lr.length===2?(lr[0]=lr[0].toLowerCase(),lr[1]=lr[1].toUpperCase(),ir.indexOf(lr[1].toLowerCase())>-1&&(lr[1]=capitalize(lr[1].toLowerCase()))):lr.length===3&&(lr[0]=lr[0].toLowerCase(),lr[1].length===2&&(lr[1]=lr[1].toUpperCase()),lr[0]!=="sgn"&&lr[2].length===2&&(lr[2]=lr[2].toUpperCase()),ir.indexOf(lr[1].toLowerCase())>-1&&(lr[1]=capitalize(lr[1].toLowerCase())),ir.indexOf(lr[2].toLowerCase())>-1&&(lr[2]=capitalize(lr[2].toLowerCase()))),lr.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?rr.toLowerCase():rr}isSupportedCode(rr){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(rr=this.getLanguagePartFromCode(rr)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(rr)>-1}getBestMatchFromCodes(rr){if(!rr)return null;let ir;return rr.forEach(lr=>{if(ir)return;const dr=this.formatLanguageCode(lr);(!this.options.supportedLngs||this.isSupportedCode(dr))&&(ir=dr)}),!ir&&this.options.supportedLngs&&rr.forEach(lr=>{if(ir)return;const dr=this.getLanguagePartFromCode(lr);if(this.isSupportedCode(dr))return ir=dr;ir=this.options.supportedLngs.find(fr=>{if(fr===dr)return fr;if(!(fr.indexOf("-")<0&&dr.indexOf("-")<0)&&(fr.indexOf("-")>0&&dr.indexOf("-")<0&&fr.substring(0,fr.indexOf("-"))===dr||fr.indexOf(dr)===0&&dr.length>1))return fr})}),ir||(ir=this.getFallbackCodes(this.options.fallbackLng)[0]),ir}getFallbackCodes(rr,ir){if(!rr)return[];if(typeof rr=="function"&&(rr=rr(ir)),isString$1(rr)&&(rr=[rr]),Array.isArray(rr))return rr;if(!ir)return rr.default||[];let lr=rr[ir];return lr||(lr=rr[this.getScriptPartFromCode(ir)]),lr||(lr=rr[this.formatLanguageCode(ir)]),lr||(lr=rr[this.getLanguagePartFromCode(ir)]),lr||(lr=rr.default),lr||[]}toResolveHierarchy(rr,ir){const lr=this.getFallbackCodes(ir||this.options.fallbackLng||[],rr),dr=[],fr=hr=>{hr&&(this.isSupportedCode(hr)?dr.push(hr):this.logger.warn(`rejecting language code not found in supportedLngs: ${hr}`))};return isString$1(rr)&&(rr.indexOf("-")>-1||rr.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&fr(this.formatLanguageCode(rr)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&fr(this.getScriptPartFromCode(rr)),this.options.load!=="currentOnly"&&fr(this.getLanguagePartFromCode(rr))):isString$1(rr)&&fr(this.formatLanguageCode(rr)),lr.forEach(hr=>{dr.indexOf(hr)<0&&fr(this.formatLanguageCode(hr))}),dr}}let sets=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],_rulesPluralsTypes={1:tr=>+(tr>1),2:tr=>+(tr!=1),3:tr=>0,4:tr=>tr%10==1&&tr%100!=11?0:tr%10>=2&&tr%10<=4&&(tr%100<10||tr%100>=20)?1:2,5:tr=>tr==0?0:tr==1?1:tr==2?2:tr%100>=3&&tr%100<=10?3:tr%100>=11?4:5,6:tr=>tr==1?0:tr>=2&&tr<=4?1:2,7:tr=>tr==1?0:tr%10>=2&&tr%10<=4&&(tr%100<10||tr%100>=20)?1:2,8:tr=>tr==1?0:tr==2?1:tr!=8&&tr!=11?2:3,9:tr=>+(tr>=2),10:tr=>tr==1?0:tr==2?1:tr<7?2:tr<11?3:4,11:tr=>tr==1||tr==11?0:tr==2||tr==12?1:tr>2&&tr<20?2:3,12:tr=>+(tr%10!=1||tr%100==11),13:tr=>+(tr!==0),14:tr=>tr==1?0:tr==2?1:tr==3?2:3,15:tr=>tr%10==1&&tr%100!=11?0:tr%10>=2&&(tr%100<10||tr%100>=20)?1:2,16:tr=>tr%10==1&&tr%100!=11?0:tr!==0?1:2,17:tr=>tr==1||tr%10==1&&tr%100!=11?0:1,18:tr=>tr==0?0:tr==1?1:2,19:tr=>tr==1?0:tr==0||tr%100>1&&tr%100<11?1:tr%100>10&&tr%100<20?2:3,20:tr=>tr==1?0:tr==0||tr%100>0&&tr%100<20?1:2,21:tr=>tr%100==1?1:tr%100==2?2:tr%100==3||tr%100==4?3:0,22:tr=>tr==1?0:tr==2?1:(tr<0||tr>10)&&tr%10==0?2:3};const nonIntlVersions=["v1","v2","v3"],intlVersions=["v4"],suffixesOrder={zero:0,one:1,two:2,few:3,many:4,other:5},createRules=()=>{const tr={};return sets.forEach(rr=>{rr.lngs.forEach(ir=>{tr[ir]={numbers:rr.nr,plurals:_rulesPluralsTypes[rr.fc]}})}),tr};class PluralResolver{constructor(rr){let ir=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.languageUtils=rr,this.options=ir,this.logger=baseLogger.create("pluralResolver"),(!this.options.compatibilityJSON||intlVersions.includes(this.options.compatibilityJSON))&&(typeof Intl>"u"||!Intl.PluralRules)&&(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=createRules(),this.pluralRulesCache={}}addRule(rr,ir){this.rules[rr]=ir}clearCache(){this.pluralRulesCache={}}getRule(rr){let ir=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.shouldUseIntlApi()){const lr=getCleanedCode(rr==="dev"?"en":rr),dr=ir.ordinal?"ordinal":"cardinal",fr=JSON.stringify({cleanedCode:lr,type:dr});if(fr in this.pluralRulesCache)return this.pluralRulesCache[fr];let hr;try{hr=new Intl.PluralRules(lr,{type:dr})}catch{if(!rr.match(/-|_/))return;const gr=this.languageUtils.getLanguagePartFromCode(rr);hr=this.getRule(gr,ir)}return this.pluralRulesCache[fr]=hr,hr}return this.rules[rr]||this.rules[this.languageUtils.getLanguagePartFromCode(rr)]}needsPlural(rr){let ir=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const lr=this.getRule(rr,ir);return this.shouldUseIntlApi()?lr&&lr.resolvedOptions().pluralCategories.length>1:lr&&lr.numbers.length>1}getPluralFormsOfKey(rr,ir){let lr=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(rr,lr).map(dr=>`${ir}${dr}`)}getSuffixes(rr){let ir=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const lr=this.getRule(rr,ir);return lr?this.shouldUseIntlApi()?lr.resolvedOptions().pluralCategories.sort((dr,fr)=>suffixesOrder[dr]-suffixesOrder[fr]).map(dr=>`${this.options.prepend}${ir.ordinal?`ordinal${this.options.prepend}`:""}${dr}`):lr.numbers.map(dr=>this.getSuffix(rr,dr,ir)):[]}getSuffix(rr,ir){let lr=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const dr=this.getRule(rr,lr);return dr?this.shouldUseIntlApi()?`${this.options.prepend}${lr.ordinal?`ordinal${this.options.prepend}`:""}${dr.select(ir)}`:this.getSuffixRetroCompatible(dr,ir):(this.logger.warn(`no plural rule found for: ${rr}`),"")}getSuffixRetroCompatible(rr,ir){const lr=rr.noAbs?rr.plurals(ir):rr.plurals(Math.abs(ir));let dr=rr.numbers[lr];this.options.simplifyPluralSuffix&&rr.numbers.length===2&&rr.numbers[0]===1&&(dr===2?dr="plural":dr===1&&(dr=""));const fr=()=>this.options.prepend&&dr.toString()?this.options.prepend+dr.toString():dr.toString();return this.options.compatibilityJSON==="v1"?dr===1?"":typeof dr=="number"?`_plural_${dr.toString()}`:fr():this.options.compatibilityJSON==="v2"||this.options.simplifyPluralSuffix&&rr.numbers.length===2&&rr.numbers[0]===1?fr():this.options.prepend&&lr.toString()?this.options.prepend+lr.toString():lr.toString()}shouldUseIntlApi(){return!nonIntlVersions.includes(this.options.compatibilityJSON)}}const deepFindWithDefaults=function(tr,rr,ir){let lr=arguments.length>3&&arguments[3]!==void 0?arguments[3]:".",dr=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,fr=getPathWithDefaults(tr,rr,ir);return!fr&&dr&&isString$1(ir)&&(fr=deepFind(tr,ir,lr),fr===void 0&&(fr=deepFind(rr,ir,lr))),fr},regexSafe=tr=>tr.replace(/\$/g,"$$$$");class Interpolator{constructor(){let rr=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=baseLogger.create("interpolator"),this.options=rr,this.format=rr.interpolation&&rr.interpolation.format||(ir=>ir),this.init(rr)}init(){let rr=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};rr.interpolation||(rr.interpolation={escapeValue:!0});const{escape:ir,escapeValue:lr,useRawValueToEscape:dr,prefix:fr,prefixEscaped:hr,suffix:mr,suffixEscaped:gr,formatSeparator:yr,unescapeSuffix:_r,unescapePrefix:br,nestingPrefix:vr,nestingPrefixEscaped:wr,nestingSuffix:xr,nestingSuffixEscaped:Sr,nestingOptionsSeparator:Ar,maxReplaces:Ir,alwaysFormat:Mr}=rr.interpolation;this.escape=ir!==void 0?ir:escape,this.escapeValue=lr!==void 0?lr:!0,this.useRawValueToEscape=dr!==void 0?dr:!1,this.prefix=fr?regexEscape(fr):hr||"{{",this.suffix=mr?regexEscape(mr):gr||"}}",this.formatSeparator=yr||",",this.unescapePrefix=_r?"":br||"-",this.unescapeSuffix=this.unescapePrefix?"":_r||"",this.nestingPrefix=vr?regexEscape(vr):wr||regexEscape("$t("),this.nestingSuffix=xr?regexEscape(xr):Sr||regexEscape(")"),this.nestingOptionsSeparator=Ar||",",this.maxReplaces=Ir||1e3,this.alwaysFormat=Mr!==void 0?Mr:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const rr=(ir,lr)=>ir&&ir.source===lr?(ir.lastIndex=0,ir):new RegExp(lr,"g");this.regexp=rr(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=rr(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=rr(this.nestingRegexp,`${this.nestingPrefix}(.+?)${this.nestingSuffix}`)}interpolate(rr,ir,lr,dr){let fr,hr,mr;const gr=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},yr=wr=>{if(wr.indexOf(this.formatSeparator)<0){const Ir=deepFindWithDefaults(ir,gr,wr,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(Ir,void 0,lr,{...dr,...ir,interpolationkey:wr}):Ir}const xr=wr.split(this.formatSeparator),Sr=xr.shift().trim(),Ar=xr.join(this.formatSeparator).trim();return this.format(deepFindWithDefaults(ir,gr,Sr,this.options.keySeparator,this.options.ignoreJSONStructure),Ar,lr,{...dr,...ir,interpolationkey:Sr})};this.resetRegExp();const _r=dr&&dr.missingInterpolationHandler||this.options.missingInterpolationHandler,br=dr&&dr.interpolation&&dr.interpolation.skipOnVariables!==void 0?dr.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:wr=>regexSafe(wr)},{regex:this.regexp,safeValue:wr=>this.escapeValue?regexSafe(this.escape(wr)):regexSafe(wr)}].forEach(wr=>{for(mr=0;fr=wr.regex.exec(rr);){const xr=fr[1].trim();if(hr=yr(xr),hr===void 0)if(typeof _r=="function"){const Ar=_r(rr,fr,dr);hr=isString$1(Ar)?Ar:""}else if(dr&&Object.prototype.hasOwnProperty.call(dr,xr))hr="";else if(br){hr=fr[0];continue}else this.logger.warn(`missed to pass in variable ${xr} for interpolating ${rr}`),hr="";else!isString$1(hr)&&!this.useRawValueToEscape&&(hr=makeString(hr));const Sr=wr.safeValue(hr);if(rr=rr.replace(fr[0],Sr),br?(wr.regex.lastIndex+=hr.length,wr.regex.lastIndex-=fr[0].length):wr.regex.lastIndex=0,mr++,mr>=this.maxReplaces)break}}),rr}nest(rr,ir){let lr=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},dr,fr,hr;const mr=(gr,yr)=>{const _r=this.nestingOptionsSeparator;if(gr.indexOf(_r)<0)return gr;const br=gr.split(new RegExp(`${_r}[ ]*{`));let vr=`{${br[1]}`;gr=br[0],vr=this.interpolate(vr,hr);const wr=vr.match(/'/g),xr=vr.match(/"/g);(wr&&wr.length%2===0&&!xr||xr.length%2!==0)&&(vr=vr.replace(/'/g,'"'));try{hr=JSON.parse(vr),yr&&(hr={...yr,...hr})}catch(Sr){return this.logger.warn(`failed parsing options string in nesting for key ${gr}`,Sr),`${gr}${_r}${vr}`}return hr.defaultValue&&hr.defaultValue.indexOf(this.prefix)>-1&&delete hr.defaultValue,gr};for(;dr=this.nestingRegexp.exec(rr);){let gr=[];hr={...lr},hr=hr.replace&&!isString$1(hr.replace)?hr.replace:hr,hr.applyPostProcessor=!1,delete hr.defaultValue;let yr=!1;if(dr[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(dr[1])){const _r=dr[1].split(this.formatSeparator).map(br=>br.trim());dr[1]=_r.shift(),gr=_r,yr=!0}if(fr=ir(mr.call(this,dr[1].trim(),hr),hr),fr&&dr[0]===rr&&!isString$1(fr))return fr;isString$1(fr)||(fr=makeString(fr)),fr||(this.logger.warn(`missed to resolve ${dr[1]} for nesting ${rr}`),fr=""),yr&&(fr=gr.reduce((_r,br)=>this.format(_r,br,lr.lng,{...lr,interpolationkey:dr[1].trim()}),fr.trim())),rr=rr.replace(dr[0],fr),this.regexp.lastIndex=0}return rr}}const parseFormatStr=tr=>{let rr=tr.toLowerCase().trim();const ir={};if(tr.indexOf("(")>-1){const lr=tr.split("(");rr=lr[0].toLowerCase().trim();const dr=lr[1].substring(0,lr[1].length-1);rr==="currency"&&dr.indexOf(":")<0?ir.currency||(ir.currency=dr.trim()):rr==="relativetime"&&dr.indexOf(":")<0?ir.range||(ir.range=dr.trim()):dr.split(";").forEach(hr=>{if(hr){const[mr,...gr]=hr.split(":"),yr=gr.join(":").trim().replace(/^'+|'+$/g,""),_r=mr.trim();ir[_r]||(ir[_r]=yr),yr==="false"&&(ir[_r]=!1),yr==="true"&&(ir[_r]=!0),isNaN(yr)||(ir[_r]=parseInt(yr,10))}})}return{formatName:rr,formatOptions:ir}},createCachedFormatter=tr=>{const rr={};return(ir,lr,dr)=>{let fr=dr;dr&&dr.interpolationkey&&dr.formatParams&&dr.formatParams[dr.interpolationkey]&&dr[dr.interpolationkey]&&(fr={...fr,[dr.interpolationkey]:void 0});const hr=lr+JSON.stringify(fr);let mr=rr[hr];return mr||(mr=tr(getCleanedCode(lr),dr),rr[hr]=mr),mr(ir)}};class Formatter{constructor(){let rr=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=baseLogger.create("formatter"),this.options=rr,this.formats={number:createCachedFormatter((ir,lr)=>{const dr=new Intl.NumberFormat(ir,{...lr});return fr=>dr.format(fr)}),currency:createCachedFormatter((ir,lr)=>{const dr=new Intl.NumberFormat(ir,{...lr,style:"currency"});return fr=>dr.format(fr)}),datetime:createCachedFormatter((ir,lr)=>{const dr=new Intl.DateTimeFormat(ir,{...lr});return fr=>dr.format(fr)}),relativetime:createCachedFormatter((ir,lr)=>{const dr=new Intl.RelativeTimeFormat(ir,{...lr});return fr=>dr.format(fr,lr.range||"day")}),list:createCachedFormatter((ir,lr)=>{const dr=new Intl.ListFormat(ir,{...lr});return fr=>dr.format(fr)})},this.init(rr)}init(rr){let ir=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};this.formatSeparator=ir.interpolation.formatSeparator||","}add(rr,ir){this.formats[rr.toLowerCase().trim()]=ir}addCached(rr,ir){this.formats[rr.toLowerCase().trim()]=createCachedFormatter(ir)}format(rr,ir,lr){let dr=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const fr=ir.split(this.formatSeparator);if(fr.length>1&&fr[0].indexOf("(")>1&&fr[0].indexOf(")")<0&&fr.find(mr=>mr.indexOf(")")>-1)){const mr=fr.findIndex(gr=>gr.indexOf(")")>-1);fr[0]=[fr[0],...fr.splice(1,mr)].join(this.formatSeparator)}return fr.reduce((mr,gr)=>{const{formatName:yr,formatOptions:_r}=parseFormatStr(gr);if(this.formats[yr]){let br=mr;try{const vr=dr&&dr.formatParams&&dr.formatParams[dr.interpolationkey]||{},wr=vr.locale||vr.lng||dr.locale||dr.lng||lr;br=this.formats[yr](mr,wr,{..._r,...dr,...vr})}catch(vr){this.logger.warn(vr)}return br}else this.logger.warn(`there was no format function for ${yr}`);return mr},rr)}}const removePending=(tr,rr)=>{tr.pending[rr]!==void 0&&(delete tr.pending[rr],tr.pendingCount--)};class Connector extends EventEmitter{constructor(rr,ir,lr){let dr=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};super(),this.backend=rr,this.store=ir,this.services=lr,this.languageUtils=lr.languageUtils,this.options=dr,this.logger=baseLogger.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=dr.maxParallelReads||10,this.readingCalls=0,this.maxRetries=dr.maxRetries>=0?dr.maxRetries:5,this.retryTimeout=dr.retryTimeout>=1?dr.retryTimeout:350,this.state={},this.queue=[],this.backend&&this.backend.init&&this.backend.init(lr,dr.backend,dr)}queueLoad(rr,ir,lr,dr){const fr={},hr={},mr={},gr={};return rr.forEach(yr=>{let _r=!0;ir.forEach(br=>{const vr=`${yr}|${br}`;!lr.reload&&this.store.hasResourceBundle(yr,br)?this.state[vr]=2:this.state[vr]<0||(this.state[vr]===1?hr[vr]===void 0&&(hr[vr]=!0):(this.state[vr]=1,_r=!1,hr[vr]===void 0&&(hr[vr]=!0),fr[vr]===void 0&&(fr[vr]=!0),gr[br]===void 0&&(gr[br]=!0)))}),_r||(mr[yr]=!0)}),(Object.keys(fr).length||Object.keys(hr).length)&&this.queue.push({pending:hr,pendingCount:Object.keys(hr).length,loaded:{},errors:[],callback:dr}),{toLoad:Object.keys(fr),pending:Object.keys(hr),toLoadLanguages:Object.keys(mr),toLoadNamespaces:Object.keys(gr)}}loaded(rr,ir,lr){const dr=rr.split("|"),fr=dr[0],hr=dr[1];ir&&this.emit("failedLoading",fr,hr,ir),!ir&&lr&&this.store.addResourceBundle(fr,hr,lr,void 0,void 0,{skipCopy:!0}),this.state[rr]=ir?-1:2,ir&&lr&&(this.state[rr]=0);const mr={};this.queue.forEach(gr=>{pushPath(gr.loaded,[fr],hr),removePending(gr,rr),ir&&gr.errors.push(ir),gr.pendingCount===0&&!gr.done&&(Object.keys(gr.loaded).forEach(yr=>{mr[yr]||(mr[yr]={});const _r=gr.loaded[yr];_r.length&&_r.forEach(br=>{mr[yr][br]===void 0&&(mr[yr][br]=!0)})}),gr.done=!0,gr.errors.length?gr.callback(gr.errors):gr.callback())}),this.emit("loaded",mr),this.queue=this.queue.filter(gr=>!gr.done)}read(rr,ir,lr){let dr=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,fr=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,hr=arguments.length>5?arguments[5]:void 0;if(!rr.length)return hr(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:rr,ns:ir,fcName:lr,tried:dr,wait:fr,callback:hr});return}this.readingCalls++;const mr=(yr,_r)=>{if(this.readingCalls--,this.waitingReads.length>0){const br=this.waitingReads.shift();this.read(br.lng,br.ns,br.fcName,br.tried,br.wait,br.callback)}if(yr&&_r&&dr<this.maxRetries){setTimeout(()=>{this.read.call(this,rr,ir,lr,dr+1,fr*2,hr)},fr);return}hr(yr,_r)},gr=this.backend[lr].bind(this.backend);if(gr.length===2){try{const yr=gr(rr,ir);yr&&typeof yr.then=="function"?yr.then(_r=>mr(null,_r)).catch(mr):mr(null,yr)}catch(yr){mr(yr)}return}return gr(rr,ir,mr)}prepareLoading(rr,ir){let lr=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},dr=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),dr&&dr();isString$1(rr)&&(rr=this.languageUtils.toResolveHierarchy(rr)),isString$1(ir)&&(ir=[ir]);const fr=this.queueLoad(rr,ir,lr,dr);if(!fr.toLoad.length)return fr.pending.length||dr(),null;fr.toLoad.forEach(hr=>{this.loadOne(hr)})}load(rr,ir,lr){this.prepareLoading(rr,ir,{},lr)}reload(rr,ir,lr){this.prepareLoading(rr,ir,{reload:!0},lr)}loadOne(rr){let ir=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";const lr=rr.split("|"),dr=lr[0],fr=lr[1];this.read(dr,fr,"read",void 0,void 0,(hr,mr)=>{hr&&this.logger.warn(`${ir}loading namespace ${fr} for language ${dr} failed`,hr),!hr&&mr&&this.logger.log(`${ir}loaded namespace ${fr} for language ${dr}`,mr),this.loaded(rr,hr,mr)})}saveMissing(rr,ir,lr,dr,fr){let hr=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{},mr=arguments.length>6&&arguments[6]!==void 0?arguments[6]:()=>{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(ir)){this.logger.warn(`did not save key "${lr}" as the namespace "${ir}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(lr==null||lr==="")){if(this.backend&&this.backend.create){const gr={...hr,isUpdate:fr},yr=this.backend.create.bind(this.backend);if(yr.length<6)try{let _r;yr.length===5?_r=yr(rr,ir,lr,dr,gr):_r=yr(rr,ir,lr,dr),_r&&typeof _r.then=="function"?_r.then(br=>mr(null,br)).catch(mr):mr(null,_r)}catch(_r){mr(_r)}else yr(rr,ir,lr,dr,mr,gr)}!rr||!rr[0]||this.store.addResource(rr[0],ir,lr,dr)}}}const get=()=>({debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:tr=>{let rr={};if(typeof tr[1]=="object"&&(rr=tr[1]),isString$1(tr[1])&&(rr.defaultValue=tr[1]),isString$1(tr[2])&&(rr.tDescription=tr[2]),typeof tr[2]=="object"||typeof tr[3]=="object"){const ir=tr[3]||tr[2];Object.keys(ir).forEach(lr=>{rr[lr]=ir[lr]})}return rr},interpolation:{escapeValue:!0,format:tr=>tr,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}),transformOptions=tr=>(isString$1(tr.ns)&&(tr.ns=[tr.ns]),isString$1(tr.fallbackLng)&&(tr.fallbackLng=[tr.fallbackLng]),isString$1(tr.fallbackNS)&&(tr.fallbackNS=[tr.fallbackNS]),tr.supportedLngs&&tr.supportedLngs.indexOf("cimode")<0&&(tr.supportedLngs=tr.supportedLngs.concat(["cimode"])),tr),noop=()=>{},bindMemberFunctions=tr=>{Object.getOwnPropertyNames(Object.getPrototypeOf(tr)).forEach(ir=>{typeof tr[ir]=="function"&&(tr[ir]=tr[ir].bind(tr))})};class I18n extends EventEmitter{constructor(){let rr=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},ir=arguments.length>1?arguments[1]:void 0;if(super(),this.options=transformOptions(rr),this.services={},this.logger=baseLogger,this.modules={external:[]},bindMemberFunctions(this),ir&&!this.isInitialized&&!rr.isClone){if(!this.options.initImmediate)return this.init(rr,ir),this;setTimeout(()=>{this.init(rr,ir)},0)}}init(){var rr=this;let ir=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},lr=arguments.length>1?arguments[1]:void 0;this.isInitializing=!0,typeof ir=="function"&&(lr=ir,ir={}),!ir.defaultNS&&ir.defaultNS!==!1&&ir.ns&&(isString$1(ir.ns)?ir.defaultNS=ir.ns:ir.ns.indexOf("translation")<0&&(ir.defaultNS=ir.ns[0]));const dr=get();this.options={...dr,...this.options,...transformOptions(ir)},this.options.compatibilityAPI!=="v1"&&(this.options.interpolation={...dr.interpolation,...this.options.interpolation}),ir.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=ir.keySeparator),ir.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=ir.nsSeparator);const fr=_r=>_r?typeof _r=="function"?new _r:_r:null;if(!this.options.isClone){this.modules.logger?baseLogger.init(fr(this.modules.logger),this.options):baseLogger.init(null,this.options);let _r;this.modules.formatter?_r=this.modules.formatter:typeof Intl<"u"&&(_r=Formatter);const br=new LanguageUtil(this.options);this.store=new ResourceStore(this.options.resources,this.options);const vr=this.services;vr.logger=baseLogger,vr.resourceStore=this.store,vr.languageUtils=br,vr.pluralResolver=new PluralResolver(br,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),_r&&(!this.options.interpolation.format||this.options.interpolation.format===dr.interpolation.format)&&(vr.formatter=fr(_r),vr.formatter.init(vr,this.options),this.options.interpolation.format=vr.formatter.format.bind(vr.formatter)),vr.interpolator=new Interpolator(this.options),vr.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},vr.backendConnector=new Connector(fr(this.modules.backend),vr.resourceStore,vr,this.options),vr.backendConnector.on("*",function(wr){for(var xr=arguments.length,Sr=new Array(xr>1?xr-1:0),Ar=1;Ar<xr;Ar++)Sr[Ar-1]=arguments[Ar];rr.emit(wr,...Sr)}),this.modules.languageDetector&&(vr.languageDetector=fr(this.modules.languageDetector),vr.languageDetector.init&&vr.languageDetector.init(vr,this.options.detection,this.options)),this.modules.i18nFormat&&(vr.i18nFormat=fr(this.modules.i18nFormat),vr.i18nFormat.init&&vr.i18nFormat.init(this)),this.translator=new Translator(this.services,this.options),this.translator.on("*",function(wr){for(var xr=arguments.length,Sr=new Array(xr>1?xr-1:0),Ar=1;Ar<xr;Ar++)Sr[Ar-1]=arguments[Ar];rr.emit(wr,...Sr)}),this.modules.external.forEach(wr=>{wr.init&&wr.init(this)})}if(this.format=this.options.interpolation.format,lr||(lr=noop),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const _r=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);_r.length>0&&_r[0]!=="dev"&&(this.options.lng=_r[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(_r=>{this[_r]=function(){return rr.store[_r](...arguments)}}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(_r=>{this[_r]=function(){return rr.store[_r](...arguments),rr}});const gr=defer(),yr=()=>{const _r=(br,vr)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),gr.resolve(vr),lr(br,vr)};if(this.languages&&this.options.compatibilityAPI!=="v1"&&!this.isInitialized)return _r(null,this.t.bind(this));this.changeLanguage(this.options.lng,_r)};return this.options.resources||!this.options.initImmediate?yr():setTimeout(yr,0),gr}loadResources(rr){let lr=arguments.length>1&&arguments[1]!==void 0?arguments[1]:noop;const dr=isString$1(rr)?rr:this.language;if(typeof rr=="function"&&(lr=rr),!this.options.resources||this.options.partialBundledLanguages){if(dr&&dr.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return lr();const fr=[],hr=mr=>{if(!mr||mr==="cimode")return;this.services.languageUtils.toResolveHierarchy(mr).forEach(yr=>{yr!=="cimode"&&fr.indexOf(yr)<0&&fr.push(yr)})};dr?hr(dr):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(gr=>hr(gr)),this.options.preload&&this.options.preload.forEach(mr=>hr(mr)),this.services.backendConnector.load(fr,this.options.ns,mr=>{!mr&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),lr(mr)})}else lr(null)}reloadResources(rr,ir,lr){const dr=defer();return typeof rr=="function"&&(lr=rr,rr=void 0),typeof ir=="function"&&(lr=ir,ir=void 0),rr||(rr=this.languages),ir||(ir=this.options.ns),lr||(lr=noop),this.services.backendConnector.reload(rr,ir,fr=>{dr.resolve(),lr(fr)}),dr}use(rr){if(!rr)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!rr.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return rr.type==="backend"&&(this.modules.backend=rr),(rr.type==="logger"||rr.log&&rr.warn&&rr.error)&&(this.modules.logger=rr),rr.type==="languageDetector"&&(this.modules.languageDetector=rr),rr.type==="i18nFormat"&&(this.modules.i18nFormat=rr),rr.type==="postProcessor"&&postProcessor.addPostProcessor(rr),rr.type==="formatter"&&(this.modules.formatter=rr),rr.type==="3rdParty"&&this.modules.external.push(rr),this}setResolvedLanguage(rr){if(!(!rr||!this.languages)&&!(["cimode","dev"].indexOf(rr)>-1))for(let ir=0;ir<this.languages.length;ir++){const lr=this.languages[ir];if(!(["cimode","dev"].indexOf(lr)>-1)&&this.store.hasLanguageSomeTranslations(lr)){this.resolvedLanguage=lr;break}}}changeLanguage(rr,ir){var lr=this;this.isLanguageChangingTo=rr;const dr=defer();this.emit("languageChanging",rr);const fr=gr=>{this.language=gr,this.languages=this.services.languageUtils.toResolveHierarchy(gr),this.resolvedLanguage=void 0,this.setResolvedLanguage(gr)},hr=(gr,yr)=>{yr?(fr(yr),this.translator.changeLanguage(yr),this.isLanguageChangingTo=void 0,this.emit("languageChanged",yr),this.logger.log("languageChanged",yr)):this.isLanguageChangingTo=void 0,dr.resolve(function(){return lr.t(...arguments)}),ir&&ir(gr,function(){return lr.t(...arguments)})},mr=gr=>{!rr&&!gr&&this.services.languageDetector&&(gr=[]);const yr=isString$1(gr)?gr:this.services.languageUtils.getBestMatchFromCodes(gr);yr&&(this.language||fr(yr),this.translator.language||this.translator.changeLanguage(yr),this.services.languageDetector&&this.services.languageDetector.cacheUserLanguage&&this.services.languageDetector.cacheUserLanguage(yr)),this.loadResources(yr,_r=>{hr(_r,yr)})};return!rr&&this.services.languageDetector&&!this.services.languageDetector.async?mr(this.services.languageDetector.detect()):!rr&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(mr):this.services.languageDetector.detect(mr):mr(rr),dr}getFixedT(rr,ir,lr){var dr=this;const fr=function(hr,mr){let gr;if(typeof mr!="object"){for(var yr=arguments.length,_r=new Array(yr>2?yr-2:0),br=2;br<yr;br++)_r[br-2]=arguments[br];gr=dr.options.overloadTranslationOptionHandler([hr,mr].concat(_r))}else gr={...mr};gr.lng=gr.lng||fr.lng,gr.lngs=gr.lngs||fr.lngs,gr.ns=gr.ns||fr.ns,gr.keyPrefix!==""&&(gr.keyPrefix=gr.keyPrefix||lr||fr.keyPrefix);const vr=dr.options.keySeparator||".";let wr;return gr.keyPrefix&&Array.isArray(hr)?wr=hr.map(xr=>`${gr.keyPrefix}${vr}${xr}`):wr=gr.keyPrefix?`${gr.keyPrefix}${vr}${hr}`:hr,dr.t(wr,gr)};return isString$1(rr)?fr.lng=rr:fr.lngs=rr,fr.ns=ir,fr.keyPrefix=lr,fr}t(){return this.translator&&this.translator.translate(...arguments)}exists(){return this.translator&&this.translator.exists(...arguments)}setDefaultNamespace(rr){this.options.defaultNS=rr}hasLoadedNamespace(rr){let ir=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const lr=ir.lng||this.resolvedLanguage||this.languages[0],dr=this.options?this.options.fallbackLng:!1,fr=this.languages[this.languages.length-1];if(lr.toLowerCase()==="cimode")return!0;const hr=(mr,gr)=>{const yr=this.services.backendConnector.state[`${mr}|${gr}`];return yr===-1||yr===0||yr===2};if(ir.precheck){const mr=ir.precheck(this,hr);if(mr!==void 0)return mr}return!!(this.hasResourceBundle(lr,rr)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||hr(lr,rr)&&(!dr||hr(fr,rr)))}loadNamespaces(rr,ir){const lr=defer();return this.options.ns?(isString$1(rr)&&(rr=[rr]),rr.forEach(dr=>{this.options.ns.indexOf(dr)<0&&this.options.ns.push(dr)}),this.loadResources(dr=>{lr.resolve(),ir&&ir(dr)}),lr):(ir&&ir(),Promise.resolve())}loadLanguages(rr,ir){const lr=defer();isString$1(rr)&&(rr=[rr]);const dr=this.options.preload||[],fr=rr.filter(hr=>dr.indexOf(hr)<0&&this.services.languageUtils.isSupportedCode(hr));return fr.length?(this.options.preload=dr.concat(fr),this.loadResources(hr=>{lr.resolve(),ir&&ir(hr)}),lr):(ir&&ir(),Promise.resolve())}dir(rr){if(rr||(rr=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!rr)return"rtl";const ir=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],lr=this.services&&this.services.languageUtils||new LanguageUtil(get());return ir.indexOf(lr.getLanguagePartFromCode(rr))>-1||rr.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(){let rr=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},ir=arguments.length>1?arguments[1]:void 0;return new I18n(rr,ir)}cloneInstance(){let rr=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},ir=arguments.length>1&&arguments[1]!==void 0?arguments[1]:noop;const lr=rr.forkResourceStore;lr&&delete rr.forkResourceStore;const dr={...this.options,...rr,isClone:!0},fr=new I18n(dr);return(rr.debug!==void 0||rr.prefix!==void 0)&&(fr.logger=fr.logger.clone(rr)),["store","services","language"].forEach(mr=>{fr[mr]=this[mr]}),fr.services={...this.services},fr.services.utils={hasLoadedNamespace:fr.hasLoadedNamespace.bind(fr)},lr&&(fr.store=new ResourceStore(this.store.data,dr),fr.services.resourceStore=fr.store),fr.translator=new Translator(fr.services,dr),fr.translator.on("*",function(mr){for(var gr=arguments.length,yr=new Array(gr>1?gr-1:0),_r=1;_r<gr;_r++)yr[_r-1]=arguments[_r];fr.emit(mr,...yr)}),fr.init(dr,ir),fr.translator.options=dr,fr.translator.backendConnector.services.utils={hasLoadedNamespace:fr.hasLoadedNamespace.bind(fr)},fr}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const instance=I18n.createInstance();instance.createInstance=I18n.createInstance;const t=instance.t,common={cancel:"Cancel",delete:"Delete",continue:"Continue",empty:"Empty",create:"Create",save:"Save",export:"Export",reload:"Reload",reloadConnect:"Click here to reload Connect"},searchbar={placeholder:"Search Powerhouse",filterLabel:"File type"},folderView={sections:{folders:{title:"Folders",empty:"No folders 🗂️"},documents:{title:"Documents and files",empty:"No documents or files 📄"}}},files={options:{switchboardLink:"Switchboard Link"}},modals={deleteItem:{folder:{header:"Delete “{{item}}” folder?",body:"Are you sure you want to delete this folder? All files and subfolders within it will be removed."},file:{header:"Delete “{{item}}” file?",body:"Are you sure you want to delete this file?"}},deleteDrive:{title:'Delete "{{label}}" drive?',body:"Are you sure you want to delete this drive? All files and subfolders within it will be removed. Do you want to proceed?",inputPlaceholder:"Enter drive name..."},upgradeDrive:{header:"Upgrade to cloud drive",body:"You are moving files from a private to a shared drive. These files will become accessible to others in the shared drive.Do you want to proceed?"},createDocument:{header:"Create a new document",placeholder:"Document name"},connectSettings:{title:"Settings",body:"These settings will apply to all drives.",clearStorage:{button:"Clear Storage",description:"Delete previous session data",confirmation:{title:"Clear Storage",body:"Are you sure you want to clear the storage? This will remove all previous session data.",clearButton:"Clear Storage"}},enabledDocumentTypes:{title:"Document Models",description:"Documents enabled",allSelected:"All documents are selected"}},exportDocumentWithErrors:{title:"Your document contains errors",body:"Your document contains structure errors. Do you want to export it anyway?"},disclaimer:{title:"Disclaimer",body:"All content provided herein our website, hyperlinked sites, associated applications, forums, blogs, social media accounts and other platforms (“Site”) is for your general information only, procured from third party sources. We make no warranties of any kind in relation to our content, including but not limited to accuracy and updatedness. No part of the content that we provide constitutes financial advice, legal advice or any other form of advice meant for your specific reliance for any purpose. Any use or reliance on our content is solely at your own risk and discretion. You should conduct your own research, review, analyse and verify our content before relying on them. Trading is a highly risky activity that can lead to major losses, please therefore consult your financial advisor before making any decision. No content on our Site is meant to be a solicitation or offer."},cookiesPolicy:{title:"Cookies Policy",body:"<subtitle>Use of Cookies and Similar Technologies</subtitle><p>The Site is using cookies. Cookies are small text files that are placed on your computer by websites that you visit. They are widely used in order to make websites work, or work more efficiently, as well as to provide information to the owners of the site. Cookies are typically stored on your computer´s hard drive.Information collected from cookies is used by us to evaluate the effectiveness of our Site and analyze trends. The information collected from cookies allows us to determine such things as which parts of the Site are most visited and difficulties our visitors may experience in accessing the SIte. With this knowledge, we can improve the quality of your experience on the Site by recognizing and delivering more of the most desired features and information, as well as by resolving access difficulties.</p><p>We use third party service providers, to assist us in better understanding the use of our Site. Our service providers will place cookies on the hard drive of your computer (or use similar technologies) and will receive information that we select that will educate us on such things as how visitors navigate around our Site. This information is aggregated to provide statistical data about our users browsing actions and patterns, and does not personally identify individuals. This information may include:</p><p>Computer or mobile device information, Website usage information, such as:<list></p><bullet>Page views,</bullet><bullet>Button clicks,</bullet><bullet>Input form changes (without the values being entered),</bullet><bullet>Errors.</bullet></list><p>Our service providers analyses this information and provides us with aggregate reports. The information and analysis provided by our service providers will be used to assist us in better understanding our visitors interests in our Site and how to better serve those interests. If you want to avoid using cookies altogether, you can disable cookies in your browser. However, disabling cookies might make it impossible for you to use certain features of the Site. Your use of the Site with a browser that is configured to accept cookies constitutes an acceptance of our and third-party cookies.</p>"}},notifications={deleteDriveSuccess:"Drive successfully deleted",deleteFolderSuccess:"Folder deleted",fileDeleteSuccess:"File deleted",addDriveSuccess:"New drive successfully added",driveSyncSuccess:"Drive synced successfully",driveSyncError:"Error synchronizing drive {{drive}}",driveSyncConflict:"Conflict error detected in {{drive}}",reloadApp:"It seems like you're running an outdated version of the app. Please reload Connect to get the latest version."},footer={cookiePolicy:"Cookie Policy",termsOfUse:"Terms of Use",disclaimer:"Disclaimer",builtWith:"Built with <icon /> Powerhouse"},cookieBanner={message:"This website uses cookies for analytic purposes only. Cookies are anonymous and do not link to user data. We collect information to improve the user experience and validate UI changes. You can still use the page without cookies. For more information, please read our <a>cookies policy.</a>",accept:"Accept configured cookies",reject:"Reject all cookies",cookies:{functional:"Functional cookies",analytics:"Analytics cookies"}},translationEN={common,searchbar,folderView,files,modals,notifications,footer,cookieBanner},resources={en:{code:"en",name:"English",translation:translationEN}};instance.use(initReactI18next).init({resources,fallbackLng:"en",debug:!1,interpolation:{escapeValue:!1}}).catch(tr=>{console.error(tr)});const isCookieAccepted=(tr,rr)=>tr.some(ir=>ir.id===rr&&ir.value),CookieBanner=()=>{const{t:tr}=useTranslation(void 0,{useSuspense:!0,i18n:instance}),[rr,ir]=useCookieBanner(),[,lr]=useAcceptedCookies(),dr=[{id:"analytics-cookie",label:tr("cookieBanner.cookies.analytics"),value:!0}],fr=mr=>{ir(!1),isCookieAccepted(mr,"analytics-cookie")&&lr(gr=>({...gr,analytics:!0}))},hr=()=>{ir(!1),lr(()=>({analytics:!1,functional:!1,marketing:!1}))};return rr?jsxs("div",{className:"absolute inset-0 z-[10000] backdrop-blur-sm",children:[jsx$1("div",{className:"absolute inset-0 bg-black opacity-15"}),jsx$1("div",{className:"absolute inset-x-0 bottom-0 flex justify-center bg-white px-10 pb-16 pt-10 shadow-lg",children:jsx$1(CookieBanner$1,{className:"max-w-[1024px]",cookies:dr,onSubmit:fr,onReject:hr,submitLabel:tr("cookieBanner.accept"),rejectLabel:tr("cookieBanner.reject"),children:jsx$1("p",{className:"font-semibold text-gray-500",children:jsx$1(Trans,{i18nKey:"cookieBanner.message",components:{a:jsx$1("a",{onClick:()=>showPHModal({type:"cookiesPolicy"}),className:"cursor-pointer text-gray-900 hover:underline"},"cookieBanner.message-link")}},"cookieBanner.message")})})})]}):null},CONNECT_TOAST_CONTAINER_ID="connect";function toast(tr,rr){const{type:ir="default",containerId:lr=CONNECT_TOAST_CONTAINER_ID,...dr}=rr||{};return toast$1(tr,{type:ir,containerId:lr,...dr})}function AddDriveModal(){const tr=usePHModal(),rr=(tr==null?void 0:tr.type)==="addDrive",ir=useUser(),lr=useConnectCrypto(),dr=useDriveEditorModules(),fr=async _r=>{try{const br=dr==null?void 0:dr.find(wr=>wr.id===_r.appId),vr=await addDrive({global:{name:_r.name,icon:null},local:{sharingType:_r.sharingType.toLowerCase()}},br==null?void 0:br.id);if(toast$1(t("notifications.addDriveSuccess"),{type:"connect-success"}),!vr)return;setSelectedDrive(vr)}catch(br){console.error(br)}},hr=async _r=>{try{const br=await addRemoteDrive(_r.url,{sharingType:_r.sharingType,availableOffline:_r.availableOffline,listeners:[{block:!0,callInfo:{data:_r.url,name:"switchboard-push",transmitterType:"SwitchboardPush"},filter:{branch:["main"],documentId:["*"],documentType:["*"],scope:["global"]},label:"Switchboard Sync",listenerId:"1",system:!0}],triggers:[]});if(toast$1(t("notifications.addDriveSuccess"),{type:"connect-success"}),!br)return;setSelectedDrive(br)}catch(br){console.error(br)}};async function mr(_r){await fr(_r),closePHModal()}async function gr(_r){await hr(_r),closePHModal()}const yr=dr.length>0;return jsx$1(AddDriveModal$1,{open:rr&&yr,onAddLocalDrive:mr,onAddRemoteDrive:gr,requestPublicDrive:async _r=>{var br,vr;try{const wr=await((br=lr==null?void 0:lr.getBearerToken)==null?void 0:br.call(lr,_r,ir==null?void 0:ir.address,!0,{expiresIn:10}));return requestPublicDrive(_r,{Authorization:`Bearer ${wr}`})}catch(wr){console.error(wr);const xr=await((vr=lr==null?void 0:lr.getBearerToken)==null?void 0:vr.call(lr,_r,ir==null?void 0:ir.address,!0,{expiresIn:10}));return requestPublicDrive(_r,{Authorization:`Bearer ${xr}`})}},onOpenChange:_r=>{if(!_r)return closePHModal()},appOptions:(dr==null?void 0:dr.map(_r=>({id:_r.id,name:_r.name,driveEditor:_r.id})))||[]})}async function loadGenericDriveExplorerEditorModule(){const{GenericDriveExplorer:tr}=await __vitePreload(async()=>{const{GenericDriveExplorer:hr}=await import("./index.CXV2LGi6.js").then(mr=>mr.i);return{GenericDriveExplorer:hr}},[],import.meta.url),rr="Generic Drive Explorer",ir=tr.documentTypes,lr=tr.Component,dr=tr.config;return{id:DEFAULT_DRIVE_EDITOR_ID,name:rr,documentTypes:ir,Component:lr,config:dr}}async function loadDocumentModelEditorModule(){await __vitePreload(()=>Promise.resolve({}),__vite__mapDeps([4]),import.meta.url);const{documentModelEditorModule:tr}=await __vitePreload(async()=>{const{documentModelEditorModule:rr}=await import("./index.DA_wjuiB.js");return{documentModelEditorModule:rr}},__vite__mapDeps([5,6]),import.meta.url);return tr}async function loadDocumentModelEditor(){const tr=await loadDocumentModelEditorModule(),rr=tr.config,ir=rr.id,lr="Document Model Editor",dr=tr.documentTypes,fr=tr.Component;return{id:ir,name:lr,documentTypes:dr,Component:fr,config:rr}}async function loadDocumentModelDocumentModelModule(){const{documentModelDocumentModelModule:tr}=await __vitePreload(async()=>{const{documentModelDocumentModelModule:br}=await import("./index.DL3Up0hU.js");return{documentModelDocumentModelModule:br}},__vite__mapDeps([7,6]),import.meta.url),rr=tr.documentModel,ir=rr.name,lr=rr.id,dr=lr,fr=rr.extension,hr=rr.specifications,mr=tr.reducer,gr=tr.actions,yr=tr.utils;return{id:dr,name:ir,documentType:lr,extension:fr,specifications:hr,reducer:mr,actions:gr,utils:yr,documentModel:rr}}async function loadDriveDocumentModelModule(){const{driveDocumentModelModule:tr}=await __vitePreload(async()=>{const{driveDocumentModelModule:br}=await Promise.resolve().then(()=>index$2);return{driveDocumentModelModule:br}},void 0,import.meta.url),rr=tr.documentModel,ir=rr.name,lr=rr.id,dr=lr,fr=rr.extension,hr=rr.specifications,mr=tr.reducer,gr=tr.actions,yr=tr.utils;return{id:dr,name:ir,documentType:lr,extension:fr,specifications:hr,reducer:mr,actions:gr,utils:yr,documentModel:rr}}async function loadCommonPackage(){const tr=await loadDocumentModelDocumentModelModule(),rr=await loadDriveDocumentModelModule(),ir=await loadDocumentModelEditor(),lr=await loadGenericDriveExplorerEditorModule();return{id:COMMON_PACKAGE_ID,name:"Common",description:"Common",category:"Common",author:{name:"Powerhouse",website:"https://powerhousedao.com"},modules:{documentModelModules:[tr,rr],editorModules:[ir,lr]}}}const externalPackagesUrl=connectConfig.routerBasename+"external-packages.js",externalPackagesEnabled=window.__VITE_ENVS.PROD;async function loadExternalPackages(){try{if(!externalPackagesEnabled)return[];const tr=await import(externalPackagesUrl),rr=tr==null?void 0:tr.default;return rr?rr.map(convertLegacyLibToVetraPackage):[]}catch(tr){return console.error(tr),[]}}let reactorStorage;function setReactorStorage(tr){reactorStorage=tr}async function clearReactorStorage(){return await(reactorStorage==null?void 0:reactorStorage.clear()),!!reactorStorage}async function loadVetraPackages(){const tr=await loadCommonPackage(),rr=await loadExternalPackages();return[tr,...rr]}async function createReactor(){if(window.reactor||window.loading)return;window.loading=!0,addPHEventHandlers();const tr=getAppConfig(),rr=await initConnectCrypto(),ir=await rr.did(),lr=initRenown(ir,connectConfig.routerBasename),dr=createBrowserStorage(connectConfig.routerBasename);setReactorStorage(dr);const fr=await loadVetraPackages(),hr=fr.flatMap(Ar=>Ar.modules.documentModelModules).filter(Ar=>Ar!==void 0),mr=createBrowserDocumentDriveServer(hr,dr);await initReactor(mr,lr,rr);const gr=new ProcessorManager(mr.listeners,mr),yr=await getDrives(mr),_r=getDriveUrl();if(_r&&!yr.some(Ar=>_r.includes(Ar.header.slug)||_r.includes(Ar.header.id)))try{await mr.addRemoteDrive(_r,{sharingType:"PUBLIC",availableOffline:!0,listeners:[{block:!0,callInfo:{data:_r,name:"switchboard-push",transmitterType:"SwitchboardPush"},filter:{branch:["main"],documentId:["*"],documentType:["*"],scope:["global"]},label:"Switchboard Sync",listenerId:generateId(),system:!0}],triggers:[]}),window.location.href="/d/"+_r.split("/").pop()}catch(Ar){logger$6.error("Error adding remote drive",Ar)}else _r&&(window.location.href="/d/"+_r.split("/").pop());const br=await getDocuments(mr),vr=window.location.pathname,wr=extractDriveSlugFromPath(vr),xr=extractNodeSlugFromPath(vr),Sr=getDidFromUrl();await login(Sr,mr,lr,rr),dispatchSetReactorEvent(mr),dispatchSetConnectCryptoEvent(rr),dispatchSetDidEvent(ir),dispatchSetRenownEvent(lr),dispatchSetAppConfigEvent(tr),dispatchSetProcessorManagerEvent(gr),dispatchSetDrivesEvent(yr),dispatchSetDocumentsEvent(br),dispatchSetVetraPackagesEvent(fr),dispatchSetSelectedDriveIdEvent(wr),dispatchSetSelectedNodeIdEvent(xr),mr.on("syncStatus",(...Ar)=>{logger$6.verbose("syncStatus",...Ar),refreshReactorData(mr).catch(logger$6.error)}),mr.on("strandUpdate",(...Ar)=>{logger$6.verbose("strandUpdate",...Ar),refreshReactorData(mr).catch(logger$6.error)}),mr.on("defaultRemoteDrive",(...Ar)=>{logger$6.verbose("defaultRemoteDrive",...Ar),refreshReactorData(mr).catch(logger$6.error)}),mr.on("clientStrandsError",(...Ar)=>{logger$6.verbose("clientStrandsError",...Ar),refreshReactorData(mr).catch(logger$6.error)}),mr.on("driveAdded",(...Ar)=>{logger$6.verbose("driveAdded",...Ar),gr.registerDrive(Ar[0].header.id).catch(logger$6.error),refreshReactorData(mr).catch(logger$6.error)}),mr.on("driveDeleted",(...Ar)=>{logger$6.verbose("driveDeleted",...Ar),refreshReactorData(mr).catch(logger$6.error)}),mr.on("documentModelModules",(...Ar)=>{logger$6.verbose("documentModelModules",...Ar),refreshReactorData(mr).catch(logger$6.error)}),mr.on("documentOperationsAdded",(...Ar)=>{logger$6.verbose("documentOperationsAdded",...Ar),refreshReactorData(mr).catch(logger$6.error)}),mr.on("driveOperationsAdded",(...Ar)=>{logger$6.verbose("driveOperationsAdded",...Ar),refreshReactorData(mr).catch(logger$6.error)}),mr.on("operationsAdded",(...Ar)=>{logger$6.verbose("operationsAdded",...Ar),refreshReactorData(mr).catch(logger$6.error)}),window.loading=!1}function getAppConfig(){const tr=getAllowList(),rr=connectConfig.analytics.databaseName,ir=connectConfig.content.showSearchBar;return{allowList:tr,analyticsDatabaseName:rr,showSearchBar:ir}}function getAllowList(){const tr=window.__VITE_ENVS.PH_CONNECT_ARBITRUM_ALLOW_LIST,rr=window.__VITE_ENVS.PH_CONNECT_RWA_ALLOW_LIST;if(!(!tr.length&&!rr.length)){if(tr.length)return tr.split(",").filter(Boolean);if(rr.length)return rr.split(",").filter(Boolean)}}function getDidFromUrl(){const rr=new URLSearchParams(window.location.search).get("user");return rr?decodeURIComponent(rr):void 0}function getDriveUrl(){const rr=new URLSearchParams(window.location.search).get("driveUrl");return rr?decodeURIComponent(rr):void 0}const objectToString=Object.prototype.toString;function isError(tr){switch(objectToString.call(tr)){case"[object Error]":case"[object Exception]":case"[object DOMException]":return!0;default:return isInstanceOf(tr,Error)}}function isBuiltin(tr,rr){return objectToString.call(tr)===`[object ${rr}]`}function isErrorEvent(tr){return isBuiltin(tr,"ErrorEvent")}function isDOMError(tr){return isBuiltin(tr,"DOMError")}function isDOMException(tr){return isBuiltin(tr,"DOMException")}function isString(tr){return isBuiltin(tr,"String")}function isParameterizedString(tr){return typeof tr=="object"&&tr!==null&&"__sentry_template_string__"in tr&&"__sentry_template_values__"in tr}function isPrimitive(tr){return tr===null||isParameterizedString(tr)||typeof tr!="object"&&typeof tr!="function"}function isPlainObject(tr){return isBuiltin(tr,"Object")}function isEvent(tr){return typeof Event<"u"&&isInstanceOf(tr,Event)}function isElement(tr){return typeof Element<"u"&&isInstanceOf(tr,Element)}function isRegExp(tr){return isBuiltin(tr,"RegExp")}function isThenable(tr){return!!(tr&&tr.then&&typeof tr.then=="function")}function isSyntheticEvent(tr){return isPlainObject(tr)&&"nativeEvent"in tr&&"preventDefault"in tr&&"stopPropagation"in tr}function isNaN$1(tr){return typeof tr=="number"&&tr!==tr}function isInstanceOf(tr,rr){try{return tr instanceof rr}catch{return!1}}function isVueViewModel(tr){return!!(typeof tr=="object"&&tr!==null&&(tr.__isVue||tr._isVue))}function truncate(tr,rr=0){return typeof tr!="string"||rr===0||tr.length<=rr?tr:`${tr.slice(0,rr)}...`}function snipLine(tr,rr){let ir=tr;const lr=ir.length;if(lr<=150)return ir;rr>lr&&(rr=lr);let dr=Math.max(rr-60,0);dr<5&&(dr=0);let fr=Math.min(dr+140,lr);return fr>lr-5&&(fr=lr),fr===lr&&(dr=Math.max(fr-140,0)),ir=ir.slice(dr,fr),dr>0&&(ir=`'{snip} ${ir}`),fr<lr&&(ir+=" {snip}"),ir}function safeJoin(tr,rr){if(!Array.isArray(tr))return"";const ir=[];for(let lr=0;lr<tr.length;lr++){const dr=tr[lr];try{isVueViewModel(dr)?ir.push("[VueViewModel]"):ir.push(String(dr))}catch{ir.push("[value cannot be serialized]")}}return ir.join(rr)}function isMatchingPattern(tr,rr,ir=!1){return isString(tr)?isRegExp(rr)?rr.test(tr):isString(rr)?ir?tr===rr:tr.includes(rr):!1:!1}function stringMatchesSomePattern(tr,rr=[],ir=!1){return rr.some(lr=>isMatchingPattern(tr,lr,ir))}function isGlobalObj(tr){return tr&&tr.Math==Math?tr:void 0}const GLOBAL_OBJ=typeof globalThis=="object"&&isGlobalObj(globalThis)||typeof window=="object"&&isGlobalObj(window)||typeof self=="object"&&isGlobalObj(self)||typeof global=="object"&&isGlobalObj(global)||(function(){return this})()||{};function getGlobalObject(){return GLOBAL_OBJ}function getGlobalSingleton(tr,rr,ir){const lr=ir||GLOBAL_OBJ,dr=lr.__SENTRY__=lr.__SENTRY__||{};return dr[tr]||(dr[tr]=rr())}const WINDOW=getGlobalObject(),DEFAULT_MAX_STRING_LENGTH=80;function htmlTreeAsString(tr,rr={}){if(!tr)return"<unknown>";try{let ir=tr;const lr=5,dr=[];let fr=0,hr=0;const mr=" > ",gr=mr.length;let yr;const _r=Array.isArray(rr)?rr:rr.keyAttrs,br=!Array.isArray(rr)&&rr.maxStringLength||DEFAULT_MAX_STRING_LENGTH;for(;ir&&fr++<lr&&(yr=_htmlElementAsString(ir,_r),!(yr==="html"||fr>1&&hr+dr.length*gr+yr.length>=br));)dr.push(yr),hr+=yr.length,ir=ir.parentNode;return dr.reverse().join(mr)}catch{return"<unknown>"}}function _htmlElementAsString(tr,rr){const ir=tr,lr=[];let dr,fr,hr,mr,gr;if(!ir||!ir.tagName)return"";if(WINDOW.HTMLElement&&ir instanceof HTMLElement&&ir.dataset&&ir.dataset.sentryComponent)return ir.dataset.sentryComponent;lr.push(ir.tagName.toLowerCase());const yr=rr&&rr.length?rr.filter(br=>ir.getAttribute(br)).map(br=>[br,ir.getAttribute(br)]):null;if(yr&&yr.length)yr.forEach(br=>{lr.push(`[${br[0]}="${br[1]}"]`)});else if(ir.id&&lr.push(`#${ir.id}`),dr=ir.className,dr&&isString(dr))for(fr=dr.split(/\s+/),gr=0;gr<fr.length;gr++)lr.push(`.${fr[gr]}`);const _r=["aria-label","type","name","title","alt"];for(gr=0;gr<_r.length;gr++)hr=_r[gr],mr=ir.getAttribute(hr),mr&&lr.push(`[${hr}="${mr}"]`);return lr.join("")}function getLocationHref(){try{return WINDOW.document.location.href}catch{return""}}function getDomElement(tr){return WINDOW.document&&WINDOW.document.querySelector?WINDOW.document.querySelector(tr):null}function getComponentName(tr){if(!WINDOW.HTMLElement)return null;let rr=tr;const ir=5;for(let lr=0;lr<ir;lr++){if(!rr)return null;if(rr instanceof HTMLElement&&rr.dataset.sentryComponent)return rr.dataset.sentryComponent;rr=rr.parentNode}return null}const DEBUG_BUILD$1=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,PREFIX="Sentry Logger ",CONSOLE_LEVELS=["debug","info","warn","error","log","assert","trace"],originalConsoleMethods={};function consoleSandbox(tr){if(!("console"in GLOBAL_OBJ))return tr();const rr=GLOBAL_OBJ.console,ir={},lr=Object.keys(originalConsoleMethods);lr.forEach(dr=>{const fr=originalConsoleMethods[dr];ir[dr]=rr[dr],rr[dr]=fr});try{return tr()}finally{lr.forEach(dr=>{rr[dr]=ir[dr]})}}function makeLogger(){let tr=!1;const rr={enable:()=>{tr=!0},disable:()=>{tr=!1},isEnabled:()=>tr};return DEBUG_BUILD$1?CONSOLE_LEVELS.forEach(ir=>{rr[ir]=(...lr)=>{tr&&consoleSandbox(()=>{GLOBAL_OBJ.console[ir](`${PREFIX}[${ir}]:`,...lr)})}}):CONSOLE_LEVELS.forEach(ir=>{rr[ir]=()=>{}}),rr}const logger$1=makeLogger();function fill(tr,rr,ir){if(!(rr in tr))return;const lr=tr[rr],dr=ir(lr);typeof dr=="function"&&markFunctionWrapped(dr,lr),tr[rr]=dr}function addNonEnumerableProperty(tr,rr,ir){try{Object.defineProperty(tr,rr,{value:ir,writable:!0,configurable:!0})}catch{DEBUG_BUILD$1&&logger$1.log(`Failed to add non-enumerable property "${rr}" to object`,tr)}}function markFunctionWrapped(tr,rr){try{const ir=rr.prototype||{};tr.prototype=rr.prototype=ir,addNonEnumerableProperty(tr,"__sentry_original__",rr)}catch{}}function getOriginalFunction(tr){return tr.__sentry_original__}function urlEncode(tr){return Object.keys(tr).map(rr=>`${encodeURIComponent(rr)}=${encodeURIComponent(tr[rr])}`).join("&")}function convertToPlainObject(tr){if(isError(tr))return{message:tr.message,name:tr.name,stack:tr.stack,...getOwnProperties(tr)};if(isEvent(tr)){const rr={type:tr.type,target:serializeEventTarget(tr.target),currentTarget:serializeEventTarget(tr.currentTarget),...getOwnProperties(tr)};return typeof CustomEvent<"u"&&isInstanceOf(tr,CustomEvent)&&(rr.detail=tr.detail),rr}else return tr}function serializeEventTarget(tr){try{return isElement(tr)?htmlTreeAsString(tr):Object.prototype.toString.call(tr)}catch{return"<unknown>"}}function getOwnProperties(tr){if(typeof tr=="object"&&tr!==null){const rr={};for(const ir in tr)Object.prototype.hasOwnProperty.call(tr,ir)&&(rr[ir]=tr[ir]);return rr}else return{}}function extractExceptionKeysForMessage(tr,rr=40){const ir=Object.keys(convertToPlainObject(tr));if(ir.sort(),!ir.length)return"[object has no keys]";if(ir[0].length>=rr)return truncate(ir[0],rr);for(let lr=ir.length;lr>0;lr--){const dr=ir.slice(0,lr).join(", ");if(!(dr.length>rr))return lr===ir.length?dr:truncate(dr,rr)}return""}function dropUndefinedKeys(tr){return _dropUndefinedKeys(tr,new Map)}function _dropUndefinedKeys(tr,rr){if(isPojo(tr)){const ir=rr.get(tr);if(ir!==void 0)return ir;const lr={};rr.set(tr,lr);for(const dr of Object.keys(tr))typeof tr[dr]<"u"&&(lr[dr]=_dropUndefinedKeys(tr[dr],rr));return lr}if(Array.isArray(tr)){const ir=rr.get(tr);if(ir!==void 0)return ir;const lr=[];return rr.set(tr,lr),tr.forEach(dr=>{lr.push(_dropUndefinedKeys(dr,rr))}),lr}return tr}function isPojo(tr){if(!isPlainObject(tr))return!1;try{const rr=Object.getPrototypeOf(tr).constructor.name;return!rr||rr==="Object"}catch{return!0}}const STACKTRACE_FRAME_LIMIT=50,WEBPACK_ERROR_REGEXP=/\(error: (.*)\)/,STRIP_FRAME_REGEXP=/captureMessage|captureException/;function createStackParser(...tr){const rr=tr.sort((ir,lr)=>ir[0]-lr[0]).map(ir=>ir[1]);return(ir,lr=0)=>{const dr=[],fr=ir.split(`
850
+ */function _extends(){return _extends=Object.assign?Object.assign.bind():function(tr){for(var rr=1;rr<arguments.length;rr++){var ir=arguments[rr];for(var lr in ir)Object.prototype.hasOwnProperty.call(ir,lr)&&(tr[lr]=ir[lr])}return tr},_extends.apply(this,arguments)}const REACT_ROUTER_VERSION="6";try{window.__reactRouterVersion=REACT_ROUTER_VERSION}catch(tr){}function createBrowserRouter(tr,rr){return createRouter$1({basename:rr==null?void 0:rr.basename,future:_extends({},rr==null?void 0:rr.future,{v7_prependBasename:!0}),history:createBrowserHistory({window:rr==null?void 0:rr.window}),hydrationData:(rr==null?void 0:rr.hydrationData)||parseHydrationData(),routes:tr,mapRouteProperties,dataStrategy:rr==null?void 0:rr.dataStrategy,patchRoutesOnNavigation:rr==null?void 0:rr.patchRoutesOnNavigation,window:rr==null?void 0:rr.window}).initialize()}function parseHydrationData(){var tr;let rr=(tr=window)==null?void 0:tr.__staticRouterHydrationData;return rr&&rr.errors&&(rr=_extends({},rr,{errors:deserializeErrors(rr.errors)})),rr}function deserializeErrors(tr){if(!tr)return null;let rr=Object.entries(tr),ir={};for(let[lr,dr]of rr)if(dr&&dr.__type==="RouteErrorResponse")ir[lr]=new ErrorResponseImpl(dr.status,dr.statusText,dr.data,dr.internal===!0);else if(dr&&dr.__type==="Error"){if(dr.__subType){let fr=window[dr.__subType];if(typeof fr=="function")try{let hr=new fr(dr.message);hr.stack="",ir[lr]=hr}catch{}}if(ir[lr]==null){let fr=new Error(dr.message);fr.stack="",ir[lr]=fr}}else ir[lr]=dr;return ir}const ViewTransitionContext=React.createContext({isTransitioning:!1}),FetchersContext=React.createContext(new Map),START_TRANSITION="startTransition",startTransitionImpl=React[START_TRANSITION],FLUSH_SYNC="flushSync",flushSyncImpl=ReactDOM[FLUSH_SYNC];function startTransitionSafe(tr){startTransitionImpl?startTransitionImpl(tr):tr()}function flushSyncSafe(tr){flushSyncImpl?flushSyncImpl(tr):tr()}class Deferred{constructor(){this.status="pending",this.promise=new Promise((rr,ir)=>{this.resolve=lr=>{this.status==="pending"&&(this.status="resolved",rr(lr))},this.reject=lr=>{this.status==="pending"&&(this.status="rejected",ir(lr))}})}}function RouterProvider(tr){let{fallbackElement:rr,router:ir,future:lr}=tr,[dr,fr]=React.useState(ir.state),[hr,mr]=React.useState(),[gr,yr]=React.useState({isTransitioning:!1}),[_r,br]=React.useState(),[vr,wr]=React.useState(),[xr,Sr]=React.useState(),Ar=React.useRef(new Map),{v7_startTransition:Ir}=lr||{},Mr=React.useCallback(Jr=>{Ir?startTransitionSafe(Jr):Jr()},[Ir]),Or=React.useCallback((Jr,$n)=>{let{deletedFetchers:Qr,flushSync:Zn,viewTransitionOpts:qn}=$n;Jr.fetchers.forEach((Lr,Gr)=>{Lr.data!==void 0&&Ar.current.set(Gr,Lr.data)}),Qr.forEach(Lr=>Ar.current.delete(Lr));let Xn=ir.window==null||ir.window.document==null||typeof ir.window.document.startViewTransition!="function";if(!qn||Xn){Zn?flushSyncSafe(()=>fr(Jr)):Mr(()=>fr(Jr));return}if(Zn){flushSyncSafe(()=>{vr&&(_r&&_r.resolve(),vr.skipTransition()),yr({isTransitioning:!0,flushSync:!0,currentLocation:qn.currentLocation,nextLocation:qn.nextLocation})});let Lr=ir.window.document.startViewTransition(()=>{flushSyncSafe(()=>fr(Jr))});Lr.finished.finally(()=>{flushSyncSafe(()=>{br(void 0),wr(void 0),mr(void 0),yr({isTransitioning:!1})})}),flushSyncSafe(()=>wr(Lr));return}vr?(_r&&_r.resolve(),vr.skipTransition(),Sr({state:Jr,currentLocation:qn.currentLocation,nextLocation:qn.nextLocation})):(mr(Jr),yr({isTransitioning:!0,flushSync:!1,currentLocation:qn.currentLocation,nextLocation:qn.nextLocation}))},[ir.window,vr,_r,Ar,Mr]);React.useLayoutEffect(()=>ir.subscribe(Or),[ir,Or]),React.useEffect(()=>{gr.isTransitioning&&!gr.flushSync&&br(new Deferred)},[gr]),React.useEffect(()=>{if(_r&&hr&&ir.window){let Jr=hr,$n=_r.promise,Qr=ir.window.document.startViewTransition(async()=>{Mr(()=>fr(Jr)),await $n});Qr.finished.finally(()=>{br(void 0),wr(void 0),mr(void 0),yr({isTransitioning:!1})}),wr(Qr)}},[Mr,hr,_r,ir.window]),React.useEffect(()=>{_r&&hr&&dr.location.key===hr.location.key&&_r.resolve()},[_r,vr,dr.location,hr]),React.useEffect(()=>{!gr.isTransitioning&&xr&&(mr(xr.state),yr({isTransitioning:!0,flushSync:!1,currentLocation:xr.currentLocation,nextLocation:xr.nextLocation}),Sr(void 0))},[gr.isTransitioning,xr]),React.useEffect(()=>{},[]);let $r=React.useMemo(()=>({createHref:ir.createHref,encodeLocation:ir.encodeLocation,go:Jr=>ir.navigate(Jr),push:(Jr,$n,Qr)=>ir.navigate(Jr,{state:$n,preventScrollReset:Qr==null?void 0:Qr.preventScrollReset}),replace:(Jr,$n,Qr)=>ir.navigate(Jr,{replace:!0,state:$n,preventScrollReset:Qr==null?void 0:Qr.preventScrollReset})}),[ir]),Dr=ir.basename||"/",zr=React.useMemo(()=>({router:ir,navigator:$r,static:!1,basename:Dr}),[ir,$r,Dr]),Fr=React.useMemo(()=>({v7_relativeSplatPath:ir.future.v7_relativeSplatPath}),[ir.future.v7_relativeSplatPath]);return React.useEffect(()=>void 0,[lr,ir.future]),React.createElement(React.Fragment,null,React.createElement(DataRouterContext.Provider,{value:zr},React.createElement(DataRouterStateContext.Provider,{value:dr},React.createElement(FetchersContext.Provider,{value:Ar.current},React.createElement(ViewTransitionContext.Provider,{value:gr},React.createElement(Router$1,{basename:Dr,location:dr.location,navigationType:dr.historyAction,navigator:$r,future:Fr},dr.initialized||ir.future.v7_partialHydration?React.createElement(MemoizedDataRoutes,{routes:ir.routes,future:ir.future,state:dr}):rr))))),null)}const MemoizedDataRoutes=React.memo(DataRoutes);function DataRoutes(tr){let{routes:rr,future:ir,state:lr}=tr;return useRoutesImpl(rr,void 0,lr,ir)}var DataRouterHook;(function(tr){tr.UseScrollRestoration="useScrollRestoration",tr.UseSubmit="useSubmit",tr.UseSubmitFetcher="useSubmitFetcher",tr.UseFetcher="useFetcher",tr.useViewTransitionState="useViewTransitionState"})(DataRouterHook||(DataRouterHook={}));var DataRouterStateHook;(function(tr){tr.UseFetcher="useFetcher",tr.UseFetchers="useFetchers",tr.UseScrollRestoration="useScrollRestoration"})(DataRouterStateHook||(DataRouterStateHook={}));const Content=React__default.lazy(()=>__vitePreload(()=>import("./content.CxDClVTv.js"),__vite__mapDeps([0,1,2]),import.meta.url)),Root=React__default.lazy(()=>__vitePreload(()=>import("./root.4AaIaYqm.js"),__vite__mapDeps([3,1]),import.meta.url)),AtlasImport=React__default.lazy(()=>__vitePreload(()=>import("./atlas-import.CzW8-AP5.js"),[],import.meta.url).then(tr=>({default:tr.AtlasImport}))),routerBasename=connectConfig.routerBasename.endsWith("/")?connectConfig.routerBasename.slice(0,-1):connectConfig.routerBasename;function createRouter(tr){return createBrowserRouter(tr,{basename:routerBasename,future:{v7_fetcherPersist:!0,v7_relativeSplatPath:!0}})}function createRoutes(){return[{element:jsx$1(Suspense,{name:"RouteRoot",children:jsx$1(Root,{})}),children:[{index:!0,path:"d?/:driveId?/*?",element:jsx$1(Suspense,{name:"Drive",children:jsx$1(Content,{})})},{path:"import/:documentId",element:jsx$1(Suspense,{name:"AtlasImport",children:jsx$1(AtlasImport,{})})}]}]}const routes=createRoutes(),router=createRouter(routes),Router=()=>jsx$1(RouterProvider,{router});window.__VITE_ENVS.MODE==="development"?window.documentEditorDebugTools=new DocumentEditorDebugTools:serviceWorkerManager.registerServiceWorker(!1);const App=()=>jsx$1(SentryProvider,{children:jsx$1(WagmiContext,{children:jsxs(ProcessorManagerProvider,{children:[jsx$1(ToastContainer,{position:"bottom-right",containerId:"connect"}),jsx$1(Router,{}),jsx$1(Analytics,{})]})})});var voidElements,hasRequiredVoidElements;function requireVoidElements(){return hasRequiredVoidElements||(hasRequiredVoidElements=1,voidElements={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0}),voidElements}var voidElementsExports=requireVoidElements();const e=getDefaultExportFromCjs(voidElementsExports);var t$1=/\s([^'"/\s><]+?)[\s/>]|([^\s=]+)=\s?(".*?"|'.*?')/g;function n(tr){var rr={type:"tag",name:"",voidElement:!1,attrs:{},children:[]},ir=tr.match(/<\/?([^\s]+?)[/\s>]/);if(ir&&(rr.name=ir[1],(e[ir[1]]||tr.charAt(tr.length-2)==="/")&&(rr.voidElement=!0),rr.name.startsWith("!--"))){var lr=tr.indexOf("-->");return{type:"comment",comment:lr!==-1?tr.slice(4,lr):""}}for(var dr=new RegExp(t$1),fr=null;(fr=dr.exec(tr))!==null;)if(fr[0].trim())if(fr[1]){var hr=fr[1].trim(),mr=[hr,""];hr.indexOf("=")>-1&&(mr=hr.split("=")),rr.attrs[mr[0]]=mr[1],dr.lastIndex--}else fr[2]&&(rr.attrs[fr[2]]=fr[3].trim().substring(1,fr[3].length-1));return rr}var r=/<[a-zA-Z0-9\-\!\/](?:"[^"]*"|'[^']*'|[^'">])*>/g,i=/^\s*$/,s=Object.create(null);function a(tr,rr){switch(rr.type){case"text":return tr+rr.content;case"tag":return tr+="<"+rr.name+(rr.attrs?(function(ir){var lr=[];for(var dr in ir)lr.push(dr+'="'+ir[dr]+'"');return lr.length?" "+lr.join(" "):""})(rr.attrs):"")+(rr.voidElement?"/>":">"),rr.voidElement?tr:tr+rr.children.reduce(a,"")+"</"+rr.name+">";case"comment":return tr+"<!--"+rr.comment+"-->"}}var c={parse:function(tr,rr){rr||(rr={}),rr.components||(rr.components=s);var ir,lr=[],dr=[],fr=-1,hr=!1;if(tr.indexOf("<")!==0){var mr=tr.indexOf("<");lr.push({type:"text",content:mr===-1?tr:tr.substring(0,mr)})}return tr.replace(r,function(gr,yr){if(hr){if(gr!=="</"+ir.name+">")return;hr=!1}var _r,br=gr.charAt(1)!=="/",vr=gr.startsWith("<!--"),wr=yr+gr.length,xr=tr.charAt(wr);if(vr){var Sr=n(gr);return fr<0?(lr.push(Sr),lr):((_r=dr[fr]).children.push(Sr),lr)}if(br&&(fr++,(ir=n(gr)).type==="tag"&&rr.components[ir.name]&&(ir.type="component",hr=!0),ir.voidElement||hr||!xr||xr==="<"||ir.children.push({type:"text",content:tr.slice(wr,tr.indexOf("<",wr))}),fr===0&&lr.push(ir),(_r=dr[fr-1])&&_r.children.push(ir),dr[fr]=ir),(!br||ir.voidElement)&&(fr>-1&&(ir.voidElement||ir.name===gr.slice(2,-1))&&(fr--,ir=fr===-1?lr:dr[fr]),!hr&&xr!=="<"&&xr)){_r=fr===-1?lr:dr[fr].children;var Ar=tr.indexOf("<",wr),Ir=tr.slice(wr,Ar===-1?void 0:Ar);i.test(Ir)&&(Ir=" "),(Ar>-1&&fr+_r.length>=0||Ir!==" ")&&_r.push({type:"text",content:Ir})}}),lr},stringify:function(tr){return tr.reduce(function(rr,ir){return rr+a("",ir)},"")}};function warn(){if(console&&console.warn){for(var tr=arguments.length,rr=new Array(tr),ir=0;ir<tr;ir++)rr[ir]=arguments[ir];typeof rr[0]=="string"&&(rr[0]=`react-i18next:: ${rr[0]}`),console.warn(...rr)}}const alreadyWarned={};function warnOnce(){for(var tr=arguments.length,rr=new Array(tr),ir=0;ir<tr;ir++)rr[ir]=arguments[ir];typeof rr[0]=="string"&&alreadyWarned[rr[0]]||(typeof rr[0]=="string"&&(alreadyWarned[rr[0]]=new Date),warn(...rr))}const loadedClb=(tr,rr)=>()=>{if(tr.isInitialized)rr();else{const ir=()=>{setTimeout(()=>{tr.off("initialized",ir)},0),rr()};tr.on("initialized",ir)}};function loadNamespaces(tr,rr,ir){tr.loadNamespaces(rr,loadedClb(tr,ir))}function loadLanguages(tr,rr,ir,lr){typeof ir=="string"&&(ir=[ir]),ir.forEach(dr=>{tr.options.ns.indexOf(dr)<0&&tr.options.ns.push(dr)}),tr.loadLanguages(rr,loadedClb(tr,lr))}function oldI18nextHasLoadedNamespace(tr,rr){let ir=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const lr=rr.languages[0],dr=rr.options?rr.options.fallbackLng:!1,fr=rr.languages[rr.languages.length-1];if(lr.toLowerCase()==="cimode")return!0;const hr=(mr,gr)=>{const yr=rr.services.backendConnector.state[`${mr}|${gr}`];return yr===-1||yr===2};return ir.bindI18n&&ir.bindI18n.indexOf("languageChanging")>-1&&rr.services.backendConnector.backend&&rr.isLanguageChangingTo&&!hr(rr.isLanguageChangingTo,tr)?!1:!!(rr.hasResourceBundle(lr,tr)||!rr.services.backendConnector.backend||rr.options.resources&&!rr.options.partialBundledLanguages||hr(lr,tr)&&(!dr||hr(fr,tr)))}function hasLoadedNamespace(tr,rr){let ir=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return!rr.languages||!rr.languages.length?(warnOnce("i18n.languages were undefined or empty",rr.languages),!0):rr.options.ignoreJSONStructure!==void 0?rr.hasLoadedNamespace(tr,{lng:ir.lng,precheck:(dr,fr)=>{if(ir.bindI18n&&ir.bindI18n.indexOf("languageChanging")>-1&&dr.services.backendConnector.backend&&dr.isLanguageChangingTo&&!fr(dr.isLanguageChangingTo,tr))return!1}}):oldI18nextHasLoadedNamespace(tr,rr,ir)}const matchHtmlEntity=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,htmlEntities={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"©","&#169;":"©","&reg;":"®","&#174;":"®","&hellip;":"…","&#8230;":"…","&#x2F;":"/","&#47;":"/"},unescapeHtmlEntity=tr=>htmlEntities[tr],unescape$1=tr=>tr.replace(matchHtmlEntity,unescapeHtmlEntity);let defaultOptions={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:unescape$1};function setDefaults(){let tr=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};defaultOptions={...defaultOptions,...tr}}function getDefaults(){return defaultOptions}let i18nInstance;function setI18n(tr){i18nInstance=tr}function getI18n(){return i18nInstance}function hasChildren(tr,rr){if(!tr)return!1;const ir=tr.props?tr.props.children:tr.children;return rr?ir.length>0:!!ir}function getChildren(tr){if(!tr)return[];const rr=tr.props?tr.props.children:tr.children;return tr.props&&tr.props.i18nIsDynamicList?getAsArray(rr):rr}function hasValidReactChildren(tr){return Object.prototype.toString.call(tr)!=="[object Array]"?!1:tr.every(rr=>isValidElement(rr))}function getAsArray(tr){return Array.isArray(tr)?tr:[tr]}function mergeProps(tr,rr){const ir={...rr};return ir.props=Object.assign(tr.props,rr.props),ir}function nodesToString(tr,rr){if(!tr)return"";let ir="";const lr=getAsArray(tr),dr=rr.transSupportBasicHtmlNodes&&rr.transKeepBasicHtmlNodesFor?rr.transKeepBasicHtmlNodesFor:[];return lr.forEach((fr,hr)=>{if(typeof fr=="string")ir+=`${fr}`;else if(isValidElement(fr)){const mr=Object.keys(fr.props).length,gr=dr.indexOf(fr.type)>-1,yr=fr.props.children;if(!yr&&gr&&mr===0)ir+=`<${fr.type}/>`;else if(!yr&&(!gr||mr!==0))ir+=`<${hr}></${hr}>`;else if(fr.props.i18nIsDynamicList)ir+=`<${hr}></${hr}>`;else if(gr&&mr===1&&typeof yr=="string")ir+=`<${fr.type}>${yr}</${fr.type}>`;else{const _r=nodesToString(yr,rr);ir+=`<${hr}>${_r}</${hr}>`}}else if(fr===null)warn("Trans: the passed in value is invalid - seems you passed in a null child.");else if(typeof fr=="object"){const{format:mr,...gr}=fr,yr=Object.keys(gr);if(yr.length===1){const _r=mr?`${yr[0]}, ${mr}`:yr[0];ir+=`{{${_r}}}`}else warn("react-i18next: the passed in object contained more than one variable - the object should look like {{ value, format }} where format is optional.",fr)}else warn("Trans: the passed in value is invalid - seems you passed in a variable like {number} - please pass in variables for interpolation as full objects like {{number}}.",fr)}),ir}function renderNodes(tr,rr,ir,lr,dr,fr){if(rr==="")return[];const hr=lr.transKeepBasicHtmlNodesFor||[],mr=rr&&new RegExp(hr.map(Ar=>`<${Ar}`).join("|")).test(rr);if(!tr&&!mr&&!fr)return[rr];const gr={};function yr(Ar){getAsArray(Ar).forEach(Mr=>{typeof Mr!="string"&&(hasChildren(Mr)?yr(getChildren(Mr)):typeof Mr=="object"&&!isValidElement(Mr)&&Object.assign(gr,Mr))})}yr(tr);const _r=c.parse(`<0>${rr}</0>`),br={...gr,...dr};function vr(Ar,Ir,Mr){const Or=getChildren(Ar),$r=xr(Or,Ir.children,Mr);return hasValidReactChildren(Or)&&$r.length===0||Ar.props&&Ar.props.i18nIsDynamicList?Or:$r}function wr(Ar,Ir,Mr,Or,$r){Ar.dummy?(Ar.children=Ir,Mr.push(cloneElement(Ar,{key:Or},$r?void 0:Ir))):Mr.push(...Children.map([Ar],Dr=>{const zr={...Dr.props};return delete zr.i18nIsDynamicList,React__default.createElement(Dr.type,_extends$3({},zr,{key:Or,ref:Dr.ref},$r?{}:{children:Ir}))}))}function xr(Ar,Ir,Mr){const Or=getAsArray(Ar);return getAsArray(Ir).reduce((Dr,zr,Fr)=>{const Jr=zr.children&&zr.children[0]&&zr.children[0].content&&ir.services.interpolator.interpolate(zr.children[0].content,br,ir.language);if(zr.type==="tag"){let $n=Or[parseInt(zr.name,10)];Mr.length===1&&!$n&&($n=Mr[0][zr.name]),$n||($n={});const Qr=Object.keys(zr.attrs).length!==0?mergeProps({props:zr.attrs},$n):$n,Zn=isValidElement(Qr),qn=Zn&&hasChildren(zr,!0)&&!zr.voidElement,Xn=mr&&typeof Qr=="object"&&Qr.dummy&&!Zn,Lr=typeof tr=="object"&&tr!==null&&Object.hasOwnProperty.call(tr,zr.name);if(typeof Qr=="string"){const Gr=ir.services.interpolator.interpolate(Qr,br,ir.language);Dr.push(Gr)}else if(hasChildren(Qr)||qn){const Gr=vr(Qr,zr,Mr);wr(Qr,Gr,Dr,Fr)}else if(Xn){const Gr=xr(Or,zr.children,Mr);wr(Qr,Gr,Dr,Fr)}else if(Number.isNaN(parseFloat(zr.name)))if(Lr){const Gr=vr(Qr,zr,Mr);wr(Qr,Gr,Dr,Fr,zr.voidElement)}else if(lr.transSupportBasicHtmlNodes&&hr.indexOf(zr.name)>-1)if(zr.voidElement)Dr.push(createElement(zr.name,{key:`${zr.name}-${Fr}`}));else{const Gr=xr(Or,zr.children,Mr);Dr.push(createElement(zr.name,{key:`${zr.name}-${Fr}`},Gr))}else if(zr.voidElement)Dr.push(`<${zr.name} />`);else{const Gr=xr(Or,zr.children,Mr);Dr.push(`<${zr.name}>${Gr}</${zr.name}>`)}else if(typeof Qr=="object"&&!Zn){const Gr=zr.children[0]?Jr:null;Gr&&Dr.push(Gr)}else wr(Qr,Jr,Dr,Fr,zr.children.length!==1||!Jr)}else if(zr.type==="text"){const $n=lr.transWrapTextNodes,Qr=fr?lr.unescape(ir.services.interpolator.interpolate(zr.content,br,ir.language)):ir.services.interpolator.interpolate(zr.content,br,ir.language);$n?Dr.push(createElement($n,{key:`${zr.name}-${Fr}`},Qr)):Dr.push(Qr)}return Dr},[])}const Sr=xr([{dummy:!0,children:tr||[]}],_r,getAsArray(tr||[]));return getChildren(Sr[0])}function Trans$1(tr){let{children:rr,count:ir,parent:lr,i18nKey:dr,context:fr,tOptions:hr={},values:mr,defaults:gr,components:yr,ns:_r,i18n:br,t:vr,shouldUnescape:wr,...xr}=tr;const Sr=br||getI18n();if(!Sr)return warnOnce("You will need to pass in an i18next instance by using i18nextReactModule"),rr;const Ar=vr||Sr.t.bind(Sr)||(qn=>qn);fr&&(hr.context=fr);const Ir={...getDefaults(),...Sr.options&&Sr.options.react};let Mr=_r||Ar.ns||Sr.options&&Sr.options.defaultNS;Mr=typeof Mr=="string"?[Mr]:Mr||["translation"];const Or=nodesToString(rr,Ir),$r=gr||Or||Ir.transEmptyNodeValue||dr,{hashTransKey:Dr}=Ir,zr=dr||(Dr?Dr(Or||$r):Or||$r);Sr.options&&Sr.options.interpolation&&Sr.options.interpolation.defaultVariables&&(mr=mr&&Object.keys(mr).length>0?{...mr,...Sr.options.interpolation.defaultVariables}:{...Sr.options.interpolation.defaultVariables});const Fr=mr?hr.interpolation:{interpolation:{...hr.interpolation,prefix:"#$?",suffix:"?$#"}},Jr={...hr,count:ir,...mr,...Fr,defaultValue:$r,ns:Mr},$n=zr?Ar(zr,Jr):$r;yr&&Object.keys(yr).forEach(qn=>{const Xn=yr[qn];if(typeof Xn.type=="function"||!Xn.props||!Xn.props.children||$n.indexOf(`${qn}/>`)<0&&$n.indexOf(`${qn} />`)<0)return;function Lr(){return React__default.createElement(React__default.Fragment,null,Xn)}yr[qn]=React__default.createElement(Lr,null)});const Qr=renderNodes(yr||rr,$n,Sr,Ir,Jr,wr),Zn=lr!==void 0?lr:Ir.defaultTransParent;return Zn?createElement(Zn,xr,Qr):Qr}const initReactI18next={type:"3rdParty",init(tr){setDefaults(tr.options.react),setI18n(tr)}},I18nContext=createContext();class ReportNamespaces{constructor(){this.usedNamespaces={}}addUsedNamespaces(rr){rr.forEach(ir=>{this.usedNamespaces[ir]||(this.usedNamespaces[ir]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}function Trans(tr){let{children:rr,count:ir,parent:lr,i18nKey:dr,context:fr,tOptions:hr={},values:mr,defaults:gr,components:yr,ns:_r,i18n:br,t:vr,shouldUnescape:wr,...xr}=tr;const{i18n:Sr,defaultNS:Ar}=useContext(I18nContext)||{},Ir=br||Sr||getI18n(),Mr=vr||Ir&&Ir.t.bind(Ir);return Trans$1({children:rr,count:ir,parent:lr,i18nKey:dr,context:fr,tOptions:hr,values:mr,defaults:gr,components:yr,ns:_r||Mr&&Mr.ns||Ar||Ir&&Ir.options&&Ir.options.defaultNS,i18n:Ir,t:vr,shouldUnescape:wr,...xr})}const usePrevious=(tr,rr)=>{const ir=useRef();return useEffect(()=>{ir.current=tr},[tr,rr]),ir.current};function useTranslation(tr){let rr=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{i18n:ir}=rr,{i18n:lr,defaultNS:dr}=useContext(I18nContext)||{},fr=ir||lr||getI18n();if(fr&&!fr.reportNamespaces&&(fr.reportNamespaces=new ReportNamespaces),!fr){warnOnce("You will need to pass in an i18next instance by using initReactI18next");const Or=(Dr,zr)=>typeof zr=="string"?zr:zr&&typeof zr=="object"&&typeof zr.defaultValue=="string"?zr.defaultValue:Array.isArray(Dr)?Dr[Dr.length-1]:Dr,$r=[Or,{},!1];return $r.t=Or,$r.i18n={},$r.ready=!1,$r}fr.options.react&&fr.options.react.wait!==void 0&&warnOnce("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const hr={...getDefaults(),...fr.options.react,...rr},{useSuspense:mr,keyPrefix:gr}=hr;let yr=dr||fr.options&&fr.options.defaultNS;yr=typeof yr=="string"?[yr]:yr||["translation"],fr.reportNamespaces.addUsedNamespaces&&fr.reportNamespaces.addUsedNamespaces(yr);const _r=(fr.isInitialized||fr.initializedStoreOnce)&&yr.every(Or=>hasLoadedNamespace(Or,fr,hr));function br(){return fr.getFixedT(rr.lng||null,hr.nsMode==="fallback"?yr:yr[0],gr)}const[vr,wr]=useState(br);let xr=yr.join();rr.lng&&(xr=`${rr.lng}${xr}`);const Sr=usePrevious(xr),Ar=useRef(!0);useEffect(()=>{const{bindI18n:Or,bindI18nStore:$r}=hr;Ar.current=!0,!_r&&!mr&&(rr.lng?loadLanguages(fr,rr.lng,yr,()=>{Ar.current&&wr(br)}):loadNamespaces(fr,yr,()=>{Ar.current&&wr(br)})),_r&&Sr&&Sr!==xr&&Ar.current&&wr(br);function Dr(){Ar.current&&wr(br)}return Or&&fr&&fr.on(Or,Dr),$r&&fr&&fr.store.on($r,Dr),()=>{Ar.current=!1,Or&&fr&&Or.split(" ").forEach(zr=>fr.off(zr,Dr)),$r&&fr&&$r.split(" ").forEach(zr=>fr.store.off(zr,Dr))}},[fr,xr]);const Ir=useRef(!0);useEffect(()=>{Ar.current&&!Ir.current&&wr(br),Ir.current=!1},[fr,gr]);const Mr=[vr,fr,_r];if(Mr.t=vr,Mr.i18n=fr,Mr.ready=_r,_r||!_r&&!mr)return Mr;throw new Promise(Or=>{rr.lng?loadLanguages(fr,rr.lng,yr,()=>Or()):loadNamespaces(fr,yr,()=>Or())})}const namespace=connectConfig.routerBasename,COOKIE_BANNER_KEY_STORAGE=`${namespace}:display-cookie-banner`,listeners=new Set;let bannerShown=getInitial();function getInitial(){try{return localStorage.getItem(COOKIE_BANNER_KEY_STORAGE)!=="false"}catch(tr){return console.error(tr),!0}}function getCookieBannerState(){return bannerShown}function setCookieBannerState(tr){bannerShown=tr,localStorage.setItem(COOKIE_BANNER_KEY_STORAGE,JSON.stringify(tr))}function subscribe(tr){return listeners.add(tr),()=>listeners.delete(tr)}const useCookieBanner=()=>[useSyncExternalStore(subscribe,getCookieBannerState,getCookieBannerState),setCookieBannerState],isString$1=tr=>typeof tr=="string",defer=()=>{let tr,rr;const ir=new Promise((lr,dr)=>{tr=lr,rr=dr});return ir.resolve=tr,ir.reject=rr,ir},makeString=tr=>tr==null?"":""+tr,copy=(tr,rr,ir)=>{tr.forEach(lr=>{rr[lr]&&(ir[lr]=rr[lr])})},lastOfPathSeparatorRegExp=/###/g,cleanKey=tr=>tr&&tr.indexOf("###")>-1?tr.replace(lastOfPathSeparatorRegExp,"."):tr,canNotTraverseDeeper=tr=>!tr||isString$1(tr),getLastOfPath=(tr,rr,ir)=>{const lr=isString$1(rr)?rr.split("."):rr;let dr=0;for(;dr<lr.length-1;){if(canNotTraverseDeeper(tr))return{};const fr=cleanKey(lr[dr]);!tr[fr]&&ir&&(tr[fr]=new ir),Object.prototype.hasOwnProperty.call(tr,fr)?tr=tr[fr]:tr={},++dr}return canNotTraverseDeeper(tr)?{}:{obj:tr,k:cleanKey(lr[dr])}},setPath=(tr,rr,ir)=>{const{obj:lr,k:dr}=getLastOfPath(tr,rr,Object);if(lr!==void 0||rr.length===1){lr[dr]=ir;return}let fr=rr[rr.length-1],hr=rr.slice(0,rr.length-1),mr=getLastOfPath(tr,hr,Object);for(;mr.obj===void 0&&hr.length;)fr=`${hr[hr.length-1]}.${fr}`,hr=hr.slice(0,hr.length-1),mr=getLastOfPath(tr,hr,Object),mr&&mr.obj&&typeof mr.obj[`${mr.k}.${fr}`]<"u"&&(mr.obj=void 0);mr.obj[`${mr.k}.${fr}`]=ir},pushPath=(tr,rr,ir,lr)=>{const{obj:dr,k:fr}=getLastOfPath(tr,rr,Object);dr[fr]=dr[fr]||[],dr[fr].push(ir)},getPath=(tr,rr)=>{const{obj:ir,k:lr}=getLastOfPath(tr,rr);if(ir)return ir[lr]},getPathWithDefaults=(tr,rr,ir)=>{const lr=getPath(tr,ir);return lr!==void 0?lr:getPath(rr,ir)},deepExtend=(tr,rr,ir)=>{for(const lr in rr)lr!=="__proto__"&&lr!=="constructor"&&(lr in tr?isString$1(tr[lr])||tr[lr]instanceof String||isString$1(rr[lr])||rr[lr]instanceof String?ir&&(tr[lr]=rr[lr]):deepExtend(tr[lr],rr[lr],ir):tr[lr]=rr[lr]);return tr},regexEscape=tr=>tr.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var _entityMap={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};const escape=tr=>isString$1(tr)?tr.replace(/[&<>"'\/]/g,rr=>_entityMap[rr]):tr;class RegExpCache{constructor(rr){this.capacity=rr,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(rr){const ir=this.regExpMap.get(rr);if(ir!==void 0)return ir;const lr=new RegExp(rr);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(rr,lr),this.regExpQueue.push(rr),lr}}const chars=[" ",",","?","!",";"],looksLikeObjectPathRegExpCache=new RegExpCache(20),looksLikeObjectPath=(tr,rr,ir)=>{rr=rr||"",ir=ir||"";const lr=chars.filter(hr=>rr.indexOf(hr)<0&&ir.indexOf(hr)<0);if(lr.length===0)return!0;const dr=looksLikeObjectPathRegExpCache.getRegExp(`(${lr.map(hr=>hr==="?"?"\\?":hr).join("|")})`);let fr=!dr.test(tr);if(!fr){const hr=tr.indexOf(ir);hr>0&&!dr.test(tr.substring(0,hr))&&(fr=!0)}return fr},deepFind=function(tr,rr){let ir=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(!tr)return;if(tr[rr])return tr[rr];const lr=rr.split(ir);let dr=tr;for(let fr=0;fr<lr.length;){if(!dr||typeof dr!="object")return;let hr,mr="";for(let gr=fr;gr<lr.length;++gr)if(gr!==fr&&(mr+=ir),mr+=lr[gr],hr=dr[mr],hr!==void 0){if(["string","number","boolean"].indexOf(typeof hr)>-1&&gr<lr.length-1)continue;fr+=gr-fr+1;break}dr=hr}return dr},getCleanedCode=tr=>tr&&tr.replace("_","-"),consoleLogger={type:"logger",log(tr){this.output("log",tr)},warn(tr){this.output("warn",tr)},error(tr){this.output("error",tr)},output(tr,rr){console&&console[tr]&&console[tr].apply(console,rr)}};class Logger{constructor(rr){let ir=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.init(rr,ir)}init(rr){let ir=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=ir.prefix||"i18next:",this.logger=rr||consoleLogger,this.options=ir,this.debug=ir.debug}log(){for(var rr=arguments.length,ir=new Array(rr),lr=0;lr<rr;lr++)ir[lr]=arguments[lr];return this.forward(ir,"log","",!0)}warn(){for(var rr=arguments.length,ir=new Array(rr),lr=0;lr<rr;lr++)ir[lr]=arguments[lr];return this.forward(ir,"warn","",!0)}error(){for(var rr=arguments.length,ir=new Array(rr),lr=0;lr<rr;lr++)ir[lr]=arguments[lr];return this.forward(ir,"error","")}deprecate(){for(var rr=arguments.length,ir=new Array(rr),lr=0;lr<rr;lr++)ir[lr]=arguments[lr];return this.forward(ir,"warn","WARNING DEPRECATED: ",!0)}forward(rr,ir,lr,dr){return dr&&!this.debug?null:(isString$1(rr[0])&&(rr[0]=`${lr}${this.prefix} ${rr[0]}`),this.logger[ir](rr))}create(rr){return new Logger(this.logger,{prefix:`${this.prefix}:${rr}:`,...this.options})}clone(rr){return rr=rr||this.options,rr.prefix=rr.prefix||this.prefix,new Logger(this.logger,rr)}}var baseLogger=new Logger;class EventEmitter{constructor(){this.observers={}}on(rr,ir){return rr.split(" ").forEach(lr=>{this.observers[lr]||(this.observers[lr]=new Map);const dr=this.observers[lr].get(ir)||0;this.observers[lr].set(ir,dr+1)}),this}off(rr,ir){if(this.observers[rr]){if(!ir){delete this.observers[rr];return}this.observers[rr].delete(ir)}}emit(rr){for(var ir=arguments.length,lr=new Array(ir>1?ir-1:0),dr=1;dr<ir;dr++)lr[dr-1]=arguments[dr];this.observers[rr]&&Array.from(this.observers[rr].entries()).forEach(hr=>{let[mr,gr]=hr;for(let yr=0;yr<gr;yr++)mr(...lr)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(hr=>{let[mr,gr]=hr;for(let yr=0;yr<gr;yr++)mr.apply(mr,[rr,...lr])})}}class ResourceStore extends EventEmitter{constructor(rr){let ir=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=rr||{},this.options=ir,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(rr){this.options.ns.indexOf(rr)<0&&this.options.ns.push(rr)}removeNamespaces(rr){const ir=this.options.ns.indexOf(rr);ir>-1&&this.options.ns.splice(ir,1)}getResource(rr,ir,lr){let dr=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const fr=dr.keySeparator!==void 0?dr.keySeparator:this.options.keySeparator,hr=dr.ignoreJSONStructure!==void 0?dr.ignoreJSONStructure:this.options.ignoreJSONStructure;let mr;rr.indexOf(".")>-1?mr=rr.split("."):(mr=[rr,ir],lr&&(Array.isArray(lr)?mr.push(...lr):isString$1(lr)&&fr?mr.push(...lr.split(fr)):mr.push(lr)));const gr=getPath(this.data,mr);return!gr&&!ir&&!lr&&rr.indexOf(".")>-1&&(rr=mr[0],ir=mr[1],lr=mr.slice(2).join(".")),gr||!hr||!isString$1(lr)?gr:deepFind(this.data&&this.data[rr]&&this.data[rr][ir],lr,fr)}addResource(rr,ir,lr,dr){let fr=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1};const hr=fr.keySeparator!==void 0?fr.keySeparator:this.options.keySeparator;let mr=[rr,ir];lr&&(mr=mr.concat(hr?lr.split(hr):lr)),rr.indexOf(".")>-1&&(mr=rr.split("."),dr=ir,ir=mr[1]),this.addNamespaces(ir),setPath(this.data,mr,dr),fr.silent||this.emit("added",rr,ir,lr,dr)}addResources(rr,ir,lr){let dr=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(const fr in lr)(isString$1(lr[fr])||Array.isArray(lr[fr]))&&this.addResource(rr,ir,fr,lr[fr],{silent:!0});dr.silent||this.emit("added",rr,ir,lr)}addResourceBundle(rr,ir,lr,dr,fr){let hr=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1,skipCopy:!1},mr=[rr,ir];rr.indexOf(".")>-1&&(mr=rr.split("."),dr=lr,lr=ir,ir=mr[1]),this.addNamespaces(ir);let gr=getPath(this.data,mr)||{};hr.skipCopy||(lr=JSON.parse(JSON.stringify(lr))),dr?deepExtend(gr,lr,fr):gr={...gr,...lr},setPath(this.data,mr,gr),hr.silent||this.emit("added",rr,ir,lr)}removeResourceBundle(rr,ir){this.hasResourceBundle(rr,ir)&&delete this.data[rr][ir],this.removeNamespaces(ir),this.emit("removed",rr,ir)}hasResourceBundle(rr,ir){return this.getResource(rr,ir)!==void 0}getResourceBundle(rr,ir){return ir||(ir=this.options.defaultNS),this.options.compatibilityAPI==="v1"?{...this.getResource(rr,ir)}:this.getResource(rr,ir)}getDataByLanguage(rr){return this.data[rr]}hasLanguageSomeTranslations(rr){const ir=this.getDataByLanguage(rr);return!!(ir&&Object.keys(ir)||[]).find(dr=>ir[dr]&&Object.keys(ir[dr]).length>0)}toJSON(){return this.data}}var postProcessor={processors:{},addPostProcessor(tr){this.processors[tr.name]=tr},handle(tr,rr,ir,lr,dr){return tr.forEach(fr=>{this.processors[fr]&&(rr=this.processors[fr].process(rr,ir,lr,dr))}),rr}};const checkedLoadedFor={};class Translator extends EventEmitter{constructor(rr){let ir=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),copy(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],rr,this),this.options=ir,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=baseLogger.create("translator")}changeLanguage(rr){rr&&(this.language=rr)}exists(rr){let ir=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(rr==null)return!1;const lr=this.resolve(rr,ir);return lr&&lr.res!==void 0}extractFromKey(rr,ir){let lr=ir.nsSeparator!==void 0?ir.nsSeparator:this.options.nsSeparator;lr===void 0&&(lr=":");const dr=ir.keySeparator!==void 0?ir.keySeparator:this.options.keySeparator;let fr=ir.ns||this.options.defaultNS||[];const hr=lr&&rr.indexOf(lr)>-1,mr=!this.options.userDefinedKeySeparator&&!ir.keySeparator&&!this.options.userDefinedNsSeparator&&!ir.nsSeparator&&!looksLikeObjectPath(rr,lr,dr);if(hr&&!mr){const gr=rr.match(this.interpolator.nestingRegexp);if(gr&&gr.length>0)return{key:rr,namespaces:isString$1(fr)?[fr]:fr};const yr=rr.split(lr);(lr!==dr||lr===dr&&this.options.ns.indexOf(yr[0])>-1)&&(fr=yr.shift()),rr=yr.join(dr)}return{key:rr,namespaces:isString$1(fr)?[fr]:fr}}translate(rr,ir,lr){if(typeof ir!="object"&&this.options.overloadTranslationOptionHandler&&(ir=this.options.overloadTranslationOptionHandler(arguments)),typeof ir=="object"&&(ir={...ir}),ir||(ir={}),rr==null)return"";Array.isArray(rr)||(rr=[String(rr)]);const dr=ir.returnDetails!==void 0?ir.returnDetails:this.options.returnDetails,fr=ir.keySeparator!==void 0?ir.keySeparator:this.options.keySeparator,{key:hr,namespaces:mr}=this.extractFromKey(rr[rr.length-1],ir),gr=mr[mr.length-1],yr=ir.lng||this.language,_r=ir.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(yr&&yr.toLowerCase()==="cimode"){if(_r){const $r=ir.nsSeparator||this.options.nsSeparator;return dr?{res:`${gr}${$r}${hr}`,usedKey:hr,exactUsedKey:hr,usedLng:yr,usedNS:gr,usedParams:this.getUsedParamsDetails(ir)}:`${gr}${$r}${hr}`}return dr?{res:hr,usedKey:hr,exactUsedKey:hr,usedLng:yr,usedNS:gr,usedParams:this.getUsedParamsDetails(ir)}:hr}const br=this.resolve(rr,ir);let vr=br&&br.res;const wr=br&&br.usedKey||hr,xr=br&&br.exactUsedKey||hr,Sr=Object.prototype.toString.apply(vr),Ar=["[object Number]","[object Function]","[object RegExp]"],Ir=ir.joinArrays!==void 0?ir.joinArrays:this.options.joinArrays,Mr=!this.i18nFormat||this.i18nFormat.handleAsObject,Or=!isString$1(vr)&&typeof vr!="boolean"&&typeof vr!="number";if(Mr&&vr&&Or&&Ar.indexOf(Sr)<0&&!(isString$1(Ir)&&Array.isArray(vr))){if(!ir.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const $r=this.options.returnedObjectHandler?this.options.returnedObjectHandler(wr,vr,{...ir,ns:mr}):`key '${hr} (${this.language})' returned an object instead of string.`;return dr?(br.res=$r,br.usedParams=this.getUsedParamsDetails(ir),br):$r}if(fr){const $r=Array.isArray(vr),Dr=$r?[]:{},zr=$r?xr:wr;for(const Fr in vr)if(Object.prototype.hasOwnProperty.call(vr,Fr)){const Jr=`${zr}${fr}${Fr}`;Dr[Fr]=this.translate(Jr,{...ir,joinArrays:!1,ns:mr}),Dr[Fr]===Jr&&(Dr[Fr]=vr[Fr])}vr=Dr}}else if(Mr&&isString$1(Ir)&&Array.isArray(vr))vr=vr.join(Ir),vr&&(vr=this.extendTranslation(vr,rr,ir,lr));else{let $r=!1,Dr=!1;const zr=ir.count!==void 0&&!isString$1(ir.count),Fr=Translator.hasDefaultValue(ir),Jr=zr?this.pluralResolver.getSuffix(yr,ir.count,ir):"",$n=ir.ordinal&&zr?this.pluralResolver.getSuffix(yr,ir.count,{ordinal:!1}):"",Qr=zr&&!ir.ordinal&&ir.count===0&&this.pluralResolver.shouldUseIntlApi(),Zn=Qr&&ir[`defaultValue${this.options.pluralSeparator}zero`]||ir[`defaultValue${Jr}`]||ir[`defaultValue${$n}`]||ir.defaultValue;!this.isValidLookup(vr)&&Fr&&($r=!0,vr=Zn),this.isValidLookup(vr)||(Dr=!0,vr=hr);const Xn=(ir.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&Dr?void 0:vr,Lr=Fr&&Zn!==vr&&this.options.updateMissing;if(Dr||$r||Lr){if(this.logger.log(Lr?"updateKey":"missingKey",yr,gr,hr,Lr?Zn:vr),fr){const oi=this.resolve(hr,{...ir,keySeparator:!1});oi&&oi.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let Gr=[];const Hn=this.languageUtils.getFallbackCodes(this.options.fallbackLng,ir.lng||this.language);if(this.options.saveMissingTo==="fallback"&&Hn&&Hn[0])for(let oi=0;oi<Hn.length;oi++)Gr.push(Hn[oi]);else this.options.saveMissingTo==="all"?Gr=this.languageUtils.toResolveHierarchy(ir.lng||this.language):Gr.push(ir.lng||this.language);const ii=(oi,ri,ti)=>{const si=Fr&&ti!==vr?ti:Xn;this.options.missingKeyHandler?this.options.missingKeyHandler(oi,gr,ri,si,Lr,ir):this.backendConnector&&this.backendConnector.saveMissing&&this.backendConnector.saveMissing(oi,gr,ri,si,Lr,ir),this.emit("missingKey",oi,gr,ri,vr)};this.options.saveMissing&&(this.options.saveMissingPlurals&&zr?Gr.forEach(oi=>{const ri=this.pluralResolver.getSuffixes(oi,ir);Qr&&ir[`defaultValue${this.options.pluralSeparator}zero`]&&ri.indexOf(`${this.options.pluralSeparator}zero`)<0&&ri.push(`${this.options.pluralSeparator}zero`),ri.forEach(ti=>{ii([oi],hr+ti,ir[`defaultValue${ti}`]||Zn)})}):ii(Gr,hr,Zn))}vr=this.extendTranslation(vr,rr,ir,br,lr),Dr&&vr===hr&&this.options.appendNamespaceToMissingKey&&(vr=`${gr}:${hr}`),(Dr||$r)&&this.options.parseMissingKeyHandler&&(this.options.compatibilityAPI!=="v1"?vr=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${gr}:${hr}`:hr,$r?vr:void 0):vr=this.options.parseMissingKeyHandler(vr))}return dr?(br.res=vr,br.usedParams=this.getUsedParamsDetails(ir),br):vr}extendTranslation(rr,ir,lr,dr,fr){var hr=this;if(this.i18nFormat&&this.i18nFormat.parse)rr=this.i18nFormat.parse(rr,{...this.options.interpolation.defaultVariables,...lr},lr.lng||this.language||dr.usedLng,dr.usedNS,dr.usedKey,{resolved:dr});else if(!lr.skipInterpolation){lr.interpolation&&this.interpolator.init({...lr,interpolation:{...this.options.interpolation,...lr.interpolation}});const yr=isString$1(rr)&&(lr&&lr.interpolation&&lr.interpolation.skipOnVariables!==void 0?lr.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let _r;if(yr){const vr=rr.match(this.interpolator.nestingRegexp);_r=vr&&vr.length}let br=lr.replace&&!isString$1(lr.replace)?lr.replace:lr;if(this.options.interpolation.defaultVariables&&(br={...this.options.interpolation.defaultVariables,...br}),rr=this.interpolator.interpolate(rr,br,lr.lng||this.language||dr.usedLng,lr),yr){const vr=rr.match(this.interpolator.nestingRegexp),wr=vr&&vr.length;_r<wr&&(lr.nest=!1)}!lr.lng&&this.options.compatibilityAPI!=="v1"&&dr&&dr.res&&(lr.lng=this.language||dr.usedLng),lr.nest!==!1&&(rr=this.interpolator.nest(rr,function(){for(var vr=arguments.length,wr=new Array(vr),xr=0;xr<vr;xr++)wr[xr]=arguments[xr];return fr&&fr[0]===wr[0]&&!lr.context?(hr.logger.warn(`It seems you are nesting recursively key: ${wr[0]} in key: ${ir[0]}`),null):hr.translate(...wr,ir)},lr)),lr.interpolation&&this.interpolator.reset()}const mr=lr.postProcess||this.options.postProcess,gr=isString$1(mr)?[mr]:mr;return rr!=null&&gr&&gr.length&&lr.applyPostProcessor!==!1&&(rr=postProcessor.handle(gr,rr,ir,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...dr,usedParams:this.getUsedParamsDetails(lr)},...lr}:lr,this)),rr}resolve(rr){let ir=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},lr,dr,fr,hr,mr;return isString$1(rr)&&(rr=[rr]),rr.forEach(gr=>{if(this.isValidLookup(lr))return;const yr=this.extractFromKey(gr,ir),_r=yr.key;dr=_r;let br=yr.namespaces;this.options.fallbackNS&&(br=br.concat(this.options.fallbackNS));const vr=ir.count!==void 0&&!isString$1(ir.count),wr=vr&&!ir.ordinal&&ir.count===0&&this.pluralResolver.shouldUseIntlApi(),xr=ir.context!==void 0&&(isString$1(ir.context)||typeof ir.context=="number")&&ir.context!=="",Sr=ir.lngs?ir.lngs:this.languageUtils.toResolveHierarchy(ir.lng||this.language,ir.fallbackLng);br.forEach(Ar=>{this.isValidLookup(lr)||(mr=Ar,!checkedLoadedFor[`${Sr[0]}-${Ar}`]&&this.utils&&this.utils.hasLoadedNamespace&&!this.utils.hasLoadedNamespace(mr)&&(checkedLoadedFor[`${Sr[0]}-${Ar}`]=!0,this.logger.warn(`key "${dr}" for languages "${Sr.join(", ")}" won't get resolved as namespace "${mr}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),Sr.forEach(Ir=>{if(this.isValidLookup(lr))return;hr=Ir;const Mr=[_r];if(this.i18nFormat&&this.i18nFormat.addLookupKeys)this.i18nFormat.addLookupKeys(Mr,_r,Ir,Ar,ir);else{let $r;vr&&($r=this.pluralResolver.getSuffix(Ir,ir.count,ir));const Dr=`${this.options.pluralSeparator}zero`,zr=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(vr&&(Mr.push(_r+$r),ir.ordinal&&$r.indexOf(zr)===0&&Mr.push(_r+$r.replace(zr,this.options.pluralSeparator)),wr&&Mr.push(_r+Dr)),xr){const Fr=`${_r}${this.options.contextSeparator}${ir.context}`;Mr.push(Fr),vr&&(Mr.push(Fr+$r),ir.ordinal&&$r.indexOf(zr)===0&&Mr.push(Fr+$r.replace(zr,this.options.pluralSeparator)),wr&&Mr.push(Fr+Dr))}}let Or;for(;Or=Mr.pop();)this.isValidLookup(lr)||(fr=Or,lr=this.getResource(Ir,Ar,Or,ir))}))})}),{res:lr,usedKey:dr,exactUsedKey:fr,usedLng:hr,usedNS:mr}}isValidLookup(rr){return rr!==void 0&&!(!this.options.returnNull&&rr===null)&&!(!this.options.returnEmptyString&&rr==="")}getResource(rr,ir,lr){let dr=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(rr,ir,lr,dr):this.resourceStore.getResource(rr,ir,lr,dr)}getUsedParamsDetails(){let rr=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const ir=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],lr=rr.replace&&!isString$1(rr.replace);let dr=lr?rr.replace:rr;if(lr&&typeof rr.count<"u"&&(dr.count=rr.count),this.options.interpolation.defaultVariables&&(dr={...this.options.interpolation.defaultVariables,...dr}),!lr){dr={...dr};for(const fr of ir)delete dr[fr]}return dr}static hasDefaultValue(rr){const ir="defaultValue";for(const lr in rr)if(Object.prototype.hasOwnProperty.call(rr,lr)&&ir===lr.substring(0,ir.length)&&rr[lr]!==void 0)return!0;return!1}}const capitalize=tr=>tr.charAt(0).toUpperCase()+tr.slice(1);class LanguageUtil{constructor(rr){this.options=rr,this.supportedLngs=this.options.supportedLngs||!1,this.logger=baseLogger.create("languageUtils")}getScriptPartFromCode(rr){if(rr=getCleanedCode(rr),!rr||rr.indexOf("-")<0)return null;const ir=rr.split("-");return ir.length===2||(ir.pop(),ir[ir.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(ir.join("-"))}getLanguagePartFromCode(rr){if(rr=getCleanedCode(rr),!rr||rr.indexOf("-")<0)return rr;const ir=rr.split("-");return this.formatLanguageCode(ir[0])}formatLanguageCode(rr){if(isString$1(rr)&&rr.indexOf("-")>-1){if(typeof Intl<"u"&&typeof Intl.getCanonicalLocales<"u")try{let dr=Intl.getCanonicalLocales(rr)[0];if(dr&&this.options.lowerCaseLng&&(dr=dr.toLowerCase()),dr)return dr}catch{}const ir=["hans","hant","latn","cyrl","cans","mong","arab"];let lr=rr.split("-");return this.options.lowerCaseLng?lr=lr.map(dr=>dr.toLowerCase()):lr.length===2?(lr[0]=lr[0].toLowerCase(),lr[1]=lr[1].toUpperCase(),ir.indexOf(lr[1].toLowerCase())>-1&&(lr[1]=capitalize(lr[1].toLowerCase()))):lr.length===3&&(lr[0]=lr[0].toLowerCase(),lr[1].length===2&&(lr[1]=lr[1].toUpperCase()),lr[0]!=="sgn"&&lr[2].length===2&&(lr[2]=lr[2].toUpperCase()),ir.indexOf(lr[1].toLowerCase())>-1&&(lr[1]=capitalize(lr[1].toLowerCase())),ir.indexOf(lr[2].toLowerCase())>-1&&(lr[2]=capitalize(lr[2].toLowerCase()))),lr.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?rr.toLowerCase():rr}isSupportedCode(rr){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(rr=this.getLanguagePartFromCode(rr)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(rr)>-1}getBestMatchFromCodes(rr){if(!rr)return null;let ir;return rr.forEach(lr=>{if(ir)return;const dr=this.formatLanguageCode(lr);(!this.options.supportedLngs||this.isSupportedCode(dr))&&(ir=dr)}),!ir&&this.options.supportedLngs&&rr.forEach(lr=>{if(ir)return;const dr=this.getLanguagePartFromCode(lr);if(this.isSupportedCode(dr))return ir=dr;ir=this.options.supportedLngs.find(fr=>{if(fr===dr)return fr;if(!(fr.indexOf("-")<0&&dr.indexOf("-")<0)&&(fr.indexOf("-")>0&&dr.indexOf("-")<0&&fr.substring(0,fr.indexOf("-"))===dr||fr.indexOf(dr)===0&&dr.length>1))return fr})}),ir||(ir=this.getFallbackCodes(this.options.fallbackLng)[0]),ir}getFallbackCodes(rr,ir){if(!rr)return[];if(typeof rr=="function"&&(rr=rr(ir)),isString$1(rr)&&(rr=[rr]),Array.isArray(rr))return rr;if(!ir)return rr.default||[];let lr=rr[ir];return lr||(lr=rr[this.getScriptPartFromCode(ir)]),lr||(lr=rr[this.formatLanguageCode(ir)]),lr||(lr=rr[this.getLanguagePartFromCode(ir)]),lr||(lr=rr.default),lr||[]}toResolveHierarchy(rr,ir){const lr=this.getFallbackCodes(ir||this.options.fallbackLng||[],rr),dr=[],fr=hr=>{hr&&(this.isSupportedCode(hr)?dr.push(hr):this.logger.warn(`rejecting language code not found in supportedLngs: ${hr}`))};return isString$1(rr)&&(rr.indexOf("-")>-1||rr.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&fr(this.formatLanguageCode(rr)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&fr(this.getScriptPartFromCode(rr)),this.options.load!=="currentOnly"&&fr(this.getLanguagePartFromCode(rr))):isString$1(rr)&&fr(this.formatLanguageCode(rr)),lr.forEach(hr=>{dr.indexOf(hr)<0&&fr(this.formatLanguageCode(hr))}),dr}}let sets=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],_rulesPluralsTypes={1:tr=>+(tr>1),2:tr=>+(tr!=1),3:tr=>0,4:tr=>tr%10==1&&tr%100!=11?0:tr%10>=2&&tr%10<=4&&(tr%100<10||tr%100>=20)?1:2,5:tr=>tr==0?0:tr==1?1:tr==2?2:tr%100>=3&&tr%100<=10?3:tr%100>=11?4:5,6:tr=>tr==1?0:tr>=2&&tr<=4?1:2,7:tr=>tr==1?0:tr%10>=2&&tr%10<=4&&(tr%100<10||tr%100>=20)?1:2,8:tr=>tr==1?0:tr==2?1:tr!=8&&tr!=11?2:3,9:tr=>+(tr>=2),10:tr=>tr==1?0:tr==2?1:tr<7?2:tr<11?3:4,11:tr=>tr==1||tr==11?0:tr==2||tr==12?1:tr>2&&tr<20?2:3,12:tr=>+(tr%10!=1||tr%100==11),13:tr=>+(tr!==0),14:tr=>tr==1?0:tr==2?1:tr==3?2:3,15:tr=>tr%10==1&&tr%100!=11?0:tr%10>=2&&(tr%100<10||tr%100>=20)?1:2,16:tr=>tr%10==1&&tr%100!=11?0:tr!==0?1:2,17:tr=>tr==1||tr%10==1&&tr%100!=11?0:1,18:tr=>tr==0?0:tr==1?1:2,19:tr=>tr==1?0:tr==0||tr%100>1&&tr%100<11?1:tr%100>10&&tr%100<20?2:3,20:tr=>tr==1?0:tr==0||tr%100>0&&tr%100<20?1:2,21:tr=>tr%100==1?1:tr%100==2?2:tr%100==3||tr%100==4?3:0,22:tr=>tr==1?0:tr==2?1:(tr<0||tr>10)&&tr%10==0?2:3};const nonIntlVersions=["v1","v2","v3"],intlVersions=["v4"],suffixesOrder={zero:0,one:1,two:2,few:3,many:4,other:5},createRules=()=>{const tr={};return sets.forEach(rr=>{rr.lngs.forEach(ir=>{tr[ir]={numbers:rr.nr,plurals:_rulesPluralsTypes[rr.fc]}})}),tr};class PluralResolver{constructor(rr){let ir=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.languageUtils=rr,this.options=ir,this.logger=baseLogger.create("pluralResolver"),(!this.options.compatibilityJSON||intlVersions.includes(this.options.compatibilityJSON))&&(typeof Intl>"u"||!Intl.PluralRules)&&(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=createRules(),this.pluralRulesCache={}}addRule(rr,ir){this.rules[rr]=ir}clearCache(){this.pluralRulesCache={}}getRule(rr){let ir=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.shouldUseIntlApi()){const lr=getCleanedCode(rr==="dev"?"en":rr),dr=ir.ordinal?"ordinal":"cardinal",fr=JSON.stringify({cleanedCode:lr,type:dr});if(fr in this.pluralRulesCache)return this.pluralRulesCache[fr];let hr;try{hr=new Intl.PluralRules(lr,{type:dr})}catch{if(!rr.match(/-|_/))return;const gr=this.languageUtils.getLanguagePartFromCode(rr);hr=this.getRule(gr,ir)}return this.pluralRulesCache[fr]=hr,hr}return this.rules[rr]||this.rules[this.languageUtils.getLanguagePartFromCode(rr)]}needsPlural(rr){let ir=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const lr=this.getRule(rr,ir);return this.shouldUseIntlApi()?lr&&lr.resolvedOptions().pluralCategories.length>1:lr&&lr.numbers.length>1}getPluralFormsOfKey(rr,ir){let lr=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(rr,lr).map(dr=>`${ir}${dr}`)}getSuffixes(rr){let ir=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const lr=this.getRule(rr,ir);return lr?this.shouldUseIntlApi()?lr.resolvedOptions().pluralCategories.sort((dr,fr)=>suffixesOrder[dr]-suffixesOrder[fr]).map(dr=>`${this.options.prepend}${ir.ordinal?`ordinal${this.options.prepend}`:""}${dr}`):lr.numbers.map(dr=>this.getSuffix(rr,dr,ir)):[]}getSuffix(rr,ir){let lr=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const dr=this.getRule(rr,lr);return dr?this.shouldUseIntlApi()?`${this.options.prepend}${lr.ordinal?`ordinal${this.options.prepend}`:""}${dr.select(ir)}`:this.getSuffixRetroCompatible(dr,ir):(this.logger.warn(`no plural rule found for: ${rr}`),"")}getSuffixRetroCompatible(rr,ir){const lr=rr.noAbs?rr.plurals(ir):rr.plurals(Math.abs(ir));let dr=rr.numbers[lr];this.options.simplifyPluralSuffix&&rr.numbers.length===2&&rr.numbers[0]===1&&(dr===2?dr="plural":dr===1&&(dr=""));const fr=()=>this.options.prepend&&dr.toString()?this.options.prepend+dr.toString():dr.toString();return this.options.compatibilityJSON==="v1"?dr===1?"":typeof dr=="number"?`_plural_${dr.toString()}`:fr():this.options.compatibilityJSON==="v2"||this.options.simplifyPluralSuffix&&rr.numbers.length===2&&rr.numbers[0]===1?fr():this.options.prepend&&lr.toString()?this.options.prepend+lr.toString():lr.toString()}shouldUseIntlApi(){return!nonIntlVersions.includes(this.options.compatibilityJSON)}}const deepFindWithDefaults=function(tr,rr,ir){let lr=arguments.length>3&&arguments[3]!==void 0?arguments[3]:".",dr=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,fr=getPathWithDefaults(tr,rr,ir);return!fr&&dr&&isString$1(ir)&&(fr=deepFind(tr,ir,lr),fr===void 0&&(fr=deepFind(rr,ir,lr))),fr},regexSafe=tr=>tr.replace(/\$/g,"$$$$");class Interpolator{constructor(){let rr=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=baseLogger.create("interpolator"),this.options=rr,this.format=rr.interpolation&&rr.interpolation.format||(ir=>ir),this.init(rr)}init(){let rr=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};rr.interpolation||(rr.interpolation={escapeValue:!0});const{escape:ir,escapeValue:lr,useRawValueToEscape:dr,prefix:fr,prefixEscaped:hr,suffix:mr,suffixEscaped:gr,formatSeparator:yr,unescapeSuffix:_r,unescapePrefix:br,nestingPrefix:vr,nestingPrefixEscaped:wr,nestingSuffix:xr,nestingSuffixEscaped:Sr,nestingOptionsSeparator:Ar,maxReplaces:Ir,alwaysFormat:Mr}=rr.interpolation;this.escape=ir!==void 0?ir:escape,this.escapeValue=lr!==void 0?lr:!0,this.useRawValueToEscape=dr!==void 0?dr:!1,this.prefix=fr?regexEscape(fr):hr||"{{",this.suffix=mr?regexEscape(mr):gr||"}}",this.formatSeparator=yr||",",this.unescapePrefix=_r?"":br||"-",this.unescapeSuffix=this.unescapePrefix?"":_r||"",this.nestingPrefix=vr?regexEscape(vr):wr||regexEscape("$t("),this.nestingSuffix=xr?regexEscape(xr):Sr||regexEscape(")"),this.nestingOptionsSeparator=Ar||",",this.maxReplaces=Ir||1e3,this.alwaysFormat=Mr!==void 0?Mr:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const rr=(ir,lr)=>ir&&ir.source===lr?(ir.lastIndex=0,ir):new RegExp(lr,"g");this.regexp=rr(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=rr(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=rr(this.nestingRegexp,`${this.nestingPrefix}(.+?)${this.nestingSuffix}`)}interpolate(rr,ir,lr,dr){let fr,hr,mr;const gr=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},yr=wr=>{if(wr.indexOf(this.formatSeparator)<0){const Ir=deepFindWithDefaults(ir,gr,wr,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(Ir,void 0,lr,{...dr,...ir,interpolationkey:wr}):Ir}const xr=wr.split(this.formatSeparator),Sr=xr.shift().trim(),Ar=xr.join(this.formatSeparator).trim();return this.format(deepFindWithDefaults(ir,gr,Sr,this.options.keySeparator,this.options.ignoreJSONStructure),Ar,lr,{...dr,...ir,interpolationkey:Sr})};this.resetRegExp();const _r=dr&&dr.missingInterpolationHandler||this.options.missingInterpolationHandler,br=dr&&dr.interpolation&&dr.interpolation.skipOnVariables!==void 0?dr.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:wr=>regexSafe(wr)},{regex:this.regexp,safeValue:wr=>this.escapeValue?regexSafe(this.escape(wr)):regexSafe(wr)}].forEach(wr=>{for(mr=0;fr=wr.regex.exec(rr);){const xr=fr[1].trim();if(hr=yr(xr),hr===void 0)if(typeof _r=="function"){const Ar=_r(rr,fr,dr);hr=isString$1(Ar)?Ar:""}else if(dr&&Object.prototype.hasOwnProperty.call(dr,xr))hr="";else if(br){hr=fr[0];continue}else this.logger.warn(`missed to pass in variable ${xr} for interpolating ${rr}`),hr="";else!isString$1(hr)&&!this.useRawValueToEscape&&(hr=makeString(hr));const Sr=wr.safeValue(hr);if(rr=rr.replace(fr[0],Sr),br?(wr.regex.lastIndex+=hr.length,wr.regex.lastIndex-=fr[0].length):wr.regex.lastIndex=0,mr++,mr>=this.maxReplaces)break}}),rr}nest(rr,ir){let lr=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},dr,fr,hr;const mr=(gr,yr)=>{const _r=this.nestingOptionsSeparator;if(gr.indexOf(_r)<0)return gr;const br=gr.split(new RegExp(`${_r}[ ]*{`));let vr=`{${br[1]}`;gr=br[0],vr=this.interpolate(vr,hr);const wr=vr.match(/'/g),xr=vr.match(/"/g);(wr&&wr.length%2===0&&!xr||xr.length%2!==0)&&(vr=vr.replace(/'/g,'"'));try{hr=JSON.parse(vr),yr&&(hr={...yr,...hr})}catch(Sr){return this.logger.warn(`failed parsing options string in nesting for key ${gr}`,Sr),`${gr}${_r}${vr}`}return hr.defaultValue&&hr.defaultValue.indexOf(this.prefix)>-1&&delete hr.defaultValue,gr};for(;dr=this.nestingRegexp.exec(rr);){let gr=[];hr={...lr},hr=hr.replace&&!isString$1(hr.replace)?hr.replace:hr,hr.applyPostProcessor=!1,delete hr.defaultValue;let yr=!1;if(dr[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(dr[1])){const _r=dr[1].split(this.formatSeparator).map(br=>br.trim());dr[1]=_r.shift(),gr=_r,yr=!0}if(fr=ir(mr.call(this,dr[1].trim(),hr),hr),fr&&dr[0]===rr&&!isString$1(fr))return fr;isString$1(fr)||(fr=makeString(fr)),fr||(this.logger.warn(`missed to resolve ${dr[1]} for nesting ${rr}`),fr=""),yr&&(fr=gr.reduce((_r,br)=>this.format(_r,br,lr.lng,{...lr,interpolationkey:dr[1].trim()}),fr.trim())),rr=rr.replace(dr[0],fr),this.regexp.lastIndex=0}return rr}}const parseFormatStr=tr=>{let rr=tr.toLowerCase().trim();const ir={};if(tr.indexOf("(")>-1){const lr=tr.split("(");rr=lr[0].toLowerCase().trim();const dr=lr[1].substring(0,lr[1].length-1);rr==="currency"&&dr.indexOf(":")<0?ir.currency||(ir.currency=dr.trim()):rr==="relativetime"&&dr.indexOf(":")<0?ir.range||(ir.range=dr.trim()):dr.split(";").forEach(hr=>{if(hr){const[mr,...gr]=hr.split(":"),yr=gr.join(":").trim().replace(/^'+|'+$/g,""),_r=mr.trim();ir[_r]||(ir[_r]=yr),yr==="false"&&(ir[_r]=!1),yr==="true"&&(ir[_r]=!0),isNaN(yr)||(ir[_r]=parseInt(yr,10))}})}return{formatName:rr,formatOptions:ir}},createCachedFormatter=tr=>{const rr={};return(ir,lr,dr)=>{let fr=dr;dr&&dr.interpolationkey&&dr.formatParams&&dr.formatParams[dr.interpolationkey]&&dr[dr.interpolationkey]&&(fr={...fr,[dr.interpolationkey]:void 0});const hr=lr+JSON.stringify(fr);let mr=rr[hr];return mr||(mr=tr(getCleanedCode(lr),dr),rr[hr]=mr),mr(ir)}};class Formatter{constructor(){let rr=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=baseLogger.create("formatter"),this.options=rr,this.formats={number:createCachedFormatter((ir,lr)=>{const dr=new Intl.NumberFormat(ir,{...lr});return fr=>dr.format(fr)}),currency:createCachedFormatter((ir,lr)=>{const dr=new Intl.NumberFormat(ir,{...lr,style:"currency"});return fr=>dr.format(fr)}),datetime:createCachedFormatter((ir,lr)=>{const dr=new Intl.DateTimeFormat(ir,{...lr});return fr=>dr.format(fr)}),relativetime:createCachedFormatter((ir,lr)=>{const dr=new Intl.RelativeTimeFormat(ir,{...lr});return fr=>dr.format(fr,lr.range||"day")}),list:createCachedFormatter((ir,lr)=>{const dr=new Intl.ListFormat(ir,{...lr});return fr=>dr.format(fr)})},this.init(rr)}init(rr){let ir=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};this.formatSeparator=ir.interpolation.formatSeparator||","}add(rr,ir){this.formats[rr.toLowerCase().trim()]=ir}addCached(rr,ir){this.formats[rr.toLowerCase().trim()]=createCachedFormatter(ir)}format(rr,ir,lr){let dr=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const fr=ir.split(this.formatSeparator);if(fr.length>1&&fr[0].indexOf("(")>1&&fr[0].indexOf(")")<0&&fr.find(mr=>mr.indexOf(")")>-1)){const mr=fr.findIndex(gr=>gr.indexOf(")")>-1);fr[0]=[fr[0],...fr.splice(1,mr)].join(this.formatSeparator)}return fr.reduce((mr,gr)=>{const{formatName:yr,formatOptions:_r}=parseFormatStr(gr);if(this.formats[yr]){let br=mr;try{const vr=dr&&dr.formatParams&&dr.formatParams[dr.interpolationkey]||{},wr=vr.locale||vr.lng||dr.locale||dr.lng||lr;br=this.formats[yr](mr,wr,{..._r,...dr,...vr})}catch(vr){this.logger.warn(vr)}return br}else this.logger.warn(`there was no format function for ${yr}`);return mr},rr)}}const removePending=(tr,rr)=>{tr.pending[rr]!==void 0&&(delete tr.pending[rr],tr.pendingCount--)};class Connector extends EventEmitter{constructor(rr,ir,lr){let dr=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};super(),this.backend=rr,this.store=ir,this.services=lr,this.languageUtils=lr.languageUtils,this.options=dr,this.logger=baseLogger.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=dr.maxParallelReads||10,this.readingCalls=0,this.maxRetries=dr.maxRetries>=0?dr.maxRetries:5,this.retryTimeout=dr.retryTimeout>=1?dr.retryTimeout:350,this.state={},this.queue=[],this.backend&&this.backend.init&&this.backend.init(lr,dr.backend,dr)}queueLoad(rr,ir,lr,dr){const fr={},hr={},mr={},gr={};return rr.forEach(yr=>{let _r=!0;ir.forEach(br=>{const vr=`${yr}|${br}`;!lr.reload&&this.store.hasResourceBundle(yr,br)?this.state[vr]=2:this.state[vr]<0||(this.state[vr]===1?hr[vr]===void 0&&(hr[vr]=!0):(this.state[vr]=1,_r=!1,hr[vr]===void 0&&(hr[vr]=!0),fr[vr]===void 0&&(fr[vr]=!0),gr[br]===void 0&&(gr[br]=!0)))}),_r||(mr[yr]=!0)}),(Object.keys(fr).length||Object.keys(hr).length)&&this.queue.push({pending:hr,pendingCount:Object.keys(hr).length,loaded:{},errors:[],callback:dr}),{toLoad:Object.keys(fr),pending:Object.keys(hr),toLoadLanguages:Object.keys(mr),toLoadNamespaces:Object.keys(gr)}}loaded(rr,ir,lr){const dr=rr.split("|"),fr=dr[0],hr=dr[1];ir&&this.emit("failedLoading",fr,hr,ir),!ir&&lr&&this.store.addResourceBundle(fr,hr,lr,void 0,void 0,{skipCopy:!0}),this.state[rr]=ir?-1:2,ir&&lr&&(this.state[rr]=0);const mr={};this.queue.forEach(gr=>{pushPath(gr.loaded,[fr],hr),removePending(gr,rr),ir&&gr.errors.push(ir),gr.pendingCount===0&&!gr.done&&(Object.keys(gr.loaded).forEach(yr=>{mr[yr]||(mr[yr]={});const _r=gr.loaded[yr];_r.length&&_r.forEach(br=>{mr[yr][br]===void 0&&(mr[yr][br]=!0)})}),gr.done=!0,gr.errors.length?gr.callback(gr.errors):gr.callback())}),this.emit("loaded",mr),this.queue=this.queue.filter(gr=>!gr.done)}read(rr,ir,lr){let dr=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,fr=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,hr=arguments.length>5?arguments[5]:void 0;if(!rr.length)return hr(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:rr,ns:ir,fcName:lr,tried:dr,wait:fr,callback:hr});return}this.readingCalls++;const mr=(yr,_r)=>{if(this.readingCalls--,this.waitingReads.length>0){const br=this.waitingReads.shift();this.read(br.lng,br.ns,br.fcName,br.tried,br.wait,br.callback)}if(yr&&_r&&dr<this.maxRetries){setTimeout(()=>{this.read.call(this,rr,ir,lr,dr+1,fr*2,hr)},fr);return}hr(yr,_r)},gr=this.backend[lr].bind(this.backend);if(gr.length===2){try{const yr=gr(rr,ir);yr&&typeof yr.then=="function"?yr.then(_r=>mr(null,_r)).catch(mr):mr(null,yr)}catch(yr){mr(yr)}return}return gr(rr,ir,mr)}prepareLoading(rr,ir){let lr=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},dr=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),dr&&dr();isString$1(rr)&&(rr=this.languageUtils.toResolveHierarchy(rr)),isString$1(ir)&&(ir=[ir]);const fr=this.queueLoad(rr,ir,lr,dr);if(!fr.toLoad.length)return fr.pending.length||dr(),null;fr.toLoad.forEach(hr=>{this.loadOne(hr)})}load(rr,ir,lr){this.prepareLoading(rr,ir,{},lr)}reload(rr,ir,lr){this.prepareLoading(rr,ir,{reload:!0},lr)}loadOne(rr){let ir=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";const lr=rr.split("|"),dr=lr[0],fr=lr[1];this.read(dr,fr,"read",void 0,void 0,(hr,mr)=>{hr&&this.logger.warn(`${ir}loading namespace ${fr} for language ${dr} failed`,hr),!hr&&mr&&this.logger.log(`${ir}loaded namespace ${fr} for language ${dr}`,mr),this.loaded(rr,hr,mr)})}saveMissing(rr,ir,lr,dr,fr){let hr=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{},mr=arguments.length>6&&arguments[6]!==void 0?arguments[6]:()=>{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(ir)){this.logger.warn(`did not save key "${lr}" as the namespace "${ir}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(lr==null||lr==="")){if(this.backend&&this.backend.create){const gr={...hr,isUpdate:fr},yr=this.backend.create.bind(this.backend);if(yr.length<6)try{let _r;yr.length===5?_r=yr(rr,ir,lr,dr,gr):_r=yr(rr,ir,lr,dr),_r&&typeof _r.then=="function"?_r.then(br=>mr(null,br)).catch(mr):mr(null,_r)}catch(_r){mr(_r)}else yr(rr,ir,lr,dr,mr,gr)}!rr||!rr[0]||this.store.addResource(rr[0],ir,lr,dr)}}}const get=()=>({debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:tr=>{let rr={};if(typeof tr[1]=="object"&&(rr=tr[1]),isString$1(tr[1])&&(rr.defaultValue=tr[1]),isString$1(tr[2])&&(rr.tDescription=tr[2]),typeof tr[2]=="object"||typeof tr[3]=="object"){const ir=tr[3]||tr[2];Object.keys(ir).forEach(lr=>{rr[lr]=ir[lr]})}return rr},interpolation:{escapeValue:!0,format:tr=>tr,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}),transformOptions=tr=>(isString$1(tr.ns)&&(tr.ns=[tr.ns]),isString$1(tr.fallbackLng)&&(tr.fallbackLng=[tr.fallbackLng]),isString$1(tr.fallbackNS)&&(tr.fallbackNS=[tr.fallbackNS]),tr.supportedLngs&&tr.supportedLngs.indexOf("cimode")<0&&(tr.supportedLngs=tr.supportedLngs.concat(["cimode"])),tr),noop=()=>{},bindMemberFunctions=tr=>{Object.getOwnPropertyNames(Object.getPrototypeOf(tr)).forEach(ir=>{typeof tr[ir]=="function"&&(tr[ir]=tr[ir].bind(tr))})};class I18n extends EventEmitter{constructor(){let rr=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},ir=arguments.length>1?arguments[1]:void 0;if(super(),this.options=transformOptions(rr),this.services={},this.logger=baseLogger,this.modules={external:[]},bindMemberFunctions(this),ir&&!this.isInitialized&&!rr.isClone){if(!this.options.initImmediate)return this.init(rr,ir),this;setTimeout(()=>{this.init(rr,ir)},0)}}init(){var rr=this;let ir=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},lr=arguments.length>1?arguments[1]:void 0;this.isInitializing=!0,typeof ir=="function"&&(lr=ir,ir={}),!ir.defaultNS&&ir.defaultNS!==!1&&ir.ns&&(isString$1(ir.ns)?ir.defaultNS=ir.ns:ir.ns.indexOf("translation")<0&&(ir.defaultNS=ir.ns[0]));const dr=get();this.options={...dr,...this.options,...transformOptions(ir)},this.options.compatibilityAPI!=="v1"&&(this.options.interpolation={...dr.interpolation,...this.options.interpolation}),ir.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=ir.keySeparator),ir.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=ir.nsSeparator);const fr=_r=>_r?typeof _r=="function"?new _r:_r:null;if(!this.options.isClone){this.modules.logger?baseLogger.init(fr(this.modules.logger),this.options):baseLogger.init(null,this.options);let _r;this.modules.formatter?_r=this.modules.formatter:typeof Intl<"u"&&(_r=Formatter);const br=new LanguageUtil(this.options);this.store=new ResourceStore(this.options.resources,this.options);const vr=this.services;vr.logger=baseLogger,vr.resourceStore=this.store,vr.languageUtils=br,vr.pluralResolver=new PluralResolver(br,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),_r&&(!this.options.interpolation.format||this.options.interpolation.format===dr.interpolation.format)&&(vr.formatter=fr(_r),vr.formatter.init(vr,this.options),this.options.interpolation.format=vr.formatter.format.bind(vr.formatter)),vr.interpolator=new Interpolator(this.options),vr.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},vr.backendConnector=new Connector(fr(this.modules.backend),vr.resourceStore,vr,this.options),vr.backendConnector.on("*",function(wr){for(var xr=arguments.length,Sr=new Array(xr>1?xr-1:0),Ar=1;Ar<xr;Ar++)Sr[Ar-1]=arguments[Ar];rr.emit(wr,...Sr)}),this.modules.languageDetector&&(vr.languageDetector=fr(this.modules.languageDetector),vr.languageDetector.init&&vr.languageDetector.init(vr,this.options.detection,this.options)),this.modules.i18nFormat&&(vr.i18nFormat=fr(this.modules.i18nFormat),vr.i18nFormat.init&&vr.i18nFormat.init(this)),this.translator=new Translator(this.services,this.options),this.translator.on("*",function(wr){for(var xr=arguments.length,Sr=new Array(xr>1?xr-1:0),Ar=1;Ar<xr;Ar++)Sr[Ar-1]=arguments[Ar];rr.emit(wr,...Sr)}),this.modules.external.forEach(wr=>{wr.init&&wr.init(this)})}if(this.format=this.options.interpolation.format,lr||(lr=noop),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const _r=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);_r.length>0&&_r[0]!=="dev"&&(this.options.lng=_r[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(_r=>{this[_r]=function(){return rr.store[_r](...arguments)}}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(_r=>{this[_r]=function(){return rr.store[_r](...arguments),rr}});const gr=defer(),yr=()=>{const _r=(br,vr)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),gr.resolve(vr),lr(br,vr)};if(this.languages&&this.options.compatibilityAPI!=="v1"&&!this.isInitialized)return _r(null,this.t.bind(this));this.changeLanguage(this.options.lng,_r)};return this.options.resources||!this.options.initImmediate?yr():setTimeout(yr,0),gr}loadResources(rr){let lr=arguments.length>1&&arguments[1]!==void 0?arguments[1]:noop;const dr=isString$1(rr)?rr:this.language;if(typeof rr=="function"&&(lr=rr),!this.options.resources||this.options.partialBundledLanguages){if(dr&&dr.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return lr();const fr=[],hr=mr=>{if(!mr||mr==="cimode")return;this.services.languageUtils.toResolveHierarchy(mr).forEach(yr=>{yr!=="cimode"&&fr.indexOf(yr)<0&&fr.push(yr)})};dr?hr(dr):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(gr=>hr(gr)),this.options.preload&&this.options.preload.forEach(mr=>hr(mr)),this.services.backendConnector.load(fr,this.options.ns,mr=>{!mr&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),lr(mr)})}else lr(null)}reloadResources(rr,ir,lr){const dr=defer();return typeof rr=="function"&&(lr=rr,rr=void 0),typeof ir=="function"&&(lr=ir,ir=void 0),rr||(rr=this.languages),ir||(ir=this.options.ns),lr||(lr=noop),this.services.backendConnector.reload(rr,ir,fr=>{dr.resolve(),lr(fr)}),dr}use(rr){if(!rr)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!rr.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return rr.type==="backend"&&(this.modules.backend=rr),(rr.type==="logger"||rr.log&&rr.warn&&rr.error)&&(this.modules.logger=rr),rr.type==="languageDetector"&&(this.modules.languageDetector=rr),rr.type==="i18nFormat"&&(this.modules.i18nFormat=rr),rr.type==="postProcessor"&&postProcessor.addPostProcessor(rr),rr.type==="formatter"&&(this.modules.formatter=rr),rr.type==="3rdParty"&&this.modules.external.push(rr),this}setResolvedLanguage(rr){if(!(!rr||!this.languages)&&!(["cimode","dev"].indexOf(rr)>-1))for(let ir=0;ir<this.languages.length;ir++){const lr=this.languages[ir];if(!(["cimode","dev"].indexOf(lr)>-1)&&this.store.hasLanguageSomeTranslations(lr)){this.resolvedLanguage=lr;break}}}changeLanguage(rr,ir){var lr=this;this.isLanguageChangingTo=rr;const dr=defer();this.emit("languageChanging",rr);const fr=gr=>{this.language=gr,this.languages=this.services.languageUtils.toResolveHierarchy(gr),this.resolvedLanguage=void 0,this.setResolvedLanguage(gr)},hr=(gr,yr)=>{yr?(fr(yr),this.translator.changeLanguage(yr),this.isLanguageChangingTo=void 0,this.emit("languageChanged",yr),this.logger.log("languageChanged",yr)):this.isLanguageChangingTo=void 0,dr.resolve(function(){return lr.t(...arguments)}),ir&&ir(gr,function(){return lr.t(...arguments)})},mr=gr=>{!rr&&!gr&&this.services.languageDetector&&(gr=[]);const yr=isString$1(gr)?gr:this.services.languageUtils.getBestMatchFromCodes(gr);yr&&(this.language||fr(yr),this.translator.language||this.translator.changeLanguage(yr),this.services.languageDetector&&this.services.languageDetector.cacheUserLanguage&&this.services.languageDetector.cacheUserLanguage(yr)),this.loadResources(yr,_r=>{hr(_r,yr)})};return!rr&&this.services.languageDetector&&!this.services.languageDetector.async?mr(this.services.languageDetector.detect()):!rr&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(mr):this.services.languageDetector.detect(mr):mr(rr),dr}getFixedT(rr,ir,lr){var dr=this;const fr=function(hr,mr){let gr;if(typeof mr!="object"){for(var yr=arguments.length,_r=new Array(yr>2?yr-2:0),br=2;br<yr;br++)_r[br-2]=arguments[br];gr=dr.options.overloadTranslationOptionHandler([hr,mr].concat(_r))}else gr={...mr};gr.lng=gr.lng||fr.lng,gr.lngs=gr.lngs||fr.lngs,gr.ns=gr.ns||fr.ns,gr.keyPrefix!==""&&(gr.keyPrefix=gr.keyPrefix||lr||fr.keyPrefix);const vr=dr.options.keySeparator||".";let wr;return gr.keyPrefix&&Array.isArray(hr)?wr=hr.map(xr=>`${gr.keyPrefix}${vr}${xr}`):wr=gr.keyPrefix?`${gr.keyPrefix}${vr}${hr}`:hr,dr.t(wr,gr)};return isString$1(rr)?fr.lng=rr:fr.lngs=rr,fr.ns=ir,fr.keyPrefix=lr,fr}t(){return this.translator&&this.translator.translate(...arguments)}exists(){return this.translator&&this.translator.exists(...arguments)}setDefaultNamespace(rr){this.options.defaultNS=rr}hasLoadedNamespace(rr){let ir=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const lr=ir.lng||this.resolvedLanguage||this.languages[0],dr=this.options?this.options.fallbackLng:!1,fr=this.languages[this.languages.length-1];if(lr.toLowerCase()==="cimode")return!0;const hr=(mr,gr)=>{const yr=this.services.backendConnector.state[`${mr}|${gr}`];return yr===-1||yr===0||yr===2};if(ir.precheck){const mr=ir.precheck(this,hr);if(mr!==void 0)return mr}return!!(this.hasResourceBundle(lr,rr)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||hr(lr,rr)&&(!dr||hr(fr,rr)))}loadNamespaces(rr,ir){const lr=defer();return this.options.ns?(isString$1(rr)&&(rr=[rr]),rr.forEach(dr=>{this.options.ns.indexOf(dr)<0&&this.options.ns.push(dr)}),this.loadResources(dr=>{lr.resolve(),ir&&ir(dr)}),lr):(ir&&ir(),Promise.resolve())}loadLanguages(rr,ir){const lr=defer();isString$1(rr)&&(rr=[rr]);const dr=this.options.preload||[],fr=rr.filter(hr=>dr.indexOf(hr)<0&&this.services.languageUtils.isSupportedCode(hr));return fr.length?(this.options.preload=dr.concat(fr),this.loadResources(hr=>{lr.resolve(),ir&&ir(hr)}),lr):(ir&&ir(),Promise.resolve())}dir(rr){if(rr||(rr=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!rr)return"rtl";const ir=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],lr=this.services&&this.services.languageUtils||new LanguageUtil(get());return ir.indexOf(lr.getLanguagePartFromCode(rr))>-1||rr.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(){let rr=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},ir=arguments.length>1?arguments[1]:void 0;return new I18n(rr,ir)}cloneInstance(){let rr=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},ir=arguments.length>1&&arguments[1]!==void 0?arguments[1]:noop;const lr=rr.forkResourceStore;lr&&delete rr.forkResourceStore;const dr={...this.options,...rr,isClone:!0},fr=new I18n(dr);return(rr.debug!==void 0||rr.prefix!==void 0)&&(fr.logger=fr.logger.clone(rr)),["store","services","language"].forEach(mr=>{fr[mr]=this[mr]}),fr.services={...this.services},fr.services.utils={hasLoadedNamespace:fr.hasLoadedNamespace.bind(fr)},lr&&(fr.store=new ResourceStore(this.store.data,dr),fr.services.resourceStore=fr.store),fr.translator=new Translator(fr.services,dr),fr.translator.on("*",function(mr){for(var gr=arguments.length,yr=new Array(gr>1?gr-1:0),_r=1;_r<gr;_r++)yr[_r-1]=arguments[_r];fr.emit(mr,...yr)}),fr.init(dr,ir),fr.translator.options=dr,fr.translator.backendConnector.services.utils={hasLoadedNamespace:fr.hasLoadedNamespace.bind(fr)},fr}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const instance=I18n.createInstance();instance.createInstance=I18n.createInstance;const t=instance.t,common={cancel:"Cancel",delete:"Delete",continue:"Continue",empty:"Empty",create:"Create",save:"Save",export:"Export",reload:"Reload",reloadConnect:"Click here to reload Connect"},searchbar={placeholder:"Search Powerhouse",filterLabel:"File type"},folderView={sections:{folders:{title:"Folders",empty:"No folders 🗂️"},documents:{title:"Documents and files",empty:"No documents or files 📄"}}},files={options:{switchboardLink:"Switchboard Link"}},modals={deleteItem:{folder:{header:"Delete “{{item}}” folder?",body:"Are you sure you want to delete this folder? All files and subfolders within it will be removed."},file:{header:"Delete “{{item}}” file?",body:"Are you sure you want to delete this file?"}},deleteDrive:{title:'Delete "{{label}}" drive?',body:"Are you sure you want to delete this drive? All files and subfolders within it will be removed. Do you want to proceed?",inputPlaceholder:"Enter drive name..."},upgradeDrive:{header:"Upgrade to cloud drive",body:"You are moving files from a private to a shared drive. These files will become accessible to others in the shared drive.Do you want to proceed?"},createDocument:{header:"Create a new document",placeholder:"Document name"},connectSettings:{title:"Settings",body:"These settings will apply to all drives.",clearStorage:{button:"Clear Storage",description:"Delete previous session data",confirmation:{title:"Clear Storage",body:"Are you sure you want to clear the storage? This will remove all previous session data.",clearButton:"Clear Storage"}},enabledDocumentTypes:{title:"Document Models",description:"Documents enabled",allSelected:"All documents are selected"}},exportDocumentWithErrors:{title:"Your document contains errors",body:"Your document contains structure errors. Do you want to export it anyway?"},disclaimer:{title:"Disclaimer",body:"All content provided herein our website, hyperlinked sites, associated applications, forums, blogs, social media accounts and other platforms (“Site”) is for your general information only, procured from third party sources. We make no warranties of any kind in relation to our content, including but not limited to accuracy and updatedness. No part of the content that we provide constitutes financial advice, legal advice or any other form of advice meant for your specific reliance for any purpose. Any use or reliance on our content is solely at your own risk and discretion. You should conduct your own research, review, analyse and verify our content before relying on them. Trading is a highly risky activity that can lead to major losses, please therefore consult your financial advisor before making any decision. No content on our Site is meant to be a solicitation or offer."},cookiesPolicy:{title:"Cookies Policy",body:"<subtitle>Use of Cookies and Similar Technologies</subtitle><p>The Site is using cookies. Cookies are small text files that are placed on your computer by websites that you visit. They are widely used in order to make websites work, or work more efficiently, as well as to provide information to the owners of the site. Cookies are typically stored on your computer´s hard drive.Information collected from cookies is used by us to evaluate the effectiveness of our Site and analyze trends. The information collected from cookies allows us to determine such things as which parts of the Site are most visited and difficulties our visitors may experience in accessing the SIte. With this knowledge, we can improve the quality of your experience on the Site by recognizing and delivering more of the most desired features and information, as well as by resolving access difficulties.</p><p>We use third party service providers, to assist us in better understanding the use of our Site. Our service providers will place cookies on the hard drive of your computer (or use similar technologies) and will receive information that we select that will educate us on such things as how visitors navigate around our Site. This information is aggregated to provide statistical data about our users browsing actions and patterns, and does not personally identify individuals. This information may include:</p><p>Computer or mobile device information, Website usage information, such as:<list></p><bullet>Page views,</bullet><bullet>Button clicks,</bullet><bullet>Input form changes (without the values being entered),</bullet><bullet>Errors.</bullet></list><p>Our service providers analyses this information and provides us with aggregate reports. The information and analysis provided by our service providers will be used to assist us in better understanding our visitors interests in our Site and how to better serve those interests. If you want to avoid using cookies altogether, you can disable cookies in your browser. However, disabling cookies might make it impossible for you to use certain features of the Site. Your use of the Site with a browser that is configured to accept cookies constitutes an acceptance of our and third-party cookies.</p>"}},notifications={deleteDriveSuccess:"Drive successfully deleted",deleteFolderSuccess:"Folder deleted",fileDeleteSuccess:"File deleted",addDriveSuccess:"New drive successfully added",driveSyncSuccess:"Drive synced successfully",driveSyncError:"Error synchronizing drive {{drive}}",driveSyncConflict:"Conflict error detected in {{drive}}",reloadApp:"It seems like you're running an outdated version of the app. Please reload Connect to get the latest version."},footer={cookiePolicy:"Cookie Policy",termsOfUse:"Terms of Use",disclaimer:"Disclaimer",builtWith:"Built with <icon /> Powerhouse"},cookieBanner={message:"This website uses cookies for analytic purposes only. Cookies are anonymous and do not link to user data. We collect information to improve the user experience and validate UI changes. You can still use the page without cookies. For more information, please read our <a>cookies policy.</a>",accept:"Accept configured cookies",reject:"Reject all cookies",cookies:{functional:"Functional cookies",analytics:"Analytics cookies"}},translationEN={common,searchbar,folderView,files,modals,notifications,footer,cookieBanner},resources={en:{code:"en",name:"English",translation:translationEN}};instance.use(initReactI18next).init({resources,fallbackLng:"en",debug:!1,interpolation:{escapeValue:!1}}).catch(tr=>{console.error(tr)});const isCookieAccepted=(tr,rr)=>tr.some(ir=>ir.id===rr&&ir.value),CookieBanner=()=>{const{t:tr}=useTranslation(void 0,{useSuspense:!0,i18n:instance}),[rr,ir]=useCookieBanner(),[,lr]=useAcceptedCookies(),dr=[{id:"analytics-cookie",label:tr("cookieBanner.cookies.analytics"),value:!0}],fr=mr=>{ir(!1),isCookieAccepted(mr,"analytics-cookie")&&lr(gr=>({...gr,analytics:!0}))},hr=()=>{ir(!1),lr(()=>({analytics:!1,functional:!1,marketing:!1}))};return rr?jsxs("div",{className:"absolute inset-0 z-[10000] backdrop-blur-sm",children:[jsx$1("div",{className:"absolute inset-0 bg-black opacity-15"}),jsx$1("div",{className:"absolute inset-x-0 bottom-0 flex justify-center bg-white px-10 pb-16 pt-10 shadow-lg",children:jsx$1(CookieBanner$1,{className:"max-w-[1024px]",cookies:dr,onSubmit:fr,onReject:hr,submitLabel:tr("cookieBanner.accept"),rejectLabel:tr("cookieBanner.reject"),children:jsx$1("p",{className:"font-semibold text-gray-500",children:jsx$1(Trans,{i18nKey:"cookieBanner.message",components:{a:jsx$1("a",{onClick:()=>showPHModal({type:"cookiesPolicy"}),className:"cursor-pointer text-gray-900 hover:underline"},"cookieBanner.message-link")}},"cookieBanner.message")})})})]}):null},CONNECT_TOAST_CONTAINER_ID="connect";function toast(tr,rr){const{type:ir="default",containerId:lr=CONNECT_TOAST_CONTAINER_ID,...dr}=rr||{};return toast$1(tr,{type:ir,containerId:lr,...dr})}function AddDriveModal(){const tr=usePHModal(),rr=(tr==null?void 0:tr.type)==="addDrive",ir=useUser(),lr=useConnectCrypto(),dr=useDriveEditorModules(),fr=async _r=>{try{const br=dr==null?void 0:dr.find(wr=>wr.id===_r.appId),vr=await addDrive({global:{name:_r.name,icon:null},local:{sharingType:_r.sharingType.toLowerCase()}},br==null?void 0:br.id);if(toast$1(t("notifications.addDriveSuccess"),{type:"connect-success"}),!vr)return;setSelectedDrive(vr)}catch(br){console.error(br)}},hr=async _r=>{try{const br=await addRemoteDrive(_r.url,{sharingType:_r.sharingType,availableOffline:_r.availableOffline,listeners:[{block:!0,callInfo:{data:_r.url,name:"switchboard-push",transmitterType:"SwitchboardPush"},filter:{branch:["main"],documentId:["*"],documentType:["*"],scope:["global"]},label:"Switchboard Sync",listenerId:"1",system:!0}],triggers:[]});if(toast$1(t("notifications.addDriveSuccess"),{type:"connect-success"}),!br)return;setSelectedDrive(br)}catch(br){console.error(br)}};async function mr(_r){await fr(_r),closePHModal()}async function gr(_r){await hr(_r),closePHModal()}const yr=dr.length>0;return jsx$1(AddDriveModal$1,{open:rr&&yr,onAddLocalDrive:mr,onAddRemoteDrive:gr,requestPublicDrive:async _r=>{var br,vr;try{const wr=await((br=lr==null?void 0:lr.getBearerToken)==null?void 0:br.call(lr,_r,ir==null?void 0:ir.address,!0,{expiresIn:10}));return requestPublicDrive(_r,{Authorization:`Bearer ${wr}`})}catch(wr){console.error(wr);const xr=await((vr=lr==null?void 0:lr.getBearerToken)==null?void 0:vr.call(lr,_r,ir==null?void 0:ir.address,!0,{expiresIn:10}));return requestPublicDrive(_r,{Authorization:`Bearer ${xr}`})}},onOpenChange:_r=>{if(!_r)return closePHModal()},appOptions:(dr==null?void 0:dr.map(_r=>({id:_r.id,name:_r.name,driveEditor:_r.id})))||[]})}async function loadGenericDriveExplorerEditorModule(){const{GenericDriveExplorer:tr}=await __vitePreload(async()=>{const{GenericDriveExplorer:hr}=await import("./index.CZ3emu5D.js").then(mr=>mr.i);return{GenericDriveExplorer:hr}},[],import.meta.url),rr="Generic Drive Explorer",ir=tr.documentTypes,lr=tr.Component,dr=tr.config;return{id:DEFAULT_DRIVE_EDITOR_ID,name:rr,documentTypes:ir,Component:lr,config:dr}}async function loadDocumentModelEditorModule(){await __vitePreload(()=>Promise.resolve({}),__vite__mapDeps([4]),import.meta.url);const{documentModelEditorModule:tr}=await __vitePreload(async()=>{const{documentModelEditorModule:rr}=await import("./index.BS7j0VZJ.js");return{documentModelEditorModule:rr}},__vite__mapDeps([5,6]),import.meta.url);return tr}async function loadDocumentModelEditor(){const tr=await loadDocumentModelEditorModule(),rr=tr.config,ir=rr.id,lr="Document Model Editor",dr=tr.documentTypes,fr=tr.Component;return{id:ir,name:lr,documentTypes:dr,Component:fr,config:rr}}async function loadDocumentModelDocumentModelModule(){const{documentModelDocumentModelModule:tr}=await __vitePreload(async()=>{const{documentModelDocumentModelModule:br}=await import("./index.BKnM0GnX.js");return{documentModelDocumentModelModule:br}},__vite__mapDeps([7,6]),import.meta.url),rr=tr.documentModel,ir=rr.name,lr=rr.id,dr=lr,fr=rr.extension,hr=rr.specifications,mr=tr.reducer,gr=tr.actions,yr=tr.utils;return{id:dr,name:ir,documentType:lr,extension:fr,specifications:hr,reducer:mr,actions:gr,utils:yr,documentModel:rr}}async function loadDriveDocumentModelModule(){const{driveDocumentModelModule:tr}=await __vitePreload(async()=>{const{driveDocumentModelModule:br}=await Promise.resolve().then(()=>index$2);return{driveDocumentModelModule:br}},void 0,import.meta.url),rr=tr.documentModel,ir=rr.name,lr=rr.id,dr=lr,fr=rr.extension,hr=rr.specifications,mr=tr.reducer,gr=tr.actions,yr=tr.utils;return{id:dr,name:ir,documentType:lr,extension:fr,specifications:hr,reducer:mr,actions:gr,utils:yr,documentModel:rr}}async function loadCommonPackage(){const tr=await loadDocumentModelDocumentModelModule(),rr=await loadDriveDocumentModelModule(),ir=await loadDocumentModelEditor(),lr=await loadGenericDriveExplorerEditorModule();return{id:COMMON_PACKAGE_ID,name:"Common",description:"Common",category:"Common",author:{name:"Powerhouse",website:"https://powerhousedao.com"},modules:{documentModelModules:[tr,rr],editorModules:[ir,lr]}}}const externalPackagesUrl=connectConfig.routerBasename+"external-packages.js",externalPackagesEnabled=window.__VITE_ENVS.PROD;async function loadExternalPackages(){try{if(!externalPackagesEnabled)return[];const tr=await import(externalPackagesUrl),rr=tr==null?void 0:tr.default;return rr?rr.map(convertLegacyLibToVetraPackage):[]}catch(tr){return console.error(tr),[]}}let reactorStorage;function setReactorStorage(tr){reactorStorage=tr}async function clearReactorStorage(){return await(reactorStorage==null?void 0:reactorStorage.clear()),!!reactorStorage}async function loadVetraPackages(){const tr=await loadCommonPackage(),rr=await loadExternalPackages();return[tr,...rr]}async function createReactor(){if(window.reactor||window.loading)return;window.loading=!0,addPHEventHandlers();const tr=getAppConfig(),rr=await initConnectCrypto(),ir=await rr.did(),lr=initRenown(ir,connectConfig.routerBasename),dr=createBrowserStorage(connectConfig.routerBasename);setReactorStorage(dr);const fr=await loadVetraPackages(),hr=fr.flatMap(Ar=>Ar.modules.documentModelModules).filter(Ar=>Ar!==void 0),mr=createBrowserDocumentDriveServer(hr,dr);await initReactor(mr,lr,rr);const gr=new ProcessorManager(mr.listeners,mr),yr=await getDrives(mr),_r=getDriveUrl();if(_r&&!yr.some(Ar=>_r.includes(Ar.header.slug)||_r.includes(Ar.header.id)))try{await mr.addRemoteDrive(_r,{sharingType:"PUBLIC",availableOffline:!0,listeners:[{block:!0,callInfo:{data:_r,name:"switchboard-push",transmitterType:"SwitchboardPush"},filter:{branch:["main"],documentId:["*"],documentType:["*"],scope:["global"]},label:"Switchboard Sync",listenerId:generateId(),system:!0}],triggers:[]}),window.location.href="/d/"+_r.split("/").pop()}catch(Ar){logger$6.error("Error adding remote drive",Ar)}else _r&&(window.location.href="/d/"+_r.split("/").pop());const br=await getDocuments(mr),vr=window.location.pathname,wr=extractDriveSlugFromPath(vr),xr=extractNodeSlugFromPath(vr),Sr=getDidFromUrl();await login(Sr,mr,lr,rr),dispatchSetReactorEvent(mr),dispatchSetConnectCryptoEvent(rr),dispatchSetDidEvent(ir),dispatchSetRenownEvent(lr),dispatchSetAppConfigEvent(tr),dispatchSetProcessorManagerEvent(gr),dispatchSetDrivesEvent(yr),dispatchSetDocumentsEvent(br),dispatchSetVetraPackagesEvent(fr),dispatchSetSelectedDriveIdEvent(wr),dispatchSetSelectedNodeIdEvent(xr),mr.on("syncStatus",(...Ar)=>{logger$6.verbose("syncStatus",...Ar),refreshReactorData(mr).catch(logger$6.error)}),mr.on("strandUpdate",(...Ar)=>{logger$6.verbose("strandUpdate",...Ar),refreshReactorData(mr).catch(logger$6.error)}),mr.on("defaultRemoteDrive",(...Ar)=>{logger$6.verbose("defaultRemoteDrive",...Ar),refreshReactorData(mr).catch(logger$6.error)}),mr.on("clientStrandsError",(...Ar)=>{logger$6.verbose("clientStrandsError",...Ar),refreshReactorData(mr).catch(logger$6.error)}),mr.on("driveAdded",(...Ar)=>{logger$6.verbose("driveAdded",...Ar),gr.registerDrive(Ar[0].header.id).catch(logger$6.error),refreshReactorData(mr).catch(logger$6.error)}),mr.on("driveDeleted",(...Ar)=>{logger$6.verbose("driveDeleted",...Ar),refreshReactorData(mr).catch(logger$6.error)}),mr.on("documentModelModules",(...Ar)=>{logger$6.verbose("documentModelModules",...Ar),refreshReactorData(mr).catch(logger$6.error)}),mr.on("documentOperationsAdded",(...Ar)=>{logger$6.verbose("documentOperationsAdded",...Ar),refreshReactorData(mr).catch(logger$6.error)}),mr.on("driveOperationsAdded",(...Ar)=>{logger$6.verbose("driveOperationsAdded",...Ar),refreshReactorData(mr).catch(logger$6.error)}),mr.on("operationsAdded",(...Ar)=>{logger$6.verbose("operationsAdded",...Ar),refreshReactorData(mr).catch(logger$6.error)}),window.loading=!1}function getAppConfig(){const tr=getAllowList(),rr=connectConfig.analytics.databaseName,ir=connectConfig.content.showSearchBar;return{allowList:tr,analyticsDatabaseName:rr,showSearchBar:ir}}function getAllowList(){const tr=window.__VITE_ENVS.PH_CONNECT_ARBITRUM_ALLOW_LIST,rr=window.__VITE_ENVS.PH_CONNECT_RWA_ALLOW_LIST;if(!(!tr.length&&!rr.length)){if(tr.length)return tr.split(",").filter(Boolean);if(rr.length)return rr.split(",").filter(Boolean)}}function getDidFromUrl(){const rr=new URLSearchParams(window.location.search).get("user");return rr?decodeURIComponent(rr):void 0}function getDriveUrl(){const rr=new URLSearchParams(window.location.search).get("driveUrl");return rr?decodeURIComponent(rr):void 0}const objectToString=Object.prototype.toString;function isError(tr){switch(objectToString.call(tr)){case"[object Error]":case"[object Exception]":case"[object DOMException]":return!0;default:return isInstanceOf(tr,Error)}}function isBuiltin(tr,rr){return objectToString.call(tr)===`[object ${rr}]`}function isErrorEvent(tr){return isBuiltin(tr,"ErrorEvent")}function isDOMError(tr){return isBuiltin(tr,"DOMError")}function isDOMException(tr){return isBuiltin(tr,"DOMException")}function isString(tr){return isBuiltin(tr,"String")}function isParameterizedString(tr){return typeof tr=="object"&&tr!==null&&"__sentry_template_string__"in tr&&"__sentry_template_values__"in tr}function isPrimitive(tr){return tr===null||isParameterizedString(tr)||typeof tr!="object"&&typeof tr!="function"}function isPlainObject(tr){return isBuiltin(tr,"Object")}function isEvent(tr){return typeof Event<"u"&&isInstanceOf(tr,Event)}function isElement(tr){return typeof Element<"u"&&isInstanceOf(tr,Element)}function isRegExp(tr){return isBuiltin(tr,"RegExp")}function isThenable(tr){return!!(tr&&tr.then&&typeof tr.then=="function")}function isSyntheticEvent(tr){return isPlainObject(tr)&&"nativeEvent"in tr&&"preventDefault"in tr&&"stopPropagation"in tr}function isNaN$1(tr){return typeof tr=="number"&&tr!==tr}function isInstanceOf(tr,rr){try{return tr instanceof rr}catch{return!1}}function isVueViewModel(tr){return!!(typeof tr=="object"&&tr!==null&&(tr.__isVue||tr._isVue))}function truncate(tr,rr=0){return typeof tr!="string"||rr===0||tr.length<=rr?tr:`${tr.slice(0,rr)}...`}function snipLine(tr,rr){let ir=tr;const lr=ir.length;if(lr<=150)return ir;rr>lr&&(rr=lr);let dr=Math.max(rr-60,0);dr<5&&(dr=0);let fr=Math.min(dr+140,lr);return fr>lr-5&&(fr=lr),fr===lr&&(dr=Math.max(fr-140,0)),ir=ir.slice(dr,fr),dr>0&&(ir=`'{snip} ${ir}`),fr<lr&&(ir+=" {snip}"),ir}function safeJoin(tr,rr){if(!Array.isArray(tr))return"";const ir=[];for(let lr=0;lr<tr.length;lr++){const dr=tr[lr];try{isVueViewModel(dr)?ir.push("[VueViewModel]"):ir.push(String(dr))}catch{ir.push("[value cannot be serialized]")}}return ir.join(rr)}function isMatchingPattern(tr,rr,ir=!1){return isString(tr)?isRegExp(rr)?rr.test(tr):isString(rr)?ir?tr===rr:tr.includes(rr):!1:!1}function stringMatchesSomePattern(tr,rr=[],ir=!1){return rr.some(lr=>isMatchingPattern(tr,lr,ir))}function isGlobalObj(tr){return tr&&tr.Math==Math?tr:void 0}const GLOBAL_OBJ=typeof globalThis=="object"&&isGlobalObj(globalThis)||typeof window=="object"&&isGlobalObj(window)||typeof self=="object"&&isGlobalObj(self)||typeof global=="object"&&isGlobalObj(global)||(function(){return this})()||{};function getGlobalObject(){return GLOBAL_OBJ}function getGlobalSingleton(tr,rr,ir){const lr=ir||GLOBAL_OBJ,dr=lr.__SENTRY__=lr.__SENTRY__||{};return dr[tr]||(dr[tr]=rr())}const WINDOW=getGlobalObject(),DEFAULT_MAX_STRING_LENGTH=80;function htmlTreeAsString(tr,rr={}){if(!tr)return"<unknown>";try{let ir=tr;const lr=5,dr=[];let fr=0,hr=0;const mr=" > ",gr=mr.length;let yr;const _r=Array.isArray(rr)?rr:rr.keyAttrs,br=!Array.isArray(rr)&&rr.maxStringLength||DEFAULT_MAX_STRING_LENGTH;for(;ir&&fr++<lr&&(yr=_htmlElementAsString(ir,_r),!(yr==="html"||fr>1&&hr+dr.length*gr+yr.length>=br));)dr.push(yr),hr+=yr.length,ir=ir.parentNode;return dr.reverse().join(mr)}catch{return"<unknown>"}}function _htmlElementAsString(tr,rr){const ir=tr,lr=[];let dr,fr,hr,mr,gr;if(!ir||!ir.tagName)return"";if(WINDOW.HTMLElement&&ir instanceof HTMLElement&&ir.dataset&&ir.dataset.sentryComponent)return ir.dataset.sentryComponent;lr.push(ir.tagName.toLowerCase());const yr=rr&&rr.length?rr.filter(br=>ir.getAttribute(br)).map(br=>[br,ir.getAttribute(br)]):null;if(yr&&yr.length)yr.forEach(br=>{lr.push(`[${br[0]}="${br[1]}"]`)});else if(ir.id&&lr.push(`#${ir.id}`),dr=ir.className,dr&&isString(dr))for(fr=dr.split(/\s+/),gr=0;gr<fr.length;gr++)lr.push(`.${fr[gr]}`);const _r=["aria-label","type","name","title","alt"];for(gr=0;gr<_r.length;gr++)hr=_r[gr],mr=ir.getAttribute(hr),mr&&lr.push(`[${hr}="${mr}"]`);return lr.join("")}function getLocationHref(){try{return WINDOW.document.location.href}catch{return""}}function getDomElement(tr){return WINDOW.document&&WINDOW.document.querySelector?WINDOW.document.querySelector(tr):null}function getComponentName(tr){if(!WINDOW.HTMLElement)return null;let rr=tr;const ir=5;for(let lr=0;lr<ir;lr++){if(!rr)return null;if(rr instanceof HTMLElement&&rr.dataset.sentryComponent)return rr.dataset.sentryComponent;rr=rr.parentNode}return null}const DEBUG_BUILD$1=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,PREFIX="Sentry Logger ",CONSOLE_LEVELS=["debug","info","warn","error","log","assert","trace"],originalConsoleMethods={};function consoleSandbox(tr){if(!("console"in GLOBAL_OBJ))return tr();const rr=GLOBAL_OBJ.console,ir={},lr=Object.keys(originalConsoleMethods);lr.forEach(dr=>{const fr=originalConsoleMethods[dr];ir[dr]=rr[dr],rr[dr]=fr});try{return tr()}finally{lr.forEach(dr=>{rr[dr]=ir[dr]})}}function makeLogger(){let tr=!1;const rr={enable:()=>{tr=!0},disable:()=>{tr=!1},isEnabled:()=>tr};return DEBUG_BUILD$1?CONSOLE_LEVELS.forEach(ir=>{rr[ir]=(...lr)=>{tr&&consoleSandbox(()=>{GLOBAL_OBJ.console[ir](`${PREFIX}[${ir}]:`,...lr)})}}):CONSOLE_LEVELS.forEach(ir=>{rr[ir]=()=>{}}),rr}const logger$1=makeLogger();function fill(tr,rr,ir){if(!(rr in tr))return;const lr=tr[rr],dr=ir(lr);typeof dr=="function"&&markFunctionWrapped(dr,lr),tr[rr]=dr}function addNonEnumerableProperty(tr,rr,ir){try{Object.defineProperty(tr,rr,{value:ir,writable:!0,configurable:!0})}catch{DEBUG_BUILD$1&&logger$1.log(`Failed to add non-enumerable property "${rr}" to object`,tr)}}function markFunctionWrapped(tr,rr){try{const ir=rr.prototype||{};tr.prototype=rr.prototype=ir,addNonEnumerableProperty(tr,"__sentry_original__",rr)}catch{}}function getOriginalFunction(tr){return tr.__sentry_original__}function urlEncode(tr){return Object.keys(tr).map(rr=>`${encodeURIComponent(rr)}=${encodeURIComponent(tr[rr])}`).join("&")}function convertToPlainObject(tr){if(isError(tr))return{message:tr.message,name:tr.name,stack:tr.stack,...getOwnProperties(tr)};if(isEvent(tr)){const rr={type:tr.type,target:serializeEventTarget(tr.target),currentTarget:serializeEventTarget(tr.currentTarget),...getOwnProperties(tr)};return typeof CustomEvent<"u"&&isInstanceOf(tr,CustomEvent)&&(rr.detail=tr.detail),rr}else return tr}function serializeEventTarget(tr){try{return isElement(tr)?htmlTreeAsString(tr):Object.prototype.toString.call(tr)}catch{return"<unknown>"}}function getOwnProperties(tr){if(typeof tr=="object"&&tr!==null){const rr={};for(const ir in tr)Object.prototype.hasOwnProperty.call(tr,ir)&&(rr[ir]=tr[ir]);return rr}else return{}}function extractExceptionKeysForMessage(tr,rr=40){const ir=Object.keys(convertToPlainObject(tr));if(ir.sort(),!ir.length)return"[object has no keys]";if(ir[0].length>=rr)return truncate(ir[0],rr);for(let lr=ir.length;lr>0;lr--){const dr=ir.slice(0,lr).join(", ");if(!(dr.length>rr))return lr===ir.length?dr:truncate(dr,rr)}return""}function dropUndefinedKeys(tr){return _dropUndefinedKeys(tr,new Map)}function _dropUndefinedKeys(tr,rr){if(isPojo(tr)){const ir=rr.get(tr);if(ir!==void 0)return ir;const lr={};rr.set(tr,lr);for(const dr of Object.keys(tr))typeof tr[dr]<"u"&&(lr[dr]=_dropUndefinedKeys(tr[dr],rr));return lr}if(Array.isArray(tr)){const ir=rr.get(tr);if(ir!==void 0)return ir;const lr=[];return rr.set(tr,lr),tr.forEach(dr=>{lr.push(_dropUndefinedKeys(dr,rr))}),lr}return tr}function isPojo(tr){if(!isPlainObject(tr))return!1;try{const rr=Object.getPrototypeOf(tr).constructor.name;return!rr||rr==="Object"}catch{return!0}}const STACKTRACE_FRAME_LIMIT=50,WEBPACK_ERROR_REGEXP=/\(error: (.*)\)/,STRIP_FRAME_REGEXP=/captureMessage|captureException/;function createStackParser(...tr){const rr=tr.sort((ir,lr)=>ir[0]-lr[0]).map(ir=>ir[1]);return(ir,lr=0)=>{const dr=[],fr=ir.split(`
851
851
  `);for(let hr=lr;hr<fr.length;hr++){const mr=fr[hr];if(mr.length>1024)continue;const gr=WEBPACK_ERROR_REGEXP.test(mr)?mr.replace(WEBPACK_ERROR_REGEXP,"$1"):mr;if(!gr.match(/\S*Error: /)){for(const yr of rr){const _r=yr(gr);if(_r){dr.push(_r);break}}if(dr.length>=STACKTRACE_FRAME_LIMIT)break}}return stripSentryFramesAndReverse(dr)}}function stackParserFromStackParserOptions(tr){return Array.isArray(tr)?createStackParser(...tr):tr}function stripSentryFramesAndReverse(tr){if(!tr.length)return[];const rr=Array.from(tr);return/sentryWrapped/.test(rr[rr.length-1].function||"")&&rr.pop(),rr.reverse(),STRIP_FRAME_REGEXP.test(rr[rr.length-1].function||"")&&(rr.pop(),STRIP_FRAME_REGEXP.test(rr[rr.length-1].function||"")&&rr.pop()),rr.slice(0,STACKTRACE_FRAME_LIMIT).map(ir=>({...ir,filename:ir.filename||rr[rr.length-1].filename,function:ir.function||"?"}))}const defaultFunctionName="<anonymous>";function getFunctionName(tr){try{return!tr||typeof tr!="function"?defaultFunctionName:tr.name||defaultFunctionName}catch{return defaultFunctionName}}function uuid4(){const tr=GLOBAL_OBJ,rr=tr.crypto||tr.msCrypto;let ir=()=>Math.random()*16;try{if(rr&&rr.randomUUID)return rr.randomUUID().replace(/-/g,"");rr&&rr.getRandomValues&&(ir=()=>{const lr=new Uint8Array(1);return rr.getRandomValues(lr),lr[0]})}catch{}return("10000000100040008000"+1e11).replace(/[018]/g,lr=>(lr^(ir()&15)>>lr/4).toString(16))}function getFirstException(tr){return tr.exception&&tr.exception.values?tr.exception.values[0]:void 0}function getEventDescription(tr){const{message:rr,event_id:ir}=tr;if(rr)return rr;const lr=getFirstException(tr);return lr?lr.type&&lr.value?`${lr.type}: ${lr.value}`:lr.type||lr.value||ir||"<unknown>":ir||"<unknown>"}function addExceptionTypeValue(tr,rr,ir){const lr=tr.exception=tr.exception||{},dr=lr.values=lr.values||[],fr=dr[0]=dr[0]||{};fr.value||(fr.value=rr||""),fr.type||(fr.type="Error")}function addExceptionMechanism(tr,rr){const ir=getFirstException(tr);if(!ir)return;const lr={type:"generic",handled:!0},dr=ir.mechanism;if(ir.mechanism={...lr,...dr,...rr},rr&&"data"in rr){const fr={...dr&&dr.data,...rr.data};ir.mechanism.data=fr}}function addContextToFrame(tr,rr,ir=5){if(rr.lineno===void 0)return;const lr=tr.length,dr=Math.max(Math.min(lr-1,rr.lineno-1),0);rr.pre_context=tr.slice(Math.max(0,dr-ir),dr).map(fr=>snipLine(fr,0)),rr.context_line=snipLine(tr[Math.min(lr-1,dr)],rr.colno||0),rr.post_context=tr.slice(Math.min(dr+1,lr),dr+1+ir).map(fr=>snipLine(fr,0))}function checkOrSetAlreadyCaught(tr){if(tr&&tr.__sentry_captured__)return!0;try{addNonEnumerableProperty(tr,"__sentry_captured__",!0)}catch{}return!1}function arrayify(tr){return Array.isArray(tr)?tr:[tr]}function memoBuilder(){const tr=typeof WeakSet=="function",rr=tr?new WeakSet:[];function ir(dr){if(tr)return rr.has(dr)?!0:(rr.add(dr),!1);for(let fr=0;fr<rr.length;fr++)if(rr[fr]===dr)return!0;return rr.push(dr),!1}function lr(dr){if(tr)rr.delete(dr);else for(let fr=0;fr<rr.length;fr++)if(rr[fr]===dr){rr.splice(fr,1);break}}return[ir,lr]}function normalize(tr,rr=100,ir=1/0){try{return visit("",tr,rr,ir)}catch(lr){return{ERROR:`**non-serializable** (${lr})`}}}function normalizeToSize(tr,rr=3,ir=100*1024){const lr=normalize(tr,rr);return jsonSize(lr)>ir?normalizeToSize(tr,rr-1,ir):lr}function visit(tr,rr,ir=1/0,lr=1/0,dr=memoBuilder()){const[fr,hr]=dr;if(rr==null||["number","boolean","string"].includes(typeof rr)&&!isNaN$1(rr))return rr;const mr=stringifyValue(tr,rr);if(!mr.startsWith("[object "))return mr;if(rr.__sentry_skip_normalization__)return rr;const gr=typeof rr.__sentry_override_normalization_depth__=="number"?rr.__sentry_override_normalization_depth__:ir;if(gr===0)return mr.replace("object ","");if(fr(rr))return"[Circular ~]";const yr=rr;if(yr&&typeof yr.toJSON=="function")try{const wr=yr.toJSON();return visit("",wr,gr-1,lr,dr)}catch{}const _r=Array.isArray(rr)?[]:{};let br=0;const vr=convertToPlainObject(rr);for(const wr in vr){if(!Object.prototype.hasOwnProperty.call(vr,wr))continue;if(br>=lr){_r[wr]="[MaxProperties ~]";break}const xr=vr[wr];_r[wr]=visit(wr,xr,gr-1,lr,dr),br++}return hr(rr),_r}function stringifyValue(tr,rr){try{if(tr==="domain"&&rr&&typeof rr=="object"&&rr._events)return"[Domain]";if(tr==="domainEmitter")return"[DomainEmitter]";if(typeof global<"u"&&rr===global)return"[Global]";if(typeof window<"u"&&rr===window)return"[Window]";if(typeof document<"u"&&rr===document)return"[Document]";if(isVueViewModel(rr))return"[VueViewModel]";if(isSyntheticEvent(rr))return"[SyntheticEvent]";if(typeof rr=="number"&&rr!==rr)return"[NaN]";if(typeof rr=="function")return`[Function: ${getFunctionName(rr)}]`;if(typeof rr=="symbol")return`[${String(rr)}]`;if(typeof rr=="bigint")return`[BigInt: ${String(rr)}]`;const ir=getConstructorName(rr);return/^HTML(\w*)Element$/.test(ir)?`[HTMLElement: ${ir}]`:`[object ${ir}]`}catch(ir){return`**non-serializable** (${ir})`}}function getConstructorName(tr){const rr=Object.getPrototypeOf(tr);return rr?rr.constructor.name:"null prototype"}function utf8Length(tr){return~-encodeURI(tr).split(/%..|./).length}function jsonSize(tr){return utf8Length(JSON.stringify(tr))}var States;(function(tr){tr[tr.PENDING=0]="PENDING";const ir=1;tr[tr.RESOLVED=ir]="RESOLVED";const lr=2;tr[tr.REJECTED=lr]="REJECTED"})(States||(States={}));function resolvedSyncPromise(tr){return new SyncPromise(rr=>{rr(tr)})}function rejectedSyncPromise(tr){return new SyncPromise((rr,ir)=>{ir(tr)})}class SyncPromise{constructor(rr){SyncPromise.prototype.__init.call(this),SyncPromise.prototype.__init2.call(this),SyncPromise.prototype.__init3.call(this),SyncPromise.prototype.__init4.call(this),this._state=States.PENDING,this._handlers=[];try{rr(this._resolve,this._reject)}catch(ir){this._reject(ir)}}then(rr,ir){return new SyncPromise((lr,dr)=>{this._handlers.push([!1,fr=>{if(!rr)lr(fr);else try{lr(rr(fr))}catch(hr){dr(hr)}},fr=>{if(!ir)dr(fr);else try{lr(ir(fr))}catch(hr){dr(hr)}}]),this._executeHandlers()})}catch(rr){return this.then(ir=>ir,rr)}finally(rr){return new SyncPromise((ir,lr)=>{let dr,fr;return this.then(hr=>{fr=!1,dr=hr,rr&&rr()},hr=>{fr=!0,dr=hr,rr&&rr()}).then(()=>{if(fr){lr(dr);return}ir(dr)})})}__init(){this._resolve=rr=>{this._setResult(States.RESOLVED,rr)}}__init2(){this._reject=rr=>{this._setResult(States.REJECTED,rr)}}__init3(){this._setResult=(rr,ir)=>{if(this._state===States.PENDING){if(isThenable(ir)){ir.then(this._resolve,this._reject);return}this._state=rr,this._value=ir,this._executeHandlers()}}}__init4(){this._executeHandlers=()=>{if(this._state===States.PENDING)return;const rr=this._handlers.slice();this._handlers=[],rr.forEach(ir=>{ir[0]||(this._state===States.RESOLVED&&ir[1](this._value),this._state===States.REJECTED&&ir[2](this._value),ir[0]=!0)})}}}const ONE_SECOND_IN_MS=1e3;function dateTimestampInSeconds(){return Date.now()/ONE_SECOND_IN_MS}function createUnixTimestampInSecondsFunc(){const{performance:tr}=GLOBAL_OBJ;if(!tr||!tr.now)return dateTimestampInSeconds;const rr=Date.now()-tr.now(),ir=tr.timeOrigin==null?rr:tr.timeOrigin;return()=>(ir+tr.now())/ONE_SECOND_IN_MS}const timestampInSeconds=createUnixTimestampInSecondsFunc(),browserPerformanceTimeOrigin=(()=>{const{performance:tr}=GLOBAL_OBJ;if(!tr||!tr.now)return;const rr=3600*1e3,ir=tr.now(),lr=Date.now(),dr=tr.timeOrigin?Math.abs(tr.timeOrigin+ir-lr):rr,fr=dr<rr,hr=tr.timing&&tr.timing.navigationStart,gr=typeof hr=="number"?Math.abs(hr+ir-lr):rr,yr=gr<rr;return fr||yr?dr<=gr?tr.timeOrigin:hr:lr})(),BAGGAGE_HEADER_NAME="baggage",SENTRY_BAGGAGE_KEY_PREFIX="sentry-",SENTRY_BAGGAGE_KEY_PREFIX_REGEX=/^sentry-/,MAX_BAGGAGE_STRING_LENGTH=8192;function baggageHeaderToDynamicSamplingContext(tr){if(!isString(tr)&&!Array.isArray(tr))return;let rr={};if(Array.isArray(tr))rr=tr.reduce((lr,dr)=>{const fr=baggageHeaderToObject(dr);for(const hr of Object.keys(fr))lr[hr]=fr[hr];return lr},{});else{if(!tr)return;rr=baggageHeaderToObject(tr)}const ir=Object.entries(rr).reduce((lr,[dr,fr])=>{if(dr.match(SENTRY_BAGGAGE_KEY_PREFIX_REGEX)){const hr=dr.slice(SENTRY_BAGGAGE_KEY_PREFIX.length);lr[hr]=fr}return lr},{});if(Object.keys(ir).length>0)return ir}function dynamicSamplingContextToSentryBaggageHeader(tr){if(!tr)return;const rr=Object.entries(tr).reduce((ir,[lr,dr])=>(dr&&(ir[`${SENTRY_BAGGAGE_KEY_PREFIX}${lr}`]=dr),ir),{});return objectToBaggageHeader(rr)}function baggageHeaderToObject(tr){return tr.split(",").map(rr=>rr.split("=").map(ir=>decodeURIComponent(ir.trim()))).reduce((rr,[ir,lr])=>(rr[ir]=lr,rr),{})}function objectToBaggageHeader(tr){if(Object.keys(tr).length!==0)return Object.entries(tr).reduce((rr,[ir,lr],dr)=>{const fr=`${encodeURIComponent(ir)}=${encodeURIComponent(lr)}`,hr=dr===0?fr:`${rr},${fr}`;return hr.length>MAX_BAGGAGE_STRING_LENGTH?(DEBUG_BUILD$1&&logger$1.warn(`Not adding key: ${ir} with val: ${lr} to baggage header due to exceeding baggage size limits.`),rr):hr},"")}const TRACEPARENT_REGEXP=new RegExp("^[ \\t]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ \\t]*$");function extractTraceparentData(tr){if(!tr)return;const rr=tr.match(TRACEPARENT_REGEXP);if(!rr)return;let ir;return rr[3]==="1"?ir=!0:rr[3]==="0"&&(ir=!1),{traceId:rr[1],parentSampled:ir,parentSpanId:rr[2]}}function tracingContextFromHeaders(tr,rr){const ir=extractTraceparentData(tr),lr=baggageHeaderToDynamicSamplingContext(rr),{traceId:dr,parentSpanId:fr,parentSampled:hr}=ir||{};return ir?{traceparentData:ir,dynamicSamplingContext:lr||{},propagationContext:{traceId:dr||uuid4(),parentSpanId:fr||uuid4().substring(16),spanId:uuid4().substring(16),sampled:hr,dsc:lr||{}}}:{traceparentData:ir,dynamicSamplingContext:void 0,propagationContext:{traceId:dr||uuid4(),spanId:uuid4().substring(16)}}}function propagationContextFromHeaders(tr,rr){const ir=extractTraceparentData(tr),lr=baggageHeaderToDynamicSamplingContext(rr),{traceId:dr,parentSpanId:fr,parentSampled:hr}=ir||{};return ir?{traceId:dr||uuid4(),parentSpanId:fr||uuid4().substring(16),spanId:uuid4().substring(16),sampled:hr,dsc:lr||{}}:{traceId:dr||uuid4(),spanId:uuid4().substring(16)}}function generateSentryTraceHeader(tr=uuid4(),rr=uuid4().substring(16),ir){let lr="";return ir!==void 0&&(lr=ir?"-1":"-0"),`${tr}-${rr}${lr}`}const DEBUG_BUILD=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,DEFAULT_ENVIRONMENT="production";function getGlobalEventProcessors(){return getGlobalSingleton("globalEventProcessors",()=>[])}function addGlobalEventProcessor(tr){getGlobalEventProcessors().push(tr)}function notifyEventProcessors(tr,rr,ir,lr=0){return new SyncPromise((dr,fr)=>{const hr=tr[lr];if(rr===null||typeof hr!="function")dr(rr);else{const mr=hr({...rr},ir);DEBUG_BUILD&&hr.id&&mr===null&&logger$1.log(`Event processor "${hr.id}" dropped event`),isThenable(mr)?mr.then(gr=>notifyEventProcessors(tr,gr,ir,lr+1).then(dr)).then(null,fr):notifyEventProcessors(tr,mr,ir,lr+1).then(dr).then(null,fr)}})}function makeSession(tr){const rr=timestampInSeconds(),ir={sid:uuid4(),init:!0,timestamp:rr,started:rr,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>sessionToJSON(ir)};return tr&&updateSession(ir,tr),ir}function updateSession(tr,rr={}){if(rr.user&&(!tr.ipAddress&&rr.user.ip_address&&(tr.ipAddress=rr.user.ip_address),!tr.did&&!rr.did&&(tr.did=rr.user.id||rr.user.email||rr.user.username)),tr.timestamp=rr.timestamp||timestampInSeconds(),rr.abnormal_mechanism&&(tr.abnormal_mechanism=rr.abnormal_mechanism),rr.ignoreDuration&&(tr.ignoreDuration=rr.ignoreDuration),rr.sid&&(tr.sid=rr.sid.length===32?rr.sid:uuid4()),rr.init!==void 0&&(tr.init=rr.init),!tr.did&&rr.did&&(tr.did=`${rr.did}`),typeof rr.started=="number"&&(tr.started=rr.started),tr.ignoreDuration)tr.duration=void 0;else if(typeof rr.duration=="number")tr.duration=rr.duration;else{const ir=tr.timestamp-tr.started;tr.duration=ir>=0?ir:0}rr.release&&(tr.release=rr.release),rr.environment&&(tr.environment=rr.environment),!tr.ipAddress&&rr.ipAddress&&(tr.ipAddress=rr.ipAddress),!tr.userAgent&&rr.userAgent&&(tr.userAgent=rr.userAgent),typeof rr.errors=="number"&&(tr.errors=rr.errors),rr.status&&(tr.status=rr.status)}function closeSession(tr,rr){let ir={};tr.status==="ok"&&(ir={status:"exited"}),updateSession(tr,ir)}function sessionToJSON(tr){return dropUndefinedKeys({sid:`${tr.sid}`,init:tr.init,started:new Date(tr.started*1e3).toISOString(),timestamp:new Date(tr.timestamp*1e3).toISOString(),status:tr.status,errors:tr.errors,did:typeof tr.did=="number"||typeof tr.did=="string"?`${tr.did}`:void 0,duration:tr.duration,abnormal_mechanism:tr.abnormal_mechanism,attrs:{release:tr.release,environment:tr.environment,ip_address:tr.ipAddress,user_agent:tr.userAgent}})}const TRACE_FLAG_NONE=0,TRACE_FLAG_SAMPLED=1;function spanToTraceContext(tr){const{spanId:rr,traceId:ir}=tr.spanContext(),{data:lr,op:dr,parent_span_id:fr,status:hr,tags:mr,origin:gr}=spanToJSON(tr);return dropUndefinedKeys({data:lr,op:dr,parent_span_id:fr,span_id:rr,status:hr,tags:mr,trace_id:ir,origin:gr})}function spanToTraceHeader(tr){const{traceId:rr,spanId:ir}=tr.spanContext(),lr=spanIsSampled(tr);return generateSentryTraceHeader(rr,ir,lr)}function spanTimeInputToSeconds(tr){return typeof tr=="number"?ensureTimestampInSeconds(tr):Array.isArray(tr)?tr[0]+tr[1]/1e9:tr instanceof Date?ensureTimestampInSeconds(tr.getTime()):timestampInSeconds()}function ensureTimestampInSeconds(tr){return tr>9999999999?tr/1e3:tr}function spanToJSON(tr){return spanIsSpanClass(tr)?tr.getSpanJSON():typeof tr.toJSON=="function"?tr.toJSON():{}}function spanIsSpanClass(tr){return typeof tr.getSpanJSON=="function"}function spanIsSampled(tr){const{traceFlags:rr}=tr.spanContext();return!!(rr&TRACE_FLAG_SAMPLED)}function prepareEvent(tr,rr,ir,lr,dr,fr){const{normalizeDepth:hr=3,normalizeMaxBreadth:mr=1e3}=tr,gr={...rr,event_id:rr.event_id||ir.event_id||uuid4(),timestamp:rr.timestamp||dateTimestampInSeconds()},yr=ir.integrations||tr.integrations.map(Ar=>Ar.name);applyClientOptions(gr,tr),applyIntegrationsMetadata(gr,yr),rr.type===void 0&&applyDebugIds(gr,tr.stackParser);const _r=getFinalScope(lr,ir.captureContext);ir.mechanism&&addExceptionMechanism(gr,ir.mechanism);const br=dr&&dr.getEventProcessors?dr.getEventProcessors():[],vr=getGlobalScope().getScopeData();if(fr){const Ar=fr.getScopeData();mergeScopeData(vr,Ar)}if(_r){const Ar=_r.getScopeData();mergeScopeData(vr,Ar)}const wr=[...ir.attachments||[],...vr.attachments];wr.length&&(ir.attachments=wr),applyScopeDataToEvent(gr,vr);const xr=[...br,...getGlobalEventProcessors(),...vr.eventProcessors];return notifyEventProcessors(xr,gr,ir).then(Ar=>(Ar&&applyDebugMeta(Ar),typeof hr=="number"&&hr>0?normalizeEvent(Ar,hr,mr):Ar))}function applyClientOptions(tr,rr){const{environment:ir,release:lr,dist:dr,maxValueLength:fr=250}=rr;"environment"in tr||(tr.environment="environment"in rr?ir:DEFAULT_ENVIRONMENT),tr.release===void 0&&lr!==void 0&&(tr.release=lr),tr.dist===void 0&&dr!==void 0&&(tr.dist=dr),tr.message&&(tr.message=truncate(tr.message,fr));const hr=tr.exception&&tr.exception.values&&tr.exception.values[0];hr&&hr.value&&(hr.value=truncate(hr.value,fr));const mr=tr.request;mr&&mr.url&&(mr.url=truncate(mr.url,fr))}const debugIdStackParserCache=new WeakMap;function applyDebugIds(tr,rr){const ir=GLOBAL_OBJ._sentryDebugIds;if(!ir)return;let lr;const dr=debugIdStackParserCache.get(rr);dr?lr=dr:(lr=new Map,debugIdStackParserCache.set(rr,lr));const fr=Object.keys(ir).reduce((hr,mr)=>{let gr;const yr=lr.get(mr);yr?gr=yr:(gr=rr(mr),lr.set(mr,gr));for(let _r=gr.length-1;_r>=0;_r--){const br=gr[_r];if(br.filename){hr[br.filename]=ir[mr];break}}return hr},{});try{tr.exception.values.forEach(hr=>{hr.stacktrace.frames.forEach(mr=>{mr.filename&&(mr.debug_id=fr[mr.filename])})})}catch{}}function applyDebugMeta(tr){const rr={};try{tr.exception.values.forEach(lr=>{lr.stacktrace.frames.forEach(dr=>{dr.debug_id&&(dr.abs_path?rr[dr.abs_path]=dr.debug_id:dr.filename&&(rr[dr.filename]=dr.debug_id),delete dr.debug_id)})})}catch{}if(Object.keys(rr).length===0)return;tr.debug_meta=tr.debug_meta||{},tr.debug_meta.images=tr.debug_meta.images||[];const ir=tr.debug_meta.images;Object.keys(rr).forEach(lr=>{ir.push({type:"sourcemap",code_file:lr,debug_id:rr[lr]})})}function applyIntegrationsMetadata(tr,rr){rr.length>0&&(tr.sdk=tr.sdk||{},tr.sdk.integrations=[...tr.sdk.integrations||[],...rr])}function normalizeEvent(tr,rr,ir){if(!tr)return null;const lr={...tr,...tr.breadcrumbs&&{breadcrumbs:tr.breadcrumbs.map(dr=>({...dr,...dr.data&&{data:normalize(dr.data,rr,ir)}}))},...tr.user&&{user:normalize(tr.user,rr,ir)},...tr.contexts&&{contexts:normalize(tr.contexts,rr,ir)},...tr.extra&&{extra:normalize(tr.extra,rr,ir)}};return tr.contexts&&tr.contexts.trace&&lr.contexts&&(lr.contexts.trace=tr.contexts.trace,tr.contexts.trace.data&&(lr.contexts.trace.data=normalize(tr.contexts.trace.data,rr,ir))),tr.spans&&(lr.spans=tr.spans.map(dr=>{const fr=spanToJSON(dr).data;return fr&&(dr.data=normalize(fr,rr,ir)),dr})),lr}function getFinalScope(tr,rr){if(!rr)return tr;const ir=tr?tr.clone():new Scope;return ir.update(rr),ir}function parseEventHintOrCaptureContext(tr){if(tr)return hintIsScopeOrFunction(tr)?{captureContext:tr}:hintIsScopeContext(tr)?{captureContext:tr}:tr}function hintIsScopeOrFunction(tr){return tr instanceof Scope||typeof tr=="function"}const captureContextKeys=["user","level","extra","contexts","tags","fingerprint","requestSession","propagationContext"];function hintIsScopeContext(tr){return Object.keys(tr).some(rr=>captureContextKeys.includes(rr))}function captureException(tr,rr){return getCurrentHub().captureException(tr,parseEventHintOrCaptureContext(rr))}function captureMessage(tr,rr){const ir=typeof rr=="string"?rr:void 0,lr=typeof rr!="string"?{captureContext:rr}:void 0;return getCurrentHub().captureMessage(tr,ir,lr)}function captureEvent(tr,rr){return getCurrentHub().captureEvent(tr,rr)}function configureScope(tr){getCurrentHub().configureScope(tr)}function addBreadcrumb(tr,rr){getCurrentHub().addBreadcrumb(tr,rr)}function setContext(tr,rr){getCurrentHub().setContext(tr,rr)}function setExtras(tr){getCurrentHub().setExtras(tr)}function setExtra(tr,rr){getCurrentHub().setExtra(tr,rr)}function setTags(tr){getCurrentHub().setTags(tr)}function setTag(tr,rr){getCurrentHub().setTag(tr,rr)}function setUser(tr){getCurrentHub().setUser(tr)}function withScope(...tr){const rr=getCurrentHub();if(tr.length===2){const[ir,lr]=tr;return ir?rr.withScope(()=>(rr.getStackTop().scope=ir,lr(ir))):rr.withScope(lr)}return rr.withScope(tr[0])}function withIsolationScope(tr){return runWithAsyncContext(()=>tr(getIsolationScope()))}function withActiveSpan(tr,rr){return withScope(ir=>(ir.setSpan(tr),rr(ir)))}function startTransaction(tr,rr){return getCurrentHub().startTransaction({...tr},rr)}async function flush(tr){const rr=getClient();return rr?rr.flush(tr):(DEBUG_BUILD&&logger$1.warn("Cannot flush events. No client defined."),Promise.resolve(!1))}async function close(tr){const rr=getClient();return rr?rr.close(tr):(DEBUG_BUILD&&logger$1.warn("Cannot flush events and disable SDK. No client defined."),Promise.resolve(!1))}function lastEventId(){return getCurrentHub().lastEventId()}function getClient(){return getCurrentHub().getClient()}function isInitialized(){return!!getClient()}function getCurrentScope(){return getCurrentHub().getScope()}function startSession(tr){const rr=getClient(),ir=getIsolationScope(),lr=getCurrentScope(),{release:dr,environment:fr=DEFAULT_ENVIRONMENT}=rr&&rr.getOptions()||{},{userAgent:hr}=GLOBAL_OBJ.navigator||{},mr=makeSession({release:dr,environment:fr,user:lr.getUser()||ir.getUser(),...hr&&{userAgent:hr},...tr}),gr=ir.getSession();return gr&&gr.status==="ok"&&updateSession(gr,{status:"exited"}),endSession(),ir.setSession(mr),lr.setSession(mr),mr}function endSession(){const tr=getIsolationScope(),rr=getCurrentScope(),ir=rr.getSession()||tr.getSession();ir&&closeSession(ir),_sendSessionUpdate(),tr.setSession(),rr.setSession()}function _sendSessionUpdate(){const tr=getIsolationScope(),rr=getCurrentScope(),ir=getClient(),lr=rr.getSession()||tr.getSession();lr&&ir&&ir.captureSession&&ir.captureSession(lr)}function captureSession(tr=!1){if(tr){endSession();return}_sendSessionUpdate()}function getRootSpan(tr){return tr.transaction}function getDynamicSamplingContextFromClient(tr,rr,ir){const lr=rr.getOptions(),{publicKey:dr}=rr.getDsn()||{},{segment:fr}=ir&&ir.getUser()||{},hr=dropUndefinedKeys({environment:lr.environment||DEFAULT_ENVIRONMENT,release:lr.release,user_segment:fr,public_key:dr,trace_id:tr});return rr.emit&&rr.emit("createDsc",hr),hr}function getDynamicSamplingContextFromSpan(tr){const rr=getClient();if(!rr)return{};const ir=getDynamicSamplingContextFromClient(spanToJSON(tr).trace_id||"",rr,getCurrentScope()),lr=getRootSpan(tr);if(!lr)return ir;const dr=lr&&lr._frozenDynamicSamplingContext;if(dr)return dr;const{sampleRate:fr,source:hr}=lr.metadata;fr!=null&&(ir.sample_rate=`${fr}`);const mr=spanToJSON(lr);return hr&&hr!=="url"&&(ir.transaction=mr.description),ir.sampled=String(spanIsSampled(lr)),rr.emit&&rr.emit("createDsc",ir),ir}function applyScopeDataToEvent(tr,rr){const{fingerprint:ir,span:lr,breadcrumbs:dr,sdkProcessingMetadata:fr}=rr;applyDataToEvent(tr,rr),lr&&applySpanToEvent(tr,lr),applyFingerprintToEvent(tr,ir),applyBreadcrumbsToEvent(tr,dr),applySdkMetadataToEvent(tr,fr)}function mergeScopeData(tr,rr){const{extra:ir,tags:lr,user:dr,contexts:fr,level:hr,sdkProcessingMetadata:mr,breadcrumbs:gr,fingerprint:yr,eventProcessors:_r,attachments:br,propagationContext:vr,transactionName:wr,span:xr}=rr;mergeAndOverwriteScopeData(tr,"extra",ir),mergeAndOverwriteScopeData(tr,"tags",lr),mergeAndOverwriteScopeData(tr,"user",dr),mergeAndOverwriteScopeData(tr,"contexts",fr),mergeAndOverwriteScopeData(tr,"sdkProcessingMetadata",mr),hr&&(tr.level=hr),wr&&(tr.transactionName=wr),xr&&(tr.span=xr),gr.length&&(tr.breadcrumbs=[...tr.breadcrumbs,...gr]),yr.length&&(tr.fingerprint=[...tr.fingerprint,...yr]),_r.length&&(tr.eventProcessors=[...tr.eventProcessors,..._r]),br.length&&(tr.attachments=[...tr.attachments,...br]),tr.propagationContext={...tr.propagationContext,...vr}}function mergeAndOverwriteScopeData(tr,rr,ir){if(ir&&Object.keys(ir).length){tr[rr]={...tr[rr]};for(const lr in ir)Object.prototype.hasOwnProperty.call(ir,lr)&&(tr[rr][lr]=ir[lr])}}function applyDataToEvent(tr,rr){const{extra:ir,tags:lr,user:dr,contexts:fr,level:hr,transactionName:mr}=rr,gr=dropUndefinedKeys(ir);gr&&Object.keys(gr).length&&(tr.extra={...gr,...tr.extra});const yr=dropUndefinedKeys(lr);yr&&Object.keys(yr).length&&(tr.tags={...yr,...tr.tags});const _r=dropUndefinedKeys(dr);_r&&Object.keys(_r).length&&(tr.user={..._r,...tr.user});const br=dropUndefinedKeys(fr);br&&Object.keys(br).length&&(tr.contexts={...br,...tr.contexts}),hr&&(tr.level=hr),mr&&(tr.transaction=mr)}function applyBreadcrumbsToEvent(tr,rr){const ir=[...tr.breadcrumbs||[],...rr];tr.breadcrumbs=ir.length?ir:void 0}function applySdkMetadataToEvent(tr,rr){tr.sdkProcessingMetadata={...tr.sdkProcessingMetadata,...rr}}function applySpanToEvent(tr,rr){tr.contexts={trace:spanToTraceContext(rr),...tr.contexts};const ir=getRootSpan(rr);if(ir){tr.sdkProcessingMetadata={dynamicSamplingContext:getDynamicSamplingContextFromSpan(rr),...tr.sdkProcessingMetadata};const lr=spanToJSON(ir).description;lr&&(tr.tags={transaction:lr,...tr.tags})}}function applyFingerprintToEvent(tr,rr){tr.fingerprint=tr.fingerprint?arrayify(tr.fingerprint):[],rr&&(tr.fingerprint=tr.fingerprint.concat(rr)),tr.fingerprint&&!tr.fingerprint.length&&delete tr.fingerprint}const DEFAULT_MAX_BREADCRUMBS=100;let globalScope;class Scope{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext=generatePropagationContext()}static clone(rr){return rr?rr.clone():new Scope}clone(){const rr=new Scope;return rr._breadcrumbs=[...this._breadcrumbs],rr._tags={...this._tags},rr._extra={...this._extra},rr._contexts={...this._contexts},rr._user=this._user,rr._level=this._level,rr._span=this._span,rr._session=this._session,rr._transactionName=this._transactionName,rr._fingerprint=this._fingerprint,rr._eventProcessors=[...this._eventProcessors],rr._requestSession=this._requestSession,rr._attachments=[...this._attachments],rr._sdkProcessingMetadata={...this._sdkProcessingMetadata},rr._propagationContext={...this._propagationContext},rr._client=this._client,rr}setClient(rr){this._client=rr}getClient(){return this._client}addScopeListener(rr){this._scopeListeners.push(rr)}addEventProcessor(rr){return this._eventProcessors.push(rr),this}setUser(rr){return this._user=rr||{email:void 0,id:void 0,ip_address:void 0,segment:void 0,username:void 0},this._session&&updateSession(this._session,{user:rr}),this._notifyScopeListeners(),this}getUser(){return this._user}getRequestSession(){return this._requestSession}setRequestSession(rr){return this._requestSession=rr,this}setTags(rr){return this._tags={...this._tags,...rr},this._notifyScopeListeners(),this}setTag(rr,ir){return this._tags={...this._tags,[rr]:ir},this._notifyScopeListeners(),this}setExtras(rr){return this._extra={...this._extra,...rr},this._notifyScopeListeners(),this}setExtra(rr,ir){return this._extra={...this._extra,[rr]:ir},this._notifyScopeListeners(),this}setFingerprint(rr){return this._fingerprint=rr,this._notifyScopeListeners(),this}setLevel(rr){return this._level=rr,this._notifyScopeListeners(),this}setTransactionName(rr){return this._transactionName=rr,this._notifyScopeListeners(),this}setContext(rr,ir){return ir===null?delete this._contexts[rr]:this._contexts[rr]=ir,this._notifyScopeListeners(),this}setSpan(rr){return this._span=rr,this._notifyScopeListeners(),this}getSpan(){return this._span}getTransaction(){const rr=this._span;return rr&&rr.transaction}setSession(rr){return rr?this._session=rr:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(rr){if(!rr)return this;const ir=typeof rr=="function"?rr(this):rr;if(ir instanceof Scope){const lr=ir.getScopeData();this._tags={...this._tags,...lr.tags},this._extra={...this._extra,...lr.extra},this._contexts={...this._contexts,...lr.contexts},lr.user&&Object.keys(lr.user).length&&(this._user=lr.user),lr.level&&(this._level=lr.level),lr.fingerprint.length&&(this._fingerprint=lr.fingerprint),ir.getRequestSession()&&(this._requestSession=ir.getRequestSession()),lr.propagationContext&&(this._propagationContext=lr.propagationContext)}else if(isPlainObject(ir)){const lr=rr;this._tags={...this._tags,...lr.tags},this._extra={...this._extra,...lr.extra},this._contexts={...this._contexts,...lr.contexts},lr.user&&(this._user=lr.user),lr.level&&(this._level=lr.level),lr.fingerprint&&(this._fingerprint=lr.fingerprint),lr.requestSession&&(this._requestSession=lr.requestSession),lr.propagationContext&&(this._propagationContext=lr.propagationContext)}return this}clear(){return this._breadcrumbs=[],this._tags={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._requestSession=void 0,this._span=void 0,this._session=void 0,this._notifyScopeListeners(),this._attachments=[],this._propagationContext=generatePropagationContext(),this}addBreadcrumb(rr,ir){const lr=typeof ir=="number"?ir:DEFAULT_MAX_BREADCRUMBS;if(lr<=0)return this;const dr={timestamp:dateTimestampInSeconds(),...rr},fr=this._breadcrumbs;return fr.push(dr),this._breadcrumbs=fr.length>lr?fr.slice(-lr):fr,this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(rr){return this._attachments.push(rr),this}getAttachments(){return this.getScopeData().attachments}clearAttachments(){return this._attachments=[],this}getScopeData(){const{_breadcrumbs:rr,_attachments:ir,_contexts:lr,_tags:dr,_extra:fr,_user:hr,_level:mr,_fingerprint:gr,_eventProcessors:yr,_propagationContext:_r,_sdkProcessingMetadata:br,_transactionName:vr,_span:wr}=this;return{breadcrumbs:rr,attachments:ir,contexts:lr,tags:dr,extra:fr,user:hr,level:mr,fingerprint:gr||[],eventProcessors:yr,propagationContext:_r,sdkProcessingMetadata:br,transactionName:vr,span:wr}}applyToEvent(rr,ir={},lr=[]){applyScopeDataToEvent(rr,this.getScopeData());const dr=[...lr,...getGlobalEventProcessors(),...this._eventProcessors];return notifyEventProcessors(dr,rr,ir)}setSDKProcessingMetadata(rr){return this._sdkProcessingMetadata={...this._sdkProcessingMetadata,...rr},this}setPropagationContext(rr){return this._propagationContext=rr,this}getPropagationContext(){return this._propagationContext}captureException(rr,ir){const lr=ir&&ir.event_id?ir.event_id:uuid4();if(!this._client)return logger$1.warn("No client configured on scope - will not capture exception!"),lr;const dr=new Error("Sentry syntheticException");return this._client.captureException(rr,{originalException:rr,syntheticException:dr,...ir,event_id:lr},this),lr}captureMessage(rr,ir,lr){const dr=lr&&lr.event_id?lr.event_id:uuid4();if(!this._client)return logger$1.warn("No client configured on scope - will not capture message!"),dr;const fr=new Error(rr);return this._client.captureMessage(rr,ir,{originalException:rr,syntheticException:fr,...lr,event_id:dr},this),dr}captureEvent(rr,ir){const lr=ir&&ir.event_id?ir.event_id:uuid4();return this._client?(this._client.captureEvent(rr,{...ir,event_id:lr},this),lr):(logger$1.warn("No client configured on scope - will not capture event!"),lr)}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach(rr=>{rr(this)}),this._notifyingListeners=!1)}}function getGlobalScope(){return globalScope||(globalScope=new Scope),globalScope}function generatePropagationContext(){return{traceId:uuid4(),spanId:uuid4().substring(16)}}const SDK_VERSION="7.120.4",API_VERSION=parseFloat(SDK_VERSION),DEFAULT_BREADCRUMBS=100;class Hub{constructor(rr,ir,lr,dr=API_VERSION){this._version=dr;let fr;ir?fr=ir:(fr=new Scope,fr.setClient(rr));let hr;lr?hr=lr:(hr=new Scope,hr.setClient(rr)),this._stack=[{scope:fr}],rr&&this.bindClient(rr),this._isolationScope=hr}isOlderThan(rr){return this._version<rr}bindClient(rr){const ir=this.getStackTop();ir.client=rr,ir.scope.setClient(rr),rr&&rr.setupIntegrations&&rr.setupIntegrations()}pushScope(){const rr=this.getScope().clone();return this.getStack().push({client:this.getClient(),scope:rr}),rr}popScope(){return this.getStack().length<=1?!1:!!this.getStack().pop()}withScope(rr){const ir=this.pushScope();let lr;try{lr=rr(ir)}catch(dr){throw this.popScope(),dr}return isThenable(lr)?lr.then(dr=>(this.popScope(),dr),dr=>{throw this.popScope(),dr}):(this.popScope(),lr)}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this._isolationScope}getStack(){return this._stack}getStackTop(){return this._stack[this._stack.length-1]}captureException(rr,ir){const lr=this._lastEventId=ir&&ir.event_id?ir.event_id:uuid4(),dr=new Error("Sentry syntheticException");return this.getScope().captureException(rr,{originalException:rr,syntheticException:dr,...ir,event_id:lr}),lr}captureMessage(rr,ir,lr){const dr=this._lastEventId=lr&&lr.event_id?lr.event_id:uuid4(),fr=new Error(rr);return this.getScope().captureMessage(rr,ir,{originalException:rr,syntheticException:fr,...lr,event_id:dr}),dr}captureEvent(rr,ir){const lr=ir&&ir.event_id?ir.event_id:uuid4();return rr.type||(this._lastEventId=lr),this.getScope().captureEvent(rr,{...ir,event_id:lr}),lr}lastEventId(){return this._lastEventId}addBreadcrumb(rr,ir){const{scope:lr,client:dr}=this.getStackTop();if(!dr)return;const{beforeBreadcrumb:fr=null,maxBreadcrumbs:hr=DEFAULT_BREADCRUMBS}=dr.getOptions&&dr.getOptions()||{};if(hr<=0)return;const gr={timestamp:dateTimestampInSeconds(),...rr},yr=fr?consoleSandbox(()=>fr(gr,ir)):gr;yr!==null&&(dr.emit&&dr.emit("beforeAddBreadcrumb",yr,ir),lr.addBreadcrumb(yr,hr))}setUser(rr){this.getScope().setUser(rr),this.getIsolationScope().setUser(rr)}setTags(rr){this.getScope().setTags(rr),this.getIsolationScope().setTags(rr)}setExtras(rr){this.getScope().setExtras(rr),this.getIsolationScope().setExtras(rr)}setTag(rr,ir){this.getScope().setTag(rr,ir),this.getIsolationScope().setTag(rr,ir)}setExtra(rr,ir){this.getScope().setExtra(rr,ir),this.getIsolationScope().setExtra(rr,ir)}setContext(rr,ir){this.getScope().setContext(rr,ir),this.getIsolationScope().setContext(rr,ir)}configureScope(rr){const{scope:ir,client:lr}=this.getStackTop();lr&&rr(ir)}run(rr){const ir=makeMain(this);try{rr(this)}finally{makeMain(ir)}}getIntegration(rr){const ir=this.getClient();if(!ir)return null;try{return ir.getIntegration(rr)}catch{return DEBUG_BUILD&&logger$1.warn(`Cannot retrieve integration ${rr.id} from the current Hub`),null}}startTransaction(rr,ir){const lr=this._callExtensionMethod("startTransaction",rr,ir);return DEBUG_BUILD&&!lr&&(this.getClient()?logger$1.warn(`Tracing extension 'startTransaction' has not been added. Call 'addTracingExtensions' before calling 'init':
852
852
  Sentry.addTracingExtensions();
853
853
  Sentry.init({...});
854
854
  `):logger$1.warn("Tracing extension 'startTransaction' is missing. You should 'init' the SDK before calling 'startTransaction'")),lr}traceHeaders(){return this._callExtensionMethod("traceHeaders")}captureSession(rr=!1){if(rr)return this.endSession();this._sendSessionUpdate()}endSession(){const ir=this.getStackTop().scope,lr=ir.getSession();lr&&closeSession(lr),this._sendSessionUpdate(),ir.setSession()}startSession(rr){const{scope:ir,client:lr}=this.getStackTop(),{release:dr,environment:fr=DEFAULT_ENVIRONMENT}=lr&&lr.getOptions()||{},{userAgent:hr}=GLOBAL_OBJ.navigator||{},mr=makeSession({release:dr,environment:fr,user:ir.getUser(),...hr&&{userAgent:hr},...rr}),gr=ir.getSession&&ir.getSession();return gr&&gr.status==="ok"&&updateSession(gr,{status:"exited"}),this.endSession(),ir.setSession(mr),mr}shouldSendDefaultPii(){const rr=this.getClient(),ir=rr&&rr.getOptions();return!!(ir&&ir.sendDefaultPii)}_sendSessionUpdate(){const{scope:rr,client:ir}=this.getStackTop(),lr=rr.getSession();lr&&ir&&ir.captureSession&&ir.captureSession(lr)}_callExtensionMethod(rr,...ir){const dr=getMainCarrier().__SENTRY__;if(dr&&dr.extensions&&typeof dr.extensions[rr]=="function")return dr.extensions[rr].apply(this,ir);DEBUG_BUILD&&logger$1.warn(`Extension method ${rr} couldn't be found, doing nothing.`)}}function getMainCarrier(){return GLOBAL_OBJ.__SENTRY__=GLOBAL_OBJ.__SENTRY__||{extensions:{},hub:void 0},GLOBAL_OBJ}function makeMain(tr){const rr=getMainCarrier(),ir=getHubFromCarrier(rr);return setHubOnCarrier(rr,tr),ir}function getCurrentHub(){const tr=getMainCarrier();if(tr.__SENTRY__&&tr.__SENTRY__.acs){const rr=tr.__SENTRY__.acs.getCurrentHub();if(rr)return rr}return getGlobalHub(tr)}function getIsolationScope(){return getCurrentHub().getIsolationScope()}function getGlobalHub(tr=getMainCarrier()){return(!hasHubOnCarrier(tr)||getHubFromCarrier(tr).isOlderThan(API_VERSION))&&setHubOnCarrier(tr,new Hub),getHubFromCarrier(tr)}function runWithAsyncContext(tr,rr={}){const ir=getMainCarrier();return ir.__SENTRY__&&ir.__SENTRY__.acs?ir.__SENTRY__.acs.runWithAsyncContext(tr,rr):tr()}function hasHubOnCarrier(tr){return!!(tr&&tr.__SENTRY__&&tr.__SENTRY__.hub)}function getHubFromCarrier(tr){return getGlobalSingleton("hub",()=>new Hub,tr)}function setHubOnCarrier(tr,rr){if(!tr)return!1;const ir=tr.__SENTRY__=tr.__SENTRY__||{};return ir.hub=rr,!0}function useSetSentryUser(){const tr=useUser();useEffect(()=>{var ir;let rr=null;if(tr){const{credential:lr,...dr}=tr;rr={id:dr.did,username:(ir=dr.ens)==null?void 0:ir.name,...dr}}setUser(rr)},[tr])}function ClearStorageModal(){const tr=usePHModal(),rr=(tr==null?void 0:tr.type)==="clearStorage",{t:ir}=useTranslation();return jsx$1(ConnectConfirmationModal,{open:rr,header:ir("modals.clearStorage.title"),title:ir("modals.clearStorage.title"),body:ir("modals.connectSettings.clearStorage.confirmation.body"),cancelLabel:ir("common.cancel"),continueLabel:ir("modals.connectSettings.clearStorage.confirmation.clearButton"),onCancel:()=>showPHModal({type:"settings"}),onContinue:async()=>{try{await clearReactorStorage()}catch(lr){console.error(lr)}finally{setSelectedDrive(void 0),setSelectedNode(void 0),closePHModal()}},onOpenChange:lr=>{if(!lr)return closePHModal()}})}const CookiesPolicyModal=()=>{const tr=usePHModal(),rr=(tr==null?void 0:tr.type)==="cookiesPolicy",{t:ir}=useTranslation();return jsx$1(ReadRequiredModal,{open:rr,header:ir("modals.cookiesPolicy.title"),body:jsx$1(Trans,{i18nKey:"modals.cookiesPolicy.body",components:{subtitle:jsx$1("h2",{className:"mb-4 text-lg font-bold"}),p:jsx$1("p",{className:"mb-2"}),list:jsx$1("ul",{className:"mb-4 list-disc pl-6"}),bullet:jsx$1("li",{})}}),bodyProps:{className:"text-left"},closeLabel:"Close",onContinue:()=>closePHModal(),overlayProps:{style:{zIndex:1e4}}})},CreateDocumentModal=()=>{const tr=usePHModal(),rr=(tr==null?void 0:tr.type)==="createDocument",ir=rr?tr.documentType:void 0,lr=useDocumentModelModuleById(ir),[dr]=useSelectedDrive(),fr=useSelectedFolder(),hr=useSelectedParentFolder();return jsx$1(CreateDocumentModal$1,{open:rr,onContinue:async gr=>{if(closePHModal(),!dr||!lr)return;const yr=await addDocument(dr.header.id,gr||`New ${lr.documentModel.name}`,lr.documentModel.id,(fr==null?void 0:fr.id)??(hr==null?void 0:hr.id));setSelectedNode(yr)},onOpenChange:gr=>{if(!gr)return closePHModal()}})};let getRandomValues;const rnds8=new Uint8Array(16);function rng(){if(!getRandomValues&&(getRandomValues=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!getRandomValues))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return getRandomValues(rnds8)}const byteToHex=[];for(let tr=0;tr<256;++tr)byteToHex.push((tr+256).toString(16).slice(1));function unsafeStringify(tr,rr=0){return byteToHex[tr[rr+0]]+byteToHex[tr[rr+1]]+byteToHex[tr[rr+2]]+byteToHex[tr[rr+3]]+"-"+byteToHex[tr[rr+4]]+byteToHex[tr[rr+5]]+"-"+byteToHex[tr[rr+6]]+byteToHex[tr[rr+7]]+"-"+byteToHex[tr[rr+8]]+byteToHex[tr[rr+9]]+"-"+byteToHex[tr[rr+10]]+byteToHex[tr[rr+11]]+byteToHex[tr[rr+12]]+byteToHex[tr[rr+13]]+byteToHex[tr[rr+14]]+byteToHex[tr[rr+15]]}const randomUUID=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),native={randomUUID};function v4(tr,rr,ir){if(native.randomUUID&&!tr)return native.randomUUID();tr=tr||{};const lr=tr.random||(tr.rng||rng)();return lr[6]=lr[6]&15|64,lr[8]=lr[8]&63|128,unsafeStringify(lr)}const DebugSettingsModal=()=>{var zr;const tr=usePHModal(),rr=(tr==null?void 0:tr.type)==="debugSettings",ir=localStorage.getItem("AUTO_REGISTER_PULL_RESPONDER")!=="false",[lr,dr]=useState(connectConfig.appVersion),[fr,hr]=useState({label:serviceWorkerManager.debug?"Enabled":"Disabled",value:serviceWorkerManager.debug}),[mr,gr]=useState(),[yr,_r]=useState(null),[br,vr]=useState(""),[wr,xr]=useState({label:ir?"Enabled":"Disabled",value:ir?"true":"false"}),Sr=useDrives();useEffect(()=>{serviceWorkerManager.setDebug(fr.value)},[fr]);const Ar=((zr=Sr==null?void 0:Sr.find(Fr=>Fr.header.id===mr))==null?void 0:zr.state.local.triggers)||[],Mr=!mr||br==="",Or=async()=>{!yr||!mr||(await removeTrigger(mr,yr.value),_r(null))},$r=async(Fr=!1)=>{if(!(!br||br===""||!mr)){if(!Fr){const Jr=await registerNewPullResponderTrigger(mr,br,{pullInterval:3e3});if(!Jr)return;await addTrigger(mr,Jr),vr("");return}await addTrigger(mr,{id:`invalid-trigger-${v4()}`,type:"PullResponder",data:{interval:"3000",listenerId:`ivalid-listener-${v4()}`,url:br}}),vr("")}},Dr=Fr=>{xr(Fr),localStorage.setItem("AUTO_REGISTER_PULL_RESPONDER",Fr.value)};return jsx$1(Modal,{open:rr,onOpenChange:Fr=>{if(!Fr)return closePHModal()},contentProps:{className:"rounded-2xl"},children:jsxs("div",{className:"w-[700px] rounded-2xl p-6",children:[jsxs("div",{className:"mb-6 flex justify-between",children:[jsx$1("div",{className:"text-xl font-bold",children:"Debug Tools"}),jsx$1("button",{id:"close-modal",onClick:()=>closePHModal(),children:jsx$1(Icon,{name:"Xmark",size:28})})]}),jsxs("div",{className:"flex text-sm font-bold",children:[jsx$1(Icon,{name:"Ring",size:22}),jsxs("span",{className:"ml-2",children:["App Version: ",connectConfig.appVersion]})]}),jsxs("div",{className:"mt-4 flex text-sm font-bold",children:[jsx$1(Icon,{name:"Hdd",size:22}),jsx$1("span",{className:"ml-2",children:"Drive Tools:"})]}),jsxs("div",{children:[jsx$1("label",{htmlFor:"selectedDrive",className:"text-xs",children:"Selected Drive:"}),jsx$1(Combobox,{id:"selectedDrive",onChange:Fr=>{if(!Fr||typeof Fr!="object"||!("value"in Fr)){gr(void 0),_r(null);return}gr(Fr.value),_r(null)},options:Sr==null?void 0:Sr.map(Fr=>({label:Fr.header.name,value:Fr.header.id}))})]}),jsx$1("div",{className:"mt-2 flex items-end justify-between pl-4",children:jsxs("div",{className:"w-[400px]",children:[jsx$1("label",{htmlFor:"autoRegisterPullResponder",className:"text-xs",children:"Auto register pull responder:"}),jsx$1(Combobox,{id:"autoRegisterPullResponder",onChange:Fr=>{Dr(Fr)},value:wr,options:[{label:"Enabled",value:"true"},{label:"Disabled",value:"false"}]})]})}),jsxs("div",{className:"mt-2 flex items-end justify-between pl-4",children:[jsxs("div",{className:"w-[400px]",children:[jsx$1("label",{htmlFor:"driveTrigger",className:"text-xs",children:"Drive trigger:"}),jsx$1(Combobox,{id:"driveTrigger",onChange:Fr=>{_r(Fr)},value:yr,options:Ar.map(Fr=>({label:`${Fr.id} - ${Fr.type}`,value:Fr.id}))})]}),jsx$1("div",{children:jsx$1(Button$1,{onClick:Or,color:yr?"red":"light",disabled:!yr,size:"small",children:"Remove Trigger"})})]}),jsxs("div",{className:"mt-2 flex items-end justify-between pl-4",children:[jsxs("div",{className:"w-[400px]",children:[jsx$1("label",{htmlFor:"driveUrl",className:"text-xs",children:"Add drive trigger:"}),jsx$1(FormInput,{containerClassName:"p-1 bg-white border border-gray-200 rounded-md text-sm",inputClassName:"text-xs font-normal",id:"driveUrl",icon:jsx$1("div",{className:"flex h-full items-center text-xs",children:"URL:"}),value:br,onChange:Fr=>vr(Fr.target.value)})]}),jsxs("div",{className:"mb-1 flex items-center justify-center",children:[jsx$1(Button$1,{className:"mr-2",color:Mr?"light":"blue",size:"small",disabled:Mr,onClick:()=>$r(),children:"Add Trigger"}),jsx$1(Button$1,{color:Mr?"light":"red",size:"small",disabled:Mr,onClick:()=>$r(!0),children:"Add Invalid Trigger"})]})]}),jsxs("div",{className:"mt-4 flex text-sm font-bold",children:[jsx$1(Icon,{name:"Gear",size:22}),jsx$1("span",{className:"ml-2",children:"Service Worker Tools:"})]}),jsx$1("div",{className:"mt-2 flex items-end justify-between pl-4",children:jsxs("div",{className:"w-[400px]",children:[jsx$1("label",{htmlFor:"serviceWorkerDebugMode",className:"text-xs",children:"Service Worker Debug Mode:"}),jsx$1(Combobox,{id:"serviceWorkerDebugMode",onChange:Fr=>{hr(Fr)},value:fr,options:[{label:"Enabled",value:!0},{label:"Disabled",value:!1}]})]})}),jsxs("div",{className:"mt-2 flex items-end justify-between pl-4",children:[jsxs("div",{className:"w-[400px]",children:[jsx$1("label",{htmlFor:"appVersion",className:"text-xs",children:"Set invalid app version:"}),jsx$1(FormInput,{containerClassName:"p-1 bg-white border border-gray-200 rounded-md text-sm",inputClassName:"text-xs font-normal",id:"appVersion",icon:jsx$1("div",{className:"flex h-full items-center text-xs",children:"Version:"}),value:lr,onChange:Fr=>dr(Fr.target.value)})]}),jsx$1("div",{className:"mb-1 flex items-center justify-center",children:jsx$1(Button$1,{color:lr===""?"light":"red",size:"small",disabled:lr==="",onClick:()=>{serviceWorkerManager.sendMessage({type:"SET_APP_VERSION",version:lr}),dr("")},children:"Add Invalid App Version"})})]})]})})},DeleteDriveModal=()=>{const tr=usePHModal(),rr=(tr==null?void 0:tr.type)==="deleteDrive",ir=rr?tr.driveId:void 0,[lr]=useDriveById(ir),dr=useDrives();if(!lr)return null;async function fr(){ir&&(await deleteDrive(ir),setSelectedDrive(dr==null?void 0:dr[0]),closePHModal(),toast$1(hr("notifications.deleteDriveSuccess"),{type:"connect-deleted"}))}const{t:hr}=useTranslation();return jsx$1(ConnectDeleteDriveModal,{open:rr,driveName:lr.header.name,onCancel:closePHModal,header:hr("modals.deleteDrive.title",{label:lr.header.name}),body:hr("modals.deleteDrive.body"),inputPlaceholder:hr("modals.deleteDrive.inputPlaceholder"),cancelLabel:hr("common.cancel"),continueLabel:hr("common.delete"),onContinue:()=>fr(),onOpenChange:mr=>{if(!mr)return closePHModal()}})},DeleteItemModal=()=>{const tr=usePHModal(),rr=(tr==null?void 0:tr.type)==="deleteItem",ir=rr?tr.id:void 0,{t:lr}=useTranslation(),dr=useNodeName(ir),fr=useNodeKind(ir),hr=useSelectedDriveId(),mr=useSelectedParentFolder();async function gr(){if(!hr||!ir)return;closePHModal();const yr=fr==="FOLDER"?"notifications.deleteFolderSuccess":"notifications.fileDeleteSuccess";await deleteNode(hr,ir),setSelectedNode(mr),toast$1(lr(yr),{type:"connect-deleted"})}return jsx$1(ConnectDeleteItemModal,{open:rr,onDelete:()=>gr(),onCancel:()=>closePHModal(),header:lr(`modals.deleteItem.${fr==null?void 0:fr.toLowerCase()}.header`,{item:dr}),body:lr(`modals.deleteItem.${fr==null?void 0:fr.toLowerCase()}.body`),cancelLabel:lr("common.cancel"),deleteLabel:lr("common.delete")})},DisclaimerModal=()=>{const tr=usePHModal(),rr=(tr==null?void 0:tr.type)==="disclaimer",{t:ir}=useTranslation();return jsx$1(ReadRequiredModal,{open:rr,header:ir("modals.disclaimer.title"),body:ir("modals.disclaimer.body"),closeLabel:"Close",onContinue:()=>closePHModal()})};function DriveSettingsModal(){const tr=usePHModal(),rr=(tr==null?void 0:tr.type)==="driveSettings",ir=rr?tr.driveId:void 0,[lr]=useDriveById(ir),dr=useDriveSharingType(ir),fr=useDriveAvailableOffline(ir);if(!ir||!lr)return null;async function hr(yr,_r){await renameDrive(yr.header.id,_r)}async function mr(yr,_r){await setDriveSharingType(yr.header.id,_r)}async function gr(yr,_r){await setDriveAvailableOffline(yr.header.id,_r)}return jsx$1(DriveSettingsModal$1,{drive:lr,sharingType:dr??"LOCAL",availableOffline:fr,open:rr,onRenameDrive:hr,onDeleteDrive:()=>showPHModal({type:"deleteDrive",driveId:ir}),onChangeAvailableOffline:gr,onChangeSharingType:mr,onOpenChange:yr=>{if(!yr)return closePHModal()}})}function ExportDocumentWithErrorsModal(){const tr=usePHModal(),rr=(tr==null?void 0:tr.type)==="exportDocumentWithErrors",ir=rr?tr.documentId:void 0,[lr]=useDocumentById(ir),{t:dr}=useTranslation();if(!lr)return null;const fr=validateDocument(lr);return jsx$1(ConnectConfirmationModal,{header:dr("modals.exportDocumentWithErrors.title"),title:dr("modals.exportDocumentWithErrors.title"),body:jsxs("div",{children:[jsx$1("p",{children:dr("modals.exportDocumentWithErrors.body")}),jsx$1("ul",{className:"mt-4 flex list-disc flex-col items-start px-4 text-xs",children:fr.map((hr,mr)=>jsx$1("li",{children:hr.message},mr))})]}),cancelLabel:dr("common.cancel"),continueLabel:dr("common.export"),onCancel:()=>closePHModal(),onContinue:async()=>{try{await exportFile(lr)}catch(hr){console.error(hr)}finally{closePHModal()}},open:rr,onOpenChange:hr=>{if(!hr)return closePHModal()}})}const About=()=>jsx$1(About$1,{packageJson,phCliVersion:typeof connectConfig.phCliVersion=="string"?connectConfig.phCliVersion:void 0}),DangerZone=({onRefresh:tr})=>{useTranslation();const rr=useDrives();return jsx$1(DangerZone$1,{drives:rr??[],onDeleteDrive:async dr=>{await deleteDrive(dr.header.id),setSelectedDrive(void 0)},onClearStorage:()=>{showPHModal({type:"clearStorage"})}})},documentModelEditorOptions=[{label:"V1",value:"document-model-editor"},{label:"V2",value:"document-model-editor-v2"}],DefaultEditor=()=>{const[tr,rr]=useState(documentModelEditorOptions[1]),ir=useCallback(lr=>{const dr=documentModelEditorOptions.find(fr=>fr.value==lr);dr&&rr(dr)},[]);return jsx$1(DefaultEditor$1,{documentModelEditor:tr.value,setDocumentModelEditor:ir,documentModelEditorOptions})};async function getHMRModule(){if(import.meta.hot)return import.meta.hot;try{return(await __vitePreload(()=>import("../hmr.js"),[],import.meta.url)).hmr}catch{return}}async function addExternalPackage(tr){const rr=await getHMRModule();if(!rr)throw new Error("HMR not available.");return new Promise(ir=>{function lr(dr){tr===dr.name&&(ir(),rr==null||rr.off("studio:external-package-added",lr))}rr.on("studio:external-package-added",lr),rr.send("studio:add-external-package",{name:tr})})}async function removeExternalPackage(tr){const rr=await getHMRModule();if(!rr)throw new Error("HMR not available.");return new Promise(ir=>{function lr(dr){tr===dr.name&&(ir(),rr==null||rr.off("studio:external-package-removed",lr))}rr.on("studio:external-package-removed",lr),rr.send("studio:remove-external-package",{name:tr})})}function useSubscribeToVetraPackages(){const tr=useRef();useEffect(()=>{const rr=async lr=>{const dr=window.vetraPackages||[],gr=(await __vitePreload(()=>import(`${lr.url}?t=${lr.timestamp}`),[],import.meta.url)).default.map(convertLegacyLibToVetraPackage),_r=[...dr.filter(br=>br.id==="powerhouse/common"),...gr];setVetraPackages(_r)};async function ir(){const lr=await getHMRModule();tr.current=lr,lr==null||lr.on("studio:external-packages-updated",rr)}return ir().catch(logger$6.error),()=>{var lr;(lr=tr.current)==null||lr.off("studio:external-packages-updated",rr)}},[])}const PH_PACKAGES=[{packageName:"@sky-ph/atlas",version:"latest",provider:"npm",url:"https://www.npmjs.com/package/@sky-ph/atlas"}],LOCAL_REACTOR_VALUE="local-reactor",LOCAL_REACTOR_LABEL="Local Reactor",PackageManager=()=>{const tr=useVetraPackages(),rr=useDrives(),[ir,lr]=useState(""),dr=useMemo(()=>rr==null?void 0:rr.reduce((yr,_r)=>{var xr;const br=_r.state.local.triggers.find(Sr=>{var Ar;return(Ar=Sr.data)==null?void 0:Ar.url});if(!((xr=br==null?void 0:br.data)!=null&&xr.url))return yr;const vr=br.data.url,wr=_r.state.global.name;return yr.push({value:vr,label:wr,disabled:!0}),yr},[{value:LOCAL_REACTOR_VALUE,label:LOCAL_REACTOR_LABEL,disabled:!1}]),[rr]);useEffect(()=>{lr(yr=>{const _r=dr==null?void 0:dr.find(br=>!br.disabled);return yr&&(dr!=null&&dr.find(br=>br.value===yr))?yr:(_r==null?void 0:_r.value)??""})},[ir,dr]);const fr=tr==null?void 0:tr.map(yr=>makeVetraPackageManifest(yr)),hr=useCallback(yr=>lr(yr??""),[]),mr=useCallback(yr=>{if(ir!==LOCAL_REACTOR_VALUE)throw new Error("Cannot install external package on a remote reactor");return addExternalPackage(yr)},[ir]),gr=useCallback(yr=>{if(ir!==LOCAL_REACTOR_VALUE)throw new Error("Cannot delete external package on a remote reactor");return removeExternalPackage(yr)},[ir]);return jsx$1(PackageManager$1,{mutable:!0,reactorOptions:dr??[],reactor:ir,packages:(fr==null?void 0:fr.map(yr=>({id:yr.id,name:yr.name,description:yr.description,category:yr.category,publisher:yr.author.name,publisherUrl:yr.author.website??"",modules:Object.values(yr.modules).flatMap(_r=>_r.map(br=>br.name)),removable:!0})))??[],onReactorChange:hr,onInstall:mr,onUninstall:gr,packageOptions:PH_PACKAGES})},SettingsModal=()=>{const tr=usePHModal(),rr=(tr==null?void 0:tr.type)==="settings";function ir(){window.location.reload()}const lr=useMemo(()=>[{id:"package-manager",icon:jsx$1(Icon,{name:"PackageManager",size:12}),label:"Package Manager",content:PackageManager},{id:"default-editors",icon:jsx$1(Icon,{name:"Edit",size:12}),label:"Default Editors",content:DefaultEditor},{id:"danger-zone",icon:jsx$1(Icon,{name:"Danger",size:12,className:"text-red-900"}),label:jsx$1("span",{className:"text-red-900",children:"Danger Zone"}),content:()=>jsx$1(DangerZone,{onRefresh:ir})},{id:"about",icon:jsx$1(Icon,{name:"QuestionSquare",size:12}),label:"About",content:About}],[ir]);return jsx$1(SettingsModal$1,{open:rr,title:t("modals.connectSettings.title"),onOpenChange:dr=>{if(!dr)return closePHModal()},tabs:lr})},UpgradeDriveModal=()=>{const tr=usePHModal(),rr=(tr==null?void 0:tr.type)==="upgradeDrive",ir=rr?tr.driveId:void 0,{t:lr}=useTranslation();return jsx$1(ConnectUpgradeDriveModal,{open:rr,onContinue:()=>{console.log("Upgrade drive: ",ir),closePHModal()},header:lr("modals.upgradeDrive.header"),body:lr("modals.upgradeDrive.body"),cancelLabel:lr("common.cancel"),continueLabel:lr("common.continue"),onOpenChange:fr=>{if(!fr)return closePHModal()}})};function ModalsContainer(){return jsxs(Fragment,{children:[jsx$1(AddDriveModal,{}),jsx$1(ClearStorageModal,{}),jsx$1(CookiesPolicyModal,{}),jsx$1(CreateDocumentModal,{}),jsx$1(DebugSettingsModal,{}),jsx$1(DeleteDriveModal,{}),jsx$1(DeleteItemModal,{}),jsx$1(DisclaimerModal,{}),jsx$1(DriveSettingsModal,{}),jsx$1(ExportDocumentWithErrorsModal,{}),jsx$1(SettingsModal,{}),jsx$1(UpgradeDriveModal,{})]})}const ReloadConnectToast=()=>{const{t:tr}=useTranslation();return jsxs("div",{children:[jsx$1("p",{className:"font-medium",children:tr("notifications.reloadApp")}),jsxs("button",{onClick:()=>location.reload(),className:"underline decoration-solid underline-offset-2",children:[tr("common.reloadConnect")," 🔄"]})]})},currentVersion=window.__VITE_ENVS.APP_VERSION;window.navigator.appVersion.includes("Mac");const urlBranchMap={"staging/makerdao":"deployments/staging/makerdao","staging/arbitrum":"arb-ltip","staging/powerhouse":"staging",makerdao:"deployments/makerdao",arbitrum:"deployments/arbitrum",arbgrants:"deployments/arbitrum",localhost:"develop"},getGithubLinkFromUrl=()=>{const tr="https://raw.githubusercontent.com/powerhouse-inc/connect",rr=window.location.href,ir=Object.keys(urlBranchMap).find(dr=>rr.includes(dr)),lr=ir?urlBranchMap[ir]:void 0;if(lr)return`${tr}/${lr}/package.json`},fetchLatestVersion=async()=>{const tr=getGithubLinkFromUrl();if(!tr)return;const ir=await(await fetch(tr)).json(),{version:lr}=ir;return lr},isLatestVersion=async()=>{const tr=await fetchLatestVersion();return tr?{isLatest:tr===currentVersion,currentVersion,latestVersion:tr}:null},useCheckLatestVersion=()=>{async function tr(){const rr=await isLatestVersion();if(rr!==null){if(rr.isLatest||rr.currentVersion.includes("-"))return!0;window.__VITE_ENVS.MODE==="development"||connectConfig.studioMode||!connectConfig.warnOutdatedApp?logger$6.warn(`Connect is outdated:
855
855
  Current: ${rr.currentVersion}
856
- Latest: ${rr.latestVersion}`):toast(jsx$1(ReloadConnectToast,{}),{type:"connect-warning",toastId:"outdated-app",autoClose:!1})}}useEffect(()=>{tr().catch(console.error)},[])},logger=childLogger(["sentry"]);let clientStarted=!1;async function getSentry(){return await __vitePreload(()=>import("./index.CYAFrFct.js"),[],import.meta.url)}async function initSentry(){const tr=window.__VITE_ENVS.SENTRY_RELEASE,rr=await getSentry(),ir=[rr.httpClientIntegration(),rr.extraErrorDataIntegration({depth:5}),rr.replayIntegration(),rr.captureConsoleIntegration({levels:["error"]})];connectConfig.sentry.tracing&&ir.push(rr.reactRouterV6BrowserTracingIntegration({useEffect:React__default.useEffect,useLocation,useNavigationType,createRoutesFromChildren,matchRoutes})),rr.init({release:tr,dsn:connectConfig.sentry.dsn,environment:connectConfig.sentry.env,integrations:ir,ignoreErrors:["User is not allowed to create files","User is not allowed to move documents","The user aborted a request."],sendDefaultPii:!0,tracesSampleRate:1,replaysSessionSampleRate:.1,replaysOnErrorSampleRate:1,beforeSend(lr,dr){const fr=dr.originalException;return fr instanceof TypeError&&fr.message.includes("Failed to fetch")&&!navigator.onLine?null:lr}}),clientStarted=!0}async function closeClient(){if(!clientStarted)return;const rr=(await getSentry()).getClient();return rr==null?void 0:rr.close()}function useInitSentry(){const[tr]=useAcceptedCookies(),{analytics:rr}=tr;useEffect(()=>{if(!rr){closeClient().catch(ir=>logger.error(ir));return}clientStarted||!connectConfig.sentry.dsn||connectConfig.sentry.dsn===""||initSentry().catch(ir=>logger.error(ir))},[rr])}const LOADER_DELAY=250,Loader=({delay:tr=LOADER_DELAY})=>{const rr=typeof window>"u",ir=typeof document<"u"&&document.body.getAttribute("data-show-loader")==="true",[lr,dr]=useState(!tr||ir);return useEffect(()=>{const fr=setTimeout(()=>{dr(!0)},tr);return()=>clearTimeout(fr)},[]),jsxs("div",{className:`skeleton-loader absolute inset-0 z-10 flex items-center justify-center ${lr?"":"hidden"}`,children:[jsx$1("div",{className:"animate-pulse overflow-hidden rounded-full shadow-lg",children:jsx$1(AnimatedLoader,{})}),rr?jsx$1("script",{dangerouslySetInnerHTML:{__html:`setTimeout(() => {
856
+ Latest: ${rr.latestVersion}`):toast(jsx$1(ReloadConnectToast,{}),{type:"connect-warning",toastId:"outdated-app",autoClose:!1})}}useEffect(()=>{tr().catch(console.error)},[])},logger=childLogger(["sentry"]);let clientStarted=!1;async function getSentry(){return await __vitePreload(()=>import("./index.B-dgtyfz.js"),[],import.meta.url)}async function initSentry(){const tr=window.__VITE_ENVS.SENTRY_RELEASE,rr=await getSentry(),ir=[rr.httpClientIntegration(),rr.extraErrorDataIntegration({depth:5}),rr.replayIntegration(),rr.captureConsoleIntegration({levels:["error"]})];connectConfig.sentry.tracing&&ir.push(rr.reactRouterV6BrowserTracingIntegration({useEffect:React__default.useEffect,useLocation,useNavigationType,createRoutesFromChildren,matchRoutes})),rr.init({release:tr,dsn:connectConfig.sentry.dsn,environment:connectConfig.sentry.env,integrations:ir,ignoreErrors:["User is not allowed to create files","User is not allowed to move documents","The user aborted a request."],sendDefaultPii:!0,tracesSampleRate:1,replaysSessionSampleRate:.1,replaysOnErrorSampleRate:1,beforeSend(lr,dr){const fr=dr.originalException;return fr instanceof TypeError&&fr.message.includes("Failed to fetch")&&!navigator.onLine?null:lr}}),clientStarted=!0}async function closeClient(){if(!clientStarted)return;const rr=(await getSentry()).getClient();return rr==null?void 0:rr.close()}function useInitSentry(){const[tr]=useAcceptedCookies(),{analytics:rr}=tr;useEffect(()=>{if(!rr){closeClient().catch(ir=>logger.error(ir));return}clientStarted||!connectConfig.sentry.dsn||connectConfig.sentry.dsn===""||initSentry().catch(ir=>logger.error(ir))},[rr])}const LOADER_DELAY=250,Loader=({delay:tr=LOADER_DELAY})=>{const rr=typeof window>"u",ir=typeof document<"u"&&document.body.getAttribute("data-show-loader")==="true",[lr,dr]=useState(!tr||ir);return useEffect(()=>{const fr=setTimeout(()=>{dr(!0)},tr);return()=>clearTimeout(fr)},[]),jsxs("div",{className:`skeleton-loader absolute inset-0 z-10 flex items-center justify-center ${lr?"":"hidden"}`,children:[jsx$1("div",{className:"animate-pulse overflow-hidden rounded-full shadow-lg",children:jsx$1(AnimatedLoader,{})}),rr?jsx$1("script",{dangerouslySetInnerHTML:{__html:`setTimeout(() => {
857
857
  document.querySelector('.skeleton-loader')?.classList.remove('hidden');
858
858
  document.body.setAttribute('data-show-loader', 'true');
859
859
  }, ${tr})`}}):null]})},AppSkeleton=()=>{const tr=typeof window>"u",rr=!tr&&window.location.pathname===getBasePath();return jsxs("div",{className:"flex h-screen",children:[jsx$1(ConnectSidebar,{className:"animate-pulse",onLogin:void 0,onDisconnect:void 0,onClickSettings:void 0,address:void 0}),jsx$1(HomeScreen,{containerClassName:tr||!rr?"hidden home-screen":void 0,children:null}),tr?jsx$1("script",{dangerouslySetInnerHTML:{__html:`
@@ -863,4 +863,4 @@ Latest: ${rr.latestVersion}`):toast(jsx$1(ReloadConnectToast,{}),{type:"connect-
863
863
  if (window.location.pathname === basePath) {
864
864
  document.querySelector('.home-screen')?.classList.remove('hidden')
865
865
  }`}}):null,jsx$1(Loader,{})]})},Load=lazy(async()=>(await createReactor(),{default:({children:tr})=>(useSubscribeToVetraPackages(),useSetSentryUser(),useCheckLatestVersion(),tr)})),AppLoader=()=>jsxs(StrictMode,{children:[jsx$1(Suspense,{fallback:jsx$1(AppSkeleton,{}),name:"AppLoader",children:jsx$1(Load,{children:jsx$1(App,{})})}),jsx$1(Suspense,{name:"CookieBanner",children:jsx$1(CookieBanner,{})}),jsx$1(ModalsContainer,{})]});createRoot(document.getElementById("root")).render(jsx$1(AppLoader,{}));export{useNavigate as $,AnalyticsPath as A,BaseError$4 as B,Cr as C,DateTime as D,isHex as E,twMerge as F,useUser as G,HttpRequestError as H,Icon as I,useDrives as J,useSelectedDrive as K,ConnectSidebar as L,logout as M,Nr as N,openRenown as O,PGLITE_UPDATE_EVENT as P,setSelectedDrive as Q,R$3 as R,connectConfig as S,T$1 as T,Ue as U,logger$6 as V,showPHModal as W,Outlet as X,ModalsContainer as Y,subscribeToReactor as Z,useParams as _,usePGliteDB as a,useOnClickOutside as a$,toast as a0,addRemoteDrive as a1,Button$1 as a2,useLocation as a3,gql as a4,request as a5,objectType as a6,stringType as a7,literalType as a8,arrayType as a9,noop$4 as aA,prune as aB,redo as aC,setName as aD,undo as aE,createAuthState as aF,createBaseState as aG,createDocumentState as aH,defaultAuthState as aI,defaultDocumentState as aJ,attachBranch as aK,garbageCollect as aL,garbageCollectDocumentOperations as aM,groupOperationsByScope as aN,merge as aO,precedes as aP,removeExistingOperations as aQ,reshuffleByTimestamp as aR,skipHeaderOperations as aS,sortOperations as aT,nodeOptionsMap as aU,defaultFileOptions as aV,ConnectDropdownMenu as aW,DELETE as aX,RENAME as aY,DUPLICATE as aZ,defaultFolderOptions as a_,anyType as aa,createAction as ab,createReducer as ac,isDocumentAction as ad,defaultBaseState as ae,baseCreateDocument as af,baseSaveToFile as ag,baseSaveToFileHandle as ah,baseLoadFromFile as ai,baseLoadFromInput as aj,customUtils$1 as ak,actions$1 as al,hashDocumentStateForScope as am,replayDocument as an,buildOperationSignature as ao,buildOperationSignatureMessage as ap,buildSignedAction as aq,generateId as ar,createZip as as,createUnsignedHeader as at,validateHeader as au,validateInitialState as av,validateModule as aw,validateModuleOperation as ax,validateModules as ay,validateStateSchemaName as az,useSetPGliteDB as b,uuid4 as b$,useEventListener as b0,mergeClassNameProps as b1,cn$2 as b2,DropdownMenu as b3,DropdownMenuTrigger as b4,DropdownMenuContent as b5,DropdownMenuItem as b6,useTranslation as b7,cn$1 as b8,useFolderChildNodesForId as b9,AnalyticsGranularity as bA,useDocumentById as bB,useDocumentModelModuleById as bC,useEditorModuleById as bD,useFallbackEditorModule as bE,useSelectedDocument as bF,useParentFolder as bG,useDriveIsRemote as bH,useDriveRemoteUrl as bI,useConnectCrypto as bJ,validateDocument as bK,exportFile as bL,useDriveEditorModuleById as bM,useDefaultDriveEditorModule as bN,HomeScreen as bO,getDefaultExportFromCjs as bP,isInstanceOf as bQ,truncate as bR,consoleSandbox as bS,DEBUG_BUILD$1 as bT,logger$1 as bU,getFunctionName as bV,GLOBAL_OBJ as bW,CONSOLE_LEVELS as bX,fill as bY,originalConsoleMethods as bZ,addNonEnumerableProperty as b_,useFileChildNodesForId as ba,useSelectedDriveDocument as bb,useNodeActions as bc,useSelectedFolder as bd,useDocumentModelModules as be,useSelectedNodePath as bf,useUserPermissions as bg,useShowSearchBar as bh,showDeleteNodeModal as bi,setSelectedNode as bj,getSyncStatusSync as bk,makeFolderNodeFromDrive as bl,showCreateDocumentModal as bm,AnimatedLoader as bn,useCopyToClipboard as bo,Select as bp,ENSAvatar as bq,Provider as br,Root3 as bs,Trigger$2 as bt,Portal$1 as bu,Content2$1 as bv,useAnalyticsStoreAsync as bw,useQueryClient as bx,useAnalyticsEngineAsync as by,useQuery$1 as bz,ur as c,extractExceptionKeysForMessage as c$,getGlobalObject as c0,isString as c1,process as c2,SyncPromise as c3,resolvedSyncPromise as c4,rejectedSyncPromise as c5,dropUndefinedKeys as c6,normalize as c7,dateTimestampInSeconds as c8,extractTraceparentData as c9,updateSession as cA,prepareEvent as cB,getDynamicSamplingContextFromClient as cC,isParameterizedString as cD,isPlainObject as cE,SDK_VERSION as cF,getEventDescription as cG,stringMatchesSomePattern as cH,getOriginalFunction as cI,browserPerformanceTimeOrigin as cJ,htmlTreeAsString as cK,getComponentName as cL,generateSentryTraceHeader as cM,dynamicSamplingContextToSentryBaggageHeader as cN,BAGGAGE_HEADER_NAME as cO,propagationContextFromHeaders as cP,getDomElement as cQ,markFunctionWrapped as cR,addExceptionTypeValue as cS,addExceptionMechanism as cT,captureException as cU,isErrorEvent as cV,isDOMError as cW,isDOMException as cX,isError as cY,isEvent as cZ,normalizeToSize as c_,getCurrentHub as ca,DEBUG_BUILD as cb,isThenable as cc,getClient as cd,getCurrentScope as ce,tracingContextFromHeaders as cf,runWithAsyncContext as cg,spanTimeInputToSeconds as ch,getIsolationScope as ci,getDynamicSamplingContextFromSpan as cj,spanIsSampled as ck,withScope as cl,spanToJSON as cm,timestampInSeconds as cn,TRACE_FLAG_SAMPLED as co,TRACE_FLAG_NONE as cp,getRootSpan as cq,spanToTraceHeader as cr,spanToTraceContext as cs,isNaN$1 as ct,getMainCarrier as cu,urlEncode as cv,arrayify as cw,addGlobalEventProcessor as cx,checkOrSetAlreadyCaught as cy,isPrimitive as cz,C$1 as d,GraphQLScalarType as d$,createStackParser as d0,addBreadcrumb as d1,safeJoin as d2,captureEvent as d3,getLocationHref as d4,stackParserFromStackParserOptions as d5,startSession as d6,captureSession as d7,setContext as d8,captureMessage as d9,isInputObjectType as dA,isScalarType as dB,isObjectType as dC,isInterfaceType as dD,isUnionType as dE,isEnumType as dF,print as dG,isPrintableAsBlockString as dH,astFromValue as dI,DEFAULT_DEPRECATION_REASON as dJ,isSpecifiedDirective as dK,isSpecifiedScalarType as dL,isIntrospectionType as dM,Kind as dN,clsx as dO,specifiedRules as dP,GraphQLID as dQ,GraphQLBoolean as dR,GraphQLString as dS,GraphQLFloat as dT,GraphQLInt as dU,GraphQLDirective as dV,GraphQLObjectType as dW,GraphQLInterfaceType as dX,GraphQLUnionType as dY,GraphQLInputObjectType as dZ,GraphQLEnumType as d_,addContextToFrame as da,DEFAULT_ENVIRONMENT as db,withActiveSpan as dc,getGlobalScope as dd,Hub as de,Scope as df,close as dg,configureScope as dh,endSession as di,flush as dj,getHubFromCarrier as dk,isInitialized as dl,lastEventId as dm,makeMain as dn,setExtra as dp,setExtras as dq,setTag as dr,setTags as ds,setUser as dt,startTransaction as du,withIsolationScope as dv,inspect as dw,GraphQLError as dx,getNamedType as dy,invariant$1 as dz,ee as e,isListType as e0,GraphQLList as e1,isNonNullType as e2,GraphQLNonNull as e3,isNamedType as e4,getNullableType as e5,isLeafType as e6,GraphQLSchema as e7,numberType as e8,lazyType as e9,TypeMetaFieldDef as eA,TypeNameMetaFieldDef as eB,isCompositeType as eC,isOutputType as eD,isInputType as eE,assertAbstractType as eF,doTypesOverlap as eG,DirectiveLocation as eH,NoUnusedFragmentsRule as eI,ExecutableDefinitionsRule as eJ,validateSchema as eK,createContextScope as eL,useComposedRefs as eM,useId as eN,composeEventHandlers as eO,useDirection as eP,useControllableState as eQ,useCallbackRef$1 as eR,useLayoutEffect2 as eS,useSelectedDocumentId as eT,useDocumentOfType as eU,unionType as ea,booleanType as eb,nullType as ec,recordType as ed,buildSchema as ee,buildASTSchema as ef,parse$2 as eg,validate as eh,pascalCase as ei,visit$1 as ej,get$3 as ek,set$1 as el,appendErrors as em,snakeCase as en,constantCase as eo,useFormContext as ep,createSlot as eq,cva as er,FormProvider as es,Controller as et,Slot$3 as eu,useForm as ev,sentenceCase as ew,isAbstractType as ex,BREAK as ey,SchemaMetaFieldDef as ez,cr as f,U$2 as g,h$2 as h,getDriveSharingType as i,j,childLogger as k,isAddress as l,InvalidAddressError as m,getUrl as n,decodeErrorResult as o,pr as p,localBatchGatewayUrl as q,runAsapAsync as r,stringify as s,localBatchGatewayRequest as t,u$2 as u,call as v,concat as w,x$3 as x,encodeAbiParameters as y,z$1 as z};
866
- //# sourceMappingURL=main.BXlmSY46.js.map
866
+ //# sourceMappingURL=main.s5_GNYWM.js.map