26 lines
184 KiB
JavaScript
Raw Normal View History

"use strict";var Web5Common=(()=>{var _c=Object.create;var $r=Object.defineProperty;var xc=Object.getOwnPropertyDescriptor;var Sc=Object.getOwnPropertyNames;var Tc=Object.getPrototypeOf,Ac=Object.prototype.hasOwnProperty;var b=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Ns=(t,e)=>{for(var r in e)$r(t,r,{get:e[r],enumerable:!0})},Ms=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Sc(e))!Ac.call(t,i)&&i!==r&&$r(t,i,{get:()=>e[i],enumerable:!(n=xc(e,i))||n.enumerable});return t};var jr=(t,e,r)=>(r=t!=null?_c(Tc(t)):{},Ms(e||!t||!t.__esModule?$r(r,"default",{value:t,enumerable:!0}):r,t)),Rc=t=>Ms($r({},"__esModule",{value:!0}),t);var Ds=b(($g,ks)=>{var vc=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,Vr=()=>vc.now(),Ic=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),ti=t=>t===1/0||Ic(t),ri=class t{constructor({max:e=1/0,ttl:r,updateAgeOnGet:n=!1,checkAgeOnGet:i=!1,noUpdateTTL:o=!1,dispose:s,noDisposeOnSet:a=!1}={}){if(this.expirations=Object.create(null),this.data=new Map,this.expirationMap=new Map,r!==void 0&&!ti(r))throw new TypeError("ttl must be positive integer or Infinity if set");if(!ti(e))throw new TypeError("max must be positive integer or Infinity");if(this.ttl=r,this.max=e,this.updateAgeOnGet=!!n,this.checkAgeOnGet=!!i,this.noUpdateTTL=!!o,this.noDisposeOnSet=!!a,s!==void 0){if(typeof s!="function")throw new TypeError("dispose must be function if set");this.dispose=s}this.timer=void 0,this.timerExpiration=void 0}setTimer(e,r){if(this.timerExpiration<e)return;this.timer&&clearTimeout(this.timer);let n=setTimeout(()=>{this.timer=void 0,this.timerExpiration=void 0,this.purgeStale();for(let i in this.expirations){this.setTimer(i,i-Vr());break}},r);n.unref&&n.unref(),this.timerExpiration=e,this.timer=n}cancelTimer(){this.timer&&(clearTimeout(this.timer),this.timerExpiration=void 0,this.timer=void 0)}cancelTimers(){return process.emitWarning('TTLCache.cancelTimers has been renamed to TTLCache.cancelTimer (no "s"), and will be removed in the next major version update'),this.cancelTimer()}clear(){let e=this.dispose!==t.prototype.dispose?[...this]:[];this.data.clear(),this.expirationMap.clear(),this.cancelTimer(),this.expirations=Object.create(null);for(let[r,n]of e)this.dispose(n,r,"delete")}setTTL(e,r=this.ttl){let n=this.expirationMap.get(e);if(n!==void 0){let i=this.expirations[n];!i||i.length<=1?delete this.expirations[n]:this.expirations[n]=i.filter(o=>o!==e)}if(r!==1/0){let i=Math.floor(Vr()+r);this.expirationMap.set(e,i),this.expirations[i]||(this.expirations[i]=[],this.setTimer(i,r)),this.expirations[i].push(e)}else this.expirationMap.set(e,1/0)}set(e,r,{ttl:n=this.ttl,noUpdateTTL:i=this.noUpdateTTL,noDisposeOnSet:o=this.noDisposeOnSet}={}){if(!ti(n))throw new TypeError("ttl must be positive integer or Infinity");if(this.expirationMap.has(e)){i||this.setTTL(e,n);let s=this.data.get(e);s!==r&&(this.data.set(e,r),o||this.dispose(s,e,"set"))}else this.setTTL(e,n),this.data.set(e,r);for(;this.size>this.max;)this.purgeToCapacity();return this}has(e){return this.data.has(e)}getRemainingTTL(e){let r=this.expirationMap.get(e);return r===1/0?r:r!==void 0?Math.max(0,Math.ceil(r-Vr())):0}get(e,{updateAgeOnGet:r=this.updateAgeOnGet,ttl:n=this.ttl,checkAgeOnGet:i=this.checkAgeOnGet}={}){let o=this.data.get(e);if(i&&this.getRemainingTTL(e)===0){this.delete(e);return}return r&&this.setTTL(e,n),o}dispose(e,r){}delete(e){let r=this.expirationMap.get(e);if(r!==void 0){let n=this.data.get(e);this.data.delete(e),this.expirationMap.delete(e);let i=this.expirations[r];return i&&(i.length<=1?delete this.expirations[r]:this.expirations[r]=i.filter(o=>o!==e)),this.dispose(n,e,"delete"),this.size===0&&this.cancelTimer(),!0}return!1}purgeToCapacity(){for(let e in this.expirations){let r=this.expirations[e];if(this.size-r.length>=this.max){delete this.expirations[e];let n=[];for(let i of r)n.push([i,this.data.get(i)]),this.data.delete(i),this.expirationMap.delete(i);for(let[i,o]of n)this.dispose(o,i,"evict")}else{let n=this.size-this.max,i=[];for(let o of r.splic
`;super(r),this.name="AggregateError",this.errors=e}};_o.exports={AggregateError:Eo,kEmptyObject:Object.freeze({}),once(t){let e=!1;return function(...r){e||(e=!0,t.apply(this,r))}},createDeferredPromise:function(){let t,e;return{promise:new Promise((n,i)=>{t=n,e=i}),resolve:t,reject:e}},promisify(t){return new Promise((e,r)=>{t((n,...i)=>n?r(n):e(...i))})},debuglog(){return function(){}},format(t,...e){return t.replace(/%([sdifj])/g,function(...[r,n]){let i=e.shift();return n==="f"?i.toFixed(6):n==="j"?JSON.stringify(i):n==="s"&&typeof i=="object"?`${i.constructor!==Object?i.constructor.name:""} {}`.trim():i.toString()})},inspect(t){switch(typeof t){case"string":if(t.includes("'"))if(t.includes('"')){if(!t.includes("`")&&!t.includes("${"))return`\`${t}\``}else return`"${t}"`;return`'${t}'`;case"number":return isNaN(t)?"NaN":Object.is(t,-0)?String(t):t;case"bigint":return`${String(t)}n`;case"boolean":case"undefined":return String(t);case"object":return"{}"}},types:{isAsyncFunction(t){return t instanceof Wh},isArrayBufferView(t){return ArrayBuffer.isView(t)}},isBlob:Kh};_o.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")});var Tn=b((wE,Sn)=>{"use strict";var{AbortController:ku,AbortSignal:Gh}=typeof self<"u"?self:typeof window<"u"?window:void 0;Sn.exports=ku;Sn.exports.AbortSignal=Gh;Sn.exports.default=ku});var V=b((gE,Fu)=>{"use strict";var{format:Hh,inspect:An,AggregateError:zh}=be(),Yh=globalThis.AggregateError||zh,Jh=Symbol("kIsNodeError"),Xh=["string","function","number","object","Function","Object","boolean","bigint","symbol"],Zh=/^([A-Z][a-z0-9]*)+$/,Qh="__node_internal_",Rn={};function Et(t,e){if(!t)throw new Rn.ERR_INTERNAL_ASSERTION(e)}function Du(t){let e="",r=t.length,n=t[0]==="-"?1:0;for(;r>=n+4;r-=3)e=`_${t.slice(r-3,r)}${e}`;return`${t.slice(0,r)}${e}`}function ep(t,e,r){if(typeof e=="function")return Et(e.length<=r.length,`Code: ${t}; The provided arguments length (${r.length}) does not match the required ones (${e.length}).`),e(...r);let n=(e.match(/%[dfijoOs]/g)||[]).length;return Et(n===r.length,`Code: ${t}; The provided arguments length (${r.length}) does not match the required ones (${n}).`),r.length===0?e:Hh(e,...r)}function P(t,e,r){r||(r=Error);class n extends r{constructor(...o){super(ep(t,e,o))}toString(){return`${this.name} [${t}]: ${this.message}`}}Object.defineProperties(n.prototype,{name:{value:r.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${t}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),n.prototype.code=t,n.prototype[Jh]=!0,Rn[t]=n}function Uu(t){let e=Qh+t.name;return Object.defineProperty(t,"name",{value:e}),t}function tp(t,e){if(t&&e&&t!==e){if(Array.isArray(e.errors))return e.errors.push(t),e;let r=new Yh([e,t],e.message);return r.code=e.code,r}return t||e}var xo=class extends Error{constructor(e="The operation was aborted",r=void 0){if(r!==void 0&&typeof r!="object")throw new Rn.ERR_INVALID_ARG_TYPE("options","Object",r);super(e,r),this.code="ABORT_ERR",this.name="AbortError"}};P("ERR_ASSERTION","%s",Error);P("ERR_INVALID_ARG_TYPE",(t,e,r)=>{Et(typeof t=="string","'name' must be a string"),Array.isArray(e)||(e=[e]);let n="The ";t.endsWith(" argument")?n+=`${t} `:n+=`"${t}" ${t.includes(".")?"property":"argument"} `,n+="must be ";let i=[],o=[],s=[];for(let u of e)Et(typeof u=="string","All expected entries have to be of type string"),Xh.includes(u)?i.push(u.toLowerCase()):Zh.test(u)?o.push(u):(Et(u!=="object",'The value "object" should be written as "Object"'),s.push(u));if(o.length>0){let u=i.indexOf("object");u!==-1&&(i.splice(i,u,1),o.push("Object"))}if(i.length>0){switch(i.length){case 1:n+=`of type ${i[0]}`;break;case 2:n+=`one of type ${i[0]} or ${i[1]}`;break;default:{let u=i.pop();n+=`one of type ${i.join(", ")}, or ${u}`}}(o.length>0||s.length>0)&&(n+=" or ")}if(o.length>0){switch(o.length){case 1:n+=`an instance of ${o[0]}`;break;case 2:n+=`an instance of ${o[0]} or ${o[1]}`;break;default:{let u=o.pop();n+=`an instance of ${o.join(", ")}, or ${u}`}}s.length>0&&(n+=" or ")}switch(s.length){case 0
/*! Bundled license information:
ieee754/index.js:
(*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> *)
buffer/index.js:
(*!
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh <https://feross.org>
* @license MIT
*)
queue-microtask/index.js:
(*! queue-microtask. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> *)
run-parallel-limit/index.js:
(*! run-parallel-limit. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> *)
safe-buffer/index.js:
(*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> *)
*/
//# sourceMappingURL=browser.js.map