@verdocs/web-sdk 1.4.6 → 1.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/VerdocsEndpoint-5e6dd8ef.js +4780 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/verdocs-auth.cjs.entry.js +32 -19
- package/dist/cjs/verdocs-dropdown_12.cjs.entry.js +15 -11
- package/dist/cjs/verdocs-kba-dialog.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-ok-dialog.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-quick-functions.cjs.entry.js +5 -0
- package/dist/cjs/verdocs-search-activity_2.cjs.entry.js +40 -35
- package/dist/cjs/verdocs-search.cjs.entry.js +6 -1
- package/dist/cjs/verdocs-sign.cjs.entry.js +26 -161
- package/dist/cjs/verdocs-web-sdk.cjs.js +1 -1
- package/dist/collection/components/dialogs/verdocs-kba-dialog/verdocs-kba-dialog.css +1 -1
- package/dist/collection/components/dialogs/verdocs-ok-dialog/verdocs-ok-dialog.css +1 -1
- package/dist/collection/components/elements/verdocs-quick-functions/verdocs-quick-functions.js +31 -1
- package/dist/collection/components/elements/verdocs-search-activity/verdocs-search-activity.js +30 -6
- package/dist/collection/components/elements/verdocs-search-box/verdocs-search-box.js +26 -0
- package/dist/collection/components/embeds/verdocs-auth/verdocs-auth.css +1 -4
- package/dist/collection/components/embeds/verdocs-auth/verdocs-auth.js +35 -17
- package/dist/collection/components/embeds/verdocs-search/verdocs-search.js +36 -6
- package/dist/collection/components/embeds/verdocs-sign/verdocs-sign.css +27 -26
- package/dist/collection/components/embeds/verdocs-sign/verdocs-sign.js +40 -23
- package/dist/collection/components/embeds/verdocs-sign/verdocs-sign.stories.js +2 -2
- package/dist/collection/components/embeds/verdocs-view/verdocs-view.js +26 -0
- package/dist/components/VerdocsEndpoint.js +4766 -0
- package/dist/components/verdocs-auth.js +33 -18
- package/dist/components/verdocs-kba-dialog.js +1 -1
- package/dist/components/verdocs-ok-dialog2.js +1 -1
- package/dist/components/verdocs-quick-functions.js +8 -1
- package/dist/components/verdocs-search-activity2.js +37 -34
- package/dist/components/verdocs-search-box2.js +6 -0
- package/dist/components/verdocs-search.js +9 -2
- package/dist/components/verdocs-sign.js +27 -162
- package/dist/components/verdocs-view2.js +6 -1
- package/dist/docs.json +117 -3
- package/dist/esm/VerdocsEndpoint-30e1b6ec.js +4766 -0
- package/dist/esm/loader.js +1 -1
- package/dist/esm/verdocs-auth.entry.js +32 -19
- package/dist/esm/verdocs-dropdown_12.entry.js +5 -1
- package/dist/esm/verdocs-kba-dialog.entry.js +1 -1
- package/dist/esm/verdocs-ok-dialog.entry.js +1 -1
- package/dist/esm/verdocs-quick-functions.entry.js +5 -0
- package/dist/esm/verdocs-search-activity_2.entry.js +40 -35
- package/dist/esm/verdocs-search.entry.js +6 -1
- package/dist/esm/verdocs-sign.entry.js +26 -161
- package/dist/esm/verdocs-web-sdk.js +1 -1
- package/dist/esm-es5/VerdocsEndpoint-30e1b6ec.js +7 -0
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/verdocs-auth.entry.js +1 -1
- package/dist/esm-es5/verdocs-dropdown_12.entry.js +2 -2
- package/dist/esm-es5/verdocs-kba-dialog.entry.js +1 -1
- package/dist/esm-es5/verdocs-ok-dialog.entry.js +1 -1
- package/dist/esm-es5/verdocs-quick-functions.entry.js +1 -1
- package/dist/esm-es5/verdocs-search-activity_2.entry.js +1 -1
- package/dist/esm-es5/verdocs-search.entry.js +1 -1
- package/dist/esm-es5/verdocs-sign.entry.js +1 -1
- package/dist/esm-es5/verdocs-web-sdk.js +1 -1
- package/dist/types/components/elements/verdocs-quick-functions/verdocs-quick-functions.d.ts +5 -0
- package/dist/types/components/elements/verdocs-search-activity/verdocs-search-activity.d.ts +5 -0
- package/dist/types/components/elements/verdocs-search-box/verdocs-search-box.d.ts +5 -0
- package/dist/types/components/embeds/verdocs-auth/verdocs-auth.d.ts +7 -4
- package/dist/types/components/embeds/verdocs-search/verdocs-search.d.ts +5 -0
- package/dist/types/components/embeds/verdocs-sign/verdocs-sign.d.ts +6 -3
- package/dist/types/components/embeds/verdocs-view/verdocs-view.d.ts +5 -0
- package/dist/types/components.d.ts +57 -0
- package/dist/verdocs-web-sdk/{p-ed5baeb4.entry.js → p-064453c3.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-06f38046.js +1 -0
- package/dist/verdocs-web-sdk/p-16d62a51.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-1b4e04b7.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-1ea3b9d3.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-30cc8818.entry.js +1 -0
- package/dist/verdocs-web-sdk/{p-0353c423.entry.js → p-32ad1014.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-4d80d044.system.js +7 -0
- package/dist/verdocs-web-sdk/{p-432c3151.system.entry.js → p-81fc0196.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-8276345a.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-88a300c5.system.js +1 -1
- package/dist/verdocs-web-sdk/p-9139a76d.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-a87069d5.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-aa9fc574.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-c29c2cf8.entry.js +1 -0
- package/dist/verdocs-web-sdk/{p-4368df79.system.entry.js → p-c4d03ff9.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-a1143ddb.entry.js → p-d522de7d.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-e2e643c5.system.entry.js → p-e4ba14dc.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-f6a53928.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/verdocs-web-sdk.esm.js +1 -1
- package/package.json +2 -2
- package/dist/cjs/Auth-e68977a3.js +0 -90
- package/dist/cjs/Token-1ec62bd3.js +0 -2330
- package/dist/cjs/buffer-es6-bc8199b1.js +0 -2018
- package/dist/components/Auth.js +0 -85
- package/dist/components/Token.js +0 -2325
- package/dist/components/buffer-es6.js +0 -2010
- package/dist/esm/Auth-b330f209.js +0 -85
- package/dist/esm/Token-a587e3ad.js +0 -2325
- package/dist/esm/buffer-es6-136673c8.js +0 -2010
- package/dist/esm-es5/Auth-b330f209.js +0 -1
- package/dist/esm-es5/Token-a587e3ad.js +0 -1
- package/dist/esm-es5/buffer-es6-136673c8.js +0 -7
- package/dist/verdocs-web-sdk/p-0b1fb53f.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-0c30002e.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-203fd748.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-216a4759.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-2c161242.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-3820c9a2.js +0 -1
- package/dist/verdocs-web-sdk/p-39633a02.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-5dfd73f9.system.js +0 -7
- package/dist/verdocs-web-sdk/p-6348272c.js +0 -1
- package/dist/verdocs-web-sdk/p-9428614b.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-da850d97.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-e3659c64.system.js +0 -1
- package/dist/verdocs-web-sdk/p-e93ac86f.system.js +0 -1
- package/dist/verdocs-web-sdk/p-ef932a87.js +0 -1
- package/dist/verdocs-web-sdk/p-f0e6fde0.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-fd853e54.system.entry.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{g as getEndpoint,d as decodeAccessTokenBody}from"./Token-a587e3ad.js";var authenticateUser=function(e){return getEndpoint().api.post("/authentication/login",e).then((function(e){return e.data}))};var clearSession=function(e,n){getEndpoint().setAuthorization(null);if(n){localStorage.removeItem(e)}notifySessionListeners(e,null);return null};var setSession=function(e,n,t){if(t===void 0){t=false}if(n===null){return clearSession(e,t)}var s=decodeAccessTokenBody(n||"");if(s===null||s.exp&&s.exp*1e3<(new Date).getTime()){return clearSession(e,t)}if(t){localStorage.setItem(e,n)}getEndpoint().setAuthorization(n);notifySessionListeners(e,s);return s};var loadSession=function(e){var n=localStorage.getItem(e);if(!n){return null}var t=decodeAccessTokenBody(n);if(!t){return null}if(t.exp&&t.exp*1e3<(new Date).getTime()){localStorage.removeItem(e);return null}getEndpoint().setAuthorization(n);notifySessionListeners(e,t);return t};var endSession=function(e,n){if(n===void 0){n=false}return clearSession(e,n)};var sessionChangedListeners=new Map;var notifySessionListeners=function(e,n){sessionChangedListeners.forEach((function(t){try{t(e,n)}catch(e){}}))};export{authenticateUser as a,endSession as e,loadSession as l,setSession as s};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{B as Buffer,p as process_1}from"./buffer-es6-136673c8.js";var bind=function e(t,r){return function e(){var n=new Array(arguments.length);for(var i=0;i<n.length;i++){n[i]=arguments[i]}return t.apply(r,n)}};var toString=Object.prototype.toString;var kindOf=function(e){return function(t){var r=toString.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())}}(Object.create(null));function kindOfTest(e){e=e.toLowerCase();return function t(r){return kindOf(r)===e}}function isArray(e){return Array.isArray(e)}function isUndefined(e){return typeof e==="undefined"}function isBuffer(e){return e!==null&&!isUndefined(e)&&e.constructor!==null&&!isUndefined(e.constructor)&&typeof e.constructor.isBuffer==="function"&&e.constructor.isBuffer(e)}var isArrayBuffer=kindOfTest("ArrayBuffer");function isArrayBufferView(e){var t;if(typeof ArrayBuffer!=="undefined"&&ArrayBuffer.isView){t=ArrayBuffer.isView(e)}else{t=e&&e.buffer&&isArrayBuffer(e.buffer)}return t}function isString(e){return typeof e==="string"}function isNumber(e){return typeof e==="number"}function isObject(e){return e!==null&&typeof e==="object"}function isPlainObject(e){if(kindOf(e)!=="object"){return false}var t=Object.getPrototypeOf(e);return t===null||t===Object.prototype}var isDate=kindOfTest("Date");var isFile=kindOfTest("File");var isBlob=kindOfTest("Blob");var isFileList=kindOfTest("FileList");function isFunction(e){return toString.call(e)==="[object Function]"}function isStream(e){return isObject(e)&&isFunction(e.pipe)}function isFormData(e){var t="[object FormData]";return e&&(typeof FormData==="function"&&e instanceof FormData||toString.call(e)===t||isFunction(e.toString)&&e.toString()===t)}var isURLSearchParams=kindOfTest("URLSearchParams");function trim(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function isStandardBrowserEnv(){if(typeof navigator!=="undefined"&&(navigator.product==="ReactNative"||navigator.product==="NativeScript"||navigator.product==="NS")){return false}return typeof window!=="undefined"&&typeof document!=="undefined"}function forEach(e,t){if(e===null||typeof e==="undefined"){return}if(typeof e!=="object"){e=[e]}if(isArray(e)){for(var r=0,n=e.length;r<n;r++){t.call(null,e[r],r,e)}}else{for(var i in e){if(Object.prototype.hasOwnProperty.call(e,i)){t.call(null,e[i],i,e)}}}}function merge(){var e={};function t(t,r){if(isPlainObject(e[r])&&isPlainObject(t)){e[r]=merge(e[r],t)}else if(isPlainObject(t)){e[r]=merge({},t)}else if(isArray(t)){e[r]=t.slice()}else{e[r]=t}}for(var r=0,n=arguments.length;r<n;r++){forEach(arguments[r],t)}return e}function extend(e,t,r){forEach(t,(function t(n,i){if(r&&typeof n==="function"){e[i]=bind(n,r)}else{e[i]=n}}));return e}function stripBOM(e){if(e.charCodeAt(0)===65279){e=e.slice(1)}return e}function inherits(e,t,r,n){e.prototype=Object.create(t.prototype,n);e.prototype.constructor=e;r&&Object.assign(e.prototype,r)}function toFlatObject(e,t,r){var n;var i;var o;var s={};t=t||{};do{n=Object.getOwnPropertyNames(e);i=n.length;while(i-- >0){o=n[i];if(!s[o]){t[o]=e[o];s[o]=true}}e=Object.getPrototypeOf(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t}function endsWith(e,t,r){e=String(e);if(r===undefined||r>e.length){r=e.length}r-=t.length;var n=e.indexOf(t,r);return n!==-1&&n===r}function toArray(e){if(!e)return null;var t=e.length;if(isUndefined(t))return null;var r=new Array(t);while(t-- >0){r[t]=e[t]}return r}var isTypedArray=function(e){return function(t){return e&&t instanceof e}}(typeof Uint8Array!=="undefined"&&Object.getPrototypeOf(Uint8Array));var utils={isArray:isArray,isArrayBuffer:isArrayBuffer,isBuffer:isBuffer,isFormData:isFormData,isArrayBufferView:isArrayBufferView,isString:isString,isNumber:isNumber,isObject:isObject,isPlainObject:isPlainObject,isUndefined:isUndefined,isDate:isDate,isFile:isFile,isBlob:isBlob,isFunction:isFunction,isStream:isStream,isURLSearchParams:isURLSearchParams,isStandardBrowserEnv:isStandardBrowserEnv,forEach:forEach,merge:merge,extend:extend,trim:trim,stripBOM:stripBOM,inherits:inherits,toFlatObject:toFlatObject,kindOf:kindOf,kindOfTest:kindOfTest,endsWith:endsWith,toArray:toArray,isTypedArray:isTypedArray,isFileList:isFileList};function encode(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}var buildURL=function e(t,r,n){if(!r){return t}var i;if(n){i=n(r)}else if(utils.isURLSearchParams(r)){i=r.toString()}else{var o=[];utils.forEach(r,(function e(t,r){if(t===null||typeof t==="undefined"){return}if(utils.isArray(t)){r=r+"[]"}else{t=[t]}utils.forEach(t,(function e(t){if(utils.isDate(t)){t=t.toISOString()}else if(utils.isObject(t)){t=JSON.stringify(t)}o.push(encode(r)+"="+encode(t))}))}));i=o.join("&")}if(i){var s=t.indexOf("#");if(s!==-1){t=t.slice(0,s)}t+=(t.indexOf("?")===-1?"?":"&")+i}return t};function InterceptorManager(){this.handlers=[]}InterceptorManager.prototype.use=function e(t,r,n){this.handlers.push({fulfilled:t,rejected:r,synchronous:n?n.synchronous:false,runWhen:n?n.runWhen:null});return this.handlers.length-1};InterceptorManager.prototype.eject=function e(t){if(this.handlers[t]){this.handlers[t]=null}};InterceptorManager.prototype.forEach=function e(t){utils.forEach(this.handlers,(function e(r){if(r!==null){t(r)}}))};var InterceptorManager_1=InterceptorManager;var normalizeHeaderName=function e(t,r){utils.forEach(t,(function e(n,i){if(i!==r&&i.toUpperCase()===r.toUpperCase()){t[r]=n;delete t[i]}}))};function AxiosError(e,t,r,n,i){Error.call(this);this.message=e;this.name="AxiosError";t&&(this.code=t);r&&(this.config=r);n&&(this.request=n);i&&(this.response=i)}utils.inherits(AxiosError,Error,{toJSON:function e(){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}}});var prototype=AxiosError.prototype;var descriptors={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED"].forEach((function(e){descriptors[e]={value:e}}));Object.defineProperties(AxiosError,descriptors);Object.defineProperty(prototype,"isAxiosError",{value:true});AxiosError.from=function(e,t,r,n,i,o){var s=Object.create(prototype);utils.toFlatObject(e,s,(function e(t){return t!==Error.prototype}));AxiosError.call(s,e.message,t,r,n,i);s.name=e.name;o&&Object.assign(s,o);return s};var AxiosError_1=AxiosError;var transitional={silentJSONParsing:true,forcedJSONParsing:true,clarifyTimeoutError:false};function toFormData(e,t){t=t||new FormData;var r=[];function n(e){if(e===null)return"";if(utils.isDate(e)){return e.toISOString()}if(utils.isArrayBuffer(e)||utils.isTypedArray(e)){return typeof Blob==="function"?new Blob([e]):Buffer.from(e)}return e}function i(e,o){if(utils.isPlainObject(e)||utils.isArray(e)){if(r.indexOf(e)!==-1){throw Error("Circular reference detected in "+o)}r.push(e);utils.forEach(e,(function e(r,s){if(utils.isUndefined(r))return;var a=o?o+"."+s:s;var u;if(r&&!o&&typeof r==="object"){if(utils.endsWith(s,"{}")){r=JSON.stringify(r)}else if(utils.endsWith(s,"[]")&&(u=utils.toArray(r))){u.forEach((function(e){!utils.isUndefined(e)&&t.append(a,n(e))}));return}}i(r,a)}));r.pop()}else{t.append(o,n(e))}}i(e);return t}var toFormData_1=toFormData;var settle=function e(t,r,n){var i=n.config.validateStatus;if(!n.status||!i||i(n.status)){t(n)}else{r(new AxiosError_1("Request failed with status code "+n.status,[AxiosError_1.ERR_BAD_REQUEST,AxiosError_1.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}};var cookies=utils.isStandardBrowserEnv()?function e(){return{write:function e(t,r,n,i,o,s){var a=[];a.push(t+"="+encodeURIComponent(r));if(utils.isNumber(n)){a.push("expires="+new Date(n).toGMTString())}if(utils.isString(i)){a.push("path="+i)}if(utils.isString(o)){a.push("domain="+o)}if(s===true){a.push("secure")}document.cookie=a.join("; ")},read:function e(t){var r=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return r?decodeURIComponent(r[3]):null},remove:function e(t){this.write(t,"",Date.now()-864e5)}}}():function e(){return{write:function e(){},read:function e(){return null},remove:function e(){}}}();var isAbsoluteURL=function e(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)};var combineURLs=function e(t,r){return r?t.replace(/\/+$/,"")+"/"+r.replace(/^\/+/,""):t};var buildFullPath=function e(t,r){if(t&&!isAbsoluteURL(r)){return combineURLs(t,r)}return r};var ignoreDuplicateOf=["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"];var parseHeaders=function e(t){var r={};var n;var i;var o;if(!t){return r}utils.forEach(t.split("\n"),(function e(t){o=t.indexOf(":");n=utils.trim(t.substr(0,o)).toLowerCase();i=utils.trim(t.substr(o+1));if(n){if(r[n]&&ignoreDuplicateOf.indexOf(n)>=0){return}if(n==="set-cookie"){r[n]=(r[n]?r[n]:[]).concat([i])}else{r[n]=r[n]?r[n]+", "+i:i}}}));return r};var isURLSameOrigin=utils.isStandardBrowserEnv()?function e(){var t=/(msie|trident)/i.test(navigator.userAgent);var r=document.createElement("a");var n;function i(e){var n=e;if(t){r.setAttribute("href",n);n=r.href}r.setAttribute("href",n);return{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:r.pathname.charAt(0)==="/"?r.pathname:"/"+r.pathname}}n=i(window.location.href);return function e(t){var r=utils.isString(t)?i(t):t;return r.protocol===n.protocol&&r.host===n.host}}():function e(){return function e(){return true}}();function CanceledError(e){AxiosError_1.call(this,e==null?"canceled":e,AxiosError_1.ERR_CANCELED);this.name="CanceledError"}utils.inherits(CanceledError,AxiosError_1,{__CANCEL__:true});var CanceledError_1=CanceledError;var parseProtocol=function e(t){var r=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return r&&r[1]||""};var xhr=function e(t){return new Promise((function e(r,n){var i=t.data;var o=t.headers;var s=t.responseType;var a;function u(){if(t.cancelToken){t.cancelToken.unsubscribe(a)}if(t.signal){t.signal.removeEventListener("abort",a)}}if(utils.isFormData(i)&&utils.isStandardBrowserEnv()){delete o["Content-Type"]}var f=new XMLHttpRequest;if(t.auth){var l=t.auth.username||"";var c=t.auth.password?unescape(encodeURIComponent(t.auth.password)):"";o.Authorization="Basic "+btoa(l+":"+c)}var d=buildFullPath(t.baseURL,t.url);f.open(t.method.toUpperCase(),buildURL(d,t.params,t.paramsSerializer),true);f.timeout=t.timeout;function p(){if(!f){return}var e="getAllResponseHeaders"in f?parseHeaders(f.getAllResponseHeaders()):null;var i=!s||s==="text"||s==="json"?f.responseText:f.response;var o={data:i,status:f.status,statusText:f.statusText,headers:e,config:t,request:f};settle((function e(t){r(t);u()}),(function e(t){n(t);u()}),o);f=null}if("onloadend"in f){f.onloadend=p}else{f.onreadystatechange=function e(){if(!f||f.readyState!==4){return}if(f.status===0&&!(f.responseURL&&f.responseURL.indexOf("file:")===0)){return}setTimeout(p)}}f.onabort=function e(){if(!f){return}n(new AxiosError_1("Request aborted",AxiosError_1.ECONNABORTED,t,f));f=null};f.onerror=function e(){n(new AxiosError_1("Network Error",AxiosError_1.ERR_NETWORK,t,f,f));f=null};f.ontimeout=function e(){var r=t.timeout?"timeout of "+t.timeout+"ms exceeded":"timeout exceeded";var i=t.transitional||transitional;if(t.timeoutErrorMessage){r=t.timeoutErrorMessage}n(new AxiosError_1(r,i.clarifyTimeoutError?AxiosError_1.ETIMEDOUT:AxiosError_1.ECONNABORTED,t,f));f=null};if(utils.isStandardBrowserEnv()){var h=(t.withCredentials||isURLSameOrigin(d))&&t.xsrfCookieName?cookies.read(t.xsrfCookieName):undefined;if(h){o[t.xsrfHeaderName]=h}}if("setRequestHeader"in f){utils.forEach(o,(function e(t,r){if(typeof i==="undefined"&&r.toLowerCase()==="content-type"){delete o[r]}else{f.setRequestHeader(r,t)}}))}if(!utils.isUndefined(t.withCredentials)){f.withCredentials=!!t.withCredentials}if(s&&s!=="json"){f.responseType=t.responseType}if(typeof t.onDownloadProgress==="function"){f.addEventListener("progress",t.onDownloadProgress)}if(typeof t.onUploadProgress==="function"&&f.upload){f.upload.addEventListener("progress",t.onUploadProgress)}if(t.cancelToken||t.signal){a=function(e){if(!f){return}n(!e||e&&e.type?new CanceledError_1:e);f.abort();f=null};t.cancelToken&&t.cancelToken.subscribe(a);if(t.signal){t.signal.aborted?a():t.signal.addEventListener("abort",a)}}if(!i){i=null}var v=parseProtocol(d);if(v&&["http","https","file"].indexOf(v)===-1){n(new AxiosError_1("Unsupported protocol "+v+":",AxiosError_1.ERR_BAD_REQUEST,t));return}f.send(i)}))};var _null=null;var DEFAULT_CONTENT_TYPE={"Content-Type":"application/x-www-form-urlencoded"};function setContentTypeIfUnset(e,t){if(!utils.isUndefined(e)&&utils.isUndefined(e["Content-Type"])){e["Content-Type"]=t}}function getDefaultAdapter(){var e;if(typeof XMLHttpRequest!=="undefined"){e=xhr}else if(typeof process_1!=="undefined"&&Object.prototype.toString.call(process_1)==="[object process]"){e=xhr}return e}function stringifySafely(e,t,r){if(utils.isString(e)){try{(t||JSON.parse)(e);return utils.trim(e)}catch(e){if(e.name!=="SyntaxError"){throw e}}}return(r||JSON.stringify)(e)}var defaults={transitional:transitional,adapter:getDefaultAdapter(),transformRequest:[function e(t,r){normalizeHeaderName(r,"Accept");normalizeHeaderName(r,"Content-Type");if(utils.isFormData(t)||utils.isArrayBuffer(t)||utils.isBuffer(t)||utils.isStream(t)||utils.isFile(t)||utils.isBlob(t)){return t}if(utils.isArrayBufferView(t)){return t.buffer}if(utils.isURLSearchParams(t)){setContentTypeIfUnset(r,"application/x-www-form-urlencoded;charset=utf-8");return t.toString()}var n=utils.isObject(t);var i=r&&r["Content-Type"];var o;if((o=utils.isFileList(t))||n&&i==="multipart/form-data"){var s=this.env&&this.env.FormData;return toFormData_1(o?{"files[]":t}:t,s&&new s)}else if(n||i==="application/json"){setContentTypeIfUnset(r,"application/json");return stringifySafely(t)}return t}],transformResponse:[function e(t){var r=this.transitional||defaults.transitional;var n=r&&r.silentJSONParsing;var i=r&&r.forcedJSONParsing;var o=!n&&this.responseType==="json";if(o||i&&utils.isString(t)&&t.length){try{return JSON.parse(t)}catch(e){if(o){if(e.name==="SyntaxError"){throw AxiosError_1.from(e,AxiosError_1.ERR_BAD_RESPONSE,this,null,this.response)}throw e}}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:_null},validateStatus:function e(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};utils.forEach(["delete","get","head"],(function e(t){defaults.headers[t]={}}));utils.forEach(["post","put","patch"],(function e(t){defaults.headers[t]=utils.merge(DEFAULT_CONTENT_TYPE)}));var defaults_1=defaults;var transformData=function e(t,r,n){var i=this||defaults_1;utils.forEach(n,(function e(n){t=n.call(i,t,r)}));return t};var isCancel=function e(t){return!!(t&&t.__CANCEL__)};function throwIfCancellationRequested(e){if(e.cancelToken){e.cancelToken.throwIfRequested()}if(e.signal&&e.signal.aborted){throw new CanceledError_1}}var dispatchRequest=function e(t){throwIfCancellationRequested(t);t.headers=t.headers||{};t.data=transformData.call(t,t.data,t.headers,t.transformRequest);t.headers=utils.merge(t.headers.common||{},t.headers[t.method]||{},t.headers);utils.forEach(["delete","get","head","post","put","patch","common"],(function e(r){delete t.headers[r]}));var r=t.adapter||defaults_1.adapter;return r(t).then((function e(r){throwIfCancellationRequested(t);r.data=transformData.call(t,r.data,r.headers,t.transformResponse);return r}),(function e(r){if(!isCancel(r)){throwIfCancellationRequested(t);if(r&&r.response){r.response.data=transformData.call(t,r.response.data,r.response.headers,t.transformResponse)}}return Promise.reject(r)}))};var mergeConfig=function e(t,r){r=r||{};var n={};function i(e,t){if(utils.isPlainObject(e)&&utils.isPlainObject(t)){return utils.merge(e,t)}else if(utils.isPlainObject(t)){return utils.merge({},t)}else if(utils.isArray(t)){return t.slice()}return t}function o(e){if(!utils.isUndefined(r[e])){return i(t[e],r[e])}else if(!utils.isUndefined(t[e])){return i(undefined,t[e])}}function s(e){if(!utils.isUndefined(r[e])){return i(undefined,r[e])}}function a(e){if(!utils.isUndefined(r[e])){return i(undefined,r[e])}else if(!utils.isUndefined(t[e])){return i(undefined,t[e])}}function u(e){if(e in r){return i(t[e],r[e])}else if(e in t){return i(undefined,t[e])}}var f={url:s,method:s,data:s,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,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:u};utils.forEach(Object.keys(t).concat(Object.keys(r)),(function e(t){var r=f[t]||o;var i=r(t);utils.isUndefined(i)&&r!==u||(n[t]=i)}));return n};var data={version:"0.27.2"};var VERSION=data.version;var validators$1={};["object","boolean","number","function","string","symbol"].forEach((function(e,t){validators$1[e]=function r(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));var deprecatedWarnings={};validators$1.transitional=function e(t,r,n){function i(e,t){return"[Axios v"+VERSION+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return function(e,n,o){if(t===false){throw new AxiosError_1(i(n," has been removed"+(r?" in "+r:"")),AxiosError_1.ERR_DEPRECATED)}if(r&&!deprecatedWarnings[n]){deprecatedWarnings[n]=true;console.warn(i(n," has been deprecated since v"+r+" and will be removed in the near future"))}return t?t(e,n,o):true}};function assertOptions(e,t,r){if(typeof e!=="object"){throw new AxiosError_1("options must be an object",AxiosError_1.ERR_BAD_OPTION_VALUE)}var n=Object.keys(e);var i=n.length;while(i-- >0){var o=n[i];var s=t[o];if(s){var a=e[o];var u=a===undefined||s(a,o,e);if(u!==true){throw new AxiosError_1("option "+o+" must be "+u,AxiosError_1.ERR_BAD_OPTION_VALUE)}continue}if(r!==true){throw new AxiosError_1("Unknown option "+o,AxiosError_1.ERR_BAD_OPTION)}}}var validator={assertOptions:assertOptions,validators:validators$1};var validators=validator.validators;function Axios(e){this.defaults=e;this.interceptors={request:new InterceptorManager_1,response:new InterceptorManager_1}}Axios.prototype.request=function e(t,r){if(typeof t==="string"){r=r||{};r.url=t}else{r=t||{}}r=mergeConfig(this.defaults,r);if(r.method){r.method=r.method.toLowerCase()}else if(this.defaults.method){r.method=this.defaults.method.toLowerCase()}else{r.method="get"}var n=r.transitional;if(n!==undefined){validator.assertOptions(n,{silentJSONParsing:validators.transitional(validators.boolean),forcedJSONParsing:validators.transitional(validators.boolean),clarifyTimeoutError:validators.transitional(validators.boolean)},false)}var i=[];var o=true;this.interceptors.request.forEach((function e(t){if(typeof t.runWhen==="function"&&t.runWhen(r)===false){return}o=o&&t.synchronous;i.unshift(t.fulfilled,t.rejected)}));var s=[];this.interceptors.response.forEach((function e(t){s.push(t.fulfilled,t.rejected)}));var a;if(!o){var u=[dispatchRequest,undefined];Array.prototype.unshift.apply(u,i);u=u.concat(s);a=Promise.resolve(r);while(u.length){a=a.then(u.shift(),u.shift())}return a}var f=r;while(i.length){var l=i.shift();var c=i.shift();try{f=l(f)}catch(e){c(e);break}}try{a=dispatchRequest(f)}catch(e){return Promise.reject(e)}while(s.length){a=a.then(s.shift(),s.shift())}return a};Axios.prototype.getUri=function e(t){t=mergeConfig(this.defaults,t);var r=buildFullPath(t.baseURL,t.url);return buildURL(r,t.params,t.paramsSerializer)};utils.forEach(["delete","get","head","options"],(function e(t){Axios.prototype[t]=function(e,r){return this.request(mergeConfig(r||{},{method:t,url:e,data:(r||{}).data}))}}));utils.forEach(["post","put","patch"],(function e(t){function r(e){return function r(n,i,o){return this.request(mergeConfig(o||{},{method:t,headers:e?{"Content-Type":"multipart/form-data"}:{},url:n,data:i}))}}Axios.prototype[t]=r();Axios.prototype[t+"Form"]=r(true)}));var Axios_1=Axios;function CancelToken(e){if(typeof e!=="function"){throw new TypeError("executor must be a function.")}var t;this.promise=new Promise((function e(r){t=r}));var r=this;this.promise.then((function(e){if(!r._listeners)return;var t;var n=r._listeners.length;for(t=0;t<n;t++){r._listeners[t](e)}r._listeners=null}));this.promise.then=function(e){var t;var n=new Promise((function(e){r.subscribe(e);t=e})).then(e);n.cancel=function e(){r.unsubscribe(t)};return n};e((function e(n){if(r.reason){return}r.reason=new CanceledError_1(n);t(r.reason)}))}CancelToken.prototype.throwIfRequested=function e(){if(this.reason){throw this.reason}};CancelToken.prototype.subscribe=function e(t){if(this.reason){t(this.reason);return}if(this._listeners){this._listeners.push(t)}else{this._listeners=[t]}};CancelToken.prototype.unsubscribe=function e(t){if(!this._listeners){return}var r=this._listeners.indexOf(t);if(r!==-1){this._listeners.splice(r,1)}};CancelToken.source=function e(){var t;var r=new CancelToken((function e(r){t=r}));return{token:r,cancel:t}};var CancelToken_1=CancelToken;var spread=function e(t){return function e(r){return t.apply(null,r)}};var isAxiosError=function e(t){return utils.isObject(t)&&t.isAxiosError===true};function createInstance(e){var t=new Axios_1(e);var r=bind(Axios_1.prototype.request,t);utils.extend(r,Axios_1.prototype,t);utils.extend(r,t);r.create=function t(r){return createInstance(mergeConfig(e,r))};return r}var axios$1=createInstance(defaults_1);axios$1.Axios=Axios_1;axios$1.CanceledError=CanceledError_1;axios$1.CancelToken=CancelToken_1;axios$1.isCancel=isCancel;axios$1.VERSION=data.version;axios$1.toFormData=toFormData_1;axios$1.AxiosError=AxiosError_1;axios$1.Cancel=axios$1.CanceledError;axios$1.all=function e(t){return Promise.all(t)};axios$1.spread=spread;axios$1.isAxiosError=isAxiosError;var axios_1=axios$1;var _default=axios$1;axios_1.default=_default;var axios=axios_1;var requestLogger=function(e){console.debug("[JS-SDK] ".concat(e.method.toUpperCase()," ").concat(e.baseURL).concat(e.url),e.data?JSON.stringify(e.data):"");return e};var VerdocsEndpoint=function(){function e(){this.requestLoggerId=null;this.api=axios.create({baseURL:"https://api.verdocs.com",timeout:3e3})}e.prototype.setTimeout=function(e){this.api.defaults.timeout=e;return this};e.prototype.setClientID=function(e){this.api.defaults.headers.common["X-Client-ID"]=e;return this};e.prototype.setAuthorization=function(e){if(e){this.api.defaults.headers.common.Authorization="Bearer ".concat(e)}else{delete this.api.defaults.headers.common.Authorization}return this};e.prototype.setSigningAuthorization=function(e){if(e){this.api.defaults.headers.common.signer="Bearer ".concat(e)}else{delete this.api.defaults.headers.common.signer}return this};e.prototype.setBaseURL=function(e){this.api.defaults.baseURL=e;return this};e.prototype.logRequests=function(e){if(e&&this.requestLoggerId===null){this.requestLoggerId=this.api.interceptors.request.use(requestLogger)}else if(!e&&this.requestLoggerId!==null){this.api.interceptors.request.eject(this.requestLoggerId)}return this};return e}();var naiveFallback=function(){if(typeof self==="object"&&self)return self;if(typeof window==="object"&&window)return window;throw new Error("Unable to resolve global `this`")};var globalThis_1=function(){if(this)return this;if(typeof globalThis==="object"&&globalThis)return globalThis;try{Object.defineProperty(Object.prototype,"__global__",{get:function(){return this},configurable:true})}catch(e){return naiveFallback()}try{if(!__global__)return naiveFallback();return __global__}finally{delete Object.prototype.__global__}}();var ENDPOINT_KEY=Symbol.for("verdocs-api-endpoint");if(!globalThis_1[ENDPOINT_KEY]){globalThis_1[ENDPOINT_KEY]=new VerdocsEndpoint}var globalEndpoint=globalThis_1[ENDPOINT_KEY];var activeEndpoint=globalEndpoint;var getEndpoint=function(){return activeEndpoint};var setActiveEndpoint=function(e){activeEndpoint=e||globalEndpoint};var b64="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";var b64re=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/;var AtoB=function(e){e=String(e).replace(/[\t\n\f\r ]+/g,"");if(!b64re.test(e))throw new TypeError("Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded.");e+="==".slice(2-(e.length&3));var t;var r="";var n;var i;var o=0;for(;o<e.length;){t=b64.indexOf(e.charAt(o++))<<18|b64.indexOf(e.charAt(o++))<<12|(n=b64.indexOf(e.charAt(o++)))<<6|(i=b64.indexOf(e.charAt(o++)));r+=n===64?String.fromCharCode(t>>16&255):i===64?String.fromCharCode(t>>16&255,t>>8&255):String.fromCharCode(t>>16&255,t>>8&255,t&255)}return r};var decodeTokenBody=function(e){return JSON.parse(AtoB((e||"").split(".")[1]||""))};var decodeAccessTokenBody=function(e){var t;try{t=decodeTokenBody(e);if(t===null){return null}}catch(e){return null}Object.keys(t).forEach((function(e){if(typeof e==="string"&&e.startsWith("https://verdocs.com/")){t[e.replace("https://verdocs.com/","")]=t[e];delete t[e]}}));return t};export{VerdocsEndpoint as V,decodeAccessTokenBody as d,getEndpoint as g,setActiveEndpoint as s};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
var commonjsGlobal=typeof globalThis!=="undefined"?globalThis:typeof window!=="undefined"?window:typeof global!=="undefined"?global:typeof self!=="undefined"?self:{};function getDefaultExportFromCjs(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e["default"]:e}function createCommonjsModule(e,r,t){return t={path:r,exports:{},require:function(e,r){return commonjsRequire()}},e(t,t.exports),t.exports}function getAugmentedNamespace(e){if(e.__esModule)return e;var r=Object.defineProperty({},"__esModule",{value:true});Object.keys(e).forEach((function(t){var n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:true,get:function(){return e[t]}})}));return r}function commonjsRequire(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}var process_1=commonjsGlobal.process;var global$1=typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{};var lookup=[];var revLookup=[];var Arr=typeof Uint8Array!=="undefined"?Uint8Array:Array;var inited=false;function init(){inited=true;var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var r=0,t=e.length;r<t;++r){lookup[r]=e[r];revLookup[e.charCodeAt(r)]=r}revLookup["-".charCodeAt(0)]=62;revLookup["_".charCodeAt(0)]=63}function toByteArray(e){if(!inited){init()}var r,t,n,f,i,o;var u=e.length;if(u%4>0){throw new Error("Invalid string. Length must be a multiple of 4")}i=e[u-2]==="="?2:e[u-1]==="="?1:0;o=new Arr(u*3/4-i);n=i>0?u-4:u;var a=0;for(r=0,t=0;r<n;r+=4,t+=3){f=revLookup[e.charCodeAt(r)]<<18|revLookup[e.charCodeAt(r+1)]<<12|revLookup[e.charCodeAt(r+2)]<<6|revLookup[e.charCodeAt(r+3)];o[a++]=f>>16&255;o[a++]=f>>8&255;o[a++]=f&255}if(i===2){f=revLookup[e.charCodeAt(r)]<<2|revLookup[e.charCodeAt(r+1)]>>4;o[a++]=f&255}else if(i===1){f=revLookup[e.charCodeAt(r)]<<10|revLookup[e.charCodeAt(r+1)]<<4|revLookup[e.charCodeAt(r+2)]>>2;o[a++]=f>>8&255;o[a++]=f&255}return o}function tripletToBase64(e){return lookup[e>>18&63]+lookup[e>>12&63]+lookup[e>>6&63]+lookup[e&63]}function encodeChunk(e,r,t){var n;var f=[];for(var i=r;i<t;i+=3){n=(e[i]<<16)+(e[i+1]<<8)+e[i+2];f.push(tripletToBase64(n))}return f.join("")}function fromByteArray(e){if(!inited){init()}var r;var t=e.length;var n=t%3;var f="";var i=[];var o=16383;for(var u=0,a=t-n;u<a;u+=o){i.push(encodeChunk(e,u,u+o>a?a:u+o))}if(n===1){r=e[t-1];f+=lookup[r>>2];f+=lookup[r<<4&63];f+="=="}else if(n===2){r=(e[t-2]<<8)+e[t-1];f+=lookup[r>>10];f+=lookup[r>>4&63];f+=lookup[r<<2&63];f+="="}i.push(f);return i.join("")}function read(e,r,t,n,f){var i,o;var u=f*8-n-1;var a=(1<<u)-1;var s=a>>1;var h=-7;var c=t?f-1:0;var l=t?-1:1;var p=e[r+c];c+=l;i=p&(1<<-h)-1;p>>=-h;h+=u;for(;h>0;i=i*256+e[r+c],c+=l,h-=8){}o=i&(1<<-h)-1;i>>=-h;h+=n;for(;h>0;o=o*256+e[r+c],c+=l,h-=8){}if(i===0){i=1-s}else if(i===a){return o?NaN:(p?-1:1)*Infinity}else{o=o+Math.pow(2,n);i=i-s}return(p?-1:1)*o*Math.pow(2,i-n)}function write(e,r,t,n,f,i){var o,u,a;var s=i*8-f-1;var h=(1<<s)-1;var c=h>>1;var l=f===23?Math.pow(2,-24)-Math.pow(2,-77):0;var p=n?0:i-1;var g=n?1:-1;var y=r<0||r===0&&1/r<0?1:0;r=Math.abs(r);if(isNaN(r)||r===Infinity){u=isNaN(r)?1:0;o=h}else{o=Math.floor(Math.log(r)/Math.LN2);if(r*(a=Math.pow(2,-o))<1){o--;a*=2}if(o+c>=1){r+=l/a}else{r+=l*Math.pow(2,1-c)}if(r*a>=2){o++;a/=2}if(o+c>=h){u=0;o=h}else if(o+c>=1){u=(r*a-1)*Math.pow(2,f);o=o+c}else{u=r*Math.pow(2,c-1)*Math.pow(2,f);o=0}}for(;f>=8;e[t+p]=u&255,p+=g,u/=256,f-=8){}o=o<<f|u;s+=f;for(;s>0;e[t+p]=o&255,p+=g,o/=256,s-=8){}e[t+p-g]|=y*128}var toString={}.toString;var isArray=Array.isArray||function(e){return toString.call(e)=="[object Array]"};
|
|
2
|
-
/*!
|
|
3
|
-
* The buffer module from node.js, for the browser.
|
|
4
|
-
*
|
|
5
|
-
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
|
|
6
|
-
* @license MIT
|
|
7
|
-
*/var INSPECT_MAX_BYTES=50;Buffer.TYPED_ARRAY_SUPPORT=global$1.TYPED_ARRAY_SUPPORT!==undefined?global$1.TYPED_ARRAY_SUPPORT:true;function kMaxLength(){return Buffer.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function createBuffer(e,r){if(kMaxLength()<r){throw new RangeError("Invalid typed array length")}if(Buffer.TYPED_ARRAY_SUPPORT){e=new Uint8Array(r);e.__proto__=Buffer.prototype}else{if(e===null){e=new Buffer(r)}e.length=r}return e}function Buffer(e,r,t){if(!Buffer.TYPED_ARRAY_SUPPORT&&!(this instanceof Buffer)){return new Buffer(e,r,t)}if(typeof e==="number"){if(typeof r==="string"){throw new Error("If encoding is specified then the first argument must be a string")}return allocUnsafe(this,e)}return from(this,e,r,t)}Buffer.poolSize=8192;Buffer._augment=function(e){e.__proto__=Buffer.prototype;return e};function from(e,r,t,n){if(typeof r==="number"){throw new TypeError('"value" argument must not be a number')}if(typeof ArrayBuffer!=="undefined"&&r instanceof ArrayBuffer){return fromArrayBuffer(e,r,t,n)}if(typeof r==="string"){return fromString(e,r,t)}return fromObject(e,r)}Buffer.from=function(e,r,t){return from(null,e,r,t)};if(Buffer.TYPED_ARRAY_SUPPORT){Buffer.prototype.__proto__=Uint8Array.prototype;Buffer.__proto__=Uint8Array}function assertSize(e){if(typeof e!=="number"){throw new TypeError('"size" argument must be a number')}else if(e<0){throw new RangeError('"size" argument must not be negative')}}function alloc(e,r,t,n){assertSize(r);if(r<=0){return createBuffer(e,r)}if(t!==undefined){return typeof n==="string"?createBuffer(e,r).fill(t,n):createBuffer(e,r).fill(t)}return createBuffer(e,r)}Buffer.alloc=function(e,r,t){return alloc(null,e,r,t)};function allocUnsafe(e,r){assertSize(r);e=createBuffer(e,r<0?0:checked(r)|0);if(!Buffer.TYPED_ARRAY_SUPPORT){for(var t=0;t<r;++t){e[t]=0}}return e}Buffer.allocUnsafe=function(e){return allocUnsafe(null,e)};Buffer.allocUnsafeSlow=function(e){return allocUnsafe(null,e)};function fromString(e,r,t){if(typeof t!=="string"||t===""){t="utf8"}if(!Buffer.isEncoding(t)){throw new TypeError('"encoding" must be a valid string encoding')}var n=byteLength(r,t)|0;e=createBuffer(e,n);var f=e.write(r,t);if(f!==n){e=e.slice(0,f)}return e}function fromArrayLike(e,r){var t=r.length<0?0:checked(r.length)|0;e=createBuffer(e,t);for(var n=0;n<t;n+=1){e[n]=r[n]&255}return e}function fromArrayBuffer(e,r,t,n){if(t<0||r.byteLength<t){throw new RangeError("'offset' is out of bounds")}if(r.byteLength<t+(n||0)){throw new RangeError("'length' is out of bounds")}if(t===undefined&&n===undefined){r=new Uint8Array(r)}else if(n===undefined){r=new Uint8Array(r,t)}else{r=new Uint8Array(r,t,n)}if(Buffer.TYPED_ARRAY_SUPPORT){e=r;e.__proto__=Buffer.prototype}else{e=fromArrayLike(e,r)}return e}function fromObject(e,r){if(internalIsBuffer(r)){var t=checked(r.length)|0;e=createBuffer(e,t);if(e.length===0){return e}r.copy(e,0,0,t);return e}if(r){if(typeof ArrayBuffer!=="undefined"&&r.buffer instanceof ArrayBuffer||"length"in r){if(typeof r.length!=="number"||isnan(r.length)){return createBuffer(e,0)}return fromArrayLike(e,r)}if(r.type==="Buffer"&&isArray(r.data)){return fromArrayLike(e,r.data)}}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function checked(e){if(e>=kMaxLength()){throw new RangeError("Attempt to allocate Buffer larger than maximum "+"size: 0x"+kMaxLength().toString(16)+" bytes")}return e|0}Buffer.isBuffer=isBuffer;function internalIsBuffer(e){return!!(e!=null&&e._isBuffer)}Buffer.compare=function e(r,t){if(!internalIsBuffer(r)||!internalIsBuffer(t)){throw new TypeError("Arguments must be Buffers")}if(r===t)return 0;var n=r.length;var f=t.length;for(var i=0,o=Math.min(n,f);i<o;++i){if(r[i]!==t[i]){n=r[i];f=t[i];break}}if(n<f)return-1;if(f<n)return 1;return 0};Buffer.isEncoding=function e(r){switch(String(r).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return true;default:return false}};Buffer.concat=function e(r,t){if(!isArray(r)){throw new TypeError('"list" argument must be an Array of Buffers')}if(r.length===0){return Buffer.alloc(0)}var n;if(t===undefined){t=0;for(n=0;n<r.length;++n){t+=r[n].length}}var f=Buffer.allocUnsafe(t);var i=0;for(n=0;n<r.length;++n){var o=r[n];if(!internalIsBuffer(o)){throw new TypeError('"list" argument must be an Array of Buffers')}o.copy(f,i);i+=o.length}return f};function byteLength(e,r){if(internalIsBuffer(e)){return e.length}if(typeof ArrayBuffer!=="undefined"&&typeof ArrayBuffer.isView==="function"&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer)){return e.byteLength}if(typeof e!=="string"){e=""+e}var t=e.length;if(t===0)return 0;var n=false;for(;;){switch(r){case"ascii":case"latin1":case"binary":return t;case"utf8":case"utf-8":case undefined:return utf8ToBytes(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return t*2;case"hex":return t>>>1;case"base64":return base64ToBytes(e).length;default:if(n)return utf8ToBytes(e).length;r=(""+r).toLowerCase();n=true}}}Buffer.byteLength=byteLength;function slowToString(e,r,t){var n=false;if(r===undefined||r<0){r=0}if(r>this.length){return""}if(t===undefined||t>this.length){t=this.length}if(t<=0){return""}t>>>=0;r>>>=0;if(t<=r){return""}if(!e)e="utf8";while(true){switch(e){case"hex":return hexSlice(this,r,t);case"utf8":case"utf-8":return utf8Slice(this,r,t);case"ascii":return asciiSlice(this,r,t);case"latin1":case"binary":return latin1Slice(this,r,t);case"base64":return base64Slice(this,r,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return utf16leSlice(this,r,t);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase();n=true}}}Buffer.prototype._isBuffer=true;function swap(e,r,t){var n=e[r];e[r]=e[t];e[t]=n}Buffer.prototype.swap16=function e(){var r=this.length;if(r%2!==0){throw new RangeError("Buffer size must be a multiple of 16-bits")}for(var t=0;t<r;t+=2){swap(this,t,t+1)}return this};Buffer.prototype.swap32=function e(){var r=this.length;if(r%4!==0){throw new RangeError("Buffer size must be a multiple of 32-bits")}for(var t=0;t<r;t+=4){swap(this,t,t+3);swap(this,t+1,t+2)}return this};Buffer.prototype.swap64=function e(){var r=this.length;if(r%8!==0){throw new RangeError("Buffer size must be a multiple of 64-bits")}for(var t=0;t<r;t+=8){swap(this,t,t+7);swap(this,t+1,t+6);swap(this,t+2,t+5);swap(this,t+3,t+4)}return this};Buffer.prototype.toString=function e(){var r=this.length|0;if(r===0)return"";if(arguments.length===0)return utf8Slice(this,0,r);return slowToString.apply(this,arguments)};Buffer.prototype.equals=function e(r){if(!internalIsBuffer(r))throw new TypeError("Argument must be a Buffer");if(this===r)return true;return Buffer.compare(this,r)===0};Buffer.prototype.inspect=function e(){var r="";var t=INSPECT_MAX_BYTES;if(this.length>0){r=this.toString("hex",0,t).match(/.{2}/g).join(" ");if(this.length>t)r+=" ... "}return"<Buffer "+r+">"};Buffer.prototype.compare=function e(r,t,n,f,i){if(!internalIsBuffer(r)){throw new TypeError("Argument must be a Buffer")}if(t===undefined){t=0}if(n===undefined){n=r?r.length:0}if(f===undefined){f=0}if(i===undefined){i=this.length}if(t<0||n>r.length||f<0||i>this.length){throw new RangeError("out of range index")}if(f>=i&&t>=n){return 0}if(f>=i){return-1}if(t>=n){return 1}t>>>=0;n>>>=0;f>>>=0;i>>>=0;if(this===r)return 0;var o=i-f;var u=n-t;var a=Math.min(o,u);var s=this.slice(f,i);var h=r.slice(t,n);for(var c=0;c<a;++c){if(s[c]!==h[c]){o=s[c];u=h[c];break}}if(o<u)return-1;if(u<o)return 1;return 0};function bidirectionalIndexOf(e,r,t,n,f){if(e.length===0)return-1;if(typeof t==="string"){n=t;t=0}else if(t>2147483647){t=2147483647}else if(t<-2147483648){t=-2147483648}t=+t;if(isNaN(t)){t=f?0:e.length-1}if(t<0)t=e.length+t;if(t>=e.length){if(f)return-1;else t=e.length-1}else if(t<0){if(f)t=0;else return-1}if(typeof r==="string"){r=Buffer.from(r,n)}if(internalIsBuffer(r)){if(r.length===0){return-1}return arrayIndexOf(e,r,t,n,f)}else if(typeof r==="number"){r=r&255;if(Buffer.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf==="function"){if(f){return Uint8Array.prototype.indexOf.call(e,r,t)}else{return Uint8Array.prototype.lastIndexOf.call(e,r,t)}}return arrayIndexOf(e,[r],t,n,f)}throw new TypeError("val must be string, number or Buffer")}function arrayIndexOf(e,r,t,n,f){var i=1;var o=e.length;var u=r.length;if(n!==undefined){n=String(n).toLowerCase();if(n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le"){if(e.length<2||r.length<2){return-1}i=2;o/=2;u/=2;t/=2}}function a(e,r){if(i===1){return e[r]}else{return e.readUInt16BE(r*i)}}var s;if(f){var h=-1;for(s=t;s<o;s++){if(a(e,s)===a(r,h===-1?0:s-h)){if(h===-1)h=s;if(s-h+1===u)return h*i}else{if(h!==-1)s-=s-h;h=-1}}}else{if(t+u>o)t=o-u;for(s=t;s>=0;s--){var c=true;for(var l=0;l<u;l++){if(a(e,s+l)!==a(r,l)){c=false;break}}if(c)return s}}return-1}Buffer.prototype.includes=function e(r,t,n){return this.indexOf(r,t,n)!==-1};Buffer.prototype.indexOf=function e(r,t,n){return bidirectionalIndexOf(this,r,t,n,true)};Buffer.prototype.lastIndexOf=function e(r,t,n){return bidirectionalIndexOf(this,r,t,n,false)};function hexWrite(e,r,t,n){t=Number(t)||0;var f=e.length-t;if(!n){n=f}else{n=Number(n);if(n>f){n=f}}var i=r.length;if(i%2!==0)throw new TypeError("Invalid hex string");if(n>i/2){n=i/2}for(var o=0;o<n;++o){var u=parseInt(r.substr(o*2,2),16);if(isNaN(u))return o;e[t+o]=u}return o}function utf8Write(e,r,t,n){return blitBuffer(utf8ToBytes(r,e.length-t),e,t,n)}function asciiWrite(e,r,t,n){return blitBuffer(asciiToBytes(r),e,t,n)}function latin1Write(e,r,t,n){return asciiWrite(e,r,t,n)}function base64Write(e,r,t,n){return blitBuffer(base64ToBytes(r),e,t,n)}function ucs2Write(e,r,t,n){return blitBuffer(utf16leToBytes(r,e.length-t),e,t,n)}Buffer.prototype.write=function e(r,t,n,f){if(t===undefined){f="utf8";n=this.length;t=0}else if(n===undefined&&typeof t==="string"){f=t;n=this.length;t=0}else if(isFinite(t)){t=t|0;if(isFinite(n)){n=n|0;if(f===undefined)f="utf8"}else{f=n;n=undefined}}else{throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported")}var i=this.length-t;if(n===undefined||n>i)n=i;if(r.length>0&&(n<0||t<0)||t>this.length){throw new RangeError("Attempt to write outside buffer bounds")}if(!f)f="utf8";var o=false;for(;;){switch(f){case"hex":return hexWrite(this,r,t,n);case"utf8":case"utf-8":return utf8Write(this,r,t,n);case"ascii":return asciiWrite(this,r,t,n);case"latin1":case"binary":return latin1Write(this,r,t,n);case"base64":return base64Write(this,r,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ucs2Write(this,r,t,n);default:if(o)throw new TypeError("Unknown encoding: "+f);f=(""+f).toLowerCase();o=true}}};Buffer.prototype.toJSON=function e(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function base64Slice(e,r,t){if(r===0&&t===e.length){return fromByteArray(e)}else{return fromByteArray(e.slice(r,t))}}function utf8Slice(e,r,t){t=Math.min(e.length,t);var n=[];var f=r;while(f<t){var i=e[f];var o=null;var u=i>239?4:i>223?3:i>191?2:1;if(f+u<=t){var a,s,h,c;switch(u){case 1:if(i<128){o=i}break;case 2:a=e[f+1];if((a&192)===128){c=(i&31)<<6|a&63;if(c>127){o=c}}break;case 3:a=e[f+1];s=e[f+2];if((a&192)===128&&(s&192)===128){c=(i&15)<<12|(a&63)<<6|s&63;if(c>2047&&(c<55296||c>57343)){o=c}}break;case 4:a=e[f+1];s=e[f+2];h=e[f+3];if((a&192)===128&&(s&192)===128&&(h&192)===128){c=(i&15)<<18|(a&63)<<12|(s&63)<<6|h&63;if(c>65535&&c<1114112){o=c}}}}if(o===null){o=65533;u=1}else if(o>65535){o-=65536;n.push(o>>>10&1023|55296);o=56320|o&1023}n.push(o);f+=u}return decodeCodePointsArray(n)}var MAX_ARGUMENTS_LENGTH=4096;function decodeCodePointsArray(e){var r=e.length;if(r<=MAX_ARGUMENTS_LENGTH){return String.fromCharCode.apply(String,e)}var t="";var n=0;while(n<r){t+=String.fromCharCode.apply(String,e.slice(n,n+=MAX_ARGUMENTS_LENGTH))}return t}function asciiSlice(e,r,t){var n="";t=Math.min(e.length,t);for(var f=r;f<t;++f){n+=String.fromCharCode(e[f]&127)}return n}function latin1Slice(e,r,t){var n="";t=Math.min(e.length,t);for(var f=r;f<t;++f){n+=String.fromCharCode(e[f])}return n}function hexSlice(e,r,t){var n=e.length;if(!r||r<0)r=0;if(!t||t<0||t>n)t=n;var f="";for(var i=r;i<t;++i){f+=toHex(e[i])}return f}function utf16leSlice(e,r,t){var n=e.slice(r,t);var f="";for(var i=0;i<n.length;i+=2){f+=String.fromCharCode(n[i]+n[i+1]*256)}return f}Buffer.prototype.slice=function e(r,t){var n=this.length;r=~~r;t=t===undefined?n:~~t;if(r<0){r+=n;if(r<0)r=0}else if(r>n){r=n}if(t<0){t+=n;if(t<0)t=0}else if(t>n){t=n}if(t<r)t=r;var f;if(Buffer.TYPED_ARRAY_SUPPORT){f=this.subarray(r,t);f.__proto__=Buffer.prototype}else{var i=t-r;f=new Buffer(i,undefined);for(var o=0;o<i;++o){f[o]=this[o+r]}}return f};function checkOffset(e,r,t){if(e%1!==0||e<0)throw new RangeError("offset is not uint");if(e+r>t)throw new RangeError("Trying to access beyond buffer length")}Buffer.prototype.readUIntLE=function e(r,t,n){r=r|0;t=t|0;if(!n)checkOffset(r,t,this.length);var f=this[r];var i=1;var o=0;while(++o<t&&(i*=256)){f+=this[r+o]*i}return f};Buffer.prototype.readUIntBE=function e(r,t,n){r=r|0;t=t|0;if(!n){checkOffset(r,t,this.length)}var f=this[r+--t];var i=1;while(t>0&&(i*=256)){f+=this[r+--t]*i}return f};Buffer.prototype.readUInt8=function e(r,t){if(!t)checkOffset(r,1,this.length);return this[r]};Buffer.prototype.readUInt16LE=function e(r,t){if(!t)checkOffset(r,2,this.length);return this[r]|this[r+1]<<8};Buffer.prototype.readUInt16BE=function e(r,t){if(!t)checkOffset(r,2,this.length);return this[r]<<8|this[r+1]};Buffer.prototype.readUInt32LE=function e(r,t){if(!t)checkOffset(r,4,this.length);return(this[r]|this[r+1]<<8|this[r+2]<<16)+this[r+3]*16777216};Buffer.prototype.readUInt32BE=function e(r,t){if(!t)checkOffset(r,4,this.length);return this[r]*16777216+(this[r+1]<<16|this[r+2]<<8|this[r+3])};Buffer.prototype.readIntLE=function e(r,t,n){r=r|0;t=t|0;if(!n)checkOffset(r,t,this.length);var f=this[r];var i=1;var o=0;while(++o<t&&(i*=256)){f+=this[r+o]*i}i*=128;if(f>=i)f-=Math.pow(2,8*t);return f};Buffer.prototype.readIntBE=function e(r,t,n){r=r|0;t=t|0;if(!n)checkOffset(r,t,this.length);var f=t;var i=1;var o=this[r+--f];while(f>0&&(i*=256)){o+=this[r+--f]*i}i*=128;if(o>=i)o-=Math.pow(2,8*t);return o};Buffer.prototype.readInt8=function e(r,t){if(!t)checkOffset(r,1,this.length);if(!(this[r]&128))return this[r];return(255-this[r]+1)*-1};Buffer.prototype.readInt16LE=function e(r,t){if(!t)checkOffset(r,2,this.length);var n=this[r]|this[r+1]<<8;return n&32768?n|4294901760:n};Buffer.prototype.readInt16BE=function e(r,t){if(!t)checkOffset(r,2,this.length);var n=this[r+1]|this[r]<<8;return n&32768?n|4294901760:n};Buffer.prototype.readInt32LE=function e(r,t){if(!t)checkOffset(r,4,this.length);return this[r]|this[r+1]<<8|this[r+2]<<16|this[r+3]<<24};Buffer.prototype.readInt32BE=function e(r,t){if(!t)checkOffset(r,4,this.length);return this[r]<<24|this[r+1]<<16|this[r+2]<<8|this[r+3]};Buffer.prototype.readFloatLE=function e(r,t){if(!t)checkOffset(r,4,this.length);return read(this,r,true,23,4)};Buffer.prototype.readFloatBE=function e(r,t){if(!t)checkOffset(r,4,this.length);return read(this,r,false,23,4)};Buffer.prototype.readDoubleLE=function e(r,t){if(!t)checkOffset(r,8,this.length);return read(this,r,true,52,8)};Buffer.prototype.readDoubleBE=function e(r,t){if(!t)checkOffset(r,8,this.length);return read(this,r,false,52,8)};function checkInt(e,r,t,n,f,i){if(!internalIsBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>f||r<i)throw new RangeError('"value" argument is out of bounds');if(t+n>e.length)throw new RangeError("Index out of range")}Buffer.prototype.writeUIntLE=function e(r,t,n,f){r=+r;t=t|0;n=n|0;if(!f){var i=Math.pow(2,8*n)-1;checkInt(this,r,t,n,i,0)}var o=1;var u=0;this[t]=r&255;while(++u<n&&(o*=256)){this[t+u]=r/o&255}return t+n};Buffer.prototype.writeUIntBE=function e(r,t,n,f){r=+r;t=t|0;n=n|0;if(!f){var i=Math.pow(2,8*n)-1;checkInt(this,r,t,n,i,0)}var o=n-1;var u=1;this[t+o]=r&255;while(--o>=0&&(u*=256)){this[t+o]=r/u&255}return t+n};Buffer.prototype.writeUInt8=function e(r,t,n){r=+r;t=t|0;if(!n)checkInt(this,r,t,1,255,0);if(!Buffer.TYPED_ARRAY_SUPPORT)r=Math.floor(r);this[t]=r&255;return t+1};function objectWriteUInt16(e,r,t,n){if(r<0)r=65535+r+1;for(var f=0,i=Math.min(e.length-t,2);f<i;++f){e[t+f]=(r&255<<8*(n?f:1-f))>>>(n?f:1-f)*8}}Buffer.prototype.writeUInt16LE=function e(r,t,n){r=+r;t=t|0;if(!n)checkInt(this,r,t,2,65535,0);if(Buffer.TYPED_ARRAY_SUPPORT){this[t]=r&255;this[t+1]=r>>>8}else{objectWriteUInt16(this,r,t,true)}return t+2};Buffer.prototype.writeUInt16BE=function e(r,t,n){r=+r;t=t|0;if(!n)checkInt(this,r,t,2,65535,0);if(Buffer.TYPED_ARRAY_SUPPORT){this[t]=r>>>8;this[t+1]=r&255}else{objectWriteUInt16(this,r,t,false)}return t+2};function objectWriteUInt32(e,r,t,n){if(r<0)r=4294967295+r+1;for(var f=0,i=Math.min(e.length-t,4);f<i;++f){e[t+f]=r>>>(n?f:3-f)*8&255}}Buffer.prototype.writeUInt32LE=function e(r,t,n){r=+r;t=t|0;if(!n)checkInt(this,r,t,4,4294967295,0);if(Buffer.TYPED_ARRAY_SUPPORT){this[t+3]=r>>>24;this[t+2]=r>>>16;this[t+1]=r>>>8;this[t]=r&255}else{objectWriteUInt32(this,r,t,true)}return t+4};Buffer.prototype.writeUInt32BE=function e(r,t,n){r=+r;t=t|0;if(!n)checkInt(this,r,t,4,4294967295,0);if(Buffer.TYPED_ARRAY_SUPPORT){this[t]=r>>>24;this[t+1]=r>>>16;this[t+2]=r>>>8;this[t+3]=r&255}else{objectWriteUInt32(this,r,t,false)}return t+4};Buffer.prototype.writeIntLE=function e(r,t,n,f){r=+r;t=t|0;if(!f){var i=Math.pow(2,8*n-1);checkInt(this,r,t,n,i-1,-i)}var o=0;var u=1;var a=0;this[t]=r&255;while(++o<n&&(u*=256)){if(r<0&&a===0&&this[t+o-1]!==0){a=1}this[t+o]=(r/u>>0)-a&255}return t+n};Buffer.prototype.writeIntBE=function e(r,t,n,f){r=+r;t=t|0;if(!f){var i=Math.pow(2,8*n-1);checkInt(this,r,t,n,i-1,-i)}var o=n-1;var u=1;var a=0;this[t+o]=r&255;while(--o>=0&&(u*=256)){if(r<0&&a===0&&this[t+o+1]!==0){a=1}this[t+o]=(r/u>>0)-a&255}return t+n};Buffer.prototype.writeInt8=function e(r,t,n){r=+r;t=t|0;if(!n)checkInt(this,r,t,1,127,-128);if(!Buffer.TYPED_ARRAY_SUPPORT)r=Math.floor(r);if(r<0)r=255+r+1;this[t]=r&255;return t+1};Buffer.prototype.writeInt16LE=function e(r,t,n){r=+r;t=t|0;if(!n)checkInt(this,r,t,2,32767,-32768);if(Buffer.TYPED_ARRAY_SUPPORT){this[t]=r&255;this[t+1]=r>>>8}else{objectWriteUInt16(this,r,t,true)}return t+2};Buffer.prototype.writeInt16BE=function e(r,t,n){r=+r;t=t|0;if(!n)checkInt(this,r,t,2,32767,-32768);if(Buffer.TYPED_ARRAY_SUPPORT){this[t]=r>>>8;this[t+1]=r&255}else{objectWriteUInt16(this,r,t,false)}return t+2};Buffer.prototype.writeInt32LE=function e(r,t,n){r=+r;t=t|0;if(!n)checkInt(this,r,t,4,2147483647,-2147483648);if(Buffer.TYPED_ARRAY_SUPPORT){this[t]=r&255;this[t+1]=r>>>8;this[t+2]=r>>>16;this[t+3]=r>>>24}else{objectWriteUInt32(this,r,t,true)}return t+4};Buffer.prototype.writeInt32BE=function e(r,t,n){r=+r;t=t|0;if(!n)checkInt(this,r,t,4,2147483647,-2147483648);if(r<0)r=4294967295+r+1;if(Buffer.TYPED_ARRAY_SUPPORT){this[t]=r>>>24;this[t+1]=r>>>16;this[t+2]=r>>>8;this[t+3]=r&255}else{objectWriteUInt32(this,r,t,false)}return t+4};function checkIEEE754(e,r,t,n,f,i){if(t+n>e.length)throw new RangeError("Index out of range");if(t<0)throw new RangeError("Index out of range")}function writeFloat(e,r,t,n,f){if(!f){checkIEEE754(e,r,t,4)}write(e,r,t,n,23,4);return t+4}Buffer.prototype.writeFloatLE=function e(r,t,n){return writeFloat(this,r,t,true,n)};Buffer.prototype.writeFloatBE=function e(r,t,n){return writeFloat(this,r,t,false,n)};function writeDouble(e,r,t,n,f){if(!f){checkIEEE754(e,r,t,8)}write(e,r,t,n,52,8);return t+8}Buffer.prototype.writeDoubleLE=function e(r,t,n){return writeDouble(this,r,t,true,n)};Buffer.prototype.writeDoubleBE=function e(r,t,n){return writeDouble(this,r,t,false,n)};Buffer.prototype.copy=function e(r,t,n,f){if(!n)n=0;if(!f&&f!==0)f=this.length;if(t>=r.length)t=r.length;if(!t)t=0;if(f>0&&f<n)f=n;if(f===n)return 0;if(r.length===0||this.length===0)return 0;if(t<0){throw new RangeError("targetStart out of bounds")}if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(f<0)throw new RangeError("sourceEnd out of bounds");if(f>this.length)f=this.length;if(r.length-t<f-n){f=r.length-t+n}var i=f-n;var o;if(this===r&&n<t&&t<f){for(o=i-1;o>=0;--o){r[o+t]=this[o+n]}}else if(i<1e3||!Buffer.TYPED_ARRAY_SUPPORT){for(o=0;o<i;++o){r[o+t]=this[o+n]}}else{Uint8Array.prototype.set.call(r,this.subarray(n,n+i),t)}return i};Buffer.prototype.fill=function e(r,t,n,f){if(typeof r==="string"){if(typeof t==="string"){f=t;t=0;n=this.length}else if(typeof n==="string"){f=n;n=this.length}if(r.length===1){var i=r.charCodeAt(0);if(i<256){r=i}}if(f!==undefined&&typeof f!=="string"){throw new TypeError("encoding must be a string")}if(typeof f==="string"&&!Buffer.isEncoding(f)){throw new TypeError("Unknown encoding: "+f)}}else if(typeof r==="number"){r=r&255}if(t<0||this.length<t||this.length<n){throw new RangeError("Out of range index")}if(n<=t){return this}t=t>>>0;n=n===undefined?this.length:n>>>0;if(!r)r=0;var o;if(typeof r==="number"){for(o=t;o<n;++o){this[o]=r}}else{var u=internalIsBuffer(r)?r:utf8ToBytes(new Buffer(r,f).toString());var a=u.length;for(o=0;o<n-t;++o){this[o+t]=u[o%a]}}return this};var INVALID_BASE64_RE=/[^+\/0-9A-Za-z-_]/g;function base64clean(e){e=stringtrim(e).replace(INVALID_BASE64_RE,"");if(e.length<2)return"";while(e.length%4!==0){e=e+"="}return e}function stringtrim(e){if(e.trim)return e.trim();return e.replace(/^\s+|\s+$/g,"")}function toHex(e){if(e<16)return"0"+e.toString(16);return e.toString(16)}function utf8ToBytes(e,r){r=r||Infinity;var t;var n=e.length;var f=null;var i=[];for(var o=0;o<n;++o){t=e.charCodeAt(o);if(t>55295&&t<57344){if(!f){if(t>56319){if((r-=3)>-1)i.push(239,191,189);continue}else if(o+1===n){if((r-=3)>-1)i.push(239,191,189);continue}f=t;continue}if(t<56320){if((r-=3)>-1)i.push(239,191,189);f=t;continue}t=(f-55296<<10|t-56320)+65536}else if(f){if((r-=3)>-1)i.push(239,191,189)}f=null;if(t<128){if((r-=1)<0)break;i.push(t)}else if(t<2048){if((r-=2)<0)break;i.push(t>>6|192,t&63|128)}else if(t<65536){if((r-=3)<0)break;i.push(t>>12|224,t>>6&63|128,t&63|128)}else if(t<1114112){if((r-=4)<0)break;i.push(t>>18|240,t>>12&63|128,t>>6&63|128,t&63|128)}else{throw new Error("Invalid code point")}}return i}function asciiToBytes(e){var r=[];for(var t=0;t<e.length;++t){r.push(e.charCodeAt(t)&255)}return r}function utf16leToBytes(e,r){var t,n,f;var i=[];for(var o=0;o<e.length;++o){if((r-=2)<0)break;t=e.charCodeAt(o);n=t>>8;f=t%256;i.push(f);i.push(n)}return i}function base64ToBytes(e){return toByteArray(base64clean(e))}function blitBuffer(e,r,t,n){for(var f=0;f<n;++f){if(f+t>=r.length||f>=e.length)break;r[f+t]=e[f]}return f}function isnan(e){return e!==e}function isBuffer(e){return e!=null&&(!!e._isBuffer||isFastBuffer(e)||isSlowBuffer(e))}function isFastBuffer(e){return!!e.constructor&&typeof e.constructor.isBuffer==="function"&&e.constructor.isBuffer(e)}function isSlowBuffer(e){return typeof e.readFloatLE==="function"&&typeof e.slice==="function"&&isFastBuffer(e.slice(0,0))}export{Buffer as B,getDefaultExportFromCjs as a,commonjsGlobal as b,createCommonjsModule as c,commonjsRequire as d,getAugmentedNamespace as g,process_1 as p};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e,c as t,h as i}from"./p-2bc58746.js";import{l as r}from"./p-3820c9a2.js";import{g as o}from"./p-6348272c.js";import"./p-ef932a87.js";var s=function(){return e=void 0,t=void 0,r=function(){return function(e,t){var i,r,o,s,n={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return s={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function c(s){return function(c){return function(s){if(i)throw new TypeError("Generator is already executing.");for(;n;)try{if(i=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return n.label++,{value:s[1],done:!1};case 5:n.label++,r=s[1],s=[0];continue;case 7:s=n.ops.pop(),n.trys.pop();continue;default:if(!((o=(o=n.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){n=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){n.label=s[1];break}if(6===s[0]&&n.label<o[1]){n.label=o[1],o=s;break}if(o&&n.label<o[2]){n.label=o[2],n.ops.push(s);break}o[2]&&n.ops.pop(),n.trys.pop();continue}s=t.call(e,n)}catch(e){s=[6,e],r=0}finally{i=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}}(this,(function(){return[2,o().api.get("/search/history").then((function(e){return e.data}))]}))},new((i=void 0)||(i=Promise))((function(o,s){function n(e){try{a(r.next(e))}catch(e){s(e)}}function c(e){try{a(r.throw(e))}catch(e){s(e)}}function a(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(n,c)}a((r=r.apply(e,t||[])).next())}));var e,t,i,r};const n='<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="#000000"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M8 16h8v2H8zm0-4h8v2H8zm6-10H6c-1.1 0-2 .9-2 2v16c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zm4 18H6V4h7v5h5v11z"/></svg>',c=class{constructor(i){e(this,i),this.entrySelected=t(this,"entrySelected",7),this.type="recent",this.emptyMessage="You do not have any starred searches.",this.authFailure=!1,this.title="Recent Searches",this.recent=[],this.saved=[],this.starred=[]}componentWillLoad(){r("verdocs-stage");const e=e=>{var t;console.warn("[Verdocs/search-activity] Error getting search data",e),401===(null===(t=null==e?void 0:e.response)||void 0===t?void 0:t.status)&&(this.authFailure=!0)};switch(this.type){case"recent":this.title="Recent Searches",this.emptyMessage="You do not have any recent searches.",s().then((e=>this.recent=e.recent)).catch(e);break;case"saved":this.title="Saved Searches",this.emptyMessage="You do not have any saved searches.",s().then((e=>this.saved=e.saved)).catch(e);break;case"starred":this.title="My Starred items",this.emptyMessage="You do not have any starred templates.",(t={is_starred:!0},o().api.get("/templates/",{params:t}).then((function(e){return e.data}))).then((e=>this.starred=e)).catch(e)}var t}handleSelectEntry(e){this.entrySelected.emit(e)}computePagesText(e){return e<2?`${e} Page`:`${e} Pages`}computeRecipientsText(e){return"object"==typeof e?e.join(", "):e>1?`${e} Recipients`:`${e} Recipient`}render(){const e=this.recent.length<1&&this.saved.length<1&&this.starred.length<1;return i("div",{class:"container"},i("p",{class:"title"},this.title),i("div",{class:"items"},this.recent.map((e=>i("button",{class:"item",onClick:()=>this.handleSelectEntry(e)},i("div",{class:"icon",innerHTML:n}),i("div",{class:"details"},i("div",{class:"item-title"},e.params.q),i("div",{class:"info"},"Test"))))),this.saved.map((e=>i("button",{class:"item",onClick:()=>this.handleSelectEntry(e)},i("div",{class:"icon",innerHTML:n}),i("div",{class:"details"},i("div",{class:"item-title"},e.params.q),i("div",{class:"info"}))))),e&&i("div",{class:"empty"},this.authFailure?"Authentication required":this.emptyMessage)))}};c.style='verdocs-search-activity{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-search-activity .container{display:-ms-flexbox;display:flex;width:240px;color:#ffffff;-ms-flex-direction:column;flex-direction:column;text-transform:uppercase;padding:10px 10px 20px 10px;background-color:var(--verdocs-background-dark)}verdocs-search-activity .title{font-size:22px;font-weight:700;line-height:30px}verdocs-search-activity .items{display:-ms-flexbox;display:flex;margin-top:20px;-ms-flex-direction:column;flex-direction:column}verdocs-search-activity .item{border:none;display:-ms-flexbox;display:flex;text-align:left;margin-bottom:20px;-ms-flex-direction:row;flex-direction:row;background:transparent}verdocs-search-activity .item:hover{cursor:pointer}verdocs-search-activity .icon{-ms-flex:0 0 22px;flex:0 0 22px;margin-right:14px}verdocs-search-activity .icon svg{fill:#707ae5;width:22px;height:22px}verdocs-search-activity .details{display:-ms-flexbox;display:flex;overflow:hidden;-ms-flex-direction:column;flex-direction:column}verdocs-search-activity .item-title{font-size:16px;font-weight:400;color:#ffffff;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}verdocs-search-activity .info{font-size:14px;font-weight:500;line-height:23px;color:#aeb4bf}verdocs-search-activity .empty{text-transform:none;line-height:22px;color:#ccc}';const a=class{constructor(i){e(this,i),this.searchClicked=t(this,"searchClicked",7),this.typeChanged=t(this,"typeChanged",7),this.queryChanged=t(this,"queryChanged",7),this.placeholder="search documents, templates, people...",this.type="all",this.query=""}handleSearch(e){return this.searchClicked.emit({type:this.type,query:this.query}),e.preventDefault(),!1}handleChange(e){this.queryChanged.emit(e.target.value)}handleClearFilter(){this.typeChanged.emit("all")}handleKeyUp(e){"Enter"===e.key&&this.searchClicked.emit({type:this.type,query:this.query})}render(){return i("form",{onSubmit:e=>this.handleSearch(e)},void 0!==this.type&&"all"!==this.type&&i("span",{class:"type"},this.type,"s ",i("button",{class:"remove",innerHTML:'<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M14.0739 11.7565L19.7127 6.23228C20.0875 5.85692 20.0875 5.25309 19.7127 4.87773L19.0213 4.20046C18.6382 3.82511 18.0219 3.82511 17.6387 4.20046L12 9.72472L6.36127 4.20046C5.97814 3.82511 5.36179 3.82511 4.97866 4.20046L4.28735 4.87773C3.90422 5.25309 3.90422 5.85692 4.28735 6.23228L9.92608 11.7565L4.28735 17.2808C3.90422 17.6561 3.90422 18.26 4.28735 18.6353L4.97866 19.3126C5.36179 19.688 5.97814 19.688 6.36127 19.3126L12 13.7883L17.6387 19.3126C18.0219 19.688 18.6382 19.688 19.0213 19.3126L19.7127 18.6353C20.0958 18.26 20.0958 17.6561 19.7127 17.2808L14.0739 11.7565Z" fill="white"/>\n</svg>\n',onClick:()=>this.handleClearFilter()})),i("input",{type:"text",placeholder:this.placeholder,value:this.query,onInput:e=>this.handleChange(e),onKeyUp:e=>this.handleKeyUp(e)}),i("button",{onClick:e=>this.handleSearch(e),class:"search"},i("span",{innerHTML:'<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M23.4809 20.7176L17.9111 15.2536C19.0961 13.6368 19.727 11.6926 19.7128 9.70131C19.7201 7.53345 18.9846 5.42606 17.6244 3.71753C16.2642 2.009 14.3581 0.798456 12.2123 0.280282C10.0665 -0.237892 7.80552 -0.0336342 5.79227 0.86026C3.77902 1.75415 2.13038 3.28582 1.1111 5.20931C0.0918114 7.1328 -0.238985 9.33652 0.171813 11.4666C0.582612 13.5967 1.71117 15.5296 3.37628 16.9548C5.0414 18.3801 7.14646 19.2151 9.35344 19.3257C11.5604 19.4364 13.7413 18.8162 15.5458 17.5649L21.1372 23.05L21.1563 23.0663C21.4841 23.3487 21.9039 23.507 22.3401 23.5128C22.7823 23.5125 23.2063 23.3402 23.5191 23.0337V23.0337C23.6749 22.8812 23.7979 22.6995 23.8804 22.4993C23.963 22.2991 24.0036 22.0847 23.9997 21.8688C23.9959 21.6529 23.9477 21.44 23.858 21.2428C23.7683 21.0456 23.639 20.8682 23.4778 20.7212L23.4809 20.7176ZM14.5167 14.1975C13.4564 15.2349 12.0623 15.8797 10.5719 16.022C9.08145 16.1644 7.58681 15.7955 6.34249 14.9781C5.09816 14.1608 4.18109 12.9456 3.74751 11.5395C3.31393 10.1334 3.39064 8.6233 3.96455 7.26643C4.53846 5.90955 5.57409 4.7898 6.89507 4.09787C8.21606 3.40594 9.74071 3.18461 11.2093 3.4716C12.678 3.75858 13.9998 4.53612 14.9497 5.6718C15.8996 6.80748 16.4188 8.23105 16.4189 9.7001C16.4196 10.5357 16.2519 11.3632 15.9254 12.135C15.599 12.9069 15.1202 13.6078 14.5167 14.1975V14.1975Z" fill="white"/>\n</svg>\n'}),"Search"))}};a.style='verdocs-search-box{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-search-box form{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;height:45px;-webkit-box-sizing:border-box;box-sizing:border-box;margin:5px 0 0;border-radius:5px;-ms-flex-align:center;align-items:center;background-color:#fff;padding:0 8px;border-width:1px;border-style:solid;border-color:var(--verdocs-container-border-color)}verdocs-search-box form input{-webkit-box-sizing:border-box;box-sizing:border-box;height:43px;width:100%;font-size:18px;border:none}verdocs-search-box form input:focus{outline:none}verdocs-search-box form button.search{cursor:pointer;display:-ms-inline-flexbox;display:inline-flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:4px;border:none;width:100px;height:28px;font-weight:700;font-size:10px;letter-spacing:1px;background-color:#50be80;text-transform:uppercase;color:#fff}verdocs-search-box form .type{background-color:#707ae5;height:30px;display:-ms-inline-flexbox;display:inline-flex;padding:1px 0 2px 10px;font-size:13px;line-height:16px;border-radius:4px;-ms-flex-pack:center;justify-content:center;text-transform:uppercase;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;color:#fff;margin-right:10px}verdocs-search-box form .type button{border:none;color:#fff;margin:5px 0 0 8px;background:transparent}verdocs-search-box form svg{width:12px;height:12px;margin-right:6px}verdocs-search-box ::-webkit-input-placeholder{color:#aeb4bf}verdocs-search-box ::-moz-placeholder{color:#aeb4bf}verdocs-search-box :-ms-input-placeholder{color:#aeb4bf}verdocs-search-box ::-ms-input-placeholder{color:#aeb4bf}verdocs-search-box ::placeholder{color:#aeb4bf}';export{c as verdocs_search_activity,a as verdocs_search_box}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e,h as t,H as o}from"./p-2bc58746.js";import{g as i,d as n,V as r,s}from"./p-6348272c.js";import{B as a}from"./p-ef932a87.js";function c(e){switch(e%10){case 0:return 0===e?"rgba(255, 193, 7, 0.4)":"rgba(134, 134, 134, 0.3)";case 1:return"rgba(156, 39, 176, .4)";case 2:return"rgba(33, 150, 243, .4)";case 3:return"rgba(220, 231, 117, 0.3)";case 4:return"rgba(121, 134, 203, 0.3)";case 5:return"rgba(77, 182, 172, 0.3)";case 6:return"rgba(255, 202, 165, 0.3)";case 7:return"rgba(2, 247, 190, 0.3)";case 8:return"rgba(255, 138, 101, 0.3)";case 9:return"rgba(82, 255, 79, 0.3)";default:return"rgba(229, 115, 155, 0.3)"}}function l(e,t){return e*t}var d=function(){return(d=Object.assign||function(e){for(var t,o=1,i=arguments.length;o<i;o++)for(var n in t=arguments[o])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}).apply(this,arguments)},u=new RegExp(/\+[1-9]\d{6,14}/g),h=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,p=function(e,t,o,i){return new(o||(o=Promise))((function(n,r){function s(e){try{c(i.next(e))}catch(e){r(e)}}function a(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?n(e.value):(t=e.value,t instanceof o?t:new o((function(e){e(t)}))).then(s,a)}c((i=i.apply(e,t||[])).next())}))},f=function(e,t){var o,i,n,r,s={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return r={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function a(r){return function(a){return function(r){if(o)throw new TypeError("Generator is already executing.");for(;s;)try{if(o=1,i&&(n=2&r[0]?i.return:r[0]?i.throw||((n=i.return)&&n.call(i),0):i.next)&&!(n=n.call(i,r[1])).done)return n;switch(i=0,n&&(r=[2&r[0],n.value]),r[0]){case 0:case 1:n=r;break;case 4:return s.label++,{value:r[1],done:!1};case 5:s.label++,i=r[1],r=[0];continue;case 7:r=s.ops.pop(),s.trys.pop();continue;default:if(!((n=(n=s.trys).length>0&&n[n.length-1])||6!==r[0]&&2!==r[0])){s=0;continue}if(3===r[0]&&(!n||r[1]>n[0]&&r[1]<n[3])){s.label=r[1];break}if(6===r[0]&&s.label<n[1]){s.label=n[1],n=r;break}if(n&&s.label<n[2]){s.label=n[2],s.ops.push(r);break}n[2]&&s.ops.pop(),s.trys.pop();continue}r=t.call(e,s)}catch(e){r=[6,e],i=0}finally{o=n=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,a])}}},v=function(e,t,o){return p(void 0,void 0,void 0,(function(){return f(this,(function(){return[2,i().api.put("/documents/".concat(e,"/fields/").concat(t),o).then((function(e){return e.data}))]}))}))};const b="https://stage-api.verdocs.com",g=class{constructor(t){e(this,t),this.documentid=null,this.roleid=null,this.invitecode=null,this.endpoint=null,this.recipient=null,this.signerToken=null,this.pdfUrl=null,this.recipientIndex=-1,this.document=null,this.fields=[],this.hasSignature=!1,this.nextButtonLabel="Start",this.focusedField=""}componentWillLoad(){const e=(new r).setBaseURL(b);s(e)}async componentDidLoad(){try{console.log("[SIGN] Processing invite code",this.documentid,this.roleid,this.invitecode);const{session:o,recipient:r,signerToken:s}=await(t={documentId:this.documentid,roleId:this.roleid,inviteCode:this.invitecode},p(void 0,void 0,void 0,(function(){return f(this,(function(){return[2,i().api.get("/documents/".concat(t.documentId,"/recipients/").concat(encodeURIComponent(t.roleId),"/invitation/").concat(t.inviteCode)).then((function(e){var t,o,r=(null===(t=e.headers)||void 0===t?void 0:t.signer_token)||"",s=n(r);return i().setAuthorization(null===(o=e.headers)||void 0===o?void 0:o.signer_token),{recipient:e.data,session:s,signerToken:r}}))]}))})));console.log("[SIGN] Got signing session",o),console.log("[SIGN] Recipient",r),this.recipient=r,this.signerToken=s,i().setSigningAuthorization(s),this.recipient.agreed&&(this.nextButtonLabel="Next");const a=await(e=this.documentid,p(void 0,void 0,void 0,(function(){return f(this,(function(){return[2,i().api.get("/documents/".concat(e)).then((function(e){return e.data}))]}))})));this.document=a,console.log("[SIGN] Document",a),this.pdfUrl=`${b}/documents/${this.documentid}/envelope_documents/${a.envelope_document_id}?file=true`,this.recipientIndex=this.document.recipients.findIndex((e=>e.role_name==this.roleid)),this.recipientIndex>-1&&console.log("Found recipient",this.document.recipients[this.recipientIndex]),this.fields=this.document.fields.filter((e=>e.recipient_role===this.roleid)),console.log("Loaded fields",this.fields)}catch(e){console.log("Error with signing session",e)}var e,t}handleClickAgree(){var e,t,o,n,r,s,a;console.log("agree clicked"),(e=this.documentid,t=this.roleid,"update",o={agreed:!0},n=void 0,r=void 0,s=void 0,a=function(){return function(e,t){var o,i,n,r,s={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return r={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function a(r){return function(a){return function(r){if(o)throw new TypeError("Generator is already executing.");for(;s;)try{if(o=1,i&&(n=2&r[0]?i.return:r[0]?i.throw||((n=i.return)&&n.call(i),0):i.next)&&!(n=n.call(i,r[1])).done)return n;switch(i=0,n&&(r=[2&r[0],n.value]),r[0]){case 0:case 1:n=r;break;case 4:return s.label++,{value:r[1],done:!1};case 5:s.label++,i=r[1],r=[0];continue;case 7:r=s.ops.pop(),s.trys.pop();continue;default:if(!((n=(n=s.trys).length>0&&n[n.length-1])||6!==r[0]&&2!==r[0])){s=0;continue}if(3===r[0]&&(!n||r[1]>n[0]&&r[1]<n[3])){s.label=r[1];break}if(6===r[0]&&s.label<n[1]){s.label=n[1],n=r;break}if(n&&s.label<n[2]){s.label=n[2],s.ops.push(r);break}n[2]&&s.ops.pop(),s.trys.pop();continue}r=t.call(e,s)}catch(e){r=[6,e],i=0}finally{o=n=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,a])}}}(this,(function(){return[2,i().api.put("/documents/".concat(e,"/recipients/").concat(t),d({role_name:t,action:"update"},o||{})).then((function(e){return e.data}))]}))},new(s||(s=Promise))((function(e,t){function o(e){try{c(a.next(e))}catch(e){t(e)}}function i(e){try{c(a.throw(e))}catch(e){t(e)}}function c(t){var n;t.done?e(t.value):(n=t.value,n instanceof s?n:new s((function(e){e(n)}))).then(o,i)}c((a=a.apply(n,r||[])).next())}))).then((e=>{console.log("update result",e),this.nextButtonLabel="Next",this.recipient=e})).catch((e=>{console.log("update failure",e)}))}async savePDF(){const e=`${this.document.name} - ${this.document.updated_at.split("T")[0]}.pdf`,t=await(o=this.documentid,n=this.document.envelope_document_id,p(void 0,void 0,void 0,(function(){return f(this,(function(){return[2,i().api.get("/documents/".concat(o,"/envelope_documents/").concat(n,"?file=true"),{responseType:"arraybuffer"}).then((function(e){return a.from(e.data,"binary").toString("base64")}))]}))})));var o,n;let r=new XMLHttpRequest;r.responseType="blob",r.onload=function(){let t=document.createElement("a");t.href=window.URL.createObjectURL(r.response),t.download=e,t.style.display="none",document.body.appendChild(t),t.click(),t.remove()};const s=`data:application/pdf;base64,${t}`;console.log("url",s.length,s),r.open("GET",`data:application/pdf;base64,${t}`),r.send()}async handleOptionSelected(e){switch(e.detail.id){case"later":(null===window||void 0===window?void 0:window.STORYBOOK_ENV)||window.alert("User intends to sign later.");break;case"claim":case"decline":case"print":break;case"download":this.savePDF().catch((()=>{}))}}async handleFieldChange(e,t,o){switch(console.log("fieldChange",e,t.detail),e.type){case"textbox":v(this.documentid,e.name,{prepared:!1,value:t.detail}).then((e=>console.log("Update result",e))).catch((e=>console.log("Error updating",e)));break;case"checkbox_group":v(this.documentid,e.name,{prepared:!1,value:{options:[{id:o,checked:t.detail}]}}).then((e=>console.log("Update result",e))).catch((e=>console.log("Error updating",e)));break;case"radio_button_group":const i=e.settings.options.map((e=>({id:e.id,selected:o===e.id})));v(this.documentid,e.name,{prepared:!1,value:{options:i}}).then((e=>console.log("Update result",e))).catch((e=>console.log("Error updating",e)));break;case"dropdown":v(this.documentid,e.name,{prepared:!1,value:t.detail}).then((e=>console.log("Update result",e))).catch((e=>console.log("Error updating",e)));break;case"initial":console.log("Got initial",t.detail);break;case"signature":console.log("Got signature",t.detail)}}renderCheckboxGroupOption(e,o,i,n){const r={left:`${l(e.xRatio,i.x)}px`,bottom:`${l(e.yRatio,i.y)}px`,position:"absolute",transform:`scale(${e.xRatio}, ${e.yRatio})`,backgroundColor:c(this.recipientIndex)};return t("verdocs-field-checkbox",{style:r,order:n,value:i.checked,onFieldChange:e=>this.handleFieldChange(o,e,i.id)})}renderRadioGroupOption(e,o,i,n){const r={left:`${l(e.xRatio,i.x)}px`,bottom:`${l(e.yRatio,i.y)}px`,position:"absolute",transform:`scale(${e.xRatio}, ${e.yRatio})`,backgroundColor:c(this.recipientIndex)};return t("verdocs-field-radio-button",{style:r,order:n,value:i.id,name:o.name,checked:i.selected,onFieldChange:e=>this.handleFieldChange(o,e,i.id)})}renderField(e,o){const{required:i=!1,settings:n={}}=e,{x:r=0,y:s=0,base64:a="",placeholder:d="",options:u=[],value:h="",result:p=""}=n,f=this.pdfPageInfo.pages.find((t=>t.pageNumber===e.page));if(!f)return console.log("Unable to render invalid field",e),t("div",{class:"invalid-field"},"Invalid field.");const v={left:`${l(f.xRatio,r)}px`,bottom:`${l(f.yRatio,s)}px`,position:"absolute",transform:`scale(${f.xRatio}, ${f.yRatio})`,backgroundColor:e.settings.rgba||c(this.recipientIndex)};e.settings.height&&(v.height=`${e.settings.height}px`),e.settings.width&&(v.width=`${e.settings.width}px`),console.log("rendering field",e.type,e);const b=`field-${e.name}`;switch(e.type){case"signature":return t("verdocs-field-signature",{style:v,value:a,required:i,id:b});case"initial":return t("verdocs-field-initial",{style:v,required:i,id:b});case"textbox":return t("verdocs-field-textbox",{style:v,order:o,value:p||"",placeholder:d,id:b,onFieldChange:t=>this.handleFieldChange(e,t)});case"textarea":return t("verdocs-field-textarea",{style:v,placeholder:d||"",id:b});case"date":return t("verdocs-field-date",{style:v,order:o,value:p||"",placeholder:d,required:i,id:b});case"dropdown":return t("verdocs-field-dropdown",{style:v,options:u,value:h,required:i,id:b,onFieldChange:t=>this.handleFieldChange(e,t)});case"checkbox":return t("verdocs-field-checkbox",{style:v,value:p||"",id:b});case"checkbox_group":return e.settings.options.map(((t,o)=>this.renderCheckboxGroupOption(f,e,t,o)));case"radio_button_group":return e.settings.options.map(((t,o)=>this.renderRadioGroupOption(f,e,t,o)));case"attachment":return t("verdocs-field-attachment",{style:v,value:p||"",id:b});case"payment":return t("verdocs-field-payment",{style:v,field:e,id:b});default:console.log("[SIGN] Skipping unsupported field type",e)}return t("div",{style:{display:"none"}},'Unsupported field type "',e.type,'"')}isFieldValid(e){var t,o,i,n,r,s,a,c,l,d,p,f,v;switch(e.type){case"textbox":switch((null===(t=e.settings)||void 0===t?void 0:t.validator)||""){case"email":return v=(null===(o=e.settings)||void 0===o?void 0:o.result)||"",h.test(v);case"phone":return function(e){return null!==(t=e)&&t.length<16&&t.length>6&&u.test(t)||""===t||null===t;var t}((null===(i=e.settings)||void 0===i?void 0:i.result)||"");default:return!!(null===(n=e.settings)||void 0===n?void 0:n.result)}case"signature":case"initial":case"textarea":case"date":case"attachment":return!!(null===(r=e.settings)||void 0===r?void 0:r.result);case"dropdown":return!!(null===(s=e.settings)||void 0===s?void 0:s.value);case"checkbox_group":const b=((null===(c=null===(a=e.settings)||void 0===a?void 0:a.options)||void 0===c?void 0:c.filter((e=>e.checked)))||[]).length;return b>=((null===(l=e.settings)||void 0===l?void 0:l.minimum_checked)||0)&&b<=((null===(d=e.settings)||void 0===d?void 0:d.maximum_checked)||999);case"radio_button_group":return((null===(f=null===(p=e.settings)||void 0===p?void 0:p.options)||void 0===f?void 0:f.filter((e=>e.selected)))||[]).length>0;default:return!1}}handleDocumentRendered(e){console.log("[SIGN] Document rendered",e.detail),this.pdfPageInfo=e.detail}handleNext(){const e=this.fields.filter((e=>e.required));console.log("required Fields",e);const t=e.findIndex((e=>e.name===this.focusedField));console.log("focused Index",t);let o=t+1;o>=e.length&&(o=0);const i=e[o];if(console.log("next required fielod",i),i){const e=document.getElementById(`field-${i.name}`);null==e||e.focusField(),this.focusedField=i.name}}render(){var e,i,n,r,s;return t(o,{class:{storybook:!!(null===window||void 0===window?void 0:window.STORYBOOK_ENV),agreed:null===(e=this.recipient)||void 0===e?void 0:e.agreed}},t("div",{class:"header"},t("div",{class:"intro"},"Please review and act on these documents."),t("div",{class:"toolbar"},t("div",{class:"tools"},t("verdocs-dropdown",{options:[{id:"later",label:"Finish Later"},{id:"claim",label:"Claim the Document",disabled:!0},{id:"decline",label:"Decline to Sign"},{id:"print",label:"Print Without Signing"},{id:"download",label:"Download"}],onOptionSelected:e=>this.handleOptionSelected(e)}),(null===(i=this.recipient)||void 0===i?void 0:i.agreed)?t("div",{style:{flex:"1"}}):t("div",{style:{flex:"1",flexDirection:"row",display:"flex",alignItems:"center"}},t("div",{class:"agree-checkbox"},t("input",{type:"checkbox",value:"None",id:"agree-checkbox-element",name:"agree",onChange:()=>this.handleClickAgree()}),t("label",{htmlFor:"agree-checkbox-element"})),"I agree to use electronic records and signatures."),t("verdocs-button",{label:this.nextButtonLabel,disabled:!(null===(n=this.recipient)||void 0===n?void 0:n.agreed),onClick:()=>this.handleNext()})))),(null===(r=this.recipient)||void 0===r?void 0:r.agreed)?t("div",{style:{display:"none"}}):t("div",{class:"cover"}),t("div",{class:"document"},this.pdfUrl?t("verdocs-view",{source:this.pdfUrl,token:this.signerToken,onDocumentRendered:e=>this.handleDocumentRendered(e)}):t("verdocs-loader",null),((null===(s=this.pdfPageInfo)||void 0===s?void 0:s.pages)||[]).map((e=>{var o;return t("div",{class:"page-controls",style:{height:`${e.height}px`,width:`${e.width}px`,top:`${e.canvasTop}px`,margin:"0 auto"}},(null===(o=this.pdfPageInfo)||void 0===o?void 0:o.numRendered)>0?this.fields.filter((t=>t.page===e.pageNumber)).map(((e,t)=>this.renderField(e,t))):t("div",{style:{display:"none"}},"Waiting for PDF to render..."))}))))}};g.style='verdocs-sign{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;position:relative;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;min-height:600px;-webkit-box-sizing:border-box;box-sizing:border-box;overflow:hidden}verdocs-sign.storybook{max-height:600px}verdocs-sign div{-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-sign .header{-ms-flex:0 0 115px;flex:0 0 115px;z-index:1000;background-color:#33354c;-webkit-box-shadow:0 4px 4px 0 rgba(0, 0, 0, 0.24), 0 0 4px 0 rgba(0, 0, 0, 0.12);box-shadow:0 4px 4px 0 rgba(0, 0, 0, 0.24), 0 0 4px 0 rgba(0, 0, 0, 0.12);-webkit-transition:all 0.25s;transition:all 0.25s}verdocs-sign .intro{background-color:#ffffff;width:100%;margin:0 auto;padding:20px;max-width:1028px;color:rgba(0, 0, 0, 0.87)}verdocs-sign .toolbar{width:100%;margin:0 auto;padding:0 20px;max-width:1028px;position:relative}verdocs-sign .tools{width:100%;color:#fff;height:56px;padding:4px;display:-ms-flexbox;display:flex;font-size:12px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;background-color:#33354c}verdocs-sign .cover{top:0;left:0;right:0;bottom:0;z-index:999;position:absolute;background:rgba(0, 0, 0, 0.5)}verdocs-sign .document{-ms-flex:1;flex:1;height:100%;position:relative;overflow-y:scroll}verdocs-sign .agree-checkbox{-ms-flex:0 0 20px;flex:0 0 20px;display:-ms-flexbox;display:flex;width:20px;height:20px;border-radius:3px;background:#ffffff;position:relative;margin:0 10px 0 30px}verdocs-sign .agree-checkbox label{left:2px;top:2px;width:16px;height:16px;cursor:pointer;position:absolute;background:#33354c;-webkit-box-shadow:inset 0 -1px 1px rgba(255, 255, 255, 0.8);box-shadow:inset 0 -1px 1px rgba(255, 255, 255, 0.8)}verdocs-sign .agree-checkbox label:after{top:2px;left:3px;width:8px;opacity:0;height:5px;content:"";position:absolute;background:transparent;filter:alpha(opacity=0);-webkit-transform:rotate(-45deg);transform:rotate(-45deg);border:2px solid #fcfff4;border-top:none;border-right:none}verdocs-sign .agree-checkbox label:hover::after{filter:alpha(opacity=30);opacity:0.3}verdocs-sign .agree-checkbox input[type=checkbox]:checked+label:after{filter:alpha(opacity=100);opacity:1}verdocs-sign.agreed .intro{display:none}verdocs-sign.agreed .header{-ms-flex:0 0 56px;flex:0 0 56px}verdocs-sign.agreed .agree-checkbox{background:#ccc}verdocs-sign.agreed .agree-checkbox label{cursor:default}verdocs-sign .page-controls{position:absolute;left:50%;-webkit-transform:translateX(-50%);transform:translateX(-50%);z-index:500}';export{g as verdocs_sign}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(e,t,n,o){function i(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,r){function a(e){try{s(o.next(e))}catch(e){r(e)}}function c(e){try{s(o["throw"](e))}catch(e){r(e)}}function s(e){e.done?n(e.value):i(e.value).then(a,c)}s((o=o.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var n={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},o,i,r,a;return a={next:c(0),throw:c(1),return:c(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function c(e){return function(t){return s([e,t])}}function s(a){if(o)throw new TypeError("Generator is already executing.");while(n)try{if(o=1,i&&(r=a[0]&2?i["return"]:a[0]?i["throw"]||((r=i["return"])&&r.call(i),0):i.next)&&!(r=r.call(i,a[1])).done)return r;if(i=0,r)a=[a[0]&2,r.value];switch(a[0]){case 0:case 1:r=a;break;case 4:n.label++;return{value:a[1],done:false};case 5:n.label++;i=a[1];a=[0];continue;case 7:a=n.ops.pop();n.trys.pop();continue;default:if(!(r=n.trys,r=r.length>0&&r[r.length-1])&&(a[0]===6||a[0]===2)){n=0;continue}if(a[0]===3&&(!r||a[1]>r[0]&&a[1]<r[3])){n.label=a[1];break}if(a[0]===6&&n.label<r[1]){n.label=r[1];r=a;break}if(r&&n.label<r[2]){n.label=r[2];n.ops.push(a);break}if(r[2])n.ops.pop();n.trys.pop();continue}a=t.call(e,n)}catch(e){a=[6,e];i=0}finally{o=r=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};System.register(["./p-caed7818.system.js","./p-e3659c64.system.js","./p-5dfd73f9.system.js"],(function(e){"use strict";var t,n,o,i,r,a,c,s;return{setters:[function(e){t=e.r;n=e.h;o=e.H},function(e){i=e.g;r=e.d;a=e.V;c=e.s},function(e){s=e.B}],execute:function(){function l(e){switch(e%10){case 0:return e===0?"rgba(255, 193, 7, 0.4)":"rgba(134, 134, 134, 0.3)";case 1:return"rgba(156, 39, 176, .4)";case 2:return"rgba(33, 150, 243, .4)";case 3:return"rgba(220, 231, 117, 0.3)";case 4:return"rgba(121, 134, 203, 0.3)";case 5:return"rgba(77, 182, 172, 0.3)";case 6:return"rgba(255, 202, 165, 0.3)";case 7:return"rgba(2, 247, 190, 0.3)";case 8:return"rgba(255, 138, 101, 0.3)";case 9:return"rgba(82, 255, 79, 0.3)";default:return"rgba(229, 115, 155, 0.3)"}}function d(e,t){return e*t}var u=undefined&&undefined.__assign||function(){u=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++){t=arguments[n];for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i))e[i]=t[i]}return e};return u.apply(this,arguments)};var f=undefined&&undefined.__awaiter||function(e,t,n,o){function i(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,r){function a(e){try{s(o.next(e))}catch(e){r(e)}}function c(e){try{s(o["throw"](e))}catch(e){r(e)}}function s(e){e.done?n(e.value):i(e.value).then(a,c)}s((o=o.apply(e,t||[])).next())}))};var p=undefined&&undefined.__generator||function(e,t){var n={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},o,i,r,a;return a={next:c(0),throw:c(1),return:c(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function c(e){return function(t){return s([e,t])}}function s(a){if(o)throw new TypeError("Generator is already executing.");while(n)try{if(o=1,i&&(r=a[0]&2?i["return"]:a[0]?i["throw"]||((r=i["return"])&&r.call(i),0):i.next)&&!(r=r.call(i,a[1])).done)return r;if(i=0,r)a=[a[0]&2,r.value];switch(a[0]){case 0:case 1:r=a;break;case 4:n.label++;return{value:a[1],done:false};case 5:n.label++;i=a[1];a=[0];continue;case 7:a=n.ops.pop();n.trys.pop();continue;default:if(!(r=n.trys,r=r.length>0&&r[r.length-1])&&(a[0]===6||a[0]===2)){n=0;continue}if(a[0]===3&&(!r||a[1]>r[0]&&a[1]<r[3])){n.label=a[1];break}if(a[0]===6&&n.label<r[1]){n.label=r[1];r=a;break}if(r&&n.label<r[2]){n.label=r[2];n.ops.push(a);break}if(r[2])n.ops.pop();n.trys.pop();continue}a=t.call(e,n)}catch(e){a=[6,e];i=0}finally{o=r=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};var h=function(e,t,n,o){return f(void 0,void 0,void 0,(function(){return p(this,(function(r){return[2,i().api.put("/documents/".concat(e,"/recipients/").concat(t),u({role_name:t,action:n},o||{})).then((function(e){return e.data}))]}))}))};var v=new RegExp(/\+[1-9]\d{6,14}/g);function g(e){return e!==null&&e.length<16&&e.length>6&&v.test(e)||e===""||e===null}var b=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;var x=function(e){return b.test(e)};var m=function(e){return g(e)};var y=undefined&&undefined.__awaiter||function(e,t,n,o){function i(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,r){function a(e){try{s(o.next(e))}catch(e){r(e)}}function c(e){try{s(o["throw"](e))}catch(e){r(e)}}function s(e){e.done?n(e.value):i(e.value).then(a,c)}s((o=o.apply(e,t||[])).next())}))};var w=undefined&&undefined.__generator||function(e,t){var n={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},o,i,r,a;return a={next:c(0),throw:c(1),return:c(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function c(e){return function(t){return s([e,t])}}function s(a){if(o)throw new TypeError("Generator is already executing.");while(n)try{if(o=1,i&&(r=a[0]&2?i["return"]:a[0]?i["throw"]||((r=i["return"])&&r.call(i),0):i.next)&&!(r=r.call(i,a[1])).done)return r;if(i=0,r)a=[a[0]&2,r.value];switch(a[0]){case 0:case 1:r=a;break;case 4:n.label++;return{value:a[1],done:false};case 5:n.label++;i=a[1];a=[0];continue;case 7:a=n.ops.pop();n.trys.pop();continue;default:if(!(r=n.trys,r=r.length>0&&r[r.length-1])&&(a[0]===6||a[0]===2)){n=0;continue}if(a[0]===3&&(!r||a[1]>r[0]&&a[1]<r[3])){n.label=a[1];break}if(a[0]===6&&n.label<r[1]){n.label=r[1];r=a;break}if(r&&n.label<r[2]){n.label=r[2];n.ops.push(a);break}if(r[2])n.ops.pop();n.trys.pop();continue}a=t.call(e,n)}catch(e){a=[6,e];i=0}finally{o=r=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};var k=function(e){return y(void 0,void 0,void 0,(function(){return w(this,(function(t){return[2,i().api.get("/documents/".concat(e.documentId,"/recipients/").concat(encodeURIComponent(e.roleId),"/invitation/").concat(e.inviteCode)).then((function(e){var t,n;var o=((t=e.headers)===null||t===void 0?void 0:t.signer_token)||"";var a=r(o);i().setAuthorization((n=e.headers)===null||n===void 0?void 0:n.signer_token);return{recipient:e.data,session:a,signerToken:o}}))]}))}))};var _=function(e){return y(void 0,void 0,void 0,(function(){return w(this,(function(t){return[2,i().api.get("/documents/".concat(e)).then((function(e){return e.data}))]}))}))};var I=function(e,t){return y(void 0,void 0,void 0,(function(){return w(this,(function(n){return[2,i().api.get("/documents/".concat(e,"/envelope_documents/").concat(t,"?file=true"),{responseType:"arraybuffer"}).then((function(e){return s.from(e.data,"binary").toString("base64")}))]}))}))};var R=function(e,t,n){return y(void 0,void 0,void 0,(function(){return w(this,(function(o){return[2,i().api.put("/documents/".concat(e,"/fields/").concat(t),n).then((function(e){return e.data}))]}))}))};var S='verdocs-sign{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;position:relative;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;min-height:600px;-webkit-box-sizing:border-box;box-sizing:border-box;overflow:hidden}verdocs-sign.storybook{max-height:600px}verdocs-sign div{-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-sign .header{-ms-flex:0 0 115px;flex:0 0 115px;z-index:1000;background-color:#33354c;-webkit-box-shadow:0 4px 4px 0 rgba(0, 0, 0, 0.24), 0 0 4px 0 rgba(0, 0, 0, 0.12);box-shadow:0 4px 4px 0 rgba(0, 0, 0, 0.24), 0 0 4px 0 rgba(0, 0, 0, 0.12);-webkit-transition:all 0.25s;transition:all 0.25s}verdocs-sign .intro{background-color:#ffffff;width:100%;margin:0 auto;padding:20px;max-width:1028px;color:rgba(0, 0, 0, 0.87)}verdocs-sign .toolbar{width:100%;margin:0 auto;padding:0 20px;max-width:1028px;position:relative}verdocs-sign .tools{width:100%;color:#fff;height:56px;padding:4px;display:-ms-flexbox;display:flex;font-size:12px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;background-color:#33354c}verdocs-sign .cover{top:0;left:0;right:0;bottom:0;z-index:999;position:absolute;background:rgba(0, 0, 0, 0.5)}verdocs-sign .document{-ms-flex:1;flex:1;height:100%;position:relative;overflow-y:scroll}verdocs-sign .agree-checkbox{-ms-flex:0 0 20px;flex:0 0 20px;display:-ms-flexbox;display:flex;width:20px;height:20px;border-radius:3px;background:#ffffff;position:relative;margin:0 10px 0 30px}verdocs-sign .agree-checkbox label{left:2px;top:2px;width:16px;height:16px;cursor:pointer;position:absolute;background:#33354c;-webkit-box-shadow:inset 0 -1px 1px rgba(255, 255, 255, 0.8);box-shadow:inset 0 -1px 1px rgba(255, 255, 255, 0.8)}verdocs-sign .agree-checkbox label:after{top:2px;left:3px;width:8px;opacity:0;height:5px;content:"";position:absolute;background:transparent;filter:alpha(opacity=0);-webkit-transform:rotate(-45deg);transform:rotate(-45deg);border:2px solid #fcfff4;border-top:none;border-right:none}verdocs-sign .agree-checkbox label:hover::after{filter:alpha(opacity=30);opacity:0.3}verdocs-sign .agree-checkbox input[type=checkbox]:checked+label:after{filter:alpha(opacity=100);opacity:1}verdocs-sign.agreed .intro{display:none}verdocs-sign.agreed .header{-ms-flex:0 0 56px;flex:0 0 56px}verdocs-sign.agreed .agree-checkbox{background:#ccc}verdocs-sign.agreed .agree-checkbox label{cursor:default}verdocs-sign .page-controls{position:absolute;left:50%;-webkit-transform:translateX(-50%);transform:translateX(-50%);z-index:500}';var C="https://stage-api.verdocs.com";var F=e("verdocs_sign",function(){function e(e){t(this,e);this.documentid=null;this.roleid=null;this.invitecode=null;this.endpoint=null;this.recipient=null;this.signerToken=null;this.pdfUrl=null;this.recipientIndex=-1;this.document=null;this.fields=[];this.hasSignature=false;this.nextButtonLabel="Start";this.focusedField=""}e.prototype.componentWillLoad=function(){var e=(new a).setBaseURL(C);c(e)};e.prototype.componentDidLoad=function(){return y(this,void 0,void 0,(function(){var e,t,n,o,r,a;var c=this;return w(this,(function(s){switch(s.label){case 0:s.trys.push([0,3,,4]);console.log("[SIGN] Processing invite code",this.documentid,this.roleid,this.invitecode);return[4,k({documentId:this.documentid,roleId:this.roleid,inviteCode:this.invitecode})];case 1:e=s.sent(),t=e.session,n=e.recipient,o=e.signerToken;console.log("[SIGN] Got signing session",t);console.log("[SIGN] Recipient",n);this.recipient=n;this.signerToken=o;i().setSigningAuthorization(o);if(this.recipient.agreed){this.nextButtonLabel="Next"}return[4,_(this.documentid)];case 2:r=s.sent();this.document=r;console.log("[SIGN] Document",r);this.pdfUrl="".concat(C,"/documents/").concat(this.documentid,"/envelope_documents/").concat(r.envelope_document_id,"?file=true");this.recipientIndex=this.document.recipients.findIndex((function(e){return e.role_name==c.roleid}));if(this.recipientIndex>-1){console.log("Found recipient",this.document.recipients[this.recipientIndex])}this.fields=this.document.fields.filter((function(e){return e.recipient_role===c.roleid}));console.log("Loaded fields",this.fields);return[3,4];case 3:a=s.sent();console.log("Error with signing session",a);return[3,4];case 4:return[2]}}))}))};e.prototype.handleClickAgree=function(){var e=this;console.log("agree clicked");h(this.documentid,this.roleid,"update",{agreed:true}).then((function(t){console.log("update result",t);e.nextButtonLabel="Next";e.recipient=t})).catch((function(e){console.log("update failure",e)}))};e.prototype.savePDF=function(){return y(this,void 0,void 0,(function(){var e,t,n,o;return w(this,(function(i){switch(i.label){case 0:e="".concat(this.document.name," - ").concat(this.document.updated_at.split("T")[0],".pdf");return[4,I(this.documentid,this.document.envelope_document_id)];case 1:t=i.sent();n=new XMLHttpRequest;n.responseType="blob";n.onload=function(){var t=document.createElement("a");t.href=window.URL.createObjectURL(n.response);t.download=e;t.style.display="none";document.body.appendChild(t);t.click();t.remove()};o="data:application/pdf;base64,".concat(t);console.log("url",o.length,o);n.open("GET","data:application/pdf;base64,".concat(t));n.send();return[2]}}))}))};e.prototype.handleOptionSelected=function(e){return y(this,void 0,void 0,(function(){return w(this,(function(t){switch(e.detail.id){case"later":if(!(window===null||window===void 0?void 0:window["STORYBOOK_ENV"])){window.alert("User intends to sign later.")}break;case"claim":break;case"decline":break;case"print":break;case"download":this.savePDF().catch((function(){}));break}return[2]}))}))};e.prototype.handleFieldChange=function(e,t,n){return y(this,void 0,void 0,(function(){var o;return w(this,(function(i){console.log("fieldChange",e,t.detail);switch(e.type){case"textbox":R(this.documentid,e.name,{prepared:false,value:t.detail}).then((function(e){return console.log("Update result",e)})).catch((function(e){return console.log("Error updating",e)}));break;case"checkbox_group":R(this.documentid,e.name,{prepared:false,value:{options:[{id:n,checked:t.detail}]}}).then((function(e){return console.log("Update result",e)})).catch((function(e){return console.log("Error updating",e)}));break;case"radio_button_group":o=e.settings.options.map((function(e){return{id:e.id,selected:n===e.id}}));R(this.documentid,e.name,{prepared:false,value:{options:o}}).then((function(e){return console.log("Update result",e)})).catch((function(e){return console.log("Error updating",e)}));break;case"dropdown":R(this.documentid,e.name,{prepared:false,value:t.detail}).then((function(e){return console.log("Update result",e)})).catch((function(e){return console.log("Error updating",e)}));break;case"initial":console.log("Got initial",t.detail);break;case"signature":console.log("Got signature",t.detail);break}return[2]}))}))};e.prototype.renderCheckboxGroupOption=function(e,t,o,i){var r=this;var a=d(e.xRatio,o.x);var c=d(e.yRatio,o.y);var s={left:"".concat(a,"px"),bottom:"".concat(c,"px"),position:"absolute",transform:"scale(".concat(e.xRatio,", ").concat(e.yRatio,")"),backgroundColor:l(this.recipientIndex)};return n("verdocs-field-checkbox",{style:s,order:i,value:o.checked,onFieldChange:function(e){return r.handleFieldChange(t,e,o.id)}})};e.prototype.renderRadioGroupOption=function(e,t,o,i){var r=this;var a=d(e.xRatio,o.x);var c=d(e.yRatio,o.y);var s={left:"".concat(a,"px"),bottom:"".concat(c,"px"),position:"absolute",transform:"scale(".concat(e.xRatio,", ").concat(e.yRatio,")"),backgroundColor:l(this.recipientIndex)};return n("verdocs-field-radio-button",{style:s,order:i,value:o.id,name:t.name,checked:o.selected,onFieldChange:function(e){return r.handleFieldChange(t,e,o.id)}})};e.prototype.renderField=function(e,t){var o=this;var i=e.required,r=i===void 0?false:i,a=e.settings,c=a===void 0?{}:a;var s=c.x,u=s===void 0?0:s,f=c.y,p=f===void 0?0:f,h=c.base64,v=h===void 0?"":h,g=c.placeholder,b=g===void 0?"":g,x=c.options,m=x===void 0?[]:x,y=c.value,w=y===void 0?"":y,k=c.result,_=k===void 0?"":k;var I=this.pdfPageInfo.pages.find((function(t){return t.pageNumber===e.page}));if(!I){console.log("Unable to render invalid field",e);return n("div",{class:"invalid-field"},"Invalid field.")}var R=d(I.xRatio,u);var S=d(I.yRatio,p);var C={left:"".concat(R,"px"),bottom:"".concat(S,"px"),position:"absolute",transform:"scale(".concat(I.xRatio,", ").concat(I.yRatio,")"),backgroundColor:e.settings.rgba||l(this.recipientIndex)};if(e.settings.height){C.height="".concat(e.settings.height,"px")}if(e.settings.width){C.width="".concat(e.settings.width,"px")}console.log("rendering field",e.type,e);var F="field-".concat(e.name);switch(e.type){case"signature":return n("verdocs-field-signature",{style:C,value:v,required:r,id:F});case"initial":return n("verdocs-field-initial",{style:C,required:r,id:F});case"textbox":return n("verdocs-field-textbox",{style:C,order:t,value:_||"",placeholder:b,id:F,onFieldChange:function(t){return o.handleFieldChange(e,t)}});case"textarea":return n("verdocs-field-textarea",{style:C,placeholder:b||"",id:F});case"date":return n("verdocs-field-date",{style:C,order:t,value:_||"",placeholder:b,required:r,id:F});case"dropdown":return n("verdocs-field-dropdown",{style:C,options:m,value:w,required:r,id:F,onFieldChange:function(t){return o.handleFieldChange(e,t)}});case"checkbox":return n("verdocs-field-checkbox",{style:C,value:_||"",id:F});case"checkbox_group":return e.settings.options.map((function(t,n){return o.renderCheckboxGroupOption(I,e,t,n)}));case"radio_button_group":return e.settings.options.map((function(t,n){return o.renderRadioGroupOption(I,e,t,n)}));case"attachment":return n("verdocs-field-attachment",{style:C,value:_||"",id:F});case"payment":return n("verdocs-field-payment",{style:C,field:e,id:F});default:console.log("[SIGN] Skipping unsupported field type",e)}return n("div",{style:{display:"none"}},'Unsupported field type "',e.type,'"')};e.prototype.isFieldValid=function(e){var t,n,o,i,r,a,c,s,l,d,u,f;switch(e.type){case"textbox":switch(((t=e.settings)===null||t===void 0?void 0:t.validator)||""){case"email":return x(((n=e.settings)===null||n===void 0?void 0:n.result)||"");case"phone":return m(((o=e.settings)===null||o===void 0?void 0:o.result)||"");default:return!!((i=e.settings)===null||i===void 0?void 0:i.result)}case"signature":case"initial":case"textarea":case"date":case"attachment":return!!((r=e.settings)===null||r===void 0?void 0:r.result);case"dropdown":return!!((a=e.settings)===null||a===void 0?void 0:a.value);case"checkbox_group":var p=(((s=(c=e.settings)===null||c===void 0?void 0:c.options)===null||s===void 0?void 0:s.filter((function(e){return e.checked})))||[]).length;return p>=(((l=e.settings)===null||l===void 0?void 0:l.minimum_checked)||0)&&p<=(((d=e.settings)===null||d===void 0?void 0:d.maximum_checked)||999);case"radio_button_group":return(((f=(u=e.settings)===null||u===void 0?void 0:u.options)===null||f===void 0?void 0:f.filter((function(e){return e.selected})))||[]).length>0;default:return false}};e.prototype.handleDocumentRendered=function(e){console.log("[SIGN] Document rendered",e.detail);this.pdfPageInfo=e.detail};e.prototype.handleNext=function(){var e=this;var t=this.fields.filter((function(e){return e.required}));console.log("required Fields",t);var n=t.findIndex((function(t){return t.name===e.focusedField}));console.log("focused Index",n);var o=n+1;if(o>=t.length){o=0}var i=t[o];console.log("next required fielod",i);if(i){var r=document.getElementById("field-".concat(i.name));r===null||r===void 0?void 0:r.focusField();this.focusedField=i.name}};e.prototype.render=function(){var e=this;var t,i,r,a,c;var s=[{id:"later",label:"Finish Later"},{id:"claim",label:"Claim the Document",disabled:true},{id:"decline",label:"Decline to Sign"},{id:"print",label:"Print Without Signing"},{id:"download",label:"Download"}];return n(o,{class:{storybook:!!(window===null||window===void 0?void 0:window["STORYBOOK_ENV"]),agreed:(t=this.recipient)===null||t===void 0?void 0:t.agreed}},n("div",{class:"header"},n("div",{class:"intro"},"Please review and act on these documents."),n("div",{class:"toolbar"},n("div",{class:"tools"},n("verdocs-dropdown",{options:s,onOptionSelected:function(t){return e.handleOptionSelected(t)}}),!((i=this.recipient)===null||i===void 0?void 0:i.agreed)?n("div",{style:{flex:"1",flexDirection:"row",display:"flex",alignItems:"center"}},n("div",{class:"agree-checkbox"},n("input",{type:"checkbox",value:"None",id:"agree-checkbox-element",name:"agree",onChange:function(){return e.handleClickAgree()}}),n("label",{htmlFor:"agree-checkbox-element"})),"I agree to use electronic records and signatures."):n("div",{style:{flex:"1"}}),n("verdocs-button",{label:this.nextButtonLabel,disabled:!((r=this.recipient)===null||r===void 0?void 0:r.agreed),onClick:function(){return e.handleNext()}})))),!((a=this.recipient)===null||a===void 0?void 0:a.agreed)?n("div",{class:"cover"}):n("div",{style:{display:"none"}}),n("div",{class:"document"},this.pdfUrl?n("verdocs-view",{source:this.pdfUrl,token:this.signerToken,onDocumentRendered:function(t){return e.handleDocumentRendered(t)}}):n("verdocs-loader",null),(((c=this.pdfPageInfo)===null||c===void 0?void 0:c.pages)||[]).map((function(t){var o;return n("div",{class:"page-controls",style:{height:"".concat(t.height,"px"),width:"".concat(t.width,"px"),top:"".concat(t.canvasTop,"px"),margin:"0 auto"}},((o=e.pdfPageInfo)===null||o===void 0?void 0:o.numRendered)>0?e.fields.filter((function(e){return e.page===t.pageNumber})).map((function(t,n){return e.renderField(t,n)})):n("div",{style:{display:"none"}},"Waiting for PDF to render..."))}))))};return e}());F.style=S}}}));
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
System.register(["./p-caed7818.system.js","./p-e93ac86f.system.js","./p-e3659c64.system.js","./p-5dfd73f9.system.js"],(function(e){"use strict";var t,r,n,i,o;return{setters:[function(e){t=e.r;r=e.c;n=e.h},function(e){i=e.l},function(e){o=e.g},function(){}],execute:function(){var s=undefined&&undefined.__awaiter||function(e,t,r,n){function i(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n["throw"](e))}catch(e){o(e)}}function c(e){e.done?r(e.value):i(e.value).then(s,a)}c((n=n.apply(e,t||[])).next())}))};var a=undefined&&undefined.__generator||function(e,t){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(e){return function(t){return c([e,t])}}function c(s){if(n)throw new TypeError("Generator is already executing.");while(r)try{if(n=1,i&&(o=s[0]&2?i["return"]:s[0]?i["throw"]||((o=i["return"])&&o.call(i),0):i.next)&&!(o=o.call(i,s[1])).done)return o;if(i=0,o)s=[s[0]&2,o.value];switch(s[0]){case 0:case 1:o=s;break;case 4:r.label++;return{value:s[1],done:false};case 5:r.label++;i=s[1];s=[0];continue;case 7:s=r.ops.pop();r.trys.pop();continue;default:if(!(o=r.trys,o=o.length>0&&o[o.length-1])&&(s[0]===6||s[0]===2)){r=0;continue}if(s[0]===3&&(!o||s[1]>o[0]&&s[1]<o[3])){r.label=s[1];break}if(s[0]===6&&r.label<o[1]){r.label=o[1];o=s;break}if(o&&r.label<o[2]){r.label=o[2];r.ops.push(s);break}if(o[2])r.ops.pop();r.trys.pop();continue}s=t.call(e,r)}catch(e){s=[6,e];i=0}finally{n=o=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};var c=function(){return s(void 0,void 0,void 0,(function(){return a(this,(function(e){return[2,o().api.get("/search/history").then((function(e){return e.data}))]}))}))};var l=function(e){return o().api.get("/templates/",{params:e}).then((function(e){return e.data}))};var h='<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="#000000"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M8 16h8v2H8zm0-4h8v2H8zm6-10H6c-1.1 0-2 .9-2 2v16c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zm4 18H6V4h7v5h5v11z"/></svg>';var d='verdocs-search-activity{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-search-activity .container{display:-ms-flexbox;display:flex;width:240px;color:#ffffff;-ms-flex-direction:column;flex-direction:column;text-transform:uppercase;padding:10px 10px 20px 10px;background-color:var(--verdocs-background-dark)}verdocs-search-activity .title{font-size:22px;font-weight:700;line-height:30px}verdocs-search-activity .items{display:-ms-flexbox;display:flex;margin-top:20px;-ms-flex-direction:column;flex-direction:column}verdocs-search-activity .item{border:none;display:-ms-flexbox;display:flex;text-align:left;margin-bottom:20px;-ms-flex-direction:row;flex-direction:row;background:transparent}verdocs-search-activity .item:hover{cursor:pointer}verdocs-search-activity .icon{-ms-flex:0 0 22px;flex:0 0 22px;margin-right:14px}verdocs-search-activity .icon svg{fill:#707ae5;width:22px;height:22px}verdocs-search-activity .details{display:-ms-flexbox;display:flex;overflow:hidden;-ms-flex-direction:column;flex-direction:column}verdocs-search-activity .item-title{font-size:16px;font-weight:400;color:#ffffff;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}verdocs-search-activity .info{font-size:14px;font-weight:500;line-height:23px;color:#aeb4bf}verdocs-search-activity .empty{text-transform:none;line-height:22px;color:#ccc}';var p="verdocs-stage";var f=e("verdocs_search_activity",function(){function e(e){t(this,e);this.entrySelected=r(this,"entrySelected",7);this.type="recent";this.emptyMessage="You do not have any starred searches.";this.authFailure=false;this.title="Recent Searches";this.recent=[];this.saved=[];this.starred=[]}e.prototype.componentWillLoad=function(){var e=this;i(p);var t=function(t){var r;console.warn("[Verdocs/search-activity] Error getting search data",t);if(((r=t===null||t===void 0?void 0:t.response)===null||r===void 0?void 0:r.status)===401){e.authFailure=true}};switch(this.type){case"recent":this.title="Recent Searches";this.emptyMessage="You do not have any recent searches.";c().then((function(t){return e.recent=t.recent})).catch(t);break;case"saved":this.title="Saved Searches";this.emptyMessage="You do not have any saved searches.";c().then((function(t){return e.saved=t.saved})).catch(t);break;case"starred":this.title="My Starred items";this.emptyMessage="You do not have any starred templates.";l({is_starred:true}).then((function(t){return e.starred=t})).catch(t);break}};e.prototype.handleSelectEntry=function(e){this.entrySelected.emit(e)};e.prototype.computePagesText=function(e){if(e<2){return"".concat(e," Page")}else{return"".concat(e," Pages")}};e.prototype.computeRecipientsText=function(e){if(typeof e==="object"){return e.join(", ")}else if(e>1){return"".concat(e," Recipients")}else{return"".concat(e," Recipient")}};e.prototype.render=function(){var e=this;var t=this.recent.length<1&&this.saved.length<1&&this.starred.length<1;return n("div",{class:"container"},n("p",{class:"title"},this.title),n("div",{class:"items"},this.recent.map((function(t){return n("button",{class:"item",onClick:function(){return e.handleSelectEntry(t)}},n("div",{class:"icon",innerHTML:h}),n("div",{class:"details"},n("div",{class:"item-title"},t.params.q),n("div",{class:"info"},"Test")))})),this.saved.map((function(t){return n("button",{class:"item",onClick:function(){return e.handleSelectEntry(t)}},n("div",{class:"icon",innerHTML:h}),n("div",{class:"details"},n("div",{class:"item-title"},t.params.q),n("div",{class:"info"})))})),t&&n("div",{class:"empty"},this.authFailure?"Authentication required":this.emptyMessage)))};return e}());f.style=d;var u='<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M23.4809 20.7176L17.9111 15.2536C19.0961 13.6368 19.727 11.6926 19.7128 9.70131C19.7201 7.53345 18.9846 5.42606 17.6244 3.71753C16.2642 2.009 14.3581 0.798456 12.2123 0.280282C10.0665 -0.237892 7.80552 -0.0336342 5.79227 0.86026C3.77902 1.75415 2.13038 3.28582 1.1111 5.20931C0.0918114 7.1328 -0.238985 9.33652 0.171813 11.4666C0.582612 13.5967 1.71117 15.5296 3.37628 16.9548C5.0414 18.3801 7.14646 19.2151 9.35344 19.3257C11.5604 19.4364 13.7413 18.8162 15.5458 17.5649L21.1372 23.05L21.1563 23.0663C21.4841 23.3487 21.9039 23.507 22.3401 23.5128C22.7823 23.5125 23.2063 23.3402 23.5191 23.0337V23.0337C23.6749 22.8812 23.7979 22.6995 23.8804 22.4993C23.963 22.2991 24.0036 22.0847 23.9997 21.8688C23.9959 21.6529 23.9477 21.44 23.858 21.2428C23.7683 21.0456 23.639 20.8682 23.4778 20.7212L23.4809 20.7176ZM14.5167 14.1975C13.4564 15.2349 12.0623 15.8797 10.5719 16.022C9.08145 16.1644 7.58681 15.7955 6.34249 14.9781C5.09816 14.1608 4.18109 12.9456 3.74751 11.5395C3.31393 10.1334 3.39064 8.6233 3.96455 7.26643C4.53846 5.90955 5.57409 4.7898 6.89507 4.09787C8.21606 3.40594 9.74071 3.18461 11.2093 3.4716C12.678 3.75858 13.9998 4.53612 14.9497 5.6718C15.8996 6.80748 16.4188 8.23105 16.4189 9.7001C16.4196 10.5357 16.2519 11.3632 15.9254 12.135C15.599 12.9069 15.1202 13.6078 14.5167 14.1975V14.1975Z" fill="white"/>\n</svg>\n';var v='<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M14.0739 11.7565L19.7127 6.23228C20.0875 5.85692 20.0875 5.25309 19.7127 4.87773L19.0213 4.20046C18.6382 3.82511 18.0219 3.82511 17.6387 4.20046L12 9.72472L6.36127 4.20046C5.97814 3.82511 5.36179 3.82511 4.97866 4.20046L4.28735 4.87773C3.90422 5.25309 3.90422 5.85692 4.28735 6.23228L9.92608 11.7565L4.28735 17.2808C3.90422 17.6561 3.90422 18.26 4.28735 18.6353L4.97866 19.3126C5.36179 19.688 5.97814 19.688 6.36127 19.3126L12 13.7883L17.6387 19.3126C18.0219 19.688 18.6382 19.688 19.0213 19.3126L19.7127 18.6353C20.0958 18.26 20.0958 17.6561 19.7127 17.2808L14.0739 11.7565Z" fill="white"/>\n</svg>\n';var x='verdocs-search-box{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-search-box form{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;height:45px;-webkit-box-sizing:border-box;box-sizing:border-box;margin:5px 0 0;border-radius:5px;-ms-flex-align:center;align-items:center;background-color:#fff;padding:0 8px;border-width:1px;border-style:solid;border-color:var(--verdocs-container-border-color)}verdocs-search-box form input{-webkit-box-sizing:border-box;box-sizing:border-box;height:43px;width:100%;font-size:18px;border:none}verdocs-search-box form input:focus{outline:none}verdocs-search-box form button.search{cursor:pointer;display:-ms-inline-flexbox;display:inline-flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:4px;border:none;width:100px;height:28px;font-weight:700;font-size:10px;letter-spacing:1px;background-color:#50be80;text-transform:uppercase;color:#fff}verdocs-search-box form .type{background-color:#707ae5;height:30px;display:-ms-inline-flexbox;display:inline-flex;padding:1px 0 2px 10px;font-size:13px;line-height:16px;border-radius:4px;-ms-flex-pack:center;justify-content:center;text-transform:uppercase;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;color:#fff;margin-right:10px}verdocs-search-box form .type button{border:none;color:#fff;margin:5px 0 0 8px;background:transparent}verdocs-search-box form svg{width:12px;height:12px;margin-right:6px}verdocs-search-box ::-webkit-input-placeholder{color:#aeb4bf}verdocs-search-box ::-moz-placeholder{color:#aeb4bf}verdocs-search-box :-ms-input-placeholder{color:#aeb4bf}verdocs-search-box ::-ms-input-placeholder{color:#aeb4bf}verdocs-search-box ::placeholder{color:#aeb4bf}';var y=e("verdocs_search_box",function(){function e(e){t(this,e);this.searchClicked=r(this,"searchClicked",7);this.typeChanged=r(this,"typeChanged",7);this.queryChanged=r(this,"queryChanged",7);this.placeholder="search documents, templates, people...";this.type="all";this.query=""}e.prototype.handleSearch=function(e){this.searchClicked.emit({type:this.type,query:this.query});e.preventDefault();return false};e.prototype.handleChange=function(e){this.queryChanged.emit(e.target.value)};e.prototype.handleClearFilter=function(){this.typeChanged.emit("all")};e.prototype.handleKeyUp=function(e){if(e.key==="Enter"){this.searchClicked.emit({type:this.type,query:this.query})}};e.prototype.render=function(){var e=this;return n("form",{onSubmit:function(t){return e.handleSearch(t)}},this.type!==undefined&&this.type!=="all"&&n("span",{class:"type"},this.type,"s ",n("button",{class:"remove",innerHTML:v,onClick:function(){return e.handleClearFilter()}})),n("input",{type:"text",placeholder:this.placeholder,value:this.query,onInput:function(t){return e.handleChange(t)},onKeyUp:function(t){return e.handleKeyUp(t)}}),n("button",{onClick:function(t){return e.handleSearch(t)},class:"search"},n("span",{innerHTML:u}),"Search"))};return e}());y.style=x}}}));
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
System.register(["./p-caed7818.system.js"],(function(e){"use strict";var t,n,i;return{setters:[function(e){t=e.r;n=e.c;i=e.h}],execute:function(){var o='<svg xmlns="http://www.w3.org/2000/svg" enable-background="new 0 0 24 24" height="24px" viewBox="0 0 24 24" width="24px" fill="#000000"><g><rect fill="none" height="24" width="24"/><g><path d="M19,5v14H5V5H19 M19,3H5C3.9,3,3,3.9,3,5v14c0,1.1,0.9,2,2,2h14c1.1,0,2-0.9,2-2V5C21,3.9,20.1,3,19,3L19,3z"/></g><path d="M14,17H7v-2h7V17z M17,13H7v-2h10V13z M17,9H7V7h10V9z"/></g></svg>';var r='<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="#000000"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M8 16h8v2H8zm0-4h8v2H8zm6-10H6c-1.1 0-2 .9-2 2v16c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zm4 18H6V4h7v5h5v11z"/></svg>';var c='verdocs-quick-functions{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-quick-functions .container{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-wrap:nowrap;flex-wrap:nowrap;width:240px;background-color:var(--verdocs-background-dark);text-transform:uppercase;padding:10px 10px 20px 10px;font-family:sans-serif;color:#ffffff}verdocs-quick-functions .title{font-size:22px;font-weight:700;line-height:30px;margin:1em 0 40px 0}verdocs-quick-functions button{width:140px;height:40px;border:none;display:-ms-flexbox;display:flex;color:#ffffff;cursor:pointer;font-size:14px;font-weight:700;line-height:25px;-ms-flex-align:center;align-items:center;margin-bottom:20px;border-radius:5px;text-transform:uppercase;-ms-flex-pack:space-evenly;justify-content:space-evenly;background-color:#50be50}verdocs-quick-functions button svg{fill:#ffffff}';var s=e("verdocs_quick_functions",function(){function e(e){t(this,e);this.createTemplate=n(this,"createTemplate",7);this.createDocument=n(this,"createDocument",7)}e.prototype.handleCreateTemplate=function(){this.createTemplate.emit()};e.prototype.handleCreateDocument=function(){this.createDocument.emit()};e.prototype.render=function(){var e=this;return i("div",{class:"container"},i("p",{class:"title"},"Quick Create"),i("button",{onClick:function(){return e.handleCreateTemplate()},innerHTML:o},"Template"),i("button",{onClick:function(){return e.handleCreateDocument()},innerHTML:r},"Document"))};return e}());s.style=c}}}));
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{g as n,d as t}from"./p-6348272c.js";var r=function(t){return n().api.post("/authentication/login",t).then((function(n){return n.data}))},l=function(t,r){return n().setAuthorization(null),r&&localStorage.removeItem(t),c(t,null),null},a=function(r,a,u){if(void 0===u&&(u=!1),null===a)return l(r,u);var o=t(a||"");return null===o||o.exp&&1e3*o.exp<(new Date).getTime()?l(r,u):(u&&localStorage.setItem(r,a),n().setAuthorization(a),c(r,o),o)},u=function(r){var l=localStorage.getItem(r);if(!l)return null;var a=t(l);return a?a.exp&&1e3*a.exp<(new Date).getTime()?(localStorage.removeItem(r),null):(n().setAuthorization(l),c(r,a),a):null},o=function(n,t){return void 0===t&&(t=!1),l(n,t)},e=new Map,c=function(n,t){e.forEach((function(r){try{r(n,t)}catch(n){}}))};export{r as a,o as e,u as l,a as s}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e,h as s}from"./p-2bc58746.js";const r=class{constructor(s){e(this,s)}render(){return s("div",{class:"container"},s("verdocs-search-box",null),s("div",{class:"boxes"},s("verdocs-search-activity",{type:"recent"}),s("verdocs-search-activity",{type:"saved"}),s("verdocs-search-activity",{type:"starred"}),s("search-quick-functions",null)))}};r.style='verdocs-search{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;display:-ms-flexbox;display:flex;background-color:#1e2031}verdocs-search search-box{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;margin:20px 10px}verdocs-search .boxes{-ms-flex-wrap:wrap;flex-wrap:wrap;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;margin:20px 0}verdocs-search search-recent,verdocs-search search-saved,verdocs-search search-quick-functions,verdocs-search search-starred{display:-ms-flexbox;display:flex;margin:0 20px 20px 0}';export{r as verdocs_search}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
System.register([],(function(t){"use strict";return{execute:function(){t({B:m,a:e,c:n,d:f,g:i});var r=t("b",typeof globalThis!=="undefined"?globalThis:typeof window!=="undefined"?window:typeof global!=="undefined"?global:typeof self!=="undefined"?self:{});function e(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t["default"]:t}function n(t,r,e){return e={path:r,exports:{},require:function(t,r){return f()}},t(e,e.exports),e.exports}function i(t){if(t.__esModule)return t;var r=Object.defineProperty({},"__esModule",{value:true});Object.keys(t).forEach((function(e){var n=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(r,e,n.get?n:{enumerable:true,get:function(){return t[e]}})}));return r}function f(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}var o=t("p",r.process);var u=typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{};var s=[];var a=[];var h=typeof Uint8Array!=="undefined"?Uint8Array:Array;var l=false;function c(){l=true;var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var r=0,e=t.length;r<e;++r){s[r]=t[r];a[t.charCodeAt(r)]=r}a["-".charCodeAt(0)]=62;a["_".charCodeAt(0)]=63}function p(t){if(!l){c()}var r,e,n,i,f,o;var u=t.length;if(u%4>0){throw new Error("Invalid string. Length must be a multiple of 4")}f=t[u-2]==="="?2:t[u-1]==="="?1:0;o=new h(u*3/4-f);n=f>0?u-4:u;var s=0;for(r=0,e=0;r<n;r+=4,e+=3){i=a[t.charCodeAt(r)]<<18|a[t.charCodeAt(r+1)]<<12|a[t.charCodeAt(r+2)]<<6|a[t.charCodeAt(r+3)];o[s++]=i>>16&255;o[s++]=i>>8&255;o[s++]=i&255}if(f===2){i=a[t.charCodeAt(r)]<<2|a[t.charCodeAt(r+1)]>>4;o[s++]=i&255}else if(f===1){i=a[t.charCodeAt(r)]<<10|a[t.charCodeAt(r+1)]<<4|a[t.charCodeAt(r+2)]>>2;o[s++]=i>>8&255;o[s++]=i&255}return o}function g(t){return s[t>>18&63]+s[t>>12&63]+s[t>>6&63]+s[t&63]}function y(t,r,e){var n;var i=[];for(var f=r;f<e;f+=3){n=(t[f]<<16)+(t[f+1]<<8)+t[f+2];i.push(g(n))}return i.join("")}function d(t){if(!l){c()}var r;var e=t.length;var n=e%3;var i="";var f=[];var o=16383;for(var u=0,a=e-n;u<a;u+=o){f.push(y(t,u,u+o>a?a:u+o))}if(n===1){r=t[e-1];i+=s[r>>2];i+=s[r<<4&63];i+="=="}else if(n===2){r=(t[e-2]<<8)+t[e-1];i+=s[r>>10];i+=s[r>>4&63];i+=s[r<<2&63];i+="="}f.push(i);return f.join("")}function v(t,r,e,n,i){var f,o;var u=i*8-n-1;var s=(1<<u)-1;var a=s>>1;var h=-7;var l=e?i-1:0;var c=e?-1:1;var p=t[r+l];l+=c;f=p&(1<<-h)-1;p>>=-h;h+=u;for(;h>0;f=f*256+t[r+l],l+=c,h-=8){}o=f&(1<<-h)-1;f>>=-h;h+=n;for(;h>0;o=o*256+t[r+l],l+=c,h-=8){}if(f===0){f=1-a}else if(f===s){return o?NaN:(p?-1:1)*Infinity}else{o=o+Math.pow(2,n);f=f-a}return(p?-1:1)*o*Math.pow(2,f-n)}function w(t,r,e,n,i,f){var o,u,s;var a=f*8-i-1;var h=(1<<a)-1;var l=h>>1;var c=i===23?Math.pow(2,-24)-Math.pow(2,-77):0;var p=n?0:f-1;var g=n?1:-1;var y=r<0||r===0&&1/r<0?1:0;r=Math.abs(r);if(isNaN(r)||r===Infinity){u=isNaN(r)?1:0;o=h}else{o=Math.floor(Math.log(r)/Math.LN2);if(r*(s=Math.pow(2,-o))<1){o--;s*=2}if(o+l>=1){r+=c/s}else{r+=c*Math.pow(2,1-l)}if(r*s>=2){o++;s/=2}if(o+l>=h){u=0;o=h}else if(o+l>=1){u=(r*s-1)*Math.pow(2,i);o=o+l}else{u=r*Math.pow(2,l-1)*Math.pow(2,i);o=0}}for(;i>=8;t[e+p]=u&255,p+=g,u/=256,i-=8){}o=o<<i|u;a+=i;for(;a>0;t[e+p]=o&255,p+=g,o/=256,a-=8){}t[e+p-g]|=y*128}var E={}.toString;var A=Array.isArray||function(t){return E.call(t)=="[object Array]"};
|
|
2
|
-
/*!
|
|
3
|
-
* The buffer module from node.js, for the browser.
|
|
4
|
-
*
|
|
5
|
-
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
|
|
6
|
-
* @license MIT
|
|
7
|
-
*/var b=50;m.TYPED_ARRAY_SUPPORT=u.TYPED_ARRAY_SUPPORT!==undefined?u.TYPED_ARRAY_SUPPORT:true;function R(){return m.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function _(t,r){if(R()<r){throw new RangeError("Invalid typed array length")}if(m.TYPED_ARRAY_SUPPORT){t=new Uint8Array(r);t.__proto__=m.prototype}else{if(t===null){t=new m(r)}t.length=r}return t}function m(t,r,e){if(!m.TYPED_ARRAY_SUPPORT&&!(this instanceof m)){return new m(t,r,e)}if(typeof t==="number"){if(typeof r==="string"){throw new Error("If encoding is specified then the first argument must be a string")}return B(this,t)}return P(this,t,r,e)}m.poolSize=8192;m._augment=function(t){t.__proto__=m.prototype;return t};function P(t,r,e,n){if(typeof r==="number"){throw new TypeError('"value" argument must not be a number')}if(typeof ArrayBuffer!=="undefined"&&r instanceof ArrayBuffer){return I(t,r,e,n)}if(typeof r==="string"){return S(t,r,e)}return O(t,r)}m.from=function(t,r,e){return P(null,t,r,e)};if(m.TYPED_ARRAY_SUPPORT){m.prototype.__proto__=Uint8Array.prototype;m.__proto__=Uint8Array}function T(t){if(typeof t!=="number"){throw new TypeError('"size" argument must be a number')}else if(t<0){throw new RangeError('"size" argument must not be negative')}}function U(t,r,e,n){T(r);if(r<=0){return _(t,r)}if(e!==undefined){return typeof n==="string"?_(t,r).fill(e,n):_(t,r).fill(e)}return _(t,r)}m.alloc=function(t,r,e){return U(null,t,r,e)};function B(t,r){T(r);t=_(t,r<0?0:C(r)|0);if(!m.TYPED_ARRAY_SUPPORT){for(var e=0;e<r;++e){t[e]=0}}return t}m.allocUnsafe=function(t){return B(null,t)};m.allocUnsafeSlow=function(t){return B(null,t)};function S(t,r,e){if(typeof e!=="string"||e===""){e="utf8"}if(!m.isEncoding(e)){throw new TypeError('"encoding" must be a valid string encoding')}var n=D(r,e)|0;t=_(t,n);var i=t.write(r,e);if(i!==n){t=t.slice(0,i)}return t}function Y(t,r){var e=r.length<0?0:C(r.length)|0;t=_(t,e);for(var n=0;n<e;n+=1){t[n]=r[n]&255}return t}function I(t,r,e,n){if(e<0||r.byteLength<e){throw new RangeError("'offset' is out of bounds")}if(r.byteLength<e+(n||0)){throw new RangeError("'length' is out of bounds")}if(e===undefined&&n===undefined){r=new Uint8Array(r)}else if(n===undefined){r=new Uint8Array(r,e)}else{r=new Uint8Array(r,e,n)}if(m.TYPED_ARRAY_SUPPORT){t=r;t.__proto__=m.prototype}else{t=Y(t,r)}return t}function O(t,r){if(M(r)){var e=C(r.length)|0;t=_(t,e);if(t.length===0){return t}r.copy(t,0,0,e);return t}if(r){if(typeof ArrayBuffer!=="undefined"&&r.buffer instanceof ArrayBuffer||"length"in r){if(typeof r.length!=="number"||dt(r.length)){return _(t,0)}return Y(t,r)}if(r.type==="Buffer"&&A(r.data)){return Y(t,r.data)}}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function C(t){if(t>=R()){throw new RangeError("Attempt to allocate Buffer larger than maximum "+"size: 0x"+R().toString(16)+" bytes")}return t|0}m.isBuffer=vt;function M(t){return!!(t!=null&&t._isBuffer)}m.compare=function t(r,e){if(!M(r)||!M(e)){throw new TypeError("Arguments must be Buffers")}if(r===e)return 0;var n=r.length;var i=e.length;for(var f=0,o=Math.min(n,i);f<o;++f){if(r[f]!==e[f]){n=r[f];i=e[f];break}}if(n<i)return-1;if(i<n)return 1;return 0};m.isEncoding=function t(r){switch(String(r).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return true;default:return false}};m.concat=function t(r,e){if(!A(r)){throw new TypeError('"list" argument must be an Array of Buffers')}if(r.length===0){return m.alloc(0)}var n;if(e===undefined){e=0;for(n=0;n<r.length;++n){e+=r[n].length}}var i=m.allocUnsafe(e);var f=0;for(n=0;n<r.length;++n){var o=r[n];if(!M(o)){throw new TypeError('"list" argument must be an Array of Buffers')}o.copy(i,f);f+=o.length}return i};function D(t,r){if(M(t)){return t.length}if(typeof ArrayBuffer!=="undefined"&&typeof ArrayBuffer.isView==="function"&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer)){return t.byteLength}if(typeof t!=="string"){t=""+t}var e=t.length;if(e===0)return 0;var n=false;for(;;){switch(r){case"ascii":case"latin1":case"binary":return e;case"utf8":case"utf-8":case undefined:return lt(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return e*2;case"hex":return e>>>1;case"base64":return gt(t).length;default:if(n)return lt(t).length;r=(""+r).toLowerCase();n=true}}}m.byteLength=D;function L(t,r,e){var n=false;if(r===undefined||r<0){r=0}if(r>this.length){return""}if(e===undefined||e>this.length){e=this.length}if(e<=0){return""}e>>>=0;r>>>=0;if(e<=r){return""}if(!t)t="utf8";while(true){switch(t){case"hex":return X(this,r,e);case"utf8":case"utf-8":return G(this,r,e);case"ascii":return Q(this,r,e);case"latin1":case"binary":return W(this,r,e);case"base64":return Z(this,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return $(this,r,e);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase();n=true}}}m.prototype._isBuffer=true;function x(t,r,e){var n=t[r];t[r]=t[e];t[e]=n}m.prototype.swap16=function t(){var r=this.length;if(r%2!==0){throw new RangeError("Buffer size must be a multiple of 16-bits")}for(var e=0;e<r;e+=2){x(this,e,e+1)}return this};m.prototype.swap32=function t(){var r=this.length;if(r%4!==0){throw new RangeError("Buffer size must be a multiple of 32-bits")}for(var e=0;e<r;e+=4){x(this,e,e+3);x(this,e+1,e+2)}return this};m.prototype.swap64=function t(){var r=this.length;if(r%8!==0){throw new RangeError("Buffer size must be a multiple of 64-bits")}for(var e=0;e<r;e+=8){x(this,e,e+7);x(this,e+1,e+6);x(this,e+2,e+5);x(this,e+3,e+4)}return this};m.prototype.toString=function t(){var r=this.length|0;if(r===0)return"";if(arguments.length===0)return G(this,0,r);return L.apply(this,arguments)};m.prototype.equals=function t(r){if(!M(r))throw new TypeError("Argument must be a Buffer");if(this===r)return true;return m.compare(this,r)===0};m.prototype.inspect=function t(){var r="";var e=b;if(this.length>0){r=this.toString("hex",0,e).match(/.{2}/g).join(" ");if(this.length>e)r+=" ... "}return"<Buffer "+r+">"};m.prototype.compare=function t(r,e,n,i,f){if(!M(r)){throw new TypeError("Argument must be a Buffer")}if(e===undefined){e=0}if(n===undefined){n=r?r.length:0}if(i===undefined){i=0}if(f===undefined){f=this.length}if(e<0||n>r.length||i<0||f>this.length){throw new RangeError("out of range index")}if(i>=f&&e>=n){return 0}if(i>=f){return-1}if(e>=n){return 1}e>>>=0;n>>>=0;i>>>=0;f>>>=0;if(this===r)return 0;var o=f-i;var u=n-e;var s=Math.min(o,u);var a=this.slice(i,f);var h=r.slice(e,n);for(var l=0;l<s;++l){if(a[l]!==h[l]){o=a[l];u=h[l];break}}if(o<u)return-1;if(u<o)return 1;return 0};function k(t,r,e,n,i){if(t.length===0)return-1;if(typeof e==="string"){n=e;e=0}else if(e>2147483647){e=2147483647}else if(e<-2147483648){e=-2147483648}e=+e;if(isNaN(e)){e=i?0:t.length-1}if(e<0)e=t.length+e;if(e>=t.length){if(i)return-1;else e=t.length-1}else if(e<0){if(i)e=0;else return-1}if(typeof r==="string"){r=m.from(r,n)}if(M(r)){if(r.length===0){return-1}return N(t,r,e,n,i)}else if(typeof r==="number"){r=r&255;if(m.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf==="function"){if(i){return Uint8Array.prototype.indexOf.call(t,r,e)}else{return Uint8Array.prototype.lastIndexOf.call(t,r,e)}}return N(t,[r],e,n,i)}throw new TypeError("val must be string, number or Buffer")}function N(t,r,e,n,i){var f=1;var o=t.length;var u=r.length;if(n!==undefined){n=String(n).toLowerCase();if(n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le"){if(t.length<2||r.length<2){return-1}f=2;o/=2;u/=2;e/=2}}function s(t,r){if(f===1){return t[r]}else{return t.readUInt16BE(r*f)}}var a;if(i){var h=-1;for(a=e;a<o;a++){if(s(t,a)===s(r,h===-1?0:a-h)){if(h===-1)h=a;if(a-h+1===u)return h*f}else{if(h!==-1)a-=a-h;h=-1}}}else{if(e+u>o)e=o-u;for(a=e;a>=0;a--){var l=true;for(var c=0;c<u;c++){if(s(t,a+c)!==s(r,c)){l=false;break}}if(l)return a}}return-1}m.prototype.includes=function t(r,e,n){return this.indexOf(r,e,n)!==-1};m.prototype.indexOf=function t(r,e,n){return k(this,r,e,n,true)};m.prototype.lastIndexOf=function t(r,e,n){return k(this,r,e,n,false)};function j(t,r,e,n){e=Number(e)||0;var i=t.length-e;if(!n){n=i}else{n=Number(n);if(n>i){n=i}}var f=r.length;if(f%2!==0)throw new TypeError("Invalid hex string");if(n>f/2){n=f/2}for(var o=0;o<n;++o){var u=parseInt(r.substr(o*2,2),16);if(isNaN(u))return o;t[e+o]=u}return o}function z(t,r,e,n){return yt(lt(r,t.length-e),t,e,n)}function F(t,r,e,n){return yt(ct(r),t,e,n)}function q(t,r,e,n){return F(t,r,e,n)}function V(t,r,e,n){return yt(gt(r),t,e,n)}function J(t,r,e,n){return yt(pt(r,t.length-e),t,e,n)}m.prototype.write=function t(r,e,n,i){if(e===undefined){i="utf8";n=this.length;e=0}else if(n===undefined&&typeof e==="string"){i=e;n=this.length;e=0}else if(isFinite(e)){e=e|0;if(isFinite(n)){n=n|0;if(i===undefined)i="utf8"}else{i=n;n=undefined}}else{throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported")}var f=this.length-e;if(n===undefined||n>f)n=f;if(r.length>0&&(n<0||e<0)||e>this.length){throw new RangeError("Attempt to write outside buffer bounds")}if(!i)i="utf8";var o=false;for(;;){switch(i){case"hex":return j(this,r,e,n);case"utf8":case"utf-8":return z(this,r,e,n);case"ascii":return F(this,r,e,n);case"latin1":case"binary":return q(this,r,e,n);case"base64":return V(this,r,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return J(this,r,e,n);default:if(o)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase();o=true}}};m.prototype.toJSON=function t(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Z(t,r,e){if(r===0&&e===t.length){return d(t)}else{return d(t.slice(r,e))}}function G(t,r,e){e=Math.min(t.length,e);var n=[];var i=r;while(i<e){var f=t[i];var o=null;var u=f>239?4:f>223?3:f>191?2:1;if(i+u<=e){var s,a,h,l;switch(u){case 1:if(f<128){o=f}break;case 2:s=t[i+1];if((s&192)===128){l=(f&31)<<6|s&63;if(l>127){o=l}}break;case 3:s=t[i+1];a=t[i+2];if((s&192)===128&&(a&192)===128){l=(f&15)<<12|(s&63)<<6|a&63;if(l>2047&&(l<55296||l>57343)){o=l}}break;case 4:s=t[i+1];a=t[i+2];h=t[i+3];if((s&192)===128&&(a&192)===128&&(h&192)===128){l=(f&15)<<18|(s&63)<<12|(a&63)<<6|h&63;if(l>65535&&l<1114112){o=l}}}}if(o===null){o=65533;u=1}else if(o>65535){o-=65536;n.push(o>>>10&1023|55296);o=56320|o&1023}n.push(o);i+=u}return K(n)}var H=4096;function K(t){var r=t.length;if(r<=H){return String.fromCharCode.apply(String,t)}var e="";var n=0;while(n<r){e+=String.fromCharCode.apply(String,t.slice(n,n+=H))}return e}function Q(t,r,e){var n="";e=Math.min(t.length,e);for(var i=r;i<e;++i){n+=String.fromCharCode(t[i]&127)}return n}function W(t,r,e){var n="";e=Math.min(t.length,e);for(var i=r;i<e;++i){n+=String.fromCharCode(t[i])}return n}function X(t,r,e){var n=t.length;if(!r||r<0)r=0;if(!e||e<0||e>n)e=n;var i="";for(var f=r;f<e;++f){i+=ht(t[f])}return i}function $(t,r,e){var n=t.slice(r,e);var i="";for(var f=0;f<n.length;f+=2){i+=String.fromCharCode(n[f]+n[f+1]*256)}return i}m.prototype.slice=function t(r,e){var n=this.length;r=~~r;e=e===undefined?n:~~e;if(r<0){r+=n;if(r<0)r=0}else if(r>n){r=n}if(e<0){e+=n;if(e<0)e=0}else if(e>n){e=n}if(e<r)e=r;var i;if(m.TYPED_ARRAY_SUPPORT){i=this.subarray(r,e);i.__proto__=m.prototype}else{var f=e-r;i=new m(f,undefined);for(var o=0;o<f;++o){i[o]=this[o+r]}}return i};function tt(t,r,e){if(t%1!==0||t<0)throw new RangeError("offset is not uint");if(t+r>e)throw new RangeError("Trying to access beyond buffer length")}m.prototype.readUIntLE=function t(r,e,n){r=r|0;e=e|0;if(!n)tt(r,e,this.length);var i=this[r];var f=1;var o=0;while(++o<e&&(f*=256)){i+=this[r+o]*f}return i};m.prototype.readUIntBE=function t(r,e,n){r=r|0;e=e|0;if(!n){tt(r,e,this.length)}var i=this[r+--e];var f=1;while(e>0&&(f*=256)){i+=this[r+--e]*f}return i};m.prototype.readUInt8=function t(r,e){if(!e)tt(r,1,this.length);return this[r]};m.prototype.readUInt16LE=function t(r,e){if(!e)tt(r,2,this.length);return this[r]|this[r+1]<<8};m.prototype.readUInt16BE=function t(r,e){if(!e)tt(r,2,this.length);return this[r]<<8|this[r+1]};m.prototype.readUInt32LE=function t(r,e){if(!e)tt(r,4,this.length);return(this[r]|this[r+1]<<8|this[r+2]<<16)+this[r+3]*16777216};m.prototype.readUInt32BE=function t(r,e){if(!e)tt(r,4,this.length);return this[r]*16777216+(this[r+1]<<16|this[r+2]<<8|this[r+3])};m.prototype.readIntLE=function t(r,e,n){r=r|0;e=e|0;if(!n)tt(r,e,this.length);var i=this[r];var f=1;var o=0;while(++o<e&&(f*=256)){i+=this[r+o]*f}f*=128;if(i>=f)i-=Math.pow(2,8*e);return i};m.prototype.readIntBE=function t(r,e,n){r=r|0;e=e|0;if(!n)tt(r,e,this.length);var i=e;var f=1;var o=this[r+--i];while(i>0&&(f*=256)){o+=this[r+--i]*f}f*=128;if(o>=f)o-=Math.pow(2,8*e);return o};m.prototype.readInt8=function t(r,e){if(!e)tt(r,1,this.length);if(!(this[r]&128))return this[r];return(255-this[r]+1)*-1};m.prototype.readInt16LE=function t(r,e){if(!e)tt(r,2,this.length);var n=this[r]|this[r+1]<<8;return n&32768?n|4294901760:n};m.prototype.readInt16BE=function t(r,e){if(!e)tt(r,2,this.length);var n=this[r+1]|this[r]<<8;return n&32768?n|4294901760:n};m.prototype.readInt32LE=function t(r,e){if(!e)tt(r,4,this.length);return this[r]|this[r+1]<<8|this[r+2]<<16|this[r+3]<<24};m.prototype.readInt32BE=function t(r,e){if(!e)tt(r,4,this.length);return this[r]<<24|this[r+1]<<16|this[r+2]<<8|this[r+3]};m.prototype.readFloatLE=function t(r,e){if(!e)tt(r,4,this.length);return v(this,r,true,23,4)};m.prototype.readFloatBE=function t(r,e){if(!e)tt(r,4,this.length);return v(this,r,false,23,4)};m.prototype.readDoubleLE=function t(r,e){if(!e)tt(r,8,this.length);return v(this,r,true,52,8)};m.prototype.readDoubleBE=function t(r,e){if(!e)tt(r,8,this.length);return v(this,r,false,52,8)};function rt(t,r,e,n,i,f){if(!M(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>i||r<f)throw new RangeError('"value" argument is out of bounds');if(e+n>t.length)throw new RangeError("Index out of range")}m.prototype.writeUIntLE=function t(r,e,n,i){r=+r;e=e|0;n=n|0;if(!i){var f=Math.pow(2,8*n)-1;rt(this,r,e,n,f,0)}var o=1;var u=0;this[e]=r&255;while(++u<n&&(o*=256)){this[e+u]=r/o&255}return e+n};m.prototype.writeUIntBE=function t(r,e,n,i){r=+r;e=e|0;n=n|0;if(!i){var f=Math.pow(2,8*n)-1;rt(this,r,e,n,f,0)}var o=n-1;var u=1;this[e+o]=r&255;while(--o>=0&&(u*=256)){this[e+o]=r/u&255}return e+n};m.prototype.writeUInt8=function t(r,e,n){r=+r;e=e|0;if(!n)rt(this,r,e,1,255,0);if(!m.TYPED_ARRAY_SUPPORT)r=Math.floor(r);this[e]=r&255;return e+1};function et(t,r,e,n){if(r<0)r=65535+r+1;for(var i=0,f=Math.min(t.length-e,2);i<f;++i){t[e+i]=(r&255<<8*(n?i:1-i))>>>(n?i:1-i)*8}}m.prototype.writeUInt16LE=function t(r,e,n){r=+r;e=e|0;if(!n)rt(this,r,e,2,65535,0);if(m.TYPED_ARRAY_SUPPORT){this[e]=r&255;this[e+1]=r>>>8}else{et(this,r,e,true)}return e+2};m.prototype.writeUInt16BE=function t(r,e,n){r=+r;e=e|0;if(!n)rt(this,r,e,2,65535,0);if(m.TYPED_ARRAY_SUPPORT){this[e]=r>>>8;this[e+1]=r&255}else{et(this,r,e,false)}return e+2};function nt(t,r,e,n){if(r<0)r=4294967295+r+1;for(var i=0,f=Math.min(t.length-e,4);i<f;++i){t[e+i]=r>>>(n?i:3-i)*8&255}}m.prototype.writeUInt32LE=function t(r,e,n){r=+r;e=e|0;if(!n)rt(this,r,e,4,4294967295,0);if(m.TYPED_ARRAY_SUPPORT){this[e+3]=r>>>24;this[e+2]=r>>>16;this[e+1]=r>>>8;this[e]=r&255}else{nt(this,r,e,true)}return e+4};m.prototype.writeUInt32BE=function t(r,e,n){r=+r;e=e|0;if(!n)rt(this,r,e,4,4294967295,0);if(m.TYPED_ARRAY_SUPPORT){this[e]=r>>>24;this[e+1]=r>>>16;this[e+2]=r>>>8;this[e+3]=r&255}else{nt(this,r,e,false)}return e+4};m.prototype.writeIntLE=function t(r,e,n,i){r=+r;e=e|0;if(!i){var f=Math.pow(2,8*n-1);rt(this,r,e,n,f-1,-f)}var o=0;var u=1;var s=0;this[e]=r&255;while(++o<n&&(u*=256)){if(r<0&&s===0&&this[e+o-1]!==0){s=1}this[e+o]=(r/u>>0)-s&255}return e+n};m.prototype.writeIntBE=function t(r,e,n,i){r=+r;e=e|0;if(!i){var f=Math.pow(2,8*n-1);rt(this,r,e,n,f-1,-f)}var o=n-1;var u=1;var s=0;this[e+o]=r&255;while(--o>=0&&(u*=256)){if(r<0&&s===0&&this[e+o+1]!==0){s=1}this[e+o]=(r/u>>0)-s&255}return e+n};m.prototype.writeInt8=function t(r,e,n){r=+r;e=e|0;if(!n)rt(this,r,e,1,127,-128);if(!m.TYPED_ARRAY_SUPPORT)r=Math.floor(r);if(r<0)r=255+r+1;this[e]=r&255;return e+1};m.prototype.writeInt16LE=function t(r,e,n){r=+r;e=e|0;if(!n)rt(this,r,e,2,32767,-32768);if(m.TYPED_ARRAY_SUPPORT){this[e]=r&255;this[e+1]=r>>>8}else{et(this,r,e,true)}return e+2};m.prototype.writeInt16BE=function t(r,e,n){r=+r;e=e|0;if(!n)rt(this,r,e,2,32767,-32768);if(m.TYPED_ARRAY_SUPPORT){this[e]=r>>>8;this[e+1]=r&255}else{et(this,r,e,false)}return e+2};m.prototype.writeInt32LE=function t(r,e,n){r=+r;e=e|0;if(!n)rt(this,r,e,4,2147483647,-2147483648);if(m.TYPED_ARRAY_SUPPORT){this[e]=r&255;this[e+1]=r>>>8;this[e+2]=r>>>16;this[e+3]=r>>>24}else{nt(this,r,e,true)}return e+4};m.prototype.writeInt32BE=function t(r,e,n){r=+r;e=e|0;if(!n)rt(this,r,e,4,2147483647,-2147483648);if(r<0)r=4294967295+r+1;if(m.TYPED_ARRAY_SUPPORT){this[e]=r>>>24;this[e+1]=r>>>16;this[e+2]=r>>>8;this[e+3]=r&255}else{nt(this,r,e,false)}return e+4};function it(t,r,e,n,i,f){if(e+n>t.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function ft(t,r,e,n,i){if(!i){it(t,r,e,4)}w(t,r,e,n,23,4);return e+4}m.prototype.writeFloatLE=function t(r,e,n){return ft(this,r,e,true,n)};m.prototype.writeFloatBE=function t(r,e,n){return ft(this,r,e,false,n)};function ot(t,r,e,n,i){if(!i){it(t,r,e,8)}w(t,r,e,n,52,8);return e+8}m.prototype.writeDoubleLE=function t(r,e,n){return ot(this,r,e,true,n)};m.prototype.writeDoubleBE=function t(r,e,n){return ot(this,r,e,false,n)};m.prototype.copy=function t(r,e,n,i){if(!n)n=0;if(!i&&i!==0)i=this.length;if(e>=r.length)e=r.length;if(!e)e=0;if(i>0&&i<n)i=n;if(i===n)return 0;if(r.length===0||this.length===0)return 0;if(e<0){throw new RangeError("targetStart out of bounds")}if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");if(i>this.length)i=this.length;if(r.length-e<i-n){i=r.length-e+n}var f=i-n;var o;if(this===r&&n<e&&e<i){for(o=f-1;o>=0;--o){r[o+e]=this[o+n]}}else if(f<1e3||!m.TYPED_ARRAY_SUPPORT){for(o=0;o<f;++o){r[o+e]=this[o+n]}}else{Uint8Array.prototype.set.call(r,this.subarray(n,n+f),e)}return f};m.prototype.fill=function t(r,e,n,i){if(typeof r==="string"){if(typeof e==="string"){i=e;e=0;n=this.length}else if(typeof n==="string"){i=n;n=this.length}if(r.length===1){var f=r.charCodeAt(0);if(f<256){r=f}}if(i!==undefined&&typeof i!=="string"){throw new TypeError("encoding must be a string")}if(typeof i==="string"&&!m.isEncoding(i)){throw new TypeError("Unknown encoding: "+i)}}else if(typeof r==="number"){r=r&255}if(e<0||this.length<e||this.length<n){throw new RangeError("Out of range index")}if(n<=e){return this}e=e>>>0;n=n===undefined?this.length:n>>>0;if(!r)r=0;var o;if(typeof r==="number"){for(o=e;o<n;++o){this[o]=r}}else{var u=M(r)?r:lt(new m(r,i).toString());var s=u.length;for(o=0;o<n-e;++o){this[o+e]=u[o%s]}}return this};var ut=/[^+\/0-9A-Za-z-_]/g;function st(t){t=at(t).replace(ut,"");if(t.length<2)return"";while(t.length%4!==0){t=t+"="}return t}function at(t){if(t.trim)return t.trim();return t.replace(/^\s+|\s+$/g,"")}function ht(t){if(t<16)return"0"+t.toString(16);return t.toString(16)}function lt(t,r){r=r||Infinity;var e;var n=t.length;var i=null;var f=[];for(var o=0;o<n;++o){e=t.charCodeAt(o);if(e>55295&&e<57344){if(!i){if(e>56319){if((r-=3)>-1)f.push(239,191,189);continue}else if(o+1===n){if((r-=3)>-1)f.push(239,191,189);continue}i=e;continue}if(e<56320){if((r-=3)>-1)f.push(239,191,189);i=e;continue}e=(i-55296<<10|e-56320)+65536}else if(i){if((r-=3)>-1)f.push(239,191,189)}i=null;if(e<128){if((r-=1)<0)break;f.push(e)}else if(e<2048){if((r-=2)<0)break;f.push(e>>6|192,e&63|128)}else if(e<65536){if((r-=3)<0)break;f.push(e>>12|224,e>>6&63|128,e&63|128)}else if(e<1114112){if((r-=4)<0)break;f.push(e>>18|240,e>>12&63|128,e>>6&63|128,e&63|128)}else{throw new Error("Invalid code point")}}return f}function ct(t){var r=[];for(var e=0;e<t.length;++e){r.push(t.charCodeAt(e)&255)}return r}function pt(t,r){var e,n,i;var f=[];for(var o=0;o<t.length;++o){if((r-=2)<0)break;e=t.charCodeAt(o);n=e>>8;i=e%256;f.push(i);f.push(n)}return f}function gt(t){return p(st(t))}function yt(t,r,e,n){for(var i=0;i<n;++i){if(i+e>=r.length||i>=t.length)break;r[i+e]=t[i]}return i}function dt(t){return t!==t}function vt(t){return t!=null&&(!!t._isBuffer||wt(t)||Et(t))}function wt(t){return!!t.constructor&&typeof t.constructor.isBuffer==="function"&&t.constructor.isBuffer(t)}function Et(t){return typeof t.readFloatLE==="function"&&typeof t.slice==="function"&&wt(t.slice(0,0))}}}}));
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{B as t,p as n}from"./p-ef932a87.js";var e,r=function(t,n){return function(){for(var e=new Array(arguments.length),r=0;r<e.length;r++)e[r]=arguments[r];return t.apply(n,e)}},i=Object.prototype.toString,o=(e=Object.create(null),function(t){var n=i.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())});function u(t){return t=t.toLowerCase(),function(n){return o(n)===t}}function f(t){return Array.isArray(t)}function a(t){return void 0===t}var c=u("ArrayBuffer");function s(t){return null!==t&&"object"==typeof t}function l(t){if("object"!==o(t))return!1;var n=Object.getPrototypeOf(t);return null===n||n===Object.prototype}var h=u("Date"),d=u("File"),v=u("Blob"),p=u("FileList");function m(t){return"[object Function]"===i.call(t)}var b=u("URLSearchParams");function w(t,n){if(null!=t)if("object"!=typeof t&&(t=[t]),f(t))for(var e=0,r=t.length;e<r;e++)n.call(null,t[e],e,t);else for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&n.call(null,t[i],i,t)}var y,g=(y="undefined"!=typeof Uint8Array&&Object.getPrototypeOf(Uint8Array),function(t){return y&&t instanceof y}),O={isArray:f,isArrayBuffer:c,isBuffer:function(t){return null!==t&&!a(t)&&null!==t.constructor&&!a(t.constructor)&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)},isFormData:function(t){var n="[object FormData]";return t&&("function"==typeof FormData&&t instanceof FormData||i.call(t)===n||m(t.toString)&&t.toString()===n)},isArrayBufferView:function(t){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&c(t.buffer)},isString:function(t){return"string"==typeof t},isNumber:function(t){return"number"==typeof t},isObject:s,isPlainObject:l,isUndefined:a,isDate:h,isFile:d,isBlob:v,isFunction:m,isStream:function(t){return s(t)&&m(t.pipe)},isURLSearchParams:b,isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&"undefined"!=typeof window&&"undefined"!=typeof document},forEach:w,merge:function t(){var n={};function e(e,r){n[r]=l(n[r])&&l(e)?t(n[r],e):l(e)?t({},e):f(e)?e.slice():e}for(var r=0,i=arguments.length;r<i;r++)w(arguments[r],e);return n},extend:function(t,n,e){return w(n,(function(n,i){t[i]=e&&"function"==typeof n?r(n,e):n})),t},trim:function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")},stripBOM:function(t){return 65279===t.charCodeAt(0)&&(t=t.slice(1)),t},inherits:function(t,n,e,r){t.prototype=Object.create(n.prototype,r),t.prototype.constructor=t,e&&Object.assign(t.prototype,e)},toFlatObject:function(t,n,e){var r,i,o,u={};n=n||{};do{for(i=(r=Object.getOwnPropertyNames(t)).length;i-- >0;)u[o=r[i]]||(n[o]=t[o],u[o]=!0);t=Object.getPrototypeOf(t)}while(t&&(!e||e(t,n))&&t!==Object.prototype);return n},kindOf:o,kindOfTest:u,endsWith:function(t,n,e){t=String(t),(void 0===e||e>t.length)&&(e=t.length);var r=t.indexOf(n,e-=n.length);return-1!==r&&r===e},toArray:function(t){if(!t)return null;var n=t.length;if(a(n))return null;for(var e=new Array(n);n-- >0;)e[n]=t[n];return e},isTypedArray:g,isFileList:p};function j(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}var E=function(t,n,e){if(!n)return t;var r;if(e)r=e(n);else if(O.isURLSearchParams(n))r=n.toString();else{var i=[];O.forEach(n,(function(t,n){null!=t&&(O.isArray(t)?n+="[]":t=[t],O.forEach(t,(function(t){O.isDate(t)?t=t.toISOString():O.isObject(t)&&(t=JSON.stringify(t)),i.push(j(n)+"="+j(t))})))})),r=i.join("&")}if(r){var o=t.indexOf("#");-1!==o&&(t=t.slice(0,o)),t+=(-1===t.indexOf("?")?"?":"&")+r}return t};function R(){this.handlers=[]}R.prototype.use=function(t,n,e){return this.handlers.push({fulfilled:t,rejected:n,synchronous:!!e&&e.synchronous,runWhen:e?e.runWhen:null}),this.handlers.length-1},R.prototype.eject=function(t){this.handlers[t]&&(this.handlers[t]=null)},R.prototype.forEach=function(t){O.forEach(this.handlers,(function(n){null!==n&&t(n)}))};var S=R,A=function(t,n){O.forEach(t,(function(e,r){r!==n&&r.toUpperCase()===n.toUpperCase()&&(t[n]=e,delete t[r])}))};function N(t,n,e,r,i){Error.call(this),this.message=t,this.name="AxiosError",n&&(this.code=n),e&&(this.config=e),r&&(this.request=r),i&&(this.response=i)}O.inherits(N,Error,{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}}});var T=N.prototype,x={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED"].forEach((function(t){x[t]={value:t}})),Object.defineProperties(N,x),Object.defineProperty(T,"isAxiosError",{value:!0}),N.from=function(t,n,e,r,i,o){var u=Object.create(T);return O.toFlatObject(t,u,(function(t){return t!==Error.prototype})),N.call(u,t.message,n,e,r,i),u.name=t.name,o&&Object.assign(u,o),u};var _=N,B={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},D=function(n,e){e=e||new FormData;var r=[];function i(n){return null===n?"":O.isDate(n)?n.toISOString():O.isArrayBuffer(n)||O.isTypedArray(n)?"function"==typeof Blob?new Blob([n]):t.from(n):n}return function t(n,o){if(O.isPlainObject(n)||O.isArray(n)){if(-1!==r.indexOf(n))throw Error("Circular reference detected in "+o);r.push(n),O.forEach(n,(function(n,r){if(!O.isUndefined(n)){var u,f=o?o+"."+r:r;if(n&&!o&&"object"==typeof n)if(O.endsWith(r,"{}"))n=JSON.stringify(n);else if(O.endsWith(r,"[]")&&(u=O.toArray(n)))return void u.forEach((function(t){!O.isUndefined(t)&&e.append(f,i(t))}));t(n,f)}})),r.pop()}else e.append(o,i(n))}(n),e},C=O.isStandardBrowserEnv()?{write:function(t,n,e,r,i,o){var u=[];u.push(t+"="+encodeURIComponent(n)),O.isNumber(e)&&u.push("expires="+new Date(e).toGMTString()),O.isString(r)&&u.push("path="+r),O.isString(i)&&u.push("domain="+i),!0===o&&u.push("secure"),document.cookie=u.join("; ")},read:function(t){var n=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return n?decodeURIComponent(n[3]):null},remove:function(t){this.write(t,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}},P=function(t,n){return t&&!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(n)?function(t,n){return n?t.replace(/\/+$/,"")+"/"+n.replace(/^\/+/,""):t}(t,n):n},F=["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"],U=O.isStandardBrowserEnv()?function(){var t,n=/(msie|trident)/i.test(navigator.userAgent),e=document.createElement("a");function r(t){var r=t;return n&&(e.setAttribute("href",r),r=e.href),e.setAttribute("href",r),{href:e.href,protocol:e.protocol?e.protocol.replace(/:$/,""):"",host:e.host,search:e.search?e.search.replace(/^\?/,""):"",hash:e.hash?e.hash.replace(/^#/,""):"",hostname:e.hostname,port:e.port,pathname:"/"===e.pathname.charAt(0)?e.pathname:"/"+e.pathname}}return t=r(window.location.href),function(n){var e=O.isString(n)?r(n):n;return e.protocol===t.protocol&&e.host===t.host}}():function(){return!0};function L(t){_.call(this,null==t?"canceled":t,_.ERR_CANCELED),this.name="CanceledError"}O.inherits(L,_,{__CANCEL__:!0});var J=L,k={"Content-Type":"application/x-www-form-urlencoded"};function q(t,n){!O.isUndefined(t)&&O.isUndefined(t["Content-Type"])&&(t["Content-Type"]=n)}var z,I={transitional:B,adapter:(("undefined"!=typeof XMLHttpRequest||void 0!==n&&"[object process]"===Object.prototype.toString.call(n))&&(z=function(t){return new Promise((function(n,e){var r,i=t.data,o=t.headers,u=t.responseType;function f(){t.cancelToken&&t.cancelToken.unsubscribe(r),t.signal&&t.signal.removeEventListener("abort",r)}O.isFormData(i)&&O.isStandardBrowserEnv()&&delete o["Content-Type"];var a=new XMLHttpRequest;if(t.auth){var c=t.auth.username||"",s=t.auth.password?unescape(encodeURIComponent(t.auth.password)):"";o.Authorization="Basic "+btoa(c+":"+s)}var l=P(t.baseURL,t.url);function h(){if(a){var r,i,o,c,s,l="getAllResponseHeaders"in a?(r=a.getAllResponseHeaders(),s={},r?(O.forEach(r.split("\n"),(function(t){if(c=t.indexOf(":"),i=O.trim(t.substr(0,c)).toLowerCase(),o=O.trim(t.substr(c+1)),i){if(s[i]&&F.indexOf(i)>=0)return;s[i]="set-cookie"===i?(s[i]?s[i]:[]).concat([o]):s[i]?s[i]+", "+o:o}})),s):s):null;!function(t,n,e){var r=e.config.validateStatus;e.status&&r&&!r(e.status)?n(new _("Request failed with status code "+e.status,[_.ERR_BAD_REQUEST,_.ERR_BAD_RESPONSE][Math.floor(e.status/100)-4],e.config,e.request,e)):t(e)}((function(t){n(t),f()}),(function(t){e(t),f()}),{data:u&&"text"!==u&&"json"!==u?a.response:a.responseText,status:a.status,statusText:a.statusText,headers:l,config:t,request:a}),a=null}}if(a.open(t.method.toUpperCase(),E(l,t.params,t.paramsSerializer),!0),a.timeout=t.timeout,"onloadend"in a?a.onloadend=h:a.onreadystatechange=function(){a&&4===a.readyState&&(0!==a.status||a.responseURL&&0===a.responseURL.indexOf("file:"))&&setTimeout(h)},a.onabort=function(){a&&(e(new _("Request aborted",_.ECONNABORTED,t,a)),a=null)},a.onerror=function(){e(new _("Network Error",_.ERR_NETWORK,t,a,a)),a=null},a.ontimeout=function(){var n=t.timeout?"timeout of "+t.timeout+"ms exceeded":"timeout exceeded";t.timeoutErrorMessage&&(n=t.timeoutErrorMessage),e(new _(n,(t.transitional||B).clarifyTimeoutError?_.ETIMEDOUT:_.ECONNABORTED,t,a)),a=null},O.isStandardBrowserEnv()){var d=(t.withCredentials||U(l))&&t.xsrfCookieName?C.read(t.xsrfCookieName):void 0;d&&(o[t.xsrfHeaderName]=d)}"setRequestHeader"in a&&O.forEach(o,(function(t,n){void 0===i&&"content-type"===n.toLowerCase()?delete o[n]:a.setRequestHeader(n,t)})),O.isUndefined(t.withCredentials)||(a.withCredentials=!!t.withCredentials),u&&"json"!==u&&(a.responseType=t.responseType),"function"==typeof t.onDownloadProgress&&a.addEventListener("progress",t.onDownloadProgress),"function"==typeof t.onUploadProgress&&a.upload&&a.upload.addEventListener("progress",t.onUploadProgress),(t.cancelToken||t.signal)&&(r=function(t){a&&(e(!t||t&&t.type?new J:t),a.abort(),a=null)},t.cancelToken&&t.cancelToken.subscribe(r),t.signal&&(t.signal.aborted?r():t.signal.addEventListener("abort",r))),i||(i=null);var v,p=(v=/^([-+\w]{1,25})(:?\/\/|:)/.exec(l))&&v[1]||"";p&&-1===["http","https","file"].indexOf(p)?e(new _("Unsupported protocol "+p+":",_.ERR_BAD_REQUEST,t)):a.send(i)}))}),z),transformRequest:[function(t,n){if(A(n,"Accept"),A(n,"Content-Type"),O.isFormData(t)||O.isArrayBuffer(t)||O.isBuffer(t)||O.isStream(t)||O.isFile(t)||O.isBlob(t))return t;if(O.isArrayBufferView(t))return t.buffer;if(O.isURLSearchParams(t))return q(n,"application/x-www-form-urlencoded;charset=utf-8"),t.toString();var e,r=O.isObject(t),i=n&&n["Content-Type"];if((e=O.isFileList(t))||r&&"multipart/form-data"===i){var o=this.env&&this.env.FormData;return D(e?{"files[]":t}:t,o&&new o)}return r||"application/json"===i?(q(n,"application/json"),function(t){if(O.isString(t))try{return(0,JSON.parse)(t),O.trim(t)}catch(t){if("SyntaxError"!==t.name)throw t}return(0,JSON.stringify)(t)}(t)):t}],transformResponse:[function(t){var n=this.transitional||I.transitional,e=!(n&&n.silentJSONParsing)&&"json"===this.responseType;if(e||n&&n.forcedJSONParsing&&O.isString(t)&&t.length)try{return JSON.parse(t)}catch(t){if(e){if("SyntaxError"===t.name)throw _.from(t,_.ERR_BAD_RESPONSE,this,null,this.response);throw t}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:null},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};O.forEach(["delete","get","head"],(function(t){I.headers[t]={}})),O.forEach(["post","put","patch"],(function(t){I.headers[t]=O.merge(k)}));var M=I,H=function(t,n,e){var r=this||M;return O.forEach(e,(function(e){t=e.call(r,t,n)})),t},X=function(t){return!(!t||!t.__CANCEL__)};function K(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new J}var W=function(t){return K(t),t.headers=t.headers||{},t.data=H.call(t,t.data,t.headers,t.transformRequest),t.headers=O.merge(t.headers.common||{},t.headers[t.method]||{},t.headers),O.forEach(["delete","get","head","post","put","patch","common"],(function(n){delete t.headers[n]})),(t.adapter||M.adapter)(t).then((function(n){return K(t),n.data=H.call(t,n.data,n.headers,t.transformResponse),n}),(function(n){return X(n)||(K(t),n&&n.response&&(n.response.data=H.call(t,n.response.data,n.response.headers,t.transformResponse))),Promise.reject(n)}))},$=function(t,n){n=n||{};var e={};function r(t,n){return O.isPlainObject(t)&&O.isPlainObject(n)?O.merge(t,n):O.isPlainObject(n)?O.merge({},n):O.isArray(n)?n.slice():n}function i(e){return O.isUndefined(n[e])?O.isUndefined(t[e])?void 0:r(void 0,t[e]):r(t[e],n[e])}function o(t){if(!O.isUndefined(n[t]))return r(void 0,n[t])}function u(e){return O.isUndefined(n[e])?O.isUndefined(t[e])?void 0:r(void 0,t[e]):r(void 0,n[e])}function f(e){return e in n?r(t[e],n[e]):e in t?r(void 0,t[e]):void 0}var a={url:o,method:o,data:o,baseURL:u,transformRequest:u,transformResponse:u,paramsSerializer:u,timeout:u,timeoutMessage:u,withCredentials:u,adapter:u,responseType:u,xsrfCookieName:u,xsrfHeaderName:u,onUploadProgress:u,onDownloadProgress:u,decompress:u,maxContentLength:u,maxBodyLength:u,beforeRedirect:u,transport:u,httpAgent:u,httpsAgent:u,cancelToken:u,socketPath:u,responseEncoding:u,validateStatus:f};return O.forEach(Object.keys(t).concat(Object.keys(n)),(function(t){var n=a[t]||i,r=n(t);O.isUndefined(r)&&n!==f||(e[t]=r)})),e},V={};["object","boolean","number","function","string","symbol"].forEach((function(t,n){V[t]=function(e){return typeof e===t||"a"+(n<1?"n ":" ")+t}}));var Z={};V.transitional=function(t,n,e){function r(t,n){return"[Axios v0.27.2] Transitional option '"+t+"'"+n+(e?". "+e:"")}return function(e,i,o){if(!1===t)throw new _(r(i," has been removed"+(n?" in "+n:"")),_.ERR_DEPRECATED);return n&&!Z[i]&&(Z[i]=!0,console.warn(r(i," has been deprecated since v"+n+" and will be removed in the near future"))),!t||t(e,i,o)}};var Q={assertOptions:function(t,n,e){if("object"!=typeof t)throw new _("options must be an object",_.ERR_BAD_OPTION_VALUE);for(var r=Object.keys(t),i=r.length;i-- >0;){var o=r[i],u=n[o];if(u){var f=t[o],a=void 0===f||u(f,o,t);if(!0!==a)throw new _("option "+o+" must be "+a,_.ERR_BAD_OPTION_VALUE)}else if(!0!==e)throw new _("Unknown option "+o,_.ERR_BAD_OPTION)}},validators:V},Y=Q.validators;function G(t){this.defaults=t,this.interceptors={request:new S,response:new S}}G.prototype.request=function(t,n){"string"==typeof t?(n=n||{}).url=t:n=t||{},(n=$(this.defaults,n)).method=n.method?n.method.toLowerCase():this.defaults.method?this.defaults.method.toLowerCase():"get";var e=n.transitional;void 0!==e&&Q.assertOptions(e,{silentJSONParsing:Y.transitional(Y.boolean),forcedJSONParsing:Y.transitional(Y.boolean),clarifyTimeoutError:Y.transitional(Y.boolean)},!1);var r=[],i=!0;this.interceptors.request.forEach((function(t){"function"==typeof t.runWhen&&!1===t.runWhen(n)||(i=i&&t.synchronous,r.unshift(t.fulfilled,t.rejected))}));var o,u=[];if(this.interceptors.response.forEach((function(t){u.push(t.fulfilled,t.rejected)})),!i){var f=[W,void 0];for(Array.prototype.unshift.apply(f,r),f=f.concat(u),o=Promise.resolve(n);f.length;)o=o.then(f.shift(),f.shift());return o}for(var a=n;r.length;){var c=r.shift(),s=r.shift();try{a=c(a)}catch(t){s(t);break}}try{o=W(a)}catch(t){return Promise.reject(t)}for(;u.length;)o=o.then(u.shift(),u.shift());return o},G.prototype.getUri=function(t){t=$(this.defaults,t);var n=P(t.baseURL,t.url);return E(n,t.params,t.paramsSerializer)},O.forEach(["delete","get","head","options"],(function(t){G.prototype[t]=function(n,e){return this.request($(e||{},{method:t,url:n,data:(e||{}).data}))}})),O.forEach(["post","put","patch"],(function(t){function n(n){return function(e,r,i){return this.request($(i||{},{method:t,headers:n?{"Content-Type":"multipart/form-data"}:{},url:e,data:r}))}}G.prototype[t]=n(),G.prototype[t+"Form"]=n(!0)}));var tt=G;function nt(t){if("function"!=typeof t)throw new TypeError("executor must be a function.");var n;this.promise=new Promise((function(t){n=t}));var e=this;this.promise.then((function(t){if(e._listeners){var n,r=e._listeners.length;for(n=0;n<r;n++)e._listeners[n](t);e._listeners=null}})),this.promise.then=function(t){var n,r=new Promise((function(t){e.subscribe(t),n=t})).then(t);return r.cancel=function(){e.unsubscribe(n)},r},t((function(t){e.reason||(e.reason=new J(t),n(e.reason))}))}nt.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},nt.prototype.subscribe=function(t){this.reason?t(this.reason):this._listeners?this._listeners.push(t):this._listeners=[t]},nt.prototype.unsubscribe=function(t){if(this._listeners){var n=this._listeners.indexOf(t);-1!==n&&this._listeners.splice(n,1)}},nt.source=function(){var t;return{token:new nt((function(n){t=n})),cancel:t}};var et=nt,rt=function t(n){var e=new tt(n),i=r(tt.prototype.request,e);return O.extend(i,tt.prototype,e),O.extend(i,e),i.create=function(e){return t($(n,e))},i}(M);rt.Axios=tt,rt.CanceledError=J,rt.CancelToken=et,rt.isCancel=X,rt.VERSION="0.27.2",rt.toFormData=D,rt.AxiosError=_,rt.Cancel=rt.CanceledError,rt.all=function(t){return Promise.all(t)},rt.spread=function(t){return function(n){return t.apply(null,n)}},rt.isAxiosError=function(t){return O.isObject(t)&&!0===t.isAxiosError};var it=rt;it.default=rt;var ot=it,ut=function(t){return console.debug("[JS-SDK] ".concat(t.method.toUpperCase()," ").concat(t.baseURL).concat(t.url),t.data?JSON.stringify(t.data):""),t},ft=function(){function t(){this.requestLoggerId=null,this.api=ot.create({baseURL:"https://api.verdocs.com",timeout:3e3})}return t.prototype.setTimeout=function(t){return this.api.defaults.timeout=t,this},t.prototype.setClientID=function(t){return this.api.defaults.headers.common["X-Client-ID"]=t,this},t.prototype.setAuthorization=function(t){return t?this.api.defaults.headers.common.Authorization="Bearer ".concat(t):delete this.api.defaults.headers.common.Authorization,this},t.prototype.setSigningAuthorization=function(t){return t?this.api.defaults.headers.common.signer="Bearer ".concat(t):delete this.api.defaults.headers.common.signer,this},t.prototype.setBaseURL=function(t){return this.api.defaults.baseURL=t,this},t.prototype.logRequests=function(t){return t&&null===this.requestLoggerId?this.requestLoggerId=this.api.interceptors.request.use(ut):t||null===this.requestLoggerId||this.api.interceptors.request.eject(this.requestLoggerId),this},t}(),at=function(){if("object"==typeof self&&self)return self;if("object"==typeof window&&window)return window;throw new Error("Unable to resolve global `this`")},ct=function(){if(this)return this;if("object"==typeof globalThis&&globalThis)return globalThis;try{Object.defineProperty(Object.prototype,"__global__",{get:function(){return this},configurable:!0})}catch(t){return at()}try{return __global__||at()}finally{delete Object.prototype.__global__}}(),st=Symbol.for("verdocs-api-endpoint");ct[st]||(ct[st]=new ft);var lt=ct[st],ht=lt,dt=function(){return ht},vt=function(t){ht=t||lt},pt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",mt=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,bt=function(t){var n;try{if(null===(n=function(t){return JSON.parse(function(t){if(t=String(t).replace(/[\t\n\f\r ]+/g,""),!mt.test(t))throw new TypeError("Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded.");var n;t+="==".slice(2-(3&t.length));for(var e,r,i="",o=0;o<t.length;)n=pt.indexOf(t.charAt(o++))<<18|pt.indexOf(t.charAt(o++))<<12|(e=pt.indexOf(t.charAt(o++)))<<6|(r=pt.indexOf(t.charAt(o++))),i+=64===e?String.fromCharCode(n>>16&255):64===r?String.fromCharCode(n>>16&255,n>>8&255):String.fromCharCode(n>>16&255,n>>8&255,255&n);return i}((t||"").split(".")[1]||""))}(t)))return null}catch(t){return null}return Object.keys(n).forEach((function(t){"string"==typeof t&&t.startsWith("https://verdocs.com/")&&(n[t.replace("https://verdocs.com/","")]=n[t],delete n[t])})),n};export{ft as V,bt as d,dt as g,vt as s}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
System.register(["./p-caed7818.system.js","./p-e93ac86f.system.js","./p-e3659c64.system.js","./p-5dfd73f9.system.js"],(function(t){"use strict";var e,n,s,i,o,a,r,l,u;return{setters:[function(t){e=t.r;n=t.c;s=t.h},function(t){i=t.l;o=t.a;a=t.s;r=t.e},function(t){l=t.V;u=t.s},function(){}],execute:function(){var d='verdocs-auth{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;background-color:#4c56cb;padding:40px;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center}verdocs-auth .login-form,verdocs-auth .signup-form{background:#f5f5fa;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;border-radius:8px;-ms-flex-direction:column;flex-direction:column;display:-ms-flexbox;display:flex;padding:20px;width:300px;max-width:100%}verdocs-auth .logo{margin:20px 0 30px;width:128px;max-width:100%}verdocs-auth h3{text-align:center;font-weight:400;font-size:16px;line-height:1.75;margin:0}verdocs-auth h4{text-align:center;font-weight:400;font-size:14px;line-height:1.43;margin:0}verdocs-auth .status-result{display:none}verdocs-auth .status-result.debug{white-space:pre-wrap;font-size:14px;background:#fff;padding:10px;display:block;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:center;justify-content:center}verdocs-auth form{width:100%}verdocs-auth verdocs-text-input{margin-bottom:10px}';var c="https://stage-api.verdocs.com/";var g="verdocs-stage";var h=t("verdocs_auth",function(){function t(t){e(this,t);this.authenticated=n(this,"authenticated",7);this.visible=true;this.logo="https://verdocs.com/assets/blue-logo.svg";this.debug=false;this.isAuthenticated=false;this.displayMode="login";this.username="";this.password="";this.loggingIn=false;this.activeSession=null;this.loginError=null}t.prototype.componentWillLoad=function(){var t=(new l).setBaseURL(c);u(t)};t.prototype.componentDidLoad=function(){var t=i(g);if(t!==null){this.isAuthenticated=true;this.activeSession=t;this.authenticated.emit({authenticated:true,session:t})}else{this.authenticated.emit({authenticated:false,session:null})}};t.prototype.handleLogin=function(){var t=this;this.loggingIn=true;o({username:this.username,password:this.password}).then((function(e){t.loggingIn=false;var n=a(g,e.accessToken,true);t.activeSession=n;t.isAuthenticated=true;t.authenticated.emit({authenticated:true,session:n})})).catch((function(e){var n;console.log("[VERDOCS] Login error",e.response,JSON.stringify(e));t.loggingIn=false;t.activeSession=null;t.authenticated.emit({authenticated:false,session:null});if(((n=e===null||e===void 0?void 0:e.response)===null||n===void 0?void 0:n.status)===403){t.loginError="Please check your username and password and try again."}}))};t.prototype.handleLogout=function(){r(g);this.isAuthenticated=false;this.authenticated.emit({authenticated:false,session:null})};t.prototype.handleClearError=function(){this.loginError=null};t.prototype.render=function(){var t=this;if(!this.visible){return s("div",{style:{display:"none"}},"Verdocs Auth Placeholder")}if(this.isAuthenticated){if(this.debug){return s("div",{class:"status-result debug"},s("verdocs-button",{label:"Logout",disabled:this.loggingIn,onPress:function(){return t.handleLogout()}}))}return s("div",{class:"status-result"},"Authenticated")}if(this.displayMode==="signup"){return s("div",{class:"signup-form"},s("img",{src:this.logo,alt:"Verdocs Logo",class:"logo"}),s("h3",null,"Sign up for an account"),s("h4",null,"Already have an account?",s("verdocs-button",{label:"Log In",variant:"text",onClick:function(){return t.displayMode="login"},disabled:this.loggingIn})),s("form",{onSubmit:function(){return t.handleLogin()}},s("verdocs-text-input",{label:"Email",autocomplete:"username",value:this.username,onFieldInput:function(e){return t.username=e.detail},disabled:this.loggingIn}),s("verdocs-text-input",{label:"Password",type:"password",autocomplete:"current-password",value:this.password,onFieldInput:function(e){return t.password=e.detail},disabled:this.loggingIn}),s("verdocs-button",{label:"Signup",disabled:this.loggingIn,onPress:function(){return t.handleLogin()},style:{display:"flex",justifyContent:"center",margin:"30px auto 0"}})))}return s("div",{class:"login-form"},s("img",{src:this.logo,alt:"Verdocs Logo",class:"logo"}),s("h3",null,"Log in to your account"),s("h4",null,"Don't have an account?",s("verdocs-button",{label:"Sign Up",variant:"text",onClick:function(){return t.displayMode="signup"},disabled:this.loggingIn})),s("form",{onSubmit:function(){return t.handleLogin()}},s("verdocs-text-input",{label:"Email",autocomplete:"username",value:this.username,onFieldInput:function(e){return t.username=e.detail},disabled:this.loggingIn}),s("verdocs-text-input",{label:"Password",type:"password",autocomplete:"current-password",value:this.password,onFieldInput:function(e){return t.password=e.detail},disabled:this.loggingIn}),s("verdocs-button",{label:"Forgot Your Password?",variant:"text",onClick:function(){return t.displayMode="signup"},disabled:this.loggingIn,style:{display:"flex",justifyContent:"center",margin:"10px auto 20px"}}),s("verdocs-button",{label:"Login",disabled:this.loggingIn,onPress:function(){return t.handleLogin()},style:{display:"flex",justifyContent:"center",margin:"10px auto 0"}})),this.loginError?s("verdocs-ok-dialog",{open:true,heading:"Login Error",message:this.loginError,onClosed:function(){return t.handleClearError()}}):s("div",null))};return t}());h.style=d}}}));
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,c as s,h as e}from"./p-2bc58746.js";import{l as i,a as o,s as n,e as a}from"./p-3820c9a2.js";import{V as l,s as r}from"./p-6348272c.js";import"./p-ef932a87.js";const d="verdocs-stage",c=class{constructor(e){t(this,e),this.authenticated=s(this,"authenticated",7),this.visible=!0,this.logo="https://verdocs.com/assets/blue-logo.svg",this.debug=!1,this.isAuthenticated=!1,this.displayMode="login",this.username="",this.password="",this.loggingIn=!1,this.activeSession=null,this.loginError=null}componentWillLoad(){const t=(new l).setBaseURL("https://stage-api.verdocs.com/");r(t)}componentDidLoad(){const t=i(d);null!==t?(this.isAuthenticated=!0,this.activeSession=t,this.authenticated.emit({authenticated:!0,session:t})):this.authenticated.emit({authenticated:!1,session:null})}handleLogin(){this.loggingIn=!0,o({username:this.username,password:this.password}).then((t=>{this.loggingIn=!1;const s=n(d,t.accessToken,!0);this.activeSession=s,this.isAuthenticated=!0,this.authenticated.emit({authenticated:!0,session:s})})).catch((t=>{var s;console.log("[VERDOCS] Login error",t.response,JSON.stringify(t)),this.loggingIn=!1,this.activeSession=null,this.authenticated.emit({authenticated:!1,session:null}),403===(null===(s=null==t?void 0:t.response)||void 0===s?void 0:s.status)&&(this.loginError="Please check your username and password and try again.")}))}handleLogout(){a(d),this.isAuthenticated=!1,this.authenticated.emit({authenticated:!1,session:null})}handleClearError(){this.loginError=null}render(){return this.visible?this.isAuthenticated?this.debug?e("div",{class:"status-result debug"},e("verdocs-button",{label:"Logout",disabled:this.loggingIn,onPress:()=>this.handleLogout()})):e("div",{class:"status-result"},"Authenticated"):"signup"===this.displayMode?e("div",{class:"signup-form"},e("img",{src:this.logo,alt:"Verdocs Logo",class:"logo"}),e("h3",null,"Sign up for an account"),e("h4",null,"Already have an account?",e("verdocs-button",{label:"Log In",variant:"text",onClick:()=>this.displayMode="login",disabled:this.loggingIn})),e("form",{onSubmit:()=>this.handleLogin()},e("verdocs-text-input",{label:"Email",autocomplete:"username",value:this.username,onFieldInput:t=>this.username=t.detail,disabled:this.loggingIn}),e("verdocs-text-input",{label:"Password",type:"password",autocomplete:"current-password",value:this.password,onFieldInput:t=>this.password=t.detail,disabled:this.loggingIn}),e("verdocs-button",{label:"Signup",disabled:this.loggingIn,onPress:()=>this.handleLogin(),style:{display:"flex",justifyContent:"center",margin:"30px auto 0"}}))):e("div",{class:"login-form"},e("img",{src:this.logo,alt:"Verdocs Logo",class:"logo"}),e("h3",null,"Log in to your account"),e("h4",null,"Don't have an account?",e("verdocs-button",{label:"Sign Up",variant:"text",onClick:()=>this.displayMode="signup",disabled:this.loggingIn})),e("form",{onSubmit:()=>this.handleLogin()},e("verdocs-text-input",{label:"Email",autocomplete:"username",value:this.username,onFieldInput:t=>this.username=t.detail,disabled:this.loggingIn}),e("verdocs-text-input",{label:"Password",type:"password",autocomplete:"current-password",value:this.password,onFieldInput:t=>this.password=t.detail,disabled:this.loggingIn}),e("verdocs-button",{label:"Forgot Your Password?",variant:"text",onClick:()=>this.displayMode="signup",disabled:this.loggingIn,style:{display:"flex",justifyContent:"center",margin:"10px auto 20px"}}),e("verdocs-button",{label:"Login",disabled:this.loggingIn,onPress:()=>this.handleLogin(),style:{display:"flex",justifyContent:"center",margin:"10px auto 0"}})),this.loginError?e("verdocs-ok-dialog",{open:!0,heading:"Login Error",message:this.loginError,onClosed:()=>this.handleClearError()}):e("div",null)):e("div",{style:{display:"none"}},"Verdocs Auth Placeholder")}};c.style='verdocs-auth{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;background-color:#4c56cb;padding:40px;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center}verdocs-auth .login-form,verdocs-auth .signup-form{background:#f5f5fa;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;border-radius:8px;-ms-flex-direction:column;flex-direction:column;display:-ms-flexbox;display:flex;padding:20px;width:300px;max-width:100%}verdocs-auth .logo{margin:20px 0 30px;width:128px;max-width:100%}verdocs-auth h3{text-align:center;font-weight:400;font-size:16px;line-height:1.75;margin:0}verdocs-auth h4{text-align:center;font-weight:400;font-size:14px;line-height:1.43;margin:0}verdocs-auth .status-result{display:none}verdocs-auth .status-result.debug{white-space:pre-wrap;font-size:14px;background:#fff;padding:10px;display:block;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:center;justify-content:center}verdocs-auth form{width:100%}verdocs-auth verdocs-text-input{margin-bottom:10px}';export{c as verdocs_auth}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
System.register(["./p-5dfd73f9.system.js"],(function(e){"use strict";var t,r;return{setters:[function(e){t=e.B;r=e.p}],execute:function(){var n=function e(t,r){return function e(){var n=new Array(arguments.length);for(var i=0;i<n.length;i++){n[i]=arguments[i]}return t.apply(r,n)}};var i=Object.prototype.toString;var o=function(e){return function(t){var r=i.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())}}(Object.create(null));function a(e){e=e.toLowerCase();return function t(r){return o(r)===e}}function s(e){return Array.isArray(e)}function u(e){return typeof e==="undefined"}function f(e){return e!==null&&!u(e)&&e.constructor!==null&&!u(e.constructor)&&typeof e.constructor.isBuffer==="function"&&e.constructor.isBuffer(e)}var c=a("ArrayBuffer");function l(e){var t;if(typeof ArrayBuffer!=="undefined"&&ArrayBuffer.isView){t=ArrayBuffer.isView(e)}else{t=e&&e.buffer&&c(e.buffer)}return t}function d(e){return typeof e==="string"}function p(e){return typeof e==="number"}function h(e){return e!==null&&typeof e==="object"}function v(e){if(o(e)!=="object"){return false}var t=Object.getPrototypeOf(e);return t===null||t===Object.prototype}var m=a("Date");var g=a("File");var y=a("Blob");var b=a("FileList");function E(e){return i.call(e)==="[object Function]"}function w(e){return h(e)&&E(e.pipe)}function O(e){var t="[object FormData]";return e&&(typeof FormData==="function"&&e instanceof FormData||i.call(e)===t||E(e.toString)&&e.toString()===t)}var R=a("URLSearchParams");function A(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function S(){if(typeof navigator!=="undefined"&&(navigator.product==="ReactNative"||navigator.product==="NativeScript"||navigator.product==="NS")){return false}return typeof window!=="undefined"&&typeof document!=="undefined"}function _(e,t){if(e===null||typeof e==="undefined"){return}if(typeof e!=="object"){e=[e]}if(s(e)){for(var r=0,n=e.length;r<n;r++){t.call(null,e[r],r,e)}}else{for(var i in e){if(Object.prototype.hasOwnProperty.call(e,i)){t.call(null,e[i],i,e)}}}}function j(){var e={};function t(t,r){if(v(e[r])&&v(t)){e[r]=j(e[r],t)}else if(v(t)){e[r]=j({},t)}else if(s(t)){e[r]=t.slice()}else{e[r]=t}}for(var r=0,n=arguments.length;r<n;r++){_(arguments[r],t)}return e}function C(e,t,r){_(t,(function t(i,o){if(r&&typeof i==="function"){e[o]=n(i,r)}else{e[o]=i}}));return e}function T(e){if(e.charCodeAt(0)===65279){e=e.slice(1)}return e}function N(e,t,r,n){e.prototype=Object.create(t.prototype,n);e.prototype.constructor=e;r&&Object.assign(e.prototype,r)}function x(e,t,r){var n;var i;var o;var a={};t=t||{};do{n=Object.getOwnPropertyNames(e);i=n.length;while(i-- >0){o=n[i];if(!a[o]){t[o]=e[o];a[o]=true}}e=Object.getPrototypeOf(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t}function U(e,t,r){e=String(e);if(r===undefined||r>e.length){r=e.length}r-=t.length;var n=e.indexOf(t,r);return n!==-1&&n===r}function P(e){if(!e)return null;var t=e.length;if(u(t))return null;var r=new Array(t);while(t-- >0){r[t]=e[t]}return r}var B=function(e){return function(t){return e&&t instanceof e}}(typeof Uint8Array!=="undefined"&&Object.getPrototypeOf(Uint8Array));var D={isArray:s,isArrayBuffer:c,isBuffer:f,isFormData:O,isArrayBufferView:l,isString:d,isNumber:p,isObject:h,isPlainObject:v,isUndefined:u,isDate:m,isFile:g,isBlob:y,isFunction:E,isStream:w,isURLSearchParams:R,isStandardBrowserEnv:S,forEach:_,merge:j,extend:C,trim:A,stripBOM:T,inherits:N,toFlatObject:x,kindOf:o,kindOfTest:a,endsWith:U,toArray:P,isTypedArray:B,isFileList:b};function L(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}var k=function e(t,r,n){if(!r){return t}var i;if(n){i=n(r)}else if(D.isURLSearchParams(r)){i=r.toString()}else{var o=[];D.forEach(r,(function e(t,r){if(t===null||typeof t==="undefined"){return}if(D.isArray(t)){r=r+"[]"}else{t=[t]}D.forEach(t,(function e(t){if(D.isDate(t)){t=t.toISOString()}else if(D.isObject(t)){t=JSON.stringify(t)}o.push(L(r)+"="+L(t))}))}));i=o.join("&")}if(i){var a=t.indexOf("#");if(a!==-1){t=t.slice(0,a)}t+=(t.indexOf("?")===-1?"?":"&")+i}return t};function q(){this.handlers=[]}q.prototype.use=function e(t,r,n){this.handlers.push({fulfilled:t,rejected:r,synchronous:n?n.synchronous:false,runWhen:n?n.runWhen:null});return this.handlers.length-1};q.prototype.eject=function e(t){if(this.handlers[t]){this.handlers[t]=null}};q.prototype.forEach=function e(t){D.forEach(this.handlers,(function e(r){if(r!==null){t(r)}}))};var F=q;var I=function e(t,r){D.forEach(t,(function e(n,i){if(i!==r&&i.toUpperCase()===r.toUpperCase()){t[r]=n;delete t[i]}}))};function z(e,t,r,n,i){Error.call(this);this.message=e;this.name="AxiosError";t&&(this.code=t);r&&(this.config=r);n&&(this.request=n);i&&(this.response=i)}D.inherits(z,Error,{toJSON:function e(){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}}});var J=z.prototype;var M={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED"].forEach((function(e){M[e]={value:e}}));Object.defineProperties(z,M);Object.defineProperty(J,"isAxiosError",{value:true});z.from=function(e,t,r,n,i,o){var a=Object.create(J);D.toFlatObject(e,a,(function e(t){return t!==Error.prototype}));z.call(a,e.message,t,r,n,i);a.name=e.name;o&&Object.assign(a,o);return a};var W=z;var H={silentJSONParsing:true,forcedJSONParsing:true,clarifyTimeoutError:false};function V(e,r){r=r||new FormData;var n=[];function i(e){if(e===null)return"";if(D.isDate(e)){return e.toISOString()}if(D.isArrayBuffer(e)||D.isTypedArray(e)){return typeof Blob==="function"?new Blob([e]):t.from(e)}return e}function o(e,t){if(D.isPlainObject(e)||D.isArray(e)){if(n.indexOf(e)!==-1){throw Error("Circular reference detected in "+t)}n.push(e);D.forEach(e,(function e(n,a){if(D.isUndefined(n))return;var s=t?t+"."+a:a;var u;if(n&&!t&&typeof n==="object"){if(D.endsWith(a,"{}")){n=JSON.stringify(n)}else if(D.endsWith(a,"[]")&&(u=D.toArray(n))){u.forEach((function(e){!D.isUndefined(e)&&r.append(s,i(e))}));return}}o(n,s)}));n.pop()}else{r.append(t,i(e))}}o(e);return r}var X=V;var K=function e(t,r,n){var i=n.config.validateStatus;if(!n.status||!i||i(n.status)){t(n)}else{r(new W("Request failed with status code "+n.status,[W.ERR_BAD_REQUEST,W.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}};var $=D.isStandardBrowserEnv()?function e(){return{write:function e(t,r,n,i,o,a){var s=[];s.push(t+"="+encodeURIComponent(r));if(D.isNumber(n)){s.push("expires="+new Date(n).toGMTString())}if(D.isString(i)){s.push("path="+i)}if(D.isString(o)){s.push("domain="+o)}if(a===true){s.push("secure")}document.cookie=s.join("; ")},read:function e(t){var r=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return r?decodeURIComponent(r[3]):null},remove:function e(t){this.write(t,"",Date.now()-864e5)}}}():function e(){return{write:function e(){},read:function e(){return null},remove:function e(){}}}();var Q=function e(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)};var Z=function e(t,r){return r?t.replace(/\/+$/,"")+"/"+r.replace(/^\/+/,""):t};var G=function e(t,r){if(t&&!Q(r)){return Z(t,r)}return r};var Y=["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"];var ee=function e(t){var r={};var n;var i;var o;if(!t){return r}D.forEach(t.split("\n"),(function e(t){o=t.indexOf(":");n=D.trim(t.substr(0,o)).toLowerCase();i=D.trim(t.substr(o+1));if(n){if(r[n]&&Y.indexOf(n)>=0){return}if(n==="set-cookie"){r[n]=(r[n]?r[n]:[]).concat([i])}else{r[n]=r[n]?r[n]+", "+i:i}}}));return r};var te=D.isStandardBrowserEnv()?function e(){var t=/(msie|trident)/i.test(navigator.userAgent);var r=document.createElement("a");var n;function i(e){var n=e;if(t){r.setAttribute("href",n);n=r.href}r.setAttribute("href",n);return{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:r.pathname.charAt(0)==="/"?r.pathname:"/"+r.pathname}}n=i(window.location.href);return function e(t){var r=D.isString(t)?i(t):t;return r.protocol===n.protocol&&r.host===n.host}}():function e(){return function e(){return true}}();function re(e){W.call(this,e==null?"canceled":e,W.ERR_CANCELED);this.name="CanceledError"}D.inherits(re,W,{__CANCEL__:true});var ne=re;var ie=function e(t){var r=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return r&&r[1]||""};var oe=function e(t){return new Promise((function e(r,n){var i=t.data;var o=t.headers;var a=t.responseType;var s;function u(){if(t.cancelToken){t.cancelToken.unsubscribe(s)}if(t.signal){t.signal.removeEventListener("abort",s)}}if(D.isFormData(i)&&D.isStandardBrowserEnv()){delete o["Content-Type"]}var f=new XMLHttpRequest;if(t.auth){var c=t.auth.username||"";var l=t.auth.password?unescape(encodeURIComponent(t.auth.password)):"";o.Authorization="Basic "+btoa(c+":"+l)}var d=G(t.baseURL,t.url);f.open(t.method.toUpperCase(),k(d,t.params,t.paramsSerializer),true);f.timeout=t.timeout;function p(){if(!f){return}var e="getAllResponseHeaders"in f?ee(f.getAllResponseHeaders()):null;var i=!a||a==="text"||a==="json"?f.responseText:f.response;var o={data:i,status:f.status,statusText:f.statusText,headers:e,config:t,request:f};K((function e(t){r(t);u()}),(function e(t){n(t);u()}),o);f=null}if("onloadend"in f){f.onloadend=p}else{f.onreadystatechange=function e(){if(!f||f.readyState!==4){return}if(f.status===0&&!(f.responseURL&&f.responseURL.indexOf("file:")===0)){return}setTimeout(p)}}f.onabort=function e(){if(!f){return}n(new W("Request aborted",W.ECONNABORTED,t,f));f=null};f.onerror=function e(){n(new W("Network Error",W.ERR_NETWORK,t,f,f));f=null};f.ontimeout=function e(){var r=t.timeout?"timeout of "+t.timeout+"ms exceeded":"timeout exceeded";var i=t.transitional||H;if(t.timeoutErrorMessage){r=t.timeoutErrorMessage}n(new W(r,i.clarifyTimeoutError?W.ETIMEDOUT:W.ECONNABORTED,t,f));f=null};if(D.isStandardBrowserEnv()){var h=(t.withCredentials||te(d))&&t.xsrfCookieName?$.read(t.xsrfCookieName):undefined;if(h){o[t.xsrfHeaderName]=h}}if("setRequestHeader"in f){D.forEach(o,(function e(t,r){if(typeof i==="undefined"&&r.toLowerCase()==="content-type"){delete o[r]}else{f.setRequestHeader(r,t)}}))}if(!D.isUndefined(t.withCredentials)){f.withCredentials=!!t.withCredentials}if(a&&a!=="json"){f.responseType=t.responseType}if(typeof t.onDownloadProgress==="function"){f.addEventListener("progress",t.onDownloadProgress)}if(typeof t.onUploadProgress==="function"&&f.upload){f.upload.addEventListener("progress",t.onUploadProgress)}if(t.cancelToken||t.signal){s=function(e){if(!f){return}n(!e||e&&e.type?new ne:e);f.abort();f=null};t.cancelToken&&t.cancelToken.subscribe(s);if(t.signal){t.signal.aborted?s():t.signal.addEventListener("abort",s)}}if(!i){i=null}var v=ie(d);if(v&&["http","https","file"].indexOf(v)===-1){n(new W("Unsupported protocol "+v+":",W.ERR_BAD_REQUEST,t));return}f.send(i)}))};var ae=null;var se={"Content-Type":"application/x-www-form-urlencoded"};function ue(e,t){if(!D.isUndefined(e)&&D.isUndefined(e["Content-Type"])){e["Content-Type"]=t}}function fe(){var e;if(typeof XMLHttpRequest!=="undefined"){e=oe}else if(typeof r!=="undefined"&&Object.prototype.toString.call(r)==="[object process]"){e=oe}return e}function ce(e,t,r){if(D.isString(e)){try{(t||JSON.parse)(e);return D.trim(e)}catch(e){if(e.name!=="SyntaxError"){throw e}}}return(r||JSON.stringify)(e)}var le={transitional:H,adapter:fe(),transformRequest:[function e(t,r){I(r,"Accept");I(r,"Content-Type");if(D.isFormData(t)||D.isArrayBuffer(t)||D.isBuffer(t)||D.isStream(t)||D.isFile(t)||D.isBlob(t)){return t}if(D.isArrayBufferView(t)){return t.buffer}if(D.isURLSearchParams(t)){ue(r,"application/x-www-form-urlencoded;charset=utf-8");return t.toString()}var n=D.isObject(t);var i=r&&r["Content-Type"];var o;if((o=D.isFileList(t))||n&&i==="multipart/form-data"){var a=this.env&&this.env.FormData;return X(o?{"files[]":t}:t,a&&new a)}else if(n||i==="application/json"){ue(r,"application/json");return ce(t)}return t}],transformResponse:[function e(t){var r=this.transitional||le.transitional;var n=r&&r.silentJSONParsing;var i=r&&r.forcedJSONParsing;var o=!n&&this.responseType==="json";if(o||i&&D.isString(t)&&t.length){try{return JSON.parse(t)}catch(e){if(o){if(e.name==="SyntaxError"){throw W.from(e,W.ERR_BAD_RESPONSE,this,null,this.response)}throw e}}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:ae},validateStatus:function e(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};D.forEach(["delete","get","head"],(function e(t){le.headers[t]={}}));D.forEach(["post","put","patch"],(function e(t){le.headers[t]=D.merge(se)}));var de=le;var pe=function e(t,r,n){var i=this||de;D.forEach(n,(function e(n){t=n.call(i,t,r)}));return t};var he=function e(t){return!!(t&&t.__CANCEL__)};function ve(e){if(e.cancelToken){e.cancelToken.throwIfRequested()}if(e.signal&&e.signal.aborted){throw new ne}}var me=function e(t){ve(t);t.headers=t.headers||{};t.data=pe.call(t,t.data,t.headers,t.transformRequest);t.headers=D.merge(t.headers.common||{},t.headers[t.method]||{},t.headers);D.forEach(["delete","get","head","post","put","patch","common"],(function e(r){delete t.headers[r]}));var r=t.adapter||de.adapter;return r(t).then((function e(r){ve(t);r.data=pe.call(t,r.data,r.headers,t.transformResponse);return r}),(function e(r){if(!he(r)){ve(t);if(r&&r.response){r.response.data=pe.call(t,r.response.data,r.response.headers,t.transformResponse)}}return Promise.reject(r)}))};var ge=function e(t,r){r=r||{};var n={};function i(e,t){if(D.isPlainObject(e)&&D.isPlainObject(t)){return D.merge(e,t)}else if(D.isPlainObject(t)){return D.merge({},t)}else if(D.isArray(t)){return t.slice()}return t}function o(e){if(!D.isUndefined(r[e])){return i(t[e],r[e])}else if(!D.isUndefined(t[e])){return i(undefined,t[e])}}function a(e){if(!D.isUndefined(r[e])){return i(undefined,r[e])}}function s(e){if(!D.isUndefined(r[e])){return i(undefined,r[e])}else if(!D.isUndefined(t[e])){return i(undefined,t[e])}}function u(e){if(e in r){return i(t[e],r[e])}else if(e in t){return i(undefined,t[e])}}var f={url:a,method:a,data:a,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:u};D.forEach(Object.keys(t).concat(Object.keys(r)),(function e(t){var r=f[t]||o;var i=r(t);D.isUndefined(i)&&r!==u||(n[t]=i)}));return n};var ye={version:"0.27.2"};var be=ye.version;var Ee={};["object","boolean","number","function","string","symbol"].forEach((function(e,t){Ee[e]=function r(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));var we={};Ee.transitional=function e(t,r,n){function i(e,t){return"[Axios v"+be+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return function(e,n,o){if(t===false){throw new W(i(n," has been removed"+(r?" in "+r:"")),W.ERR_DEPRECATED)}if(r&&!we[n]){we[n]=true;console.warn(i(n," has been deprecated since v"+r+" and will be removed in the near future"))}return t?t(e,n,o):true}};function Oe(e,t,r){if(typeof e!=="object"){throw new W("options must be an object",W.ERR_BAD_OPTION_VALUE)}var n=Object.keys(e);var i=n.length;while(i-- >0){var o=n[i];var a=t[o];if(a){var s=e[o];var u=s===undefined||a(s,o,e);if(u!==true){throw new W("option "+o+" must be "+u,W.ERR_BAD_OPTION_VALUE)}continue}if(r!==true){throw new W("Unknown option "+o,W.ERR_BAD_OPTION)}}}var Re={assertOptions:Oe,validators:Ee};var Ae=Re.validators;function Se(e){this.defaults=e;this.interceptors={request:new F,response:new F}}Se.prototype.request=function e(t,r){if(typeof t==="string"){r=r||{};r.url=t}else{r=t||{}}r=ge(this.defaults,r);if(r.method){r.method=r.method.toLowerCase()}else if(this.defaults.method){r.method=this.defaults.method.toLowerCase()}else{r.method="get"}var n=r.transitional;if(n!==undefined){Re.assertOptions(n,{silentJSONParsing:Ae.transitional(Ae.boolean),forcedJSONParsing:Ae.transitional(Ae.boolean),clarifyTimeoutError:Ae.transitional(Ae.boolean)},false)}var i=[];var o=true;this.interceptors.request.forEach((function e(t){if(typeof t.runWhen==="function"&&t.runWhen(r)===false){return}o=o&&t.synchronous;i.unshift(t.fulfilled,t.rejected)}));var a=[];this.interceptors.response.forEach((function e(t){a.push(t.fulfilled,t.rejected)}));var s;if(!o){var u=[me,undefined];Array.prototype.unshift.apply(u,i);u=u.concat(a);s=Promise.resolve(r);while(u.length){s=s.then(u.shift(),u.shift())}return s}var f=r;while(i.length){var c=i.shift();var l=i.shift();try{f=c(f)}catch(e){l(e);break}}try{s=me(f)}catch(e){return Promise.reject(e)}while(a.length){s=s.then(a.shift(),a.shift())}return s};Se.prototype.getUri=function e(t){t=ge(this.defaults,t);var r=G(t.baseURL,t.url);return k(r,t.params,t.paramsSerializer)};D.forEach(["delete","get","head","options"],(function e(t){Se.prototype[t]=function(e,r){return this.request(ge(r||{},{method:t,url:e,data:(r||{}).data}))}}));D.forEach(["post","put","patch"],(function e(t){function r(e){return function r(n,i,o){return this.request(ge(o||{},{method:t,headers:e?{"Content-Type":"multipart/form-data"}:{},url:n,data:i}))}}Se.prototype[t]=r();Se.prototype[t+"Form"]=r(true)}));var _e=Se;function je(e){if(typeof e!=="function"){throw new TypeError("executor must be a function.")}var t;this.promise=new Promise((function e(r){t=r}));var r=this;this.promise.then((function(e){if(!r._listeners)return;var t;var n=r._listeners.length;for(t=0;t<n;t++){r._listeners[t](e)}r._listeners=null}));this.promise.then=function(e){var t;var n=new Promise((function(e){r.subscribe(e);t=e})).then(e);n.cancel=function e(){r.unsubscribe(t)};return n};e((function e(n){if(r.reason){return}r.reason=new ne(n);t(r.reason)}))}je.prototype.throwIfRequested=function e(){if(this.reason){throw this.reason}};je.prototype.subscribe=function e(t){if(this.reason){t(this.reason);return}if(this._listeners){this._listeners.push(t)}else{this._listeners=[t]}};je.prototype.unsubscribe=function e(t){if(!this._listeners){return}var r=this._listeners.indexOf(t);if(r!==-1){this._listeners.splice(r,1)}};je.source=function e(){var t;var r=new je((function e(r){t=r}));return{token:r,cancel:t}};var Ce=je;var Te=function e(t){return function e(r){return t.apply(null,r)}};var Ne=function e(t){return D.isObject(t)&&t.isAxiosError===true};function xe(e){var t=new _e(e);var r=n(_e.prototype.request,t);D.extend(r,_e.prototype,t);D.extend(r,t);r.create=function t(r){return xe(ge(e,r))};return r}var Ue=xe(de);Ue.Axios=_e;Ue.CanceledError=ne;Ue.CancelToken=Ce;Ue.isCancel=he;Ue.VERSION=ye.version;Ue.toFormData=X;Ue.AxiosError=W;Ue.Cancel=Ue.CanceledError;Ue.all=function e(t){return Promise.all(t)};Ue.spread=Te;Ue.isAxiosError=Ne;var Pe=Ue;var Be=Ue;Pe.default=Be;var De=Pe;var Le=function(e){console.debug("[JS-SDK] ".concat(e.method.toUpperCase()," ").concat(e.baseURL).concat(e.url),e.data?JSON.stringify(e.data):"");return e};var ke=e("V",function(){function e(){this.requestLoggerId=null;this.api=De.create({baseURL:"https://api.verdocs.com",timeout:3e3})}e.prototype.setTimeout=function(e){this.api.defaults.timeout=e;return this};e.prototype.setClientID=function(e){this.api.defaults.headers.common["X-Client-ID"]=e;return this};e.prototype.setAuthorization=function(e){if(e){this.api.defaults.headers.common.Authorization="Bearer ".concat(e)}else{delete this.api.defaults.headers.common.Authorization}return this};e.prototype.setSigningAuthorization=function(e){if(e){this.api.defaults.headers.common.signer="Bearer ".concat(e)}else{delete this.api.defaults.headers.common.signer}return this};e.prototype.setBaseURL=function(e){this.api.defaults.baseURL=e;return this};e.prototype.logRequests=function(e){if(e&&this.requestLoggerId===null){this.requestLoggerId=this.api.interceptors.request.use(Le)}else if(!e&&this.requestLoggerId!==null){this.api.interceptors.request.eject(this.requestLoggerId)}return this};return e}());var qe=function(){if(typeof self==="object"&&self)return self;if(typeof window==="object"&&window)return window;throw new Error("Unable to resolve global `this`")};var Fe=function(){if(this)return this;if(typeof globalThis==="object"&&globalThis)return globalThis;try{Object.defineProperty(Object.prototype,"__global__",{get:function(){return this},configurable:true})}catch(e){return qe()}try{if(!__global__)return qe();return __global__}finally{delete Object.prototype.__global__}}();var Ie=Symbol.for("verdocs-api-endpoint");if(!Fe[Ie]){Fe[Ie]=new ke}var ze=Fe[Ie];var Je=ze;var Me=e("g",(function(){return Je}));var We=e("s",(function(e){Je=e||ze}));var He="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";var Ve=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/;var Xe=function(e){e=String(e).replace(/[\t\n\f\r ]+/g,"");if(!Ve.test(e))throw new TypeError("Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded.");e+="==".slice(2-(e.length&3));var t;var r="";var n;var i;var o=0;for(;o<e.length;){t=He.indexOf(e.charAt(o++))<<18|He.indexOf(e.charAt(o++))<<12|(n=He.indexOf(e.charAt(o++)))<<6|(i=He.indexOf(e.charAt(o++)));r+=n===64?String.fromCharCode(t>>16&255):i===64?String.fromCharCode(t>>16&255,t>>8&255):String.fromCharCode(t>>16&255,t>>8&255,t&255)}return r};var Ke=function(e){return JSON.parse(Xe((e||"").split(".")[1]||""))};var $e=e("d",(function(e){var t;try{t=Ke(e);if(t===null){return null}}catch(e){return null}Object.keys(t).forEach((function(e){if(typeof e==="string"&&e.startsWith("https://verdocs.com/")){t[e.replace("https://verdocs.com/","")]=t[e];delete t[e]}}));return t}))}}}));
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
System.register(["./p-e3659c64.system.js"],(function(t){"use strict";var e,n;return{setters:[function(t){e=t.g;n=t.d}],execute:function(){var r=t("a",(function(t){return e().api.post("/authentication/login",t).then((function(t){return t.data}))}));var u=function(t,n){e().setAuthorization(null);if(n){localStorage.removeItem(t)}f(t,null);return null};var i=t("s",(function(t,r,i){if(i===void 0){i=false}if(r===null){return u(t,i)}var a=n(r||"");if(a===null||a.exp&&a.exp*1e3<(new Date).getTime()){return u(t,i)}if(i){localStorage.setItem(t,r)}e().setAuthorization(r);f(t,a);return a}));var a=t("l",(function(t){var r=localStorage.getItem(t);if(!r){return null}var u=n(r);if(!u){return null}if(u.exp&&u.exp*1e3<(new Date).getTime()){localStorage.removeItem(t);return null}e().setAuthorization(r);f(t,u);return u}));var o=t("e",(function(t,e){if(e===void 0){e=false}return u(t,e)}));var l=new Map;var f=function(t,e){l.forEach((function(n){try{n(t,e)}catch(t){}}))}}}}));
|