bimplus-websdk 0.0.248 → 0.0.249
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/bimplus-websdk.js +1 -1
- package/package.json +1 -1
package/dist/bimplus-websdk.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! For license information please see bimplus-websdk.js.LICENSE.txt */
|
|
2
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.add=t():e.add=t()}(self,(()=>(()=>{"use strict";var e={d:(t,r)=>{for(var n in r)e.o(r,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:r[n]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function n(){n=function(){return t};var e,t={},s=Object.prototype,i=s.hasOwnProperty,o=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},u=a.iterator||"@@iterator",c=a.asyncIterator||"@@asyncIterator",l=a.toStringTag||"@@toStringTag";function h(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{h({},"")}catch(e){h=function(e,t,r){return e[t]=r}}function p(e,t,r,n){var s=t&&t.prototype instanceof b?t:b,i=Object.create(s.prototype),a=new O(n||[]);return o(i,"_invoke",{value:x(e,r,a)}),i}function f(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=p;var d="suspendedStart",g="suspendedYield",m="executing",y="completed",v={};function b(){}function w(){}function T(){}var A={};h(A,u,(function(){return this}));var q=Object.getPrototypeOf,_=q&&q(q(D([])));_&&_!==s&&i.call(_,u)&&(A=_);var U=T.prototype=b.prototype=Object.create(A);function k(e){["next","throw","return"].forEach((function(t){h(e,t,(function(e){return this._invoke(t,e)}))}))}function j(e,t){function n(s,o,a,u){var c=f(e[s],e,o);if("throw"!==c.type){var l=c.arg,h=l.value;return h&&"object"==r(h)&&i.call(h,"__await")?t.resolve(h.__await).then((function(e){n("next",e,a,u)}),(function(e){n("throw",e,a,u)})):t.resolve(h).then((function(e){l.value=e,a(l)}),(function(e){return n("throw",e,a,u)}))}u(c.arg)}var s;o(this,"_invoke",{value:function(e,r){function i(){return new t((function(t,s){n(e,r,t,s)}))}return s=s?s.then(i,i):i()}})}function x(t,r,n){var s=d;return function(i,o){if(s===m)throw new Error("Generator is already running");if(s===y){if("throw"===i)throw o;return{value:e,done:!0}}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var u=S(a,n);if(u){if(u===v)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(s===d)throw s=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);s=m;var c=f(t,r,n);if("normal"===c.type){if(s=n.done?y:g,c.arg===v)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(s=y,n.method="throw",n.arg=c.arg)}}}function S(t,r){var n=r.method,s=t.iterator[n];if(s===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,S(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var i=f(s,t.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,v;var o=i.arg;return o?o.done?(r[t.resultName]=o.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,v):o:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function P(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function E(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function O(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(P,this),this.reset(!0)}function D(t){if(t||""===t){var n=t[u];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var s=-1,o=function r(){for(;++s<t.length;)if(i.call(t,s))return r.value=t[s],r.done=!1,r;return r.value=e,r.done=!0,r};return o.next=o}}throw new TypeError(r(t)+" is not iterable")}return w.prototype=T,o(U,"constructor",{value:T,configurable:!0}),o(T,"constructor",{value:w,configurable:!0}),w.displayName=h(T,l,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===w||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,T):(e.__proto__=T,h(e,l,"GeneratorFunction")),e.prototype=Object.create(U),e},t.awrap=function(e){return{__await:e}},k(j.prototype),h(j.prototype,c,(function(){return this})),t.AsyncIterator=j,t.async=function(e,r,n,s,i){void 0===i&&(i=Promise);var o=new j(p(e,r,n,s),i);return t.isGeneratorFunction(r)?o:o.next().then((function(e){return e.done?e.value:o.next()}))},k(U),h(U,l,"Generator"),h(U,u,(function(){return this})),h(U,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=D,O.prototype={constructor:O,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(E),!t)for(var r in this)"t"===r.charAt(0)&&i.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function n(n,s){return a.type="throw",a.arg=t,r.next=n,s&&(r.method="next",r.arg=e),!!s}for(var s=this.tryEntries.length-1;s>=0;--s){var o=this.tryEntries[s],a=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var u=i.call(o,"catchLoc"),c=i.call(o,"finallyLoc");if(u&&c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(u){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&i.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var s=n;break}}s&&("break"===e||"continue"===e)&&s.tryLoc<=t&&t<=s.finallyLoc&&(s=null);var o=s?s.completion:{};return o.type=e,o.arg=t,s?(this.method="next",this.next=s.finallyLoc,v):this.complete(o)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),v},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),E(r),v}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var s=n.arg;E(r)}return s}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:D(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),v}},t}function s(e,t,r,n,s,i,o){try{var a=e[i](o),u=a.value}catch(e){return void r(e)}a.done?t(u):Promise.resolve(u).then(n,s)}function i(e,t,r,n){return $.ajax({url:e,type:t,data:r,contentType:n&&void 0!==n.contentType?n.contentType:"application/json; charset=utf-8",dataType:n&&void 0!==n.dataType?n.dataType:"json",processData:!(!n||void 0===n.processData)&&n.processData,cache:!(!window||!window.BIMPLUS_SDK_ENABLE_CACHE),async:!0,xhr:function(){var e=$.ajaxSettings.xhr();return n&&void 0!==n.xhrUploadProgress&&e.upload.addEventListener("progress",n.xhrUploadProgress,!1),e},beforeSend:function(t){if(window&&void 0!==window.BIMPLUS_SDK_PENDING_REQUESTS&&window.BIMPLUS_SDK_PENDING_REQUESTS++,n&&n.token){var r=n.tokenType?n.tokenType:"BimPlus";t.setRequestHeader("Authorization",r+" "+n.token)}n&&n.eTag&&(t.setRequestHeader("Cache-Control","no-cache"),window&&!window.BIMPLUS_SDK_DISABLE_ETAG&&t.setRequestHeader("If-None-Match",n.eTag)),!t._url&&e&&(t._url=e)},complete:function(t){if(window&&void 0!==window.BIMPLUS_SDK_PENDING_REQUESTS&&window.BIMPLUS_SDK_PENDING_REQUESTS--,window&&window.BIMPLUS_SDK_LOG_API_CALLS){var r={url:e,response:t&&t.responseText&&t.responseText.length>0?JSON.parse(t.responseText):null};console.log(JSON.stringify(r))}}})}function o(e,t,r,n){var s=$.Deferred();console.debug("xmlHttpRequest config=",n);var i=new XMLHttpRequest;return i.open(t,e,!0),i.setRequestHeader("Authorization","BimPlus "+n.token),window&&void 0!==window.BIMPLUS_SDK_PENDING_REQUESTS&&window.BIMPLUS_SDK_PENDING_REQUESTS++,n&&n.responseType&&(console.debug("responseType is set to",n.responseType),i.responseType=n.responseType),n&&n.eTag&&(console.debug("setRequestHeader is set to eTag",n.eTag),i.setRequestHeader("Cache-Control","no-cache"),window&&!window.BIMPLUS_SDK_DISABLE_ETAG&&i.setRequestHeader("If-None-Match",n.eTag)),i.onload=function(){window&&void 0!==window.BIMPLUS_SDK_PENDING_REQUESTS&&window.BIMPLUS_SDK_PENDING_REQUESTS--,s.resolve(i.response,i.status,i)},i.onerror=function(){window&&void 0!==window.BIMPLUS_SDK_PENDING_REQUESTS&&window.BIMPLUS_SDK_PENDING_REQUESTS--,s.reject()},r&&i.setRequestHeader("Content-Type","application/json;charset=UTF-8"),i.send(r),s.promise()}function a(e){var t="?";for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t+=r+"="+e[r]+"&");return t=t.slice(0,-1)}function u(e,t,r,i,o){o||(o={}),o.token||(o.token=t),o.queryParams||(o.queryParams={}),o.queryParams.chunkSize||(o.queryParams.chunkSize=r),o.queryParams.chunk=1;var a=$.Deferred(),u=[];return e.get(i,o).done(function(){var t=function(e){return function(){var t=this,r=arguments;return new Promise((function(n,i){var o=e.apply(t,r);function a(e){s(o,n,i,a,u,"next",e)}function u(e){s(o,n,i,a,u,"throw",e)}a(void 0)}))}}(n().mark((function t(r,s,c){var l,h,p,f;return n().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:u.push(r),l=0,200===c.status?(h=c.getResponseHeader("X-Total-Count"))?l=parseInt(h,10):console.warn("Request for "+i+" doesn't support chunked responses!"):304===c.status&&(c["Cached-X-Total-Count"]?l=c["Cached-X-Total-Count"]:console.warn("Cached request for "+i+" doesn't contain chunk info!")),p=n().mark((function t(){var r;return n().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:o.queryParams.chunk=f,r=$.Deferred(),e.get(i,o).done((function(e){r.resolve(e)})).fail((function(e,t){r.reject(e,t)})),u.push(r);case 4:case"end":return t.stop()}}),t)})),f=2;case 5:if(!(f<=l)){t.next=10;break}return t.delegateYield(p(),"t0",7);case 7:f++,t.next=5;break;case 10:a.resolve(u);case 11:case"end":return t.stop()}}),t)})));return function(e,r,n){return t.apply(this,arguments)}}()).fail((function(e,t){a.reject(e,t)})),a.promise()}e.r(t),e.d(t,{Api:()=>ks,IDBCache:()=>qn,createDefaultConfig:()=>js});var c=function(){var e=null,t=null;this.setAccessToken=function(t){e=t},this.setTokenType=function(e){t=e},this.get=function(r,n){var s;return n||(n={}),n.token||(n.token=e),n.tokenType&&n.tokenType===t||(n.tokenType=t),n.queryParams&&(r+=a(n.queryParams)),null!==(s=n)&&void 0!==s&&s.useXMLHttpRequest?o(r,"GET",null,n):i(r,"GET",null,n)},this.getChunked=function(t,r){return u(this,e,"medium",t,r)},this.put=function(r,n,s){return s||(s={}),s.token||(s.token=e),s.tokenType&&s.tokenType===t||(s.tokenType=t),s.queryParams&&(r+=a(s.queryParams)),i(r,"PUT",n,s)},this.post=function(r,n,s){var u;return s||(s={}),s.token||(s.token=e),s.tokenType&&s.tokenType===t||(s.tokenType=t),s.queryParams&&(r+=a(s.queryParams)),null!==(u=s)&&void 0!==u&&u.useXMLHttpRequest?o(r,"POST",n,s):i(r,"POST",n,s)},this.del=function(r,n,s){return s||(s={}),n||(s.contentType=null),s.dataType=null,s.token||(s.token=e),s.tokenType&&s.tokenType===t||(s.tokenType=t),s.queryParams&&(r+=a(s.queryParams)),i(r,"DELETE",n||null,s)}},l=function(e){this.postSettings=function(t){return e.request.post(e.getApiUrl()+"application/settings",t)},this.getSettings=function(t){return t?e.request.get(e.getApiUrl()+"application/settings/"+t):e.request.get(e.getApiUrl()+"application/settings")},this.putSettings=function(t,r){return e.request.put(e.getApiUrl()+"application/settings/"+t,r)},this.deleteSettings=function(t){return e.request.del(e.getApiUrl()+"application/settings/"+t)}},h=function(e){this.get=function(t){return console.debug("Annotation get API ",e.getApiTeamUrl()+"annotations/"+t),e.request.get(e.getApiTeamUrl()+"annotations/"+t)},this.delete=function(t){return e.request.del(e.getApiTeamUrl()+"annotations/"+t)},this.put=function(t,r){return e.request.put(e.getApiTeamUrl()+"annotations/"+t,r)}},p=function(e){this.get=function(t){return e.request.get(e.getApiTeamUrl()+"attachments/"+t)},this.download=function(t,r){return r?e.request.get(e.getApiTeamUrl()+"attachments/"+t+"/versions/"+r+"/download"):e.request.get(e.getApiTeamUrl()+"attachments/"+t+"/download")},this.put=function(t,r){return e.request.put(e.getApiTeamUrl()+"attachments/"+t,r)},this.post=function(t,r,n){return e.request.put(e.getApiTeamUrl()+"attachments/"+t,r,{contentType:!1,processData:!1,dataType:null,xhrUploadProgress:n})},this.delete=function(t,r){return r?e.request.del(e.getApiTeamUrl()+"attachments/"+t+"/versions/"+r):e.request.del(e.getApiTeamUrl()+"attachments/"+t)},this.deleteSelected=function(t){return e.request.del(e.getApiTeamUrl()+"objects/"+t+"/attachments")},this.postVersion=function(t,r,n){return e.request.post(e.getApiTeamUrl()+"attachments/"+t+"/versions",r,{contentType:!1,processData:!1,dataType:null,xhrUploadProgress:n})},this.getAllVersions=function(t){return e.request.get(e.getApiTeamUrl()+"attachments/"+t+"/versions")},this.releaseVersion=function(t,r){return e.request.put(e.getApiTeamUrl()+"attachments/"+t+"/release",r)}},f=function(e){this.post=function(t){return e.request.post(e.getApiTeamUrl()+"attributetemplates",t)},this.get=function(t){return t?e.request.get(e.getApiTeamUrl()+"attributetemplates/"+t):e.request.get(e.getApiTeamUrl()+"attributetemplates")},this.put=function(t,r){return e.request.put(e.getApiTeamUrl()+"attributetemplates/"+t,r)},this.delete=function(t){return e.request.del(e.getApiTeamUrl()+"attributetemplates/"+t)}},d=function(e){this.post=function(t,r,n){return e.request.post(e.getApiUrl()+"authorize",JSON.stringify({user_id:t,password:r,application_id:n}))},this.forgotPassword=function(t){return e.request.post(e.getApiUrl()+"auth-forgot",t,{dataType:null})},this.checkAccessToken=function(){return e.request.get(e.getApiUrl()+"authorize")},this.requestCrossToken=function(){return e.request.post(e.getApiUrl()+"cross-token")},this.requestExternalAppToken=function(){return e.request.get(e.getApiUrl()+"validate")},this.getOpenIdConfiguration=function(){return e.request.get(e.getApiUrl()+".well-known/openid-configuration")}};const g="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,m=Object.keys,y=Array.isArray;function v(e,t){return"object"!=typeof t||m(t).forEach((function(r){e[r]=t[r]})),e}"undefined"==typeof Promise||g.Promise||(g.Promise=Promise);const b=Object.getPrototypeOf,w={}.hasOwnProperty;function T(e,t){return w.call(e,t)}function A(e,t){"function"==typeof t&&(t=t(b(e))),("undefined"==typeof Reflect?m:Reflect.ownKeys)(t).forEach((r=>{_(e,r,t[r])}))}const q=Object.defineProperty;function _(e,t,r,n){q(e,t,v(r&&T(r,"get")&&"function"==typeof r.get?{get:r.get,set:r.set,configurable:!0}:{value:r,configurable:!0,writable:!0},n))}function U(e){return{from:function(t){return e.prototype=Object.create(t.prototype),_(e.prototype,"constructor",e),{extend:A.bind(null,e.prototype)}}}}const k=Object.getOwnPropertyDescriptor;function j(e,t){let r;return k(e,t)||(r=b(e))&&j(r,t)}const x=[].slice;function S(e,t,r){return x.call(e,t,r)}function P(e,t){return t(e)}function E(e){if(!e)throw new Error("Assertion Failed")}function O(e){g.setImmediate?setImmediate(e):setTimeout(e,0)}function D(e,t){return e.reduce(((e,r,n)=>{var s=t(r,n);return s&&(e[s[0]]=s[1]),e}),{})}function C(e,t){if(T(e,t))return e[t];if(!t)return e;if("string"!=typeof t){for(var r=[],n=0,s=t.length;n<s;++n){var i=C(e,t[n]);r.push(i)}return r}var o=t.indexOf(".");if(-1!==o){var a=e[t.substr(0,o)];return void 0===a?void 0:C(a,t.substr(o+1))}}function I(e,t,r){if(e&&void 0!==t&&(!("isFrozen"in Object)||!Object.isFrozen(e)))if("string"!=typeof t&&"length"in t){E("string"!=typeof r&&"length"in r);for(var n=0,s=t.length;n<s;++n)I(e,t[n],r[n])}else{var i=t.indexOf(".");if(-1!==i){var o=t.substr(0,i),a=t.substr(i+1);if(""===a)void 0===r?y(e)&&!isNaN(parseInt(o))?e.splice(o,1):delete e[o]:e[o]=r;else{var u=e[o];u&&T(e,o)||(u=e[o]={}),I(u,a,r)}}else void 0===r?y(e)&&!isNaN(parseInt(t))?e.splice(t,1):delete e[t]:e[t]=r}}function R(e){var t={};for(var r in e)T(e,r)&&(t[r]=e[r]);return t}const B=[].concat;function K(e){return B.apply([],e)}const L="Boolean,String,Date,RegExp,Blob,File,FileList,FileSystemFileHandle,ArrayBuffer,DataView,Uint8ClampedArray,ImageBitmap,ImageData,Map,Set,CryptoKey".split(",").concat(K([8,16,32,64].map((e=>["Int","Uint","Float"].map((t=>t+e+"Array")))))).filter((e=>g[e])),N=L.map((e=>g[e]));D(L,(e=>[e,!0]));let M=null;function F(e){M="undefined"!=typeof WeakMap&&new WeakMap;const t=G(e);return M=null,t}function G(e){if(!e||"object"!=typeof e)return e;let t=M&&M.get(e);if(t)return t;if(y(e)){t=[],M&&M.set(e,t);for(var r=0,n=e.length;r<n;++r)t.push(G(e[r]))}else if(N.indexOf(e.constructor)>=0)t=e;else{const r=b(e);for(var s in t=r===Object.prototype?{}:Object.create(r),M&&M.set(e,t),e)T(e,s)&&(t[s]=G(e[s]))}return t}const{toString:W}={};function H(e){return W.call(e).slice(8,-1)}const V="undefined"!=typeof Symbol?Symbol.iterator:"@@iterator",J="symbol"==typeof V?function(e){var t;return null!=e&&(t=e[V])&&t.apply(e)}:function(){return null},z={};function X(e){var t,r,n,s;if(1===arguments.length){if(y(e))return e.slice();if(this===z&&"string"==typeof e)return[e];if(s=J(e)){for(r=[];!(n=s.next()).done;)r.push(n.value);return r}if(null==e)return[e];if("number"==typeof(t=e.length)){for(r=new Array(t);t--;)r[t]=e[t];return r}return[e]}for(t=arguments.length,r=new Array(t);t--;)r[t]=arguments[t];return r}const Q="undefined"!=typeof Symbol?e=>"AsyncFunction"===e[Symbol.toStringTag]:()=>!1;var Y="undefined"!=typeof location&&/^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);function Z(e,t){Y=e,ee=t}var ee=()=>!0;const te=!new Error("").stack;function re(){if(te)try{throw re.arguments,new Error}catch(e){return e}return new Error}function ne(e,t){var r=e.stack;return r?(t=t||0,0===r.indexOf(e.name)&&(t+=(e.name+e.message).split("\n").length),r.split("\n").slice(t).filter(ee).map((e=>"\n"+e)).join("")):""}var se=["Unknown","Constraint","Data","TransactionInactive","ReadOnly","Version","NotFound","InvalidState","InvalidAccess","Abort","Timeout","QuotaExceeded","Syntax","DataClone"],ie=["Modify","Bulk","OpenFailed","VersionChange","Schema","Upgrade","InvalidTable","MissingAPI","NoSuchDatabase","InvalidArgument","SubTransaction","Unsupported","Internal","DatabaseClosed","PrematureCommit","ForeignAwait"].concat(se),oe={VersionChanged:"Database version changed by other database connection",DatabaseClosed:"Database has been closed",Abort:"Transaction aborted",TransactionInactive:"Transaction has already completed or failed",MissingAPI:"IndexedDB API missing. Please visit https://tinyurl.com/y2uuvskb"};function ae(e,t){this._e=re(),this.name=e,this.message=t}function ue(e,t){return e+". Errors: "+Object.keys(t).map((e=>t[e].toString())).filter(((e,t,r)=>r.indexOf(e)===t)).join("\n")}function ce(e,t,r,n){this._e=re(),this.failures=t,this.failedKeys=n,this.successCount=r,this.message=ue(e,t)}function le(e,t){this._e=re(),this.name="BulkError",this.failures=Object.keys(t).map((e=>t[e])),this.failuresByPos=t,this.message=ue(e,t)}U(ae).from(Error).extend({stack:{get:function(){return this._stack||(this._stack=this.name+": "+this.message+ne(this._e,2))}},toString:function(){return this.name+": "+this.message}}),U(ce).from(ae),U(le).from(ae);var he=ie.reduce(((e,t)=>(e[t]=t+"Error",e)),{});const pe=ae;var fe=ie.reduce(((e,t)=>{var r=t+"Error";function n(e,n){this._e=re(),this.name=r,e?"string"==typeof e?(this.message=`${e}${n?"\n "+n:""}`,this.inner=n||null):"object"==typeof e&&(this.message=`${e.name} ${e.message}`,this.inner=e):(this.message=oe[t]||r,this.inner=null)}return U(n).from(pe),e[t]=n,e}),{});fe.Syntax=SyntaxError,fe.Type=TypeError,fe.Range=RangeError;var de=se.reduce(((e,t)=>(e[t+"Error"]=fe[t],e)),{}),ge=ie.reduce(((e,t)=>(-1===["Syntax","Type","Range"].indexOf(t)&&(e[t+"Error"]=fe[t]),e)),{});function me(){}function ye(e){return e}function ve(e,t){return null==e||e===ye?t:function(r){return t(e(r))}}function be(e,t){return function(){e.apply(this,arguments),t.apply(this,arguments)}}function we(e,t){return e===me?t:function(){var r=e.apply(this,arguments);void 0!==r&&(arguments[0]=r);var n=this.onsuccess,s=this.onerror;this.onsuccess=null,this.onerror=null;var i=t.apply(this,arguments);return n&&(this.onsuccess=this.onsuccess?be(n,this.onsuccess):n),s&&(this.onerror=this.onerror?be(s,this.onerror):s),void 0!==i?i:r}}function Te(e,t){return e===me?t:function(){e.apply(this,arguments);var r=this.onsuccess,n=this.onerror;this.onsuccess=this.onerror=null,t.apply(this,arguments),r&&(this.onsuccess=this.onsuccess?be(r,this.onsuccess):r),n&&(this.onerror=this.onerror?be(n,this.onerror):n)}}function Ae(e,t){return e===me?t:function(r){var n=e.apply(this,arguments);v(r,n);var s=this.onsuccess,i=this.onerror;this.onsuccess=null,this.onerror=null;var o=t.apply(this,arguments);return s&&(this.onsuccess=this.onsuccess?be(s,this.onsuccess):s),i&&(this.onerror=this.onerror?be(i,this.onerror):i),void 0===n?void 0===o?void 0:o:v(n,o)}}function qe(e,t){return e===me?t:function(){return!1!==t.apply(this,arguments)&&e.apply(this,arguments)}}function _e(e,t){return e===me?t:function(){var r=e.apply(this,arguments);if(r&&"function"==typeof r.then){for(var n=this,s=arguments.length,i=new Array(s);s--;)i[s]=arguments[s];return r.then((function(){return t.apply(n,i)}))}return t.apply(this,arguments)}}ge.ModifyError=ce,ge.DexieError=ae,ge.BulkError=le;var Ue={};const ke=100,[je,xe,Se]="undefined"==typeof Promise?[]:(()=>{let e=Promise.resolve();if("undefined"==typeof crypto||!crypto.subtle)return[e,b(e),e];const t=crypto.subtle.digest("SHA-512",new Uint8Array([0]));return[t,b(t),e]})(),Pe=xe&&xe.then,Ee=je&&je.constructor,Oe=!!Se;var De=!1,Ce=Se?()=>{Se.then(nt)}:g.setImmediate?setImmediate.bind(null,nt):g.MutationObserver?()=>{var e=document.createElement("div");new MutationObserver((()=>{nt(),e=null})).observe(e,{attributes:!0}),e.setAttribute("i","1")}:()=>{setTimeout(nt,0)},Ie=function(e,t){We.push([e,t]),Be&&(Ce(),Be=!1)},Re=!0,Be=!0,Ke=[],Le=[],Ne=null,Me=ye,Fe={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:xt,pgp:!1,env:{},finalize:function(){this.unhandleds.forEach((e=>{try{xt(e[0],e[1])}catch(e){}}))}},Ge=Fe,We=[],He=0,$e=[];function Ve(e){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");this._listeners=[],this.onuncatched=me,this._lib=!1;var t=this._PSD=Ge;if(Y&&(this._stackHolder=re(),this._prev=null,this._numPrev=0),"function"!=typeof e){if(e!==Ue)throw new TypeError("Not a function");return this._state=arguments[1],this._value=arguments[2],void(!1===this._state&&Qe(this,this._value))}this._state=null,this._value=null,++t.ref,Xe(this,e)}const Je={get:function(){var e=Ge,t=ft;function r(r,n){var s=!e.global&&(e!==Ge||t!==ft);const i=s&&!yt();var o=new Ve(((t,o)=>{Ze(this,new ze(Ut(r,e,s,i),Ut(n,e,s,i),t,o,e))}));return Y&&rt(o,this),o}return r.prototype=Ue,r},set:function(e){_(this,"then",e&&e.prototype===Ue?Je:{get:function(){return e},set:Je.set})}};function ze(e,t,r,n,s){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.resolve=r,this.reject=n,this.psd=s}function Xe(e,t){try{t((t=>{if(null===e._state){if(t===e)throw new TypeError("A promise cannot be resolved with itself.");var r=e._lib&&st();t&&"function"==typeof t.then?Xe(e,((e,r)=>{t instanceof Ve?t._then(e,r):t.then(e,r)})):(e._state=!0,e._value=t,Ye(e)),r&&it()}}),Qe.bind(null,e))}catch(t){Qe(e,t)}}function Qe(e,t){if(Le.push(t),null===e._state){var r=e._lib&&st();t=Me(t),e._state=!1,e._value=t,Y&&null!==t&&"object"==typeof t&&!t._promise&&function(e,t,r){try{e.apply(null,void 0)}catch(e){}}((()=>{var r=j(t,"stack");t._promise=e,_(t,"stack",{get:()=>De?r&&(r.get?r.get.apply(t):r.value):e.stack})})),function(e){Ke.some((t=>t._value===e._value))||Ke.push(e)}(e),Ye(e),r&&it()}}function Ye(e){var t=e._listeners;e._listeners=[];for(var r=0,n=t.length;r<n;++r)Ze(e,t[r]);var s=e._PSD;--s.ref||s.finalize(),0===He&&(++He,Ie((()=>{0==--He&&ot()}),[]))}function Ze(e,t){if(null!==e._state){var r=e._state?t.onFulfilled:t.onRejected;if(null===r)return(e._state?t.resolve:t.reject)(e._value);++t.psd.ref,++He,Ie(et,[r,e,t])}else e._listeners.push(t)}function et(e,t,r){try{Ne=t;var n,s=t._value;t._state?n=e(s):(Le.length&&(Le=[]),n=e(s),-1===Le.indexOf(s)&&function(e){for(var t=Ke.length;t;)if(Ke[--t]._value===e._value)return void Ke.splice(t,1)}(t)),r.resolve(n)}catch(e){r.reject(e)}finally{Ne=null,0==--He&&ot(),--r.psd.ref||r.psd.finalize()}}function tt(e,t,r){if(t.length===r)return t;var n="";if(!1===e._state){var s,i,o=e._value;null!=o?(s=o.name||"Error",i=o.message||o,n=ne(o,0)):(s=o,i=""),t.push(s+(i?": "+i:"")+n)}return Y&&((n=ne(e._stackHolder,2))&&-1===t.indexOf(n)&&t.push(n),e._prev&&tt(e._prev,t,r)),t}function rt(e,t){var r=t?t._numPrev+1:0;r<100&&(e._prev=t,e._numPrev=r)}function nt(){st()&&it()}function st(){var e=Re;return Re=!1,Be=!1,e}function it(){var e,t,r;do{for(;We.length>0;)for(e=We,We=[],r=e.length,t=0;t<r;++t){var n=e[t];n[0].apply(null,n[1])}}while(We.length>0);Re=!0,Be=!0}function ot(){var e=Ke;Ke=[],e.forEach((e=>{e._PSD.onunhandled.call(null,e._value,e)}));for(var t=$e.slice(0),r=t.length;r;)t[--r]()}function at(e){return new Ve(Ue,!1,e)}function ut(e,t){var r=Ge;return function(){var n=st(),s=Ge;try{return Tt(r,!0),e.apply(this,arguments)}catch(e){t&&t(e)}finally{Tt(s,!1),n&&it()}}}A(Ve.prototype,{then:Je,_then:function(e,t){Ze(this,new ze(null,null,e,t,Ge))},catch:function(e){if(1===arguments.length)return this.then(null,e);var t=arguments[0],r=arguments[1];return"function"==typeof t?this.then(null,(e=>e instanceof t?r(e):at(e))):this.then(null,(e=>e&&e.name===t?r(e):at(e)))},finally:function(e){return this.then((t=>(e(),t)),(t=>(e(),at(t))))},stack:{get:function(){if(this._stack)return this._stack;try{De=!0;var e=tt(this,[],20).join("\nFrom previous: ");return null!==this._state&&(this._stack=e),e}finally{De=!1}}},timeout:function(e,t){return e<1/0?new Ve(((r,n)=>{var s=setTimeout((()=>n(new fe.Timeout(t))),e);this.then(r,n).finally(clearTimeout.bind(null,s))})):this}}),"undefined"!=typeof Symbol&&Symbol.toStringTag&&_(Ve.prototype,Symbol.toStringTag,"Dexie.Promise"),Fe.env=At(),A(Ve,{all:function(){var e=X.apply(null,arguments).map(vt);return new Ve((function(t,r){0===e.length&&t([]);var n=e.length;e.forEach(((s,i)=>Ve.resolve(s).then((r=>{e[i]=r,--n||t(e)}),r)))}))},resolve:e=>{if(e instanceof Ve)return e;if(e&&"function"==typeof e.then)return new Ve(((t,r)=>{e.then(t,r)}));var t=new Ve(Ue,!0,e);return rt(t,Ne),t},reject:at,race:function(){var e=X.apply(null,arguments).map(vt);return new Ve(((t,r)=>{e.map((e=>Ve.resolve(e).then(t,r)))}))},PSD:{get:()=>Ge,set:e=>Ge=e},totalEchoes:{get:()=>ft},newPSD:gt,usePSD:qt,scheduler:{get:()=>Ie,set:e=>{Ie=e}},rejectionMapper:{get:()=>Me,set:e=>{Me=e}},follow:(e,t)=>new Ve(((r,n)=>gt(((t,r)=>{var n=Ge;n.unhandleds=[],n.onunhandled=r,n.finalize=be((function(){!function(e){$e.push((function t(){e(),$e.splice($e.indexOf(t),1)})),++He,Ie((()=>{0==--He&&ot()}),[])}((()=>{0===this.unhandleds.length?t():r(this.unhandleds[0])}))}),n.finalize),e()}),t,r,n)))}),Ee&&(Ee.allSettled&&_(Ve,"allSettled",(function(){const e=X.apply(null,arguments).map(vt);return new Ve((t=>{0===e.length&&t([]);let r=e.length;const n=new Array(r);e.forEach(((e,s)=>Ve.resolve(e).then((e=>n[s]={status:"fulfilled",value:e}),(e=>n[s]={status:"rejected",reason:e})).then((()=>--r||t(n)))))}))})),Ee.any&&"undefined"!=typeof AggregateError&&_(Ve,"any",(function(){const e=X.apply(null,arguments).map(vt);return new Ve(((t,r)=>{0===e.length&&r(new AggregateError([]));let n=e.length;const s=new Array(n);e.forEach(((e,i)=>Ve.resolve(e).then((e=>t(e)),(e=>{s[i]=e,--n||r(new AggregateError(s))}))))}))})));const ct={awaits:0,echoes:0,id:0};var lt=0,ht=[],pt=0,ft=0,dt=0;function gt(e,t,r,n){var s=Ge,i=Object.create(s);i.parent=s,i.ref=0,i.global=!1,i.id=++dt;var o=Fe.env;i.env=Oe?{Promise:Ve,PromiseProp:{value:Ve,configurable:!0,writable:!0},all:Ve.all,race:Ve.race,allSettled:Ve.allSettled,any:Ve.any,resolve:Ve.resolve,reject:Ve.reject,nthen:kt(o.nthen,i),gthen:kt(o.gthen,i)}:{},t&&v(i,t),++s.ref,i.finalize=function(){--this.parent.ref||this.parent.finalize()};var a=qt(i,e,r,n);return 0===i.ref&&i.finalize(),a}function mt(){return ct.id||(ct.id=++lt),++ct.awaits,ct.echoes+=ke,ct.id}function yt(){return!!ct.awaits&&(0==--ct.awaits&&(ct.id=0),ct.echoes=ct.awaits*ke,!0)}function vt(e){return ct.echoes&&e&&e.constructor===Ee?(mt(),e.then((e=>(yt(),e)),(e=>(yt(),St(e))))):e}function bt(e){++ft,ct.echoes&&0!=--ct.echoes||(ct.echoes=ct.id=0),ht.push(Ge),Tt(e,!0)}function wt(){var e=ht[ht.length-1];ht.pop(),Tt(e,!1)}function Tt(e,t){var r=Ge;if((t?!ct.echoes||pt++&&e===Ge:!pt||--pt&&e===Ge)||_t(t?bt.bind(null,e):wt),e!==Ge&&(Ge=e,r===Fe&&(Fe.env=At()),Oe)){var n=Fe.env.Promise,s=e.env;xe.then=s.nthen,n.prototype.then=s.gthen,(r.global||e.global)&&(Object.defineProperty(g,"Promise",s.PromiseProp),n.all=s.all,n.race=s.race,n.resolve=s.resolve,n.reject=s.reject,s.allSettled&&(n.allSettled=s.allSettled),s.any&&(n.any=s.any))}}function At(){var e=g.Promise;return Oe?{Promise:e,PromiseProp:Object.getOwnPropertyDescriptor(g,"Promise"),all:e.all,race:e.race,allSettled:e.allSettled,any:e.any,resolve:e.resolve,reject:e.reject,nthen:xe.then,gthen:e.prototype.then}:{}}function qt(e,t,r,n,s){var i=Ge;try{return Tt(e,!0),t(r,n,s)}finally{Tt(i,!1)}}function _t(e){Pe.call(je,e)}function Ut(e,t,r,n){return"function"!=typeof e?e:function(){var s=Ge;r&&mt(),Tt(t,!0);try{return e.apply(this,arguments)}finally{Tt(s,!1),n&&_t(yt)}}}function kt(e,t){return function(r,n){return e.call(this,Ut(r,t),Ut(n,t))}}-1===(""+Pe).indexOf("[native code]")&&(mt=yt=me);const jt="unhandledrejection";function xt(e,t){var r;try{r=t.onuncatched(e)}catch(e){}if(!1!==r)try{var n,s={promise:t,reason:e};if(g.document&&document.createEvent?((n=document.createEvent("Event")).initEvent(jt,!0,!0),v(n,s)):g.CustomEvent&&v(n=new CustomEvent(jt,{detail:s}),s),n&&g.dispatchEvent&&(dispatchEvent(n),!g.PromiseRejectionEvent&&g.onunhandledrejection))try{g.onunhandledrejection(n)}catch(e){}Y&&n&&!n.defaultPrevented&&console.warn(`Unhandled rejection: ${e.stack||e}`)}catch(e){}}var St=Ve.reject;function Pt(e,t,r,n){if(e.idbdb&&(e._state.openComplete||Ge.letThrough||e._vip)){var s=e._createTransaction(t,r,e._dbSchema);try{s.create(),e._state.PR1398_maxLoop=3}catch(s){return s.name===he.InvalidState&&e.isOpen()&&--e._state.PR1398_maxLoop>0?(console.warn("Dexie: Need to reopen db"),e._close(),e.open().then((()=>Pt(e,t,r,n)))):St(s)}return s._promise(t,((e,t)=>gt((()=>(Ge.trans=s,n(e,t,s)))))).then((e=>s._completion.then((()=>e))))}if(e._state.openComplete)return St(new fe.DatabaseClosed(e._state.dbOpenError));if(!e._state.isBeingOpened){if(!e._options.autoOpen)return St(new fe.DatabaseClosed);e.open().catch(me)}return e._state.dbReadyPromise.then((()=>Pt(e,t,r,n)))}const Et="3.2.4",Ot=String.fromCharCode(65535),Dt=-1/0,Ct="Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.",It="String expected.",Rt=[],Bt="undefined"!=typeof navigator&&/(MSIE|Trident|Edge)/.test(navigator.userAgent),Kt=Bt,Lt=Bt,Nt=e=>!/(dexie\.js|dexie\.min\.js)/.test(e),Mt="__dbnames",Ft="readonly",Gt="readwrite";function Wt(e,t){return e?t?function(){return e.apply(this,arguments)&&t.apply(this,arguments)}:e:t}const Ht={type:3,lower:-1/0,lowerOpen:!1,upper:[[]],upperOpen:!1};function $t(e){return"string"!=typeof e||/\./.test(e)?e=>e:t=>(void 0===t[e]&&e in t&&delete(t=F(t))[e],t)}class Vt{_trans(e,t,r){const n=this._tx||Ge.trans,s=this.name;function i(e,r,n){if(!n.schema[s])throw new fe.NotFound("Table "+s+" not part of transaction");return t(n.idbtrans,n)}const o=st();try{return n&&n.db===this.db?n===Ge.trans?n._promise(e,i,r):gt((()=>n._promise(e,i,r)),{trans:n,transless:Ge.transless||Ge}):Pt(this.db,e,[this.name],i)}finally{o&&it()}}get(e,t){return e&&e.constructor===Object?this.where(e).first(t):this._trans("readonly",(t=>this.core.get({trans:t,key:e}).then((e=>this.hook.reading.fire(e))))).then(t)}where(e){if("string"==typeof e)return new this.db.WhereClause(this,e);if(y(e))return new this.db.WhereClause(this,`[${e.join("+")}]`);const t=m(e);if(1===t.length)return this.where(t[0]).equals(e[t[0]]);const r=this.schema.indexes.concat(this.schema.primKey).filter((e=>e.compound&&t.every((t=>e.keyPath.indexOf(t)>=0))&&e.keyPath.every((e=>t.indexOf(e)>=0))))[0];if(r&&this.db._maxKey!==Ot)return this.where(r.name).equals(r.keyPath.map((t=>e[t])));!r&&Y&&console.warn(`The query ${JSON.stringify(e)} on ${this.name} would benefit of a compound index [${t.join("+")}]`);const{idxByName:n}=this.schema,s=this.db._deps.indexedDB;function i(e,t){try{return 0===s.cmp(e,t)}catch(e){return!1}}const[o,a]=t.reduce((([t,r],s)=>{const o=n[s],a=e[s];return[t||o,t||!o?Wt(r,o&&o.multi?e=>{const t=C(e,s);return y(t)&&t.some((e=>i(a,e)))}:e=>i(a,C(e,s))):r]}),[null,null]);return o?this.where(o.name).equals(e[o.keyPath]).filter(a):r?this.filter(a):this.where(t).equals("")}filter(e){return this.toCollection().and(e)}count(e){return this.toCollection().count(e)}offset(e){return this.toCollection().offset(e)}limit(e){return this.toCollection().limit(e)}each(e){return this.toCollection().each(e)}toArray(e){return this.toCollection().toArray(e)}toCollection(){return new this.db.Collection(new this.db.WhereClause(this))}orderBy(e){return new this.db.Collection(new this.db.WhereClause(this,y(e)?`[${e.join("+")}]`:e))}reverse(){return this.toCollection().reverse()}mapToClass(e){this.schema.mappedClass=e;const t=t=>{if(!t)return t;const r=Object.create(e.prototype);for(var n in t)if(T(t,n))try{r[n]=t[n]}catch(e){}return r};return this.schema.readHook&&this.hook.reading.unsubscribe(this.schema.readHook),this.schema.readHook=t,this.hook("reading",t),e}defineClass(){return this.mapToClass((function(e){v(this,e)}))}add(e,t){const{auto:r,keyPath:n}=this.schema.primKey;let s=e;return n&&r&&(s=$t(n)(e)),this._trans("readwrite",(e=>this.core.mutate({trans:e,type:"add",keys:null!=t?[t]:null,values:[s]}))).then((e=>e.numFailures?Ve.reject(e.failures[0]):e.lastResult)).then((t=>{if(n)try{I(e,n,t)}catch(e){}return t}))}update(e,t){if("object"!=typeof e||y(e))return this.where(":id").equals(e).modify(t);{const r=C(e,this.schema.primKey.keyPath);if(void 0===r)return St(new fe.InvalidArgument("Given object does not contain its primary key"));try{"function"!=typeof t?m(t).forEach((r=>{I(e,r,t[r])})):t(e,{value:e,primKey:r})}catch(e){}return this.where(":id").equals(r).modify(t)}}put(e,t){const{auto:r,keyPath:n}=this.schema.primKey;let s=e;return n&&r&&(s=$t(n)(e)),this._trans("readwrite",(e=>this.core.mutate({trans:e,type:"put",values:[s],keys:null!=t?[t]:null}))).then((e=>e.numFailures?Ve.reject(e.failures[0]):e.lastResult)).then((t=>{if(n)try{I(e,n,t)}catch(e){}return t}))}delete(e){return this._trans("readwrite",(t=>this.core.mutate({trans:t,type:"delete",keys:[e]}))).then((e=>e.numFailures?Ve.reject(e.failures[0]):void 0))}clear(){return this._trans("readwrite",(e=>this.core.mutate({trans:e,type:"deleteRange",range:Ht}))).then((e=>e.numFailures?Ve.reject(e.failures[0]):void 0))}bulkGet(e){return this._trans("readonly",(t=>this.core.getMany({keys:e,trans:t}).then((e=>e.map((e=>this.hook.reading.fire(e)))))))}bulkAdd(e,t,r){const n=Array.isArray(t)?t:void 0,s=(r=r||(n?void 0:t))?r.allKeys:void 0;return this._trans("readwrite",(t=>{const{auto:r,keyPath:i}=this.schema.primKey;if(i&&n)throw new fe.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");if(n&&n.length!==e.length)throw new fe.InvalidArgument("Arguments objects and keys must have the same length");const o=e.length;let a=i&&r?e.map($t(i)):e;return this.core.mutate({trans:t,type:"add",keys:n,values:a,wantResults:s}).then((({numFailures:e,results:t,lastResult:r,failures:n})=>{if(0===e)return s?t:r;throw new le(`${this.name}.bulkAdd(): ${e} of ${o} operations failed`,n)}))}))}bulkPut(e,t,r){const n=Array.isArray(t)?t:void 0,s=(r=r||(n?void 0:t))?r.allKeys:void 0;return this._trans("readwrite",(t=>{const{auto:r,keyPath:i}=this.schema.primKey;if(i&&n)throw new fe.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");if(n&&n.length!==e.length)throw new fe.InvalidArgument("Arguments objects and keys must have the same length");const o=e.length;let a=i&&r?e.map($t(i)):e;return this.core.mutate({trans:t,type:"put",keys:n,values:a,wantResults:s}).then((({numFailures:e,results:t,lastResult:r,failures:n})=>{if(0===e)return s?t:r;throw new le(`${this.name}.bulkPut(): ${e} of ${o} operations failed`,n)}))}))}bulkDelete(e){const t=e.length;return this._trans("readwrite",(t=>this.core.mutate({trans:t,type:"delete",keys:e}))).then((({numFailures:e,lastResult:r,failures:n})=>{if(0===e)return r;throw new le(`${this.name}.bulkDelete(): ${e} of ${t} operations failed`,n)}))}}function Jt(e){var t={},r=function(r,n){if(n){for(var s=arguments.length,i=new Array(s-1);--s;)i[s-1]=arguments[s];return t[r].subscribe.apply(null,i),e}if("string"==typeof r)return t[r]};r.addEventType=i;for(var n=1,s=arguments.length;n<s;++n)i(arguments[n]);return r;function i(e,n,s){if("object"!=typeof e){var o;n||(n=qe),s||(s=me);var a={subscribers:[],fire:s,subscribe:function(e){-1===a.subscribers.indexOf(e)&&(a.subscribers.push(e),a.fire=n(a.fire,e))},unsubscribe:function(e){a.subscribers=a.subscribers.filter((function(t){return t!==e})),a.fire=a.subscribers.reduce(n,s)}};return t[e]=r[e]=a,a}m(o=e).forEach((function(e){var t=o[e];if(y(t))i(e,o[e][0],o[e][1]);else{if("asap"!==t)throw new fe.InvalidArgument("Invalid event config");var r=i(e,ye,(function(){for(var e=arguments.length,t=new Array(e);e--;)t[e]=arguments[e];r.subscribers.forEach((function(e){O((function(){e.apply(null,t)}))}))}))}}))}}function zt(e,t){return U(t).from({prototype:e}),t}function Xt(e,t){return!(e.filter||e.algorithm||e.or)&&(t?e.justLimit:!e.replayFilter)}function Qt(e,t){e.filter=Wt(e.filter,t)}function Yt(e,t,r){var n=e.replayFilter;e.replayFilter=n?()=>Wt(n(),t()):t,e.justLimit=r&&!n}function Zt(e,t){if(e.isPrimKey)return t.primaryKey;const r=t.getIndexByKeyPath(e.index);if(!r)throw new fe.Schema("KeyPath "+e.index+" on object store "+t.name+" is not indexed");return r}function er(e,t,r){const n=Zt(e,t.schema);return t.openCursor({trans:r,values:!e.keysOnly,reverse:"prev"===e.dir,unique:!!e.unique,query:{index:n,range:e.range}})}function tr(e,t,r,n){const s=e.replayFilter?Wt(e.filter,e.replayFilter()):e.filter;if(e.or){const i={},o=(e,r,n)=>{if(!s||s(r,n,(e=>r.stop(e)),(e=>r.fail(e)))){var o=r.primaryKey,a=""+o;"[object ArrayBuffer]"===a&&(a=""+new Uint8Array(o)),T(i,a)||(i[a]=!0,t(e,r,n))}};return Promise.all([e.or._iterate(o,r),rr(er(e,n,r),e.algorithm,o,!e.keysOnly&&e.valueMapper)])}return rr(er(e,n,r),Wt(e.algorithm,s),t,!e.keysOnly&&e.valueMapper)}function rr(e,t,r,n){var s=ut(n?(e,t,s)=>r(n(e),t,s):r);return e.then((e=>{if(e)return e.start((()=>{var r=()=>e.continue();t&&!t(e,(e=>r=e),(t=>{e.stop(t),r=me}),(t=>{e.fail(t),r=me}))||s(e.value,e,(e=>r=e)),r()}))}))}function nr(e,t){try{const r=sr(e),n=sr(t);if(r!==n)return"Array"===r?1:"Array"===n?-1:"binary"===r?1:"binary"===n?-1:"string"===r?1:"string"===n?-1:"Date"===r?1:"Date"!==n?NaN:-1;switch(r){case"number":case"Date":case"string":return e>t?1:e<t?-1:0;case"binary":return function(e,t){const r=e.length,n=t.length,s=r<n?r:n;for(let r=0;r<s;++r)if(e[r]!==t[r])return e[r]<t[r]?-1:1;return r===n?0:r<n?-1:1}(ir(e),ir(t));case"Array":return function(e,t){const r=e.length,n=t.length,s=r<n?r:n;for(let r=0;r<s;++r){const n=nr(e[r],t[r]);if(0!==n)return n}return r===n?0:r<n?-1:1}(e,t)}}catch(e){}return NaN}function sr(e){const t=typeof e;if("object"!==t)return t;if(ArrayBuffer.isView(e))return"binary";const r=H(e);return"ArrayBuffer"===r?"binary":r}function ir(e){return e instanceof Uint8Array?e:ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):new Uint8Array(e)}class or{_read(e,t){var r=this._ctx;return r.error?r.table._trans(null,St.bind(null,r.error)):r.table._trans("readonly",e).then(t)}_write(e){var t=this._ctx;return t.error?t.table._trans(null,St.bind(null,t.error)):t.table._trans("readwrite",e,"locked")}_addAlgorithm(e){var t=this._ctx;t.algorithm=Wt(t.algorithm,e)}_iterate(e,t){return tr(this._ctx,e,t,this._ctx.table.core)}clone(e){var t=Object.create(this.constructor.prototype),r=Object.create(this._ctx);return e&&v(r,e),t._ctx=r,t}raw(){return this._ctx.valueMapper=null,this}each(e){var t=this._ctx;return this._read((r=>tr(t,e,r,t.table.core)))}count(e){return this._read((e=>{const t=this._ctx,r=t.table.core;if(Xt(t,!0))return r.count({trans:e,query:{index:Zt(t,r.schema),range:t.range}}).then((e=>Math.min(e,t.limit)));var n=0;return tr(t,(()=>(++n,!1)),e,r).then((()=>n))})).then(e)}sortBy(e,t){const r=e.split(".").reverse(),n=r[0],s=r.length-1;function i(e,t){return t?i(e[r[t]],t-1):e[n]}var o="next"===this._ctx.dir?1:-1;function a(e,t){var r=i(e,s),n=i(t,s);return r<n?-o:r>n?o:0}return this.toArray((function(e){return e.sort(a)})).then(t)}toArray(e){return this._read((e=>{var t=this._ctx;if("next"===t.dir&&Xt(t,!0)&&t.limit>0){const{valueMapper:r}=t,n=Zt(t,t.table.core.schema);return t.table.core.query({trans:e,limit:t.limit,values:!0,query:{index:n,range:t.range}}).then((({result:e})=>r?e.map(r):e))}{const r=[];return tr(t,(e=>r.push(e)),e,t.table.core).then((()=>r))}}),e)}offset(e){var t=this._ctx;return e<=0||(t.offset+=e,Xt(t)?Yt(t,(()=>{var t=e;return(e,r)=>0===t||(1===t?(--t,!1):(r((()=>{e.advance(t),t=0})),!1))})):Yt(t,(()=>{var t=e;return()=>--t<0}))),this}limit(e){return this._ctx.limit=Math.min(this._ctx.limit,e),Yt(this._ctx,(()=>{var t=e;return function(e,r,n){return--t<=0&&r(n),t>=0}}),!0),this}until(e,t){return Qt(this._ctx,(function(r,n,s){return!e(r.value)||(n(s),t)})),this}first(e){return this.limit(1).toArray((function(e){return e[0]})).then(e)}last(e){return this.reverse().first(e)}filter(e){var t,r;return Qt(this._ctx,(function(t){return e(t.value)})),t=this._ctx,r=e,t.isMatch=Wt(t.isMatch,r),this}and(e){return this.filter(e)}or(e){return new this.db.WhereClause(this._ctx.table,e,this)}reverse(){return this._ctx.dir="prev"===this._ctx.dir?"next":"prev",this._ondirectionchange&&this._ondirectionchange(this._ctx.dir),this}desc(){return this.reverse()}eachKey(e){var t=this._ctx;return t.keysOnly=!t.isMatch,this.each((function(t,r){e(r.key,r)}))}eachUniqueKey(e){return this._ctx.unique="unique",this.eachKey(e)}eachPrimaryKey(e){var t=this._ctx;return t.keysOnly=!t.isMatch,this.each((function(t,r){e(r.primaryKey,r)}))}keys(e){var t=this._ctx;t.keysOnly=!t.isMatch;var r=[];return this.each((function(e,t){r.push(t.key)})).then((function(){return r})).then(e)}primaryKeys(e){var t=this._ctx;if("next"===t.dir&&Xt(t,!0)&&t.limit>0)return this._read((e=>{var r=Zt(t,t.table.core.schema);return t.table.core.query({trans:e,values:!1,limit:t.limit,query:{index:r,range:t.range}})})).then((({result:e})=>e)).then(e);t.keysOnly=!t.isMatch;var r=[];return this.each((function(e,t){r.push(t.primaryKey)})).then((function(){return r})).then(e)}uniqueKeys(e){return this._ctx.unique="unique",this.keys(e)}firstKey(e){return this.limit(1).keys((function(e){return e[0]})).then(e)}lastKey(e){return this.reverse().firstKey(e)}distinct(){var e=this._ctx,t=e.index&&e.table.schema.idxByName[e.index];if(!t||!t.multi)return this;var r={};return Qt(this._ctx,(function(e){var t=e.primaryKey.toString(),n=T(r,t);return r[t]=!0,!n})),this}modify(e){var t=this._ctx;return this._write((r=>{var n;if("function"==typeof e)n=e;else{var s=m(e),i=s.length;n=function(t){for(var r=!1,n=0;n<i;++n){var o=s[n],a=e[o];C(t,o)!==a&&(I(t,o,a),r=!0)}return r}}const o=t.table.core,{outbound:a,extractKey:u}=o.schema.primaryKey,c=this.db._options.modifyChunkSize||200,l=[];let h=0;const p=[],f=(e,t)=>{const{failures:r,numFailures:n}=t;h+=e-n;for(let e of m(r))l.push(r[e])};return this.clone().primaryKeys().then((s=>{const i=l=>{const h=Math.min(c,s.length-l);return o.getMany({trans:r,keys:s.slice(l,l+h),cache:"immutable"}).then((p=>{const d=[],g=[],m=a?[]:null,y=[];for(let e=0;e<h;++e){const t=p[e],r={value:F(t),primKey:s[l+e]};!1!==n.call(r,r.value,r)&&(null==r.value?y.push(s[l+e]):a||0===nr(u(t),u(r.value))?(g.push(r.value),a&&m.push(s[l+e])):(y.push(s[l+e]),d.push(r.value)))}const v=Xt(t)&&t.limit===1/0&&("function"!=typeof e||e===ar)&&{index:t.index,range:t.range};return Promise.resolve(d.length>0&&o.mutate({trans:r,type:"add",values:d}).then((e=>{for(let t in e.failures)y.splice(parseInt(t),1);f(d.length,e)}))).then((()=>(g.length>0||v&&"object"==typeof e)&&o.mutate({trans:r,type:"put",keys:m,values:g,criteria:v,changeSpec:"function"!=typeof e&&e}).then((e=>f(g.length,e))))).then((()=>(y.length>0||v&&e===ar)&&o.mutate({trans:r,type:"delete",keys:y,criteria:v}).then((e=>f(y.length,e))))).then((()=>s.length>l+h&&i(l+c)))}))};return i(0).then((()=>{if(l.length>0)throw new ce("Error modifying one or more objects",l,h,p);return s.length}))}))}))}delete(){var e=this._ctx,t=e.range;return Xt(e)&&(e.isPrimKey&&!Lt||3===t.type)?this._write((r=>{const{primaryKey:n}=e.table.core.schema,s=t;return e.table.core.count({trans:r,query:{index:n,range:s}}).then((t=>e.table.core.mutate({trans:r,type:"deleteRange",range:s}).then((({failures:e,lastResult:r,results:n,numFailures:s})=>{if(s)throw new ce("Could not delete some values",Object.keys(e).map((t=>e[t])),t-s);return t-s}))))})):this.modify(ar)}}const ar=(e,t)=>t.value=null;function ur(e,t){return e<t?-1:e===t?0:1}function cr(e,t){return e>t?-1:e===t?0:1}function lr(e,t,r){var n=e instanceof mr?new e.Collection(e):e;return n._ctx.error=r?new r(t):new TypeError(t),n}function hr(e){return new e.Collection(e,(()=>gr(""))).limit(0)}function pr(e,t,r,n,s,i){for(var o=Math.min(e.length,n.length),a=-1,u=0;u<o;++u){var c=t[u];if(c!==n[u])return s(e[u],r[u])<0?e.substr(0,u)+r[u]+r.substr(u+1):s(e[u],n[u])<0?e.substr(0,u)+n[u]+r.substr(u+1):a>=0?e.substr(0,a)+t[a]+r.substr(a+1):null;s(e[u],c)<0&&(a=u)}return o<n.length&&"next"===i?e+r.substr(e.length):o<e.length&&"prev"===i?e.substr(0,r.length):a<0?null:e.substr(0,a)+n[a]+r.substr(a+1)}function fr(e,t,r,n){var s,i,o,a,u,c,l,h=r.length;if(!r.every((e=>"string"==typeof e)))return lr(e,It);function p(e){s=function(e){return"next"===e?e=>e.toUpperCase():e=>e.toLowerCase()}(e),i=function(e){return"next"===e?e=>e.toLowerCase():e=>e.toUpperCase()}(e),o="next"===e?ur:cr;var t=r.map((function(e){return{lower:i(e),upper:s(e)}})).sort((function(e,t){return o(e.lower,t.lower)}));a=t.map((function(e){return e.upper})),u=t.map((function(e){return e.lower})),c=e,l="next"===e?"":n}p("next");var f=new e.Collection(e,(()=>dr(a[0],u[h-1]+n)));f._ondirectionchange=function(e){p(e)};var d=0;return f._addAlgorithm((function(e,r,n){var s=e.key;if("string"!=typeof s)return!1;var p=i(s);if(t(p,u,d))return!0;for(var f=null,g=d;g<h;++g){var m=pr(s,p,a[g],u[g],o,c);null===m&&null===f?d=g+1:(null===f||o(f,m)>0)&&(f=m)}return r(null!==f?function(){e.continue(f+l)}:n),!1})),f}function dr(e,t,r,n){return{type:2,lower:e,upper:t,lowerOpen:r,upperOpen:n}}function gr(e){return{type:1,lower:e,upper:e}}class mr{get Collection(){return this._ctx.table.db.Collection}between(e,t,r,n){r=!1!==r,n=!0===n;try{return this._cmp(e,t)>0||0===this._cmp(e,t)&&(r||n)&&(!r||!n)?hr(this):new this.Collection(this,(()=>dr(e,t,!r,!n)))}catch(e){return lr(this,Ct)}}equals(e){return null==e?lr(this,Ct):new this.Collection(this,(()=>gr(e)))}above(e){return null==e?lr(this,Ct):new this.Collection(this,(()=>dr(e,void 0,!0)))}aboveOrEqual(e){return null==e?lr(this,Ct):new this.Collection(this,(()=>dr(e,void 0,!1)))}below(e){return null==e?lr(this,Ct):new this.Collection(this,(()=>dr(void 0,e,!1,!0)))}belowOrEqual(e){return null==e?lr(this,Ct):new this.Collection(this,(()=>dr(void 0,e)))}startsWith(e){return"string"!=typeof e?lr(this,It):this.between(e,e+Ot,!0,!0)}startsWithIgnoreCase(e){return""===e?this.startsWith(e):fr(this,((e,t)=>0===e.indexOf(t[0])),[e],Ot)}equalsIgnoreCase(e){return fr(this,((e,t)=>e===t[0]),[e],"")}anyOfIgnoreCase(){var e=X.apply(z,arguments);return 0===e.length?hr(this):fr(this,((e,t)=>-1!==t.indexOf(e)),e,"")}startsWithAnyOfIgnoreCase(){var e=X.apply(z,arguments);return 0===e.length?hr(this):fr(this,((e,t)=>t.some((t=>0===e.indexOf(t)))),e,Ot)}anyOf(){const e=X.apply(z,arguments);let t=this._cmp;try{e.sort(t)}catch(e){return lr(this,Ct)}if(0===e.length)return hr(this);const r=new this.Collection(this,(()=>dr(e[0],e[e.length-1])));r._ondirectionchange=r=>{t="next"===r?this._ascending:this._descending,e.sort(t)};let n=0;return r._addAlgorithm(((r,s,i)=>{const o=r.key;for(;t(o,e[n])>0;)if(++n,n===e.length)return s(i),!1;return 0===t(o,e[n])||(s((()=>{r.continue(e[n])})),!1)})),r}notEqual(e){return this.inAnyRange([[Dt,e],[e,this.db._maxKey]],{includeLowers:!1,includeUppers:!1})}noneOf(){const e=X.apply(z,arguments);if(0===e.length)return new this.Collection(this);try{e.sort(this._ascending)}catch(e){return lr(this,Ct)}const t=e.reduce(((e,t)=>e?e.concat([[e[e.length-1][1],t]]):[[Dt,t]]),null);return t.push([e[e.length-1],this.db._maxKey]),this.inAnyRange(t,{includeLowers:!1,includeUppers:!1})}inAnyRange(e,t){const r=this._cmp,n=this._ascending,s=this._descending,i=this._min,o=this._max;if(0===e.length)return hr(this);if(!e.every((e=>void 0!==e[0]&&void 0!==e[1]&&n(e[0],e[1])<=0)))return lr(this,"First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower",fe.InvalidArgument);const a=!t||!1!==t.includeLowers,u=t&&!0===t.includeUppers;let c,l=n;function h(e,t){return l(e[0],t[0])}try{c=e.reduce((function(e,t){let n=0,s=e.length;for(;n<s;++n){const s=e[n];if(r(t[0],s[1])<0&&r(t[1],s[0])>0){s[0]=i(s[0],t[0]),s[1]=o(s[1],t[1]);break}}return n===s&&e.push(t),e}),[]),c.sort(h)}catch(e){return lr(this,Ct)}let p=0;const f=u?e=>n(e,c[p][1])>0:e=>n(e,c[p][1])>=0,d=a?e=>s(e,c[p][0])>0:e=>s(e,c[p][0])>=0;let g=f;const m=new this.Collection(this,(()=>dr(c[0][0],c[c.length-1][1],!a,!u)));return m._ondirectionchange=e=>{"next"===e?(g=f,l=n):(g=d,l=s),c.sort(h)},m._addAlgorithm(((e,t,r)=>{for(var s=e.key;g(s);)if(++p,p===c.length)return t(r),!1;return!!function(e){return!f(e)&&!d(e)}(s)||(0===this._cmp(s,c[p][1])||0===this._cmp(s,c[p][0])||t((()=>{l===n?e.continue(c[p][0]):e.continue(c[p][1])})),!1)})),m}startsWithAnyOf(){const e=X.apply(z,arguments);return e.every((e=>"string"==typeof e))?0===e.length?hr(this):this.inAnyRange(e.map((e=>[e,e+Ot]))):lr(this,"startsWithAnyOf() only works with strings")}}function yr(e){return ut((function(t){return vr(t),e(t.target.error),!1}))}function vr(e){e.stopPropagation&&e.stopPropagation(),e.preventDefault&&e.preventDefault()}const br="storagemutated",wr="x-storagemutated-1",Tr=Jt(null,br);class Ar{_lock(){return E(!Ge.global),++this._reculock,1!==this._reculock||Ge.global||(Ge.lockOwnerFor=this),this}_unlock(){if(E(!Ge.global),0==--this._reculock)for(Ge.global||(Ge.lockOwnerFor=null);this._blockedFuncs.length>0&&!this._locked();){var e=this._blockedFuncs.shift();try{qt(e[1],e[0])}catch(e){}}return this}_locked(){return this._reculock&&Ge.lockOwnerFor!==this}create(e){if(!this.mode)return this;const t=this.db.idbdb,r=this.db._state.dbOpenError;if(E(!this.idbtrans),!e&&!t)switch(r&&r.name){case"DatabaseClosedError":throw new fe.DatabaseClosed(r);case"MissingAPIError":throw new fe.MissingAPI(r.message,r);default:throw new fe.OpenFailed(r)}if(!this.active)throw new fe.TransactionInactive;return E(null===this._completion._state),(e=this.idbtrans=e||(this.db.core?this.db.core.transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability}):t.transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability}))).onerror=ut((t=>{vr(t),this._reject(e.error)})),e.onabort=ut((t=>{vr(t),this.active&&this._reject(new fe.Abort(e.error)),this.active=!1,this.on("abort").fire(t)})),e.oncomplete=ut((()=>{this.active=!1,this._resolve(),"mutatedParts"in e&&Tr.storagemutated.fire(e.mutatedParts)})),this}_promise(e,t,r){if("readwrite"===e&&"readwrite"!==this.mode)return St(new fe.ReadOnly("Transaction is readonly"));if(!this.active)return St(new fe.TransactionInactive);if(this._locked())return new Ve(((n,s)=>{this._blockedFuncs.push([()=>{this._promise(e,t,r).then(n,s)},Ge])}));if(r)return gt((()=>{var e=new Ve(((e,r)=>{this._lock();const n=t(e,r,this);n&&n.then&&n.then(e,r)}));return e.finally((()=>this._unlock())),e._lib=!0,e}));var n=new Ve(((e,r)=>{var n=t(e,r,this);n&&n.then&&n.then(e,r)}));return n._lib=!0,n}_root(){return this.parent?this.parent._root():this}waitFor(e){var t=this._root();const r=Ve.resolve(e);if(t._waitingFor)t._waitingFor=t._waitingFor.then((()=>r));else{t._waitingFor=r,t._waitingQueue=[];var n=t.idbtrans.objectStore(t.storeNames[0]);!function e(){for(++t._spinCount;t._waitingQueue.length;)t._waitingQueue.shift()();t._waitingFor&&(n.get(-1/0).onsuccess=e)}()}var s=t._waitingFor;return new Ve(((e,n)=>{r.then((r=>t._waitingQueue.push(ut(e.bind(null,r)))),(e=>t._waitingQueue.push(ut(n.bind(null,e))))).finally((()=>{t._waitingFor===s&&(t._waitingFor=null)}))}))}abort(){this.active&&(this.active=!1,this.idbtrans&&this.idbtrans.abort(),this._reject(new fe.Abort))}table(e){const t=this._memoizedTables||(this._memoizedTables={});if(T(t,e))return t[e];const r=this.schema[e];if(!r)throw new fe.NotFound("Table "+e+" not part of transaction");const n=new this.db.Table(e,r,this);return n.core=this.db.core.table(e),t[e]=n,n}}function qr(e,t,r,n,s,i,o){return{name:e,keyPath:t,unique:r,multi:n,auto:s,compound:i,src:(r&&!o?"&":"")+(n?"*":"")+(s?"++":"")+_r(t)}}function _r(e){return"string"==typeof e?e:e?"["+[].join.call(e,"+")+"]":""}function Ur(e,t,r){return{name:e,primKey:t,indexes:r,mappedClass:null,idxByName:D(r,(e=>[e.name,e]))}}let kr=e=>{try{return e.only([[]]),kr=()=>[[]],[[]]}catch(e){return kr=()=>Ot,Ot}};function jr(e){return null==e?()=>{}:"string"==typeof e?function(e){return 1===e.split(".").length?t=>t[e]:t=>C(t,e)}(e):t=>C(t,e)}function xr(e){return[].slice.call(e)}let Sr=0;function Pr(e){return null==e?":id":"string"==typeof e?e:`[${e.join("+")}]`}function Er(e,t,r){function n(e){if(3===e.type)return null;if(4===e.type)throw new Error("Cannot convert never type to IDBKeyRange");const{lower:r,upper:n,lowerOpen:s,upperOpen:i}=e;return void 0===r?void 0===n?null:t.upperBound(n,!!i):void 0===n?t.lowerBound(r,!!s):t.bound(r,n,!!s,!!i)}const{schema:s,hasGetAll:i}=function(e,t){const r=xr(e.objectStoreNames);return{schema:{name:e.name,tables:r.map((e=>t.objectStore(e))).map((e=>{const{keyPath:t,autoIncrement:r}=e,n=y(t),s=null==t,i={},o={name:e.name,primaryKey:{name:null,isPrimaryKey:!0,outbound:s,compound:n,keyPath:t,autoIncrement:r,unique:!0,extractKey:jr(t)},indexes:xr(e.indexNames).map((t=>e.index(t))).map((e=>{const{name:t,unique:r,multiEntry:n,keyPath:s}=e,o={name:t,compound:y(s),keyPath:s,unique:r,multiEntry:n,extractKey:jr(s)};return i[Pr(s)]=o,o})),getIndexByKeyPath:e=>i[Pr(e)]};return i[":id"]=o.primaryKey,null!=t&&(i[Pr(t)]=o.primaryKey),o}))},hasGetAll:r.length>0&&"getAll"in t.objectStore(r[0])&&!("undefined"!=typeof navigator&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604)}}(e,r),o=s.tables.map((e=>function(e){const t=e.name;return{name:t,schema:e,mutate:function({trans:e,type:r,keys:s,values:i,range:o}){return new Promise(((a,u)=>{a=ut(a);const c=e.objectStore(t),l=null==c.keyPath,h="put"===r||"add"===r;if(!h&&"delete"!==r&&"deleteRange"!==r)throw new Error("Invalid operation type: "+r);const{length:p}=s||i||{length:1};if(s&&i&&s.length!==i.length)throw new Error("Given keys array must have same length as given values array.");if(0===p)return a({numFailures:0,failures:{},results:[],lastResult:void 0});let f;const d=[],g=[];let m=0;const y=e=>{++m,vr(e)};if("deleteRange"===r){if(4===o.type)return a({numFailures:m,failures:g,results:[],lastResult:void 0});3===o.type?d.push(f=c.clear()):d.push(f=c.delete(n(o)))}else{const[e,t]=h?l?[i,s]:[i,null]:[s,null];if(h)for(let n=0;n<p;++n)d.push(f=t&&void 0!==t[n]?c[r](e[n],t[n]):c[r](e[n])),f.onerror=y;else for(let t=0;t<p;++t)d.push(f=c[r](e[t])),f.onerror=y}const v=e=>{const t=e.target.result;d.forEach(((e,t)=>null!=e.error&&(g[t]=e.error))),a({numFailures:m,failures:g,results:"delete"===r?s:d.map((e=>e.result)),lastResult:t})};f.onerror=e=>{y(e),v(e)},f.onsuccess=v}))},getMany:({trans:e,keys:r})=>new Promise(((n,s)=>{n=ut(n);const i=e.objectStore(t),o=r.length,a=new Array(o);let u,c=0,l=0;const h=e=>{const t=e.target;a[t._pos]=t.result,++l===c&&n(a)},p=yr(s);for(let e=0;e<o;++e)null!=r[e]&&(u=i.get(r[e]),u._pos=e,u.onsuccess=h,u.onerror=p,++c);0===c&&n(a)})),get:({trans:e,key:r})=>new Promise(((n,s)=>{n=ut(n);const i=e.objectStore(t).get(r);i.onsuccess=e=>n(e.target.result),i.onerror=yr(s)})),query:function(e){return r=>new Promise(((s,i)=>{s=ut(s);const{trans:o,values:a,limit:u,query:c}=r,l=u===1/0?void 0:u,{index:h,range:p}=c,f=o.objectStore(t),d=h.isPrimaryKey?f:f.index(h.name),g=n(p);if(0===u)return s({result:[]});if(e){const e=a?d.getAll(g,l):d.getAllKeys(g,l);e.onsuccess=e=>s({result:e.target.result}),e.onerror=yr(i)}else{let e=0;const t=a||!("openKeyCursor"in d)?d.openCursor(g):d.openKeyCursor(g),r=[];t.onsuccess=n=>{const i=t.result;return i?(r.push(a?i.value:i.primaryKey),++e===u?s({result:r}):void i.continue()):s({result:r})},t.onerror=yr(i)}}))}(i),openCursor:function({trans:e,values:r,query:s,reverse:i,unique:o}){return new Promise(((a,u)=>{a=ut(a);const{index:c,range:l}=s,h=e.objectStore(t),p=c.isPrimaryKey?h:h.index(c.name),f=i?o?"prevunique":"prev":o?"nextunique":"next",d=r||!("openKeyCursor"in p)?p.openCursor(n(l),f):p.openKeyCursor(n(l),f);d.onerror=yr(u),d.onsuccess=ut((t=>{const r=d.result;if(!r)return void a(null);r.___id=++Sr,r.done=!1;const n=r.continue.bind(r);let s=r.continuePrimaryKey;s&&(s=s.bind(r));const i=r.advance.bind(r),o=()=>{throw new Error("Cursor not stopped")};r.trans=e,r.stop=r.continue=r.continuePrimaryKey=r.advance=()=>{throw new Error("Cursor not started")},r.fail=ut(u),r.next=function(){let e=1;return this.start((()=>e--?this.continue():this.stop())).then((()=>this))},r.start=e=>{const t=new Promise(((e,t)=>{e=ut(e),d.onerror=yr(t),r.fail=t,r.stop=t=>{r.stop=r.continue=r.continuePrimaryKey=r.advance=o,e(t)}})),a=()=>{if(d.result)try{e()}catch(e){r.fail(e)}else r.done=!0,r.start=()=>{throw new Error("Cursor behind last entry")},r.stop()};return d.onsuccess=ut((e=>{d.onsuccess=a,a()})),r.continue=n,r.continuePrimaryKey=s,r.advance=i,a(),t},a(r)}),u)}))},count({query:e,trans:r}){const{index:s,range:i}=e;return new Promise(((e,o)=>{const a=r.objectStore(t),u=s.isPrimaryKey?a:a.index(s.name),c=n(i),l=c?u.count(c):u.count();l.onsuccess=ut((t=>e(t.target.result))),l.onerror=yr(o)}))}}}(e))),a={};return o.forEach((e=>a[e.name]=e)),{stack:"dbcore",transaction:e.transaction.bind(e),table(e){if(!a[e])throw new Error(`Table '${e}' not found`);return a[e]},MIN_KEY:-1/0,MAX_KEY:kr(t),schema:s}}function Or({_novip:e},t){const r=t.db,n=function(e,t,{IDBKeyRange:r,indexedDB:n},s){const i=function(e,t){return t.reduce(((e,{create:t})=>({...e,...t(e)})),e)}(Er(t,r,s),e.dbcore);return{dbcore:i}}(e._middlewares,r,e._deps,t);e.core=n.dbcore,e.tables.forEach((t=>{const r=t.name;e.core.schema.tables.some((e=>e.name===r))&&(t.core=e.core.table(r),e[r]instanceof e.Table&&(e[r].core=t.core))}))}function Dr({_novip:e},t,r,n){r.forEach((r=>{const s=n[r];t.forEach((t=>{const n=j(t,r);(!n||"value"in n&&void 0===n.value)&&(t===e.Transaction.prototype||t instanceof e.Transaction?_(t,r,{get(){return this.table(r)},set(e){q(this,r,{value:e,writable:!0,configurable:!0,enumerable:!0})}}):t[r]=new e.Table(r,s))}))}))}function Cr({_novip:e},t){t.forEach((t=>{for(let r in t)t[r]instanceof e.Table&&delete t[r]}))}function Ir(e,t){return e._cfg.version-t._cfg.version}function Rr(e,t,r,n){const s=e._dbSchema,i=e._createTransaction("readwrite",e._storeNames,s);i.create(r),i._completion.catch(n);const o=i._reject.bind(i),a=Ge.transless||Ge;gt((()=>{Ge.trans=i,Ge.transless=a,0===t?(m(s).forEach((e=>{Kr(r,e,s[e].primKey,s[e].indexes)})),Or(e,r),Ve.follow((()=>e.on.populate.fire(i))).catch(o)):function({_novip:e},t,r,n){const s=[],i=e._versions;let o=e._dbSchema=Nr(e,e.idbdb,n),a=!1;const u=i.filter((e=>e._cfg.version>=t));return u.forEach((i=>{s.push((()=>{const s=o,u=i._cfg.dbschema;Mr(e,s,n),Mr(e,u,n),o=e._dbSchema=u;const c=Br(s,u);c.add.forEach((e=>{Kr(n,e[0],e[1].primKey,e[1].indexes)})),c.change.forEach((e=>{if(e.recreate)throw new fe.Upgrade("Not yet support for changing primary key");{const t=n.objectStore(e.name);e.add.forEach((e=>Lr(t,e))),e.change.forEach((e=>{t.deleteIndex(e.name),Lr(t,e)})),e.del.forEach((e=>t.deleteIndex(e)))}}));const l=i._cfg.contentUpgrade;if(l&&i._cfg.version>t){Or(e,n),r._memoizedTables={},a=!0;let t=R(u);c.del.forEach((e=>{t[e]=s[e]})),Cr(e,[e.Transaction.prototype]),Dr(e,[e.Transaction.prototype],m(t),t),r.schema=t;const i=Q(l);let o;i&&mt();const h=Ve.follow((()=>{if(o=l(r),o&&i){var e=yt.bind(null,null);o.then(e,e)}}));return o&&"function"==typeof o.then?Ve.resolve(o):h.then((()=>o))}})),s.push((t=>{a&&Kt||function(e,t){[].slice.call(t.db.objectStoreNames).forEach((r=>null==e[r]&&t.db.deleteObjectStore(r)))}(i._cfg.dbschema,t),Cr(e,[e.Transaction.prototype]),Dr(e,[e.Transaction.prototype],e._storeNames,e._dbSchema),r.schema=e._dbSchema}))})),function e(){return s.length?Ve.resolve(s.shift()(r.idbtrans)).then(e):Ve.resolve()}().then((()=>{var e,t;t=n,m(e=o).forEach((r=>{t.db.objectStoreNames.contains(r)||Kr(t,r,e[r].primKey,e[r].indexes)}))}))}(e,t,i,r).catch(o)}))}function Br(e,t){const r={del:[],add:[],change:[]};let n;for(n in e)t[n]||r.del.push(n);for(n in t){const s=e[n],i=t[n];if(s){const e={name:n,def:i,recreate:!1,del:[],add:[],change:[]};if(""+(s.primKey.keyPath||"")!=""+(i.primKey.keyPath||"")||s.primKey.auto!==i.primKey.auto&&!Bt)e.recreate=!0,r.change.push(e);else{const t=s.idxByName,n=i.idxByName;let o;for(o in t)n[o]||e.del.push(o);for(o in n){const r=t[o],s=n[o];r?r.src!==s.src&&e.change.push(s):e.add.push(s)}(e.del.length>0||e.add.length>0||e.change.length>0)&&r.change.push(e)}}else r.add.push([n,i])}return r}function Kr(e,t,r,n){const s=e.db.createObjectStore(t,r.keyPath?{keyPath:r.keyPath,autoIncrement:r.auto}:{autoIncrement:r.auto});return n.forEach((e=>Lr(s,e))),s}function Lr(e,t){e.createIndex(t.name,t.keyPath,{unique:t.unique,multiEntry:t.multi})}function Nr(e,t,r){const n={};return S(t.objectStoreNames,0).forEach((e=>{const t=r.objectStore(e);let s=t.keyPath;const i=qr(_r(s),s||"",!1,!1,!!t.autoIncrement,s&&"string"!=typeof s,!0),o=[];for(let e=0;e<t.indexNames.length;++e){const r=t.index(t.indexNames[e]);s=r.keyPath;var a=qr(r.name,s,!!r.unique,!!r.multiEntry,!1,s&&"string"!=typeof s,!1);o.push(a)}n[e]=Ur(e,i,o)})),n}function Mr({_novip:e},t,r){const n=r.db.objectStoreNames;for(let s=0;s<n.length;++s){const i=n[s],o=r.objectStore(i);e._hasGetAll="getAll"in o;for(let e=0;e<o.indexNames.length;++e){const r=o.indexNames[e],n=o.index(r).keyPath,s="string"==typeof n?n:"["+S(n).join("+")+"]";if(t[i]){const e=t[i].idxByName[s];e&&(e.name=r,delete t[i].idxByName[s],t[i].idxByName[r]=e)}}}"undefined"!=typeof navigator&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&g.WorkerGlobalScope&&g instanceof g.WorkerGlobalScope&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604&&(e._hasGetAll=!1)}class Fr{_parseStoresSpec(e,t){m(e).forEach((r=>{if(null!==e[r]){var n=e[r].split(",").map(((e,t)=>{const r=(e=e.trim()).replace(/([&*]|\+\+)/g,""),n=/^\[/.test(r)?r.match(/^\[(.*)\]$/)[1].split("+"):r;return qr(r,n||null,/\&/.test(e),/\*/.test(e),/\+\+/.test(e),y(n),0===t)})),s=n.shift();if(s.multi)throw new fe.Schema("Primary key cannot be multi-valued");n.forEach((e=>{if(e.auto)throw new fe.Schema("Only primary key can be marked as autoIncrement (++)");if(!e.keyPath)throw new fe.Schema("Index must have a name and cannot be an empty string")})),t[r]=Ur(r,s,n)}}))}stores(e){const t=this.db;this._cfg.storesSource=this._cfg.storesSource?v(this._cfg.storesSource,e):e;const r=t._versions,n={};let s={};return r.forEach((e=>{v(n,e._cfg.storesSource),s=e._cfg.dbschema={},e._parseStoresSpec(n,s)})),t._dbSchema=s,Cr(t,[t._allTables,t,t.Transaction.prototype]),Dr(t,[t._allTables,t,t.Transaction.prototype,this._cfg.tables],m(s),s),t._storeNames=m(s),this}upgrade(e){return this._cfg.contentUpgrade=_e(this._cfg.contentUpgrade||me,e),this}}function Gr(e,t){let r=e._dbNamesDB;return r||(r=e._dbNamesDB=new hn(Mt,{addons:[],indexedDB:e,IDBKeyRange:t}),r.version(1).stores({dbnames:"name"})),r.table("dbnames")}function Wr(e){return e&&"function"==typeof e.databases}function Hr(e){return gt((function(){return Ge.letThrough=!0,e()}))}function $r(){var e;return!navigator.userAgentData&&/Safari\//.test(navigator.userAgent)&&!/Chrom(e|ium)\//.test(navigator.userAgent)&&indexedDB.databases?new Promise((function(t){var r=function(){return indexedDB.databases().finally(t)};e=setInterval(r,100),r()})).finally((function(){return clearInterval(e)})):Promise.resolve()}function Vr(e){var t=t=>e.next(t),r=s(t),n=s((t=>e.throw(t)));function s(e){return t=>{var s=e(t),i=s.value;return s.done?i:i&&"function"==typeof i.then?i.then(r,n):y(i)?Promise.all(i).then(r,n):r(i)}}return s(t)()}function Jr(e,t,r){var n=arguments.length;if(n<2)throw new fe.InvalidArgument("Too few arguments");for(var s=new Array(n-1);--n;)s[n-1]=arguments[n];return r=s.pop(),[e,K(s),r]}function zr(e,t,r,n,s){return Ve.resolve().then((()=>{const i=Ge.transless||Ge,o=e._createTransaction(t,r,e._dbSchema,n),a={trans:o,transless:i};if(n)o.idbtrans=n.idbtrans;else try{o.create(),e._state.PR1398_maxLoop=3}catch(n){return n.name===he.InvalidState&&e.isOpen()&&--e._state.PR1398_maxLoop>0?(console.warn("Dexie: Need to reopen db"),e._close(),e.open().then((()=>zr(e,t,r,null,s)))):St(n)}const u=Q(s);let c;u&&mt();const l=Ve.follow((()=>{if(c=s.call(o,o),c)if(u){var e=yt.bind(null,null);c.then(e,e)}else"function"==typeof c.next&&"function"==typeof c.throw&&(c=Vr(c))}),a);return(c&&"function"==typeof c.then?Ve.resolve(c).then((e=>o.active?e:St(new fe.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn")))):l.then((()=>c))).then((e=>(n&&o._resolve(),o._completion.then((()=>e))))).catch((e=>(o._reject(e),St(e))))}))}function Xr(e,t,r){const n=y(e)?e.slice():[e];for(let e=0;e<r;++e)n.push(t);return n}const Qr={stack:"dbcore",name:"VirtualIndexMiddleware",level:1,create:function(e){return{...e,table(t){const r=e.table(t),{schema:n}=r,s={},i=[];function o(e,t,r){const n=Pr(e),a=s[n]=s[n]||[],u=null==e?0:"string"==typeof e?1:e.length,c=t>0,l={...r,isVirtual:c,keyTail:t,keyLength:u,extractKey:jr(e),unique:!c&&r.unique};return a.push(l),l.isPrimaryKey||i.push(l),u>1&&o(2===u?e[0]:e.slice(0,u-1),t+1,r),a.sort(((e,t)=>e.keyTail-t.keyTail)),l}const a=o(n.primaryKey.keyPath,0,n.primaryKey);s[":id"]=[a];for(const e of n.indexes)o(e.keyPath,0,e);function u(t){const r=t.query.index;return r.isVirtual?{...t,query:{index:r,range:(n=t.query.range,s=r.keyTail,{type:1===n.type?2:n.type,lower:Xr(n.lower,n.lowerOpen?e.MAX_KEY:e.MIN_KEY,s),lowerOpen:!0,upper:Xr(n.upper,n.upperOpen?e.MIN_KEY:e.MAX_KEY,s),upperOpen:!0})}}:t;var n,s}const c={...r,schema:{...n,primaryKey:a,indexes:i,getIndexByKeyPath:function(e){const t=s[Pr(e)];return t&&t[0]}},count:e=>r.count(u(e)),query:e=>r.query(u(e)),openCursor(t){const{keyTail:n,isVirtual:s,keyLength:i}=t.query.index;return s?r.openCursor(u(t)).then((r=>r&&function(r){const s=Object.create(r,{continue:{value:function(s){null!=s?r.continue(Xr(s,t.reverse?e.MAX_KEY:e.MIN_KEY,n)):t.unique?r.continue(r.key.slice(0,i).concat(t.reverse?e.MIN_KEY:e.MAX_KEY,n)):r.continue()}},continuePrimaryKey:{value(t,s){r.continuePrimaryKey(Xr(t,e.MAX_KEY,n),s)}},primaryKey:{get:()=>r.primaryKey},key:{get(){const e=r.key;return 1===i?e[0]:e.slice(0,i)}},value:{get:()=>r.value}});return s}(r))):r.openCursor(t)}};return c}}}};function Yr(e,t,r,n){return r=r||{},n=n||"",m(e).forEach((s=>{if(T(t,s)){var i=e[s],o=t[s];if("object"==typeof i&&"object"==typeof o&&i&&o){const e=H(i);e!==H(o)?r[n+s]=t[s]:"Object"===e?Yr(i,o,r,n+s+"."):i!==o&&(r[n+s]=t[s])}else i!==o&&(r[n+s]=t[s])}else r[n+s]=void 0})),m(t).forEach((s=>{T(e,s)||(r[n+s]=t[s])})),r}const Zr={stack:"dbcore",name:"HooksMiddleware",level:2,create:e=>({...e,table(t){const r=e.table(t),{primaryKey:n}=r.schema,s={...r,mutate(e){const s=Ge.trans,{deleting:i,creating:o,updating:a}=s.table(t).hook;switch(e.type){case"add":if(o.fire===me)break;return s._promise("readwrite",(()=>u(e)),!0);case"put":if(o.fire===me&&a.fire===me)break;return s._promise("readwrite",(()=>u(e)),!0);case"delete":if(i.fire===me)break;return s._promise("readwrite",(()=>u(e)),!0);case"deleteRange":if(i.fire===me)break;return s._promise("readwrite",(()=>function(e){return c(e.trans,e.range,1e4)}(e)),!0)}return r.mutate(e);function u(e){const t=Ge.trans,s=e.keys||function(e,t){return"delete"===t.type?t.keys:t.keys||t.values.map(e.extractKey)}(n,e);if(!s)throw new Error("Keys missing");return"delete"!==(e="add"===e.type||"put"===e.type?{...e,keys:s}:{...e}).type&&(e.values=[...e.values]),e.keys&&(e.keys=[...e.keys]),function(e,t,r){return"add"===t.type?Promise.resolve([]):e.getMany({trans:t.trans,keys:r,cache:"immutable"})}(r,e,s).then((u=>{const c=s.map(((r,s)=>{const c=u[s],l={onerror:null,onsuccess:null};if("delete"===e.type)i.fire.call(l,r,c,t);else if("add"===e.type||void 0===c){const i=o.fire.call(l,r,e.values[s],t);null==r&&null!=i&&(r=i,e.keys[s]=r,n.outbound||I(e.values[s],n.keyPath,r))}else{const n=Yr(c,e.values[s]),i=a.fire.call(l,n,r,c,t);if(i){const t=e.values[s];Object.keys(i).forEach((e=>{T(t,e)?t[e]=i[e]:I(t,e,i[e])}))}}return l}));return r.mutate(e).then((({failures:t,results:r,numFailures:n,lastResult:i})=>{for(let n=0;n<s.length;++n){const i=r?r[n]:s[n],o=c[n];null==i?o.onerror&&o.onerror(t[n]):o.onsuccess&&o.onsuccess("put"===e.type&&u[n]?e.values[n]:i)}return{failures:t,results:r,numFailures:n,lastResult:i}})).catch((e=>(c.forEach((t=>t.onerror&&t.onerror(e))),Promise.reject(e))))}))}function c(e,t,s){return r.query({trans:e,values:!1,query:{index:n,range:t},limit:s}).then((({result:r})=>u({type:"delete",keys:r,trans:e}).then((n=>n.numFailures>0?Promise.reject(n.failures[0]):r.length<s?{failures:[],numFailures:0,lastResult:void 0}:c(e,{...t,lower:r[r.length-1],lowerOpen:!0},s)))))}}};return s}})};function en(e,t,r){try{if(!t)return null;if(t.keys.length<e.length)return null;const n=[];for(let s=0,i=0;s<t.keys.length&&i<e.length;++s)0===nr(t.keys[s],e[i])&&(n.push(r?F(t.values[s]):t.values[s]),++i);return n.length===e.length?n:null}catch(e){return null}}const tn={stack:"dbcore",level:-1,create:e=>({table:t=>{const r=e.table(t);return{...r,getMany:e=>{if(!e.cache)return r.getMany(e);const t=en(e.keys,e.trans._cache,"clone"===e.cache);return t?Ve.resolve(t):r.getMany(e).then((t=>(e.trans._cache={keys:e.keys,values:"clone"===e.cache?F(t):t},t)))},mutate:e=>("add"!==e.type&&(e.trans._cache=null),r.mutate(e))}}})};function rn(e){return!("from"in e)}const nn=function(e,t){if(!this){const t=new nn;return e&&"d"in e&&v(t,e),t}v(this,arguments.length?{d:1,from:e,to:arguments.length>1?t:e}:{d:0})};function sn(e,t,r){const n=nr(t,r);if(isNaN(n))return;if(n>0)throw RangeError();if(rn(e))return v(e,{from:t,to:r,d:1});const s=e.l,i=e.r;if(nr(r,e.from)<0)return s?sn(s,t,r):e.l={from:t,to:r,d:1,l:null,r:null},un(e);if(nr(t,e.to)>0)return i?sn(i,t,r):e.r={from:t,to:r,d:1,l:null,r:null},un(e);nr(t,e.from)<0&&(e.from=t,e.l=null,e.d=i?i.d+1:1),nr(r,e.to)>0&&(e.to=r,e.r=null,e.d=e.l?e.l.d+1:1);const o=!e.r;s&&!e.l&&on(e,s),i&&o&&on(e,i)}function on(e,t){rn(t)||function e(t,{from:r,to:n,l:s,r:i}){sn(t,r,n),s&&e(t,s),i&&e(t,i)}(e,t)}function an(e){let t=rn(e)?null:{s:0,n:e};return{next(e){const r=arguments.length>0;for(;t;)switch(t.s){case 0:if(t.s=1,r)for(;t.n.l&&nr(e,t.n.from)<0;)t={up:t,n:t.n.l,s:1};else for(;t.n.l;)t={up:t,n:t.n.l,s:1};case 1:if(t.s=2,!r||nr(e,t.n.to)<=0)return{value:t.n,done:!1};case 2:if(t.n.r){t.s=3,t={up:t,n:t.n.r,s:0};continue}case 3:t=t.up}return{done:!0}}}}function un(e){var t,r;const n=((null===(t=e.r)||void 0===t?void 0:t.d)||0)-((null===(r=e.l)||void 0===r?void 0:r.d)||0),s=n>1?"r":n<-1?"l":"";if(s){const t="r"===s?"l":"r",r={...e},n=e[s];e.from=n.from,e.to=n.to,e[s]=n[s],r[s]=n[t],e[t]=r,r.d=cn(r)}e.d=cn(e)}function cn({r:e,l:t}){return(e?t?Math.max(e.d,t.d):e.d:t?t.d:0)+1}A(nn.prototype,{add(e){return on(this,e),this},addKey(e){return sn(this,e,e),this},addKeys(e){return e.forEach((e=>sn(this,e,e))),this},[V](){return an(this)}});const ln={stack:"dbcore",level:0,create:e=>{const t=e.schema.name,r=new nn(e.MIN_KEY,e.MAX_KEY);return{...e,table:n=>{const s=e.table(n),{schema:i}=s,{primaryKey:o}=i,{extractKey:a,outbound:u}=o,c={...s,mutate:e=>{const o=e.trans,a=o.mutatedParts||(o.mutatedParts={}),u=e=>{const r=`idb://${t}/${n}/${e}`;return a[r]||(a[r]=new nn)},c=u(""),l=u(":dels"),{type:h}=e;let[p,f]="deleteRange"===e.type?[e.range]:"delete"===e.type?[e.keys]:e.values.length<50?[[],e.values]:[];const d=e.trans._cache;return s.mutate(e).then((e=>{if(y(p)){"delete"!==h&&(p=e.results),c.addKeys(p);const t=en(p,d);t||"add"===h||l.addKeys(p),(t||f)&&function(e,t,r,n){t.indexes.forEach((function(t){const s=e(t.name||"");function i(e){return null!=e?t.extractKey(e):null}const o=e=>t.multiEntry&&y(e)?e.forEach((e=>s.addKey(e))):s.addKey(e);(r||n).forEach(((e,t)=>{const s=r&&i(r[t]),a=n&&i(n[t]);0!==nr(s,a)&&(null!=s&&o(s),null!=a&&o(a))}))}))}(u,i,t,f)}else if(p){const e={from:p.lower,to:p.upper};l.add(e),c.add(e)}else c.add(r),l.add(r),i.indexes.forEach((e=>u(e.name).add(r)));return e}))}},l=({query:{index:t,range:r}})=>{var n,s;return[t,new nn(null!==(n=r.lower)&&void 0!==n?n:e.MIN_KEY,null!==(s=r.upper)&&void 0!==s?s:e.MAX_KEY)]},h={get:e=>[o,new nn(e.key)],getMany:e=>[o,(new nn).addKeys(e.keys)],count:l,query:l,openCursor:l};return m(h).forEach((e=>{c[e]=function(i){const{subscr:o}=Ge;if(o){const c=e=>{const r=`idb://${t}/${n}/${e}`;return o[r]||(o[r]=new nn)},l=c(""),p=c(":dels"),[f,d]=h[e](i);if(c(f.name||"").add(d),!f.isPrimaryKey){if("count"!==e){const t="query"===e&&u&&i.values&&s.query({...i,values:!1});return s[e].apply(this,arguments).then((r=>{if("query"===e){if(u&&i.values)return t.then((({result:e})=>(l.addKeys(e),r)));const e=i.values?r.result.map(a):r.result;i.values?l.addKeys(e):p.addKeys(e)}else if("openCursor"===e){const e=r,t=i.values;return e&&Object.create(e,{key:{get:()=>(p.addKey(e.primaryKey),e.key)},primaryKey:{get(){const t=e.primaryKey;return p.addKey(t),t}},value:{get:()=>(t&&l.addKey(e.primaryKey),e.value)}})}return r}))}p.add(r)}}return s[e].apply(this,arguments)}})),c}}}};class hn{constructor(e,t){this._middlewares={},this.verno=0;const r=hn.dependencies;this._options=t={addons:hn.addons,autoOpen:!0,indexedDB:r.indexedDB,IDBKeyRange:r.IDBKeyRange,...t},this._deps={indexedDB:t.indexedDB,IDBKeyRange:t.IDBKeyRange};const{addons:n}=t;this._dbSchema={},this._versions=[],this._storeNames=[],this._allTables={},this.idbdb=null,this._novip=this;const s={dbOpenError:null,isBeingOpened:!1,onReadyBeingFired:null,openComplete:!1,dbReadyResolve:me,dbReadyPromise:null,cancelOpen:me,openCanceller:null,autoSchema:!0,PR1398_maxLoop:3};var i;s.dbReadyPromise=new Ve((e=>{s.dbReadyResolve=e})),s.openCanceller=new Ve(((e,t)=>{s.cancelOpen=t})),this._state=s,this.name=e,this.on=Jt(this,"populate","blocked","versionchange","close",{ready:[_e,me]}),this.on.ready.subscribe=P(this.on.ready.subscribe,(e=>(t,r)=>{hn.vip((()=>{const n=this._state;if(n.openComplete)n.dbOpenError||Ve.resolve().then(t),r&&e(t);else if(n.onReadyBeingFired)n.onReadyBeingFired.push(t),r&&e(t);else{e(t);const n=this;r||e((function e(){n.on.ready.unsubscribe(t),n.on.ready.unsubscribe(e)}))}}))})),this.Collection=(i=this,zt(or.prototype,(function(e,t){this.db=i;let r=Ht,n=null;if(t)try{r=t()}catch(e){n=e}const s=e._ctx,o=s.table,a=o.hook.reading.fire;this._ctx={table:o,index:s.index,isPrimKey:!s.index||o.schema.primKey.keyPath&&s.index===o.schema.primKey.name,range:r,keysOnly:!1,dir:"next",unique:"",algorithm:null,filter:null,replayFilter:null,justLimit:!0,isMatch:null,offset:0,limit:1/0,error:n,or:s.or,valueMapper:a!==ye?a:null}}))),this.Table=function(e){return zt(Vt.prototype,(function(t,r,n){this.db=e,this._tx=n,this.name=t,this.schema=r,this.hook=e._allTables[t]?e._allTables[t].hook:Jt(null,{creating:[we,me],reading:[ve,ye],updating:[Ae,me],deleting:[Te,me]})}))}(this),this.Transaction=function(e){return zt(Ar.prototype,(function(t,r,n,s,i){this.db=e,this.mode=t,this.storeNames=r,this.schema=n,this.chromeTransactionDurability=s,this.idbtrans=null,this.on=Jt(this,"complete","error","abort"),this.parent=i||null,this.active=!0,this._reculock=0,this._blockedFuncs=[],this._resolve=null,this._reject=null,this._waitingFor=null,this._waitingQueue=null,this._spinCount=0,this._completion=new Ve(((e,t)=>{this._resolve=e,this._reject=t})),this._completion.then((()=>{this.active=!1,this.on.complete.fire()}),(e=>{var t=this.active;return this.active=!1,this.on.error.fire(e),this.parent?this.parent._reject(e):t&&this.idbtrans&&this.idbtrans.abort(),St(e)}))}))}(this),this.Version=function(e){return zt(Fr.prototype,(function(t){this.db=e,this._cfg={version:t,storesSource:null,dbschema:{},tables:{},contentUpgrade:null}}))}(this),this.WhereClause=function(e){return zt(mr.prototype,(function(t,r,n){this.db=e,this._ctx={table:t,index:":id"===r?null:r,or:n};const s=e._deps.indexedDB;if(!s)throw new fe.MissingAPI;this._cmp=this._ascending=s.cmp.bind(s),this._descending=(e,t)=>s.cmp(t,e),this._max=(e,t)=>s.cmp(e,t)>0?e:t,this._min=(e,t)=>s.cmp(e,t)<0?e:t,this._IDBKeyRange=e._deps.IDBKeyRange}))}(this),this.on("versionchange",(e=>{e.newVersion>0?console.warn(`Another connection wants to upgrade database '${this.name}'. Closing db now to resume the upgrade.`):console.warn(`Another connection wants to delete database '${this.name}'. Closing db now to resume the delete request.`),this.close()})),this.on("blocked",(e=>{!e.newVersion||e.newVersion<e.oldVersion?console.warn(`Dexie.delete('${this.name}') was blocked`):console.warn(`Upgrade '${this.name}' blocked by other connection holding version ${e.oldVersion/10}`)})),this._maxKey=kr(t.IDBKeyRange),this._createTransaction=(e,t,r,n)=>new this.Transaction(e,t,r,this._options.chromeTransactionDurability,n),this._fireOnBlocked=e=>{this.on("blocked").fire(e),Rt.filter((e=>e.name===this.name&&e!==this&&!e._state.vcFired)).map((t=>t.on("versionchange").fire(e)))},this.use(Qr),this.use(Zr),this.use(ln),this.use(tn),this.vip=Object.create(this,{_vip:{value:!0}}),n.forEach((e=>e(this)))}version(e){if(isNaN(e)||e<.1)throw new fe.Type("Given version is not a positive number");if(e=Math.round(10*e)/10,this.idbdb||this._state.isBeingOpened)throw new fe.Schema("Cannot add version when database is open");this.verno=Math.max(this.verno,e);const t=this._versions;var r=t.filter((t=>t._cfg.version===e))[0];return r||(r=new this.Version(e),t.push(r),t.sort(Ir),r.stores({}),this._state.autoSchema=!1,r)}_whenReady(e){return this.idbdb&&(this._state.openComplete||Ge.letThrough||this._vip)?e():new Ve(((e,t)=>{if(this._state.openComplete)return t(new fe.DatabaseClosed(this._state.dbOpenError));if(!this._state.isBeingOpened){if(!this._options.autoOpen)return void t(new fe.DatabaseClosed);this.open().catch(me)}this._state.dbReadyPromise.then(e,t)})).then(e)}use({stack:e,create:t,level:r,name:n}){n&&this.unuse({stack:e,name:n});const s=this._middlewares[e]||(this._middlewares[e]=[]);return s.push({stack:e,create:t,level:null==r?10:r,name:n}),s.sort(((e,t)=>e.level-t.level)),this}unuse({stack:e,name:t,create:r}){return e&&this._middlewares[e]&&(this._middlewares[e]=this._middlewares[e].filter((e=>r?e.create!==r:!!t&&e.name!==t))),this}open(){return function(e){const t=e._state,{indexedDB:r}=e._deps;if(t.isBeingOpened||e.idbdb)return t.dbReadyPromise.then((()=>t.dbOpenError?St(t.dbOpenError):e));Y&&(t.openCanceller._stackHolder=re()),t.isBeingOpened=!0,t.dbOpenError=null,t.openComplete=!1;const n=t.openCanceller;function s(){if(t.openCanceller!==n)throw new fe.DatabaseClosed("db.open() was cancelled")}let i=t.dbReadyResolve,o=null,a=!1;return Ve.race([n,("undefined"==typeof navigator?Ve.resolve():$r()).then((()=>new Ve(((n,i)=>{if(s(),!r)throw new fe.MissingAPI;const u=e.name,c=t.autoSchema?r.open(u):r.open(u,Math.round(10*e.verno));if(!c)throw new fe.MissingAPI;c.onerror=yr(i),c.onblocked=ut(e._fireOnBlocked),c.onupgradeneeded=ut((n=>{if(o=c.transaction,t.autoSchema&&!e._options.allowEmptyDB){c.onerror=vr,o.abort(),c.result.close();const e=r.deleteDatabase(u);e.onsuccess=e.onerror=ut((()=>{i(new fe.NoSuchDatabase(`Database ${u} doesnt exist`))}))}else{o.onerror=yr(i);var s=n.oldVersion>Math.pow(2,62)?0:n.oldVersion;a=s<1,e._novip.idbdb=c.result,Rr(e,s/10,o,i)}}),i),c.onsuccess=ut((()=>{o=null;const r=e._novip.idbdb=c.result,s=S(r.objectStoreNames);if(s.length>0)try{const n=r.transaction(1===(i=s).length?i[0]:i,"readonly");t.autoSchema?function({_novip:e},t,r){e.verno=t.version/10;const n=e._dbSchema=Nr(0,t,r);e._storeNames=S(t.objectStoreNames,0),Dr(e,[e._allTables],m(n),n)}(e,r,n):(Mr(e,e._dbSchema,n),function(e,t){const r=Br(Nr(0,e.idbdb,t),e._dbSchema);return!(r.add.length||r.change.some((e=>e.add.length||e.change.length)))}(e,n)||console.warn("Dexie SchemaDiff: Schema was extended without increasing the number passed to db.version(). Some queries may fail.")),Or(e,n)}catch(e){}var i;Rt.push(e),r.onversionchange=ut((r=>{t.vcFired=!0,e.on("versionchange").fire(r)})),r.onclose=ut((t=>{e.on("close").fire(t)})),a&&function({indexedDB:e,IDBKeyRange:t},r){!Wr(e)&&r!==Mt&&Gr(e,t).put({name:r}).catch(me)}(e._deps,u),n()}),i)}))))]).then((()=>(s(),t.onReadyBeingFired=[],Ve.resolve(Hr((()=>e.on.ready.fire(e.vip)))).then((function r(){if(t.onReadyBeingFired.length>0){let n=t.onReadyBeingFired.reduce(_e,me);return t.onReadyBeingFired=[],Ve.resolve(Hr((()=>n(e.vip)))).then(r)}}))))).finally((()=>{t.onReadyBeingFired=null,t.isBeingOpened=!1})).then((()=>e)).catch((r=>{t.dbOpenError=r;try{o&&o.abort()}catch(e){}return n===t.openCanceller&&e._close(),St(r)})).finally((()=>{t.openComplete=!0,i()}))}(this)}_close(){const e=this._state,t=Rt.indexOf(this);if(t>=0&&Rt.splice(t,1),this.idbdb){try{this.idbdb.close()}catch(e){}this._novip.idbdb=null}e.dbReadyPromise=new Ve((t=>{e.dbReadyResolve=t})),e.openCanceller=new Ve(((t,r)=>{e.cancelOpen=r}))}close(){this._close();const e=this._state;this._options.autoOpen=!1,e.dbOpenError=new fe.DatabaseClosed,e.isBeingOpened&&e.cancelOpen(e.dbOpenError)}delete(){const e=arguments.length>0,t=this._state;return new Ve(((r,n)=>{const s=()=>{this.close();var e=this._deps.indexedDB.deleteDatabase(this.name);e.onsuccess=ut((()=>{!function({indexedDB:e,IDBKeyRange:t},r){!Wr(e)&&r!==Mt&&Gr(e,t).delete(r).catch(me)}(this._deps,this.name),r()})),e.onerror=yr(n),e.onblocked=this._fireOnBlocked};if(e)throw new fe.InvalidArgument("Arguments not allowed in db.delete()");t.isBeingOpened?t.dbReadyPromise.then(s):s()}))}backendDB(){return this.idbdb}isOpen(){return null!==this.idbdb}hasBeenClosed(){const e=this._state.dbOpenError;return e&&"DatabaseClosed"===e.name}hasFailed(){return null!==this._state.dbOpenError}dynamicallyOpened(){return this._state.autoSchema}get tables(){return m(this._allTables).map((e=>this._allTables[e]))}transaction(){const e=Jr.apply(this,arguments);return this._transaction.apply(this,e)}_transaction(e,t,r){let n=Ge.trans;n&&n.db===this&&-1===e.indexOf("!")||(n=null);const s=-1!==e.indexOf("?");let i,o;e=e.replace("!","").replace("?","");try{if(o=t.map((e=>{var t=e instanceof this.Table?e.name:e;if("string"!=typeof t)throw new TypeError("Invalid table argument to Dexie.transaction(). Only Table or String are allowed");return t})),"r"==e||e===Ft)i=Ft;else{if("rw"!=e&&e!=Gt)throw new fe.InvalidArgument("Invalid transaction mode: "+e);i=Gt}if(n){if(n.mode===Ft&&i===Gt){if(!s)throw new fe.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");n=null}n&&o.forEach((e=>{if(n&&-1===n.storeNames.indexOf(e)){if(!s)throw new fe.SubTransaction("Table "+e+" not included in parent transaction.");n=null}})),s&&n&&!n.active&&(n=null)}}catch(e){return n?n._promise(null,((t,r)=>{r(e)})):St(e)}const a=zr.bind(null,this,i,o,n,r);return n?n._promise(i,a,"lock"):Ge.trans?qt(Ge.transless,(()=>this._whenReady(a))):this._whenReady(a)}table(e){if(!T(this._allTables,e))throw new fe.InvalidTable(`Table ${e} does not exist`);return this._allTables[e]}}const pn="undefined"!=typeof Symbol&&"observable"in Symbol?Symbol.observable:"@@observable";class fn{constructor(e){this._subscribe=e}subscribe(e,t,r){return this._subscribe(e&&"function"!=typeof e?e:{next:e,error:t,complete:r})}[pn](){return this}}function dn(e,t){return m(t).forEach((r=>{on(e[r]||(e[r]=new nn),t[r])})),e}let gn;try{gn={indexedDB:g.indexedDB||g.mozIndexedDB||g.webkitIndexedDB||g.msIndexedDB,IDBKeyRange:g.IDBKeyRange||g.webkitIDBKeyRange}}catch(g){gn={indexedDB:null,IDBKeyRange:null}}const mn=hn;function yn(e){let t=vn;try{vn=!0,Tr.storagemutated.fire(e)}finally{vn=t}}A(mn,{...ge,delete:e=>new mn(e,{addons:[]}).delete(),exists:e=>new mn(e,{addons:[]}).open().then((e=>(e.close(),!0))).catch("NoSuchDatabaseError",(()=>!1)),getDatabaseNames(e){try{return function({indexedDB:e,IDBKeyRange:t}){return Wr(e)?Promise.resolve(e.databases()).then((e=>e.map((e=>e.name)).filter((e=>e!==Mt)))):Gr(e,t).toCollection().primaryKeys()}(mn.dependencies).then(e)}catch(e){return St(new fe.MissingAPI)}},defineClass:()=>function(e){v(this,e)},ignoreTransaction:e=>Ge.trans?qt(Ge.transless,e):e(),vip:Hr,async:function(e){return function(){try{var t=Vr(e.apply(this,arguments));return t&&"function"==typeof t.then?t:Ve.resolve(t)}catch(e){return St(e)}}},spawn:function(e,t,r){try{var n=Vr(e.apply(r,t||[]));return n&&"function"==typeof n.then?n:Ve.resolve(n)}catch(e){return St(e)}},currentTransaction:{get:()=>Ge.trans||null},waitFor:function(e,t){const r=Ve.resolve("function"==typeof e?mn.ignoreTransaction(e):e).timeout(t||6e4);return Ge.trans?Ge.trans.waitFor(r):r},Promise:Ve,debug:{get:()=>Y,set:e=>{Z(e,"dexie"===e?()=>!0:Nt)}},derive:U,extend:v,props:A,override:P,Events:Jt,on:Tr,liveQuery:function(e){let t,r=!1;const n=new fn((n=>{const s=Q(e);let i=!1,o={},a={};const u={get closed(){return i},unsubscribe:()=>{i=!0,Tr.storagemutated.unsubscribe(p)}};n.start&&n.start(u);let c=!1,l=!1;function h(){return m(a).some((e=>o[e]&&function(e,t){const r=an(t);let n=r.next();if(n.done)return!1;let s=n.value;const i=an(e);let o=i.next(s.from),a=o.value;for(;!n.done&&!o.done;){if(nr(a.from,s.to)<=0&&nr(a.to,s.from)>=0)return!0;nr(s.from,a.from)<0?s=(n=r.next(a.from)).value:a=(o=i.next(s.from)).value}return!1}(o[e],a[e])))}const p=e=>{dn(o,e),h()&&f()},f=()=>{if(c||i)return;o={};const d={},g=function(t){s&&mt();const r=()=>gt(e,{subscr:t,trans:null}),n=Ge.trans?qt(Ge.transless,r):r();return s&&n.then(yt,yt),n}(d);l||(Tr(br,p),l=!0),c=!0,Promise.resolve(g).then((e=>{r=!0,t=e,c=!1,i||(h()?f():(o={},a=d,n.next&&n.next(e)))}),(e=>{c=!1,r=!1,n.error&&n.error(e),u.unsubscribe()}))};return f(),u}));return n.hasValue=()=>r,n.getValue=()=>t,n},extendObservabilitySet:dn,getByKeyPath:C,setByKeyPath:I,delByKeyPath:function(e,t){"string"==typeof t?I(e,t,void 0):"length"in t&&[].map.call(t,(function(t){I(e,t,void 0)}))},shallowClone:R,deepClone:F,getObjectDiff:Yr,cmp:nr,asap:O,minKey:Dt,addons:[],connections:Rt,errnames:he,dependencies:gn,semVer:Et,version:Et.split(".").map((e=>parseInt(e))).reduce(((e,t,r)=>e+t/Math.pow(10,2*r)))}),mn.maxKey=kr(mn.dependencies.IDBKeyRange),"undefined"!=typeof dispatchEvent&&"undefined"!=typeof addEventListener&&(Tr(br,(e=>{if(!vn){let t;Bt?(t=document.createEvent("CustomEvent"),t.initCustomEvent(wr,!0,!0,e)):t=new CustomEvent(wr,{detail:e}),vn=!0,dispatchEvent(t),vn=!1}})),addEventListener(wr,(({detail:e})=>{vn||yn(e)})));let vn=!1;if("undefined"!=typeof BroadcastChannel){const e=new BroadcastChannel(wr);"function"==typeof e.unref&&e.unref(),Tr(br,(t=>{vn||e.postMessage(t)})),e.onmessage=e=>{e.data&&yn(e.data)}}else if("undefined"!=typeof self&&"undefined"!=typeof navigator){Tr(br,(e=>{try{vn||("undefined"!=typeof localStorage&&localStorage.setItem(wr,JSON.stringify({trig:Math.random(),changedParts:e})),"object"==typeof self.clients&&[...self.clients.matchAll({includeUncontrolled:!0})].forEach((t=>t.postMessage({type:wr,changedParts:e}))))}catch(e){}})),"undefined"!=typeof addEventListener&&addEventListener("storage",(e=>{if(e.key===wr){const t=JSON.parse(e.newValue);t&&yn(t.changedParts)}}));const e=self.document&&navigator.serviceWorker;e&&e.addEventListener("message",(function({data:e}){e&&e.type===wr&&yn(e.changedParts)}))}function bn(e){return bn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},bn(e)}function wn(){wn=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,s=Object.defineProperty||function(e,t,r){e[t]=r.value},i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function c(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,r){return e[t]=r}}function l(e,t,r,n){var i=t&&t.prototype instanceof y?t:y,o=Object.create(i.prototype),a=new P(n||[]);return s(o,"_invoke",{value:k(e,r,a)}),o}function h(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=l;var p="suspendedStart",f="suspendedYield",d="executing",g="completed",m={};function y(){}function v(){}function b(){}var w={};c(w,o,(function(){return this}));var T=Object.getPrototypeOf,A=T&&T(T(E([])));A&&A!==r&&n.call(A,o)&&(w=A);var q=b.prototype=y.prototype=Object.create(w);function _(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function U(e,t){function r(s,i,o,a){var u=h(e[s],e,i);if("throw"!==u.type){var c=u.arg,l=c.value;return l&&"object"==bn(l)&&n.call(l,"__await")?t.resolve(l.__await).then((function(e){r("next",e,o,a)}),(function(e){r("throw",e,o,a)})):t.resolve(l).then((function(e){c.value=e,o(c)}),(function(e){return r("throw",e,o,a)}))}a(u.arg)}var i;s(this,"_invoke",{value:function(e,n){function s(){return new t((function(t,s){r(e,n,t,s)}))}return i=i?i.then(s,s):s()}})}function k(t,r,n){var s=p;return function(i,o){if(s===d)throw new Error("Generator is already running");if(s===g){if("throw"===i)throw o;return{value:e,done:!0}}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var u=j(a,n);if(u){if(u===m)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(s===p)throw s=g,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);s=d;var c=h(t,r,n);if("normal"===c.type){if(s=n.done?g:f,c.arg===m)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(s=g,n.method="throw",n.arg=c.arg)}}}function j(t,r){var n=r.method,s=t.iterator[n];if(s===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,j(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var i=h(s,t.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,m;var o=i.arg;return o?o.done?(r[t.resultName]=o.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,m):o:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function x(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function S(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function P(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(x,this),this.reset(!0)}function E(t){if(t||""===t){var r=t[o];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var s=-1,i=function r(){for(;++s<t.length;)if(n.call(t,s))return r.value=t[s],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}throw new TypeError(bn(t)+" is not iterable")}return v.prototype=b,s(q,"constructor",{value:b,configurable:!0}),s(b,"constructor",{value:v,configurable:!0}),v.displayName=c(b,u,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===v||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,b):(e.__proto__=b,c(e,u,"GeneratorFunction")),e.prototype=Object.create(q),e},t.awrap=function(e){return{__await:e}},_(U.prototype),c(U.prototype,a,(function(){return this})),t.AsyncIterator=U,t.async=function(e,r,n,s,i){void 0===i&&(i=Promise);var o=new U(l(e,r,n,s),i);return t.isGeneratorFunction(r)?o:o.next().then((function(e){return e.done?e.value:o.next()}))},_(q),c(q,u,"Generator"),c(q,o,(function(){return this})),c(q,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=E,P.prototype={constructor:P,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(S),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function s(n,s){return a.type="throw",a.arg=t,r.next=n,s&&(r.method="next",r.arg=e),!!s}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return s("end");if(o.tryLoc<=this.prev){var u=n.call(o,"catchLoc"),c=n.call(o,"finallyLoc");if(u&&c){if(this.prev<o.catchLoc)return s(o.catchLoc,!0);if(this.prev<o.finallyLoc)return s(o.finallyLoc)}else if(u){if(this.prev<o.catchLoc)return s(o.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return s(o.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var s=this.tryEntries[r];if(s.tryLoc<=this.prev&&n.call(s,"finallyLoc")&&this.prev<s.finallyLoc){var i=s;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var o=i?i.completion:{};return o.type=e,o.arg=t,i?(this.method="next",this.next=i.finallyLoc,m):this.complete(o)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),m},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),S(r),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var s=n.arg;S(r)}return s}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:E(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),m}},t}function Tn(e,t,r,n,s,i,o){try{var a=e[i](o),u=a.value}catch(e){return void r(e)}a.done?t(u):Promise.resolve(u).then(n,s)}function An(e){return function(){var t=this,r=arguments;return new Promise((function(n,s){var i=e.apply(t,r);function o(e){Tn(i,n,s,o,a,"next",e)}function a(e){Tn(i,n,s,o,a,"throw",e)}o(void 0)}))}}Ve.rejectionMapper=function(e,t){if(!e||e instanceof ae||e instanceof TypeError||e instanceof SyntaxError||!e.name||!de[e.name])return e;var r=new de[e.name](t||e.message,e);return"stack"in e&&_(r,"stack",{get:function(){return this.inner.stack}}),r},Z(Y,Nt);var qn=function(){var e=new hn("IDBCache",{autoOpen:!1});this._detectIE=function(){var e=window.navigator.userAgent,t=e.indexOf("MSIE ");if(t>0)return parseInt(e.substring(t+5,e.indexOf(".",t)),10);if(e.indexOf("Trident/")>0){var r=e.indexOf("rv:");return parseInt(e.substring(r+3,e.indexOf(".",r)),10)}var n=e.indexOf("Edge/");return n>0&&parseInt(e.substring(n+5,e.indexOf(".",n)),10)},this._detectSafari=function(){if(navigator.userAgent.match(/Safari/i)&&!1==!navigator.userAgent.match(/Chrome/i))return!1;var e=navigator.userAgent.toLowerCase();return(e=e.substring(e.indexOf("version/")+8)).substring(0,e.indexOf("."))},this.isSupported=function(){var e=window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB,t=window.IDBKeyRange||window.webkitIDBKeyRange,r=window.IDBCursor||window.webkitIDBCursor,n=this._detectIE(),s=this._detectSafari(),i=!1!==n&&n<11,o=!1!==s&&s<10,a=!!navigator.userAgent.match(/iPad|iPhone|iPod/i);return navigator.userAgent.match(/PhantomJS/i)?e&&t&&r:e&&t&&r&&!i&&!a&&!o},this.addResponse=function(t,r,n,s){return e.responseTable.put({etag:n,data:r,timestamp:$.now(),chunks:s?parseInt(s,10):null},t)},this.getResponse=function(t){return e.responseTable.get(t)},this.addBatchResponse=function(t,r,n,s){return e.batchedResponseTable.put({id:t+r,batch:r,data:n,timestamp:$.now(),chunks:s?parseInt(s,10):null})},this.getBatchResponse=function(t,r){return e.batchedResponseTable.get(t+r)},this.deleteBatchResponses=function(t){return e.batchedResponseTable.where("batch").equals(t).delete()},this.clear=function(){return Promise.all([e.responseTable.clear(),e.batchedResponseTable.clear()])},this.clearResponseTable=function(){return Promise.all([e.responseTable.clear()])},this.initDB=function(){return e.version(.1).stores({responseTable:""}),e.version(.2).stores({batchResponseTable:"&[id+batch],batch"}),e.version(.3).stores({batchedResponseTable:"id,batch",batchResponseTable:null}),e.version(.4).stores({batchedResponseTable:"id,batch"}).upgrade((function(e){e.batchedResponseTable.filter((function(e){return e.id.includes("objects")&&e.id.includes("topology")&&e.id.includes("shortinfo")})).delete()})),e.version(.5).stores({batchedResponseTable:"id,batch"}).upgrade((function(e){e.batchedResponseTable.filter((function(e){return e.id.includes("objects")&&e.id.includes("topology")&&e.id.includes("shortinfo")})).delete()})),e.open()},this.deleteDB=function(){return e.delete()},this.close=function(){return e.close()},this.isOpen=function(){return e.isOpen()},this.dumpTableContent=function(){var e=An(wn().mark((function e(t){var r,n;return wn().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=function(e,t){var r,n;return"timestamp"===e?null!==(r=window)&&void 0!==r&&r.BIMPLUS_SDK_ENABLE_IDBCACHE_TIMESTAMP_DUMP?t:"NOT SHOWN":"data"===e?null!==(n=window)&&void 0!==n&&n.BIMPLUS_SDK_ENABLE_IDBCACHE_DATA_DUMP?t:"NOT SHOWN":t},n="",e.next=4,t.each((function(e){n+=" ".concat(JSON.stringify(e,r),"\n")}));case 4:return e.abrupt("return",n);case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),this.dumpTable=function(){var e=An(wn().mark((function e(t){var r,n,s,i;return wn().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.toCollection().count();case 2:return r=e.sent,n=[t.schema.primKey].concat(t.schema.indexes),s=n.map((function(e){return e.src})).join(","),i="Table: ".concat(t.name,", Schema: '").concat(s,"', Count of entries: ").concat(r,"\n"),e.t0=i,e.next=9,this.dumpTableContent(t);case 9:return i=e.t0+=e.sent,e.abrupt("return",i);case 11:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),this.dumpDatabase=An(wn().mark((function t(){var r;return wn().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r="",r+="BimWebSdk: Dexie Databases Dump\n",r+="===============================\n",r+="Database: ".concat(e.name," (Version: ").concat(e.verno,")\n"),t.t0=r,t.next=7,this.dumpTable(e.responseTable);case 7:return r=t.t0+=t.sent,t.t1=r,t.next=11,this.dumpTable(e.batchedResponseTable);case 11:return r=t.t1+=t.sent,t.abrupt("return",r);case 13:case"end":return t.stop()}}),t,this)})))},_n=function(){var e=null,t=null,r=new qn;r.initDB().then((function(){window.BIMPLUS_SDK_ENABLE_IDBCACHE_DUMP&&r.dumpDatabase().then((function(e){console.log(e)}))})).catch((function(e){console.error("BimWebSdk indexedDB initialization error : "+e.stack||0)})),this.setAccessToken=function(t){e=t},this.setTokenType=function(e){t=e},this.getCache=function(){return r};var n=function(e,t,n){var s=n.getResponseHeader("ETag"),i=n.getResponseHeader("X-Total-Count"),o="arraybuffer"===n.responseType;if(s){var a=!1===o?JSON.stringify(t):null;r.addResponse(e,o?t:JSON.parse(a),s,i).then((function(){})).catch((function(t){console.error("BimWebSdk failed to add response to cache: "+e+" Reason: "+t.message)}))}},s=function(e){return"W"===e.charAt(0)?e.substring(2):e};this.getBatchResponse=function(e,t,n){var s=$.Deferred(),a=n.useXMLHttpRequest?o:i;return r.getBatchResponse(e,t).then((function(i){if(i){var o={};null!==i.chunks&&(o["Cached-X-Total-Count"]=i.chunks),o.status=304,s.resolve(i.data,304,o)}else a(e,"GET",null,n).done((function(n,i,o){var a=o.getResponseHeader("X-Total-Count"),u="arraybuffer"===o.responseType,c=!1===u?JSON.stringify(n):null;r.addBatchResponse(e,t,u?n:JSON.parse(c),a).then((function(){})).catch((function(t){console.error("BimWebSdk failed to add response to cache: "+e+" Reason: "+t.message)})),s.resolve(n,i,o)})).fail((function(e,t){s.reject(e,t)}))})),s.promise()},this.get=function(u,c){if(c||(c={}),c.token||(c.token=e),c.tokenType&&c.tokenType===t||(c.tokenType=t),c.queryParams&&(u+=a(c.queryParams)),c.responseBatch)return this.getBatchResponse(u,c.responseBatch,c);var l=$.Deferred(),h=c.useXMLHttpRequest?o:i;return r.getResponse("GET;"+u).then((function(e){if(e){var t=s(e.etag);c.eTag=t,h(u,"GET",null,c).done((function(t,r,s){304===s.status?(null!==e.chunks&&(s["Cached-X-Total-Count"]=e.chunks),l.resolve(e.data,r,s)):(n("GET;"+u,t,s),l.resolve(t,r,s))})).fail((function(e,t){l.reject(e,t)}))}else h(u,"GET",null,c).done((function(e,t,r){n("GET;"+u,e,r),l.resolve(e,t,r)})).fail((function(e,t){l.reject(e,t)}))})).catch((function(){h(u,"GET",null,c).done((function(e,t,r){n("GET;"+u,e,r),l.resolve(e,t,r)})).fail((function(e,t){l.reject(e,t)}))})),l.promise()},this.getChunked=function(t,r){return u(this,e,"medium",t,r)},this.put=function(r,n,s){return s||(s={}),s.token||(s.token=e),s.tokenType&&s.tokenType===t||(s.tokenType=t),s.queryParams&&(r+=a(s.queryParams)),i(r,"PUT",n,s)},this.post=function(r,n,s){return s||(s={}),s.token||(s.token=e),s.tokenType&&s.tokenType===t||(s.tokenType=t),s.queryParams&&(r+=a(s.queryParams)),(s.useXMLHttpRequest?o:i)(r,"POST",n,s)},this.del=function(r,n,s){return s||(s={}),n||(s.contentType=null),s.dataType=null,s.token||(s.token=e),s.tokenType&&s.tokenType===t||(s.tokenType=t),s.queryParams&&(r+=a(s.queryParams)),i(r,"DELETE",n||null,s)},this.head=function(o,u){u||(u={}),u.contentType="",u.dataType="",u.token||(u.token=e),u.tokenType&&u.tokenType===t||(u.tokenType=t),u.queryParams&&(o+=a(u.queryParams));var c=$.Deferred();return r.getResponse("HEAD;"+o).then((function(e){if(e){var t=s(e.etag);u.eTag=t,i(o,"HEAD",null,u).done((function(e,t,r){304===r.status?c.resolve(!0,t,r):(n("HEAD;"+o,null,r),c.resolve(!1,t,r))})).fail((function(e,t){c.reject(e,t)}))}else i(o,"HEAD",null,u).done((function(e,t,r){n("HEAD;"+o,null,r),c.resolve(!1,t,r)})).fail((function(e,t){c.reject(!1,t)}))})).catch((function(){i(o,"HEAD",null,u).done((function(e,t,r){n("HEAD;"+o,null,r),c.resolve(!1,t,r)})).fail((function(e,t){c.reject(!1,t)}))})),c.promise()}},Un=function(e){this.detectAllClashes=function(t){return e.request.post(e.getApiTeamUrl()+"services/postprocess",t)},this.detectDisciplinesClashes=function(t){return e.request.post(e.getApiTeamUrl()+"clashdetection",t)},this.getFilters=function(t,r){var n={queryParams:{customFilter:r}};return t?e.request.get(e.getApiTeamUrl()+"clashdetection/filters/"+t,r?n:null):e.request.get(e.getApiTeamUrl()+"clashdetection/filters",r?n:null)},this.calculateClashes=function(t,r,n){if(r||n){var s={queryParams:{}};return r&&(s.queryParams.topology=r),n&&(s.queryParams.clashElements=n),e.request.post(e.getApiTeamUrl()+"clashdetection/filters",t,s)}return e.request.post(e.getApiTeamUrl()+"clashdetection/filters",t)},this.getFilterResults=function(t,r,n,s){if(n||s){var i={queryParams:{}};return n&&(i.queryParams.topology=n),s&&(i.queryParams.clashElements=s),r?e.request.get(e.getApiTeamUrl()+"clashdetection/projects/"+t+"/filters/"+r,i):e.request.get(e.getApiTeamUrl()+"clashdetection/projects/"+t+"/filters",i)}return r?e.request.get(e.getApiTeamUrl()+"clashdetection/projects/"+t+"/filters/"+r):e.request.get(e.getApiTeamUrl()+"clashdetection/projects/"+t+"/filters")},this.createClashRule=function(t,r){return e.request.post(e.getApiTeamUrl()+"projects/"+t+"/clashfilters",JSON.stringify(r))},this.deleteClashRule=function(t,r){var n={queryParams:{force:r}};return e.request.del(e.getApiTeamUrl()+"clashfilters/"+t,null,r?n:null)},this.updateClashRule=function(t,r){return e.request.put(e.getApiTeamUrl()+"clashfilters/"+t,JSON.stringify(r))},this.getAllClashRules=function(t,r){var n={queryParams:{customFilter:r}};return e.request.get(e.getApiTeamUrl()+"projects/"+t+"/clashfilters",r?n:null)}},kn=function(e){this.post=function(t){var r=[{message:t}];return e.request.post(e.getApiTeamUrl()+"clientlogs",JSON.stringify(r))},this.postExtended=function(t,r,n,s){var i=[{message:t,applicationclass:r,releaseversion:n,projectid:s}];return e.request.post(e.getApiTeamUrl()+"clientlogs",JSON.stringify(i))},this.postArray=function(t){return e.request.post(e.getApiTeamUrl()+"clientlogs",JSON.stringify(t))},this.get=function(){return e.request.get(e.getApiTeamUrl()+"clientlogs")}},jn=function(e){this.get=function(t){return e.request.get(e.getApiTeamUrl()+"comments/"+t)},this.delete=function(t){return e.request.del(e.getApiTeamUrl()+"comments/"+t)},this.put=function(t,r){return e.request.put(e.getApiTeamUrl()+"comments/"+t,r)}},xn=function(e){this.get=function(t,r,n){var s="".concat(e.getApiTeamUrl(),"objects/").concat(t,"/customtables");r&&(s+="?variantId=".concat(r));var i={};return n&&(i.queryParams={revision:n}),e.request.get(s,n?i:void 0)},this.post=function(t,r){return e.request.post("".concat(e.getApiTeamUrl(),"objects/").concat(t,"/customtables"),r)},this.exportTable=function(t,r){return e.request.post("".concat(e.getApiTeamUrl(),"customtables/").concat(t,"/export/excel"),r)},this.deleteAllTables=function(t){return e.request.del("".concat(e.getApiTeamUrl(),"objects/").concat(t,"/customtables"))},this.deleteTable=function(t){return e.request.del("".concat(e.getApiTeamUrl(),"customtables/").concat(t))}},Sn=function(e){this.get=function(t){return e.request.get(e.getApiTeamUrl()+"dimensionlines/"+t)},this.delete=function(t){return e.request.del(e.getApiTeamUrl()+"dimensionlines/"+t)},this.put=function(t,r){return e.request.put(e.getApiTeamUrl()+"dimensionlines/"+t,r)}},Pn=function(e){this.get=function(t){return t?e.request.get(e.getApiTeamUrl()+"element-types/"+t):e.request.get(e.getApiTeamUrl()+"element-types")},this.getDisciplines=function(t){return t?e.request.get(e.getApiTeamUrl()+"element-types/disciplines/"+t):e.request.get(e.getApiTeamUrl()+"element-types/disciplines")},this.getAttributeTemplates=function(t,r){return t?e.request.get(e.getApiTeamUrl()+"element-types/"+t+"/attributetemplates",r?{queryParams:r}:void 0):e.request.get(e.getApiTeamUrl()+"element-types/attributetemplates",r?{queryParams:r}:void 0)},this.getTopology=function(){return e.request.get(e.getApiTeamUrl()+"element-types/topology")},this.getProjectTopology=function(t){return e.request.get(e.getApiTeamUrl()+"projects/"+t+"/element-types")}},En=function(e){this.exportObjects=function(t,r){return e.request.get(e.getApiTeamUrl()+"projects/"+t+"/objects/export/excel?typeId="+r)},this.exportModel=function(t,r,n,s,i,o){var a={};return n&&(a.revision=n),s&&(a.emptyPropExport=1),i&&(a.propSetExport=1),o&&(a.temporary="true"),e.request.post("".concat(e.getApiTeamUrl(),"projects/").concat(t,"/model/").concat(r,"/exportasync"),null,{queryParams:a,contentType:!1,processData:!1,dataType:null})},this.exportSelection=function(t,r,n,s){var i={};return r&&(i.emptyPropExport=r),n&&(i.propSetExport=n),s&&(i.temporary="true"),e.request.post("".concat(e.getApiTeamUrl(),"selections/").concat(t,"/exportasync"),null,{queryParams:i})},this.createExportSelection=function(t,r){return e.request.post("".concat(e.getApiTeamUrl(),"projects/").concat(t,"/exportobjects"),r)}},On=function(e){this.getAccessRights=function(t){return e.request.get(e.getApiTeamUrl()+"folders/"+t+"/rights")},this.setMemberAccessRights=function(t,r,n){return e.request.put(e.getApiTeamUrl()+"folders/"+t+"/rights?assignrecursive="+(n?"true":"false"),r)},this.setMembersAccessRights=function(t,r,n){return e.request.put(e.getApiTeamUrl()+"folders/"+t+"/usersrights?assignrecursive="+(n?"true":"false"),r)}},Dn=function(e){var t=function(t){return t?e.getApiUrl()+"content/freeattributegroups/":e.getApiTeamUrl()+"freeattributegroups/"};this.post=function(r,n){return e.request.post(t(n),r)},this.get=function(r,n){return r?e.request.get(t(n)+r):e.request.get(t(n))},this.put=function(r,n,s){return e.request.put(t(s)+r,n)},this.delete=function(r,n){return e.request.del(t(n)+r)},this.getFreeAttributes=function(r,n){return e.request.get(t(n)+r+"/freeattributes")}},Cn=function(e){var t=function(t){return t?e.getApiUrl()+"content/freeattributes/":e.getApiTeamUrl()+"freeattributes/"};this.post=function(r,n){return e.request.post(t(n),r)},this.get=function(r,n,s){return r?e.request.get(t(n)+r,s?{queryParams:s}:void 0):e.request.get(t(n),s?{queryParams:s}:void 0)},this.put=function(r,n,s){return e.request.put(t(s)+r,n)},this.delete=function(r,n){return e.request.del(t(n)+r)},this.getTopology=function(r){return e.request.get(t(r)+"?topology=true")},this.getFilteredAttributes=function(t,r,n){var s=e.getApiTeamUrl();return t&&(s+="projects/".concat(t,"/")),s+="attributes?",r&&(s+="layer=".concat(r,"&")),n&&(s+="type=".concat(n)),e.request.get(s)}},In=function(e){this.calculate=function(t,r,n,s,i){var o={hiddenCalculation:{projectId:t,calculationMode:"View",view:r,clippingPlanes:n,clipRegion:{clipFace:!1},light:{useLight:!0,elevationAngle:45,sideAngle:60,useShadows:!1},propertySettings:{faceMode:"Filling",calcLines:!0},responseSettings:{mode:"Svg",svgHeight:390,svgWidth:500,fileName:s},sectionSettings:{}},runAsync:i};return e.request.post(e.getApiTeamUrl()+"services/Hiddencalculation",JSON.stringify(o))}},Rn=function(e){this.get=function(t){return e.request.get(e.getApiTeamUrl()+"hyperlinks/"+t)},this.delete=function(t){return e.request.del(e.getApiTeamUrl()+"hyperlinks/"+t)},this.put=function(t,r){return e.request.put(e.getApiTeamUrl()+"hyperlinks/"+t,r)}},Bn=function(e){this.postModel=function(t,r,n,s,i){return"replaceModelData"===i?e.request.post(e.getApiTeamUrl()+"projects/"+t+"/model/"+r+"/importasync?replaceModelData=true",n,{preparedData:n,contentType:!1,processData:!1,dataType:null,xhrUploadProgress:s}):e.request.post(e.getApiTeamUrl()+"projects/"+t+"/model/"+r+"/importasync",n,{preparedData:n,contentType:!1,processData:!1,dataType:null,xhrUploadProgress:s})}},Kn=function(e){this.post=function(t,r){return e.request.post(e.getApiTeamUrl()+"projects/"+t+"/issues",r)},this.get=function(t){return e.request.get(e.getApiTeamUrl()+"issues/"+t)},this.postPin=function(t,r){return e.request.post(e.getApiTeamUrl()+"issues/"+t+"/pins",r)},this.getPins=function(t){return e.request.get(e.getApiTeamUrl()+"issues/"+t+"/pins")},this.deletePins=function(t){return e.request.del(e.getApiTeamUrl()+"issues/"+t+"/pins")},this.postComment=function(t,r){return e.request.post(e.getApiTeamUrl()+"issues/"+t+"/comments",r)},this.getComments=function(t){return e.request.get(e.getApiTeamUrl()+"issues/"+t+"/comments")},this.deleteComments=function(t){return e.request.del(e.getApiTeamUrl()+"issues/"+t+"/comments")},this.postAttachment=function(t,r){return e.request.post(e.getApiTeamUrl()+"issues/"+t+"/attachments",r)},this.getAttachments=function(t){return e.request.get(e.getApiTeamUrl()+"issues/"+t+"/attachments")},this.deleteAttachments=function(t){return e.request.del(e.getApiTeamUrl()+"issues/"+t+"/attachments")},this.put=function(t,r,n){return e.request.put(e.getApiTeamUrl()+"issues/"+t,r,n?{queryParams:n}:void 0)},this.delete=function(t,r){var n={queryParams:{forceDelete:r}};return e.request.del(e.getApiTeamUrl()+"issues/"+t,null,r?n:null)},this.getRights=function(t){return e.request.get(e.getApiTeamUrl()+"issues/"+t+"/rights")},this.getIssueTypes=function(){return e.request.get(e.getApiTeamUrl()+"lib/issuetypes")},this.getReports=function(t){return e.request.get(e.getApiTeamUrl()+"issues/"+t+"/reports")},this.importBcf=function(t,r){return e.request.put(e.getApiTeamUrl()+"projects/"+t+"/issues/bcf",r,{contentType:!1,processData:!1})},this.updateImportBcf=function(t,r){return e.request.put(e.getApiTeamUrl()+"projects/"+t+"/issues/bcf",r)},this.exportBcf=function(t,r,n){return t?e.request.post(e.getApiTeamUrl()+"projects/"+t+"/issues/export/bcf"+(n?"?version="+n:""),r):e.request.post(e.getApiTeamUrl()+"issues/export/bcf"+(n?"?version="+n:""),r)},this.exportExcel=function(t,r){return t?e.request.post(e.getApiTeamUrl()+"projects/"+t+"/issues/export/excel",r):e.request.post(e.getApiTeamUrl()+"issues/export/excel",r)}},Ln=function(e){this.get=function(t){return e.request.get(e.getApiTeamUrl()+"labels/"+t)},this.delete=function(t){return e.request.del(e.getApiTeamUrl()+"labels/"+t)},this.put=function(t,r){return e.request.put(e.getApiTeamUrl()+"labels/"+t,r)}},Nn=function(e){this.lockObject=function(t,r){return e.request.put(e.getApiTeamUrl()+"objects/"+t+"/locks",r,{dataType:"text"})},this.checkLocked=function(t){return e.request.get(e.getApiTeamUrl()+"objects/"+t+"/locks")},this.deleteLock=function(t,r){return!0===r?e.request.del(e.getApiTeamUrl()+"objects/"+t+"/locks?asAdmin=true"):e.request.del(e.getApiTeamUrl()+"objects/"+t+"/locks")},this.getLocksWithChildren=function(t){return e.request.get(e.getApiTeamUrl()+"objects/"+t+"/locks?withChildren=true")}},Mn=function(e){this.post=function(t){return e.request.post(e.getApiTeamUrl()+"members",t)},this.get=function(){return e.request.get(e.getApiTeamUrl()+"members")},this.putUser=function(t,r,n){return e.request.put(e.getApiTeamUrl()+"members/"+r,n)},this.deleteUser=function(t,r){return e.request.del(e.getApiTeamUrl()+"members/"+r)}},Fn=function(e){this.post=function(t){return e.request.post(e.getApiUrl()+"messages",t)},this.getUserMessages=function(t){return e.request.get(e.getApiUrl()+"user/"+t+"/messages")},this.getUserDashboardMessages=function(t){return e.request.get(e.getApiUrl()+"user/"+t+"/messages?topic=dashboard")},this.getSentUserMessages=function(t){return e.request.get(e.getApiUrl()+"user/"+t+"/messages/sent")},this.getSentGroupMessages=function(t){return e.request.get(e.getApiUrl()+"user/"+t+"/messages/groupsent")},this.get=function(t){return e.request.get(e.getApiUrl()+"messages/"+t)},this.getFiltered=function(t){return e.request.get(e.getApiUrl()+"messages/",{queryParams:{filter:t}})},this.deleteMessage=function(t){return e.request.del(e.getApiUrl()+"messages/"+t)},this.markAsRead=function(t){return e.request.post(e.getApiUrl()+"messages/"+t+"/markasreadbrowser",null,{dataType:null,contentType:null})},this.updateDashboardAdditionalData=function(t,r){return e.request.put(e.getApiUrl()+"messages/"+t+"/updatedashboardadditionaldata",r)},this.addDashboardMessageAttachment=function(t,r,n){return e.request.put(e.getApiUrl()+"messages/"+t+"/upload?type=dashboard",r,n)},this.getAllMessagingGroups=function(){return e.request.get(e.getApiUrl()+"systemgroups")},this.getMessagingGroupsDetails=function(t){return e.request.get(e.getApiUrl()+"systemgroups/"+t)}},Gn=function(e){this.get=function(t){return t?e.request.get(e.getApiTeamUrl()+"divisions/"+t):e.request.get(e.getApiTeamUrl()+"divisions")},this.head=function(t){return e.request.head?e.request.head(e.getApiTeamUrl()+"divisions/"+t):(console.warn("BimWebSdk: request (divisions/".concat(t,") does not support head method!")),new Promise((function(e){e(!1)})))},this.getDisciplines=function(t){return e.request.get(e.getApiTeamUrl()+"divisions/"+t+"/disciplines")},this.setDisciplineValidity=function(t,r,n){var s={private:!n};return e.request.put(e.getApiTeamUrl()+"divisions/"+t+"/disciplines/"+r,JSON.stringify(s))},this.getRevisions=function(t){return e.request.get(e.getApiTeamUrl()+"divisions/"+t+"/revisions")},this.getAllRevisions=function(t){return e.request.get(e.getApiTeamUrl()+"projects/"+t+"/revisions")},this.postRevision=function(t,r){return e.request.post(e.getApiTeamUrl()+"divisions/"+t+"/revisions",r)},this.put=function(t,r){return e.request.put(e.getApiTeamUrl()+"divisions/"+t,r)},this.download=function(t){return e.request.get(e.getApiTeamUrl()+"divisions/"+t+"/download")},this.delete=function(t){return e.request.del(e.getApiTeamUrl()+"divisions/"+t)},this.move=function(t,r){return e.request.put(e.getApiTeamUrl()+"divisions/"+t+"/move",r)}},Wn=["topology","structure"],Hn=function(e){this.get=function(t,r){var n={};return t&&(n.object_id=t),r&&(n.project_id=r),e.request.get(e.getApiTeamUrl()+"settings/filters",{queryParams:n})},this.getFilteredObjects=function(t,r,n,s){if(n)return e.request.get(e.getApiTeamUrl()+"projects/"+t+"/filters/"+r+"/properties",{queryParams:n});if(s&&Wn.find((function(e){return e===s}))){var i={};return i[s]=!0,e.request.get(e.getApiTeamUrl()+"projects/"+t+"/filters/"+r,{queryParams:i})}return e.request.get(e.getApiTeamUrl()+"projects/"+t+"/filters/"+r)},this.getSelectionFilteredObjects=function(t,r,n,s){if(n)return e.request.get(e.getApiTeamUrl()+"selections/"+t+"/filters/"+r+"/properties",{queryParams:n});if(s&&Wn.find((function(e){return e===s}))){var i={};return i[s]=!0,e.request.get(e.getApiTeamUrl()+"selections/"+t+"/filters/"+r,{queryParams:i})}return e.request.get(e.getApiTeamUrl()+"selections/"+t+"/filters/"+r)},this.applyFilter=function(t){return e.request.get(e.getApiTeamUrl()+"filters/"+t)},this.post=function(t,r){var n={};return r&&(n.project_id=r),e.request.post(e.getApiTeamUrl()+"settings/filter",t,{queryParams:n})},this.put=function(t){return e.request.put(e.getApiTeamUrl()+"settings/filter",t)},this.delete=function(t){return e.request.del(e.getApiTeamUrl()+"settings/filter/"+t)},this.getFilter=function(t){return e.request.get(e.getApiTeamUrl()+"settings/filters/"+t)}},$n=function(e){this.post=function(t){return e.request.post(e.getApiTeamUrl()+"objects/",t)},this.get=function(t,r,n,s,i,o){var a={};r&&(a.queryParams={revision:r}),s&&(a.queryParams?a.queryParams.projectId=s:a.queryParams={projectId:s}),i&&(a.queryParams?a.queryParams.shortinfo=i:a.queryParams={shortinfo:i}),o&&(a.queryParams?a.queryParams.type=o:a.queryParams={type:o});var u=e.getApiTeamUrl()+"objects/"+t;return n&&(u+="/properties/",u+=n),e.request.get(u,r||s||i||o?a:void 0)},this.getInternal=function(t,r){var n={};r&&(n.queryParams={revision:r});var s=e.getApiTeamUrl()+"objects/"+t;return s+="/internal",e.request.get(s,r?n:void 0)},this.head=function(t,r){var n={};return r&&(n.queryParams={revision:r}),e.request.head?e.request.head(e.getApiTeamUrl()+"objects/"+t,r?n:void 0):(console.warn("BimWebSdk: request (objects/".concat(t,") does not support head method! Using get as fallback.")),e.request.get(e.getApiTeamUrl()+"objects/"+t,r?n:void 0))},this.getTopology=function(t,r,n,s,i){var o={};return(r||n||s)&&(o.queryParams={},r&&(o.queryParams.revision=r),n&&(o.queryParams.hideElements=n),s&&(o.queryParams.shortinfo=s)),i&&(o.responseBatch=i),e.request.get(e.getApiTeamUrl()+"objects/"+t+"/topology",o)},this.getGeometryThreeJS=function(t,r,n,s,i,o,a,u){var c,l={};return null===s&&null===i&&null===u||(l.queryParams={},null!==s&&(l.queryParams.revision=s),null!==i&&(l.queryParams.levelofdetail=i),null!==u&&(l.queryParams.chunkSize=u)),a&&(l.responseBatch=a),c=r?e.getApiTeamUrl()+"objects/"+t+"/disciplines/"+r+"/geometries/threejs":e.getApiTeamUrl()+"objects/"+t+"/geometries/threejs",o&&(c+="/properties/",c+=o),n?e.request.getChunked(c,l):e.request.get(c,l)},this.getGeometryGLB=function(t,r,n,s,i,o,a,u,c){var l,h=arguments.length>9&&void 0!==arguments[9]?arguments[9]:void 0,p=arguments.length>10&&void 0!==arguments[10]?arguments[10]:void 0,f={};return f.dataType="binary",f.processData=!1,f.responseType="arraybuffer",f.useXMLHttpRequest=!0,void 0===n&&void 0===s&&void 0===i&&void 0===o&&void 0===a&&void 0===h&&void 0===p||(f.queryParams={},void 0!==n&&(f.queryParams.revision=n),void 0!==s&&(f.queryParams.levelofdetail=s),void 0!==i&&(f.queryParams.vertexNormals=i),void 0!==o&&(f.queryParams.smoothingAngle=o),void 0!==a&&(f.queryParams.topology=a),void 0!==h&&(f.queryParams.edges=h),void 0!==p&&(f.queryParams.version=p)),u&&(f.responseBatch=u),l=r?e.getApiTeamUrl()+"objects/"+t+"/disciplines/"+r+"/geometries/glb":e.getApiTeamUrl()+"objects/"+t+"/geometries/glb",c?e.request.getChunked(l,f):e.request.get(l,f)},this.getGLB=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;return this.getGeometryGLB(e,undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,t)},this.getGeometryTemplatesThreeJS=function(t,r,n,s,i,o){var a={};null===s&&null===i||(a.queryParams={},null!==s&&(a.queryParams.revision=s),null!==i&&(a.queryParams.levelofdetail=i)),o&&(a.responseBatch=o);var u=e.getApiTeamUrl()+"objects/"+t+"/disciplines/"+r+"/templates/threejs";return n?e.request.getChunked(u,a):e.request.get(u,a)},this.getGeometryCompressed=function(t,r){return r?e.request.get(e.getApiTeamUrl()+"objects/"+t+"/disciplines/"+r+"/geometries/meshblob"):e.request.get(e.getApiTeamUrl()+"objects/"+t+"/geometries/meshblob")},this.getProperties=function(t,r){return e.request.get(e.getApiTeamUrl()+"objects/"+t+"/geometries/threejs/properties"+r)},this.put=function(t,r,n){var s={};return n&&(s.projectid=n),e.request.put(e.getApiTeamUrl()+"objects/"+t,r,{queryParams:s})},this.postComment=function(t,r){return e.request.post(e.getApiTeamUrl()+"objects/"+t+"/comments",r)},this.getComments=function(t){return e.request.get(e.getApiTeamUrl()+"objects/"+t+"/comments")},this.deleteComments=function(t){return e.request.del(e.getApiTeamUrl()+"objects/"+t+"/comments")},this.postAttachment=function(t,r,n,s){return e.request.post(e.getApiTeamUrl()+"objects/"+t+"/attachments",r,{contentType:!1,processData:!1,dataType:null,xhrUploadProgress:n,queryParams:s?{DocumentFolderId:s}:void 0})},this.getAttachments=function(t,r){return e.request.get(e.getApiTeamUrl()+"objects/"+t+"/attachments",r?{queryParams:{revision:r}}:void 0)},this.deleteAttachments=function(t){return e.request.del(e.getApiTeamUrl()+"objects/"+t+"/attachments")},this.postAttachmentLink=function(t,r){return e.request.post(e.getApiTeamUrl()+"objects/"+t+"/attachmentlinks",r)},this.getAttachmentLinks=function(t){return e.request.get(e.getApiTeamUrl()+"objects/"+t+"/attachmentlinks")},this.deleteAttachmentLink=function(t,r){return e.request.del(e.getApiTeamUrl()+"objects/"+t+"/attachmentlinks/"+r)},this.postHyperlink=function(t,r){return e.request.post(e.getApiTeamUrl()+"objects/"+t+"/hyperlinks",r)},this.getHyperlinks=function(t){return e.request.get(e.getApiTeamUrl()+"objects/"+t+"/hyperlinks")},this.deleteHyperlinks=function(t){return e.request.del(e.getApiTeamUrl()+"objects/"+t+"/hyperlinks")},this.delete=function(t){return e.request.del(e.getApiTeamUrl()+"objects/"+t)},this.getAttributes=function(t,r,n,s){var i=r?"&documentversion="+r:"",o=s?"&revision="+s:"",a=n?"&projectid="+n:"",u=e.getApiTeamUrl()+"objects/"+t+"?freeattributes=true";return e.request.get(u+i+o+a)},this.getAttributesAsFlatStructure=function(t,r,n,s){var i=r?"&documentversion="+r:"",o=s?"&revision="+s:"",a=n?"&projectid="+n:"",u=e.getApiTeamUrl()+"objects/"+t+"?freeattributes=true&internal=true&attributedefinition=true";return e.request.get(u+i+o+a)},this.getAttributeValues=function(t,r){return e.request.get(e.getApiTeamUrl()+"objects/"+t+"/attributes/"+r+"?children=true")},this.getComplexPropertiesTopology=function(t,r){return e.request.get(e.getApiTeamUrl()+"objects/"+t+"/complexproperties"+(r>=0?"?revision="+r:""))},this.postThumbnail=function(t,r,n){return e.request.post(e.getApiTeamUrl()+"objects/"+t+"/thumbnail",r,{contentType:!1,processData:!1,dataType:null,xhrUploadProgress:n})},this.deleteThumbnail=function(t){return e.request.del(e.getApiTeamUrl()+"objects/"+t+"/thumbnail")},this.addChildObject=function(t){return e.request.post(e.getApiTeamUrl()+"objects/alter/",t)},this.getReports=function(t,r,n){return e.request.get(e.getApiTeamUrl()+"objects/"+t+"/reports?version="+r+"&action="+n)},this.exportExcelReports=function(t,r){return e.request.post(e.getApiTeamUrl()+"projects/"+t+"/reports/export/excel",r)},this.postDimensions=function(t,r){return e.request.post(e.getApiTeamUrl()+"objects/"+t+"/dimensionlines",r)},this.putDimensions=function(t,r){return e.request.put(e.getApiTeamUrl()+"objects/"+t+"/dimensionlines",r)},this.getDimensions=function(t){return e.request.get(e.getApiTeamUrl()+"objects/"+t+"/dimensionlines")},this.deleteDimensions=function(t){return e.request.del(e.getApiTeamUrl()+"objects/"+t+"/dimensionlines")},this.postLabels=function(t,r){return e.request.post(e.getApiTeamUrl()+"objects/"+t+"/labels",r)},this.putLabels=function(t,r){return e.request.put(e.getApiTeamUrl()+"objects/"+t+"/labels",r)},this.getLabels=function(t){return e.request.get(e.getApiTeamUrl()+"objects/"+t+"/labels")},this.deleteLabels=function(t){return e.request.del(e.getApiTeamUrl()+"objects/"+t+"/labels")},this.postAnnotations=function(t,r){return e.request.post(e.getApiTeamUrl()+"objects/"+t+"/annotations",r)},this.putAnnotations=function(t,r){return e.request.put(e.getApiTeamUrl()+"objects/"+t+"/annotations",r)},this.getAnnotations=function(t){return e.request.get(e.getApiTeamUrl()+"objects/"+t+"/annotations")},this.deleteAnnotations=function(t){return e.request.del(e.getApiTeamUrl()+"objects/"+t+"/annotations")},this.getObjectIdsByQuery=function(t,r,n,s){var i=Array.isArray(s)?s.join(","):void 0,o={queryParams:{}};return o.queryParams[r]=n,i&&(o.queryParams.divisions=i),e.request.get(e.getApiTeamUrl()+"objects/"+t+"/query",o)},this.getObjectIdsByIfcId=function(e,t,r){return this.getObjectIdsByQuery(e,"93027bad-df91-48ee-a0bb-60a8184cddba",t,r)},this.postOverlay=function(t){return e.request.post(e.getApiTeamUrl()+"objects/",t)},this.getOverlays=function(t){return e.request.get(e.getApiTeamUrl()+"objects/"+t+"/overlays")},this.getOverlay=function(e){return this.getInternal(e)},this.deleteOverlay=function(t){return e.request.del(e.getApiTeamUrl()+"objects/"+t)},this.deleteOverlays=function(t){return e.request.del(e.getApiTeamUrl()+"objects/"+t+"/overlays")},this.getThumbnail=function(t){var r=e.getApiTeamUrl()+"objects/"+t+"/thumbnail/download";return e.request.get(r,{useXMLHttpRequest:!0,dataType:"binary",processData:!1,responseType:"arraybuffer"})}},Vn=function(e){this.get=function(t){return e.request.get(e.getApiTeamUrl()+"overlays/"+t)},this.put=function(t,r){return e.request.put(e.getApiTeamUrl()+"overlays/"+t,r)},this.delete=function(t){return e.request.del(e.getApiTeamUrl()+"overlays/"+t)}},Jn=function(e){this.get=function(t){return e.request.get(e.getApiTeamUrl()+"overlaysets/"+t)},this.put=function(t,r){return e.request.put(e.getApiTeamUrl()+"overlaysets/"+t,r)},this.delete=function(t){return e.request.del(e.getApiTeamUrl()+"overlaysets/"+t)},this.postOverlay=function(t,r){return e.request.post(e.getApiTeamUrl()+"overlaysets/"+t+"/overlays",r)},this.getOverlays=function(t){return e.request.get(e.getApiTeamUrl()+"overlaysets/"+t+"/overlays")}},zn=function(e){this.get=function(t){return e.request.get(e.getApiTeamUrl()+"pins/"+t)},this.delete=function(t){return e.request.del(e.getApiTeamUrl()+"pins/"+t)},this.put=function(t,r){return e.request.put(e.getApiTeamUrl()+"pins/"+t,r)}},Xn=function(e){this.get=function(){return e.request.get(e.getApiUrl()+"project-actions-rights/")}},Qn=function(e){var t="projectattributetemplates";this.post=function(r){return e.request.post(e.getApiTeamUrl()+t,r)},this.get=function(r,n){var s=n?{queryParams:{default:n}}:null;return r?e.request.get(e.getApiTeamUrl()+t+"/"+r):e.request.get(e.getApiTeamUrl()+t,s)},this.put=function(r,n){return e.request.put(e.getApiTeamUrl()+t+"/"+r,n)},this.delete=function(r){return e.request.del(e.getApiTeamUrl()+t+"/"+r)},this.copyFrom=function(r,n){return e.request.put(e.getApiTeamUrl()+t+"/"+n+"/copyfrom",JSON.stringify({id:r}))},this.setDefault=function(r){return e.request.put(e.getApiTeamUrl()+t+"/"+r+"/default")}};function Yn(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,s,i,o,a=[],u=!0,c=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(a.push(n.value),a.length!==t);u=!0);}catch(e){c=!0,s=e}finally{try{if(!u&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(c)throw s}}return a}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Zn(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Zn(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Zn(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var es=function(e){this.post=function(t){return e.request.post(e.getApiTeamUrl()+"projects",t)},this.createFromExisting=function(t){return e.request.post(e.getApiTeamUrl()+"projects/copyfrom",t)},this.put=function(t,r){return e.request.put(e.getApiTeamUrl()+"projects/"+t,r)},this.get=function(t,r,n,s,i){var o={queryParams:i||{}};return r&&(o.queryParams.disciplines=!1),s&&(o.queryParams.recycleBin=!0),t?e.request.get(e.getApiTeamUrl()+"projects/"+t,o):n?e.request.get(e.getApiUrl()+n+"/projects",o):e.getTeamSlug()?e.request.get(e.getApiTeamUrl()+"projects",o):e.request.get(e.getApiUrl()+"/projects",o)},this.delete=function(t){return e.request.del(e.getApiTeamUrl()+"projects/"+t)},this.moveToRecycleBin=function(t){return e.request.del(e.getApiTeamUrl()+"projects/"+t+"?moveToRecycleBin=true")},this.restoreFromRecycleBin=function(t){return e.request.put(e.getApiTeamUrl()+"objects/"+t+"/restore",JSON.stringify({}),{dataType:"text"})},this.deleteFromRecycleBin=function(t){return e.request.del(e.getApiTeamUrl()+"projects/"+t+"?fromRecycleBin=true")},this.deleteServerCache=function(t){return e.request.del(e.getApiTeamUrl()+"projects/"+t+"/deletecache")},this.clearServerDecimation=function(t,r,n){return r||(r="00000000-0000-0000-0000-000000000000"),(n<0||!n&&0!=n)&&(n="100"),e.request.del(e.getApiTeamUrl()+"temporary/projects/"+t+"/disciplines/"+r+"/levelofdetails/"+n)},this.getModels=function(t){return e.request.get(e.getApiTeamUrl()+"projects/"+t+"/divisions")},this.postModel=function(t,r){return e.request.post(e.getApiTeamUrl()+"projects/"+t+"/divisions",r)},this.getMembers=function(t){return e.request.get(e.getApiTeamUrl()+"projects/"+t+"/members")},this.postMember=function(t,r){return e.request.post(e.getApiTeamUrl()+"projects/"+t+"/members",r)},this.putMember=function(t,r){return e.request.put(e.getApiTeamUrl()+"projects/"+t+"/members",r)},this.deleteMember=function(t,r){return e.request.del(e.getApiTeamUrl()+"projects/"+t+"/members",r)},this.getPins=function(t){return e.request.get(e.getApiTeamUrl()+"projects/"+t+"/pins")},this.putProject=function(t,r){return e.request.put(e.getApiTeamUrl()+"projects/"+t,r)},this.postAttachment=function(t,r){return e.request.post(e.getApiTeamUrl()+"projects/"+t+"/attachments",r)},this.getAttachments=function(t,r,n){var s=n;return s||(s={}),r&&(s.revision=r),e.request.get(e.getApiTeamUrl()+"projects/"+t+"/attachments",r||n?{queryParams:s}:void 0)},this.deleteAttachments=function(t){return e.request.del(e.getApiTeamUrl()+"projects/"+t+"/attachments")},this.getTopology=function(t){return e.request.get(e.getApiTeamUrl()+"projects/"+t+"/topology")},this.getSpots=function(t){return e.request.get(e.getApiTeamUrl()+"projects/"+t+"/pins")},this.postThumbnail=function(t,r,n){return e.request.post(e.getApiTeamUrl()+"projects/"+t+"/thumbnail",r,{contentType:!1,processData:!1,dataType:null,xhrUploadProgress:n})},this.getThumbnail=function(t){return e.request.get(e.getApiTeamUrl()+"thumbnail/"+t)},this.deleteThumbnail=function(t){return e.request.del(e.getApiTeamUrl()+"projects/"+t+"/thumbnail")},this.getComments=function(t){return e.request.get(e.getApiTeamUrl()+"projects/"+t+"/comments")},this.getHyperlinks=function(t){return e.request.get(e.getApiTeamUrl()+"projects/"+t+"/hyperlinks")},this.getIssues=function(t,r){return e.request.get(e.getApiTeamUrl()+"projects/"+t+"/issues"+(r?"?scene=false":""))},this.getIssuesShortInfo=function(t){var r=function(){var e=Yn((new Date).toString().split("GMT"),2),t=e[0],r=e[1];if(!t||!r)return"";var n=new Date(t+"UTC").toISOString().split(".")[0],s=(r=r.split(" ")[0]).slice(0,3)+":"+r.slice(3);return n&&s?n+s:""}();return e.request.get(e.getApiTeamUrl()+"projects/"+t+"/issues?shortinfo=true"+(r?"¤ttime="+r:""))},this.postSlideshow=function(t,r){return e.request.post(e.getApiTeamUrl()+"projects/"+t+"/slideshows",r)},this.getSlideshows=function(t){return e.request.get(e.getApiTeamUrl()+"projects/"+t+"/slideshows")},this.deleteSlideshows=function(t){return e.request.del(e.getApiTeamUrl()+"projects/"+t+"/slideshows")},this.exportSlideshowToPDF=function(t,r){var n={slideShowId:r};return e.request.post(e.getApiTeamUrl()+"projects/"+t+"/slideshow/export/pdf",JSON.stringify(n))},this.getProjectInfo=function(t,r){var n={queryParams:r||{}};return e.request.get(e.getApiTeamUrl()+"projects/"+t,n)},this.postOverlaySet=function(t,r){return e.request.post(e.getApiTeamUrl()+"projects/"+t+"/overlaysets",r)},this.getOverlaySets=function(t){return e.request.get(e.getApiTeamUrl()+"projects/"+t+"/overlaysets")},this.deleteOverlaySets=function(t){return e.request.del(e.getApiTeamUrl()+"projects/"+t+"/overlaysets")}},ts=function(e){this.postRevision=function(t,r){return e.request.post(e.getApiTeamUrl()+"divisions/"+t+"/revisions",r)},this.getRevisionList=function(t){return e.request.get(e.getApiTeamUrl()+"divisions/"+t+"/revisions")},this.getRevisionInfo=function(t){return e.request.get(e.getApiTeamUrl()+"revisions/"+t)},this.postRevisionInfo=function(t,r){return e.request.post(e.getApiTeamUrl()+"revisions/"+t,r)},this.putRevisionInfo=function(t,r){return e.request.put(e.getApiTeamUrl()+"revisions/"+t,r)},this.getRevisionsComparisonResult=function(t,r,n,s){return e.request.get(e.getApiTeamUrl()+"divisions/"+t+"/revisionscomparison/"+r+"/"+n,s)},this.compareRevisions=function(t,r,n,s){return e.request.post(e.getApiTeamUrl()+"divisions/"+t+"/revisionscomparison/"+r+"/"+n,null,s)},this.excelExportRevisionsComparisonResult=function(t,r,n,s){return e.request.post(e.getApiTeamUrl()+"divisions/"+t+"/revisionscomparison/"+r+"/"+n+"/export/excel",s)}},rs=function(e){this.getRoles=function(t){return t?e.request.get(e.getApiTeamUrl()+"projects/"+t+"/members"):e.request.get(e.getApiTeamUrl()+"roles")},this.postUserRole=function(t,r){return e.request.post(e.getApiTeamUrl()+"projects/"+t+"/members",r)},this.putUserRole=function(t,r){return e.request.put(e.getApiTeamUrl()+"projects/"+t+"/members",r)},this.deleteUser=function(t){return e.request.del(e.getApiTeamUrl()+"projects/"+t+"/members")}},ns=function(e){this.get=function(t,r){if(t||r){var n={queryParams:{}};return void 0!==t&&(n.queryParams.rights=t),void 0!==r&&(n.queryParams.customrole=r),e.request.get(e.getApiTeamUrl()+"roles/",n)}return e.request.get(e.getApiTeamUrl()+"roles/")},this.getAllRights=function(t){if(t){var r={queryParams:{globalfreeattributes:t.globalfreeattributes,global:t.global,project:t.project,document:t.document,layer:t.layer}};return e.request.get(e.getApiTeamUrl()+"rights",r)}return e.request.get(e.getApiTeamUrl()+"rights")},this.post=function(t){return e.request.post(e.getApiTeamUrl()+"roles/",t)},this.getRoleDetails=function(t){return e.request.get(e.getApiTeamUrl()+"roles/"+t)},this.updateRole=function(t,r){return e.request.put(e.getApiTeamUrl()+"roles/"+t,r)},this.deleteRole=function(t){return e.request.del(e.getApiTeamUrl()+"roles/"+t)}},ss=function(e){this.calculateCutSection=function(t){var r,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],s={cuttingCalculation:{projectId:t.projectId,cuttingPlanes:t.cuttingPlanes,selection:{modelLayer:t.modelLayer,topologyNodes:t.topologyNodes,hiddenObjects:t.hiddenObjects},settings:t.settings},runAsync:n};if("glb"===(null===(r=s.cuttingCalculation)||void 0===r||null===(r=r.settings)||void 0===r?void 0:r.responseGeometry)){return e.request.post(e.getApiTeamUrl()+"services/CuttingCalculation",JSON.stringify(s),{useXMLHttpRequest:!0,dataType:"binary",processData:!1,responseType:"arraybuffer"})}return e.request.post(e.getApiTeamUrl()+"services/CuttingCalculation",JSON.stringify(s))}},is=function(e){this.post=function(t){return e.request.post(e.getApiTeamUrl()+"share",t)}},os=function(e){this.get=function(t){return e.request.get(e.getApiTeamUrl()+"slides/"+t)},this.put=function(t,r){return e.request.put(e.getApiTeamUrl()+"slides/"+t,r)},this.delete=function(t){return e.request.del(e.getApiTeamUrl()+"slides/"+t)},this.postThumbnail=function(t,r){return e.request.post(e.getApiTeamUrl()+"slides/"+t+"/thumbnail",r)}},as=function(e){this.get=function(t){return e.request.get(e.getApiTeamUrl()+"slideshows/"+t)},this.put=function(t,r){return e.request.put(e.getApiTeamUrl()+"slideshows/"+t,r)},this.delete=function(t){return e.request.del(e.getApiTeamUrl()+"slideshows/"+t)},this.postSlide=function(t,r){return e.request.post(e.getApiTeamUrl()+"slideshows/"+t+"/slides",r)},this.getSlides=function(t){return e.request.get(e.getApiTeamUrl()+"slideshows/"+t+"/slides")},this.postThumbnail=function(t,r){return e.request.post(e.getApiTeamUrl()+"slideshows/"+t+"/thumbnail",r)},this.getThumbnail=function(t){return e.request.get(e.getApiTeamUrl()+"thumbnail/"+t)}},us=function(e){this.postStructure=function(t,r){return e.request.post(e.getApiTeamUrl()+"projects/"+t+"/structures",r)},this.postStructureTopology=function(t,r){return e.request.post(e.getApiTeamUrl()+"structures/"+t+"/topology",r)},this.postSubNode=function(t,r){return e.request.post(e.getApiTeamUrl()+"structures/"+t,r)},this.postAssignedObject=function(t,r,n,s){return e.request.post(e.getApiTeamUrl()+"structures/"+t+"/assign/"+r+"?varianttype="+n,s)},this.attributeAssign=function(t,r,n,s){var i={attributeId:n};return s&&(i.variantType=s),e.request.put(e.getApiTeamUrl()+"projects/"+t+"/structures/"+r+"/attributeassign",JSON.stringify(i))},this.deleteAssignedObject=function(t,r,n,s){var i=[s?"removeAllNodes=true":"",n?"varianttype=true":""].filter((function(e){return e})).join("&");return e.request.del(e.getApiTeamUrl()+"structures/"+t+"/delete/"+r+"?"+i)},this.getStructure=function(t,r,n){return r?e.request.get(e.getApiTeamUrl()+"structures/"+r):e.request.get(e.getApiTeamUrl()+"projects/"+t+"/structures"+(n?"?type="+n:""))},this.getTopology=function(t,r,n){return void 0===n||""==n?e.request.get(e.getApiTeamUrl()+"structures/"+t+"/topology?varianttype="+r):!0===n?e.request.get(e.getApiTeamUrl()+"structures/"+t+"/topology?varianttype="+r+"&attributes=true"):void 0},this.getTopologyStructure=function(t){return e.request.get(e.getApiTeamUrl()+"projects/"+t+"/topologystructure")},this.resetTopologyStructure=function(t){return e.request.put(e.getApiTeamUrl()+"projects/"+t+"/topologystructure/reset")},this.copyStructure=function(t,r,n){return e.request.post(e.getApiTeamUrl()+"structures/"+t+"/copy?elementRelation="+n+"&attributes=true",r)},this.putStructure=function(t,r,n){var s=n?"?applyToChild=true":"";return e.request.put(e.getApiTeamUrl()+"structures/"+t+s,r)},this.reorderStructure=function(t,r){return e.request.put(e.getApiTeamUrl()+"structures/"+t+"/reorder?varianttype="+r)},this.deleteStructure=function(t,r,n){return n?e.request.del(e.getApiTeamUrl()+"structures/"+t+"?forceDelete=true"):r?e.request.del(e.getApiTeamUrl()+"structures/"+t+"?deleteAll=true"):e.request.del(e.getApiTeamUrl()+"structures/"+t)},this.removeAllAssignedObjects=function(t){return e.request.del(e.getApiTeamUrl()+"structures/"+t+"/delete")},this.deleteAllProjectStructures=function(t){return e.request.del(e.getApiTeamUrl()+"projects/"+t+"/structures")},this.postVariantType=function(t,r){return e.request.post(e.getApiTeamUrl()+"projects/"+t+"/variants",r)},this.getVariantType=function(t,r){return r?e.request.get(e.getApiTeamUrl()+"projects/"+t+"/variants/"+r):e.request.get(e.getApiTeamUrl()+"projects/"+t+"/variants")},this.deleteVariantType=function(t,r){return e.request.del(e.getApiTeamUrl()+"projects/"+t+"/variants/"+r)},this.copyElementsToVariant=function(t,r,n){return e.request.put(e.getApiTeamUrl()+"projects/"+t+"/variants/"+r+"/copyfrom",n)}},cs=function(e){this.get=function(){return e.request.get(e.getApiUrl()+"team-actions-rights/")}},ls=function(e){this.get=function(t,r){var n={queryParams:{}};return r&&(n.queryParams.filterEmpty=r),t?e.request.get(e.getApiUrl()+"teams/"+t,n):e.request.get(e.getApiUrl()+"teams",n)},this.postTeam=function(t){return e.request.post(e.getApiUrl()+"teams",t)},this.putTeam=function(t){return e.request.put(e.getApiUrl()+"team",t)},this.deleteTeam=function(t){return e.request.del(e.getApiUrl()+"teams/"+t)},this.getAccountSettings=function(t){return e.request.get(e.getApiUrl()+"administration/teams/"+t+"/accountsettings")},this.getRestrictions=function(t){return e.request.get(e.getApiUrl()+"teams/"+t+"/restrictions")},this.deleteServerCache=function(){return e.request.del(e.getApiTeamUrl()+"deleteCache")}},hs=function(e){this.get=function(t,r){var n={language:t};return r&&(n.type=r),e.request.get(e.getApiUrl()+"terms/download",{queryParams:n,dataType:"html"})}},ps=function(e){this.get=function(t,r){var n={language:t};return r&&(n.type=r),e.request.get(e.getApiUrl()+"dataprotectiondeclarations/download",{queryParams:n,dataType:"html"})},this.getForbiddenEmails=function(){return e.request.get(e.getApiUrl()+"restrictedemails")}},fs=function(e){this.get=function(t,r){var n={language:t};return r&&(n.type=r),e.request.get(e.getApiUrl()+"imprints/download",{queryParams:n,dataType:"html"})}},ds=function(e){this.post=function(t){return e.request.post(e.getApiUrl()+"content/units/",t)},this.get=function(t){return t?e.request.get(e.getApiUrl()+"content/units/"+t):e.request.get(e.getApiUrl()+"content/units/")},this.put=function(t,r){return e.request.put(e.getApiUrl()+"content/units/"+t,r)},this.delete=function(t){return e.request.del(e.getApiUrl()+"content/units/"+t)}},gs=function(e){this.get=function(t){return t?e.request.get(e.getApiUrl()+"user",{token:t}):e.request.get(e.getApiUrl()+"user")},this.put=function(t,r){var n=e.getApiUrl()+"user";return r?e.request.put(n,t,{token:r}):e.request.put(n,t)},this.setPassword=function(t,r,n){var s=e.getApiUrl()+"user/set_password";return t&&(s+=t),n?e.request.put(s,r,{token:n}):e.request.put(s,r)},this.post=function(t){return e.request.post(e.getApiUrl()+"user",t)},this.postPhoto=function(t){return e.request.post(e.getApiUrl()+"user/photo",t,{contentType:!1,processData:!1})},this.deletePhoto=function(){return e.request.del(e.getApiUrl()+"user/photo")},this.getPhoto=function(){return e.request.get(e.getApiUrl()+"user/photo")},this.putPassword=function(t){return e.request.put(e.getApiUrl()+"user/change_password",t)},this.getSubscriptions=function(t){return t?e.request.get(e.getApiUrl()+"user/accountsettings/"+t):e.request.get(e.getApiUrl()+"user/accountsettings")}},ms=function(e){this.post=function(t){return e.request.post(e.getApiUrl()+"users",t)},this.exist=function(t){return e.request.get(e.getApiUrl()+"users/exist",{queryParams:{email:t}})},this.put=function(t,r){return e.request.put(e.getApiUrl()+"users/"+t,r)},this.delete=function(t){return e.request.del(e.getApiUrl()+"users/"+t)},this.setSubscriptions=function(t,r){return e.request.post(e.getApiUrl()+"administration/users/"+t+"/accountsettings",r)}},ys=function(e){this.postSettings=function(t,r){return e.request.post(e.getApiTeamUrl()+"userSettings/"+t,r)},this.getSettings=function(t){return e.request.get(e.getApiTeamUrl()+"userSettings/"+t)}},vs=function(e){this.get=function(t){return e.request.get(e.getApiTeamUrl()+"invitations/"+(t||""))},this.getProjectInvitations=function(t){return e.request.get("".concat(e.getApiTeamUrl(),"invitations?projectId=").concat(t))},this.post=function(t){return e.request.post(e.getApiTeamUrl()+"invitations/",t)},this.delete=function(t){return e.request.del(e.getApiTeamUrl()+"invitations/"+t)},this.put=function(t,r){return e.request.put(e.getApiTeamUrl()+"invitations/"+t,r)},this.accept=function(t,r){return e.request.put(e.getApiUrl()+"invitations/"+t+"/accept",r)},this.getInvitation=function(t,r){return e.request.get(e.getApiUrl()+"invitations/"+t,r)}},bs=function(e){this.post=function(t,r){return e.request.post(e.getApiTeamUrl()+"projects/"+t+"/selections",r)},this.get=function(t){return e.request.get(e.getApiTeamUrl()+"selections/"+t)},this.getAllSelections=function(t){return e.request.get(e.getApiTeamUrl()+"projects/"+t+"/selections")},this.delete=function(t){return e.request.del(e.getApiTeamUrl()+"selections/"+t)}},ws=function(e){this.postGroup=function(t,r){return e.request.post(e.getApiTeamUrl()+"projects/"+t+"/usergroups",r)},this.getGroups=function(t){return e.request.get(e.getApiTeamUrl()+"projects/"+t+"/usergroups")},this.getUsers=function(t){return e.request.get(e.getApiTeamUrl()+"usergroups/"+t)},this.deleteGroup=function(t){return e.request.del(e.getApiTeamUrl()+"usergroups/"+t)},this.putGroup=function(t,r){return e.request.put(e.getApiTeamUrl()+"usergroups/"+t,r)},this.assignUser=function(t,r){return e.request.put(e.getApiTeamUrl()+"usergroups/"+t+"/assign",r)},this.removeUser=function(t,r){return e.request.put(e.getApiTeamUrl()+"usergroups/"+t+"/remove",r)}},Ts=function(e){this.get=function(t){return e.request.get(e.getApiTeamUrl()+"scenes/"+t)},this.getObjectScenes=function(t,r){var n={};r&&(n.queryParams={shortInfo:r});var s=e.getApiTeamUrl()+"objects/"+t+"/scenes";return e.request.get(s,n)},this.post=function(t,r){return e.request.post(e.getApiTeamUrl()+"objects/"+t+"/scenes",r)},this.delete=function(t){return e.request.del(e.getApiTeamUrl()+"scenes/"+t)},this.put=function(t,r){return e.request.put(e.getApiTeamUrl()+"scenes/"+t,r)},this.postThumbnailAttachment=function(t,r,n,s){return e.request.post(e.getApiTeamUrl()+"objects/"+t+"/attachments",r,{contentType:!1,processData:!1,dataType:null,xhrUploadProgress:n,queryParams:s?{attachmenttype:"thumbnailhighresolution"}:void 0})},this.postThumbnail=function(t,r,n){return e.request.post(e.getApiTeamUrl()+"objects/"+t+"/attachments",r,{queryParams:n?{attachmenttype:"thumbnailhighresolution"}:void 0})},this.getThumbnail=function(t){return e.request.get(e.getApiTeamUrl()+"objects/"+t+"/attachments")}},As=function(e){this.post=function(t){return e.request.post(e.getApiTeamUrl()+"services/BaseQuantities",JSON.stringify(t))}},qs=function(e){this.createWorkflowTemplateFolder=function(t,r){return e.request.post(e.getApiTeamUrl()+"structures/"+t,r)},this.putWorkflowTemplateFolder=function(t,r){return e.request.put(e.getApiTeamUrl()+"structures/"+t,r)},this.postWorkflowTemplate=function(t,r){return e.request.post(e.getApiTeamUrl()+"projects/"+t+"/workflowtemplates",r)},this.putWorkflowTemplate=function(t,r){return e.request.put(e.getApiTeamUrl()+"workflowtemplates/"+t,r)},this.getWorkflowTemplate=function(t){return e.request.get(e.getApiTeamUrl()+"workflowtemplates/"+t)},this.getWorkflowTemplateRoot=function(t){return e.request.get(e.getApiTeamUrl()+"projects/"+t+"/structures?type=IsoWorkflowStructure")},this.getWorkflowTemplateStructure=function(t){return e.request.get(e.getApiTeamUrl()+"structures/"+t+"/topology")},this.getAllWorkflowTemplates=function(t){return e.request.get(e.getApiTeamUrl()+"projects/"+t+"/workflowtemplates")},this.deleteWorkflowTemplate=function(t){return e.request.del(e.getApiTeamUrl()+"workflowtemplates/"+t)},this.getWorkflowTemplateInfo=function(t){return e.request.get(e.getApiTeamUrl()+"workflowtemplates/"+t)},this.initializeWorkflowTemplate=function(t,r){return e.request.post(e.getApiTeamUrl()+"projects/"+t+"/workflows",r)},this.getAllWorkflows=function(t,r){var n={queryParams:{}};return n.queryParams.status=r,e.request.get(e.getApiTeamUrl()+"projects/"+t+"/workflows",n)},this.getWorkflow=function(t){return e.request.get(e.getApiTeamUrl()+"workflows/"+t)},this.deleteWorkflow=function(t){return e.request.del(e.getApiTeamUrl()+"workflows/"+t)},this.putWorkflow=function(t){return e.request.put(e.getApiTeamUrl()+"workflows/"+t.id,t)},this.submitReview=function(t){return e.request.put(e.getApiTeamUrl()+"workflows/"+t.id+"/?submit=true",t)},this.getStep=function(t){return e.request.put(e.getApiTeamUrl()+"workflows/"+t)},this.submitStep=function(t,r){return e.request.put(e.getApiTeamUrl()+"steps/"+t+"/?submit=true",r)},this.saveStep=function(t,r){return e.request.put(e.getApiTeamUrl()+"steps/"+t+"/?submit=false",r)},this.cancelWorkflow=function(t){return e.request.put(e.getApiTeamUrl()+"workflows/"+t+"/cancel")}};function _s(e){return _s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_s(e)}function Us(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,(s=n.key,i=void 0,i=function(e,t){if("object"!==_s(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==_s(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(s,"string"),"symbol"===_s(i)?i:String(i)),n)}var s,i}var ks=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._config=null,t?(void 0===t.version&&(t.version="v2"),this._config=t):this._config=js(),this._token=null,this._tokenType=null,this._teamSlug=null,this._cache=null,window.BIMPLUS_SDK_ENABLE_DEBUG_LOGS&&console.log("BimWebSdk: config = ",this._config),this._config.cache?(this.request=new _n,this._cache=this.request.getCache(),!1===this._cache.isSupported()&&(console.warn("Warning: Caching requested but not supported by browser! Falling back to uncached requests."),this.request=new c,this._cache=null)):this.request=new c,this.authorize=new d(this),this.user=new gs(this),this.users=new ms(this),this.teams=new ls(this),this.members=new Mn(this),this.projects=new es(this),this.structures=new us(this),this.models=new Gn(this),this.objects=new $n(this),this.overlays=new Vn(this),this.overlaySets=new Jn(this),this.revisions=new ts(this),this.elementTypes=new Pn(this),this.annotations=new h(this),this.attachments=new p(this),this.issues=new Kn(this),this.labels=new Ln(this),this.pins=new zn(this),this.comments=new jn(this),this.hyperlinks=new Rn(this),this.importService=new Bn(this),this.slideshows=new as(this),this.slides=new os(this),this.clashDetection=new Un(this),this.clientLogs=new kn(this),this.rightsService=new rs(this),this.applicationSettings=new l(this),this.exportService=new En(this),this.folders=new On(this),this.locks=new Nn(this),this.share=new is(this),this.messages=new Fn(this),this.objectFilters=new Hn(this),this.terms=new hs(this),this.dataProtection=new ps(this),this.dimensions=new Sn(this),this.imprints=new fs(this),this.projectActionsRights=new Xn(this),this.roles=new ns(this),this.attributeTemplates=new f(this),this.units=new ds(this),this.freeAttributes=new Cn(this),this.freeAttributeGroups=new Dn(this),this.hiddenCalculation=new In(this),this.sectionCut=new ss(this),this.projectAttributeTemplates=new Qn(this),this.teamActionsRights=new cs(this),this.customTables=new xn(this),this.userSettings=new ys(this),this.invitations=new vs(this),this.selections=new bs(this),this.userGroups=new ws(this),this.scenes=new Ts(this),this.baseQuantities=new As(this),this.workflows=new qs(this)}var t,r,n;return t=e,(r=[{key:"setAccessToken",value:function(e){this._token=e,this.request.setAccessToken(e),window.BIMPLUS_SDK_ENABLE_DEBUG_LOGS&&console.log("BimWebSdk: token was set to "+this._token)}},{key:"getAccessToken",value:function(){return this._token}},{key:"setTokenType",value:function(e){this._tokenType=e,this.request.setTokenType(e),window.BIMPLUS_SDK_ENABLE_DEBUG_LOGS&&console.log("BimWebSdk: token type was set to "+this._tokenType)}},{key:"getTokenType",value:function(){return this._tokenType}},{key:"setAccessTokenAndType",value:function(e,t){this.setAccessToken(e),this.setTokenType(t)}},{key:"getAccessTokenAndType",value:function(){return{token:this._token,tokenType:this._tokenType}}},{key:"setTeamSlug",value:function(e){this._teamSlug=e,window.BIMPLUS_SDK_ENABLE_DEBUG_LOGS&&console.log("BimWebSdk: team slug was set to "+this._teamSlug)}},{key:"getTeamSlug",value:function(){return this._teamSlug}},{key:"getApiUrl",value:function(){return this._config.protocol+this._config.host+"/"+(this._config.version?this._config.version+"/":"")}},{key:"getApiTeamUrl",value:function(){return this._teamSlug||console.error("Error: Teamslug not set"),this.getApiUrl()+this._teamSlug+"/"}},{key:"getCache",value:function(){return this._cache}}])&&Us(t.prototype,r),n&&Us(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}(),js=function(e){var t="api.bimplus.net";if(e)switch(e){case"dev":t="api-dev.bimplus.net";break;case"stage":t="api-stage.bimplus.net"}return{protocol:"https://",host:t,cache:!1,version:"v2"}};return t})()));
|
|
2
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.add=t():e.add=t()}(self,(()=>(()=>{"use strict";var e={d:(t,r)=>{for(var n in r)e.o(r,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:r[n]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function n(){n=function(){return t};var e,t={},s=Object.prototype,i=s.hasOwnProperty,o=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},u=a.iterator||"@@iterator",c=a.asyncIterator||"@@asyncIterator",l=a.toStringTag||"@@toStringTag";function h(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{h({},"")}catch(e){h=function(e,t,r){return e[t]=r}}function p(e,t,r,n){var s=t&&t.prototype instanceof b?t:b,i=Object.create(s.prototype),a=new O(n||[]);return o(i,"_invoke",{value:x(e,r,a)}),i}function f(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=p;var d="suspendedStart",g="suspendedYield",m="executing",y="completed",v={};function b(){}function w(){}function T(){}var A={};h(A,u,(function(){return this}));var q=Object.getPrototypeOf,_=q&&q(q(D([])));_&&_!==s&&i.call(_,u)&&(A=_);var U=T.prototype=b.prototype=Object.create(A);function k(e){["next","throw","return"].forEach((function(t){h(e,t,(function(e){return this._invoke(t,e)}))}))}function j(e,t){function n(s,o,a,u){var c=f(e[s],e,o);if("throw"!==c.type){var l=c.arg,h=l.value;return h&&"object"==r(h)&&i.call(h,"__await")?t.resolve(h.__await).then((function(e){n("next",e,a,u)}),(function(e){n("throw",e,a,u)})):t.resolve(h).then((function(e){l.value=e,a(l)}),(function(e){return n("throw",e,a,u)}))}u(c.arg)}var s;o(this,"_invoke",{value:function(e,r){function i(){return new t((function(t,s){n(e,r,t,s)}))}return s=s?s.then(i,i):i()}})}function x(t,r,n){var s=d;return function(i,o){if(s===m)throw new Error("Generator is already running");if(s===y){if("throw"===i)throw o;return{value:e,done:!0}}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var u=S(a,n);if(u){if(u===v)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(s===d)throw s=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);s=m;var c=f(t,r,n);if("normal"===c.type){if(s=n.done?y:g,c.arg===v)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(s=y,n.method="throw",n.arg=c.arg)}}}function S(t,r){var n=r.method,s=t.iterator[n];if(s===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,S(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var i=f(s,t.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,v;var o=i.arg;return o?o.done?(r[t.resultName]=o.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,v):o:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function P(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function E(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function O(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(P,this),this.reset(!0)}function D(t){if(t||""===t){var n=t[u];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var s=-1,o=function r(){for(;++s<t.length;)if(i.call(t,s))return r.value=t[s],r.done=!1,r;return r.value=e,r.done=!0,r};return o.next=o}}throw new TypeError(r(t)+" is not iterable")}return w.prototype=T,o(U,"constructor",{value:T,configurable:!0}),o(T,"constructor",{value:w,configurable:!0}),w.displayName=h(T,l,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===w||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,T):(e.__proto__=T,h(e,l,"GeneratorFunction")),e.prototype=Object.create(U),e},t.awrap=function(e){return{__await:e}},k(j.prototype),h(j.prototype,c,(function(){return this})),t.AsyncIterator=j,t.async=function(e,r,n,s,i){void 0===i&&(i=Promise);var o=new j(p(e,r,n,s),i);return t.isGeneratorFunction(r)?o:o.next().then((function(e){return e.done?e.value:o.next()}))},k(U),h(U,l,"Generator"),h(U,u,(function(){return this})),h(U,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=D,O.prototype={constructor:O,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(E),!t)for(var r in this)"t"===r.charAt(0)&&i.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function n(n,s){return a.type="throw",a.arg=t,r.next=n,s&&(r.method="next",r.arg=e),!!s}for(var s=this.tryEntries.length-1;s>=0;--s){var o=this.tryEntries[s],a=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var u=i.call(o,"catchLoc"),c=i.call(o,"finallyLoc");if(u&&c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(u){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&i.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var s=n;break}}s&&("break"===e||"continue"===e)&&s.tryLoc<=t&&t<=s.finallyLoc&&(s=null);var o=s?s.completion:{};return o.type=e,o.arg=t,s?(this.method="next",this.next=s.finallyLoc,v):this.complete(o)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),v},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),E(r),v}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var s=n.arg;E(r)}return s}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:D(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),v}},t}function s(e,t,r,n,s,i,o){try{var a=e[i](o),u=a.value}catch(e){return void r(e)}a.done?t(u):Promise.resolve(u).then(n,s)}function i(e,t,r,n){return $.ajax({url:e,type:t,data:r,contentType:n&&void 0!==n.contentType?n.contentType:"application/json; charset=utf-8",dataType:n&&void 0!==n.dataType?n.dataType:"json",processData:!(!n||void 0===n.processData)&&n.processData,cache:!(!window||!window.BIMPLUS_SDK_ENABLE_CACHE),async:!0,xhr:function(){var e=$.ajaxSettings.xhr();return n&&void 0!==n.xhrUploadProgress&&e.upload.addEventListener("progress",n.xhrUploadProgress,!1),e},beforeSend:function(t){if(window&&void 0!==window.BIMPLUS_SDK_PENDING_REQUESTS&&window.BIMPLUS_SDK_PENDING_REQUESTS++,n&&n.token){var r=n.tokenType?n.tokenType:"BimPlus";t.setRequestHeader("Authorization",r+" "+n.token)}n&&n.eTag&&(t.setRequestHeader("Cache-Control","no-cache"),window&&!window.BIMPLUS_SDK_DISABLE_ETAG&&t.setRequestHeader("If-None-Match",n.eTag)),!t._url&&e&&(t._url=e)},complete:function(t){if(window&&void 0!==window.BIMPLUS_SDK_PENDING_REQUESTS&&window.BIMPLUS_SDK_PENDING_REQUESTS--,window&&window.BIMPLUS_SDK_LOG_API_CALLS){var r={url:e,response:t&&t.responseText&&t.responseText.length>0?JSON.parse(t.responseText):null};console.log(JSON.stringify(r))}}})}function o(e,t,r,n){var s=$.Deferred();console.debug("xmlHttpRequest config=",n);var i=new XMLHttpRequest;return i.open(t,e,!0),i.setRequestHeader("Authorization","BimPlus "+n.token),window&&void 0!==window.BIMPLUS_SDK_PENDING_REQUESTS&&window.BIMPLUS_SDK_PENDING_REQUESTS++,n&&n.responseType&&(console.debug("responseType is set to",n.responseType),i.responseType=n.responseType),n&&n.eTag&&(console.debug("setRequestHeader is set to eTag",n.eTag),i.setRequestHeader("Cache-Control","no-cache"),window&&!window.BIMPLUS_SDK_DISABLE_ETAG&&i.setRequestHeader("If-None-Match",n.eTag)),i.onload=function(){window&&void 0!==window.BIMPLUS_SDK_PENDING_REQUESTS&&window.BIMPLUS_SDK_PENDING_REQUESTS--,s.resolve(i.response,i.status,i)},i.onerror=function(){window&&void 0!==window.BIMPLUS_SDK_PENDING_REQUESTS&&window.BIMPLUS_SDK_PENDING_REQUESTS--,s.reject()},r&&i.setRequestHeader("Content-Type","application/json;charset=UTF-8"),i.send(r),s.promise()}function a(e){var t="?";for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t+=r+"="+e[r]+"&");return t=t.slice(0,-1)}function u(e,t,r,i,o){o||(o={}),o.token||(o.token=t),o.queryParams||(o.queryParams={}),o.queryParams.chunkSize||(o.queryParams.chunkSize=r),o.queryParams.chunk=1;var a=$.Deferred(),u=[];return e.get(i,o).done(function(){var t=function(e){return function(){var t=this,r=arguments;return new Promise((function(n,i){var o=e.apply(t,r);function a(e){s(o,n,i,a,u,"next",e)}function u(e){s(o,n,i,a,u,"throw",e)}a(void 0)}))}}(n().mark((function t(r,s,c){var l,h,p,f;return n().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:u.push(r),l=0,200===c.status?(h=c.getResponseHeader("X-Total-Count"))?l=parseInt(h,10):console.warn("Request for "+i+" doesn't support chunked responses!"):304===c.status&&(c["Cached-X-Total-Count"]?l=c["Cached-X-Total-Count"]:console.warn("Cached request for "+i+" doesn't contain chunk info!")),p=n().mark((function t(){var r;return n().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:o.queryParams.chunk=f,r=$.Deferred(),e.get(i,o).done((function(e){r.resolve(e)})).fail((function(e,t){r.reject(e,t)})),u.push(r);case 4:case"end":return t.stop()}}),t)})),f=2;case 5:if(!(f<=l)){t.next=10;break}return t.delegateYield(p(),"t0",7);case 7:f++,t.next=5;break;case 10:a.resolve(u);case 11:case"end":return t.stop()}}),t)})));return function(e,r,n){return t.apply(this,arguments)}}()).fail((function(e,t){a.reject(e,t)})),a.promise()}e.r(t),e.d(t,{Api:()=>ks,IDBCache:()=>qn,createDefaultConfig:()=>js});var c=function(){var e=null,t=null;this.setAccessToken=function(t){e=t},this.setTokenType=function(e){t=e},this.get=function(r,n){var s;return n||(n={}),n.token||(n.token=e),n.tokenType&&n.tokenType===t||(n.tokenType=t),n.queryParams&&(r+=a(n.queryParams)),null!==(s=n)&&void 0!==s&&s.useXMLHttpRequest?o(r,"GET",null,n):i(r,"GET",null,n)},this.getChunked=function(t,r){return u(this,e,"medium",t,r)},this.put=function(r,n,s){return s||(s={}),s.token||(s.token=e),s.tokenType&&s.tokenType===t||(s.tokenType=t),s.queryParams&&(r+=a(s.queryParams)),i(r,"PUT",n,s)},this.post=function(r,n,s){var u;return s||(s={}),s.token||(s.token=e),s.tokenType&&s.tokenType===t||(s.tokenType=t),s.queryParams&&(r+=a(s.queryParams)),null!==(u=s)&&void 0!==u&&u.useXMLHttpRequest?o(r,"POST",n,s):i(r,"POST",n,s)},this.del=function(r,n,s){return s||(s={}),n||(s.contentType=null),s.dataType=null,s.token||(s.token=e),s.tokenType&&s.tokenType===t||(s.tokenType=t),s.queryParams&&(r+=a(s.queryParams)),i(r,"DELETE",n||null,s)}},l=function(e){this.postSettings=function(t){return e.request.post(e.getApiUrl()+"application/settings",t)},this.getSettings=function(t){return t?e.request.get(e.getApiUrl()+"application/settings/"+t):e.request.get(e.getApiUrl()+"application/settings")},this.putSettings=function(t,r){return e.request.put(e.getApiUrl()+"application/settings/"+t,r)},this.deleteSettings=function(t){return e.request.del(e.getApiUrl()+"application/settings/"+t)}},h=function(e){this.get=function(t){return console.debug("Annotation get API ",e.getApiTeamUrl()+"annotations/"+t),e.request.get(e.getApiTeamUrl()+"annotations/"+t)},this.delete=function(t){return e.request.del(e.getApiTeamUrl()+"annotations/"+t)},this.put=function(t,r){return e.request.put(e.getApiTeamUrl()+"annotations/"+t,r)}},p=function(e){this.get=function(t){return e.request.get(e.getApiTeamUrl()+"attachments/"+t)},this.download=function(t,r){return r?e.request.get(e.getApiTeamUrl()+"attachments/"+t+"/versions/"+r+"/download"):e.request.get(e.getApiTeamUrl()+"attachments/"+t+"/download")},this.put=function(t,r){return e.request.put(e.getApiTeamUrl()+"attachments/"+t,r)},this.post=function(t,r,n){return e.request.put(e.getApiTeamUrl()+"attachments/"+t,r,{contentType:!1,processData:!1,dataType:null,xhrUploadProgress:n})},this.delete=function(t,r){return r?e.request.del(e.getApiTeamUrl()+"attachments/"+t+"/versions/"+r):e.request.del(e.getApiTeamUrl()+"attachments/"+t)},this.deleteSelected=function(t){return e.request.del(e.getApiTeamUrl()+"objects/"+t+"/attachments")},this.postVersion=function(t,r,n){return e.request.post(e.getApiTeamUrl()+"attachments/"+t+"/versions",r,{contentType:!1,processData:!1,dataType:null,xhrUploadProgress:n})},this.getAllVersions=function(t){return e.request.get(e.getApiTeamUrl()+"attachments/"+t+"/versions")},this.releaseVersion=function(t,r){return e.request.put(e.getApiTeamUrl()+"attachments/"+t+"/release",r)}},f=function(e){this.post=function(t){return e.request.post(e.getApiTeamUrl()+"attributetemplates",t)},this.get=function(t){return t?e.request.get(e.getApiTeamUrl()+"attributetemplates/"+t):e.request.get(e.getApiTeamUrl()+"attributetemplates")},this.put=function(t,r){return e.request.put(e.getApiTeamUrl()+"attributetemplates/"+t,r)},this.delete=function(t){return e.request.del(e.getApiTeamUrl()+"attributetemplates/"+t)}},d=function(e){this.post=function(t,r,n){return e.request.post(e.getApiUrl()+"authorize",JSON.stringify({user_id:t,password:r,application_id:n}))},this.forgotPassword=function(t){return e.request.post(e.getApiUrl()+"auth-forgot",t,{dataType:null})},this.checkAccessToken=function(){return e.request.get(e.getApiUrl()+"authorize")},this.requestCrossToken=function(){return e.request.post(e.getApiUrl()+"cross-token")},this.requestExternalAppToken=function(){return e.request.get(e.getApiUrl()+"validate")},this.getOpenIdConfiguration=function(){return e.request.get(e.getApiUrl()+".well-known/openid-configuration")}};const g="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,m=Object.keys,y=Array.isArray;function v(e,t){return"object"!=typeof t||m(t).forEach((function(r){e[r]=t[r]})),e}"undefined"==typeof Promise||g.Promise||(g.Promise=Promise);const b=Object.getPrototypeOf,w={}.hasOwnProperty;function T(e,t){return w.call(e,t)}function A(e,t){"function"==typeof t&&(t=t(b(e))),("undefined"==typeof Reflect?m:Reflect.ownKeys)(t).forEach((r=>{_(e,r,t[r])}))}const q=Object.defineProperty;function _(e,t,r,n){q(e,t,v(r&&T(r,"get")&&"function"==typeof r.get?{get:r.get,set:r.set,configurable:!0}:{value:r,configurable:!0,writable:!0},n))}function U(e){return{from:function(t){return e.prototype=Object.create(t.prototype),_(e.prototype,"constructor",e),{extend:A.bind(null,e.prototype)}}}}const k=Object.getOwnPropertyDescriptor;function j(e,t){let r;return k(e,t)||(r=b(e))&&j(r,t)}const x=[].slice;function S(e,t,r){return x.call(e,t,r)}function P(e,t){return t(e)}function E(e){if(!e)throw new Error("Assertion Failed")}function O(e){g.setImmediate?setImmediate(e):setTimeout(e,0)}function D(e,t){return e.reduce(((e,r,n)=>{var s=t(r,n);return s&&(e[s[0]]=s[1]),e}),{})}function C(e,t){if(T(e,t))return e[t];if(!t)return e;if("string"!=typeof t){for(var r=[],n=0,s=t.length;n<s;++n){var i=C(e,t[n]);r.push(i)}return r}var o=t.indexOf(".");if(-1!==o){var a=e[t.substr(0,o)];return void 0===a?void 0:C(a,t.substr(o+1))}}function I(e,t,r){if(e&&void 0!==t&&(!("isFrozen"in Object)||!Object.isFrozen(e)))if("string"!=typeof t&&"length"in t){E("string"!=typeof r&&"length"in r);for(var n=0,s=t.length;n<s;++n)I(e,t[n],r[n])}else{var i=t.indexOf(".");if(-1!==i){var o=t.substr(0,i),a=t.substr(i+1);if(""===a)void 0===r?y(e)&&!isNaN(parseInt(o))?e.splice(o,1):delete e[o]:e[o]=r;else{var u=e[o];u&&T(e,o)||(u=e[o]={}),I(u,a,r)}}else void 0===r?y(e)&&!isNaN(parseInt(t))?e.splice(t,1):delete e[t]:e[t]=r}}function R(e){var t={};for(var r in e)T(e,r)&&(t[r]=e[r]);return t}const B=[].concat;function K(e){return B.apply([],e)}const L="Boolean,String,Date,RegExp,Blob,File,FileList,FileSystemFileHandle,ArrayBuffer,DataView,Uint8ClampedArray,ImageBitmap,ImageData,Map,Set,CryptoKey".split(",").concat(K([8,16,32,64].map((e=>["Int","Uint","Float"].map((t=>t+e+"Array")))))).filter((e=>g[e])),N=L.map((e=>g[e]));D(L,(e=>[e,!0]));let M=null;function F(e){M="undefined"!=typeof WeakMap&&new WeakMap;const t=G(e);return M=null,t}function G(e){if(!e||"object"!=typeof e)return e;let t=M&&M.get(e);if(t)return t;if(y(e)){t=[],M&&M.set(e,t);for(var r=0,n=e.length;r<n;++r)t.push(G(e[r]))}else if(N.indexOf(e.constructor)>=0)t=e;else{const r=b(e);for(var s in t=r===Object.prototype?{}:Object.create(r),M&&M.set(e,t),e)T(e,s)&&(t[s]=G(e[s]))}return t}const{toString:W}={};function H(e){return W.call(e).slice(8,-1)}const V="undefined"!=typeof Symbol?Symbol.iterator:"@@iterator",J="symbol"==typeof V?function(e){var t;return null!=e&&(t=e[V])&&t.apply(e)}:function(){return null},z={};function X(e){var t,r,n,s;if(1===arguments.length){if(y(e))return e.slice();if(this===z&&"string"==typeof e)return[e];if(s=J(e)){for(r=[];!(n=s.next()).done;)r.push(n.value);return r}if(null==e)return[e];if("number"==typeof(t=e.length)){for(r=new Array(t);t--;)r[t]=e[t];return r}return[e]}for(t=arguments.length,r=new Array(t);t--;)r[t]=arguments[t];return r}const Q="undefined"!=typeof Symbol?e=>"AsyncFunction"===e[Symbol.toStringTag]:()=>!1;var Y="undefined"!=typeof location&&/^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);function Z(e,t){Y=e,ee=t}var ee=()=>!0;const te=!new Error("").stack;function re(){if(te)try{throw re.arguments,new Error}catch(e){return e}return new Error}function ne(e,t){var r=e.stack;return r?(t=t||0,0===r.indexOf(e.name)&&(t+=(e.name+e.message).split("\n").length),r.split("\n").slice(t).filter(ee).map((e=>"\n"+e)).join("")):""}var se=["Unknown","Constraint","Data","TransactionInactive","ReadOnly","Version","NotFound","InvalidState","InvalidAccess","Abort","Timeout","QuotaExceeded","Syntax","DataClone"],ie=["Modify","Bulk","OpenFailed","VersionChange","Schema","Upgrade","InvalidTable","MissingAPI","NoSuchDatabase","InvalidArgument","SubTransaction","Unsupported","Internal","DatabaseClosed","PrematureCommit","ForeignAwait"].concat(se),oe={VersionChanged:"Database version changed by other database connection",DatabaseClosed:"Database has been closed",Abort:"Transaction aborted",TransactionInactive:"Transaction has already completed or failed",MissingAPI:"IndexedDB API missing. Please visit https://tinyurl.com/y2uuvskb"};function ae(e,t){this._e=re(),this.name=e,this.message=t}function ue(e,t){return e+". Errors: "+Object.keys(t).map((e=>t[e].toString())).filter(((e,t,r)=>r.indexOf(e)===t)).join("\n")}function ce(e,t,r,n){this._e=re(),this.failures=t,this.failedKeys=n,this.successCount=r,this.message=ue(e,t)}function le(e,t){this._e=re(),this.name="BulkError",this.failures=Object.keys(t).map((e=>t[e])),this.failuresByPos=t,this.message=ue(e,t)}U(ae).from(Error).extend({stack:{get:function(){return this._stack||(this._stack=this.name+": "+this.message+ne(this._e,2))}},toString:function(){return this.name+": "+this.message}}),U(ce).from(ae),U(le).from(ae);var he=ie.reduce(((e,t)=>(e[t]=t+"Error",e)),{});const pe=ae;var fe=ie.reduce(((e,t)=>{var r=t+"Error";function n(e,n){this._e=re(),this.name=r,e?"string"==typeof e?(this.message=`${e}${n?"\n "+n:""}`,this.inner=n||null):"object"==typeof e&&(this.message=`${e.name} ${e.message}`,this.inner=e):(this.message=oe[t]||r,this.inner=null)}return U(n).from(pe),e[t]=n,e}),{});fe.Syntax=SyntaxError,fe.Type=TypeError,fe.Range=RangeError;var de=se.reduce(((e,t)=>(e[t+"Error"]=fe[t],e)),{}),ge=ie.reduce(((e,t)=>(-1===["Syntax","Type","Range"].indexOf(t)&&(e[t+"Error"]=fe[t]),e)),{});function me(){}function ye(e){return e}function ve(e,t){return null==e||e===ye?t:function(r){return t(e(r))}}function be(e,t){return function(){e.apply(this,arguments),t.apply(this,arguments)}}function we(e,t){return e===me?t:function(){var r=e.apply(this,arguments);void 0!==r&&(arguments[0]=r);var n=this.onsuccess,s=this.onerror;this.onsuccess=null,this.onerror=null;var i=t.apply(this,arguments);return n&&(this.onsuccess=this.onsuccess?be(n,this.onsuccess):n),s&&(this.onerror=this.onerror?be(s,this.onerror):s),void 0!==i?i:r}}function Te(e,t){return e===me?t:function(){e.apply(this,arguments);var r=this.onsuccess,n=this.onerror;this.onsuccess=this.onerror=null,t.apply(this,arguments),r&&(this.onsuccess=this.onsuccess?be(r,this.onsuccess):r),n&&(this.onerror=this.onerror?be(n,this.onerror):n)}}function Ae(e,t){return e===me?t:function(r){var n=e.apply(this,arguments);v(r,n);var s=this.onsuccess,i=this.onerror;this.onsuccess=null,this.onerror=null;var o=t.apply(this,arguments);return s&&(this.onsuccess=this.onsuccess?be(s,this.onsuccess):s),i&&(this.onerror=this.onerror?be(i,this.onerror):i),void 0===n?void 0===o?void 0:o:v(n,o)}}function qe(e,t){return e===me?t:function(){return!1!==t.apply(this,arguments)&&e.apply(this,arguments)}}function _e(e,t){return e===me?t:function(){var r=e.apply(this,arguments);if(r&&"function"==typeof r.then){for(var n=this,s=arguments.length,i=new Array(s);s--;)i[s]=arguments[s];return r.then((function(){return t.apply(n,i)}))}return t.apply(this,arguments)}}ge.ModifyError=ce,ge.DexieError=ae,ge.BulkError=le;var Ue={};const ke=100,[je,xe,Se]="undefined"==typeof Promise?[]:(()=>{let e=Promise.resolve();if("undefined"==typeof crypto||!crypto.subtle)return[e,b(e),e];const t=crypto.subtle.digest("SHA-512",new Uint8Array([0]));return[t,b(t),e]})(),Pe=xe&&xe.then,Ee=je&&je.constructor,Oe=!!Se;var De=!1,Ce=Se?()=>{Se.then(nt)}:g.setImmediate?setImmediate.bind(null,nt):g.MutationObserver?()=>{var e=document.createElement("div");new MutationObserver((()=>{nt(),e=null})).observe(e,{attributes:!0}),e.setAttribute("i","1")}:()=>{setTimeout(nt,0)},Ie=function(e,t){We.push([e,t]),Be&&(Ce(),Be=!1)},Re=!0,Be=!0,Ke=[],Le=[],Ne=null,Me=ye,Fe={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:xt,pgp:!1,env:{},finalize:function(){this.unhandleds.forEach((e=>{try{xt(e[0],e[1])}catch(e){}}))}},Ge=Fe,We=[],He=0,$e=[];function Ve(e){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");this._listeners=[],this.onuncatched=me,this._lib=!1;var t=this._PSD=Ge;if(Y&&(this._stackHolder=re(),this._prev=null,this._numPrev=0),"function"!=typeof e){if(e!==Ue)throw new TypeError("Not a function");return this._state=arguments[1],this._value=arguments[2],void(!1===this._state&&Qe(this,this._value))}this._state=null,this._value=null,++t.ref,Xe(this,e)}const Je={get:function(){var e=Ge,t=ft;function r(r,n){var s=!e.global&&(e!==Ge||t!==ft);const i=s&&!yt();var o=new Ve(((t,o)=>{Ze(this,new ze(Ut(r,e,s,i),Ut(n,e,s,i),t,o,e))}));return Y&&rt(o,this),o}return r.prototype=Ue,r},set:function(e){_(this,"then",e&&e.prototype===Ue?Je:{get:function(){return e},set:Je.set})}};function ze(e,t,r,n,s){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.resolve=r,this.reject=n,this.psd=s}function Xe(e,t){try{t((t=>{if(null===e._state){if(t===e)throw new TypeError("A promise cannot be resolved with itself.");var r=e._lib&&st();t&&"function"==typeof t.then?Xe(e,((e,r)=>{t instanceof Ve?t._then(e,r):t.then(e,r)})):(e._state=!0,e._value=t,Ye(e)),r&&it()}}),Qe.bind(null,e))}catch(t){Qe(e,t)}}function Qe(e,t){if(Le.push(t),null===e._state){var r=e._lib&&st();t=Me(t),e._state=!1,e._value=t,Y&&null!==t&&"object"==typeof t&&!t._promise&&function(e,t,r){try{e.apply(null,void 0)}catch(e){}}((()=>{var r=j(t,"stack");t._promise=e,_(t,"stack",{get:()=>De?r&&(r.get?r.get.apply(t):r.value):e.stack})})),function(e){Ke.some((t=>t._value===e._value))||Ke.push(e)}(e),Ye(e),r&&it()}}function Ye(e){var t=e._listeners;e._listeners=[];for(var r=0,n=t.length;r<n;++r)Ze(e,t[r]);var s=e._PSD;--s.ref||s.finalize(),0===He&&(++He,Ie((()=>{0==--He&&ot()}),[]))}function Ze(e,t){if(null!==e._state){var r=e._state?t.onFulfilled:t.onRejected;if(null===r)return(e._state?t.resolve:t.reject)(e._value);++t.psd.ref,++He,Ie(et,[r,e,t])}else e._listeners.push(t)}function et(e,t,r){try{Ne=t;var n,s=t._value;t._state?n=e(s):(Le.length&&(Le=[]),n=e(s),-1===Le.indexOf(s)&&function(e){for(var t=Ke.length;t;)if(Ke[--t]._value===e._value)return void Ke.splice(t,1)}(t)),r.resolve(n)}catch(e){r.reject(e)}finally{Ne=null,0==--He&&ot(),--r.psd.ref||r.psd.finalize()}}function tt(e,t,r){if(t.length===r)return t;var n="";if(!1===e._state){var s,i,o=e._value;null!=o?(s=o.name||"Error",i=o.message||o,n=ne(o,0)):(s=o,i=""),t.push(s+(i?": "+i:"")+n)}return Y&&((n=ne(e._stackHolder,2))&&-1===t.indexOf(n)&&t.push(n),e._prev&&tt(e._prev,t,r)),t}function rt(e,t){var r=t?t._numPrev+1:0;r<100&&(e._prev=t,e._numPrev=r)}function nt(){st()&&it()}function st(){var e=Re;return Re=!1,Be=!1,e}function it(){var e,t,r;do{for(;We.length>0;)for(e=We,We=[],r=e.length,t=0;t<r;++t){var n=e[t];n[0].apply(null,n[1])}}while(We.length>0);Re=!0,Be=!0}function ot(){var e=Ke;Ke=[],e.forEach((e=>{e._PSD.onunhandled.call(null,e._value,e)}));for(var t=$e.slice(0),r=t.length;r;)t[--r]()}function at(e){return new Ve(Ue,!1,e)}function ut(e,t){var r=Ge;return function(){var n=st(),s=Ge;try{return Tt(r,!0),e.apply(this,arguments)}catch(e){t&&t(e)}finally{Tt(s,!1),n&&it()}}}A(Ve.prototype,{then:Je,_then:function(e,t){Ze(this,new ze(null,null,e,t,Ge))},catch:function(e){if(1===arguments.length)return this.then(null,e);var t=arguments[0],r=arguments[1];return"function"==typeof t?this.then(null,(e=>e instanceof t?r(e):at(e))):this.then(null,(e=>e&&e.name===t?r(e):at(e)))},finally:function(e){return this.then((t=>(e(),t)),(t=>(e(),at(t))))},stack:{get:function(){if(this._stack)return this._stack;try{De=!0;var e=tt(this,[],20).join("\nFrom previous: ");return null!==this._state&&(this._stack=e),e}finally{De=!1}}},timeout:function(e,t){return e<1/0?new Ve(((r,n)=>{var s=setTimeout((()=>n(new fe.Timeout(t))),e);this.then(r,n).finally(clearTimeout.bind(null,s))})):this}}),"undefined"!=typeof Symbol&&Symbol.toStringTag&&_(Ve.prototype,Symbol.toStringTag,"Dexie.Promise"),Fe.env=At(),A(Ve,{all:function(){var e=X.apply(null,arguments).map(vt);return new Ve((function(t,r){0===e.length&&t([]);var n=e.length;e.forEach(((s,i)=>Ve.resolve(s).then((r=>{e[i]=r,--n||t(e)}),r)))}))},resolve:e=>{if(e instanceof Ve)return e;if(e&&"function"==typeof e.then)return new Ve(((t,r)=>{e.then(t,r)}));var t=new Ve(Ue,!0,e);return rt(t,Ne),t},reject:at,race:function(){var e=X.apply(null,arguments).map(vt);return new Ve(((t,r)=>{e.map((e=>Ve.resolve(e).then(t,r)))}))},PSD:{get:()=>Ge,set:e=>Ge=e},totalEchoes:{get:()=>ft},newPSD:gt,usePSD:qt,scheduler:{get:()=>Ie,set:e=>{Ie=e}},rejectionMapper:{get:()=>Me,set:e=>{Me=e}},follow:(e,t)=>new Ve(((r,n)=>gt(((t,r)=>{var n=Ge;n.unhandleds=[],n.onunhandled=r,n.finalize=be((function(){!function(e){$e.push((function t(){e(),$e.splice($e.indexOf(t),1)})),++He,Ie((()=>{0==--He&&ot()}),[])}((()=>{0===this.unhandleds.length?t():r(this.unhandleds[0])}))}),n.finalize),e()}),t,r,n)))}),Ee&&(Ee.allSettled&&_(Ve,"allSettled",(function(){const e=X.apply(null,arguments).map(vt);return new Ve((t=>{0===e.length&&t([]);let r=e.length;const n=new Array(r);e.forEach(((e,s)=>Ve.resolve(e).then((e=>n[s]={status:"fulfilled",value:e}),(e=>n[s]={status:"rejected",reason:e})).then((()=>--r||t(n)))))}))})),Ee.any&&"undefined"!=typeof AggregateError&&_(Ve,"any",(function(){const e=X.apply(null,arguments).map(vt);return new Ve(((t,r)=>{0===e.length&&r(new AggregateError([]));let n=e.length;const s=new Array(n);e.forEach(((e,i)=>Ve.resolve(e).then((e=>t(e)),(e=>{s[i]=e,--n||r(new AggregateError(s))}))))}))})));const ct={awaits:0,echoes:0,id:0};var lt=0,ht=[],pt=0,ft=0,dt=0;function gt(e,t,r,n){var s=Ge,i=Object.create(s);i.parent=s,i.ref=0,i.global=!1,i.id=++dt;var o=Fe.env;i.env=Oe?{Promise:Ve,PromiseProp:{value:Ve,configurable:!0,writable:!0},all:Ve.all,race:Ve.race,allSettled:Ve.allSettled,any:Ve.any,resolve:Ve.resolve,reject:Ve.reject,nthen:kt(o.nthen,i),gthen:kt(o.gthen,i)}:{},t&&v(i,t),++s.ref,i.finalize=function(){--this.parent.ref||this.parent.finalize()};var a=qt(i,e,r,n);return 0===i.ref&&i.finalize(),a}function mt(){return ct.id||(ct.id=++lt),++ct.awaits,ct.echoes+=ke,ct.id}function yt(){return!!ct.awaits&&(0==--ct.awaits&&(ct.id=0),ct.echoes=ct.awaits*ke,!0)}function vt(e){return ct.echoes&&e&&e.constructor===Ee?(mt(),e.then((e=>(yt(),e)),(e=>(yt(),St(e))))):e}function bt(e){++ft,ct.echoes&&0!=--ct.echoes||(ct.echoes=ct.id=0),ht.push(Ge),Tt(e,!0)}function wt(){var e=ht[ht.length-1];ht.pop(),Tt(e,!1)}function Tt(e,t){var r=Ge;if((t?!ct.echoes||pt++&&e===Ge:!pt||--pt&&e===Ge)||_t(t?bt.bind(null,e):wt),e!==Ge&&(Ge=e,r===Fe&&(Fe.env=At()),Oe)){var n=Fe.env.Promise,s=e.env;xe.then=s.nthen,n.prototype.then=s.gthen,(r.global||e.global)&&(Object.defineProperty(g,"Promise",s.PromiseProp),n.all=s.all,n.race=s.race,n.resolve=s.resolve,n.reject=s.reject,s.allSettled&&(n.allSettled=s.allSettled),s.any&&(n.any=s.any))}}function At(){var e=g.Promise;return Oe?{Promise:e,PromiseProp:Object.getOwnPropertyDescriptor(g,"Promise"),all:e.all,race:e.race,allSettled:e.allSettled,any:e.any,resolve:e.resolve,reject:e.reject,nthen:xe.then,gthen:e.prototype.then}:{}}function qt(e,t,r,n,s){var i=Ge;try{return Tt(e,!0),t(r,n,s)}finally{Tt(i,!1)}}function _t(e){Pe.call(je,e)}function Ut(e,t,r,n){return"function"!=typeof e?e:function(){var s=Ge;r&&mt(),Tt(t,!0);try{return e.apply(this,arguments)}finally{Tt(s,!1),n&&_t(yt)}}}function kt(e,t){return function(r,n){return e.call(this,Ut(r,t),Ut(n,t))}}-1===(""+Pe).indexOf("[native code]")&&(mt=yt=me);const jt="unhandledrejection";function xt(e,t){var r;try{r=t.onuncatched(e)}catch(e){}if(!1!==r)try{var n,s={promise:t,reason:e};if(g.document&&document.createEvent?((n=document.createEvent("Event")).initEvent(jt,!0,!0),v(n,s)):g.CustomEvent&&v(n=new CustomEvent(jt,{detail:s}),s),n&&g.dispatchEvent&&(dispatchEvent(n),!g.PromiseRejectionEvent&&g.onunhandledrejection))try{g.onunhandledrejection(n)}catch(e){}Y&&n&&!n.defaultPrevented&&console.warn(`Unhandled rejection: ${e.stack||e}`)}catch(e){}}var St=Ve.reject;function Pt(e,t,r,n){if(e.idbdb&&(e._state.openComplete||Ge.letThrough||e._vip)){var s=e._createTransaction(t,r,e._dbSchema);try{s.create(),e._state.PR1398_maxLoop=3}catch(s){return s.name===he.InvalidState&&e.isOpen()&&--e._state.PR1398_maxLoop>0?(console.warn("Dexie: Need to reopen db"),e._close(),e.open().then((()=>Pt(e,t,r,n)))):St(s)}return s._promise(t,((e,t)=>gt((()=>(Ge.trans=s,n(e,t,s)))))).then((e=>s._completion.then((()=>e))))}if(e._state.openComplete)return St(new fe.DatabaseClosed(e._state.dbOpenError));if(!e._state.isBeingOpened){if(!e._options.autoOpen)return St(new fe.DatabaseClosed);e.open().catch(me)}return e._state.dbReadyPromise.then((()=>Pt(e,t,r,n)))}const Et="3.2.4",Ot=String.fromCharCode(65535),Dt=-1/0,Ct="Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.",It="String expected.",Rt=[],Bt="undefined"!=typeof navigator&&/(MSIE|Trident|Edge)/.test(navigator.userAgent),Kt=Bt,Lt=Bt,Nt=e=>!/(dexie\.js|dexie\.min\.js)/.test(e),Mt="__dbnames",Ft="readonly",Gt="readwrite";function Wt(e,t){return e?t?function(){return e.apply(this,arguments)&&t.apply(this,arguments)}:e:t}const Ht={type:3,lower:-1/0,lowerOpen:!1,upper:[[]],upperOpen:!1};function $t(e){return"string"!=typeof e||/\./.test(e)?e=>e:t=>(void 0===t[e]&&e in t&&delete(t=F(t))[e],t)}class Vt{_trans(e,t,r){const n=this._tx||Ge.trans,s=this.name;function i(e,r,n){if(!n.schema[s])throw new fe.NotFound("Table "+s+" not part of transaction");return t(n.idbtrans,n)}const o=st();try{return n&&n.db===this.db?n===Ge.trans?n._promise(e,i,r):gt((()=>n._promise(e,i,r)),{trans:n,transless:Ge.transless||Ge}):Pt(this.db,e,[this.name],i)}finally{o&&it()}}get(e,t){return e&&e.constructor===Object?this.where(e).first(t):this._trans("readonly",(t=>this.core.get({trans:t,key:e}).then((e=>this.hook.reading.fire(e))))).then(t)}where(e){if("string"==typeof e)return new this.db.WhereClause(this,e);if(y(e))return new this.db.WhereClause(this,`[${e.join("+")}]`);const t=m(e);if(1===t.length)return this.where(t[0]).equals(e[t[0]]);const r=this.schema.indexes.concat(this.schema.primKey).filter((e=>e.compound&&t.every((t=>e.keyPath.indexOf(t)>=0))&&e.keyPath.every((e=>t.indexOf(e)>=0))))[0];if(r&&this.db._maxKey!==Ot)return this.where(r.name).equals(r.keyPath.map((t=>e[t])));!r&&Y&&console.warn(`The query ${JSON.stringify(e)} on ${this.name} would benefit of a compound index [${t.join("+")}]`);const{idxByName:n}=this.schema,s=this.db._deps.indexedDB;function i(e,t){try{return 0===s.cmp(e,t)}catch(e){return!1}}const[o,a]=t.reduce((([t,r],s)=>{const o=n[s],a=e[s];return[t||o,t||!o?Wt(r,o&&o.multi?e=>{const t=C(e,s);return y(t)&&t.some((e=>i(a,e)))}:e=>i(a,C(e,s))):r]}),[null,null]);return o?this.where(o.name).equals(e[o.keyPath]).filter(a):r?this.filter(a):this.where(t).equals("")}filter(e){return this.toCollection().and(e)}count(e){return this.toCollection().count(e)}offset(e){return this.toCollection().offset(e)}limit(e){return this.toCollection().limit(e)}each(e){return this.toCollection().each(e)}toArray(e){return this.toCollection().toArray(e)}toCollection(){return new this.db.Collection(new this.db.WhereClause(this))}orderBy(e){return new this.db.Collection(new this.db.WhereClause(this,y(e)?`[${e.join("+")}]`:e))}reverse(){return this.toCollection().reverse()}mapToClass(e){this.schema.mappedClass=e;const t=t=>{if(!t)return t;const r=Object.create(e.prototype);for(var n in t)if(T(t,n))try{r[n]=t[n]}catch(e){}return r};return this.schema.readHook&&this.hook.reading.unsubscribe(this.schema.readHook),this.schema.readHook=t,this.hook("reading",t),e}defineClass(){return this.mapToClass((function(e){v(this,e)}))}add(e,t){const{auto:r,keyPath:n}=this.schema.primKey;let s=e;return n&&r&&(s=$t(n)(e)),this._trans("readwrite",(e=>this.core.mutate({trans:e,type:"add",keys:null!=t?[t]:null,values:[s]}))).then((e=>e.numFailures?Ve.reject(e.failures[0]):e.lastResult)).then((t=>{if(n)try{I(e,n,t)}catch(e){}return t}))}update(e,t){if("object"!=typeof e||y(e))return this.where(":id").equals(e).modify(t);{const r=C(e,this.schema.primKey.keyPath);if(void 0===r)return St(new fe.InvalidArgument("Given object does not contain its primary key"));try{"function"!=typeof t?m(t).forEach((r=>{I(e,r,t[r])})):t(e,{value:e,primKey:r})}catch(e){}return this.where(":id").equals(r).modify(t)}}put(e,t){const{auto:r,keyPath:n}=this.schema.primKey;let s=e;return n&&r&&(s=$t(n)(e)),this._trans("readwrite",(e=>this.core.mutate({trans:e,type:"put",values:[s],keys:null!=t?[t]:null}))).then((e=>e.numFailures?Ve.reject(e.failures[0]):e.lastResult)).then((t=>{if(n)try{I(e,n,t)}catch(e){}return t}))}delete(e){return this._trans("readwrite",(t=>this.core.mutate({trans:t,type:"delete",keys:[e]}))).then((e=>e.numFailures?Ve.reject(e.failures[0]):void 0))}clear(){return this._trans("readwrite",(e=>this.core.mutate({trans:e,type:"deleteRange",range:Ht}))).then((e=>e.numFailures?Ve.reject(e.failures[0]):void 0))}bulkGet(e){return this._trans("readonly",(t=>this.core.getMany({keys:e,trans:t}).then((e=>e.map((e=>this.hook.reading.fire(e)))))))}bulkAdd(e,t,r){const n=Array.isArray(t)?t:void 0,s=(r=r||(n?void 0:t))?r.allKeys:void 0;return this._trans("readwrite",(t=>{const{auto:r,keyPath:i}=this.schema.primKey;if(i&&n)throw new fe.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");if(n&&n.length!==e.length)throw new fe.InvalidArgument("Arguments objects and keys must have the same length");const o=e.length;let a=i&&r?e.map($t(i)):e;return this.core.mutate({trans:t,type:"add",keys:n,values:a,wantResults:s}).then((({numFailures:e,results:t,lastResult:r,failures:n})=>{if(0===e)return s?t:r;throw new le(`${this.name}.bulkAdd(): ${e} of ${o} operations failed`,n)}))}))}bulkPut(e,t,r){const n=Array.isArray(t)?t:void 0,s=(r=r||(n?void 0:t))?r.allKeys:void 0;return this._trans("readwrite",(t=>{const{auto:r,keyPath:i}=this.schema.primKey;if(i&&n)throw new fe.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");if(n&&n.length!==e.length)throw new fe.InvalidArgument("Arguments objects and keys must have the same length");const o=e.length;let a=i&&r?e.map($t(i)):e;return this.core.mutate({trans:t,type:"put",keys:n,values:a,wantResults:s}).then((({numFailures:e,results:t,lastResult:r,failures:n})=>{if(0===e)return s?t:r;throw new le(`${this.name}.bulkPut(): ${e} of ${o} operations failed`,n)}))}))}bulkDelete(e){const t=e.length;return this._trans("readwrite",(t=>this.core.mutate({trans:t,type:"delete",keys:e}))).then((({numFailures:e,lastResult:r,failures:n})=>{if(0===e)return r;throw new le(`${this.name}.bulkDelete(): ${e} of ${t} operations failed`,n)}))}}function Jt(e){var t={},r=function(r,n){if(n){for(var s=arguments.length,i=new Array(s-1);--s;)i[s-1]=arguments[s];return t[r].subscribe.apply(null,i),e}if("string"==typeof r)return t[r]};r.addEventType=i;for(var n=1,s=arguments.length;n<s;++n)i(arguments[n]);return r;function i(e,n,s){if("object"!=typeof e){var o;n||(n=qe),s||(s=me);var a={subscribers:[],fire:s,subscribe:function(e){-1===a.subscribers.indexOf(e)&&(a.subscribers.push(e),a.fire=n(a.fire,e))},unsubscribe:function(e){a.subscribers=a.subscribers.filter((function(t){return t!==e})),a.fire=a.subscribers.reduce(n,s)}};return t[e]=r[e]=a,a}m(o=e).forEach((function(e){var t=o[e];if(y(t))i(e,o[e][0],o[e][1]);else{if("asap"!==t)throw new fe.InvalidArgument("Invalid event config");var r=i(e,ye,(function(){for(var e=arguments.length,t=new Array(e);e--;)t[e]=arguments[e];r.subscribers.forEach((function(e){O((function(){e.apply(null,t)}))}))}))}}))}}function zt(e,t){return U(t).from({prototype:e}),t}function Xt(e,t){return!(e.filter||e.algorithm||e.or)&&(t?e.justLimit:!e.replayFilter)}function Qt(e,t){e.filter=Wt(e.filter,t)}function Yt(e,t,r){var n=e.replayFilter;e.replayFilter=n?()=>Wt(n(),t()):t,e.justLimit=r&&!n}function Zt(e,t){if(e.isPrimKey)return t.primaryKey;const r=t.getIndexByKeyPath(e.index);if(!r)throw new fe.Schema("KeyPath "+e.index+" on object store "+t.name+" is not indexed");return r}function er(e,t,r){const n=Zt(e,t.schema);return t.openCursor({trans:r,values:!e.keysOnly,reverse:"prev"===e.dir,unique:!!e.unique,query:{index:n,range:e.range}})}function tr(e,t,r,n){const s=e.replayFilter?Wt(e.filter,e.replayFilter()):e.filter;if(e.or){const i={},o=(e,r,n)=>{if(!s||s(r,n,(e=>r.stop(e)),(e=>r.fail(e)))){var o=r.primaryKey,a=""+o;"[object ArrayBuffer]"===a&&(a=""+new Uint8Array(o)),T(i,a)||(i[a]=!0,t(e,r,n))}};return Promise.all([e.or._iterate(o,r),rr(er(e,n,r),e.algorithm,o,!e.keysOnly&&e.valueMapper)])}return rr(er(e,n,r),Wt(e.algorithm,s),t,!e.keysOnly&&e.valueMapper)}function rr(e,t,r,n){var s=ut(n?(e,t,s)=>r(n(e),t,s):r);return e.then((e=>{if(e)return e.start((()=>{var r=()=>e.continue();t&&!t(e,(e=>r=e),(t=>{e.stop(t),r=me}),(t=>{e.fail(t),r=me}))||s(e.value,e,(e=>r=e)),r()}))}))}function nr(e,t){try{const r=sr(e),n=sr(t);if(r!==n)return"Array"===r?1:"Array"===n?-1:"binary"===r?1:"binary"===n?-1:"string"===r?1:"string"===n?-1:"Date"===r?1:"Date"!==n?NaN:-1;switch(r){case"number":case"Date":case"string":return e>t?1:e<t?-1:0;case"binary":return function(e,t){const r=e.length,n=t.length,s=r<n?r:n;for(let r=0;r<s;++r)if(e[r]!==t[r])return e[r]<t[r]?-1:1;return r===n?0:r<n?-1:1}(ir(e),ir(t));case"Array":return function(e,t){const r=e.length,n=t.length,s=r<n?r:n;for(let r=0;r<s;++r){const n=nr(e[r],t[r]);if(0!==n)return n}return r===n?0:r<n?-1:1}(e,t)}}catch(e){}return NaN}function sr(e){const t=typeof e;if("object"!==t)return t;if(ArrayBuffer.isView(e))return"binary";const r=H(e);return"ArrayBuffer"===r?"binary":r}function ir(e){return e instanceof Uint8Array?e:ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):new Uint8Array(e)}class or{_read(e,t){var r=this._ctx;return r.error?r.table._trans(null,St.bind(null,r.error)):r.table._trans("readonly",e).then(t)}_write(e){var t=this._ctx;return t.error?t.table._trans(null,St.bind(null,t.error)):t.table._trans("readwrite",e,"locked")}_addAlgorithm(e){var t=this._ctx;t.algorithm=Wt(t.algorithm,e)}_iterate(e,t){return tr(this._ctx,e,t,this._ctx.table.core)}clone(e){var t=Object.create(this.constructor.prototype),r=Object.create(this._ctx);return e&&v(r,e),t._ctx=r,t}raw(){return this._ctx.valueMapper=null,this}each(e){var t=this._ctx;return this._read((r=>tr(t,e,r,t.table.core)))}count(e){return this._read((e=>{const t=this._ctx,r=t.table.core;if(Xt(t,!0))return r.count({trans:e,query:{index:Zt(t,r.schema),range:t.range}}).then((e=>Math.min(e,t.limit)));var n=0;return tr(t,(()=>(++n,!1)),e,r).then((()=>n))})).then(e)}sortBy(e,t){const r=e.split(".").reverse(),n=r[0],s=r.length-1;function i(e,t){return t?i(e[r[t]],t-1):e[n]}var o="next"===this._ctx.dir?1:-1;function a(e,t){var r=i(e,s),n=i(t,s);return r<n?-o:r>n?o:0}return this.toArray((function(e){return e.sort(a)})).then(t)}toArray(e){return this._read((e=>{var t=this._ctx;if("next"===t.dir&&Xt(t,!0)&&t.limit>0){const{valueMapper:r}=t,n=Zt(t,t.table.core.schema);return t.table.core.query({trans:e,limit:t.limit,values:!0,query:{index:n,range:t.range}}).then((({result:e})=>r?e.map(r):e))}{const r=[];return tr(t,(e=>r.push(e)),e,t.table.core).then((()=>r))}}),e)}offset(e){var t=this._ctx;return e<=0||(t.offset+=e,Xt(t)?Yt(t,(()=>{var t=e;return(e,r)=>0===t||(1===t?(--t,!1):(r((()=>{e.advance(t),t=0})),!1))})):Yt(t,(()=>{var t=e;return()=>--t<0}))),this}limit(e){return this._ctx.limit=Math.min(this._ctx.limit,e),Yt(this._ctx,(()=>{var t=e;return function(e,r,n){return--t<=0&&r(n),t>=0}}),!0),this}until(e,t){return Qt(this._ctx,(function(r,n,s){return!e(r.value)||(n(s),t)})),this}first(e){return this.limit(1).toArray((function(e){return e[0]})).then(e)}last(e){return this.reverse().first(e)}filter(e){var t,r;return Qt(this._ctx,(function(t){return e(t.value)})),t=this._ctx,r=e,t.isMatch=Wt(t.isMatch,r),this}and(e){return this.filter(e)}or(e){return new this.db.WhereClause(this._ctx.table,e,this)}reverse(){return this._ctx.dir="prev"===this._ctx.dir?"next":"prev",this._ondirectionchange&&this._ondirectionchange(this._ctx.dir),this}desc(){return this.reverse()}eachKey(e){var t=this._ctx;return t.keysOnly=!t.isMatch,this.each((function(t,r){e(r.key,r)}))}eachUniqueKey(e){return this._ctx.unique="unique",this.eachKey(e)}eachPrimaryKey(e){var t=this._ctx;return t.keysOnly=!t.isMatch,this.each((function(t,r){e(r.primaryKey,r)}))}keys(e){var t=this._ctx;t.keysOnly=!t.isMatch;var r=[];return this.each((function(e,t){r.push(t.key)})).then((function(){return r})).then(e)}primaryKeys(e){var t=this._ctx;if("next"===t.dir&&Xt(t,!0)&&t.limit>0)return this._read((e=>{var r=Zt(t,t.table.core.schema);return t.table.core.query({trans:e,values:!1,limit:t.limit,query:{index:r,range:t.range}})})).then((({result:e})=>e)).then(e);t.keysOnly=!t.isMatch;var r=[];return this.each((function(e,t){r.push(t.primaryKey)})).then((function(){return r})).then(e)}uniqueKeys(e){return this._ctx.unique="unique",this.keys(e)}firstKey(e){return this.limit(1).keys((function(e){return e[0]})).then(e)}lastKey(e){return this.reverse().firstKey(e)}distinct(){var e=this._ctx,t=e.index&&e.table.schema.idxByName[e.index];if(!t||!t.multi)return this;var r={};return Qt(this._ctx,(function(e){var t=e.primaryKey.toString(),n=T(r,t);return r[t]=!0,!n})),this}modify(e){var t=this._ctx;return this._write((r=>{var n;if("function"==typeof e)n=e;else{var s=m(e),i=s.length;n=function(t){for(var r=!1,n=0;n<i;++n){var o=s[n],a=e[o];C(t,o)!==a&&(I(t,o,a),r=!0)}return r}}const o=t.table.core,{outbound:a,extractKey:u}=o.schema.primaryKey,c=this.db._options.modifyChunkSize||200,l=[];let h=0;const p=[],f=(e,t)=>{const{failures:r,numFailures:n}=t;h+=e-n;for(let e of m(r))l.push(r[e])};return this.clone().primaryKeys().then((s=>{const i=l=>{const h=Math.min(c,s.length-l);return o.getMany({trans:r,keys:s.slice(l,l+h),cache:"immutable"}).then((p=>{const d=[],g=[],m=a?[]:null,y=[];for(let e=0;e<h;++e){const t=p[e],r={value:F(t),primKey:s[l+e]};!1!==n.call(r,r.value,r)&&(null==r.value?y.push(s[l+e]):a||0===nr(u(t),u(r.value))?(g.push(r.value),a&&m.push(s[l+e])):(y.push(s[l+e]),d.push(r.value)))}const v=Xt(t)&&t.limit===1/0&&("function"!=typeof e||e===ar)&&{index:t.index,range:t.range};return Promise.resolve(d.length>0&&o.mutate({trans:r,type:"add",values:d}).then((e=>{for(let t in e.failures)y.splice(parseInt(t),1);f(d.length,e)}))).then((()=>(g.length>0||v&&"object"==typeof e)&&o.mutate({trans:r,type:"put",keys:m,values:g,criteria:v,changeSpec:"function"!=typeof e&&e}).then((e=>f(g.length,e))))).then((()=>(y.length>0||v&&e===ar)&&o.mutate({trans:r,type:"delete",keys:y,criteria:v}).then((e=>f(y.length,e))))).then((()=>s.length>l+h&&i(l+c)))}))};return i(0).then((()=>{if(l.length>0)throw new ce("Error modifying one or more objects",l,h,p);return s.length}))}))}))}delete(){var e=this._ctx,t=e.range;return Xt(e)&&(e.isPrimKey&&!Lt||3===t.type)?this._write((r=>{const{primaryKey:n}=e.table.core.schema,s=t;return e.table.core.count({trans:r,query:{index:n,range:s}}).then((t=>e.table.core.mutate({trans:r,type:"deleteRange",range:s}).then((({failures:e,lastResult:r,results:n,numFailures:s})=>{if(s)throw new ce("Could not delete some values",Object.keys(e).map((t=>e[t])),t-s);return t-s}))))})):this.modify(ar)}}const ar=(e,t)=>t.value=null;function ur(e,t){return e<t?-1:e===t?0:1}function cr(e,t){return e>t?-1:e===t?0:1}function lr(e,t,r){var n=e instanceof mr?new e.Collection(e):e;return n._ctx.error=r?new r(t):new TypeError(t),n}function hr(e){return new e.Collection(e,(()=>gr(""))).limit(0)}function pr(e,t,r,n,s,i){for(var o=Math.min(e.length,n.length),a=-1,u=0;u<o;++u){var c=t[u];if(c!==n[u])return s(e[u],r[u])<0?e.substr(0,u)+r[u]+r.substr(u+1):s(e[u],n[u])<0?e.substr(0,u)+n[u]+r.substr(u+1):a>=0?e.substr(0,a)+t[a]+r.substr(a+1):null;s(e[u],c)<0&&(a=u)}return o<n.length&&"next"===i?e+r.substr(e.length):o<e.length&&"prev"===i?e.substr(0,r.length):a<0?null:e.substr(0,a)+n[a]+r.substr(a+1)}function fr(e,t,r,n){var s,i,o,a,u,c,l,h=r.length;if(!r.every((e=>"string"==typeof e)))return lr(e,It);function p(e){s=function(e){return"next"===e?e=>e.toUpperCase():e=>e.toLowerCase()}(e),i=function(e){return"next"===e?e=>e.toLowerCase():e=>e.toUpperCase()}(e),o="next"===e?ur:cr;var t=r.map((function(e){return{lower:i(e),upper:s(e)}})).sort((function(e,t){return o(e.lower,t.lower)}));a=t.map((function(e){return e.upper})),u=t.map((function(e){return e.lower})),c=e,l="next"===e?"":n}p("next");var f=new e.Collection(e,(()=>dr(a[0],u[h-1]+n)));f._ondirectionchange=function(e){p(e)};var d=0;return f._addAlgorithm((function(e,r,n){var s=e.key;if("string"!=typeof s)return!1;var p=i(s);if(t(p,u,d))return!0;for(var f=null,g=d;g<h;++g){var m=pr(s,p,a[g],u[g],o,c);null===m&&null===f?d=g+1:(null===f||o(f,m)>0)&&(f=m)}return r(null!==f?function(){e.continue(f+l)}:n),!1})),f}function dr(e,t,r,n){return{type:2,lower:e,upper:t,lowerOpen:r,upperOpen:n}}function gr(e){return{type:1,lower:e,upper:e}}class mr{get Collection(){return this._ctx.table.db.Collection}between(e,t,r,n){r=!1!==r,n=!0===n;try{return this._cmp(e,t)>0||0===this._cmp(e,t)&&(r||n)&&(!r||!n)?hr(this):new this.Collection(this,(()=>dr(e,t,!r,!n)))}catch(e){return lr(this,Ct)}}equals(e){return null==e?lr(this,Ct):new this.Collection(this,(()=>gr(e)))}above(e){return null==e?lr(this,Ct):new this.Collection(this,(()=>dr(e,void 0,!0)))}aboveOrEqual(e){return null==e?lr(this,Ct):new this.Collection(this,(()=>dr(e,void 0,!1)))}below(e){return null==e?lr(this,Ct):new this.Collection(this,(()=>dr(void 0,e,!1,!0)))}belowOrEqual(e){return null==e?lr(this,Ct):new this.Collection(this,(()=>dr(void 0,e)))}startsWith(e){return"string"!=typeof e?lr(this,It):this.between(e,e+Ot,!0,!0)}startsWithIgnoreCase(e){return""===e?this.startsWith(e):fr(this,((e,t)=>0===e.indexOf(t[0])),[e],Ot)}equalsIgnoreCase(e){return fr(this,((e,t)=>e===t[0]),[e],"")}anyOfIgnoreCase(){var e=X.apply(z,arguments);return 0===e.length?hr(this):fr(this,((e,t)=>-1!==t.indexOf(e)),e,"")}startsWithAnyOfIgnoreCase(){var e=X.apply(z,arguments);return 0===e.length?hr(this):fr(this,((e,t)=>t.some((t=>0===e.indexOf(t)))),e,Ot)}anyOf(){const e=X.apply(z,arguments);let t=this._cmp;try{e.sort(t)}catch(e){return lr(this,Ct)}if(0===e.length)return hr(this);const r=new this.Collection(this,(()=>dr(e[0],e[e.length-1])));r._ondirectionchange=r=>{t="next"===r?this._ascending:this._descending,e.sort(t)};let n=0;return r._addAlgorithm(((r,s,i)=>{const o=r.key;for(;t(o,e[n])>0;)if(++n,n===e.length)return s(i),!1;return 0===t(o,e[n])||(s((()=>{r.continue(e[n])})),!1)})),r}notEqual(e){return this.inAnyRange([[Dt,e],[e,this.db._maxKey]],{includeLowers:!1,includeUppers:!1})}noneOf(){const e=X.apply(z,arguments);if(0===e.length)return new this.Collection(this);try{e.sort(this._ascending)}catch(e){return lr(this,Ct)}const t=e.reduce(((e,t)=>e?e.concat([[e[e.length-1][1],t]]):[[Dt,t]]),null);return t.push([e[e.length-1],this.db._maxKey]),this.inAnyRange(t,{includeLowers:!1,includeUppers:!1})}inAnyRange(e,t){const r=this._cmp,n=this._ascending,s=this._descending,i=this._min,o=this._max;if(0===e.length)return hr(this);if(!e.every((e=>void 0!==e[0]&&void 0!==e[1]&&n(e[0],e[1])<=0)))return lr(this,"First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower",fe.InvalidArgument);const a=!t||!1!==t.includeLowers,u=t&&!0===t.includeUppers;let c,l=n;function h(e,t){return l(e[0],t[0])}try{c=e.reduce((function(e,t){let n=0,s=e.length;for(;n<s;++n){const s=e[n];if(r(t[0],s[1])<0&&r(t[1],s[0])>0){s[0]=i(s[0],t[0]),s[1]=o(s[1],t[1]);break}}return n===s&&e.push(t),e}),[]),c.sort(h)}catch(e){return lr(this,Ct)}let p=0;const f=u?e=>n(e,c[p][1])>0:e=>n(e,c[p][1])>=0,d=a?e=>s(e,c[p][0])>0:e=>s(e,c[p][0])>=0;let g=f;const m=new this.Collection(this,(()=>dr(c[0][0],c[c.length-1][1],!a,!u)));return m._ondirectionchange=e=>{"next"===e?(g=f,l=n):(g=d,l=s),c.sort(h)},m._addAlgorithm(((e,t,r)=>{for(var s=e.key;g(s);)if(++p,p===c.length)return t(r),!1;return!!function(e){return!f(e)&&!d(e)}(s)||(0===this._cmp(s,c[p][1])||0===this._cmp(s,c[p][0])||t((()=>{l===n?e.continue(c[p][0]):e.continue(c[p][1])})),!1)})),m}startsWithAnyOf(){const e=X.apply(z,arguments);return e.every((e=>"string"==typeof e))?0===e.length?hr(this):this.inAnyRange(e.map((e=>[e,e+Ot]))):lr(this,"startsWithAnyOf() only works with strings")}}function yr(e){return ut((function(t){return vr(t),e(t.target.error),!1}))}function vr(e){e.stopPropagation&&e.stopPropagation(),e.preventDefault&&e.preventDefault()}const br="storagemutated",wr="x-storagemutated-1",Tr=Jt(null,br);class Ar{_lock(){return E(!Ge.global),++this._reculock,1!==this._reculock||Ge.global||(Ge.lockOwnerFor=this),this}_unlock(){if(E(!Ge.global),0==--this._reculock)for(Ge.global||(Ge.lockOwnerFor=null);this._blockedFuncs.length>0&&!this._locked();){var e=this._blockedFuncs.shift();try{qt(e[1],e[0])}catch(e){}}return this}_locked(){return this._reculock&&Ge.lockOwnerFor!==this}create(e){if(!this.mode)return this;const t=this.db.idbdb,r=this.db._state.dbOpenError;if(E(!this.idbtrans),!e&&!t)switch(r&&r.name){case"DatabaseClosedError":throw new fe.DatabaseClosed(r);case"MissingAPIError":throw new fe.MissingAPI(r.message,r);default:throw new fe.OpenFailed(r)}if(!this.active)throw new fe.TransactionInactive;return E(null===this._completion._state),(e=this.idbtrans=e||(this.db.core?this.db.core.transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability}):t.transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability}))).onerror=ut((t=>{vr(t),this._reject(e.error)})),e.onabort=ut((t=>{vr(t),this.active&&this._reject(new fe.Abort(e.error)),this.active=!1,this.on("abort").fire(t)})),e.oncomplete=ut((()=>{this.active=!1,this._resolve(),"mutatedParts"in e&&Tr.storagemutated.fire(e.mutatedParts)})),this}_promise(e,t,r){if("readwrite"===e&&"readwrite"!==this.mode)return St(new fe.ReadOnly("Transaction is readonly"));if(!this.active)return St(new fe.TransactionInactive);if(this._locked())return new Ve(((n,s)=>{this._blockedFuncs.push([()=>{this._promise(e,t,r).then(n,s)},Ge])}));if(r)return gt((()=>{var e=new Ve(((e,r)=>{this._lock();const n=t(e,r,this);n&&n.then&&n.then(e,r)}));return e.finally((()=>this._unlock())),e._lib=!0,e}));var n=new Ve(((e,r)=>{var n=t(e,r,this);n&&n.then&&n.then(e,r)}));return n._lib=!0,n}_root(){return this.parent?this.parent._root():this}waitFor(e){var t=this._root();const r=Ve.resolve(e);if(t._waitingFor)t._waitingFor=t._waitingFor.then((()=>r));else{t._waitingFor=r,t._waitingQueue=[];var n=t.idbtrans.objectStore(t.storeNames[0]);!function e(){for(++t._spinCount;t._waitingQueue.length;)t._waitingQueue.shift()();t._waitingFor&&(n.get(-1/0).onsuccess=e)}()}var s=t._waitingFor;return new Ve(((e,n)=>{r.then((r=>t._waitingQueue.push(ut(e.bind(null,r)))),(e=>t._waitingQueue.push(ut(n.bind(null,e))))).finally((()=>{t._waitingFor===s&&(t._waitingFor=null)}))}))}abort(){this.active&&(this.active=!1,this.idbtrans&&this.idbtrans.abort(),this._reject(new fe.Abort))}table(e){const t=this._memoizedTables||(this._memoizedTables={});if(T(t,e))return t[e];const r=this.schema[e];if(!r)throw new fe.NotFound("Table "+e+" not part of transaction");const n=new this.db.Table(e,r,this);return n.core=this.db.core.table(e),t[e]=n,n}}function qr(e,t,r,n,s,i,o){return{name:e,keyPath:t,unique:r,multi:n,auto:s,compound:i,src:(r&&!o?"&":"")+(n?"*":"")+(s?"++":"")+_r(t)}}function _r(e){return"string"==typeof e?e:e?"["+[].join.call(e,"+")+"]":""}function Ur(e,t,r){return{name:e,primKey:t,indexes:r,mappedClass:null,idxByName:D(r,(e=>[e.name,e]))}}let kr=e=>{try{return e.only([[]]),kr=()=>[[]],[[]]}catch(e){return kr=()=>Ot,Ot}};function jr(e){return null==e?()=>{}:"string"==typeof e?function(e){return 1===e.split(".").length?t=>t[e]:t=>C(t,e)}(e):t=>C(t,e)}function xr(e){return[].slice.call(e)}let Sr=0;function Pr(e){return null==e?":id":"string"==typeof e?e:`[${e.join("+")}]`}function Er(e,t,r){function n(e){if(3===e.type)return null;if(4===e.type)throw new Error("Cannot convert never type to IDBKeyRange");const{lower:r,upper:n,lowerOpen:s,upperOpen:i}=e;return void 0===r?void 0===n?null:t.upperBound(n,!!i):void 0===n?t.lowerBound(r,!!s):t.bound(r,n,!!s,!!i)}const{schema:s,hasGetAll:i}=function(e,t){const r=xr(e.objectStoreNames);return{schema:{name:e.name,tables:r.map((e=>t.objectStore(e))).map((e=>{const{keyPath:t,autoIncrement:r}=e,n=y(t),s=null==t,i={},o={name:e.name,primaryKey:{name:null,isPrimaryKey:!0,outbound:s,compound:n,keyPath:t,autoIncrement:r,unique:!0,extractKey:jr(t)},indexes:xr(e.indexNames).map((t=>e.index(t))).map((e=>{const{name:t,unique:r,multiEntry:n,keyPath:s}=e,o={name:t,compound:y(s),keyPath:s,unique:r,multiEntry:n,extractKey:jr(s)};return i[Pr(s)]=o,o})),getIndexByKeyPath:e=>i[Pr(e)]};return i[":id"]=o.primaryKey,null!=t&&(i[Pr(t)]=o.primaryKey),o}))},hasGetAll:r.length>0&&"getAll"in t.objectStore(r[0])&&!("undefined"!=typeof navigator&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604)}}(e,r),o=s.tables.map((e=>function(e){const t=e.name;return{name:t,schema:e,mutate:function({trans:e,type:r,keys:s,values:i,range:o}){return new Promise(((a,u)=>{a=ut(a);const c=e.objectStore(t),l=null==c.keyPath,h="put"===r||"add"===r;if(!h&&"delete"!==r&&"deleteRange"!==r)throw new Error("Invalid operation type: "+r);const{length:p}=s||i||{length:1};if(s&&i&&s.length!==i.length)throw new Error("Given keys array must have same length as given values array.");if(0===p)return a({numFailures:0,failures:{},results:[],lastResult:void 0});let f;const d=[],g=[];let m=0;const y=e=>{++m,vr(e)};if("deleteRange"===r){if(4===o.type)return a({numFailures:m,failures:g,results:[],lastResult:void 0});3===o.type?d.push(f=c.clear()):d.push(f=c.delete(n(o)))}else{const[e,t]=h?l?[i,s]:[i,null]:[s,null];if(h)for(let n=0;n<p;++n)d.push(f=t&&void 0!==t[n]?c[r](e[n],t[n]):c[r](e[n])),f.onerror=y;else for(let t=0;t<p;++t)d.push(f=c[r](e[t])),f.onerror=y}const v=e=>{const t=e.target.result;d.forEach(((e,t)=>null!=e.error&&(g[t]=e.error))),a({numFailures:m,failures:g,results:"delete"===r?s:d.map((e=>e.result)),lastResult:t})};f.onerror=e=>{y(e),v(e)},f.onsuccess=v}))},getMany:({trans:e,keys:r})=>new Promise(((n,s)=>{n=ut(n);const i=e.objectStore(t),o=r.length,a=new Array(o);let u,c=0,l=0;const h=e=>{const t=e.target;a[t._pos]=t.result,++l===c&&n(a)},p=yr(s);for(let e=0;e<o;++e)null!=r[e]&&(u=i.get(r[e]),u._pos=e,u.onsuccess=h,u.onerror=p,++c);0===c&&n(a)})),get:({trans:e,key:r})=>new Promise(((n,s)=>{n=ut(n);const i=e.objectStore(t).get(r);i.onsuccess=e=>n(e.target.result),i.onerror=yr(s)})),query:function(e){return r=>new Promise(((s,i)=>{s=ut(s);const{trans:o,values:a,limit:u,query:c}=r,l=u===1/0?void 0:u,{index:h,range:p}=c,f=o.objectStore(t),d=h.isPrimaryKey?f:f.index(h.name),g=n(p);if(0===u)return s({result:[]});if(e){const e=a?d.getAll(g,l):d.getAllKeys(g,l);e.onsuccess=e=>s({result:e.target.result}),e.onerror=yr(i)}else{let e=0;const t=a||!("openKeyCursor"in d)?d.openCursor(g):d.openKeyCursor(g),r=[];t.onsuccess=n=>{const i=t.result;return i?(r.push(a?i.value:i.primaryKey),++e===u?s({result:r}):void i.continue()):s({result:r})},t.onerror=yr(i)}}))}(i),openCursor:function({trans:e,values:r,query:s,reverse:i,unique:o}){return new Promise(((a,u)=>{a=ut(a);const{index:c,range:l}=s,h=e.objectStore(t),p=c.isPrimaryKey?h:h.index(c.name),f=i?o?"prevunique":"prev":o?"nextunique":"next",d=r||!("openKeyCursor"in p)?p.openCursor(n(l),f):p.openKeyCursor(n(l),f);d.onerror=yr(u),d.onsuccess=ut((t=>{const r=d.result;if(!r)return void a(null);r.___id=++Sr,r.done=!1;const n=r.continue.bind(r);let s=r.continuePrimaryKey;s&&(s=s.bind(r));const i=r.advance.bind(r),o=()=>{throw new Error("Cursor not stopped")};r.trans=e,r.stop=r.continue=r.continuePrimaryKey=r.advance=()=>{throw new Error("Cursor not started")},r.fail=ut(u),r.next=function(){let e=1;return this.start((()=>e--?this.continue():this.stop())).then((()=>this))},r.start=e=>{const t=new Promise(((e,t)=>{e=ut(e),d.onerror=yr(t),r.fail=t,r.stop=t=>{r.stop=r.continue=r.continuePrimaryKey=r.advance=o,e(t)}})),a=()=>{if(d.result)try{e()}catch(e){r.fail(e)}else r.done=!0,r.start=()=>{throw new Error("Cursor behind last entry")},r.stop()};return d.onsuccess=ut((e=>{d.onsuccess=a,a()})),r.continue=n,r.continuePrimaryKey=s,r.advance=i,a(),t},a(r)}),u)}))},count({query:e,trans:r}){const{index:s,range:i}=e;return new Promise(((e,o)=>{const a=r.objectStore(t),u=s.isPrimaryKey?a:a.index(s.name),c=n(i),l=c?u.count(c):u.count();l.onsuccess=ut((t=>e(t.target.result))),l.onerror=yr(o)}))}}}(e))),a={};return o.forEach((e=>a[e.name]=e)),{stack:"dbcore",transaction:e.transaction.bind(e),table(e){if(!a[e])throw new Error(`Table '${e}' not found`);return a[e]},MIN_KEY:-1/0,MAX_KEY:kr(t),schema:s}}function Or({_novip:e},t){const r=t.db,n=function(e,t,{IDBKeyRange:r,indexedDB:n},s){const i=function(e,t){return t.reduce(((e,{create:t})=>({...e,...t(e)})),e)}(Er(t,r,s),e.dbcore);return{dbcore:i}}(e._middlewares,r,e._deps,t);e.core=n.dbcore,e.tables.forEach((t=>{const r=t.name;e.core.schema.tables.some((e=>e.name===r))&&(t.core=e.core.table(r),e[r]instanceof e.Table&&(e[r].core=t.core))}))}function Dr({_novip:e},t,r,n){r.forEach((r=>{const s=n[r];t.forEach((t=>{const n=j(t,r);(!n||"value"in n&&void 0===n.value)&&(t===e.Transaction.prototype||t instanceof e.Transaction?_(t,r,{get(){return this.table(r)},set(e){q(this,r,{value:e,writable:!0,configurable:!0,enumerable:!0})}}):t[r]=new e.Table(r,s))}))}))}function Cr({_novip:e},t){t.forEach((t=>{for(let r in t)t[r]instanceof e.Table&&delete t[r]}))}function Ir(e,t){return e._cfg.version-t._cfg.version}function Rr(e,t,r,n){const s=e._dbSchema,i=e._createTransaction("readwrite",e._storeNames,s);i.create(r),i._completion.catch(n);const o=i._reject.bind(i),a=Ge.transless||Ge;gt((()=>{Ge.trans=i,Ge.transless=a,0===t?(m(s).forEach((e=>{Kr(r,e,s[e].primKey,s[e].indexes)})),Or(e,r),Ve.follow((()=>e.on.populate.fire(i))).catch(o)):function({_novip:e},t,r,n){const s=[],i=e._versions;let o=e._dbSchema=Nr(e,e.idbdb,n),a=!1;const u=i.filter((e=>e._cfg.version>=t));return u.forEach((i=>{s.push((()=>{const s=o,u=i._cfg.dbschema;Mr(e,s,n),Mr(e,u,n),o=e._dbSchema=u;const c=Br(s,u);c.add.forEach((e=>{Kr(n,e[0],e[1].primKey,e[1].indexes)})),c.change.forEach((e=>{if(e.recreate)throw new fe.Upgrade("Not yet support for changing primary key");{const t=n.objectStore(e.name);e.add.forEach((e=>Lr(t,e))),e.change.forEach((e=>{t.deleteIndex(e.name),Lr(t,e)})),e.del.forEach((e=>t.deleteIndex(e)))}}));const l=i._cfg.contentUpgrade;if(l&&i._cfg.version>t){Or(e,n),r._memoizedTables={},a=!0;let t=R(u);c.del.forEach((e=>{t[e]=s[e]})),Cr(e,[e.Transaction.prototype]),Dr(e,[e.Transaction.prototype],m(t),t),r.schema=t;const i=Q(l);let o;i&&mt();const h=Ve.follow((()=>{if(o=l(r),o&&i){var e=yt.bind(null,null);o.then(e,e)}}));return o&&"function"==typeof o.then?Ve.resolve(o):h.then((()=>o))}})),s.push((t=>{a&&Kt||function(e,t){[].slice.call(t.db.objectStoreNames).forEach((r=>null==e[r]&&t.db.deleteObjectStore(r)))}(i._cfg.dbschema,t),Cr(e,[e.Transaction.prototype]),Dr(e,[e.Transaction.prototype],e._storeNames,e._dbSchema),r.schema=e._dbSchema}))})),function e(){return s.length?Ve.resolve(s.shift()(r.idbtrans)).then(e):Ve.resolve()}().then((()=>{var e,t;t=n,m(e=o).forEach((r=>{t.db.objectStoreNames.contains(r)||Kr(t,r,e[r].primKey,e[r].indexes)}))}))}(e,t,i,r).catch(o)}))}function Br(e,t){const r={del:[],add:[],change:[]};let n;for(n in e)t[n]||r.del.push(n);for(n in t){const s=e[n],i=t[n];if(s){const e={name:n,def:i,recreate:!1,del:[],add:[],change:[]};if(""+(s.primKey.keyPath||"")!=""+(i.primKey.keyPath||"")||s.primKey.auto!==i.primKey.auto&&!Bt)e.recreate=!0,r.change.push(e);else{const t=s.idxByName,n=i.idxByName;let o;for(o in t)n[o]||e.del.push(o);for(o in n){const r=t[o],s=n[o];r?r.src!==s.src&&e.change.push(s):e.add.push(s)}(e.del.length>0||e.add.length>0||e.change.length>0)&&r.change.push(e)}}else r.add.push([n,i])}return r}function Kr(e,t,r,n){const s=e.db.createObjectStore(t,r.keyPath?{keyPath:r.keyPath,autoIncrement:r.auto}:{autoIncrement:r.auto});return n.forEach((e=>Lr(s,e))),s}function Lr(e,t){e.createIndex(t.name,t.keyPath,{unique:t.unique,multiEntry:t.multi})}function Nr(e,t,r){const n={};return S(t.objectStoreNames,0).forEach((e=>{const t=r.objectStore(e);let s=t.keyPath;const i=qr(_r(s),s||"",!1,!1,!!t.autoIncrement,s&&"string"!=typeof s,!0),o=[];for(let e=0;e<t.indexNames.length;++e){const r=t.index(t.indexNames[e]);s=r.keyPath;var a=qr(r.name,s,!!r.unique,!!r.multiEntry,!1,s&&"string"!=typeof s,!1);o.push(a)}n[e]=Ur(e,i,o)})),n}function Mr({_novip:e},t,r){const n=r.db.objectStoreNames;for(let s=0;s<n.length;++s){const i=n[s],o=r.objectStore(i);e._hasGetAll="getAll"in o;for(let e=0;e<o.indexNames.length;++e){const r=o.indexNames[e],n=o.index(r).keyPath,s="string"==typeof n?n:"["+S(n).join("+")+"]";if(t[i]){const e=t[i].idxByName[s];e&&(e.name=r,delete t[i].idxByName[s],t[i].idxByName[r]=e)}}}"undefined"!=typeof navigator&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&g.WorkerGlobalScope&&g instanceof g.WorkerGlobalScope&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604&&(e._hasGetAll=!1)}class Fr{_parseStoresSpec(e,t){m(e).forEach((r=>{if(null!==e[r]){var n=e[r].split(",").map(((e,t)=>{const r=(e=e.trim()).replace(/([&*]|\+\+)/g,""),n=/^\[/.test(r)?r.match(/^\[(.*)\]$/)[1].split("+"):r;return qr(r,n||null,/\&/.test(e),/\*/.test(e),/\+\+/.test(e),y(n),0===t)})),s=n.shift();if(s.multi)throw new fe.Schema("Primary key cannot be multi-valued");n.forEach((e=>{if(e.auto)throw new fe.Schema("Only primary key can be marked as autoIncrement (++)");if(!e.keyPath)throw new fe.Schema("Index must have a name and cannot be an empty string")})),t[r]=Ur(r,s,n)}}))}stores(e){const t=this.db;this._cfg.storesSource=this._cfg.storesSource?v(this._cfg.storesSource,e):e;const r=t._versions,n={};let s={};return r.forEach((e=>{v(n,e._cfg.storesSource),s=e._cfg.dbschema={},e._parseStoresSpec(n,s)})),t._dbSchema=s,Cr(t,[t._allTables,t,t.Transaction.prototype]),Dr(t,[t._allTables,t,t.Transaction.prototype,this._cfg.tables],m(s),s),t._storeNames=m(s),this}upgrade(e){return this._cfg.contentUpgrade=_e(this._cfg.contentUpgrade||me,e),this}}function Gr(e,t){let r=e._dbNamesDB;return r||(r=e._dbNamesDB=new hn(Mt,{addons:[],indexedDB:e,IDBKeyRange:t}),r.version(1).stores({dbnames:"name"})),r.table("dbnames")}function Wr(e){return e&&"function"==typeof e.databases}function Hr(e){return gt((function(){return Ge.letThrough=!0,e()}))}function $r(){var e;return!navigator.userAgentData&&/Safari\//.test(navigator.userAgent)&&!/Chrom(e|ium)\//.test(navigator.userAgent)&&indexedDB.databases?new Promise((function(t){var r=function(){return indexedDB.databases().finally(t)};e=setInterval(r,100),r()})).finally((function(){return clearInterval(e)})):Promise.resolve()}function Vr(e){var t=t=>e.next(t),r=s(t),n=s((t=>e.throw(t)));function s(e){return t=>{var s=e(t),i=s.value;return s.done?i:i&&"function"==typeof i.then?i.then(r,n):y(i)?Promise.all(i).then(r,n):r(i)}}return s(t)()}function Jr(e,t,r){var n=arguments.length;if(n<2)throw new fe.InvalidArgument("Too few arguments");for(var s=new Array(n-1);--n;)s[n-1]=arguments[n];return r=s.pop(),[e,K(s),r]}function zr(e,t,r,n,s){return Ve.resolve().then((()=>{const i=Ge.transless||Ge,o=e._createTransaction(t,r,e._dbSchema,n),a={trans:o,transless:i};if(n)o.idbtrans=n.idbtrans;else try{o.create(),e._state.PR1398_maxLoop=3}catch(n){return n.name===he.InvalidState&&e.isOpen()&&--e._state.PR1398_maxLoop>0?(console.warn("Dexie: Need to reopen db"),e._close(),e.open().then((()=>zr(e,t,r,null,s)))):St(n)}const u=Q(s);let c;u&&mt();const l=Ve.follow((()=>{if(c=s.call(o,o),c)if(u){var e=yt.bind(null,null);c.then(e,e)}else"function"==typeof c.next&&"function"==typeof c.throw&&(c=Vr(c))}),a);return(c&&"function"==typeof c.then?Ve.resolve(c).then((e=>o.active?e:St(new fe.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn")))):l.then((()=>c))).then((e=>(n&&o._resolve(),o._completion.then((()=>e))))).catch((e=>(o._reject(e),St(e))))}))}function Xr(e,t,r){const n=y(e)?e.slice():[e];for(let e=0;e<r;++e)n.push(t);return n}const Qr={stack:"dbcore",name:"VirtualIndexMiddleware",level:1,create:function(e){return{...e,table(t){const r=e.table(t),{schema:n}=r,s={},i=[];function o(e,t,r){const n=Pr(e),a=s[n]=s[n]||[],u=null==e?0:"string"==typeof e?1:e.length,c=t>0,l={...r,isVirtual:c,keyTail:t,keyLength:u,extractKey:jr(e),unique:!c&&r.unique};return a.push(l),l.isPrimaryKey||i.push(l),u>1&&o(2===u?e[0]:e.slice(0,u-1),t+1,r),a.sort(((e,t)=>e.keyTail-t.keyTail)),l}const a=o(n.primaryKey.keyPath,0,n.primaryKey);s[":id"]=[a];for(const e of n.indexes)o(e.keyPath,0,e);function u(t){const r=t.query.index;return r.isVirtual?{...t,query:{index:r,range:(n=t.query.range,s=r.keyTail,{type:1===n.type?2:n.type,lower:Xr(n.lower,n.lowerOpen?e.MAX_KEY:e.MIN_KEY,s),lowerOpen:!0,upper:Xr(n.upper,n.upperOpen?e.MIN_KEY:e.MAX_KEY,s),upperOpen:!0})}}:t;var n,s}const c={...r,schema:{...n,primaryKey:a,indexes:i,getIndexByKeyPath:function(e){const t=s[Pr(e)];return t&&t[0]}},count:e=>r.count(u(e)),query:e=>r.query(u(e)),openCursor(t){const{keyTail:n,isVirtual:s,keyLength:i}=t.query.index;return s?r.openCursor(u(t)).then((r=>r&&function(r){const s=Object.create(r,{continue:{value:function(s){null!=s?r.continue(Xr(s,t.reverse?e.MAX_KEY:e.MIN_KEY,n)):t.unique?r.continue(r.key.slice(0,i).concat(t.reverse?e.MIN_KEY:e.MAX_KEY,n)):r.continue()}},continuePrimaryKey:{value(t,s){r.continuePrimaryKey(Xr(t,e.MAX_KEY,n),s)}},primaryKey:{get:()=>r.primaryKey},key:{get(){const e=r.key;return 1===i?e[0]:e.slice(0,i)}},value:{get:()=>r.value}});return s}(r))):r.openCursor(t)}};return c}}}};function Yr(e,t,r,n){return r=r||{},n=n||"",m(e).forEach((s=>{if(T(t,s)){var i=e[s],o=t[s];if("object"==typeof i&&"object"==typeof o&&i&&o){const e=H(i);e!==H(o)?r[n+s]=t[s]:"Object"===e?Yr(i,o,r,n+s+"."):i!==o&&(r[n+s]=t[s])}else i!==o&&(r[n+s]=t[s])}else r[n+s]=void 0})),m(t).forEach((s=>{T(e,s)||(r[n+s]=t[s])})),r}const Zr={stack:"dbcore",name:"HooksMiddleware",level:2,create:e=>({...e,table(t){const r=e.table(t),{primaryKey:n}=r.schema,s={...r,mutate(e){const s=Ge.trans,{deleting:i,creating:o,updating:a}=s.table(t).hook;switch(e.type){case"add":if(o.fire===me)break;return s._promise("readwrite",(()=>u(e)),!0);case"put":if(o.fire===me&&a.fire===me)break;return s._promise("readwrite",(()=>u(e)),!0);case"delete":if(i.fire===me)break;return s._promise("readwrite",(()=>u(e)),!0);case"deleteRange":if(i.fire===me)break;return s._promise("readwrite",(()=>function(e){return c(e.trans,e.range,1e4)}(e)),!0)}return r.mutate(e);function u(e){const t=Ge.trans,s=e.keys||function(e,t){return"delete"===t.type?t.keys:t.keys||t.values.map(e.extractKey)}(n,e);if(!s)throw new Error("Keys missing");return"delete"!==(e="add"===e.type||"put"===e.type?{...e,keys:s}:{...e}).type&&(e.values=[...e.values]),e.keys&&(e.keys=[...e.keys]),function(e,t,r){return"add"===t.type?Promise.resolve([]):e.getMany({trans:t.trans,keys:r,cache:"immutable"})}(r,e,s).then((u=>{const c=s.map(((r,s)=>{const c=u[s],l={onerror:null,onsuccess:null};if("delete"===e.type)i.fire.call(l,r,c,t);else if("add"===e.type||void 0===c){const i=o.fire.call(l,r,e.values[s],t);null==r&&null!=i&&(r=i,e.keys[s]=r,n.outbound||I(e.values[s],n.keyPath,r))}else{const n=Yr(c,e.values[s]),i=a.fire.call(l,n,r,c,t);if(i){const t=e.values[s];Object.keys(i).forEach((e=>{T(t,e)?t[e]=i[e]:I(t,e,i[e])}))}}return l}));return r.mutate(e).then((({failures:t,results:r,numFailures:n,lastResult:i})=>{for(let n=0;n<s.length;++n){const i=r?r[n]:s[n],o=c[n];null==i?o.onerror&&o.onerror(t[n]):o.onsuccess&&o.onsuccess("put"===e.type&&u[n]?e.values[n]:i)}return{failures:t,results:r,numFailures:n,lastResult:i}})).catch((e=>(c.forEach((t=>t.onerror&&t.onerror(e))),Promise.reject(e))))}))}function c(e,t,s){return r.query({trans:e,values:!1,query:{index:n,range:t},limit:s}).then((({result:r})=>u({type:"delete",keys:r,trans:e}).then((n=>n.numFailures>0?Promise.reject(n.failures[0]):r.length<s?{failures:[],numFailures:0,lastResult:void 0}:c(e,{...t,lower:r[r.length-1],lowerOpen:!0},s)))))}}};return s}})};function en(e,t,r){try{if(!t)return null;if(t.keys.length<e.length)return null;const n=[];for(let s=0,i=0;s<t.keys.length&&i<e.length;++s)0===nr(t.keys[s],e[i])&&(n.push(r?F(t.values[s]):t.values[s]),++i);return n.length===e.length?n:null}catch(e){return null}}const tn={stack:"dbcore",level:-1,create:e=>({table:t=>{const r=e.table(t);return{...r,getMany:e=>{if(!e.cache)return r.getMany(e);const t=en(e.keys,e.trans._cache,"clone"===e.cache);return t?Ve.resolve(t):r.getMany(e).then((t=>(e.trans._cache={keys:e.keys,values:"clone"===e.cache?F(t):t},t)))},mutate:e=>("add"!==e.type&&(e.trans._cache=null),r.mutate(e))}}})};function rn(e){return!("from"in e)}const nn=function(e,t){if(!this){const t=new nn;return e&&"d"in e&&v(t,e),t}v(this,arguments.length?{d:1,from:e,to:arguments.length>1?t:e}:{d:0})};function sn(e,t,r){const n=nr(t,r);if(isNaN(n))return;if(n>0)throw RangeError();if(rn(e))return v(e,{from:t,to:r,d:1});const s=e.l,i=e.r;if(nr(r,e.from)<0)return s?sn(s,t,r):e.l={from:t,to:r,d:1,l:null,r:null},un(e);if(nr(t,e.to)>0)return i?sn(i,t,r):e.r={from:t,to:r,d:1,l:null,r:null},un(e);nr(t,e.from)<0&&(e.from=t,e.l=null,e.d=i?i.d+1:1),nr(r,e.to)>0&&(e.to=r,e.r=null,e.d=e.l?e.l.d+1:1);const o=!e.r;s&&!e.l&&on(e,s),i&&o&&on(e,i)}function on(e,t){rn(t)||function e(t,{from:r,to:n,l:s,r:i}){sn(t,r,n),s&&e(t,s),i&&e(t,i)}(e,t)}function an(e){let t=rn(e)?null:{s:0,n:e};return{next(e){const r=arguments.length>0;for(;t;)switch(t.s){case 0:if(t.s=1,r)for(;t.n.l&&nr(e,t.n.from)<0;)t={up:t,n:t.n.l,s:1};else for(;t.n.l;)t={up:t,n:t.n.l,s:1};case 1:if(t.s=2,!r||nr(e,t.n.to)<=0)return{value:t.n,done:!1};case 2:if(t.n.r){t.s=3,t={up:t,n:t.n.r,s:0};continue}case 3:t=t.up}return{done:!0}}}}function un(e){var t,r;const n=((null===(t=e.r)||void 0===t?void 0:t.d)||0)-((null===(r=e.l)||void 0===r?void 0:r.d)||0),s=n>1?"r":n<-1?"l":"";if(s){const t="r"===s?"l":"r",r={...e},n=e[s];e.from=n.from,e.to=n.to,e[s]=n[s],r[s]=n[t],e[t]=r,r.d=cn(r)}e.d=cn(e)}function cn({r:e,l:t}){return(e?t?Math.max(e.d,t.d):e.d:t?t.d:0)+1}A(nn.prototype,{add(e){return on(this,e),this},addKey(e){return sn(this,e,e),this},addKeys(e){return e.forEach((e=>sn(this,e,e))),this},[V](){return an(this)}});const ln={stack:"dbcore",level:0,create:e=>{const t=e.schema.name,r=new nn(e.MIN_KEY,e.MAX_KEY);return{...e,table:n=>{const s=e.table(n),{schema:i}=s,{primaryKey:o}=i,{extractKey:a,outbound:u}=o,c={...s,mutate:e=>{const o=e.trans,a=o.mutatedParts||(o.mutatedParts={}),u=e=>{const r=`idb://${t}/${n}/${e}`;return a[r]||(a[r]=new nn)},c=u(""),l=u(":dels"),{type:h}=e;let[p,f]="deleteRange"===e.type?[e.range]:"delete"===e.type?[e.keys]:e.values.length<50?[[],e.values]:[];const d=e.trans._cache;return s.mutate(e).then((e=>{if(y(p)){"delete"!==h&&(p=e.results),c.addKeys(p);const t=en(p,d);t||"add"===h||l.addKeys(p),(t||f)&&function(e,t,r,n){t.indexes.forEach((function(t){const s=e(t.name||"");function i(e){return null!=e?t.extractKey(e):null}const o=e=>t.multiEntry&&y(e)?e.forEach((e=>s.addKey(e))):s.addKey(e);(r||n).forEach(((e,t)=>{const s=r&&i(r[t]),a=n&&i(n[t]);0!==nr(s,a)&&(null!=s&&o(s),null!=a&&o(a))}))}))}(u,i,t,f)}else if(p){const e={from:p.lower,to:p.upper};l.add(e),c.add(e)}else c.add(r),l.add(r),i.indexes.forEach((e=>u(e.name).add(r)));return e}))}},l=({query:{index:t,range:r}})=>{var n,s;return[t,new nn(null!==(n=r.lower)&&void 0!==n?n:e.MIN_KEY,null!==(s=r.upper)&&void 0!==s?s:e.MAX_KEY)]},h={get:e=>[o,new nn(e.key)],getMany:e=>[o,(new nn).addKeys(e.keys)],count:l,query:l,openCursor:l};return m(h).forEach((e=>{c[e]=function(i){const{subscr:o}=Ge;if(o){const c=e=>{const r=`idb://${t}/${n}/${e}`;return o[r]||(o[r]=new nn)},l=c(""),p=c(":dels"),[f,d]=h[e](i);if(c(f.name||"").add(d),!f.isPrimaryKey){if("count"!==e){const t="query"===e&&u&&i.values&&s.query({...i,values:!1});return s[e].apply(this,arguments).then((r=>{if("query"===e){if(u&&i.values)return t.then((({result:e})=>(l.addKeys(e),r)));const e=i.values?r.result.map(a):r.result;i.values?l.addKeys(e):p.addKeys(e)}else if("openCursor"===e){const e=r,t=i.values;return e&&Object.create(e,{key:{get:()=>(p.addKey(e.primaryKey),e.key)},primaryKey:{get(){const t=e.primaryKey;return p.addKey(t),t}},value:{get:()=>(t&&l.addKey(e.primaryKey),e.value)}})}return r}))}p.add(r)}}return s[e].apply(this,arguments)}})),c}}}};class hn{constructor(e,t){this._middlewares={},this.verno=0;const r=hn.dependencies;this._options=t={addons:hn.addons,autoOpen:!0,indexedDB:r.indexedDB,IDBKeyRange:r.IDBKeyRange,...t},this._deps={indexedDB:t.indexedDB,IDBKeyRange:t.IDBKeyRange};const{addons:n}=t;this._dbSchema={},this._versions=[],this._storeNames=[],this._allTables={},this.idbdb=null,this._novip=this;const s={dbOpenError:null,isBeingOpened:!1,onReadyBeingFired:null,openComplete:!1,dbReadyResolve:me,dbReadyPromise:null,cancelOpen:me,openCanceller:null,autoSchema:!0,PR1398_maxLoop:3};var i;s.dbReadyPromise=new Ve((e=>{s.dbReadyResolve=e})),s.openCanceller=new Ve(((e,t)=>{s.cancelOpen=t})),this._state=s,this.name=e,this.on=Jt(this,"populate","blocked","versionchange","close",{ready:[_e,me]}),this.on.ready.subscribe=P(this.on.ready.subscribe,(e=>(t,r)=>{hn.vip((()=>{const n=this._state;if(n.openComplete)n.dbOpenError||Ve.resolve().then(t),r&&e(t);else if(n.onReadyBeingFired)n.onReadyBeingFired.push(t),r&&e(t);else{e(t);const n=this;r||e((function e(){n.on.ready.unsubscribe(t),n.on.ready.unsubscribe(e)}))}}))})),this.Collection=(i=this,zt(or.prototype,(function(e,t){this.db=i;let r=Ht,n=null;if(t)try{r=t()}catch(e){n=e}const s=e._ctx,o=s.table,a=o.hook.reading.fire;this._ctx={table:o,index:s.index,isPrimKey:!s.index||o.schema.primKey.keyPath&&s.index===o.schema.primKey.name,range:r,keysOnly:!1,dir:"next",unique:"",algorithm:null,filter:null,replayFilter:null,justLimit:!0,isMatch:null,offset:0,limit:1/0,error:n,or:s.or,valueMapper:a!==ye?a:null}}))),this.Table=function(e){return zt(Vt.prototype,(function(t,r,n){this.db=e,this._tx=n,this.name=t,this.schema=r,this.hook=e._allTables[t]?e._allTables[t].hook:Jt(null,{creating:[we,me],reading:[ve,ye],updating:[Ae,me],deleting:[Te,me]})}))}(this),this.Transaction=function(e){return zt(Ar.prototype,(function(t,r,n,s,i){this.db=e,this.mode=t,this.storeNames=r,this.schema=n,this.chromeTransactionDurability=s,this.idbtrans=null,this.on=Jt(this,"complete","error","abort"),this.parent=i||null,this.active=!0,this._reculock=0,this._blockedFuncs=[],this._resolve=null,this._reject=null,this._waitingFor=null,this._waitingQueue=null,this._spinCount=0,this._completion=new Ve(((e,t)=>{this._resolve=e,this._reject=t})),this._completion.then((()=>{this.active=!1,this.on.complete.fire()}),(e=>{var t=this.active;return this.active=!1,this.on.error.fire(e),this.parent?this.parent._reject(e):t&&this.idbtrans&&this.idbtrans.abort(),St(e)}))}))}(this),this.Version=function(e){return zt(Fr.prototype,(function(t){this.db=e,this._cfg={version:t,storesSource:null,dbschema:{},tables:{},contentUpgrade:null}}))}(this),this.WhereClause=function(e){return zt(mr.prototype,(function(t,r,n){this.db=e,this._ctx={table:t,index:":id"===r?null:r,or:n};const s=e._deps.indexedDB;if(!s)throw new fe.MissingAPI;this._cmp=this._ascending=s.cmp.bind(s),this._descending=(e,t)=>s.cmp(t,e),this._max=(e,t)=>s.cmp(e,t)>0?e:t,this._min=(e,t)=>s.cmp(e,t)<0?e:t,this._IDBKeyRange=e._deps.IDBKeyRange}))}(this),this.on("versionchange",(e=>{e.newVersion>0?console.warn(`Another connection wants to upgrade database '${this.name}'. Closing db now to resume the upgrade.`):console.warn(`Another connection wants to delete database '${this.name}'. Closing db now to resume the delete request.`),this.close()})),this.on("blocked",(e=>{!e.newVersion||e.newVersion<e.oldVersion?console.warn(`Dexie.delete('${this.name}') was blocked`):console.warn(`Upgrade '${this.name}' blocked by other connection holding version ${e.oldVersion/10}`)})),this._maxKey=kr(t.IDBKeyRange),this._createTransaction=(e,t,r,n)=>new this.Transaction(e,t,r,this._options.chromeTransactionDurability,n),this._fireOnBlocked=e=>{this.on("blocked").fire(e),Rt.filter((e=>e.name===this.name&&e!==this&&!e._state.vcFired)).map((t=>t.on("versionchange").fire(e)))},this.use(Qr),this.use(Zr),this.use(ln),this.use(tn),this.vip=Object.create(this,{_vip:{value:!0}}),n.forEach((e=>e(this)))}version(e){if(isNaN(e)||e<.1)throw new fe.Type("Given version is not a positive number");if(e=Math.round(10*e)/10,this.idbdb||this._state.isBeingOpened)throw new fe.Schema("Cannot add version when database is open");this.verno=Math.max(this.verno,e);const t=this._versions;var r=t.filter((t=>t._cfg.version===e))[0];return r||(r=new this.Version(e),t.push(r),t.sort(Ir),r.stores({}),this._state.autoSchema=!1,r)}_whenReady(e){return this.idbdb&&(this._state.openComplete||Ge.letThrough||this._vip)?e():new Ve(((e,t)=>{if(this._state.openComplete)return t(new fe.DatabaseClosed(this._state.dbOpenError));if(!this._state.isBeingOpened){if(!this._options.autoOpen)return void t(new fe.DatabaseClosed);this.open().catch(me)}this._state.dbReadyPromise.then(e,t)})).then(e)}use({stack:e,create:t,level:r,name:n}){n&&this.unuse({stack:e,name:n});const s=this._middlewares[e]||(this._middlewares[e]=[]);return s.push({stack:e,create:t,level:null==r?10:r,name:n}),s.sort(((e,t)=>e.level-t.level)),this}unuse({stack:e,name:t,create:r}){return e&&this._middlewares[e]&&(this._middlewares[e]=this._middlewares[e].filter((e=>r?e.create!==r:!!t&&e.name!==t))),this}open(){return function(e){const t=e._state,{indexedDB:r}=e._deps;if(t.isBeingOpened||e.idbdb)return t.dbReadyPromise.then((()=>t.dbOpenError?St(t.dbOpenError):e));Y&&(t.openCanceller._stackHolder=re()),t.isBeingOpened=!0,t.dbOpenError=null,t.openComplete=!1;const n=t.openCanceller;function s(){if(t.openCanceller!==n)throw new fe.DatabaseClosed("db.open() was cancelled")}let i=t.dbReadyResolve,o=null,a=!1;return Ve.race([n,("undefined"==typeof navigator?Ve.resolve():$r()).then((()=>new Ve(((n,i)=>{if(s(),!r)throw new fe.MissingAPI;const u=e.name,c=t.autoSchema?r.open(u):r.open(u,Math.round(10*e.verno));if(!c)throw new fe.MissingAPI;c.onerror=yr(i),c.onblocked=ut(e._fireOnBlocked),c.onupgradeneeded=ut((n=>{if(o=c.transaction,t.autoSchema&&!e._options.allowEmptyDB){c.onerror=vr,o.abort(),c.result.close();const e=r.deleteDatabase(u);e.onsuccess=e.onerror=ut((()=>{i(new fe.NoSuchDatabase(`Database ${u} doesnt exist`))}))}else{o.onerror=yr(i);var s=n.oldVersion>Math.pow(2,62)?0:n.oldVersion;a=s<1,e._novip.idbdb=c.result,Rr(e,s/10,o,i)}}),i),c.onsuccess=ut((()=>{o=null;const r=e._novip.idbdb=c.result,s=S(r.objectStoreNames);if(s.length>0)try{const n=r.transaction(1===(i=s).length?i[0]:i,"readonly");t.autoSchema?function({_novip:e},t,r){e.verno=t.version/10;const n=e._dbSchema=Nr(0,t,r);e._storeNames=S(t.objectStoreNames,0),Dr(e,[e._allTables],m(n),n)}(e,r,n):(Mr(e,e._dbSchema,n),function(e,t){const r=Br(Nr(0,e.idbdb,t),e._dbSchema);return!(r.add.length||r.change.some((e=>e.add.length||e.change.length)))}(e,n)||console.warn("Dexie SchemaDiff: Schema was extended without increasing the number passed to db.version(). Some queries may fail.")),Or(e,n)}catch(e){}var i;Rt.push(e),r.onversionchange=ut((r=>{t.vcFired=!0,e.on("versionchange").fire(r)})),r.onclose=ut((t=>{e.on("close").fire(t)})),a&&function({indexedDB:e,IDBKeyRange:t},r){!Wr(e)&&r!==Mt&&Gr(e,t).put({name:r}).catch(me)}(e._deps,u),n()}),i)}))))]).then((()=>(s(),t.onReadyBeingFired=[],Ve.resolve(Hr((()=>e.on.ready.fire(e.vip)))).then((function r(){if(t.onReadyBeingFired.length>0){let n=t.onReadyBeingFired.reduce(_e,me);return t.onReadyBeingFired=[],Ve.resolve(Hr((()=>n(e.vip)))).then(r)}}))))).finally((()=>{t.onReadyBeingFired=null,t.isBeingOpened=!1})).then((()=>e)).catch((r=>{t.dbOpenError=r;try{o&&o.abort()}catch(e){}return n===t.openCanceller&&e._close(),St(r)})).finally((()=>{t.openComplete=!0,i()}))}(this)}_close(){const e=this._state,t=Rt.indexOf(this);if(t>=0&&Rt.splice(t,1),this.idbdb){try{this.idbdb.close()}catch(e){}this._novip.idbdb=null}e.dbReadyPromise=new Ve((t=>{e.dbReadyResolve=t})),e.openCanceller=new Ve(((t,r)=>{e.cancelOpen=r}))}close(){this._close();const e=this._state;this._options.autoOpen=!1,e.dbOpenError=new fe.DatabaseClosed,e.isBeingOpened&&e.cancelOpen(e.dbOpenError)}delete(){const e=arguments.length>0,t=this._state;return new Ve(((r,n)=>{const s=()=>{this.close();var e=this._deps.indexedDB.deleteDatabase(this.name);e.onsuccess=ut((()=>{!function({indexedDB:e,IDBKeyRange:t},r){!Wr(e)&&r!==Mt&&Gr(e,t).delete(r).catch(me)}(this._deps,this.name),r()})),e.onerror=yr(n),e.onblocked=this._fireOnBlocked};if(e)throw new fe.InvalidArgument("Arguments not allowed in db.delete()");t.isBeingOpened?t.dbReadyPromise.then(s):s()}))}backendDB(){return this.idbdb}isOpen(){return null!==this.idbdb}hasBeenClosed(){const e=this._state.dbOpenError;return e&&"DatabaseClosed"===e.name}hasFailed(){return null!==this._state.dbOpenError}dynamicallyOpened(){return this._state.autoSchema}get tables(){return m(this._allTables).map((e=>this._allTables[e]))}transaction(){const e=Jr.apply(this,arguments);return this._transaction.apply(this,e)}_transaction(e,t,r){let n=Ge.trans;n&&n.db===this&&-1===e.indexOf("!")||(n=null);const s=-1!==e.indexOf("?");let i,o;e=e.replace("!","").replace("?","");try{if(o=t.map((e=>{var t=e instanceof this.Table?e.name:e;if("string"!=typeof t)throw new TypeError("Invalid table argument to Dexie.transaction(). Only Table or String are allowed");return t})),"r"==e||e===Ft)i=Ft;else{if("rw"!=e&&e!=Gt)throw new fe.InvalidArgument("Invalid transaction mode: "+e);i=Gt}if(n){if(n.mode===Ft&&i===Gt){if(!s)throw new fe.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");n=null}n&&o.forEach((e=>{if(n&&-1===n.storeNames.indexOf(e)){if(!s)throw new fe.SubTransaction("Table "+e+" not included in parent transaction.");n=null}})),s&&n&&!n.active&&(n=null)}}catch(e){return n?n._promise(null,((t,r)=>{r(e)})):St(e)}const a=zr.bind(null,this,i,o,n,r);return n?n._promise(i,a,"lock"):Ge.trans?qt(Ge.transless,(()=>this._whenReady(a))):this._whenReady(a)}table(e){if(!T(this._allTables,e))throw new fe.InvalidTable(`Table ${e} does not exist`);return this._allTables[e]}}const pn="undefined"!=typeof Symbol&&"observable"in Symbol?Symbol.observable:"@@observable";class fn{constructor(e){this._subscribe=e}subscribe(e,t,r){return this._subscribe(e&&"function"!=typeof e?e:{next:e,error:t,complete:r})}[pn](){return this}}function dn(e,t){return m(t).forEach((r=>{on(e[r]||(e[r]=new nn),t[r])})),e}let gn;try{gn={indexedDB:g.indexedDB||g.mozIndexedDB||g.webkitIndexedDB||g.msIndexedDB,IDBKeyRange:g.IDBKeyRange||g.webkitIDBKeyRange}}catch(g){gn={indexedDB:null,IDBKeyRange:null}}const mn=hn;function yn(e){let t=vn;try{vn=!0,Tr.storagemutated.fire(e)}finally{vn=t}}A(mn,{...ge,delete:e=>new mn(e,{addons:[]}).delete(),exists:e=>new mn(e,{addons:[]}).open().then((e=>(e.close(),!0))).catch("NoSuchDatabaseError",(()=>!1)),getDatabaseNames(e){try{return function({indexedDB:e,IDBKeyRange:t}){return Wr(e)?Promise.resolve(e.databases()).then((e=>e.map((e=>e.name)).filter((e=>e!==Mt)))):Gr(e,t).toCollection().primaryKeys()}(mn.dependencies).then(e)}catch(e){return St(new fe.MissingAPI)}},defineClass:()=>function(e){v(this,e)},ignoreTransaction:e=>Ge.trans?qt(Ge.transless,e):e(),vip:Hr,async:function(e){return function(){try{var t=Vr(e.apply(this,arguments));return t&&"function"==typeof t.then?t:Ve.resolve(t)}catch(e){return St(e)}}},spawn:function(e,t,r){try{var n=Vr(e.apply(r,t||[]));return n&&"function"==typeof n.then?n:Ve.resolve(n)}catch(e){return St(e)}},currentTransaction:{get:()=>Ge.trans||null},waitFor:function(e,t){const r=Ve.resolve("function"==typeof e?mn.ignoreTransaction(e):e).timeout(t||6e4);return Ge.trans?Ge.trans.waitFor(r):r},Promise:Ve,debug:{get:()=>Y,set:e=>{Z(e,"dexie"===e?()=>!0:Nt)}},derive:U,extend:v,props:A,override:P,Events:Jt,on:Tr,liveQuery:function(e){let t,r=!1;const n=new fn((n=>{const s=Q(e);let i=!1,o={},a={};const u={get closed(){return i},unsubscribe:()=>{i=!0,Tr.storagemutated.unsubscribe(p)}};n.start&&n.start(u);let c=!1,l=!1;function h(){return m(a).some((e=>o[e]&&function(e,t){const r=an(t);let n=r.next();if(n.done)return!1;let s=n.value;const i=an(e);let o=i.next(s.from),a=o.value;for(;!n.done&&!o.done;){if(nr(a.from,s.to)<=0&&nr(a.to,s.from)>=0)return!0;nr(s.from,a.from)<0?s=(n=r.next(a.from)).value:a=(o=i.next(s.from)).value}return!1}(o[e],a[e])))}const p=e=>{dn(o,e),h()&&f()},f=()=>{if(c||i)return;o={};const d={},g=function(t){s&&mt();const r=()=>gt(e,{subscr:t,trans:null}),n=Ge.trans?qt(Ge.transless,r):r();return s&&n.then(yt,yt),n}(d);l||(Tr(br,p),l=!0),c=!0,Promise.resolve(g).then((e=>{r=!0,t=e,c=!1,i||(h()?f():(o={},a=d,n.next&&n.next(e)))}),(e=>{c=!1,r=!1,n.error&&n.error(e),u.unsubscribe()}))};return f(),u}));return n.hasValue=()=>r,n.getValue=()=>t,n},extendObservabilitySet:dn,getByKeyPath:C,setByKeyPath:I,delByKeyPath:function(e,t){"string"==typeof t?I(e,t,void 0):"length"in t&&[].map.call(t,(function(t){I(e,t,void 0)}))},shallowClone:R,deepClone:F,getObjectDiff:Yr,cmp:nr,asap:O,minKey:Dt,addons:[],connections:Rt,errnames:he,dependencies:gn,semVer:Et,version:Et.split(".").map((e=>parseInt(e))).reduce(((e,t,r)=>e+t/Math.pow(10,2*r)))}),mn.maxKey=kr(mn.dependencies.IDBKeyRange),"undefined"!=typeof dispatchEvent&&"undefined"!=typeof addEventListener&&(Tr(br,(e=>{if(!vn){let t;Bt?(t=document.createEvent("CustomEvent"),t.initCustomEvent(wr,!0,!0,e)):t=new CustomEvent(wr,{detail:e}),vn=!0,dispatchEvent(t),vn=!1}})),addEventListener(wr,(({detail:e})=>{vn||yn(e)})));let vn=!1;if("undefined"!=typeof BroadcastChannel){const e=new BroadcastChannel(wr);"function"==typeof e.unref&&e.unref(),Tr(br,(t=>{vn||e.postMessage(t)})),e.onmessage=e=>{e.data&&yn(e.data)}}else if("undefined"!=typeof self&&"undefined"!=typeof navigator){Tr(br,(e=>{try{vn||("undefined"!=typeof localStorage&&localStorage.setItem(wr,JSON.stringify({trig:Math.random(),changedParts:e})),"object"==typeof self.clients&&[...self.clients.matchAll({includeUncontrolled:!0})].forEach((t=>t.postMessage({type:wr,changedParts:e}))))}catch(e){}})),"undefined"!=typeof addEventListener&&addEventListener("storage",(e=>{if(e.key===wr){const t=JSON.parse(e.newValue);t&&yn(t.changedParts)}}));const e=self.document&&navigator.serviceWorker;e&&e.addEventListener("message",(function({data:e}){e&&e.type===wr&&yn(e.changedParts)}))}function bn(e){return bn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},bn(e)}function wn(){wn=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,s=Object.defineProperty||function(e,t,r){e[t]=r.value},i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function c(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,r){return e[t]=r}}function l(e,t,r,n){var i=t&&t.prototype instanceof y?t:y,o=Object.create(i.prototype),a=new P(n||[]);return s(o,"_invoke",{value:k(e,r,a)}),o}function h(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=l;var p="suspendedStart",f="suspendedYield",d="executing",g="completed",m={};function y(){}function v(){}function b(){}var w={};c(w,o,(function(){return this}));var T=Object.getPrototypeOf,A=T&&T(T(E([])));A&&A!==r&&n.call(A,o)&&(w=A);var q=b.prototype=y.prototype=Object.create(w);function _(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function U(e,t){function r(s,i,o,a){var u=h(e[s],e,i);if("throw"!==u.type){var c=u.arg,l=c.value;return l&&"object"==bn(l)&&n.call(l,"__await")?t.resolve(l.__await).then((function(e){r("next",e,o,a)}),(function(e){r("throw",e,o,a)})):t.resolve(l).then((function(e){c.value=e,o(c)}),(function(e){return r("throw",e,o,a)}))}a(u.arg)}var i;s(this,"_invoke",{value:function(e,n){function s(){return new t((function(t,s){r(e,n,t,s)}))}return i=i?i.then(s,s):s()}})}function k(t,r,n){var s=p;return function(i,o){if(s===d)throw new Error("Generator is already running");if(s===g){if("throw"===i)throw o;return{value:e,done:!0}}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var u=j(a,n);if(u){if(u===m)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(s===p)throw s=g,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);s=d;var c=h(t,r,n);if("normal"===c.type){if(s=n.done?g:f,c.arg===m)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(s=g,n.method="throw",n.arg=c.arg)}}}function j(t,r){var n=r.method,s=t.iterator[n];if(s===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,j(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var i=h(s,t.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,m;var o=i.arg;return o?o.done?(r[t.resultName]=o.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,m):o:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function x(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function S(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function P(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(x,this),this.reset(!0)}function E(t){if(t||""===t){var r=t[o];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var s=-1,i=function r(){for(;++s<t.length;)if(n.call(t,s))return r.value=t[s],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}throw new TypeError(bn(t)+" is not iterable")}return v.prototype=b,s(q,"constructor",{value:b,configurable:!0}),s(b,"constructor",{value:v,configurable:!0}),v.displayName=c(b,u,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===v||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,b):(e.__proto__=b,c(e,u,"GeneratorFunction")),e.prototype=Object.create(q),e},t.awrap=function(e){return{__await:e}},_(U.prototype),c(U.prototype,a,(function(){return this})),t.AsyncIterator=U,t.async=function(e,r,n,s,i){void 0===i&&(i=Promise);var o=new U(l(e,r,n,s),i);return t.isGeneratorFunction(r)?o:o.next().then((function(e){return e.done?e.value:o.next()}))},_(q),c(q,u,"Generator"),c(q,o,(function(){return this})),c(q,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=E,P.prototype={constructor:P,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(S),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function s(n,s){return a.type="throw",a.arg=t,r.next=n,s&&(r.method="next",r.arg=e),!!s}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return s("end");if(o.tryLoc<=this.prev){var u=n.call(o,"catchLoc"),c=n.call(o,"finallyLoc");if(u&&c){if(this.prev<o.catchLoc)return s(o.catchLoc,!0);if(this.prev<o.finallyLoc)return s(o.finallyLoc)}else if(u){if(this.prev<o.catchLoc)return s(o.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return s(o.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var s=this.tryEntries[r];if(s.tryLoc<=this.prev&&n.call(s,"finallyLoc")&&this.prev<s.finallyLoc){var i=s;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var o=i?i.completion:{};return o.type=e,o.arg=t,i?(this.method="next",this.next=i.finallyLoc,m):this.complete(o)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),m},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),S(r),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var s=n.arg;S(r)}return s}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:E(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),m}},t}function Tn(e,t,r,n,s,i,o){try{var a=e[i](o),u=a.value}catch(e){return void r(e)}a.done?t(u):Promise.resolve(u).then(n,s)}function An(e){return function(){var t=this,r=arguments;return new Promise((function(n,s){var i=e.apply(t,r);function o(e){Tn(i,n,s,o,a,"next",e)}function a(e){Tn(i,n,s,o,a,"throw",e)}o(void 0)}))}}Ve.rejectionMapper=function(e,t){if(!e||e instanceof ae||e instanceof TypeError||e instanceof SyntaxError||!e.name||!de[e.name])return e;var r=new de[e.name](t||e.message,e);return"stack"in e&&_(r,"stack",{get:function(){return this.inner.stack}}),r},Z(Y,Nt);var qn=function(){var e=new hn("IDBCache",{autoOpen:!1});this._detectIE=function(){var e=window.navigator.userAgent,t=e.indexOf("MSIE ");if(t>0)return parseInt(e.substring(t+5,e.indexOf(".",t)),10);if(e.indexOf("Trident/")>0){var r=e.indexOf("rv:");return parseInt(e.substring(r+3,e.indexOf(".",r)),10)}var n=e.indexOf("Edge/");return n>0&&parseInt(e.substring(n+5,e.indexOf(".",n)),10)},this._detectSafari=function(){if(navigator.userAgent.match(/Safari/i)&&!1==!navigator.userAgent.match(/Chrome/i))return!1;var e=navigator.userAgent.toLowerCase();return(e=e.substring(e.indexOf("version/")+8)).substring(0,e.indexOf("."))},this.isSupported=function(){var e=window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB,t=window.IDBKeyRange||window.webkitIDBKeyRange,r=window.IDBCursor||window.webkitIDBCursor,n=this._detectIE(),s=this._detectSafari(),i=!1!==n&&n<11,o=!1!==s&&s<10,a=!!navigator.userAgent.match(/iPad|iPhone|iPod/i);return navigator.userAgent.match(/PhantomJS/i)?e&&t&&r:e&&t&&r&&!i&&!a&&!o},this.addResponse=function(t,r,n,s){return e.responseTable.put({etag:n,data:r,timestamp:$.now(),chunks:s?parseInt(s,10):null},t)},this.getResponse=function(t){return e.responseTable.get(t)},this.addBatchResponse=function(t,r,n,s){return e.batchedResponseTable.put({id:t+r,batch:r,data:n,timestamp:$.now(),chunks:s?parseInt(s,10):null})},this.getBatchResponse=function(t,r){return e.batchedResponseTable.get(t+r)},this.deleteBatchResponses=function(t){return e.batchedResponseTable.where("batch").equals(t).delete()},this.clear=function(){return Promise.all([e.responseTable.clear(),e.batchedResponseTable.clear()])},this.clearResponseTable=function(){return Promise.all([e.responseTable.clear()])},this.initDB=function(){return e.version(.1).stores({responseTable:""}),e.version(.2).stores({batchResponseTable:"&[id+batch],batch"}),e.version(.3).stores({batchedResponseTable:"id,batch",batchResponseTable:null}),e.version(.4).stores({batchedResponseTable:"id,batch"}).upgrade((function(e){e.batchedResponseTable.filter((function(e){return e.id.includes("objects")&&e.id.includes("topology")&&e.id.includes("shortinfo")})).delete()})),e.version(.5).stores({batchedResponseTable:"id,batch"}).upgrade((function(e){e.batchedResponseTable.filter((function(e){return e.id.includes("objects")&&e.id.includes("topology")&&e.id.includes("shortinfo")})).delete()})),e.open()},this.deleteDB=function(){return e.delete()},this.close=function(){return e.close()},this.isOpen=function(){return e.isOpen()},this.dumpTableContent=function(){var e=An(wn().mark((function e(t){var r,n;return wn().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=function(e,t){var r,n;return"timestamp"===e?null!==(r=window)&&void 0!==r&&r.BIMPLUS_SDK_ENABLE_IDBCACHE_TIMESTAMP_DUMP?t:"NOT SHOWN":"data"===e?null!==(n=window)&&void 0!==n&&n.BIMPLUS_SDK_ENABLE_IDBCACHE_DATA_DUMP?t:"NOT SHOWN":t},n="",e.next=4,t.each((function(e){n+=" ".concat(JSON.stringify(e,r),"\n")}));case 4:return e.abrupt("return",n);case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),this.dumpTable=function(){var e=An(wn().mark((function e(t){var r,n,s,i;return wn().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.toCollection().count();case 2:return r=e.sent,n=[t.schema.primKey].concat(t.schema.indexes),s=n.map((function(e){return e.src})).join(","),i="Table: ".concat(t.name,", Schema: '").concat(s,"', Count of entries: ").concat(r,"\n"),e.t0=i,e.next=9,this.dumpTableContent(t);case 9:return i=e.t0+=e.sent,e.abrupt("return",i);case 11:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),this.dumpDatabase=An(wn().mark((function t(){var r;return wn().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r="",r+="BimWebSdk: Dexie Databases Dump\n",r+="===============================\n",r+="Database: ".concat(e.name," (Version: ").concat(e.verno,")\n"),t.t0=r,t.next=7,this.dumpTable(e.responseTable);case 7:return r=t.t0+=t.sent,t.t1=r,t.next=11,this.dumpTable(e.batchedResponseTable);case 11:return r=t.t1+=t.sent,t.abrupt("return",r);case 13:case"end":return t.stop()}}),t,this)})))},_n=function(){var e=null,t=null,r=new qn;r.initDB().then((function(){window.BIMPLUS_SDK_ENABLE_IDBCACHE_DUMP&&r.dumpDatabase().then((function(e){console.log(e)}))})).catch((function(e){console.error("BimWebSdk indexedDB initialization error : "+e.stack||0)})),this.setAccessToken=function(t){e=t},this.setTokenType=function(e){t=e},this.getCache=function(){return r};var n=function(e,t,n){var s=n.getResponseHeader("ETag"),i=n.getResponseHeader("X-Total-Count"),o="arraybuffer"===n.responseType;if(s){var a=!1===o?JSON.stringify(t):null;r.addResponse(e,o?t:JSON.parse(a),s,i).then((function(){})).catch((function(t){console.error("BimWebSdk failed to add response to cache: "+e+" Reason: "+t.message)}))}},s=function(e){return"W"===e.charAt(0)?e.substring(2):e};this.getBatchResponse=function(e,t,n){var s=$.Deferred(),a=n.useXMLHttpRequest?o:i;return r.getBatchResponse(e,t).then((function(i){if(i){var o={};null!==i.chunks&&(o["Cached-X-Total-Count"]=i.chunks),o.status=304,s.resolve(i.data,304,o)}else a(e,"GET",null,n).done((function(n,i,o){var a=o.getResponseHeader("X-Total-Count"),u="arraybuffer"===o.responseType,c=!1===u?JSON.stringify(n):null;r.addBatchResponse(e,t,u?n:JSON.parse(c),a).then((function(){})).catch((function(t){console.error("BimWebSdk failed to add response to cache: "+e+" Reason: "+t.message)})),s.resolve(n,i,o)})).fail((function(e,t){s.reject(e,t)}))})),s.promise()},this.get=function(u,c){if(c||(c={}),c.token||(c.token=e),c.tokenType&&c.tokenType===t||(c.tokenType=t),c.queryParams&&(u+=a(c.queryParams)),c.responseBatch)return this.getBatchResponse(u,c.responseBatch,c);var l=$.Deferred(),h=c.useXMLHttpRequest?o:i;return r.getResponse("GET;"+u).then((function(e){if(e){var t=s(e.etag);c.eTag=t,h(u,"GET",null,c).done((function(t,r,s){304===s.status?(null!==e.chunks&&(s["Cached-X-Total-Count"]=e.chunks),l.resolve(e.data,r,s)):(n("GET;"+u,t,s),l.resolve(t,r,s))})).fail((function(e,t){l.reject(e,t)}))}else h(u,"GET",null,c).done((function(e,t,r){n("GET;"+u,e,r),l.resolve(e,t,r)})).fail((function(e,t){l.reject(e,t)}))})).catch((function(){h(u,"GET",null,c).done((function(e,t,r){n("GET;"+u,e,r),l.resolve(e,t,r)})).fail((function(e,t){l.reject(e,t)}))})),l.promise()},this.getChunked=function(t,r){return u(this,e,"medium",t,r)},this.put=function(r,n,s){return s||(s={}),s.token||(s.token=e),s.tokenType&&s.tokenType===t||(s.tokenType=t),s.queryParams&&(r+=a(s.queryParams)),i(r,"PUT",n,s)},this.post=function(r,n,s){return s||(s={}),s.token||(s.token=e),s.tokenType&&s.tokenType===t||(s.tokenType=t),s.queryParams&&(r+=a(s.queryParams)),(s.useXMLHttpRequest?o:i)(r,"POST",n,s)},this.del=function(r,n,s){return s||(s={}),n||(s.contentType=null),s.dataType=null,s.token||(s.token=e),s.tokenType&&s.tokenType===t||(s.tokenType=t),s.queryParams&&(r+=a(s.queryParams)),i(r,"DELETE",n||null,s)},this.head=function(o,u){u||(u={}),u.contentType="",u.dataType="",u.token||(u.token=e),u.tokenType&&u.tokenType===t||(u.tokenType=t),u.queryParams&&(o+=a(u.queryParams));var c=$.Deferred();return r.getResponse("HEAD;"+o).then((function(e){if(e){var t=s(e.etag);u.eTag=t,i(o,"HEAD",null,u).done((function(e,t,r){304===r.status?c.resolve(!0,t,r):(n("HEAD;"+o,null,r),c.resolve(!1,t,r))})).fail((function(e,t){c.reject(e,t)}))}else i(o,"HEAD",null,u).done((function(e,t,r){n("HEAD;"+o,null,r),c.resolve(!1,t,r)})).fail((function(e,t){c.reject(!1,t)}))})).catch((function(){i(o,"HEAD",null,u).done((function(e,t,r){n("HEAD;"+o,null,r),c.resolve(!1,t,r)})).fail((function(e,t){c.reject(!1,t)}))})),c.promise()}},Un=function(e){this.detectAllClashes=function(t){return e.request.post(e.getApiTeamUrl()+"services/postprocess",t)},this.detectDisciplinesClashes=function(t){return e.request.post(e.getApiTeamUrl()+"clashdetection",t)},this.getFilters=function(t,r){var n={queryParams:{customFilter:r}};return t?e.request.get(e.getApiTeamUrl()+"clashdetection/filters/"+t,r?n:null):e.request.get(e.getApiTeamUrl()+"clashdetection/filters",r?n:null)},this.calculateClashes=function(t,r,n){if(r||n){var s={queryParams:{}};return r&&(s.queryParams.topology=r),n&&(s.queryParams.clashElements=n),e.request.post(e.getApiTeamUrl()+"clashdetection/filters",t,s)}return e.request.post(e.getApiTeamUrl()+"clashdetection/filters",t)},this.getFilterResults=function(t,r,n,s){if(n||s){var i={queryParams:{}};return n&&(i.queryParams.topology=n),s&&(i.queryParams.clashElements=s),r?e.request.get(e.getApiTeamUrl()+"clashdetection/projects/"+t+"/filters/"+r,i):e.request.get(e.getApiTeamUrl()+"clashdetection/projects/"+t+"/filters",i)}return r?e.request.get(e.getApiTeamUrl()+"clashdetection/projects/"+t+"/filters/"+r):e.request.get(e.getApiTeamUrl()+"clashdetection/projects/"+t+"/filters")},this.createClashRule=function(t,r){return e.request.post(e.getApiTeamUrl()+"projects/"+t+"/clashfilters",JSON.stringify(r))},this.deleteClashRule=function(t,r){var n={queryParams:{force:r}};return e.request.del(e.getApiTeamUrl()+"clashfilters/"+t,null,r?n:null)},this.updateClashRule=function(t,r){return e.request.put(e.getApiTeamUrl()+"clashfilters/"+t,JSON.stringify(r))},this.getAllClashRules=function(t,r){var n={queryParams:{customFilter:r}};return e.request.get(e.getApiTeamUrl()+"projects/"+t+"/clashfilters",r?n:null)}},kn=function(e){this.post=function(t){var r=[{message:t}];return e.request.post(e.getApiTeamUrl()+"clientlogs",JSON.stringify(r))},this.postExtended=function(t,r,n,s){var i=[{message:t,applicationclass:r,releaseversion:n,projectid:s}];return e.request.post(e.getApiTeamUrl()+"clientlogs",JSON.stringify(i))},this.postArray=function(t){return e.request.post(e.getApiTeamUrl()+"clientlogs",JSON.stringify(t))},this.get=function(){return e.request.get(e.getApiTeamUrl()+"clientlogs")}},jn=function(e){this.get=function(t){return e.request.get(e.getApiTeamUrl()+"comments/"+t)},this.delete=function(t){return e.request.del(e.getApiTeamUrl()+"comments/"+t)},this.put=function(t,r){return e.request.put(e.getApiTeamUrl()+"comments/"+t,r)}},xn=function(e){this.get=function(t,r,n){var s="".concat(e.getApiTeamUrl(),"objects/").concat(t,"/customtables");r&&(s+="?variantId=".concat(r));var i={};return n&&(i.queryParams={revision:n}),e.request.get(s,n?i:void 0)},this.post=function(t,r){return e.request.post("".concat(e.getApiTeamUrl(),"objects/").concat(t,"/customtables"),r)},this.exportTable=function(t,r){return e.request.post("".concat(e.getApiTeamUrl(),"customtables/").concat(t,"/export/excel"),r)},this.deleteAllTables=function(t){return e.request.del("".concat(e.getApiTeamUrl(),"objects/").concat(t,"/customtables"))},this.deleteTable=function(t){return e.request.del("".concat(e.getApiTeamUrl(),"customtables/").concat(t))}},Sn=function(e){this.get=function(t){return e.request.get(e.getApiTeamUrl()+"dimensionlines/"+t)},this.delete=function(t){return e.request.del(e.getApiTeamUrl()+"dimensionlines/"+t)},this.put=function(t,r){return e.request.put(e.getApiTeamUrl()+"dimensionlines/"+t,r)}},Pn=function(e){this.get=function(t){return t?e.request.get(e.getApiTeamUrl()+"element-types/"+t):e.request.get(e.getApiTeamUrl()+"element-types")},this.getDisciplines=function(t){return t?e.request.get(e.getApiTeamUrl()+"element-types/disciplines/"+t):e.request.get(e.getApiTeamUrl()+"element-types/disciplines")},this.getAttributeTemplates=function(t,r){return t?e.request.get(e.getApiTeamUrl()+"element-types/"+t+"/attributetemplates",r?{queryParams:r}:void 0):e.request.get(e.getApiTeamUrl()+"element-types/attributetemplates",r?{queryParams:r}:void 0)},this.getTopology=function(){return e.request.get(e.getApiTeamUrl()+"element-types/topology")},this.getProjectTopology=function(t){return e.request.get(e.getApiTeamUrl()+"projects/"+t+"/element-types")}},En=function(e){this.exportObjects=function(t,r){return e.request.get(e.getApiTeamUrl()+"projects/"+t+"/objects/export/excel?typeId="+r)},this.exportModel=function(t,r,n,s,i,o){var a={};return n&&(a.revision=n),s&&(a.emptyPropExport=1),i&&(a.propSetExport=1),o&&(a.temporary="true"),e.request.post("".concat(e.getApiTeamUrl(),"projects/").concat(t,"/model/").concat(r,"/exportasync"),null,{queryParams:a,contentType:!1,processData:!1,dataType:null})},this.exportSelection=function(t,r,n,s){var i={};return r&&(i.emptyPropExport=r),n&&(i.propSetExport=n),s&&(i.temporary="true"),e.request.post("".concat(e.getApiTeamUrl(),"selections/").concat(t,"/exportasync"),null,{queryParams:i})},this.createExportSelection=function(t,r){return e.request.post("".concat(e.getApiTeamUrl(),"projects/").concat(t,"/exportobjects"),r)}},On=function(e){this.getAccessRights=function(t){return e.request.get(e.getApiTeamUrl()+"folders/"+t+"/rights")},this.setMemberAccessRights=function(t,r,n){return e.request.put(e.getApiTeamUrl()+"folders/"+t+"/rights?assignrecursive="+(n?"true":"false"),r)},this.setMembersAccessRights=function(t,r,n){return e.request.put(e.getApiTeamUrl()+"folders/"+t+"/usersrights?assignrecursive="+(n?"true":"false"),r)}},Dn=function(e){var t=function(t){return t?e.getApiUrl()+"content/freeattributegroups/":e.getApiTeamUrl()+"freeattributegroups/"};this.post=function(r,n){return e.request.post(t(n),r)},this.get=function(r,n){return r?e.request.get(t(n)+r):e.request.get(t(n))},this.put=function(r,n,s){return e.request.put(t(s)+r,n)},this.delete=function(r,n){return e.request.del(t(n)+r)},this.getFreeAttributes=function(r,n){return e.request.get(t(n)+r+"/freeattributes")}},Cn=function(e){var t=function(t){return t?e.getApiUrl()+"content/freeattributes/":e.getApiTeamUrl()+"freeattributes/"};this.post=function(r,n){return e.request.post(t(n),r)},this.get=function(r,n,s){return r?e.request.get(t(n)+r,s?{queryParams:s}:void 0):e.request.get(t(n),s?{queryParams:s}:void 0)},this.put=function(r,n,s){return e.request.put(t(s)+r,n)},this.delete=function(r,n){return e.request.del(t(n)+r)},this.getTopology=function(r){return e.request.get(t(r)+"?topology=true")},this.getFilteredAttributes=function(t,r,n){var s=e.getApiTeamUrl();return t&&(s+="projects/".concat(t,"/")),s+="attributes?",r&&(s+="layer=".concat(r,"&")),n&&(s+="type=".concat(n)),e.request.get(s)}},In=function(e){this.calculate=function(t,r,n,s,i){var o={hiddenCalculation:{projectId:t,calculationMode:"View",view:r,clippingPlanes:n,clipRegion:{clipFace:!1},light:{useLight:!0,elevationAngle:45,sideAngle:60,useShadows:!1},propertySettings:{faceMode:"Filling",calcLines:!0},responseSettings:{mode:"Svg",svgHeight:390,svgWidth:500,fileName:s},sectionSettings:{}},runAsync:i};return e.request.post(e.getApiTeamUrl()+"services/Hiddencalculation",JSON.stringify(o))}},Rn=function(e){this.get=function(t){return e.request.get(e.getApiTeamUrl()+"hyperlinks/"+t)},this.delete=function(t){return e.request.del(e.getApiTeamUrl()+"hyperlinks/"+t)},this.put=function(t,r){return e.request.put(e.getApiTeamUrl()+"hyperlinks/"+t,r)}},Bn=function(e){this.postModel=function(t,r,n,s,i){return"replaceModelData"===i?e.request.post(e.getApiTeamUrl()+"projects/"+t+"/model/"+r+"/importasync?replaceModelData=true",n,{preparedData:n,contentType:!1,processData:!1,dataType:null,xhrUploadProgress:s}):e.request.post(e.getApiTeamUrl()+"projects/"+t+"/model/"+r+"/importasync",n,{preparedData:n,contentType:!1,processData:!1,dataType:null,xhrUploadProgress:s})}},Kn=function(e){this.post=function(t,r){return e.request.post(e.getApiTeamUrl()+"projects/"+t+"/issues",r)},this.get=function(t){return e.request.get(e.getApiTeamUrl()+"issues/"+t)},this.postPin=function(t,r){return e.request.post(e.getApiTeamUrl()+"issues/"+t+"/pins",r)},this.getPins=function(t){return e.request.get(e.getApiTeamUrl()+"issues/"+t+"/pins")},this.deletePins=function(t){return e.request.del(e.getApiTeamUrl()+"issues/"+t+"/pins")},this.postComment=function(t,r){return e.request.post(e.getApiTeamUrl()+"issues/"+t+"/comments",r)},this.getComments=function(t){return e.request.get(e.getApiTeamUrl()+"issues/"+t+"/comments")},this.deleteComments=function(t){return e.request.del(e.getApiTeamUrl()+"issues/"+t+"/comments")},this.postAttachment=function(t,r){return e.request.post(e.getApiTeamUrl()+"issues/"+t+"/attachments",r)},this.getAttachments=function(t){return e.request.get(e.getApiTeamUrl()+"issues/"+t+"/attachments")},this.deleteAttachments=function(t){return e.request.del(e.getApiTeamUrl()+"issues/"+t+"/attachments")},this.put=function(t,r,n){return e.request.put(e.getApiTeamUrl()+"issues/"+t,r,n?{queryParams:n}:void 0)},this.delete=function(t,r){var n={queryParams:{forceDelete:r}};return e.request.del(e.getApiTeamUrl()+"issues/"+t,null,r?n:null)},this.getRights=function(t){return e.request.get(e.getApiTeamUrl()+"issues/"+t+"/rights")},this.getIssueTypes=function(){return e.request.get(e.getApiTeamUrl()+"lib/issuetypes")},this.getReports=function(t){return e.request.get(e.getApiTeamUrl()+"issues/"+t+"/reports")},this.importBcf=function(t,r){return e.request.put(e.getApiTeamUrl()+"projects/"+t+"/issues/bcf",r,{contentType:!1,processData:!1})},this.updateImportBcf=function(t,r){return e.request.put(e.getApiTeamUrl()+"projects/"+t+"/issues/bcf",r)},this.exportBcf=function(t,r,n){return t?e.request.post(e.getApiTeamUrl()+"projects/"+t+"/issues/export/bcf"+(n?"?version="+n:""),r):e.request.post(e.getApiTeamUrl()+"issues/export/bcf"+(n?"?version="+n:""),r)},this.exportExcel=function(t,r){return t?e.request.post(e.getApiTeamUrl()+"projects/"+t+"/issues/export/excel",r):e.request.post(e.getApiTeamUrl()+"issues/export/excel",r)}},Ln=function(e){this.get=function(t){return e.request.get(e.getApiTeamUrl()+"labels/"+t)},this.delete=function(t){return e.request.del(e.getApiTeamUrl()+"labels/"+t)},this.put=function(t,r){return e.request.put(e.getApiTeamUrl()+"labels/"+t,r)}},Nn=function(e){this.lockObject=function(t,r){return e.request.put(e.getApiTeamUrl()+"objects/"+t+"/locks",r,{dataType:"text"})},this.checkLocked=function(t){return e.request.get(e.getApiTeamUrl()+"objects/"+t+"/locks")},this.deleteLock=function(t,r){return!0===r?e.request.del(e.getApiTeamUrl()+"objects/"+t+"/locks?asAdmin=true"):e.request.del(e.getApiTeamUrl()+"objects/"+t+"/locks")},this.getLocksWithChildren=function(t){return e.request.get(e.getApiTeamUrl()+"objects/"+t+"/locks?withChildren=true")}},Mn=function(e){this.post=function(t){return e.request.post(e.getApiTeamUrl()+"members",t)},this.get=function(){return e.request.get(e.getApiTeamUrl()+"members")},this.putUser=function(t,r,n){return e.request.put(e.getApiTeamUrl()+"members/"+r,n)},this.deleteUser=function(t,r){return e.request.del(e.getApiTeamUrl()+"members/"+r)}},Fn=function(e){this.post=function(t){return e.request.post(e.getApiUrl()+"messages",t)},this.getUserMessages=function(t){return e.request.get(e.getApiUrl()+"user/"+t+"/messages")},this.getUserDashboardMessages=function(t){return e.request.get(e.getApiUrl()+"user/"+t+"/messages?topic=dashboard")},this.getSentUserMessages=function(t){return e.request.get(e.getApiUrl()+"user/"+t+"/messages/sent")},this.getSentGroupMessages=function(t){return e.request.get(e.getApiUrl()+"user/"+t+"/messages/groupsent")},this.get=function(t){return e.request.get(e.getApiUrl()+"messages/"+t)},this.getFiltered=function(t){return e.request.get(e.getApiUrl()+"messages/",{queryParams:{filter:t}})},this.deleteMessage=function(t){return e.request.del(e.getApiUrl()+"messages/"+t)},this.markAsRead=function(t){return e.request.post(e.getApiUrl()+"messages/"+t+"/markasreadbrowser",null,{dataType:null,contentType:null})},this.updateDashboardAdditionalData=function(t,r){return e.request.put(e.getApiUrl()+"messages/"+t+"/updatedashboardadditionaldata",r)},this.addDashboardMessageAttachment=function(t,r,n){return e.request.put(e.getApiUrl()+"messages/"+t+"/upload?type=dashboard",r,n)},this.getAllMessagingGroups=function(){return e.request.get(e.getApiUrl()+"systemgroups")},this.getMessagingGroupsDetails=function(t){return e.request.get(e.getApiUrl()+"systemgroups/"+t)}},Gn=function(e){this.get=function(t){return t?e.request.get(e.getApiTeamUrl()+"divisions/"+t):e.request.get(e.getApiTeamUrl()+"divisions")},this.head=function(t){return e.request.head?e.request.head(e.getApiTeamUrl()+"divisions/"+t):(console.warn("BimWebSdk: request (divisions/".concat(t,") does not support head method!")),Promise.resolve(!1))},this.getDisciplines=function(t){return e.request.get(e.getApiTeamUrl()+"divisions/"+t+"/disciplines")},this.setDisciplineValidity=function(t,r,n){var s={private:!n};return e.request.put(e.getApiTeamUrl()+"divisions/"+t+"/disciplines/"+r,JSON.stringify(s))},this.getRevisions=function(t){return e.request.get(e.getApiTeamUrl()+"divisions/"+t+"/revisions")},this.getAllRevisions=function(t){return e.request.get(e.getApiTeamUrl()+"projects/"+t+"/revisions")},this.postRevision=function(t,r){return e.request.post(e.getApiTeamUrl()+"divisions/"+t+"/revisions",r)},this.put=function(t,r){return e.request.put(e.getApiTeamUrl()+"divisions/"+t,r)},this.download=function(t){return e.request.get(e.getApiTeamUrl()+"divisions/"+t+"/download")},this.delete=function(t){return e.request.del(e.getApiTeamUrl()+"divisions/"+t)},this.move=function(t,r){return e.request.put(e.getApiTeamUrl()+"divisions/"+t+"/move",r)}},Wn=["topology","structure"],Hn=function(e){this.get=function(t,r){var n={};return t&&(n.object_id=t),r&&(n.project_id=r),e.request.get(e.getApiTeamUrl()+"settings/filters",{queryParams:n})},this.getFilteredObjects=function(t,r,n,s){if(n)return e.request.get(e.getApiTeamUrl()+"projects/"+t+"/filters/"+r+"/properties",{queryParams:n});if(s&&Wn.find((function(e){return e===s}))){var i={};return i[s]=!0,e.request.get(e.getApiTeamUrl()+"projects/"+t+"/filters/"+r,{queryParams:i})}return e.request.get(e.getApiTeamUrl()+"projects/"+t+"/filters/"+r)},this.getSelectionFilteredObjects=function(t,r,n,s){if(n)return e.request.get(e.getApiTeamUrl()+"selections/"+t+"/filters/"+r+"/properties",{queryParams:n});if(s&&Wn.find((function(e){return e===s}))){var i={};return i[s]=!0,e.request.get(e.getApiTeamUrl()+"selections/"+t+"/filters/"+r,{queryParams:i})}return e.request.get(e.getApiTeamUrl()+"selections/"+t+"/filters/"+r)},this.applyFilter=function(t){return e.request.get(e.getApiTeamUrl()+"filters/"+t)},this.post=function(t,r){var n={};return r&&(n.project_id=r),e.request.post(e.getApiTeamUrl()+"settings/filter",t,{queryParams:n})},this.put=function(t){return e.request.put(e.getApiTeamUrl()+"settings/filter",t)},this.delete=function(t){return e.request.del(e.getApiTeamUrl()+"settings/filter/"+t)},this.getFilter=function(t){return e.request.get(e.getApiTeamUrl()+"settings/filters/"+t)}},$n=function(e){this.post=function(t){return e.request.post(e.getApiTeamUrl()+"objects/",t)},this.get=function(t,r,n,s,i,o){var a={};r&&(a.queryParams={revision:r}),s&&(a.queryParams?a.queryParams.projectId=s:a.queryParams={projectId:s}),i&&(a.queryParams?a.queryParams.shortinfo=i:a.queryParams={shortinfo:i}),o&&(a.queryParams?a.queryParams.type=o:a.queryParams={type:o});var u=e.getApiTeamUrl()+"objects/"+t;return n&&(u+="/properties/",u+=n),e.request.get(u,r||s||i||o?a:void 0)},this.getInternal=function(t,r){var n={};r&&(n.queryParams={revision:r});var s=e.getApiTeamUrl()+"objects/"+t;return s+="/internal",e.request.get(s,r?n:void 0)},this.head=function(t,r){var n={};return r&&(n.queryParams={revision:r}),e.request.head?e.request.head(e.getApiTeamUrl()+"objects/"+t,r?n:void 0):(console.warn("BimWebSdk: request (objects/".concat(t,") does not support head method! Using get as fallback.")),e.request.get(e.getApiTeamUrl()+"objects/"+t,r?n:void 0))},this.getTopology=function(t,r,n,s,i){var o={};return(r||n||s)&&(o.queryParams={},r&&(o.queryParams.revision=r),n&&(o.queryParams.hideElements=n),s&&(o.queryParams.shortinfo=s)),i&&(o.responseBatch=i),e.request.get(e.getApiTeamUrl()+"objects/"+t+"/topology",o)},this.getGeometryThreeJS=function(t,r,n,s,i,o,a,u){var c,l={};return null===s&&null===i&&null===u||(l.queryParams={},null!==s&&(l.queryParams.revision=s),null!==i&&(l.queryParams.levelofdetail=i),null!==u&&(l.queryParams.chunkSize=u)),a&&(l.responseBatch=a),c=r?e.getApiTeamUrl()+"objects/"+t+"/disciplines/"+r+"/geometries/threejs":e.getApiTeamUrl()+"objects/"+t+"/geometries/threejs",o&&(c+="/properties/",c+=o),n?e.request.getChunked(c,l):e.request.get(c,l)},this.getGeometryGLB=function(t,r,n,s,i,o,a,u,c){var l,h=arguments.length>9&&void 0!==arguments[9]?arguments[9]:void 0,p=arguments.length>10&&void 0!==arguments[10]?arguments[10]:void 0,f={};return f.dataType="binary",f.processData=!1,f.responseType="arraybuffer",f.useXMLHttpRequest=!0,void 0===n&&void 0===s&&void 0===i&&void 0===o&&void 0===a&&void 0===h&&void 0===p||(f.queryParams={},void 0!==n&&(f.queryParams.revision=n),void 0!==s&&(f.queryParams.levelofdetail=s),void 0!==i&&(f.queryParams.vertexNormals=i),void 0!==o&&(f.queryParams.smoothingAngle=o),void 0!==a&&(f.queryParams.topology=a),void 0!==h&&(f.queryParams.edges=h),void 0!==p&&(f.queryParams.version=p)),u&&(f.responseBatch=u),l=r?e.getApiTeamUrl()+"objects/"+t+"/disciplines/"+r+"/geometries/glb":e.getApiTeamUrl()+"objects/"+t+"/geometries/glb",c?e.request.getChunked(l,f):e.request.get(l,f)},this.getGLB=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;return this.getGeometryGLB(e,undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,t)},this.getGeometryTemplatesThreeJS=function(t,r,n,s,i,o){var a={};null===s&&null===i||(a.queryParams={},null!==s&&(a.queryParams.revision=s),null!==i&&(a.queryParams.levelofdetail=i)),o&&(a.responseBatch=o);var u=e.getApiTeamUrl()+"objects/"+t+"/disciplines/"+r+"/templates/threejs";return n?e.request.getChunked(u,a):e.request.get(u,a)},this.getGeometryCompressed=function(t,r){return r?e.request.get(e.getApiTeamUrl()+"objects/"+t+"/disciplines/"+r+"/geometries/meshblob"):e.request.get(e.getApiTeamUrl()+"objects/"+t+"/geometries/meshblob")},this.getProperties=function(t,r){return e.request.get(e.getApiTeamUrl()+"objects/"+t+"/geometries/threejs/properties"+r)},this.put=function(t,r,n){var s={};return n&&(s.projectid=n),e.request.put(e.getApiTeamUrl()+"objects/"+t,r,{queryParams:s})},this.postComment=function(t,r){return e.request.post(e.getApiTeamUrl()+"objects/"+t+"/comments",r)},this.getComments=function(t){return e.request.get(e.getApiTeamUrl()+"objects/"+t+"/comments")},this.deleteComments=function(t){return e.request.del(e.getApiTeamUrl()+"objects/"+t+"/comments")},this.postAttachment=function(t,r,n,s){return e.request.post(e.getApiTeamUrl()+"objects/"+t+"/attachments",r,{contentType:!1,processData:!1,dataType:null,xhrUploadProgress:n,queryParams:s?{DocumentFolderId:s}:void 0})},this.getAttachments=function(t,r){return e.request.get(e.getApiTeamUrl()+"objects/"+t+"/attachments",r?{queryParams:{revision:r}}:void 0)},this.deleteAttachments=function(t){return e.request.del(e.getApiTeamUrl()+"objects/"+t+"/attachments")},this.postAttachmentLink=function(t,r){return e.request.post(e.getApiTeamUrl()+"objects/"+t+"/attachmentlinks",r)},this.getAttachmentLinks=function(t){return e.request.get(e.getApiTeamUrl()+"objects/"+t+"/attachmentlinks")},this.deleteAttachmentLink=function(t,r){return e.request.del(e.getApiTeamUrl()+"objects/"+t+"/attachmentlinks/"+r)},this.postHyperlink=function(t,r){return e.request.post(e.getApiTeamUrl()+"objects/"+t+"/hyperlinks",r)},this.getHyperlinks=function(t){return e.request.get(e.getApiTeamUrl()+"objects/"+t+"/hyperlinks")},this.deleteHyperlinks=function(t){return e.request.del(e.getApiTeamUrl()+"objects/"+t+"/hyperlinks")},this.delete=function(t){return e.request.del(e.getApiTeamUrl()+"objects/"+t)},this.getAttributes=function(t,r,n,s){var i=r?"&documentversion="+r:"",o=s?"&revision="+s:"",a=n?"&projectid="+n:"",u=e.getApiTeamUrl()+"objects/"+t+"?freeattributes=true";return e.request.get(u+i+o+a)},this.getAttributesAsFlatStructure=function(t,r,n,s){var i=r?"&documentversion="+r:"",o=s?"&revision="+s:"",a=n?"&projectid="+n:"",u=e.getApiTeamUrl()+"objects/"+t+"?freeattributes=true&internal=true&attributedefinition=true";return e.request.get(u+i+o+a)},this.getAttributeValues=function(t,r){return e.request.get(e.getApiTeamUrl()+"objects/"+t+"/attributes/"+r+"?children=true")},this.getComplexPropertiesTopology=function(t,r){return e.request.get(e.getApiTeamUrl()+"objects/"+t+"/complexproperties"+(r>=0?"?revision="+r:""))},this.postThumbnail=function(t,r,n){return e.request.post(e.getApiTeamUrl()+"objects/"+t+"/thumbnail",r,{contentType:!1,processData:!1,dataType:null,xhrUploadProgress:n})},this.deleteThumbnail=function(t){return e.request.del(e.getApiTeamUrl()+"objects/"+t+"/thumbnail")},this.addChildObject=function(t){return e.request.post(e.getApiTeamUrl()+"objects/alter/",t)},this.getReports=function(t,r,n){return e.request.get(e.getApiTeamUrl()+"objects/"+t+"/reports?version="+r+"&action="+n)},this.exportExcelReports=function(t,r){return e.request.post(e.getApiTeamUrl()+"projects/"+t+"/reports/export/excel",r)},this.postDimensions=function(t,r){return e.request.post(e.getApiTeamUrl()+"objects/"+t+"/dimensionlines",r)},this.putDimensions=function(t,r){return e.request.put(e.getApiTeamUrl()+"objects/"+t+"/dimensionlines",r)},this.getDimensions=function(t){return e.request.get(e.getApiTeamUrl()+"objects/"+t+"/dimensionlines")},this.deleteDimensions=function(t){return e.request.del(e.getApiTeamUrl()+"objects/"+t+"/dimensionlines")},this.postLabels=function(t,r){return e.request.post(e.getApiTeamUrl()+"objects/"+t+"/labels",r)},this.putLabels=function(t,r){return e.request.put(e.getApiTeamUrl()+"objects/"+t+"/labels",r)},this.getLabels=function(t){return e.request.get(e.getApiTeamUrl()+"objects/"+t+"/labels")},this.deleteLabels=function(t){return e.request.del(e.getApiTeamUrl()+"objects/"+t+"/labels")},this.postAnnotations=function(t,r){return e.request.post(e.getApiTeamUrl()+"objects/"+t+"/annotations",r)},this.putAnnotations=function(t,r){return e.request.put(e.getApiTeamUrl()+"objects/"+t+"/annotations",r)},this.getAnnotations=function(t){return e.request.get(e.getApiTeamUrl()+"objects/"+t+"/annotations")},this.deleteAnnotations=function(t){return e.request.del(e.getApiTeamUrl()+"objects/"+t+"/annotations")},this.getObjectIdsByQuery=function(t,r,n,s){var i=Array.isArray(s)?s.join(","):void 0,o={queryParams:{}};return o.queryParams[r]=n,i&&(o.queryParams.divisions=i),e.request.get(e.getApiTeamUrl()+"objects/"+t+"/query",o)},this.getObjectIdsByIfcId=function(e,t,r){return this.getObjectIdsByQuery(e,"93027bad-df91-48ee-a0bb-60a8184cddba",t,r)},this.postOverlay=function(t){return e.request.post(e.getApiTeamUrl()+"objects/",t)},this.getOverlays=function(t){return e.request.get(e.getApiTeamUrl()+"objects/"+t+"/overlays")},this.getOverlay=function(e){return this.getInternal(e)},this.deleteOverlay=function(t){return e.request.del(e.getApiTeamUrl()+"objects/"+t)},this.deleteOverlays=function(t){return e.request.del(e.getApiTeamUrl()+"objects/"+t+"/overlays")},this.getThumbnail=function(t){var r=e.getApiTeamUrl()+"objects/"+t+"/thumbnail/download";return e.request.get(r,{useXMLHttpRequest:!0,dataType:"binary",processData:!1,responseType:"arraybuffer"})}},Vn=function(e){this.get=function(t){return e.request.get(e.getApiTeamUrl()+"overlays/"+t)},this.put=function(t,r){return e.request.put(e.getApiTeamUrl()+"overlays/"+t,r)},this.delete=function(t){return e.request.del(e.getApiTeamUrl()+"overlays/"+t)}},Jn=function(e){this.get=function(t){return e.request.get(e.getApiTeamUrl()+"overlaysets/"+t)},this.put=function(t,r){return e.request.put(e.getApiTeamUrl()+"overlaysets/"+t,r)},this.delete=function(t){return e.request.del(e.getApiTeamUrl()+"overlaysets/"+t)},this.postOverlay=function(t,r){return e.request.post(e.getApiTeamUrl()+"overlaysets/"+t+"/overlays",r)},this.getOverlays=function(t){return e.request.get(e.getApiTeamUrl()+"overlaysets/"+t+"/overlays")}},zn=function(e){this.get=function(t){return e.request.get(e.getApiTeamUrl()+"pins/"+t)},this.delete=function(t){return e.request.del(e.getApiTeamUrl()+"pins/"+t)},this.put=function(t,r){return e.request.put(e.getApiTeamUrl()+"pins/"+t,r)}},Xn=function(e){this.get=function(){return e.request.get(e.getApiUrl()+"project-actions-rights/")}},Qn=function(e){var t="projectattributetemplates";this.post=function(r){return e.request.post(e.getApiTeamUrl()+t,r)},this.get=function(r,n){var s=n?{queryParams:{default:n}}:null;return r?e.request.get(e.getApiTeamUrl()+t+"/"+r):e.request.get(e.getApiTeamUrl()+t,s)},this.put=function(r,n){return e.request.put(e.getApiTeamUrl()+t+"/"+r,n)},this.delete=function(r){return e.request.del(e.getApiTeamUrl()+t+"/"+r)},this.copyFrom=function(r,n){return e.request.put(e.getApiTeamUrl()+t+"/"+n+"/copyfrom",JSON.stringify({id:r}))},this.setDefault=function(r){return e.request.put(e.getApiTeamUrl()+t+"/"+r+"/default")}};function Yn(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,s,i,o,a=[],u=!0,c=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(a.push(n.value),a.length!==t);u=!0);}catch(e){c=!0,s=e}finally{try{if(!u&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(c)throw s}}return a}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Zn(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Zn(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Zn(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var es=function(e){this.post=function(t){return e.request.post(e.getApiTeamUrl()+"projects",t)},this.createFromExisting=function(t){return e.request.post(e.getApiTeamUrl()+"projects/copyfrom",t)},this.put=function(t,r){return e.request.put(e.getApiTeamUrl()+"projects/"+t,r)},this.get=function(t,r,n,s,i){var o={queryParams:i||{}};return r&&(o.queryParams.disciplines=!1),s&&(o.queryParams.recycleBin=!0),t?e.request.get(e.getApiTeamUrl()+"projects/"+t,o):n?e.request.get(e.getApiUrl()+n+"/projects",o):e.getTeamSlug()?e.request.get(e.getApiTeamUrl()+"projects",o):e.request.get(e.getApiUrl()+"/projects",o)},this.delete=function(t){return e.request.del(e.getApiTeamUrl()+"projects/"+t)},this.moveToRecycleBin=function(t){return e.request.del(e.getApiTeamUrl()+"projects/"+t+"?moveToRecycleBin=true")},this.restoreFromRecycleBin=function(t){return e.request.put(e.getApiTeamUrl()+"objects/"+t+"/restore",JSON.stringify({}),{dataType:"text"})},this.deleteFromRecycleBin=function(t){return e.request.del(e.getApiTeamUrl()+"projects/"+t+"?fromRecycleBin=true")},this.deleteServerCache=function(t){return e.request.del(e.getApiTeamUrl()+"projects/"+t+"/deletecache")},this.clearServerDecimation=function(t,r,n){return r||(r="00000000-0000-0000-0000-000000000000"),(n<0||!n&&0!=n)&&(n="100"),e.request.del(e.getApiTeamUrl()+"temporary/projects/"+t+"/disciplines/"+r+"/levelofdetails/"+n)},this.getModels=function(t){return e.request.get(e.getApiTeamUrl()+"projects/"+t+"/divisions")},this.postModel=function(t,r){return e.request.post(e.getApiTeamUrl()+"projects/"+t+"/divisions",r)},this.getMembers=function(t){return e.request.get(e.getApiTeamUrl()+"projects/"+t+"/members")},this.postMember=function(t,r){return e.request.post(e.getApiTeamUrl()+"projects/"+t+"/members",r)},this.putMember=function(t,r){return e.request.put(e.getApiTeamUrl()+"projects/"+t+"/members",r)},this.deleteMember=function(t,r){return e.request.del(e.getApiTeamUrl()+"projects/"+t+"/members",r)},this.getPins=function(t){return e.request.get(e.getApiTeamUrl()+"projects/"+t+"/pins")},this.putProject=function(t,r){return e.request.put(e.getApiTeamUrl()+"projects/"+t,r)},this.postAttachment=function(t,r){return e.request.post(e.getApiTeamUrl()+"projects/"+t+"/attachments",r)},this.getAttachments=function(t,r,n){var s=n;return s||(s={}),r&&(s.revision=r),e.request.get(e.getApiTeamUrl()+"projects/"+t+"/attachments",r||n?{queryParams:s}:void 0)},this.deleteAttachments=function(t){return e.request.del(e.getApiTeamUrl()+"projects/"+t+"/attachments")},this.getTopology=function(t){return e.request.get(e.getApiTeamUrl()+"projects/"+t+"/topology")},this.getSpots=function(t){return e.request.get(e.getApiTeamUrl()+"projects/"+t+"/pins")},this.postThumbnail=function(t,r,n){return e.request.post(e.getApiTeamUrl()+"projects/"+t+"/thumbnail",r,{contentType:!1,processData:!1,dataType:null,xhrUploadProgress:n})},this.getThumbnail=function(t){return e.request.get(e.getApiTeamUrl()+"thumbnail/"+t)},this.deleteThumbnail=function(t){return e.request.del(e.getApiTeamUrl()+"projects/"+t+"/thumbnail")},this.getComments=function(t){return e.request.get(e.getApiTeamUrl()+"projects/"+t+"/comments")},this.getHyperlinks=function(t){return e.request.get(e.getApiTeamUrl()+"projects/"+t+"/hyperlinks")},this.getIssues=function(t,r){return e.request.get(e.getApiTeamUrl()+"projects/"+t+"/issues"+(r?"?scene=false":""))},this.getIssuesShortInfo=function(t){var r=function(){var e=Yn((new Date).toString().split("GMT"),2),t=e[0],r=e[1];if(!t||!r)return"";var n=new Date(t+"UTC").toISOString().split(".")[0],s=(r=r.split(" ")[0]).slice(0,3)+":"+r.slice(3);return n&&s?n+s:""}();return e.request.get(e.getApiTeamUrl()+"projects/"+t+"/issues?shortinfo=true"+(r?"¤ttime="+r:""))},this.postSlideshow=function(t,r){return e.request.post(e.getApiTeamUrl()+"projects/"+t+"/slideshows",r)},this.getSlideshows=function(t){return e.request.get(e.getApiTeamUrl()+"projects/"+t+"/slideshows")},this.deleteSlideshows=function(t){return e.request.del(e.getApiTeamUrl()+"projects/"+t+"/slideshows")},this.exportSlideshowToPDF=function(t,r){var n={slideShowId:r};return e.request.post(e.getApiTeamUrl()+"projects/"+t+"/slideshow/export/pdf",JSON.stringify(n))},this.getProjectInfo=function(t,r){var n={queryParams:r||{}};return e.request.get(e.getApiTeamUrl()+"projects/"+t,n)},this.postOverlaySet=function(t,r){return e.request.post(e.getApiTeamUrl()+"projects/"+t+"/overlaysets",r)},this.getOverlaySets=function(t){return e.request.get(e.getApiTeamUrl()+"projects/"+t+"/overlaysets")},this.deleteOverlaySets=function(t){return e.request.del(e.getApiTeamUrl()+"projects/"+t+"/overlaysets")}},ts=function(e){this.postRevision=function(t,r){return e.request.post(e.getApiTeamUrl()+"divisions/"+t+"/revisions",r)},this.getRevisionList=function(t){return e.request.get(e.getApiTeamUrl()+"divisions/"+t+"/revisions")},this.getRevisionInfo=function(t){return e.request.get(e.getApiTeamUrl()+"revisions/"+t)},this.postRevisionInfo=function(t,r){return e.request.post(e.getApiTeamUrl()+"revisions/"+t,r)},this.putRevisionInfo=function(t,r){return e.request.put(e.getApiTeamUrl()+"revisions/"+t,r)},this.getRevisionsComparisonResult=function(t,r,n,s){return e.request.get(e.getApiTeamUrl()+"divisions/"+t+"/revisionscomparison/"+r+"/"+n,s)},this.compareRevisions=function(t,r,n,s){return e.request.post(e.getApiTeamUrl()+"divisions/"+t+"/revisionscomparison/"+r+"/"+n,null,s)},this.excelExportRevisionsComparisonResult=function(t,r,n,s){return e.request.post(e.getApiTeamUrl()+"divisions/"+t+"/revisionscomparison/"+r+"/"+n+"/export/excel",s)}},rs=function(e){this.getRoles=function(t){return t?e.request.get(e.getApiTeamUrl()+"projects/"+t+"/members"):e.request.get(e.getApiTeamUrl()+"roles")},this.postUserRole=function(t,r){return e.request.post(e.getApiTeamUrl()+"projects/"+t+"/members",r)},this.putUserRole=function(t,r){return e.request.put(e.getApiTeamUrl()+"projects/"+t+"/members",r)},this.deleteUser=function(t){return e.request.del(e.getApiTeamUrl()+"projects/"+t+"/members")}},ns=function(e){this.get=function(t,r){if(t||r){var n={queryParams:{}};return void 0!==t&&(n.queryParams.rights=t),void 0!==r&&(n.queryParams.customrole=r),e.request.get(e.getApiTeamUrl()+"roles/",n)}return e.request.get(e.getApiTeamUrl()+"roles/")},this.getAllRights=function(t){if(t){var r={queryParams:{globalfreeattributes:t.globalfreeattributes,global:t.global,project:t.project,document:t.document,layer:t.layer}};return e.request.get(e.getApiTeamUrl()+"rights",r)}return e.request.get(e.getApiTeamUrl()+"rights")},this.post=function(t){return e.request.post(e.getApiTeamUrl()+"roles/",t)},this.getRoleDetails=function(t){return e.request.get(e.getApiTeamUrl()+"roles/"+t)},this.updateRole=function(t,r){return e.request.put(e.getApiTeamUrl()+"roles/"+t,r)},this.deleteRole=function(t){return e.request.del(e.getApiTeamUrl()+"roles/"+t)}},ss=function(e){this.calculateCutSection=function(t){var r,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],s={cuttingCalculation:{projectId:t.projectId,cuttingPlanes:t.cuttingPlanes,selection:{modelLayer:t.modelLayer,topologyNodes:t.topologyNodes,hiddenObjects:t.hiddenObjects},settings:t.settings},runAsync:n};if("glb"===(null===(r=s.cuttingCalculation)||void 0===r||null===(r=r.settings)||void 0===r?void 0:r.responseGeometry)){return e.request.post(e.getApiTeamUrl()+"services/CuttingCalculation",JSON.stringify(s),{useXMLHttpRequest:!0,dataType:"binary",processData:!1,responseType:"arraybuffer"})}return e.request.post(e.getApiTeamUrl()+"services/CuttingCalculation",JSON.stringify(s))}},is=function(e){this.post=function(t){return e.request.post(e.getApiTeamUrl()+"share",t)}},os=function(e){this.get=function(t){return e.request.get(e.getApiTeamUrl()+"slides/"+t)},this.put=function(t,r){return e.request.put(e.getApiTeamUrl()+"slides/"+t,r)},this.delete=function(t){return e.request.del(e.getApiTeamUrl()+"slides/"+t)},this.postThumbnail=function(t,r){return e.request.post(e.getApiTeamUrl()+"slides/"+t+"/thumbnail",r)}},as=function(e){this.get=function(t){return e.request.get(e.getApiTeamUrl()+"slideshows/"+t)},this.put=function(t,r){return e.request.put(e.getApiTeamUrl()+"slideshows/"+t,r)},this.delete=function(t){return e.request.del(e.getApiTeamUrl()+"slideshows/"+t)},this.postSlide=function(t,r){return e.request.post(e.getApiTeamUrl()+"slideshows/"+t+"/slides",r)},this.getSlides=function(t){return e.request.get(e.getApiTeamUrl()+"slideshows/"+t+"/slides")},this.postThumbnail=function(t,r){return e.request.post(e.getApiTeamUrl()+"slideshows/"+t+"/thumbnail",r)},this.getThumbnail=function(t){return e.request.get(e.getApiTeamUrl()+"thumbnail/"+t)}},us=function(e){this.postStructure=function(t,r){return e.request.post(e.getApiTeamUrl()+"projects/"+t+"/structures",r)},this.postStructureTopology=function(t,r){return e.request.post(e.getApiTeamUrl()+"structures/"+t+"/topology",r)},this.postSubNode=function(t,r){return e.request.post(e.getApiTeamUrl()+"structures/"+t,r)},this.postAssignedObject=function(t,r,n,s){return e.request.post(e.getApiTeamUrl()+"structures/"+t+"/assign/"+r+"?varianttype="+n,s)},this.attributeAssign=function(t,r,n,s){var i={attributeId:n};return s&&(i.variantType=s),e.request.put(e.getApiTeamUrl()+"projects/"+t+"/structures/"+r+"/attributeassign",JSON.stringify(i))},this.deleteAssignedObject=function(t,r,n,s){var i=[s?"removeAllNodes=true":"",n?"varianttype=true":""].filter((function(e){return e})).join("&");return e.request.del(e.getApiTeamUrl()+"structures/"+t+"/delete/"+r+"?"+i)},this.getStructure=function(t,r,n){return r?e.request.get(e.getApiTeamUrl()+"structures/"+r):e.request.get(e.getApiTeamUrl()+"projects/"+t+"/structures"+(n?"?type="+n:""))},this.getTopology=function(t,r,n){return void 0===n||""==n?e.request.get(e.getApiTeamUrl()+"structures/"+t+"/topology?varianttype="+r):!0===n?e.request.get(e.getApiTeamUrl()+"structures/"+t+"/topology?varianttype="+r+"&attributes=true"):void 0},this.getTopologyStructure=function(t){return e.request.get(e.getApiTeamUrl()+"projects/"+t+"/topologystructure")},this.resetTopologyStructure=function(t){return e.request.put(e.getApiTeamUrl()+"projects/"+t+"/topologystructure/reset")},this.copyStructure=function(t,r,n){return e.request.post(e.getApiTeamUrl()+"structures/"+t+"/copy?elementRelation="+n+"&attributes=true",r)},this.putStructure=function(t,r,n){var s=n?"?applyToChild=true":"";return e.request.put(e.getApiTeamUrl()+"structures/"+t+s,r)},this.reorderStructure=function(t,r){return e.request.put(e.getApiTeamUrl()+"structures/"+t+"/reorder?varianttype="+r)},this.deleteStructure=function(t,r,n){return n?e.request.del(e.getApiTeamUrl()+"structures/"+t+"?forceDelete=true"):r?e.request.del(e.getApiTeamUrl()+"structures/"+t+"?deleteAll=true"):e.request.del(e.getApiTeamUrl()+"structures/"+t)},this.removeAllAssignedObjects=function(t){return e.request.del(e.getApiTeamUrl()+"structures/"+t+"/delete")},this.deleteAllProjectStructures=function(t){return e.request.del(e.getApiTeamUrl()+"projects/"+t+"/structures")},this.postVariantType=function(t,r){return e.request.post(e.getApiTeamUrl()+"projects/"+t+"/variants",r)},this.getVariantType=function(t,r){return r?e.request.get(e.getApiTeamUrl()+"projects/"+t+"/variants/"+r):e.request.get(e.getApiTeamUrl()+"projects/"+t+"/variants")},this.deleteVariantType=function(t,r){return e.request.del(e.getApiTeamUrl()+"projects/"+t+"/variants/"+r)},this.copyElementsToVariant=function(t,r,n){return e.request.put(e.getApiTeamUrl()+"projects/"+t+"/variants/"+r+"/copyfrom",n)}},cs=function(e){this.get=function(){return e.request.get(e.getApiUrl()+"team-actions-rights/")}},ls=function(e){this.get=function(t,r){var n={queryParams:{}};return r&&(n.queryParams.filterEmpty=r),t?e.request.get(e.getApiUrl()+"teams/"+t,n):e.request.get(e.getApiUrl()+"teams",n)},this.postTeam=function(t){return e.request.post(e.getApiUrl()+"teams",t)},this.putTeam=function(t){return e.request.put(e.getApiUrl()+"team",t)},this.deleteTeam=function(t){return e.request.del(e.getApiUrl()+"teams/"+t)},this.getAccountSettings=function(t){return e.request.get(e.getApiUrl()+"administration/teams/"+t+"/accountsettings")},this.getRestrictions=function(t){return e.request.get(e.getApiUrl()+"teams/"+t+"/restrictions")},this.deleteServerCache=function(){return e.request.del(e.getApiTeamUrl()+"deleteCache")}},hs=function(e){this.get=function(t,r){var n={language:t};return r&&(n.type=r),e.request.get(e.getApiUrl()+"terms/download",{queryParams:n,dataType:"html"})}},ps=function(e){this.get=function(t,r){var n={language:t};return r&&(n.type=r),e.request.get(e.getApiUrl()+"dataprotectiondeclarations/download",{queryParams:n,dataType:"html"})},this.getForbiddenEmails=function(){return e.request.get(e.getApiUrl()+"restrictedemails")}},fs=function(e){this.get=function(t,r){var n={language:t};return r&&(n.type=r),e.request.get(e.getApiUrl()+"imprints/download",{queryParams:n,dataType:"html"})}},ds=function(e){this.post=function(t){return e.request.post(e.getApiUrl()+"content/units/",t)},this.get=function(t){return t?e.request.get(e.getApiUrl()+"content/units/"+t):e.request.get(e.getApiUrl()+"content/units/")},this.put=function(t,r){return e.request.put(e.getApiUrl()+"content/units/"+t,r)},this.delete=function(t){return e.request.del(e.getApiUrl()+"content/units/"+t)}},gs=function(e){this.get=function(t){return t?e.request.get(e.getApiUrl()+"user",{token:t}):e.request.get(e.getApiUrl()+"user")},this.put=function(t,r){var n=e.getApiUrl()+"user";return r?e.request.put(n,t,{token:r}):e.request.put(n,t)},this.setPassword=function(t,r,n){var s=e.getApiUrl()+"user/set_password";return t&&(s+=t),n?e.request.put(s,r,{token:n}):e.request.put(s,r)},this.post=function(t){return e.request.post(e.getApiUrl()+"user",t)},this.postPhoto=function(t){return e.request.post(e.getApiUrl()+"user/photo",t,{contentType:!1,processData:!1})},this.deletePhoto=function(){return e.request.del(e.getApiUrl()+"user/photo")},this.getPhoto=function(){return e.request.get(e.getApiUrl()+"user/photo")},this.putPassword=function(t){return e.request.put(e.getApiUrl()+"user/change_password",t)},this.getSubscriptions=function(t){return t?e.request.get(e.getApiUrl()+"user/accountsettings/"+t):e.request.get(e.getApiUrl()+"user/accountsettings")}},ms=function(e){this.post=function(t){return e.request.post(e.getApiUrl()+"users",t)},this.exist=function(t){return e.request.get(e.getApiUrl()+"users/exist",{queryParams:{email:t}})},this.put=function(t,r){return e.request.put(e.getApiUrl()+"users/"+t,r)},this.delete=function(t){return e.request.del(e.getApiUrl()+"users/"+t)},this.setSubscriptions=function(t,r){return e.request.post(e.getApiUrl()+"administration/users/"+t+"/accountsettings",r)}},ys=function(e){this.postSettings=function(t,r){return e.request.post(e.getApiTeamUrl()+"userSettings/"+t,r)},this.getSettings=function(t){return e.request.get(e.getApiTeamUrl()+"userSettings/"+t)}},vs=function(e){this.get=function(t){return e.request.get(e.getApiTeamUrl()+"invitations/"+(t||""))},this.getProjectInvitations=function(t){return e.request.get("".concat(e.getApiTeamUrl(),"invitations?projectId=").concat(t))},this.post=function(t){return e.request.post(e.getApiTeamUrl()+"invitations/",t)},this.delete=function(t){return e.request.del(e.getApiTeamUrl()+"invitations/"+t)},this.put=function(t,r){return e.request.put(e.getApiTeamUrl()+"invitations/"+t,r)},this.accept=function(t,r){return e.request.put(e.getApiUrl()+"invitations/"+t+"/accept",r)},this.getInvitation=function(t,r){return e.request.get(e.getApiUrl()+"invitations/"+t,r)}},bs=function(e){this.post=function(t,r){return e.request.post(e.getApiTeamUrl()+"projects/"+t+"/selections",r)},this.get=function(t){return e.request.get(e.getApiTeamUrl()+"selections/"+t)},this.getAllSelections=function(t){return e.request.get(e.getApiTeamUrl()+"projects/"+t+"/selections")},this.delete=function(t){return e.request.del(e.getApiTeamUrl()+"selections/"+t)}},ws=function(e){this.postGroup=function(t,r){return e.request.post(e.getApiTeamUrl()+"projects/"+t+"/usergroups",r)},this.getGroups=function(t){return e.request.get(e.getApiTeamUrl()+"projects/"+t+"/usergroups")},this.getUsers=function(t){return e.request.get(e.getApiTeamUrl()+"usergroups/"+t)},this.deleteGroup=function(t){return e.request.del(e.getApiTeamUrl()+"usergroups/"+t)},this.putGroup=function(t,r){return e.request.put(e.getApiTeamUrl()+"usergroups/"+t,r)},this.assignUser=function(t,r){return e.request.put(e.getApiTeamUrl()+"usergroups/"+t+"/assign",r)},this.removeUser=function(t,r){return e.request.put(e.getApiTeamUrl()+"usergroups/"+t+"/remove",r)}},Ts=function(e){this.get=function(t){return e.request.get(e.getApiTeamUrl()+"scenes/"+t)},this.getObjectScenes=function(t,r){var n={};r&&(n.queryParams={shortInfo:r});var s=e.getApiTeamUrl()+"objects/"+t+"/scenes";return e.request.get(s,n)},this.post=function(t,r){return e.request.post(e.getApiTeamUrl()+"objects/"+t+"/scenes",r)},this.delete=function(t){return e.request.del(e.getApiTeamUrl()+"scenes/"+t)},this.put=function(t,r){return e.request.put(e.getApiTeamUrl()+"scenes/"+t,r)},this.postThumbnailAttachment=function(t,r,n,s){return e.request.post(e.getApiTeamUrl()+"objects/"+t+"/attachments",r,{contentType:!1,processData:!1,dataType:null,xhrUploadProgress:n,queryParams:s?{attachmenttype:"thumbnailhighresolution"}:void 0})},this.postThumbnail=function(t,r,n){return e.request.post(e.getApiTeamUrl()+"objects/"+t+"/attachments",r,{queryParams:n?{attachmenttype:"thumbnailhighresolution"}:void 0})},this.getThumbnail=function(t){return e.request.get(e.getApiTeamUrl()+"objects/"+t+"/attachments")}},As=function(e){this.post=function(t){return e.request.post(e.getApiTeamUrl()+"services/BaseQuantities",JSON.stringify(t))}},qs=function(e){this.createWorkflowTemplateFolder=function(t,r){return e.request.post(e.getApiTeamUrl()+"structures/"+t,r)},this.putWorkflowTemplateFolder=function(t,r){return e.request.put(e.getApiTeamUrl()+"structures/"+t,r)},this.postWorkflowTemplate=function(t,r){return e.request.post(e.getApiTeamUrl()+"projects/"+t+"/workflowtemplates",r)},this.putWorkflowTemplate=function(t,r){return e.request.put(e.getApiTeamUrl()+"workflowtemplates/"+t,r)},this.getWorkflowTemplate=function(t){return e.request.get(e.getApiTeamUrl()+"workflowtemplates/"+t)},this.getWorkflowTemplateRoot=function(t){return e.request.get(e.getApiTeamUrl()+"projects/"+t+"/structures?type=IsoWorkflowStructure")},this.getWorkflowTemplateStructure=function(t){return e.request.get(e.getApiTeamUrl()+"structures/"+t+"/topology")},this.getAllWorkflowTemplates=function(t){return e.request.get(e.getApiTeamUrl()+"projects/"+t+"/workflowtemplates")},this.deleteWorkflowTemplate=function(t){return e.request.del(e.getApiTeamUrl()+"workflowtemplates/"+t)},this.getWorkflowTemplateInfo=function(t){return e.request.get(e.getApiTeamUrl()+"workflowtemplates/"+t)},this.initializeWorkflowTemplate=function(t,r){return e.request.post(e.getApiTeamUrl()+"projects/"+t+"/workflows",r)},this.getAllWorkflows=function(t,r){var n={queryParams:{}};return n.queryParams.status=r,e.request.get(e.getApiTeamUrl()+"projects/"+t+"/workflows",n)},this.getWorkflow=function(t){return e.request.get(e.getApiTeamUrl()+"workflows/"+t)},this.deleteWorkflow=function(t){return e.request.del(e.getApiTeamUrl()+"workflows/"+t)},this.putWorkflow=function(t){return e.request.put(e.getApiTeamUrl()+"workflows/"+t.id,t)},this.submitReview=function(t){return e.request.put(e.getApiTeamUrl()+"workflows/"+t.id+"/?submit=true",t)},this.getStep=function(t){return e.request.put(e.getApiTeamUrl()+"workflows/"+t)},this.submitStep=function(t,r){return e.request.put(e.getApiTeamUrl()+"steps/"+t+"/?submit=true",r)},this.saveStep=function(t,r){return e.request.put(e.getApiTeamUrl()+"steps/"+t+"/?submit=false",r)},this.cancelWorkflow=function(t){return e.request.put(e.getApiTeamUrl()+"workflows/"+t+"/cancel")}};function _s(e){return _s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_s(e)}function Us(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,(s=n.key,i=void 0,i=function(e,t){if("object"!==_s(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==_s(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(s,"string"),"symbol"===_s(i)?i:String(i)),n)}var s,i}var ks=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._config=null,t?(void 0===t.version&&(t.version="v2"),this._config=t):this._config=js(),this._token=null,this._tokenType=null,this._teamSlug=null,this._cache=null,window.BIMPLUS_SDK_ENABLE_DEBUG_LOGS&&console.log("BimWebSdk: config = ",this._config),this._config.cache?(this.request=new _n,this._cache=this.request.getCache(),!1===this._cache.isSupported()&&(console.warn("Warning: Caching requested but not supported by browser! Falling back to uncached requests."),this.request=new c,this._cache=null)):this.request=new c,this.authorize=new d(this),this.user=new gs(this),this.users=new ms(this),this.teams=new ls(this),this.members=new Mn(this),this.projects=new es(this),this.structures=new us(this),this.models=new Gn(this),this.objects=new $n(this),this.overlays=new Vn(this),this.overlaySets=new Jn(this),this.revisions=new ts(this),this.elementTypes=new Pn(this),this.annotations=new h(this),this.attachments=new p(this),this.issues=new Kn(this),this.labels=new Ln(this),this.pins=new zn(this),this.comments=new jn(this),this.hyperlinks=new Rn(this),this.importService=new Bn(this),this.slideshows=new as(this),this.slides=new os(this),this.clashDetection=new Un(this),this.clientLogs=new kn(this),this.rightsService=new rs(this),this.applicationSettings=new l(this),this.exportService=new En(this),this.folders=new On(this),this.locks=new Nn(this),this.share=new is(this),this.messages=new Fn(this),this.objectFilters=new Hn(this),this.terms=new hs(this),this.dataProtection=new ps(this),this.dimensions=new Sn(this),this.imprints=new fs(this),this.projectActionsRights=new Xn(this),this.roles=new ns(this),this.attributeTemplates=new f(this),this.units=new ds(this),this.freeAttributes=new Cn(this),this.freeAttributeGroups=new Dn(this),this.hiddenCalculation=new In(this),this.sectionCut=new ss(this),this.projectAttributeTemplates=new Qn(this),this.teamActionsRights=new cs(this),this.customTables=new xn(this),this.userSettings=new ys(this),this.invitations=new vs(this),this.selections=new bs(this),this.userGroups=new ws(this),this.scenes=new Ts(this),this.baseQuantities=new As(this),this.workflows=new qs(this)}var t,r,n;return t=e,(r=[{key:"setAccessToken",value:function(e){this._token=e,this.request.setAccessToken(e),window.BIMPLUS_SDK_ENABLE_DEBUG_LOGS&&console.log("BimWebSdk: token was set to "+this._token)}},{key:"getAccessToken",value:function(){return this._token}},{key:"setTokenType",value:function(e){this._tokenType=e,this.request.setTokenType(e),window.BIMPLUS_SDK_ENABLE_DEBUG_LOGS&&console.log("BimWebSdk: token type was set to "+this._tokenType)}},{key:"getTokenType",value:function(){return this._tokenType}},{key:"setAccessTokenAndType",value:function(e,t){this.setAccessToken(e),this.setTokenType(t)}},{key:"getAccessTokenAndType",value:function(){return{token:this._token,tokenType:this._tokenType}}},{key:"setTeamSlug",value:function(e){this._teamSlug=e,window.BIMPLUS_SDK_ENABLE_DEBUG_LOGS&&console.log("BimWebSdk: team slug was set to "+this._teamSlug)}},{key:"getTeamSlug",value:function(){return this._teamSlug}},{key:"getApiUrl",value:function(){return this._config.protocol+this._config.host+"/"+(this._config.version?this._config.version+"/":"")}},{key:"getApiTeamUrl",value:function(){return this._teamSlug||console.error("Error: Teamslug not set"),this.getApiUrl()+this._teamSlug+"/"}},{key:"getCache",value:function(){return this._cache}}])&&Us(t.prototype,r),n&&Us(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}(),js=function(e){var t="api.bimplus.net";if(e)switch(e){case"dev":t="api-dev.bimplus.net";break;case"stage":t="api-stage.bimplus.net"}return{protocol:"https://",host:t,cache:!1,version:"v2"}};return t})()));
|