bimplus-websdk 1.0.50-hackathon-object-store01 → 1.0.50-hackathon-object-store02

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.
@@ -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,(()=>(()=>{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 A(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)A(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:A(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 q(e){var t,n={};for(t in e)l(e,t)&&(n[t]=e[t]);return n}var _=[].concat;function U(e){return _.apply([],e)}var k="BigUint64Array,BigInt64Array,Array,Boolean,String,Date,RegExp,Blob,File,FileList,FileSystemFileHandle,FileSystemDirectoryHandle,ArrayBuffer,DataView,Uint8ClampedArray,ImageBitmap,ImageData,Map,Set,CryptoKey".split(",").concat(U([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(k.map((function(e){return i[e]}))),j=null;function S(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 P={}.toString;function E(e){return P.call(e).slice(8,-1)}var O="undefined"!=typeof Symbol?Symbol.iterator:"@@iterator",C="symbol"==typeof O?function(e){var t;return null!=e&&(t=e[O])&&t.apply(e)}:function(){return null};function D(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=C(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"]),L={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 N(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(N).from(Error).extend({toString:function(){return this.name+": "+this.message}}),d(F).from(N),d(G).from(N);var W=K.reduce((function(e,t){return e[t]=t+"Error",e}),{}),z=N,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=L[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 X(e){return e}function Y(e,t){return null==e||e===X?t:function(n){return t(e(n))}}function J(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?J(r,this.onsuccess):r),i&&(this.onerror=this.onerror?J(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?J(n,this.onsuccess):n),r&&(this.onerror=this.onerror?J(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?J(i,this.onsuccess):i),o&&(this.onerror=this.onerror?J(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=N,$.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=(k="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]}(),k[0]),ce=(K=k[1],k=k[2],K=K&&K.then,ae&&ae.constructor),le=!!k,fe=function(e,t){be.push([e,t]),he&&(queueMicrotask(Se),he=!1)},pe=!0,he=!0,de=[],ge=[],me=X,ye={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:Q,pgp:!1,env:{},finalize:Q},ve=ye,be=[],we=0,Te=[];function Ae(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&&Ue(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&&Pe();n&&"function"==typeof n.then?e(t,(function(e,t){n instanceof Ae?n._then(e,t):n.then(e,t)})):(t._state=!0,t._value=n,ke(t)),r&&Ee()}}),Ue.bind(null,t))}catch(n){Ue(t,n)}}(this,e)}var qe={get:function(){var e=ve,t=Le;function n(n,r){var i=this,o=!e.global&&(e!==ve||t!==Le),s=o&&!Ge(),u=new Ae((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?qe:{get:function(){return e},set:qe.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 Ue(e,t){var n,r;ge.push(t),null===e._state&&(n=e._lib&&Pe(),t=me(t),e._state=!1,e._value=t,r=e,de.some((function(e){return e._value===r._value}))||de.push(r),ke(e),n&&Ee())}function ke(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 Se(){$e(ye,(function(){Pe()&&Ee()}))}function Pe(){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 Ce(e){return new Ae(se,!1,e)}function De(e,t){var n=ve;return function(){var r=Pe(),i=ve;try{return He(n,!0),e.apply(this,arguments)}catch(r){t&&t(r)}finally{He(i,!1),r&&Ee()}}}f(Ae.prototype,{then:qe,_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:Ce)(e)})):this.then(null,(function(e){return(e&&e.name===t?n:Ce)(e)}))},finally:function(e){return this.then((function(t){return Ae.resolve(e()).then((function(){return t}))}),(function(t){return Ae.resolve(e()).then((function(){return Ce(t)}))}))},timeout:function(e,t){var n=this;return e<1/0?new Ae((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(Ae.prototype,Symbol.toStringTag,"Dexie.Promise"),ye.env=Ve(),f(Ae,{all:function(){var e=R.apply(null,arguments).map(We);return new Ae((function(t,n){0===e.length&&t([]);var r=e.length;e.forEach((function(i,o){return Ae.resolve(i).then((function(n){e[o]=n,--r||t(e)}),n)}))}))},resolve:function(e){return e instanceof Ae?e:e&&"function"==typeof e.then?new Ae((function(t,n){e.then(t,n)})):new Ae(se,!0,e)},reject:Ce,race:function(){var e=R.apply(null,arguments).map(We);return new Ae((function(t,n){e.map((function(e){return Ae.resolve(e).then(t,n)}))}))},PSD:{get:function(){return ve},set:function(e){return ve=e}},totalEchoes:{get:function(){return Le}},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 Ae((function(n,r){return Me((function(t,n){var r=ve;r.unhandleds=[],r.onunhandled=n,r.finalize=J((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(Ae,"allSettled",(function(){var e=R.apply(null,arguments).map(We);return new Ae((function(t){0===e.length&&t([]);var n=e.length,r=new Array(n);e.forEach((function(e,i){return Ae.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(Ae,"any",(function(){var e=R.apply(null,arguments).map(We);return new Ae((function(t,n){0===e.length&&n(new AggregateError([]));var r=e.length,i=new Array(r);e.forEach((function(e,o){return Ae.resolve(e).then((function(e){return t(e)}),(function(e){i[o]=e,--r||n(new AggregateError(i))}))}))}))})),ce.withResolvers&&(Ae.withResolvers=ce.withResolvers));var Ie={awaits:0,echoes:0,id:0},Re=0,Be=[],Ke=0,Le=0,Ne=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=++Ne,ye.env,o.env=le?{Promise:Ae,PromiseProp:{value:Ae,configurable:!0,writable:!0},all:Ae.all,race:Ae.race,allSettled:Ae.allSettled,any:Ae.any,resolve:Ae.resolve,reject:Ae.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(),Ye(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){++Le,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 Xe(e){Promise===ce&&0===Ie.echoes?0===Ke?e():enqueueNativeMicroTask(e):setTimeout(e,0)}-1===(""+K).indexOf("[native code]")&&(Fe=Ge=Q);var Ye=Ae.reject,Je=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=S(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=Pe();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)}))):Ye(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 Ye(new H.DatabaseClosed(t._state.dbOpenError));if(!t._state.isBeingOpened){if(!t._state.autoOpen)return Ye(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),Ye(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?Ye(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!==Je){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;function u(e,t){return 0===ct(e,t)}var a=t.reduce((function(t,n){var r=t[0],o=t[1],a=(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 u(a,e)}))}:function(e){return u(a,T(e,n))}):o]}),[null,null]);return r=a[0],a=a[1],r?this.where(r.name).equals(e[r.keyPath]).filter(a):n?this.filter(a):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?Ae.reject(e.failures[0]):e.lastResult})).then((function(t){if(o)try{A(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))?Ye(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?Ae.reject(e.failures[0]):e.lastResult})).then((function(t){if(o)try{A(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?Ae.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?Ae.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 A(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,X,(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),At(wt(e,r,n),e.algorithm,s,!e.keysOnly&&e.valueMapper)])}return At(wt(e,r,n),ot(e.algorithm,i),t,!e.keysOnly&&e.valueMapper)}function At(e,t,n,r){var i=De(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()}))}))}var qt=(_t.prototype.execute=function(e){var t=this["@@propmod"];if(void 0!==t.add){var n=t.add;if(s(n))return r(r([],s(e)?e:[],!0),n,!0).sort();if("number"==typeof n)return(Number(e)||0)+n;if("bigint"==typeof n)try{return BigInt(e)+n}catch(e){return BigInt(0)+n}throw new TypeError("Invalid term ".concat(n))}if(void 0!==t.remove){var i=t.remove;if(s(i))return s(e)?e.filter((function(e){return!i.includes(e)})).sort():[];if("number"==typeof i)return Number(e)-i;if("bigint"==typeof i)try{return BigInt(e)-i}catch(e){return BigInt(0)-i}throw new TypeError("Invalid subtrahend ".concat(i))}return(n=null===(n=t.replacePrefix)||void 0===n?void 0:n[0])&&"string"==typeof e&&e.startsWith(n)?t.replacePrefix[1]+e.substring(n.length):e},_t);function _t(e){this["@@propmod"]=e}var Ut=(kt.prototype._read=function(e,t){var n=this._ctx;return n.error?n.table._trans(null,Ye.bind(null,n.error)):n.table._trans("readonly",e).then(t)},kt.prototype._write=function(e){var t=this._ctx;return t.error?t.table._trans(null,Ye.bind(null,t.error)):t.table._trans("readwrite",e,"locked")},kt.prototype._addAlgorithm=function(e){var t=this._ctx;t.algorithm=ot(t.algorithm,e)},kt.prototype._iterate=function(e,t){return Tt(this._ctx,e,t,this._ctx.table.core)},kt.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},kt.prototype.raw=function(){return this._ctx.valueMapper=null,this},kt.prototype.each=function(e){var t=this._ctx;return this._read((function(n){return Tt(t,e,n,t.table.core)}))},kt.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)},kt.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 ct(o(e,i),o(t,i))*s}return this.toArray((function(e){return e.sort(u)})).then(t)},kt.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)},kt.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},kt.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},kt.prototype.until=function(e,t){return yt(this._ctx,(function(n,r,i){return!e(n.value)||(r(i),t)})),this},kt.prototype.first=function(e){return this.limit(1).toArray((function(e){return e[0]})).then(e)},kt.prototype.last=function(e){return this.reverse().first(e)},kt.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},kt.prototype.and=function(e){return this.filter(e)},kt.prototype.or=function(e){return new this.db.WhereClause(this._ctx.table,e,this)},kt.prototype.reverse=function(){return this._ctx.dir="prev"===this._ctx.dir?"next":"prev",this._ondirectionchange&&this._ondirectionchange(this._ctx.dir),this},kt.prototype.desc=function(){return this.reverse()},kt.prototype.eachKey=function(e){var t=this._ctx;return t.keysOnly=!t.isMatch,this.each((function(t,n){e(n.key,n)}))},kt.prototype.eachUniqueKey=function(e){return this._ctx.unique="unique",this.eachKey(e)},kt.prototype.eachPrimaryKey=function(e){var t=this._ctx;return t.keysOnly=!t.isMatch,this.each((function(t,n){e(n.primaryKey,n)}))},kt.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)},kt.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)},kt.prototype.uniqueKeys=function(e){return this._ctx.unique="unique",this.keys(e)},kt.prototype.firstKey=function(e){return this.limit(1).keys((function(e){return e[0]})).then(e)},kt.prototype.lastKey=function(e){return this.reverse().firstKey(e)},kt.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},kt.prototype.modify=function(e){var t=this,n=this._ctx;return this._write((function(r){var i,s,u;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 qt?(A(t,o,u.execute(a)),n=!0):a!==u&&(A(t,o,u),n=!0)}return n});var a,c=n.table.core,l=(a=c.schema.primaryKey).outbound,f=a.extractKey,p=200;function h(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])}}(a=t.db._options.modifyChunkSize)&&(p="object"==typeof a?a[c.name]||a["*"]||200:a);var d=[],g=0,m=[];return t.clone().primaryKeys().then((function(t){function i(n){var s=Math.min(p,t.length-n);return c.getMany({trans:r,keys:t.slice(n,n+s),cache:"immutable"}).then((function(a){for(var d=[],g=[],m=l?[]:null,y=[],v=0;v<s;++v){var b=a[v],w={value:S(b),primKey:t[n+v]};!1!==u.call(w,w.value,w)&&(null==w.value?y.push(t[n+v]):l||0===ct(f(b),f(w.value))?(g.push(w.value),l&&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);h(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 h(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 h(y.length,e)}))})).then((function(){return t.length>n+s&&i(n+p)}))}))}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}))}))}))},kt.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)},kt);function kt(){}var xt=function(e,t){return t.value=null};function jt(e,t){return e<t?-1:e===t?0:1}function St(e,t){return t<e?-1:e===t?0:1}function Pt(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 Dt("")})).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 Pt(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:St;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 Ct(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 Ct(e,t,n,r){return{type:2,lower:e,upper:t,lowerOpen:n,upperOpen:r}}function Dt(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 Ct(e,t,!n,!r)}))}catch(e){return Pt(this,Ze)}},Rt.prototype.equals=function(e){return null==e?Pt(this,Ze):new this.Collection(this,(function(){return Dt(e)}))},Rt.prototype.above=function(e){return null==e?Pt(this,Ze):new this.Collection(this,(function(){return Ct(e,void 0,!0)}))},Rt.prototype.aboveOrEqual=function(e){return null==e?Pt(this,Ze):new this.Collection(this,(function(){return Ct(e,void 0,!1)}))},Rt.prototype.below=function(e){return null==e?Pt(this,Ze):new this.Collection(this,(function(){return Ct(void 0,e,!1,!0)}))},Rt.prototype.belowOrEqual=function(e){return null==e?Pt(this,Ze):new this.Collection(this,(function(){return Ct(void 0,e)}))},Rt.prototype.startsWith=function(e){return"string"!=typeof e?Pt(this,et):this.between(e,e+Je,!0,!0)},Rt.prototype.startsWithIgnoreCase=function(e){return""===e?this.startsWith(e):Ot(this,(function(e,t){return 0===e.indexOf(t[0])}),[e],Je)},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,Je)},Rt.prototype.anyOf=function(){var e=this,t=R.apply(I,arguments),n=this._cmp;try{t.sort(n)}catch(r){return Pt(this,Ze)}if(0===t.length)return Et(this);var r=new this.Collection(this,(function(){return Ct(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 Pt(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 Pt(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 Pt(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 Ct(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+Je]}))):Pt(this,"startsWithAnyOf() only works with strings")},Rt);function Rt(){}function Bt(e){return De((function(t){return Kt(t),e(t.target.error),!1}))}function Kt(e){e.stopPropagation&&e.stopPropagation(),e.preventDefault&&e.preventDefault()}var Lt="storagemutated",Nt="x-storagemutated-1",Mt=dt(null,Lt),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=De((function(n){Kt(n),t._reject(e.error)})),e.onabort=De((function(n){Kt(n),t.active&&t._reject(new H.Abort(e.error)),t.active=!1,t.on("abort").fire(n)})),e.oncomplete=De((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 Ye(new H.ReadOnly("Transaction is readonly"));if(!this.active)return Ye(new H.TransactionInactive);if(this._locked())return new Ae((function(i,o){r._blockedFuncs.push([function(){r._promise(e,t,n).then(i,o)},ve])}));if(n)return Me((function(){var e=new Ae((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 Ae((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=Ae.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 Ae((function(e,t){r.then((function(t){return n._waitingQueue.push(De(e.bind(null,t)))}),(function(e){return n._waitingQueue.push(De(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 Je},Je}};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 Xt=0;function Yt(e){return null==e?":id":"string"==typeof e?e:"[".concat(e.join("+"),"]")}function Jt(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=De(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=De(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=De(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=De(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=De(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=De((function(n){var r,i,o,s,u=p.result;u?(u.___id=++Xt,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=De(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=De(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=De((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=De((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[Yt(e)]=r})),getIndexByKeyPath:function(e){return i[Yt(e)]}},i[":id"]=n.primaryKey,null!=t&&(i[Yt(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=Jt(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})):Ae.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=q(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=Ae.follow((function(){var e;(p=c(u))&&h&&(e=Ge.bind(null,null),p.then(e,e))})),p&&"function"==typeof p.then?Ae.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?Ae.resolve(c.shift()(u.idbtrans)).then(e):Ae.resolve()}().then((function(){cn(l,a)}))):Ae.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 Ae.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},Un(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},Un(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&&An(e,i),r&&n&&An(e,r)}}function An(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 qn(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 Un(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=kn(r)),e.d=kn(e)}function kn(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]?An(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]&&qn(t[n],e[n])}))}f(wn.prototype,((K={add:function(e){return An(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 Sn={},Pn={},En=!1;function On(e){xn(Pn,e),En||(En=!0,setTimeout((function(){En=!1,Cn(Pn,!(Pn={}))}),0))}function Cn(e,t){void 0===t&&(t=!1);var n=new Set;if(e.all)for(var r=0,i=Object.values(Sn);r<i.length;r++)Dn(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=Sn["idb://".concat(o,"/").concat(u)])&&Dn(s,e,n,t))}n.forEach((function(e){return e()}))}function Dn(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?Ye(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 Ae((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=De(e._fireOnBlocked),h.onupgradeneeded=De((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=De((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=De((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=De((function(n){t.vcFired=!0,e.on("versionchange").fire(n)})),m.onclose=De((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 Ae.reject(e)}))}var c,l=t.dbReadyResolve,f=null,p=!1;return Ae.race([r,("undefined"==typeof navigator?Ae.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=[],Ae.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=[],Ae.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(),Ye(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(Lt).fire(t),Cn(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=Yt(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[Yt(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 Ln(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?Ln(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 Nn(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||Nn(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||A(e.values[r],o.keyPath,n))):(i=Ln(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]:A(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?S(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?Ae.resolve(t):r.getMany(e).then((function(t){return e.trans._cache={keys:e.keys,values:"clone"===e.cache?S(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(t){function o(e){return e="idb://".concat(n,"/").concat(i,"/").concat(e),g[e]||(g[e]=new wn)}var l,f,p,d=t.trans,g=t.mutatedParts||(t.mutatedParts={}),m=o(""),y=o(":dels"),v=t.type,b="deleteRange"===t.type?[t.range]:"delete"===t.type?[t.keys]:t.values.length<50?[Nn(c,t).filter((function(e){return e})),t.values]:[],w=b[0],T=b[1];return b=t.trans._cache,s(w)?(m.addKeys(w),(b="delete"===v||w.length===T.length?Fn(w,b):null)||y.addKeys(w),(b||T)&&(l=o,f=b,p=T,a.indexes.forEach((function(e){var t=l(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)}(f||p).forEach((function(e,t){var i=f&&n(f[t]);0!==ct(i,t=p&&n(p[t]))&&(null!=i&&r(i),null!=t&&r(t))}))})))):w?(T={from:null!==(T=w.lower)&&void 0!==T?T:e.MIN_KEY,to:null!==(T=w.upper)&&void 0!==T?T:e.MAX_KEY},y.add(T),m.add(T)):(m.add(r),y.add(r),a.indexes.forEach((function(e){return o(e.name).add(r)}))),u.mutate(t).then((function(e){return!w||"add"!==t.type&&"put"!==t.type||(m.addKeys(e.results),h&&h.forEach((function(n){for(var r=t.values.map((function(e){return n.extractKey(e)})),i=n.keyPath.findIndex((function(e){return e===c.keyPath})),s=0,u=e.results.length;s<u;++s)r[s][i]=e.results[s];o(n.name).addKeys(r)}))),d.mutatedParts=xn(d.mutatedParts||{},g),e}))}}),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":var g=(new wn).addKeys(t.values?e.map((function(e){return l(e)})):e);r=e.concat(t.values?i.filter((function(e){return e=l(e),!g.hasKey(e)&&(g.addKey(e),!0)})):i.map((function(e){return l(e)})).filter((function(e){return!g.hasKey(e)&&(g.addKey(e),!0)})));break;case"put":var m=(new wn).addKeys(n.values.map((function(e){return l(e)})));r=e.filter((function(e){return!m.hasKey(t.values?l(e):e)})).concat(t.values?i:i.map((function(e){return l(e)})));break;case"delete":var y=(new wn).addKeys(n.keys);r=e.filter((function(e){return!y.hasKey(t.values?l(e):e)}));break;case"deleteRange":var v=n.range;r=e.filter((function(e){return!$n(l(e),v)}))}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 Xn(e,t){return 0===ct(e.lower,t.lower)&&0===ct(e.upper,t.upper)&&!!e.lowerOpen==!!t.lowerOpen&&!!e.upperOpen==!!t.upperOpen}function Yn(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 Jn(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&&D(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=Sn["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)&&(D(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,A,q=0,_=(w=b[v]).slice();q<_.length;q++)null!=(T=_[q]).res&&u.mutatedParts&&(i&&!T.dirty?(A=Object.isFrozen(T.res),A=Qn(T.res,T.req,h,p,T,A),T.dirty?(D(w,T),T.subscribers.forEach((function(e){return s.add(e)}))):A!==T.res&&(T.res=A,T.promise=Ae.resolve({result:A}))):(T.dirty&&D(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||"readwrite"!==s.idbtrans.mode)return i.mutate(e);var u=Sn["idb://".concat(n,"/").concat(r)];return u?(s=i.mutate(e),"add"!==e.type&&"put"!==e.type||!(50<=e.values.length||Nn(o,e).some((function(e){return null==e})))?(u.optimisticOps.push(e),e.mutatedParts&&On(e.mutatedParts),s.then((function(t){0<t.numFailures&&(D(u.optimisticOps,e),(t=Vn(0,e,t))&&u.optimisticOps.push(t),e.mutatedParts&&On(e.mutatedParts))})),s.catch((function(){D(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 n.failures[r]||A(e=null!==(i=o.keyPath)&&void 0!==i&&i.includes(".")?S(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=Sn["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&&Xn(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)&&Yn(e.req.query.range,r.query.range)})),!1,i,o];case"count":return s=o.find((function(e){return Xn(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=S(n);return e})).catch((function(e){return f&&a&&D(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||(Sn["idb://".concat(n,"/").concat(r)]={queries:{query:{},count:{}},objs:new Map,optimisticOps:[],unsignaledParts:{}})).queries.query[e.query.index.name||""]=f)),Jn(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 Ae((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 Ae((function(t){e.dbReadyResolve=t})),e.openCanceller=new Ae((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 Ae((function(i,o){function s(){t.close(e);var n=t._deps.indexedDB.deleteDatabase(t.name);n.onsuccess=De((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,U(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)})):Ye(n)}var a=function e(t,n,r,i,o){return Ae.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)}))):Ye(s)}var a,c=B(o);return c&&Fe(),s=Ae.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?Ae.resolve(a).then((function(e){return u.active?e:Ye(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),Ye(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 Ae((function(e){l.dbReadyResolve=e})),l.openCanceller=new Ae((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||Ae.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(Ut.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!==X?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:[Y,X],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 Ae((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(),Ye(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(k){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 Xe(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=Pe();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(Lt,h),f=!0),Xe((function(){return!s&&r.next&&r.next(e)})))}),(function(e){n=!1,["DatabaseClosedError","AbortError"].includes(null==e?void 0:e.name)||s||Xe((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),Cn(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 Ye(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:Ae.resolve(t)}catch(t){return Ye(t)}}},spawn:function(e,t,n){try{var r=Rn(e.apply(n,t||[]));return r&&"function"==typeof r.then?r:Ae.resolve(r)}catch(e){return Ye(e)}},currentTransaction:{get:function(){return ve.trans||null}},waitFor:function(e,t){return t=Ae.resolve("function"==typeof e?ur.ignoreTransaction(e):e).timeout(t||6e4),ve.trans?ve.trans.waitFor(t):t},Promise:Ae,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:A,delByKeyPath:function(e,t){"string"==typeof t?A(e,t,void 0):"length"in t&&[].map.call(t,(function(t){A(e,t,void 0)}))},shallowClone:q,deepClone:S,getObjectDiff:Ln,cmp:ct,asap:w,minKey:-1/0,addons:[],connections:tt,errnames:W,dependencies:rr,cache:Sn,semVer:"4.0.11",version:"4.0.11".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(Lt,(function(e){lr||(e=new CustomEvent(Nt,{detail:e}),lr=!0,dispatchEvent(e),lr=!1)})),addEventListener(Nt,(function(e){e=e.detail,lr||ar(e)})));var cr,lr=!1,fr=function(){};return"undefined"!=typeof BroadcastChannel&&((fr=function(){(cr=new BroadcastChannel(Nt)).onmessage=function(e){return e.data&&ar(e.data)}})(),"function"==typeof cr.unref&&cr.unref(),Mt(Lt,(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,[[]])}))}))),Ae.rejectionMapper=function(e,t){return!e||e instanceof N||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,PropModification:qt,replacePrefix:function(e,t){return new qt({replacePrefix:[e,t]})},add:function(e){return new qt({add:e})},remove:function(e){return new qt({remove:e})},default:tr,RangeSet:wn,mergeRanges:An,rangesOverlap:qn}),{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 A={};f(A,a,(function(){return this}));var q=Object.getPrototypeOf,_=q&&q(q(C([])));_&&_!==i&&o.call(_,a)&&(A=_);var U=T.prototype=b.prototype=Object.create(A);function k(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=S(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 S(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,S(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 P(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function E(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function O(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(P,this),this.reset(!0)}function C(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(U,"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(U),e},r.awrap=function(e){return{__await:e}},k(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()}))},k(U),f(U,l,"Generator"),f(U,a,(function(){return this})),f(U,"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=C,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:C(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,t,n,r){return t||(t={}),t.token||(t.token=n),t.tokenType&&t.tokenType===r||(t.tokenType=r),t.queryParams&&(e+=function(e){var t="?";for(var n in e)Object.hasOwn(e,n)&&(t+=n+"="+e[n]+"&");return t=t.slice(0,-1)}(t.queryParams)),{ajaxConfig:t,url:e}}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:()=>R,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=a(n,r,e,t),o=i.ajaxConfig,c=i.url;return null!=o&&o.useXMLHttpRequest?u(c,"GET",null,o):s(c,"GET",null,o)},this.getChunked=function(t,n){return c(this,e,"medium",t,n)},this.put=function(n,r,i){var o=a(n,i,e,t),u=o.ajaxConfig;return s(o.url,"PUT",r,u)},this.putChunked=function(t,n,r){return f(this,e,t,n,r)},this.post=function(n,r,i){var o=a(n,i,e,t),c=o.ajaxConfig,l=o.url;return null!=c&&c.useXMLHttpRequest?u(l,"POST",r,c):s(l,"POST",r,c)},this.del=function(n,r,i){var o=a(n,i,e,t),u=o.ajaxConfig,c=o.url;return r||(u.contentType=null),u.dataType=null,s(c,"DELETE",r||null,u)}},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)}})},this.getExchange=function(){return e.request.get(e.getApiUrl()+"external/attachments/exchange")},this.postExternalAttachment=function(t){return e.request.post(e.getApiTeamUrl()+"external/attachments/upload",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:A,rangesOverlap:q,RangeSet:_,cmp:U,Entity:k,PropModification:x,replacePrefix:j,add:S,remove:P}=w,E=w;function O(e){return O="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},O(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 P(r||[]);return i(s,"_invoke",{value:k(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,A=T&&T(T(E([])));A&&A!==n&&r.call(A,s)&&(w=A);var q=b.prototype=y.prototype=Object.create(w);function _(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function U(e,t){function 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"==O(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 k(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 S(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function P(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(O(t)+" is not iterable")}return v.prototype=b,i(q,"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(q),e},t.awrap=function(e){return{__await:e}},_(U.prototype),c(U.prototype,u,(function(){return this})),t.AsyncIterator=U,t.async=function(e,n,r,i,o){void 0===o&&(o=Promise);var s=new U(l(e,n,r,i),o);return t.isGeneratorFunction(n)?s:s.next().then((function(e){return e.done?e.value:s.next()}))},_(q),c(q,a,"Generator"),c(q,s,(function(){return this})),c(q,"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,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 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),S(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;S(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 D(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 I(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function s(e){D(o,r,i,s,u,"next",e)}function u(e){D(o,r,i,s,u,"throw",e)}s(void 0)}))}}var R=function(){var e=new E("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=I(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=I(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=I(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)})))},B=function(){var e=null,t=null,n=new R;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){var l=a(o,c,e,t),f=l.ajaxConfig,p=l.url;if(f.responseBatch)return this.getBatchResponse(p,f.responseBatch,f);var h=$.Deferred(),d=f.useXMLHttpRequest?u:s;return n.getResponse("GET;"+p).then((function(e){if(e){var t=i(e.etag);f.eTag=t,d(p,"GET",null,f).done((function(t,n,i){304===i.status?(null!==e.chunks&&(i["Cached-X-Total-Count"]=e.chunks),h.resolve(e.data,n,i)):(r("GET;"+p,t,i),h.resolve(t,n,i))})).fail((function(e,t){h.reject(e,t)}))}else d(p,"GET",null,f).done((function(e,t,n){r("GET;"+p,e,n),h.resolve(e,t,n)})).fail((function(e,t){h.reject(e,t)}))})).catch((function(){d(p,"GET",null,f).done((function(e,t,n){r("GET;"+p,e,n),h.resolve(e,t,n)})).fail((function(e,t){h.reject(e,t)}))})),h.promise()},this.put=function(n,r,i){var o=a(n,i,e,t),u=o.ajaxConfig;return s(o.url,"PUT",r,u)},this.post=function(n,r,i){var o=a(n,i,e,t),c=o.ajaxConfig,l=o.url;return(c.useXMLHttpRequest?u:s)(l,"POST",r,c)},this.del=function(n,r,i){var o=a(n,i,e,t),u=o.ajaxConfig,c=o.url;return r||(u.contentType=null),u.dataType=null,s(c,"DELETE",r||null,u)},this.head=function(o,u){var c=a(o,u,e,t),l=c.ajaxConfig,f=c.url;l.contentType="",l.dataType="";var p=$.Deferred();return n.getResponse("HEAD;"+f).then((function(e){if(e){var t=i(e.etag);l.eTag=t,s(f,"HEAD",null,l).done((function(e,t,n){304===n.status?p.resolve(!0,t,n):(r("HEAD;"+f,null,n),p.resolve(!1,t,n))})).fail((function(e,t){p.reject(e,t)}))}else s(f,"HEAD",null,l).done((function(e,t,n){r("HEAD;"+f,null,n),p.resolve(!1,t,n)})).fail((function(e,t){p.reject(!1,t)}))})).catch((function(){s(f,"HEAD",null,l).done((function(e,t,n){r("HEAD;"+f,null,n),p.resolve(!1,t,n)})).fail((function(e,t){p.reject(!1,t)}))})),p.promise()},this.getChunked=function(t,n){return c(this,e,"medium",t,n)},this.putChunked=function(t,n,r){return f(this,e,t,n,r)}},K=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")}},N=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)}},M=function(e){this.post=function(t){return t.runAsync=!1,e.request.post(e.getApiTeamUrl()+"services/Connexis",JSON.stringify(t))}},F=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))}},G=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)}},W=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")}},z=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)}},H=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)}},V=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")}},Q=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)}},J=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})}},Z=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)}},ee=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)}},te=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")}},ne=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)}},re=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)}},ie=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)}},oe=["topology","structure"],se=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&&oe.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&&oe.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)}},ue=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),console.debug("getTopology url: ",e.getApiTeamUrl()+"objects/"+t+"/topology","qp: ",s),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",console.debug("getGeometryGLB url: ",n,"qp: ",o),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"})}},ae=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)}},ce=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")}},le=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)}},fe=function(e){this.get=function(){return e.request.get(e.getApiUrl()+"project-actions-rights/")}},pe=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 he(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 de(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)?de(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 de(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 ge=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=he((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?"&currenttime="+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")}},me=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)}},ye=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")}},ve=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)}},be=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))}},we=function(e){this.post=function(t){return e.request.post(e.getApiTeamUrl()+"share",t)}},Te=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)}},qe=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(){return e.hackathonObjectStore.getBuildingStructure()},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)}},_e=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")}},ke=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"})}},xe=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")}},je=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)}},Pe=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")}},Ee=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)}},Oe=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,n){var r=null!=n?n:"".concat(e.getApiTeamUrl(),"invitations/");return e.request.post(r,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)}},De=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)}},Ie=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)}},Re=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")}},Be=function(e){this.post=function(t){return e.request.post(e.getApiTeamUrl()+"services/BaseQuantities",JSON.stringify(t))}},Ke=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.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)}},Ne=function(){this.getBuildingStructure=function(){var e=$.Deferred();return e.resolve({id:"8152e0c6-c452-441d-8778-0707c23fb579",children:[{id:"de6256d6-0511-4b1d-a8c4-53464e6dc42b",children:[{id:"14e81665-c9d0-4d8a-96b7-275f268e0f51",children:[{id:"06d4a57e-fa9c-472d-8f75-ebd25452e2e5",children:[{id:"aeb2fba9-c16a-4800-8143-12abe0d91431",children:[{id:"5d885c64-3ad2-4c89-8176-93f196c13a38",children:[],structureElementId:"36b4bddc-7c9b-4c8f-8e38-a67f23f94942",divisionId:"6e3d8139-047d-40ad-aaac-6b1f1d89f99f",divisionTopologyId:"455b223e-57e2-422e-a795-fc5cc44c6866",revisions:[1],parent:"aeb2fba9-c16a-4800-8143-12abe0d91431",name:"Geschosse",type:"Topology",number:0,level:5}],parent:"06d4a57e-fa9c-472d-8f75-ebd25452e2e5",name:"Geschosse",type:"TopologyStructure",number:4,level:4}],parent:"14e81665-c9d0-4d8a-96b7-275f268e0f51",name:"Gebäude",type:"TopologyStructure",number:3,level:3}],parent:"de6256d6-0511-4b1d-a8c4-53464e6dc42b",name:"Liegenschaft",type:"TopologyStructure",number:2,level:2}],parent:"8152e0c6-c452-441d-8778-0707c23fb579",name:"Columns and Walls",type:"TopologyStructure",number:1,level:1}],parent:"774783d3-57a6-47e0-86ad-7aa0394f3138",name:"Hackathon-Object-Store",type:"TopologyStructure",number:0,level:0},200),e.promise()},this.getModelObjectStructure=function(){},this.getModelGlb=function(){return{id:"846c5bba-c7c1-4e8f-a7c5-d950777982ec",children:[{id:"ba1aca9b-bb6e-4207-b7d7-f9a206cfd656",children:[{id:"6685adad-2871-4d32-87b2-331fc87d6a73",children:[{id:"a25db240-3800-49b6-866a-4079736df814",children:[{id:"bdfc1725-3067-416b-9012-0fc1b3bdc6a6",children:[{id:"ace17cf7-23ff-4ac5-a244-ada4900df1b0",children:[],name:"",type:"Column",layerid:"0f106af0-a919-44c5-b211-15bd5ef620b6",elementTypeId:"2e308afe-d078-4c20-b53c-76b2da66d848",isChild:!1,ifcId:"2Xq1ubLnL0euxIdwlhChWm"},{id:"f8bf2b69-4e1a-4f0d-99eb-b319cbc3e5c8",children:[],name:"",type:"Column",layerid:"0f106af0-a919-44c5-b211-15bd5ef620b6",elementTypeId:"2e308afe-d078-4c20-b53c-76b2da66d848",isChild:!1,ifcId:"2xBxbIImTBs9P$ij7Ygy6e"},{id:"9285a7f4-84c0-4b2c-ab1b-d8ab153c0c0b",children:[],name:"",type:"Column",layerid:"0f106af0-a919-44c5-b211-15bd5ef620b6",elementTypeId:"2e308afe-d078-4c20-b53c-76b2da66d848",isChild:!1,ifcId:"3LczFrPnTC4e$sw1h37Y$4"}],name:"Column",type:"ElementAssembly",layerid:"d625ce34-b38c-4c97-b663-3e4f26e301c8",elementTypeId:"315bc152-da91-4857-a2e1-dff14b78520c",isChild:!1,ifcId:"0_43efpXf5rRfIDZFtX5yt"},{id:"ec646f99-2104-4af1-9e20-c7f095f480b2",children:[{id:"41787c78-9a66-45c2-a759-a8a483c21dea",children:[{id:"7e2e8ba1-0273-4d90-99b8-0437c08d7df3",children:[],name:"",type:"MaterialLayer",layerid:"0f106af0-a919-44c5-b211-15bd5ef620b6",elementTypeId:"cbe76618-9ac5-4600-afa2-cfad331be043",isChild:!0,ifcId:"0pYvKo2Rz6iuMMWDNUP0jt#1"},{id:"bb2dca63-64f3-4a19-a83f-662b8e210305",children:[],name:"",type:"MaterialLayer",layerid:"0f106af0-a919-44c5-b211-15bd5ef620b6",elementTypeId:"cbe76618-9ac5-4600-afa2-cfad331be043",isChild:!0,ifcId:"0pYvKo2Rz6iuMMWDNUP0jt#2"}],name:"",type:"Wall",layerid:"0f106af0-a919-44c5-b211-15bd5ef620b6",elementTypeId:"10074eef-9418-4d64-9c6d-23932835a7f1",isChild:!1,ifcId:"0pYvKo2Rz6iuMMWDNUP0jt"},{id:"bcd5ac6c-1ba2-4ebc-8e42-de6bcac4bfe4",children:[{id:"d6c52ae6-0a6a-4e80-bfae-48b91e8855c8",children:[],name:"",type:"MaterialLayer",layerid:"0f106af0-a919-44c5-b211-15bd5ef620b6",elementTypeId:"cbe76618-9ac5-4600-afa2-cfad331be043",isChild:!0,ifcId:"1l6qL5lSj0eReTtixEyyP2#1"},{id:"2e3537ea-02c7-4d0b-8207-b3f3bcf06d91",children:[],name:"",type:"MaterialLayer",layerid:"0f106af0-a919-44c5-b211-15bd5ef620b6",elementTypeId:"cbe76618-9ac5-4600-afa2-cfad331be043",isChild:!0,ifcId:"1l6qL5lSj0eReTtixEyyP2#2"}],name:"",type:"Wall",layerid:"0f106af0-a919-44c5-b211-15bd5ef620b6",elementTypeId:"10074eef-9418-4d64-9c6d-23932835a7f1",isChild:!1,ifcId:"1l6qL5lSj0eReTtixEyyP2"}],name:"Wand 2",type:"ElementAssembly",layerid:"d625ce34-b38c-4c97-b663-3e4f26e301c8",elementTypeId:"315bc152-da91-4857-a2e1-dff14b78520c",isChild:!1,ifcId:"18MUa9Zcn0ShySvTt25D3U"}],name:"Geschosse",type:"Topology",elementTypeId:"699c3feb-d9fa-4c3a-a91a-e1615a843d76",isChild:!1,ifcId:"06ETgtwoX8$Q4QLY3eoXls"}],name:"Gebäude",type:"TopologyItem",elementTypeId:"d72696e0-6f5e-4883-a54d-f36ccb3b5f3b",isChild:!1,ifcId:"2idnokUDnCUxyoQJYKPQJ0"}],name:"Liegenschaft",type:"Site",elementTypeId:"d5dcaf7d-adb3-4bba-a4a6-2bdaba9112e4",isChild:!1,ifcId:"1NcOiUxprDXOW5oVl$1o7_"}],name:"Columns and Walls",type:"TopologyDivision",elementTypeId:"e003e080-f21b-4f8a-8c4c-4c9c5026cf50"}}};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 B,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 Pe(this),this.users=new Ee(this),this.teams=new Ue(this),this.members=new ne(this),this.projects=new ge(this),this.structures=new qe(this),this.models=new ie(this),this.objects=new ue(this),this.overlays=new ae(this),this.overlaySets=new ce(this),this.revisions=new me(this),this.elementTypes=new W(this),this.annotations=new d(this),this.attachments=new g(this),this.issues=new Z(this),this.labels=new ee(this),this.pins=new le(this),this.comments=new N(this),this.hyperlinks=new Y(this),this.importService=new J(this),this.slideshows=new Ae(this),this.slides=new Te(this),this.clashDetection=new K(this),this.clientLogs=new L(this),this.rightsService=new ye(this),this.applicationSettings=new h(this),this.exportService=new z(this),this.folders=new H(this),this.locks=new te(this),this.share=new we(this),this.messages=new re(this),this.objectFilters=new se(this),this.terms=new ke(this),this.dataProtection=new xe(this),this.dimensions=new G(this),this.imprints=new je(this),this.projectActionsRights=new fe(this),this.roles=new ve(this),this.attributeTemplates=new m(this),this.units=new Se(this),this.freeAttributes=new Q(this),this.freeAttributeGroups=new V(this),this.hiddenCalculation=new X(this),this.sectionCut=new be(this),this.projectAttributeTemplates=new pe(this),this.teamActionsRights=new _e(this),this.customTables=new F(this),this.userSettings=new Oe(this),this.invitations=new Ce(this),this.selections=new De(this),this.userGroups=new Ie(this),this.scenes=new Re(this),this.baseQuantities=new Be(this),this.workflows=new Ke(this),this.backups=new Le(this),this.connexis=new M(this),this.hackathonObjectStore=new Ne(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})()));
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 m=Object.getOwnPropertyDescriptor,g=[].slice;function y(e,t,n){return g.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 A(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)A(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:A(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 q(e){var t,n={};for(t in e)l(e,t)&&(n[t]=e[t]);return n}var _=[].concat;function U(e){return _.apply([],e)}var k="BigUint64Array,BigInt64Array,Array,Boolean,String,Date,RegExp,Blob,File,FileList,FileSystemFileHandle,FileSystemDirectoryHandle,ArrayBuffer,DataView,Uint8ClampedArray,ImageBitmap,ImageData,Map,Set,CryptoKey".split(",").concat(U([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(k.map((function(e){return i[e]}))),j=null;function S(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 P={}.toString;function E(e){return P.call(e).slice(8,-1)}var O="undefined"!=typeof Symbol?Symbol.iterator:"@@iterator",C="symbol"==typeof O?function(e){var t;return null!=e&&(t=e[O])&&t.apply(e)}:function(){return null};function I(e,t){return 0<=(t=e.indexOf(t))&&e.splice(t,1),0<=t}var D={};function R(e){var t,n,r,i;if(1===arguments.length){if(s(e))return e.slice();if(this===D&&"string"==typeof e)return[e];if(i=C(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"]),L={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 N(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(N).from(Error).extend({toString:function(){return this.name+": "+this.message}}),d(F).from(N),d(G).from(N);var W=K.reduce((function(e,t){return e[t]=t+"Error",e}),{}),z=N,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=L[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 X(){}function Y(e){return e}function Q(e,t){return null==e||e===Y?t:function(n){return t(e(n))}}function J(e,t){return function(){e.apply(this,arguments),t.apply(this,arguments)}}function Z(e,t){return e===X?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?J(r,this.onsuccess):r),i&&(this.onerror=this.onerror?J(i,this.onerror):i),void 0!==o?o:n}}function ee(e,t){return e===X?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?J(n,this.onsuccess):n),r&&(this.onerror=this.onerror?J(r,this.onerror):r)}}function te(e,t){return e===X?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?J(i,this.onsuccess):i),o&&(this.onerror=this.onerror?J(o,this.onerror):o),void 0===r?void 0===n?void 0:n:u(r,n)}}function ne(e,t){return e===X?t:function(){return!1!==t.apply(this,arguments)&&e.apply(this,arguments)}}function re(e,t){return e===X?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=N,$.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=(k="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]}(),k[0]),ce=(K=k[1],k=k[2],K=K&&K.then,ae&&ae.constructor),le=!!k,fe=function(e,t){be.push([e,t]),he&&(queueMicrotask(Se),he=!1)},pe=!0,he=!0,de=[],me=[],ge=Y,ye={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:X,pgp:!1,env:{},finalize:X},ve=ye,be=[],we=0,Te=[];function Ae(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&&Ue(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&&Pe();n&&"function"==typeof n.then?e(t,(function(e,t){n instanceof Ae?n._then(e,t):n.then(e,t)})):(t._state=!0,t._value=n,ke(t)),r&&Ee()}}),Ue.bind(null,t))}catch(n){Ue(t,n)}}(this,e)}var qe={get:function(){var e=ve,t=Le;function n(n,r){var i=this,o=!e.global&&(e!==ve||t!==Le),s=o&&!Ge(),u=new Ae((function(t,u){xe(i,new _e(Xe(n,e,o,s),Xe(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?qe:{get:function(){return e},set:qe.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 Ue(e,t){var n,r;me.push(t),null===e._state&&(n=e._lib&&Pe(),t=ge(t),e._state=!1,e._value=t,r=e,de.some((function(e){return e._value===r._value}))||de.push(r),ke(e),n&&Ee())}function ke(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&&me.length&&(me=[]),r=ie&&t._consoleTask?t._consoleTask.run((function(){return e(i)})):e(i),t._state||-1!==me.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 Se(){$e(ye,(function(){Pe()&&Ee()}))}function Pe(){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 Ce(e){return new Ae(se,!1,e)}function Ie(e,t){var n=ve;return function(){var r=Pe(),i=ve;try{return He(n,!0),e.apply(this,arguments)}catch(r){t&&t(r)}finally{He(i,!1),r&&Ee()}}}f(Ae.prototype,{then:qe,_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:Ce)(e)})):this.then(null,(function(e){return(e&&e.name===t?n:Ce)(e)}))},finally:function(e){return this.then((function(t){return Ae.resolve(e()).then((function(){return t}))}),(function(t){return Ae.resolve(e()).then((function(){return Ce(t)}))}))},timeout:function(e,t){var n=this;return e<1/0?new Ae((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(Ae.prototype,Symbol.toStringTag,"Dexie.Promise"),ye.env=Ve(),f(Ae,{all:function(){var e=R.apply(null,arguments).map(We);return new Ae((function(t,n){0===e.length&&t([]);var r=e.length;e.forEach((function(i,o){return Ae.resolve(i).then((function(n){e[o]=n,--r||t(e)}),n)}))}))},resolve:function(e){return e instanceof Ae?e:e&&"function"==typeof e.then?new Ae((function(t,n){e.then(t,n)})):new Ae(se,!0,e)},reject:Ce,race:function(){var e=R.apply(null,arguments).map(We);return new Ae((function(t,n){e.map((function(e){return Ae.resolve(e).then(t,n)}))}))},PSD:{get:function(){return ve},set:function(e){return ve=e}},totalEchoes:{get:function(){return Le}},newPSD:Me,usePSD:$e,scheduler:{get:function(){return fe},set:function(e){fe=e}},rejectionMapper:{get:function(){return ge},set:function(e){ge=e}},follow:function(e,t){return new Ae((function(n,r){return Me((function(t,n){var r=ve;r.unhandleds=[],r.onunhandled=n,r.finalize=J((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(Ae,"allSettled",(function(){var e=R.apply(null,arguments).map(We);return new Ae((function(t){0===e.length&&t([]);var n=e.length,r=new Array(n);e.forEach((function(e,i){return Ae.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(Ae,"any",(function(){var e=R.apply(null,arguments).map(We);return new Ae((function(t,n){0===e.length&&n(new AggregateError([]));var r=e.length,i=new Array(r);e.forEach((function(e,o){return Ae.resolve(e).then((function(e){return t(e)}),(function(e){i[o]=e,--r||n(new AggregateError(i))}))}))}))})),ce.withResolvers&&(Ae.withResolvers=ce.withResolvers));var De={awaits:0,echoes:0,id:0},Re=0,Be=[],Ke=0,Le=0,Ne=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=++Ne,ye.env,o.env=le?{Promise:Ae,PromiseProp:{value:Ae,configurable:!0,writable:!0},all:Ae.all,race:Ae.race,allSettled:Ae.allSettled,any:Ae.any,resolve:Ae.resolve,reject:Ae.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 De.id||(De.id=++Re),++De.awaits,De.echoes+=ue,De.id}function Ge(){return!!De.awaits&&(0==--De.awaits&&(De.id=0),De.echoes=De.awaits*ue,!0)}function We(e){return De.echoes&&e&&e.constructor===ce?(Fe(),e.then((function(e){return Ge(),e}),(function(e){return Ge(),Qe(e)}))):e}function ze(){var e=Be[Be.length-1];Be.pop(),He(e,!1)}function He(e,t){var n,r=ve;(t?!De.echoes||Ke++&&e===ve:!Ke||--Ke&&e===ve)||queueMicrotask(t?function(e){++Le,De.echoes&&0!=--De.echoes||(De.echoes=De.awaits=De.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 Xe(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 Ye(e){Promise===ce&&0===De.echoes?0===Ke?e():enqueueNativeMicroTask(e):setTimeout(e,0)}-1===(""+K).indexOf("[native code]")&&(Fe=Ge=X);var Qe=Ae.reject,Je=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=S(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=Pe();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)}))):Qe(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 Qe(new H.DatabaseClosed(t._state.dbOpenError));if(!t._state.isBeingOpened){if(!t._state.autoOpen)return Qe(new H.DatabaseClosed);t.open().catch(X)}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),Qe(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?Qe(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!==Je){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;function u(e,t){return 0===ct(e,t)}var a=t.reduce((function(t,n){var r=t[0],o=t[1],a=(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 u(a,e)}))}:function(e){return u(a,T(e,n))}):o]}),[null,null]);return r=a[0],a=a[1],r?this.where(r.name).equals(e[r.keyPath]).filter(a):n?this.filter(a):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?Ae.reject(e.failures[0]):e.lastResult})).then((function(t){if(o)try{A(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))?Qe(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?Ae.reject(e.failures[0]):e.lastResult})).then((function(t){if(o)try{A(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?Ae.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?Ae.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 A(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||X,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,Y,(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 mt(e,t){return d(t).from({prototype:e}),t}function gt(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),At(wt(e,r,n),e.algorithm,s,!e.keysOnly&&e.valueMapper)])}return At(wt(e,r,n),ot(e.algorithm,i),t,!e.keysOnly&&e.valueMapper)}function At(e,t,n,r){var i=Ie(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=X}),(function(t){e.fail(t),n=X}))||i(e.value,e,(function(e){return n=e})),n()}))}))}var qt=(_t.prototype.execute=function(e){var t=this["@@propmod"];if(void 0!==t.add){var n=t.add;if(s(n))return r(r([],s(e)?e:[],!0),n,!0).sort();if("number"==typeof n)return(Number(e)||0)+n;if("bigint"==typeof n)try{return BigInt(e)+n}catch(e){return BigInt(0)+n}throw new TypeError("Invalid term ".concat(n))}if(void 0!==t.remove){var i=t.remove;if(s(i))return s(e)?e.filter((function(e){return!i.includes(e)})).sort():[];if("number"==typeof i)return Number(e)-i;if("bigint"==typeof i)try{return BigInt(e)-i}catch(e){return BigInt(0)-i}throw new TypeError("Invalid subtrahend ".concat(i))}return(n=null===(n=t.replacePrefix)||void 0===n?void 0:n[0])&&"string"==typeof e&&e.startsWith(n)?t.replacePrefix[1]+e.substring(n.length):e},_t);function _t(e){this["@@propmod"]=e}var Ut=(kt.prototype._read=function(e,t){var n=this._ctx;return n.error?n.table._trans(null,Qe.bind(null,n.error)):n.table._trans("readonly",e).then(t)},kt.prototype._write=function(e){var t=this._ctx;return t.error?t.table._trans(null,Qe.bind(null,t.error)):t.table._trans("readwrite",e,"locked")},kt.prototype._addAlgorithm=function(e){var t=this._ctx;t.algorithm=ot(t.algorithm,e)},kt.prototype._iterate=function(e,t){return Tt(this._ctx,e,t,this._ctx.table.core)},kt.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},kt.prototype.raw=function(){return this._ctx.valueMapper=null,this},kt.prototype.each=function(e){var t=this._ctx;return this._read((function(n){return Tt(t,e,n,t.table.core)}))},kt.prototype.count=function(e){var t=this;return this._read((function(e){var n=t._ctx,r=n.table.core;if(gt(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)},kt.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 ct(o(e,i),o(t,i))*s}return this.toArray((function(e){return e.sort(u)})).then(t)},kt.prototype.toArray=function(e){var t=this;return this._read((function(e){var n=t._ctx;if("next"===n.dir&&gt(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)},kt.prototype.offset=function(e){var t=this._ctx;return e<=0||(t.offset+=e,gt(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},kt.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},kt.prototype.until=function(e,t){return yt(this._ctx,(function(n,r,i){return!e(n.value)||(r(i),t)})),this},kt.prototype.first=function(e){return this.limit(1).toArray((function(e){return e[0]})).then(e)},kt.prototype.last=function(e){return this.reverse().first(e)},kt.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},kt.prototype.and=function(e){return this.filter(e)},kt.prototype.or=function(e){return new this.db.WhereClause(this._ctx.table,e,this)},kt.prototype.reverse=function(){return this._ctx.dir="prev"===this._ctx.dir?"next":"prev",this._ondirectionchange&&this._ondirectionchange(this._ctx.dir),this},kt.prototype.desc=function(){return this.reverse()},kt.prototype.eachKey=function(e){var t=this._ctx;return t.keysOnly=!t.isMatch,this.each((function(t,n){e(n.key,n)}))},kt.prototype.eachUniqueKey=function(e){return this._ctx.unique="unique",this.eachKey(e)},kt.prototype.eachPrimaryKey=function(e){var t=this._ctx;return t.keysOnly=!t.isMatch,this.each((function(t,n){e(n.primaryKey,n)}))},kt.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)},kt.prototype.primaryKeys=function(e){var t=this._ctx;if("next"===t.dir&&gt(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)},kt.prototype.uniqueKeys=function(e){return this._ctx.unique="unique",this.keys(e)},kt.prototype.firstKey=function(e){return this.limit(1).keys((function(e){return e[0]})).then(e)},kt.prototype.lastKey=function(e){return this.reverse().firstKey(e)},kt.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},kt.prototype.modify=function(e){var t=this,n=this._ctx;return this._write((function(r){var i,s,u;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 qt?(A(t,o,u.execute(a)),n=!0):a!==u&&(A(t,o,u),n=!0)}return n});var a,c=n.table.core,l=(a=c.schema.primaryKey).outbound,f=a.extractKey,p=200;function h(e,t){var n=t.failures;t=t.numFailures,m+=e-t;for(var r=0,i=o(n);r<i.length;r++){var s=i[r];d.push(n[s])}}(a=t.db._options.modifyChunkSize)&&(p="object"==typeof a?a[c.name]||a["*"]||200:a);var d=[],m=0,g=[];return t.clone().primaryKeys().then((function(t){function i(n){var s=Math.min(p,t.length-n);return c.getMany({trans:r,keys:t.slice(n,n+s),cache:"immutable"}).then((function(a){for(var d=[],m=[],g=l?[]:null,y=[],v=0;v<s;++v){var b=a[v],w={value:S(b),primKey:t[n+v]};!1!==u.call(w,w.value,w)&&(null==w.value?y.push(t[n+v]):l||0===ct(f(b),f(w.value))?(m.push(w.value),l&&g.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);h(d.length,e)}))).then((function(){return(0<m.length||o&&"object"==typeof e)&&c.mutate({trans:r,type:"put",keys:g,values:m,criteria:o,changeSpec:"function"!=typeof e&&e,isAdditionalChunk:0<n}).then((function(e){return h(m.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 h(y.length,e)}))})).then((function(){return t.length>n+s&&i(n+p)}))}))}var o=gt(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,m,g);return t.length}))}))}))},kt.prototype.delete=function(){var e=this._ctx,t=e.range;return gt(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)},kt);function kt(){}var xt=function(e,t){return t.value=null};function jt(e,t){return e<t?-1:e===t?0:1}function St(e,t){return t<e?-1:e===t?0:1}function Pt(e,t,n){return(e=e instanceof Dt?new e.Collection(e):e)._ctx.error=new(n||TypeError)(t),e}function Et(e){return new e.Collection(e,(function(){return It("")})).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 Pt(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:St;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 Ct(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,m=h;m<f;++m){var g=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[m],a[m],s,c);null===g&&null===d?h=m+1:(null===d||0<s(d,g))&&(d=g)}return n(null!==d?function(){e.continue(d+l)}:r),!1})),e}function Ct(e,t,n,r){return{type:2,lower:e,upper:t,lowerOpen:n,upperOpen:r}}function It(e){return{type:1,lower:e,upper:e}}var Dt=(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 Ct(e,t,!n,!r)}))}catch(e){return Pt(this,Ze)}},Rt.prototype.equals=function(e){return null==e?Pt(this,Ze):new this.Collection(this,(function(){return It(e)}))},Rt.prototype.above=function(e){return null==e?Pt(this,Ze):new this.Collection(this,(function(){return Ct(e,void 0,!0)}))},Rt.prototype.aboveOrEqual=function(e){return null==e?Pt(this,Ze):new this.Collection(this,(function(){return Ct(e,void 0,!1)}))},Rt.prototype.below=function(e){return null==e?Pt(this,Ze):new this.Collection(this,(function(){return Ct(void 0,e,!1,!0)}))},Rt.prototype.belowOrEqual=function(e){return null==e?Pt(this,Ze):new this.Collection(this,(function(){return Ct(void 0,e)}))},Rt.prototype.startsWith=function(e){return"string"!=typeof e?Pt(this,et):this.between(e,e+Je,!0,!0)},Rt.prototype.startsWithIgnoreCase=function(e){return""===e?this.startsWith(e):Ot(this,(function(e,t){return 0===e.indexOf(t[0])}),[e],Je)},Rt.prototype.equalsIgnoreCase=function(e){return Ot(this,(function(e,t){return e===t[0]}),[e],"")},Rt.prototype.anyOfIgnoreCase=function(){var e=R.apply(D,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(D,arguments);return 0===e.length?Et(this):Ot(this,(function(e,t){return t.some((function(t){return 0===e.indexOf(t)}))}),e,Je)},Rt.prototype.anyOf=function(){var e=this,t=R.apply(D,arguments),n=this._cmp;try{t.sort(n)}catch(r){return Pt(this,Ze)}if(0===t.length)return Et(this);var r=new this.Collection(this,(function(){return Ct(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(D,arguments);if(0===e.length)return new this.Collection(this);try{e.sort(this._ascending)}catch(e){return Pt(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 Pt(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 Pt(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])},m=c?function(e){return 0<o(e,a[h][0])}:function(e){return 0<=o(e,a[h][0])},g=d;return(e=new this.Collection(this,(function(){return Ct(a[0][0],a[a.length-1][1],!c,!l)})))._ondirectionchange=function(e){f="next"===e?(g=d,i):(g=m,o),a.sort(p)},e._addAlgorithm((function(e,t,r){for(var o,s=e.key;g(s);)if(++h===a.length)return t(r),!1;return!d(o=s)&&!m(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(D,arguments);return e.every((function(e){return"string"==typeof e}))?0===e.length?Et(this):this.inAnyRange(e.map((function(e){return[e,e+Je]}))):Pt(this,"startsWithAnyOf() only works with strings")},Rt);function Rt(){}function Bt(e){return Ie((function(t){return Kt(t),e(t.target.error),!1}))}function Kt(e){e.stopPropagation&&e.stopPropagation(),e.preventDefault&&e.preventDefault()}var Lt="storagemutated",Nt="x-storagemutated-1",Mt=dt(null,Lt),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=Ie((function(n){Kt(n),t._reject(e.error)})),e.onabort=Ie((function(n){Kt(n),t.active&&t._reject(new H.Abort(e.error)),t.active=!1,t.on("abort").fire(n)})),e.oncomplete=Ie((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 Qe(new H.ReadOnly("Transaction is readonly"));if(!this.active)return Qe(new H.TransactionInactive);if(this._locked())return new Ae((function(i,o){r._blockedFuncs.push([function(){r._promise(e,t,n).then(i,o)},ve])}));if(n)return Me((function(){var e=new Ae((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 Ae((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=Ae.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 Ae((function(e,t){r.then((function(t){return n._waitingQueue.push(Ie(e.bind(null,t)))}),(function(e){return n._waitingQueue.push(Ie(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 Je},Je}};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 Xt(e){return[].slice.call(e)}var Yt=0;function Qt(e){return null==e?":id":"string"==typeof e?e:"[".concat(e.join("+"),"]")}function Jt(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=Ie(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 m=[],g=[],y=0;if("deleteRange"===i){if(4===u.type)return e({numFailures:y,failures:g,results:[],lastResult:void 0});3===u.type?m.push(p=c.clear()):m.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)m.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)m.push(p=c[i](v[w])),p.onerror=d}function T(t){t=t.target.result,m.forEach((function(e,t){return null!=e.error&&(g[t]=e.error)})),e({numFailures:y,failures:g,results:"delete"===i?o:m.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=Ie(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=Ie(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=Ie(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=Ie(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=Ie((function(n){var r,i,o,s,u=p.result;u?(u.___id=++Yt,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=Ie(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=Ie(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=Ie((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=Ie((function(t){return e(t.target.result)})),a.onerror=Bt(t)}))}}}var o,u,a,c=(u=n,a=Xt((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:Xt(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[Qt(e)]=r})),getIndexByKeyPath:function(e){return i[Qt(e)]}},i[":id"]=n.primaryKey,null!=t&&(i[Qt(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=Jt(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 m(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})):Ae.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=q(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=Ae.follow((function(){var e;(p=c(u))&&h&&(e=Ge.bind(null,null),p.then(e,e))})),p&&"function"==typeof p.then?Ae.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?Ae.resolve(c.shift()(u.idbtrans)).then(e):Ae.resolve()}().then((function(){cn(l,a)}))):Ae.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 Ae.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=(mn.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)}}))},mn.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},mn.prototype.upgrade=function(e){return this._cfg.contentUpgrade=re(this._cfg.contentUpgrade||X,e),this},mn);function mn(){}function gn(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},Un(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},Un(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&&An(e,i),r&&n&&An(e,r)}}function An(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 qn(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 Un(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=kn(r)),e.d=kn(e)}function kn(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]?An(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]&&qn(t[n],e[n])}))}f(wn.prototype,((K={add:function(e){return An(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 Sn={},Pn={},En=!1;function On(e){xn(Pn,e),En||(En=!0,setTimeout((function(){En=!1,Cn(Pn,!(Pn={}))}),0))}function Cn(e,t){void 0===t&&(t=!1);var n=new Set;if(e.all)for(var r=0,i=Object.values(Sn);r<i.length;r++)In(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=Sn["idb://".concat(o,"/").concat(u)])&&In(s,e,n,t))}n.forEach((function(e){return e()}))}function In(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 m=d[h];a=m[0],c=m[1],e.queries.query[a]=c}}function Dn(e){var t=e._state,n=e._deps.indexedDB;if(t.isBeingOpened||e.idbdb)return t.dbReadyPromise.then((function(){return t.dbOpenError?Qe(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 Ae((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=Ie(e._fireOnBlocked),h.onupgradeneeded=Ie((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=Ie((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=Ie((function(){f=null;var n,u,c,d,m,g=e.idbdb=h.result,v=y(g.objectStoreNames);if(0<v.length)try{var b=g.transaction(1===(d=v).length?d[0]:d,"readonly");if(t.autoSchema)u=g,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),((m=un(fn(0,(m=e).idbdb,b),m._dbSchema)).add.length||m.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."),g.close(),i=g.version+1,s=!0,r(a());en(e,b)}catch(n){}tt.push(e),g.onversionchange=Ie((function(n){t.vcFired=!0,e.on("versionchange").fire(n)})),g.onclose=Ie((function(t){e.on("close").fire(t)})),p&&(m=e._deps,b=l,g=m.indexedDB,m=m.IDBKeyRange,yn(g)||b===nt||gn(g,m).put({name:b}).catch(X)),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 Ae.reject(e)}))}var c,l=t.dbReadyResolve,f=null,p=!1;return Ae.race([r,("undefined"==typeof navigator?Ae.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=[],Ae.resolve(vn((function(){return e.on.ready.fire(e.vip)}))).then((function n(){if(0<t.onReadyBeingFired.length){var r=t.onReadyBeingFired.reduce(re,X);return t.onReadyBeingFired=[],Ae.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(),Qe(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(Lt).fire(t),Cn(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=Qt(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[Qt(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 Ln(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?Ln(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 Nn(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===X)break;return s._promise("readwrite",(function(){return p(e)}),!0);case"put":if(c.fire===X&&f.fire===X)break;return s._promise("readwrite",(function(){return p(e)}),!0);case"delete":if(a.fire===X)break;return s._promise("readwrite",(function(){return p(e)}),!0);case"deleteRange":if(a.fire===X)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||Nn(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||A(e.values[r],o.keyPath,n))):(i=Ln(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]:A(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?S(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?Ae.resolve(t):r.getMany(e).then((function(t){return e.trans._cache={keys:e.keys,values:"clone"===e.cache?S(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(t){function o(e){return e="idb://".concat(n,"/").concat(i,"/").concat(e),m[e]||(m[e]=new wn)}var l,f,p,d=t.trans,m=t.mutatedParts||(t.mutatedParts={}),g=o(""),y=o(":dels"),v=t.type,b="deleteRange"===t.type?[t.range]:"delete"===t.type?[t.keys]:t.values.length<50?[Nn(c,t).filter((function(e){return e})),t.values]:[],w=b[0],T=b[1];return b=t.trans._cache,s(w)?(g.addKeys(w),(b="delete"===v||w.length===T.length?Fn(w,b):null)||y.addKeys(w),(b||T)&&(l=o,f=b,p=T,a.indexes.forEach((function(e){var t=l(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)}(f||p).forEach((function(e,t){var i=f&&n(f[t]);0!==ct(i,t=p&&n(p[t]))&&(null!=i&&r(i),null!=t&&r(t))}))})))):w?(T={from:null!==(T=w.lower)&&void 0!==T?T:e.MIN_KEY,to:null!==(T=w.upper)&&void 0!==T?T:e.MAX_KEY},y.add(T),g.add(T)):(g.add(r),y.add(r),a.indexes.forEach((function(e){return o(e.name).add(r)}))),u.mutate(t).then((function(e){return!w||"add"!==t.type&&"put"!==t.type||(g.addKeys(e.results),h&&h.forEach((function(n){for(var r=t.values.map((function(e){return n.extractKey(e)})),i=n.keyPath.findIndex((function(e){return e===c.keyPath})),s=0,u=e.results.length;s<u;++s)r[s][i]=e.results[s];o(n.name).addKeys(r)}))),d.mutatedParts=xn(d.mutatedParts||{},m),e}))}}),m=(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(m).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=m[e](o))[0],d[1]);if(("query"===e&&s.isPrimaryKey&&!o.values?h:c(s.name||"")).add(d),!s.isPrimaryKey){if("count"!==e){var g="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 g.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 Xn(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":var m=(new wn).addKeys(t.values?e.map((function(e){return l(e)})):e);r=e.concat(t.values?i.filter((function(e){return e=l(e),!m.hasKey(e)&&(m.addKey(e),!0)})):i.map((function(e){return l(e)})).filter((function(e){return!m.hasKey(e)&&(m.addKey(e),!0)})));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 y=(new wn).addKeys(n.keys);r=e.filter((function(e){return!y.hasKey(t.values?l(e):e)}));break;case"deleteRange":var v=n.range;r=e.filter((function(e){return!$n(l(e),v)}))}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 Yn(e,t){return 0===ct(e.lower,t.lower)&&0===ct(e.upper,t.upper)&&!!e.lowerOpen==!!t.lowerOpen&&!!e.upperOpen==!!t.upperOpen}function Qn(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 Jn(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&&I(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=Sn["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,m=Object.values(f.queries.query);d<m.length;d++)for(var g=0,y=(w=m[d]).slice();g<y.length;g++)jn((T=y[g]).obsSet,u.mutatedParts)&&(I(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,A,q=0,_=(w=b[v]).slice();q<_.length;q++)null!=(T=_[q]).res&&u.mutatedParts&&(i&&!T.dirty?(A=Object.isFrozen(T.res),A=Xn(T.res,T.req,h,p,T,A),T.dirty?(I(w,T),T.subscribers.forEach((function(e){return s.add(e)}))):A!==T.res&&(T.res=A,T.promise=Ae.resolve({result:A}))):(T.dirty&&I(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||"readwrite"!==s.idbtrans.mode)return i.mutate(e);var u=Sn["idb://".concat(n,"/").concat(r)];return u?(s=i.mutate(e),"add"!==e.type&&"put"!==e.type||!(50<=e.values.length||Nn(o,e).some((function(e){return null==e})))?(u.optimisticOps.push(e),e.mutatedParts&&On(e.mutatedParts),s.then((function(t){0<t.numFailures&&(I(u.optimisticOps,e),(t=Vn(0,e,t))&&u.optimisticOps.push(t),e.mutatedParts&&On(e.mutatedParts))})),s.catch((function(){I(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 n.failures[r]||A(e=null!==(i=o.keyPath)&&void 0!==i&&i.includes(".")?S(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=Sn["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&&Yn(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)&&Qn(e.req.query.range,r.query.range)})),!1,i,o];case"count":return s=o.find((function(e){return Yn(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=S(n);return e})).catch((function(e){return f&&a&&I(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||(Sn["idb://".concat(n,"/").concat(r)]={queries:{query:{},count:{}},objs:new Map,optimisticOps:[],unsignaledParts:{}})).queries.query[e.query.index.name||""]=f)),Jn(a,f,o,s),a.promise.then((function(n){return{result:Xn(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 Ae((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(X)}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 Dn(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 Ae((function(t){e.dbReadyResolve=t})),e.openCanceller=new Ae((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 Ae((function(i,o){function s(){t.close(e);var n=t._deps.indexedDB.deleteDatabase(t.name);n.onsuccess=Ie((function(){var e,n,r;e=t._deps,n=t.name,r=e.indexedDB,e=e.IDBKeyRange,yn(r)||n===nt||gn(r,e).delete(n).catch(X),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,U(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)})):Qe(n)}var a=function e(t,n,r,i,o){return Ae.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)}))):Qe(s)}var a,c=B(o);return c&&Fe(),s=Ae.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?Ae.resolve(a).then((function(e){return u.active?e:Qe(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),Qe(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:X,dbReadyPromise:null,cancelOpen:X,openCanceller:null,autoSchema:!0,PR1398_maxLoop:3,autoOpen:n.autoOpen};l.dbReadyPromise=new Ae((function(e){l.dbReadyResolve=e})),l.openCanceller=new Ae((function(e,t){l.cancelOpen=t})),this._state=l,this.name=e,this.on=dt(this,"populate","blocked","versionchange","close",{ready:[re,X]}),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||Ae.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,mt(Ut.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!==Y?e:null}}))),this.Table=(s=this,mt(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,X],reading:[Q,Y],updating:[te,X],deleting:[ee,X]})}))),this.Transaction=(u=this,mt(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 Ae((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(),Qe(e)}))}))),this.Version=(a=this,mt(dn.prototype,(function(e){this.db=a,this._cfg={version:e,storesSource:null,dbschema:{},tables:{},contentUpgrade:null}}))),this.WhereClause=(c=this,mt(Dt.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(k){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 Ye(d)},h=function(e){xn(u,e),jn(a,u)&&p()},d=function(){var c,d,m;!s&&rr.indexedDB&&(u={},c={},i&&i.abort(),i=new AbortController,m=function(t){var n=Pe();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(m).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(Lt,h),f=!0),Ye((function(){return!s&&r.next&&r.next(e)})))}),(function(e){n=!1,["DatabaseClosedError","AbortError"].includes(null==e?void 0:e.name)||s||Ye((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),Cn(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}))})):gn(n,t).toCollection().primaryKeys()).then(e)}catch(e){return Qe(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:Ae.resolve(t)}catch(t){return Qe(t)}}},spawn:function(e,t,n){try{var r=Rn(e.apply(n,t||[]));return r&&"function"==typeof r.then?r:Ae.resolve(r)}catch(e){return Qe(e)}},currentTransaction:{get:function(){return ve.trans||null}},waitFor:function(e,t){return t=Ae.resolve("function"==typeof e?ur.ignoreTransaction(e):e).timeout(t||6e4),ve.trans?ve.trans.waitFor(t):t},Promise:Ae,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:A,delByKeyPath:function(e,t){"string"==typeof t?A(e,t,void 0):"length"in t&&[].map.call(t,(function(t){A(e,t,void 0)}))},shallowClone:q,deepClone:S,getObjectDiff:Ln,cmp:ct,asap:w,minKey:-1/0,addons:[],connections:tt,errnames:W,dependencies:rr,cache:Sn,semVer:"4.0.11",version:"4.0.11".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(Lt,(function(e){lr||(e=new CustomEvent(Nt,{detail:e}),lr=!0,dispatchEvent(e),lr=!1)})),addEventListener(Nt,(function(e){e=e.detail,lr||ar(e)})));var cr,lr=!1,fr=function(){};return"undefined"!=typeof BroadcastChannel&&((fr=function(){(cr=new BroadcastChannel(Nt)).onmessage=function(e){return e.data&&ar(e.data)}})(),"function"==typeof cr.unref&&cr.unref(),Mt(Lt,(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,[[]])}))}))),Ae.rejectionMapper=function(e,t){return!e||e instanceof N||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,PropModification:qt,replacePrefix:function(e,t){return new qt({replacePrefix:[e,t]})},add:function(e){return new qt({add:e})},remove:function(e){return new qt({remove:e})},default:tr,RangeSet:wn,mergeRanges:An,rangesOverlap:qn}),{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",m="suspendedYield",g="executing",y="completed",v={};function b(){}function w(){}function T(){}var A={};f(A,a,(function(){return this}));var q=Object.getPrototypeOf,_=q&&q(q(C([])));_&&_!==i&&o.call(_,a)&&(A=_);var U=T.prototype=b.prototype=Object.create(A);function k(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===g)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=S(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=g;var c=h(e,t,r);if("normal"===c.type){if(i=r.done?y:m,c.arg===v)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(i=y,r.method="throw",r.arg=c.arg)}}}function S(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,S(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 P(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function E(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function O(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(P,this),this.reset(!0)}function C(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(U,"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(U),e},r.awrap=function(e){return{__await:e}},k(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()}))},k(U),f(U,l,"Generator"),f(U,a,(function(){return this})),f(U,"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=C,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:C(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,t,n,r){return t||(t={}),t.token||(t.token=n),t.tokenType&&t.tokenType===r||(t.tokenType=r),t.queryParams&&(e+=function(e){var t="?";for(var n in e)Object.hasOwn(e,n)&&(t+=n+"="+e[n]+"&");return t=t.slice(0,-1)}(t.queryParams)),{ajaxConfig:t,url:e}}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,m=Math.ceil(d/p),g=0*p,y={currentChunk:0,start:g,end:Math.min(d,g+p)-1,totalChunks:m,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:()=>R,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=a(n,r,e,t),o=i.ajaxConfig,c=i.url;return null!=o&&o.useXMLHttpRequest?u(c,"GET",null,o):s(c,"GET",null,o)},this.getChunked=function(t,n){return c(this,e,"medium",t,n)},this.put=function(n,r,i){var o=a(n,i,e,t),u=o.ajaxConfig;return s(o.url,"PUT",r,u)},this.putChunked=function(t,n,r){return f(this,e,t,n,r)},this.post=function(n,r,i){var o=a(n,i,e,t),c=o.ajaxConfig,l=o.url;return null!=c&&c.useXMLHttpRequest?u(l,"POST",r,c):s(l,"POST",r,c)},this.del=function(n,r,i){var o=a(n,i,e,t),u=o.ajaxConfig,c=o.url;return r||(u.contentType=null),u.dataType=null,s(c,"DELETE",r||null,u)}},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)}},m=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)}})},this.getExchange=function(){return e.request.get(e.getApiUrl()+"external/attachments/exchange")},this.postExternalAttachment=function(t){return e.request.post(e.getApiTeamUrl()+"external/attachments/upload",t)}},g=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:A,rangesOverlap:q,RangeSet:_,cmp:U,Entity:k,PropModification:x,replacePrefix:j,add:S,remove:P}=w,E=w;function O(e){return O="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},O(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 P(r||[]);return i(s,"_invoke",{value:k(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",m="completed",g={};function y(){}function v(){}function b(){}var w={};c(w,s,(function(){return this}));var T=Object.getPrototypeOf,A=T&&T(T(E([])));A&&A!==n&&r.call(A,s)&&(w=A);var q=b.prototype=y.prototype=Object.create(w);function _(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function U(e,t){function 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"==O(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 k(t,n,r){var i=p;return function(o,s){if(i===d)throw Error("Generator is already running");if(i===m){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===g)continue;return a}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(i===p)throw i=m,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?m:h,c.arg===g)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(i=m,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")),g;var o=f(i,t.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,g;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,g):s:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,g)}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 S(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function P(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(O(t)+" is not iterable")}return v.prototype=b,i(q,"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(q),e},t.awrap=function(e){return{__await:e}},_(U.prototype),c(U.prototype,u,(function(){return this})),t.AsyncIterator=U,t.async=function(e,n,r,i,o){void 0===o&&(o=Promise);var s=new U(l(e,n,r,i),o);return t.isGeneratorFunction(n)?s:s.next().then((function(e){return e.done?e.value:s.next()}))},_(q),c(q,a,"Generator"),c(q,s,(function(){return this})),c(q,"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,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 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,g):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),g},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),S(n),g}},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;S(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),g}},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 D(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 R=function(){var e=new E("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=D(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=D(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=D(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)})))},B=function(){var e=null,t=null,n=new R;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){var l=a(o,c,e,t),f=l.ajaxConfig,p=l.url;if(f.responseBatch)return this.getBatchResponse(p,f.responseBatch,f);var h=$.Deferred(),d=f.useXMLHttpRequest?u:s;return n.getResponse("GET;"+p).then((function(e){if(e){var t=i(e.etag);f.eTag=t,d(p,"GET",null,f).done((function(t,n,i){304===i.status?(null!==e.chunks&&(i["Cached-X-Total-Count"]=e.chunks),h.resolve(e.data,n,i)):(r("GET;"+p,t,i),h.resolve(t,n,i))})).fail((function(e,t){h.reject(e,t)}))}else d(p,"GET",null,f).done((function(e,t,n){r("GET;"+p,e,n),h.resolve(e,t,n)})).fail((function(e,t){h.reject(e,t)}))})).catch((function(){d(p,"GET",null,f).done((function(e,t,n){r("GET;"+p,e,n),h.resolve(e,t,n)})).fail((function(e,t){h.reject(e,t)}))})),h.promise()},this.put=function(n,r,i){var o=a(n,i,e,t),u=o.ajaxConfig;return s(o.url,"PUT",r,u)},this.post=function(n,r,i){var o=a(n,i,e,t),c=o.ajaxConfig,l=o.url;return(c.useXMLHttpRequest?u:s)(l,"POST",r,c)},this.del=function(n,r,i){var o=a(n,i,e,t),u=o.ajaxConfig,c=o.url;return r||(u.contentType=null),u.dataType=null,s(c,"DELETE",r||null,u)},this.head=function(o,u){var c=a(o,u,e,t),l=c.ajaxConfig,f=c.url;l.contentType="",l.dataType="";var p=$.Deferred();return n.getResponse("HEAD;"+f).then((function(e){if(e){var t=i(e.etag);l.eTag=t,s(f,"HEAD",null,l).done((function(e,t,n){304===n.status?p.resolve(!0,t,n):(r("HEAD;"+f,null,n),p.resolve(!1,t,n))})).fail((function(e,t){p.reject(e,t)}))}else s(f,"HEAD",null,l).done((function(e,t,n){r("HEAD;"+f,null,n),p.resolve(!1,t,n)})).fail((function(e,t){p.reject(!1,t)}))})).catch((function(){s(f,"HEAD",null,l).done((function(e,t,n){r("HEAD;"+f,null,n),p.resolve(!1,t,n)})).fail((function(e,t){p.reject(!1,t)}))})),p.promise()},this.getChunked=function(t,n){return c(this,e,"medium",t,n)},this.putChunked=function(t,n,r){return f(this,e,t,n,r)}},K=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")}},N=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)}},M=function(e){this.post=function(t){return t.runAsync=!1,e.request.post(e.getApiTeamUrl()+"services/Connexis",JSON.stringify(t))}},F=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))}},G=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)}},W=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")}},z=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)}},H=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)}},V=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")}},X=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)}},Y=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))}},Q=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)}},J=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})}},Z=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)}},ee=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)}},te=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")}},ne=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)}},re=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)}},ie=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)}},oe=["topology","structure"],se=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&&oe.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&&oe.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)}},ue=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),console.debug("getTopology url: ",e.getApiTeamUrl()+"objects/"+t+"/topology","qp: ",s),o?e.hackathonObjectStore.getModelObjectStructure():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",console.debug("getGeometryGLB url: ",n,"qp: ",o),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"})}},ae=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)}},ce=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")}},le=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)}},fe=function(e){this.get=function(){return e.request.get(e.getApiUrl()+"project-actions-rights/")}},pe=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 he(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 de(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)?de(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 de(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=he((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?"&currenttime="+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")}},ge=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)}},ye=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")}},ve=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)}},be=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))}},we=function(e){this.post=function(t){return e.request.post(e.getApiTeamUrl()+"share",t)}},Te=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)}},qe=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(){return e.hackathonObjectStore.getBuildingStructure()},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)}},_e=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")}},ke=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"})}},xe=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")}},je=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)}},Pe=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")}},Ee=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)}},Oe=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,n){var r=null!=n?n:"".concat(e.getApiTeamUrl(),"invitations/");return e.request.post(r,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)}},De=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)}},Re=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")}},Be=function(e){this.post=function(t){return e.request.post(e.getApiTeamUrl()+"services/BaseQuantities",JSON.stringify(t))}},Ke=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.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)}},Ne=function(){this.getBuildingStructure=function(){var e=$.Deferred();return e.resolve({id:"8152e0c6-c452-441d-8778-0707c23fb579",children:[{id:"de6256d6-0511-4b1d-a8c4-53464e6dc42b",children:[{id:"14e81665-c9d0-4d8a-96b7-275f268e0f51",children:[{id:"06d4a57e-fa9c-472d-8f75-ebd25452e2e5",children:[{id:"aeb2fba9-c16a-4800-8143-12abe0d91431",children:[{id:"5d885c64-3ad2-4c89-8176-93f196c13a38",children:[],structureElementId:"36b4bddc-7c9b-4c8f-8e38-a67f23f94942",divisionId:"6e3d8139-047d-40ad-aaac-6b1f1d89f99f",divisionTopologyId:"455b223e-57e2-422e-a795-fc5cc44c6866",revisions:[1],parent:"aeb2fba9-c16a-4800-8143-12abe0d91431",name:"Geschosse",type:"Topology",number:0,level:5}],parent:"06d4a57e-fa9c-472d-8f75-ebd25452e2e5",name:"Geschosse",type:"TopologyStructure",number:4,level:4}],parent:"14e81665-c9d0-4d8a-96b7-275f268e0f51",name:"Gebäude",type:"TopologyStructure",number:3,level:3}],parent:"de6256d6-0511-4b1d-a8c4-53464e6dc42b",name:"Liegenschaft",type:"TopologyStructure",number:2,level:2}],parent:"8152e0c6-c452-441d-8778-0707c23fb579",name:"Columns and Walls",type:"TopologyStructure",number:1,level:1}],parent:"774783d3-57a6-47e0-86ad-7aa0394f3138",name:"Hackathon-Object-Store",type:"TopologyStructure",number:0,level:0},200),e.promise()},this.getModelObjectStructure=function(){var e=$.Deferred();return e.resolve({id:"455b223e-57e2-422e-a795-fc5cc44c6866",children:[{id:"4004d7e7-0066-4977-92c8-b42220f14fe2",children:[{id:"5590b747-40c5-4729-b9c9-1965a86c7b27",children:[{id:"5d885c64-3ad2-4c89-8176-93f196c13a38",children:[{id:"f767c82c-111f-45a8-b7eb-863a195658db",children:[{id:"a5fedffe-59b1-48c3-a79c-3246b808c5b3",children:[],name:"",type:"Column",layerid:"0f106af0-a919-44c5-b211-15bd5ef620b6",elementTypeId:"2e308afe-d078-4c20-b53c-76b2da66d848",isChild:!1,ifcId:"2xBxbIImTBs9P$ij7Ygy6e"},{id:"bd58115b-323d-4ff4-9ac9-8b87ca3c58aa",children:[],name:"",type:"Column",layerid:"0f106af0-a919-44c5-b211-15bd5ef620b6",elementTypeId:"2e308afe-d078-4c20-b53c-76b2da66d848",isChild:!1,ifcId:"3LczFrPnTC4e$sw1h37Y$4"},{id:"d405cb0b-be3d-4b36-9f0b-e14bb05a8a79",children:[],name:"",type:"Column",layerid:"0f106af0-a919-44c5-b211-15bd5ef620b6",elementTypeId:"2e308afe-d078-4c20-b53c-76b2da66d848",isChild:!1,ifcId:"2Xq1ubLnL0euxIdwlhChWm"}],name:"Column",type:"ElementAssembly",layerid:"d625ce34-b38c-4c97-b663-3e4f26e301c8",elementTypeId:"315bc152-da91-4857-a2e1-dff14b78520c",isChild:!1,ifcId:"0_43efpXf5rRfIDZFtX5yt"},{id:"c3629392-c6bd-4bd8-851a-d13a6ef04f3e",children:[{id:"b97e0fb7-2868-4070-a983-2fbfdcee16e3",children:[{id:"b83b5c8a-5984-43b3-8bd8-fe2f90c4e481",children:[],name:"",type:"MaterialLayer",layerid:"0f106af0-a919-44c5-b211-15bd5ef620b6",elementTypeId:"cbe76618-9ac5-4600-afa2-cfad331be043",isChild:!0,ifcId:"1l6qL5lSj0eReTtixEyyP2#1"},{id:"fd821904-91ec-4342-9e8a-571986374dd4",children:[],name:"",type:"MaterialLayer",layerid:"0f106af0-a919-44c5-b211-15bd5ef620b6",elementTypeId:"cbe76618-9ac5-4600-afa2-cfad331be043",isChild:!0,ifcId:"1l6qL5lSj0eReTtixEyyP2#2"}],name:"",type:"Wall",layerid:"0f106af0-a919-44c5-b211-15bd5ef620b6",elementTypeId:"10074eef-9418-4d64-9c6d-23932835a7f1",isChild:!1,ifcId:"1l6qL5lSj0eReTtixEyyP2"},{id:"eec3b01b-6b47-4943-b60f-6ab154e1e18f",children:[{id:"92e5f2d2-480b-4b36-a819-dba13ca97fa4",children:[],name:"",type:"MaterialLayer",layerid:"0f106af0-a919-44c5-b211-15bd5ef620b6",elementTypeId:"cbe76618-9ac5-4600-afa2-cfad331be043",isChild:!0,ifcId:"0pYvKo2Rz6iuMMWDNUP0jt#1"},{id:"a0c0eb86-1f8b-44af-b23c-bcb2e35d23ff",children:[],name:"",type:"MaterialLayer",layerid:"0f106af0-a919-44c5-b211-15bd5ef620b6",elementTypeId:"cbe76618-9ac5-4600-afa2-cfad331be043",isChild:!0,ifcId:"0pYvKo2Rz6iuMMWDNUP0jt#2"}],name:"",type:"Wall",layerid:"0f106af0-a919-44c5-b211-15bd5ef620b6",elementTypeId:"10074eef-9418-4d64-9c6d-23932835a7f1",isChild:!1,ifcId:"0pYvKo2Rz6iuMMWDNUP0jt"}],name:"Wand 2",type:"ElementAssembly",layerid:"d625ce34-b38c-4c97-b663-3e4f26e301c8",elementTypeId:"315bc152-da91-4857-a2e1-dff14b78520c",isChild:!1,ifcId:"18MUa9Zcn0ShySvTt25D3U"}],name:"Geschosse",type:"Topology",elementTypeId:"699c3feb-d9fa-4c3a-a91a-e1615a843d76",isChild:!1,ifcId:"06ETgtwoX8$Q4QLY3eoXls"}],name:"Gebäude",type:"TopologyItem",elementTypeId:"d72696e0-6f5e-4883-a54d-f36ccb3b5f3b",isChild:!1,ifcId:"2idnokUDnCUxyoQJYKPQJ0"}],name:"Liegenschaft",type:"Site",elementTypeId:"d5dcaf7d-adb3-4bba-a4a6-2bdaba9112e4",isChild:!1,ifcId:"1NcOiUxprDXOW5oVl$1o7_"}],name:"Columns and Walls",type:"TopologyDivision",elementTypeId:"e003e080-f21b-4f8a-8c4c-4c9c5026cf50"},200),e.promise()},this.getModelGlb=function(){return{id:"846c5bba-c7c1-4e8f-a7c5-d950777982ec",children:[{id:"ba1aca9b-bb6e-4207-b7d7-f9a206cfd656",children:[{id:"6685adad-2871-4d32-87b2-331fc87d6a73",children:[{id:"a25db240-3800-49b6-866a-4079736df814",children:[{id:"bdfc1725-3067-416b-9012-0fc1b3bdc6a6",children:[{id:"ace17cf7-23ff-4ac5-a244-ada4900df1b0",children:[],name:"",type:"Column",layerid:"0f106af0-a919-44c5-b211-15bd5ef620b6",elementTypeId:"2e308afe-d078-4c20-b53c-76b2da66d848",isChild:!1,ifcId:"2Xq1ubLnL0euxIdwlhChWm"},{id:"f8bf2b69-4e1a-4f0d-99eb-b319cbc3e5c8",children:[],name:"",type:"Column",layerid:"0f106af0-a919-44c5-b211-15bd5ef620b6",elementTypeId:"2e308afe-d078-4c20-b53c-76b2da66d848",isChild:!1,ifcId:"2xBxbIImTBs9P$ij7Ygy6e"},{id:"9285a7f4-84c0-4b2c-ab1b-d8ab153c0c0b",children:[],name:"",type:"Column",layerid:"0f106af0-a919-44c5-b211-15bd5ef620b6",elementTypeId:"2e308afe-d078-4c20-b53c-76b2da66d848",isChild:!1,ifcId:"3LczFrPnTC4e$sw1h37Y$4"}],name:"Column",type:"ElementAssembly",layerid:"d625ce34-b38c-4c97-b663-3e4f26e301c8",elementTypeId:"315bc152-da91-4857-a2e1-dff14b78520c",isChild:!1,ifcId:"0_43efpXf5rRfIDZFtX5yt"},{id:"ec646f99-2104-4af1-9e20-c7f095f480b2",children:[{id:"41787c78-9a66-45c2-a759-a8a483c21dea",children:[{id:"7e2e8ba1-0273-4d90-99b8-0437c08d7df3",children:[],name:"",type:"MaterialLayer",layerid:"0f106af0-a919-44c5-b211-15bd5ef620b6",elementTypeId:"cbe76618-9ac5-4600-afa2-cfad331be043",isChild:!0,ifcId:"0pYvKo2Rz6iuMMWDNUP0jt#1"},{id:"bb2dca63-64f3-4a19-a83f-662b8e210305",children:[],name:"",type:"MaterialLayer",layerid:"0f106af0-a919-44c5-b211-15bd5ef620b6",elementTypeId:"cbe76618-9ac5-4600-afa2-cfad331be043",isChild:!0,ifcId:"0pYvKo2Rz6iuMMWDNUP0jt#2"}],name:"",type:"Wall",layerid:"0f106af0-a919-44c5-b211-15bd5ef620b6",elementTypeId:"10074eef-9418-4d64-9c6d-23932835a7f1",isChild:!1,ifcId:"0pYvKo2Rz6iuMMWDNUP0jt"},{id:"bcd5ac6c-1ba2-4ebc-8e42-de6bcac4bfe4",children:[{id:"d6c52ae6-0a6a-4e80-bfae-48b91e8855c8",children:[],name:"",type:"MaterialLayer",layerid:"0f106af0-a919-44c5-b211-15bd5ef620b6",elementTypeId:"cbe76618-9ac5-4600-afa2-cfad331be043",isChild:!0,ifcId:"1l6qL5lSj0eReTtixEyyP2#1"},{id:"2e3537ea-02c7-4d0b-8207-b3f3bcf06d91",children:[],name:"",type:"MaterialLayer",layerid:"0f106af0-a919-44c5-b211-15bd5ef620b6",elementTypeId:"cbe76618-9ac5-4600-afa2-cfad331be043",isChild:!0,ifcId:"1l6qL5lSj0eReTtixEyyP2#2"}],name:"",type:"Wall",layerid:"0f106af0-a919-44c5-b211-15bd5ef620b6",elementTypeId:"10074eef-9418-4d64-9c6d-23932835a7f1",isChild:!1,ifcId:"1l6qL5lSj0eReTtixEyyP2"}],name:"Wand 2",type:"ElementAssembly",layerid:"d625ce34-b38c-4c97-b663-3e4f26e301c8",elementTypeId:"315bc152-da91-4857-a2e1-dff14b78520c",isChild:!1,ifcId:"18MUa9Zcn0ShySvTt25D3U"}],name:"Geschosse",type:"Topology",elementTypeId:"699c3feb-d9fa-4c3a-a91a-e1615a843d76",isChild:!1,ifcId:"06ETgtwoX8$Q4QLY3eoXls"}],name:"Gebäude",type:"TopologyItem",elementTypeId:"d72696e0-6f5e-4883-a54d-f36ccb3b5f3b",isChild:!1,ifcId:"2idnokUDnCUxyoQJYKPQJ0"}],name:"Liegenschaft",type:"Site",elementTypeId:"d5dcaf7d-adb3-4bba-a4a6-2bdaba9112e4",isChild:!1,ifcId:"1NcOiUxprDXOW5oVl$1o7_"}],name:"Columns and Walls",type:"TopologyDivision",elementTypeId:"e003e080-f21b-4f8a-8c4c-4c9c5026cf50"}}};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 B,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 Pe(this),this.users=new Ee(this),this.teams=new Ue(this),this.members=new ne(this),this.projects=new me(this),this.structures=new qe(this),this.models=new ie(this),this.objects=new ue(this),this.overlays=new ae(this),this.overlaySets=new ce(this),this.revisions=new ge(this),this.elementTypes=new W(this),this.annotations=new d(this),this.attachments=new m(this),this.issues=new Z(this),this.labels=new ee(this),this.pins=new le(this),this.comments=new N(this),this.hyperlinks=new Q(this),this.importService=new J(this),this.slideshows=new Ae(this),this.slides=new Te(this),this.clashDetection=new K(this),this.clientLogs=new L(this),this.rightsService=new ye(this),this.applicationSettings=new h(this),this.exportService=new z(this),this.folders=new H(this),this.locks=new te(this),this.share=new we(this),this.messages=new re(this),this.objectFilters=new se(this),this.terms=new ke(this),this.dataProtection=new xe(this),this.dimensions=new G(this),this.imprints=new je(this),this.projectActionsRights=new fe(this),this.roles=new ve(this),this.attributeTemplates=new g(this),this.units=new Se(this),this.freeAttributes=new X(this),this.freeAttributeGroups=new V(this),this.hiddenCalculation=new Y(this),this.sectionCut=new be(this),this.projectAttributeTemplates=new pe(this),this.teamActionsRights=new _e(this),this.customTables=new F(this),this.userSettings=new Oe(this),this.invitations=new Ce(this),this.selections=new Ie(this),this.userGroups=new De(this),this.scenes=new Re(this),this.baseQuantities=new Be(this),this.workflows=new Ke(this),this.backups=new Le(this),this.connexis=new M(this),this.hackathonObjectStore=new Ne(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.50-hackathon-object-store01",
3
+ "version": "1.0.50-hackathon-object-store02",
4
4
  "description": "bim+ websdk",
5
5
  "types": "types/bimplus-websdk.d.ts",
6
6
  "keywords": [