doipjs/dist/doip.core.min.js

21 lines
170 KiB
JavaScript
Raw Normal View History

2023-09-23 02:16:41 -06:00
var doip=function(e,t,r){"use strict";function A(e){var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var A=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,A.get?A:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}var i=A(doipFetchers);const o={ADAPTIVE:"adaptive",ALWAYS:"always",NEVER:"never"},n={ACTIVITYPUB:"activitypub",DNS:"dns",GRAPHQL:"graphql",HTTP:"http",IRC:"irc",MATRIX:"matrix",TELEGRAM:"telegram",XMPP:"xmpp"},a={PLAIN:"plain",HTML:"html",XML:"xml"},s={NONE:"none",NOCORS:"nocors",GRANTED:"granted",SERVER:"server"},c={JSON:"json",TEXT:"text"},I={URI:"uri",FINGERPRINT:"fingerprint"},g={CONTAINS:"contains",EQUALS:"equals",ONEOF:"oneof"},h={INIT:100,MATCHED:101,VERIFIED:200,VERIFIED_VIA_PROXY:201,MATCHING_ERROR:300,NO_MATCHES:301,VERIFICATION_ERROR:400,NO_PROOF_FOUND:401},l={ASP:"asp",OPENPGP:"openpgp"},u={EDDSA:"eddsa",ES256:"es256",OPENPGP:"openpgp",UNKNOWN:"unknown",NONE:"none"},f={PEM:"pem",JWK:"jwk",ARMORED_PGP:"armored_pgp",NONE:"none"},B={ASPE:"aspe",HKP:"hkp",WKD:"wkd",HTTP:"http",NONE:"none"};var p=Object.freeze({__proto__:null,ClaimFormat:I,ClaimRelation:g,ClaimStatus:h,EntityEncodingFormat:a,Fetcher:n,ProfileType:l,ProofAccessRestriction:s,ProofFormat:c,ProxyPolicy:o,PublicKeyEncoding:f,PublicKeyFetchMethod:B,PublicKeyType:u}),C="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function d(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function E(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var r=function e(){if(this instanceof e){var r=[null];return r.push.apply(r,arguments),new(Function.bind.apply(t,r))}return t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach((function(t){var A=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,A.get?A:{enumerable:!0,get:function(){return e[t]}})})),r}var Q={},w={exports:{}};!function(e,t){function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t="string"==typeof e||e instanceof String;if(!t){var A=r(e);throw null===e?A="null":"object"===A&&(A=e.constructor.name),new TypeError("Expected a string but received a ".concat(A))}},e.exports=t.default,e.exports.default=t.default}(w,w.exports);var m=w.exports,y={};Object.defineProperty(y,"__esModule",{value:!0}),y.commaDecimal=y.dotDecimal=y.bengaliLocales=y.farsiLocales=y.arabicLocales=y.englishLocales=y.decimal=y.alphanumeric=y.alpha=void 0;var k={"en-US":/^[A-Z]+$/i,"az-AZ":/^[A-VXYZÇƏĞİıÖŞÜ]+$/i,"bg-BG":/^[А-Я]+$/i,"cs-CZ":/^[A-ZÁČĎÉĚÍŇÓŘŠŤÚŮÝŽ]+$/i,"da-DK":/^[A-ZÆØÅ]+$/i,"de-DE":/^[A-ZÄÖÜß]+$/i,"el-GR":/^[Α-ώ]+$/i,"es-ES":/^[A-ZÁÉÍÑÓÚÜ]+$/i,"fa-IR":/^[ابپتثجچحخدذرزژسشصضطظعغفقکگلمنوهی]+$/i,"fi-FI":/^[A-ZÅÄÖ]+$/i,"fr-FR":/^[A-ZÀÂÆÇÉÈÊËÏÎÔŒÙÛÜŸ]+$/i,"it-IT":/^[A-ZÀÉÈÌÎÓÒÙ]+$/i,"ja-JP":/^[ぁ-んァ-ヶヲ-゚一-龠ー・。、]+$/i,"nb-NO":/^[A-ZÆØÅ]+$/i,"nl-NL":/^[A-ZÁÉËÏÓÖÜÚ]+$/i,"nn-NO":/^[A-ZÆØÅ]+$/i,"hu-HU":/^[A-ZÁÉÍÓÖŐÚÜŰ]+$/i,"pl-PL":/^[A-ZĄĆĘŚŁŃÓŻŹ]+$/i,"pt-PT":/^[A-ZÃÁÀÂÄÇÉÊËÍÏÕÓÔÖÚÜ]+$/i,"ru-RU":/^[А-ЯЁ]+$/i,"sl-SI":/^[A-ZČĆĐŠŽ]+$/i,"sk-SK":/^[A-ZÁČĎÉÍŇÓŠŤÚÝŽĹŔĽÄÔ]+$/i,"sr-RS@latin":/^[A-ZČĆŽŠĐ]+$/i,"sr-RS":/^[А-ЯЂЈЉЊЋЏ]+$/i,"sv-SE":/^[A-ZÅÄÖ]+$/i,"th-TH":/^[ก-\s]+$/i,"tr-TR":/^[A-ZÇĞİıÖŞÜ]+$/i,"uk-UA":/^[АЬЮЯЄIЇҐі]+$/i,"vi-VN":/^[A-ZÀÁẠẢÃÂẦẤẬẨẪĂẰẮẶẲẴĐÈÉẸẺẼÊỀẾỆỂỄÌÍỊỈĨÒÓỌỎÕÔỒỐỘỔỖƠỜỚỢỞỠÙÚỤỦŨƯỪỨỰỬỮỲÝỴỶỸ]+$/i,"ko-KR":/^
2023-07-08 00:36:57 -06:00
/*!
2023-07-09 04:05:21 -06:00
* hash-wasm (https://www.npmjs.com/package/hash-wasm)
* (c) Dani Biro
* @license MIT
*/
2023-07-08 00:36:57 -06:00
/*! *****************************************************************************
2023-07-09 04:05:21 -06:00
Copyright (c) Microsoft Corporation.
2023-07-08 00:36:57 -06:00
2023-07-09 04:05:21 -06:00
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
2023-07-08 00:36:57 -06:00
2023-07-09 04:05:21 -06:00
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.
2023-10-04 01:13:43 -06:00
***************************************************************************** */function At(e,t,r,A){return new(r||(r=Promise))((function(i,o){function n(e){try{s(A.next(e))}catch(e){o(e)}}function a(e){try{s(A.throw(e))}catch(e){o(e)}}function s(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(n,a)}s((A=A.apply(e,t||[])).next())}))}class it{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 At(this,void 0,void 0,(function*(){const t=yield this.lock();try{return yield Promise.resolve(e())}finally{t()}}))}}const ot="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:Ie,nt=null!==(tt=ot.Buffer)&&void 0!==tt?tt:null,at=ot.TextEncoder?new ot.TextEncoder:null;function st(e,t){return(15&e)+(e>>6|e>>3&8)<<4|(15&t)+(t>>6|t>>3&8)}function ct(e,t){const r=t.length>>1;for(let A=0;A<r;A++){const r=A<<1;e[A]=st(t.charCodeAt(r),t.charCodeAt(r+1))}}const It="a".charCodeAt(0)-10,gt="0".charCodeAt(0);function ht(e,t,r){let A=0;for(let i=0;i<r;i++){let r=t[i]>>>4;e[A++]=r>9?r+It:r+gt,r=15&t[i],e[A++]=r>9?r+It:r+gt}return String.fromCharCode.apply(null,e)}const lt=null!==nt?e=>{if("string"==typeof e){const t=nt.from(e,"utf8");return new Uint8Array(t.buffer,t.byteOffset,t.length)}if(nt.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 at.encode(e);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw new Error("Invalid data type!")},ut="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ft=new Uint8Array(256);for(let e=0;e<ut.length;e++)ft[ut.charCodeAt(e)]=e;function Bt(e,t=!0){const r=e.length,A=r%3,i=[],o=r-A;for(let t=0;t<o;t+=3){const r=(e[t]<<16&16711680)+(e[t+1]<<8&65280)+(255&e[t+2]),A=ut.charAt(r>>18&63)+ut.charAt(r>>12&63)+ut.charAt(r>>6&63)+ut.charAt(63&r);i.push(A)}if(1===A){const A=e[r-1],o=ut.charAt(A>>2),n=ut.charAt(A<<4&63);i.push(`${o}${n}`),t&&i.push("==")}else if(2===A){const A=(e[r-2]<<8)+e[r-1],o=ut.charAt(A>>10),n=ut.charAt(A>>4&63),a=ut.charAt(A<<2&63);i.push(`${o}${n}${a}`),t&&i.push("=")}return i.join("")}function pt(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 Ct(e){const t=pt(e),r=e.length,A=new Uint8Array(t);let i=0;for(let t=0;t<r;t+=4){const r=ft[e.charCodeAt(t)],o=ft[e.charCodeAt(t+1)],n=ft[e.charCodeAt(t+2)],a=ft[e.charCodeAt(t+3)];A[i]=r<<2|o>>4,i+=1,A[i]=(15&o)<<4|n>>2,i+=1,A[i]=(3&n)<<6|63&a,i+=1}return A}const dt=16384,Et=4,Qt=new it,wt=new Map;function mt(e,t){return At(this,void 0,void 0,(function*(){let r=null,A=null,i=!1;if("undefined"==typeof WebAssembly)throw new Error("WebAssembly is not supported in this environment!");const o=()=>new DataView(r.exports.memory.buffer).getUint32(r.exports.STATE_SIZE,!0),n=Qt.dispatch((()=>At(this,void 0,void 0,(function*(){if(!wt.has(e.name)){const t=Ct(e.data),r=WebAssembly.compile(t);wt.set(e.name,r)}const t=yield wt.get(e.name);r=yield WebAssembly.instantiate(t,{})})))),a=(e=null)=>{i=!0,r.exports.Hash_Init(e)},s=e=>{if(!i)throw new Error("update() called before init()");(e=>{let t=0;for(;t<e.length;){const i=e.subarray(t,t+dt);t+=i.length,A.set(i),r.exports.Hash_Update(i.length)}})(lt(e))},c=new Uint8Array(2*t),I=(e,o=null)=>{if(!i)throw new Error("digest() called before init()");return i=!1,r.exports.Hash_Final(o),"binary"===e?A.slice(0,t):ht(c,A,t)},g=e=>"string"==typeof e?e.length<dt/4:e.byteLength<dt;let h=g;switch(e.name){case"argon2":case"scrypt":h=()=>!0;break;case"blake2b":case"blake2s":h=(e,t)=>t<=512&&g(e);break;case"blake3":h=(e,t)=>0===t&&g(e);break;case"xxhash64":case"xxhash3":case"xxhash128":h=()=>!1}return yield(()=>At(this,void 0,void 0,(function*(){r||(yield n);const e=r.exports.Hash_GetBuffer(),t=r.exports.memory.buffer;A=new Uint8Array(t,e,dt)})))(),{getMemor