mirror of
https://codeberg.org/keyoxide/doipjs.git
synced 2024-12-22 22:49:28 -07:00
1 line
29 KiB
JavaScript
1 line
29 KiB
JavaScript
var doipFetchers=function(e){"use strict";function t(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var r={exports:{}},n=function(e,t){return function(){for(var r=new Array(arguments.length),n=0;n<r.length;n++)r[n]=arguments[n];return e.apply(t,r)}},o=n,i=Object.prototype.toString;function a(e){return Array.isArray(e)}function s(e){return void 0===e}function u(e){return"[object ArrayBuffer]"===i.call(e)}function c(e){return null!==e&&"object"==typeof e}function l(e){if("[object Object]"!==i.call(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function f(e){return"[object Function]"===i.call(e)}function d(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),a(e))for(var r=0,n=e.length;r<n;r++)t.call(null,e[r],r,e);else for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.call(null,e[o],o,e)}var p={isArray:a,isArrayBuffer:u,isBuffer:function(e){return null!==e&&!s(e)&&null!==e.constructor&&!s(e.constructor)&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)},isFormData:function(e){return"[object FormData]"===i.call(e)},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&u(e.buffer)},isString:function(e){return"string"==typeof e},isNumber:function(e){return"number"==typeof e},isObject:c,isPlainObject:l,isUndefined:s,isDate:function(e){return"[object Date]"===i.call(e)},isFile:function(e){return"[object File]"===i.call(e)},isBlob:function(e){return"[object Blob]"===i.call(e)},isFunction:f,isStream:function(e){return c(e)&&f(e.pipe)},isURLSearchParams:function(e){return"[object URLSearchParams]"===i.call(e)},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&("undefined"!=typeof window&&"undefined"!=typeof document)},forEach:d,merge:function e(){var t={};function r(r,n){l(t[n])&&l(r)?t[n]=e(t[n],r):l(r)?t[n]=e({},r):a(r)?t[n]=r.slice():t[n]=r}for(var n=0,o=arguments.length;n<o;n++)d(arguments[n],r);return t},extend:function(e,t,r){return d(t,(function(t,n){e[n]=r&&"function"==typeof t?o(t,r):t})),e},trim:function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")},stripBOM:function(e){return 65279===e.charCodeAt(0)&&(e=e.slice(1)),e}},h=p;function m(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}var v=function(e,t,r){if(!t)return e;var n;if(r)n=r(t);else if(h.isURLSearchParams(t))n=t.toString();else{var o=[];h.forEach(t,(function(e,t){null!=e&&(h.isArray(e)?t+="[]":e=[e],h.forEach(e,(function(e){h.isDate(e)?e=e.toISOString():h.isObject(e)&&(e=JSON.stringify(e)),o.push(m(t)+"="+m(e))})))})),n=o.join("&")}if(n){var i=e.indexOf("#");-1!==i&&(e=e.slice(0,i)),e+=(-1===e.indexOf("?")?"?":"&")+n}return e},g=p;function y(){this.handlers=[]}y.prototype.use=function(e,t,r){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1},y.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},y.prototype.forEach=function(e){g.forEach(this.handlers,(function(t){null!==t&&e(t)}))};var w=y,b="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{};function _(){throw new Error("setTimeout has not been defined")}function x(){throw new Error("clearTimeout has not been defined")}var E=_,T=x;function j(e){if(E===setTimeout)return setTimeout(e,0);if((E===_||!E)&&setTimeout)return E=setTimeout,setTimeout(e,0);try{return E(e,0)}catch(t){try{return E.call(null,e,0)}catch(t){return E.call(this,e,0)}}}"function"==typeof b.setTimeout&&(E=setTimeout),"function"==typeof b.clearTimeout&&(T=clearTimeout);var S,O=[],A=!1,P=-1;function N(){A&&S&&(A=!1,S.length?O=S.concat(O):P=-1,O.length&&R())}function R(){if(!A){var e=j(N);A=!0;for(var t=O.length;t;){for(S=O,O=[];++P<t;)S&&S[P].run();P=-1,t=O.length}S=null,A=!1,function(e){if(T===clearTimeout)return clearTimeout(e);if((T===x||!T)&&clearTimeout)return T=clearTimeout,clearTimeout(e);try{return T(e)}catch(t){try{return T.call(null,e)}catch(t){return T.call(this,e)}}}(e)}}function C(e,t){this.fun=e,this.array=t}C.prototype.run=function(){this.fun.apply(null,this.array)};function q(){}var k=q,U=q,$=q,L=q,B=q,D=q,F=q;var M=b.performance||{},I=M.now||M.mozNow||M.msNow||M.oNow||M.webkitNow||function(){return(new Date).getTime()};var z=new Date;var J,H,W,X,V,G,K,Q,Z,Y,ee,te,re,ne,oe,ie,ae,se,ue,ce,le,fe,de={nextTick:function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];O.push(new C(e,t)),1!==O.length||A||j(R)},title:"browser",browser:!0,env:{},argv:[],version:"",versions:{},on:k,addListener:U,once:$,off:L,removeListener:B,removeAllListeners:D,emit:F,binding:function(e){throw new Error("process.binding is not supported")},cwd:function(){return"/"},chdir:function(e){throw new Error("process.chdir is not supported")},umask:function(){return 0},hrtime:function(e){var t=.001*I.call(M),r=Math.floor(t),n=Math.floor(t%1*1e9);return e&&(r-=e[0],(n-=e[1])<0&&(r--,n+=1e9)),[r,n]},platform:"browser",release:{},config:{},uptime:function(){return(new Date-z)/1e3}},pe=p,he=function(e,t){pe.forEach(e,(function(r,n){n!==t&&n.toUpperCase()===t.toUpperCase()&&(e[t]=r,delete e[n])}))},me=function(e,t,r,n,o){return e.config=t,r&&(e.code=r),e.request=n,e.response=o,e.isAxiosError=!0,e.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}},e};function ve(){if(H)return J;H=1;var e=me;return J=function(t,r,n,o,i){var a=new Error(t);return e(a,r,n,o,i)},J}function ge(){if(X)return W;X=1;var e=ve();return W=function(t,r,n){var o=n.config.validateStatus;n.status&&o&&!o(n.status)?r(e("Request failed with status code "+n.status,n.config,null,n.request,n)):t(n)}}function ye(){if(G)return V;G=1;var e=p;return V=e.isStandardBrowserEnv()?{write:function(t,r,n,o,i,a){var s=[];s.push(t+"="+encodeURIComponent(r)),e.isNumber(n)&&s.push("expires="+new Date(n).toGMTString()),e.isString(o)&&s.push("path="+o),e.isString(i)&&s.push("domain="+i),!0===a&&s.push("secure"),document.cookie=s.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}}function we(){return Q?K:(Q=1,K=function(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)})}function be(){return Y?Z:(Y=1,Z=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e})}function _e(){if(te)return ee;te=1;var e=we(),t=be();return ee=function(r,n){return r&&!e(n)?t(r,n):n}}function xe(){if(ne)return re;ne=1;var e=p,t=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];return re=function(r){var n,o,i,a={};return r?(e.forEach(r.split("\n"),(function(r){if(i=r.indexOf(":"),n=e.trim(r.substr(0,i)).toLowerCase(),o=e.trim(r.substr(i+1)),n){if(a[n]&&t.indexOf(n)>=0)return;a[n]="set-cookie"===n?(a[n]?a[n]:[]).concat([o]):a[n]?a[n]+", "+o:o}})),a):a}}function Ee(){if(ie)return oe;ie=1;var e=p;return oe=e.isStandardBrowserEnv()?function(){var t,r=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");function o(e){var t=e;return r&&(n.setAttribute("href",t),t=n.href),n.setAttribute("href",t),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:"/"===n.pathname.charAt(0)?n.pathname:"/"+n.pathname}}return t=o(window.location.href),function(r){var n=e.isString(r)?o(r):r;return n.protocol===t.protocol&&n.host===t.host}}():function(){return!0}}function Te(){if(se)return ae;function e(e){this.message=e}return se=1,e.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},e.prototype.__CANCEL__=!0,ae=e}function je(){if(ce)return ue;ce=1;var e=p,t=ge(),r=ye(),n=v,o=_e(),i=xe(),a=Ee(),s=ve(),u=Se(),c=Te();return ue=function(l){return new Promise((function(f,d){var p,h=l.data,m=l.headers,v=l.responseType;function g(){l.cancelToken&&l.cancelToken.unsubscribe(p),l.signal&&l.signal.removeEventListener("abort",p)}e.isFormData(h)&&delete m["Content-Type"];var y=new XMLHttpRequest;if(l.auth){var w=l.auth.username||"",b=l.auth.password?unescape(encodeURIComponent(l.auth.password)):"";m.Authorization="Basic "+btoa(w+":"+b)}var _=o(l.baseURL,l.url);function x(){if(y){var e="getAllResponseHeaders"in y?i(y.getAllResponseHeaders()):null,r={data:v&&"text"!==v&&"json"!==v?y.response:y.responseText,status:y.status,statusText:y.statusText,headers:e,config:l,request:y};t((function(e){f(e),g()}),(function(e){d(e),g()}),r),y=null}}if(y.open(l.method.toUpperCase(),n(_,l.params,l.paramsSerializer),!0),y.timeout=l.timeout,"onloadend"in y?y.onloadend=x:y.onreadystatechange=function(){y&&4===y.readyState&&(0!==y.status||y.responseURL&&0===y.responseURL.indexOf("file:"))&&setTimeout(x)},y.onabort=function(){y&&(d(s("Request aborted",l,"ECONNABORTED",y)),y=null)},y.onerror=function(){d(s("Network Error",l,null,y)),y=null},y.ontimeout=function(){var e=l.timeout?"timeout of "+l.timeout+"ms exceeded":"timeout exceeded",t=l.transitional||u.transitional;l.timeoutErrorMessage&&(e=l.timeoutErrorMessage),d(s(e,l,t.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",y)),y=null},e.isStandardBrowserEnv()){var E=(l.withCredentials||a(_))&&l.xsrfCookieName?r.read(l.xsrfCookieName):void 0;E&&(m[l.xsrfHeaderName]=E)}"setRequestHeader"in y&&e.forEach(m,(function(e,t){void 0===h&&"content-type"===t.toLowerCase()?delete m[t]:y.setRequestHeader(t,e)})),e.isUndefined(l.withCredentials)||(y.withCredentials=!!l.withCredentials),v&&"json"!==v&&(y.responseType=l.responseType),"function"==typeof l.onDownloadProgress&&y.addEventListener("progress",l.onDownloadProgress),"function"==typeof l.onUploadProgress&&y.upload&&y.upload.addEventListener("progress",l.onUploadProgress),(l.cancelToken||l.signal)&&(p=function(e){y&&(d(!e||e&&e.type?new c("canceled"):e),y.abort(),y=null)},l.cancelToken&&l.cancelToken.subscribe(p),l.signal&&(l.signal.aborted?p():l.signal.addEventListener("abort",p))),h||(h=null),y.send(h)}))},ue}function Se(){if(fe)return le;fe=1;var e=p,t=he,r=me,n={"Content-Type":"application/x-www-form-urlencoded"};function o(t,r){!e.isUndefined(t)&&e.isUndefined(t["Content-Type"])&&(t["Content-Type"]=r)}var i,a={transitional:{silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},adapter:(("undefined"!=typeof XMLHttpRequest||void 0!==de&&"[object process]"===Object.prototype.toString.call(de))&&(i=je()),i),transformRequest:[function(r,n){return t(n,"Accept"),t(n,"Content-Type"),e.isFormData(r)||e.isArrayBuffer(r)||e.isBuffer(r)||e.isStream(r)||e.isFile(r)||e.isBlob(r)?r:e.isArrayBufferView(r)?r.buffer:e.isURLSearchParams(r)?(o(n,"application/x-www-form-urlencoded;charset=utf-8"),r.toString()):e.isObject(r)||n&&"application/json"===n["Content-Type"]?(o(n,"application/json"),function(t,r,n){if(e.isString(t))try{return(r||JSON.parse)(t),e.trim(t)}catch(e){if("SyntaxError"!==e.name)throw e}return(n||JSON.stringify)(t)}(r)):r}],transformResponse:[function(t){var n=this.transitional||a.transitional,o=n&&n.silentJSONParsing,i=n&&n.forcedJSONParsing,s=!o&&"json"===this.responseType;if(s||i&&e.isString(t)&&t.length)try{return JSON.parse(t)}catch(e){if(s){if("SyntaxError"===e.name)throw r(e,this,"E_JSON_PARSE");throw e}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};return e.forEach(["delete","get","head"],(function(e){a.headers[e]={}})),e.forEach(["post","put","patch"],(function(t){a.headers[t]=e.merge(n)})),le=a}var Oe,Ae,Pe=p,Ne=Se();function Re(){return Ae?Oe:(Ae=1,Oe=function(e){return!(!e||!e.__CANCEL__)})}var Ce=p,qe=function(e,t,r){var n=this||Ne;return Pe.forEach(r,(function(r){e=r.call(n,e,t)})),e},ke=Re(),Ue=Se(),$e=Te();function Le(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new $e("canceled")}var Be,De,Fe=p,Me=function(e,t){t=t||{};var r={};function n(e,t){return Fe.isPlainObject(e)&&Fe.isPlainObject(t)?Fe.merge(e,t):Fe.isPlainObject(t)?Fe.merge({},t):Fe.isArray(t)?t.slice():t}function o(r){return Fe.isUndefined(t[r])?Fe.isUndefined(e[r])?void 0:n(void 0,e[r]):n(e[r],t[r])}function i(e){if(!Fe.isUndefined(t[e]))return n(void 0,t[e])}function a(r){return Fe.isUndefined(t[r])?Fe.isUndefined(e[r])?void 0:n(void 0,e[r]):n(void 0,t[r])}function s(r){return r in t?n(e[r],t[r]):r in e?n(void 0,e[r]):void 0}var u={url:i,method:i,data:i,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:s};return Fe.forEach(Object.keys(e).concat(Object.keys(t)),(function(e){var t=u[e]||o,n=t(e);Fe.isUndefined(n)&&t!==s||(r[e]=n)})),r};function Ie(){return De?Be:(De=1,Be={version:"0.25.0"})}var ze=Ie().version,Je={};["object","boolean","number","function","string","symbol"].forEach((function(e,t){Je[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}}));var He={};Je.transitional=function(e,t,r){function n(e,t){return"[Axios v"+ze+"] Transitional option '"+e+"'"+t+(r?". "+r:"")}return function(r,o,i){if(!1===e)throw new Error(n(o," has been removed"+(t?" in "+t:"")));return t&&!He[o]&&(He[o]=!0,console.warn(n(o," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(r,o,i)}};var We,Xe,Ve,Ge,Ke,Qe,Ze={assertOptions:function(e,t,r){if("object"!=typeof e)throw new TypeError("options must be an object");for(var n=Object.keys(e),o=n.length;o-- >0;){var i=n[o],a=t[i];if(a){var s=e[i],u=void 0===s||a(s,i,e);if(!0!==u)throw new TypeError("option "+i+" must be "+u)}else if(!0!==r)throw Error("Unknown option "+i)}},validators:Je},Ye=p,et=v,tt=w,rt=function(e){return Le(e),e.headers=e.headers||{},e.data=qe.call(e,e.data,e.headers,e.transformRequest),e.headers=Ce.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),Ce.forEach(["delete","get","head","post","put","patch","common"],(function(t){delete e.headers[t]})),(e.adapter||Ue.adapter)(e).then((function(t){return Le(e),t.data=qe.call(e,t.data,t.headers,e.transformResponse),t}),(function(t){return ke(t)||(Le(e),t&&t.response&&(t.response.data=qe.call(e,t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)}))},nt=Me,ot=Ze,it=ot.validators;function at(e){this.defaults=e,this.interceptors={request:new tt,response:new tt}}at.prototype.request=function(e,t){if("string"==typeof e?(t=t||{}).url=e:t=e||{},!t.url)throw new Error("Provided config url is not valid");(t=nt(this.defaults,t)).method?t.method=t.method.toLowerCase():this.defaults.method?t.method=this.defaults.method.toLowerCase():t.method="get";var r=t.transitional;void 0!==r&&ot.assertOptions(r,{silentJSONParsing:it.transitional(it.boolean),forcedJSONParsing:it.transitional(it.boolean),clarifyTimeoutError:it.transitional(it.boolean)},!1);var n=[],o=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(o=o&&e.synchronous,n.unshift(e.fulfilled,e.rejected))}));var i,a=[];if(this.interceptors.response.forEach((function(e){a.push(e.fulfilled,e.rejected)})),!o){var s=[rt,void 0];for(Array.prototype.unshift.apply(s,n),s=s.concat(a),i=Promise.resolve(t);s.length;)i=i.then(s.shift(),s.shift());return i}for(var u=t;n.length;){var c=n.shift(),l=n.shift();try{u=c(u)}catch(e){l(e);break}}try{i=rt(u)}catch(e){return Promise.reject(e)}for(;a.length;)i=i.then(a.shift(),a.shift());return i},at.prototype.getUri=function(e){if(!e.url)throw new Error("Provided config url is not valid");return e=nt(this.defaults,e),et(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")},Ye.forEach(["delete","get","head","options"],(function(e){at.prototype[e]=function(t,r){return this.request(nt(r||{},{method:e,url:t,data:(r||{}).data}))}})),Ye.forEach(["post","put","patch"],(function(e){at.prototype[e]=function(t,r,n){return this.request(nt(n||{},{method:e,url:t,data:r}))}}));var st=p,ut=n,ct=at,lt=Me;var ft=function e(t){var r=new ct(t),n=ut(ct.prototype.request,r);return st.extend(n,ct.prototype,r),st.extend(n,r),n.create=function(r){return e(lt(t,r))},n}(Se());ft.Axios=ct,ft.Cancel=Te(),ft.CancelToken=function(){if(Xe)return We;Xe=1;var e=Te();function t(t){if("function"!=typeof t)throw new TypeError("executor must be a function.");var r;this.promise=new Promise((function(e){r=e}));var n=this;this.promise.then((function(e){if(n._listeners){var t,r=n._listeners.length;for(t=0;t<r;t++)n._listeners[t](e);n._listeners=null}})),this.promise.then=function(e){var t,r=new Promise((function(e){n.subscribe(e),t=e})).then(e);return r.cancel=function(){n.unsubscribe(t)},r},t((function(t){n.reason||(n.reason=new e(t),r(n.reason))}))}return t.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},t.prototype.subscribe=function(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]},t.prototype.unsubscribe=function(e){if(this._listeners){var t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}},t.source=function(){var e;return{token:new t((function(t){e=t})),cancel:e}},We=t}(),ft.isCancel=Re(),ft.VERSION=Ie().version,ft.all=function(e){return Promise.all(e)},ft.spread=Ge?Ve:(Ge=1,Ve=function(e){return function(t){return e.apply(null,t)}}),ft.isAxiosError=function(){if(Qe)return Ke;Qe=1;var e=p;return Ke=function(t){return e.isObject(t)&&!0===t.isAxiosError}}(),r.exports=ft,r.exports.default=ft;var dt=t(r.exports),pt={exports:{}},ht={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 n=r(e);throw null===e?n="null":"object"===n&&(n=e.constructor.name),new TypeError("Expected a string but received a ".concat(n))}},e.exports=t.default,e.exports.default=t.default}(ht,ht.exports);var mt=ht.exports,vt={exports:{}},gt={exports:{}};!function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;for(var r in t)void 0===e[r]&&(e[r]=t[r]);return e},e.exports=t.default,e.exports.default=t.default}(gt,gt.exports);var yt=gt.exports;!function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){(0,r.default)(e),(t=(0,n.default)(t,i)).allow_trailing_dot&&"."===e[e.length-1]&&(e=e.substring(0,e.length-1));!0===t.allow_wildcard&&0===e.indexOf("*.")&&(e=e.substring(2));var o=e.split("."),a=o[o.length-1];if(t.require_tld){if(o.length<2)return!1;if(!t.allow_numeric_tld&&!/^([a-z\u00A1-\u00A8\u00AA-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}|xn[a-z0-9-]{2,})$/i.test(a))return!1;if(/\s/.test(a))return!1}if(!t.allow_numeric_tld&&/^\d+$/.test(a))return!1;return o.every((function(e){return!(e.length>63&&!t.ignore_max_length)&&(!!/^[a-z_\u00a1-\uffff0-9-]+$/i.test(e)&&(!/[\uff01-\uff5e]/.test(e)&&(!/^-|-$/.test(e)&&!(!t.allow_underscores&&/_/.test(e)))))}))};var r=o(mt),n=o(yt);function o(e){return e&&e.__esModule?e:{default:e}}var i={require_tld:!0,allow_underscores:!1,allow_trailing_dot:!1,allow_numeric_tld:!1,allow_wildcard:!1,ignore_max_length:!1};e.exports=t.default,e.exports.default=t.default}(vt,vt.exports);var wt=vt.exports,bt=t(wt),_t={exports:{}};!function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if((0,n.default)(t),r=String(r),!r)return e(t,4)||e(t,6);if("4"===r)return a.test(t);if("6"===r)return u.test(t);return!1};var r,n=(r=mt)&&r.__esModule?r:{default:r};var o="(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])",i="(".concat(o,"[.]){3}").concat(o),a=new RegExp("^".concat(i,"$")),s="(?:[0-9a-fA-F]{1,4})",u=new RegExp("^("+"(?:".concat(s,":){7}(?:").concat(s,"|:)|")+"(?:".concat(s,":){6}(?:").concat(i,"|:").concat(s,"|:)|")+"(?:".concat(s,":){5}(?::").concat(i,"|(:").concat(s,"){1,2}|:)|")+"(?:".concat(s,":){4}(?:(:").concat(s,"){0,1}:").concat(i,"|(:").concat(s,"){1,3}|:)|")+"(?:".concat(s,":){3}(?:(:").concat(s,"){0,2}:").concat(i,"|(:").concat(s,"){1,4}|:)|")+"(?:".concat(s,":){2}(?:(:").concat(s,"){0,3}:").concat(i,"|(:").concat(s,"){1,5}|:)|")+"(?:".concat(s,":){1}(?:(:").concat(s,"){0,4}:").concat(i,"|(:").concat(s,"){1,6}|:)|")+"(?::((?::".concat(s,"){0,5}:").concat(i,"|(?::").concat(s,"){1,7}|:))")+")(%[0-9a-zA-Z-.:]{1,})?$");e.exports=t.default,e.exports.default=t.default}(_t,_t.exports);var xt=_t.exports;!function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){if((0,r.default)(e),!e||/[\s<>]/.test(e))return!1;if(0===e.indexOf("mailto:"))return!1;if((t=(0,i.default)(t,u)).validate_length&&e.length>=2083)return!1;if(!t.allow_fragments&&e.includes("#"))return!1;if(!t.allow_query_components&&(e.includes("?")||e.includes("&")))return!1;var a,f,d,p,h,m,v,g;if(v=e.split("#"),e=v.shift(),v=e.split("?"),e=v.shift(),(v=e.split("://")).length>1){if(a=v.shift().toLowerCase(),t.require_valid_protocol&&-1===t.protocols.indexOf(a))return!1}else{if(t.require_protocol)return!1;if("//"===e.slice(0,2)){if(!t.allow_protocol_relative_urls)return!1;v[0]=e.slice(2)}}if(""===(e=v.join("://")))return!1;if(v=e.split("/"),""===(e=v.shift())&&!t.require_host)return!0;if((v=e.split("@")).length>1){if(t.disallow_auth)return!1;if(""===v[0])return!1;if((f=v.shift()).indexOf(":")>=0&&f.split(":").length>2)return!1;var y=f.split(":"),w=(E=2,function(e){if(Array.isArray(e))return e}(x=y)||function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var r=[],n=!0,o=!1,i=void 0;try{for(var a,s=e[Symbol.iterator]();!(n=(a=s.next()).done)&&(r.push(a.value),!t||r.length!==t);n=!0);}catch(e){o=!0,i=e}finally{try{n||null==s.return||s.return()}finally{if(o)throw i}}return r}}(x,E)||function(e,t){if(e){if("string"==typeof e)return s(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?s(e,t):void 0}}(x,E)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),b=w[0],_=w[1];if(""===b&&""===_)return!1}var x,E;p=v.join("@"),m=null,g=null;var T=p.match(c);T?(d="",g=T[1],m=T[2]||null):(d=(v=p.split(":")).shift(),v.length&&(m=v.join(":")));if(null!==m&&m.length>0){if(h=parseInt(m,10),!/^[0-9]+$/.test(m)||h<=0||h>65535)return!1}else if(t.require_port)return!1;if(t.host_whitelist)return l(d,t.host_whitelist);if(""===d&&!t.require_host)return!0;if(!((0,o.default)(d)||(0,n.default)(d,t)||g&&(0,o.default)(g,6)))return!1;if(d=d||g,t.host_blacklist&&l(d,t.host_blacklist))return!1;return!0};var r=a(mt),n=a(wt),o=a(xt),i=a(yt);function a(e){return e&&e.__esModule?e:{default:e}}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var u={protocols:["http","https","ftp"],require_tld:!0,require_protocol:!1,require_host:!0,require_port:!1,require_valid_protocol:!0,allow_underscores:!1,allow_trailing_dot:!1,allow_protocol_relative_urls:!1,allow_fragments:!0,allow_query_components:!0,validate_length:!0},c=/^\[([^\]]+)\](?::([0-9]+))?$/;function l(e,t){for(var r=0;r<t.length;r++){var n=t[r];if(e===n||(o=n,"[object RegExp]"===Object.prototype.toString.call(o)&&n.test(e)))return!0}var o;return!1}e.exports=t.default,e.exports.default=t.default}(pt,pt.exports);var Et=t(pt.exports),Tt={};Object.defineProperty(Tt,"__esModule",{value:!0});var jt="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},St="undefined"!=typeof window&&void 0!==window.document,Ot="object"===("undefined"==typeof self?"undefined":jt(self))&&self.constructor&&"DedicatedWorkerGlobalScope"===self.constructor.name,At=void 0!==de&&null!=de.versions&&null!=de.versions.node;Tt.isBrowser=St,Tt.isWebWorker=Ot;var Pt=Tt.isNode=At;Tt.isJsDom=function(){return"undefined"!=typeof window&&"nodejs"===window.name||navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom")};var Nt={};const Rt="1.1.0",Ct=5e3;var qt=Object.freeze({__proto__:null,fn:async function(e,t){let r;const n=new Promise(((t,n)=>{r=setTimeout((()=>n(new Error("Request was timed out"))),e.fetcherTimeout?e.fetcherTimeout:Ct)})),o=new Promise(((r,n)=>{(async()=>{let o=!1;try{Et(t.claims.activitypub.url),o=!0}catch(e){}const i=new Date,{host:a,pathname:s,search:u}=new URL(e.url),c={host:a,date:i.toUTCString(),accept:"application/activity+json","User-Agent":`doipjs/${Rt}`};if(o&&Pt){const e=`(request-target): get ${s}${u}\nhost: ${a}\ndate: ${i.toUTCString()}`,r=Nt.createSign("SHA256");r.write(e),r.end();const n=r.sign(t.claims.activitypub.privateKey.replace(/\\n/g,"\n"),"base64");c.signature=`keyId="${t.claims.activitypub.url}#main-key",headers="(request-target) host date",signature="${n}",algorithm="rsa-sha256"`}dt.get(e.url,{headers:c}).then((e=>e.data)).then((e=>{r(e)})).catch((e=>{n(e)}))})()}));return Promise.race([o,n]).then((e=>(clearTimeout(r),e)))},timeout:Ct});const kt=5e3;var Ut=Object.freeze({__proto__:null,fn:async function(e,t){let r;const n=new Promise(((t,n)=>{r=setTimeout((()=>n(new Error("Request was timed out"))),e.fetcherTimeout?e.fetcherTimeout:kt)})),o=new Promise(((t,r)=>{if(!e.url)return void r(new Error("No valid URI provided"));let n;try{n=JSON.parse(e.query)}catch(e){r(new Error("Invalid GraphQL query object"))}dt.post(e.url,n,{headers:{"Content-Type":"application/json","User-Agent":`doipjs/${Rt}`},validateStatus:function(e){return e>=200&&e<400}}).then((e=>{t(e.data)})).catch((e=>{r(e)}))}));return Promise.race([o,n]).then((e=>(clearTimeout(r),e)))},timeout:kt});const $t={JSON:"json",TEXT:"text"},Lt=5e3;var Bt=Object.freeze({__proto__:null,fn:async function(e,t){let r;const n=new Promise(((t,n)=>{r=setTimeout((()=>n(new Error("Request was timed out"))),e.fetcherTimeout?e.fetcherTimeout:Lt)})),o=new Promise(((t,r)=>{if(e.url)switch(e.format){case $t.JSON:dt.get(e.url,{headers:{Accept:"application/json","User-Agent":`doipjs/${Rt}`},validateStatus:function(e){return e>=200&&e<400}}).then((e=>{t(e.data)})).catch((e=>{r(e)}));break;case $t.TEXT:dt.get(e.url,{validateStatus:function(e){return e>=200&&e<400},responseType:"text"}).then((e=>{t(e.data)})).catch((e=>{r(e)}));break;default:r(new Error("No specified data format"))}else r(new Error("No valid URI provided"))}));return Promise.race([o,n]).then((e=>(clearTimeout(r),e)))},timeout:Lt}),Dt={exports:{}};!function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return(0,n.default)(e),o.test(e)};var r,n=(r=mt)&&r.__esModule?r:{default:r};var o=/^[\x00-\x7F]+$/;e.exports=t.default,e.exports.default=t.default}(Dt,Dt.exports);var Ft=t(Dt.exports);const Mt=5e3;var It=Object.freeze({__proto__:null,fn:async function(e,t){let r;const n=new Promise(((t,n)=>{r=setTimeout((()=>n(new Error("Request was timed out"))),e.fetcherTimeout?e.fetcherTimeout:Mt)})),o=new Promise(((r,n)=>{try{bt(t.claims.matrix.instance),Ft(t.claims.matrix.accessToken)}catch(e){throw new Error(`Matrix fetcher was not set up properly (${e.message})`)}const o=`https://${t.claims.matrix.instance}/_matrix/client/r0/rooms/${e.roomId}/event/${e.eventId}?access_token=${t.claims.matrix.accessToken}`;dt.get(o,{headers:{Accept:"application/json","User-Agent":`doipjs/${Rt}`}}).then((e=>e.data)).then((e=>{r(e)})).catch((e=>{n(e)}))}));return Promise.race([o,n]).then((e=>(clearTimeout(r),e)))},timeout:Mt});const zt=5e3;var Jt=Object.freeze({__proto__:null,fn:async function(e,t){let r;const n=new Promise(((t,n)=>{r=setTimeout((()=>n(new Error("Request was timed out"))),e.fetcherTimeout?e.fetcherTimeout:zt)})),o=r=>new Promise(((n,o)=>{try{Ft(t.claims.telegram.token)}catch(e){throw new Error(`Telegram fetcher was not set up properly (${e.message})`)}if(!e.chat||!e.user)return void o(new Error("Both chat name and user name must be provided"));const i=`https://api.telegram.org/bot${t.claims.telegram.token}/${r}?chat_id=@${e.chat}`;dt.get(i,{headers:{Accept:"application/json","User-Agent":`doipjs/${Rt}`},validateStatus:e=>200===e}).then((e=>n(e.data))).catch((e=>o(e)))})),i=o("getChatAdministrators").then((t=>{if(!t.ok)throw new Error("Request to get chat administrators failed");return o("getChat").then((r=>{if(!r.ok)throw new Error("Request to get chat info failed");let n;for(const e of t.result)"creator"===e.status&&(n=e.user.username);if(!r.result.description)throw new Error("There is no chat description");if(n!==e.user)throw new Error("User doesn't match");return{user:n,text:r.result.description}}))}));return Promise.race([i,n]).then((e=>(clearTimeout(r),e)))},timeout:zt});return e.activitypub=qt,e.graphql=Ut,e.http=Bt,e.matrix=It,e.telegram=Jt,e}({});
|