doipjs/dist/doip.fetchers.minimal.min.js

22 lines
1 MiB
JavaScript
Raw Normal View History

2024-01-23 11:06:49 -07:00
var doipFetchers=function(e){"use strict";var t="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{};function r(e,t){return function(){return e.apply(t,arguments)}}const{toString:n}=Object.prototype,{getPrototypeOf:i}=Object,a=(o=Object.create(null),e=>{const t=n.call(e);return o[t]||(o[t]=t.slice(8,-1).toLowerCase())});var o;const s=e=>(e=e.toLowerCase(),t=>a(t)===e),c=e=>t=>typeof t===e,{isArray:u}=Array,h=c("undefined");const l=s("ArrayBuffer");const f=c("string"),d=c("function"),p=c("number"),g=e=>null!==e&&"object"==typeof e,A=e=>{if("object"!==a(e))return!1;const t=i(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)},y=s("Date"),m=s("File"),b=s("Blob"),w=s("FileList"),v=s("URLSearchParams");function I(e,t,{allOwnKeys:r=!1}={}){if(null==e)return;let n,i;if("object"!=typeof e&&(e=[e]),u(e))for(n=0,i=e.length;n<i;n++)t.call(null,e[n],n,e);else{const i=r?Object.getOwnPropertyNames(e):Object.keys(e),a=i.length;let o;for(n=0;n<a;n++)o=i[n],t.call(null,e[o],o,e)}}function E(e,t){t=t.toLowerCase();const r=Object.keys(e);let n,i=r.length;for(;i-- >0;)if(n=r[i],t===n.toLowerCase())return n;return null}const B="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:t,C=e=>!h(e)&&e!==B;const _=(k="undefined"!=typeof Uint8Array&&i(Uint8Array),e=>k&&e instanceof k);var k;const S=s("HTMLFormElement"),Q=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),x=s("RegExp"),P=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};I(r,((r,i)=>{let a;!1!==(a=t(r,i,e))&&(n[i]=a||r)})),Object.defineProperties(e,n)},M="abcdefghijklmnopqrstuvwxyz",U="0123456789",D={DIGIT:U,ALPHA:M,ALPHA_DIGIT:M+M.toUpperCase()+U};const R=s("AsyncFunction");var F={isArray:u,isArrayBuffer:l,isBuffer:function(e){return null!==e&&!h(e)&&null!==e.constructor&&!h(e.constructor)&&d(e.constructor.isBuffer)&&e.constructor.isBuffer(e)},isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||d(e.append)&&("formdata"===(t=a(e))||"object"===t&&d(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&l(e.buffer),t},isString:f,isNumber:p,isBoolean:e=>!0===e||!1===e,isObject:g,isPlainObject:A,isUndefined:h,isDate:y,isFile:m,isBlob:b,isRegExp:x,isFunction:d,isStream:e=>g(e)&&d(e.pipe),isURLSearchParams:v,isTypedArray:_,isFileList:w,forEach:I,merge:function e(){const{caseless:t}=C(this)&&this||{},r={},n=(n,i)=>{const a=t&&E(r,i)||i;A(r[a])&&A(n)?r[a]=e(r[a],n):A(n)?r[a]=e({},n):u(n)?r[a]=n.slice():r[a]=n};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&I(arguments[e],n);return r},extend:(e,t,n,{allOwnKeys:i}={})=>(I(t,((t,i)=>{n&&d(t)?e[i]=r(t,n):e[i]=t}),{allOwnKeys:i}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,r,n)=>{e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},toFlatObject:(e,t,r,n)=>{let a,o,s;const c={};if(t=t||{},null==e)return t;do{for(a=Object.getOwnPropertyNames(e),o=a.length;o-- >0;)s=a[o],n&&!n(s,e,t)||c[s]||(t[s]=e[s],c[s]=!0);e=!1!==r&&i(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},kindOf:a,kindOfTest:s,endsWith:(e,t,r)=>{e=String(e),(void 0===r||r>e.length)&&(r=e.length),r-=t.length;const n=e.indexOf(t,r);return-1!==n&&n===r},toArray:e=>{if(!e)return null;if(u(e))return e;let t=e.length;if(!p(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},forEachEntry:(e,t)=>{const r=(e&&e[Symbol.iterator]).call(e);let n;for(;(n=r.next())&&!n.done;){const r=n.value;t.call(e,r[0],r[1])}},matchAll:(e,t)=>{let r;const n=[];for(;null!==(r=e.exec(t));)n.push(r);return n},isHTMLForm:S,hasOwnProperty:Q,hasOwnProp:Q,reduceDescriptors:P,freezeMethods:e=>{P(e,((t,r)=>{if(d(e)&&-1!==["arguments","caller","cal
/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */};function Yy(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+t+" is not a constructor or null");function r(){this.constructor=e}Vy(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}function Xy(e){if(!e)throw new TypeError("Assertion failed")}function $y(){}var em=function(){function e(e){this._underlyingReader=void 0,this._readerMode=void 0,this._readableStreamController=void 0,this._pendingRead=void 0,this._underlyingStream=e,this._attachDefaultReader()}return e.prototype.start=function(e){this._readableStreamController=e},e.prototype.cancel=function(e){return Xy(void 0!==this._underlyingReader),this._underlyingReader.cancel(e)},e.prototype._attachDefaultReader=function(){if("default"!==this._readerMode){this._detachReader();var e=this._underlyingStream.getReader();this._readerMode="default",this._attachReader(e)}},e.prototype._attachReader=function(e){var t=this;Xy(void 0===this._underlyingReader),this._underlyingReader=e;var r=this._underlyingReader.closed;r&&r.then((function(){return t._finishPendingRead()})).then((function(){e===t._underlyingReader&&t._readableStreamController.close()}),(function(r){e===t._underlyingReader&&t._readableStreamController.error(r)})).catch($y)},e.prototype._detachReader=function(){void 0!==this._underlyingReader&&(this._underlyingReader.releaseLock(),this._underlyingReader=void 0,this._readerMode=void 0)},e.prototype._pullWithDefaultReader=function(){var e=this;this._attachDefaultReader();var t=this._underlyingReader.read().then((function(t){var r=e._readableStreamController;t.done?e._tryClose():r.enqueue(t.value)}));return this._setPendingRead(t),t},e.prototype._tryClose=function(){try{this._readableStreamController.close()}catch(e){}},e.prototype._setPendingRead=function(e){var t,r=this,n=function(){r._pendingRead===t&&(r._pendingRead=void 0)};this._pendingRead=t=e.then(n,n)},e.prototype._finishPendingRead=function(){var e=this;if(this._pendingRead){var t=function(){return e._finishPendingRead()};return this._pendingRead.then(t,t)}},e}();function tm(e){return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}!function(e){function t(){return null!==e&&e.apply(this,arguments)||this}Yy(t,e),t.prototype.pull=function(){return this._pullWithDefaultReader()}}(em),function(e){function t(t){var r=this,n=function(e){try{return e.getReader({mode:"byob"}).releaseLock(),!0}catch(e){return!1}}(t);return(r=e.call(this,t)||this)._supportsByob=n,r}Yy(t,e),Object.defineProperty(t.prototype,"type",{get:function(){return"bytes"},enumerable:!1,configurable:!0}),t.prototype._attachByobReader=function(){if("byob"!==this._readerMode){Xy(this._supportsByob),this._detachReader();var e=this._underlyingStream.getReader({mode:"byob"});this._readerMode="byob",this._attachReader(e)}},t.prototype.pull=function(){if(this._supportsByob){var e=this._readableStreamController.byobRequest;if(e)return this._pullWithByobRequest(e)}return this._pullWithDefaultReader()},t.prototype._pullWithByobRequest=function(e){var t=this;this._attachByobReader();var r=new Uint8Array(e.view.byteLength),n=this._underlyingReader.read(r).then((function(r){var n,i,a;t._readableStreamController,r.done?(t._tryClose(),e.respond(0)):(n=r.value,i=e.view,a=tm(n),tm(i).set(a,0),e.respond(r.value.byteLength))}));return this._setPendingRead(n),n}}(em);var rm=Js((function(e){!function(e,t){function r(e,t){if(!e)throw Error(t||"Assertion failed")}function n(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function i(e,t,r){if(i.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var a;"object"==typeof e?e.exports=i:t.BN=i,i.BN=i,i.wordSize=26;try{a=void 0}catch(e){}function o(e,t,r){for(var n=0,i=Math.min(e.length,r),a=t;a<i;a++){var o=e.charCodeAt(a)-48;n<<=4,n|=o>=49&&o<=54?o-49+10:o>=17&&o<=22?o-17+10:15&o}return n}function s(e,t,r,n){for(var i=0,a=Math.min(e
/*!
* hash-wasm (https://www.npmjs.com/package/hash-wasm)
* (c) Dani Biro
* @license MIT
*/
function kb(e,t,r,n){return new(r||(r=Promise))((function(i,a){function o(e){try{c(n.next(e))}catch(e){a(e)}}function s(e){try{c(n.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,s)}c((n=n.apply(e,t||[])).next())}))}"function"==typeof SuppressedError&&SuppressedError;class Sb{constructor(){this.mutex=Promise.resolve()}lock(){let e=()=>{};return this.mutex=this.mutex.then((()=>new Promise(e))),new Promise((t=>{e=t}))}dispatch(e){return kb(this,void 0,void 0,(function*(){const t=yield this.lock();try{return yield Promise.resolve(e())}finally{t()}}))}}var Qb;const xb="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:t,Pb=null!==(Qb=xb.Buffer)&&void 0!==Qb?Qb:null,Mb=xb.TextEncoder?new xb.TextEncoder:null;function Ub(e,t){return(15&e)+(e>>6|e>>3&8)<<4|(15&t)+(t>>6|t>>3&8)}function Db(e,t){const r=t.length>>1;for(let n=0;n<r;n++){const r=n<<1;e[n]=Ub(t.charCodeAt(r),t.charCodeAt(r+1))}}const Rb="a".charCodeAt(0)-10,Fb="0".charCodeAt(0);function Tb(e,t,r){let n=0;for(let i=0;i<r;i++){let r=t[i]>>>4;e[n++]=r>9?r+Rb:r+Fb,r=15&t[i],e[n++]=r>9?r+Rb:r+Fb}return String.fromCharCode.apply(null,e)}const qb=null!==Pb?e=>{if("string"==typeof e){const t=Pb.from(e,"utf8");return new Uint8Array(t.buffer,t.byteOffset,t.length)}if(Pb.isBuffer(e))return new Uint8Array(e.buffer,e.byteOffset,e.length);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw new Error("Invalid data type!")}:e=>{if("string"==typeof e)return Mb.encode(e);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw new Error("Invalid data type!")},Ob="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Kb=new Uint8Array(256);for(let e=0;e<Ob.length;e++)Kb[Ob.charCodeAt(e)]=e;function Hb(e,t=!0){const r=e.length,n=r%3,i=[],a=r-n;for(let t=0;t<a;t+=3){const r=(e[t]<<16&16711680)+(e[t+1]<<8&65280)+(255&e[t+2]),n=Ob.charAt(r>>18&63)+Ob.charAt(r>>12&63)+Ob.charAt(r>>6&63)+Ob.charAt(63&r);i.push(n)}if(1===n){const n=e[r-1],a=Ob.charAt(n>>2),o=Ob.charAt(n<<4&63);i.push(`${a}${o}`),t&&i.push("==")}else if(2===n){const n=(e[r-2]<<8)+e[r-1],a=Ob.charAt(n>>10),o=Ob.charAt(n>>4&63),s=Ob.charAt(n<<2&63);i.push(`${a}${o}${s}`),t&&i.push("=")}return i.join("")}function Nb(e){let t=Math.floor(.75*e.length);const r=e.length;return"="===e[r-1]&&(t-=1,"="===e[r-2]&&(t-=1)),t}function Lb(e){const t=Nb(e),r=e.length,n=new Uint8Array(t);let i=0;for(let t=0;t<r;t+=4){const r=Kb[e.charCodeAt(t)],a=Kb[e.charCodeAt(t+1)],o=Kb[e.charCodeAt(t+2)],s=Kb[e.charCodeAt(t+3)];n[i]=r<<2|a>>4,i+=1,n[i]=(15&a)<<4|o>>2,i+=1,n[i]=(3&o)<<6|63&s,i+=1}return n}const Gb=16384,jb=4,zb=new Sb,Wb=new Map;function Zb(e,t){return kb(this,void 0,void 0,(function*(){let r=null,n=null,i=!1;if("undefined"==typeof WebAssembly)throw new Error("WebAssembly is not supported in this environment!");const a=()=>new DataView(r.exports.memory.buffer).getUint32(r.exports.STATE_SIZE,!0),o=zb.dispatch((()=>kb(this,void 0,void 0,(function*(){if(!Wb.has(e.name)){const t=Lb(e.data),r=WebAssembly.compile(t);Wb.set(e.name,r)}const t=yield Wb.get(e.name);r=yield WebAssembly.instantiate(t,{})})))),s=(e=null)=>{i=!0,r.exports.Hash_Init(e)},c=e=>{if(!i)throw new Error("update() called before init()");(e=>{let t=0;for(;t<e.length;){const i=e.subarray(t,t+Gb);t+=i.length,n.set(i),r.exports.Hash_Update(i.length)}})(qb(e))},u=new Uint8Array(2*t),h=(e,a=null)=>{if(!i)throw new Error("digest() called before init()");return i=!1,r.exports.Hash_Final(a),"binary"===e?n.slice(0,t):Tb(u,n,t)},l=e=>"string"==typeof e?e.length<Gb/4:e.byteLength<Gb;let f=l;switch(e.name){case"argon2":case"scrypt":f=()=>!0;break;case"blake2b":case"blake2s":f=(e,t)=>t<=512&&l(e);break;case"blake3":f=(e,t)=>0===t&&l(e);break;case"xxhash64":case"xxhash3":case"xxhash128":f=()=>!1}return yield(()=>kb(this,void 0,void 0,(function*(){r||(yield o);const e=r.exports.Hash_GetBuffer(),t=r.exports.memory.buffer;n=new Uint8Array(t,e,Gb)})))(),{getMemory:()=>n,writeMemory:(e,t