// Generated by examples/headless-tab/build-assets.mjs — inline assets (Pear apps
// virtualize the filesystem, so backend modules ship assets as require-able strings).
module.exports = {
wrapper: "<!doctype html>\n<html>\n<head>\n <meta charset=\"utf-8\">\n <title>headless tab</title>\n <script src=\"/htmx.min.js\"></script>\n <script src=\"/pear-request-client.bundle.js\"></script>\n <style>body{background:#0b0e14;margin:0;color:#e6e6e6}#boot{font:15px system-ui;color:#7a8;margin:40px auto;max-width:560px}</style>\n</head>\n<body>\n <div id=\"boot\">connecting to headless worker…</div>\n <script>\n (function () {\n // tabId is the last path segment; the worker-bridge WS port is ?ws=\n var tabId = location.pathname.split('/').filter(Boolean).pop()\n var wsPort = new URLSearchParams(location.search).get('ws')\n var ws = new WebSocket('ws://127.0.0.1:' + wsPort)\n ws.binaryType = 'arraybuffer'\n\n // A pipe shim over the WebSocket. WS preserves message boundaries, which is\n // the framing the pear-request client/router already assume.\n var listeners = {}\n function on (ev, cb) { (listeners[ev] || (listeners[ev] = [])).push(cb) }\n var pipe = {\n write: function (buf) { ws.send(buf); return true },\n on: on,\n once: function (ev, cb) { var w = function () { var i = listeners[ev].indexOf(w); if (i >= 0) listeners[ev].splice(i, 1); cb.apply(null, arguments) }; on(ev, w) }\n }\n ws.onmessage = function (e) {\n var data = globalThis.Buffer.from(e.data)\n ;(listeners.data || []).forEach(function (cb) { cb(data) })\n }\n ws.onerror = function () { var b = document.getElementById('boot'); if (b) b.textContent = 'worker pipe error' }\n ws.onclose = function () { var b = document.getElementById('boot'); if (b) b.textContent = 'worker disconnected' }\n ws.onopen = function () {\n ws.send(tabId) // FIRST frame: announce which tab/worker this is\n // swap in the stream-backed XMLHttpRequest, then let htmx pull the app's\n // root UI (GET /) from the worker into <body>. From here it's all htmx.\n globalThis.XMLHttpRequest = globalThis.createPearRequest(pipe)\n window.__PEAR_TAB_READY = true\n htmx.ajax('GET', '/', { target: 'body', swap: 'innerHTML' })\n }\n })()\n </script>\n</body>\n</html>\n",
htmx: "var htmx=function(){\"use strict\";const Q={onLoad:null,process:null,on:null,off:null,trigger:null,ajax:null,find:null,findAll:null,closest:null,values:function(e,t){const n=dn(e,t||\"post\");return n.values},remove:null,addClass:null,removeClass:null,toggleClass:null,takeClass:null,swap:null,defineExtension:null,removeExtension:null,logAll:null,logNone:null,logger:null,config:{historyEnabled:true,historyCacheSize:10,refreshOnHistoryMiss:false,defaultSwapStyle:\"innerHTML\",defaultSwapDelay:0,defaultSettleDelay:20,includeIndicatorStyles:true,indicatorClass:\"htmx-indicator\",requestClass:\"htmx-request\",addedClass:\"htmx-added\",settlingClass:\"htmx-settling\",swappingClass:\"htmx-swapping\",allowEval:true,allowScriptTags:true,inlineScriptNonce:\"\",inlineStyleNonce:\"\",attributesToSettle:[\"class\",\"style\",\"width\",\"height\"],withCredentials:false,timeout:0,wsReconnectDelay:\"full-jitter\",wsBinaryType:\"blob\",disableSelector:\"[hx-disable], [data-hx-disable]\",scrollBehavior:\"instant\",defaultFocusScroll:false,getCacheBusterParam:false,globalViewTransitions:false,methodsThatUseUrlParams:[\"get\",\"delete\"],selfRequestsOnly:true,ignoreTitle:false,scrollIntoViewOnBoost:true,triggerSpecsCache:null,disableInheritance:false,responseHandling:[{code:\"204\",swap:false},{code:\"[23]..\",swap:true},{code:\"[45]..\",swap:false,error:true}],allowNestedOobSwaps:true,historyRestoreAsHxRequest:true,reportValidityOfForms:false},parseInterval:null,location:location,_:null,version:\"2.0.10\"};Q.onLoad=j;Q.process=Ft;Q.on=ye;Q.off=xe;Q.trigger=ae;Q.ajax=Nn;Q.find=f;Q.findAll=y;Q.closest=g;Q.remove=z;Q.addClass=w;Q.removeClass=b;Q.toggleClass=G;Q.takeClass=W;Q.swap=_e;Q.defineExtension=_n;Q.removeExtension=zn;Q.logAll=$;Q.logNone=_;Q.parseInterval=d;Q._=e;const n={addTriggerHandler:St,bodyContains:se,canAccessLocalStorage:U,findThisElement:we,filterValues:yn,swap:_e,hasAttribute:s,getAttributeValue:a,getClosestAttributeValue:ne,getClosestMatch:A,getExpressionVars:Rn,getHeaders:mn,getInputValues:dn,getInternalData:oe,getSwapSpecification:bn,getTriggerSpecs:st,getTarget:Se,makeFragment:P,mergeObjects:le,makeSettleInfo:Sn,oobSwap:He,querySelectorExt:ce,settleImmediately:Yt,shouldCancel:ht,triggerEvent:ae,triggerErrorEvent:fe,withExtensions:Vt};const de=[\"get\",\"post\",\"put\",\"delete\",\"patch\"];const R=de.map(function(e){return\"[hx-\"+e+\"], [data-hx-\"+e+\"]\"}).join(\", \");function d(e){if(e==undefined){return undefined}let t=NaN;if(e.slice(-2)==\"ms\"){t=parseFloat(e.slice(0,-2))}else if(e.slice(-1)==\"s\"){t=parseFloat(e.slice(0,-1))*1e3}else if(e.slice(-1)==\"m\"){t=parseFloat(e.slice(0,-1))*1e3*60}else{t=parseFloat(e)}return isNaN(t)?undefined:t}function ee(e,t){return e instanceof Element&&e.getAttribute(t)}function s(e,t){return!!e.hasAttribute&&(e.hasAttribute(t)||e.hasAttribute(\"data-\"+t))}function a(e,t){return ee(e,t)||ee(e,\"data-\"+t)}function c(e){const t=e.parentElement;if(!t&&e.parentNode instanceof ShadowRoot)return e.parentNode;return t}function te(){return document}function q(e,t){return e.getRootNode?e.getRootNode({composed:t}):te()}function A(e,t){while(e&&!t(e)){e=c(e)}return e||null}function o(e,t,n){const r=a(t,n);const o=a(t,\"hx-disinherit\");var i=a(t,\"hx-inherit\");if(e!==t){if(Q.config.disableInheritance){if(i&&(i===\"*\"||i.split(\" \").indexOf(n)>=0)){return r}else{return null}}if(o&&(o===\"*\"||o.split(\" \").indexOf(n)>=0)){return\"unset\"}}return r}function ne(t,n){let r=null;A(t,function(e){return!!(r=o(t,ue(e),n))});if(r!==\"unset\"){return r}}function h(e,t){return e instanceof Element&&e.matches(t)}function N(e){const t=/<([a-z][^\\/\\0>\\x20\\t\\r\\n\\f]*)/i;const n=t.exec(e);if(n){return n[1].toLowerCase()}else{return\"\"}}function I(e){if(\"parseHTMLUnsafe\"in Document){return Document.parseHTMLUnsafe(e)}const t=new DOMParser;return t.parseFromString(e,\"text/html\")}function L(e,t){while(t.childNodes.length>0){e.append(t.childNodes[0])}}function r(e){const t=te().createElement(\"script\");ie(e.attributes,function(e){t.setAttribute(e.name,e.value)});t.textContent=e.textContent;t.async=false;if(Q.config.inlineScriptNonce){t.nonce=Q.config.inlineScriptNonce}return t}function i(e){return e.matches(\"script\")&&(e.type===\"text/javascript\"||e.type===\"module\"||e.type===\"\")}function D(e){Array.from(e.querySelectorAll(\"script\")).forEach(e=>{if(i(e)){const t=r(e);const n=e.parentNode;try{n.insertBefore(t,e)}catch(e){H(e)}finally{e.remove()}}})}function P(e){const t=e.replace(/<head(\\s[^>]*)?>[\\s\\S]*?<\\/head>/i,\"\");const n=N(t);let r;if(n===\"html\"){r=new DocumentFragment;const i=I(e);L(r,i.body);r.title=i.title}else if(n===\"body\"){r=new DocumentFragment;const i=I(t);L(r,i.body);r.title=i.title}else{const i=I('<body><template class=\"internal-htmx-wrapper\">'+t+\"</template></body>\");r=i.querySelector(\"template\").content;r.title=i.title;var o=r.querySelector(\"title\");if(o&&o.parentNode===r){o.remove();r.title=o.innerText}}if(r){if(Q.config.allowScriptTags){D(r)}else{r.querySelectorAll(\"script\").forEach(e=>e.remove())}}return r}function re(e){if(e){e()}}function t(e,t){return Object.prototype.toString.call(e)===\"[object \"+t+\"]\"}function k(e){return typeof e===\"function\"}function M(e){return t(e,\"Object\")}function oe(e){const t=\"htmx-internal-data\";let n=e[t];if(!n){n=e[t]={}}return n}function F(t){const n=[];if(t){for(let e=0;e<t.length;e++){n.push(t[e])}}return n}function ie(t,n){if(t){for(let e=0;e<t.length;e++){n(t[e])}}}function B(e){const t=e.getBoundingClientRect();const n=t.top;const r=t.bottom;return n<window.innerHeight&&r>=0}function se(e){return e.getRootNode({composed:true})===document}function X(e){return e.trim().split(/\\s+/)}function le(e,t){for(const n in t){if(t.hasOwnProperty(n)){e[n]=t[n]}}return e}function v(e){try{return JSON.parse(e)}catch(e){H(e);return null}}function U(){const e=\"htmx:sessionStorageTest\";try{sessionStorage.setItem(e,e);sessionStorage.removeItem(e);return true}catch(e){return false}}function V(e){try{const t=new URL(e,window.location.href);e=t.pathname+t.search}catch(e){}if(e!=\"/\"){e=e.replace(/\\/+$/,\"\")}return e}function e(e){return On(te().body,function(){return eval(e)})}function j(t){const e=Q.on(\"htmx:load\",function(e){t(e.detail.elt)});return e}function $(){Q.logger=function(e,t,n){if(console){console.log(t,e,n)}}}function _(){Q.logger=null}function f(e,t){if(typeof e!==\"string\"){return e.querySelector(t)}else{return f(te(),e)}}function y(e,t){if(typeof e!==\"string\"){return e.querySelectorAll(t)}else{return y(te(),e)}}function x(){return window}function z(e,t){e=S(e);if(t){x().setTimeout(function(){z(e);e=null},t)}else{c(e).removeChild(e)}}function ue(e){return e instanceof Element?e:null}function J(e){return e instanceof HTMLElement?e:null}function K(e){return typeof e===\"string\"?e:null}function p(e){return e instanceof Element||e instanceof Document||e instanceof DocumentFragment?e:null}function w(e,t,n){e=ue(S(e));if(!e){return}if(n){x().setTimeout(function(){w(e,t);e=null},n)}else{e.classList&&e.classList.add(t)}}function b(e,t,n){let r=ue(S(e));if(!r){return}if(n){x().setTimeout(function(){b(r,t);r=null},n)}else{if(r.classList){r.classList.remove(t);if(r.classList.length===0){r.removeAttribute(\"class\")}}}}function G(e,t){e=S(e);e.classList.toggle(t)}function W(e,t){e=S(e);ie(e.parentElement.children,function(e){b(e,t)});w(ue(e),t)}function g(e,t){e=ue(S(e));if(e){return e.closest(t)}return null}function l(e,t){return e.substring(0,t.length)===t}function Z(e,t){return e.substring(e.length-t.length)===t}function Y(e){const t=e.trim();if(l(t,\"<\")&&Z(t,\"/>\")){return t.substring(1,t.length-2)}else{return t}}function m(t,r,n){if(r.indexOf(\"global \")===0){return m(t,r.slice(7),true)}t=S(t);const o=[];{let t=0;let n=0;for(let e=0;e<r.length;e++){const l=r[e];if(l===\",\"&&t===0){o.push(r.substring(n,e));n=e+1;continue}if(l===\"<\"){t++}else if(l===\"/\"&&e<r.length-1&&r[e+1]===\">\"){t--}}if(n<r.length){o.push(r.substring(n))}}const i=[];const s=[];while(o.length>0){const r=Y(o.shift());let e;if(r.indexOf(\"closest \")===0){e=g(ue(t),Y(r.slice(8)))}else if(r.indexOf(\"find \")===0){e=f(p(t),Y(r.slice(5)))}else if(r===\"next\"||r===\"nextElementSibling\"){e=ue(t).nextElementSibling}else if(r.indexOf(\"next \")===0){e=pe(t,Y(r.slice(5)),!!n)}else if(r===\"previous\"||r===\"previousElementSibling\"){e=ue(t).previousElementSibling}else if(r.indexOf(\"previous \")===0){e=ge(t,Y(r.slice(9)),!!n)}else if(r===\"document\"){e=document}else if(r===\"window\"){e=window}else if(r===\"body\"){e=document.body}else if(r===\"root\"){e=q(t,!!n)}else if(r===\"host\"){e=t.getRootNode().host}else{s.push(r)}if(e){i.push(e)}}if(s.length>0){const e=s.join(\",\");const u=p(q(t,!!n));i.push(...F(u.querySelectorAll(e)))}return i}var pe=function(t,e,n){const r=p(q(t,n)).querySelectorAll(e);for(let e=0;e<r.length;e++){const o=r[e];if(o.compareDocumentPosition(t)===Node.DOCUMENT_POSITION_PRECEDING){return o}}};var ge=function(t,e,n){const r=p(q(t,n)).querySelectorAll(e);for(let e=r.length-1;e>=0;e--){const o=r[e];if(o.compareDocumentPosition(t)===Node.DOCUMENT_POSITION_FOLLOWING){return o}}};function ce(e,t){if(typeof e!==\"string\"){return m(e,t)[0]}else{return m(te().body,e)[0]}}function S(e,t){if(typeof e===\"string\"){return f(p(t)||document,e)}else{return e}}function me(e,t,n,r){if(k(t)){return{target:te().body,event:K(e),listener:t,options:n}}else{return{target:S(e),event:K(t),listener:n,options:r}}}function ye(t,n,r,o){Gn(function(){const e=me(t,n,r,o);e.target.addEventListener(e.event,e.listener,e.options)});const e=k(n);return e?n:r}function xe(t,n,r){Gn(function(){const e=me(t,n,r);e.target.removeEventListener(e.event,e.listener)});return k(n)?n:r}const be=te().createElement(\"output\");function ve(t,n){const e=ne(t,n);if(e){if(e===\"this\"){return[we(t,n)]}else{const r=m(t,e);const o=/(^|,)(\\s*)inherit(\\s*)($|,)/.test(e);if(o){const i=ue(A(t,function(e){return e!==t&&s(ue(e),n)}));if(i){r.push(...ve(i,n))}}if(r.length===0){H('The selector \"'+e+'\" on '+n+\" returned no matches!\");return[be]}else{return r}}}}function we(e,t){return ue(A(e,function(e){return a(ue(e),t)!=null}))}function Se(e){const t=ne(e,\"hx-target\");if(t){if(t===\"this\"){return we(e,\"hx-target\")}else{return ce(e,t)}}else{const n=oe(e);if(n.boosted){return te().body}else{return e}}}function Ee(e){return Q.config.attributesToSettle.includes(e)}function Ce(t,n){ie(Array.from(t.attributes),function(e){if(!n.hasAttribute(e.name)&&Ee(e.name)){t.removeAttribute(e.name)}});ie(n.attributes,function(e){if(Ee(e.name)){t.setAttribute(e.name,e.value)}})}function Oe(t,e){const n=Jn(e);for(let e=0;e<n.length;e++){const r=n[e];try{if(r.isInlineSwap(t)){return true}}catch(e){H(e)}}return t===\"outerHTML\"}function He(e,o,i,t){t=t||te();let n=\"#\"+CSS.escape(ee(o,\"id\"));let s=\"outerHTML\";if(e===\"true\"){}else if(e.indexOf(\":\")>0){s=e.substring(0,e.indexOf(\":\"));n=e.substring(e.indexOf(\":\")+1)}else{s=e}o.removeAttribute(\"hx-swap-oob\");o.removeAttribute(\"data-hx-swap-oob\");const r=m(t,n,false);if(r.length){ie(r,function(e){let t;const n=o.cloneNode(true);t=te().createDocumentFragment();t.appendChild(n);if(!Oe(s,e)){t=p(n)}const r={shouldSwap:true,target:e,fragment:t};if(!ae(e,\"htmx:oobBeforeSwap\",r))return;e=r.target;if(r.shouldSwap){Re(t);je(s,e,e,t,i);Te()}ie(i.elts,function(e){ae(e,\"htmx:oobAfterSwap\",r)})});o.parentNode.removeChild(o)}else{o.parentNode.removeChild(o);fe(te().body,\"htmx:oobErrorNoTarget\",{content:o,target:n})}return e}function Te(){const e=f(\"#--htmx-preserve-pantry--\");if(e){for(const t of[...e.children]){const n=f(\"#\"+t.id);n.parentNode.moveBefore(t,n);n.remove()}e.remove()}}function Re(e){ie(y(e,\"[hx-preserve], [data-hx-preserve]\"),function(e){const t=a(e,\"id\");const n=te().getElementById(t);if(n!=null){if(e.moveBefore){let e=f(\"#--htmx-preserve-pantry--\");if(e==null){te().body.insertAdjacentHTML(\"afterend\",\"<div id='--htmx-preserve-pantry--'></div>\");e=f(\"#--htmx-preserve-pantry--\")}e.moveBefore(n,null)}else{e.parentNode.replaceChild(n,e)}}})}function qe(i,e,s){ie(e.querySelectorAll(\"[id]\"),function(t){const n=ee(t,\"id\");if(n&&n.length>0){const e=p(i);const r=e&&e.querySelector(CSS.escape(t.tagName)+\"#\"+CSS.escape(n));if(r&&r!==e){const o=t.cloneNode();Ce(t,r);s.tasks.push(function(){Ce(t,o)})}}})}function Ae(e){return function(){b(e,Q.config.addedClass);Ft(ue(e));Ne(p(e));ae(e,\"htmx:load\")}}function Ne(e){const t=\"[autofocus]\";const n=J(h(e,t)?e:e.querySelector(t));if(n!=null){n.focus()}}function u(e,t,n,r){qe(e,n,r);while(n.childNodes.length>0){const o=n.firstChild;w(ue(o),Q.config.addedClass);e.insertBefore(o,t);if(o.nodeType!==Node.TEXT_NODE&&o.nodeType!==Node.COMMENT_NODE){r.tasks.push(Ae(o))}}}function Ie(e,t){let n=0;while(n<e.length){t=(t<<5)-t+e.charCodeAt(n++)|0}return t}function Le(t){let n=0;for(let e=0;e<t.attributes.length;e++){const r=t.attributes[e];if(r.value){n=Ie(r.name,n);n=Ie(r.value,n)}}return n}function De(t){const n=oe(t);if(n.onHandlers){for(let e=0;e<n.onHandlers.length;e++){const r=n.onHandlers[e];xe(t,r.event,r.listener)}delete n.onHandlers}}function Pe(e){const t=oe(e);if(t.timeout){clearTimeout(t.timeout)}if(t.listenerInfos){ie(t.listenerInfos,function(e){if(e.on){xe(e.on,e.trigger,e.listener)}})}De(e);ie(Object.keys(t),function(e){if(e!==\"firstInitCompleted\")delete t[e]})}function E(e){ae(e,\"htmx:beforeCleanupElement\");Pe(e);ie(e.children,function(e){E(e)})}function ke(t,e,n){if(t.tagName===\"BODY\"){return Ve(t,e,n)}let r;const o=t.previousSibling;const i=c(t);if(!i){return}u(i,t,e,n);if(o==null){r=i.firstChild}else{r=o.nextSibling}n.elts=n.elts.filter(function(e){return e!==t});while(r&&r!==t){if(r instanceof Element){n.elts.push(r)}r=r.nextSibling}E(t);t.remove()}function Me(e,t,n){return u(e,e.firstChild,t,n)}function Fe(e,t,n){return u(c(e),e,t,n)}function Be(e,t,n){return u(e,null,t,n)}function Xe(e,t,n){return u(c(e),e.nextSibling,t,n)}function Ue(e){E(e);const t=c(e);if(t){return t.removeChild(e)}}function Ve(e,t,n){const r=e.firstChild;u(e,r,t,n);if(r){while(r.nextSibling){E(r.nextSibling);e.removeChild(r.nextSibling)}E(r);e.removeChild(r)}}function je(t,e,n,r,o){switch(t){case\"none\":return;case\"outerHTML\":ke(n,r,o);return;case\"afterbegin\":Me(n,r,o);return;case\"beforebegin\":Fe(n,r,o);return;case\"beforeend\":Be(n,r,o);return;case\"afterend\":Xe(n,r,o);return;case\"delete\":Ue(n);return;default:var i=Jn(e);for(let e=0;e<i.length;e++){const s=i[e];try{const l=s.handleSwap(t,n,r,o);if(l){if(Array.isArray(l)){for(let e=0;e<l.length;e++){const u=l[e];if(u.nodeType!==Node.TEXT_NODE&&u.nodeType!==Node.COMMENT_NODE){o.tasks.push(Ae(u))}}}return}}catch(e){H(e)}}if(t===\"innerHTML\"){Ve(n,r,o)}else{je(Q.config.defaultSwapStyle,e,n,r,o)}}}function $e(e,n,r){var t=y(e,\"[hx-swap-oob], [data-hx-swap-oob]\");ie(t,function(e){if(Q.config.allowNestedOobSwaps||e.parentElement===null){const t=a(e,\"hx-swap-oob\");if(t!=null){He(t,e,n,r)}}else{e.removeAttribute(\"hx-swap-oob\");e.removeAttribute(\"data-hx-swap-oob\")}});return t.length>0}function _e(h,d,p,g){if(!g){g={}}let m=null;let n=null;let e=function(){re(g.beforeSwapCallback);h=S(h);const r=g.contextElement?q(g.contextElement,false):te();const e=document.activeElement;let t={};t={elt:e,start:e?e.selectionStart:null,end:e?e.selectionEnd:null};const o=Sn(h);if(p.swapStyle===\"textContent\"){h.textContent=d}else{let n=P(d);o.title=g.title||n.title;if(g.historyRequest){n=n.querySelector(\"[hx-history-elt],[data-hx-history-elt]\")||n}if(g.selectOOB){const i=g.selectOOB.split(\",\");for(let t=0;t<i.length;t++){const s=i[t].split(\":\",2);let e=s[0].trim();if(e.indexOf(\"#\")===0){e=e.substring(1)}const l=s[1]||\"true\";const u=n.querySelector(\"#\"+e);if(u){He(l,u,o,r)}}}$e(n,o,r);ie(y(n,\"template\"),function(e){if(e.content&&$e(e.content,o,r)){e.remove()}});if(g.select){const c=te().createDocumentFragment();ie(n.querySelectorAll(g.select),function(e){c.appendChild(e)});n=c}Re(n);je(p.swapStyle,g.contextElement,h,n,o);Te()}if(t.elt&&!se(t.elt)&&ee(t.elt,\"id\")){const f=document.getElementById(ee(t.elt,\"id\"));const a={preventScroll:p.focusScroll!==undefined?!p.focusScroll:!Q.config.defaultFocusScroll};if(f){if(t.start&&f.setSelectionRange){try{f.setSelectionRange(t.start,t.end)}catch(e){}}f.focus(a)}}b(h,Q.config.swappingClass);ie(o.elts,function(e){if(e.classList){w(e,Q.config.settlingClass)}ae(e,\"htmx:afterSwap\",g.eventInfo)});re(g.afterSwapCallback);if(!p.ignoreTitle){Xn(o.title)}const n=function(){ie(o.tasks,function(e){e.call()});ie(o.elts,function(e){if(e.classList){b(e,Q.config.settlingClass)}ae(e,\"htmx:afterSettle\",g.eventInfo)});if(g.anchor){const e=ue(S(\"#\"+g.anchor));if(e){e.scrollIntoView({block:\"start\",behavior:\"auto\"})}}En(o.elts,p);re(g.afterSettleCallback);re(m)};if(p.settleDelay>0){x().setTimeout(n,p.settleDelay)}else{n()}};let t=Q.config.globalViewTransitions;if(p.hasOwnProperty(\"transition\")){t=p.transition}const r=g.contextElement||te();if(t&&ae(r,\"htmx:beforeTransition\",g.eventInfo)&&typeof Promise!==\"undefined\"&&document.startViewTransition){const o=new Promise(function(e,t){m=e;n=t});const i=e;e=function(){document.startViewTransition(function(){i();return o})}}try{if(p?.swapDelay&&p.swapDelay>0){x().setTimeout(e,p.swapDelay)}else{e()}}catch(e){fe(r,\"htmx:swapError\",g.eventInfo);re(n);throw e}}function ze(e,t,n){const r=e.getResponseHeader(t);if(r.indexOf(\"{\")===0){const o=v(r);for(const i in o){if(o.hasOwnProperty(i)){let e=o[i];if(M(e)){n=e.target!==undefined?e.target:n}else{e={value:e}}ae(n,i,e)}}}else{const s=r.split(\",\");for(let e=0;e<s.length;e++){ae(n,s[e].trim(),[])}}}const Je=/\\s/;const C=/[\\s,]/;const Ke=/[_$a-zA-Z]/;const Ge=/[_$a-zA-Z0-9]/;const We=['\"',\"'\",\"/\"];const Ze=/[^\\s]/;const Ye=/[{(]/;const Qe=/[})]/;function et(e){const t=[];let n=0;while(n<e.length){if(Ke.exec(e.charAt(n))){var r=n;while(Ge.exec(e.charAt(n+1))){n++}t.push(e.substring(r,n+1))}else if(We.indexOf(e.charAt(n))!==-1){const o=e.charAt(n);var r=n;n++;while(n<e.length&&e.charAt(n)!==o){if(e.charAt(n)===\"\\\\\"){n++}n++}t.push(e.substring(r,n+1))}else{const i=e.charAt(n);t.push(i)}n++}return t}function tt(e,t,n){return Ke.exec(e.charAt(0))&&e!==\"true\"&&e!==\"false\"&&e!==\"this\"&&e!==n&&t!==\".\"}function nt(r,o,i){if(o[0]===\"[\"){o.shift();let e=1;let t=\" return (function(\"+i+\"){ return (\";let n=null;while(o.length>0){const s=o[0];if(s===\"]\"){e--;if(e===0){if(n===null){t=t+\"true\"}o.shift();t+=\")})\";try{const l=On(r,function(){return Function(t)()},function(){return true});l.source=t;return l}catch(e){fe(te().body,\"htmx:syntax:error\",{error:e,source:t});return null}}}else if(s===\"[\"){e++}if(tt(s,n,i)){t+=\"((\"+i+\".\"+s+\") ? (\"+i+\".\"+s+\") : (window.\"+s+\"))\"}else{t=t+s}n=o.shift()}}}function O(e,t){let n=\"\";while(e.length>0&&!t.test(e[0])){n+=e.shift()}return n}function rt(e){let t;if(e.length>0&&Ye.test(e[0])){e.shift();t=O(e,Qe).trim();e.shift()}else{t=O(e,C)}return t}const ot=\"input, textarea, select\";function it(e,t,n){const r=[];const o=et(t);do{O(o,Ze);const l=o.length;const u=O(o,/[,\\[\\s]/);if(u!==\"\"){if(u===\"every\"){const c={trigger:\"every\"};O(o,Ze);c.pollInterval=d(O(o,/[,\\[\\s]/));O(o,Ze);var i=nt(e,o,\"event\");if(i){c.eventFilter=i}r.push(c)}else{const f={trigger:u};var i=nt(e,o,\"event\");if(i){f.eventFilter=i}O(o,Ze);while(o.length>0&&o[0]!==\",\"){const a=o.shift();if(a===\"changed\"){f.changed=true}else if(a===\"once\"){f.once=true}else if(a===\"consume\"){f.consume=true}else if(a===\"delay\"&&o[0]===\":\"){o.shift();f.delay=d(O(o,C))}else if(a===\"from\"&&o[0]===\":\"){o.shift();if(Ye.test(o[0])){var s=rt(o)}else{var s=O(o,C);if(s===\"closest\"||s===\"find\"||s===\"next\"||s===\"previous\"){o.shift();const h=rt(o);if(h.length>0){s+=\" \"+h}}}f.from=s}else if(a===\"target\"&&o[0]===\":\"){o.shift();f.target=rt(o)}else if(a===\"throttle\"&&o[0]===\":\"){o.shift();f.throttle=d(O(o,C))}else if(a===\"queue\"&&o[0]===\":\"){o.shift();f.queue=O(o,C)}else if(a===\"root\"&&o[0]===\":\"){o.shift();f[a]=rt(o)}else if(a===\"threshold\"&&o[0]===\":\"){o.shift();f[a]=O(o,C)}else{fe(e,\"htmx:syntax:error\",{token:o.shift()})}O(o,Ze)}r.push(f)}}if(o.length===l){fe(e,\"htmx:syntax:error\",{token:o.shift()})}O(o,Ze)}while(o[0]===\",\"&&o.shift());if(n){n[t]=r}return r}function st(e){const t=a(e,\"hx-trigger\");let n=[];if(t){const r=Q.config.triggerSpecsCache;n=r&&r[t]||it(e,t,r)}if(n.length>0){return n}else if(h(e,\"form\")){return[{trigger:\"submit\"}]}else if(h(e,'input[type=\"button\"], input[type=\"submit\"]')){return[{trigger:\"click\"}]}else if(h(e,ot)){return[{trigger:\"change\"}]}else{return[{trigger:\"click\"}]}}function lt(e){oe(e).cancelled=true}function ut(e,t,n){const r=oe(e);r.timeout=x().setTimeout(function(){if(se(e)&&r.cancelled!==true){if(!pt(n,e,Xt(\"hx:poll:trigger\",{triggerSpec:n,target:e}))){t(e)}ut(e,t,n)}},n.pollInterval)}function ct(e){return location.hostname===e.hostname&&ee(e,\"href\")&&ee(e,\"href\").indexOf(\"#\")!==0}function ft(e){return g(e,Q.config.disableSelector)}function at(t,n,e){if(t instanceof HTMLAnchorElement&&ct(t)&&(t.target===\"\"||t.target===\"_self\")||t.tagName===\"FORM\"&&String(ee(t,\"method\")).toLowerCase()!==\"dialog\"){n.boosted=true;let r,o;if(t.tagName===\"A\"){r=\"get\";o=ee(t,\"href\")}else{const i=ee(t,\"method\");r=i?i.toLowerCase():\"get\";o=ee(t,\"action\");if(o==null||o===\"\"){o=location.href}if(r===\"get\"&&o.includes(\"?\")){o=o.replace(/\\?[^#]+/,\"\")}}e.forEach(function(e){gt(t,function(e,t){const n=ue(e);if(ft(n)){E(n);return}he(r,o,n,t)},n,e,true)})}}function ht(e,t){if(e.type===\"submit\"&&t.tagName===\"FORM\"){return true}else if(e.type===\"click\"){const n=t.closest('input[type=\"submit\"], button');if(n&&n.form&&n.type===\"submit\"){return true}const r=t.closest(\"a\");const o=/^#.+/;if(r&&r.href&&!o.test(r.getAttribute(\"href\"))){return true}}return false}function dt(e,t){return oe(e).boosted&&e instanceof HTMLAnchorElement&&t.type===\"click\"&&(t.ctrlKey||t.metaKey)}function pt(e,t,n){const r=e.eventFilter;if(r){try{return r.call(t,n)!==true}catch(e){const o=r.source;fe(te().body,\"htmx:eventFilter:error\",{error:e,source:o});return true}}return false}function gt(l,u,e,c,f){const a=oe(l);let t;if(c.from){t=m(l,c.from)}else{t=[l]}if(c.changed){if(!(\"lastValue\"in a)){a.lastValue=new WeakMap}t.forEach(function(e){if(!a.lastValue.has(c)){a.lastValue.set(c,new WeakMap)}a.lastValue.get(c).set(e,e.value)})}ie(t,function(i){const s=function(e){if(!se(l)){i.removeEventListener(c.trigger,s);return}if(dt(l,e)){return}if(f||ht(e,i)){e.preventDefault()}if(pt(c,l,e)){return}const t=oe(e);t.triggerSpec=c;if(t.handledFor==null){t.handledFor=[]}if(t.handledFor.indexOf(l)<0){t.handledFor.push(l);if(c.consume){e.stopPropagation()}if(c.target&&e.target){if(!h(ue(e.target),c.target)){return}}if(c.once){if(a.triggeredOnce){return}else{a.triggeredOnce=true}}if(c.changed){const n=e.target;const r=n.value;const o=a.lastValue.get(c);if(o.has(n)&&o.get(n)===r){return}o.set(n,r)}if(a.delayed){clearTimeout(a.delayed)}if(a.throttle){return}if(c.throttle>0){if(!a.throttle){ae(l,\"htmx:trigger\");u(l,e);a.throttle=x().setTimeout(function(){a.throttle=null},c.throttle)}}else if(c.delay>0){a.delayed=x().setTimeout(function(){ae(l,\"htmx:trigger\");u(l,e)},c.delay)}else{ae(l,\"htmx:trigger\");u(l,e)}}};if(e.listenerInfos==null){e.listenerInfos=[]}e.listenerInfos.push({trigger:c.trigger,listener:s,on:i});i.addEventListener(c.trigger,s)})}let mt=false;let yt=null;function xt(){if(!yt){yt=function(){mt=true};window.addEventListener(\"scroll\",yt);window.addEventListener(\"resize\",yt);setInterval(function(){if(mt){mt=false;ie(te().querySelectorAll(\"[hx-trigger*='revealed'],[data-hx-trigger*='revealed']\"),function(e){bt(e)})}},200)}}function bt(e){if(!s(e,\"data-hx-revealed\")&&B(e)){e.setAttribute(\"data-hx-revealed\",\"true\");const t=oe(e);if(t.initHash){ae(e,\"revealed\")}else{e.addEventListener(\"htmx:afterProcessNode\",function(){ae(e,\"revealed\")},{once:true})}}}function vt(e,t,n,r){const o=function(){if(!n.loaded){n.loaded=true;ae(e,\"htmx:trigger\");t(e)}};if(r>0){x().setTimeout(o,r)}else{o()}}function wt(t,n,e){let i=false;ie(de,function(r){if(s(t,\"hx-\"+r)){const o=a(t,\"hx-\"+r);i=true;n.path=o;n.verb=r;e.forEach(function(e){St(t,e,n,function(e,t){const n=ue(e);if(ft(n)){E(n);return}he(r,o,n,t)})})}});return i}function St(r,e,t,n){if(e.trigger===\"revealed\"){xt();gt(r,n,t,e);bt(ue(r))}else if(e.trigger===\"intersect\"){const o={};if(e.root){o.root=ce(r,e.root)}if(e.threshold){o.threshold=parseFloat(e.threshold)}const i=new IntersectionObserver(function(t){for(let e=0;e<t.length;e++){const n=t[e];if(n.isIntersecting){ae(r,\"intersect\");break}}},o);i.observe(ue(r));gt(ue(r),n,t,e)}else if(!t.firstInitCompleted&&e.trigger===\"load\"){if(!pt(e,r,Xt(\"load\",{elt:r}))){vt(ue(r),n,t,e.delay)}}else if(e.pollInterval>0){t.polling=true;ut(ue(r),n,e)}else{gt(r,n,t,e)}}function Et(e){const t=ue(e);if(!t){return false}const n=t.attributes;for(let e=0;e<n.length;e++){const r=n[e].name;if(l(r,\"hx-on:\")||l(r,\"data-hx-on:\")||l(r,\"hx-on-\")||l(r,\"data-hx-on-\")){return true}}return false}const Ct=(new XPathEvaluator).createExpression('.//*[@*[ starts-with(name(), \"hx-on:\") or starts-with(name(), \"data-hx-on:\") or'+' starts-with(name(), \"hx-on-\") or starts-with(name(), \"data-hx-on-\") ]]');function Ot(e,t){if(Et(e)){t.push(ue(e))}const n=Ct.evaluate(e);let r=null;while(r=n.iterateNext())t.push(ue(r))}function Ht(e){const t=[];if(e instanceof DocumentFragment){for(const n of e.childNodes){Ot(n,t)}}else{Ot(e,t)}return t}function Tt(e){if(e.querySelectorAll){const n=\", [hx-boost] a, [data-hx-boost] a, a[hx-boost], a[data-hx-boost]\";const r=[];for(const i in jn){const s=jn[i];if(s.getSelectors){var t=s.getSelectors();if(t){r.push(t)}}}const o=e.querySelectorAll(R+n+\", form, [type='submit'],\"+\" [hx-ext], [data-hx-ext], [hx-trigger], [data-hx-trigger]\"+r.flat().map(e=>\", \"+e).join(\"\"));return o}else{return[]}}function Rt(e){const t=At(e.target);const n=It(e);if(n){n.lastButtonClicked=t}}function qt(e){const t=It(e);if(t){t.lastButtonClicked=null}}function At(e){return g(ue(e),\"button, input[type='submit']\")}function Nt(e){return e.form||g(e,\"form\")}function It(e){const t=At(e.target);if(!t){return}const n=Nt(t);if(!n){return}return oe(n)}function Lt(e){e.addEventListener(\"click\",Rt);e.addEventListener(\"focusin\",Rt);e.addEventListener(\"focusout\",qt)}function Dt(t,e,n){const r=oe(t);if(!Array.isArray(r.onHandlers)){r.onHandlers=[]}let o;const i=function(e){On(t,function(){if(ft(t)){return}if(!o){o=new Function(\"event\",n)}o.call(t,e)})};t.addEventListener(e,i);r.onHandlers.push({event:e,listener:i})}function Pt(t){De(t);for(let e=0;e<t.attributes.length;e++){const n=t.attributes[e].name;const r=t.attributes[e].value;if(l(n,\"hx-on\")||l(n,\"data-hx-on\")){const o=n.indexOf(\"-on\")+3;const i=n.slice(o,o+1);if(i===\"-\"||i===\":\"){let e=n.slice(o+1);if(l(e,\":\")){e=\"htmx\"+e}else if(l(e,\"-\")){e=\"htmx:\"+e.slice(1)}else if(l(e,\"htmx-\")){e=\"htmx:\"+e.slice(5)}Dt(t,e,r)}}}}function kt(t){ae(t,\"htmx:beforeProcessNode\");const n=oe(t);const e=st(t);const r=wt(t,n,e);if(!r){if(ne(t,\"hx-boost\")===\"true\"){at(t,n,e)}else if(s(t,\"hx-trigger\")){e.forEach(function(e){St(t,e,n,function(){})})}}if(t.tagName===\"FORM\"||ee(t,\"type\")===\"submit\"&&s(t,\"form\")){Lt(t)}n.firstInitCompleted=true;ae(t,\"htmx:afterProcessNode\")}function Mt(e){if(!(e instanceof Element)){return false}const t=oe(e);const n=Le(e);if(t.initHash!==n){Pe(e);t.initHash=n;return true}return false}function Ft(e){e=S(e);if(ft(e)){E(e);return}const t=[];if(Mt(e)){t.push(e)}ie(Tt(e),function(e){if(ft(e)){E(e);return}if(Mt(e)){t.push(e)}});ie(Ht(e),Pt);ie(t,kt)}function Bt(e){return e.replace(/([a-z0-9])([A-Z])/g,\"$1-$2\").toLowerCase()}function Xt(e,t){return new CustomEvent(e,{bubbles:true,cancelable:true,composed:true,detail:t})}function fe(e,t,n){ae(e,t,le({error:t},n))}function Ut(e){return e===\"htmx:afterProcessNode\"}function Vt(e,t,n){ie(Jn(e,[],n),function(e){try{t(e)}catch(e){H(e)}})}function H(e){console.error(e)}function ae(e,t,n){e=S(e);if(n==null){n={}}n.elt=e;const r=Xt(t,n);if(Q.logger&&!Ut(t)){Q.logger(e,t,n)}if(n.error){H(n.error+(n.target?\", \"+n.target:\"\"));ae(e,\"htmx:error\",{errorInfo:n})}let o=e.dispatchEvent(r);const i=Bt(t);if(o&&i!==t){const s=Xt(i,r.detail);o=o&&e.dispatchEvent(s)}Vt(ue(e),function(e){o=o&&(e.onEvent(t,r)!==false&&!r.defaultPrevented)});return o}let jt;function $t(e){jt=e;if(U()){sessionStorage.setItem(\"htmx-current-path-for-history\",e)}}$t(location.pathname+location.search);function _t(){const e=te().querySelector(\"[hx-history-elt],[data-hx-history-elt]\");return e||te().body}function zt(t,e){if(!U()){return}const n=Kt(e);const r=te().title;const o=window.scrollY;if(Q.config.historyCacheSize<=0){sessionStorage.removeItem(\"htmx-history-cache\");return}t=V(t);const i=v(sessionStorage.getItem(\"htmx-history-cache\"))||[];for(let e=0;e<i.length;e++){if(i[e].url===t){i.splice(e,1);break}}const s={url:t,content:n,title:r,scroll:o};ae(te().body,\"htmx:historyItemCreated\",{item:s,cache:i});i.push(s);while(i.length>Q.config.historyCacheSize){i.shift()}while(i.length>0){try{sessionStorage.setItem(\"htmx-history-cache\",JSON.stringify(i));break}catch(e){fe(te().body,\"htmx:historyCacheError\",{cause:e,cache:i});i.shift()}}}function Jt(t){if(!U()){return null}t=V(t);const n=v(sessionStorage.getItem(\"htmx-history-cache\"))||[];for(let e=0;e<n.length;e++){if(n[e].url===t){return n[e]}}return null}function Kt(e){const t=Q.config.requestClass;const n=e.cloneNode(true);ie(y(n,\".\"+t),function(e){b(e,t)});ie(y(n,\"[data-disabled-by-htmx]\"),function(e){e.removeAttribute(\"disabled\")});return n.innerHTML}function Gt(){const e=_t();let t=jt;if(U()){t=sessionStorage.getItem(\"htmx-current-path-for-history\")}t=t||location.pathname+location.search;const n=te().querySelector('[hx-history=\"false\" i],[data-hx-history=\"false\" i]');if(!n){ae(te().body,\"htmx:beforeHistorySave\",{path:t,historyElt:e});zt(t,e)}if(Q.config.historyEnabled)history.replaceState({htmx:true},te().title,location.href)}function Wt(e){if(Q.config.getCacheBusterParam){e=e.replace(/org\\.htmx\\.cache-buster=[^&]*&?/,\"\");if(Z(e,\"&\")||Z(e,\"?\")){e=e.slice(0,-1)}}if(Q.config.historyEnabled){history.pushState({htmx:true},\"\",e)}$t(e)}function Zt(e){if(Q.config.historyEnabled)history.replaceState({htmx:true},\"\",e);$t(e)}function Yt(e){ie(e,function(e){e.call(undefined)})}function Qt(e){const t=new XMLHttpRequest;const n={swapStyle:\"innerHTML\",swapDelay:0,settleDelay:0};const r={path:e,xhr:t,historyElt:_t(),swapSpec:n};t.open(\"GET\",e,true);if(Q.config.historyRestoreAsHxRequest){t.setRequestHeader(\"HX-Request\",\"true\")}t.setRequestHeader(\"HX-History-Restore-Request\",\"true\");t.setRequestHeader(\"HX-Current-URL\",location.href);t.onload=function(){if(this.status>=200&&this.status<400){r.response=this.response;ae(te().body,\"htmx:historyCacheMissLoad\",r);_e(r.historyElt,r.response,n,{contextElement:r.historyElt,historyRequest:true});$t(r.path);ae(te().body,\"htmx:historyRestore\",{path:e,cacheMiss:true,serverResponse:r.response})}else{fe(te().body,\"htmx:historyCacheMissLoadError\",r)}};if(ae(te().body,\"htmx:historyCacheMiss\",r)){t.send()}}function en(e){Gt();e=e||location.pathname+location.search;const t=Jt(e);if(t){const n={swapStyle:\"innerHTML\",swapDelay:0,settleDelay:0,scroll:t.scroll};const r={path:e,item:t,historyElt:_t(),swapSpec:n};if(ae(te().body,\"htmx:historyCacheHit\",r)){_e(r.historyElt,t.content,n,{contextElement:r.historyElt,title:t.title});$t(r.path);ae(te().body,\"htmx:historyRestore\",r)}}else{if(Q.config.refreshOnHistoryMiss){Q.location.reload(true)}else{Qt(e)}}}function tn(e){let t=ve(e,\"hx-indicator\");if(t==null){t=[e]}ie(t,function(e){const t=oe(e);t.requestCount=(t.requestCount||0)+1;w(e,Q.config.requestClass)});return t}function nn(e){let t=ve(e,\"hx-disabled-elt\");if(t==null){t=[]}ie(t,function(e){const t=oe(e);t.requestCount=(t.requestCount||0)+1;if(!e.hasAttribute(\"disabled\")){e.setAttribute(\"disabled\",\"\");e.setAttribute(\"data-disabled-by-htmx\",\"\")}});return t}function rn(e,t){ie(e.concat(t),function(e){const t=oe(e);t.requestCount=(t.requestCount||1)-1});ie(e,function(e){const t=oe(e);if(t.requestCount===0){b(e,Q.config.requestClass)}});ie(t,function(e){const t=oe(e);if(t.requestCount===0&&e.hasAttribute(\"data-disabled-by-htmx\")){e.removeAttribute(\"disabled\");e.removeAttribute(\"data-disabled-by-htmx\")}})}function on(t,n){for(let e=0;e<t.length;e++){const r=t[e];if(r.isSameNode(n)){return true}}return false}function sn(e){const t=e;if(t.name===\"\"||t.name==null||t.disabled||g(t,\"fieldset[disabled]\")){return false}if(t.type===\"button\"||t.type===\"submit\"||t.tagName===\"image\"||t.tagName===\"reset\"||t.tagName===\"file\"){return false}if(t.type===\"checkbox\"||t.type===\"radio\"){return t.checked}return true}function ln(t,e,n){if(t!=null&&e!=null){if(Array.isArray(e)){e.forEach(function(e){n.append(t,e)})}else{n.append(t,e)}}}function un(t,n,r){if(t!=null&&n!=null){let e=r.getAll(t);if(Array.isArray(n)){e=e.filter(e=>n.indexOf(e)<0)}else{e=e.filter(e=>e!==n)}r.delete(t);ie(e,e=>r.append(t,e))}}function cn(e){if(e instanceof HTMLSelectElement&&e.multiple){return F(e.querySelectorAll(\"option:checked\")).map(function(e){return e.value})}if(e instanceof HTMLInputElement&&e.files){return F(e.files)}return e.value}function fn(t,n,r,e,o){if(e==null||on(t,e)){return}else{t.push(e)}if(sn(e)){const i=ee(e,\"name\");ln(i,cn(e),n);if(o){an(e,r)}}if(e instanceof HTMLFormElement){ie(e.elements,function(e){if(t.indexOf(e)>=0){un(e.name,cn(e),n)}else{t.push(e)}if(o){an(e,r)}});new FormData(e).forEach(function(e,t){if(e instanceof File&&e.name===\"\"){return}ln(t,e,n)})}}function an(e,t){const n=e;if(n.willValidate){ae(n,\"htmx:validation:validate\");if(!n.checkValidity()){if(ae(n,\"htmx:validation:failed\",{message:n.validationMessage,validity:n.validity})&&!t.length&&Q.config.reportValidityOfForms){n.reportValidity()}t.push({elt:n,message:n.validationMessage,validity:n.validity})}}}function hn(n,e){for(const t of e.keys()){n.delete(t)}e.forEach(function(e,t){n.append(t,e)});return n}function dn(e,t){const n=[];const r=new FormData;const o=new FormData;const i=[];const s=oe(e);if(s.lastButtonClicked&&!se(s.lastButtonClicked)){s.lastButtonClicked=null}let l=e instanceof HTMLFormElement&&e.noValidate!==true||a(e,\"hx-validate\")===\"true\";if(s.lastButtonClicked){l=l&&s.lastButtonClicked.formNoValidate!==true}if(t!==\"get\"){fn(n,o,i,Nt(e),l)}fn(n,r,i,e,l);if(s.lastButtonClicked||e.tagName===\"BUTTON\"||e.tagName===\"INPUT\"&&ee(e,\"type\")===\"submit\"){const c=s.lastButtonClicked||e;const f=ee(c,\"name\");ln(f,c.value,o)}const u=ve(e,\"hx-include\");ie(u,function(e){fn(n,r,i,ue(e),l);if(!h(e,\"form\")){ie(p(e).querySelectorAll(ot),function(e){fn(n,r,i,e,l)})}});hn(r,o);return{errors:i,formData:r,values:kn(r)}}function pn(e,t,n){if(e!==\"\"){e+=\"&\"}if(String(n)===\"[object Object]\"){n=JSON.stringify(n)}const r=encodeURIComponent(n);e+=encodeURIComponent(t)+\"=\"+r;return e}function gn(e){e=Dn(e);let n=\"\";e.forEach(function(e,t){n=pn(n,t,e)});return n}function mn(e,t,n){const r={\"HX-Request\":\"true\",\"HX-Trigger\":ee(e,\"id\"),\"HX-Trigger-Name\":ee(e,\"name\"),\"HX-Target\":a(t,\"id\"),\"HX-Current-URL\":location.href};Cn(e,\"hx-headers\",false,r);if(n!==undefined){r[\"HX-Prompt\"]=n}if(oe(e).boosted){r[\"HX-Boosted\"]=\"true\"}return r}function yn(n,e){const t=ne(e,\"hx-params\");if(t){if(t===\"none\"){return new FormData}else if(t===\"*\"){return n}else if(t.indexOf(\"not \")===0){ie(t.slice(4).split(\",\"),function(e){e=e.trim();n.delete(e)});return n}else{const r=new FormData;ie(t.split(\",\"),function(t){t=t.trim();if(n.has(t)){n.getAll(t).forEach(function(e){r.append(t,e)})}});return r}}else{return n}}function xn(e){return!!ee(e,\"href\")&&ee(e,\"href\").indexOf(\"#\")>=0}function bn(e,t){const n=t||ne(e,\"hx-swap\");const r={swapStyle:oe(e).boosted?\"innerHTML\":Q.config.defaultSwapStyle,swapDelay:Q.config.defaultSwapDelay,settleDelay:Q.config.defaultSettleDelay};if(Q.config.scrollIntoViewOnBoost&&oe(e).boosted&&!xn(e)){r.show=\"top\"}if(n){const s=X(n);if(s.length>0){for(let e=0;e<s.length;e++){const l=s[e];if(l.indexOf(\"swap:\")===0){r.swapDelay=d(l.slice(5))}else if(l.indexOf(\"settle:\")===0){r.settleDelay=d(l.slice(7))}else if(l.indexOf(\"transition:\")===0){r.transition=l.slice(11)===\"true\"}else if(l.indexOf(\"ignoreTitle:\")===0){r.ignoreTitle=l.slice(12)===\"true\"}else if(l.indexOf(\"scroll:\")===0){const u=l.slice(7);var o=u.split(\":\");const c=o.pop();var i=o.length>0?o.join(\":\"):null;r.scroll=c;r.scrollTarget=i}else if(l.indexOf(\"show:\")===0){const f=l.slice(5);var o=f.split(\":\");const a=o.pop();var i=o.length>0?o.join(\":\"):null;r.show=a;r.showTarget=i}else if(l.indexOf(\"focus-scroll:\")===0){const h=l.slice(\"focus-scroll:\".length);r.focusScroll=h==\"true\"}else if(e==0){r.swapStyle=l}else{H(\"Unknown modifier in hx-swap: \"+l)}}}}return r}function vn(e){return ne(e,\"hx-encoding\")===\"multipart/form-data\"||h(e,\"form\")&&ee(e,\"enctype\")===\"multipart/form-data\"}function wn(t,n,r){let o=null;Vt(n,function(e){if(o==null){o=e.encodeParameters(t,r,n)}});if(o!=null){return o}else{if(vn(n)){return hn(new FormData,Dn(r))}else{return gn(r)}}}function Sn(e){return{tasks:[],elts:[e]}}function En(e,t){const n=e[0];const r=e[e.length-1];if(t.scroll){var o=null;if(t.scrollTarget){o=ue(ce(n,t.scrollTarget))}if(t.scroll===\"top\"&&(n||o)){o=o||n;o.scrollTop=0}if(t.scroll===\"bottom\"&&(r||o)){o=o||r;o.scrollTop=o.scrollHeight}if(typeof t.scroll===\"number\"){x().setTimeout(function(){window.scrollTo(0,t.scroll)},0)}}if(t.show){var o=null;if(t.showTarget){let e=t.showTarget;if(t.showTarget===\"window\"){e=\"body\"}o=ue(ce(n,e))}if(t.show===\"top\"&&(n||o)){o=o||n;o.scrollIntoView({block:\"start\",behavior:Q.config.scrollBehavior})}if(t.show===\"bottom\"&&(r||o)){o=o||r;o.scrollIntoView({block:\"end\",behavior:Q.config.scrollBehavior})}}}function Cn(r,e,o,i,s){if(i==null){i={}}if(r==null){return i}const l=a(r,e);if(l){let e=l.trim();let t=o;if(e===\"unset\"){return null}if(e.indexOf(\"javascript:\")===0){e=e.slice(11);t=true}else if(e.indexOf(\"js:\")===0){e=e.slice(3);t=true}if(e.indexOf(\"{\")!==0){e=\"{\"+e+\"}\"}let n;if(t){n=On(r,function(){if(s){return Function(\"event\",\"return (\"+e+\")\").call(r,s)}else{return Function(\"return (\"+e+\")\").call(r)}},{})}else{n=v(e)}for(const u in n){if(n.hasOwnProperty(u)){if(i[u]==null){i[u]=n[u]}}}}return Cn(ue(c(r)),e,o,i,s)}function On(e,t,n){if(Q.config.allowEval){return t()}else{fe(e,\"htmx:evalDisallowedError\");return n}}function Hn(e,t,n){return Cn(e,\"hx-vars\",true,n,t)}function Tn(e,t,n){return Cn(e,\"hx-vals\",false,n,t)}function Rn(e,t){return le(Hn(e,t),Tn(e,t))}function qn(t,n,r){if(r!==null){try{t.setRequestHeader(n,r)}catch(e){t.setRequestHeader(n,encodeURIComponent(r));t.setRequestHeader(n+\"-URI-AutoEncoded\",\"true\")}}}function An(t){if(t.responseURL){try{const e=new URL(t.responseURL);return e.pathname+e.search}catch(e){fe(te().body,\"htmx:badResponseUrl\",{url:t.responseURL})}}}function T(e,t){return t.test(e.getAllResponseHeaders())}function Nn(t,n,r){t=t.toLowerCase();if(r){if(r instanceof Element||typeof r===\"string\"){return he(t,n,null,null,{targetOverride:S(r)||be,returnPromise:true})}else{let e=S(r.target);if(r.target&&!e||r.source&&!e&&!S(r.source)){e=be}return he(t,n,S(r.source),r.event,{handler:r.handler,headers:r.headers,values:r.values,targetOverride:e,swapOverride:r.swap,select:r.select,returnPromise:true,push:r.push,replace:r.replace,selectOOB:r.selectOOB})}}else{return he(t,n,null,null,{returnPromise:true})}}function In(e){const t=[];while(e){t.push(e);e=e.parentElement}return t}function Ln(e,t,n){const r=new URL(t,location.protocol!==\"about:\"?location.href:window.origin);const o=location.protocol!==\"about:\"?location.origin:window.origin;const i=o===r.origin;if(Q.config.selfRequestsOnly){if(!i){return false}}return ae(e,\"htmx:validateUrl\",le({url:r,sameHost:i},n))}function Dn(e){if(e instanceof FormData)return e;const t=new FormData;for(const n in e){if(e.hasOwnProperty(n)){if(e[n]&&typeof e[n].forEach===\"function\"){e[n].forEach(function(e){t.append(n,e)})}else if(typeof e[n]===\"object\"&&!(e[n]instanceof Blob)){t.append(n,JSON.stringify(e[n]))}else{t.append(n,e[n])}}}return t}function Pn(r,o,e){return new Proxy(e,{get:function(t,e){if(typeof e===\"number\")return t[e];if(e===\"length\")return t.length;if(e===\"push\"){return function(e){t.push(e);r.append(o,e)}}if(typeof t[e]===\"function\"){return function(){t[e].apply(t,arguments);r.delete(o);t.forEach(function(e){r.append(o,e)})}}if(t[e]&&t[e].length===1){return t[e][0]}else{return t[e]}},set:function(e,t,n){e[t]=n;r.delete(o);e.forEach(function(e){r.append(o,e)});return true}})}function kn(o){return new Proxy(o,{get:function(e,t){if(typeof t===\"symbol\"){const r=Reflect.get(e,t);if(typeof r===\"function\"){return function(){return r.apply(o,arguments)}}else{return r}}if(t===\"toJSON\"){return()=>Object.fromEntries(o)}if(t in e){if(typeof e[t]===\"function\"){return function(){return o[t].apply(o,arguments)}}}const n=o.getAll(t);if(n.length===0){return undefined}else if(n.length===1){return n[0]}else{return Pn(e,t,n)}},set:function(t,n,e){if(typeof n!==\"string\"){return false}t.delete(n);if(e&&typeof e.forEach===\"function\"){e.forEach(function(e){t.append(n,e)})}else if(typeof e===\"object\"&&!(e instanceof Blob)){t.append(n,JSON.stringify(e))}else{t.append(n,e)}return true},deleteProperty:function(e,t){if(typeof t===\"string\"){e.delete(t)}return true},ownKeys:function(e){return Reflect.ownKeys(Object.fromEntries(e))},getOwnPropertyDescriptor:function(e,t){return Reflect.getOwnPropertyDescriptor(Object.fromEntries(e),t)}})}function he(t,n,r,o,i,k){let s=null;let l=null;i=i!=null?i:{};if(i.returnPromise&&typeof Promise!==\"undefined\"){var e=new Promise(function(e,t){s=e;l=t})}if(r==null){r=te().body}const M=i.handler||Vn;const F=i.select||null;if(!se(r)){re(s);return e}const u=i.targetOverride||ue(Se(r));if(u==null||u==be){fe(r,\"htmx:targetError\",{target:ne(r,\"hx-target\")});re(l);return e}let c=oe(r);const f=c.lastButtonClicked;if(f){const A=ee(f,\"formaction\");if(A!=null){n=A}const N=ee(f,\"formmethod\");if(N!=null){if(de.includes(N.toLowerCase())){t=N}else{re(s);return e}}}const a=ne(r,\"hx-confirm\");if(k===undefined){const K=function(e){return he(t,n,r,o,i,!!e)};const G={target:u,elt:r,path:n,verb:t,triggeringEvent:o,etc:i,issueRequest:K,question:a};if(ae(r,\"htmx:confirm\",G)===false){re(s);return e}}let h=r;let d=ne(r,\"hx-sync\");let p=null;let B=false;if(d){const I=d.split(\":\");const L=I[0].trim();if(L===\"this\"){h=we(r,\"hx-sync\")}else{h=ue(ce(r,L))}d=(I[1]||\"drop\").trim();c=oe(h);if(d===\"drop\"&&c.xhr&&c.abortable!==true){re(s);return e}else if(d===\"abort\"){if(c.xhr){re(s);return e}else{B=true}}else if(d===\"replace\"){ae(h,\"htmx:abort\")}else if(d.indexOf(\"queue\")===0){const W=d.split(\" \");p=(W[1]||\"last\").trim()}}if(c.xhr){if(c.abortable){ae(h,\"htmx:abort\")}else{if(p==null){if(o){const D=oe(o);if(D&&D.triggerSpec&&D.triggerSpec.queue){p=D.triggerSpec.queue}}if(p==null){p=\"last\"}}if(c.queuedRequests==null){c.queuedRequests=[]}if(p===\"first\"&&c.queuedRequests.length===0){c.queuedRequests.push(function(){he(t,n,r,o,i)})}else if(p===\"all\"){c.queuedRequests.push(function(){he(t,n,r,o,i)})}else if(p===\"last\"){c.queuedRequests=[];c.queuedRequests.push(function(){he(t,n,r,o,i)})}re(s);return e}}const g=new XMLHttpRequest;c.xhr=g;c.abortable=B;const m=function(){c.xhr=null;c.abortable=false;if(c.queuedRequests!=null&&c.queuedRequests.length>0){const e=c.queuedRequests.shift();e()}};const X=ne(r,\"hx-prompt\");if(X){var y=prompt(X);if(y===null||!ae(r,\"htmx:prompt\",{prompt:y,target:u})){re(s);m();return e}}if(a&&!k){if(!confirm(a)){re(s);m();return e}}let x=mn(r,u,y);if(t!==\"get\"&&!vn(r)){x[\"Content-Type\"]=\"application/x-www-form-urlencoded\"}if(i.headers){x=le(x,i.headers)}const U=dn(r,t);let b=U.errors;const V=U.formData;if(i.values){hn(V,Dn(i.values))}const j=Dn(Rn(r,o));const v=hn(V,j);let w=yn(v,r);if(Q.config.getCacheBusterParam&&t===\"get\"){w.set(\"org.htmx.cache-buster\",ee(u,\"id\")||\"true\")}if(n==null||n===\"\"){n=location.href}const S=Cn(r,\"hx-request\");const $=oe(r).boosted;let E=Q.config.methodsThatUseUrlParams.indexOf(t)>=0;const C={boosted:$,useUrlParams:E,formData:w,parameters:kn(w),unfilteredFormData:v,unfilteredParameters:kn(v),headers:x,elt:r,target:u,verb:t,errors:b,withCredentials:i.credentials||S.credentials||Q.config.withCredentials,timeout:i.timeout||S.timeout||Q.config.timeout,path:n,triggeringEvent:o};if(!ae(r,\"htmx:configRequest\",C)){re(s);m();return e}n=C.path;t=C.verb;x=C.headers;w=Dn(C.parameters);b=C.errors;E=C.useUrlParams;if(b&&b.length>0){ae(r,\"htmx:validation:halted\",C);re(s);m();return e}const _=n.split(\"#\");const z=_[0];const O=_[1];let H=n;if(E){H=z;const Z=!w.keys().next().done;if(Z){if(H.indexOf(\"?\")<0){H+=\"?\"}else{H+=\"&\"}H+=gn(w);if(O){H+=\"#\"+O}}}if(!Ln(r,H,C)){fe(r,\"htmx:invalidPath\",C);re(l);m();return e}g.open(t.toUpperCase(),H,true);g.overrideMimeType(\"text/html\");g.withCredentials=C.withCredentials;g.timeout=C.timeout;if(S.noHeaders){}else{for(const P in x){if(x.hasOwnProperty(P)){const Y=x[P];qn(g,P,Y)}}}const T={xhr:g,target:u,requestConfig:C,etc:i,boosted:$,select:F,pathInfo:{requestPath:n,finalRequestPath:H,responsePath:null,anchor:O}};g.onload=function(){try{const t=In(r);T.pathInfo.responsePath=An(g);M(r,T);if(T.keepIndicators!==true){rn(R,q)}ae(r,\"htmx:afterRequest\",T);ae(r,\"htmx:afterOnLoad\",T);if(!se(r)){let e=null;while(t.length>0&&e==null){const n=t.shift();if(se(n)){e=n}}if(e){ae(e,\"htmx:afterRequest\",T);ae(e,\"htmx:afterOnLoad\",T)}}re(s)}catch(e){fe(r,\"htmx:onLoadError\",le({error:e},T));throw e}finally{m()}};g.onerror=function(){rn(R,q);fe(r,\"htmx:afterRequest\",T);fe(r,\"htmx:sendError\",T);re(l);m()};g.onabort=function(){rn(R,q);fe(r,\"htmx:afterRequest\",T);fe(r,\"htmx:sendAbort\",T);re(l);m()};g.ontimeout=function(){rn(R,q);fe(r,\"htmx:afterRequest\",T);fe(r,\"htmx:timeout\",T);re(l);m()};if(!ae(r,\"htmx:beforeRequest\",T)){re(s);m();return e}var R=tn(r);var q=nn(r);ie([\"loadstart\",\"loadend\",\"progress\",\"abort\"],function(t){ie([g,g.upload],function(e){e.addEventListener(t,function(e){ae(r,\"htmx:xhr:\"+t,{lengthComputable:e.lengthComputable,loaded:e.loaded,total:e.total})})})});ae(r,\"htmx:beforeSend\",T);const J=E?null:wn(g,r,w);g.send(J);return e}function Mn(e,t){const n=t.xhr;let r=null;let o=null;if(T(n,/HX-Push:/i)){r=n.getResponseHeader(\"HX-Push\");o=\"push\"}else if(T(n,/HX-Push-Url:/i)){r=n.getResponseHeader(\"HX-Push-Url\");o=\"push\"}else if(T(n,/HX-Replace-Url:/i)){r=n.getResponseHeader(\"HX-Replace-Url\");o=\"replace\"}if(r){if(r===\"false\"){return{}}else{return{type:o,path:r}}}const i=t.pathInfo.finalRequestPath;const s=t.pathInfo.responsePath;let l=t.etc.push||ne(e,\"hx-push-url\");let u=t.etc.replace||ne(e,\"hx-replace-url\");if(l===\"false\")l=null;if(u===\"false\")u=null;const c=oe(e).boosted;let f=null;let a=null;if(l){f=\"push\";a=l}else if(u){f=\"replace\";a=u}else if(c){f=\"push\";a=s||i}if(a){if(a===\"true\"){a=s||i}if(t.pathInfo.anchor&&a.indexOf(\"#\")===-1){a=a+\"#\"+t.pathInfo.anchor}return{type:f,path:a}}else{return{}}}function Fn(e,t){var n=new RegExp(e.code);return n.test(t.toString(10))}function Bn(e){for(var t=0;t<Q.config.responseHandling.length;t++){var n=Q.config.responseHandling[t];if(Fn(n,e.status)){return n}}return{swap:false}}function Xn(e){if(e){const t=f(\"title\");if(t){t.textContent=e}else{window.document.title=e}}}function Un(e,t){if(t===\"this\"){return e}const n=ue(ce(e,t));if(n==null){fe(e,\"htmx:targetError\",{target:t});throw new Error(`Invalid re-target ${t}`)}return n}function Vn(t,e){const n=e.xhr;let r=e.target;const o=e.etc;const i=e.select;if(!ae(t,\"htmx:beforeOnLoad\",e))return;if(T(n,/HX-Trigger:/i)){ze(n,\"HX-Trigger\",t)}if(T(n,/HX-Location:/i)){let e=n.getResponseHeader(\"HX-Location\");var s={};if(e.indexOf(\"{\")===0){s=v(e);e=s.path;delete s.path}s.push=s.push??\"true\";Nn(\"get\",e,s);return}const l=T(n,/HX-Refresh:/i)&&n.getResponseHeader(\"HX-Refresh\")===\"true\";if(T(n,/HX-Redirect:/i)){e.keepIndicators=true;Q.location.href=n.getResponseHeader(\"HX-Redirect\");l&&Q.location.reload();return}if(l){e.keepIndicators=true;Q.location.reload();return}const u=Mn(t,e);const c=Bn(n);const f=c.swap;let a=!!c.error;let h=Q.config.ignoreTitle||c.ignoreTitle;let d=c.select;if(c.target){e.target=Un(t,c.target)}var p=o.swapOverride;if(p==null&&c.swapOverride){p=c.swapOverride}if(T(n,/HX-Retarget:/i)){e.target=Un(t,n.getResponseHeader(\"HX-Retarget\"))}if(T(n,/HX-Reswap:/i)){p=n.getResponseHeader(\"HX-Reswap\")}var g=n.response;var m=le({shouldSwap:f,serverResponse:g,isError:a,ignoreTitle:h,selectOverride:d,swapOverride:p},e);if(c.event&&!ae(r,c.event,m))return;if(!ae(r,\"htmx:beforeSwap\",m))return;r=m.target;g=m.serverResponse;a=m.isError;h=m.ignoreTitle;d=m.selectOverride;p=m.swapOverride;e.target=r;e.failed=a;e.successful=!a;if(m.shouldSwap){if(n.status===286){lt(t)}Vt(t,function(e){g=e.transformResponse(g,n,t)});if(u.type){Gt()}var y=bn(t,p);if(!y.hasOwnProperty(\"ignoreTitle\")){y.ignoreTitle=h}w(r,Q.config.swappingClass);if(i){d=i}if(T(n,/HX-Reselect:/i)){d=n.getResponseHeader(\"HX-Reselect\")}const x=o.selectOOB||ne(t,\"hx-select-oob\");const b=ne(t,\"hx-select\");_e(r,g,y,{select:d===\"unset\"?null:d||b,selectOOB:x,eventInfo:e,anchor:e.pathInfo.anchor,contextElement:t,afterSwapCallback:function(){if(T(n,/HX-Trigger-After-Swap:/i)){let e=t;if(!se(t)){e=te().body}ze(n,\"HX-Trigger-After-Swap\",e)}},afterSettleCallback:function(){if(T(n,/HX-Trigger-After-Settle:/i)){let e=t;if(!se(t)){e=te().body}ze(n,\"HX-Trigger-After-Settle\",e)}},beforeSwapCallback:function(){if(u.type){ae(te().body,\"htmx:beforeHistoryUpdate\",le({history:u},e));if(u.type===\"push\"){Wt(u.path);ae(te().body,\"htmx:pushedIntoHistory\",{path:u.path})}else{Zt(u.path);ae(te().body,\"htmx:replacedInHistory\",{path:u.path})}}}})}if(a){fe(t,\"htmx:responseError\",le({error:\"Response Status Error Code \"+n.status+\" from \"+e.pathInfo.requestPath},e))}}const jn={};function $n(){return{init:function(e){return null},getSelectors:function(){return null},onEvent:function(e,t){return true},transformResponse:function(e,t,n){return e},isInlineSwap:function(e){return false},handleSwap:function(e,t,n,r){return false},encodeParameters:function(e,t,n){return null}}}function _n(e,t){if(t.init){t.init(n)}jn[e]=le($n(),t)}function zn(e){delete jn[e]}function Jn(e,n,r){if(n==undefined){n=[]}if(e==undefined){return n}if(r==undefined){r=[]}const t=a(e,\"hx-ext\");if(t){ie(t.split(\",\"),function(e){e=e.replace(/ /g,\"\");if(e.slice(0,7)==\"ignore:\"){r.push(e.slice(7));return}if(r.indexOf(e)<0){const t=jn[e];if(t&&n.indexOf(t)<0){n.push(t)}}})}return Jn(ue(c(e)),n,r)}var Kn=false;te().addEventListener(\"DOMContentLoaded\",function(){Kn=true});function Gn(e){if(Kn||te().readyState===\"complete\"){e()}else{te().addEventListener(\"DOMContentLoaded\",e)}}function Wn(){if(Q.config.includeIndicatorStyles!==false){const e=Q.config.inlineStyleNonce?` nonce=\"${Q.config.inlineStyleNonce}\"`:\"\";const t=Q.config.indicatorClass;const n=Q.config.requestClass;te().head.insertAdjacentHTML(\"beforeend\",`<style${e}>`+`.${t}{opacity:0;visibility: hidden} `+`.${n} .${t}, .${n}.${t}{opacity:1;visibility: visible;transition: opacity 200ms ease-in}`+\"</style>\")}}function Zn(){const e=te().querySelector('meta[name=\"htmx-config\"]');if(e){return v(e.content)}else{return null}}function Yn(){const e=Zn();if(e){Q.config=le(Q.config,e)}}Gn(function(){Yn();Wn();let e=te().body;Ft(e);const t=te().querySelectorAll(\"[hx-trigger='restored'],[data-hx-trigger='restored']\");e.addEventListener(\"htmx:abort\",function(e){const t=e.detail.elt||e.target;const n=oe(t);if(n&&n.xhr){n.xhr.abort()}});const n=window.onpopstate?window.onpopstate.bind(window):null;window.onpopstate=function(e){if(e.state&&e.state.htmx){en();ie(t,function(e){ae(e,\"htmx:restored\",{document:te(),triggerEvent:ae})})}else{if(n){n(e)}}};x().setTimeout(function(){ae(e,\"htmx:load\",{});e=null},0)});return Q}();",
client: "(() => {\n var __create = Object.create;\n var __defProp = Object.defineProperty;\n var __getOwnPropDesc = Object.getOwnPropertyDescriptor;\n var __getOwnPropNames = Object.getOwnPropertyNames;\n var __getProtoOf = Object.getPrototypeOf;\n var __hasOwnProp = Object.prototype.hasOwnProperty;\n var __commonJS = (cb, mod) => function __require() {\n try {\n return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;\n } catch (e) {\n throw mod = 0, e;\n }\n };\n var __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n };\n var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(\n // If the importer is in node compatibility mode or this is not an ESM\n // file that has been converted to a CommonJS file using a Babel-\n // compatible transform (i.e. \"__esModule\" has not been set), then set\n // \"default\" to the CommonJS \"module.exports\" for node compatibility.\n isNodeMode || !mod || !mod.__esModule ? __defProp(target, \"default\", { value: mod, enumerable: true }) : target,\n mod\n ));\n\n // node_modules/base64-js/index.js\n var require_base64_js = __commonJS({\n \"node_modules/base64-js/index.js\"(exports) {\n \"use strict\";\n exports.byteLength = byteLength;\n exports.toByteArray = toByteArray;\n exports.fromByteArray = fromByteArray;\n var lookup = [];\n var revLookup = [];\n var Arr = typeof Uint8Array !== \"undefined\" ? Uint8Array : Array;\n var code = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\";\n for (i = 0, len = code.length; i < len; ++i) {\n lookup[i] = code[i];\n revLookup[code.charCodeAt(i)] = i;\n }\n var i;\n var len;\n revLookup[\"-\".charCodeAt(0)] = 62;\n revLookup[\"_\".charCodeAt(0)] = 63;\n function getLens(b64) {\n var len2 = b64.length;\n if (len2 % 4 > 0) {\n throw new Error(\"Invalid string. Length must be a multiple of 4\");\n }\n var validLen = b64.indexOf(\"=\");\n if (validLen === -1) validLen = len2;\n var placeHoldersLen = validLen === len2 ? 0 : 4 - validLen % 4;\n return [validLen, placeHoldersLen];\n }\n function byteLength(b64) {\n var lens = getLens(b64);\n var validLen = lens[0];\n var placeHoldersLen = lens[1];\n return (validLen + placeHoldersLen) * 3 / 4 - placeHoldersLen;\n }\n function _byteLength(b64, validLen, placeHoldersLen) {\n return (validLen + placeHoldersLen) * 3 / 4 - placeHoldersLen;\n }\n function toByteArray(b64) {\n var tmp;\n var lens = getLens(b64);\n var validLen = lens[0];\n var placeHoldersLen = lens[1];\n var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen));\n var curByte = 0;\n var len2 = placeHoldersLen > 0 ? validLen - 4 : validLen;\n var i2;\n for (i2 = 0; i2 < len2; i2 += 4) {\n tmp = revLookup[b64.charCodeAt(i2)] << 18 | revLookup[b64.charCodeAt(i2 + 1)] << 12 | revLookup[b64.charCodeAt(i2 + 2)] << 6 | revLookup[b64.charCodeAt(i2 + 3)];\n arr[curByte++] = tmp >> 16 & 255;\n arr[curByte++] = tmp >> 8 & 255;\n arr[curByte++] = tmp & 255;\n }\n if (placeHoldersLen === 2) {\n tmp = revLookup[b64.charCodeAt(i2)] << 2 | revLookup[b64.charCodeAt(i2 + 1)] >> 4;\n arr[curByte++] = tmp & 255;\n }\n if (placeHoldersLen === 1) {\n tmp = revLookup[b64.charCodeAt(i2)] << 10 | revLookup[b64.charCodeAt(i2 + 1)] << 4 | revLookup[b64.charCodeAt(i2 + 2)] >> 2;\n arr[curByte++] = tmp >> 8 & 255;\n arr[curByte++] = tmp & 255;\n }\n return arr;\n }\n function tripletToBase64(num) {\n return lookup[num >> 18 & 63] + lookup[num >> 12 & 63] + lookup[num >> 6 & 63] + lookup[num & 63];\n }\n function encodeChunk(uint8, start, end) {\n var tmp;\n var output = [];\n for (var i2 = start; i2 < end; i2 += 3) {\n tmp = (uint8[i2] << 16 & 16711680) + (uint8[i2 + 1] << 8 & 65280) + (uint8[i2 + 2] & 255);\n output.push(tripletToBase64(tmp));\n }\n return output.join(\"\");\n }\n function fromByteArray(uint8) {\n var tmp;\n var len2 = uint8.length;\n var extraBytes = len2 % 3;\n var parts = [];\n var maxChunkLength = 16383;\n for (var i2 = 0, len22 = len2 - extraBytes; i2 < len22; i2 += maxChunkLength) {\n parts.push(encodeChunk(uint8, i2, i2 + maxChunkLength > len22 ? len22 : i2 + maxChunkLength));\n }\n if (extraBytes === 1) {\n tmp = uint8[len2 - 1];\n parts.push(\n lookup[tmp >> 2] + lookup[tmp << 4 & 63] + \"==\"\n );\n } else if (extraBytes === 2) {\n tmp = (uint8[len2 - 2] << 8) + uint8[len2 - 1];\n parts.push(\n lookup[tmp >> 10] + lookup[tmp >> 4 & 63] + lookup[tmp << 2 & 63] + \"=\"\n );\n }\n return parts.join(\"\");\n }\n }\n });\n\n // node_modules/ieee754/index.js\n var require_ieee754 = __commonJS({\n \"node_modules/ieee754/index.js\"(exports) {\n exports.read = function(buffer, offset, isLE, mLen, nBytes) {\n var e, m;\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var nBits = -7;\n var i = isLE ? nBytes - 1 : 0;\n var d = isLE ? -1 : 1;\n var s = buffer[offset + i];\n i += d;\n e = s & (1 << -nBits) - 1;\n s >>= -nBits;\n nBits += eLen;\n for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8) {\n }\n m = e & (1 << -nBits) - 1;\n e >>= -nBits;\n nBits += mLen;\n for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8) {\n }\n if (e === 0) {\n e = 1 - eBias;\n } else if (e === eMax) {\n return m ? NaN : (s ? -1 : 1) * Infinity;\n } else {\n m = m + Math.pow(2, mLen);\n e = e - eBias;\n }\n return (s ? -1 : 1) * m * Math.pow(2, e - mLen);\n };\n exports.write = function(buffer, value, offset, isLE, mLen, nBytes) {\n var e, m, c2;\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0;\n var i = isLE ? 0 : nBytes - 1;\n var d = isLE ? 1 : -1;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n value = Math.abs(value);\n if (isNaN(value) || value === Infinity) {\n m = isNaN(value) ? 1 : 0;\n e = eMax;\n } else {\n e = Math.floor(Math.log(value) / Math.LN2);\n if (value * (c2 = Math.pow(2, -e)) < 1) {\n e--;\n c2 *= 2;\n }\n if (e + eBias >= 1) {\n value += rt / c2;\n } else {\n value += rt * Math.pow(2, 1 - eBias);\n }\n if (value * c2 >= 2) {\n e++;\n c2 /= 2;\n }\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c2 - 1) * Math.pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen);\n e = 0;\n }\n }\n for (; mLen >= 8; buffer[offset + i] = m & 255, i += d, m /= 256, mLen -= 8) {\n }\n e = e << mLen | m;\n eLen += mLen;\n for (; eLen > 0; buffer[offset + i] = e & 255, i += d, e /= 256, eLen -= 8) {\n }\n buffer[offset + i - d] |= s * 128;\n };\n }\n });\n\n // node_modules/buffer/index.js\n var require_buffer = __commonJS({\n \"node_modules/buffer/index.js\"(exports) {\n \"use strict\";\n var base64 = require_base64_js();\n var ieee754 = require_ieee754();\n var customInspectSymbol = typeof Symbol === \"function\" && typeof Symbol[\"for\"] === \"function\" ? Symbol[\"for\"](\"nodejs.util.inspect.custom\") : null;\n exports.Buffer = Buffer3;\n exports.SlowBuffer = SlowBuffer;\n exports.INSPECT_MAX_BYTES = 50;\n var K_MAX_LENGTH = 2147483647;\n exports.kMaxLength = K_MAX_LENGTH;\n Buffer3.TYPED_ARRAY_SUPPORT = typedArraySupport();\n if (!Buffer3.TYPED_ARRAY_SUPPORT && typeof console !== \"undefined\" && typeof console.error === \"function\") {\n console.error(\n \"This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.\"\n );\n }\n function typedArraySupport() {\n try {\n const arr = new Uint8Array(1);\n const proto = { foo: function() {\n return 42;\n } };\n Object.setPrototypeOf(proto, Uint8Array.prototype);\n Object.setPrototypeOf(arr, proto);\n return arr.foo() === 42;\n } catch (e) {\n return false;\n }\n }\n Object.defineProperty(Buffer3.prototype, \"parent\", {\n enumerable: true,\n get: function() {\n if (!Buffer3.isBuffer(this)) return void 0;\n return this.buffer;\n }\n });\n Object.defineProperty(Buffer3.prototype, \"offset\", {\n enumerable: true,\n get: function() {\n if (!Buffer3.isBuffer(this)) return void 0;\n return this.byteOffset;\n }\n });\n function createBuffer(length) {\n if (length > K_MAX_LENGTH) {\n throw new RangeError('The value \"' + length + '\" is invalid for option \"size\"');\n }\n const buf = new Uint8Array(length);\n Object.setPrototypeOf(buf, Buffer3.prototype);\n return buf;\n }\n function Buffer3(arg, encodingOrOffset, length) {\n if (typeof arg === \"number\") {\n if (typeof encodingOrOffset === \"string\") {\n throw new TypeError(\n 'The \"string\" argument must be of type string. Received type number'\n );\n }\n return allocUnsafe(arg);\n }\n return from(arg, encodingOrOffset, length);\n }\n Buffer3.poolSize = 8192;\n function from(value, encodingOrOffset, length) {\n if (typeof value === \"string\") {\n return fromString(value, encodingOrOffset);\n }\n if (ArrayBuffer.isView(value)) {\n return fromArrayView(value);\n }\n if (value == null) {\n throw new TypeError(\n \"The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type \" + typeof value\n );\n }\n if (isInstance(value, ArrayBuffer) || value && isInstance(value.buffer, ArrayBuffer)) {\n return fromArrayBuffer(value, encodingOrOffset, length);\n }\n if (typeof SharedArrayBuffer !== \"undefined\" && (isInstance(value, SharedArrayBuffer) || value && isInstance(value.buffer, SharedArrayBuffer))) {\n return fromArrayBuffer(value, encodingOrOffset, length);\n }\n if (typeof value === \"number\") {\n throw new TypeError(\n 'The \"value\" argument must not be of type number. Received type number'\n );\n }\n const valueOf = value.valueOf && value.valueOf();\n if (valueOf != null && valueOf !== value) {\n return Buffer3.from(valueOf, encodingOrOffset, length);\n }\n const b = fromObject(value);\n if (b) return b;\n if (typeof Symbol !== \"undefined\" && Symbol.toPrimitive != null && typeof value[Symbol.toPrimitive] === \"function\") {\n return Buffer3.from(value[Symbol.toPrimitive](\"string\"), encodingOrOffset, length);\n }\n throw new TypeError(\n \"The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type \" + typeof value\n );\n }\n Buffer3.from = function(value, encodingOrOffset, length) {\n return from(value, encodingOrOffset, length);\n };\n Object.setPrototypeOf(Buffer3.prototype, Uint8Array.prototype);\n Object.setPrototypeOf(Buffer3, Uint8Array);\n function assertSize(size) {\n if (typeof size !== \"number\") {\n throw new TypeError('\"size\" argument must be of type number');\n } else if (size < 0) {\n throw new RangeError('The value \"' + size + '\" is invalid for option \"size\"');\n }\n }\n function alloc(size, fill, encoding) {\n assertSize(size);\n if (size <= 0) {\n return createBuffer(size);\n }\n if (fill !== void 0) {\n return typeof encoding === \"string\" ? createBuffer(size).fill(fill, encoding) : createBuffer(size).fill(fill);\n }\n return createBuffer(size);\n }\n Buffer3.alloc = function(size, fill, encoding) {\n return alloc(size, fill, encoding);\n };\n function allocUnsafe(size) {\n assertSize(size);\n return createBuffer(size < 0 ? 0 : checked(size) | 0);\n }\n Buffer3.allocUnsafe = function(size) {\n return allocUnsafe(size);\n };\n Buffer3.allocUnsafeSlow = function(size) {\n return allocUnsafe(size);\n };\n function fromString(string, encoding) {\n if (typeof encoding !== \"string\" || encoding === \"\") {\n encoding = \"utf8\";\n }\n if (!Buffer3.isEncoding(encoding)) {\n throw new TypeError(\"Unknown encoding: \" + encoding);\n }\n const length = byteLength(string, encoding) | 0;\n let buf = createBuffer(length);\n const actual = buf.write(string, encoding);\n if (actual !== length) {\n buf = buf.slice(0, actual);\n }\n return buf;\n }\n function fromArrayLike(array) {\n const length = array.length < 0 ? 0 : checked(array.length) | 0;\n const buf = createBuffer(length);\n for (let i = 0; i < length; i += 1) {\n buf[i] = array[i] & 255;\n }\n return buf;\n }\n function fromArrayView(arrayView) {\n if (isInstance(arrayView, Uint8Array)) {\n const copy = new Uint8Array(arrayView);\n return fromArrayBuffer(copy.buffer, copy.byteOffset, copy.byteLength);\n }\n return fromArrayLike(arrayView);\n }\n function fromArrayBuffer(array, byteOffset, length) {\n if (byteOffset < 0 || array.byteLength < byteOffset) {\n throw new RangeError('\"offset\" is outside of buffer bounds');\n }\n if (array.byteLength < byteOffset + (length || 0)) {\n throw new RangeError('\"length\" is outside of buffer bounds');\n }\n let buf;\n if (byteOffset === void 0 && length === void 0) {\n buf = new Uint8Array(array);\n } else if (length === void 0) {\n buf = new Uint8Array(array, byteOffset);\n } else {\n buf = new Uint8Array(array, byteOffset, length);\n }\n Object.setPrototypeOf(buf, Buffer3.prototype);\n return buf;\n }\n function fromObject(obj) {\n if (Buffer3.isBuffer(obj)) {\n const len = checked(obj.length) | 0;\n const buf = createBuffer(len);\n if (buf.length === 0) {\n return buf;\n }\n obj.copy(buf, 0, 0, len);\n return buf;\n }\n if (obj.length !== void 0) {\n if (typeof obj.length !== \"number\" || numberIsNaN(obj.length)) {\n return createBuffer(0);\n }\n return fromArrayLike(obj);\n }\n if (obj.type === \"Buffer\" && Array.isArray(obj.data)) {\n return fromArrayLike(obj.data);\n }\n }\n function checked(length) {\n if (length >= K_MAX_LENGTH) {\n throw new RangeError(\"Attempt to allocate Buffer larger than maximum size: 0x\" + K_MAX_LENGTH.toString(16) + \" bytes\");\n }\n return length | 0;\n }\n function SlowBuffer(length) {\n if (+length != length) {\n length = 0;\n }\n return Buffer3.alloc(+length);\n }\n Buffer3.isBuffer = function isBuffer(b) {\n return b != null && b._isBuffer === true && b !== Buffer3.prototype;\n };\n Buffer3.compare = function compare(a, b) {\n if (isInstance(a, Uint8Array)) a = Buffer3.from(a, a.offset, a.byteLength);\n if (isInstance(b, Uint8Array)) b = Buffer3.from(b, b.offset, b.byteLength);\n if (!Buffer3.isBuffer(a) || !Buffer3.isBuffer(b)) {\n throw new TypeError(\n 'The \"buf1\", \"buf2\" arguments must be one of type Buffer or Uint8Array'\n );\n }\n if (a === b) return 0;\n let x = a.length;\n let y = b.length;\n for (let i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i];\n y = b[i];\n break;\n }\n }\n if (x < y) return -1;\n if (y < x) return 1;\n return 0;\n };\n Buffer3.isEncoding = function isEncoding(encoding) {\n switch (String(encoding).toLowerCase()) {\n case \"hex\":\n case \"utf8\":\n case \"utf-8\":\n case \"ascii\":\n case \"latin1\":\n case \"binary\":\n case \"base64\":\n case \"ucs2\":\n case \"ucs-2\":\n case \"utf16le\":\n case \"utf-16le\":\n return true;\n default:\n return false;\n }\n };\n Buffer3.concat = function concat(list, length) {\n if (!Array.isArray(list)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers');\n }\n if (list.length === 0) {\n return Buffer3.alloc(0);\n }\n let i;\n if (length === void 0) {\n length = 0;\n for (i = 0; i < list.length; ++i) {\n length += list[i].length;\n }\n }\n const buffer = Buffer3.allocUnsafe(length);\n let pos = 0;\n for (i = 0; i < list.length; ++i) {\n let buf = list[i];\n if (isInstance(buf, Uint8Array)) {\n if (pos + buf.length > buffer.length) {\n if (!Buffer3.isBuffer(buf)) buf = Buffer3.from(buf);\n buf.copy(buffer, pos);\n } else {\n Uint8Array.prototype.set.call(\n buffer,\n buf,\n pos\n );\n }\n } else if (!Buffer3.isBuffer(buf)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers');\n } else {\n buf.copy(buffer, pos);\n }\n pos += buf.length;\n }\n return buffer;\n };\n function byteLength(string, encoding) {\n if (Buffer3.isBuffer(string)) {\n return string.length;\n }\n if (ArrayBuffer.isView(string) || isInstance(string, ArrayBuffer)) {\n return string.byteLength;\n }\n if (typeof string !== \"string\") {\n throw new TypeError(\n 'The \"string\" argument must be one of type string, Buffer, or ArrayBuffer. Received type ' + typeof string\n );\n }\n const len = string.length;\n const mustMatch = arguments.length > 2 && arguments[2] === true;\n if (!mustMatch && len === 0) return 0;\n let loweredCase = false;\n for (; ; ) {\n switch (encoding) {\n case \"ascii\":\n case \"latin1\":\n case \"binary\":\n return len;\n case \"utf8\":\n case \"utf-8\":\n return utf8ToBytes(string).length;\n case \"ucs2\":\n case \"ucs-2\":\n case \"utf16le\":\n case \"utf-16le\":\n return len * 2;\n case \"hex\":\n return len >>> 1;\n case \"base64\":\n return base64ToBytes(string).length;\n default:\n if (loweredCase) {\n return mustMatch ? -1 : utf8ToBytes(string).length;\n }\n encoding = (\"\" + encoding).toLowerCase();\n loweredCase = true;\n }\n }\n }\n Buffer3.byteLength = byteLength;\n function slowToString(encoding, start, end) {\n let loweredCase = false;\n if (start === void 0 || start < 0) {\n start = 0;\n }\n if (start > this.length) {\n return \"\";\n }\n if (end === void 0 || end > this.length) {\n end = this.length;\n }\n if (end <= 0) {\n return \"\";\n }\n end >>>= 0;\n start >>>= 0;\n if (end <= start) {\n return \"\";\n }\n if (!encoding) encoding = \"utf8\";\n while (true) {\n switch (encoding) {\n case \"hex\":\n return hexSlice(this, start, end);\n case \"utf8\":\n case \"utf-8\":\n return utf8Slice(this, start, end);\n case \"ascii\":\n return asciiSlice(this, start, end);\n case \"latin1\":\n case \"binary\":\n return latin1Slice(this, start, end);\n case \"base64\":\n return base64Slice(this, start, end);\n case \"ucs2\":\n case \"ucs-2\":\n case \"utf16le\":\n case \"utf-16le\":\n return utf16leSlice(this, start, end);\n default:\n if (loweredCase) throw new TypeError(\"Unknown encoding: \" + encoding);\n encoding = (encoding + \"\").toLowerCase();\n loweredCase = true;\n }\n }\n }\n Buffer3.prototype._isBuffer = true;\n function swap(b, n, m) {\n const i = b[n];\n b[n] = b[m];\n b[m] = i;\n }\n Buffer3.prototype.swap16 = function swap16() {\n const len = this.length;\n if (len % 2 !== 0) {\n throw new RangeError(\"Buffer size must be a multiple of 16-bits\");\n }\n for (let i = 0; i < len; i += 2) {\n swap(this, i, i + 1);\n }\n return this;\n };\n Buffer3.prototype.swap32 = function swap32() {\n const len = this.length;\n if (len % 4 !== 0) {\n throw new RangeError(\"Buffer size must be a multiple of 32-bits\");\n }\n for (let i = 0; i < len; i += 4) {\n swap(this, i, i + 3);\n swap(this, i + 1, i + 2);\n }\n return this;\n };\n Buffer3.prototype.swap64 = function swap64() {\n const len = this.length;\n if (len % 8 !== 0) {\n throw new RangeError(\"Buffer size must be a multiple of 64-bits\");\n }\n for (let i = 0; i < len; i += 8) {\n swap(this, i, i + 7);\n swap(this, i + 1, i + 6);\n swap(this, i + 2, i + 5);\n swap(this, i + 3, i + 4);\n }\n return this;\n };\n Buffer3.prototype.toString = function toString() {\n const length = this.length;\n if (length === 0) return \"\";\n if (arguments.length === 0) return utf8Slice(this, 0, length);\n return slowToString.apply(this, arguments);\n };\n Buffer3.prototype.toLocaleString = Buffer3.prototype.toString;\n Buffer3.prototype.equals = function equals(b) {\n if (!Buffer3.isBuffer(b)) throw new TypeError(\"Argument must be a Buffer\");\n if (this === b) return true;\n return Buffer3.compare(this, b) === 0;\n };\n Buffer3.prototype.inspect = function inspect() {\n let str = \"\";\n const max = exports.INSPECT_MAX_BYTES;\n str = this.toString(\"hex\", 0, max).replace(/(.{2})/g, \"$1 \").trim();\n if (this.length > max) str += \" ... \";\n return \"<Buffer \" + str + \">\";\n };\n if (customInspectSymbol) {\n Buffer3.prototype[customInspectSymbol] = Buffer3.prototype.inspect;\n }\n Buffer3.prototype.compare = function compare(target, start, end, thisStart, thisEnd) {\n if (isInstance(target, Uint8Array)) {\n target = Buffer3.from(target, target.offset, target.byteLength);\n }\n if (!Buffer3.isBuffer(target)) {\n throw new TypeError(\n 'The \"target\" argument must be one of type Buffer or Uint8Array. Received type ' + typeof target\n );\n }\n if (start === void 0) {\n start = 0;\n }\n if (end === void 0) {\n end = target ? target.length : 0;\n }\n if (thisStart === void 0) {\n thisStart = 0;\n }\n if (thisEnd === void 0) {\n thisEnd = this.length;\n }\n if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {\n throw new RangeError(\"out of range index\");\n }\n if (thisStart >= thisEnd && start >= end) {\n return 0;\n }\n if (thisStart >= thisEnd) {\n return -1;\n }\n if (start >= end) {\n return 1;\n }\n start >>>= 0;\n end >>>= 0;\n thisStart >>>= 0;\n thisEnd >>>= 0;\n if (this === target) return 0;\n let x = thisEnd - thisStart;\n let y = end - start;\n const len = Math.min(x, y);\n const thisCopy = this.slice(thisStart, thisEnd);\n const targetCopy = target.slice(start, end);\n for (let i = 0; i < len; ++i) {\n if (thisCopy[i] !== targetCopy[i]) {\n x = thisCopy[i];\n y = targetCopy[i];\n break;\n }\n }\n if (x < y) return -1;\n if (y < x) return 1;\n return 0;\n };\n function bidirectionalIndexOf(buffer, val, byteOffset, encoding, dir) {\n if (buffer.length === 0) return -1;\n if (typeof byteOffset === \"string\") {\n encoding = byteOffset;\n byteOffset = 0;\n } else if (byteOffset > 2147483647) {\n byteOffset = 2147483647;\n } else if (byteOffset < -2147483648) {\n byteOffset = -2147483648;\n }\n byteOffset = +byteOffset;\n if (numberIsNaN(byteOffset)) {\n byteOffset = dir ? 0 : buffer.length - 1;\n }\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset;\n if (byteOffset >= buffer.length) {\n if (dir) return -1;\n else byteOffset = buffer.length - 1;\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0;\n else return -1;\n }\n if (typeof val === \"string\") {\n val = Buffer3.from(val, encoding);\n }\n if (Buffer3.isBuffer(val)) {\n if (val.length === 0) {\n return -1;\n }\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir);\n } else if (typeof val === \"number\") {\n val = val & 255;\n if (typeof Uint8Array.prototype.indexOf === \"function\") {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset);\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset);\n }\n }\n return arrayIndexOf(buffer, [val], byteOffset, encoding, dir);\n }\n throw new TypeError(\"val must be string, number or Buffer\");\n }\n function arrayIndexOf(arr, val, byteOffset, encoding, dir) {\n let indexSize = 1;\n let arrLength = arr.length;\n let valLength = val.length;\n if (encoding !== void 0) {\n encoding = String(encoding).toLowerCase();\n if (encoding === \"ucs2\" || encoding === \"ucs-2\" || encoding === \"utf16le\" || encoding === \"utf-16le\") {\n if (arr.length < 2 || val.length < 2) {\n return -1;\n }\n indexSize = 2;\n arrLength /= 2;\n valLength /= 2;\n byteOffset /= 2;\n }\n }\n function read(buf, i2) {\n if (indexSize === 1) {\n return buf[i2];\n } else {\n return buf.readUInt16BE(i2 * indexSize);\n }\n }\n let i;\n if (dir) {\n let foundIndex = -1;\n for (i = byteOffset; i < arrLength; i++) {\n if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {\n if (foundIndex === -1) foundIndex = i;\n if (i - foundIndex + 1 === valLength) return foundIndex * indexSize;\n } else {\n if (foundIndex !== -1) i -= i - foundIndex;\n foundIndex = -1;\n }\n }\n } else {\n if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength;\n for (i = byteOffset; i >= 0; i--) {\n let found = true;\n for (let j = 0; j < valLength; j++) {\n if (read(arr, i + j) !== read(val, j)) {\n found = false;\n break;\n }\n }\n if (found) return i;\n }\n }\n return -1;\n }\n Buffer3.prototype.includes = function includes(val, byteOffset, encoding) {\n return this.indexOf(val, byteOffset, encoding) !== -1;\n };\n Buffer3.prototype.indexOf = function indexOf(val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, true);\n };\n Buffer3.prototype.lastIndexOf = function lastIndexOf(val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, false);\n };\n function hexWrite(buf, string, offset, length) {\n offset = Number(offset) || 0;\n const remaining = buf.length - offset;\n if (!length) {\n length = remaining;\n } else {\n length = Number(length);\n if (length > remaining) {\n length = remaining;\n }\n }\n const strLen = string.length;\n if (length > strLen / 2) {\n length = strLen / 2;\n }\n let i;\n for (i = 0; i < length; ++i) {\n const parsed = parseInt(string.substr(i * 2, 2), 16);\n if (numberIsNaN(parsed)) return i;\n buf[offset + i] = parsed;\n }\n return i;\n }\n function utf8Write(buf, string, offset, length) {\n return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length);\n }\n function asciiWrite(buf, string, offset, length) {\n return blitBuffer(asciiToBytes(string), buf, offset, length);\n }\n function base64Write(buf, string, offset, length) {\n return blitBuffer(base64ToBytes(string), buf, offset, length);\n }\n function ucs2Write(buf, string, offset, length) {\n return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length);\n }\n Buffer3.prototype.write = function write(string, offset, length, encoding) {\n if (offset === void 0) {\n encoding = \"utf8\";\n length = this.length;\n offset = 0;\n } else if (length === void 0 && typeof offset === \"string\") {\n encoding = offset;\n length = this.length;\n offset = 0;\n } else if (isFinite(offset)) {\n offset = offset >>> 0;\n if (isFinite(length)) {\n length = length >>> 0;\n if (encoding === void 0) encoding = \"utf8\";\n } else {\n encoding = length;\n length = void 0;\n }\n } else {\n throw new Error(\n \"Buffer.write(string, encoding, offset[, length]) is no longer supported\"\n );\n }\n const remaining = this.length - offset;\n if (length === void 0 || length > remaining) length = remaining;\n if (string.length > 0 && (length < 0 || offset < 0) || offset > this.length) {\n throw new RangeError(\"Attempt to write outside buffer bounds\");\n }\n if (!encoding) encoding = \"utf8\";\n let loweredCase = false;\n for (; ; ) {\n switch (encoding) {\n case \"hex\":\n return hexWrite(this, string, offset, length);\n case \"utf8\":\n case \"utf-8\":\n return utf8Write(this, string, offset, length);\n case \"ascii\":\n case \"latin1\":\n case \"binary\":\n return asciiWrite(this, string, offset, length);\n case \"base64\":\n return base64Write(this, string, offset, length);\n case \"ucs2\":\n case \"ucs-2\":\n case \"utf16le\":\n case \"utf-16le\":\n return ucs2Write(this, string, offset, length);\n default:\n if (loweredCase) throw new TypeError(\"Unknown encoding: \" + encoding);\n encoding = (\"\" + encoding).toLowerCase();\n loweredCase = true;\n }\n }\n };\n Buffer3.prototype.toJSON = function toJSON() {\n return {\n type: \"Buffer\",\n data: Array.prototype.slice.call(this._arr || this, 0)\n };\n };\n function base64Slice(buf, start, end) {\n if (start === 0 && end === buf.length) {\n return base64.fromByteArray(buf);\n } else {\n return base64.fromByteArray(buf.slice(start, end));\n }\n }\n function utf8Slice(buf, start, end) {\n end = Math.min(buf.length, end);\n const res = [];\n let i = start;\n while (i < end) {\n const firstByte = buf[i];\n let codePoint = null;\n let bytesPerSequence = firstByte > 239 ? 4 : firstByte > 223 ? 3 : firstByte > 191 ? 2 : 1;\n if (i + bytesPerSequence <= end) {\n let secondByte, thirdByte, fourthByte, tempCodePoint;\n switch (bytesPerSequence) {\n case 1:\n if (firstByte < 128) {\n codePoint = firstByte;\n }\n break;\n case 2:\n secondByte = buf[i + 1];\n if ((secondByte & 192) === 128) {\n tempCodePoint = (firstByte & 31) << 6 | secondByte & 63;\n if (tempCodePoint > 127) {\n codePoint = tempCodePoint;\n }\n }\n break;\n case 3:\n secondByte = buf[i + 1];\n thirdByte = buf[i + 2];\n if ((secondByte & 192) === 128 && (thirdByte & 192) === 128) {\n tempCodePoint = (firstByte & 15) << 12 | (secondByte & 63) << 6 | thirdByte & 63;\n if (tempCodePoint > 2047 && (tempCodePoint < 55296 || tempCodePoint > 57343)) {\n codePoint = tempCodePoint;\n }\n }\n break;\n case 4:\n secondByte = buf[i + 1];\n thirdByte = buf[i + 2];\n fourthByte = buf[i + 3];\n if ((secondByte & 192) === 128 && (thirdByte & 192) === 128 && (fourthByte & 192) === 128) {\n tempCodePoint = (firstByte & 15) << 18 | (secondByte & 63) << 12 | (thirdByte & 63) << 6 | fourthByte & 63;\n if (tempCodePoint > 65535 && tempCodePoint < 1114112) {\n codePoint = tempCodePoint;\n }\n }\n }\n }\n if (codePoint === null) {\n codePoint = 65533;\n bytesPerSequence = 1;\n } else if (codePoint > 65535) {\n codePoint -= 65536;\n res.push(codePoint >>> 10 & 1023 | 55296);\n codePoint = 56320 | codePoint & 1023;\n }\n res.push(codePoint);\n i += bytesPerSequence;\n }\n return decodeCodePointsArray(res);\n }\n var MAX_ARGUMENTS_LENGTH = 4096;\n function decodeCodePointsArray(codePoints) {\n const len = codePoints.length;\n if (len <= MAX_ARGUMENTS_LENGTH) {\n return String.fromCharCode.apply(String, codePoints);\n }\n let res = \"\";\n let i = 0;\n while (i < len) {\n res += String.fromCharCode.apply(\n String,\n codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)\n );\n }\n return res;\n }\n function asciiSlice(buf, start, end) {\n let ret = \"\";\n end = Math.min(buf.length, end);\n for (let i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i] & 127);\n }\n return ret;\n }\n function latin1Slice(buf, start, end) {\n let ret = \"\";\n end = Math.min(buf.length, end);\n for (let i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i]);\n }\n return ret;\n }\n function hexSlice(buf, start, end) {\n const len = buf.length;\n if (!start || start < 0) start = 0;\n if (!end || end < 0 || end > len) end = len;\n let out = \"\";\n for (let i = start; i < end; ++i) {\n out += hexSliceLookupTable[buf[i]];\n }\n return out;\n }\n function utf16leSlice(buf, start, end) {\n const bytes = buf.slice(start, end);\n let res = \"\";\n for (let i = 0; i < bytes.length - 1; i += 2) {\n res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256);\n }\n return res;\n }\n Buffer3.prototype.slice = function slice(start, end) {\n const len = this.length;\n start = ~~start;\n end = end === void 0 ? len : ~~end;\n if (start < 0) {\n start += len;\n if (start < 0) start = 0;\n } else if (start > len) {\n start = len;\n }\n if (end < 0) {\n end += len;\n if (end < 0) end = 0;\n } else if (end > len) {\n end = len;\n }\n if (end < start) end = start;\n const newBuf = this.subarray(start, end);\n Object.setPrototypeOf(newBuf, Buffer3.prototype);\n return newBuf;\n };\n function checkOffset(offset, ext, length) {\n if (offset % 1 !== 0 || offset < 0) throw new RangeError(\"offset is not uint\");\n if (offset + ext > length) throw new RangeError(\"Trying to access beyond buffer length\");\n }\n Buffer3.prototype.readUintLE = Buffer3.prototype.readUIntLE = function readUIntLE(offset, byteLength2, noAssert) {\n offset = offset >>> 0;\n byteLength2 = byteLength2 >>> 0;\n if (!noAssert) checkOffset(offset, byteLength2, this.length);\n let val = this[offset];\n let mul = 1;\n let i = 0;\n while (++i < byteLength2 && (mul *= 256)) {\n val += this[offset + i] * mul;\n }\n return val;\n };\n Buffer3.prototype.readUintBE = Buffer3.prototype.readUIntBE = function readUIntBE(offset, byteLength2, noAssert) {\n offset = offset >>> 0;\n byteLength2 = byteLength2 >>> 0;\n if (!noAssert) {\n checkOffset(offset, byteLength2, this.length);\n }\n let val = this[offset + --byteLength2];\n let mul = 1;\n while (byteLength2 > 0 && (mul *= 256)) {\n val += this[offset + --byteLength2] * mul;\n }\n return val;\n };\n Buffer3.prototype.readUint8 = Buffer3.prototype.readUInt8 = function readUInt8(offset, noAssert) {\n offset = offset >>> 0;\n if (!noAssert) checkOffset(offset, 1, this.length);\n return this[offset];\n };\n Buffer3.prototype.readUint16LE = Buffer3.prototype.readUInt16LE = function readUInt16LE(offset, noAssert) {\n offset = offset >>> 0;\n if (!noAssert) checkOffset(offset, 2, this.length);\n return this[offset] | this[offset + 1] << 8;\n };\n Buffer3.prototype.readUint16BE = Buffer3.prototype.readUInt16BE = function readUInt16BE(offset, noAssert) {\n offset = offset >>> 0;\n if (!noAssert) checkOffset(offset, 2, this.length);\n return this[offset] << 8 | this[offset + 1];\n };\n Buffer3.prototype.readUint32LE = Buffer3.prototype.readUInt32LE = function readUInt32LE(offset, noAssert) {\n offset = offset >>> 0;\n if (!noAssert) checkOffset(offset, 4, this.length);\n return (this[offset] | this[offset + 1] << 8 | this[offset + 2] << 16) + this[offset + 3] * 16777216;\n };\n Buffer3.prototype.readUint32BE = Buffer3.prototype.readUInt32BE = function readUInt32BE(offset, noAssert) {\n offset = offset >>> 0;\n if (!noAssert) checkOffset(offset, 4, this.length);\n return this[offset] * 16777216 + (this[offset + 1] << 16 | this[offset + 2] << 8 | this[offset + 3]);\n };\n Buffer3.prototype.readBigUInt64LE = defineBigIntMethod(function readBigUInt64LE(offset) {\n offset = offset >>> 0;\n validateNumber(offset, \"offset\");\n const first = this[offset];\n const last = this[offset + 7];\n if (first === void 0 || last === void 0) {\n boundsError(offset, this.length - 8);\n }\n const lo = first + this[++offset] * 2 ** 8 + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 24;\n const hi = this[++offset] + this[++offset] * 2 ** 8 + this[++offset] * 2 ** 16 + last * 2 ** 24;\n return BigInt(lo) + (BigInt(hi) << BigInt(32));\n });\n Buffer3.prototype.readBigUInt64BE = defineBigIntMethod(function readBigUInt64BE(offset) {\n offset = offset >>> 0;\n validateNumber(offset, \"offset\");\n const first = this[offset];\n const last = this[offset + 7];\n if (first === void 0 || last === void 0) {\n boundsError(offset, this.length - 8);\n }\n const hi = first * 2 ** 24 + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 8 + this[++offset];\n const lo = this[++offset] * 2 ** 24 + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 8 + last;\n return (BigInt(hi) << BigInt(32)) + BigInt(lo);\n });\n Buffer3.prototype.readIntLE = function readIntLE(offset, byteLength2, noAssert) {\n offset = offset >>> 0;\n byteLength2 = byteLength2 >>> 0;\n if (!noAssert) checkOffset(offset, byteLength2, this.length);\n let val = this[offset];\n let mul = 1;\n let i = 0;\n while (++i < byteLength2 && (mul *= 256)) {\n val += this[offset + i] * mul;\n }\n mul *= 128;\n if (val >= mul) val -= Math.pow(2, 8 * byteLength2);\n return val;\n };\n Buffer3.prototype.readIntBE = function readIntBE(offset, byteLength2, noAssert) {\n offset = offset >>> 0;\n byteLength2 = byteLength2 >>> 0;\n if (!noAssert) checkOffset(offset, byteLength2, this.length);\n let i = byteLength2;\n let mul = 1;\n let val = this[offset + --i];\n while (i > 0 && (mul *= 256)) {\n val += this[offset + --i] * mul;\n }\n mul *= 128;\n if (val >= mul) val -= Math.pow(2, 8 * byteLength2);\n return val;\n };\n Buffer3.prototype.readInt8 = function readInt8(offset, noAssert) {\n offset = offset >>> 0;\n if (!noAssert) checkOffset(offset, 1, this.length);\n if (!(this[offset] & 128)) return this[offset];\n return (255 - this[offset] + 1) * -1;\n };\n Buffer3.prototype.readInt16LE = function readInt16LE(offset, noAssert) {\n offset = offset >>> 0;\n if (!noAssert) checkOffset(offset, 2, this.length);\n const val = this[offset] | this[offset + 1] << 8;\n return val & 32768 ? val | 4294901760 : val;\n };\n Buffer3.prototype.readInt16BE = function readInt16BE(offset, noAssert) {\n offset = offset >>> 0;\n if (!noAssert) checkOffset(offset, 2, this.length);\n const val = this[offset + 1] | this[offset] << 8;\n return val & 32768 ? val | 4294901760 : val;\n };\n Buffer3.prototype.readInt32LE = function readInt32LE(offset, noAssert) {\n offset = offset >>> 0;\n if (!noAssert) checkOffset(offset, 4, this.length);\n return this[offset] | this[offset + 1] << 8 | this[offset + 2] << 16 | this[offset + 3] << 24;\n };\n Buffer3.prototype.readInt32BE = function readInt32BE(offset, noAssert) {\n offset = offset >>> 0;\n if (!noAssert) checkOffset(offset, 4, this.length);\n return this[offset] << 24 | this[offset + 1] << 16 | this[offset + 2] << 8 | this[offset + 3];\n };\n Buffer3.prototype.readBigInt64LE = defineBigIntMethod(function readBigInt64LE(offset) {\n offset = offset >>> 0;\n validateNumber(offset, \"offset\");\n const first = this[offset];\n const last = this[offset + 7];\n if (first === void 0 || last === void 0) {\n boundsError(offset, this.length - 8);\n }\n const val = this[offset + 4] + this[offset + 5] * 2 ** 8 + this[offset + 6] * 2 ** 16 + (last << 24);\n return (BigInt(val) << BigInt(32)) + BigInt(first + this[++offset] * 2 ** 8 + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 24);\n });\n Buffer3.prototype.readBigInt64BE = defineBigIntMethod(function readBigInt64BE(offset) {\n offset = offset >>> 0;\n validateNumber(offset, \"offset\");\n const first = this[offset];\n const last = this[offset + 7];\n if (first === void 0 || last === void 0) {\n boundsError(offset, this.length - 8);\n }\n const val = (first << 24) + // Overflow\n this[++offset] * 2 ** 16 + this[++offset] * 2 ** 8 + this[++offset];\n return (BigInt(val) << BigInt(32)) + BigInt(this[++offset] * 2 ** 24 + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 8 + last);\n });\n Buffer3.prototype.readFloatLE = function readFloatLE(offset, noAssert) {\n offset = offset >>> 0;\n if (!noAssert) checkOffset(offset, 4, this.length);\n return ieee754.read(this, offset, true, 23, 4);\n };\n Buffer3.prototype.readFloatBE = function readFloatBE(offset, noAssert) {\n offset = offset >>> 0;\n if (!noAssert) checkOffset(offset, 4, this.length);\n return ieee754.read(this, offset, false, 23, 4);\n };\n Buffer3.prototype.readDoubleLE = function readDoubleLE(offset, noAssert) {\n offset = offset >>> 0;\n if (!noAssert) checkOffset(offset, 8, this.length);\n return ieee754.read(this, offset, true, 52, 8);\n };\n Buffer3.prototype.readDoubleBE = function readDoubleBE(offset, noAssert) {\n offset = offset >>> 0;\n if (!noAssert) checkOffset(offset, 8, this.length);\n return ieee754.read(this, offset, false, 52, 8);\n };\n function checkInt(buf, value, offset, ext, max, min) {\n if (!Buffer3.isBuffer(buf)) throw new TypeError('\"buffer\" argument must be a Buffer instance');\n if (value > max || value < min) throw new RangeError('\"value\" argument is out of bounds');\n if (offset + ext > buf.length) throw new RangeError(\"Index out of range\");\n }\n Buffer3.prototype.writeUintLE = Buffer3.prototype.writeUIntLE = function writeUIntLE(value, offset, byteLength2, noAssert) {\n value = +value;\n offset = offset >>> 0;\n byteLength2 = byteLength2 >>> 0;\n if (!noAssert) {\n const maxBytes = Math.pow(2, 8 * byteLength2) - 1;\n checkInt(this, value, offset, byteLength2, maxBytes, 0);\n }\n let mul = 1;\n let i = 0;\n this[offset] = value & 255;\n while (++i < byteLength2 && (mul *= 256)) {\n this[offset + i] = value / mul & 255;\n }\n return offset + byteLength2;\n };\n Buffer3.prototype.writeUintBE = Buffer3.prototype.writeUIntBE = function writeUIntBE(value, offset, byteLength2, noAssert) {\n value = +value;\n offset = offset >>> 0;\n byteLength2 = byteLength2 >>> 0;\n if (!noAssert) {\n const maxBytes = Math.pow(2, 8 * byteLength2) - 1;\n checkInt(this, value, offset, byteLength2, maxBytes, 0);\n }\n let i = byteLength2 - 1;\n let mul = 1;\n this[offset + i] = value & 255;\n while (--i >= 0 && (mul *= 256)) {\n this[offset + i] = value / mul & 255;\n }\n return offset + byteLength2;\n };\n Buffer3.prototype.writeUint8 = Buffer3.prototype.writeUInt8 = function writeUInt8(value, offset, noAssert) {\n value = +value;\n offset = offset >>> 0;\n if (!noAssert) checkInt(this, value, offset, 1, 255, 0);\n this[offset] = value & 255;\n return offset + 1;\n };\n Buffer3.prototype.writeUint16LE = Buffer3.prototype.writeUInt16LE = function writeUInt16LE(value, offset, noAssert) {\n value = +value;\n offset = offset >>> 0;\n if (!noAssert) checkInt(this, value, offset, 2, 65535, 0);\n this[offset] = value & 255;\n this[offset + 1] = value >>> 8;\n return offset + 2;\n };\n Buffer3.prototype.writeUint16BE = Buffer3.prototype.writeUInt16BE = function writeUInt16BE(value, offset, noAssert) {\n value = +value;\n offset = offset >>> 0;\n if (!noAssert) checkInt(this, value, offset, 2, 65535, 0);\n this[offset] = value >>> 8;\n this[offset + 1] = value & 255;\n return offset + 2;\n };\n Buffer3.prototype.writeUint32LE = Buffer3.prototype.writeUInt32LE = function writeUInt32LE(value, offset, noAssert) {\n value = +value;\n offset = offset >>> 0;\n if (!noAssert) checkInt(this, value, offset, 4, 4294967295, 0);\n this[offset + 3] = value >>> 24;\n this[offset + 2] = value >>> 16;\n this[offset + 1] = value >>> 8;\n this[offset] = value & 255;\n return offset + 4;\n };\n Buffer3.prototype.writeUint32BE = Buffer3.prototype.writeUInt32BE = function writeUInt32BE(value, offset, noAssert) {\n value = +value;\n offset = offset >>> 0;\n if (!noAssert) checkInt(this, value, offset, 4, 4294967295, 0);\n this[offset] = value >>> 24;\n this[offset + 1] = value >>> 16;\n this[offset + 2] = value >>> 8;\n this[offset + 3] = value & 255;\n return offset + 4;\n };\n function wrtBigUInt64LE(buf, value, offset, min, max) {\n checkIntBI(value, min, max, buf, offset, 7);\n let lo = Number(value & BigInt(4294967295));\n buf[offset++] = lo;\n lo = lo >> 8;\n buf[offset++] = lo;\n lo = lo >> 8;\n buf[offset++] = lo;\n lo = lo >> 8;\n buf[offset++] = lo;\n let hi = Number(value >> BigInt(32) & BigInt(4294967295));\n buf[offset++] = hi;\n hi = hi >> 8;\n buf[offset++] = hi;\n hi = hi >> 8;\n buf[offset++] = hi;\n hi = hi >> 8;\n buf[offset++] = hi;\n return offset;\n }\n function wrtBigUInt64BE(buf, value, offset, min, max) {\n checkIntBI(value, min, max, buf, offset, 7);\n let lo = Number(value & BigInt(4294967295));\n buf[offset + 7] = lo;\n lo = lo >> 8;\n buf[offset + 6] = lo;\n lo = lo >> 8;\n buf[offset + 5] = lo;\n lo = lo >> 8;\n buf[offset + 4] = lo;\n let hi = Number(value >> BigInt(32) & BigInt(4294967295));\n buf[offset + 3] = hi;\n hi = hi >> 8;\n buf[offset + 2] = hi;\n hi = hi >> 8;\n buf[offset + 1] = hi;\n hi = hi >> 8;\n buf[offset] = hi;\n return offset + 8;\n }\n Buffer3.prototype.writeBigUInt64LE = defineBigIntMethod(function writeBigUInt64LE(value, offset = 0) {\n return wrtBigUInt64LE(this, value, offset, BigInt(0), BigInt(\"0xffffffffffffffff\"));\n });\n Buffer3.prototype.writeBigUInt64BE = defineBigIntMethod(function writeBigUInt64BE(value, offset = 0) {\n return wrtBigUInt64BE(this, value, offset, BigInt(0), BigInt(\"0xffffffffffffffff\"));\n });\n Buffer3.prototype.writeIntLE = function writeIntLE(value, offset, byteLength2, noAssert) {\n value = +value;\n offset = offset >>> 0;\n if (!noAssert) {\n const limit = Math.pow(2, 8 * byteLength2 - 1);\n checkInt(this, value, offset, byteLength2, limit - 1, -limit);\n }\n let i = 0;\n let mul = 1;\n let sub = 0;\n this[offset] = value & 255;\n while (++i < byteLength2 && (mul *= 256)) {\n if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {\n sub = 1;\n }\n this[offset + i] = (value / mul >> 0) - sub & 255;\n }\n return offset + byteLength2;\n };\n Buffer3.prototype.writeIntBE = function writeIntBE(value, offset, byteLength2, noAssert) {\n value = +value;\n offset = offset >>> 0;\n if (!noAssert) {\n const limit = Math.pow(2, 8 * byteLength2 - 1);\n checkInt(this, value, offset, byteLength2, limit - 1, -limit);\n }\n let i = byteLength2 - 1;\n let mul = 1;\n let sub = 0;\n this[offset + i] = value & 255;\n while (--i >= 0 && (mul *= 256)) {\n if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {\n sub = 1;\n }\n this[offset + i] = (value / mul >> 0) - sub & 255;\n }\n return offset + byteLength2;\n };\n Buffer3.prototype.writeInt8 = function writeInt8(value, offset, noAssert) {\n value = +value;\n offset = offset >>> 0;\n if (!noAssert) checkInt(this, value, offset, 1, 127, -128);\n if (value < 0) value = 255 + value + 1;\n this[offset] = value & 255;\n return offset + 1;\n };\n Buffer3.prototype.writeInt16LE = function writeInt16LE(value, offset, noAssert) {\n value = +value;\n offset = offset >>> 0;\n if (!noAssert) checkInt(this, value, offset, 2, 32767, -32768);\n this[offset] = value & 255;\n this[offset + 1] = value >>> 8;\n return offset + 2;\n };\n Buffer3.prototype.writeInt16BE = function writeInt16BE(value, offset, noAssert) {\n value = +value;\n offset = offset >>> 0;\n if (!noAssert) checkInt(this, value, offset, 2, 32767, -32768);\n this[offset] = value >>> 8;\n this[offset + 1] = value & 255;\n return offset + 2;\n };\n Buffer3.prototype.writeInt32LE = function writeInt32LE(value, offset, noAssert) {\n value = +value;\n offset = offset >>> 0;\n if (!noAssert) checkInt(this, value, offset, 4, 2147483647, -2147483648);\n this[offset] = value & 255;\n this[offset + 1] = value >>> 8;\n this[offset + 2] = value >>> 16;\n this[offset + 3] = value >>> 24;\n return offset + 4;\n };\n Buffer3.prototype.writeInt32BE = function writeInt32BE(value, offset, noAssert) {\n value = +value;\n offset = offset >>> 0;\n if (!noAssert) checkInt(this, value, offset, 4, 2147483647, -2147483648);\n if (value < 0) value = 4294967295 + value + 1;\n this[offset] = value >>> 24;\n this[offset + 1] = value >>> 16;\n this[offset + 2] = value >>> 8;\n this[offset + 3] = value & 255;\n return offset + 4;\n };\n Buffer3.prototype.writeBigInt64LE = defineBigIntMethod(function writeBigInt64LE(value, offset = 0) {\n return wrtBigUInt64LE(this, value, offset, -BigInt(\"0x8000000000000000\"), BigInt(\"0x7fffffffffffffff\"));\n });\n Buffer3.prototype.writeBigInt64BE = defineBigIntMethod(function writeBigInt64BE(value, offset = 0) {\n return wrtBigUInt64BE(this, value, offset, -BigInt(\"0x8000000000000000\"), BigInt(\"0x7fffffffffffffff\"));\n });\n function checkIEEE754(buf, value, offset, ext, max, min) {\n if (offset + ext > buf.length) throw new RangeError(\"Index out of range\");\n if (offset < 0) throw new RangeError(\"Index out of range\");\n }\n function writeFloat(buf, value, offset, littleEndian, noAssert) {\n value = +value;\n offset = offset >>> 0;\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 4, 34028234663852886e22, -34028234663852886e22);\n }\n ieee754.write(buf, value, offset, littleEndian, 23, 4);\n return offset + 4;\n }\n Buffer3.prototype.writeFloatLE = function writeFloatLE(value, offset, noAssert) {\n return writeFloat(this, value, offset, true, noAssert);\n };\n Buffer3.prototype.writeFloatBE = function writeFloatBE(value, offset, noAssert) {\n return writeFloat(this, value, offset, false, noAssert);\n };\n function writeDouble(buf, value, offset, littleEndian, noAssert) {\n value = +value;\n offset = offset >>> 0;\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 8, 17976931348623157e292, -17976931348623157e292);\n }\n ieee754.write(buf, value, offset, littleEndian, 52, 8);\n return offset + 8;\n }\n Buffer3.prototype.writeDoubleLE = function writeDoubleLE(value, offset, noAssert) {\n return writeDouble(this, value, offset, true, noAssert);\n };\n Buffer3.prototype.writeDoubleBE = function writeDoubleBE(value, offset, noAssert) {\n return writeDouble(this, value, offset, false, noAssert);\n };\n Buffer3.prototype.copy = function copy(target, targetStart, start, end) {\n if (!Buffer3.isBuffer(target)) throw new TypeError(\"argument should be a Buffer\");\n if (!start) start = 0;\n if (!end && end !== 0) end = this.length;\n if (targetStart >= target.length) targetStart = target.length;\n if (!targetStart) targetStart = 0;\n if (end > 0 && end < start) end = start;\n if (end === start) return 0;\n if (target.length === 0 || this.length === 0) return 0;\n if (targetStart < 0) {\n throw new RangeError(\"targetStart out of bounds\");\n }\n if (start < 0 || start >= this.length) throw new RangeError(\"Index out of range\");\n if (end < 0) throw new RangeError(\"sourceEnd out of bounds\");\n if (end > this.length) end = this.length;\n if (target.length - targetStart < end - start) {\n end = target.length - targetStart + start;\n }\n const len = end - start;\n if (this === target && typeof Uint8Array.prototype.copyWithin === \"function\") {\n this.copyWithin(targetStart, start, end);\n } else {\n Uint8Array.prototype.set.call(\n target,\n this.subarray(start, end),\n targetStart\n );\n }\n return len;\n };\n Buffer3.prototype.fill = function fill(val, start, end, encoding) {\n if (typeof val === \"string\") {\n if (typeof start === \"string\") {\n encoding = start;\n start = 0;\n end = this.length;\n } else if (typeof end === \"string\") {\n encoding = end;\n end = this.length;\n }\n if (encoding !== void 0 && typeof encoding !== \"string\") {\n throw new TypeError(\"encoding must be a string\");\n }\n if (typeof encoding === \"string\" && !Buffer3.isEncoding(encoding)) {\n throw new TypeError(\"Unknown encoding: \" + encoding);\n }\n if (val.length === 1) {\n const code = val.charCodeAt(0);\n if (encoding === \"utf8\" && code < 128 || encoding === \"latin1\") {\n val = code;\n }\n }\n } else if (typeof val === \"number\") {\n val = val & 255;\n } else if (typeof val === \"boolean\") {\n val = Number(val);\n }\n if (start < 0 || this.length < start || this.length < end) {\n throw new RangeError(\"Out of range index\");\n }\n if (end <= start) {\n return this;\n }\n start = start >>> 0;\n end = end === void 0 ? this.length : end >>> 0;\n if (!val) val = 0;\n let i;\n if (typeof val === \"number\") {\n for (i = start; i < end; ++i) {\n this[i] = val;\n }\n } else {\n const bytes = Buffer3.isBuffer(val) ? val : Buffer3.from(val, encoding);\n const len = bytes.length;\n if (len === 0) {\n throw new TypeError('The value \"' + val + '\" is invalid for argument \"value\"');\n }\n for (i = 0; i < end - start; ++i) {\n this[i + start] = bytes[i % len];\n }\n }\n return this;\n };\n var errors = {};\n function E(sym, getMessage, Base) {\n errors[sym] = class NodeError extends Base {\n constructor() {\n super();\n Object.defineProperty(this, \"message\", {\n value: getMessage.apply(this, arguments),\n writable: true,\n configurable: true\n });\n this.name = `${this.name} [${sym}]`;\n this.stack;\n delete this.name;\n }\n get code() {\n return sym;\n }\n set code(value) {\n Object.defineProperty(this, \"code\", {\n configurable: true,\n enumerable: true,\n value,\n writable: true\n });\n }\n toString() {\n return `${this.name} [${sym}]: ${this.message}`;\n }\n };\n }\n E(\n \"ERR_BUFFER_OUT_OF_BOUNDS\",\n function(name) {\n if (name) {\n return `${name} is outside of buffer bounds`;\n }\n return \"Attempt to access memory outside buffer bounds\";\n },\n RangeError\n );\n E(\n \"ERR_INVALID_ARG_TYPE\",\n function(name, actual) {\n return `The \"${name}\" argument must be of type number. Received type ${typeof actual}`;\n },\n TypeError\n );\n E(\n \"ERR_OUT_OF_RANGE\",\n function(str, range, input) {\n let msg = `The value of \"${str}\" is out of range.`;\n let received = input;\n if (Number.isInteger(input) && Math.abs(input) > 2 ** 32) {\n received = addNumericalSeparator(String(input));\n } else if (typeof input === \"bigint\") {\n received = String(input);\n if (input > BigInt(2) ** BigInt(32) || input < -(BigInt(2) ** BigInt(32))) {\n received = addNumericalSeparator(received);\n }\n received += \"n\";\n }\n msg += ` It must be ${range}. Received ${received}`;\n return msg;\n },\n RangeError\n );\n function addNumericalSeparator(val) {\n let res = \"\";\n let i = val.length;\n const start = val[0] === \"-\" ? 1 : 0;\n for (; i >= start + 4; i -= 3) {\n res = `_${val.slice(i - 3, i)}${res}`;\n }\n return `${val.slice(0, i)}${res}`;\n }\n function checkBounds(buf, offset, byteLength2) {\n validateNumber(offset, \"offset\");\n if (buf[offset] === void 0 || buf[offset + byteLength2] === void 0) {\n boundsError(offset, buf.length - (byteLength2 + 1));\n }\n }\n function checkIntBI(value, min, max, buf, offset, byteLength2) {\n if (value > max || value < min) {\n const n = typeof min === \"bigint\" ? \"n\" : \"\";\n let range;\n if (byteLength2 > 3) {\n if (min === 0 || min === BigInt(0)) {\n range = `>= 0${n} and < 2${n} ** ${(byteLength2 + 1) * 8}${n}`;\n } else {\n range = `>= -(2${n} ** ${(byteLength2 + 1) * 8 - 1}${n}) and < 2 ** ${(byteLength2 + 1) * 8 - 1}${n}`;\n }\n } else {\n range = `>= ${min}${n} and <= ${max}${n}`;\n }\n throw new errors.ERR_OUT_OF_RANGE(\"value\", range, value);\n }\n checkBounds(buf, offset, byteLength2);\n }\n function validateNumber(value, name) {\n if (typeof value !== \"number\") {\n throw new errors.ERR_INVALID_ARG_TYPE(name, \"number\", value);\n }\n }\n function boundsError(value, length, type) {\n if (Math.floor(value) !== value) {\n validateNumber(value, type);\n throw new errors.ERR_OUT_OF_RANGE(type || \"offset\", \"an integer\", value);\n }\n if (length < 0) {\n throw new errors.ERR_BUFFER_OUT_OF_BOUNDS();\n }\n throw new errors.ERR_OUT_OF_RANGE(\n type || \"offset\",\n `>= ${type ? 1 : 0} and <= ${length}`,\n value\n );\n }\n var INVALID_BASE64_RE = /[^+/0-9A-Za-z-_]/g;\n function base64clean(str) {\n str = str.split(\"=\")[0];\n str = str.trim().replace(INVALID_BASE64_RE, \"\");\n if (str.length < 2) return \"\";\n while (str.length % 4 !== 0) {\n str = str + \"=\";\n }\n return str;\n }\n function utf8ToBytes(string, units) {\n units = units || Infinity;\n let codePoint;\n const length = string.length;\n let leadSurrogate = null;\n const bytes = [];\n for (let i = 0; i < length; ++i) {\n codePoint = string.charCodeAt(i);\n if (codePoint > 55295 && codePoint < 57344) {\n if (!leadSurrogate) {\n if (codePoint > 56319) {\n if ((units -= 3) > -1) bytes.push(239, 191, 189);\n continue;\n } else if (i + 1 === length) {\n if ((units -= 3) > -1) bytes.push(239, 191, 189);\n continue;\n }\n leadSurrogate = codePoint;\n continue;\n }\n if (codePoint < 56320) {\n if ((units -= 3) > -1) bytes.push(239, 191, 189);\n leadSurrogate = codePoint;\n continue;\n }\n codePoint = (leadSurrogate - 55296 << 10 | codePoint - 56320) + 65536;\n } else if (leadSurrogate) {\n if ((units -= 3) > -1) bytes.push(239, 191, 189);\n }\n leadSurrogate = null;\n if (codePoint < 128) {\n if ((units -= 1) < 0) break;\n bytes.push(codePoint);\n } else if (codePoint < 2048) {\n if ((units -= 2) < 0) break;\n bytes.push(\n codePoint >> 6 | 192,\n codePoint & 63 | 128\n );\n } else if (codePoint < 65536) {\n if ((units -= 3) < 0) break;\n bytes.push(\n codePoint >> 12 | 224,\n codePoint >> 6 & 63 | 128,\n codePoint & 63 | 128\n );\n } else if (codePoint < 1114112) {\n if ((units -= 4) < 0) break;\n bytes.push(\n codePoint >> 18 | 240,\n codePoint >> 12 & 63 | 128,\n codePoint >> 6 & 63 | 128,\n codePoint & 63 | 128\n );\n } else {\n throw new Error(\"Invalid code point\");\n }\n }\n return bytes;\n }\n function asciiToBytes(str) {\n const byteArray = [];\n for (let i = 0; i < str.length; ++i) {\n byteArray.push(str.charCodeAt(i) & 255);\n }\n return byteArray;\n }\n function utf16leToBytes(str, units) {\n let c2, hi, lo;\n const byteArray = [];\n for (let i = 0; i < str.length; ++i) {\n if ((units -= 2) < 0) break;\n c2 = str.charCodeAt(i);\n hi = c2 >> 8;\n lo = c2 % 256;\n byteArray.push(lo);\n byteArray.push(hi);\n }\n return byteArray;\n }\n function base64ToBytes(str) {\n return base64.toByteArray(base64clean(str));\n }\n function blitBuffer(src, dst, offset, length) {\n let i;\n for (i = 0; i < length; ++i) {\n if (i + offset >= dst.length || i >= src.length) break;\n dst[i + offset] = src[i];\n }\n return i;\n }\n function isInstance(obj, type) {\n return obj instanceof type || obj != null && obj.constructor != null && obj.constructor.name != null && obj.constructor.name === type.name;\n }\n function numberIsNaN(obj) {\n return obj !== obj;\n }\n var hexSliceLookupTable = (function() {\n const alphabet = \"0123456789abcdef\";\n const table = new Array(256);\n for (let i = 0; i < 16; ++i) {\n const i16 = i * 16;\n for (let j = 0; j < 16; ++j) {\n table[i16 + j] = alphabet[i] + alphabet[j];\n }\n }\n return table;\n })();\n function defineBigIntMethod(fn) {\n return typeof BigInt === \"undefined\" ? BufferBigIntNotDefined : fn;\n }\n function BufferBigIntNotDefined() {\n throw new Error(\"BigInt not supported\");\n }\n }\n });\n\n // node_modules/b4a/lib/ascii.js\n var require_ascii = __commonJS({\n \"node_modules/b4a/lib/ascii.js\"(exports, module) {\n function byteLength(string) {\n return string.length;\n }\n function toString(buffer) {\n const len = buffer.byteLength;\n let result = \"\";\n for (let i = 0; i < len; i++) {\n result += String.fromCharCode(buffer[i] & 127);\n }\n return result;\n }\n function write(buffer, string) {\n const len = buffer.byteLength;\n for (let i = 0; i < len; i++) {\n buffer[i] = string.charCodeAt(i);\n }\n return len;\n }\n module.exports = {\n byteLength,\n toString,\n write\n };\n }\n });\n\n // node_modules/b4a/lib/base64.js\n var require_base64 = __commonJS({\n \"node_modules/b4a/lib/base64.js\"(exports, module) {\n var alphabet = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\";\n var codes = new Uint8Array(256);\n for (let i = 0; i < alphabet.length; i++) {\n codes[alphabet.charCodeAt(i)] = i;\n }\n codes[\n /* - */\n 45\n ] = 62;\n codes[\n /* _ */\n 95\n ] = 63;\n function byteLength(string) {\n let len = string.length;\n if (string.charCodeAt(len - 1) === 61) len--;\n if (len > 1 && string.charCodeAt(len - 1) === 61) len--;\n return len * 3 >>> 2;\n }\n function toString(buffer) {\n const len = buffer.byteLength;\n let result = \"\";\n for (let i = 0; i < len; i += 3) {\n result += alphabet[buffer[i] >> 2] + alphabet[(buffer[i] & 3) << 4 | buffer[i + 1] >> 4] + alphabet[(buffer[i + 1] & 15) << 2 | buffer[i + 2] >> 6] + alphabet[buffer[i + 2] & 63];\n }\n if (len % 3 === 2) {\n result = result.substring(0, result.length - 1) + \"=\";\n } else if (len % 3 === 1) {\n result = result.substring(0, result.length - 2) + \"==\";\n }\n return result;\n }\n function write(buffer, string) {\n const len = buffer.byteLength;\n for (let i = 0, j = 0; j < len; i += 4) {\n const a = codes[string.charCodeAt(i)];\n const b = codes[string.charCodeAt(i + 1)];\n const c2 = codes[string.charCodeAt(i + 2)];\n const d = codes[string.charCodeAt(i + 3)];\n buffer[j++] = a << 2 | b >> 4;\n buffer[j++] = (b & 15) << 4 | c2 >> 2;\n buffer[j++] = (c2 & 3) << 6 | d & 63;\n }\n return len;\n }\n module.exports = {\n byteLength,\n toString,\n write\n };\n }\n });\n\n // node_modules/b4a/lib/hex.js\n var require_hex = __commonJS({\n \"node_modules/b4a/lib/hex.js\"(exports, module) {\n function byteLength(string) {\n return string.length >>> 1;\n }\n function toString(buffer) {\n const len = buffer.byteLength;\n buffer = new DataView(buffer.buffer, buffer.byteOffset, len);\n let result = \"\";\n let i = 0;\n for (let n = len - len % 4; i < n; i += 4) {\n result += buffer.getUint32(i).toString(16).padStart(8, \"0\");\n }\n for (; i < len; i++) {\n result += buffer.getUint8(i).toString(16).padStart(2, \"0\");\n }\n return result;\n }\n function write(buffer, string) {\n const len = buffer.byteLength;\n for (let i = 0; i < len; i++) {\n const a = hexValue(string.charCodeAt(i * 2));\n const b = hexValue(string.charCodeAt(i * 2 + 1));\n if (a === void 0 || b === void 0) {\n return i;\n }\n buffer[i] = a << 4 | b;\n }\n return len;\n }\n module.exports = {\n byteLength,\n toString,\n write\n };\n function hexValue(char) {\n if (char >= 48 && char <= 57) return char - 48;\n if (char >= 65 && char <= 70) return char - 65 + 10;\n if (char >= 97 && char <= 102) return char - 97 + 10;\n }\n }\n });\n\n // node_modules/b4a/lib/latin1.js\n var require_latin1 = __commonJS({\n \"node_modules/b4a/lib/latin1.js\"(exports, module) {\n function byteLength(string) {\n return string.length;\n }\n function toString(buffer) {\n const len = buffer.byteLength;\n let result = \"\";\n for (let i = 0; i < len; i++) {\n result += String.fromCharCode(buffer[i]);\n }\n return result;\n }\n function write(buffer, string) {\n const len = buffer.byteLength;\n for (let i = 0; i < len; i++) {\n buffer[i] = string.charCodeAt(i);\n }\n return len;\n }\n module.exports = {\n byteLength,\n toString,\n write\n };\n }\n });\n\n // node_modules/b4a/lib/utf8.js\n var require_utf8 = __commonJS({\n \"node_modules/b4a/lib/utf8.js\"(exports, module) {\n function byteLength(string) {\n let length = 0;\n for (let i = 0, n = string.length; i < n; i++) {\n const code = string.charCodeAt(i);\n if (code >= 55296 && code <= 56319 && i + 1 < n) {\n const code2 = string.charCodeAt(i + 1);\n if (code2 >= 56320 && code2 <= 57343) {\n length += 4;\n i++;\n continue;\n }\n }\n if (code <= 127) length += 1;\n else if (code <= 2047) length += 2;\n else length += 3;\n }\n return length;\n }\n var toString;\n if (typeof TextDecoder !== \"undefined\") {\n const decoder = new TextDecoder();\n toString = function toString2(buffer) {\n return decoder.decode(buffer);\n };\n } else {\n toString = function toString2(buffer) {\n const len = buffer.byteLength;\n let output = \"\";\n let i = 0;\n while (i < len) {\n let byte = buffer[i];\n if (byte <= 127) {\n output += String.fromCharCode(byte);\n i++;\n continue;\n }\n let bytesNeeded = 0;\n let codePoint = 0;\n if (byte <= 223) {\n bytesNeeded = 1;\n codePoint = byte & 31;\n } else if (byte <= 239) {\n bytesNeeded = 2;\n codePoint = byte & 15;\n } else if (byte <= 244) {\n bytesNeeded = 3;\n codePoint = byte & 7;\n }\n if (len - i - bytesNeeded > 0) {\n let k = 0;\n while (k < bytesNeeded) {\n byte = buffer[i + k + 1];\n codePoint = codePoint << 6 | byte & 63;\n k += 1;\n }\n } else {\n codePoint = 65533;\n bytesNeeded = len - i;\n }\n output += String.fromCodePoint(codePoint);\n i += bytesNeeded + 1;\n }\n return output;\n };\n }\n var write;\n if (typeof TextEncoder !== \"undefined\") {\n const encoder = new TextEncoder();\n write = function write2(buffer, string) {\n return encoder.encodeInto(string, buffer).written;\n };\n } else {\n write = function write2(buffer, string) {\n const len = buffer.byteLength;\n let i = 0;\n let j = 0;\n while (i < string.length) {\n const code = string.codePointAt(i);\n if (code <= 127) {\n if (j + 1 > len) break;\n buffer[j++] = code;\n i++;\n continue;\n }\n let count = 0;\n let bits = 0;\n if (code <= 2047) {\n count = 6;\n bits = 192;\n } else if (code <= 65535) {\n count = 12;\n bits = 224;\n } else if (code <= 2097151) {\n count = 18;\n bits = 240;\n }\n if (j + count / 6 + 1 > len) break;\n buffer[j++] = bits | code >> count;\n count -= 6;\n while (count >= 0) {\n buffer[j++] = 128 | code >> count & 63;\n count -= 6;\n }\n i += code >= 65536 ? 2 : 1;\n }\n return j;\n };\n }\n module.exports = {\n byteLength,\n toString,\n write\n };\n }\n });\n\n // node_modules/b4a/lib/utf16le.js\n var require_utf16le = __commonJS({\n \"node_modules/b4a/lib/utf16le.js\"(exports, module) {\n function byteLength(string) {\n return string.length * 2;\n }\n function toString(buffer) {\n const len = buffer.byteLength;\n let result = \"\";\n for (let i = 0; i < len - 1; i += 2) {\n result += String.fromCharCode(buffer[i] + buffer[i + 1] * 256);\n }\n return result;\n }\n function write(buffer, string) {\n const len = buffer.byteLength;\n let units = len;\n for (let i = 0; i < string.length; ++i) {\n if ((units -= 2) < 0) break;\n const c2 = string.charCodeAt(i);\n const hi = c2 >> 8;\n const lo = c2 % 256;\n buffer[i * 2] = lo;\n buffer[i * 2 + 1] = hi;\n }\n return len;\n }\n module.exports = {\n byteLength,\n toString,\n write\n };\n }\n });\n\n // node_modules/b4a/browser.js\n var require_browser = __commonJS({\n \"node_modules/b4a/browser.js\"(exports, module) {\n var ascii = require_ascii();\n var base64 = require_base64();\n var hex = require_hex();\n var latin1 = require_latin1();\n var utf8 = require_utf8();\n var utf16le = require_utf16le();\n var LE = new Uint8Array(Uint16Array.of(255).buffer)[0] === 255;\n function codecFor(encoding) {\n switch (encoding) {\n case \"ascii\":\n return ascii;\n case \"base64\":\n return base64;\n case \"hex\":\n return hex;\n case \"binary\":\n case \"latin1\":\n return latin1;\n case \"utf8\":\n case \"utf-8\":\n case void 0:\n case null:\n return utf8;\n case \"ucs2\":\n case \"ucs-2\":\n case \"utf16le\":\n case \"utf-16le\":\n return utf16le;\n default:\n throw new Error(`Unknown encoding '${encoding}'`);\n }\n }\n function isBuffer(value) {\n return value instanceof Uint8Array;\n }\n function isEncoding(encoding) {\n try {\n codecFor(encoding);\n return true;\n } catch {\n return false;\n }\n }\n function alloc(size, fill2, encoding) {\n const buffer = new Uint8Array(size);\n if (fill2 !== void 0) {\n exports.fill(buffer, fill2, 0, buffer.byteLength, encoding);\n }\n return buffer;\n }\n function allocUnsafe(size) {\n return new Uint8Array(size);\n }\n function allocUnsafeSlow(size) {\n return new Uint8Array(size);\n }\n function byteLength(string, encoding) {\n return codecFor(encoding).byteLength(string);\n }\n function compare(a, b) {\n if (a === b) return 0;\n const len = Math.min(a.byteLength, b.byteLength);\n a = new DataView(a.buffer, a.byteOffset, a.byteLength);\n b = new DataView(b.buffer, b.byteOffset, b.byteLength);\n let i = 0;\n for (let n = len - len % 4; i < n; i += 4) {\n const x = a.getUint32(i, LE);\n const y = b.getUint32(i, LE);\n if (x !== y) break;\n }\n for (; i < len; i++) {\n const x = a.getUint8(i);\n const y = b.getUint8(i);\n if (x < y) return -1;\n if (x > y) return 1;\n }\n return a.byteLength > b.byteLength ? 1 : a.byteLength < b.byteLength ? -1 : 0;\n }\n function concat(buffers, length) {\n if (length === void 0) {\n length = buffers.reduce((len, buffer) => len + buffer.byteLength, 0);\n }\n const result = new Uint8Array(length);\n let offset = 0;\n for (const buffer of buffers) {\n if (offset + buffer.byteLength > result.byteLength) {\n result.set(buffer.subarray(0, result.byteLength - offset), offset);\n return result;\n }\n result.set(buffer, offset);\n offset += buffer.byteLength;\n }\n return result;\n }\n function copy(source, target, targetStart = 0, sourceStart = 0, sourceEnd = source.byteLength) {\n if (targetStart < 0) targetStart = 0;\n if (targetStart >= target.byteLength) return 0;\n const targetLength = target.byteLength - targetStart;\n if (sourceStart < 0) sourceStart = 0;\n if (sourceStart >= source.byteLength) return 0;\n if (sourceEnd <= sourceStart) return 0;\n if (sourceEnd > source.byteLength) sourceEnd = source.byteLength;\n if (sourceEnd - sourceStart > targetLength) {\n sourceEnd = sourceStart + targetLength;\n }\n const sourceLength = sourceEnd - sourceStart;\n if (source === target) {\n target.copyWithin(targetStart, sourceStart, sourceEnd);\n } else {\n if (sourceStart !== 0 || sourceEnd !== source.byteLength) {\n source = source.subarray(sourceStart, sourceEnd);\n }\n target.set(source, targetStart);\n }\n return sourceLength;\n }\n function equals(a, b) {\n if (a === b) return true;\n if (a.byteLength !== b.byteLength) return false;\n return compare(a, b) === 0;\n }\n function fill(buffer, value, offset = 0, end = buffer.byteLength, encoding = \"utf8\") {\n if (typeof value === \"string\") {\n if (typeof offset === \"string\") {\n encoding = offset;\n offset = 0;\n end = buffer.byteLength;\n } else if (typeof end === \"string\") {\n encoding = end;\n end = buffer.byteLength;\n }\n } else if (typeof value === \"number\") {\n value = value & 255;\n } else if (typeof value === \"boolean\") {\n value = +value;\n }\n if (offset < 0) offset = 0;\n if (offset >= buffer.byteLength) return buffer;\n if (end <= offset) return buffer;\n if (end > buffer.byteLength) end = buffer.byteLength;\n if (typeof value === \"number\") return buffer.fill(value, offset, end);\n if (typeof value === \"string\") value = exports.from(value, encoding);\n const len = value.byteLength;\n for (let i = 0, n = end - offset; i < n; ++i) {\n buffer[i + offset] = value[i % len];\n }\n return buffer;\n }\n function from(value, encodingOrOffset, length) {\n if (typeof value === \"string\") return fromString(value, encodingOrOffset);\n if (Array.isArray(value)) return fromArray(value);\n if (ArrayBuffer.isView(value)) return fromBuffer(value);\n return fromArrayBuffer(value, encodingOrOffset, length);\n }\n function fromString(string, encoding) {\n const codec = codecFor(encoding);\n const buffer = new Uint8Array(codec.byteLength(string));\n codec.write(buffer, string);\n return buffer;\n }\n function fromArray(array) {\n const buffer = new Uint8Array(array.length);\n buffer.set(array);\n return buffer;\n }\n function fromBuffer(buffer) {\n const copy2 = new Uint8Array(buffer.byteLength);\n copy2.set(buffer);\n return copy2;\n }\n function fromArrayBuffer(arrayBuffer, byteOffset, length) {\n return new Uint8Array(arrayBuffer, byteOffset, length);\n }\n function includes(buffer, value, byteOffset, encoding) {\n return indexOf(buffer, value, byteOffset, encoding) !== -1;\n }\n function indexOf(buffer, value, byteOffset, encoding) {\n return bidirectionalIndexOf(\n buffer,\n value,\n byteOffset,\n encoding,\n true\n /* first */\n );\n }\n function lastIndexOf(buffer, value, byteOffset, encoding) {\n return bidirectionalIndexOf(\n buffer,\n value,\n byteOffset,\n encoding,\n false\n /* last */\n );\n }\n function bidirectionalIndexOf(buffer, value, byteOffset, encoding, first) {\n if (buffer.byteLength === 0) return -1;\n if (typeof byteOffset === \"string\") {\n encoding = byteOffset;\n byteOffset = 0;\n } else if (byteOffset === void 0) {\n byteOffset = first ? 0 : buffer.length - 1;\n } else if (byteOffset < 0) {\n byteOffset += buffer.byteLength;\n }\n if (byteOffset >= buffer.byteLength) {\n if (first) return -1;\n else byteOffset = buffer.byteLength - 1;\n } else if (byteOffset < 0) {\n if (first) byteOffset = 0;\n else return -1;\n }\n if (typeof value === \"string\") {\n value = from(value, encoding);\n } else if (typeof value === \"number\") {\n value = value & 255;\n if (first) {\n return buffer.indexOf(value, byteOffset);\n } else {\n return buffer.lastIndexOf(value, byteOffset);\n }\n }\n if (value.byteLength === 0) return -1;\n if (first) {\n let foundIndex = -1;\n for (let i = byteOffset; i < buffer.byteLength; i++) {\n if (buffer[i] === value[foundIndex === -1 ? 0 : i - foundIndex]) {\n if (foundIndex === -1) foundIndex = i;\n if (i - foundIndex + 1 === value.byteLength) return foundIndex;\n } else {\n if (foundIndex !== -1) i -= i - foundIndex;\n foundIndex = -1;\n }\n }\n } else {\n if (byteOffset + value.byteLength > buffer.byteLength) {\n byteOffset = buffer.byteLength - value.byteLength;\n }\n for (let i = byteOffset; i >= 0; i--) {\n let found = true;\n for (let j = 0; j < value.byteLength; j++) {\n if (buffer[i + j] !== value[j]) {\n found = false;\n break;\n }\n }\n if (found) return i;\n }\n }\n return -1;\n }\n function swap(buffer, n, m) {\n const i = buffer[n];\n buffer[n] = buffer[m];\n buffer[m] = i;\n }\n function swap16(buffer) {\n const len = buffer.byteLength;\n if (len % 2 !== 0) {\n throw new RangeError(\"Buffer size must be a multiple of 16-bits\");\n }\n for (let i = 0; i < len; i += 2) swap(buffer, i, i + 1);\n return buffer;\n }\n function swap32(buffer) {\n const len = buffer.byteLength;\n if (len % 4 !== 0) {\n throw new RangeError(\"Buffer size must be a multiple of 32-bits\");\n }\n for (let i = 0; i < len; i += 4) {\n swap(buffer, i, i + 3);\n swap(buffer, i + 1, i + 2);\n }\n return buffer;\n }\n function swap64(buffer) {\n const len = buffer.byteLength;\n if (len % 8 !== 0) {\n throw new RangeError(\"Buffer size must be a multiple of 64-bits\");\n }\n for (let i = 0; i < len; i += 8) {\n swap(buffer, i, i + 7);\n swap(buffer, i + 1, i + 6);\n swap(buffer, i + 2, i + 5);\n swap(buffer, i + 3, i + 4);\n }\n return buffer;\n }\n function toBuffer(buffer) {\n return buffer;\n }\n function toString(buffer, encoding = \"utf8\", start = 0, end = buffer.byteLength) {\n if (arguments.length === 1) return utf8.toString(buffer);\n if (arguments.length === 2) return codecFor(encoding).toString(buffer);\n if (start < 0) start = 0;\n if (start >= buffer.byteLength) return \"\";\n if (end <= start) return \"\";\n if (end > buffer.byteLength) end = buffer.byteLength;\n if (start !== 0 || end !== buffer.byteLength) {\n buffer = buffer.subarray(start, end);\n }\n return codecFor(encoding).toString(buffer);\n }\n function write(buffer, string, offset = 0, length = buffer.byteLength, encoding) {\n if (arguments.length === 2) return utf8.write(buffer, string);\n if (typeof offset === \"string\") {\n encoding = offset;\n offset = 0;\n length = buffer.byteLength;\n } else if (typeof length === \"string\") {\n encoding = length;\n length = buffer.byteLength - offset;\n }\n length = Math.min(length, exports.byteLength(string, encoding));\n let start = offset;\n if (start < 0) start = 0;\n if (start >= buffer.byteLength) return 0;\n let end = offset + length;\n if (end <= start) return 0;\n if (end > buffer.byteLength) end = buffer.byteLength;\n if (start !== 0 || end !== buffer.byteLength) {\n buffer = buffer.subarray(start, end);\n }\n return codecFor(encoding).write(buffer, string);\n }\n function readDoubleBE(buffer, offset = 0) {\n const view = new DataView(buffer.buffer, buffer.byteOffset, buffer.byteLength);\n return view.getFloat64(offset, false);\n }\n function readDoubleLE(buffer, offset = 0) {\n const view = new DataView(buffer.buffer, buffer.byteOffset, buffer.byteLength);\n return view.getFloat64(offset, true);\n }\n function readFloatBE(buffer, offset = 0) {\n const view = new DataView(buffer.buffer, buffer.byteOffset, buffer.byteLength);\n return view.getFloat32(offset, false);\n }\n function readFloatLE(buffer, offset = 0) {\n const view = new DataView(buffer.buffer, buffer.byteOffset, buffer.byteLength);\n return view.getFloat32(offset, true);\n }\n function readInt32BE(buffer, offset = 0) {\n const view = new DataView(buffer.buffer, buffer.byteOffset, buffer.byteLength);\n return view.getInt32(offset, false);\n }\n function readInt32LE(buffer, offset = 0) {\n const view = new DataView(buffer.buffer, buffer.byteOffset, buffer.byteLength);\n return view.getInt32(offset, true);\n }\n function readUInt32BE(buffer, offset = 0) {\n const view = new DataView(buffer.buffer, buffer.byteOffset, buffer.byteLength);\n return view.getUint32(offset, false);\n }\n function readUInt32LE(buffer, offset = 0) {\n const view = new DataView(buffer.buffer, buffer.byteOffset, buffer.byteLength);\n return view.getUint32(offset, true);\n }\n function writeDoubleBE(buffer, value, offset = 0) {\n const view = new DataView(buffer.buffer, buffer.byteOffset, buffer.byteLength);\n view.setFloat64(offset, value, false);\n return offset + 8;\n }\n function writeDoubleLE(buffer, value, offset = 0) {\n const view = new DataView(buffer.buffer, buffer.byteOffset, buffer.byteLength);\n view.setFloat64(offset, value, true);\n return offset + 8;\n }\n function writeFloatBE(buffer, value, offset = 0) {\n const view = new DataView(buffer.buffer, buffer.byteOffset, buffer.byteLength);\n view.setFloat32(offset, value, false);\n return offset + 4;\n }\n function writeFloatLE(buffer, value, offset = 0) {\n const view = new DataView(buffer.buffer, buffer.byteOffset, buffer.byteLength);\n view.setFloat32(offset, value, true);\n return offset + 4;\n }\n function writeInt32BE(buffer, value, offset = 0) {\n const view = new DataView(buffer.buffer, buffer.byteOffset, buffer.byteLength);\n view.setInt32(offset, value, false);\n return offset + 4;\n }\n function writeInt32LE(buffer, value, offset = 0) {\n const view = new DataView(buffer.buffer, buffer.byteOffset, buffer.byteLength);\n view.setInt32(offset, value, true);\n return offset + 4;\n }\n function writeUInt32BE(buffer, value, offset = 0) {\n const view = new DataView(buffer.buffer, buffer.byteOffset, buffer.byteLength);\n view.setUint32(offset, value, false);\n return offset + 4;\n }\n function writeUInt32LE(buffer, value, offset = 0) {\n const view = new DataView(buffer.buffer, buffer.byteOffset, buffer.byteLength);\n view.setUint32(offset, value, true);\n return offset + 4;\n }\n module.exports = exports = {\n isBuffer,\n isEncoding,\n alloc,\n allocUnsafe,\n allocUnsafeSlow,\n byteLength,\n compare,\n concat,\n copy,\n equals,\n fill,\n from,\n includes,\n indexOf,\n lastIndexOf,\n swap16,\n swap32,\n swap64,\n toBuffer,\n toString,\n write,\n readDoubleBE,\n readDoubleLE,\n readFloatBE,\n readFloatLE,\n readInt32BE,\n readInt32LE,\n readUInt32BE,\n readUInt32LE,\n writeDoubleBE,\n writeDoubleLE,\n writeFloatBE,\n writeFloatLE,\n writeInt32BE,\n writeInt32LE,\n writeUInt32BE,\n writeUInt32LE\n };\n }\n });\n\n // node_modules/compact-encoding/endian.js\n var require_endian = __commonJS({\n \"node_modules/compact-encoding/endian.js\"(exports) {\n var LE = exports.LE = new Uint8Array(new Uint16Array([255]).buffer)[0] === 255;\n exports.BE = !LE;\n }\n });\n\n // node_modules/compact-encoding/raw.js\n var require_raw = __commonJS({\n \"node_modules/compact-encoding/raw.js\"(exports, module) {\n var b4a2 = require_browser();\n var { BE } = require_endian();\n exports = module.exports = {\n preencode(state, b) {\n state.end += b.byteLength;\n },\n encode(state, b) {\n state.buffer.set(b, state.start);\n state.start += b.byteLength;\n },\n decode(state) {\n const b = state.buffer.subarray(state.start, state.end);\n state.start = state.end;\n return b;\n }\n };\n var buffer = exports.buffer = {\n preencode(state, b) {\n if (b) uint8array.preencode(state, b);\n else state.end++;\n },\n encode(state, b) {\n if (b) uint8array.encode(state, b);\n else state.buffer[state.start++] = 0;\n },\n decode(state) {\n const b = state.buffer.subarray(state.start);\n if (b.byteLength === 0) return null;\n state.start = state.end;\n return b;\n }\n };\n exports.binary = {\n ...buffer,\n preencode(state, b) {\n if (typeof b === \"string\") utf8.preencode(state, b);\n else buffer.preencode(state, b);\n },\n encode(state, b) {\n if (typeof b === \"string\") utf8.encode(state, b);\n else buffer.encode(state, b);\n }\n };\n exports.arraybuffer = {\n preencode(state, b) {\n state.end += b.byteLength;\n },\n encode(state, b) {\n const view = new Uint8Array(b);\n state.buffer.set(view, state.start);\n state.start += b.byteLength;\n },\n decode(state) {\n const b = new ArrayBuffer(state.end - state.start);\n const view = new Uint8Array(b);\n view.set(state.buffer.subarray(state.start));\n state.start = state.end;\n return b;\n }\n };\n function typedarray(TypedArray, swap) {\n const n = TypedArray.BYTES_PER_ELEMENT;\n return {\n preencode(state, b) {\n state.end += b.byteLength;\n },\n encode(state, b) {\n const view = new Uint8Array(b.buffer, b.byteOffset, b.byteLength);\n if (BE && swap) swap(view);\n state.buffer.set(view, state.start);\n state.start += b.byteLength;\n },\n decode(state) {\n let b = state.buffer.subarray(state.start);\n if (b.byteOffset % n !== 0) b = new Uint8Array(b);\n if (BE && swap) swap(b);\n state.start = state.end;\n return new TypedArray(b.buffer, b.byteOffset, b.byteLength / n);\n }\n };\n }\n var uint8array = exports.uint8array = typedarray(Uint8Array);\n exports.uint16array = typedarray(Uint16Array, b4a2.swap16);\n exports.uint32array = typedarray(Uint32Array, b4a2.swap32);\n exports.int8array = typedarray(Int8Array);\n exports.int16array = typedarray(Int16Array, b4a2.swap16);\n exports.int32array = typedarray(Int32Array, b4a2.swap32);\n exports.biguint64array = typedarray(BigUint64Array, b4a2.swap64);\n exports.bigint64array = typedarray(BigInt64Array, b4a2.swap64);\n exports.float32array = typedarray(Float32Array, b4a2.swap32);\n exports.float64array = typedarray(Float64Array, b4a2.swap64);\n function string(encoding) {\n return {\n preencode(state, s) {\n state.end += b4a2.byteLength(s, encoding);\n },\n encode(state, s) {\n state.start += b4a2.write(state.buffer, s, state.start, encoding);\n },\n decode(state) {\n const s = b4a2.toString(state.buffer, encoding, state.start);\n state.start = state.end;\n return s;\n }\n };\n }\n var utf8 = exports.string = exports.utf8 = string(\"utf-8\");\n exports.ascii = string(\"ascii\");\n exports.hex = string(\"hex\");\n exports.base64 = string(\"base64\");\n exports.ucs2 = exports.utf16le = string(\"utf16le\");\n exports.array = function array(enc) {\n return {\n preencode(state, list) {\n for (const value of list) enc.preencode(state, value);\n },\n encode(state, list) {\n for (const value of list) enc.encode(state, value);\n },\n decode(state) {\n const arr = [];\n while (state.start < state.end) arr.push(enc.decode(state));\n return arr;\n }\n };\n };\n exports.json = {\n preencode(state, v) {\n utf8.preencode(state, JSON.stringify(v));\n },\n encode(state, v) {\n utf8.encode(state, JSON.stringify(v));\n },\n decode(state) {\n return JSON.parse(utf8.decode(state));\n }\n };\n exports.ndjson = {\n preencode(state, v) {\n utf8.preencode(state, JSON.stringify(v) + \"\\n\");\n },\n encode(state, v) {\n utf8.encode(state, JSON.stringify(v) + \"\\n\");\n },\n decode(state) {\n return JSON.parse(utf8.decode(state));\n }\n };\n }\n });\n\n // node_modules/compact-encoding/lexint.js\n var require_lexint = __commonJS({\n \"node_modules/compact-encoding/lexint.js\"(exports, module) {\n module.exports = {\n preencode,\n encode,\n decode\n };\n function preencode(state, num) {\n if (num < 251) {\n state.end++;\n } else if (num < 256) {\n state.end += 2;\n } else if (num < 65536) {\n state.end += 3;\n } else if (num < 16777216) {\n state.end += 4;\n } else if (num < 4294967296) {\n state.end += 5;\n } else {\n state.end++;\n const exp = Math.floor(Math.log(num) / Math.log(2)) - 32;\n preencode(state, exp);\n state.end += 6;\n }\n }\n function encode(state, num) {\n const max = 251;\n const x = num - max;\n if (num < max) {\n state.buffer[state.start++] = num;\n } else if (num < 256) {\n state.buffer[state.start++] = max;\n state.buffer[state.start++] = x;\n } else if (num < 65536) {\n state.buffer[state.start++] = max + 1;\n state.buffer[state.start++] = x >> 8 & 255;\n state.buffer[state.start++] = x & 255;\n } else if (num < 16777216) {\n state.buffer[state.start++] = max + 2;\n state.buffer[state.start++] = x >> 16;\n state.buffer[state.start++] = x >> 8 & 255;\n state.buffer[state.start++] = x & 255;\n } else if (num < 4294967296) {\n state.buffer[state.start++] = max + 3;\n state.buffer[state.start++] = x >> 24;\n state.buffer[state.start++] = x >> 16 & 255;\n state.buffer[state.start++] = x >> 8 & 255;\n state.buffer[state.start++] = x & 255;\n } else {\n const exp = Math.floor(Math.log(x) / Math.log(2)) - 32;\n state.buffer[state.start++] = 255;\n encode(state, exp);\n const rem = x / Math.pow(2, exp - 11);\n for (let i = 5; i >= 0; i--) {\n state.buffer[state.start++] = rem / Math.pow(2, 8 * i) & 255;\n }\n }\n }\n function decode(state) {\n const max = 251;\n if (state.end - state.start < 1) throw new Error(\"Out of bounds\");\n const flag = state.buffer[state.start++];\n if (flag < max) return flag;\n if (state.end - state.start < flag - max + 1) {\n throw new Error(\"Out of bounds.\");\n }\n if (flag < 252) {\n return state.buffer[state.start++] + max;\n }\n if (flag < 253) {\n return (state.buffer[state.start++] << 8) + state.buffer[state.start++] + max;\n }\n if (flag < 254) {\n return (state.buffer[state.start++] << 16) + (state.buffer[state.start++] << 8) + state.buffer[state.start++] + max;\n }\n if (flag < 255) {\n return state.buffer[state.start++] * 16777216 + (state.buffer[state.start++] << 16) + (state.buffer[state.start++] << 8) + state.buffer[state.start++] + max;\n }\n const exp = decode(state);\n if (state.end - state.start < 6) throw new Error(\"Out of bounds\");\n let rem = 0;\n for (let i = 5; i >= 0; i--) {\n rem += state.buffer[state.start++] * Math.pow(2, 8 * i);\n }\n return rem * Math.pow(2, exp - 11) + max;\n }\n }\n });\n\n // node_modules/compact-encoding/index.js\n var require_compact_encoding = __commonJS({\n \"node_modules/compact-encoding/index.js\"(exports) {\n var b4a2 = require_browser();\n var { BE } = require_endian();\n exports.state = function(start = 0, end = 0, buffer2 = null) {\n return { start, end, buffer: buffer2 };\n };\n var raw = exports.raw = require_raw();\n var uint = exports.uint = {\n preencode(state, n) {\n state.end += n <= 252 ? 1 : n <= 65535 ? 3 : n <= 4294967295 ? 5 : 9;\n },\n encode(state, n) {\n if (n <= 252) uint8.encode(state, n);\n else if (n <= 65535) {\n state.buffer[state.start++] = 253;\n uint16.encode(state, n);\n } else if (n <= 4294967295) {\n state.buffer[state.start++] = 254;\n uint32.encode(state, n);\n } else {\n state.buffer[state.start++] = 255;\n uint64.encode(state, n);\n }\n },\n decode(state) {\n const a = uint8.decode(state);\n if (a <= 252) return a;\n if (a === 253) return uint16.decode(state);\n if (a === 254) return uint32.decode(state);\n return uint64.decode(state);\n }\n };\n var uint8 = exports.uint8 = {\n preencode(state, n) {\n state.end += 1;\n },\n encode(state, n) {\n validateUint(n);\n state.buffer[state.start++] = n;\n },\n decode(state) {\n if (state.start >= state.end) throw new Error(\"Out of bounds\");\n return state.buffer[state.start++];\n }\n };\n var uint16 = exports.uint16 = {\n preencode(state, n) {\n state.end += 2;\n },\n encode(state, n) {\n validateUint(n);\n state.buffer[state.start++] = n;\n state.buffer[state.start++] = n >>> 8;\n },\n decode(state) {\n if (state.end - state.start < 2) throw new Error(\"Out of bounds\");\n return state.buffer[state.start++] + state.buffer[state.start++] * 256;\n }\n };\n var uint24 = exports.uint24 = {\n preencode(state, n) {\n state.end += 3;\n },\n encode(state, n) {\n validateUint(n);\n state.buffer[state.start++] = n;\n state.buffer[state.start++] = n >>> 8;\n state.buffer[state.start++] = n >>> 16;\n },\n decode(state) {\n if (state.end - state.start < 3) throw new Error(\"Out of bounds\");\n return state.buffer[state.start++] + state.buffer[state.start++] * 256 + state.buffer[state.start++] * 65536;\n }\n };\n var uint32 = exports.uint32 = {\n preencode(state, n) {\n state.end += 4;\n },\n encode(state, n) {\n validateUint(n);\n state.buffer[state.start++] = n;\n state.buffer[state.start++] = n >>> 8;\n state.buffer[state.start++] = n >>> 16;\n state.buffer[state.start++] = n >>> 24;\n },\n decode(state) {\n if (state.end - state.start < 4) throw new Error(\"Out of bounds\");\n return state.buffer[state.start++] + state.buffer[state.start++] * 256 + state.buffer[state.start++] * 65536 + state.buffer[state.start++] * 16777216;\n }\n };\n var uint40 = exports.uint40 = {\n preencode(state, n) {\n state.end += 5;\n },\n encode(state, n) {\n validateUint(n);\n const r = Math.floor(n / 256);\n uint8.encode(state, n);\n uint32.encode(state, r);\n },\n decode(state) {\n if (state.end - state.start < 5) throw new Error(\"Out of bounds\");\n return uint8.decode(state) + 256 * uint32.decode(state);\n }\n };\n var uint48 = exports.uint48 = {\n preencode(state, n) {\n state.end += 6;\n },\n encode(state, n) {\n validateUint(n);\n const r = Math.floor(n / 65536);\n uint16.encode(state, n);\n uint32.encode(state, r);\n },\n decode(state) {\n if (state.end - state.start < 6) throw new Error(\"Out of bounds\");\n return uint16.decode(state) + 65536 * uint32.decode(state);\n }\n };\n var uint56 = exports.uint56 = {\n preencode(state, n) {\n state.end += 7;\n },\n encode(state, n) {\n validateUint(n);\n const r = Math.floor(n / 16777216);\n uint24.encode(state, n);\n uint32.encode(state, r);\n },\n decode(state) {\n if (state.end - state.start < 7) throw new Error(\"Out of bounds\");\n return uint24.decode(state) + 16777216 * uint32.decode(state);\n }\n };\n var uint64 = exports.uint64 = {\n preencode(state, n) {\n state.end += 8;\n },\n encode(state, n) {\n validateUint(n);\n const r = Math.floor(n / 4294967296);\n uint32.encode(state, n);\n uint32.encode(state, r);\n },\n decode(state) {\n if (state.end - state.start < 8) throw new Error(\"Out of bounds\");\n return uint32.decode(state) + 4294967296 * uint32.decode(state);\n }\n };\n var int = exports.int = zigZagInt(uint);\n exports.int8 = zigZagInt(uint8);\n exports.int16 = zigZagInt(uint16);\n exports.int24 = zigZagInt(uint24);\n exports.int32 = zigZagInt(uint32);\n exports.int40 = zigZagInt(uint40);\n exports.int48 = zigZagInt(uint48);\n exports.int56 = zigZagInt(uint56);\n exports.int64 = zigZagInt(uint64);\n var biguint64 = exports.biguint64 = {\n preencode(state, n) {\n state.end += 8;\n },\n encode(state, n) {\n const view = new DataView(\n state.buffer.buffer,\n state.start + state.buffer.byteOffset,\n 8\n );\n view.setBigUint64(0, n, true);\n state.start += 8;\n },\n decode(state) {\n if (state.end - state.start < 8) throw new Error(\"Out of bounds\");\n const view = new DataView(\n state.buffer.buffer,\n state.start + state.buffer.byteOffset,\n 8\n );\n const n = view.getBigUint64(0, true);\n state.start += 8;\n return n;\n }\n };\n exports.bigint64 = zigZagBigInt(biguint64);\n var biguint = exports.biguint = {\n preencode(state, n) {\n let len = 0;\n for (let m = n; m; m = m >> 64n) len++;\n uint.preencode(state, len);\n state.end += 8 * len;\n },\n encode(state, n) {\n let len = 0;\n for (let m = n; m; m = m >> 64n) len++;\n uint.encode(state, len);\n const view = new DataView(\n state.buffer.buffer,\n state.start + state.buffer.byteOffset,\n 8 * len\n );\n for (let m = n, i = 0; m; m = m >> 64n, i += 8) {\n view.setBigUint64(i, BigInt.asUintN(64, m), true);\n }\n state.start += 8 * len;\n },\n decode(state) {\n const len = uint.decode(state);\n if (state.end - state.start < 8 * len) throw new Error(\"Out of bounds\");\n const view = new DataView(\n state.buffer.buffer,\n state.start + state.buffer.byteOffset,\n 8 * len\n );\n let n = 0n;\n for (let i = len - 1; i >= 0; i--)\n n = (n << 64n) + view.getBigUint64(i * 8, true);\n state.start += 8 * len;\n return n;\n }\n };\n exports.bigint = zigZagBigInt(biguint);\n exports.lexint = require_lexint();\n exports.float32 = {\n preencode(state, n) {\n state.end += 4;\n },\n encode(state, n) {\n const view = new DataView(\n state.buffer.buffer,\n state.start + state.buffer.byteOffset,\n 4\n );\n view.setFloat32(0, n, true);\n state.start += 4;\n },\n decode(state) {\n if (state.end - state.start < 4) throw new Error(\"Out of bounds\");\n const view = new DataView(\n state.buffer.buffer,\n state.start + state.buffer.byteOffset,\n 4\n );\n const float = view.getFloat32(0, true);\n state.start += 4;\n return float;\n }\n };\n exports.float64 = {\n preencode(state, n) {\n state.end += 8;\n },\n encode(state, n) {\n const view = new DataView(\n state.buffer.buffer,\n state.start + state.buffer.byteOffset,\n 8\n );\n view.setFloat64(0, n, true);\n state.start += 8;\n },\n decode(state) {\n if (state.end - state.start < 8) throw new Error(\"Out of bounds\");\n const view = new DataView(\n state.buffer.buffer,\n state.start + state.buffer.byteOffset,\n 8\n );\n const float = view.getFloat64(0, true);\n state.start += 8;\n return float;\n }\n };\n var buffer = exports.buffer = {\n preencode(state, b) {\n if (b) uint8array.preencode(state, b);\n else state.end++;\n },\n encode(state, b) {\n if (b) uint8array.encode(state, b);\n else state.buffer[state.start++] = 0;\n },\n decode(state) {\n const len = uint.decode(state);\n if (len === 0) return null;\n if (state.end - state.start < len) throw new Error(\"Out of bounds\");\n return state.buffer.subarray(state.start, state.start += len);\n }\n };\n exports.binary = {\n ...buffer,\n preencode(state, b) {\n if (typeof b === \"string\") utf8.preencode(state, b);\n else buffer.preencode(state, b);\n },\n encode(state, b) {\n if (typeof b === \"string\") utf8.encode(state, b);\n else buffer.encode(state, b);\n }\n };\n exports.arraybuffer = {\n preencode(state, b) {\n uint.preencode(state, b.byteLength);\n state.end += b.byteLength;\n },\n encode(state, b) {\n uint.encode(state, b.byteLength);\n const view = new Uint8Array(b);\n state.buffer.set(view, state.start);\n state.start += b.byteLength;\n },\n decode(state) {\n const len = uint.decode(state);\n const b = new ArrayBuffer(len);\n const view = new Uint8Array(b);\n view.set(state.buffer.subarray(state.start, state.start += len));\n return b;\n }\n };\n function typedarray(TypedArray, swap) {\n const n = TypedArray.BYTES_PER_ELEMENT;\n return {\n preencode(state, b) {\n uint.preencode(state, b.length);\n state.end += b.byteLength;\n },\n encode(state, b) {\n uint.encode(state, b.length);\n const view = new Uint8Array(b.buffer, b.byteOffset, b.byteLength);\n if (BE && swap) swap(view);\n state.buffer.set(view, state.start);\n state.start += b.byteLength;\n },\n decode(state) {\n const len = uint.decode(state);\n let b = state.buffer.subarray(state.start, state.start += len * n);\n if (b.byteLength !== len * n) throw new Error(\"Out of bounds\");\n if (b.byteOffset % n !== 0) b = new Uint8Array(b);\n if (BE && swap) swap(b);\n return new TypedArray(b.buffer, b.byteOffset, b.byteLength / n);\n }\n };\n }\n var uint8array = exports.uint8array = typedarray(Uint8Array);\n exports.uint16array = typedarray(Uint16Array, b4a2.swap16);\n exports.uint32array = typedarray(Uint32Array, b4a2.swap32);\n exports.int8array = typedarray(Int8Array);\n exports.int16array = typedarray(Int16Array, b4a2.swap16);\n exports.int32array = typedarray(Int32Array, b4a2.swap32);\n exports.biguint64array = typedarray(BigUint64Array, b4a2.swap64);\n exports.bigint64array = typedarray(BigInt64Array, b4a2.swap64);\n exports.float32array = typedarray(Float32Array, b4a2.swap32);\n exports.float64array = typedarray(Float64Array, b4a2.swap64);\n function string(encoding) {\n return {\n preencode(state, s) {\n const len = b4a2.byteLength(s, encoding);\n uint.preencode(state, len);\n state.end += len;\n },\n encode(state, s) {\n const len = b4a2.byteLength(s, encoding);\n uint.encode(state, len);\n b4a2.write(state.buffer, s, state.start, encoding);\n state.start += len;\n },\n decode(state) {\n const len = uint.decode(state);\n if (state.end - state.start < len) throw new Error(\"Out of bounds\");\n return b4a2.toString(\n state.buffer,\n encoding,\n state.start,\n state.start += len\n );\n },\n fixed(n) {\n return {\n preencode(state) {\n state.end += n;\n },\n encode(state, s) {\n b4a2.write(state.buffer, s, state.start, n, encoding);\n state.start += n;\n },\n decode(state) {\n if (state.end - state.start < n) throw new Error(\"Out of bounds\");\n return b4a2.toString(\n state.buffer,\n encoding,\n state.start,\n state.start += n\n );\n }\n };\n }\n };\n }\n var utf8 = exports.string = exports.utf8 = string(\"utf-8\");\n exports.ascii = string(\"ascii\");\n exports.hex = string(\"hex\");\n exports.base64 = string(\"base64\");\n exports.ucs2 = exports.utf16le = string(\"utf16le\");\n exports.bool = {\n preencode(state, b) {\n state.end++;\n },\n encode(state, b) {\n state.buffer[state.start++] = b ? 1 : 0;\n },\n decode(state) {\n if (state.start >= state.end) throw Error(\"Out of bounds\");\n return state.buffer[state.start++] === 1;\n }\n };\n var fixed = exports.fixed = function fixed2(n) {\n return {\n preencode(state, s) {\n if (s.byteLength !== n) throw new Error(\"Incorrect buffer size\");\n state.end += n;\n },\n encode(state, s) {\n state.buffer.set(s, state.start);\n state.start += n;\n },\n decode(state) {\n if (state.end - state.start < n) throw new Error(\"Out of bounds\");\n return state.buffer.subarray(state.start, state.start += n);\n }\n };\n };\n exports.fixed32 = fixed(32);\n exports.fixed64 = fixed(64);\n exports.array = function array(enc) {\n return {\n preencode(state, list) {\n uint.preencode(state, list.length);\n for (let i = 0; i < list.length; i++) enc.preencode(state, list[i]);\n },\n encode(state, list) {\n uint.encode(state, list.length);\n for (let i = 0; i < list.length; i++) enc.encode(state, list[i]);\n },\n decode(state) {\n const len = uint.decode(state);\n if (len > 1048576) throw new Error(\"Array is too big\");\n const arr = new Array(len);\n for (let i = 0; i < len; i++) arr[i] = enc.decode(state);\n return arr;\n }\n };\n };\n exports.frame = function frame(enc) {\n const dummy = exports.state();\n return {\n preencode(state, m) {\n const end = state.end;\n enc.preencode(state, m);\n uint.preencode(state, state.end - end);\n },\n encode(state, m) {\n dummy.end = 0;\n enc.preencode(dummy, m);\n uint.encode(state, dummy.end);\n enc.encode(state, m);\n },\n decode(state) {\n const end = state.end;\n const len = uint.decode(state);\n state.end = state.start + len;\n const m = enc.decode(state);\n state.start = state.end;\n state.end = end;\n return m;\n }\n };\n };\n exports.date = {\n preencode(state, d) {\n int.preencode(state, d.getTime());\n },\n encode(state, d) {\n int.encode(state, d.getTime());\n },\n decode(state, d) {\n return new Date(int.decode(state));\n }\n };\n exports.json = {\n preencode(state, v) {\n utf8.preencode(state, JSON.stringify(v));\n },\n encode(state, v) {\n utf8.encode(state, JSON.stringify(v));\n },\n decode(state) {\n return JSON.parse(utf8.decode(state));\n }\n };\n exports.ndjson = {\n preencode(state, v) {\n utf8.preencode(state, JSON.stringify(v) + \"\\n\");\n },\n encode(state, v) {\n utf8.encode(state, JSON.stringify(v) + \"\\n\");\n },\n decode(state) {\n return JSON.parse(utf8.decode(state));\n }\n };\n exports.none = {\n preencode(state, n) {\n },\n encode(state, n) {\n },\n decode(state) {\n return null;\n }\n };\n var anyArray = {\n preencode(state, arr) {\n uint.preencode(state, arr.length);\n for (let i = 0; i < arr.length; i++) {\n any.preencode(state, arr[i]);\n }\n },\n encode(state, arr) {\n uint.encode(state, arr.length);\n for (let i = 0; i < arr.length; i++) {\n any.encode(state, arr[i]);\n }\n },\n decode(state) {\n const arr = [];\n let len = uint.decode(state);\n while (len-- > 0) {\n arr.push(any.decode(state));\n }\n return arr;\n }\n };\n var anyObject = {\n preencode(state, o) {\n const keys = Object.keys(o);\n uint.preencode(state, keys.length);\n for (const key of keys) {\n utf8.preencode(state, key);\n any.preencode(state, o[key]);\n }\n },\n encode(state, o) {\n const keys = Object.keys(o);\n uint.encode(state, keys.length);\n for (const key of keys) {\n utf8.encode(state, key);\n any.encode(state, o[key]);\n }\n },\n decode(state) {\n let len = uint.decode(state);\n const o = {};\n while (len-- > 0) {\n const key = utf8.decode(state);\n o[key] = any.decode(state);\n }\n return o;\n }\n };\n var anyTypes = [\n exports.none,\n exports.bool,\n exports.string,\n exports.buffer,\n exports.uint,\n exports.int,\n exports.float64,\n anyArray,\n anyObject,\n exports.date\n ];\n var any = exports.any = {\n preencode(state, o) {\n const t = getType(o);\n uint.preencode(state, t);\n anyTypes[t].preencode(state, o);\n },\n encode(state, o) {\n const t = getType(o);\n uint.encode(state, t);\n anyTypes[t].encode(state, o);\n },\n decode(state) {\n const t = uint.decode(state);\n if (t >= anyTypes.length) throw new Error(\"Unknown type: \" + t);\n return anyTypes[t].decode(state);\n }\n };\n var port = exports.port = uint16;\n var address = (host, family) => {\n return {\n preencode(state, m) {\n host.preencode(state, m.host);\n port.preencode(state, m.port);\n },\n encode(state, m) {\n host.encode(state, m.host);\n port.encode(state, m.port);\n },\n decode(state) {\n return {\n host: host.decode(state),\n family,\n port: port.decode(state)\n };\n }\n };\n };\n var ipv4 = exports.ipv4 = {\n preencode(state) {\n state.end += 4;\n },\n encode(state, string2) {\n const start = state.start;\n const end = start + 4;\n let i = 0;\n while (i < string2.length) {\n let n = 0;\n let c2;\n while (i < string2.length && (c2 = string2.charCodeAt(i++)) !== /* . */\n 46) {\n n = n * 10 + (c2 - /* 0 */\n 48);\n }\n state.buffer[state.start++] = n;\n }\n state.start = end;\n },\n decode(state) {\n if (state.end - state.start < 4) throw new Error(\"Out of bounds\");\n return state.buffer[state.start++] + \".\" + state.buffer[state.start++] + \".\" + state.buffer[state.start++] + \".\" + state.buffer[state.start++];\n }\n };\n exports.ipv4Address = address(ipv4, 4);\n var ipv6 = exports.ipv6 = {\n preencode(state) {\n state.end += 16;\n },\n encode(state, string2) {\n const start = state.start;\n const end = start + 16;\n let i = 0;\n let split = null;\n while (i < string2.length) {\n let n = 0;\n let c2;\n while (i < string2.length && (c2 = string2.charCodeAt(i++)) !== /* : */\n 58) {\n if (c2 >= 48 && c2 <= 57) n = n * 16 + (c2 - /* 0 */\n 48);\n else if (c2 >= 65 && c2 <= 70) n = n * 16 + (c2 - /* A */\n 65 + 10);\n else if (c2 >= 97 && c2 <= 102) n = n * 16 + (c2 - /* a */\n 97 + 10);\n }\n state.buffer[state.start++] = n >>> 8;\n state.buffer[state.start++] = n;\n if (i < string2.length && string2.charCodeAt(i) === /* : */\n 58) {\n i++;\n split = state.start;\n }\n }\n if (split !== null) {\n const offset = end - state.start;\n state.buffer.copyWithin(split + offset, split).fill(0, split, split + offset);\n }\n state.start = end;\n },\n decode(state) {\n if (state.end - state.start < 16) throw new Error(\"Out of bounds\");\n return (state.buffer[state.start++] * 256 + state.buffer[state.start++]).toString(16) + \":\" + (state.buffer[state.start++] * 256 + state.buffer[state.start++]).toString(16) + \":\" + (state.buffer[state.start++] * 256 + state.buffer[state.start++]).toString(16) + \":\" + (state.buffer[state.start++] * 256 + state.buffer[state.start++]).toString(16) + \":\" + (state.buffer[state.start++] * 256 + state.buffer[state.start++]).toString(16) + \":\" + (state.buffer[state.start++] * 256 + state.buffer[state.start++]).toString(16) + \":\" + (state.buffer[state.start++] * 256 + state.buffer[state.start++]).toString(16) + \":\" + (state.buffer[state.start++] * 256 + state.buffer[state.start++]).toString(16);\n }\n };\n exports.ipv6Address = address(ipv6, 6);\n var ip = exports.ip = {\n preencode(state, string2) {\n const family = string2.includes(\":\") ? 6 : 4;\n uint8.preencode(state, family);\n if (family === 4) ipv4.preencode(state);\n else ipv6.preencode(state);\n },\n encode(state, string2) {\n const family = string2.includes(\":\") ? 6 : 4;\n uint8.encode(state, family);\n if (family === 4) ipv4.encode(state, string2);\n else ipv6.encode(state, string2);\n },\n decode(state) {\n const family = uint8.decode(state);\n if (family === 4) return ipv4.decode(state);\n else return ipv6.decode(state);\n }\n };\n exports.ipAddress = {\n preencode(state, m) {\n ip.preencode(state, m.host);\n port.preencode(state, m.port);\n },\n encode(state, m) {\n ip.encode(state, m.host);\n port.encode(state, m.port);\n },\n decode(state) {\n const family = uint8.decode(state);\n return {\n host: family === 4 ? ipv4.decode(state) : ipv6.decode(state),\n family,\n port: port.decode(state)\n };\n }\n };\n var record = exports.record = function(keyEncoding, valueEncoding) {\n return {\n preencode(state, v) {\n const keys = Object.keys(v);\n uint.preencode(state, keys.length);\n for (const k of keys) {\n keyEncoding.preencode(state, k);\n valueEncoding.preencode(state, v[k]);\n }\n },\n encode(state, v) {\n const keys = Object.keys(v);\n uint.encode(state, keys.length);\n for (const k of keys) {\n keyEncoding.encode(state, k);\n valueEncoding.encode(state, v[k]);\n }\n },\n decode(state) {\n const out = /* @__PURE__ */ Object.create(null);\n const keys = uint.decode(state);\n for (let i = 0; i < keys; i++) {\n out[keyEncoding.decode(state)] = valueEncoding.decode(state);\n }\n return out;\n }\n };\n };\n exports.stringRecord = record(utf8, utf8);\n function getType(o) {\n if (o === null || o === void 0) return 0;\n if (typeof o === \"boolean\") return 1;\n if (typeof o === \"string\") return 2;\n if (b4a2.isBuffer(o)) return 3;\n if (typeof o === \"number\") {\n if (Number.isInteger(o)) return o >= 0 ? 4 : 5;\n return 6;\n }\n if (Array.isArray(o)) return 7;\n if (o instanceof Date) return 9;\n if (typeof o === \"object\") return 8;\n throw new Error(\"Unsupported type for \" + o);\n }\n exports.from = function from(enc) {\n if (typeof enc === \"string\") return fromNamed(enc);\n if (enc.preencode) return enc;\n if (enc.encodingLength) return fromAbstractEncoder(enc);\n return fromCodec(enc);\n };\n function fromNamed(enc) {\n switch (enc) {\n case \"ascii\":\n return raw.ascii;\n case \"utf-8\":\n case \"utf8\":\n return raw.utf8;\n case \"hex\":\n return raw.hex;\n case \"base64\":\n return raw.base64;\n case \"utf16-le\":\n case \"utf16le\":\n case \"ucs-2\":\n case \"ucs2\":\n return raw.ucs2;\n case \"ndjson\":\n return raw.ndjson;\n case \"json\":\n return raw.json;\n case \"binary\":\n default:\n return raw.binary;\n }\n }\n function fromCodec(enc) {\n let tmpM = null;\n let tmpBuf = null;\n return {\n preencode(state, m) {\n tmpM = m;\n tmpBuf = enc.encode(m);\n state.end += tmpBuf.byteLength;\n },\n encode(state, m) {\n raw.encode(state, m === tmpM ? tmpBuf : enc.encode(m));\n tmpM = tmpBuf = null;\n },\n decode(state) {\n return enc.decode(raw.decode(state));\n }\n };\n }\n function fromAbstractEncoder(enc) {\n return {\n preencode(state, m) {\n state.end += enc.encodingLength(m);\n },\n encode(state, m) {\n enc.encode(m, state.buffer, state.start);\n state.start += enc.encode.bytes;\n },\n decode(state) {\n const m = enc.decode(state.buffer, state.start, state.end);\n state.start += enc.decode.bytes;\n return m;\n }\n };\n }\n exports.encode = function encode(enc, m) {\n const state = exports.state();\n enc.preencode(state, m);\n state.buffer = b4a2.allocUnsafe(state.end);\n enc.encode(state, m);\n return state.buffer;\n };\n exports.decode = function decode(enc, buffer2) {\n return enc.decode(exports.state(0, buffer2.byteLength, buffer2));\n };\n function zigZagInt(enc) {\n return {\n preencode(state, n) {\n enc.preencode(state, zigZagEncodeInt(n));\n },\n encode(state, n) {\n enc.encode(state, zigZagEncodeInt(n));\n },\n decode(state) {\n return zigZagDecodeInt(enc.decode(state));\n }\n };\n }\n function zigZagDecodeInt(n) {\n return n === 0 ? n : (n & 1) === 0 ? n / 2 : -(n + 1) / 2;\n }\n function zigZagEncodeInt(n) {\n return n < 0 ? 2 * -n - 1 : n === 0 ? 0 : 2 * n;\n }\n function zigZagBigInt(enc) {\n return {\n preencode(state, n) {\n enc.preencode(state, zigZagEncodeBigInt(n));\n },\n encode(state, n) {\n enc.encode(state, zigZagEncodeBigInt(n));\n },\n decode(state) {\n return zigZagDecodeBigInt(enc.decode(state));\n }\n };\n }\n function zigZagDecodeBigInt(n) {\n return n === 0n ? n : (n & 1n) === 0n ? n / 2n : -(n + 1n) / 2n;\n }\n function zigZagEncodeBigInt(n) {\n return n < 0n ? 2n * -n - 1n : n === 0n ? 0n : 2n * n;\n }\n function validateUint(n) {\n if (n >= 0 === false)\n throw new Error(\"uint must be positive\");\n }\n }\n });\n\n // node_modules/compact-encoding-struct/bitfield.js\n var require_bitfield = __commonJS({\n \"node_modules/compact-encoding-struct/bitfield.js\"(exports, module) {\n var c2 = require_compact_encoding();\n module.exports = {\n preencode(state, bits = [], prev) {\n c2.uint.preencode(state, bitsToNumberLE(bits));\n },\n encode(state, bits = []) {\n const num = bitsToNumberLE(bits);\n c2.uint.encode(state, num);\n },\n decode(state) {\n const num = c2.uint.decode(state);\n return numberToBitsLE(num);\n }\n };\n function bitsToNumberLE(bits) {\n let num = 0;\n for (let i = 0; i < bits.length; i++) {\n num |= bits[i] << i;\n }\n return num;\n }\n function numberToBitsLE(num) {\n const bits = [];\n while (num > 0) {\n bits.push(num & 1);\n num >>>= 1;\n }\n return bits;\n }\n }\n });\n\n // node_modules/compact-encoding-struct/index.js\n var require_compact_encoding_struct = __commonJS({\n \"node_modules/compact-encoding-struct/index.js\"(exports, module) {\n var c2 = require_compact_encoding();\n var bitfield = require_bitfield();\n module.exports = {\n compile: compile2,\n opt,\n array,\n constant,\n header,\n getHeader,\n either\n };\n function compile2(struct) {\n function preencode(state, msg) {\n if (!state.headers) state.headers = [];\n const headerIndex = state.headers.length;\n const header2 = {};\n header2.flag = [];\n header2.opt = [];\n header2.state = {\n start: 0,\n end: 0,\n buffer: null\n };\n for (const [field, cenc2] of Object.entries(struct)) {\n const enc = parseArray(cenc2);\n enc.preencode(state, msg[field], header2);\n }\n bitfield.preencode(header2.state, header2.flag);\n bitfield.preencode(header2.state, header2.opt);\n state.headers.splice(headerIndex, -1, header2);\n c2.uint.preencode(state, header2.state.end);\n state.end += header2.state.end;\n }\n function encode(state, msg) {\n const header2 = state.headers.shift();\n header2.state.buffer = Buffer.alloc(header2.state.end);\n const headerOffset = state.start;\n c2.buffer.encode(state, header2.state.buffer);\n bitfield.encode(header2.state, header2.flag);\n bitfield.encode(header2.state, header2.opt);\n for (const [field, cenc2] of Object.entries(struct)) {\n const enc = parseArray(cenc2);\n enc.encode(state, msg[field], header2);\n }\n const finalOffset = state.start;\n state.start = headerOffset;\n c2.buffer.encode(state, header2.state.buffer);\n state.start = finalOffset;\n }\n function decode(state) {\n const buffer = c2.buffer.decode(state);\n const header2 = {\n start: 0,\n end: buffer.byteLength,\n buffer\n };\n const flag = bitfield.decode(header2);\n const opt2 = bitfield.decode(header2);\n const ret = {};\n for (const [field, cenc2] of Object.entries(struct)) {\n const enc = parseArray(cenc2);\n ret[field] = enc.decode(state, { flag, opt: opt2, state: header2 });\n }\n return ret;\n }\n return {\n preencode,\n encode,\n decode\n };\n }\n function getHeader(buf, struct) {\n const buffer = c2.decode(c2.buffer, buf);\n const state = {\n start: 0,\n end: buffer.byteLength,\n buffer\n };\n const flag = bitfield.decode(state);\n const opt2 = bitfield.decode(state);\n const ret = {};\n for (const [field, cenc2] of Object.entries(struct)) {\n const enc = parseArray(cenc2);\n ret[field] = enc.decode(state, { flag, opt: opt2, state });\n }\n return ret;\n }\n function opt(enc, defaultVal = null) {\n const cenc2 = parseArray(enc);\n return {\n preencode(state, opt2, header2) {\n if (opt2) cenc2.preencode(header2.state, opt2);\n header2.opt.push(!!opt2);\n },\n encode(state, opt2, header2) {\n if (header2.opt.shift()) cenc2.encode(header2.state, opt2);\n },\n decode(state, header2) {\n if (!header2.opt.shift()) return defaultVal;\n return cenc2.decode(header2.state);\n }\n };\n }\n function constant(enc, value) {\n return {\n preencode(state) {\n enc.preencode(state, value);\n },\n encode(state) {\n enc.encode(state, value);\n },\n decode(state) {\n const prop = enc.decode(state);\n if (!same(prop, value)) {\n throw new Error(`Expect constant value: ${value}, got ${prop}`);\n }\n return value;\n }\n };\n }\n function header(enc) {\n return {\n preencode(state, value, header2) {\n enc.preencode(header2.state, value);\n },\n encode(state, value, header2) {\n enc.encode(header2.state, value);\n },\n decode(state, header2) {\n return enc.decode(header2.state);\n }\n };\n }\n function array(enc) {\n return [enc];\n }\n module.exports.flag = {\n preencode(state, bool, header2) {\n header2.flag.push(bool);\n },\n encode() {\n },\n // ignore\n decode(state, header2) {\n return !!header2.flag.shift();\n }\n };\n function either(encodings, test) {\n return {\n preencode(state, value) {\n const index = test(value);\n c2.uint.preencode(state, index);\n encodings[index].preencode(state, value);\n },\n encode(state, value) {\n const index = test(value);\n c2.uint.encode(state, index);\n encodings[index].encode(state, value);\n },\n decode(state) {\n const index = c2.uint.decode(state);\n return encodings[index].decode(state);\n }\n };\n }\n function parseArray(enc) {\n let nest = 0;\n while (Array.isArray(enc)) {\n enc = enc[0];\n nest++;\n }\n for (let i = 0; i < nest; i++) enc = c2.array(enc);\n return enc;\n }\n function same(a, b) {\n if (typeof a !== typeof b) return false;\n if (typeof a === \"number\" || typeof a === \"string\") return a === b;\n if (a instanceof Uint8Array) {\n if (!(b instanceof Uint8Array)) return false;\n return Buffer.compare(a, b) === 0;\n }\n return false;\n }\n }\n });\n\n // client-entry.mjs\n var import_buffer = __toESM(require_buffer(), 1);\n\n // node_modules/pear-request/dist/requests.js\n var import_compact_encoding = __toESM(require_compact_encoding(), 1);\n var import_compact_encoding_struct = __toESM(require_compact_encoding_struct(), 1);\n var import_b4a = __toESM(require_browser(), 1);\n var import_compact_encoding2 = __toESM(require_compact_encoding(), 1);\n var requestEncoding = (0, import_compact_encoding_struct.compile)({\n id: import_compact_encoding.default.string,\n body: import_compact_encoding.default.buffer,\n url: import_compact_encoding.default.string,\n method: import_compact_encoding.default.string\n });\n var responseEncoding = (0, import_compact_encoding_struct.compile)({\n id: import_compact_encoding.default.string,\n body: import_compact_encoding.default.buffer,\n headers: import_compact_encoding.default.json,\n status: import_compact_encoding.default.uint16\n });\n function create(pipe) {\n const pendingRequests = {};\n class PearRequestUpload {\n events = {};\n addEventListener(event, callback) {\n this.events[event] = callback;\n }\n }\n class PearRequest {\n method;\n url;\n mimeType;\n readyState = 0;\n headers = {};\n events = {};\n _responseHeaders;\n _response;\n status;\n statusText;\n static _pendingRequests = {};\n onload;\n getAllResponseHeaders() {\n return {\n ...this._responseHeaders\n };\n }\n get response() {\n if (!this._response) {\n return null;\n }\n if (this.mimeType === \"application/json\") {\n return JSON.parse(import_b4a.default.toString(this._response, \"utf-8\"));\n } else if (this.mimeType?.startsWith(\"text/\")) {\n return import_b4a.default.toString(this._response, \"utf-8\");\n } else {\n return this._response;\n }\n }\n get responseText() {\n return this._response?.toString(\"utf-8\");\n }\n get responseType() {\n return this.mimeType;\n }\n open(method, url) {\n this.method = method;\n this.url = url;\n this.readyState = 1;\n }\n send(body) {\n const id = crypto.randomUUID();\n this.readyState = 2;\n pendingRequests[id] = this;\n const buff = !body ? Buffer.alloc(0) : Buffer.isBuffer(body) ? body : Buffer.from(body, \"utf-8\");\n pipe.write(import_compact_encoding2.default.encode(requestEncoding, {\n id,\n method: this.method,\n url: this.url,\n body: buff\n }));\n }\n upload = new PearRequestUpload();\n overrideMimeType(mimeType) {\n this.mimeType = mimeType;\n }\n setRequestHeader(header2, value) {\n this.headers[header2] = value;\n }\n addEventListener(event, callback) {\n this.events[event] = callback;\n }\n }\n let incomingBuffer = Buffer.alloc(0);\n let expectedLength = 0;\n pipe.on(\"data\", (data) => {\n incomingBuffer = Buffer.concat([incomingBuffer, Buffer.from(data)]);\n try {\n if (incomingBuffer.length < 4) {\n return;\n }\n if (expectedLength === 0) {\n const length = import_compact_encoding2.default.decode(import_compact_encoding2.default.uint32, incomingBuffer.subarray(0, 4));\n expectedLength = length;\n incomingBuffer = incomingBuffer.subarray(4);\n }\n if (incomingBuffer.length < expectedLength) {\n return;\n }\n const { id, body, headers } = import_compact_encoding2.default.decode(responseEncoding, incomingBuffer);\n const pendingRequest = pendingRequests[id];\n if (pendingRequest) {\n pendingRequest._response = pendingRequest._response ? Buffer.concat([pendingRequest._response, body]) : body;\n pendingRequest.status = 200;\n pendingRequest.statusText = \"OK\";\n pendingRequest._responseHeaders = headers;\n pendingRequest.readyState = 4;\n pendingRequest[\"onload\"]?.();\n }\n incomingBuffer = Buffer.alloc(0);\n expectedLength = 0;\n } catch (error) {\n console.error(\"Error decoding header\", error);\n }\n });\n return PearRequest;\n }\n\n // client-entry.mjs\n if (!globalThis.Buffer) globalThis.Buffer = import_buffer.Buffer;\n globalThis.createPearRequest = create;\n})();\n/*! Bundled license information:\n\nieee754/index.js:\n (*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> *)\n\nbuffer/index.js:\n (*!\n * The buffer module from node.js, for the browser.\n *\n * @author Feross Aboukhadijeh <https://feross.org>\n * @license MIT\n *)\n*/\n"
}