doipjs/dist/doip.min.js

4 lines
612 KiB
JavaScript
Raw Normal View History

2020-11-18 13:51:53 -07:00
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).doip=e()}}((function(){return function e(t,r,n){function i(s,o){if(!r[s]){if(!t[s]){var u="function"==typeof require&&require;if(!o&&u)return u(s,!0);if(a)return a(s,!0);var c=new Error("Cannot find module '"+s+"'");throw c.code="MODULE_NOT_FOUND",c}var f=r[s]={exports:{}};t[s][0].call(f.exports,(function(e){return i(t[s][1][e]||e)}),f,f.exports,e,t,r,n)}return r[s].exports}for(var a="function"==typeof require&&require,s=0;s<n.length;s++)i(n[s]);return i}({1:[function(e,t,r){"use strict";const n=e("./core");class i extends Error{constructor(e,...t){let r;super(...t),Error.captureStackTrace&&Error.captureStackTrace(this,i),this.name="StatusError",this.message=e.statusMessage,this.statusCode=e.status,this.res=e,this.json=e.json.bind(e),this.text=e.text.bind(e),this.arrayBuffer=e.arrayBuffer.bind(e);Object.defineProperty(this,"responseBody",{get:()=>(r||(r=this.arrayBuffer()),r)}),this.headers={};for(const[t,r]of e.headers.entries())this.headers[t.toLowerCase()]=r}}t.exports=n(((e,t,r,n,a)=>async(s,o,u={})=>{s=a+(s||"");let c=new URL(s);if(n||(n={}),c.username&&(n.Authorization="Basic "+btoa(c.username+":"+c.password),c=new URL(c.protocol+"//"+c.host+c.pathname+c.search)),"https:"!==c.protocol&&"http:"!==c.protocol)throw new Error(`Unknown protocol, ${c.protocol}`);if(o)if(o instanceof ArrayBuffer||ArrayBuffer.isView(o)||"string"==typeof o);else{if("object"!=typeof o)throw new Error("Unknown body type.");o=JSON.stringify(o),n["Content-Type"]="application/json"}u=new Headers({...n||{},...u});const f=await fetch(c,{method:t,headers:u,body:o});if(f.statusCode=f.status,!e.has(f.status))throw new i(f);return"json"===r?f.json():"buffer"===r?f.arrayBuffer():"string"===r?f.text():f}))},{"./core":2}],2:[function(e,t,r){"use strict";const n=new Set(["json","buffer","string"]);t.exports=e=>(...t)=>{const r=new Set;let i,a,s,o="";return t.forEach((e=>{if("string"==typeof e)if(e.toUpperCase()===e){if(i){throw new Error(`Can't set method to ${e}, already set to ${i}.`)}i=e}else if(e.startsWith("http:")||e.startsWith("https:"))o=e;else{if(!n.has(e))throw new Error(`Unknown encoding, ${e}`);a=e}else if("number"==typeof e)r.add(e);else{if("object"!=typeof e)throw new Error("Unknown type: "+typeof e);if(Array.isArray(e)||e instanceof Set)e.forEach((e=>r.add(e)));else{if(s)throw new Error("Cannot set headers twice.");s=e}}})),i||(i="GET"),0===r.size&&r.add(200),e(r,i,a,s,o)}},{}],3:[function(e,t,r){},{}],4:[function(e,t,r){"use strict";t.exports=e=>{if("[object Object]"!==Object.prototype.toString.call(e))return!1;const t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}},{}],5:[function(e,t,r){"use strict";const n=e("is-plain-obj"),{hasOwnProperty:i}=Object.prototype,{propertyIsEnumerable:a}=Object,s=(e,t,r)=>Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0}),o=this,u={concatArrays:!1,ignoreUndefined:!1},c=e=>{const t=[];for(const r in e)i.call(e,r)&&t.push(r);if(Object.getOwnPropertySymbols){const r=Object.getOwnPropertySymbols(e);for(const n of r)a.call(e,n)&&t.push(n)}return t};function f(e){return Array.isArray(e)?function(e){const t=e.slice(0,0);return c(e).forEach((r=>{s(t,r,f(e[r]))})),t}(e):n(e)?function(e){const t=null===Object.getPrototypeOf(e)?Object.create(null):{};return c(e).forEach((r=>{s(t,r,f(e[r]))})),t}(e):e}const d=(e,t,r,n)=>(r.forEach((r=>{void 0===t[r]&&n.ignoreUndefined||(r in e&&e[r]!==Object.getPrototypeOf(e)?s(e,r,l(e[r],t[r],n)):s(e,r,f(t[r])))})),e);function l(e,t,r){return r.concatArrays&&Array.isArray(e)&&Array.isArray(t)?((e,t,r)=>{let n=e.slice(0,0),a=0;return[e,t].forEach((t=>{const o=[];for(let r=0;r<t.length;r++)i.call(t,r)&&(o.push(String(r)),s(n,a++,t===e?t[r]:f(t[r])));n=d(n,t,c(t).filter((e=>!o.includes(e))),r)})),n})(e,t,r):n(t)&&n(e)?d(e,t,c(t),r):f(t)}t.exports=function(...e){const t=l(f(u),this!==o&&this
/*! OpenPGP.js v4.10.8 - 2020-08-28 - this is LGPL licensed code, see LICENSE/our website https://openpgpjs.org/ for more information. */
!function(e){"object"==typeof r&&void 0!==t?t.exports=e():("undefined"!=typeof window?window:void 0!==n?n:"undefined"!=typeof self?self:this).openpgp=e()}((function(){return function t(r,n,i){function a(o,u){if(!n[o]){if(!r[o]){var c="function"==typeof e&&e;if(!u&&c)return c(o,!0);if(s)return s(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var d=n[o]={exports:{}};r[o][0].call(d.exports,(function(e){return a(r[o][1][e]||e)}),d,d.exports,t,r,n,i)}return n[o].exports}for(var s="function"==typeof e&&e,o=0;o<i.length;o++)a(i[o]);return a}({1:[function(e,t,r){(function(e){"use strict";var n;n=void 0,function(t){const r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol:e=>`Symbol(${e})`,n="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==e?e:void 0,i=Number.isNaN||function(e){return e!=e};function a(e){return"object"==typeof e&&null!==e||"function"==typeof e}function s(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function o(e){return e.slice()}function u(e,t,r,n,i){new Uint8Array(e).set(new Uint8Array(r,n,i),t)}function c(e){return!1!==function(e){return!("number"!=typeof e||i(e)||e<0)}(e)&&e!==1/0}function f(e,t,r){if("function"!=typeof e)throw new TypeError("Argument is not a function");return Function.prototype.apply.call(e,t,r)}function d(e,t,r,n){const i=e[t];if(void 0!==i){if("function"!=typeof i)throw new TypeError(`${i} is not a method`);switch(r){case 0:return()=>h(i,e,n);case 1:return t=>{const r=[t].concat(n);return h(i,e,r)}}}return()=>Promise.resolve()}function l(e,t,r){const n=e[t];if(void 0!==n)return f(n,e,r)}function h(e,t,r){try{return Promise.resolve(f(e,t,r))}catch(e){return Promise.reject(e)}}function p(e){if(e=Number(e),i(e)||e<0)throw new RangeError("highWaterMark property of a queuing strategy must be non-negative and non-NaN");return e}function y(e){if(void 0===e)return()=>1;if("function"!=typeof e)throw new TypeError("size property of a queuing strategy must be a function");return t=>e(t)}function b(e,t,r){return Promise.prototype.then.call(e,t,r)}function m(e,t,r){let n,i;const a=new Promise(((e,t)=>{n=e,i=t}));return void 0===r&&(r=e=>{throw e}),function(e,t,r){let n=!1;const i=e=>{!1===n&&(n=!0,r(e))};let a=0,s=0;const o=e.length,u=new Array(o);for(const r of e){const e=a;b(r,(r=>{u[e]=r,++s===o&&t(u)}),i),++a}}(e,(e=>{try{const r=t(e);n(r)}catch(e){i(e)}}),(e=>{try{const t=r(e);n(t)}catch(e){i(e)}})),a}function g(e){}function w(e){e&&e instanceof g.AssertionError&&setTimeout((()=>{throw e}),0)}function _(e){const t=e._queue.shift();return e._queueTotalSize-=t.size,e._queueTotalSize<0&&(e._queueTotalSize=0),t.value}function v(e,t,r){if(!c(r=Number(r)))throw new RangeError("Size must be a finite, non-NaN, non-negative number.");e._queue.push({value:t,size:r}),e._queueTotalSize+=r}function k(e){e._queue=[],e._queueTotalSize=0}g.AssertionError=function(){};const A=r("[[AbortSteps]]"),S=r("[[ErrorSteps]]");class E{constructor(e={},t={}){x(this);const r=t.size;let n=t.highWaterMark;if(void 0!==e.type)throw new RangeError("Invalid type is specified");const i=y(r);void 0===n&&(n=1),function(e,t,r,n){const i=Object.create(L.prototype),a=d(t,"write",1,[i]),s=d(t,"close",0,[]),o=d(t,"abort",1,[]);H(e,i,(function(){return l(t,"start",[i])}),a,s,o,r,n)}(this,e,n=p(n),i)}get locked(){if(!1===M(this))throw J("locked");return C(this)}abort(e){return!1===M(this)?Promise.reject(J("abort")):!0===C(this)?Promise.reject(new TypeError("Cannot abort a stream that already has a writer")):K(this,e)}getWriter(){if(!1===M(this))throw J("getWriter");return P(this)}}function P(e){return new O(e)}function x(e){e._state="writable",e._storedError=void 0,e._writer=void 0,e._writableStreamController=void 0,e._writeRequests=[],e._inFlightWriteRequest=void 0,e._closeRequest=void 0,e._inFlightCloseRequest=void 0,e._pendingAbortRequest=void 0,e._backpressure=!1}function M(e){return!!a(e)&&!!Object.prototype.hasOwnProperty.call(e,"_writableStreamController")}function C(e){return void 0!==e._writer}function K(e,t){con