bimplus-websdk 1.0.15 → 1.0.17
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 +13 -13
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",l=a.asyncIterator||"@@asyncIterator",c=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 D(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(O([])));_&&_!==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 l=f(e[s],e,o);if("throw"!==l.type){var c=l.arg,h=c.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){c.value=e,a(c)}),(function(e){return n("throw",e,a,u)}))}u(l.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 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 l=f(t,r,n);if("normal"===l.type){if(s=n.done?y:g,l.arg===v)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(s=y,n.method="throw",n.arg=l.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 D(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(P,this),this.reset(!0)}function O(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,c,"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,c,"GeneratorFunction")),e.prototype=Object.create(U),e},t.awrap=function(e){return{__await:e}},k(j.prototype),h(j.prototype,l,(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,c,"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=O,D.prototype={constructor:D,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"),l=i.call(o,"finallyLoc");if(u&&l){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(!l)throw 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 Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:O(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){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)}))}}function o(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||!1,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++,null!=n&&n.token){var r=n.tokenType?n.tokenType:"BimPlus";t.setRequestHeader("Authorization",r+" "+n.token)}if(null!=n&&n.eTag&&(t.setRequestHeader("Cache-Control","no-cache"),window&&!window.BIMPLUS_SDK_DISABLE_ETAG&&t.setRequestHeader("If-None-Match",n.eTag)),null!=n&&n.headers)for(var s in n.headers)s&&t.setRequestHeader(s,n.headers[s]);!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:null!=t&&t.responseText&&(null==t?void 0:t.responseText.length)>0?JSON.parse(t.responseText):null};console.log(JSON.stringify(r))}}})}function a(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++,null!=n&&n.responseType&&(console.debug("responseType is set to",n.responseType),i.responseType=n.responseType),null!=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 u(e){var t="?";for(var r in e)Object.hasOwn(e,r)&&(t+=r+"="+e[r]+"&");return t=t.slice(0,-1)}function l(e,t,r,s,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(s,o).done(function(){var t=i(n().mark((function t(r,i,l){var c,h,p,f;return n().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:u.push(r),c=0,200===l.status?(h=l.getResponseHeader("X-Total-Count"))?c=parseInt(h,10):console.warn("Request for "+s+" doesn't support chunked responses!"):304===l.status&&(l["Cached-X-Total-Count"]?c=l["Cached-X-Total-Count"]:console.warn("Cached request for "+s+" 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(s,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<=c)){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()}function c(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.attachmentId,r=e.file,s=e.fileName,o=e.ajaxConfig,a=e.request,u=e.url,l=e.deferred;e.uploadData.start=e.uploadData.currentChunk*e.uploadData.chunkSize,e.uploadData.end=Math.min(e.uploadData.fileSize,e.uploadData.start+e.uploadData.chunkSize)-1;var h=r.slice(e.uploadData.start,e.uploadData.end+1);return o.headers={"Content-Range":"bytes "+e.uploadData.start+"-"+e.uploadData.end+"/"+e.uploadData.fileSize,"Content-Disposition":'inline; name="'+s+'"; filename="'+r.name+'"',"Chunk-FileId":t},a.put(u,h,o).done(function(){var h=i(n().mark((function i(h,p,f){return n().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(e.uploadData.doCallback(h,p,f),e.uploadData.currentChunk++,!(e.uploadData.currentChunk<e.uploadData.totalChunks)){n.next=6;break}return n.abrupt("return",c({attachmentId:t,uploadData:e.uploadData,file:r,fileName:s,ajaxConfig:o,request:a,url:u,deferred:l}));case 6:l.resolve(h);case 7:case"end":return n.stop()}}),i)})));return function(e,t,r){return h.apply(this,arguments)}}()).fail((function(n,i,h){if(e.uploadData.doCallback({error:n}))return c({attachmentId:t,uploadData:e.uploadData,file:r,fileName:s,ajaxConfig:o,request:a,url:u,deferred:l});l.reject(n,i,h)}))}function h(e,t,r,s,o){var a,u,l=null==s?void 0:s.file,h=null==s?void 0:s.opts,p=null==h?void 0:h.chunkSize,f=2147482624;p>0&&p<f||(p=f);var d=l.size,g=Math.ceil(d/p),m=0*p,y={currentChunk:0,start:m,end:Math.min(d,m+p)-1,totalChunks:g,fileSize:d,chunkSize:p,doCallback:function(e,t,r){var n;return null==h||null===(n=h.callback)||void 0===n?void 0:n.call(h,e,t,r)}},v=l.slice(y.start,y.end+1),b=null!=l&&l.name?(null===(a=(u=l.name).substring)||void 0===a?void 0:a.call(u,0,l.name.lastIndexOf(".")))||l.name:"";!function(e){var t,r,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e||(e={}),e.token||(e.token=n.token),e.contentType=!1,e.processData=!1,e.headers||(e.headers={}),e.headers["Content-Range"]="bytes "+n.uploadData.start+"-"+n.uploadData.end+"/"+n.uploadData.fileSize,e.headers["Content-Disposition"]='inline; name="'+n.fileName+'"; filename="'+n.file.name+'"',e.queryParams||(e.queryParams={});var s=null==n||null===(t=n.data)||void 0===t?void 0:t.documentFolderId;!e.queryParams.DocumentFolderId&&s&&(e.queryParams.DocumentFolderId=s);var i=null==n||null===(r=n.data)||void 0===r?void 0:r.uploadProgress;e.xhrUploadProgress||"function"!=typeof i||(e.xhrUploadProgress=function(e){e||(e={}),e.extraData={start:n.uploadData.start,end:n.uploadData.end,fileSize:n.uploadData.fileSize,chunk:n.uploadData.currentChunk+1,total:n.uploadData.totalChunks};for(var t=arguments.length,r=new Array(t>1?t-1:0),s=1;s<t;s++)r[s-1]=arguments[s];return i.apply(void 0,[e].concat(r))})}(o,{token:t,data:s,fileName:b,file:l,uploadData:y});var w=$.Deferred();return function t(){return e.put(r,v,o).done(function(){var t=i(n().mark((function t(s,i,a){var u;return n().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(u="00000000-0000-0000-0000-000000000000"===s.id?s.fileName:s.id,y.doCallback(s,i,a),y.currentChunk++,!(y.currentChunk<y.totalChunks)){t.next=7;break}return t.abrupt("return",c({attachmentId:u,uploadData:y,file:l,fileName:b,ajaxConfig:o,request:e,url:r,deferred:w}));case 7:w.resolve(s,i,a);case 8:case"end":return t.stop()}}),t)})));return function(e,r,n){return t.apply(this,arguments)}}()).fail((function(e,r,n){if(y.doCallback({error:e}))return t();w.reject(e,r,n)}))}(),w.promise()}e.r(t),e.d(t,{Api:()=>Ds,IDBCache:()=>kn,createDefaultConfig:()=>Os});var p=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+=u(n.queryParams)),null!==(s=n)&&void 0!==s&&s.useXMLHttpRequest?a(r,"GET",null,n):o(r,"GET",null,n)},this.getChunked=function(t,r){return l(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+=u(s.queryParams)),o(r,"PUT",n,s)},this.putChunked=function(t,r,n){return h(this,e,t,r,n)},this.post=function(r,n,s){var i;return s||(s={}),s.token||(s.token=e),s.tokenType&&s.tokenType===t||(s.tokenType=t),s.queryParams&&(r+=u(s.queryParams)),null!==(i=s)&&void 0!==i&&i.useXMLHttpRequest?a(r,"POST",n,s):o(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+=u(s.queryParams)),o(r,"DELETE",n||null,s)}},f=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)}},d=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)}},g=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.updateChunked=function(t,r,n){var s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=e.getApiTeamUrl()+"attachments/"+t+"/chunked",o={file:r,uploadProgress:n,opts:s};return e.request.putChunked(i,o,{queryParams:{}})},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.createVersionChunked=function(t,r,n){var s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=e.getApiTeamUrl()+"attachments/"+t+"/versions/chunked",o={file:r,uploadProgress:n,opts:s};return e.request.putChunked(i,o,{queryParams:{}})},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)},this.getBluebeam=function(t,r){var n={};return n.externalClientId=t,e.request.get(e.getApiUrl()+"external/attachments/bluebeam",{queryParams:n,headers:{"source-Authorization":"Bearer ".concat(r)}})},this.postBluebeam=function(t,r){return e.request.post(e.getApiTeamUrl()+"external/attachments/upload",r,{headers:{"source-Authorization":"Bearer ".concat(t)}})}},m=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)}},y=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 v="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,b=Object.keys,w=Array.isArray;function T(e,t){return"object"!=typeof t||b(t).forEach((function(r){e[r]=t[r]})),e}"undefined"==typeof Promise||v.Promise||(v.Promise=Promise);const A=Object.getPrototypeOf,q={}.hasOwnProperty;function _(e,t){return q.call(e,t)}function U(e,t){"function"==typeof t&&(t=t(A(e))),("undefined"==typeof Reflect?b:Reflect.ownKeys)(t).forEach((r=>{j(e,r,t[r])}))}const k=Object.defineProperty;function j(e,t,r,n){k(e,t,T(r&&_(r,"get")&&"function"==typeof r.get?{get:r.get,set:r.set,configurable:!0}:{value:r,configurable:!0,writable:!0},n))}function x(e){return{from:function(t){return e.prototype=Object.create(t.prototype),j(e.prototype,"constructor",e),{extend:U.bind(null,e.prototype)}}}}const S=Object.getOwnPropertyDescriptor;function P(e,t){let r;return S(e,t)||(r=A(e))&&P(r,t)}const E=[].slice;function D(e,t,r){return E.call(e,t,r)}function O(e,t){return t(e)}function C(e){if(!e)throw new Error("Assertion Failed")}function I(e){v.setImmediate?setImmediate(e):setTimeout(e,0)}function R(e,t){return e.reduce(((e,r,n)=>{var s=t(r,n);return s&&(e[s[0]]=s[1]),e}),{})}function B(e,t){if("string"==typeof 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=B(e,t[n]);r.push(i)}return r}var o=t.indexOf(".");if(-1!==o){var a=e[t.substr(0,o)];return null==a?void 0:B(a,t.substr(o+1))}}function K(e,t,r){if(e&&void 0!==t&&(!("isFrozen"in Object)||!Object.isFrozen(e)))if("string"!=typeof t&&"length"in t){C("string"!=typeof r&&"length"in r);for(var n=0,s=t.length;n<s;++n)K(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?w(e)&&!isNaN(parseInt(o))?e.splice(o,1):delete e[o]:e[o]=r;else{var u=e[o];u&&_(e,o)||(u=e[o]={}),K(u,a,r)}}else void 0===r?w(e)&&!isNaN(parseInt(t))?e.splice(t,1):delete e[t]:e[t]=r}}function N(e){var t={};for(var r in e)_(e,r)&&(t[r]=e[r]);return t}const L=[].concat;function M(e){return L.apply([],e)}const F="BigUint64Array,BigInt64Array,Array,Boolean,String,Date,RegExp,Blob,File,FileList,FileSystemFileHandle,FileSystemDirectoryHandle,ArrayBuffer,DataView,Uint8ClampedArray,ImageBitmap,ImageData,Map,Set,CryptoKey".split(",").concat(M([8,16,32,64].map((e=>["Int","Uint","Float"].map((t=>t+e+"Array")))))).filter((e=>v[e])),G=F.map((e=>v[e]));R(F,(e=>[e,!0]));let H=null;function W(e){H="undefined"!=typeof WeakMap&&new WeakMap;const t=z(e);return H=null,t}function z(e){if(!e||"object"!=typeof e)return e;let t=H&&H.get(e);if(t)return t;if(w(e)){t=[],H&&H.set(e,t);for(var r=0,n=e.length;r<n;++r)t.push(z(e[r]))}else if(G.indexOf(e.constructor)>=0)t=e;else{const r=A(e);for(var s in t=r===Object.prototype?{}:Object.create(r),H&&H.set(e,t),e)_(e,s)&&(t[s]=z(e[s]))}return t}const{toString:V}={};function J(e){return V.call(e).slice(8,-1)}const Q="undefined"!=typeof Symbol?Symbol.iterator:"@@iterator",X="symbol"==typeof Q?function(e){var t;return null!=e&&(t=e[Q])&&t.apply(e)}:function(){return null},Y={};function Z(e){var t,r,n,s;if(1===arguments.length){if(w(e))return e.slice();if(this===Y&&"string"==typeof e)return[e];if(s=X(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 ee="undefined"!=typeof Symbol?e=>"AsyncFunction"===e[Symbol.toStringTag]:()=>!1;var te="undefined"!=typeof location&&/^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);function re(e,t){te=e,ne=t}var ne=()=>!0;const se=!new Error("").stack;function ie(){if(se)try{throw ie.arguments,new Error}catch(e){return e}return new Error}function oe(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(ne).map((e=>"\n"+e)).join("")):""}var ae=["Unknown","Constraint","Data","TransactionInactive","ReadOnly","Version","NotFound","InvalidState","InvalidAccess","Abort","Timeout","QuotaExceeded","Syntax","DataClone"],ue=["Modify","Bulk","OpenFailed","VersionChange","Schema","Upgrade","InvalidTable","MissingAPI","NoSuchDatabase","InvalidArgument","SubTransaction","Unsupported","Internal","DatabaseClosed","PrematureCommit","ForeignAwait"].concat(ae),le={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 ce(e,t){this._e=ie(),this.name=e,this.message=t}function he(e,t){return e+". Errors: "+Object.keys(t).map((e=>t[e].toString())).filter(((e,t,r)=>r.indexOf(e)===t)).join("\n")}function pe(e,t,r,n){this._e=ie(),this.failures=t,this.failedKeys=n,this.successCount=r,this.message=he(e,t)}function fe(e,t){this._e=ie(),this.name="BulkError",this.failures=Object.keys(t).map((e=>t[e])),this.failuresByPos=t,this.message=he(e,t)}x(ce).from(Error).extend({stack:{get:function(){return this._stack||(this._stack=this.name+": "+this.message+oe(this._e,2))}},toString:function(){return this.name+": "+this.message}}),x(pe).from(ce),x(fe).from(ce);var de=ue.reduce(((e,t)=>(e[t]=t+"Error",e)),{});const ge=ce;var me=ue.reduce(((e,t)=>{var r=t+"Error";function n(e,n){this._e=ie(),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=le[t]||r,this.inner=null)}return x(n).from(ge),e[t]=n,e}),{});me.Syntax=SyntaxError,me.Type=TypeError,me.Range=RangeError;var ye=ae.reduce(((e,t)=>(e[t+"Error"]=me[t],e)),{}),ve=ue.reduce(((e,t)=>(-1===["Syntax","Type","Range"].indexOf(t)&&(e[t+"Error"]=me[t]),e)),{});function be(){}function we(e){return e}function Te(e,t){return null==e||e===we?t:function(r){return t(e(r))}}function Ae(e,t){return function(){e.apply(this,arguments),t.apply(this,arguments)}}function qe(e,t){return e===be?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?Ae(n,this.onsuccess):n),s&&(this.onerror=this.onerror?Ae(s,this.onerror):s),void 0!==i?i:r}}function _e(e,t){return e===be?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?Ae(r,this.onsuccess):r),n&&(this.onerror=this.onerror?Ae(n,this.onerror):n)}}function Ue(e,t){return e===be?t:function(r){var n=e.apply(this,arguments);T(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?Ae(s,this.onsuccess):s),i&&(this.onerror=this.onerror?Ae(i,this.onerror):i),void 0===n?void 0===o?void 0:o:T(n,o)}}function ke(e,t){return e===be?t:function(){return!1!==t.apply(this,arguments)&&e.apply(this,arguments)}}function je(e,t){return e===be?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)}}ve.ModifyError=pe,ve.DexieError=ce,ve.BulkError=fe;var xe={};const Se=100,[Pe,Ee,De]="undefined"==typeof Promise?[]:(()=>{let e=Promise.resolve();if("undefined"==typeof crypto||!crypto.subtle)return[e,A(e),e];const t=crypto.subtle.digest("SHA-512",new Uint8Array([0]));return[t,A(t),e]})(),Oe=Ee&&Ee.then,Ce=Pe&&Pe.constructor,Ie=!!De;var Re=!1,Be=De?()=>{De.then(ot)}:v.setImmediate?setImmediate.bind(null,ot):v.MutationObserver?()=>{var e=document.createElement("div");new MutationObserver((()=>{ot(),e=null})).observe(e,{attributes:!0}),e.setAttribute("i","1")}:()=>{setTimeout(ot,0)},Ke=function(e,t){ze.push([e,t]),Le&&(Be(),Le=!1)},Ne=!0,Le=!0,Me=[],Fe=[],Ge=null,He=we,We={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:Et,pgp:!1,env:{},finalize:function(){this.unhandleds.forEach((e=>{try{Et(e[0],e[1])}catch(e){}}))}},$e=We,ze=[],Ve=0,Je=[];function Qe(e){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");this._listeners=[],this.onuncatched=be,this._lib=!1;var t=this._PSD=$e;if(te&&(this._stackHolder=ie(),this._prev=null,this._numPrev=0),"function"!=typeof e){if(e!==xe)throw new TypeError("Not a function");return this._state=arguments[1],this._value=arguments[2],void(!1===this._state&&et(this,this._value))}this._state=null,this._value=null,++t.ref,Ze(this,e)}const Xe={get:function(){var e=$e,t=mt;function r(r,n){var s=!e.global&&(e!==$e||t!==mt);const i=s&&!wt();var o=new Qe(((t,o)=>{rt(this,new Ye(xt(r,e,s,i),xt(n,e,s,i),t,o,e))}));return te&&it(o,this),o}return r.prototype=xe,r},set:function(e){j(this,"then",e&&e.prototype===xe?Xe:{get:function(){return e},set:Xe.set})}};function Ye(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 Ze(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&&at();t&&"function"==typeof t.then?Ze(e,((e,r)=>{t instanceof Qe?t._then(e,r):t.then(e,r)})):(e._state=!0,e._value=t,tt(e)),r&&ut()}}),et.bind(null,e))}catch(t){et(e,t)}}function et(e,t){if(Fe.push(t),null===e._state){var r=e._lib&&at();t=He(t),e._state=!1,e._value=t,te&&null!==t&&"object"==typeof t&&!t._promise&&function(e,t,r){try{e.apply(null,void 0)}catch(e){}}((()=>{var r=P(t,"stack");t._promise=e,j(t,"stack",{get:()=>Re?r&&(r.get?r.get.apply(t):r.value):e.stack})})),function(e){Me.some((t=>t._value===e._value))||Me.push(e)}(e),tt(e),r&&ut()}}function tt(e){var t=e._listeners;e._listeners=[];for(var r=0,n=t.length;r<n;++r)rt(e,t[r]);var s=e._PSD;--s.ref||s.finalize(),0===Ve&&(++Ve,Ke((()=>{0==--Ve&<()}),[]))}function rt(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,++Ve,Ke(nt,[r,e,t])}else e._listeners.push(t)}function nt(e,t,r){try{Ge=t;var n,s=t._value;t._state?n=e(s):(Fe.length&&(Fe=[]),n=e(s),-1===Fe.indexOf(s)&&function(e){for(var t=Me.length;t;)if(Me[--t]._value===e._value)return void Me.splice(t,1)}(t)),r.resolve(n)}catch(e){r.reject(e)}finally{Ge=null,0==--Ve&<(),--r.psd.ref||r.psd.finalize()}}function st(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=oe(o,0)):(s=o,i=""),t.push(s+(i?": "+i:"")+n)}return te&&((n=oe(e._stackHolder,2))&&-1===t.indexOf(n)&&t.push(n),e._prev&&st(e._prev,t,r)),t}function it(e,t){var r=t?t._numPrev+1:0;r<100&&(e._prev=t,e._numPrev=r)}function ot(){at()&&ut()}function at(){var e=Ne;return Ne=!1,Le=!1,e}function ut(){var e,t,r;do{for(;ze.length>0;)for(e=ze,ze=[],r=e.length,t=0;t<r;++t){var n=e[t];n[0].apply(null,n[1])}}while(ze.length>0);Ne=!0,Le=!0}function lt(){var e=Me;Me=[],e.forEach((e=>{e._PSD.onunhandled.call(null,e._value,e)}));for(var t=Je.slice(0),r=t.length;r;)t[--r]()}function ct(e){return new Qe(xe,!1,e)}function ht(e,t){var r=$e;return function(){var n=at(),s=$e;try{return _t(r,!0),e.apply(this,arguments)}catch(e){t&&t(e)}finally{_t(s,!1),n&&ut()}}}U(Qe.prototype,{then:Xe,_then:function(e,t){rt(this,new Ye(null,null,e,t,$e))},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):ct(e))):this.then(null,(e=>e&&e.name===t?r(e):ct(e)))},finally:function(e){return this.then((t=>(e(),t)),(t=>(e(),ct(t))))},stack:{get:function(){if(this._stack)return this._stack;try{Re=!0;var e=st(this,[],20).join("\nFrom previous: ");return null!==this._state&&(this._stack=e),e}finally{Re=!1}}},timeout:function(e,t){return e<1/0?new Qe(((r,n)=>{var s=setTimeout((()=>n(new me.Timeout(t))),e);this.then(r,n).finally(clearTimeout.bind(null,s))})):this}}),"undefined"!=typeof Symbol&&Symbol.toStringTag&&j(Qe.prototype,Symbol.toStringTag,"Dexie.Promise"),We.env=Ut(),U(Qe,{all:function(){var e=Z.apply(null,arguments).map(Tt);return new Qe((function(t,r){0===e.length&&t([]);var n=e.length;e.forEach(((s,i)=>Qe.resolve(s).then((r=>{e[i]=r,--n||t(e)}),r)))}))},resolve:e=>{if(e instanceof Qe)return e;if(e&&"function"==typeof e.then)return new Qe(((t,r)=>{e.then(t,r)}));var t=new Qe(xe,!0,e);return it(t,Ge),t},reject:ct,race:function(){var e=Z.apply(null,arguments).map(Tt);return new Qe(((t,r)=>{e.map((e=>Qe.resolve(e).then(t,r)))}))},PSD:{get:()=>$e,set:e=>$e=e},totalEchoes:{get:()=>mt},newPSD:vt,usePSD:kt,scheduler:{get:()=>Ke,set:e=>{Ke=e}},rejectionMapper:{get:()=>He,set:e=>{He=e}},follow:(e,t)=>new Qe(((r,n)=>vt(((t,r)=>{var n=$e;n.unhandleds=[],n.onunhandled=r,n.finalize=Ae((function(){!function(e){Je.push((function t(){e(),Je.splice(Je.indexOf(t),1)})),++Ve,Ke((()=>{0==--Ve&<()}),[])}((()=>{0===this.unhandleds.length?t():r(this.unhandleds[0])}))}),n.finalize),e()}),t,r,n)))}),Ce&&(Ce.allSettled&&j(Qe,"allSettled",(function(){const e=Z.apply(null,arguments).map(Tt);return new Qe((t=>{0===e.length&&t([]);let r=e.length;const n=new Array(r);e.forEach(((e,s)=>Qe.resolve(e).then((e=>n[s]={status:"fulfilled",value:e}),(e=>n[s]={status:"rejected",reason:e})).then((()=>--r||t(n)))))}))})),Ce.any&&"undefined"!=typeof AggregateError&&j(Qe,"any",(function(){const e=Z.apply(null,arguments).map(Tt);return new Qe(((t,r)=>{0===e.length&&r(new AggregateError([]));let n=e.length;const s=new Array(n);e.forEach(((e,i)=>Qe.resolve(e).then((e=>t(e)),(e=>{s[i]=e,--n||r(new AggregateError(s))}))))}))})));const pt={awaits:0,echoes:0,id:0};var ft=0,dt=[],gt=0,mt=0,yt=0;function vt(e,t,r,n){var s=$e,i=Object.create(s);i.parent=s,i.ref=0,i.global=!1,i.id=++yt;var o=We.env;i.env=Ie?{Promise:Qe,PromiseProp:{value:Qe,configurable:!0,writable:!0},all:Qe.all,race:Qe.race,allSettled:Qe.allSettled,any:Qe.any,resolve:Qe.resolve,reject:Qe.reject,nthen:St(o.nthen,i),gthen:St(o.gthen,i)}:{},t&&T(i,t),++s.ref,i.finalize=function(){--this.parent.ref||this.parent.finalize()};var a=kt(i,e,r,n);return 0===i.ref&&i.finalize(),a}function bt(){return pt.id||(pt.id=++ft),++pt.awaits,pt.echoes+=Se,pt.id}function wt(){return!!pt.awaits&&(0==--pt.awaits&&(pt.id=0),pt.echoes=pt.awaits*Se,!0)}function Tt(e){return pt.echoes&&e&&e.constructor===Ce?(bt(),e.then((e=>(wt(),e)),(e=>(wt(),Dt(e))))):e}function At(e){++mt,pt.echoes&&0!=--pt.echoes||(pt.echoes=pt.id=0),dt.push($e),_t(e,!0)}function qt(){var e=dt[dt.length-1];dt.pop(),_t(e,!1)}function _t(e,t){var r=$e;if((t?!pt.echoes||gt++&&e===$e:!gt||--gt&&e===$e)||jt(t?At.bind(null,e):qt),e!==$e&&($e=e,r===We&&(We.env=Ut()),Ie)){var n=We.env.Promise,s=e.env;Ee.then=s.nthen,n.prototype.then=s.gthen,(r.global||e.global)&&(Object.defineProperty(v,"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 Ut(){var e=v.Promise;return Ie?{Promise:e,PromiseProp:Object.getOwnPropertyDescriptor(v,"Promise"),all:e.all,race:e.race,allSettled:e.allSettled,any:e.any,resolve:e.resolve,reject:e.reject,nthen:Ee.then,gthen:e.prototype.then}:{}}function kt(e,t,r,n,s){var i=$e;try{return _t(e,!0),t(r,n,s)}finally{_t(i,!1)}}function jt(e){Oe.call(Pe,e)}function xt(e,t,r,n){return"function"!=typeof e?e:function(){var s=$e;r&&bt(),_t(t,!0);try{return e.apply(this,arguments)}finally{_t(s,!1),n&&jt(wt)}}}function St(e,t){return function(r,n){return e.call(this,xt(r,t),xt(n,t))}}-1===(""+Oe).indexOf("[native code]")&&(bt=wt=be);const Pt="unhandledrejection";function Et(e,t){var r;try{r=t.onuncatched(e)}catch(e){}if(!1!==r)try{var n,s={promise:t,reason:e};if(v.document&&document.createEvent?((n=document.createEvent("Event")).initEvent(Pt,!0,!0),T(n,s)):v.CustomEvent&&T(n=new CustomEvent(Pt,{detail:s}),s),n&&v.dispatchEvent&&(dispatchEvent(n),!v.PromiseRejectionEvent&&v.onunhandledrejection))try{v.onunhandledrejection(n)}catch(e){}te&&n&&!n.defaultPrevented&&console.warn(`Unhandled rejection: ${e.stack||e}`)}catch(e){}}var Dt=Qe.reject;function Ot(e,t,r,n){if(e.idbdb&&(e._state.openComplete||$e.letThrough||e._vip)){var s=e._createTransaction(t,r,e._dbSchema);try{s.create(),e._state.PR1398_maxLoop=3}catch(s){return s.name===de.InvalidState&&e.isOpen()&&--e._state.PR1398_maxLoop>0?(console.warn("Dexie: Need to reopen db"),e._close(),e.open().then((()=>Ot(e,t,r,n)))):Dt(s)}return s._promise(t,((e,t)=>vt((()=>($e.trans=s,n(e,t,s)))))).then((e=>s._completion.then((()=>e))))}if(e._state.openComplete)return Dt(new me.DatabaseClosed(e._state.dbOpenError));if(!e._state.isBeingOpened){if(!e._options.autoOpen)return Dt(new me.DatabaseClosed);e.open().catch(be)}return e._state.dbReadyPromise.then((()=>Ot(e,t,r,n)))}const Ct="3.2.7",It=String.fromCharCode(65535),Rt=-1/0,Bt="Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.",Kt="String expected.",Nt=[],Lt="undefined"!=typeof navigator&&/(MSIE|Trident|Edge)/.test(navigator.userAgent),Mt=Lt,Ft=Lt,Gt=e=>!/(dexie\.js|dexie\.min\.js)/.test(e),Ht="__dbnames",Wt="readonly",$t="readwrite";function zt(e,t){return e?t?function(){return e.apply(this,arguments)&&t.apply(this,arguments)}:e:t}const Vt={type:3,lower:-1/0,lowerOpen:!1,upper:[[]],upperOpen:!1};function Jt(e){return"string"!=typeof e||/\./.test(e)?e=>e:t=>(void 0===t[e]&&e in t&&delete(t=W(t))[e],t)}class Qt{_trans(e,t,r){const n=this._tx||$e.trans,s=this.name;function i(e,r,n){if(!n.schema[s])throw new me.NotFound("Table "+s+" not part of transaction");return t(n.idbtrans,n)}const o=at();try{return n&&n.db===this.db?n===$e.trans?n._promise(e,i,r):vt((()=>n._promise(e,i,r)),{trans:n,transless:$e.transless||$e}):Ot(this.db,e,[this.name],i)}finally{o&&ut()}}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(w(e))return new this.db.WhereClause(this,`[${e.join("+")}]`);const t=b(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=>{if(e.compound&&t.every((t=>e.keyPath.indexOf(t)>=0))){for(let r=0;r<t.length;++r)if(-1===t.indexOf(e.keyPath[r]))return!1;return!0}return!1})).sort(((e,t)=>e.keyPath.length-t.keyPath.length))[0];if(r&&this.db._maxKey!==It){const n=r.keyPath.slice(0,t.length);return this.where(n).equals(n.map((t=>e[t])))}!r&&te&&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?zt(r,o&&o.multi?e=>{const t=B(e,s);return w(t)&&t.some((e=>i(a,e)))}:e=>i(a,B(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,w(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,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){T(this,e)}))}add(e,t){const{auto:r,keyPath:n}=this.schema.primKey;let s=e;return n&&r&&(s=Jt(n)(e)),this._trans("readwrite",(e=>this.core.mutate({trans:e,type:"add",keys:null!=t?[t]:null,values:[s]}))).then((e=>e.numFailures?Qe.reject(e.failures[0]):e.lastResult)).then((t=>{if(n)try{K(e,n,t)}catch(e){}return t}))}update(e,t){if("object"!=typeof e||w(e))return this.where(":id").equals(e).modify(t);{const r=B(e,this.schema.primKey.keyPath);if(void 0===r)return Dt(new me.InvalidArgument("Given object does not contain its primary key"));try{"function"!=typeof t?b(t).forEach((r=>{K(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=Jt(n)(e)),this._trans("readwrite",(e=>this.core.mutate({trans:e,type:"put",values:[s],keys:null!=t?[t]:null}))).then((e=>e.numFailures?Qe.reject(e.failures[0]):e.lastResult)).then((t=>{if(n)try{K(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?Qe.reject(e.failures[0]):void 0))}clear(){return this._trans("readwrite",(e=>this.core.mutate({trans:e,type:"deleteRange",range:Vt}))).then((e=>e.numFailures?Qe.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 me.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");if(n&&n.length!==e.length)throw new me.InvalidArgument("Arguments objects and keys must have the same length");const o=e.length;let a=i&&r?e.map(Jt(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 fe(`${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 me.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");if(n&&n.length!==e.length)throw new me.InvalidArgument("Arguments objects and keys must have the same length");const o=e.length;let a=i&&r?e.map(Jt(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 fe(`${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 fe(`${this.name}.bulkDelete(): ${e} of ${t} operations failed`,n)}))}}function Xt(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=ke),s||(s=be);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}b(o=e).forEach((function(e){var t=o[e];if(w(t))i(e,o[e][0],o[e][1]);else{if("asap"!==t)throw new me.InvalidArgument("Invalid event config");var r=i(e,we,(function(){for(var e=arguments.length,t=new Array(e);e--;)t[e]=arguments[e];r.subscribers.forEach((function(e){I((function(){e.apply(null,t)}))}))}))}}))}}function Yt(e,t){return x(t).from({prototype:e}),t}function Zt(e,t){return!(e.filter||e.algorithm||e.or)&&(t?e.justLimit:!e.replayFilter)}function er(e,t){e.filter=zt(e.filter,t)}function tr(e,t,r){var n=e.replayFilter;e.replayFilter=n?()=>zt(n(),t()):t,e.justLimit=r&&!n}function rr(e,t){if(e.isPrimKey)return t.primaryKey;const r=t.getIndexByKeyPath(e.index);if(!r)throw new me.Schema("KeyPath "+e.index+" on object store "+t.name+" is not indexed");return r}function nr(e,t,r){const n=rr(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 sr(e,t,r,n){const s=e.replayFilter?zt(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)),_(i,a)||(i[a]=!0,t(e,r,n))}};return Promise.all([e.or._iterate(o,r),ir(nr(e,n,r),e.algorithm,o,!e.keysOnly&&e.valueMapper)])}return ir(nr(e,n,r),zt(e.algorithm,s),t,!e.keysOnly&&e.valueMapper)}function ir(e,t,r,n){var s=ht(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=be}),(t=>{e.fail(t),r=be}))||s(e.value,e,(e=>r=e)),r()}))}))}function or(e,t){try{const r=ar(e),n=ar(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}(ur(e),ur(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=or(e[r],t[r]);if(0!==n)return n}return r===n?0:r<n?-1:1}(e,t)}}catch(e){}return NaN}function ar(e){const t=typeof e;if("object"!==t)return t;if(ArrayBuffer.isView(e))return"binary";const r=J(e);return"ArrayBuffer"===r?"binary":r}function ur(e){return e instanceof Uint8Array?e:ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):new Uint8Array(e)}class lr{_read(e,t){var r=this._ctx;return r.error?r.table._trans(null,Dt.bind(null,r.error)):r.table._trans("readonly",e).then(t)}_write(e){var t=this._ctx;return t.error?t.table._trans(null,Dt.bind(null,t.error)):t.table._trans("readwrite",e,"locked")}_addAlgorithm(e){var t=this._ctx;t.algorithm=zt(t.algorithm,e)}_iterate(e,t){return sr(this._ctx,e,t,this._ctx.table.core)}clone(e){var t=Object.create(this.constructor.prototype),r=Object.create(this._ctx);return e&&T(r,e),t._ctx=r,t}raw(){return this._ctx.valueMapper=null,this}each(e){var t=this._ctx;return this._read((r=>sr(t,e,r,t.table.core)))}count(e){return this._read((e=>{const t=this._ctx,r=t.table.core;if(Zt(t,!0))return r.count({trans:e,query:{index:rr(t,r.schema),range:t.range}}).then((e=>Math.min(e,t.limit)));var n=0;return sr(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&&Zt(t,!0)&&t.limit>0){const{valueMapper:r}=t,n=rr(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 sr(t,(e=>r.push(e)),e,t.table.core).then((()=>r))}}),e)}offset(e){var t=this._ctx;return e<=0||(t.offset+=e,Zt(t)?tr(t,(()=>{var t=e;return(e,r)=>0===t||(1===t?(--t,!1):(r((()=>{e.advance(t),t=0})),!1))})):tr(t,(()=>{var t=e;return()=>--t<0}))),this}limit(e){return this._ctx.limit=Math.min(this._ctx.limit,e),tr(this._ctx,(()=>{var t=e;return function(e,r,n){return--t<=0&&r(n),t>=0}}),!0),this}until(e,t){return er(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 er(this._ctx,(function(t){return e(t.value)})),t=this._ctx,r=e,t.isMatch=zt(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&&Zt(t,!0)&&t.limit>0)return this._read((e=>{var r=rr(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 er(this._ctx,(function(e){var t=e.primaryKey.toString(),n=_(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=b(e),i=s.length;n=function(t){for(var r=!1,n=0;n<i;++n){var o=s[n],a=e[o];B(t,o)!==a&&(K(t,o,a),r=!0)}return r}}const o=t.table.core,{outbound:a,extractKey:u}=o.schema.primaryKey,l=this.db._options.modifyChunkSize||200,c=[];let h=0;const p=[],f=(e,t)=>{const{failures:r,numFailures:n}=t;h+=e-n;for(let e of b(r))c.push(r[e])};return this.clone().primaryKeys().then((s=>{const i=c=>{const h=Math.min(l,s.length-c);return o.getMany({trans:r,keys:s.slice(c,c+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:W(t),primKey:s[c+e]};!1!==n.call(r,r.value,r)&&(null==r.value?y.push(s[c+e]):a||0===or(u(t),u(r.value))?(g.push(r.value),a&&m.push(s[c+e])):(y.push(s[c+e]),d.push(r.value)))}const v=Zt(t)&&t.limit===1/0&&("function"!=typeof e||e===cr)&&{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===cr)&&o.mutate({trans:r,type:"delete",keys:y,criteria:v}).then((e=>f(y.length,e))))).then((()=>s.length>c+h&&i(c+l)))}))};return i(0).then((()=>{if(c.length>0)throw new pe("Error modifying one or more objects",c,h,p);return s.length}))}))}))}delete(){var e=this._ctx,t=e.range;return Zt(e)&&(e.isPrimKey&&!Ft||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 pe("Could not delete some values",Object.keys(e).map((t=>e[t])),t-s);return t-s}))))})):this.modify(cr)}}const cr=(e,t)=>t.value=null;function hr(e,t){return e<t?-1:e===t?0:1}function pr(e,t){return e>t?-1:e===t?0:1}function fr(e,t,r){var n=e instanceof br?new e.Collection(e):e;return n._ctx.error=r?new r(t):new TypeError(t),n}function dr(e){return new e.Collection(e,(()=>vr(""))).limit(0)}function gr(e,t,r,n,s,i){for(var o=Math.min(e.length,n.length),a=-1,u=0;u<o;++u){var l=t[u];if(l!==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],l)<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 mr(e,t,r,n){var s,i,o,a,u,l,c,h=r.length;if(!r.every((e=>"string"==typeof e)))return fr(e,Kt);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?hr:pr;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})),l=e,c="next"===e?"":n}p("next");var f=new e.Collection(e,(()=>yr(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=gr(s,p,a[g],u[g],o,l);null===m&&null===f?d=g+1:(null===f||o(f,m)>0)&&(f=m)}return r(null!==f?function(){e.continue(f+c)}:n),!1})),f}function yr(e,t,r,n){return{type:2,lower:e,upper:t,lowerOpen:r,upperOpen:n}}function vr(e){return{type:1,lower:e,upper:e}}class br{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)?dr(this):new this.Collection(this,(()=>yr(e,t,!r,!n)))}catch(e){return fr(this,Bt)}}equals(e){return null==e?fr(this,Bt):new this.Collection(this,(()=>vr(e)))}above(e){return null==e?fr(this,Bt):new this.Collection(this,(()=>yr(e,void 0,!0)))}aboveOrEqual(e){return null==e?fr(this,Bt):new this.Collection(this,(()=>yr(e,void 0,!1)))}below(e){return null==e?fr(this,Bt):new this.Collection(this,(()=>yr(void 0,e,!1,!0)))}belowOrEqual(e){return null==e?fr(this,Bt):new this.Collection(this,(()=>yr(void 0,e)))}startsWith(e){return"string"!=typeof e?fr(this,Kt):this.between(e,e+It,!0,!0)}startsWithIgnoreCase(e){return""===e?this.startsWith(e):mr(this,((e,t)=>0===e.indexOf(t[0])),[e],It)}equalsIgnoreCase(e){return mr(this,((e,t)=>e===t[0]),[e],"")}anyOfIgnoreCase(){var e=Z.apply(Y,arguments);return 0===e.length?dr(this):mr(this,((e,t)=>-1!==t.indexOf(e)),e,"")}startsWithAnyOfIgnoreCase(){var e=Z.apply(Y,arguments);return 0===e.length?dr(this):mr(this,((e,t)=>t.some((t=>0===e.indexOf(t)))),e,It)}anyOf(){const e=Z.apply(Y,arguments);let t=this._cmp;try{e.sort(t)}catch(e){return fr(this,Bt)}if(0===e.length)return dr(this);const r=new this.Collection(this,(()=>yr(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([[Rt,e],[e,this.db._maxKey]],{includeLowers:!1,includeUppers:!1})}noneOf(){const e=Z.apply(Y,arguments);if(0===e.length)return new this.Collection(this);try{e.sort(this._ascending)}catch(e){return fr(this,Bt)}const t=e.reduce(((e,t)=>e?e.concat([[e[e.length-1][1],t]]):[[Rt,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 dr(this);if(!e.every((e=>void 0!==e[0]&&void 0!==e[1]&&n(e[0],e[1])<=0)))return fr(this,"First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower",me.InvalidArgument);const a=!t||!1!==t.includeLowers,u=t&&!0===t.includeUppers;let l,c=n;function h(e,t){return c(e[0],t[0])}try{l=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}),[]),l.sort(h)}catch(e){return fr(this,Bt)}let p=0;const f=u?e=>n(e,l[p][1])>0:e=>n(e,l[p][1])>=0,d=a?e=>s(e,l[p][0])>0:e=>s(e,l[p][0])>=0;let g=f;const m=new this.Collection(this,(()=>yr(l[0][0],l[l.length-1][1],!a,!u)));return m._ondirectionchange=e=>{"next"===e?(g=f,c=n):(g=d,c=s),l.sort(h)},m._addAlgorithm(((e,t,r)=>{for(var s=e.key;g(s);)if(++p,p===l.length)return t(r),!1;return!!function(e){return!f(e)&&!d(e)}(s)||(0===this._cmp(s,l[p][1])||0===this._cmp(s,l[p][0])||t((()=>{c===n?e.continue(l[p][0]):e.continue(l[p][1])})),!1)})),m}startsWithAnyOf(){const e=Z.apply(Y,arguments);return e.every((e=>"string"==typeof e))?0===e.length?dr(this):this.inAnyRange(e.map((e=>[e,e+It]))):fr(this,"startsWithAnyOf() only works with strings")}}function wr(e){return ht((function(t){return Tr(t),e(t.target.error),!1}))}function Tr(e){e.stopPropagation&&e.stopPropagation(),e.preventDefault&&e.preventDefault()}const Ar="storagemutated",qr="x-storagemutated-1",_r=Xt(null,Ar);class Ur{_lock(){return C(!$e.global),++this._reculock,1!==this._reculock||$e.global||($e.lockOwnerFor=this),this}_unlock(){if(C(!$e.global),0==--this._reculock)for($e.global||($e.lockOwnerFor=null);this._blockedFuncs.length>0&&!this._locked();){var e=this._blockedFuncs.shift();try{kt(e[1],e[0])}catch(e){}}return this}_locked(){return this._reculock&&$e.lockOwnerFor!==this}create(e){if(!this.mode)return this;const t=this.db.idbdb,r=this.db._state.dbOpenError;if(C(!this.idbtrans),!e&&!t)switch(r&&r.name){case"DatabaseClosedError":throw new me.DatabaseClosed(r);case"MissingAPIError":throw new me.MissingAPI(r.message,r);default:throw new me.OpenFailed(r)}if(!this.active)throw new me.TransactionInactive;return C(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=ht((t=>{Tr(t),this._reject(e.error)})),e.onabort=ht((t=>{Tr(t),this.active&&this._reject(new me.Abort(e.error)),this.active=!1,this.on("abort").fire(t)})),e.oncomplete=ht((()=>{this.active=!1,this._resolve(),"mutatedParts"in e&&_r.storagemutated.fire(e.mutatedParts)})),this}_promise(e,t,r){if("readwrite"===e&&"readwrite"!==this.mode)return Dt(new me.ReadOnly("Transaction is readonly"));if(!this.active)return Dt(new me.TransactionInactive);if(this._locked())return new Qe(((n,s)=>{this._blockedFuncs.push([()=>{this._promise(e,t,r).then(n,s)},$e])}));if(r)return vt((()=>{var e=new Qe(((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 Qe(((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=Qe.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 Qe(((e,n)=>{r.then((r=>t._waitingQueue.push(ht(e.bind(null,r)))),(e=>t._waitingQueue.push(ht(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 me.Abort))}table(e){const t=this._memoizedTables||(this._memoizedTables={});if(_(t,e))return t[e];const r=this.schema[e];if(!r)throw new me.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 kr(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?"++":"")+jr(t)}}function jr(e){return"string"==typeof e?e:e?"["+[].join.call(e,"+")+"]":""}function xr(e,t,r){return{name:e,primKey:t,indexes:r,mappedClass:null,idxByName:R(r,(e=>[e.name,e]))}}let Sr=e=>{try{return e.only([[]]),Sr=()=>[[]],[[]]}catch(e){return Sr=()=>It,It}};function Pr(e){return null==e?()=>{}:"string"==typeof e?function(e){return 1===e.split(".").length?t=>t[e]:t=>B(t,e)}(e):t=>B(t,e)}function Er(e){return[].slice.call(e)}let Dr=0;function Or(e){return null==e?":id":"string"==typeof e?e:`[${e.join("+")}]`}function Cr(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=Er(e.objectStoreNames);return{schema:{name:e.name,tables:r.map((e=>t.objectStore(e))).map((e=>{const{keyPath:t,autoIncrement:r}=e,n=w(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:Pr(t)},indexes:Er(e.indexNames).map((t=>e.index(t))).map((e=>{const{name:t,unique:r,multiEntry:n,keyPath:s}=e,o={name:t,compound:w(s),keyPath:s,unique:r,multiEntry:n,extractKey:Pr(s)};return i[Or(s)]=o,o})),getIndexByKeyPath:e=>i[Or(e)]};return i[":id"]=o.primaryKey,null!=t&&(i[Or(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=ht(a);const l=e.objectStore(t),c=null==l.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,Tr(e)};if("deleteRange"===r){if(4===o.type)return a({numFailures:m,failures:g,results:[],lastResult:void 0});3===o.type?d.push(f=l.clear()):d.push(f=l.delete(n(o)))}else{const[e,t]=h?c?[i,s]:[i,null]:[s,null];if(h)for(let n=0;n<p;++n)d.push(f=t&&void 0!==t[n]?l[r](e[n],t[n]):l[r](e[n])),f.onerror=y;else for(let t=0;t<p;++t)d.push(f=l[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=ht(n);const i=e.objectStore(t),o=r.length,a=new Array(o);let u,l=0,c=0;const h=e=>{const t=e.target;a[t._pos]=t.result,++c===l&&n(a)},p=wr(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,++l);0===l&&n(a)})),get:({trans:e,key:r})=>new Promise(((n,s)=>{n=ht(n);const i=e.objectStore(t).get(r);i.onsuccess=e=>n(e.target.result),i.onerror=wr(s)})),query:function(e){return r=>new Promise(((s,i)=>{s=ht(s);const{trans:o,values:a,limit:u,query:l}=r,c=u===1/0?void 0:u,{index:h,range:p}=l,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,c):d.getAllKeys(g,c);e.onsuccess=e=>s({result:e.target.result}),e.onerror=wr(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=wr(i)}}))}(i),openCursor:function({trans:e,values:r,query:s,reverse:i,unique:o}){return new Promise(((a,u)=>{a=ht(a);const{index:l,range:c}=s,h=e.objectStore(t),p=l.isPrimaryKey?h:h.index(l.name),f=i?o?"prevunique":"prev":o?"nextunique":"next",d=r||!("openKeyCursor"in p)?p.openCursor(n(c),f):p.openKeyCursor(n(c),f);d.onerror=wr(u),d.onsuccess=ht((t=>{const r=d.result;if(!r)return void a(null);r.___id=++Dr,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=ht(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=ht(e),d.onerror=wr(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=ht((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),l=n(i),c=l?u.count(l):u.count();c.onsuccess=ht((t=>e(t.target.result))),c.onerror=wr(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:Sr(t),schema:s}}function Ir({_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)}(Cr(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 Rr({_novip:e},t,r,n){r.forEach((r=>{const s=n[r];t.forEach((t=>{const n=P(t,r);(!n||"value"in n&&void 0===n.value)&&(t===e.Transaction.prototype||t instanceof e.Transaction?j(t,r,{get(){return this.table(r)},set(e){k(this,r,{value:e,writable:!0,configurable:!0,enumerable:!0})}}):t[r]=new e.Table(r,s))}))}))}function Br({_novip:e},t){t.forEach((t=>{for(let r in t)t[r]instanceof e.Table&&delete t[r]}))}function Kr(e,t){return e._cfg.version-t._cfg.version}function Nr(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=$e.transless||$e;vt((()=>{$e.trans=i,$e.transless=a,0===t?(b(s).forEach((e=>{Mr(r,e,s[e].primKey,s[e].indexes)})),Ir(e,r),Qe.follow((()=>e.on.populate.fire(i))).catch(o)):function({_novip:e},t,r,n){const s=[],i=e._versions;let o=e._dbSchema=Gr(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;Hr(e,s,n),Hr(e,u,n),o=e._dbSchema=u;const l=Lr(s,u);l.add.forEach((e=>{Mr(n,e[0],e[1].primKey,e[1].indexes)})),l.change.forEach((e=>{if(e.recreate)throw new me.Upgrade("Not yet support for changing primary key");{const t=n.objectStore(e.name);e.add.forEach((e=>Fr(t,e))),e.change.forEach((e=>{t.deleteIndex(e.name),Fr(t,e)})),e.del.forEach((e=>t.deleteIndex(e)))}}));const c=i._cfg.contentUpgrade;if(c&&i._cfg.version>t){Ir(e,n),r._memoizedTables={},a=!0;let t=N(u);l.del.forEach((e=>{t[e]=s[e]})),Br(e,[e.Transaction.prototype]),Rr(e,[e.Transaction.prototype],b(t),t),r.schema=t;const i=ee(c);let o;i&&bt();const h=Qe.follow((()=>{if(o=c(r),o&&i){var e=wt.bind(null,null);o.then(e,e)}}));return o&&"function"==typeof o.then?Qe.resolve(o):h.then((()=>o))}})),s.push((t=>{a&&Mt||function(e,t){[].slice.call(t.db.objectStoreNames).forEach((r=>null==e[r]&&t.db.deleteObjectStore(r)))}(i._cfg.dbschema,t),Br(e,[e.Transaction.prototype]),Rr(e,[e.Transaction.prototype],e._storeNames,e._dbSchema),r.schema=e._dbSchema}))})),function e(){return s.length?Qe.resolve(s.shift()(r.idbtrans)).then(e):Qe.resolve()}().then((()=>{var e,t;t=n,b(e=o).forEach((r=>{t.db.objectStoreNames.contains(r)||Mr(t,r,e[r].primKey,e[r].indexes)}))}))}(e,t,i,r).catch(o)}))}function Lr(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&&!Lt)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 Mr(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=>Fr(s,e))),s}function Fr(e,t){e.createIndex(t.name,t.keyPath,{unique:t.unique,multiEntry:t.multi})}function Gr(e,t,r){const n={};return D(t.objectStoreNames,0).forEach((e=>{const t=r.objectStore(e);let s=t.keyPath;const i=kr(jr(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=kr(r.name,s,!!r.unique,!!r.multiEntry,!1,s&&"string"!=typeof s,!1);o.push(a)}n[e]=xr(e,i,o)})),n}function Hr({_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:"["+D(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)&&v.WorkerGlobalScope&&v instanceof v.WorkerGlobalScope&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604&&(e._hasGetAll=!1)}class Wr{_parseStoresSpec(e,t){b(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 kr(r,n||null,/\&/.test(e),/\*/.test(e),/\+\+/.test(e),w(n),0===t)})),s=n.shift();if(s.multi)throw new me.Schema("Primary key cannot be multi-valued");n.forEach((e=>{if(e.auto)throw new me.Schema("Only primary key can be marked as autoIncrement (++)");if(!e.keyPath)throw new me.Schema("Index must have a name and cannot be an empty string")})),t[r]=xr(r,s,n)}}))}stores(e){const t=this.db;this._cfg.storesSource=this._cfg.storesSource?T(this._cfg.storesSource,e):e;const r=t._versions,n={};let s={};return r.forEach((e=>{T(n,e._cfg.storesSource),s=e._cfg.dbschema={},e._parseStoresSpec(n,s)})),t._dbSchema=s,Br(t,[t._allTables,t,t.Transaction.prototype]),Rr(t,[t._allTables,t,t.Transaction.prototype,this._cfg.tables],b(s),s),t._storeNames=b(s),this}upgrade(e){return this._cfg.contentUpgrade=je(this._cfg.contentUpgrade||be,e),this}}function $r(e,t){let r=e._dbNamesDB;return r||(r=e._dbNamesDB=new dn(Ht,{addons:[],indexedDB:e,IDBKeyRange:t}),r.version(1).stores({dbnames:"name"})),r.table("dbnames")}function zr(e){return e&&"function"==typeof e.databases}function Vr(e){return vt((function(){return $e.letThrough=!0,e()}))}function Jr(){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 Qr(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):w(i)?Promise.all(i).then(r,n):r(i)}}return s(t)()}function Xr(e,t,r){var n=arguments.length;if(n<2)throw new me.InvalidArgument("Too few arguments");for(var s=new Array(n-1);--n;)s[n-1]=arguments[n];return r=s.pop(),[e,M(s),r]}function Yr(e,t,r,n,s){return Qe.resolve().then((()=>{const i=$e.transless||$e,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===de.InvalidState&&e.isOpen()&&--e._state.PR1398_maxLoop>0?(console.warn("Dexie: Need to reopen db"),e._close(),e.open().then((()=>Yr(e,t,r,null,s)))):Dt(n)}const u=ee(s);let l;u&&bt();const c=Qe.follow((()=>{if(l=s.call(o,o),l)if(u){var e=wt.bind(null,null);l.then(e,e)}else"function"==typeof l.next&&"function"==typeof l.throw&&(l=Qr(l))}),a);return(l&&"function"==typeof l.then?Qe.resolve(l).then((e=>o.active?e:Dt(new me.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn")))):c.then((()=>l))).then((e=>(n&&o._resolve(),o._completion.then((()=>e))))).catch((e=>(o._reject(e),Dt(e))))}))}function Zr(e,t,r){const n=w(e)?e.slice():[e];for(let e=0;e<r;++e)n.push(t);return n}const en={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=Or(e),a=s[n]=s[n]||[],u=null==e?0:"string"==typeof e?1:e.length,l=t>0,c={...r,isVirtual:l,keyTail:t,keyLength:u,extractKey:Pr(e),unique:!l&&r.unique};return a.push(c),c.isPrimaryKey||i.push(c),u>1&&o(2===u?e[0]:e.slice(0,u-1),t+1,r),a.sort(((e,t)=>e.keyTail-t.keyTail)),c}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:Zr(n.lower,n.lowerOpen?e.MAX_KEY:e.MIN_KEY,s),lowerOpen:!0,upper:Zr(n.upper,n.upperOpen?e.MIN_KEY:e.MAX_KEY,s),upperOpen:!0})}}:t;var n,s}const l={...r,schema:{...n,primaryKey:a,indexes:i,getIndexByKeyPath:function(e){const t=s[Or(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(Zr(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(Zr(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 l}}}};function tn(e,t,r,n){return r=r||{},n=n||"",b(e).forEach((s=>{if(_(t,s)){var i=e[s],o=t[s];if("object"==typeof i&&"object"==typeof o&&i&&o){const e=J(i);e!==J(o)?r[n+s]=t[s]:"Object"===e?tn(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})),b(t).forEach((s=>{_(e,s)||(r[n+s]=t[s])})),r}const rn={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=$e.trans,{deleting:i,creating:o,updating:a}=s.table(t).hook;switch(e.type){case"add":if(o.fire===be)break;return s._promise("readwrite",(()=>u(e)),!0);case"put":if(o.fire===be&&a.fire===be)break;return s._promise("readwrite",(()=>u(e)),!0);case"delete":if(i.fire===be)break;return s._promise("readwrite",(()=>u(e)),!0);case"deleteRange":if(i.fire===be)break;return s._promise("readwrite",(()=>function(e){return l(e.trans,e.range,1e4)}(e)),!0)}return r.mutate(e);function u(e){const t=$e.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 l=s.map(((r,s)=>{const l=u[s],c={onerror:null,onsuccess:null};if("delete"===e.type)i.fire.call(c,r,l,t);else if("add"===e.type||void 0===l){const i=o.fire.call(c,r,e.values[s],t);null==r&&null!=i&&(r=i,e.keys[s]=r,n.outbound||K(e.values[s],n.keyPath,r))}else{const n=tn(l,e.values[s]),i=a.fire.call(c,n,r,l,t);if(i){const t=e.values[s];Object.keys(i).forEach((e=>{_(t,e)?t[e]=i[e]:K(t,e,i[e])}))}}return c}));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=l[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=>(l.forEach((t=>t.onerror&&t.onerror(e))),Promise.reject(e))))}))}function l(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}:l(e,{...t,lower:r[r.length-1],lowerOpen:!0},s)))))}}};return s}})};function nn(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===or(t.keys[s],e[i])&&(n.push(r?W(t.values[s]):t.values[s]),++i);return n.length===e.length?n:null}catch(e){return null}}const sn={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=nn(e.keys,e.trans._cache,"clone"===e.cache);return t?Qe.resolve(t):r.getMany(e).then((t=>(e.trans._cache={keys:e.keys,values:"clone"===e.cache?W(t):t},t)))},mutate:e=>("add"!==e.type&&(e.trans._cache=null),r.mutate(e))}}})};function on(e){return!("from"in e)}const an=function(e,t){if(!this){const t=new an;return e&&"d"in e&&T(t,e),t}T(this,arguments.length?{d:1,from:e,to:arguments.length>1?t:e}:{d:0})};function un(e,t,r){const n=or(t,r);if(isNaN(n))return;if(n>0)throw RangeError();if(on(e))return T(e,{from:t,to:r,d:1});const s=e.l,i=e.r;if(or(r,e.from)<0)return s?un(s,t,r):e.l={from:t,to:r,d:1,l:null,r:null},hn(e);if(or(t,e.to)>0)return i?un(i,t,r):e.r={from:t,to:r,d:1,l:null,r:null},hn(e);or(t,e.from)<0&&(e.from=t,e.l=null,e.d=i?i.d+1:1),or(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&&ln(e,s),i&&o&&ln(e,i)}function ln(e,t){on(t)||function e(t,{from:r,to:n,l:s,r:i}){un(t,r,n),s&&e(t,s),i&&e(t,i)}(e,t)}function cn(e){let t=on(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&&or(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||or(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 hn(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=pn(r)}e.d=pn(e)}function pn({r:e,l:t}){return(e?t?Math.max(e.d,t.d):e.d:t?t.d:0)+1}U(an.prototype,{add(e){return ln(this,e),this},addKey(e){return un(this,e,e),this},addKeys(e){return e.forEach((e=>un(this,e,e))),this},[Q](){return cn(this)}});const fn={stack:"dbcore",level:0,create:e=>{const t=e.schema.name,r=new an(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,l={...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 an)},l=u(""),c=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(w(p)){"delete"!==h&&(p=e.results),l.addKeys(p);const t=nn(p,d);t||"add"===h||c.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&&w(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!==or(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};c.add(e),l.add(e)}else l.add(r),c.add(r),i.indexes.forEach((e=>u(e.name).add(r)));return e}))}},c=({query:{index:t,range:r}})=>{var n,s;return[t,new an(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 an(e.key)],getMany:e=>[o,(new an).addKeys(e.keys)],count:c,query:c,openCursor:c};return b(h).forEach((e=>{l[e]=function(i){const{subscr:o}=$e;if(o){const l=e=>{const r=`idb://${t}/${n}/${e}`;return o[r]||(o[r]=new an)},c=l(""),p=l(":dels"),[f,d]=h[e](i);if(l(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})=>(c.addKeys(e),r)));const e=i.values?r.result.map(a):r.result;i.values?c.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&&c.addKey(e.primaryKey),e.value)}})}return r}))}p.add(r)}}return s[e].apply(this,arguments)}})),l}}}};class dn{constructor(e,t){this._middlewares={},this.verno=0;const r=dn.dependencies;this._options=t={addons:dn.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:be,dbReadyPromise:null,cancelOpen:be,openCanceller:null,autoSchema:!0,PR1398_maxLoop:3};var i;s.dbReadyPromise=new Qe((e=>{s.dbReadyResolve=e})),s.openCanceller=new Qe(((e,t)=>{s.cancelOpen=t})),this._state=s,this.name=e,this.on=Xt(this,"populate","blocked","versionchange","close",{ready:[je,be]}),this.on.ready.subscribe=O(this.on.ready.subscribe,(e=>(t,r)=>{dn.vip((()=>{const n=this._state;if(n.openComplete)n.dbOpenError||Qe.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,Yt(lr.prototype,(function(e,t){this.db=i;let r=Vt,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!==we?a:null}}))),this.Table=function(e){return Yt(Qt.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:Xt(null,{creating:[qe,be],reading:[Te,we],updating:[Ue,be],deleting:[_e,be]})}))}(this),this.Transaction=function(e){return Yt(Ur.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=Xt(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 Qe(((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(),Dt(e)}))}))}(this),this.Version=function(e){return Yt(Wr.prototype,(function(t){this.db=e,this._cfg={version:t,storesSource:null,dbschema:{},tables:{},contentUpgrade:null}}))}(this),this.WhereClause=function(e){return Yt(br.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 me.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=Sr(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),Nt.filter((e=>e.name===this.name&&e!==this&&!e._state.vcFired)).map((t=>t.on("versionchange").fire(e)))},this.use(en),this.use(rn),this.use(fn),this.use(sn),this.vip=Object.create(this,{_vip:{value:!0}}),n.forEach((e=>e(this)))}version(e){if(isNaN(e)||e<.1)throw new me.Type("Given version is not a positive number");if(e=Math.round(10*e)/10,this.idbdb||this._state.isBeingOpened)throw new me.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(Kr),r.stores({}),this._state.autoSchema=!1,r)}_whenReady(e){return this.idbdb&&(this._state.openComplete||$e.letThrough||this._vip)?e():new Qe(((e,t)=>{if(this._state.openComplete)return t(new me.DatabaseClosed(this._state.dbOpenError));if(!this._state.isBeingOpened){if(!this._options.autoOpen)return void t(new me.DatabaseClosed);this.open().catch(be)}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?Dt(t.dbOpenError):e));te&&(t.openCanceller._stackHolder=ie()),t.isBeingOpened=!0,t.dbOpenError=null,t.openComplete=!1;const n=t.openCanceller;function s(){if(t.openCanceller!==n)throw new me.DatabaseClosed("db.open() was cancelled")}let i=t.dbReadyResolve,o=null,a=!1;const u=()=>new Qe(((n,i)=>{if(s(),!r)throw new me.MissingAPI;const u=e.name,l=t.autoSchema?r.open(u):r.open(u,Math.round(10*e.verno));if(!l)throw new me.MissingAPI;l.onerror=wr(i),l.onblocked=ht(e._fireOnBlocked),l.onupgradeneeded=ht((n=>{if(o=l.transaction,t.autoSchema&&!e._options.allowEmptyDB){l.onerror=Tr,o.abort(),l.result.close();const e=r.deleteDatabase(u);e.onsuccess=e.onerror=ht((()=>{i(new me.NoSuchDatabase(`Database ${u} doesnt exist`))}))}else{o.onerror=wr(i);var s=n.oldVersion>Math.pow(2,62)?0:n.oldVersion;a=s<1,e._novip.idbdb=l.result,Nr(e,s/10,o,i)}}),i),l.onsuccess=ht((()=>{o=null;const r=e._novip.idbdb=l.result,s=D(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=Gr(0,t,r);e._storeNames=D(t.objectStoreNames,0),Rr(e,[e._allTables],b(n),n)}(e,r,n):(Hr(e,e._dbSchema,n),function(e,t){const r=Lr(Gr(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.")),Ir(e,n)}catch(e){}var i;Nt.push(e),r.onversionchange=ht((r=>{t.vcFired=!0,e.on("versionchange").fire(r)})),r.onclose=ht((t=>{e.on("close").fire(t)})),a&&function({indexedDB:e,IDBKeyRange:t},r){!zr(e)&&r!==Ht&&$r(e,t).put({name:r}).catch(be)}(e._deps,u),n()}),i)})).catch((e=>e&&"UnknownError"===e.name&&t.PR1398_maxLoop>0?(t.PR1398_maxLoop--,console.warn("Dexie: Workaround for Chrome UnknownError on open()"),u()):Qe.reject(e)));return Qe.race([n,("undefined"==typeof navigator?Qe.resolve():Jr()).then(u)]).then((()=>(s(),t.onReadyBeingFired=[],Qe.resolve(Vr((()=>e.on.ready.fire(e.vip)))).then((function r(){if(t.onReadyBeingFired.length>0){let n=t.onReadyBeingFired.reduce(je,be);return t.onReadyBeingFired=[],Qe.resolve(Vr((()=>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(),Dt(r)})).finally((()=>{t.openComplete=!0,i()}))}(this)}_close(){const e=this._state,t=Nt.indexOf(this);if(t>=0&&Nt.splice(t,1),this.idbdb){try{this.idbdb.close()}catch(e){}this._novip.idbdb=null}e.dbReadyPromise=new Qe((t=>{e.dbReadyResolve=t})),e.openCanceller=new Qe(((t,r)=>{e.cancelOpen=r}))}close(){this._close();const e=this._state;this._options.autoOpen=!1,e.dbOpenError=new me.DatabaseClosed,e.isBeingOpened&&e.cancelOpen(e.dbOpenError)}delete(){const e=arguments.length>0,t=this._state;return new Qe(((r,n)=>{const s=()=>{this.close();var e=this._deps.indexedDB.deleteDatabase(this.name);e.onsuccess=ht((()=>{!function({indexedDB:e,IDBKeyRange:t},r){!zr(e)&&r!==Ht&&$r(e,t).delete(r).catch(be)}(this._deps,this.name),r()})),e.onerror=wr(n),e.onblocked=this._fireOnBlocked};if(e)throw new me.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 b(this._allTables).map((e=>this._allTables[e]))}transaction(){const e=Xr.apply(this,arguments);return this._transaction.apply(this,e)}_transaction(e,t,r){let n=$e.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===Wt)i=Wt;else{if("rw"!=e&&e!=$t)throw new me.InvalidArgument("Invalid transaction mode: "+e);i=$t}if(n){if(n.mode===Wt&&i===$t){if(!s)throw new me.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 me.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)})):Dt(e)}const a=Yr.bind(null,this,i,o,n,r);return n?n._promise(i,a,"lock"):$e.trans?kt($e.transless,(()=>this._whenReady(a))):this._whenReady(a)}table(e){if(!_(this._allTables,e))throw new me.InvalidTable(`Table ${e} does not exist`);return this._allTables[e]}}const gn="undefined"!=typeof Symbol&&"observable"in Symbol?Symbol.observable:"@@observable";class mn{constructor(e){this._subscribe=e}subscribe(e,t,r){return this._subscribe(e&&"function"!=typeof e?e:{next:e,error:t,complete:r})}[gn](){return this}}function yn(e,t){return b(t).forEach((r=>{ln(e[r]||(e[r]=new an),t[r])})),e}let vn;try{vn={indexedDB:v.indexedDB||v.mozIndexedDB||v.webkitIndexedDB||v.msIndexedDB,IDBKeyRange:v.IDBKeyRange||v.webkitIDBKeyRange}}catch(v){vn={indexedDB:null,IDBKeyRange:null}}const bn=dn;function wn(e){let t=Tn;try{Tn=!0,_r.storagemutated.fire(e)}finally{Tn=t}}U(bn,{...ve,delete:e=>new bn(e,{addons:[]}).delete(),exists:e=>new bn(e,{addons:[]}).open().then((e=>(e.close(),!0))).catch("NoSuchDatabaseError",(()=>!1)),getDatabaseNames(e){try{return function({indexedDB:e,IDBKeyRange:t}){return zr(e)?Promise.resolve(e.databases()).then((e=>e.map((e=>e.name)).filter((e=>e!==Ht)))):$r(e,t).toCollection().primaryKeys()}(bn.dependencies).then(e)}catch(e){return Dt(new me.MissingAPI)}},defineClass:()=>function(e){T(this,e)},ignoreTransaction:e=>$e.trans?kt($e.transless,e):e(),vip:Vr,async:function(e){return function(){try{var t=Qr(e.apply(this,arguments));return t&&"function"==typeof t.then?t:Qe.resolve(t)}catch(e){return Dt(e)}}},spawn:function(e,t,r){try{var n=Qr(e.apply(r,t||[]));return n&&"function"==typeof n.then?n:Qe.resolve(n)}catch(e){return Dt(e)}},currentTransaction:{get:()=>$e.trans||null},waitFor:function(e,t){const r=Qe.resolve("function"==typeof e?bn.ignoreTransaction(e):e).timeout(t||6e4);return $e.trans?$e.trans.waitFor(r):r},Promise:Qe,debug:{get:()=>te,set:e=>{re(e,"dexie"===e?()=>!0:Gt)}},derive:x,extend:T,props:U,override:O,Events:Xt,on:_r,liveQuery:function(e){let t,r=!1;const n=new mn((n=>{const s=ee(e);let i=!1,o={},a={};const u={get closed(){return i},unsubscribe:()=>{i=!0,_r.storagemutated.unsubscribe(p)}};n.start&&n.start(u);let l=!1,c=!1;function h(){return b(a).some((e=>o[e]&&function(e,t){const r=cn(t);let n=r.next();if(n.done)return!1;let s=n.value;const i=cn(e);let o=i.next(s.from),a=o.value;for(;!n.done&&!o.done;){if(or(a.from,s.to)<=0&&or(a.to,s.from)>=0)return!0;or(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=>{yn(o,e),h()&&f()},f=()=>{if(l||i)return;o={};const d={},g=function(t){s&&bt();const r=()=>vt(e,{subscr:t,trans:null}),n=$e.trans?kt($e.transless,r):r();return s&&n.then(wt,wt),n}(d);c||(_r(Ar,p),c=!0),l=!0,Promise.resolve(g).then((e=>{r=!0,t=e,l=!1,i||(h()?f():(o={},a=d,n.next&&n.next(e)))}),(e=>{l=!1,r=!1,n.error&&n.error(e),u.unsubscribe()}))};return f(),u}));return n.hasValue=()=>r,n.getValue=()=>t,n},extendObservabilitySet:yn,getByKeyPath:B,setByKeyPath:K,delByKeyPath:function(e,t){"string"==typeof t?K(e,t,void 0):"length"in t&&[].map.call(t,(function(t){K(e,t,void 0)}))},shallowClone:N,deepClone:W,getObjectDiff:tn,cmp:or,asap:I,minKey:Rt,addons:[],connections:Nt,errnames:de,dependencies:vn,semVer:Ct,version:Ct.split(".").map((e=>parseInt(e))).reduce(((e,t,r)=>e+t/Math.pow(10,2*r)))}),bn.maxKey=Sr(bn.dependencies.IDBKeyRange),"undefined"!=typeof dispatchEvent&&"undefined"!=typeof addEventListener&&(_r(Ar,(e=>{if(!Tn){let t;Lt?(t=document.createEvent("CustomEvent"),t.initCustomEvent(qr,!0,!0,e)):t=new CustomEvent(qr,{detail:e}),Tn=!0,dispatchEvent(t),Tn=!1}})),addEventListener(qr,(({detail:e})=>{Tn||wn(e)})));let Tn=!1;if("undefined"!=typeof BroadcastChannel){const e=new BroadcastChannel(qr);"function"==typeof e.unref&&e.unref(),_r(Ar,(t=>{Tn||e.postMessage(t)})),e.onmessage=e=>{e.data&&wn(e.data)}}else if("undefined"!=typeof self&&"undefined"!=typeof navigator){_r(Ar,(e=>{try{Tn||("undefined"!=typeof localStorage&&localStorage.setItem(qr,JSON.stringify({trig:Math.random(),changedParts:e})),"object"==typeof self.clients&&[...self.clients.matchAll({includeUncontrolled:!0})].forEach((t=>t.postMessage({type:qr,changedParts:e}))))}catch(e){}})),"undefined"!=typeof addEventListener&&addEventListener("storage",(e=>{if(e.key===qr){const t=JSON.parse(e.newValue);t&&wn(t.changedParts)}}));const e=self.document&&navigator.serviceWorker;e&&e.addEventListener("message",(function({data:e}){e&&e.type===qr&&wn(e.changedParts)}))}function An(e){return An="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},An(e)}function qn(){qn=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 l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,r){return e[t]=r}}function c(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=c;var p="suspendedStart",f="suspendedYield",d="executing",g="completed",m={};function y(){}function v(){}function b(){}var w={};l(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){l(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 l=u.arg,c=l.value;return c&&"object"==An(c)&&n.call(c,"__await")?t.resolve(c.__await).then((function(e){r("next",e,o,a)}),(function(e){r("throw",e,o,a)})):t.resolve(c).then((function(e){l.value=e,o(l)}),(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 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 l=h(t,r,n);if("normal"===l.type){if(s=n.done?g:f,l.arg===m)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(s=g,n.method="throw",n.arg=l.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(An(t)+" is not iterable")}return v.prototype=b,s(q,"constructor",{value:b,configurable:!0}),s(b,"constructor",{value:v,configurable:!0}),v.displayName=l(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,l(e,u,"GeneratorFunction")),e.prototype=Object.create(q),e},t.awrap=function(e){return{__await:e}},_(U.prototype),l(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(c(e,r,n,s),i);return t.isGeneratorFunction(r)?o:o.next().then((function(e){return e.done?e.value:o.next()}))},_(q),l(q,u,"Generator"),l(q,o,(function(){return this})),l(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"),l=n.call(o,"finallyLoc");if(u&&l){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(!l)throw 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 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 _n(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 Un(e){return function(){var t=this,r=arguments;return new Promise((function(n,s){var i=e.apply(t,r);function o(e){_n(i,n,s,o,a,"next",e)}function a(e){_n(i,n,s,o,a,"throw",e)}o(void 0)}))}}Qe.rejectionMapper=function(e,t){if(!e||e instanceof ce||e instanceof TypeError||e instanceof SyntaxError||!e.name||!ye[e.name])return e;var r=new ye[e.name](t||e.message,e);return"stack"in e&&j(r,"stack",{get:function(){return this.inner.stack}}),r},re(te,Gt);var kn=function(){var e=new dn("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=Un(qn().mark((function e(t){var r,n;return qn().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=Un(qn().mark((function e(t){var r,n,s,i;return qn().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=Un(qn().mark((function t(){var r;return qn().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)})))},jn=function(){var e=null,t=null,r=new kn;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(),i=n.useXMLHttpRequest?a:o;return r.getBatchResponse(e,t).then((function(o){if(o){var a={};null!==o.chunks&&(a["Cached-X-Total-Count"]=o.chunks),a.status=304,s.resolve(o.data,304,a)}else i(e,"GET",null,n).done((function(n,i,o){var a=o.getResponseHeader("X-Total-Count"),u="arraybuffer"===o.responseType,l=!1===u?JSON.stringify(n):null;r.addBatchResponse(e,t,u?n:JSON.parse(l),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(i,l){if(l||(l={}),l.token||(l.token=e),l.tokenType&&l.tokenType===t||(l.tokenType=t),l.queryParams&&(i+=u(l.queryParams)),l.responseBatch)return this.getBatchResponse(i,l.responseBatch,l);var c=$.Deferred(),h=l.useXMLHttpRequest?a:o;return r.getResponse("GET;"+i).then((function(e){if(e){var t=s(e.etag);l.eTag=t,h(i,"GET",null,l).done((function(t,r,s){304===s.status?(null!==e.chunks&&(s["Cached-X-Total-Count"]=e.chunks),c.resolve(e.data,r,s)):(n("GET;"+i,t,s),c.resolve(t,r,s))})).fail((function(e,t){c.reject(e,t)}))}else h(i,"GET",null,l).done((function(e,t,r){n("GET;"+i,e,r),c.resolve(e,t,r)})).fail((function(e,t){c.reject(e,t)}))})).catch((function(){h(i,"GET",null,l).done((function(e,t,r){n("GET;"+i,e,r),c.resolve(e,t,r)})).fail((function(e,t){c.reject(e,t)}))})),c.promise()},this.getChunked=function(t,r){return l(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+=u(s.queryParams)),o(r,"PUT",n,s)},this.putChunked=function(t,r,n){return h(this,e,t,r,n)},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+=u(s.queryParams)),(s.useXMLHttpRequest?a:o)(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+=u(s.queryParams)),o(r,"DELETE",n||null,s)},this.head=function(i,a){a||(a={}),a.contentType="",a.dataType="",a.token||(a.token=e),a.tokenType&&a.tokenType===t||(a.tokenType=t),a.queryParams&&(i+=u(a.queryParams));var l=$.Deferred();return r.getResponse("HEAD;"+i).then((function(e){if(e){var t=s(e.etag);a.eTag=t,o(i,"HEAD",null,a).done((function(e,t,r){304===r.status?l.resolve(!0,t,r):(n("HEAD;"+i,null,r),l.resolve(!1,t,r))})).fail((function(e,t){l.reject(e,t)}))}else o(i,"HEAD",null,a).done((function(e,t,r){n("HEAD;"+i,null,r),l.resolve(!1,t,r)})).fail((function(e,t){l.reject(!1,t)}))})).catch((function(){o(i,"HEAD",null,a).done((function(e,t,r){n("HEAD;"+i,null,r),l.resolve(!1,t,r)})).fail((function(e,t){l.reject(!1,t)}))})),l.promise()}},xn=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)}},Sn=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")}},Pn=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)}},En=function(e){this.post=function(t){return t.runAsync=!1,e.request.post(e.getApiTeamUrl()+"services/Connexis",JSON.stringify(t))}},Dn=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))}},On=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)}},Cn=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")}},In=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,i){var o={};return r&&(o.emptyPropExport=r),n&&(o.propSetExport=n),s&&(o.temporary="true"),i&&(o.exportType=i),e.request.post("".concat(e.getApiTeamUrl(),"selections/").concat(t,"/exportasync"),null,{queryParams:o})},this.createExportSelection=function(t,r){return e.request.post("".concat(e.getApiTeamUrl(),"projects/").concat(t,"/exportobjects"),r)}},Rn=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)}},Bn=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")}},Kn=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)}},Nn=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))}},Ln=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)}},Mn=function(e){this.postModel=function(t,r,n,s,i,o){return"replaceModelData"===i&&(o||(o={}),o.replaceModelData=!0),e.request.post(e.getApiTeamUrl()+"projects/"+t+"/model/"+r+"/importasync",n,{preparedData:n,contentType:!1,processData:!1,dataType:null,xhrUploadProgress:s,queryParams:o})}},Fn=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)}},Gn=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)}},Hn=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")}},Wn=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)}},$n=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)}},zn=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)}},Vn=["topology","structure"],Jn=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&&Vn.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&&Vn.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)}},Qn=function(e){this.post=function(t){return e.request.post(e.getApiTeamUrl()+"objects/",t)},this._buildQueryParams=function(e){var t={};return e.revision&&(t.revision=e.revision),e.projectId&&(t.projectId=e.projectId),e.shortInfo&&(t.shortinfo=e.shortInfo),e.type&&(t.type=e.type),{queryParams:t}},this.get=function(t,r,n,s,i,o){var a={revision:r,projectId:s,shortInfo:i,type:o},u=this._buildQueryParams(a),l=e.getApiTeamUrl()+"objects/"+t;return n&&(l+="/properties/",l+=n),e.request.get(l,r||s||i||o?u: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){var r,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{chunked:null,revision:null,lod:null,batch:null,chunkSize:null,properties:null},i={};return(s.revision||s.lod||s.chunkSize)&&(i.queryParams={},s.revision&&(i.queryParams.revision=s.revision),s.lod&&(i.queryParams.levelofdetail=s.lod),s.chunkSize&&(i.queryParams.chunkSize=s.chunkSize)),s.batch&&(i.responseBatch=s.batch),r=n?e.getApiTeamUrl()+"objects/"+t+"/disciplines/"+n+"/geometries/threejs":e.getApiTeamUrl()+"objects/"+t+"/geometries/threejs",s.properties&&(r+="/properties/",r+=s.properties),s.chunked?e.request.getChunked(r,i):e.request.get(r,i)},this._buildGetGeoAjaxOptions=function(e){var t={dataType:"binary",processData:!1,responseType:"arraybuffer",useXMLHttpRequest:!0,queryParams:{}};return e.revision&&(t.queryParams.revision=e.revision),e.lod&&(t.queryParams.levelofdetail=e.lod),e.vertexNormals&&(t.queryParams.vertexNormals=e.vertexNormals),e.smoothingAngle&&(t.queryParams.smoothingAngle=e.smoothingAngle),e.topology&&(t.queryParams.topology=e.topology),e.edges&&(t.queryParams.edges=e.edges),e.version&&(t.queryParams.version=e.version),e.batch&&(t.responseBatch=e.batch),t},this.getGeometryGLB=function(t){var r,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{chunked:null,revision:null,lod:null,batch:null,vertexNormals:null,smoothingAngle:null,topology:null,edges:null,version:null},i=this._buildGetGeoAjaxOptions(s);return r=n?e.getApiTeamUrl()+"objects/"+t+"/disciplines/"+n+"/geometries/glb":e.getApiTeamUrl()+"objects/"+t+"/geometries/glb",s.chunked?e.request.getChunked(r,i):e.request.get(r,i)},this.getGLB=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return this.getGeometryGLB(e,null,{version: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.createAttachmentChunked=function(t,r,n,s){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},o=e.getApiTeamUrl()+"objects/"+t+"/attachments/chunked",a={file:r,uploadProgress:n,documentFolderId:s,opts:i},u={queryParams:{}};return s&&(u.queryParams={DocumentFolderId:s}),e.request.putChunked(o,a,u)},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"})}},Xn=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)}},Yn=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)}},es=function(e){this.get=function(){return e.request.get(e.getApiUrl()+"project-actions-rights/")}},ts=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 rs(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,l=!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){l=!0,s=e}finally{try{if(!u&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(l)throw s}}return a}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return ns(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 ns(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 ns(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 ss=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=rs((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")}},is=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)}},os=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")}},as=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)}},us=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))}},ls=function(e){this.post=function(t){return e.request.post(e.getApiTeamUrl()+"share",t)}},cs=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)}},hs=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)}},ps=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,r){return e.request.get(e.getApiTeamUrl()+"projects/"+t+"/topologystructure",r?{queryParams:r}:void 0)},this.resetTopologyStructure=function(t,r){return e.request.put(e.getApiTeamUrl()+"projects/"+t+"/topologystructure/reset",void 0,r?{queryParams:r}:void 0)},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)}},fs=function(e){this.get=function(){return e.request.get(e.getApiUrl()+"team-actions-rights/")}},ds=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")}},gs=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"})}},ms=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")}},ys=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"})}},vs=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)}},bs=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")}},ws=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)}},Ts=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)}},As=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)}},qs=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)}},_s=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)}},Us=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")}},ks=function(e){this.post=function(t){return e.request.post(e.getApiTeamUrl()+"services/BaseQuantities",JSON.stringify(t))}},js=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")}},xs=function(e){this.post=function(t){return e.request.post(e.getApiUrl()+"administration/backups",t)},this.put=function(t,r){return e.request.put(e.getApiUrl()+"administration/backups/"+t,r)},this.delete=function(t){return e.request.del(e.getApiUrl()+"administration/backups/"+t)},this.get=function(t){return e.request.get(e.getApiUrl()+"administration/backups/"+t)},this.getProjectBackups=function(t){return e.request.get(e.getApiUrl()+"administration/backups/projects/"+t)}};function Ss(e){return Ss="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},Ss(e)}function Ps(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,Es(n.key),n)}}function Es(e){var t=function(e,t){if("object"!=Ss(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=Ss(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Ss(t)?t:t+""}var Ds=function(){return e=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=Os(),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 jn,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 p,this._cache=null)):this.request=new p,this.authorize=new y(this),this.user=new bs(this),this.users=new ws(this),this.teams=new ds(this),this.members=new Wn(this),this.projects=new ss(this),this.structures=new ps(this),this.models=new zn(this),this.objects=new Qn(this),this.overlays=new Xn(this),this.overlaySets=new Yn(this),this.revisions=new is(this),this.elementTypes=new Cn(this),this.annotations=new d(this),this.attachments=new g(this),this.issues=new Fn(this),this.labels=new Gn(this),this.pins=new Zn(this),this.comments=new Pn(this),this.hyperlinks=new Ln(this),this.importService=new Mn(this),this.slideshows=new hs(this),this.slides=new cs(this),this.clashDetection=new xn(this),this.clientLogs=new Sn(this),this.rightsService=new os(this),this.applicationSettings=new f(this),this.exportService=new In(this),this.folders=new Rn(this),this.locks=new Hn(this),this.share=new ls(this),this.messages=new $n(this),this.objectFilters=new Jn(this),this.terms=new gs(this),this.dataProtection=new ms(this),this.dimensions=new On(this),this.imprints=new ys(this),this.projectActionsRights=new es(this),this.roles=new as(this),this.attributeTemplates=new m(this),this.units=new vs(this),this.freeAttributes=new Kn(this),this.freeAttributeGroups=new Bn(this),this.hiddenCalculation=new Nn(this),this.sectionCut=new us(this),this.projectAttributeTemplates=new ts(this),this.teamActionsRights=new fs(this),this.customTables=new Dn(this),this.userSettings=new Ts(this),this.invitations=new As(this),this.selections=new qs(this),this.userGroups=new _s(this),this.scenes=new Us(this),this.baseQuantities=new ks(this),this.workflows=new js(this),this.backups=new xs(this),this.connexis=new En(this)},(t=[{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}}])&&Ps(e.prototype,t),r&&Ps(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r}(),Os=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,(()=>(()=>{var e={744:function(e,t,n){e.exports=function(){"use strict";var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(t,n)},t=function(){return(t=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function r(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||((r=r||Array.prototype.slice.call(t,0,i))[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}var i="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:n.g,o=Object.keys,s=Array.isArray;function u(e,t){return"object"!=typeof t||o(t).forEach((function(n){e[n]=t[n]})),e}"undefined"==typeof Promise||i.Promise||(i.Promise=Promise);var a=Object.getPrototypeOf,c={}.hasOwnProperty;function l(e,t){return c.call(e,t)}function f(e,t){"function"==typeof t&&(t=t(a(e))),("undefined"==typeof Reflect?o:Reflect.ownKeys)(t).forEach((function(n){h(e,n,t[n])}))}var p=Object.defineProperty;function h(e,t,n,r){p(e,t,u(n&&l(n,"get")&&"function"==typeof n.get?{get:n.get,set:n.set,configurable:!0}:{value:n,configurable:!0,writable:!0},r))}function d(e){return{from:function(t){return e.prototype=Object.create(t.prototype),h(e.prototype,"constructor",e),{extend:f.bind(null,e.prototype)}}}}var g=Object.getOwnPropertyDescriptor,m=[].slice;function y(e,t,n){return m.call(e,t,n)}function v(e,t){return t(e)}function b(e){if(!e)throw new Error("Assertion Failed")}function w(e){i.setImmediate?setImmediate(e):setTimeout(e,0)}function T(e,t){if("string"==typeof t&&l(e,t))return e[t];if(!t)return e;if("string"!=typeof t){for(var n=[],r=0,i=t.length;r<i;++r){var o=T(e,t[r]);n.push(o)}return n}var s=t.indexOf(".");if(-1!==s){var u=e[t.substr(0,s)];return null==u?void 0:T(u,t.substr(s+1))}}function q(e,t,n){if(e&&void 0!==t&&(!("isFrozen"in Object)||!Object.isFrozen(e)))if("string"!=typeof t&&"length"in t){b("string"!=typeof n&&"length"in n);for(var r=0,i=t.length;r<i;++r)q(e,t[r],n[r])}else{var o,u,a=t.indexOf(".");-1!==a?(o=t.substr(0,a),""===(u=t.substr(a+1))?void 0===n?s(e)&&!isNaN(parseInt(o))?e.splice(o,1):delete e[o]:e[o]=n:q(a=(a=e[o])&&l(e,o)?a:e[o]={},u,n)):void 0===n?s(e)&&!isNaN(parseInt(t))?e.splice(t,1):delete e[t]:e[t]=n}}function A(e){var t,n={};for(t in e)l(e,t)&&(n[t]=e[t]);return n}var _=[].concat;function k(e){return _.apply([],e)}var U="BigUint64Array,BigInt64Array,Array,Boolean,String,Date,RegExp,Blob,File,FileList,FileSystemFileHandle,FileSystemDirectoryHandle,ArrayBuffer,DataView,Uint8ClampedArray,ImageBitmap,ImageData,Map,Set,CryptoKey".split(",").concat(k([8,16,32,64].map((function(e){return["Int","Uint","Float"].map((function(t){return t+e+"Array"}))})))).filter((function(e){return i[e]})),x=new Set(U.map((function(e){return i[e]}))),j=null;function P(e){return j=new WeakMap,e=function e(t){if(!t||"object"!=typeof t)return t;var n=j.get(t);if(n)return n;if(s(t)){n=[],j.set(t,n);for(var r=0,i=t.length;r<i;++r)n.push(e(t[r]))}else if(x.has(t.constructor))n=t;else{var o,u=a(t);for(o in n=u===Object.prototype?{}:Object.create(u),j.set(t,n),t)l(t,o)&&(n[o]=e(t[o]))}return n}(e),j=null,e}var S={}.toString;function E(e){return S.call(e).slice(8,-1)}var O="undefined"!=typeof Symbol?Symbol.iterator:"@@iterator",D="symbol"==typeof O?function(e){var t;return null!=e&&(t=e[O])&&t.apply(e)}:function(){return null};function C(e,t){return 0<=(t=e.indexOf(t))&&e.splice(t,1),0<=t}var I={};function R(e){var t,n,r,i;if(1===arguments.length){if(s(e))return e.slice();if(this===I&&"string"==typeof e)return[e];if(i=D(e)){for(n=[];!(r=i.next()).done;)n.push(r.value);return n}if(null==e)return[e];if("number"!=typeof(t=e.length))return[e];for(n=new Array(t);t--;)n[t]=e[t];return n}for(t=arguments.length,n=new Array(t);t--;)n[t]=arguments[t];return n}var B="undefined"!=typeof Symbol?function(e){return"AsyncFunction"===e[Symbol.toStringTag]}:function(){return!1},K=["Modify","Bulk","OpenFailed","VersionChange","Schema","Upgrade","InvalidTable","MissingAPI","NoSuchDatabase","InvalidArgument","SubTransaction","Unsupported","Internal","DatabaseClosed","PrematureCommit","ForeignAwait"].concat(ae=["Unknown","Constraint","Data","TransactionInactive","ReadOnly","Version","NotFound","InvalidState","InvalidAccess","Abort","Timeout","QuotaExceeded","Syntax","DataClone"]),N={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 L(e,t){this.name=e,this.message=t}function M(e,t){return e+". Errors: "+Object.keys(t).map((function(e){return t[e].toString()})).filter((function(e,t,n){return n.indexOf(e)===t})).join("\n")}function F(e,t,n,r){this.failures=t,this.failedKeys=r,this.successCount=n,this.message=M(e,t)}function G(e,t){this.name="BulkError",this.failures=Object.keys(t).map((function(e){return t[e]})),this.failuresByPos=t,this.message=M(e,this.failures)}d(L).from(Error).extend({toString:function(){return this.name+": "+this.message}}),d(F).from(L),d(G).from(L);var W=K.reduce((function(e,t){return e[t]=t+"Error",e}),{}),z=L,H=K.reduce((function(e,t){var n=t+"Error";function r(e,r){this.name=n,e?"string"==typeof e?(this.message="".concat(e).concat(r?"\n "+r:""),this.inner=r||null):"object"==typeof e&&(this.message="".concat(e.name," ").concat(e.message),this.inner=e):(this.message=N[t]||n,this.inner=null)}return d(r).from(z),e[t]=r,e}),{});H.Syntax=SyntaxError,H.Type=TypeError,H.Range=RangeError;var V=ae.reduce((function(e,t){return e[t+"Error"]=H[t],e}),{}),$=K.reduce((function(e,t){return-1===["Syntax","Type","Range"].indexOf(t)&&(e[t+"Error"]=H[t]),e}),{});function Q(){}function J(e){return e}function X(e,t){return null==e||e===J?t:function(n){return t(e(n))}}function Y(e,t){return function(){e.apply(this,arguments),t.apply(this,arguments)}}function Z(e,t){return e===Q?t:function(){var n=e.apply(this,arguments);void 0!==n&&(arguments[0]=n);var r=this.onsuccess,i=this.onerror;this.onsuccess=null,this.onerror=null;var o=t.apply(this,arguments);return r&&(this.onsuccess=this.onsuccess?Y(r,this.onsuccess):r),i&&(this.onerror=this.onerror?Y(i,this.onerror):i),void 0!==o?o:n}}function ee(e,t){return e===Q?t:function(){e.apply(this,arguments);var n=this.onsuccess,r=this.onerror;this.onsuccess=this.onerror=null,t.apply(this,arguments),n&&(this.onsuccess=this.onsuccess?Y(n,this.onsuccess):n),r&&(this.onerror=this.onerror?Y(r,this.onerror):r)}}function te(e,t){return e===Q?t:function(n){var r=e.apply(this,arguments);u(n,r);var i=this.onsuccess,o=this.onerror;return this.onsuccess=null,this.onerror=null,n=t.apply(this,arguments),i&&(this.onsuccess=this.onsuccess?Y(i,this.onsuccess):i),o&&(this.onerror=this.onerror?Y(o,this.onerror):o),void 0===r?void 0===n?void 0:n:u(r,n)}}function ne(e,t){return e===Q?t:function(){return!1!==t.apply(this,arguments)&&e.apply(this,arguments)}}function re(e,t){return e===Q?t:function(){var n=e.apply(this,arguments);if(n&&"function"==typeof n.then){for(var r=this,i=arguments.length,o=new Array(i);i--;)o[i]=arguments[i];return n.then((function(){return t.apply(r,o)}))}return t.apply(this,arguments)}}$.ModifyError=F,$.DexieError=L,$.BulkError=G;var ie="undefined"!=typeof location&&/^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);function oe(e){ie=e}var se={},ue=100,ae=(U="undefined"==typeof Promise?[]:function(){var e=Promise.resolve();if("undefined"==typeof crypto||!crypto.subtle)return[e,a(e),e];var t=crypto.subtle.digest("SHA-512",new Uint8Array([0]));return[t,a(t),e]}(),U[0]),ce=(K=U[1],U=U[2],K=K&&K.then,ae&&ae.constructor),le=!!U,fe=function(e,t){be.push([e,t]),he&&(queueMicrotask(Pe),he=!1)},pe=!0,he=!0,de=[],ge=[],me=J,ye={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:Q,pgp:!1,env:{},finalize:Q},ve=ye,be=[],we=0,Te=[];function qe(e){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");this._listeners=[],this._lib=!1;var t=this._PSD=ve;if("function"!=typeof e){if(e!==se)throw new TypeError("Not a function");return this._state=arguments[1],this._value=arguments[2],void(!1===this._state&&ke(this,this._value))}this._state=null,this._value=null,++t.ref,function e(t,n){try{n((function(n){if(null===t._state){if(n===t)throw new TypeError("A promise cannot be resolved with itself.");var r=t._lib&&Se();n&&"function"==typeof n.then?e(t,(function(e,t){n instanceof qe?n._then(e,t):n.then(e,t)})):(t._state=!0,t._value=n,Ue(t)),r&&Ee()}}),ke.bind(null,t))}catch(n){ke(t,n)}}(this,e)}var Ae={get:function(){var e=ve,t=Ne;function n(n,r){var i=this,o=!e.global&&(e!==ve||t!==Ne),s=o&&!Ge(),u=new qe((function(t,u){xe(i,new _e(Qe(n,e,o,s),Qe(r,e,o,s),t,u,e))}));return this._consoleTask&&(u._consoleTask=this._consoleTask),u}return n.prototype=se,n},set:function(e){h(this,"then",e&&e.prototype===se?Ae:{get:function(){return e},set:Ae.set})}};function _e(e,t,n,r,i){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.resolve=n,this.reject=r,this.psd=i}function ke(e,t){var n,r;ge.push(t),null===e._state&&(n=e._lib&&Se(),t=me(t),e._state=!1,e._value=t,r=e,de.some((function(e){return e._value===r._value}))||de.push(r),Ue(e),n&&Ee())}function Ue(e){var t=e._listeners;e._listeners=[];for(var n=0,r=t.length;n<r;++n)xe(e,t[n]);var i=e._PSD;--i.ref||i.finalize(),0===we&&(++we,fe((function(){0==--we&&Oe()}),[]))}function xe(e,t){if(null!==e._state){var n=e._state?t.onFulfilled:t.onRejected;if(null===n)return(e._state?t.resolve:t.reject)(e._value);++t.psd.ref,++we,fe(je,[n,e,t])}else e._listeners.push(t)}function je(e,t,n){try{var r,i=t._value;!t._state&&ge.length&&(ge=[]),r=ie&&t._consoleTask?t._consoleTask.run((function(){return e(i)})):e(i),t._state||-1!==ge.indexOf(i)||function(e){for(var t=de.length;t;)if(de[--t]._value===e._value)return de.splice(t,1)}(t),n.resolve(r)}catch(e){n.reject(e)}finally{0==--we&&Oe(),--n.psd.ref||n.psd.finalize()}}function Pe(){$e(ye,(function(){Se()&&Ee()}))}function Se(){var e=pe;return he=pe=!1,e}function Ee(){var e,t,n;do{for(;0<be.length;)for(e=be,be=[],n=e.length,t=0;t<n;++t){var r=e[t];r[0].apply(null,r[1])}}while(0<be.length);he=pe=!0}function Oe(){var e=de;de=[],e.forEach((function(e){e._PSD.onunhandled.call(null,e._value,e)}));for(var t=Te.slice(0),n=t.length;n;)t[--n]()}function De(e){return new qe(se,!1,e)}function Ce(e,t){var n=ve;return function(){var r=Se(),i=ve;try{return He(n,!0),e.apply(this,arguments)}catch(r){t&&t(r)}finally{He(i,!1),r&&Ee()}}}f(qe.prototype,{then:Ae,_then:function(e,t){xe(this,new _e(null,null,e,t,ve))},catch:function(e){if(1===arguments.length)return this.then(null,e);var t=e,n=arguments[1];return"function"==typeof t?this.then(null,(function(e){return(e instanceof t?n:De)(e)})):this.then(null,(function(e){return(e&&e.name===t?n:De)(e)}))},finally:function(e){return this.then((function(t){return qe.resolve(e()).then((function(){return t}))}),(function(t){return qe.resolve(e()).then((function(){return De(t)}))}))},timeout:function(e,t){var n=this;return e<1/0?new qe((function(r,i){var o=setTimeout((function(){return i(new H.Timeout(t))}),e);n.then(r,i).finally(clearTimeout.bind(null,o))})):this}}),"undefined"!=typeof Symbol&&Symbol.toStringTag&&h(qe.prototype,Symbol.toStringTag,"Dexie.Promise"),ye.env=Ve(),f(qe,{all:function(){var e=R.apply(null,arguments).map(We);return new qe((function(t,n){0===e.length&&t([]);var r=e.length;e.forEach((function(i,o){return qe.resolve(i).then((function(n){e[o]=n,--r||t(e)}),n)}))}))},resolve:function(e){return e instanceof qe?e:e&&"function"==typeof e.then?new qe((function(t,n){e.then(t,n)})):new qe(se,!0,e)},reject:De,race:function(){var e=R.apply(null,arguments).map(We);return new qe((function(t,n){e.map((function(e){return qe.resolve(e).then(t,n)}))}))},PSD:{get:function(){return ve},set:function(e){return ve=e}},totalEchoes:{get:function(){return Ne}},newPSD:Me,usePSD:$e,scheduler:{get:function(){return fe},set:function(e){fe=e}},rejectionMapper:{get:function(){return me},set:function(e){me=e}},follow:function(e,t){return new qe((function(n,r){return Me((function(t,n){var r=ve;r.unhandleds=[],r.onunhandled=n,r.finalize=Y((function(){var e,r=this;e=function(){0===r.unhandleds.length?t():n(r.unhandleds[0])},Te.push((function t(){e(),Te.splice(Te.indexOf(t),1)})),++we,fe((function(){0==--we&&Oe()}),[])}),r.finalize),e()}),t,n,r)}))}}),ce&&(ce.allSettled&&h(qe,"allSettled",(function(){var e=R.apply(null,arguments).map(We);return new qe((function(t){0===e.length&&t([]);var n=e.length,r=new Array(n);e.forEach((function(e,i){return qe.resolve(e).then((function(e){return r[i]={status:"fulfilled",value:e}}),(function(e){return r[i]={status:"rejected",reason:e}})).then((function(){return--n||t(r)}))}))}))})),ce.any&&"undefined"!=typeof AggregateError&&h(qe,"any",(function(){var e=R.apply(null,arguments).map(We);return new qe((function(t,n){0===e.length&&n(new AggregateError([]));var r=e.length,i=new Array(r);e.forEach((function(e,o){return qe.resolve(e).then((function(e){return t(e)}),(function(e){i[o]=e,--r||n(new AggregateError(i))}))}))}))})));var Ie={awaits:0,echoes:0,id:0},Re=0,Be=[],Ke=0,Ne=0,Le=0;function Me(e,t,n,r){var i=ve,o=Object.create(i);return o.parent=i,o.ref=0,o.global=!1,o.id=++Le,ye.env,o.env=le?{Promise:qe,PromiseProp:{value:qe,configurable:!0,writable:!0},all:qe.all,race:qe.race,allSettled:qe.allSettled,any:qe.any,resolve:qe.resolve,reject:qe.reject}:{},t&&u(o,t),++i.ref,o.finalize=function(){--this.parent.ref||this.parent.finalize()},r=$e(o,e,n,r),0===o.ref&&o.finalize(),r}function Fe(){return Ie.id||(Ie.id=++Re),++Ie.awaits,Ie.echoes+=ue,Ie.id}function Ge(){return!!Ie.awaits&&(0==--Ie.awaits&&(Ie.id=0),Ie.echoes=Ie.awaits*ue,!0)}function We(e){return Ie.echoes&&e&&e.constructor===ce?(Fe(),e.then((function(e){return Ge(),e}),(function(e){return Ge(),Xe(e)}))):e}function ze(){var e=Be[Be.length-1];Be.pop(),He(e,!1)}function He(e,t){var n,r=ve;(t?!Ie.echoes||Ke++&&e===ve:!Ke||--Ke&&e===ve)||queueMicrotask(t?function(e){++Ne,Ie.echoes&&0!=--Ie.echoes||(Ie.echoes=Ie.awaits=Ie.id=0),Be.push(ve),He(e,!0)}.bind(null,e):ze),e!==ve&&(ve=e,r===ye&&(ye.env=Ve()),le&&(n=ye.env.Promise,t=e.env,(r.global||e.global)&&(Object.defineProperty(i,"Promise",t.PromiseProp),n.all=t.all,n.race=t.race,n.resolve=t.resolve,n.reject=t.reject,t.allSettled&&(n.allSettled=t.allSettled),t.any&&(n.any=t.any))))}function Ve(){var e=i.Promise;return le?{Promise:e,PromiseProp:Object.getOwnPropertyDescriptor(i,"Promise"),all:e.all,race:e.race,allSettled:e.allSettled,any:e.any,resolve:e.resolve,reject:e.reject}:{}}function $e(e,t,n,r,i){var o=ve;try{return He(e,!0),t(n,r,i)}finally{He(o,!1)}}function Qe(e,t,n,r){return"function"!=typeof e?e:function(){var i=ve;n&&Fe(),He(t,!0);try{return e.apply(this,arguments)}finally{He(i,!1),r&&queueMicrotask(Ge)}}}function Je(e){Promise===ce&&0===Ie.echoes?0===Ke?e():enqueueNativeMicroTask(e):setTimeout(e,0)}-1===(""+K).indexOf("[native code]")&&(Fe=Ge=Q);var Xe=qe.reject,Ye=String.fromCharCode(65535),Ze="Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.",et="String expected.",tt=[],nt="__dbnames",rt="readonly",it="readwrite";function ot(e,t){return e?t?function(){return e.apply(this,arguments)&&t.apply(this,arguments)}:e:t}var st={type:3,lower:-1/0,lowerOpen:!1,upper:[[]],upperOpen:!1};function ut(e){return"string"!=typeof e||/\./.test(e)?function(e){return e}:function(t){return void 0===t[e]&&e in t&&delete(t=P(t))[e],t}}function at(){throw H.Type()}function ct(e,t){try{var n=lt(e),r=lt(t);if(n!==r)return"Array"===n?1:"Array"===r?-1:"binary"===n?1:"binary"===r?-1:"string"===n?1:"string"===r?-1:"Date"===n?1:"Date"!==r?NaN:-1;switch(n){case"number":case"Date":case"string":return t<e?1:e<t?-1:0;case"binary":return function(e,t){for(var n=e.length,r=t.length,i=n<r?n:r,o=0;o<i;++o)if(e[o]!==t[o])return e[o]<t[o]?-1:1;return n===r?0:n<r?-1:1}(ft(e),ft(t));case"Array":return function(e,t){for(var n=e.length,r=t.length,i=n<r?n:r,o=0;o<i;++o){var s=ct(e[o],t[o]);if(0!==s)return s}return n===r?0:n<r?-1:1}(e,t)}}catch(e){}return NaN}function lt(e){var t=typeof e;return"object"!=t?t:ArrayBuffer.isView(e)||"ArrayBuffer"===(e=E(e))?"binary":e}function ft(e){return e instanceof Uint8Array?e:ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):new Uint8Array(e)}var pt=(ht.prototype._trans=function(e,t,n){var r=this._tx||ve.trans,i=this.name,o=ie&&"undefined"!=typeof console&&console.createTask&&console.createTask("Dexie: ".concat("readonly"===e?"read":"write"," ").concat(this.name));function s(e,n,r){if(!r.schema[i])throw new H.NotFound("Table "+i+" not part of transaction");return t(r.idbtrans,r)}var u=Se();try{var a=r&&r.db._novip===this.db._novip?r===ve.trans?r._promise(e,s,n):Me((function(){return r._promise(e,s,n)}),{trans:r,transless:ve.transless||ve}):function e(t,n,r,i){if(t.idbdb&&(t._state.openComplete||ve.letThrough||t._vip)){var o=t._createTransaction(n,r,t._dbSchema);try{o.create(),t._state.PR1398_maxLoop=3}catch(o){return o.name===W.InvalidState&&t.isOpen()&&0<--t._state.PR1398_maxLoop?(console.warn("Dexie: Need to reopen db"),t.close({disableAutoOpen:!1}),t.open().then((function(){return e(t,n,r,i)}))):Xe(o)}return o._promise(n,(function(e,t){return Me((function(){return ve.trans=o,i(e,t,o)}))})).then((function(e){if("readwrite"===n)try{o.idbtrans.commit()}catch(e){}return"readonly"===n?e:o._completion.then((function(){return e}))}))}if(t._state.openComplete)return Xe(new H.DatabaseClosed(t._state.dbOpenError));if(!t._state.isBeingOpened){if(!t._state.autoOpen)return Xe(new H.DatabaseClosed);t.open().catch(Q)}return t._state.dbReadyPromise.then((function(){return e(t,n,r,i)}))}(this.db,e,[this.name],s);return o&&(a._consoleTask=o,a=a.catch((function(e){return console.trace(e),Xe(e)}))),a}finally{u&&Ee()}},ht.prototype.get=function(e,t){var n=this;return e&&e.constructor===Object?this.where(e).first(t):null==e?Xe(new H.Type("Invalid argument to Table.get()")):this._trans("readonly",(function(t){return n.core.get({trans:t,key:e}).then((function(e){return n.hook.reading.fire(e)}))})).then(t)},ht.prototype.where=function(e){if("string"==typeof e)return new this.db.WhereClause(this,e);if(s(e))return new this.db.WhereClause(this,"[".concat(e.join("+"),"]"));var t=o(e);if(1===t.length)return this.where(t[0]).equals(e[t[0]]);var n=this.schema.indexes.concat(this.schema.primKey).filter((function(e){if(e.compound&&t.every((function(t){return 0<=e.keyPath.indexOf(t)}))){for(var n=0;n<t.length;++n)if(-1===t.indexOf(e.keyPath[n]))return!1;return!0}return!1})).sort((function(e,t){return e.keyPath.length-t.keyPath.length}))[0];if(n&&this.db._maxKey!==Ye){var r=n.keyPath.slice(0,t.length);return this.where(r).equals(r.map((function(t){return e[t]})))}!n&&ie&&console.warn("The query ".concat(JSON.stringify(e)," on ").concat(this.name," would benefit from a ")+"compound index [".concat(t.join("+"),"]"));var i=this.schema.idxByName,u=this.db._deps.indexedDB;function a(e,t){return 0===u.cmp(e,t)}var c=t.reduce((function(t,n){var r=t[0],o=t[1],u=(t=i[n],e[n]);return[r||t,r||!t?ot(o,t&&t.multi?function(e){return e=T(e,n),s(e)&&e.some((function(e){return a(u,e)}))}:function(e){return a(u,T(e,n))}):o]}),[null,null]);return r=c[0],c=c[1],r?this.where(r.name).equals(e[r.keyPath]).filter(c):n?this.filter(c):this.where(t).equals("")},ht.prototype.filter=function(e){return this.toCollection().and(e)},ht.prototype.count=function(e){return this.toCollection().count(e)},ht.prototype.offset=function(e){return this.toCollection().offset(e)},ht.prototype.limit=function(e){return this.toCollection().limit(e)},ht.prototype.each=function(e){return this.toCollection().each(e)},ht.prototype.toArray=function(e){return this.toCollection().toArray(e)},ht.prototype.toCollection=function(){return new this.db.Collection(new this.db.WhereClause(this))},ht.prototype.orderBy=function(e){return new this.db.Collection(new this.db.WhereClause(this,s(e)?"[".concat(e.join("+"),"]"):e))},ht.prototype.reverse=function(){return this.toCollection().reverse()},ht.prototype.mapToClass=function(t){var n,r=this.db,i=this.name;function o(){return null!==n&&n.apply(this,arguments)||this}(this.schema.mappedClass=t).prototype instanceof at&&(function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}(o,n=t),Object.defineProperty(o.prototype,"db",{get:function(){return r},enumerable:!1,configurable:!0}),o.prototype.table=function(){return i},t=o);for(var s=new Set,u=t.prototype;u;u=a(u))Object.getOwnPropertyNames(u).forEach((function(e){return s.add(e)}));function c(e){if(!e)return e;var n,r=Object.create(t.prototype);for(n in e)if(!s.has(n))try{r[n]=e[n]}catch(e){}return r}return this.schema.readHook&&this.hook.reading.unsubscribe(this.schema.readHook),this.schema.readHook=c,this.hook("reading",c),t},ht.prototype.defineClass=function(){return this.mapToClass((function(e){u(this,e)}))},ht.prototype.add=function(e,t){var n=this,r=this.schema.primKey,i=r.auto,o=r.keyPath,s=e;return o&&i&&(s=ut(o)(e)),this._trans("readwrite",(function(e){return n.core.mutate({trans:e,type:"add",keys:null!=t?[t]:null,values:[s]})})).then((function(e){return e.numFailures?qe.reject(e.failures[0]):e.lastResult})).then((function(t){if(o)try{q(e,o,t)}catch(t){}return t}))},ht.prototype.update=function(e,t){return"object"!=typeof e||s(e)?this.where(":id").equals(e).modify(t):void 0===(e=T(e,this.schema.primKey.keyPath))?Xe(new H.InvalidArgument("Given object does not contain its primary key")):this.where(":id").equals(e).modify(t)},ht.prototype.put=function(e,t){var n=this,r=this.schema.primKey,i=r.auto,o=r.keyPath,s=e;return o&&i&&(s=ut(o)(e)),this._trans("readwrite",(function(e){return n.core.mutate({trans:e,type:"put",values:[s],keys:null!=t?[t]:null})})).then((function(e){return e.numFailures?qe.reject(e.failures[0]):e.lastResult})).then((function(t){if(o)try{q(e,o,t)}catch(t){}return t}))},ht.prototype.delete=function(e){var t=this;return this._trans("readwrite",(function(n){return t.core.mutate({trans:n,type:"delete",keys:[e]})})).then((function(e){return e.numFailures?qe.reject(e.failures[0]):void 0}))},ht.prototype.clear=function(){var e=this;return this._trans("readwrite",(function(t){return e.core.mutate({trans:t,type:"deleteRange",range:st})})).then((function(e){return e.numFailures?qe.reject(e.failures[0]):void 0}))},ht.prototype.bulkGet=function(e){var t=this;return this._trans("readonly",(function(n){return t.core.getMany({keys:e,trans:n}).then((function(e){return e.map((function(e){return t.hook.reading.fire(e)}))}))}))},ht.prototype.bulkAdd=function(e,t,n){var r=this,i=Array.isArray(t)?t:void 0,o=(n=n||(i?void 0:t))?n.allKeys:void 0;return this._trans("readwrite",(function(t){var n=(u=r.schema.primKey).auto;if((u=u.keyPath)&&i)throw new H.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");if(i&&i.length!==e.length)throw new H.InvalidArgument("Arguments objects and keys must have the same length");var s=e.length,u=u&&n?e.map(ut(u)):e;return r.core.mutate({trans:t,type:"add",keys:i,values:u,wantResults:o}).then((function(e){var t=e.numFailures,n=e.results,i=e.lastResult;if(e=e.failures,0===t)return o?n:i;throw new G("".concat(r.name,".bulkAdd(): ").concat(t," of ").concat(s," operations failed"),e)}))}))},ht.prototype.bulkPut=function(e,t,n){var r=this,i=Array.isArray(t)?t:void 0,o=(n=n||(i?void 0:t))?n.allKeys:void 0;return this._trans("readwrite",(function(t){var n=(u=r.schema.primKey).auto;if((u=u.keyPath)&&i)throw new H.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");if(i&&i.length!==e.length)throw new H.InvalidArgument("Arguments objects and keys must have the same length");var s=e.length,u=u&&n?e.map(ut(u)):e;return r.core.mutate({trans:t,type:"put",keys:i,values:u,wantResults:o}).then((function(e){var t=e.numFailures,n=e.results,i=e.lastResult;if(e=e.failures,0===t)return o?n:i;throw new G("".concat(r.name,".bulkPut(): ").concat(t," of ").concat(s," operations failed"),e)}))}))},ht.prototype.bulkUpdate=function(e){var t=this,n=this.core,r=e.map((function(e){return e.key})),i=e.map((function(e){return e.changes})),o=[];return this._trans("readwrite",(function(s){return n.getMany({trans:s,keys:r,cache:"clone"}).then((function(u){var a=[],c=[];e.forEach((function(e,n){var r=e.key,i=e.changes,s=u[n];if(s){for(var l=0,f=Object.keys(i);l<f.length;l++){var p=f[l],h=i[p];if(p===t.schema.primKey.keyPath){if(0!==ct(h,r))throw new H.Constraint("Cannot update primary key in bulkUpdate()")}else q(s,p,h)}o.push(n),a.push(r),c.push(s)}}));var l=a.length;return n.mutate({trans:s,type:"put",keys:a,values:c,updates:{keys:r,changeSpecs:i}}).then((function(e){var n=e.numFailures,r=e.failures;if(0===n)return l;for(var i=0,s=Object.keys(r);i<s.length;i++){var u,a=s[i],c=o[Number(a)];null!=c&&(u=r[a],delete r[a],r[c]=u)}throw new G("".concat(t.name,".bulkUpdate(): ").concat(n," of ").concat(l," operations failed"),r)}))}))}))},ht.prototype.bulkDelete=function(e){var t=this,n=e.length;return this._trans("readwrite",(function(n){return t.core.mutate({trans:n,type:"delete",keys:e})})).then((function(e){var r=e.numFailures,i=e.lastResult;if(e=e.failures,0===r)return i;throw new G("".concat(t.name,".bulkDelete(): ").concat(r," of ").concat(n," operations failed"),e)}))},ht);function ht(){}function dt(e){function t(t,r){if(r){for(var i=arguments.length,o=new Array(i-1);--i;)o[i-1]=arguments[i];return n[t].subscribe.apply(null,o),e}if("string"==typeof t)return n[t]}var n={};t.addEventType=u;for(var r=1,i=arguments.length;r<i;++r)u(arguments[r]);return t;function u(e,r,i){if("object"!=typeof e){var a;r=r||ne;var c={subscribers:[],fire:i=i||Q,subscribe:function(e){-1===c.subscribers.indexOf(e)&&(c.subscribers.push(e),c.fire=r(c.fire,e))},unsubscribe:function(e){c.subscribers=c.subscribers.filter((function(t){return t!==e})),c.fire=c.subscribers.reduce(r,i)}};return n[e]=t[e]=c}o(a=e).forEach((function(e){var t=a[e];if(s(t))u(e,a[e][0],a[e][1]);else{if("asap"!==t)throw new H.InvalidArgument("Invalid event config");var n=u(e,J,(function(){for(var e=arguments.length,t=new Array(e);e--;)t[e]=arguments[e];n.subscribers.forEach((function(e){w((function(){e.apply(null,t)}))}))}))}}))}}function gt(e,t){return d(t).from({prototype:e}),t}function mt(e,t){return!(e.filter||e.algorithm||e.or)&&(t?e.justLimit:!e.replayFilter)}function yt(e,t){e.filter=ot(e.filter,t)}function vt(e,t,n){var r=e.replayFilter;e.replayFilter=r?function(){return ot(r(),t())}:t,e.justLimit=n&&!r}function bt(e,t){if(e.isPrimKey)return t.primaryKey;var n=t.getIndexByKeyPath(e.index);if(!n)throw new H.Schema("KeyPath "+e.index+" on object store "+t.name+" is not indexed");return n}function wt(e,t,n){var r=bt(e,t.schema);return t.openCursor({trans:n,values:!e.keysOnly,reverse:"prev"===e.dir,unique:!!e.unique,query:{index:r,range:e.range}})}function Tt(e,t,n,r){var i=e.replayFilter?ot(e.filter,e.replayFilter()):e.filter;if(e.or){var o={},s=function(e,n,r){var s,u;i&&!i(n,r,(function(e){return n.stop(e)}),(function(e){return n.fail(e)}))||("[object ArrayBuffer]"==(u=""+(s=n.primaryKey))&&(u=""+new Uint8Array(s)),l(o,u)||(o[u]=!0,t(e,n,r)))};return Promise.all([e.or._iterate(s,n),qt(wt(e,r,n),e.algorithm,s,!e.keysOnly&&e.valueMapper)])}return qt(wt(e,r,n),ot(e.algorithm,i),t,!e.keysOnly&&e.valueMapper)}function qt(e,t,n,r){var i=Ce(r?function(e,t,i){return n(r(e),t,i)}:n);return e.then((function(e){if(e)return e.start((function(){var n=function(){return e.continue()};t&&!t(e,(function(e){return n=e}),(function(t){e.stop(t),n=Q}),(function(t){e.fail(t),n=Q}))||i(e.value,e,(function(e){return n=e})),n()}))}))}U=Symbol();var At=(_t.prototype.execute=function(e){if(void 0!==this.add){var t=this.add;if(s(t))return r(r([],s(e)?e:[],!0),t,!0).sort();if("number"==typeof t)return(Number(e)||0)+t;if("bigint"==typeof t)try{return BigInt(e)+t}catch(e){return BigInt(0)+t}throw new TypeError("Invalid term ".concat(t))}if(void 0!==this.remove){var n=this.remove;if(s(n))return s(e)?e.filter((function(e){return!n.includes(e)})).sort():[];if("number"==typeof n)return Number(e)-n;if("bigint"==typeof n)try{return BigInt(e)-n}catch(e){return BigInt(0)-n}throw new TypeError("Invalid subtrahend ".concat(n))}return(t=null===(t=this.replacePrefix)||void 0===t?void 0:t[0])&&"string"==typeof e&&e.startsWith(t)?this.replacePrefix[1]+e.substring(t.length):e},_t);function _t(e){Object.assign(this,e)}var kt=(Ut.prototype._read=function(e,t){var n=this._ctx;return n.error?n.table._trans(null,Xe.bind(null,n.error)):n.table._trans("readonly",e).then(t)},Ut.prototype._write=function(e){var t=this._ctx;return t.error?t.table._trans(null,Xe.bind(null,t.error)):t.table._trans("readwrite",e,"locked")},Ut.prototype._addAlgorithm=function(e){var t=this._ctx;t.algorithm=ot(t.algorithm,e)},Ut.prototype._iterate=function(e,t){return Tt(this._ctx,e,t,this._ctx.table.core)},Ut.prototype.clone=function(e){var t=Object.create(this.constructor.prototype),n=Object.create(this._ctx);return e&&u(n,e),t._ctx=n,t},Ut.prototype.raw=function(){return this._ctx.valueMapper=null,this},Ut.prototype.each=function(e){var t=this._ctx;return this._read((function(n){return Tt(t,e,n,t.table.core)}))},Ut.prototype.count=function(e){var t=this;return this._read((function(e){var n=t._ctx,r=n.table.core;if(mt(n,!0))return r.count({trans:e,query:{index:bt(n,r.schema),range:n.range}}).then((function(e){return Math.min(e,n.limit)}));var i=0;return Tt(n,(function(){return++i,!1}),e,r).then((function(){return i}))})).then(e)},Ut.prototype.sortBy=function(e,t){var n=e.split(".").reverse(),r=n[0],i=n.length-1;function o(e,t){return t?o(e[n[t]],t-1):e[r]}var s="next"===this._ctx.dir?1:-1;function u(e,t){return(e=o(e,i))<(t=o(t,i))?-s:t<e?s:0}return this.toArray((function(e){return e.sort(u)})).then(t)},Ut.prototype.toArray=function(e){var t=this;return this._read((function(e){var n=t._ctx;if("next"===n.dir&&mt(n,!0)&&0<n.limit){var r=n.valueMapper,i=bt(n,n.table.core.schema);return n.table.core.query({trans:e,limit:n.limit,values:!0,query:{index:i,range:n.range}}).then((function(e){return e=e.result,r?e.map(r):e}))}var o=[];return Tt(n,(function(e){return o.push(e)}),e,n.table.core).then((function(){return o}))}),e)},Ut.prototype.offset=function(e){var t=this._ctx;return e<=0||(t.offset+=e,mt(t)?vt(t,(function(){var t=e;return function(e,n){return 0===t||(1===t?--t:n((function(){e.advance(t),t=0})),!1)}})):vt(t,(function(){var t=e;return function(){return--t<0}}))),this},Ut.prototype.limit=function(e){return this._ctx.limit=Math.min(this._ctx.limit,e),vt(this._ctx,(function(){var t=e;return function(e,n,r){return--t<=0&&n(r),0<=t}}),!0),this},Ut.prototype.until=function(e,t){return yt(this._ctx,(function(n,r,i){return!e(n.value)||(r(i),t)})),this},Ut.prototype.first=function(e){return this.limit(1).toArray((function(e){return e[0]})).then(e)},Ut.prototype.last=function(e){return this.reverse().first(e)},Ut.prototype.filter=function(e){var t;return yt(this._ctx,(function(t){return e(t.value)})),(t=this._ctx).isMatch=ot(t.isMatch,e),this},Ut.prototype.and=function(e){return this.filter(e)},Ut.prototype.or=function(e){return new this.db.WhereClause(this._ctx.table,e,this)},Ut.prototype.reverse=function(){return this._ctx.dir="prev"===this._ctx.dir?"next":"prev",this._ondirectionchange&&this._ondirectionchange(this._ctx.dir),this},Ut.prototype.desc=function(){return this.reverse()},Ut.prototype.eachKey=function(e){var t=this._ctx;return t.keysOnly=!t.isMatch,this.each((function(t,n){e(n.key,n)}))},Ut.prototype.eachUniqueKey=function(e){return this._ctx.unique="unique",this.eachKey(e)},Ut.prototype.eachPrimaryKey=function(e){var t=this._ctx;return t.keysOnly=!t.isMatch,this.each((function(t,n){e(n.primaryKey,n)}))},Ut.prototype.keys=function(e){var t=this._ctx;t.keysOnly=!t.isMatch;var n=[];return this.each((function(e,t){n.push(t.key)})).then((function(){return n})).then(e)},Ut.prototype.primaryKeys=function(e){var t=this._ctx;if("next"===t.dir&&mt(t,!0)&&0<t.limit)return this._read((function(e){var n=bt(t,t.table.core.schema);return t.table.core.query({trans:e,values:!1,limit:t.limit,query:{index:n,range:t.range}})})).then((function(e){return e.result})).then(e);t.keysOnly=!t.isMatch;var n=[];return this.each((function(e,t){n.push(t.primaryKey)})).then((function(){return n})).then(e)},Ut.prototype.uniqueKeys=function(e){return this._ctx.unique="unique",this.keys(e)},Ut.prototype.firstKey=function(e){return this.limit(1).keys((function(e){return e[0]})).then(e)},Ut.prototype.lastKey=function(e){return this.reverse().firstKey(e)},Ut.prototype.distinct=function(){var e;if(!(e=(e=this._ctx).index&&e.table.schema.idxByName[e.index])||!e.multi)return this;var t={};return yt(this._ctx,(function(e){var n=e.primaryKey.toString();return e=l(t,n),t[n]=!0,!e})),this},Ut.prototype.modify=function(e){var t=this,n=this._ctx;return this._write((function(r){var i,s,u;function a(e,t){var n=t.failures;t=t.numFailures,g+=e-t;for(var r=0,i=o(n);r<i.length;r++){var s=i[r];d.push(n[s])}}u="function"==typeof e?e:(i=o(e),s=i.length,function(t){for(var n=!1,r=0;r<s;++r){var o=i[r],u=e[o],a=T(t,o);u instanceof At?(q(t,o,u.execute(a)),n=!0):a!==u&&(q(t,o,u),n=!0)}return n});var c=n.table.core,l=c.schema.primaryKey,f=l.outbound,p=l.extractKey,h=t.db._options.modifyChunkSize||200,d=[],g=0,m=[];return t.clone().primaryKeys().then((function(t){function i(n){var s=Math.min(h,t.length-n);return c.getMany({trans:r,keys:t.slice(n,n+s),cache:"immutable"}).then((function(l){for(var d=[],g=[],m=f?[]:null,y=[],v=0;v<s;++v){var b=l[v],w={value:P(b),primKey:t[n+v]};!1!==u.call(w,w.value,w)&&(null==w.value?y.push(t[n+v]):f||0===ct(p(b),p(w.value))?(g.push(w.value),f&&m.push(t[n+v])):(y.push(t[n+v]),d.push(w.value)))}return Promise.resolve(0<d.length&&c.mutate({trans:r,type:"add",values:d}).then((function(e){for(var t in e.failures)y.splice(parseInt(t),1);a(d.length,e)}))).then((function(){return(0<g.length||o&&"object"==typeof e)&&c.mutate({trans:r,type:"put",keys:m,values:g,criteria:o,changeSpec:"function"!=typeof e&&e,isAdditionalChunk:0<n}).then((function(e){return a(g.length,e)}))})).then((function(){return(0<y.length||o&&e===xt)&&c.mutate({trans:r,type:"delete",keys:y,criteria:o,isAdditionalChunk:0<n}).then((function(e){return a(y.length,e)}))})).then((function(){return t.length>n+s&&i(n+h)}))}))}var o=mt(n)&&n.limit===1/0&&("function"!=typeof e||e===xt)&&{index:n.index,range:n.range};return i(0).then((function(){if(0<d.length)throw new F("Error modifying one or more objects",d,g,m);return t.length}))}))}))},Ut.prototype.delete=function(){var e=this._ctx,t=e.range;return mt(e)&&(e.isPrimKey||3===t.type)?this._write((function(n){var r=e.table.core.schema.primaryKey,i=t;return e.table.core.count({trans:n,query:{index:r,range:i}}).then((function(t){return e.table.core.mutate({trans:n,type:"deleteRange",range:i}).then((function(e){var n=e.failures;if(e.lastResult,e.results,e=e.numFailures)throw new F("Could not delete some values",Object.keys(n).map((function(e){return n[e]})),t-e);return t-e}))}))})):this.modify(xt)},Ut);function Ut(){}var xt=function(e,t){return t.value=null};function jt(e,t){return e<t?-1:e===t?0:1}function Pt(e,t){return t<e?-1:e===t?0:1}function St(e,t,n){return(e=e instanceof It?new e.Collection(e):e)._ctx.error=new(n||TypeError)(t),e}function Et(e){return new e.Collection(e,(function(){return Ct("")})).limit(0)}function Ot(e,t,n,r){var i,o,s,u,a,c,l,f=n.length;if(!n.every((function(e){return"string"==typeof e})))return St(e,et);function p(e){i="next"===e?function(e){return e.toUpperCase()}:function(e){return e.toLowerCase()},o="next"===e?function(e){return e.toLowerCase()}:function(e){return e.toUpperCase()},s="next"===e?jt:Pt;var t=n.map((function(e){return{lower:o(e),upper:i(e)}})).sort((function(e,t){return s(e.lower,t.lower)}));u=t.map((function(e){return e.upper})),a=t.map((function(e){return e.lower})),l="next"===(c=e)?"":r}p("next"),(e=new e.Collection(e,(function(){return Dt(u[0],a[f-1]+r)})))._ondirectionchange=function(e){p(e)};var h=0;return e._addAlgorithm((function(e,n,r){var i=e.key;if("string"!=typeof i)return!1;var p=o(i);if(t(p,a,h))return!0;for(var d=null,g=h;g<f;++g){var m=function(e,t,n,r,i,o){for(var s=Math.min(e.length,r.length),u=-1,a=0;a<s;++a){var c=t[a];if(c!==r[a])return i(e[a],n[a])<0?e.substr(0,a)+n[a]+n.substr(a+1):i(e[a],r[a])<0?e.substr(0,a)+r[a]+n.substr(a+1):0<=u?e.substr(0,u)+t[u]+n.substr(u+1):null;i(e[a],c)<0&&(u=a)}return s<r.length&&"next"===o?e+n.substr(e.length):s<e.length&&"prev"===o?e.substr(0,n.length):u<0?null:e.substr(0,u)+r[u]+n.substr(u+1)}(i,p,u[g],a[g],s,c);null===m&&null===d?h=g+1:(null===d||0<s(d,m))&&(d=m)}return n(null!==d?function(){e.continue(d+l)}:r),!1})),e}function Dt(e,t,n,r){return{type:2,lower:e,upper:t,lowerOpen:n,upperOpen:r}}function Ct(e){return{type:1,lower:e,upper:e}}var It=(Object.defineProperty(Rt.prototype,"Collection",{get:function(){return this._ctx.table.db.Collection},enumerable:!1,configurable:!0}),Rt.prototype.between=function(e,t,n,r){n=!1!==n,r=!0===r;try{return 0<this._cmp(e,t)||0===this._cmp(e,t)&&(n||r)&&(!n||!r)?Et(this):new this.Collection(this,(function(){return Dt(e,t,!n,!r)}))}catch(e){return St(this,Ze)}},Rt.prototype.equals=function(e){return null==e?St(this,Ze):new this.Collection(this,(function(){return Ct(e)}))},Rt.prototype.above=function(e){return null==e?St(this,Ze):new this.Collection(this,(function(){return Dt(e,void 0,!0)}))},Rt.prototype.aboveOrEqual=function(e){return null==e?St(this,Ze):new this.Collection(this,(function(){return Dt(e,void 0,!1)}))},Rt.prototype.below=function(e){return null==e?St(this,Ze):new this.Collection(this,(function(){return Dt(void 0,e,!1,!0)}))},Rt.prototype.belowOrEqual=function(e){return null==e?St(this,Ze):new this.Collection(this,(function(){return Dt(void 0,e)}))},Rt.prototype.startsWith=function(e){return"string"!=typeof e?St(this,et):this.between(e,e+Ye,!0,!0)},Rt.prototype.startsWithIgnoreCase=function(e){return""===e?this.startsWith(e):Ot(this,(function(e,t){return 0===e.indexOf(t[0])}),[e],Ye)},Rt.prototype.equalsIgnoreCase=function(e){return Ot(this,(function(e,t){return e===t[0]}),[e],"")},Rt.prototype.anyOfIgnoreCase=function(){var e=R.apply(I,arguments);return 0===e.length?Et(this):Ot(this,(function(e,t){return-1!==t.indexOf(e)}),e,"")},Rt.prototype.startsWithAnyOfIgnoreCase=function(){var e=R.apply(I,arguments);return 0===e.length?Et(this):Ot(this,(function(e,t){return t.some((function(t){return 0===e.indexOf(t)}))}),e,Ye)},Rt.prototype.anyOf=function(){var e=this,t=R.apply(I,arguments),n=this._cmp;try{t.sort(n)}catch(r){return St(this,Ze)}if(0===t.length)return Et(this);var r=new this.Collection(this,(function(){return Dt(t[0],t[t.length-1])}));r._ondirectionchange=function(r){n="next"===r?e._ascending:e._descending,t.sort(n)};var i=0;return r._addAlgorithm((function(e,r,o){for(var s=e.key;0<n(s,t[i]);)if(++i===t.length)return r(o),!1;return 0===n(s,t[i])||(r((function(){e.continue(t[i])})),!1)})),r},Rt.prototype.notEqual=function(e){return this.inAnyRange([[-1/0,e],[e,this.db._maxKey]],{includeLowers:!1,includeUppers:!1})},Rt.prototype.noneOf=function(){var e=R.apply(I,arguments);if(0===e.length)return new this.Collection(this);try{e.sort(this._ascending)}catch(e){return St(this,Ze)}var t=e.reduce((function(e,t){return e?e.concat([[e[e.length-1][1],t]]):[[-1/0,t]]}),null);return t.push([e[e.length-1],this.db._maxKey]),this.inAnyRange(t,{includeLowers:!1,includeUppers:!1})},Rt.prototype.inAnyRange=function(e,t){var n=this,r=this._cmp,i=this._ascending,o=this._descending,s=this._min,u=this._max;if(0===e.length)return Et(this);if(!e.every((function(e){return void 0!==e[0]&&void 0!==e[1]&&i(e[0],e[1])<=0})))return St(this,"First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower",H.InvalidArgument);var a,c=!t||!1!==t.includeLowers,l=t&&!0===t.includeUppers,f=i;function p(e,t){return f(e[0],t[0])}try{(a=e.reduce((function(e,t){for(var n=0,i=e.length;n<i;++n){var o=e[n];if(r(t[0],o[1])<0&&0<r(t[1],o[0])){o[0]=s(o[0],t[0]),o[1]=u(o[1],t[1]);break}}return n===i&&e.push(t),e}),[])).sort(p)}catch(e){return St(this,Ze)}var h=0,d=l?function(e){return 0<i(e,a[h][1])}:function(e){return 0<=i(e,a[h][1])},g=c?function(e){return 0<o(e,a[h][0])}:function(e){return 0<=o(e,a[h][0])},m=d;return(e=new this.Collection(this,(function(){return Dt(a[0][0],a[a.length-1][1],!c,!l)})))._ondirectionchange=function(e){f="next"===e?(m=d,i):(m=g,o),a.sort(p)},e._addAlgorithm((function(e,t,r){for(var o,s=e.key;m(s);)if(++h===a.length)return t(r),!1;return!d(o=s)&&!g(o)||(0===n._cmp(s,a[h][1])||0===n._cmp(s,a[h][0])||t((function(){f===i?e.continue(a[h][0]):e.continue(a[h][1])})),!1)})),e},Rt.prototype.startsWithAnyOf=function(){var e=R.apply(I,arguments);return e.every((function(e){return"string"==typeof e}))?0===e.length?Et(this):this.inAnyRange(e.map((function(e){return[e,e+Ye]}))):St(this,"startsWithAnyOf() only works with strings")},Rt);function Rt(){}function Bt(e){return Ce((function(t){return Kt(t),e(t.target.error),!1}))}function Kt(e){e.stopPropagation&&e.stopPropagation(),e.preventDefault&&e.preventDefault()}var Nt="storagemutated",Lt="x-storagemutated-1",Mt=dt(null,Nt),Ft=(Gt.prototype._lock=function(){return b(!ve.global),++this._reculock,1!==this._reculock||ve.global||(ve.lockOwnerFor=this),this},Gt.prototype._unlock=function(){if(b(!ve.global),0==--this._reculock)for(ve.global||(ve.lockOwnerFor=null);0<this._blockedFuncs.length&&!this._locked();){var e=this._blockedFuncs.shift();try{$e(e[1],e[0])}catch(e){}}return this},Gt.prototype._locked=function(){return this._reculock&&ve.lockOwnerFor!==this},Gt.prototype.create=function(e){var t=this;if(!this.mode)return this;var n=this.db.idbdb,r=this.db._state.dbOpenError;if(b(!this.idbtrans),!e&&!n)switch(r&&r.name){case"DatabaseClosedError":throw new H.DatabaseClosed(r);case"MissingAPIError":throw new H.MissingAPI(r.message,r);default:throw new H.OpenFailed(r)}if(!this.active)throw new H.TransactionInactive;return b(null===this._completion._state),(e=this.idbtrans=e||(this.db.core||n).transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability})).onerror=Ce((function(n){Kt(n),t._reject(e.error)})),e.onabort=Ce((function(n){Kt(n),t.active&&t._reject(new H.Abort(e.error)),t.active=!1,t.on("abort").fire(n)})),e.oncomplete=Ce((function(){t.active=!1,t._resolve(),"mutatedParts"in e&&Mt.storagemutated.fire(e.mutatedParts)})),this},Gt.prototype._promise=function(e,t,n){var r=this;if("readwrite"===e&&"readwrite"!==this.mode)return Xe(new H.ReadOnly("Transaction is readonly"));if(!this.active)return Xe(new H.TransactionInactive);if(this._locked())return new qe((function(i,o){r._blockedFuncs.push([function(){r._promise(e,t,n).then(i,o)},ve])}));if(n)return Me((function(){var e=new qe((function(e,n){r._lock();var i=t(e,n,r);i&&i.then&&i.then(e,n)}));return e.finally((function(){return r._unlock()})),e._lib=!0,e}));var i=new qe((function(e,n){var i=t(e,n,r);i&&i.then&&i.then(e,n)}));return i._lib=!0,i},Gt.prototype._root=function(){return this.parent?this.parent._root():this},Gt.prototype.waitFor=function(e){var t,n=this._root(),r=qe.resolve(e);n._waitingFor?n._waitingFor=n._waitingFor.then((function(){return r})):(n._waitingFor=r,n._waitingQueue=[],t=n.idbtrans.objectStore(n.storeNames[0]),function e(){for(++n._spinCount;n._waitingQueue.length;)n._waitingQueue.shift()();n._waitingFor&&(t.get(-1/0).onsuccess=e)}());var i=n._waitingFor;return new qe((function(e,t){r.then((function(t){return n._waitingQueue.push(Ce(e.bind(null,t)))}),(function(e){return n._waitingQueue.push(Ce(t.bind(null,e)))})).finally((function(){n._waitingFor===i&&(n._waitingFor=null)}))}))},Gt.prototype.abort=function(){this.active&&(this.active=!1,this.idbtrans&&this.idbtrans.abort(),this._reject(new H.Abort))},Gt.prototype.table=function(e){var t=this._memoizedTables||(this._memoizedTables={});if(l(t,e))return t[e];var n=this.schema[e];if(!n)throw new H.NotFound("Table "+e+" not part of transaction");return(n=new this.db.Table(e,n,this)).core=this.db.core.table(e),t[e]=n},Gt);function Gt(){}function Wt(e,t,n,r,i,o,s){return{name:e,keyPath:t,unique:n,multi:r,auto:i,compound:o,src:(n&&!s?"&":"")+(r?"*":"")+(i?"++":"")+zt(t)}}function zt(e){return"string"==typeof e?e:e?"["+[].join.call(e,"+")+"]":""}function Ht(e,t,n){return{name:e,primKey:t,indexes:n,mappedClass:null,idxByName:(r=function(e){return[e.name,e]},n.reduce((function(e,t,n){return(n=r(t,n))&&(e[n[0]]=n[1]),e}),{}))};var r}var Vt=function(e){try{return e.only([[]]),Vt=function(){return[[]]},[[]]}catch(e){return Vt=function(){return Ye},Ye}};function $t(e){return null==e?function(){}:"string"==typeof e?1===(t=e).split(".").length?function(e){return e[t]}:function(e){return T(e,t)}:function(t){return T(t,e)};var t}function Qt(e){return[].slice.call(e)}var Jt=0;function Xt(e){return null==e?":id":"string"==typeof e?e:"[".concat(e.join("+"),"]")}function Yt(e,t,n){function r(e){if(3===e.type)return null;if(4===e.type)throw new Error("Cannot convert never type to IDBKeyRange");var n=e.lower,r=e.upper,i=e.lowerOpen;return e=e.upperOpen,void 0===n?void 0===r?null:t.upperBound(r,!!e):void 0===r?t.lowerBound(n,!!i):t.bound(n,r,!!i,!!e)}function i(e){var t,n=e.name;return{name:n,schema:e,mutate:function(e){var t=e.trans,i=e.type,o=e.keys,s=e.values,u=e.range;return new Promise((function(e,a){e=Ce(e);var c=t.objectStore(n),l=null==c.keyPath,f="put"===i||"add"===i;if(!f&&"delete"!==i&&"deleteRange"!==i)throw new Error("Invalid operation type: "+i);var p,h=(o||s||{length:1}).length;if(o&&s&&o.length!==s.length)throw new Error("Given keys array must have same length as given values array.");if(0===h)return e({numFailures:0,failures:{},results:[],lastResult:void 0});function d(e){++y,Kt(e)}var g=[],m=[],y=0;if("deleteRange"===i){if(4===u.type)return e({numFailures:y,failures:m,results:[],lastResult:void 0});3===u.type?g.push(p=c.clear()):g.push(p=c.delete(r(u)))}else{var v=(l=f?l?[s,o]:[s,null]:[o,null])[0],b=l[1];if(f)for(var w=0;w<h;++w)g.push(p=b&&void 0!==b[w]?c[i](v[w],b[w]):c[i](v[w])),p.onerror=d;else for(w=0;w<h;++w)g.push(p=c[i](v[w])),p.onerror=d}function T(t){t=t.target.result,g.forEach((function(e,t){return null!=e.error&&(m[t]=e.error)})),e({numFailures:y,failures:m,results:"delete"===i?o:g.map((function(e){return e.result})),lastResult:t})}p.onerror=function(e){d(e),T(e)},p.onsuccess=T}))},getMany:function(e){var t=e.trans,r=e.keys;return new Promise((function(e,i){e=Ce(e);for(var o,s=t.objectStore(n),u=r.length,a=new Array(u),c=0,l=0,f=function(t){t=t.target,a[t._pos]=t.result,++l===c&&e(a)},p=Bt(i),h=0;h<u;++h)null!=r[h]&&((o=s.get(r[h]))._pos=h,o.onsuccess=f,o.onerror=p,++c);0===c&&e(a)}))},get:function(e){var t=e.trans,r=e.key;return new Promise((function(e,i){e=Ce(e);var o=t.objectStore(n).get(r);o.onsuccess=function(t){return e(t.target.result)},o.onerror=Bt(i)}))},query:(t=l,function(e){return new Promise((function(i,o){i=Ce(i);var s,u,a,c=e.trans,l=e.values,f=e.limit,p=e.query,h=f===1/0?void 0:f,d=p.index;if(p=p.range,c=c.objectStore(n),d=d.isPrimaryKey?c:c.index(d.name),p=r(p),0===f)return i({result:[]});t?((h=l?d.getAll(p,h):d.getAllKeys(p,h)).onsuccess=function(e){return i({result:e.target.result})},h.onerror=Bt(o)):(s=0,u=!l&&"openKeyCursor"in d?d.openKeyCursor(p):d.openCursor(p),a=[],u.onsuccess=function(e){var t=u.result;return t?(a.push(l?t.value:t.primaryKey),++s===f?i({result:a}):void t.continue()):i({result:a})},u.onerror=Bt(o))}))}),openCursor:function(e){var t=e.trans,i=e.values,o=e.query,s=e.reverse,u=e.unique;return new Promise((function(e,a){e=Ce(e);var c=o.index,l=o.range,f=t.objectStore(n),p=(f=c.isPrimaryKey?f:f.index(c.name),c=s?u?"prevunique":"prev":u?"nextunique":"next",!i&&"openKeyCursor"in f?f.openKeyCursor(r(l),c):f.openCursor(r(l),c));p.onerror=Bt(a),p.onsuccess=Ce((function(n){var r,i,o,s,u=p.result;u?(u.___id=++Jt,u.done=!1,r=u.continue.bind(u),i=(i=u.continuePrimaryKey)&&i.bind(u),o=u.advance.bind(u),s=function(){throw new Error("Cursor not stopped")},u.trans=t,u.stop=u.continue=u.continuePrimaryKey=u.advance=function(){throw new Error("Cursor not started")},u.fail=Ce(a),u.next=function(){var e=this,t=1;return this.start((function(){return t--?e.continue():e.stop()})).then((function(){return e}))},u.start=function(e){function t(){if(p.result)try{e()}catch(e){u.fail(e)}else u.done=!0,u.start=function(){throw new Error("Cursor behind last entry")},u.stop()}var n=new Promise((function(e,t){e=Ce(e),p.onerror=Bt(t),u.fail=t,u.stop=function(t){u.stop=u.continue=u.continuePrimaryKey=u.advance=s,e(t)}}));return p.onsuccess=Ce((function(e){p.onsuccess=t,t()})),u.continue=r,u.continuePrimaryKey=i,u.advance=o,t(),n},e(u)):e(null)}),a)}))},count:function(e){var t=e.query,i=e.trans,o=t.index,s=t.range;return new Promise((function(e,t){var u=i.objectStore(n),a=o.isPrimaryKey?u:u.index(o.name);(a=(u=r(s))?a.count(u):a.count()).onsuccess=Ce((function(t){return e(t.target.result)})),a.onerror=Bt(t)}))}}}var o,u,a,c=(u=n,a=Qt((o=e).objectStoreNames),{schema:{name:o.name,tables:a.map((function(e){return u.objectStore(e)})).map((function(e){var t=e.keyPath,n=e.autoIncrement,r=s(t),i={};return n={name:e.name,primaryKey:{name:null,isPrimaryKey:!0,outbound:null==t,compound:r,keyPath:t,autoIncrement:n,unique:!0,extractKey:$t(t)},indexes:Qt(e.indexNames).map((function(t){return e.index(t)})).map((function(e){var t=e.name,n=e.unique,r=e.multiEntry;return e=e.keyPath,r={name:t,compound:s(e),keyPath:e,unique:n,multiEntry:r,extractKey:$t(e)},i[Xt(e)]=r})),getIndexByKeyPath:function(e){return i[Xt(e)]}},i[":id"]=n.primaryKey,null!=t&&(i[Xt(t)]=n.primaryKey),n}))},hasGetAll:0<a.length&&"getAll"in u.objectStore(a[0])&&!("undefined"!=typeof navigator&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604)}),l=(n=c.schema,c.hasGetAll),f=(c=n.tables.map(i),{});return c.forEach((function(e){return f[e.name]=e})),{stack:"dbcore",transaction:e.transaction.bind(e),table:function(e){if(!f[e])throw new Error("Table '".concat(e,"' not found"));return f[e]},MIN_KEY:-1/0,MAX_KEY:Vt(t),schema:n}}function Zt(e,n,r,i){var o=r.IDBKeyRange;return r.indexedDB,{dbcore:(i=Yt(n,o,i),e.dbcore.reduce((function(e,n){return n=n.create,t(t({},e),n(e))}),i))}}function en(e,t){var n=t.db;t=Zt(e._middlewares,n,e._deps,t),e.core=t.dbcore,e.tables.forEach((function(t){var n=t.name;e.core.schema.tables.some((function(e){return e.name===n}))&&(t.core=e.core.table(n),e[n]instanceof e.Table&&(e[n].core=t.core))}))}function tn(e,t,n,r){n.forEach((function(n){var i=r[n];t.forEach((function(t){var r=function e(t,n){return g(t,n)||(t=a(t))&&e(t,n)}(t,n);(!r||"value"in r&&void 0===r.value)&&(t===e.Transaction.prototype||t instanceof e.Transaction?h(t,n,{get:function(){return this.table(n)},set:function(e){p(this,n,{value:e,writable:!0,configurable:!0,enumerable:!0})}}):t[n]=new e.Table(n,i))}))}))}function nn(e,t){t.forEach((function(t){for(var n in t)t[n]instanceof e.Table&&delete t[n]}))}function rn(e,t){return e._cfg.version-t._cfg.version}function on(e,t,n,r){var i=e._dbSchema;n.objectStoreNames.contains("$meta")&&!i.$meta&&(i.$meta=Ht("$meta",hn("")[0],[]),e._storeNames.push("$meta"));var s=e._createTransaction("readwrite",e._storeNames,i);s.create(n),s._completion.catch(r);var u=s._reject.bind(s),a=ve.transless||ve;Me((function(){return ve.trans=s,ve.transless=a,0!==t?(en(e,n),c=t,((r=s).storeNames.includes("$meta")?r.table("$meta").get("version").then((function(e){return null!=e?e:c})):qe.resolve(c)).then((function(t){return i=t,u=s,a=n,c=[],t=(r=e)._versions,l=r._dbSchema=fn(0,r.idbdb,a),0!==(t=t.filter((function(e){return e._cfg.version>=i}))).length?(t.forEach((function(e){c.push((function(){var t=l,n=e._cfg.dbschema;pn(r,t,a),pn(r,n,a),l=r._dbSchema=n;var s=un(t,n);s.add.forEach((function(e){an(a,e[0],e[1].primKey,e[1].indexes)})),s.change.forEach((function(e){if(e.recreate)throw new H.Upgrade("Not yet support for changing primary key");var t=a.objectStore(e.name);e.add.forEach((function(e){return ln(t,e)})),e.change.forEach((function(e){t.deleteIndex(e.name),ln(t,e)})),e.del.forEach((function(e){return t.deleteIndex(e)}))}));var c=e._cfg.contentUpgrade;if(c&&e._cfg.version>i){en(r,a),u._memoizedTables={};var f=A(n);s.del.forEach((function(e){f[e]=t[e]})),nn(r,[r.Transaction.prototype]),tn(r,[r.Transaction.prototype],o(f),f),u.schema=f;var p,h=B(c);return h&&Fe(),s=qe.follow((function(){var e;(p=c(u))&&h&&(e=Ge.bind(null,null),p.then(e,e))})),p&&"function"==typeof p.then?qe.resolve(p):s.then((function(){return p}))}})),c.push((function(t){var n,i,o=e._cfg.dbschema;n=o,i=t,[].slice.call(i.db.objectStoreNames).forEach((function(e){return null==n[e]&&i.db.deleteObjectStore(e)})),nn(r,[r.Transaction.prototype]),tn(r,[r.Transaction.prototype],r._storeNames,r._dbSchema),u.schema=r._dbSchema})),c.push((function(t){r.idbdb.objectStoreNames.contains("$meta")&&(Math.ceil(r.idbdb.version/10)===e._cfg.version?(r.idbdb.deleteObjectStore("$meta"),delete r._dbSchema.$meta,r._storeNames=r._storeNames.filter((function(e){return"$meta"!==e}))):t.objectStore("$meta").put(e._cfg.version,"version"))}))})),function e(){return c.length?qe.resolve(c.shift()(u.idbtrans)).then(e):qe.resolve()}().then((function(){cn(l,a)}))):qe.resolve();var r,i,u,a,c,l})).catch(u)):(o(i).forEach((function(e){an(n,e,i[e].primKey,i[e].indexes)})),en(e,n),void qe.follow((function(){return e.on.populate.fire(s)})).catch(u));var r,c}))}function sn(e,t){cn(e._dbSchema,t),t.db.version%10!=0||t.objectStoreNames.contains("$meta")||t.db.createObjectStore("$meta").add(Math.ceil(t.db.version/10-1),"version");var n=fn(0,e.idbdb,t);pn(e,e._dbSchema,t);for(var r=0,i=un(n,e._dbSchema).change;r<i.length;r++){var o=function(e){if(e.change.length||e.recreate)return console.warn("Unable to patch indexes of table ".concat(e.name," because it has changes on the type of index or primary key.")),{value:void 0};var n=t.objectStore(e.name);e.add.forEach((function(t){ie&&console.debug("Dexie upgrade patch: Creating missing index ".concat(e.name,".").concat(t.src)),ln(n,t)}))}(i[r]);if("object"==typeof o)return o.value}}function un(e,t){var n,r={del:[],add:[],change:[]};for(n in e)t[n]||r.del.push(n);for(n in t){var i=e[n],o=t[n];if(i){var s={name:n,def:o,recreate:!1,del:[],add:[],change:[]};if(""+(i.primKey.keyPath||"")!=""+(o.primKey.keyPath||"")||i.primKey.auto!==o.primKey.auto)s.recreate=!0,r.change.push(s);else{var u=i.idxByName,a=o.idxByName,c=void 0;for(c in u)a[c]||s.del.push(c);for(c in a){var l=u[c],f=a[c];l?l.src!==f.src&&s.change.push(f):s.add.push(f)}(0<s.del.length||0<s.add.length||0<s.change.length)&&r.change.push(s)}}else r.add.push([n,o])}return r}function an(e,t,n,r){var i=e.db.createObjectStore(t,n.keyPath?{keyPath:n.keyPath,autoIncrement:n.auto}:{autoIncrement:n.auto});return r.forEach((function(e){return ln(i,e)})),i}function cn(e,t){o(e).forEach((function(n){t.db.objectStoreNames.contains(n)||(ie&&console.debug("Dexie: Creating missing table",n),an(t,n,e[n].primKey,e[n].indexes))}))}function ln(e,t){e.createIndex(t.name,t.keyPath,{unique:t.unique,multiEntry:t.multi})}function fn(e,t,n){var r={};return y(t.objectStoreNames,0).forEach((function(e){for(var t=n.objectStore(e),i=Wt(zt(u=t.keyPath),u||"",!0,!1,!!t.autoIncrement,u&&"string"!=typeof u,!0),o=[],s=0;s<t.indexNames.length;++s){var u=(a=t.index(t.indexNames[s])).keyPath,a=Wt(a.name,u,!!a.unique,!!a.multiEntry,!1,u&&"string"!=typeof u,!1);o.push(a)}r[e]=Ht(e,i,o)})),r}function pn(e,t,n){for(var r=n.db.objectStoreNames,o=0;o<r.length;++o){var s=r[o],u=n.objectStore(s);e._hasGetAll="getAll"in u;for(var a=0;a<u.indexNames.length;++a){var c=u.indexNames[a],l=u.index(c).keyPath,f="string"==typeof l?l:"["+y(l).join("+")+"]";!t[s]||(l=t[s].idxByName[f])&&(l.name=c,delete t[s].idxByName[f],t[s].idxByName[c]=l)}}"undefined"!=typeof navigator&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&i.WorkerGlobalScope&&i instanceof i.WorkerGlobalScope&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604&&(e._hasGetAll=!1)}function hn(e){return e.split(",").map((function(e,t){var n=(e=e.trim()).replace(/([&*]|\+\+)/g,""),r=/^\[/.test(n)?n.match(/^\[(.*)\]$/)[1].split("+"):n;return Wt(n,r||null,/\&/.test(e),/\*/.test(e),/\+\+/.test(e),s(r),0===t)}))}var dn=(gn.prototype._parseStoresSpec=function(e,t){o(e).forEach((function(n){if(null!==e[n]){var r=hn(e[n]),i=r.shift();if(i.unique=!0,i.multi)throw new H.Schema("Primary key cannot be multi-valued");r.forEach((function(e){if(e.auto)throw new H.Schema("Only primary key can be marked as autoIncrement (++)");if(!e.keyPath)throw new H.Schema("Index must have a name and cannot be an empty string")})),t[n]=Ht(n,i,r)}}))},gn.prototype.stores=function(e){var t=this.db;this._cfg.storesSource=this._cfg.storesSource?u(this._cfg.storesSource,e):e,e=t._versions;var n={},r={};return e.forEach((function(e){u(n,e._cfg.storesSource),r=e._cfg.dbschema={},e._parseStoresSpec(n,r)})),t._dbSchema=r,nn(t,[t._allTables,t,t.Transaction.prototype]),tn(t,[t._allTables,t,t.Transaction.prototype,this._cfg.tables],o(r),r),t._storeNames=o(r),this},gn.prototype.upgrade=function(e){return this._cfg.contentUpgrade=re(this._cfg.contentUpgrade||Q,e),this},gn);function gn(){}function mn(e,t){var n=e._dbNamesDB;return n||(n=e._dbNamesDB=new tr(nt,{addons:[],indexedDB:e,IDBKeyRange:t})).version(1).stores({dbnames:"name"}),n.table("dbnames")}function yn(e){return e&&"function"==typeof e.databases}function vn(e){return Me((function(){return ve.letThrough=!0,e()}))}function bn(e){return!("from"in e)}var wn=function(e,t){if(!this){var n=new wn;return e&&"d"in e&&u(n,e),n}u(this,arguments.length?{d:1,from:e,to:1<arguments.length?t:e}:{d:0})};function Tn(e,t,n){var r=ct(t,n);if(!isNaN(r)){if(0<r)throw RangeError();if(bn(e))return u(e,{from:t,to:n,d:1});var i=e.l;if(r=e.r,ct(n,e.from)<0)return i?Tn(i,t,n):e.l={from:t,to:n,d:1,l:null,r:null},kn(e);if(0<ct(t,e.to))return r?Tn(r,t,n):e.r={from:t,to:n,d:1,l:null,r:null},kn(e);ct(t,e.from)<0&&(e.from=t,e.l=null,e.d=r?r.d+1:1),0<ct(n,e.to)&&(e.to=n,e.r=null,e.d=e.l?e.l.d+1:1),n=!e.r,i&&!e.l&&qn(e,i),r&&n&&qn(e,r)}}function qn(e,t){bn(t)||function e(t,n){var r=n.from,i=n.to,o=n.l;n=n.r,Tn(t,r,i),o&&e(t,o),n&&e(t,n)}(e,t)}function An(e,t){var n=_n(t),r=n.next();if(r.done)return!1;for(var i=r.value,o=_n(e),s=o.next(i.from),u=s.value;!r.done&&!s.done;){if(ct(u.from,i.to)<=0&&0<=ct(u.to,i.from))return!0;ct(i.from,u.from)<0?i=(r=n.next(u.from)).value:u=(s=o.next(i.from)).value}return!1}function _n(e){var t=bn(e)?null:{s:0,n:e};return{next:function(e){for(var n=0<arguments.length;t;)switch(t.s){case 0:if(t.s=1,n)for(;t.n.l&&ct(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,!n||ct(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 kn(e){var n,r,i=((null===(n=e.r)||void 0===n?void 0:n.d)||0)-((null===(r=e.l)||void 0===r?void 0:r.d)||0),o=1<i?"r":i<-1?"l":"";o&&(n="r"==o?"l":"r",r=t({},e),i=e[o],e.from=i.from,e.to=i.to,e[o]=i[o],r[o]=i[n],(e[n]=r).d=Un(r)),e.d=Un(e)}function Un(e){var t=e.r;return e=e.l,(t?e?Math.max(t.d,e.d):t.d:e?e.d:0)+1}function xn(e,t){return o(t).forEach((function(n){e[n]?qn(e[n],t[n]):e[n]=function e(t){var n,r,i={};for(n in t)l(t,n)&&(r=t[n],i[n]=!r||"object"!=typeof r||x.has(r.constructor)?r:e(r));return i}(t[n])})),e}function jn(e,t){return e.all||t.all||Object.keys(e).some((function(n){return t[n]&&An(t[n],e[n])}))}f(wn.prototype,((K={add:function(e){return qn(this,e),this},addKey:function(e){return Tn(this,e,e),this},addKeys:function(e){var t=this;return e.forEach((function(e){return Tn(t,e,e)})),this},hasKey:function(e){var t=_n(this).next(e).value;return t&&ct(t.from,e)<=0&&0<=ct(t.to,e)}})[O]=function(){return _n(this)},K));var Pn={},Sn={},En=!1;function On(e){xn(Sn,e),En||(En=!0,setTimeout((function(){En=!1,Dn(Sn,!(Sn={}))}),0))}function Dn(e,t){void 0===t&&(t=!1);var n=new Set;if(e.all)for(var r=0,i=Object.values(Pn);r<i.length;r++)Cn(s=i[r],e,n,t);else for(var o in e){var s,u=/^idb\:\/\/(.*)\/(.*)\//.exec(o);u&&(o=u[1],u=u[2],(s=Pn["idb://".concat(o,"/").concat(u)])&&Cn(s,e,n,t))}n.forEach((function(e){return e()}))}function Cn(e,t,n,r){for(var i=[],o=0,s=Object.entries(e.queries.query);o<s.length;o++){for(var u=s[o],a=u[0],c=[],l=0,f=u[1];l<f.length;l++){var p=f[l];jn(t,p.obsSet)?p.subscribers.forEach((function(e){return n.add(e)})):r&&c.push(p)}r&&i.push([a,c])}if(r)for(var h=0,d=i;h<d.length;h++){var g=d[h];a=g[0],c=g[1],e.queries.query[a]=c}}function In(e){var t=e._state,n=e._deps.indexedDB;if(t.isBeingOpened||e.idbdb)return t.dbReadyPromise.then((function(){return t.dbOpenError?Xe(t.dbOpenError):e}));t.isBeingOpened=!0,t.dbOpenError=null,t.openComplete=!1;var r=t.openCanceller,i=Math.round(10*e.verno),s=!1;function u(){if(t.openCanceller!==r)throw new H.DatabaseClosed("db.open() was cancelled")}function a(){return new qe((function(r,c){if(u(),!n)throw new H.MissingAPI;var l=e.name,h=t.autoSchema||!i?n.open(l):n.open(l,i);if(!h)throw new H.MissingAPI;h.onerror=Bt(c),h.onblocked=Ce(e._fireOnBlocked),h.onupgradeneeded=Ce((function(r){var i;f=h.transaction,t.autoSchema&&!e._options.allowEmptyDB?(h.onerror=Kt,f.abort(),h.result.close(),(i=n.deleteDatabase(l)).onsuccess=i.onerror=Ce((function(){c(new H.NoSuchDatabase("Database ".concat(l," doesnt exist")))}))):(f.onerror=Bt(c),r=r.oldVersion>Math.pow(2,62)?0:r.oldVersion,p=r<1,e.idbdb=h.result,s&&sn(e,f),on(e,r/10,f,c))}),c),h.onsuccess=Ce((function(){f=null;var n,u,c,d,g,m=e.idbdb=h.result,v=y(m.objectStoreNames);if(0<v.length)try{var b=m.transaction(1===(d=v).length?d[0]:d,"readonly");if(t.autoSchema)u=m,c=b,(n=e).verno=u.version/10,c=n._dbSchema=fn(0,u,c),n._storeNames=y(u.objectStoreNames,0),tn(n,[n._allTables],o(c),c);else if(pn(e,e._dbSchema,b),((g=un(fn(0,(g=e).idbdb,b),g._dbSchema)).add.length||g.change.some((function(e){return e.add.length||e.change.length})))&&!s)return console.warn("Dexie SchemaDiff: Schema was extended without increasing the number passed to db.version(). Dexie will add missing parts and increment native version number to workaround this."),m.close(),i=m.version+1,s=!0,r(a());en(e,b)}catch(n){}tt.push(e),m.onversionchange=Ce((function(n){t.vcFired=!0,e.on("versionchange").fire(n)})),m.onclose=Ce((function(t){e.on("close").fire(t)})),p&&(g=e._deps,b=l,m=g.indexedDB,g=g.IDBKeyRange,yn(m)||b===nt||mn(m,g).put({name:b}).catch(Q)),r()}),c)})).catch((function(e){switch(null==e?void 0:e.name){case"UnknownError":if(0<t.PR1398_maxLoop)return t.PR1398_maxLoop--,console.warn("Dexie: Workaround for Chrome UnknownError on open()"),a();break;case"VersionError":if(0<i)return i=0,a()}return qe.reject(e)}))}var c,l=t.dbReadyResolve,f=null,p=!1;return qe.race([r,("undefined"==typeof navigator?qe.resolve():!navigator.userAgentData&&/Safari\//.test(navigator.userAgent)&&!/Chrom(e|ium)\//.test(navigator.userAgent)&&indexedDB.databases?new Promise((function(e){function t(){return indexedDB.databases().finally(e)}c=setInterval(t,100),t()})).finally((function(){return clearInterval(c)})):Promise.resolve()).then(a)]).then((function(){return u(),t.onReadyBeingFired=[],qe.resolve(vn((function(){return e.on.ready.fire(e.vip)}))).then((function n(){if(0<t.onReadyBeingFired.length){var r=t.onReadyBeingFired.reduce(re,Q);return t.onReadyBeingFired=[],qe.resolve(vn((function(){return r(e.vip)}))).then(n)}}))})).finally((function(){t.openCanceller===r&&(t.onReadyBeingFired=null,t.isBeingOpened=!1)})).catch((function(n){t.dbOpenError=n;try{f&&f.abort()}catch(n){}return r===t.openCanceller&&e._close(),Xe(n)})).finally((function(){t.openComplete=!0,l()})).then((function(){var t;return p&&(t={},e.tables.forEach((function(n){n.schema.indexes.forEach((function(r){r.name&&(t["idb://".concat(e.name,"/").concat(n.name,"/").concat(r.name)]=new wn(-1/0,[[[]]]))})),t["idb://".concat(e.name,"/").concat(n.name,"/")]=t["idb://".concat(e.name,"/").concat(n.name,"/:dels")]=new wn(-1/0,[[[]]])})),Mt(Nt).fire(t),Dn(t,!0)),e}))}function Rn(e){function t(t){return e.next(t)}var n=i(t),r=i((function(t){return e.throw(t)}));function i(e){return function(t){var i=e(t);return t=i.value,i.done?t:t&&"function"==typeof t.then?t.then(n,r):s(t)?Promise.all(t).then(n,r):n(t)}}return i(t)()}function Bn(e,t,n){for(var r=s(e)?e.slice():[e],i=0;i<n;++i)r.push(t);return r}var Kn={stack:"dbcore",name:"VirtualIndexMiddleware",level:1,create:function(e){return t(t({},e),{table:function(n){var r=e.table(n),i=r.schema,o={},s=[];function u(e,n,r){var i=Xt(e),a=o[i]=o[i]||[],c=null==e?0:"string"==typeof e?1:e.length,l=0<n;return l=t(t({},r),{name:l?"".concat(i,"(virtual-from:").concat(r.name,")"):r.name,lowLevelIndex:r,isVirtual:l,keyTail:n,keyLength:c,extractKey:$t(e),unique:!l&&r.unique}),a.push(l),l.isPrimaryKey||s.push(l),1<c&&u(2===c?e[0]:e.slice(0,c-1),n+1,r),a.sort((function(e,t){return e.keyTail-t.keyTail})),l}n=u(i.primaryKey.keyPath,0,i.primaryKey),o[":id"]=[n];for(var a=0,c=i.indexes;a<c.length;a++){var l=c[a];u(l.keyPath,0,l)}function f(n){var r,i=n.query.index;return i.isVirtual?t(t({},n),{query:{index:i.lowLevelIndex,range:(r=n.query.range,i=i.keyTail,{type:1===r.type?2:r.type,lower:Bn(r.lower,r.lowerOpen?e.MAX_KEY:e.MIN_KEY,i),lowerOpen:!0,upper:Bn(r.upper,r.upperOpen?e.MIN_KEY:e.MAX_KEY,i),upperOpen:!0})}}):n}return t(t({},r),{schema:t(t({},i),{primaryKey:n,indexes:s,getIndexByKeyPath:function(e){return(e=o[Xt(e)])&&e[0]}}),count:function(e){return r.count(f(e))},query:function(e){return r.query(f(e))},openCursor:function(t){var n=t.query.index,i=n.keyTail,o=n.isVirtual,s=n.keyLength;return o?r.openCursor(f(t)).then((function(e){return e&&u(e)})):r.openCursor(t);function u(n){return Object.create(n,{continue:{value:function(r){null!=r?n.continue(Bn(r,t.reverse?e.MAX_KEY:e.MIN_KEY,i)):t.unique?n.continue(n.key.slice(0,s).concat(t.reverse?e.MIN_KEY:e.MAX_KEY,i)):n.continue()}},continuePrimaryKey:{value:function(t,r){n.continuePrimaryKey(Bn(t,e.MAX_KEY,i),r)}},primaryKey:{get:function(){return n.primaryKey}},key:{get:function(){var e=n.key;return 1===s?e[0]:e.slice(0,s)}},value:{get:function(){return n.value}}})}}})}})}};function Nn(e,t,n,r){return n=n||{},r=r||"",o(e).forEach((function(i){var o,s,u;l(t,i)?(o=e[i],s=t[i],"object"==typeof o&&"object"==typeof s&&o&&s?(u=E(o))!==E(s)?n[r+i]=t[i]:"Object"===u?Nn(o,s,n,r+i+"."):o!==s&&(n[r+i]=t[i]):o!==s&&(n[r+i]=t[i])):n[r+i]=void 0})),o(t).forEach((function(i){l(e,i)||(n[r+i]=t[i])})),n}function Ln(e,t){return"delete"===t.type?t.keys:t.keys||t.values.map(e.extractKey)}var Mn={stack:"dbcore",name:"HooksMiddleware",level:2,create:function(e){return t(t({},e),{table:function(n){var i=e.table(n),o=i.schema.primaryKey;return t(t({},i),{mutate:function(e){var s=ve.trans,u=s.table(n).hook,a=u.deleting,c=u.creating,f=u.updating;switch(e.type){case"add":if(c.fire===Q)break;return s._promise("readwrite",(function(){return p(e)}),!0);case"put":if(c.fire===Q&&f.fire===Q)break;return s._promise("readwrite",(function(){return p(e)}),!0);case"delete":if(a.fire===Q)break;return s._promise("readwrite",(function(){return p(e)}),!0);case"deleteRange":if(a.fire===Q)break;return s._promise("readwrite",(function(){return function e(n,r,s){return i.query({trans:n,values:!1,query:{index:o,range:r},limit:s}).then((function(i){var o=i.result;return p({type:"delete",keys:o,trans:n}).then((function(i){return 0<i.numFailures?Promise.reject(i.failures[0]):o.length<s?{failures:[],numFailures:0,lastResult:void 0}:e(n,t(t({},r),{lower:o[o.length-1],lowerOpen:!0}),s)}))}))}(e.trans,e.range,1e4)}),!0)}return i.mutate(e);function p(e){var n,s,u,p=ve.trans,h=e.keys||Ln(o,e);if(!h)throw new Error("Keys missing");return"delete"!==(e="add"===e.type||"put"===e.type?t(t({},e),{keys:h}):t({},e)).type&&(e.values=r([],e.values,!0)),e.keys&&(e.keys=r([],e.keys,!0)),n=i,u=h,("add"===(s=e).type?Promise.resolve([]):n.getMany({trans:s.trans,keys:u,cache:"immutable"})).then((function(t){var n=h.map((function(n,r){var i,s,u,h=t[r],d={onerror:null,onsuccess:null};return"delete"===e.type?a.fire.call(d,n,h,p):"add"===e.type||void 0===h?(i=c.fire.call(d,n,e.values[r],p),null==n&&null!=i&&(e.keys[r]=n=i,o.outbound||q(e.values[r],o.keyPath,n))):(i=Nn(h,e.values[r]),(s=f.fire.call(d,i,n,h,p))&&(u=e.values[r],Object.keys(s).forEach((function(e){l(u,e)?u[e]=s[e]:q(u,e,s[e])})))),d}));return i.mutate(e).then((function(r){for(var i=r.failures,o=r.results,s=r.numFailures,u=(r=r.lastResult,0);u<h.length;++u){var a=(o||h)[u],c=n[u];null==a?c.onerror&&c.onerror(i[u]):c.onsuccess&&c.onsuccess("put"===e.type&&t[u]?e.values[u]:a)}return{failures:i,results:o,numFailures:s,lastResult:r}})).catch((function(e){return n.forEach((function(t){return t.onerror&&t.onerror(e)})),Promise.reject(e)}))}))}}})}})}};function Fn(e,t,n){try{if(!t)return null;if(t.keys.length<e.length)return null;for(var r=[],i=0,o=0;i<t.keys.length&&o<e.length;++i)0===ct(t.keys[i],e[o])&&(r.push(n?P(t.values[i]):t.values[i]),++o);return r.length===e.length?r:null}catch(e){return null}}var Gn={stack:"dbcore",level:-1,create:function(e){return{table:function(n){var r=e.table(n);return t(t({},r),{getMany:function(e){if(!e.cache)return r.getMany(e);var t=Fn(e.keys,e.trans._cache,"clone"===e.cache);return t?qe.resolve(t):r.getMany(e).then((function(t){return e.trans._cache={keys:e.keys,values:"clone"===e.cache?P(t):t},t}))},mutate:function(e){return"add"!==e.type&&(e.trans._cache=null),r.mutate(e)}})}}}};function Wn(e,t){return"readonly"===e.trans.mode&&!!e.subscr&&!e.trans.explicit&&"disabled"!==e.trans.db._options.cache&&!t.schema.primaryKey.outbound}function zn(e,t){switch(e){case"query":return t.values&&!t.unique;case"get":case"getMany":case"count":case"openCursor":return!1}}var Hn={stack:"dbcore",level:0,name:"Observability",create:function(e){var n=e.schema.name,r=new wn(e.MIN_KEY,e.MAX_KEY);return t(t({},e),{transaction:function(t,n,r){if(ve.subscr&&"readonly"!==n)throw new H.ReadOnly("Readwrite transaction in liveQuery context. Querier source: ".concat(ve.querier));return e.transaction(t,n,r)},table:function(i){var u=e.table(i),a=u.schema,c=a.primaryKey,l=a.indexes,f=c.extractKey,p=c.outbound,h=c.autoIncrement&&l.filter((function(e){return e.compound&&e.keyPath.includes(c.keyPath)})),d=t(t({},u),{mutate:function(e){function t(e){return e="idb://".concat(n,"/").concat(i,"/").concat(e),d[e]||(d[e]=new wn)}var o,l,f,p=e.trans,d=e.mutatedParts||(e.mutatedParts={}),g=t(""),m=t(":dels"),y=e.type,v="deleteRange"===e.type?[e.range]:"delete"===e.type?[e.keys]:e.values.length<50?[Ln(c,e).filter((function(e){return e})),e.values]:[],b=v[0],w=v[1];return v=e.trans._cache,s(b)?(g.addKeys(b),(v="delete"===y||b.length===w.length?Fn(b,v):null)||m.addKeys(b),(v||w)&&(o=t,l=v,f=w,a.indexes.forEach((function(e){var t=o(e.name||"");function n(t){return null!=t?e.extractKey(t):null}function r(n){return e.multiEntry&&s(n)?n.forEach((function(e){return t.addKey(e)})):t.addKey(n)}(l||f).forEach((function(e,t){var i=l&&n(l[t]);0!==ct(i,t=f&&n(f[t]))&&(null!=i&&r(i),null!=t&&r(t))}))})))):b?(w={from:b.lower,to:b.upper},m.add(w),g.add(w)):(g.add(r),m.add(r),a.indexes.forEach((function(e){return t(e.name).add(r)}))),u.mutate(e).then((function(n){return!b||"add"!==e.type&&"put"!==e.type||(g.addKeys(n.results),h&&h.forEach((function(r){var i=e.values.map((function(e){return r.extractKey(e)})),o=r.keyPath.findIndex((function(e){return e===c.keyPath}));n.results.forEach((function(e){return i[o]=e})),t(r.name).addKeys(i)}))),p.mutatedParts=xn(p.mutatedParts||{},d),n}))}}),g=(l=function(t){t=(n=t.query).index;var n=n.range;return[t,new wn(null!==(t=n.lower)&&void 0!==t?t:e.MIN_KEY,null!==(n=n.upper)&&void 0!==n?n:e.MAX_KEY)]},{get:function(e){return[c,new wn(e.key)]},getMany:function(e){return[c,(new wn).addKeys(e.keys)]},count:l,query:l,openCursor:l});return o(g).forEach((function(e){d[e]=function(o){var s=!!(d=ve.subscr),a=Wn(ve,u)&&zn(e,o)?o.obsSet={}:d;if(s){var c=function(e){return e="idb://".concat(n,"/").concat(i,"/").concat(e),a[e]||(a[e]=new wn)},l=c(""),h=c(":dels"),d=(s=(d=g[e](o))[0],d[1]);if(("query"===e&&s.isPrimaryKey&&!o.values?h:c(s.name||"")).add(d),!s.isPrimaryKey){if("count"!==e){var m="query"===e&&p&&o.values&&u.query(t(t({},o),{values:!1}));return u[e].apply(this,arguments).then((function(t){if("query"===e){if(p&&o.values)return m.then((function(e){return e=e.result,l.addKeys(e),t}));var n=o.values?t.result.map(f):t.result;(o.values?l:h).addKeys(n)}else if("openCursor"===e){var r=t,i=o.values;return r&&Object.create(r,{key:{get:function(){return h.addKey(r.primaryKey),r.key}},primaryKey:{get:function(){var e=r.primaryKey;return h.addKey(e),e}},value:{get:function(){return i&&l.addKey(r.primaryKey),r.value}}})}return t}))}h.add(r)}}return u[e].apply(this,arguments)}})),d}})}};function Vn(e,n,r){if(0===r.numFailures)return n;if("deleteRange"===n.type)return null;var i=n.keys?n.keys.length:"values"in n&&n.values?n.values.length:1;return r.numFailures===i?null:(n=t({},n),s(n.keys)&&(n.keys=n.keys.filter((function(e,t){return!(t in r.failures)}))),"values"in n&&s(n.values)&&(n.values=n.values.filter((function(e,t){return!(t in r.failures)}))),n)}function $n(e,t){return n=e,(void 0===(r=t).lower||(r.lowerOpen?0<ct(n,r.lower):0<=ct(n,r.lower)))&&(void 0===t.upper||(t.upperOpen?ct(e,t.upper)<0:ct(e,t.upper)<=0));var n,r}function Qn(e,t,n,r,i,o){if(!n||0===n.length)return e;var u=t.query.index,a=u.multiEntry,c=t.query.range,l=r.schema.primaryKey.extractKey,f=u.extractKey,p=(u.lowLevelIndex||u).extractKey;return n=n.reduce((function(e,n){var r=e,i=[];if("add"===n.type||"put"===n.type)for(var o=new wn,u=n.values.length-1;0<=u;--u){var p,h=n.values[u],d=l(h);o.hasKey(d)||(p=f(h),(a&&s(p)?p.some((function(e){return $n(e,c)})):$n(p,c))&&(o.addKey(d),i.push(h)))}switch(n.type){case"add":r=e.concat(t.values?i:i.map((function(e){return l(e)})));break;case"put":var g=(new wn).addKeys(n.values.map((function(e){return l(e)})));r=e.filter((function(e){return!g.hasKey(t.values?l(e):e)})).concat(t.values?i:i.map((function(e){return l(e)})));break;case"delete":var m=(new wn).addKeys(n.keys);r=e.filter((function(e){return!m.hasKey(t.values?l(e):e)}));break;case"deleteRange":var y=n.range;r=e.filter((function(e){return!$n(l(e),y)}))}return r}),e),n===e?e:(n.sort((function(e,t){return ct(p(e),p(t))||ct(l(e),l(t))})),t.limit&&t.limit<1/0&&(n.length>t.limit?n.length=t.limit:e.length===t.limit&&n.length<t.limit&&(i.dirty=!0)),o?Object.freeze(n):n)}function Jn(e,t){return 0===ct(e.lower,t.lower)&&0===ct(e.upper,t.upper)&&!!e.lowerOpen==!!t.lowerOpen&&!!e.upperOpen==!!t.upperOpen}function Xn(e,t){return function(e,t,n,r){if(void 0===e)return void 0!==t?-1:0;if(void 0===t)return 1;if(0===(t=ct(e,t))){if(n&&r)return 0;if(n)return 1;if(r)return-1}return t}(e.lower,t.lower,e.lowerOpen,t.lowerOpen)<=0&&0<=function(e,t,n,r){if(void 0===e)return void 0!==t?1:0;if(void 0===t)return-1;if(0===(t=ct(e,t))){if(n&&r)return 0;if(n)return-1;if(r)return 1}return t}(e.upper,t.upper,e.upperOpen,t.upperOpen)}function Yn(e,t,n,r){e.subscribers.add(n),r.addEventListener("abort",(function(){var r,i;e.subscribers.delete(n),0===e.subscribers.size&&(r=e,i=t,setTimeout((function(){0===r.subscribers.size&&C(i,r)}),3e3))}))}var Zn={stack:"dbcore",level:0,name:"Cache",create:function(e){var n=e.schema.name;return t(t({},e),{transaction:function(t,r,i){var o,s,u=e.transaction(t,r,i);return"readwrite"===r&&(s=(o=new AbortController).signal,i=function(i){return function(){if(o.abort(),"readwrite"===r){for(var s=new Set,a=0,c=t;a<c.length;a++){var l=c[a],f=Pn["idb://".concat(n,"/").concat(l)];if(f){var p=e.table(l),h=f.optimisticOps.filter((function(e){return e.trans===u}));if(u._explicit&&i&&u.mutatedParts)for(var d=0,g=Object.values(f.queries.query);d<g.length;d++)for(var m=0,y=(w=g[d]).slice();m<y.length;m++)jn((T=y[m]).obsSet,u.mutatedParts)&&(C(w,T),T.subscribers.forEach((function(e){return s.add(e)})));else if(0<h.length){f.optimisticOps=f.optimisticOps.filter((function(e){return e.trans!==u}));for(var v=0,b=Object.values(f.queries.query);v<b.length;v++)for(var w,T,q,A=0,_=(w=b[v]).slice();A<_.length;A++)null!=(T=_[A]).res&&u.mutatedParts&&(i&&!T.dirty?(q=Object.isFrozen(T.res),q=Qn(T.res,T.req,h,p,T,q),T.dirty?(C(w,T),T.subscribers.forEach((function(e){return s.add(e)}))):q!==T.res&&(T.res=q,T.promise=qe.resolve({result:q}))):(T.dirty&&C(w,T),T.subscribers.forEach((function(e){return s.add(e)}))))}}}s.forEach((function(e){return e()}))}}},u.addEventListener("abort",i(!1),{signal:s}),u.addEventListener("error",i(!1),{signal:s}),u.addEventListener("complete",i(!0),{signal:s})),u},table:function(r){var i=e.table(r),o=i.schema.primaryKey;return t(t({},i),{mutate:function(e){var s=ve.trans;if(o.outbound||"disabled"===s.db._options.cache||s.explicit)return i.mutate(e);var u=Pn["idb://".concat(n,"/").concat(r)];return u?(s=i.mutate(e),"add"!==e.type&&"put"!==e.type||!(50<=e.values.length||Ln(o,e).some((function(e){return null==e})))?(u.optimisticOps.push(e),e.mutatedParts&&On(e.mutatedParts),s.then((function(t){0<t.numFailures&&(C(u.optimisticOps,e),(t=Vn(0,e,t))&&u.optimisticOps.push(t),e.mutatedParts&&On(e.mutatedParts))})),s.catch((function(){C(u.optimisticOps,e),e.mutatedParts&&On(e.mutatedParts)}))):s.then((function(n){var r=Vn(0,t(t({},e),{values:e.values.map((function(e,r){var i;return q(e=null!==(i=o.keyPath)&&void 0!==i&&i.includes(".")?P(e):t({},e),o.keyPath,n.results[r]),e}))}),n);u.optimisticOps.push(r),queueMicrotask((function(){return e.mutatedParts&&On(e.mutatedParts)}))})),s):i.mutate(e)},query:function(e){if(!Wn(ve,i)||!zn("query",e))return i.query(e);var t="immutable"===(null===(u=ve.trans)||void 0===u?void 0:u.db._options.cache),o=(c=ve).requery,s=c.signal,u=function(e,t,n,r){var i=Pn["idb://".concat(e,"/").concat(t)];if(!i)return[];if(!(t=i.queries[n]))return[null,!1,i,null];var o=t[(r.query?r.query.index.name:null)||""];if(!o)return[null,!1,i,null];switch(n){case"query":var s=o.find((function(e){return e.req.limit===r.limit&&e.req.values===r.values&&Jn(e.req.query.range,r.query.range)}));return s?[s,!0,i,o]:[o.find((function(e){return("limit"in e.req?e.req.limit:1/0)>=r.limit&&(!r.values||e.req.values)&&Xn(e.req.query.range,r.query.range)})),!1,i,o];case"count":return s=o.find((function(e){return Jn(e.req.query.range,r.query.range)})),[s,!!s,i,o]}}(n,r,"query",e),a=u[0],c=u[1],l=u[2],f=u[3];return a&&c?a.obsSet=e.obsSet:(c=i.query(e).then((function(e){var n=e.result;if(a&&(a.res=n),t){for(var r=0,i=n.length;r<i;++r)Object.freeze(n[r]);Object.freeze(n)}else e.result=P(n);return e})).catch((function(e){return f&&a&&C(f,a),Promise.reject(e)})),a={obsSet:e.obsSet,promise:c,subscribers:new Set,type:"query",req:e,dirty:!1},f?f.push(a):(f=[a],(l=l||(Pn["idb://".concat(n,"/").concat(r)]={queries:{query:{},count:{}},objs:new Map,optimisticOps:[],unsignaledParts:{}})).queries.query[e.query.index.name||""]=f)),Yn(a,f,o,s),a.promise.then((function(n){return{result:Qn(n.result,e,null==l?void 0:l.optimisticOps,i,a,t)}}))}})}})}};function er(e,t){return new Proxy(e,{get:function(e,n,r){return"db"===n?t:Reflect.get(e,n,r)}})}var tr=(nr.prototype.version=function(e){if(isNaN(e)||e<.1)throw new H.Type("Given version is not a positive number");if(e=Math.round(10*e)/10,this.idbdb||this._state.isBeingOpened)throw new H.Schema("Cannot add version when database is open");this.verno=Math.max(this.verno,e);var t=this._versions,n=t.filter((function(t){return t._cfg.version===e}))[0];return n||(n=new this.Version(e),t.push(n),t.sort(rn),n.stores({}),this._state.autoSchema=!1,n)},nr.prototype._whenReady=function(e){var t=this;return this.idbdb&&(this._state.openComplete||ve.letThrough||this._vip)?e():new qe((function(e,n){if(t._state.openComplete)return n(new H.DatabaseClosed(t._state.dbOpenError));if(!t._state.isBeingOpened){if(!t._state.autoOpen)return void n(new H.DatabaseClosed);t.open().catch(Q)}t._state.dbReadyPromise.then(e,n)})).then(e)},nr.prototype.use=function(e){var t=e.stack,n=e.create,r=e.level,i=e.name;return i&&this.unuse({stack:t,name:i}),(e=this._middlewares[t]||(this._middlewares[t]=[])).push({stack:t,create:n,level:null==r?10:r,name:i}),e.sort((function(e,t){return e.level-t.level})),this},nr.prototype.unuse=function(e){var t=e.stack,n=e.name,r=e.create;return t&&this._middlewares[t]&&(this._middlewares[t]=this._middlewares[t].filter((function(e){return r?e.create!==r:!!n&&e.name!==n}))),this},nr.prototype.open=function(){var e=this;return $e(ye,(function(){return In(e)}))},nr.prototype._close=function(){var e=this._state,t=tt.indexOf(this);if(0<=t&&tt.splice(t,1),this.idbdb){try{this.idbdb.close()}catch(t){}this.idbdb=null}e.isBeingOpened||(e.dbReadyPromise=new qe((function(t){e.dbReadyResolve=t})),e.openCanceller=new qe((function(t,n){e.cancelOpen=n})))},nr.prototype.close=function(e){var t=(void 0===e?{disableAutoOpen:!0}:e).disableAutoOpen;e=this._state,t?(e.isBeingOpened&&e.cancelOpen(new H.DatabaseClosed),this._close(),e.autoOpen=!1,e.dbOpenError=new H.DatabaseClosed):(this._close(),e.autoOpen=this._options.autoOpen||e.isBeingOpened,e.openComplete=!1,e.dbOpenError=null)},nr.prototype.delete=function(e){var t=this;void 0===e&&(e={disableAutoOpen:!0});var n=0<arguments.length&&"object"!=typeof arguments[0],r=this._state;return new qe((function(i,o){function s(){t.close(e);var n=t._deps.indexedDB.deleteDatabase(t.name);n.onsuccess=Ce((function(){var e,n,r;e=t._deps,n=t.name,r=e.indexedDB,e=e.IDBKeyRange,yn(r)||n===nt||mn(r,e).delete(n).catch(Q),i()})),n.onerror=Bt(o),n.onblocked=t._fireOnBlocked}if(n)throw new H.InvalidArgument("Invalid closeOptions argument to db.delete()");r.isBeingOpened?r.dbReadyPromise.then(s):s()}))},nr.prototype.backendDB=function(){return this.idbdb},nr.prototype.isOpen=function(){return null!==this.idbdb},nr.prototype.hasBeenClosed=function(){var e=this._state.dbOpenError;return e&&"DatabaseClosed"===e.name},nr.prototype.hasFailed=function(){return null!==this._state.dbOpenError},nr.prototype.dynamicallyOpened=function(){return this._state.autoSchema},Object.defineProperty(nr.prototype,"tables",{get:function(){var e=this;return o(this._allTables).map((function(t){return e._allTables[t]}))},enumerable:!1,configurable:!0}),nr.prototype.transaction=function(){var e=function(e,t,n){var r=arguments.length;if(r<2)throw new H.InvalidArgument("Too few arguments");for(var i=new Array(r-1);--r;)i[r-1]=arguments[r];return n=i.pop(),[e,k(i),n]}.apply(this,arguments);return this._transaction.apply(this,e)},nr.prototype._transaction=function(e,t,n){var r=this,i=ve.trans;i&&i.db===this&&-1===e.indexOf("!")||(i=null);var o,s,u=-1!==e.indexOf("?");e=e.replace("!","").replace("?","");try{if(s=t.map((function(e){if("string"!=typeof(e=e instanceof r.Table?e.name:e))throw new TypeError("Invalid table argument to Dexie.transaction(). Only Table or String are allowed");return e})),"r"==e||e===rt)o=rt;else{if("rw"!=e&&e!=it)throw new H.InvalidArgument("Invalid transaction mode: "+e);o=it}if(i){if(i.mode===rt&&o===it){if(!u)throw new H.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");i=null}i&&s.forEach((function(e){if(i&&-1===i.storeNames.indexOf(e)){if(!u)throw new H.SubTransaction("Table "+e+" not included in parent transaction.");i=null}})),u&&i&&!i.active&&(i=null)}}catch(n){return i?i._promise(null,(function(e,t){t(n)})):Xe(n)}var a=function e(t,n,r,i,o){return qe.resolve().then((function(){var s=ve.transless||ve,u=t._createTransaction(n,r,t._dbSchema,i);if(u.explicit=!0,s={trans:u,transless:s},i)u.idbtrans=i.idbtrans;else try{u.create(),u.idbtrans._explicit=!0,t._state.PR1398_maxLoop=3}catch(s){return s.name===W.InvalidState&&t.isOpen()&&0<--t._state.PR1398_maxLoop?(console.warn("Dexie: Need to reopen db"),t.close({disableAutoOpen:!1}),t.open().then((function(){return e(t,n,r,null,o)}))):Xe(s)}var a,c=B(o);return c&&Fe(),s=qe.follow((function(){var e;(a=o.call(u,u))&&(c?(e=Ge.bind(null,null),a.then(e,e)):"function"==typeof a.next&&"function"==typeof a.throw&&(a=Rn(a)))}),s),(a&&"function"==typeof a.then?qe.resolve(a).then((function(e){return u.active?e:Xe(new H.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"))})):s.then((function(){return a}))).then((function(e){return i&&u._resolve(),u._completion.then((function(){return e}))})).catch((function(e){return u._reject(e),Xe(e)}))}))}.bind(null,this,o,s,i,n);return i?i._promise(o,a,"lock"):ve.trans?$e(ve.transless,(function(){return r._whenReady(a)})):this._whenReady(a)},nr.prototype.table=function(e){if(!l(this._allTables,e))throw new H.InvalidTable("Table ".concat(e," does not exist"));return this._allTables[e]},nr);function nr(e,n){var r=this;this._middlewares={},this.verno=0;var i=nr.dependencies;this._options=n=t({addons:nr.addons,autoOpen:!0,indexedDB:i.indexedDB,IDBKeyRange:i.IDBKeyRange,cache:"cloned"},n),this._deps={indexedDB:n.indexedDB,IDBKeyRange:n.IDBKeyRange},i=n.addons,this._dbSchema={},this._versions=[],this._storeNames=[],this._allTables={},this.idbdb=null,this._novip=this;var o,s,u,a,c,l={dbOpenError:null,isBeingOpened:!1,onReadyBeingFired:null,openComplete:!1,dbReadyResolve:Q,dbReadyPromise:null,cancelOpen:Q,openCanceller:null,autoSchema:!0,PR1398_maxLoop:3,autoOpen:n.autoOpen};l.dbReadyPromise=new qe((function(e){l.dbReadyResolve=e})),l.openCanceller=new qe((function(e,t){l.cancelOpen=t})),this._state=l,this.name=e,this.on=dt(this,"populate","blocked","versionchange","close",{ready:[re,Q]}),this.on.ready.subscribe=v(this.on.ready.subscribe,(function(e){return function(t,n){nr.vip((function(){var i,o=r._state;o.openComplete?(o.dbOpenError||qe.resolve().then(t),n&&e(t)):o.onReadyBeingFired?(o.onReadyBeingFired.push(t),n&&e(t)):(e(t),i=r,n||e((function e(){i.on.ready.unsubscribe(t),i.on.ready.unsubscribe(e)})))}))}})),this.Collection=(o=this,gt(kt.prototype,(function(e,t){this.db=o;var n=st,r=null;if(t)try{n=t()}catch(e){r=e}var i=e._ctx;e=(t=i.table).hook.reading.fire,this._ctx={table:t,index:i.index,isPrimKey:!i.index||t.schema.primKey.keyPath&&i.index===t.schema.primKey.name,range:n,keysOnly:!1,dir:"next",unique:"",algorithm:null,filter:null,replayFilter:null,justLimit:!0,isMatch:null,offset:0,limit:1/0,error:r,or:i.or,valueMapper:e!==J?e:null}}))),this.Table=(s=this,gt(pt.prototype,(function(e,t,n){this.db=s,this._tx=n,this.name=e,this.schema=t,this.hook=s._allTables[e]?s._allTables[e].hook:dt(null,{creating:[Z,Q],reading:[X,J],updating:[te,Q],deleting:[ee,Q]})}))),this.Transaction=(u=this,gt(Ft.prototype,(function(e,t,n,r,i){var o=this;this.db=u,this.mode=e,this.storeNames=t,this.schema=n,this.chromeTransactionDurability=r,this.idbtrans=null,this.on=dt(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 qe((function(e,t){o._resolve=e,o._reject=t})),this._completion.then((function(){o.active=!1,o.on.complete.fire()}),(function(e){var t=o.active;return o.active=!1,o.on.error.fire(e),o.parent?o.parent._reject(e):t&&o.idbtrans&&o.idbtrans.abort(),Xe(e)}))}))),this.Version=(a=this,gt(dn.prototype,(function(e){this.db=a,this._cfg={version:e,storesSource:null,dbschema:{},tables:{},contentUpgrade:null}}))),this.WhereClause=(c=this,gt(It.prototype,(function(e,t,n){if(this.db=c,this._ctx={table:e,index:":id"===t?null:t,or:n},this._cmp=this._ascending=ct,this._descending=function(e,t){return ct(t,e)},this._max=function(e,t){return 0<ct(e,t)?e:t},this._min=function(e,t){return ct(e,t)<0?e:t},this._IDBKeyRange=c._deps.IDBKeyRange,!this._IDBKeyRange)throw new H.MissingAPI}))),this.on("versionchange",(function(e){0<e.newVersion?console.warn("Another connection wants to upgrade database '".concat(r.name,"'. Closing db now to resume the upgrade.")):console.warn("Another connection wants to delete database '".concat(r.name,"'. Closing db now to resume the delete request.")),r.close({disableAutoOpen:!1})})),this.on("blocked",(function(e){!e.newVersion||e.newVersion<e.oldVersion?console.warn("Dexie.delete('".concat(r.name,"') was blocked")):console.warn("Upgrade '".concat(r.name,"' blocked by other connection holding version ").concat(e.oldVersion/10))})),this._maxKey=Vt(n.IDBKeyRange),this._createTransaction=function(e,t,n,i){return new r.Transaction(e,t,n,r._options.chromeTransactionDurability,i)},this._fireOnBlocked=function(e){r.on("blocked").fire(e),tt.filter((function(e){return e.name===r.name&&e!==r&&!e._state.vcFired})).map((function(t){return t.on("versionchange").fire(e)}))},this.use(Gn),this.use(Zn),this.use(Hn),this.use(Kn),this.use(Mn);var f=new Proxy(this,{get:function(e,t,n){if("_vip"===t)return!0;if("table"===t)return function(e){return er(r.table(e),f)};var i=Reflect.get(e,t,n);return i instanceof pt?er(i,f):"tables"===t?i.map((function(e){return er(e,f)})):"_createTransaction"===t?function(){return er(i.apply(this,arguments),f)}:i}});this.vip=f,i.forEach((function(e){return e(r)}))}K="undefined"!=typeof Symbol&&"observable"in Symbol?Symbol.observable:"@@observable";var rr,ir=(or.prototype.subscribe=function(e,t,n){return this._subscribe(e&&"function"!=typeof e?e:{next:e,error:t,complete:n})},or.prototype[K]=function(){return this},or);function or(e){this._subscribe=e}try{rr={indexedDB:i.indexedDB||i.mozIndexedDB||i.webkitIndexedDB||i.msIndexedDB,IDBKeyRange:i.IDBKeyRange||i.webkitIDBKeyRange}}catch(U){rr={indexedDB:null,IDBKeyRange:null}}function sr(e){var t,n=!1,r=new ir((function(r){var i,o=B(e),s=!1,u={},a={},c={get closed(){return s},unsubscribe:function(){s||(s=!0,i&&i.abort(),f&&Mt.storagemutated.unsubscribe(h))}};r.start&&r.start(c);var f=!1,p=function(){return Je(d)},h=function(e){xn(u,e),jn(a,u)&&p()},d=function(){var c,d,g;!s&&rr.indexedDB&&(u={},c={},i&&i.abort(),i=new AbortController,g=function(t){var n=Se();try{o&&Fe();var r=Me(e,t);return r=o?r.finally(Ge):r}finally{n&&Ee()}}(d={subscr:c,signal:i.signal,requery:p,querier:e,trans:null}),Promise.resolve(g).then((function(e){n=!0,t=e,s||d.signal.aborted||(u={},function(e){for(var t in e)if(l(e,t))return;return 1}(a=c)||f||(Mt(Nt,h),f=!0),Je((function(){return!s&&r.next&&r.next(e)})))}),(function(e){n=!1,["DatabaseClosedError","AbortError"].includes(null==e?void 0:e.name)||s||Je((function(){s||r.error&&r.error(e)}))})))};return setTimeout(p,0),c}));return r.hasValue=function(){return n},r.getValue=function(){return t},r}var ur=tr;function ar(e){var t=lr;try{lr=!0,Mt.storagemutated.fire(e),Dn(e,!0)}finally{lr=t}}f(ur,t(t({},$),{delete:function(e){return new ur(e,{addons:[]}).delete()},exists:function(e){return new ur(e,{addons:[]}).open().then((function(e){return e.close(),!0})).catch("NoSuchDatabaseError",(function(){return!1}))},getDatabaseNames:function(e){try{return n=(t=ur.dependencies).indexedDB,t=t.IDBKeyRange,(yn(n)?Promise.resolve(n.databases()).then((function(e){return e.map((function(e){return e.name})).filter((function(e){return e!==nt}))})):mn(n,t).toCollection().primaryKeys()).then(e)}catch(e){return Xe(new H.MissingAPI)}var t,n},defineClass:function(){return function(e){u(this,e)}},ignoreTransaction:function(e){return ve.trans?$e(ve.transless,e):e()},vip:vn,async:function(e){return function(){try{var t=Rn(e.apply(this,arguments));return t&&"function"==typeof t.then?t:qe.resolve(t)}catch(t){return Xe(t)}}},spawn:function(e,t,n){try{var r=Rn(e.apply(n,t||[]));return r&&"function"==typeof r.then?r:qe.resolve(r)}catch(e){return Xe(e)}},currentTransaction:{get:function(){return ve.trans||null}},waitFor:function(e,t){return t=qe.resolve("function"==typeof e?ur.ignoreTransaction(e):e).timeout(t||6e4),ve.trans?ve.trans.waitFor(t):t},Promise:qe,debug:{get:function(){return ie},set:function(e){oe(e)}},derive:d,extend:u,props:f,override:v,Events:dt,on:Mt,liveQuery:sr,extendObservabilitySet:xn,getByKeyPath:T,setByKeyPath:q,delByKeyPath:function(e,t){"string"==typeof t?q(e,t,void 0):"length"in t&&[].map.call(t,(function(t){q(e,t,void 0)}))},shallowClone:A,deepClone:P,getObjectDiff:Nn,cmp:ct,asap:w,minKey:-1/0,addons:[],connections:tt,errnames:W,dependencies:rr,cache:Pn,semVer:"4.0.8",version:"4.0.8".split(".").map((function(e){return parseInt(e)})).reduce((function(e,t,n){return e+t/Math.pow(10,2*n)}))})),ur.maxKey=Vt(ur.dependencies.IDBKeyRange),"undefined"!=typeof dispatchEvent&&"undefined"!=typeof addEventListener&&(Mt(Nt,(function(e){lr||(e=new CustomEvent(Lt,{detail:e}),lr=!0,dispatchEvent(e),lr=!1)})),addEventListener(Lt,(function(e){e=e.detail,lr||ar(e)})));var cr,lr=!1,fr=function(){};return"undefined"!=typeof BroadcastChannel&&((fr=function(){(cr=new BroadcastChannel(Lt)).onmessage=function(e){return e.data&&ar(e.data)}})(),"function"==typeof cr.unref&&cr.unref(),Mt(Nt,(function(e){lr||cr.postMessage(e)}))),"undefined"!=typeof addEventListener&&(addEventListener("pagehide",(function(e){if(!tr.disableBfCache&&e.persisted){ie&&console.debug("Dexie: handling persisted pagehide"),null!=cr&&cr.close();for(var t=0,n=tt;t<n.length;t++)n[t].close({disableAutoOpen:!1})}})),addEventListener("pageshow",(function(e){!tr.disableBfCache&&e.persisted&&(ie&&console.debug("Dexie: handling persisted pageshow"),fr(),ar({all:new wn(-1/0,[[]])}))}))),qe.rejectionMapper=function(e,t){return!e||e instanceof L||e instanceof TypeError||e instanceof SyntaxError||!e.name||!V[e.name]?e:(t=new V[e.name](t||e.message,e),"stack"in e&&h(t,"stack",{get:function(){return this.inner.stack}}),t)},oe(ie),t(tr,Object.freeze({__proto__:null,Dexie:tr,liveQuery:sr,Entity:at,cmp:ct,PropModSymbol:U,PropModification:At,replacePrefix:function(e,t){return new At({replacePrefix:[e,t]})},add:function(e){return new At({add:e})},remove:function(e){return new At({remove:e})},default:tr,RangeSet:wn,mergeRanges:qn,rangesOverlap:An}),{default:tr}),tr}()}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={exports:{}};return e[r].call(o.exports,o,o.exports,n),o.exports}n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};return(()=>{"use strict";function e(t){return e="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},e(t)}function t(){t=function(){return r};var n,r={},i=Object.prototype,o=i.hasOwnProperty,s=Object.defineProperty||function(e,t,n){e[t]=n.value},u="function"==typeof Symbol?Symbol:{},a=u.iterator||"@@iterator",c=u.asyncIterator||"@@asyncIterator",l=u.toStringTag||"@@toStringTag";function f(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(n){f=function(e,t,n){return e[t]=n}}function p(e,t,n,r){var i=t&&t.prototype instanceof b?t:b,o=Object.create(i.prototype),u=new O(r||[]);return s(o,"_invoke",{value:j(e,n,u)}),o}function h(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}r.wrap=p;var d="suspendedStart",g="suspendedYield",m="executing",y="completed",v={};function b(){}function w(){}function T(){}var q={};f(q,a,(function(){return this}));var A=Object.getPrototypeOf,_=A&&A(A(D([])));_&&_!==i&&o.call(_,a)&&(q=_);var k=T.prototype=b.prototype=Object.create(q);function U(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function x(t,n){function r(i,s,u,a){var c=h(t[i],t,s);if("throw"!==c.type){var l=c.arg,f=l.value;return f&&"object"==e(f)&&o.call(f,"__await")?n.resolve(f.__await).then((function(e){r("next",e,u,a)}),(function(e){r("throw",e,u,a)})):n.resolve(f).then((function(e){l.value=e,u(l)}),(function(e){return r("throw",e,u,a)}))}a(c.arg)}var i;s(this,"_invoke",{value:function(e,t){function o(){return new n((function(n,i){r(e,t,n,i)}))}return i=i?i.then(o,o):o()}})}function j(e,t,r){var i=d;return function(o,s){if(i===m)throw Error("Generator is already running");if(i===y){if("throw"===o)throw s;return{value:n,done:!0}}for(r.method=o,r.arg=s;;){var u=r.delegate;if(u){var a=P(u,r);if(a){if(a===v)continue;return a}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(i===d)throw i=y,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);i=m;var c=h(e,t,r);if("normal"===c.type){if(i=r.done?y:g,c.arg===v)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(i=y,r.method="throw",r.arg=c.arg)}}}function P(e,t){var r=t.method,i=e.iterator[r];if(i===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=n,P(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),v;var o=h(i,e.iterator,t.arg);if("throw"===o.type)return t.method="throw",t.arg=o.arg,t.delegate=null,v;var s=o.arg;return s?s.done?(t[e.resultName]=s.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=n),t.delegate=null,v):s:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,v)}function S(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(S,this),this.reset(!0)}function D(t){if(t||""===t){var r=t[a];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var i=-1,s=function e(){for(;++i<t.length;)if(o.call(t,i))return e.value=t[i],e.done=!1,e;return e.value=n,e.done=!0,e};return s.next=s}}throw new TypeError(e(t)+" is not iterable")}return w.prototype=T,s(k,"constructor",{value:T,configurable:!0}),s(T,"constructor",{value:w,configurable:!0}),w.displayName=f(T,l,"GeneratorFunction"),r.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===w||"GeneratorFunction"===(t.displayName||t.name))},r.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,T):(e.__proto__=T,f(e,l,"GeneratorFunction")),e.prototype=Object.create(k),e},r.awrap=function(e){return{__await:e}},U(x.prototype),f(x.prototype,c,(function(){return this})),r.AsyncIterator=x,r.async=function(e,t,n,i,o){void 0===o&&(o=Promise);var s=new x(p(e,t,n,i),o);return r.isGeneratorFunction(t)?s:s.next().then((function(e){return e.done?e.value:s.next()}))},U(k),f(k,l,"Generator"),f(k,a,(function(){return this})),f(k,"toString",(function(){return"[object Generator]"})),r.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},r.values=D,O.prototype={constructor:O,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=n,this.done=!1,this.delegate=null,this.method="next",this.arg=n,this.tryEntries.forEach(E),!e)for(var t in this)"t"===t.charAt(0)&&o.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=n)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function r(r,i){return u.type="throw",u.arg=e,t.next=r,i&&(t.method="next",t.arg=n),!!i}for(var i=this.tryEntries.length-1;i>=0;--i){var s=this.tryEntries[i],u=s.completion;if("root"===s.tryLoc)return r("end");if(s.tryLoc<=this.prev){var a=o.call(s,"catchLoc"),c=o.call(s,"finallyLoc");if(a&&c){if(this.prev<s.catchLoc)return r(s.catchLoc,!0);if(this.prev<s.finallyLoc)return r(s.finallyLoc)}else if(a){if(this.prev<s.catchLoc)return r(s.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<s.finallyLoc)return r(s.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&o.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var i=r;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var s=i?i.completion:{};return s.type=e,s.arg=t,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(s)},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 n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),E(n),v}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;E(n)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:D(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=n),v}},r}function i(e,t,n,r,i,o,s){try{var u=e[o](s),a=u.value}catch(e){return void n(e)}u.done?t(a):Promise.resolve(a).then(r,i)}function o(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var s=e.apply(t,n);function u(e){i(s,r,o,u,a,"next",e)}function a(e){i(s,r,o,u,a,"throw",e)}u(void 0)}))}}function s(e,t,n,r){return $.ajax({url:e,type:t,data:n,contentType:r&&void 0!==r.contentType?r.contentType:"application/json; charset=utf-8",dataType:r&&void 0!==r.dataType?r.dataType:"json",processData:!(!r||void 0===r.processData)&&r.processData,cache:window&&window.BIMPLUS_SDK_ENABLE_CACHE||!1,async:!0,xhr:function(){var e=$.ajaxSettings.xhr();return r&&void 0!==r.xhrUploadProgress&&e.upload.addEventListener("progress",r.xhrUploadProgress,!1),e},beforeSend:function(t){if(window&&void 0!==window.BIMPLUS_SDK_PENDING_REQUESTS&&window.BIMPLUS_SDK_PENDING_REQUESTS++,null!=r&&r.token){var n=r.tokenType?r.tokenType:"BimPlus";t.setRequestHeader("Authorization",n+" "+r.token)}if(null!=r&&r.eTag&&(t.setRequestHeader("Cache-Control","no-cache"),window&&!window.BIMPLUS_SDK_DISABLE_ETAG&&t.setRequestHeader("If-None-Match",r.eTag)),null!=r&&r.headers)for(var i in r.headers)i&&t.setRequestHeader(i,r.headers[i]);!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 n={url:e,response:null!=t&&t.responseText&&(null==t?void 0:t.responseText.length)>0?JSON.parse(t.responseText):null};console.log(JSON.stringify(n))}}})}function u(e,t,n,r){var i=$.Deferred();console.debug("xmlHttpRequest config=",r);var o=new XMLHttpRequest;return o.open(t,e,!0),o.setRequestHeader("Authorization","BimPlus "+r.token),window&&void 0!==window.BIMPLUS_SDK_PENDING_REQUESTS&&window.BIMPLUS_SDK_PENDING_REQUESTS++,null!=r&&r.responseType&&(console.debug("responseType is set to",r.responseType),o.responseType=r.responseType),null!=r&&r.eTag&&(console.debug("setRequestHeader is set to eTag",r.eTag),o.setRequestHeader("Cache-Control","no-cache"),window&&!window.BIMPLUS_SDK_DISABLE_ETAG&&o.setRequestHeader("If-None-Match",r.eTag)),o.onload=function(){window&&void 0!==window.BIMPLUS_SDK_PENDING_REQUESTS&&window.BIMPLUS_SDK_PENDING_REQUESTS--,i.resolve(o.response,o.status,o)},o.onerror=function(){window&&void 0!==window.BIMPLUS_SDK_PENDING_REQUESTS&&window.BIMPLUS_SDK_PENDING_REQUESTS--,i.reject()},n&&o.setRequestHeader("Content-Type","application/json;charset=UTF-8"),o.send(n),i.promise()}function a(e){var t="?";for(var n in e)Object.hasOwn(e,n)&&(t+=n+"="+e[n]+"&");return t=t.slice(0,-1)}function c(e,n,r,i,s){s||(s={}),s.token||(s.token=n),s.queryParams||(s.queryParams={}),s.queryParams.chunkSize||(s.queryParams.chunkSize=r),s.queryParams.chunk=1;var u=$.Deferred(),a=[];return e.get(i,s).done(function(){var n=o(t().mark((function n(r,o,c){var l,f,p,h;return t().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:a.push(r),l=0,200===c.status?(f=c.getResponseHeader("X-Total-Count"))?l=parseInt(f,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=t().mark((function n(){var r;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:s.queryParams.chunk=h,r=$.Deferred(),e.get(i,s).done((function(e){r.resolve(e)})).fail((function(e,t){r.reject(e,t)})),a.push(r);case 4:case"end":return t.stop()}}),n)})),h=2;case 5:if(!(h<=l)){n.next=10;break}return n.delegateYield(p(),"t0",7);case 7:h++,n.next=5;break;case 10:u.resolve(a);case 11:case"end":return n.stop()}}),n)})));return function(e,t,r){return n.apply(this,arguments)}}()).fail((function(e,t){u.reject(e,t)})),u.promise()}function l(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.attachmentId,r=e.file,i=e.fileName,s=e.ajaxConfig,u=e.request,a=e.url,c=e.deferred;e.uploadData.start=e.uploadData.currentChunk*e.uploadData.chunkSize,e.uploadData.end=Math.min(e.uploadData.fileSize,e.uploadData.start+e.uploadData.chunkSize)-1;var f=r.slice(e.uploadData.start,e.uploadData.end+1);return s.headers={"Content-Range":"bytes "+e.uploadData.start+"-"+e.uploadData.end+"/"+e.uploadData.fileSize,"Content-Disposition":'inline; name="'+i+'"; filename="'+r.name+'"',"Chunk-FileId":n},u.put(a,f,s).done(function(){var f=o(t().mark((function o(f,p,h){return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e.uploadData.doCallback(f,p,h),e.uploadData.currentChunk++,!(e.uploadData.currentChunk<e.uploadData.totalChunks)){t.next=6;break}return t.abrupt("return",l({attachmentId:n,uploadData:e.uploadData,file:r,fileName:i,ajaxConfig:s,request:u,url:a,deferred:c}));case 6:c.resolve(f);case 7:case"end":return t.stop()}}),o)})));return function(e,t,n){return f.apply(this,arguments)}}()).fail((function(t,o,f){if(e.uploadData.doCallback({error:t}))return l({attachmentId:n,uploadData:e.uploadData,file:r,fileName:i,ajaxConfig:s,request:u,url:a,deferred:c});c.reject(t,o,f)}))}function f(e,n,r,i,s){var u,a,c=null==i?void 0:i.file,f=null==i?void 0:i.opts,p=null==f?void 0:f.chunkSize,h=2147482624;p>0&&p<h||(p=h);var d=c.size,g=Math.ceil(d/p),m=0*p,y={currentChunk:0,start:m,end:Math.min(d,m+p)-1,totalChunks:g,fileSize:d,chunkSize:p,doCallback:function(e,t,n){var r;return null==f||null===(r=f.callback)||void 0===r?void 0:r.call(f,e,t,n)}},v=c.slice(y.start,y.end+1),b=null!=c&&c.name?(null===(u=(a=c.name).substring)||void 0===u?void 0:u.call(a,0,c.name.lastIndexOf(".")))||c.name:"";!function(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e||(e={}),e.token||(e.token=r.token),e.contentType=!1,e.processData=!1,e.headers||(e.headers={}),e.headers["Content-Range"]="bytes "+r.uploadData.start+"-"+r.uploadData.end+"/"+r.uploadData.fileSize,e.headers["Content-Disposition"]='inline; name="'+r.fileName+'"; filename="'+r.file.name+'"',e.queryParams||(e.queryParams={});var i=null==r||null===(t=r.data)||void 0===t?void 0:t.documentFolderId;!e.queryParams.DocumentFolderId&&i&&(e.queryParams.DocumentFolderId=i);var o=null==r||null===(n=r.data)||void 0===n?void 0:n.uploadProgress;e.xhrUploadProgress||"function"!=typeof o||(e.xhrUploadProgress=function(e){e||(e={}),e.extraData={start:r.uploadData.start,end:r.uploadData.end,fileSize:r.uploadData.fileSize,chunk:r.uploadData.currentChunk+1,total:r.uploadData.totalChunks};for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return o.apply(void 0,[e].concat(n))})}(s,{token:n,data:i,fileName:b,file:c,uploadData:y});var w=$.Deferred(),T=function(){return e.put(r,v,s).done(function(){var n=o(t().mark((function n(i,o,u){var a;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(a="00000000-0000-0000-0000-000000000000"===i.id?i.fileName:i.id,y.doCallback(i,o,u),y.currentChunk++,!(y.currentChunk<y.totalChunks)){t.next=7;break}return t.abrupt("return",l({attachmentId:a,uploadData:y,file:c,fileName:b,ajaxConfig:s,request:e,url:r,deferred:w}));case 7:w.resolve(i,o,u);case 8:case"end":return t.stop()}}),n)})));return function(e,t,r){return n.apply(this,arguments)}}()).fail((function(e,t,n){if(y.doCallback({error:e}))return T();w.reject(e,t,n)}))};return T(),w.promise()}n.r(r),n.d(r,{Api:()=>We,IDBCache:()=>B,createDefaultConfig:()=>ze});var p=function(){var e=null,t=null;this.setAccessToken=function(t){e=t},this.setTokenType=function(e){t=e},this.get=function(n,r){var i;return r||(r={}),r.token||(r.token=e),r.tokenType&&r.tokenType===t||(r.tokenType=t),r.queryParams&&(n+=a(r.queryParams)),null!==(i=r)&&void 0!==i&&i.useXMLHttpRequest?u(n,"GET",null,r):s(n,"GET",null,r)},this.getChunked=function(t,n){return c(this,e,"medium",t,n)},this.put=function(n,r,i){return i||(i={}),i.token||(i.token=e),i.tokenType&&i.tokenType===t||(i.tokenType=t),i.queryParams&&(n+=a(i.queryParams)),s(n,"PUT",r,i)},this.putChunked=function(t,n,r){return f(this,e,t,n,r)},this.post=function(n,r,i){var o;return i||(i={}),i.token||(i.token=e),i.tokenType&&i.tokenType===t||(i.tokenType=t),i.queryParams&&(n+=a(i.queryParams)),null!==(o=i)&&void 0!==o&&o.useXMLHttpRequest?u(n,"POST",r,i):s(n,"POST",r,i)},this.del=function(n,r,i){return i||(i={}),r||(i.contentType=null),i.dataType=null,i.token||(i.token=e),i.tokenType&&i.tokenType===t||(i.tokenType=t),i.queryParams&&(n+=a(i.queryParams)),s(n,"DELETE",r||null,i)}},h=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,n){return e.request.put(e.getApiUrl()+"application/settings/"+t,n)},this.deleteSettings=function(t){return e.request.del(e.getApiUrl()+"application/settings/"+t)}},d=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,n){return e.request.put(e.getApiTeamUrl()+"annotations/"+t,n)}},g=function(e){this.get=function(t){return e.request.get(e.getApiTeamUrl()+"attachments/"+t)},this.download=function(t,n){return n?e.request.get(e.getApiTeamUrl()+"attachments/"+t+"/versions/"+n+"/download"):e.request.get(e.getApiTeamUrl()+"attachments/"+t+"/download")},this.put=function(t,n){return e.request.put(e.getApiTeamUrl()+"attachments/"+t,n)},this.post=function(t,n,r){return e.request.put(e.getApiTeamUrl()+"attachments/"+t,n,{contentType:!1,processData:!1,dataType:null,xhrUploadProgress:r})},this.updateChunked=function(t,n,r){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=e.getApiTeamUrl()+"attachments/"+t+"/chunked",s={file:n,uploadProgress:r,opts:i};return e.request.putChunked(o,s,{queryParams:{}})},this.delete=function(t,n){return n?e.request.del(e.getApiTeamUrl()+"attachments/"+t+"/versions/"+n):e.request.del(e.getApiTeamUrl()+"attachments/"+t)},this.deleteSelected=function(t){return e.request.del(e.getApiTeamUrl()+"objects/"+t+"/attachments")},this.postVersion=function(t,n,r){return e.request.post(e.getApiTeamUrl()+"attachments/"+t+"/versions",n,{contentType:!1,processData:!1,dataType:null,xhrUploadProgress:r})},this.createVersionChunked=function(t,n,r){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=e.getApiTeamUrl()+"attachments/"+t+"/versions/chunked",s={file:n,uploadProgress:r,opts:i};return e.request.putChunked(o,s,{queryParams:{}})},this.getAllVersions=function(t){return e.request.get(e.getApiTeamUrl()+"attachments/"+t+"/versions")},this.releaseVersion=function(t,n){return e.request.put(e.getApiTeamUrl()+"attachments/"+t+"/release",n)},this.getBluebeam=function(t,n){var r={};return r.externalClientId=t,e.request.get(e.getApiUrl()+"external/attachments/bluebeam",{queryParams:r,headers:{"source-Authorization":"Bearer ".concat(n)}})},this.postBluebeam=function(t,n){return e.request.post(e.getApiTeamUrl()+"external/attachments/upload",n,{headers:{"source-Authorization":"Bearer ".concat(t)}})}},m=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,n){return e.request.put(e.getApiTeamUrl()+"attributetemplates/"+t,n)},this.delete=function(t){return e.request.del(e.getApiTeamUrl()+"attributetemplates/"+t)}},y=function(e){this.post=function(t,n,r){return e.request.post(e.getApiUrl()+"authorize",JSON.stringify({user_id:t,password:n,application_id:r}))},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")}},v=n(744);const b=Symbol.for("Dexie"),w=globalThis[b]||(globalThis[b]=v);if(v.semVer!==w.semVer)throw new Error(`Two different versions of Dexie loaded in the same app: ${v.semVer} and ${w.semVer}`);const{liveQuery:T,mergeRanges:q,rangesOverlap:A,RangeSet:_,cmp:k,Entity:U,PropModSymbol:x,PropModification:j,replacePrefix:P,add:S,remove:E}=w,O=w;function D(e){return D="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},D(e)}function C(){C=function(){return t};var e,t={},n=Object.prototype,r=n.hasOwnProperty,i=Object.defineProperty||function(e,t,n){e[t]=n.value},o="function"==typeof Symbol?Symbol:{},s=o.iterator||"@@iterator",u=o.asyncIterator||"@@asyncIterator",a=o.toStringTag||"@@toStringTag";function c(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,n){return e[t]=n}}function l(e,t,n,r){var o=t&&t.prototype instanceof y?t:y,s=Object.create(o.prototype),u=new S(r||[]);return i(s,"_invoke",{value:U(e,n,u)}),s}function f(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=l;var p="suspendedStart",h="suspendedYield",d="executing",g="completed",m={};function y(){}function v(){}function b(){}var w={};c(w,s,(function(){return this}));var T=Object.getPrototypeOf,q=T&&T(T(E([])));q&&q!==n&&r.call(q,s)&&(w=q);var A=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 k(e,t){function n(i,o,s,u){var a=f(e[i],e,o);if("throw"!==a.type){var c=a.arg,l=c.value;return l&&"object"==D(l)&&r.call(l,"__await")?t.resolve(l.__await).then((function(e){n("next",e,s,u)}),(function(e){n("throw",e,s,u)})):t.resolve(l).then((function(e){c.value=e,s(c)}),(function(e){return n("throw",e,s,u)}))}u(a.arg)}var o;i(this,"_invoke",{value:function(e,r){function i(){return new t((function(t,i){n(e,r,t,i)}))}return o=o?o.then(i,i):i()}})}function U(t,n,r){var i=p;return function(o,s){if(i===d)throw Error("Generator is already running");if(i===g){if("throw"===o)throw s;return{value:e,done:!0}}for(r.method=o,r.arg=s;;){var u=r.delegate;if(u){var a=x(u,r);if(a){if(a===m)continue;return a}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(i===p)throw i=g,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);i=d;var c=f(t,n,r);if("normal"===c.type){if(i=r.done?g:h,c.arg===m)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(i=g,r.method="throw",r.arg=c.arg)}}}function x(t,n){var r=n.method,i=t.iterator[r];if(i===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,x(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),m;var o=f(i,t.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,m;var s=o.arg;return s?s.done?(n[t.resultName]=s.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,m):s:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,m)}function j(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 P(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function S(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(j,this),this.reset(!0)}function E(t){if(t||""===t){var n=t[s];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var i=-1,o=function n(){for(;++i<t.length;)if(r.call(t,i))return n.value=t[i],n.done=!1,n;return n.value=e,n.done=!0,n};return o.next=o}}throw new TypeError(D(t)+" is not iterable")}return v.prototype=b,i(A,"constructor",{value:b,configurable:!0}),i(b,"constructor",{value:v,configurable:!0}),v.displayName=c(b,a,"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,a,"GeneratorFunction")),e.prototype=Object.create(A),e},t.awrap=function(e){return{__await:e}},_(k.prototype),c(k.prototype,u,(function(){return this})),t.AsyncIterator=k,t.async=function(e,n,r,i,o){void 0===o&&(o=Promise);var s=new k(l(e,n,r,i),o);return t.isGeneratorFunction(n)?s:s.next().then((function(e){return e.done?e.value:s.next()}))},_(A),c(A,a,"Generator"),c(A,s,(function(){return this})),c(A,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},t.values=E,S.prototype={constructor:S,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(P),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=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 n=this;function i(r,i){return u.type="throw",u.arg=t,n.next=r,i&&(n.method="next",n.arg=e),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var s=this.tryEntries[o],u=s.completion;if("root"===s.tryLoc)return i("end");if(s.tryLoc<=this.prev){var a=r.call(s,"catchLoc"),c=r.call(s,"finallyLoc");if(a&&c){if(this.prev<s.catchLoc)return i(s.catchLoc,!0);if(this.prev<s.finallyLoc)return i(s.finallyLoc)}else if(a){if(this.prev<s.catchLoc)return i(s.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<s.finallyLoc)return i(s.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var s=o?o.completion:{};return s.type=e,s.arg=t,o?(this.method="next",this.next=o.finallyLoc,m):this.complete(s)},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 n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),P(n),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;P(n)}return i}}throw Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:E(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),m}},t}function I(e,t,n,r,i,o,s){try{var u=e[o](s),a=u.value}catch(e){return void n(e)}u.done?t(a):Promise.resolve(a).then(r,i)}function R(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function s(e){I(o,r,i,s,u,"next",e)}function u(e){I(o,r,i,s,u,"throw",e)}s(void 0)}))}}var B=function(){var e=new O("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 n=e.indexOf("rv:");return parseInt(e.substring(n+3,e.indexOf(".",n)),10)}var r=e.indexOf("Edge/");return r>0&&parseInt(e.substring(r+5,e.indexOf(".",r)),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,n=window.IDBCursor||window.webkitIDBCursor,r=this._detectIE(),i=this._detectSafari(),o=!1!==r&&r<11,s=!1!==i&&i<10,u=!!navigator.userAgent.match(/iPad|iPhone|iPod/i);return navigator.userAgent.match(/PhantomJS/i)?e&&t&&n:e&&t&&n&&!o&&!u&&!s},this.addResponse=function(t,n,r,i){return e.responseTable.put({etag:r,data:n,timestamp:$.now(),chunks:i?parseInt(i,10):null},t)},this.getResponse=function(t){return e.responseTable.get(t)},this.addBatchResponse=function(t,n,r,i){return e.batchedResponseTable.put({id:t+n,batch:n,data:r,timestamp:$.now(),chunks:i?parseInt(i,10):null})},this.getBatchResponse=function(t,n){return e.batchedResponseTable.get(t+n)},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=R(C().mark((function e(t){var n,r;return C().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=function(e,t){var n,r;return"timestamp"===e?null!==(n=window)&&void 0!==n&&n.BIMPLUS_SDK_ENABLE_IDBCACHE_TIMESTAMP_DUMP?t:"NOT SHOWN":"data"===e?null!==(r=window)&&void 0!==r&&r.BIMPLUS_SDK_ENABLE_IDBCACHE_DATA_DUMP?t:"NOT SHOWN":t},r="",e.next=4,t.each((function(e){r+=" ".concat(JSON.stringify(e,n),"\n")}));case 4:return e.abrupt("return",r);case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),this.dumpTable=function(){var e=R(C().mark((function e(t){var n,r,i,o;return C().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.toCollection().count();case 2:return n=e.sent,r=[t.schema.primKey].concat(t.schema.indexes),i=r.map((function(e){return e.src})).join(","),o="Table: ".concat(t.name,", Schema: '").concat(i,"', Count of entries: ").concat(n,"\n"),e.t0=o,e.next=9,this.dumpTableContent(t);case 9:return o=e.t0+=e.sent,e.abrupt("return",o);case 11:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),this.dumpDatabase=R(C().mark((function t(){var n;return C().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n="",n+="BimWebSdk: Dexie Databases Dump\n",n+="===============================\n",n+="Database: ".concat(e.name," (Version: ").concat(e.verno,")\n"),t.t0=n,t.next=7,this.dumpTable(e.responseTable);case 7:return n=t.t0+=t.sent,t.t1=n,t.next=11,this.dumpTable(e.batchedResponseTable);case 11:return n=t.t1+=t.sent,t.abrupt("return",n);case 13:case"end":return t.stop()}}),t,this)})))},K=function(){var e=null,t=null,n=new B;n.initDB().then((function(){window.BIMPLUS_SDK_ENABLE_IDBCACHE_DUMP&&n.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 n};var r=function(e,t,r){var i=r.getResponseHeader("ETag"),o=r.getResponseHeader("X-Total-Count"),s="arraybuffer"===r.responseType;if(i){var u=!1===s?JSON.stringify(t):null;n.addResponse(e,s?t:JSON.parse(u),i,o).then((function(){})).catch((function(t){console.error("BimWebSdk failed to add response to cache: "+e+" Reason: "+t.message)}))}},i=function(e){return"W"===e.charAt(0)?e.substring(2):e};this.getBatchResponse=function(e,t,r){var i=$.Deferred(),o=r.useXMLHttpRequest?u:s;return n.getBatchResponse(e,t).then((function(s){if(s){var u={};null!==s.chunks&&(u["Cached-X-Total-Count"]=s.chunks),u.status=304,i.resolve(s.data,304,u)}else o(e,"GET",null,r).done((function(r,o,s){var u=s.getResponseHeader("X-Total-Count"),a="arraybuffer"===s.responseType,c=!1===a?JSON.stringify(r):null;n.addBatchResponse(e,t,a?r:JSON.parse(c),u).then((function(){})).catch((function(t){console.error("BimWebSdk failed to add response to cache: "+e+" Reason: "+t.message)})),i.resolve(r,o,s)})).fail((function(e,t){i.reject(e,t)}))})),i.promise()},this.get=function(o,c){if(c||(c={}),c.token||(c.token=e),c.tokenType&&c.tokenType===t||(c.tokenType=t),c.queryParams&&(o+=a(c.queryParams)),c.responseBatch)return this.getBatchResponse(o,c.responseBatch,c);var l=$.Deferred(),f=c.useXMLHttpRequest?u:s;return n.getResponse("GET;"+o).then((function(e){if(e){var t=i(e.etag);c.eTag=t,f(o,"GET",null,c).done((function(t,n,i){304===i.status?(null!==e.chunks&&(i["Cached-X-Total-Count"]=e.chunks),l.resolve(e.data,n,i)):(r("GET;"+o,t,i),l.resolve(t,n,i))})).fail((function(e,t){l.reject(e,t)}))}else f(o,"GET",null,c).done((function(e,t,n){r("GET;"+o,e,n),l.resolve(e,t,n)})).fail((function(e,t){l.reject(e,t)}))})).catch((function(){f(o,"GET",null,c).done((function(e,t,n){r("GET;"+o,e,n),l.resolve(e,t,n)})).fail((function(e,t){l.reject(e,t)}))})),l.promise()},this.getChunked=function(t,n){return c(this,e,"medium",t,n)},this.put=function(n,r,i){return i||(i={}),i.token||(i.token=e),i.tokenType&&i.tokenType===t||(i.tokenType=t),i.queryParams&&(n+=a(i.queryParams)),s(n,"PUT",r,i)},this.putChunked=function(t,n,r){return f(this,e,t,n,r)},this.post=function(n,r,i){return i||(i={}),i.token||(i.token=e),i.tokenType&&i.tokenType===t||(i.tokenType=t),i.queryParams&&(n+=a(i.queryParams)),(i.useXMLHttpRequest?u:s)(n,"POST",r,i)},this.del=function(n,r,i){return i||(i={}),r||(i.contentType=null),i.dataType=null,i.token||(i.token=e),i.tokenType&&i.tokenType===t||(i.tokenType=t),i.queryParams&&(n+=a(i.queryParams)),s(n,"DELETE",r||null,i)},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 n.getResponse("HEAD;"+o).then((function(e){if(e){var t=i(e.etag);u.eTag=t,s(o,"HEAD",null,u).done((function(e,t,n){304===n.status?c.resolve(!0,t,n):(r("HEAD;"+o,null,n),c.resolve(!1,t,n))})).fail((function(e,t){c.reject(e,t)}))}else s(o,"HEAD",null,u).done((function(e,t,n){r("HEAD;"+o,null,n),c.resolve(!1,t,n)})).fail((function(e,t){c.reject(!1,t)}))})).catch((function(){s(o,"HEAD",null,u).done((function(e,t,n){r("HEAD;"+o,null,n),c.resolve(!1,t,n)})).fail((function(e,t){c.reject(!1,t)}))})),c.promise()}},N=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,n){var r={queryParams:{customFilter:n}};return t?e.request.get(e.getApiTeamUrl()+"clashdetection/filters/"+t,n?r:null):e.request.get(e.getApiTeamUrl()+"clashdetection/filters",n?r:null)},this.calculateClashes=function(t,n,r){if(n||r){var i={queryParams:{}};return n&&(i.queryParams.topology=n),r&&(i.queryParams.clashElements=r),e.request.post(e.getApiTeamUrl()+"clashdetection/filters",t,i)}return e.request.post(e.getApiTeamUrl()+"clashdetection/filters",t)},this.getFilterResults=function(t,n,r,i){if(r||i){var o={queryParams:{}};return r&&(o.queryParams.topology=r),i&&(o.queryParams.clashElements=i),n?e.request.get(e.getApiTeamUrl()+"clashdetection/projects/"+t+"/filters/"+n,o):e.request.get(e.getApiTeamUrl()+"clashdetection/projects/"+t+"/filters",o)}return n?e.request.get(e.getApiTeamUrl()+"clashdetection/projects/"+t+"/filters/"+n):e.request.get(e.getApiTeamUrl()+"clashdetection/projects/"+t+"/filters")},this.createClashRule=function(t,n){return e.request.post(e.getApiTeamUrl()+"projects/"+t+"/clashfilters",JSON.stringify(n))},this.deleteClashRule=function(t,n){var r={queryParams:{force:n}};return e.request.del(e.getApiTeamUrl()+"clashfilters/"+t,null,n?r:null)},this.updateClashRule=function(t,n){return e.request.put(e.getApiTeamUrl()+"clashfilters/"+t,JSON.stringify(n))},this.getAllClashRules=function(t,n){var r={queryParams:{customFilter:n}};return e.request.get(e.getApiTeamUrl()+"projects/"+t+"/clashfilters",n?r:null)}},L=function(e){this.post=function(t){var n=[{message:t}];return e.request.post(e.getApiTeamUrl()+"clientlogs",JSON.stringify(n))},this.postExtended=function(t,n,r,i){var o=[{message:t,applicationclass:n,releaseversion:r,projectid:i}];return e.request.post(e.getApiTeamUrl()+"clientlogs",JSON.stringify(o))},this.postArray=function(t){return e.request.post(e.getApiTeamUrl()+"clientlogs",JSON.stringify(t))},this.get=function(){return e.request.get(e.getApiTeamUrl()+"clientlogs")}},M=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,n){return e.request.put(e.getApiTeamUrl()+"comments/"+t,n)}},F=function(e){this.post=function(t){return t.runAsync=!1,e.request.post(e.getApiTeamUrl()+"services/Connexis",JSON.stringify(t))}},G=function(e){this.get=function(t,n,r){var i="".concat(e.getApiTeamUrl(),"objects/").concat(t,"/customtables");n&&(i+="?variantId=".concat(n));var o={};return r&&(o.queryParams={revision:r}),e.request.get(i,r?o:void 0)},this.post=function(t,n){return e.request.post("".concat(e.getApiTeamUrl(),"objects/").concat(t,"/customtables"),n)},this.exportTable=function(t,n){return e.request.post("".concat(e.getApiTeamUrl(),"customtables/").concat(t,"/export/excel"),n)},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))}},W=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,n){return e.request.put(e.getApiTeamUrl()+"dimensionlines/"+t,n)}},z=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,n){return t?e.request.get(e.getApiTeamUrl()+"element-types/"+t+"/attributetemplates",n?{queryParams:n}:void 0):e.request.get(e.getApiTeamUrl()+"element-types/attributetemplates",n?{queryParams:n}: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")}},H=function(e){this.exportObjects=function(t,n){return e.request.get(e.getApiTeamUrl()+"projects/"+t+"/objects/export/excel?typeId="+n)},this.exportModel=function(t,n,r,i,o,s,u){var a={};return r&&(a.revision=r),i&&(a.emptyPropExport=1),o&&(a.propSetExport=1),s&&(a.temporary="true"),u&&(a.exportType=u),e.request.post("".concat(e.getApiTeamUrl(),"projects/").concat(t,"/model/").concat(n,"/exportasync"),null,{queryParams:a,contentType:!1,processData:!1,dataType:null})},this.exportSelection=function(t,n,r,i,o){var s={};return n&&(s.emptyPropExport=n),r&&(s.propSetExport=r),i&&(s.temporary="true"),o&&(s.exportType=o),e.request.post("".concat(e.getApiTeamUrl(),"selections/").concat(t,"/exportasync"),null,{queryParams:s})},this.createExportSelection=function(t,n){return e.request.post("".concat(e.getApiTeamUrl(),"projects/").concat(t,"/exportobjects"),n)}},V=function(e){this.getAccessRights=function(t){return e.request.get(e.getApiTeamUrl()+"folders/"+t+"/rights")},this.setMemberAccessRights=function(t,n,r){return e.request.put(e.getApiTeamUrl()+"folders/"+t+"/rights?assignrecursive="+(r?"true":"false"),n)},this.setMembersAccessRights=function(t,n,r){return e.request.put(e.getApiTeamUrl()+"folders/"+t+"/usersrights?assignrecursive="+(r?"true":"false"),n)}},Q=function(e){var t=function(t){return t?e.getApiUrl()+"content/freeattributegroups/":e.getApiTeamUrl()+"freeattributegroups/"};this.post=function(n,r){return e.request.post(t(r),n)},this.get=function(n,r){return n?e.request.get(t(r)+n):e.request.get(t(r))},this.put=function(n,r,i){return e.request.put(t(i)+n,r)},this.delete=function(n,r){return e.request.del(t(r)+n)},this.getFreeAttributes=function(n,r){return e.request.get(t(r)+n+"/freeattributes")}},J=function(e){var t=function(t){return t?e.getApiUrl()+"content/freeattributes/":e.getApiTeamUrl()+"freeattributes/"};this.post=function(n,r){return e.request.post(t(r),n)},this.get=function(n,r,i){return n?e.request.get(t(r)+n,i?{queryParams:i}:void 0):e.request.get(t(r),i?{queryParams:i}:void 0)},this.put=function(n,r,i){return e.request.put(t(i)+n,r)},this.delete=function(n,r){return e.request.del(t(r)+n)},this.getTopology=function(n){return e.request.get(t(n)+"?topology=true")},this.getFilteredAttributes=function(t,n,r){var i=e.getApiTeamUrl();return t&&(i+="projects/".concat(t,"/")),i+="attributes?",n&&(i+="layer=".concat(n,"&")),r&&(i+="type=".concat(r)),e.request.get(i)}},X=function(e){this.calculate=function(t,n,r,i,o){var s={hiddenCalculation:{projectId:t,calculationMode:"View",view:n,clippingPlanes:r,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:i},sectionSettings:{}},runAsync:o};return e.request.post(e.getApiTeamUrl()+"services/Hiddencalculation",JSON.stringify(s))}},Y=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,n){return e.request.put(e.getApiTeamUrl()+"hyperlinks/"+t,n)}},Z=function(e){this.postModel=function(t,n,r,i,o,s){return"replaceModelData"===o&&(s||(s={}),s.replaceModelData=!0),e.request.post(e.getApiTeamUrl()+"projects/"+t+"/model/"+n+"/importasync",r,{preparedData:r,contentType:!1,processData:!1,dataType:null,xhrUploadProgress:i,queryParams:s})}},ee=function(e){this.post=function(t,n){return e.request.post(e.getApiTeamUrl()+"projects/"+t+"/issues",n)},this.get=function(t){return e.request.get(e.getApiTeamUrl()+"issues/"+t)},this.postPin=function(t,n){return e.request.post(e.getApiTeamUrl()+"issues/"+t+"/pins",n)},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,n){return e.request.post(e.getApiTeamUrl()+"issues/"+t+"/comments",n)},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,n){return e.request.post(e.getApiTeamUrl()+"issues/"+t+"/attachments",n)},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,n,r){return e.request.put(e.getApiTeamUrl()+"issues/"+t,n,r?{queryParams:r}:void 0)},this.delete=function(t,n){var r={queryParams:{forceDelete:n}};return e.request.del(e.getApiTeamUrl()+"issues/"+t,null,n?r: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,n){return e.request.put(e.getApiTeamUrl()+"projects/"+t+"/issues/bcf",n,{contentType:!1,processData:!1})},this.updateImportBcf=function(t,n){return e.request.put(e.getApiTeamUrl()+"projects/"+t+"/issues/bcf",n)},this.exportBcf=function(t,n,r){return t?e.request.post(e.getApiTeamUrl()+"projects/"+t+"/issues/export/bcf"+(r?"?version="+r:""),n):e.request.post(e.getApiTeamUrl()+"issues/export/bcf"+(r?"?version="+r:""),n)},this.exportExcel=function(t,n){return t?e.request.post(e.getApiTeamUrl()+"projects/"+t+"/issues/export/excel",n):e.request.post(e.getApiTeamUrl()+"issues/export/excel",n)}},te=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,n){return e.request.put(e.getApiTeamUrl()+"labels/"+t,n)}},ne=function(e){this.lockObject=function(t,n){return e.request.put(e.getApiTeamUrl()+"objects/"+t+"/locks",n,{dataType:"text"})},this.checkLocked=function(t){return e.request.get(e.getApiTeamUrl()+"objects/"+t+"/locks")},this.deleteLock=function(t,n){return!0===n?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")}},re=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,n,r){return e.request.put(e.getApiTeamUrl()+"members/"+n,r)},this.deleteUser=function(t,n){return e.request.del(e.getApiTeamUrl()+"members/"+n)}},ie=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,n){return e.request.put(e.getApiUrl()+"messages/"+t+"/updatedashboardadditionaldata",n)},this.addDashboardMessageAttachment=function(t,n,r){return e.request.put(e.getApiUrl()+"messages/"+t+"/upload?type=dashboard",n,r)},this.getAllMessagingGroups=function(){return e.request.get(e.getApiUrl()+"systemgroups")},this.getMessagingGroupsDetails=function(t){return e.request.get(e.getApiUrl()+"systemgroups/"+t)}},oe=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,n,r){var i={private:!r};return e.request.put(e.getApiTeamUrl()+"divisions/"+t+"/disciplines/"+n,JSON.stringify(i))},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,n){return e.request.post(e.getApiTeamUrl()+"divisions/"+t+"/revisions",n)},this.put=function(t,n){return e.request.put(e.getApiTeamUrl()+"divisions/"+t,n)},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,n){return e.request.put(e.getApiTeamUrl()+"divisions/"+t+"/move",n)}},se=["topology","structure"],ue=function(e){this.get=function(t,n){var r={};return t&&(r.object_id=t),n&&(r.project_id=n),e.request.get(e.getApiTeamUrl()+"settings/filters",{queryParams:r})},this.getFilteredObjects=function(t,n,r,i){if(r)return e.request.get(e.getApiTeamUrl()+"projects/"+t+"/filters/"+n+"/properties",{queryParams:r});if(i&&se.find((function(e){return e===i}))){var o={};return o[i]=!0,e.request.get(e.getApiTeamUrl()+"projects/"+t+"/filters/"+n,{queryParams:o})}return e.request.get(e.getApiTeamUrl()+"projects/"+t+"/filters/"+n)},this.getSelectionFilteredObjects=function(t,n,r,i){if(r)return e.request.get(e.getApiTeamUrl()+"selections/"+t+"/filters/"+n+"/properties",{queryParams:r});if(i&&se.find((function(e){return e===i}))){var o={};return o[i]=!0,e.request.get(e.getApiTeamUrl()+"selections/"+t+"/filters/"+n,{queryParams:o})}return e.request.get(e.getApiTeamUrl()+"selections/"+t+"/filters/"+n)},this.applyFilter=function(t){return e.request.get(e.getApiTeamUrl()+"filters/"+t)},this.post=function(t,n){var r={};return n&&(r.project_id=n),e.request.post(e.getApiTeamUrl()+"settings/filter",t,{queryParams:r})},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)}},ae=function(e){this.post=function(t){return e.request.post(e.getApiTeamUrl()+"objects/",t)},this._buildQueryParams=function(e){var t={};return e.revision&&(t.revision=e.revision),e.projectId&&(t.projectId=e.projectId),e.shortInfo&&(t.shortinfo=e.shortInfo),e.type&&(t.type=e.type),{queryParams:t}},this.get=function(t,n,r,i,o,s){var u={revision:n,projectId:i,shortInfo:o,type:s},a=this._buildQueryParams(u),c=e.getApiTeamUrl()+"objects/"+t;return r&&(c+="/properties/",c+=r),e.request.get(c,n||i||o||s?a:void 0)},this.getInternal=function(t,n){var r={};n&&(r.queryParams={revision:n});var i=e.getApiTeamUrl()+"objects/"+t;return i+="/internal",e.request.get(i,n?r:void 0)},this.head=function(t,n){var r={};return n&&(r.queryParams={revision:n}),e.request.head?e.request.head(e.getApiTeamUrl()+"objects/"+t,n?r: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,n?r:void 0))},this.getTopology=function(t,n,r,i,o){var s={};return(n||r||i)&&(s.queryParams={},n&&(s.queryParams.revision=n),r&&(s.queryParams.hideElements=r),i&&(s.queryParams.shortinfo=i)),o&&(s.responseBatch=o),e.request.get(e.getApiTeamUrl()+"objects/"+t+"/topology",s)},this.getGeometryThreeJS=function(t){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{chunked:null,revision:null,lod:null,batch:null,chunkSize:null,properties:null},o={};return(i.revision||i.lod||i.chunkSize)&&(o.queryParams={},i.revision&&(o.queryParams.revision=i.revision),i.lod&&(o.queryParams.levelofdetail=i.lod),i.chunkSize&&(o.queryParams.chunkSize=i.chunkSize)),i.batch&&(o.responseBatch=i.batch),n=r?e.getApiTeamUrl()+"objects/"+t+"/disciplines/"+r+"/geometries/threejs":e.getApiTeamUrl()+"objects/"+t+"/geometries/threejs",i.properties&&(n+="/properties/",n+=i.properties),i.chunked?e.request.getChunked(n,o):e.request.get(n,o)},this._buildGetGeoAjaxOptions=function(e){var t={dataType:"binary",processData:!1,responseType:"arraybuffer",useXMLHttpRequest:!0,queryParams:{}};return e.revision&&(t.queryParams.revision=e.revision),e.lod&&(t.queryParams.levelofdetail=e.lod),e.vertexNormals&&(t.queryParams.vertexNormals=e.vertexNormals),e.smoothingAngle&&(t.queryParams.smoothingAngle=e.smoothingAngle),e.topology&&(t.queryParams.topology=e.topology),e.edges&&(t.queryParams.edges=e.edges),e.version&&(t.queryParams.version=e.version),e.batch&&(t.responseBatch=e.batch),t},this.getGeometryGLB=function(t){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{chunked:null,revision:null,lod:null,batch:null,vertexNormals:null,smoothingAngle:null,topology:null,edges:null,version:null},o=this._buildGetGeoAjaxOptions(i);return n=r?e.getApiTeamUrl()+"objects/"+t+"/disciplines/"+r+"/geometries/glb":e.getApiTeamUrl()+"objects/"+t+"/geometries/glb",i.chunked?e.request.getChunked(n,o):e.request.get(n,o)},this.getGLB=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return this.getGeometryGLB(e,null,{version:t})},this.getGeometryTemplatesThreeJS=function(t,n,r,i,o,s){var u={};null===i&&null===o||(u.queryParams={},null!==i&&(u.queryParams.revision=i),null!==o&&(u.queryParams.levelofdetail=o)),s&&(u.responseBatch=s);var a=e.getApiTeamUrl()+"objects/"+t+"/disciplines/"+n+"/templates/threejs";return r?e.request.getChunked(a,u):e.request.get(a,u)},this.getGeometryCompressed=function(t,n){return n?e.request.get(e.getApiTeamUrl()+"objects/"+t+"/disciplines/"+n+"/geometries/meshblob"):e.request.get(e.getApiTeamUrl()+"objects/"+t+"/geometries/meshblob")},this.getProperties=function(t,n){return e.request.get(e.getApiTeamUrl()+"objects/"+t+"/geometries/threejs/properties"+n)},this.put=function(t,n,r){var i={};return r&&(i.projectid=r),e.request.put(e.getApiTeamUrl()+"objects/"+t,n,{queryParams:i})},this.postComment=function(t,n){return e.request.post(e.getApiTeamUrl()+"objects/"+t+"/comments",n)},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,n,r,i){return e.request.post(e.getApiTeamUrl()+"objects/"+t+"/attachments",n,{contentType:!1,processData:!1,dataType:null,xhrUploadProgress:r,queryParams:i?{DocumentFolderId:i}:void 0})},this.createAttachmentChunked=function(t,n,r,i){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},s=e.getApiTeamUrl()+"objects/"+t+"/attachments/chunked",u={file:n,uploadProgress:r,documentFolderId:i,opts:o},a={queryParams:{}};return i&&(a.queryParams={DocumentFolderId:i}),e.request.putChunked(s,u,a)},this.getAttachments=function(t,n){return e.request.get(e.getApiTeamUrl()+"objects/"+t+"/attachments",n?{queryParams:{revision:n}}:void 0)},this.deleteAttachments=function(t){return e.request.del(e.getApiTeamUrl()+"objects/"+t+"/attachments")},this.postAttachmentLink=function(t,n){return e.request.post(e.getApiTeamUrl()+"objects/"+t+"/attachmentlinks",n)},this.getAttachmentLinks=function(t){return e.request.get(e.getApiTeamUrl()+"objects/"+t+"/attachmentlinks")},this.deleteAttachmentLink=function(t,n){return e.request.del(e.getApiTeamUrl()+"objects/"+t+"/attachmentlinks/"+n)},this.postHyperlink=function(t,n){return e.request.post(e.getApiTeamUrl()+"objects/"+t+"/hyperlinks",n)},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,n,r,i){var o=n?"&documentversion="+n:"",s=i?"&revision="+i:"",u=r?"&projectid="+r:"",a=e.getApiTeamUrl()+"objects/"+t+"?freeattributes=true";return e.request.get(a+o+s+u)},this.getAttributesAsFlatStructure=function(t,n,r,i){var o=n?"&documentversion="+n:"",s=i?"&revision="+i:"",u=r?"&projectid="+r:"",a=e.getApiTeamUrl()+"objects/"+t+"?freeattributes=true&internal=true&attributedefinition=true";return e.request.get(a+o+s+u)},this.getAttributeValues=function(t,n){return e.request.get(e.getApiTeamUrl()+"objects/"+t+"/attributes/"+n+"?children=true")},this.getComplexPropertiesTopology=function(t,n){return e.request.get(e.getApiTeamUrl()+"objects/"+t+"/complexproperties"+(n>=0?"?revision="+n:""))},this.postThumbnail=function(t,n,r){return e.request.post(e.getApiTeamUrl()+"objects/"+t+"/thumbnail",n,{contentType:!1,processData:!1,dataType:null,xhrUploadProgress:r})},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,n,r){return e.request.get(e.getApiTeamUrl()+"objects/"+t+"/reports?version="+n+"&action="+r)},this.exportExcelReports=function(t,n){return e.request.post(e.getApiTeamUrl()+"projects/"+t+"/reports/export/excel",n)},this.postDimensions=function(t,n){return e.request.post(e.getApiTeamUrl()+"objects/"+t+"/dimensionlines",n)},this.putDimensions=function(t,n){return e.request.put(e.getApiTeamUrl()+"objects/"+t+"/dimensionlines",n)},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,n){return e.request.post(e.getApiTeamUrl()+"objects/"+t+"/labels",n)},this.putLabels=function(t,n){return e.request.put(e.getApiTeamUrl()+"objects/"+t+"/labels",n)},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,n){return e.request.post(e.getApiTeamUrl()+"objects/"+t+"/annotations",n)},this.putAnnotations=function(t,n){return e.request.put(e.getApiTeamUrl()+"objects/"+t+"/annotations",n)},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,n,r,i){var o=Array.isArray(i)?i.join(","):void 0,s={queryParams:{}};return s.queryParams[n]=r,o&&(s.queryParams.divisions=o),e.request.get(e.getApiTeamUrl()+"objects/"+t+"/query",s)},this.getObjectIdsByIfcId=function(e,t,n){return this.getObjectIdsByQuery(e,"93027bad-df91-48ee-a0bb-60a8184cddba",t,n)},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 n=e.getApiTeamUrl()+"objects/"+t+"/thumbnail/download";return e.request.get(n,{useXMLHttpRequest:!0,dataType:"binary",processData:!1,responseType:"arraybuffer"})}},ce=function(e){this.get=function(t){return e.request.get(e.getApiTeamUrl()+"overlays/"+t)},this.put=function(t,n){return e.request.put(e.getApiTeamUrl()+"overlays/"+t,n)},this.delete=function(t){return e.request.del(e.getApiTeamUrl()+"overlays/"+t)}},le=function(e){this.get=function(t){return e.request.get(e.getApiTeamUrl()+"overlaysets/"+t)},this.put=function(t,n){return e.request.put(e.getApiTeamUrl()+"overlaysets/"+t,n)},this.delete=function(t){return e.request.del(e.getApiTeamUrl()+"overlaysets/"+t)},this.postOverlay=function(t,n){return e.request.post(e.getApiTeamUrl()+"overlaysets/"+t+"/overlays",n)},this.getOverlays=function(t){return e.request.get(e.getApiTeamUrl()+"overlaysets/"+t+"/overlays")}},fe=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,n){return e.request.put(e.getApiTeamUrl()+"pins/"+t,n)}},pe=function(e){this.get=function(){return e.request.get(e.getApiUrl()+"project-actions-rights/")}},he=function(e){var t="projectattributetemplates";this.post=function(n){return e.request.post(e.getApiTeamUrl()+t,n)},this.get=function(n,r){var i=r?{queryParams:{default:r}}:null;return n?e.request.get(e.getApiTeamUrl()+t+"/"+n):e.request.get(e.getApiTeamUrl()+t,i)},this.put=function(n,r){return e.request.put(e.getApiTeamUrl()+t+"/"+n,r)},this.delete=function(n){return e.request.del(e.getApiTeamUrl()+t+"/"+n)},this.copyFrom=function(n,r){return e.request.put(e.getApiTeamUrl()+t+"/"+r+"/copyfrom",JSON.stringify({id:n}))},this.setDefault=function(n){return e.request.put(e.getApiTeamUrl()+t+"/"+n+"/default")}};function de(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,s,u=[],a=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;a=!1}else for(;!(a=(r=o.call(n)).done)&&(u.push(r.value),u.length!==t);a=!0);}catch(e){c=!0,i=e}finally{try{if(!a&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(c)throw i}}return u}}(e,t)||function(e,t){if(e){if("string"==typeof e)return ge(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ge(e,t):void 0}}(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 ge(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var me=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,n){return e.request.put(e.getApiTeamUrl()+"projects/"+t,n)},this.get=function(t,n,r,i,o){var s={queryParams:o||{}};return n&&(s.queryParams.disciplines=!1),i&&(s.queryParams.recycleBin=!0),t?e.request.get(e.getApiTeamUrl()+"projects/"+t,s):r?e.request.get(e.getApiUrl()+r+"/projects",s):e.getTeamSlug()?e.request.get(e.getApiTeamUrl()+"projects",s):e.request.get(e.getApiUrl()+"/projects",s)},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,n,r){return n||(n="00000000-0000-0000-0000-000000000000"),(r<0||!r&&0!=r)&&(r="100"),e.request.del(e.getApiTeamUrl()+"temporary/projects/"+t+"/disciplines/"+n+"/levelofdetails/"+r)},this.getModels=function(t){return e.request.get(e.getApiTeamUrl()+"projects/"+t+"/divisions")},this.postModel=function(t,n){return e.request.post(e.getApiTeamUrl()+"projects/"+t+"/divisions",n)},this.getMembers=function(t){return e.request.get(e.getApiTeamUrl()+"projects/"+t+"/members")},this.postMember=function(t,n){return e.request.post(e.getApiTeamUrl()+"projects/"+t+"/members",n)},this.putMember=function(t,n){return e.request.put(e.getApiTeamUrl()+"projects/"+t+"/members",n)},this.deleteMember=function(t,n){return e.request.del(e.getApiTeamUrl()+"projects/"+t+"/members",n)},this.getPins=function(t){return e.request.get(e.getApiTeamUrl()+"projects/"+t+"/pins")},this.putProject=function(t,n){return e.request.put(e.getApiTeamUrl()+"projects/"+t,n)},this.postAttachment=function(t,n){return e.request.post(e.getApiTeamUrl()+"projects/"+t+"/attachments",n)},this.getAttachments=function(t,n,r){var i=r;return i||(i={}),n&&(i.revision=n),e.request.get(e.getApiTeamUrl()+"projects/"+t+"/attachments",n||r?{queryParams:i}: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,n,r){return e.request.post(e.getApiTeamUrl()+"projects/"+t+"/thumbnail",n,{contentType:!1,processData:!1,dataType:null,xhrUploadProgress:r})},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,n){return e.request.get(e.getApiTeamUrl()+"projects/"+t+"/issues"+(n?"?scene=false":""))},this.getIssuesShortInfo=function(t){var n=function(){var e=de((new Date).toString().split("GMT"),2),t=e[0],n=e[1];if(!t||!n)return"";var r=new Date(t+"UTC").toISOString().split(".")[0],i=(n=n.split(" ")[0]).slice(0,3)+":"+n.slice(3);return r&&i?r+i:""}();return e.request.get(e.getApiTeamUrl()+"projects/"+t+"/issues?shortinfo=true"+(n?"¤ttime="+n:""))},this.postSlideshow=function(t,n){return e.request.post(e.getApiTeamUrl()+"projects/"+t+"/slideshows",n)},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,n){var r={slideShowId:n};return e.request.post(e.getApiTeamUrl()+"projects/"+t+"/slideshow/export/pdf",JSON.stringify(r))},this.getProjectInfo=function(t,n){var r={queryParams:n||{}};return e.request.get(e.getApiTeamUrl()+"projects/"+t,r)},this.postOverlaySet=function(t,n){return e.request.post(e.getApiTeamUrl()+"projects/"+t+"/overlaysets",n)},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")}},ye=function(e){this.postRevision=function(t,n){return e.request.post(e.getApiTeamUrl()+"divisions/"+t+"/revisions",n)},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,n){return e.request.post(e.getApiTeamUrl()+"revisions/"+t,n)},this.putRevisionInfo=function(t,n){return e.request.put(e.getApiTeamUrl()+"revisions/"+t,n)},this.getRevisionsComparisonResult=function(t,n,r,i){return e.request.get(e.getApiTeamUrl()+"divisions/"+t+"/revisionscomparison/"+n+"/"+r,i)},this.compareRevisions=function(t,n,r,i){return e.request.post(e.getApiTeamUrl()+"divisions/"+t+"/revisionscomparison/"+n+"/"+r,null,i)},this.excelExportRevisionsComparisonResult=function(t,n,r,i){return e.request.post(e.getApiTeamUrl()+"divisions/"+t+"/revisionscomparison/"+n+"/"+r+"/export/excel",i)}},ve=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,n){return e.request.post(e.getApiTeamUrl()+"projects/"+t+"/members",n)},this.putUserRole=function(t,n){return e.request.put(e.getApiTeamUrl()+"projects/"+t+"/members",n)},this.deleteUser=function(t){return e.request.del(e.getApiTeamUrl()+"projects/"+t+"/members")}},be=function(e){this.get=function(t,n){if(t||n){var r={queryParams:{}};return void 0!==t&&(r.queryParams.rights=t),void 0!==n&&(r.queryParams.customrole=n),e.request.get(e.getApiTeamUrl()+"roles/",r)}return e.request.get(e.getApiTeamUrl()+"roles/")},this.getAllRights=function(t){if(t){var n={queryParams:{globalfreeattributes:t.globalfreeattributes,global:t.global,project:t.project,document:t.document,layer:t.layer}};return e.request.get(e.getApiTeamUrl()+"rights",n)}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,n){return e.request.put(e.getApiTeamUrl()+"roles/"+t,n)},this.deleteRole=function(t){return e.request.del(e.getApiTeamUrl()+"roles/"+t)}},we=function(e){this.calculateCutSection=function(t){var n,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i={cuttingCalculation:{projectId:t.projectId,cuttingPlanes:t.cuttingPlanes,selection:{modelLayer:t.modelLayer,topologyNodes:t.topologyNodes,hiddenObjects:t.hiddenObjects},settings:t.settings},runAsync:r};if("glb"===(null===(n=i.cuttingCalculation)||void 0===n||null===(n=n.settings)||void 0===n?void 0:n.responseGeometry)){return e.request.post(e.getApiTeamUrl()+"services/CuttingCalculation",JSON.stringify(i),{useXMLHttpRequest:!0,dataType:"binary",processData:!1,responseType:"arraybuffer"})}return e.request.post(e.getApiTeamUrl()+"services/CuttingCalculation",JSON.stringify(i))}},Te=function(e){this.post=function(t){return e.request.post(e.getApiTeamUrl()+"share",t)}},qe=function(e){this.get=function(t){return e.request.get(e.getApiTeamUrl()+"slides/"+t)},this.put=function(t,n){return e.request.put(e.getApiTeamUrl()+"slides/"+t,n)},this.delete=function(t){return e.request.del(e.getApiTeamUrl()+"slides/"+t)},this.postThumbnail=function(t,n){return e.request.post(e.getApiTeamUrl()+"slides/"+t+"/thumbnail",n)}},Ae=function(e){this.get=function(t){return e.request.get(e.getApiTeamUrl()+"slideshows/"+t)},this.put=function(t,n){return e.request.put(e.getApiTeamUrl()+"slideshows/"+t,n)},this.delete=function(t){return e.request.del(e.getApiTeamUrl()+"slideshows/"+t)},this.postSlide=function(t,n){return e.request.post(e.getApiTeamUrl()+"slideshows/"+t+"/slides",n)},this.getSlides=function(t){return e.request.get(e.getApiTeamUrl()+"slideshows/"+t+"/slides")},this.postThumbnail=function(t,n){return e.request.post(e.getApiTeamUrl()+"slideshows/"+t+"/thumbnail",n)},this.getThumbnail=function(t){return e.request.get(e.getApiTeamUrl()+"thumbnail/"+t)}},_e=function(e){this.postStructure=function(t,n){return e.request.post(e.getApiTeamUrl()+"projects/"+t+"/structures",n)},this.postStructureTopology=function(t,n){return e.request.post(e.getApiTeamUrl()+"structures/"+t+"/topology",n)},this.postSubNode=function(t,n){return e.request.post(e.getApiTeamUrl()+"structures/"+t,n)},this.postAssignedObject=function(t,n,r,i){return e.request.post(e.getApiTeamUrl()+"structures/"+t+"/assign/"+n+"?varianttype="+r,i)},this.attributeAssign=function(t,n,r,i){var o={attributeId:r};return i&&(o.variantType=i),e.request.put(e.getApiTeamUrl()+"projects/"+t+"/structures/"+n+"/attributeassign",JSON.stringify(o))},this.deleteAssignedObject=function(t,n,r,i){var o=[i?"removeAllNodes=true":"",r?"varianttype=true":""].filter((function(e){return e})).join("&");return e.request.del(e.getApiTeamUrl()+"structures/"+t+"/delete/"+n+"?"+o)},this.getStructure=function(t,n,r){return n?e.request.get(e.getApiTeamUrl()+"structures/"+n):e.request.get(e.getApiTeamUrl()+"projects/"+t+"/structures"+(r?"?type="+r:""))},this.getTopology=function(t,n,r){return void 0===r||""==r?e.request.get(e.getApiTeamUrl()+"structures/"+t+"/topology?varianttype="+n):!0===r?e.request.get(e.getApiTeamUrl()+"structures/"+t+"/topology?varianttype="+n+"&attributes=true"):void 0},this.getTopologyStructure=function(t,n){return e.request.get(e.getApiTeamUrl()+"projects/"+t+"/topologystructure",n?{queryParams:n}:void 0)},this.resetTopologyStructure=function(t,n){return e.request.put(e.getApiTeamUrl()+"projects/"+t+"/topologystructure/reset",void 0,n?{queryParams:n}:void 0)},this.copyStructure=function(t,n,r){return e.request.post(e.getApiTeamUrl()+"structures/"+t+"/copy?elementRelation="+r+"&attributes=true",n)},this.putStructure=function(t,n,r){var i=r?"?applyToChild=true":"";return e.request.put(e.getApiTeamUrl()+"structures/"+t+i,n)},this.reorderStructure=function(t,n){return e.request.put(e.getApiTeamUrl()+"structures/"+t+"/reorder?varianttype="+n)},this.deleteStructure=function(t,n,r){return r?e.request.del(e.getApiTeamUrl()+"structures/"+t+"?forceDelete=true"):n?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,n){return e.request.post(e.getApiTeamUrl()+"projects/"+t+"/variants",n)},this.getVariantType=function(t,n){return n?e.request.get(e.getApiTeamUrl()+"projects/"+t+"/variants/"+n):e.request.get(e.getApiTeamUrl()+"projects/"+t+"/variants")},this.deleteVariantType=function(t,n){return e.request.del(e.getApiTeamUrl()+"projects/"+t+"/variants/"+n)},this.copyElementsToVariant=function(t,n,r){return e.request.put(e.getApiTeamUrl()+"projects/"+t+"/variants/"+n+"/copyfrom",r)}},ke=function(e){this.get=function(){return e.request.get(e.getApiUrl()+"team-actions-rights/")}},Ue=function(e){this.get=function(t,n){var r={queryParams:{}};return n&&(r.queryParams.filterEmpty=n),t?e.request.get(e.getApiUrl()+"teams/"+t,r):e.request.get(e.getApiUrl()+"teams",r)},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")}},xe=function(e){this.get=function(t,n){var r={language:t};return n&&(r.type=n),e.request.get(e.getApiUrl()+"terms/download",{queryParams:r,dataType:"html"})}},je=function(e){this.get=function(t,n){var r={language:t};return n&&(r.type=n),e.request.get(e.getApiUrl()+"dataprotectiondeclarations/download",{queryParams:r,dataType:"html"})},this.getForbiddenEmails=function(){return e.request.get(e.getApiUrl()+"restrictedemails")}},Pe=function(e){this.get=function(t,n){var r={language:t};return n&&(r.type=n),e.request.get(e.getApiUrl()+"imprints/download",{queryParams:r,dataType:"html"})}},Se=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,n){return e.request.put(e.getApiUrl()+"content/units/"+t,n)},this.delete=function(t){return e.request.del(e.getApiUrl()+"content/units/"+t)}},Ee=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,n){var r=e.getApiUrl()+"user";return n?e.request.put(r,t,{token:n}):e.request.put(r,t)},this.setPassword=function(t,n,r){var i=e.getApiUrl()+"user/set_password";return t&&(i+=t),r?e.request.put(i,n,{token:r}):e.request.put(i,n)},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")}},Oe=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,n){return e.request.put(e.getApiUrl()+"users/"+t,n)},this.delete=function(t){return e.request.del(e.getApiUrl()+"users/"+t)},this.setSubscriptions=function(t,n){return e.request.post(e.getApiUrl()+"administration/users/"+t+"/accountsettings",n)}},De=function(e){this.postSettings=function(t,n){return e.request.post(e.getApiTeamUrl()+"userSettings/"+t,n)},this.getSettings=function(t){return e.request.get(e.getApiTeamUrl()+"userSettings/"+t)}},Ce=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,n){return e.request.put(e.getApiTeamUrl()+"invitations/"+t,n)},this.accept=function(t,n){return e.request.put(e.getApiUrl()+"invitations/"+t+"/accept",n)},this.getInvitation=function(t,n){return e.request.get(e.getApiUrl()+"invitations/"+t,n)}},Ie=function(e){this.post=function(t,n){return e.request.post(e.getApiTeamUrl()+"projects/"+t+"/selections",n)},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)}},Re=function(e){this.postGroup=function(t,n){return e.request.post(e.getApiTeamUrl()+"projects/"+t+"/usergroups",n)},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,n){return e.request.put(e.getApiTeamUrl()+"usergroups/"+t,n)},this.assignUser=function(t,n){return e.request.put(e.getApiTeamUrl()+"usergroups/"+t+"/assign",n)},this.removeUser=function(t,n){return e.request.put(e.getApiTeamUrl()+"usergroups/"+t+"/remove",n)}},Be=function(e){this.get=function(t){return e.request.get(e.getApiTeamUrl()+"scenes/"+t)},this.getObjectScenes=function(t,n){var r={};n&&(r.queryParams={shortInfo:n});var i=e.getApiTeamUrl()+"objects/"+t+"/scenes";return e.request.get(i,r)},this.post=function(t,n){return e.request.post(e.getApiTeamUrl()+"objects/"+t+"/scenes",n)},this.delete=function(t){return e.request.del(e.getApiTeamUrl()+"scenes/"+t)},this.put=function(t,n){return e.request.put(e.getApiTeamUrl()+"scenes/"+t,n)},this.postThumbnailAttachment=function(t,n,r,i){return e.request.post(e.getApiTeamUrl()+"objects/"+t+"/attachments",n,{contentType:!1,processData:!1,dataType:null,xhrUploadProgress:r,queryParams:i?{attachmenttype:"thumbnailhighresolution"}:void 0})},this.postThumbnail=function(t,n,r){return e.request.post(e.getApiTeamUrl()+"objects/"+t+"/attachments",n,{queryParams:r?{attachmenttype:"thumbnailhighresolution"}:void 0})},this.getThumbnail=function(t){return e.request.get(e.getApiTeamUrl()+"objects/"+t+"/attachments")}},Ke=function(e){this.post=function(t){return e.request.post(e.getApiTeamUrl()+"services/BaseQuantities",JSON.stringify(t))}},Ne=function(e){this.createWorkflowTemplateFolder=function(t,n){return e.request.post(e.getApiTeamUrl()+"structures/"+t,n)},this.putWorkflowTemplateFolder=function(t,n){return e.request.put(e.getApiTeamUrl()+"structures/"+t,n)},this.postWorkflowTemplate=function(t,n){return e.request.post(e.getApiTeamUrl()+"projects/"+t+"/workflowtemplates",n)},this.putWorkflowTemplate=function(t,n){return e.request.put(e.getApiTeamUrl()+"workflowtemplates/"+t,n)},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,n){return e.request.post(e.getApiTeamUrl()+"projects/"+t+"/workflows",n)},this.getAllWorkflows=function(t,n){var r={queryParams:{}};return r.queryParams.status=n,e.request.get(e.getApiTeamUrl()+"projects/"+t+"/workflows",r)},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,n){return e.request.put(e.getApiTeamUrl()+"steps/"+t+"/?submit=true",n)},this.saveStep=function(t,n){return e.request.put(e.getApiTeamUrl()+"steps/"+t+"/?submit=false",n)},this.cancelWorkflow=function(t){return e.request.put(e.getApiTeamUrl()+"workflows/"+t+"/cancel")}},Le=function(e){this.post=function(t){return e.request.post(e.getApiUrl()+"administration/backups",t)},this.put=function(t,n){return e.request.put(e.getApiUrl()+"administration/backups/"+t,n)},this.delete=function(t){return e.request.del(e.getApiUrl()+"administration/backups/"+t)},this.get=function(t){return e.request.get(e.getApiUrl()+"administration/backups/"+t)},this.getProjectBackups=function(t){return e.request.get(e.getApiUrl()+"administration/backups/projects/"+t)}};function Me(e){return Me="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},Me(e)}function Fe(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Ge(r.key),r)}}function Ge(e){var t=function(e,t){if("object"!=Me(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=Me(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Me(t)?t:t+""}var We=function(){return e=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=ze(),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 K,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 p,this._cache=null)):this.request=new p,this.authorize=new y(this),this.user=new Ee(this),this.users=new Oe(this),this.teams=new Ue(this),this.members=new re(this),this.projects=new me(this),this.structures=new _e(this),this.models=new oe(this),this.objects=new ae(this),this.overlays=new ce(this),this.overlaySets=new le(this),this.revisions=new ye(this),this.elementTypes=new z(this),this.annotations=new d(this),this.attachments=new g(this),this.issues=new ee(this),this.labels=new te(this),this.pins=new fe(this),this.comments=new M(this),this.hyperlinks=new Y(this),this.importService=new Z(this),this.slideshows=new Ae(this),this.slides=new qe(this),this.clashDetection=new N(this),this.clientLogs=new L(this),this.rightsService=new ve(this),this.applicationSettings=new h(this),this.exportService=new H(this),this.folders=new V(this),this.locks=new ne(this),this.share=new Te(this),this.messages=new ie(this),this.objectFilters=new ue(this),this.terms=new xe(this),this.dataProtection=new je(this),this.dimensions=new W(this),this.imprints=new Pe(this),this.projectActionsRights=new pe(this),this.roles=new be(this),this.attributeTemplates=new m(this),this.units=new Se(this),this.freeAttributes=new J(this),this.freeAttributeGroups=new Q(this),this.hiddenCalculation=new X(this),this.sectionCut=new we(this),this.projectAttributeTemplates=new he(this),this.teamActionsRights=new ke(this),this.customTables=new G(this),this.userSettings=new De(this),this.invitations=new Ce(this),this.selections=new Ie(this),this.userGroups=new Re(this),this.scenes=new Be(this),this.baseQuantities=new Ke(this),this.workflows=new Ne(this),this.backups=new Le(this),this.connexis=new F(this)},(t=[{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}}])&&Fe(e.prototype,t),n&&Fe(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n}(),ze=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"}}})(),r})()));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bimplus-websdk",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.17",
|
|
4
4
|
"description": "bim+ websdk",
|
|
5
5
|
"types": "types/bimplus-websdk.d.ts",
|
|
6
6
|
"keywords": [
|
|
@@ -36,33 +36,33 @@
|
|
|
36
36
|
"test-watch": "npm run test -- --browsers=Chrome --single-run=false --auto-watch"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
|
-
"@babel/core": "^7.
|
|
40
|
-
"@babel/plugin-transform-runtime": "^7.
|
|
41
|
-
"@babel/preset-env": "^7.
|
|
42
|
-
"@babel/runtime": "^7.
|
|
43
|
-
"babel-loader": "^9.1
|
|
39
|
+
"@babel/core": "^7.25.2",
|
|
40
|
+
"@babel/plugin-transform-runtime": "^7.25.4",
|
|
41
|
+
"@babel/preset-env": "^7.25.4",
|
|
42
|
+
"@babel/runtime": "^7.25.4",
|
|
43
|
+
"babel-loader": "^9.2.1",
|
|
44
44
|
"clean-webpack-plugin": "^4.0.0",
|
|
45
45
|
"coverage-istanbul-loader": "^3.0.5",
|
|
46
46
|
"documentation": "^14.0.3",
|
|
47
|
-
"eslint": "^9.
|
|
48
|
-
"globals": "15.
|
|
47
|
+
"eslint": "^9.11.1",
|
|
48
|
+
"globals": "15.10.0",
|
|
49
49
|
"host-environment": "^2.1.2",
|
|
50
|
-
"karma": "^6.4.
|
|
50
|
+
"karma": "^6.4.4",
|
|
51
51
|
"karma-chrome-launcher": "^3.2.0",
|
|
52
52
|
"karma-coverage-istanbul-reporter": "^3.0.2",
|
|
53
53
|
"karma-firefox-launcher": "^2.1.3",
|
|
54
54
|
"karma-host-environment": "^3.0.3",
|
|
55
55
|
"karma-jquery": "^0.2.4",
|
|
56
|
-
"karma-qunit": "^4.2.
|
|
56
|
+
"karma-qunit": "^4.2.1",
|
|
57
57
|
"karma-webpack": "^5.0.1",
|
|
58
|
-
"qunit": "^2.
|
|
58
|
+
"qunit": "^2.22.0",
|
|
59
59
|
"terser-webpack-plugin": "^5.3.10",
|
|
60
|
-
"webpack": "^5.
|
|
60
|
+
"webpack": "^5.95.0",
|
|
61
61
|
"webpack-cli": "^5.1.4",
|
|
62
62
|
"webpack-merge": "^6.0.1"
|
|
63
63
|
},
|
|
64
64
|
"dependencies": {
|
|
65
|
-
"async": "^3.2.
|
|
65
|
+
"async": "^3.2.6",
|
|
66
66
|
"dexie": "4.0.8",
|
|
67
67
|
"jquery": "3.7.1"
|
|
68
68
|
}
|