arangojs 7.8.0 → 8.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +264 -3
- package/CONTRIBUTING.md +1 -1
- package/MIGRATING.md +126 -2
- package/README.md +7 -13
- package/analyzer.d.ts +531 -253
- package/analyzer.d.ts.map +1 -1
- package/analyzer.js +9 -8
- package/analyzer.js.map +1 -1
- package/aql.d.ts +122 -139
- package/aql.d.ts.map +1 -1
- package/aql.js +146 -148
- package/aql.js.map +1 -1
- package/collection.d.ts +311 -310
- package/collection.d.ts.map +1 -1
- package/collection.js +163 -96
- package/collection.js.map +1 -1
- package/connection.d.ts +65 -52
- package/connection.d.ts.map +1 -1
- package/connection.js +142 -140
- package/connection.js.map +1 -1
- package/cursor.d.ts +108 -26
- package/cursor.d.ts.map +1 -1
- package/cursor.js +24 -23
- package/cursor.js.map +1 -1
- package/database.d.ts +298 -330
- package/database.d.ts.map +1 -1
- package/database.js +178 -252
- package/database.js.map +1 -1
- package/documents.d.ts +3 -4
- package/documents.d.ts.map +1 -1
- package/documents.js +0 -1
- package/documents.js.map +1 -1
- package/error.d.ts +3 -6
- package/error.d.ts.map +1 -1
- package/error.js +5 -7
- package/error.js.map +1 -1
- package/foxx-manifest.d.ts +7 -8
- package/foxx-manifest.d.ts.map +1 -1
- package/foxx-manifest.js +1 -1
- package/foxx-manifest.js.map +1 -1
- package/graph.d.ts +38 -56
- package/graph.d.ts.map +1 -1
- package/graph.js +59 -63
- package/graph.js.map +1 -1
- package/index.d.ts +6 -8
- package/index.d.ts.map +1 -1
- package/index.js +1 -6
- package/index.js.map +1 -1
- package/indexes.d.ts +348 -127
- package/indexes.d.ts.map +1 -1
- package/indexes.js +1 -3
- package/indexes.js.map +1 -1
- package/lib/blob.d.ts +0 -2
- package/lib/blob.d.ts.map +1 -1
- package/lib/blob.js +0 -1
- package/lib/blob.js.map +1 -1
- package/lib/btoa.d.ts +1 -3
- package/lib/btoa.d.ts.map +1 -1
- package/lib/btoa.js +3 -5
- package/lib/btoa.js.map +1 -1
- package/lib/btoa.web.d.ts +1 -3
- package/lib/btoa.web.d.ts.map +1 -1
- package/lib/btoa.web.js +4 -6
- package/lib/btoa.web.js.map +1 -1
- package/lib/codes.d.ts +2 -2
- package/lib/codes.d.ts.map +1 -1
- package/lib/codes.js +3 -3
- package/lib/codes.js.map +1 -1
- package/lib/errback.d.ts +0 -2
- package/lib/errback.d.ts.map +1 -1
- package/lib/errback.js.map +1 -1
- package/lib/joinPath.d.ts +0 -2
- package/lib/joinPath.d.ts.map +1 -1
- package/lib/joinPath.js +0 -2
- package/lib/joinPath.js.map +1 -1
- package/lib/joinPath.web.d.ts +1 -3
- package/lib/joinPath.web.d.ts.map +1 -1
- package/lib/joinPath.web.js +7 -4
- package/lib/joinPath.web.js.map +1 -1
- package/lib/multipart.d.ts +0 -4
- package/lib/multipart.d.ts.map +1 -1
- package/lib/multipart.js +16 -37
- package/lib/multipart.js.map +1 -1
- package/lib/multipart.web.d.ts +0 -2
- package/lib/multipart.web.d.ts.map +1 -1
- package/lib/multipart.web.js +0 -2
- package/lib/multipart.web.js.map +1 -1
- package/lib/normalizeUrl.d.ts +0 -2
- package/lib/normalizeUrl.d.ts.map +1 -1
- package/lib/normalizeUrl.js +0 -2
- package/lib/normalizeUrl.js.map +1 -1
- package/lib/omit.d.ts +1 -3
- package/lib/omit.d.ts.map +1 -1
- package/lib/omit.js +1 -2
- package/lib/omit.js.map +1 -1
- package/lib/querystringify.d.ts +4 -0
- package/lib/querystringify.d.ts.map +1 -0
- package/lib/querystringify.js +20 -0
- package/lib/querystringify.js.map +1 -0
- package/lib/querystringify.web.d.ts +2 -0
- package/lib/querystringify.web.d.ts.map +1 -0
- package/lib/querystringify.web.js +30 -0
- package/lib/querystringify.web.js.map +1 -0
- package/lib/request.d.ts +0 -1
- package/lib/request.d.ts.map +1 -1
- package/lib/request.js +6 -3
- package/lib/request.js.map +1 -1
- package/lib/request.node.d.ts +2 -8
- package/lib/request.node.d.ts.map +1 -1
- package/lib/request.node.js +16 -7
- package/lib/request.node.js.map +1 -1
- package/lib/request.web.d.ts +2 -3
- package/lib/request.web.d.ts.map +1 -1
- package/lib/request.web.js +26 -29
- package/lib/request.web.js.map +1 -1
- package/lib/xhr.d.ts +1 -3
- package/lib/xhr.d.ts.map +1 -1
- package/lib/xhr.js +0 -2
- package/lib/xhr.js.map +1 -1
- package/package.json +5 -6
- package/route.d.ts +1 -2
- package/route.d.ts.map +1 -1
- package/route.js +1 -2
- package/route.js.map +1 -1
- package/transaction.d.ts +31 -6
- package/transaction.d.ts.map +1 -1
- package/transaction.js +13 -6
- package/transaction.js.map +1 -1
- package/view.d.ts +237 -181
- package/view.d.ts.map +1 -1
- package/view.js +17 -25
- package/view.js.map +1 -1
- package/web.js +1 -1
- package/web.js.map +1 -1
- package/lib/error.d.ts +0 -18
- package/lib/error.d.ts.map +0 -1
- package/lib/error.js +0 -18
- package/lib/error.js.map +0 -1
package/web.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.arangojs=t():e.arangojs=t()}(window,(function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=14)}([function(e,t,r){"use strict";r.r(t),r.d(t,"isArangoCollection",(function(){return x})),r.d(t,"collectionToString",(function(){return j})),r.d(t,"CollectionType",(function(){return f})),r.d(t,"CollectionStatus",(function(){return p})),r.d(t,"Collection",(function(){return R}));var n=r(5),o=r(2),i=r(1);function a(e){return function(e){if(Array.isArray(e))return c(e)}(e)||l(e)||s(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function u(e){return function(e){if(Array.isArray(e))return e}(e)||l(e)||s(e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(e,t){if(e){if("string"==typeof e)return c(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?c(e,t):void 0}}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function l(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function h(e,t){if("string"!=typeof e){if(e.id)return h(e.id,t);throw new Error("Index handle must be a string or an object with an id attribute")}if(e.includes("/")){var r=u(e.split("/")),n=r[0],o=r.slice(1),i=n.normalize("NFC");if(i!==t)throw new Error('Index ID "'.concat(e,'" does not match collection name "').concat(t,'"'));return[i].concat(a(o)).join("/")}return"".concat(t,"/").concat(e)}var f,p,d=r(3),y=["waitForSyncReplication","enforceReplicationFactor"],v=["index"];function m(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function b(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?m(Object(r),!0).forEach((function(t){O(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):m(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function g(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function w(e,t,r,n,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void r(e)}u.done?t(s):Promise.resolve(s).then(n,o)}function _(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(e){w(i,n,o,a,u,"next",e)}function u(e){w(i,n,o,a,u,"throw",e)}a(void 0)}))}}function k(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function O(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function x(e){return Boolean(e&&e.isArangoCollection)}function j(e){return x(e)?String(e.name):String(e).normalize("NFC")}!function(e){e[e.DOCUMENT_COLLECTION=2]="DOCUMENT_COLLECTION",e[e.EDGE_COLLECTION=3]="EDGE_COLLECTION"}(f||(f={})),function(e){e[e.NEWBORN=1]="NEWBORN",e[e.UNLOADED=2]="UNLOADED",e[e.LOADED=3]="LOADED",e[e.UNLOADING=4]="UNLOADING",e[e.DELETED=5]="DELETED",e[e.LOADING=6]="LOADING"}(p||(p={}));var R=function(){function e(t,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),O(this,"_name",void 0),O(this,"_db",void 0),this._name=r.normalize("NFC"),this._db=t}var t,r,a,u,s,c,l,f,p,m;return t=e,(r=[{key:"_get",value:function(e,t){return this._db.request({path:"/_api/collection/".concat(encodeURIComponent(this._name),"/").concat(e),qs:t},(function(e){return e.body}))}},{key:"_put",value:function(e,t){return this._db.request({method:"PUT",path:"/_api/collection/".concat(encodeURIComponent(this._name),"/").concat(e),body:t},(function(e){return e.body}))}},{key:"isArangoCollection",get:function(){return!0}},{key:"name",get:function(){return this._name}},{key:"get",value:function(){return this._db.request({path:"/_api/collection/".concat(encodeURIComponent(this._name))},(function(e){return e.body}))}},{key:"exists",value:(m=_(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.get();case 3:return e.abrupt("return",!0);case 6:if(e.prev=6,e.t0=e.catch(0),!Object(i.c)(e.t0)||e.t0.errorNum!==d.b){e.next=10;break}return e.abrupt("return",!1);case 10:throw e.t0;case 11:case"end":return e.stop()}}),e,this,[[0,6]])}))),function(){return m.apply(this,arguments)})},{key:"create",value:function(e){var t=e||{},r=t.waitForSyncReplication,n=void 0===r?void 0:r,o=t.enforceReplicationFactor,i=void 0===o?void 0:o,a=g(t,y),u={};return"boolean"==typeof n&&(u.waitForSyncReplication=n?1:0),"boolean"==typeof i&&(u.enforceReplicationFactor=i?1:0),this._db.request({method:"POST",path:"/_api/collection",qs:u,body:b(b({},a),{},{name:this._name})},(function(e){return e.body}))}},{key:"properties",value:function(e){function t(t){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}((function(e){return e?this._put("properties",e):this._get("properties")}))},{key:"count",value:function(){return this._get("count")}},{key:"recalculateCount",value:(p=_(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._put("recalculateCount");case 2:return t=e.sent,e.abrupt("return",t.result);case 4:case"end":return e.stop()}}),e,this)}))),function(){return p.apply(this,arguments)})},{key:"figures",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this._db.request({path:"/_api/collection/".concat(encodeURIComponent(this._name),"/figures"),qs:{details:e}})}},{key:"revision",value:function(){return this._get("revision")}},{key:"checksum",value:function(e){return this._get("checksum",e)}},{key:"load",value:function(e){return this._put("load","boolean"==typeof e?{count:e}:void 0)}},{key:"loadIndexes",value:(f=_(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._put("loadIndexesIntoMemory");case 2:return t=e.sent,e.abrupt("return",t.result);case 4:case"end":return e.stop()}}),e,this)}))),function(){return f.apply(this,arguments)})},{key:"unload",value:function(){return this._put("unload")}},{key:"rename",value:(l=_(regeneratorRuntime.mark((function e(t){var r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._db.renameCollection(this._name,t);case 2:return r=e.sent,this._name=t.normalize("NFC"),e.abrupt("return",r);case 5:case"end":return e.stop()}}),e,this)}))),function(e){return l.apply(this,arguments)})},{key:"rotate",value:(c=_(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._put("rotate");case 2:return t=e.sent,e.abrupt("return",t.result);case 4:case"end":return e.stop()}}),e,this)}))),function(){return c.apply(this,arguments)})},{key:"truncate",value:function(){return this._put("truncate")}},{key:"drop",value:function(e){return this._db.request({method:"DELETE",path:"/_api/collection/".concat(encodeURIComponent(this._name)),qs:e},(function(e){return e.body}))}},{key:"getResponsibleShard",value:function(e){return this._db.request({method:"PUT",path:"/_api/collection/".concat(encodeURIComponent(this._name),"/responsibleShard"),body:e},(function(e){return e.body.shardId}))}},{key:"documentId",value:function(e){return Object(o.a)(e,this._name)}},{key:"documentExists",value:(s=_(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this._db.request({method:"HEAD",path:"/_api/document/".concat(encodeURI(Object(o.a)(t,this._name)))},(function(){return!0}));case 3:return e.abrupt("return",e.sent);case 6:if(e.prev=6,e.t0=e.catch(0),404!==e.t0.code){e.next=10;break}return e.abrupt("return",!1);case 10:throw e.t0;case 11:case"end":return e.stop()}}),e,this,[[0,6]])}))),function(e){return s.apply(this,arguments)})},{key:"documents",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.allowDirtyRead,n=void 0===r?void 0:r;return this._db.request({method:"PUT",path:"/_api/document/".concat(encodeURIComponent(this._name)),qs:{onlyget:!0},allowDirtyRead:n,body:e},(function(e){return e.body}))}},{key:"document",value:(u=_(regeneratorRuntime.mark((function e(t){var r,n,a,u,s,c,l,h=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("boolean"==typeof(r=h.length>1&&void 0!==h[1]?h[1]:{})&&(r={graceful:r}),a=(n=r).allowDirtyRead,u=void 0===a?void 0:a,s=n.graceful,c=void 0!==s&&s,l=this._db.request({path:"/_api/document/".concat(encodeURI(Object(o.a)(t,this._name))),allowDirtyRead:u},(function(e){return e.body})),c){e.next=6;break}return e.abrupt("return",l);case 6:return e.prev=6,e.next=9,l;case 9:return e.abrupt("return",e.sent);case 12:if(e.prev=12,e.t0=e.catch(6),!Object(i.c)(e.t0)||e.t0.errorNum!==d.d){e.next=16;break}return e.abrupt("return",null);case 16:throw e.t0;case 17:case"end":return e.stop()}}),e,this,[[6,12]])}))),function(e){return u.apply(this,arguments)})},{key:"save",value:function(e,t){return this._db.request({method:"POST",path:"/_api/document/".concat(encodeURIComponent(this._name)),body:e,qs:t},(function(e){return t&&t.silent?void 0:e.body}))}},{key:"saveAll",value:function(e,t){return this._db.request({method:"POST",path:"/_api/document/".concat(encodeURIComponent(this._name)),body:e,qs:t},(function(e){return t&&t.silent?void 0:e.body}))}},{key:"replace",value:function(e,t,r){return this._db.request({method:"PUT",path:"/_api/document/".concat(encodeURI(Object(o.a)(e,this._name))),body:t,qs:r},(function(e){return r&&r.silent?void 0:e.body}))}},{key:"replaceAll",value:function(e,t){return this._db.request({method:"PUT",path:"/_api/document/".concat(encodeURIComponent(this._name)),body:e,qs:t},(function(e){return t&&t.silent?void 0:e.body}))}},{key:"update",value:function(e,t,r){return this._db.request({method:"PATCH",path:"/_api/document/".concat(encodeURI(Object(o.a)(e,this._name))),body:t,qs:r},(function(e){return r&&r.silent?void 0:e.body}))}},{key:"updateAll",value:function(e,t){return this._db.request({method:"PATCH",path:"/_api/document/".concat(encodeURIComponent(this._name)),body:e,qs:t},(function(e){return t&&t.silent?void 0:e.body}))}},{key:"remove",value:function(e,t){return this._db.request({method:"DELETE",path:"/_api/document/".concat(encodeURI(Object(o.a)(e,this._name))),qs:t},(function(e){return t&&t.silent?void 0:e.body}))}},{key:"removeAll",value:function(e,t){var r=this;return this._db.request({method:"DELETE",path:"/_api/document/".concat(encodeURIComponent(this._name)),body:e.map((function(e){return Object(o.a)(e,r._name)})),qs:t},(function(e){return t&&t.silent?void 0:e.body}))}},{key:"import",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=b(b({},t),{},{collection:this._name});if(Array.isArray(e)){r.type=Array.isArray(e[0])?void 0:"documents";var n=e;e=n.map((function(e){return JSON.stringify(e)})).join("\r\n")+"\r\n"}return this._db.request({method:"POST",path:"/_api/import",body:e,isBinary:!0,qs:r},(function(e){return e.body}))}},{key:"_edges",value:function(e,t){return this._db.request({path:"/_api/edges/".concat(encodeURIComponent(this._name)),qs:{direction:t,vertex:Object(o.a)(e,this._name,!1)}},(function(e){return e.body}))}},{key:"edges",value:function(e){return this._edges(e)}},{key:"inEdges",value:function(e){return this._edges(e,"in")}},{key:"outEdges",value:function(e){return this._edges(e,"out")}},{key:"traversal",value:function(e,t){return this._db.request({method:"POST",path:"/_api/traversal",body:b(b({},t),{},{startVertex:e,edgeCollection:this._name})},(function(e){return e.body.result}))}},{key:"list",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"id";return this._db.request({method:"PUT",path:"/_api/simple/all-keys",body:{type:t,collection:this._name}},(function(t){return new n.a(e._db,t.body,t.arangojsHostId).items}))}},{key:"all",value:function(e){var t=this;return this._db.request({method:"PUT",path:"/_api/simple/all",body:b(b({},e),{},{collection:this._name})},(function(e){return new n.a(t._db,e.body,e.arangojsHostId).items}))}},{key:"any",value:function(){return this._db.request({method:"PUT",path:"/_api/simple/any",body:{collection:this._name}},(function(e){return e.body.document}))}},{key:"byExample",value:function(e,t){var r=this;return this._db.request({method:"PUT",path:"/_api/simple/by-example",body:b(b({},t),{},{example:e,collection:this._name})},(function(e){return new n.a(r._db,e.body,e.arangojsHostId).items}))}},{key:"firstExample",value:function(e){return this._db.request({method:"PUT",path:"/_api/simple/first-example",body:{example:e,collection:this._name}},(function(e){return e.body.document}))}},{key:"removeByExample",value:function(e,t){return this._db.request({method:"PUT",path:"/_api/simple/remove-by-example",body:b(b({},t),{},{example:e,collection:this._name})},(function(e){return e.body}))}},{key:"replaceByExample",value:function(e,t,r){return this._db.request({method:"PUT",path:"/_api/simple/replace-by-example",body:b(b({},r),{},{example:e,newValue:t,collection:this._name})},(function(e){return e.body}))}},{key:"updateByExample",value:function(e,t,r){return this._db.request({method:"PUT",path:"/_api/simple/update-by-example",body:b(b({},r),{},{example:e,newValue:t,collection:this._name})},(function(e){return e.body}))}},{key:"lookupByKeys",value:function(e){return this._db.request({method:"PUT",path:"/_api/simple/lookup-by-keys",body:{keys:e,collection:this._name}},(function(e){return e.body.documents}))}},{key:"removeByKeys",value:function(e,t){return this._db.request({method:"PUT",path:"/_api/simple/remove-by-keys",body:{options:t,keys:e,collection:this._name}},(function(e){return e.body}))}},{key:"indexes",value:function(){return this._db.request({path:"/_api/index",qs:{collection:this._name}},(function(e){return e.body.indexes}))}},{key:"index",value:function(e){return this._db.request({path:"/_api/index/".concat(encodeURI(h(e,this._name)))},(function(e){return e.body}))}},{key:"ensureIndex",value:function(e){return this._db.request({method:"POST",path:"/_api/index",body:e,qs:{collection:this._name}},(function(e){return e.body}))}},{key:"dropIndex",value:function(e){return this._db.request({method:"DELETE",path:"/_api/index/".concat(encodeURI(h(e,this._name)))},(function(e){return e.body}))}},{key:"fulltext",value:function(e,t){var r=this,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=o.index,a=g(o,v);return this._db.request({method:"PUT",path:"/_api/simple/fulltext",body:b(b({},a),{},{index:i?h(i,this._name):void 0,attribute:e,query:t,collection:this._name})},(function(e){return new n.a(r._db,e.body,e.arangojsHostId).items}))}},{key:"compact",value:function(){return this._db.request({method:"PUT",path:"/_api/collection/".concat(this._name,"/compact")},(function(e){return e.body}))}}])&&k(t.prototype,r),a&&k(t,a),Object.defineProperty(t,"prototype",{writable:!1}),e}()},function(e,t,r){"use strict";r.d(t,"c",(function(){return w})),r.d(t,"d",(function(){return _})),r.d(t,"e",(function(){return k})),r.d(t,"a",(function(){return O})),r.d(t,"b",(function(){return x}));var n=r(18),o=n.default||n;function i(e){return(i="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)}function a(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return u(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return u(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw i}}}}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function c(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function l(e,t,r){return t&&c(e.prototype,t),r&&c(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function h(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&f(e,t)}function f(e,t){return(f=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function p(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=v(e);if(t){var o=v(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return d(this,r)}}function d(e,t){if(t&&("object"===i(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return y(e)}function y(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function v(e){return(v=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function m(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var b={0:"Network Error",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Payload Too Large",414:"Request-URI Too Long",415:"Unsupported Media Type",416:"Requested Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",421:"Misdirected Request",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",444:"Connection Closed Without Response",451:"Unavailable For Legal Reasons",499:"Client Closed Request",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",510:"Not Extended",511:"Network Authentication Required",599:"Network Connect Timeout Error"},g=["fileName","lineNumber","columnNumber","stack","description","number"];function w(e){return Boolean(e&&e.isArangoError)}function _(e){return e&&e.hasOwnProperty("error")&&e.hasOwnProperty("code")&&e.hasOwnProperty("errorMessage")&&e.hasOwnProperty("errorNum")}function k(e){return Object.getPrototypeOf(e)===Error.prototype&&e.hasOwnProperty("code")&&e.hasOwnProperty("errno")&&e.hasOwnProperty("syscall")}var O=function(e){h(r,e);var t=p(r);function r(e){var n;s(this,r),m(y(n=t.call(this)),"name","ArangoError"),m(y(n),"errorNum",void 0),m(y(n),"code",void 0),m(y(n),"response",void 0),n.response=e,n.message=e.body.errorMessage,n.errorNum=e.body.errorNum,n.code=e.body.code;var o=new Error(n.message);o.name=n.name;var i,u=a(g);try{for(u.s();!(i=u.n()).done;){var c=i.value;o[c]&&(n[c]=o[c])}}catch(o){u.e(o)}finally{u.f()}return n}return l(r,[{key:"isArangoError",get:function(){return!0}},{key:"toJSON",value:function(){return{error:!0,errorMessage:this.message,errorNum:this.errorNum,code:this.code}}}]),r}(o),x=function(e){h(r,e);var t=p(r);function r(e){var n;s(this,r),m(y(n=t.call(this)),"name","HttpError"),m(y(n),"response",void 0),m(y(n),"code",void 0),n.response=e,n.code=e.statusCode||500,n.message=b[n.code]||b[500];var o=new Error(n.message);o.name=n.name;var i,u=a(g);try{for(u.s();!(i=u.n()).done;){var c=i.value;o[c]&&(n[c]=o[c])}}catch(o){u.e(o)}finally{u.f()}return n}return l(r,[{key:"toJSON",value:function(){return{error:!0,code:this.code}}}]),r}(o)},function(e,t,r){"use strict";function n(e){return function(e){if(Array.isArray(e))return a(e)}(e)||u(e)||i(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(e){return function(e){if(Array.isArray(e))return e}(e)||u(e)||i(e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(e,t){if(e){if("string"==typeof e)return a(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?a(e,t):void 0}}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function u(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function s(e,t){var r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if("string"!=typeof e){if(e._id)return s(e._id,t);if(e._key)return s(e._key,t);throw new Error("Document handle must be a string or an object with a _key or _id attribute")}if(e.includes("/")){var i=e.split("/"),a=o(i),u=a[0],c=a.slice(1),l=u.normalize("NFC");if(r&&l!==t)throw new Error('Document ID "'.concat(e,'" does not match collection name "').concat(t,'"'));return[l].concat(n(c)).join("/")}return"".concat(t,"/").concat(e)}r.d(t,"a",(function(){return s}))},function(e,t,r){"use strict";r.d(t,"g",(function(){return n})),r.d(t,"e",(function(){return o})),r.d(t,"a",(function(){return i})),r.d(t,"d",(function(){return a})),r.d(t,"b",(function(){return u})),r.d(t,"h",(function(){return s})),r.d(t,"c",(function(){return c})),r.d(t,"f",(function(){return l}));var n=10,o=1200,i=1202,a=1202,u=1203,s=1203,c=1228,l=1924},function(e,t,r){"use strict";r.r(t),r.d(t,"isAqlQuery",(function(){return f})),r.d(t,"isGeneratedAqlQuery",(function(){return p})),r.d(t,"isAqlLiteral",(function(){return d})),r.d(t,"aql",(function(){return y}));var n,o,i,a=r(0),u=r(8),s=r(7);function c(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function l(e){return function(e){if(Array.isArray(e))return h(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return h(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return h(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function h(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function f(e){return Boolean(e&&"string"==typeof e.query&&e.bindVars)}function p(e){return f(e)&&"function"==typeof e._source}function d(e){return Boolean(e&&"function"==typeof e.toAQL)}function y(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];for(var o=l(e),i={},c=[],h=o[0],f=0;f<r.length;f++){var y=r[f],v=y;if(p(y)){var m=y._source();m.args.length?(h+=m.strings[0],r.splice.apply(r,[f,1].concat(l(m.args))),o.splice.apply(o,[f,2,o[f]+m.strings[0]].concat(l(m.strings.slice(1,m.args.length)),[m.strings[m.args.length]+o[f+1]]))):(h+=y.query+o[f+1],r.splice(f,1),o.splice(f,2,o[f]+y.query+o[f+1])),f-=1}else if(void 0!==y)if(d(y))h+="".concat(y.toAQL()).concat(o[f+1]);else{var b=c.indexOf(y),g=-1!==b,w="value".concat(g?b:c.length);(Object(a.isArangoCollection)(y)||Object(u.b)(y)||Object(s.isArangoView)(y))&&(w="@".concat(w),v=y.name),g||(c.push(y),i[w]=v),h+="@".concat(w).concat(o[f+1])}else h+=o[f+1]}return{query:h,bindVars:i,_source:function(){return{strings:o,args:r}}}}(i=y||(y={})).literal=function(e){return d(e)?e:{toAQL:function(){return void 0===e?"":String(e)}}},i.join=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:" ";return e.length?1===e.length?y(o||(o=c(["",""])),e[0]):y.apply(void 0,[[""].concat(l(Array(e.length-1).fill(t)),[""])].concat(l(e))):y(n||(n=c([""])))}},function(e,t,r){"use strict";r.d(t,"a",(function(){return g}));var n,o,i=r(6);function a(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=s(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}function u(e){return function(e){if(Array.isArray(e))return c(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||s(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(e,t){if(e){if("string"==typeof e)return c(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?c(e,t):void 0}}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function l(e,t,r,n,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void r(e)}u.done?t(s):Promise.resolve(s).then(n,o)}function h(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(e){l(i,n,o,a,u,"next",e)}function u(e){l(i,n,o,a,u,"throw",e)}a(void 0)}))}}function f(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function p(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function d(e,t,r){return t&&p(e.prototype,t),r&&p(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function y(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function v(e){return function(){return new m(e.apply(this,arguments))}}function m(e){var t,r;function n(t,r){try{var i=e[t](r),a=i.value,u=a instanceof b;Promise.resolve(u?a.wrapped:a).then((function(e){u?n("return"===t?"return":"next",e):o(i.done?"return":"normal",e)}),(function(e){n("throw",e)}))}catch(e){o("throw",e)}}function o(e,o){switch(e){case"return":t.resolve({value:o,done:!0});break;case"throw":t.reject(o);break;default:t.resolve({value:o,done:!1})}(t=t.next)?n(t.key,t.arg):r=null}this._invoke=function(e,o){return new Promise((function(i,a){var u={key:e,arg:o,resolve:i,reject:a,next:null};r?r=r.next=u:(t=r=u,n(e,o))}))},"function"!=typeof e.return&&(this.return=void 0)}function b(e){this.wrapped=e}m.prototype["function"==typeof Symbol&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},m.prototype.next=function(e){return this._invoke("next",e)},m.prototype.throw=function(e){return this._invoke("throw",e)},m.prototype.return=function(e){return this._invoke("return",e)},n=Symbol.asyncIterator;var g=function(){function e(t,r,n,o){var a=this;f(this,e),y(this,"_db",void 0),y(this,"_batches",void 0),y(this,"_count",void 0),y(this,"_extra",void 0),y(this,"_hasMore",void 0),y(this,"_id",void 0),y(this,"_host",void 0),y(this,"_allowDirtyRead",void 0),y(this,"_itemsCursor",void 0);var u=new i.LinkedList(r.result.length?[new i.LinkedList(r.result)]:[]);this._db=t,this._batches=u,this._id=r.id,this._hasMore=Boolean(r.id&&r.hasMore),this._host=n,this._count=r.count,this._extra=r.extra,this._allowDirtyRead=o,this._itemsCursor=new w(this,{get isEmpty(){return!u.length},more:function(){return a._more()},shift:function(){for(var e,t=null===(e=u.first)||void 0===e?void 0:e.value;t&&!t.length;){var r;u.shift(),t=null===(r=u.first)||void 0===r?void 0:r.value}if(t){var n=t.shift();return t.length||u.shift(),n}}})}var t,r,o,s,c,l,p,m,b;return d(e,[{key:"_more",value:(b=h(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.hasMore){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,this._db.request({method:"PUT",path:"/_api/cursor/".concat(encodeURIComponent(this._id)),host:this._host,allowDirtyRead:this._allowDirtyRead});case 4:t=e.sent,this._batches.push(new i.LinkedList(t.body.result)),this._hasMore=t.body.hasMore;case 7:case"end":return e.stop()}}),e,this)}))),function(){return b.apply(this,arguments)})},{key:"items",get:function(){return this._itemsCursor}},{key:"extra",get:function(){return this._extra}},{key:"count",get:function(){return this._count}},{key:"hasMore",get:function(){return this._hasMore}},{key:"hasNext",get:function(){return this.hasMore||Boolean(this._batches.length)}},{key:n,value:function(){var e=this;return v(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!e.hasNext){t.next=5;break}return t.next=3,e.next();case 3:t.next=0;break;case 5:return t.abrupt("return",void 0);case 6:case"end":return t.stop()}}),t)})))()}},{key:"loadAll",value:(m=h(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._hasMore){e.next=5;break}return e.next=3,this._more();case 3:e.next=0;break;case 5:case"end":return e.stop()}}),e,this)}))),function(){return m.apply(this,arguments)})},{key:"all",value:(p=h(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.map((function(e){return e})));case 1:case"end":return e.stop()}}),e,this)}))),function(){return p.apply(this,arguments)})},{key:"next",value:(l=h(regeneratorRuntime.mark((function e(){var t,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._batches.length||!this.hasNext){e.next=5;break}return e.next=3,this._more();case 3:e.next=0;break;case 5:if(this._batches.length){e.next=7;break}return e.abrupt("return",void 0);case 7:if(t=this._batches.shift()){e.next=10;break}return e.abrupt("return",void 0);case 10:return r=u(t.values()),t.clear(!0),e.abrupt("return",r);case 13:case"end":return e.stop()}}),e,this)}))),function(){return l.apply(this,arguments)})},{key:"forEach",value:(c=h(regeneratorRuntime.mark((function e(t){var r,n,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=0;case 1:if(!this.hasNext){e.next=14;break}return e.next=4,this.next();case 4:if(n=e.sent,o=t(n,r,this),r++,!1!==o){e.next=9;break}return e.abrupt("return",o);case 9:if(!this.hasNext){e.next=12;break}return e.next=12,this._more();case 12:e.next=1;break;case 14:return e.abrupt("return",!0);case 15:case"end":return e.stop()}}),e,this)}))),function(e){return c.apply(this,arguments)})},{key:"map",value:(s=h(regeneratorRuntime.mark((function e(t){var r,n,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=0,n=[];case 2:if(!this.hasNext){e.next=10;break}return e.next=5,this.next();case 5:o=e.sent,n.push(t(o,r,this)),r++,e.next=2;break;case 10:return e.abrupt("return",n);case 11:case"end":return e.stop()}}),e,this)}))),function(e){return s.apply(this,arguments)})},{key:"flatMap",value:(o=h(regeneratorRuntime.mark((function e(t){var r,n,o,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=0,n=[];case 2:if(!this.hasNext){e.next=11;break}return e.next=5,this.next();case 5:o=e.sent,i=t(o,r,this),Array.isArray(i)?n.push.apply(n,u(i)):n.push(i),r++,e.next=2;break;case 11:return e.abrupt("return",n);case 12:case"end":return e.stop()}}),e,this)}))),function(e){return o.apply(this,arguments)})},{key:"reduce",value:(r=h(regeneratorRuntime.mark((function e(t,r){var n,o,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=0,this.hasNext){e.next=3;break}return e.abrupt("return",r);case 3:if(void 0!==r){e.next=8;break}return e.next=6,this.next();case 6:r=e.sent,n+=1;case 8:o=r;case 9:if(!this.hasNext){e.next=17;break}return e.next=12,this.next();case 12:i=e.sent,o=t(o,i,n,this),n++,e.next=9;break;case 17:return e.abrupt("return",o);case 18:case"end":return e.stop()}}),e,this)}))),function(e,t){return r.apply(this,arguments)})},{key:"kill",value:(t=h(regeneratorRuntime.mark((function e(){var t,r,n=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._batches.length){t=a(this._batches.values());try{for(t.s();!(r=t.n()).done;)r.value.clear()}catch(e){t.e(e)}finally{t.f()}this._batches.clear()}if(this.hasNext){e.next=3;break}return e.abrupt("return",void 0);case 3:return e.abrupt("return",this._db.request({method:"DELETE",path:"/_api/cursor/".concat(encodeURIComponent(this._id))},(function(){n._hasMore=!1})));case 4:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})}]),e}();o=Symbol.asyncIterator;var w=function(){function e(t,r){f(this,e),y(this,"_batches",void 0),y(this,"_view",void 0),this._batches=t,this._view=r}var t,r,n,i,a,s,c;return d(e,[{key:"batches",get:function(){return this._batches}},{key:"extra",get:function(){return this.batches.extra}},{key:"count",get:function(){return this.batches.count}},{key:"hasNext",get:function(){return this.batches.hasNext}},{key:o,value:function(){var e=this;return v(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!e.hasNext){t.next=5;break}return t.next=3,e.next();case 3:t.next=0;break;case 5:return t.abrupt("return",void 0);case 6:case"end":return t.stop()}}),t)})))()}},{key:"all",value:(c=h(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.batches.flatMap((function(e){return e})));case 1:case"end":return e.stop()}}),e,this)}))),function(){return c.apply(this,arguments)})},{key:"next",value:(s=h(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._view.isEmpty||!this.batches.hasMore){e.next=5;break}return e.next=3,this._view.more();case 3:e.next=0;break;case 5:if(!this._view.isEmpty){e.next=7;break}return e.abrupt("return",void 0);case 7:return e.abrupt("return",this._view.shift());case 8:case"end":return e.stop()}}),e,this)}))),function(){return s.apply(this,arguments)})},{key:"forEach",value:(a=h(regeneratorRuntime.mark((function e(t){var r,n,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=0;case 1:if(!this.hasNext){e.next=11;break}return e.next=4,this.next();case 4:if(n=e.sent,o=t(n,r,this),r++,!1!==o){e.next=9;break}return e.abrupt("return",o);case 9:e.next=1;break;case 11:return e.abrupt("return",!0);case 12:case"end":return e.stop()}}),e,this)}))),function(e){return a.apply(this,arguments)})},{key:"map",value:(i=h(regeneratorRuntime.mark((function e(t){var r,n,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=0,n=[];case 2:if(!this.hasNext){e.next=10;break}return e.next=5,this.next();case 5:o=e.sent,n.push(t(o,r,this)),r++,e.next=2;break;case 10:return e.abrupt("return",n);case 11:case"end":return e.stop()}}),e,this)}))),function(e){return i.apply(this,arguments)})},{key:"flatMap",value:(n=h(regeneratorRuntime.mark((function e(t){var r,n,o,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=0,n=[];case 2:if(!this.hasNext){e.next=11;break}return e.next=5,this.next();case 5:o=e.sent,i=t(o,r,this),Array.isArray(i)?n.push.apply(n,u(i)):n.push(i),r++,e.next=2;break;case 11:return e.abrupt("return",n);case 12:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"reduce",value:(r=h(regeneratorRuntime.mark((function e(t,r){var n,o,i,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=0,this.hasNext){e.next=3;break}return e.abrupt("return",r);case 3:if(void 0!==r){e.next=9;break}return e.next=6,this.next();case 6:o=e.sent,r=o,n+=1;case 9:i=r;case 10:if(!this.hasNext){e.next=18;break}return e.next=13,this.next();case 13:a=e.sent,i=t(i,a,n,this),n++,e.next=10;break;case 18:return e.abrupt("return",i);case 19:case"end":return e.stop()}}),e,this)}))),function(e,t){return r.apply(this,arguments)})},{key:"kill",value:(t=h(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.batches.kill());case 1:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})}]),e}()},function(e,t,r){"use strict";function n(e){for(var r in e)t.hasOwnProperty(r)||(t[r]=e[r])}Object.defineProperty(t,"__esModule",{value:!0}),n(r(17)),n(r(11))},function(e,t,r){"use strict";r.r(t),r.d(t,"ViewType",(function(){return n})),r.d(t,"isArangoView",(function(){return f})),r.d(t,"View",(function(){return p}));var n,o=r(1),i=r(3);function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function u(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?a(Object(r),!0).forEach((function(t){h(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):a(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function s(e,t,r,n,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void r(e)}u.done?t(s):Promise.resolve(s).then(n,o)}function c(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(e){s(i,n,o,a,u,"next",e)}function u(e){s(i,n,o,a,u,"throw",e)}a(void 0)}))}}function l(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function h(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function f(e){return Boolean(e&&e.isArangoView)}!function(e){e.ARANGOSEARCH_VIEW="arangosearch"}(n||(n={}));var p=function(){function e(t,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),h(this,"_name",void 0),h(this,"_db",void 0),this._db=t,this._name=r.normalize("NFC")}var t,r,a,s,f;return t=e,(r=[{key:"isArangoView",get:function(){return!0}},{key:"name",get:function(){return this._name}},{key:"get",value:function(){return this._db.request({path:"/_api/view/".concat(encodeURIComponent(this._name))},(function(e){return e.body}))}},{key:"exists",value:(f=c(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.get();case 3:return e.abrupt("return",!0);case 6:if(e.prev=6,e.t0=e.catch(0),!Object(o.c)(e.t0)||e.t0.errorNum!==i.h){e.next=10;break}return e.abrupt("return",!1);case 10:throw e.t0;case 11:case"end":return e.stop()}}),e,this,[[0,6]])}))),function(){return f.apply(this,arguments)})},{key:"create",value:function(e){return this._db.request({method:"POST",path:"/_api/view",body:u(u({type:n.ARANGOSEARCH_VIEW},e||{}),{},{name:this._name})},(function(e){return e.body}))}},{key:"rename",value:(s=c(regeneratorRuntime.mark((function e(t){var r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=this._db.renameView(this._name,t),this._name=t.normalize("NFC"),e.abrupt("return",r);case 3:case"end":return e.stop()}}),e,this)}))),function(e){return s.apply(this,arguments)})},{key:"properties",value:function(){return this._db.request({path:"/_api/view/".concat(encodeURIComponent(this._name),"/properties")},(function(e){return e.body}))}},{key:"updateProperties",value:function(e){return this._db.request({method:"PATCH",path:"/_api/view/".concat(encodeURIComponent(this._name),"/properties"),body:e||{}},(function(e){return e.body}))}},{key:"replaceProperties",value:function(e){return this._db.request({method:"PUT",path:"/_api/view/".concat(encodeURIComponent(this._name),"/properties"),body:e||{}},(function(e){return e.body}))}},{key:"drop",value:function(){return this._db.request({method:"DELETE",path:"/_api/view/".concat(encodeURIComponent(this._name))},(function(e){return e.body.result}))}}])&&l(t.prototype,r),a&&l(t,a),Object.defineProperty(t,"prototype",{writable:!1}),e}()},function(e,t,r){"use strict";r.d(t,"b",(function(){return P})),r.d(t,"a",(function(){return U}));var n=r(0),o=r(2),i=r(1),a=r(3),u=["allowDirtyRead","graceful","rev"],s=["rev"],c=["rev"],l=["rev"],h=["allowDirtyRead","graceful","rev"],f=["rev"],p=["rev"],d=["rev"],y=["orphanCollections","satellites","waitForSync","isSmart","isDisjoint"],v=["satellites"],m=["satellites"],b=["satellites"];function g(e){return(g="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)}function w(e,t,r,n,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void r(e)}u.done?t(s):Promise.resolve(s).then(n,o)}function _(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(e){w(i,n,o,a,u,"next",e)}function u(e){w(i,n,o,a,u,"throw",e)}a(void 0)}))}}function k(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function O(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function x(e,t,r){return t&&O(e.prototype,t),r&&O(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function j(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function R(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?j(Object(r),!0).forEach((function(t){q(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):j(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function q(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function S(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function T(e){var t=function(e,t){if("object"!==g(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==g(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===g(t)?t:String(t)}function P(e){return Boolean(e&&e.isArangoGraph)}function C(e,t){var r=e.new,n=e.old,o=e[t],i=R(R({},S(e,["new","old",t].map(T))),o);return void 0!==r&&(i.new=r),void 0!==n&&(i.old=n),i}function E(e){var t={};return t.collection=Object(n.collectionToString)(e.collection),t.from=Array.isArray(e.from)?e.from.map(n.collectionToString):[Object(n.collectionToString)(e.from)],t.to=Array.isArray(e.to)?e.to.map(n.collectionToString):[Object(n.collectionToString)(e.to)],t}var A=function(){function e(t,r,n){k(this,e),q(this,"_db",void 0),q(this,"_name",void 0),q(this,"_graph",void 0),q(this,"_collection",void 0),this._db=t,this._collection=t.collection(r),this._name=this._collection.name,this._graph=n}var t,r;return x(e,[{key:"isArangoCollection",get:function(){return!0}},{key:"name",get:function(){return this._name}},{key:"collection",get:function(){return this._collection}},{key:"graph",get:function(){return this._graph}},{key:"vertexExists",value:(r=_(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this._db.request({method:"HEAD",path:"/_api/gharial/".concat(encodeURIComponent(this.graph.name),"/vertex/").concat(encodeURI(Object(o.a)(t,this._name)))},(function(){return!0}));case 3:return e.abrupt("return",e.sent);case 6:if(e.prev=6,e.t0=e.catch(0),404!==e.t0.code){e.next=10;break}return e.abrupt("return",!1);case 10:throw e.t0;case 11:case"end":return e.stop()}}),e,this,[[0,6]])}))),function(e){return r.apply(this,arguments)})},{key:"vertex",value:(t=_(regeneratorRuntime.mark((function e(t){var r,n,s,c,l,h,f,p,d,y,v=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("boolean"==typeof(r=v.length>1&&void 0!==v[1]?v[1]:{})&&(r={graceful:r}),s=(n=r).allowDirtyRead,c=void 0===s?void 0:s,l=n.graceful,h=void 0!==l&&l,f=n.rev,p=S(n,u),d={},f&&(d["if-match"]=f),y=this._db.request({path:"/_api/gharial/".concat(encodeURIComponent(this.graph.name),"/vertex/").concat(encodeURI(Object(o.a)(t,this._name))),headers:d,qs:p,allowDirtyRead:c},(function(e){return e.body.vertex})),h){e.next=8;break}return e.abrupt("return",y);case 8:return e.prev=8,e.next=11,y;case 11:return e.abrupt("return",e.sent);case 14:if(e.prev=14,e.t0=e.catch(8),!Object(i.c)(e.t0)||e.t0.errorNum!==a.d){e.next=18;break}return e.abrupt("return",null);case 18:throw e.t0;case 19:case"end":return e.stop()}}),e,this,[[8,14]])}))),function(e){return t.apply(this,arguments)})},{key:"save",value:function(e,t){return this._db.request({method:"POST",path:"/_api/gharial/".concat(encodeURIComponent(this.graph.name),"/vertex/").concat(encodeURIComponent(this._name)),body:e,qs:t},(function(e){return C(e.body,"vertex")}))}},{key:"replace",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};"string"==typeof r&&(r={rev:r});var n=r,i=n.rev,a=S(n,s),u={};return i&&(u["if-match"]=i),this._db.request({method:"PUT",path:"/_api/gharial/".concat(encodeURIComponent(this.graph.name),"/vertex/").concat(encodeURI(Object(o.a)(e,this._name))),body:t,qs:a,headers:u},(function(e){return C(e.body,"vertex")}))}},{key:"update",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};"string"==typeof r&&(r={rev:r});var n={},i=r,a=i.rev,u=S(i,c);return a&&(n["if-match"]=a),this._db.request({method:"PATCH",path:"/_api/gharial/".concat(encodeURIComponent(this.graph.name),"/vertex/").concat(encodeURI(Object(o.a)(e,this._name))),body:t,qs:u,headers:n},(function(e){return C(e.body,"vertex")}))}},{key:"remove",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};"string"==typeof t&&(t={rev:t});var r={},n=t,i=n.rev,a=S(n,l);return i&&(r["if-match"]=i),this._db.request({method:"DELETE",path:"/_api/gharial/".concat(encodeURIComponent(this.graph.name),"/vertex/").concat(encodeURI(Object(o.a)(e,this._name))),qs:a,headers:r},(function(e){return C(e.body,"removed")}))}}]),e}(),I=function(){function e(t,r,n){k(this,e),q(this,"_db",void 0),q(this,"_name",void 0),q(this,"_graph",void 0),q(this,"_collection",void 0),this._db=t,this._collection=t.collection(r),this._name=this._collection.name,this._graph=n}var t,r;return x(e,[{key:"isArangoCollection",get:function(){return!0}},{key:"name",get:function(){return this._name}},{key:"collection",get:function(){return this._collection}},{key:"graph",get:function(){return this._graph}},{key:"edgeExists",value:(r=_(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this._db.request({method:"HEAD",path:"/_api/gharial/".concat(encodeURIComponent(this.graph.name),"/edge/").concat(encodeURI(Object(o.a)(t,this._name)))},(function(){return!0}));case 3:return e.abrupt("return",e.sent);case 6:if(e.prev=6,e.t0=e.catch(0),404!==e.t0.code){e.next=10;break}return e.abrupt("return",!1);case 10:throw e.t0;case 11:case"end":return e.stop()}}),e,this,[[0,6]])}))),function(e){return r.apply(this,arguments)})},{key:"edge",value:(t=_(regeneratorRuntime.mark((function e(t){var r,n,u,s,c,l,f,p,d,y,v=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("boolean"==typeof(r=v.length>1&&void 0!==v[1]?v[1]:{})&&(r={graceful:r}),u=(n=r).allowDirtyRead,s=void 0===u?void 0:u,c=n.graceful,l=void 0!==c&&c,f=n.rev,p=S(n,h),d={},f&&(d["if-match"]=f),y=this._db.request({path:"/_api/gharial/".concat(encodeURIComponent(this.graph.name),"/edge/").concat(encodeURI(Object(o.a)(t,this._name))),qs:p,allowDirtyRead:s},(function(e){return e.body.edge})),l){e.next=8;break}return e.abrupt("return",y);case 8:return e.prev=8,e.next=11,y;case 11:return e.abrupt("return",e.sent);case 14:if(e.prev=14,e.t0=e.catch(8),!Object(i.c)(e.t0)||e.t0.errorNum!==a.d){e.next=18;break}return e.abrupt("return",null);case 18:throw e.t0;case 19:case"end":return e.stop()}}),e,this,[[8,14]])}))),function(e){return t.apply(this,arguments)})},{key:"save",value:function(e,t){return this._db.request({method:"POST",path:"/_api/gharial/".concat(encodeURIComponent(this.graph.name),"/edge/").concat(encodeURIComponent(this._name)),body:e,qs:t},(function(e){return C(e.body,"edge")}))}},{key:"replace",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};"string"==typeof r&&(r={rev:r});var n=r,i=n.rev,a=S(n,f),u={};return i&&(u["if-match"]=i),this._db.request({method:"PUT",path:"/_api/gharial/".concat(encodeURIComponent(this.graph.name),"/edge/").concat(encodeURI(Object(o.a)(e,this._name))),body:t,qs:a,headers:u},(function(e){return C(e.body,"edge")}))}},{key:"update",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};"string"==typeof r&&(r={rev:r});var n=r,i=n.rev,a=S(n,p),u={};return i&&(u["if-match"]=i),this._db.request({method:"PATCH",path:"/_api/gharial/".concat(encodeURIComponent(this.graph.name),"/edge/").concat(encodeURI(Object(o.a)(e,this._name))),body:t,qs:a,headers:u},(function(e){return C(e.body,"edge")}))}},{key:"remove",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};"string"==typeof t&&(t={rev:t});var r=t,n=r.rev,i=S(r,d),a={};return n&&(a["if-match"]=n),this._db.request({method:"DELETE",path:"/_api/gharial/".concat(encodeURIComponent(this.graph.name),"/edge/").concat(encodeURI(Object(o.a)(e,this._name))),qs:i,headers:a},(function(e){return C(e.body,"removed")}))}}]),e}(),U=function(){function e(t,r){k(this,e),q(this,"_name",void 0),q(this,"_db",void 0),this._name=r.normalize("NFC"),this._db=t}var t,r,o;return x(e,[{key:"isArangoGraph",get:function(){return!0}},{key:"name",get:function(){return this._name}},{key:"exists",value:(o=_(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.get();case 3:return e.abrupt("return",!0);case 6:if(e.prev=6,e.t0=e.catch(0),!Object(i.c)(e.t0)||e.t0.errorNum!==a.f){e.next=10;break}return e.abrupt("return",!1);case 10:throw e.t0;case 11:case"end":return e.stop()}}),e,this,[[0,6]])}))),function(){return o.apply(this,arguments)})},{key:"get",value:function(){return this._db.request({path:"/_api/gharial/".concat(encodeURIComponent(this._name))},(function(e){return e.body.graph}))}},{key:"create",value:function(e,t){var r=null!=t?t:{},o=r.orphanCollections,i=r.satellites,a=r.waitForSync,u=r.isSmart,s=r.isDisjoint,c=S(r,y);return this._db.request({method:"POST",path:"/_api/gharial",body:{orphanCollections:o&&(Array.isArray(o)?o.map(n.collectionToString):[Object(n.collectionToString)(o)]),edgeDefinitions:e.map(E),isSmart:u,isDisjoint:s,name:this._name,options:R(R({},c),{},{satellites:null==i?void 0:i.map(n.collectionToString)})},qs:{waitForSync:a}},(function(e){return e.body.graph}))}},{key:"drop",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this._db.request({method:"DELETE",path:"/_api/gharial/".concat(encodeURIComponent(this._name)),qs:{dropCollections:e}},(function(e){return e.body.removed}))}},{key:"vertexCollection",value:function(e){return new A(this._db,Object(n.collectionToString)(e),this)}},{key:"listVertexCollections",value:function(){return this._db.request({path:"/_api/gharial/".concat(encodeURIComponent(this._name),"/vertex")},(function(e){return e.body.collections}))}},{key:"vertexCollections",value:(r=_(regeneratorRuntime.mark((function e(){var t,r=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.listVertexCollections();case 2:return t=e.sent,e.abrupt("return",t.map((function(e){return new A(r._db,e,r)})));case 4:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"addVertexCollection",value:function(e,t){var r=null!=t?t:{},o=r.satellites,i=S(r,v);return this._db.request({method:"POST",path:"/_api/gharial/".concat(encodeURIComponent(this._name),"/vertex"),body:{collection:Object(n.collectionToString)(e),options:R(R({},i),{},{satellites:null==o?void 0:o.map(n.collectionToString)})}},(function(e){return e.body.graph}))}},{key:"removeVertexCollection",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this._db.request({method:"DELETE",path:"/_api/gharial/".concat(encodeURIComponent(this._name),"/vertex/").concat(encodeURIComponent(Object(n.collectionToString)(e))),qs:{dropCollection:t}},(function(e){return e.body.graph}))}},{key:"edgeCollection",value:function(e){return new I(this._db,Object(n.collectionToString)(e),this)}},{key:"listEdgeCollections",value:function(){return this._db.request({path:"/_api/gharial/".concat(encodeURIComponent(this._name),"/edge")},(function(e){return e.body.collections}))}},{key:"edgeCollections",value:(t=_(regeneratorRuntime.mark((function e(){var t,r=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.listEdgeCollections();case 2:return t=e.sent,e.abrupt("return",t.map((function(e){return new I(r._db,e,r)})));case 4:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"addEdgeDefinition",value:function(e,t){var r=null!=t?t:{},o=r.satellites,i=S(r,m);return this._db.request({method:"POST",path:"/_api/gharial/".concat(encodeURIComponent(this._name),"/edge"),body:R(R({},E(e)),{},{options:R(R({},i),{},{satellites:null==o?void 0:o.map(n.collectionToString)})})},(function(e){return e.body.graph}))}},{key:"replaceEdgeDefinition",value:function(e,t,r){var o,i=e,a=t;t&&!t.hasOwnProperty("collection")&&(r=t,t=void 0),t||(i=(a=e).collection);var u=null!==(o=r)&&void 0!==o?o:{},s=u.satellites,c=S(u,b);return this._db.request({method:"PUT",path:"/_api/gharial/".concat(encodeURIComponent(this._name),"/edge/").concat(encodeURIComponent(Object(n.collectionToString)(i))),body:R(R({},E(a)),{},{options:R(R({},c),{},{satellites:null==s?void 0:s.map(n.collectionToString)})})},(function(e){return e.body.graph}))}},{key:"removeEdgeDefinition",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this._db.request({method:"DELETE",path:"/_api/gharial/".concat(encodeURIComponent(this._name),"/edge/").concat(encodeURIComponent(Object(n.collectionToString)(e))),qs:{dropCollection:t}},(function(e){return e.body.graph}))}},{key:"traversal",value:function(e,t){return this._db.request({method:"POST",path:"/_api/traversal",body:R(R({},t),{},{startVertex:e,graphName:this._name})},(function(e){return e.body.result}))}}]),e}()},function(e,t,r){"use strict";t.decode=t.parse=r(19),t.encode=t.stringify=r(20)},function(e,t,r){"use strict";var n=r(21),o=r(23);function i(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}t.parse=g,t.resolve=function(e,t){return g(e,!1,!0).resolve(t)},t.resolveObject=function(e,t){return e?g(e,!1,!0).resolveObject(t):t},t.format=function(e){o.isString(e)&&(e=g(e));return e instanceof i?e.format():i.prototype.format.call(e)},t.Url=i;var a=/^([a-z0-9.+-]+:)/i,u=/:[0-9]*$/,s=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,c=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),l=["'"].concat(c),h=["%","/","?",";","#"].concat(l),f=["/","?","#"],p=/^[+a-z0-9A-Z_-]{0,63}$/,d=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,y={javascript:!0,"javascript:":!0},v={javascript:!0,"javascript:":!0},m={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},b=r(9);function g(e,t,r){if(e&&o.isObject(e)&&e instanceof i)return e;var n=new i;return n.parse(e,t,r),n}i.prototype.parse=function(e,t,r){if(!o.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var i=e.indexOf("?"),u=-1!==i&&i<e.indexOf("#")?"?":"#",c=e.split(u);c[0]=c[0].replace(/\\/g,"/");var g=e=c.join(u);if(g=g.trim(),!r&&1===e.split("#").length){var w=s.exec(g);if(w)return this.path=g,this.href=g,this.pathname=w[1],w[2]?(this.search=w[2],this.query=t?b.parse(this.search.substr(1)):this.search.substr(1)):t&&(this.search="",this.query={}),this}var _=a.exec(g);if(_){var k=(_=_[0]).toLowerCase();this.protocol=k,g=g.substr(_.length)}if(r||_||g.match(/^\/\/[^@\/]+@[^@\/]+/)){var O="//"===g.substr(0,2);!O||_&&v[_]||(g=g.substr(2),this.slashes=!0)}if(!v[_]&&(O||_&&!m[_])){for(var x,j,R=-1,q=0;q<f.length;q++){-1!==(S=g.indexOf(f[q]))&&(-1===R||S<R)&&(R=S)}-1!==(j=-1===R?g.lastIndexOf("@"):g.lastIndexOf("@",R))&&(x=g.slice(0,j),g=g.slice(j+1),this.auth=decodeURIComponent(x)),R=-1;for(q=0;q<h.length;q++){var S;-1!==(S=g.indexOf(h[q]))&&(-1===R||S<R)&&(R=S)}-1===R&&(R=g.length),this.host=g.slice(0,R),g=g.slice(R),this.parseHost(),this.hostname=this.hostname||"";var T="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!T)for(var P=this.hostname.split(/\./),C=(q=0,P.length);q<C;q++){var E=P[q];if(E&&!E.match(p)){for(var A="",I=0,U=E.length;I<U;I++)E.charCodeAt(I)>127?A+="x":A+=E[I];if(!A.match(p)){var D=P.slice(0,q),L=P.slice(q+1),N=E.match(d);N&&(D.push(N[1]),L.unshift(N[2])),L.length&&(g="/"+L.join(".")+g),this.hostname=D.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),T||(this.hostname=n.toASCII(this.hostname));var F=this.port?":"+this.port:"",H=this.hostname||"";this.host=H+F,this.href+=this.host,T&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==g[0]&&(g="/"+g))}if(!y[k])for(q=0,C=l.length;q<C;q++){var B=l[q];if(-1!==g.indexOf(B)){var M=encodeURIComponent(B);M===B&&(M=escape(B)),g=g.split(B).join(M)}}var z=g.indexOf("#");-1!==z&&(this.hash=g.substr(z),g=g.slice(0,z));var V=g.indexOf("?");if(-1!==V?(this.search=g.substr(V),this.query=g.substr(V+1),t&&(this.query=b.parse(this.query)),g=g.slice(0,V)):t&&(this.search="",this.query={}),g&&(this.pathname=g),m[k]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){F=this.pathname||"";var G=this.search||"";this.path=F+G}return this.href=this.format(),this},i.prototype.format=function(){var e=this.auth||"";e&&(e=(e=encodeURIComponent(e)).replace(/%3A/i,":"),e+="@");var t=this.protocol||"",r=this.pathname||"",n=this.hash||"",i=!1,a="";this.host?i=e+this.host:this.hostname&&(i=e+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(i+=":"+this.port)),this.query&&o.isObject(this.query)&&Object.keys(this.query).length&&(a=b.stringify(this.query));var u=this.search||a&&"?"+a||"";return t&&":"!==t.substr(-1)&&(t+=":"),this.slashes||(!t||m[t])&&!1!==i?(i="//"+(i||""),r&&"/"!==r.charAt(0)&&(r="/"+r)):i||(i=""),n&&"#"!==n.charAt(0)&&(n="#"+n),u&&"?"!==u.charAt(0)&&(u="?"+u),t+i+(r=r.replace(/[?#]/g,(function(e){return encodeURIComponent(e)})))+(u=u.replace("#","%23"))+n},i.prototype.resolve=function(e){return this.resolveObject(g(e,!1,!0)).format()},i.prototype.resolveObject=function(e){if(o.isString(e)){var t=new i;t.parse(e,!1,!0),e=t}for(var r=new i,n=Object.keys(this),a=0;a<n.length;a++){var u=n[a];r[u]=this[u]}if(r.hash=e.hash,""===e.href)return r.href=r.format(),r;if(e.slashes&&!e.protocol){for(var s=Object.keys(e),c=0;c<s.length;c++){var l=s[c];"protocol"!==l&&(r[l]=e[l])}return m[r.protocol]&&r.hostname&&!r.pathname&&(r.path=r.pathname="/"),r.href=r.format(),r}if(e.protocol&&e.protocol!==r.protocol){if(!m[e.protocol]){for(var h=Object.keys(e),f=0;f<h.length;f++){var p=h[f];r[p]=e[p]}return r.href=r.format(),r}if(r.protocol=e.protocol,e.host||v[e.protocol])r.pathname=e.pathname;else{for(var d=(e.pathname||"").split("/");d.length&&!(e.host=d.shift()););e.host||(e.host=""),e.hostname||(e.hostname=""),""!==d[0]&&d.unshift(""),d.length<2&&d.unshift(""),r.pathname=d.join("/")}if(r.search=e.search,r.query=e.query,r.host=e.host||"",r.auth=e.auth,r.hostname=e.hostname||e.host,r.port=e.port,r.pathname||r.search){var y=r.pathname||"",b=r.search||"";r.path=y+b}return r.slashes=r.slashes||e.slashes,r.href=r.format(),r}var g=r.pathname&&"/"===r.pathname.charAt(0),w=e.host||e.pathname&&"/"===e.pathname.charAt(0),_=w||g||r.host&&e.pathname,k=_,O=r.pathname&&r.pathname.split("/")||[],x=(d=e.pathname&&e.pathname.split("/")||[],r.protocol&&!m[r.protocol]);if(x&&(r.hostname="",r.port=null,r.host&&(""===O[0]?O[0]=r.host:O.unshift(r.host)),r.host="",e.protocol&&(e.hostname=null,e.port=null,e.host&&(""===d[0]?d[0]=e.host:d.unshift(e.host)),e.host=null),_=_&&(""===d[0]||""===O[0])),w)r.host=e.host||""===e.host?e.host:r.host,r.hostname=e.hostname||""===e.hostname?e.hostname:r.hostname,r.search=e.search,r.query=e.query,O=d;else if(d.length)O||(O=[]),O.pop(),O=O.concat(d),r.search=e.search,r.query=e.query;else if(!o.isNullOrUndefined(e.search)){if(x)r.hostname=r.host=O.shift(),(T=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=T.shift(),r.host=r.hostname=T.shift());return r.search=e.search,r.query=e.query,o.isNull(r.pathname)&&o.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r}if(!O.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var j=O.slice(-1)[0],R=(r.host||e.host||O.length>1)&&("."===j||".."===j)||""===j,q=0,S=O.length;S>=0;S--)"."===(j=O[S])?O.splice(S,1):".."===j?(O.splice(S,1),q++):q&&(O.splice(S,1),q--);if(!_&&!k)for(;q--;q)O.unshift("..");!_||""===O[0]||O[0]&&"/"===O[0].charAt(0)||O.unshift(""),R&&"/"!==O.join("/").substr(-1)&&O.push("");var T,P=""===O[0]||O[0]&&"/"===O[0].charAt(0);x&&(r.hostname=r.host=P?"":O.length?O.shift():"",(T=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=T.shift(),r.host=r.hostname=T.shift()));return(_=_||r.host&&O.length)&&!P&&O.unshift(""),O.length?r.pathname=O.join("/"):(r.pathname=null,r.path=null),o.isNull(r.pathname)&&o.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=e.auth||r.auth,r.slashes=r.slashes||e.slashes,r.href=r.format(),r},i.prototype.parseHost=function(){var e=this.host,t=u.exec(e);t&&(":"!==(t=t[0])&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.LinkedListItem=class{constructor(e,t){this.value=e,this.unlinkCleanup=t}insertBehind(e){if(e.insertBefore(this),this.behind){let t=e;for(;t.behind;)t=t.behind;this.behind.insertBefore(t),t.insertBehind(this.behind)}this.behind=e}unlink(e=!1){this.before&&(this.before.behind=this.behind),this.behind&&(this.behind.before=this.before),this.unlinkCleanup&&this.unlinkCleanup(this),this.unlinkCleanup=void 0,e&&(this.before=this.behind=void 0)}insertBefore(e){this.before=e,this.unlinkCleanup||(this.unlinkCleanup=e.unlinkCleanup)}}},function(e,t){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(e){"object"==typeof window&&(r=window)}e.exports=r},function(e,t,r){(function(e){function r(e,t){for(var r=0,n=e.length-1;n>=0;n--){var o=e[n];"."===o?e.splice(n,1):".."===o?(e.splice(n,1),r++):r&&(e.splice(n,1),r--)}if(t)for(;r--;r)e.unshift("..");return e}function n(e,t){if(e.filter)return e.filter(t);for(var r=[],n=0;n<e.length;n++)t(e[n],n,e)&&r.push(e[n]);return r}t.resolve=function(){for(var t="",o=!1,i=arguments.length-1;i>=-1&&!o;i--){var a=i>=0?arguments[i]:e.cwd();if("string"!=typeof a)throw new TypeError("Arguments to path.resolve must be strings");a&&(t=a+"/"+t,o="/"===a.charAt(0))}return(o?"/":"")+(t=r(n(t.split("/"),(function(e){return!!e})),!o).join("/"))||"."},t.normalize=function(e){var i=t.isAbsolute(e),a="/"===o(e,-1);return(e=r(n(e.split("/"),(function(e){return!!e})),!i).join("/"))||i||(e="."),e&&a&&(e+="/"),(i?"/":"")+e},t.isAbsolute=function(e){return"/"===e.charAt(0)},t.join=function(){var e=Array.prototype.slice.call(arguments,0);return t.normalize(n(e,(function(e,t){if("string"!=typeof e)throw new TypeError("Arguments to path.join must be strings");return e})).join("/"))},t.relative=function(e,r){function n(e){for(var t=0;t<e.length&&""===e[t];t++);for(var r=e.length-1;r>=0&&""===e[r];r--);return t>r?[]:e.slice(t,r-t+1)}e=t.resolve(e).substr(1),r=t.resolve(r).substr(1);for(var o=n(e.split("/")),i=n(r.split("/")),a=Math.min(o.length,i.length),u=a,s=0;s<a;s++)if(o[s]!==i[s]){u=s;break}var c=[];for(s=u;s<o.length;s++)c.push("..");return(c=c.concat(i.slice(u))).join("/")},t.sep="/",t.delimiter=":",t.dirname=function(e){if("string"!=typeof e&&(e+=""),0===e.length)return".";for(var t=e.charCodeAt(0),r=47===t,n=-1,o=!0,i=e.length-1;i>=1;--i)if(47===(t=e.charCodeAt(i))){if(!o){n=i;break}}else o=!1;return-1===n?r?"/":".":r&&1===n?"/":e.slice(0,n)},t.basename=function(e,t){var r=function(e){"string"!=typeof e&&(e+="");var t,r=0,n=-1,o=!0;for(t=e.length-1;t>=0;--t)if(47===e.charCodeAt(t)){if(!o){r=t+1;break}}else-1===n&&(o=!1,n=t+1);return-1===n?"":e.slice(r,n)}(e);return t&&r.substr(-1*t.length)===t&&(r=r.substr(0,r.length-t.length)),r},t.extname=function(e){"string"!=typeof e&&(e+="");for(var t=-1,r=0,n=-1,o=!0,i=0,a=e.length-1;a>=0;--a){var u=e.charCodeAt(a);if(47!==u)-1===n&&(o=!1,n=a+1),46===u?-1===t?t=a:1!==i&&(i=1):-1!==t&&(i=-1);else if(!o){r=a+1;break}}return-1===t||-1===n||0===i||1===i&&t===n-1&&t===r+1?"":e.slice(t,n)};var o="b"==="ab".substr(-1)?function(e,t,r){return e.substr(t,r)}:function(e,t,r){return t<0&&(t=e.length+t),e.substr(t,r)}}).call(this,r(24))},function(e,t,r){r(15),e.exports=r(16)},function(e,t,r){var n=function(e){"use strict";var t=Object.prototype,r=t.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",i=n.asyncIterator||"@@asyncIterator",a=n.toStringTag||"@@toStringTag";function u(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{u({},"")}catch(e){u=function(e,t,r){return e[t]=r}}function s(e,t,r,n){var o=t&&t.prototype instanceof h?t:h,i=Object.create(o.prototype),a=new O(n||[]);return i._invoke=function(e,t,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return j()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var u=w(a,r);if(u){if(u===l)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var s=c(e,t,r);if("normal"===s.type){if(n=r.done?"completed":"suspendedYield",s.arg===l)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n="completed",r.method="throw",r.arg=s.arg)}}}(e,r,a),i}function c(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=s;var l={};function h(){}function f(){}function p(){}var d={};u(d,o,(function(){return this}));var y=Object.getPrototypeOf,v=y&&y(y(x([])));v&&v!==t&&r.call(v,o)&&(d=v);var m=p.prototype=h.prototype=Object.create(d);function b(e){["next","throw","return"].forEach((function(t){u(e,t,(function(e){return this._invoke(t,e)}))}))}function g(e,t){var n;this._invoke=function(o,i){function a(){return new t((function(n,a){!function n(o,i,a,u){var s=c(e[o],e,i);if("throw"!==s.type){var l=s.arg,h=l.value;return h&&"object"==typeof h&&r.call(h,"__await")?t.resolve(h.__await).then((function(e){n("next",e,a,u)}),(function(e){n("throw",e,a,u)})):t.resolve(h).then((function(e){l.value=e,a(l)}),(function(e){return n("throw",e,a,u)}))}u(s.arg)}(o,i,n,a)}))}return n=n?n.then(a,a):a()}}function w(e,t){var r=e.iterator[t.method];if(void 0===r){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method))return l;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return l}var n=c(r,e.iterator,t.arg);if("throw"===n.type)return t.method="throw",t.arg=n.arg,t.delegate=null,l;var o=n.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,l):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,l)}function _(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 k(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function O(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(_,this),this.reset(!0)}function x(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,i=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return i.next=i}}return{next:j}}function j(){return{value:void 0,done:!0}}return f.prototype=p,u(m,"constructor",p),u(p,"constructor",f),f.displayName=u(p,a,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,p):(e.__proto__=p,u(e,a,"GeneratorFunction")),e.prototype=Object.create(m),e},e.awrap=function(e){return{__await:e}},b(g.prototype),u(g.prototype,i,(function(){return this})),e.AsyncIterator=g,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new g(s(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},b(m),u(m,a,"Generator"),u(m,o,(function(){return this})),u(m,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=[];for(var r in e)t.push(r);return t.reverse(),function r(){for(;t.length;){var n=t.pop();if(n in e)return r.value=n,r.done=!1,r}return r.done=!0,r}},e.values=x,O.prototype={constructor:O,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(k),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},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 n(r,n){return a.type="throw",a.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var u=r.call(i,"catchLoc"),s=r.call(i,"finallyLoc");if(u&&s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,l):this.complete(a)},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),l},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),k(r),l}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;k(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:x(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),l}},e}(e.exports);try{regeneratorRuntime=n}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=n:Function("r","regeneratorRuntime = r")(n)}},function(e,t,r){"use strict";var n=r(4).aql,o=r(0),i=o.CollectionStatus,a=o.CollectionType,u=r(7).ViewType,s=r(30).Database;function c(e){return"string"==typeof e||Array.isArray(e),new s(e)}e.exports=c,Object.assign(c,{aql:n,arangojs:c,CollectionStatus:i,CollectionType:a,Database:s,ViewType:u})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(11);class o{constructor(e){if(this.length=0,this.unlinkCleanup=e=>{this.first===e&&(this.first=this.first.behind),this.last===e&&(this.last=this.last.before),this.length--},e){e instanceof o&&(e=e.values());for(const t of e)this.push(t)}}clear(e=!1){if(e)for(;this.first;)this.first.unlink(!0);this.first=this.last=void 0,this.length=0}every(e,t){t&&(e=e.bind(t));for(const t of this.keys())if(!e(t.value,t,this))return!1;return!0}filter(e,t){t&&(e=e.bind(t));const r=new o;for(const[t,n]of this)e(n,t,this)&&r.push(n);return r}find(e,t){t&&(e=e.bind(t));for(const[t,r]of this)if(e(r,t,this))return r}findItem(e,t){t&&(e=e.bind(t));for(const[t,r]of this)if(e(r,t,this))return t}forEach(e,t){t&&(e=e.bind(t));for(const[t,r]of this)e(r,t,this)}includes(e,t=0){let r=this.getItemByIndex(t);for(;r;){if(r.value===e)return!0;r=r.behind}return!1}itemOf(e,t=0){let r=this.getItemByIndex(t);for(;r;){if(r.value===e)return r;r=r.behind}}lastItemOf(e,t=-1){let r=this.getItemByIndex(t);for(;r;){if(r.value===e)return r;r=r.before}}map(e,t){t&&(e=e.bind(t));const r=new o;for(const[t,n]of this)r.push(e(n,t,this));return r}reduce(e,t){let r=this.first;if(!r){if(!t)throw new TypeError("Empty accumulator on empty LinkedList is not allowed.");return t}if(void 0===t){if(t=r.value,!r.behind)return t;r=r.behind}do{t=e(t,r.value,r,this),r=r.behind}while(r);return t}reduceRight(e,t){let r=this.last;if(!r){if(!t)throw new TypeError("Empty accumulator on empty LinkedList is not allowed.");return t}if(void 0===t){if(t=r.value,!r.before)return t;r=r.before}do{t=e(t,r.value,r,this),r=r.before}while(r);return t}some(e,t){t&&(e=e.bind(t));for(const[t,r]of this)if(e(r,t,this))return!0;return!1}join(e){return[...this.values()].join(e)}concat(...e){const t=new o(this);for(const r of e)r instanceof o?t.push(...r.values()):t.push(r);return t}pop(){if(!this.last)return;const e=this.last;return e.unlink(),e.value}push(...e){for(const t of e){const e=new n.LinkedListItem(t,this.unlinkCleanup);this.first&&this.last?(this.last.insertBehind(e),this.last=e):this.first=this.last=e,this.length++}return this.length}unshift(...e){for(const t of e){const e=new n.LinkedListItem(t,this.unlinkCleanup);this.last&&this.first?(e.insertBehind(this.first),this.first=e):this.first=this.last=e,this.length++}return this.length}remove(e){for(const t of this.keys())if(t.value===e)return t.unlink(),!0;return!1}removeAllOccurrences(e){let t=!1;for(const r of this.keys())r.value===e&&(r.unlink(),t=!0);return t}shift(){if(!this.first)return;const e=this.first;return e.unlink(),e.value}*[Symbol.iterator](){let e=this.first;if(e)do{yield[e,e.value],e=e.behind}while(e)}entries(){return this[Symbol.iterator]()}*keys(){let e=this.first;if(e)do{yield e,e=e.behind}while(e)}*values(){let e=this.first;if(e)do{yield e.value,e=e.behind}while(e)}getItemByIndex(e){if(void 0===e)throw new Error("index must be a number!");if(!this.first)return;let t;if(e>0)for(t=this.first;t&&e--;)t=t.behind;else{if(!(e<0))return this.first;for(t=this.last;t&&++e;)t=t.before}return t}}t.LinkedList=o},function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}r.r(t);var i=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";n(this,t);var r=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return Object.defineProperty(r,"message",{configurable:!0,enumerable:!1,value:e,writable:!0}),Object.defineProperty(r,"name",{configurable:!0,enumerable:!1,value:r.constructor.name,writable:!0}),Error.hasOwnProperty("captureStackTrace")?(Error.captureStackTrace(r,r.constructor),o(r)):(Object.defineProperty(r,"stack",{configurable:!0,enumerable:!1,value:new Error(e).stack,writable:!0}),r)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t}(function(e){function t(){e.apply(this,arguments)}return t.prototype=Object.create(e.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e,t}(Error));t.default=i},function(e,t,r){"use strict";function n(e,t){return Object.prototype.hasOwnProperty.call(e,t)}e.exports=function(e,t,r,i){t=t||"&",r=r||"=";var a={};if("string"!=typeof e||0===e.length)return a;var u=/\+/g;e=e.split(t);var s=1e3;i&&"number"==typeof i.maxKeys&&(s=i.maxKeys);var c=e.length;s>0&&c>s&&(c=s);for(var l=0;l<c;++l){var h,f,p,d,y=e[l].replace(u,"%20"),v=y.indexOf(r);v>=0?(h=y.substr(0,v),f=y.substr(v+1)):(h=y,f=""),p=decodeURIComponent(h),d=decodeURIComponent(f),n(a,p)?o(a[p])?a[p].push(d):a[p]=[a[p],d]:a[p]=d}return a};var o=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)}},function(e,t,r){"use strict";var n=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};e.exports=function(e,t,r,u){return t=t||"&",r=r||"=",null===e&&(e=void 0),"object"==typeof e?i(a(e),(function(a){var u=encodeURIComponent(n(a))+r;return o(e[a])?i(e[a],(function(e){return u+encodeURIComponent(n(e))})).join(t):u+encodeURIComponent(n(e[a]))})).join(t):u?encodeURIComponent(n(u))+r+encodeURIComponent(n(e)):""};var o=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};function i(e,t){if(e.map)return e.map(t);for(var r=[],n=0;n<e.length;n++)r.push(t(e[n],n));return r}var a=Object.keys||function(e){var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.push(r);return t}},function(e,t,r){(function(e,n){var o;/*! https://mths.be/punycode v1.4.1 by @mathias */!function(i){t&&t.nodeType,e&&e.nodeType;var a="object"==typeof n&&n;a.global!==a&&a.window!==a&&a.self;var u,s=2147483647,c=/^xn--/,l=/[^\x20-\x7E]/,h=/[\x2E\u3002\uFF0E\uFF61]/g,f={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},p=Math.floor,d=String.fromCharCode;function y(e){throw new RangeError(f[e])}function v(e,t){for(var r=e.length,n=[];r--;)n[r]=t(e[r]);return n}function m(e,t){var r=e.split("@"),n="";return r.length>1&&(n=r[0]+"@",e=r[1]),n+v((e=e.replace(h,".")).split("."),t).join(".")}function b(e){for(var t,r,n=[],o=0,i=e.length;o<i;)(t=e.charCodeAt(o++))>=55296&&t<=56319&&o<i?56320==(64512&(r=e.charCodeAt(o++)))?n.push(((1023&t)<<10)+(1023&r)+65536):(n.push(t),o--):n.push(t);return n}function g(e){return v(e,(function(e){var t="";return e>65535&&(t+=d((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+=d(e)})).join("")}function w(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function _(e,t,r){var n=0;for(e=r?p(e/700):e>>1,e+=p(e/t);e>455;n+=36)e=p(e/35);return p(n+36*e/(e+38))}function k(e){var t,r,n,o,i,a,u,c,l,h,f,d=[],v=e.length,m=0,b=128,w=72;for((r=e.lastIndexOf("-"))<0&&(r=0),n=0;n<r;++n)e.charCodeAt(n)>=128&&y("not-basic"),d.push(e.charCodeAt(n));for(o=r>0?r+1:0;o<v;){for(i=m,a=1,u=36;o>=v&&y("invalid-input"),((c=(f=e.charCodeAt(o++))-48<10?f-22:f-65<26?f-65:f-97<26?f-97:36)>=36||c>p((s-m)/a))&&y("overflow"),m+=c*a,!(c<(l=u<=w?1:u>=w+26?26:u-w));u+=36)a>p(s/(h=36-l))&&y("overflow"),a*=h;w=_(m-i,t=d.length+1,0==i),p(m/t)>s-b&&y("overflow"),b+=p(m/t),m%=t,d.splice(m++,0,b)}return g(d)}function O(e){var t,r,n,o,i,a,u,c,l,h,f,v,m,g,k,O=[];for(v=(e=b(e)).length,t=128,r=0,i=72,a=0;a<v;++a)(f=e[a])<128&&O.push(d(f));for(n=o=O.length,o&&O.push("-");n<v;){for(u=s,a=0;a<v;++a)(f=e[a])>=t&&f<u&&(u=f);for(u-t>p((s-r)/(m=n+1))&&y("overflow"),r+=(u-t)*m,t=u,a=0;a<v;++a)if((f=e[a])<t&&++r>s&&y("overflow"),f==t){for(c=r,l=36;!(c<(h=l<=i?1:l>=i+26?26:l-i));l+=36)k=c-h,g=36-h,O.push(d(w(h+k%g,0))),c=p(k/g);O.push(d(w(c,0))),i=_(r,m,n==o),r=0,++n}++r,++t}return O.join("")}u={version:"1.4.1",ucs2:{decode:b,encode:g},decode:k,encode:O,toASCII:function(e){return m(e,(function(e){return l.test(e)?"xn--"+O(e):e}))},toUnicode:function(e){return m(e,(function(e){return c.test(e)?k(e.slice(4).toLowerCase()):e}))}},void 0===(o=function(){return u}.call(t,r,t,e))||(e.exports=o)}()}).call(this,r(22)(e),r(12))},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t,r){"use strict";e.exports={isString:function(e){return"string"==typeof e},isObject:function(e){return"object"==typeof e&&null!==e},isNull:function(e){return null===e},isNullOrUndefined:function(e){return null==e}}},function(e,t){var r,n,o=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function u(e){if(r===setTimeout)return setTimeout(e,0);if((r===i||!r)&&setTimeout)return r=setTimeout,setTimeout(e,0);try{return r(e,0)}catch(t){try{return r.call(null,e,0)}catch(t){return r.call(this,e,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:i}catch(e){r=i}try{n="function"==typeof clearTimeout?clearTimeout:a}catch(e){n=a}}();var s,c=[],l=!1,h=-1;function f(){l&&s&&(l=!1,s.length?c=s.concat(c):h=-1,c.length&&p())}function p(){if(!l){var e=u(f);l=!0;for(var t=c.length;t;){for(s=c,c=[];++h<t;)s&&s[h].run();h=-1,t=c.length}s=null,l=!1,function(e){if(n===clearTimeout)return clearTimeout(e);if((n===a||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(e);try{n(e)}catch(t){try{return n.call(null,e)}catch(t){return n.call(this,e)}}}(e)}}function d(e,t){this.fun=e,this.array=t}function y(){}o.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];c.push(new d(e,t)),1!==c.length||l||u(p)},d.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=y,o.addListener=y,o.once=y,o.off=y,o.removeListener=y,o.removeAllListeners=y,o.emit=y,o.prependListener=y,o.prependOnceListener=y,o.listeners=function(e){return[]},o.binding=function(e){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(e){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},function(e,t,r){"use strict";var n=r(26),o=r(27),i=r(28),a=r(29);function u(e,t,r){var n=e;return o(t)?(r=t,"string"==typeof e&&(n={uri:e})):n=a(t,{uri:e}),n.callback=r,n}function s(e,t,r){return c(t=u(e,t,r))}function c(e){if(void 0===e.callback)throw new Error("callback argument missing");var t=!1,r=function(r,n,o){t||(t=!0,e.callback(r,n,o))};function n(){var e=void 0;if(e=l.response?l.response:l.responseText||function(e){try{if("document"===e.responseType)return e.responseXML;var t=e.responseXML&&"parsererror"===e.responseXML.documentElement.nodeName;if(""===e.responseType&&!t)return e.responseXML}catch(e){}return null}(l),m)try{e=JSON.parse(e)}catch(e){}return e}function o(e){return clearTimeout(h),e instanceof Error||(e=new Error(""+(e||"Unknown XMLHttpRequest Error"))),e.statusCode=0,r(e,b)}function a(){if(!c){var t;clearTimeout(h),t=e.useXDR&&void 0===l.status?200:1223===l.status?204:l.status;var o=b,a=null;return 0!==t?(o={body:n(),statusCode:t,method:p,headers:{},url:f,rawRequest:l},l.getAllResponseHeaders&&(o.headers=i(l.getAllResponseHeaders()))):a=new Error("Internal XMLHttpRequest Error"),r(a,o,o.body)}}var u,c,l=e.xhr||null;l||(l=e.cors||e.useXDR?new s.XDomainRequest:new s.XMLHttpRequest);var h,f=l.url=e.uri||e.url,p=l.method=e.method||"GET",d=e.body||e.data,y=l.headers=e.headers||{},v=!!e.sync,m=!1,b={body:void 0,headers:{},statusCode:0,method:p,url:f,rawRequest:l};if("json"in e&&!1!==e.json&&(m=!0,y.accept||y.Accept||(y.Accept="application/json"),"GET"!==p&&"HEAD"!==p&&(y["content-type"]||y["Content-Type"]||(y["Content-Type"]="application/json"),d=JSON.stringify(!0===e.json?d:e.json))),l.onreadystatechange=function(){4===l.readyState&&setTimeout(a,0)},l.onload=a,l.onerror=o,l.onprogress=function(){},l.onabort=function(){c=!0},l.ontimeout=o,l.open(p,f,!v,e.username,e.password),v||(l.withCredentials=!!e.withCredentials),!v&&e.timeout>0&&(h=setTimeout((function(){if(!c){c=!0,l.abort("timeout");var e=new Error("XMLHttpRequest timeout");e.code="ETIMEDOUT",o(e)}}),e.timeout)),l.setRequestHeader)for(u in y)y.hasOwnProperty(u)&&l.setRequestHeader(u,y[u]);else if(e.headers&&!function(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0}(e.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in e&&(l.responseType=e.responseType),"beforeSend"in e&&"function"==typeof e.beforeSend&&e.beforeSend(l),l.send(d||null),l}e.exports=s,e.exports.default=s,s.XMLHttpRequest=n.XMLHttpRequest||function(){},s.XDomainRequest="withCredentials"in new s.XMLHttpRequest?s.XMLHttpRequest:n.XDomainRequest,function(e,t){for(var r=0;r<e.length;r++)t(e[r])}(["get","put","post","patch","head","delete"],(function(e){s["delete"===e?"del":e]=function(t,r,n){return(r=u(t,r,n)).method=e.toUpperCase(),c(r)}}))},function(e,t,r){(function(t){var r;r="undefined"!=typeof window?window:void 0!==t?t:"undefined"!=typeof self?self:{},e.exports=r}).call(this,r(12))},function(e,t){e.exports=function(e){if(!e)return!1;var t=r.call(e);return"[object Function]"===t||"function"==typeof e&&"[object RegExp]"!==t||"undefined"!=typeof window&&(e===window.setTimeout||e===window.alert||e===window.confirm||e===window.prompt)};var r=Object.prototype.toString},function(e,t){var r=function(e){return e.replace(/^\s+|\s+$/g,"")};e.exports=function(e){if(!e)return{};for(var t,n={},o=r(e).split("\n"),i=0;i<o.length;i++){var a=o[i],u=a.indexOf(":"),s=r(a.slice(0,u)).toLowerCase(),c=r(a.slice(u+1));void 0===n[s]?n[s]=c:(t=n[s],"[object Array]"===Object.prototype.toString.call(t)?n[s].push(c):n[s]=[n[s],c])}return n}},function(e,t){e.exports=function(){for(var e={},t=0;t<arguments.length;t++){var n=arguments[t];for(var o in n)r.call(n,o)&&(e[o]=n[o])}return e};var r=Object.prototype.hasOwnProperty},function(e,t,r){"use strict";r.r(t),r.d(t,"isArangoDatabase",(function(){return ge})),r.d(t,"Database",(function(){return _e}));var n=r(1),o=r(3);function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function a(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?i(Object(r),!0).forEach((function(t){c(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function u(e,t,r,n,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void r(e)}u.done?t(s):Promise.resolve(s).then(n,o)}function s(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function c(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var l=function(){function e(t,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),c(this,"_name",void 0),c(this,"_db",void 0),this._db=t,this._name=r.normalize("NFC")}var t,r,i,l,h;return t=e,(r=[{key:"isArangoAnalyzer",get:function(){return!0}},{key:"name",get:function(){return this._name}},{key:"exists",value:(l=regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.get();case 3:return e.abrupt("return",!0);case 6:if(e.prev=6,e.t0=e.catch(0),!Object(n.c)(e.t0)||e.t0.errorNum!==o.a){e.next=10;break}return e.abrupt("return",!1);case 10:throw e.t0;case 11:case"end":return e.stop()}}),e,this,[[0,6]])})),h=function(){var e=this,t=arguments;return new Promise((function(r,n){var o=l.apply(e,t);function i(e){u(o,r,n,i,a,"next",e)}function a(e){u(o,r,n,i,a,"throw",e)}i(void 0)}))},function(){return h.apply(this,arguments)})},{key:"get",value:function(){return this._db.request({path:"/_api/analyzer/".concat(encodeURIComponent(this._name))},(function(e){return e.body}))}},{key:"create",value:function(e){return this._db.request({method:"POST",path:"/_api/analyzer",body:a({name:this._name},e)},(function(e){return e.body}))}},{key:"drop",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this._db.request({method:"DELETE",path:"/_api/analyzer/".concat(encodeURIComponent(this._name)),qs:{force:e}},(function(e){return e.body}))}}])&&s(t.prototype,r),i&&s(t,i),Object.defineProperty(t,"prototype",{writable:!1}),e}(),h=r(4),f=r(0),p=r(9),d=r(6);function y(e){return window.btoa(e)}var v=r(10),m=r(13);var b=r(25),g=["auth"];function w(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function _(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?w(Object(r),!0).forEach((function(t){k(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):w(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function k(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function O(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function x(e,t){var r=Object(v.parse)(e),n=r.auth,o=O(r,g),i=function(e,t){for(var r={},n=0,o=Object.keys(e);n<o.length;n++){var i=o[n];t.includes(i)||(r[i]=e[i])}return r}(t,["maxSockets"]);return function(e,t){var r=e.method,a=e.url,u=e.headers,s=e.body,c=e.timeout,l=e.expectBinary,h=_(_({},o),{},{pathname:a.pathname?o.pathname?Object(m.join)(o.pathname,a.pathname):a.pathname:o.pathname,search:a.search?o.search?"".concat(o.search,"&").concat(a.search.slice(1)):a.search:o.search});u.authorization||(u.authorization="Basic ".concat(y(n||"root:")));var f=function(e,r){f=function(){},t(e,r)},p=b(_(_({useXDR:!0,withCredentials:!0},i),{},{responseType:l?"blob":"text",url:Object(v.format)(h),body:s,method:r,headers:u,timeout:c}),(function(e,t){if(e){var r=e;r.request=p,i.after&&i.after(r),f(r)}else{var n=t;n.request=p,n.body||(n.body=""),i.after&&i.after(null,n),f(null,n)}}));i.before&&i.before(p)}}var j=["host","method","body","expectBinary","isBinary","allowDirtyRead","retryOnConflict","timeout","headers"];function R(e){return(R="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function q(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function S(e,t,r,n,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void r(e)}u.done?t(s):Promise.resolve(s).then(n,o)}function T(e){return function(e){if(Array.isArray(e))return A(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||E(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function P(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==r)return;var n,o,i=[],a=!0,u=!1;try{for(r=r.call(e);!(a=(n=r.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){u=!0,o=e}finally{try{a||null==r.return||r.return()}finally{if(u)throw o}}return i}(e,t)||E(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 C(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=E(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}function E(e,t){if(e){if("string"==typeof e)return A(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?A(e,t):void 0}}function A(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function I(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function U(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?I(Object(r),!0).forEach((function(t){N(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):I(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function D(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function L(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function N(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var F=/\/(json|javascript)(\W|$)/;function H(e){return e.hasOwnProperty("token")}var B=function(){function e(){var t,r,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};D(this,e),N(this,"_activeTasks",0),N(this,"_agent",void 0),N(this,"_agentOptions",void 0),N(this,"_arangoVersion",30400),N(this,"_headers",void 0),N(this,"_loadBalancingStrategy",void 0),N(this,"_useFailOver",void 0),N(this,"_shouldRetry",void 0),N(this,"_maxRetries",void 0),N(this,"_maxTasks",void 0),N(this,"_queue",new d.LinkedList),N(this,"_databases",new Map),N(this,"_hosts",[]),N(this,"_urls",[]),N(this,"_activeHost",void 0),N(this,"_activeDirtyHost",void 0),N(this,"_transactionId",null),N(this,"_precaptureStackTraces",void 0),N(this,"_responseQueueTimeSamples",void 0),N(this,"_queueTimes",new d.LinkedList);var o,i=n.url?Array.isArray(n.url)?n.url:[n.url]:["http://localhost:8529"],a=3*("ROUND_ROBIN"===n.loadBalancingStrategy?i.length:1);(void 0!==n.arangoVersion&&(this._arangoVersion=n.arangoVersion),this._agent=n.agent,this._agentOptions=U({maxSockets:a},n.agentOptions),this._maxTasks=this._agentOptions.maxSockets,this._headers=U({},n.headers),this._loadBalancingStrategy=null!==(t=n.loadBalancingStrategy)&&void 0!==t?t:"NONE",this._useFailOver="ROUND_ROBIN"!==this._loadBalancingStrategy,this._precaptureStackTraces=Boolean(n.precaptureStackTraces),this._responseQueueTimeSamples=null!==(r=n.responseQueueTimeSamples)&&void 0!==r?r:10,this._responseQueueTimeSamples<0&&(this._responseQueueTimeSamples=1/0),!1===n.maxRetries)?(this._shouldRetry=!1,this._maxRetries=0):(this._shouldRetry=!0,this._maxRetries=null!==(o=n.maxRetries)&&void 0!==o?o:0);this.addToHostList(i),n.auth&&(H(n.auth)?this.setBearerAuth(n.auth):this.setBasicAuth(n.auth)),"ONE_RANDOM"===this._loadBalancingStrategy?(this._activeHost=Math.floor(Math.random()*this._hosts.length),this._activeDirtyHost=Math.floor(Math.random()*this._hosts.length)):(this._activeHost=0,this._activeDirtyHost=0)}var t,r,i,a,u;return t=e,(r=[{key:"isArangoConnection",get:function(){return!0}},{key:"queueTime",get:function(){var e=this;return{getLatest:function(){var t;return null===(t=e._queueTimes.last)||void 0===t?void 0:t.value[1]},getValues:function(){return Array.from(e._queueTimes.values())},getAvg:function(){var t,r=0,n=C(e._queueTimes);try{for(n.s();!(t=n.n()).done;){var o=P(t.value,2);r+=P(o[1],2)[1]/e._queueTimes.length}}catch(e){n.e(e)}finally{n.f()}return r}}}},{key:"_runQueue",value:function(){var e=this;if(this._queue.length&&!(this._activeTasks>=this._maxTasks)){var t=this._queue.shift(),r=this._activeHost;void 0!==t.host?r=t.host:t.allowDirtyRead?(r=this._activeDirtyHost,this._activeDirtyHost=(this._activeDirtyHost+1)%this._hosts.length,t.options.headers["x-arango-allow-dirty-read"]="true"):"ROUND_ROBIN"===this._loadBalancingStrategy&&(this._activeHost=(this._activeHost+1)%this._hosts.length),this._activeTasks+=1;var i=function(i,a){if(e._activeTasks-=1,i)!t.allowDirtyRead&&e._hosts.length>1&&e._activeHost===r&&e._useFailOver&&(e._activeHost=(e._activeHost+1)%e._hosts.length),Object(n.c)(i)&&i.errorNum===o.e&&t.retryOnConflict>0?(t.retryOnConflict-=1,e._queue.push(t)):!t.host&&e._shouldRetry&&t.retries<(e._maxRetries||e._hosts.length-1)&&Object(n.e)(i)&&"connect"===i.syscall&&"ECONNREFUSED"===i.code?(t.retries+=1,e._queue.push(t)):(t.stack&&(i.stack+=t.stack()),t.reject(i));else{var u=a;if(503===u.statusCode&&u.headers["x-arango-endpoint"]){var s=u.headers["x-arango-endpoint"],c=P(e.addToHostList(s),1)[0];t.host=c,e._activeHost===r&&(e._activeHost=c),e._queue.push(t)}else u.arangojsHostId=r,t.resolve(u)}e._runQueue()};try{this._hosts[r](t.options,i)}catch(e){i(e)}}}},{key:"_buildUrl",value:function(e){var t,r=e.basePath,n=e.path,o=e.qs,i="".concat(r||"").concat(n||"");return o&&(t="?".concat("string"==typeof o?o:Object(p.stringify)(function(e){for(var t={},r=0,n=Object.keys(e);r<n.length;r++){var o=n[r],i=e[o];void 0!==i&&(t[o]=i)}return t}(o)))),t?{pathname:i,search:t}:{pathname:i}}},{key:"setBearerAuth",value:function(e){this.setHeader("authorization","Bearer ".concat(e.token))}},{key:"setBasicAuth",value:function(e){this.setHeader("authorization","Basic ".concat(y("".concat(e.username,":").concat(e.password))))}},{key:"setResponseQueueTimeSamples",value:function(e){for(e<0&&(e=1/0),this._responseQueueTimeSamples=e;this._responseQueueTimeSamples<this._queueTimes.length;)this._queueTimes.shift()}},{key:"database",value:function(e){function t(t,r){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}((function(e,t){if(null!==t)return t?(this._databases.set(e,t),t):this._databases.get(e);this._databases.delete(e)}))},{key:"addToHostList",value:function(e){var t,r,n=this,o=(Array.isArray(e)?e:[e]).map((function(e){return function(e){var t=e.match(/^(tcp|ssl|tls)((?::|\+).+)/);t&&(e=("tcp"===t[1]?"http":"https")+t[2]);var r=e.match(/^(?:(http|https)\+)?unix:\/\/(\/.+)/);return r&&(e="".concat(r[1]||"http","://unix:").concat(r[2])),e}(e)})),i=o.filter((function(e){return-1===n._urls.indexOf(e)}));return(t=this._urls).push.apply(t,T(i)),(r=this._hosts).push.apply(r,T(i.map((function(e){return x(e,n._agentOptions,n._agent)})))),o.map((function(e){return n._urls.indexOf(e)}))}},{key:"setTransactionId",value:function(e){this._transactionId=e}},{key:"clearTransactionId",value:function(){this._transactionId=null}},{key:"setHeader",value:function(e,t){null===t?delete this._headers[e]:this._headers[e]=t}},{key:"close",value:function(){var e,t=C(this._hosts);try{for(t.s();!(e=t.n()).done;){var r=e.value;r.close&&r.close()}}catch(e){t.e(e)}finally{t.f()}}},{key:"waitForPropagation",value:(a=regeneratorRuntime.mark((function e(t){var r,n,o,i,a,u=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=u.length>1&&void 0!==u[1]?u[1]:1/0,n=this._hosts.length,o=[],i=Date.now(),a=0;case 5:if(o.length!==n){e.next=8;break}return e.abrupt("return");case 8:for(;o.includes(a);)a=(a+1)%n;return e.prev=9,e.next=12,this.request(U(U({},t),{},{host:a}));case 12:e.next=21;break;case 14:if(e.prev=14,e.t0=e.catch(9),!(i+r<Date.now())){e.next=18;break}throw e.t0;case 18:return e.next=20,new Promise((function(e){return setTimeout(e,1e3)}));case 20:return e.abrupt("continue",5);case 21:o.includes(a)||o.push(a),e.next=5;break;case 24:case"end":return e.stop()}}),e,this,[[9,14]])})),u=function(){var e=this,t=arguments;return new Promise((function(r,n){var o=a.apply(e,t);function i(e){S(o,r,n,i,u,"next",e)}function u(e){S(o,r,n,i,u,"throw",e)}i(void 0)}))},function(e){return u.apply(this,arguments)})},{key:"request",value:function(e,t){var r=this,o=e.host,i=e.method,a=void 0===i?"GET":i,u=e.body,s=e.expectBinary,c=void 0!==s&&s,l=e.isBinary,h=void 0!==l&&l,f=e.allowDirtyRead,p=void 0!==f&&f,d=e.retryOnConflict,y=void 0===d?0:d,v=e.timeout,m=void 0===v?0:v,b=e.headers,g=q(e,j);return new Promise((function(e,i){var s="text/plain";h?s="application/octet-stream":u&&("object"===R(u)?(u=JSON.stringify(u),s="application/json"):u=String(u));var l=U(U({},r._headers),{},{"content-type":s,"x-arango-version":String(r._arangoVersion)});r._transactionId&&(l["x-arango-trx-id"]=r._transactionId);var f={retries:0,host:o,allowDirtyRead:p,retryOnConflict:y,options:{url:r._buildUrl(g),headers:U(U({},l),b),timeout:m,method:a,expectBinary:c,body:u},reject:i,resolve:function(o){var a=o.headers["content-type"],u=o.headers["x-arango-queue-time-seconds"];if(u)for(r._queueTimes.push([Date.now(),Number(u)]);r._responseQueueTimeSamples<r._queueTimes.length;)r._queueTimes.shift();var s=void 0;if(o.body.length&&a&&a.match(F))try{s=o.body,s=JSON.parse(s)}catch(e){if(!c)return"string"!=typeof s&&(s=o.body.toString("utf-8")),e.response=o,f.stack&&(e.stack+=f.stack()),void i(e)}else s=o.body&&!c?o.body.toString("utf-8"):o.body;if(Object(n.d)(s)){o.body=s;var l=new n.a(o);f.stack&&(l.stack+=f.stack()),i(l)}else if(o.statusCode&&o.statusCode>=400){o.body=s;var h=new n.b(o);f.stack&&(h.stack+=f.stack()),i(h)}else c||(o.body=s),e(t?t(o):o)}};if(r._precaptureStackTraces)if("function"==typeof Error.captureStackTrace){var d={};Error.captureStackTrace(d),f.stack=function(){return"\n".concat(d.stack.split("\n").slice(3).join("\n"))}}else{var v=function(){var e=new Error;if(!e.stack)try{throw e}catch(t){e=t}return e}();Object.prototype.hasOwnProperty.call(v,"stack")&&(f.stack=function(){return"\n".concat(v.stack.split("\n").slice(4).join("\n"))})}r._queue.push(f),r._runQueue()}))}}])&&L(t.prototype,r),i&&L(t,i),Object.defineProperty(t,"prototype",{writable:!1}),e}(),M=r(5),z=r(8);function V(e){return(V="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)}function G(e,t){var r;try{r=new FormData;for(var n=0,o=Object.keys(e);n<o.length;n++){var i=o[n],a=e[i];void 0!==a&&(a instanceof Blob||"object"!==V(a)&&"function"!=typeof a||(a=JSON.stringify(a)),r.append(i,a))}}catch(e){return void t(e)}t(null,{body:r})}function Q(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function X(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Q(Object(r),!0).forEach((function(t){W(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Q(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function $(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function J(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function W(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var K=function(){function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};$(this,e),W(this,"_db",void 0),W(this,"_path",void 0),W(this,"_headers",void 0),r?"/"!==r.charAt(0)&&(r="/".concat(r)):r="",this._db=t,this._path=r,this._headers=n}var t,r,n;return t=e,(r=[{key:"route",value:function(t,r){return t?"/"!==t.charAt(0)&&(t="/".concat(t)):t="",new e(this._db,this._path+t,X(X({},this._headers),r))}},{key:"request",value:function(e){var t=X({},e);return t.path&&"/"!==t.path?this._path&&"/"!==t.path.charAt(0)?t.path="/".concat(t.path):t.path=t.path:t.path="",t.basePath=this._path,t.headers=X(X({},this._headers),t.headers),t.method=t.method?t.method.toUpperCase():"GET",this._db.request(t)}},{key:"delete",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n="string"==typeof t[0]?t.shift():void 0,o=t[0],i=t[1];return this.request({method:"DELETE",path:n,qs:o,headers:i})}},{key:"get",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n="string"==typeof t[0]?t.shift():void 0,o=t[0],i=t[1];return this.request({method:"GET",path:n,qs:o,headers:i})}},{key:"head",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n="string"==typeof t[0]?t.shift():void 0,o=t[0],i=t[1];return this.request({method:"HEAD",path:n,qs:o,headers:i})}},{key:"patch",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n="string"==typeof t[0]?t.shift():void 0,o=t[0],i=t[1],a=t[2];return this.request({method:"PATCH",path:n,body:o,qs:i,headers:a})}},{key:"post",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n="string"==typeof t[0]?t.shift():void 0,o=t[0],i=t[1],a=t[2];return this.request({method:"POST",path:n,body:o,qs:i,headers:a})}},{key:"put",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n="string"==typeof t[0]?t.shift():void 0,o=t[0],i=t[1],a=t[2];return this.request({method:"PUT",path:n,body:o,qs:i,headers:a})}}])&&J(t.prototype,r),n&&J(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Y(e,t,r,n,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void r(e)}u.done?t(s):Promise.resolve(s).then(n,o)}function Z(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function ee(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var te=function(){function e(t,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),ee(this,"_db",void 0),ee(this,"_id",void 0),this._db=t,this._id=r}var t,r,i,a,u;return t=e,(r=[{key:"isArangoTransaction",get:function(){return!0}},{key:"id",get:function(){return this._id}},{key:"exists",value:(a=regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.get();case 3:return e.abrupt("return",!0);case 6:if(e.prev=6,e.t0=e.catch(0),!Object(n.c)(e.t0)||e.t0.errorNum!==o.g){e.next=10;break}return e.abrupt("return",!1);case 10:throw e.t0;case 11:case"end":return e.stop()}}),e,this,[[0,6]])})),u=function(){var e=this,t=arguments;return new Promise((function(r,n){var o=a.apply(e,t);function i(e){Y(o,r,n,i,u,"next",e)}function u(e){Y(o,r,n,i,u,"throw",e)}i(void 0)}))},function(){return u.apply(this,arguments)})},{key:"get",value:function(){return this._db.request({path:"/_api/transaction/".concat(encodeURIComponent(this.id))},(function(e){return e.body.result}))}},{key:"commit",value:function(){return this._db.request({method:"PUT",path:"/_api/transaction/".concat(encodeURIComponent(this.id))},(function(e){return e.body.result}))}},{key:"abort",value:function(){return this._db.request({method:"DELETE",path:"/_api/transaction/".concat(encodeURIComponent(this.id))},(function(e){return e.body.result}))}},{key:"step",value:function(e){var t=this._db._connection;t.setTransactionId(this.id);try{var r=e();if(!r)throw new Error("Transaction callback was not an async function or did not return a promise!");return Promise.resolve(r)}finally{t.clearTransactionId()}}}])&&Z(t.prototype,r),i&&Z(t,i),Object.defineProperty(t,"prototype",{writable:!1}),e}(),re=r(7),ne=["databaseName"],oe=["absolutePath","basePath"],ie=["basePath"],ae=["users"],ue=["allowDirtyRead","retryOnConflict","count","batchSize","cache","memoryLimit","ttl","timeout"],se=["configuration","dependencies"],ce=["configuration","dependencies"],le=["configuration","dependencies"];function he(e,t,r,n,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void r(e)}u.done?t(s):Promise.resolve(s).then(n,o)}function fe(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(e){he(i,n,o,a,u,"next",e)}function u(e){he(i,n,o,a,u,"throw",e)}a(void 0)}))}}function pe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function de(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?pe(Object(r),!0).forEach((function(t){be(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):pe(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function ye(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function ve(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function me(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function be(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ge(e){return Boolean(e&&e.isArangoDatabase)}function we(e){if("string"==typeof e)return{write:[e]};if(Array.isArray(e))return{write:e.map(f.collectionToString)};if(Object(f.isArangoCollection)(e))return{write:Object(f.collectionToString)(e)};var t={};return e&&(void 0!==e.allowImplicit&&(t.allowImplicit=e.allowImplicit),e.read&&(t.read=Array.isArray(e.read)?e.read.map(f.collectionToString):Object(f.collectionToString)(e.read)),e.write&&(t.write=Array.isArray(e.write)?e.write.map(f.collectionToString):Object(f.collectionToString)(e.write)),e.exclusive&&(t.exclusive=Array.isArray(e.exclusive)?e.exclusive.map(f.collectionToString):Object(f.collectionToString)(e.exclusive))),t}var _e=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;if(ve(this,e),be(this,"_connection",void 0),be(this,"_name",void 0),be(this,"_analyzers",new Map),be(this,"_collections",new Map),be(this,"_graphs",new Map),be(this,"_views",new Map),ge(t)){var n=t._connection,o=(r||t.name).normalize("NFC");this._connection=n,this._name=o;var i=n.database(o);if(i)return i}else{var a=t,u="string"==typeof a||Array.isArray(a)?{databaseName:r,url:a}:a,s=u.databaseName,c=ye(u,ne);this._connection=new B(c),this._name=(null==s?void 0:s.normalize("NFC"))||"_system"}}var t,r,i,a,u,s,c,p,d,y,v,m,b,g,w,_,k,O,x,j,R,q,S,T,P,C,E;return t=e,(r=[{key:"isArangoDatabase",get:function(){return!0}},{key:"name",get:function(){return this._name}},{key:"version",value:function(e){return this.request({method:"GET",path:"/_api/version",qs:{details:e}},(function(e){return e.body}))}},{key:"route",value:function(e,t){return new K(this,e,t)}},{key:"request",value:function(e,t){var r=e.absolutePath,n=void 0!==r&&r,o=e.basePath,i=ye(e,oe);return n||(o="/_db/".concat(encodeURIComponent(this._name)).concat(o||"")),this._connection.request(de({basePath:o},i),t)}},{key:"acquireHostList",value:(E=fe(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.request({path:"/_api/cluster/endpoints"},(function(e){return e.body.endpoints.map((function(e){return e.endpoint}))}));case 2:t=e.sent,this._connection.addToHostList(t);case 4:case"end":return e.stop()}}),e,this)}))),function(){return E.apply(this,arguments)})},{key:"close",value:function(){this._connection.close()}},{key:"waitForPropagation",value:(C=fe(regeneratorRuntime.mark((function e(t,r){var n,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.basePath,o=ye(t,ie),e.next=3,this._connection.waitForPropagation(de(de({},o),{},{basePath:"/_db/".concat(encodeURIComponent(this._name)).concat(n||"")}),r);case 3:case"end":return e.stop()}}),e,this)}))),function(e,t){return C.apply(this,arguments)})},{key:"queueTime",get:function(){return this._connection.queueTime}},{key:"setResponseQueueTimeSamples",value:function(e){this._connection.setResponseQueueTimeSamples(e)}},{key:"useDatabase",value:function(e){return this._connection.database(this._name,null),this._name=e.normalize("NFC"),this}},{key:"useBasicAuth",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"root",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return this._connection.setBasicAuth({username:e,password:t}),this}},{key:"useBearerAuth",value:function(e){return this._connection.setBearerAuth({token:e}),this}},{key:"login",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"root",r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return this.request({method:"POST",path:"/_open/auth",body:{username:t,password:r}},(function(t){return e.useBearerAuth(t.body.jwt),t.body.jwt}))}},{key:"database",value:function(t){return new e(this,t)}},{key:"get",value:function(){return this.request({path:"/_api/database/current"},(function(e){return e.body.result}))}},{key:"exists",value:(P=fe(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.get();case 3:return e.abrupt("return",!0);case 6:if(e.prev=6,e.t0=e.catch(0),!Object(n.c)(e.t0)||e.t0.errorNum!==o.c){e.next=10;break}return e.abrupt("return",!1);case 10:throw e.t0;case 11:case"end":return e.stop()}}),e,this,[[0,6]])}))),function(){return P.apply(this,arguments)})},{key:"createDatabase",value:function(e,t){var r=this,n=Array.isArray(t)?{users:t}:t||{},o=n.users,i=ye(n,ae);return this.request({method:"POST",path:"/_api/database",body:{name:e.normalize("NFC"),users:o,options:i}},(function(){return r.database(e)}))}},{key:"listDatabases",value:function(){return this.request({path:"/_api/database"},(function(e){return e.body.result}))}},{key:"listUserDatabases",value:function(){return this.request({path:"/_api/database/user"},(function(e){return e.body.result}))}},{key:"databases",value:function(){var e=this;return this.request({path:"/_api/database"},(function(t){return t.body.result.map((function(t){return e.database(t)}))}))}},{key:"userDatabases",value:function(){var e=this;return this.request({path:"/_api/database/user"},(function(t){return t.body.result.map((function(t){return e.database(t)}))}))}},{key:"dropDatabase",value:function(e){return e=e.normalize("NFC"),this.request({method:"DELETE",path:"/_api/database/".concat(encodeURIComponent(e))},(function(e){return e.body.result}))}},{key:"collection",value:function(e){return e=e.normalize("NFC"),this._collections.has(e)||this._collections.set(e,new f.Collection(this,e)),this._collections.get(e)}},{key:"createCollection",value:(T=fe(regeneratorRuntime.mark((function e(t,r){var n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=this.collection(t),e.next=3,n.create(r);case 3:return e.abrupt("return",n);case 4:case"end":return e.stop()}}),e,this)}))),function(e,t){return T.apply(this,arguments)})},{key:"createEdgeCollection",value:(S=fe(regeneratorRuntime.mark((function e(t,r){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.createCollection(t,de(de({},r),{},{type:f.CollectionType.EDGE_COLLECTION})));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return S.apply(this,arguments)})},{key:"renameCollection",value:(q=fe(regeneratorRuntime.mark((function e(t,r){var n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=t.normalize("NFC"),e.next=3,this.request({method:"PUT",path:"/_api/collection/".concat(encodeURIComponent(t),"/rename"),body:{name:r.normalize("NFC")}},(function(e){return e.body}));case 3:return n=e.sent,this._collections.delete(t),e.abrupt("return",n);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return q.apply(this,arguments)})},{key:"listCollections",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this.request({path:"/_api/collection",qs:{excludeSystem:e}},(function(e){return e.body.result}))}},{key:"collections",value:(R=fe(regeneratorRuntime.mark((function e(){var t,r,n=this,o=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=!(o.length>0&&void 0!==o[0])||o[0],e.next=3,this.listCollections(t);case 3:return r=e.sent,e.abrupt("return",r.map((function(e){return n.collection(e.name)})));case 5:case"end":return e.stop()}}),e,this)}))),function(){return R.apply(this,arguments)})},{key:"graph",value:function(e){return e=e.normalize("NFC"),this._graphs.has(e)||this._graphs.set(e,new z.a(this,e)),this._graphs.get(e)}},{key:"createGraph",value:(j=fe(regeneratorRuntime.mark((function e(t,r,n){var o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=this.graph(t.normalize("NFC")),e.next=3,o.create(r,n);case 3:return e.abrupt("return",o);case 4:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return j.apply(this,arguments)})},{key:"listGraphs",value:function(){return this.request({path:"/_api/gharial"},(function(e){return e.body.graphs}))}},{key:"graphs",value:(x=fe(regeneratorRuntime.mark((function e(){var t,r=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.listGraphs();case 2:return t=e.sent,e.abrupt("return",t.map((function(e){return r.graph(e._key)})));case 4:case"end":return e.stop()}}),e,this)}))),function(){return x.apply(this,arguments)})},{key:"view",value:function(e){return e=e.normalize("NFC"),this._views.has(e)||this._views.set(e,new re.View(this,e)),this._views.get(e)}},{key:"createView",value:(O=fe(regeneratorRuntime.mark((function e(t,r){var n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=this.view(t.normalize("NFC")),e.next=3,n.create(de(de({},r),{},{type:re.ViewType.ARANGOSEARCH_VIEW}));case 3:return e.abrupt("return",n);case 4:case"end":return e.stop()}}),e,this)}))),function(e,t){return O.apply(this,arguments)})},{key:"renameView",value:(k=fe(regeneratorRuntime.mark((function e(t,r){var n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=t.normalize("NFC"),e.next=3,this.request({method:"PUT",path:"/_api/view/".concat(encodeURIComponent(t),"/rename"),body:{name:r.normalize("NFC")}},(function(e){return e.body}));case 3:return n=e.sent,this._views.delete(t),e.abrupt("return",n);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return k.apply(this,arguments)})},{key:"listViews",value:function(){return this.request({path:"/_api/view"},(function(e){return e.body.result}))}},{key:"views",value:(_=fe(regeneratorRuntime.mark((function e(){var t,r=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.listViews();case 2:return t=e.sent,e.abrupt("return",t.map((function(e){return r.view(e.name)})));case 4:case"end":return e.stop()}}),e,this)}))),function(){return _.apply(this,arguments)})},{key:"analyzer",value:function(e){return e=e.normalize("NFC"),this._analyzers.has(e)||this._analyzers.set(e,new l(this,e)),this._analyzers.get(e)}},{key:"createAnalyzer",value:(w=fe(regeneratorRuntime.mark((function e(t,r){var n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=this.analyzer(t),e.next=3,n.create(r);case 3:return e.abrupt("return",n);case 4:case"end":return e.stop()}}),e,this)}))),function(e,t){return w.apply(this,arguments)})},{key:"listAnalyzers",value:function(){return this.request({path:"/_api/analyzer"},(function(e){return e.body.result}))}},{key:"analyzers",value:(g=fe(regeneratorRuntime.mark((function e(){var t,r=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.listAnalyzers();case 2:return t=e.sent,e.abrupt("return",t.map((function(e){return r.analyzer(e.name)})));case 4:case"end":return e.stop()}}),e,this)}))),function(){return g.apply(this,arguments)})},{key:"listUsers",value:function(){return this.request({absolutePath:!0,path:"/_api/user"})}},{key:"getUser",value:function(e){return this.request({absolutePath:!0,path:"/_api/user/".concat(encodeURIComponent(e))})}},{key:"createUser",value:function(e,t){return"string"==typeof t&&(t={passwd:t}),this.request({absolutePath:!0,method:"POST",path:"/_api/user",body:de({user:e},t)},(function(e){return e.body}))}},{key:"updateUser",value:function(e,t){return"string"==typeof t&&(t={passwd:t}),this.request({absolutePath:!0,method:"PATCH",path:"/api/user/".concat(encodeURIComponent(e)),body:t},(function(e){return e.body}))}},{key:"replaceUser",value:function(e,t){return"string"==typeof t&&(t={passwd:t}),this.request({absolutePath:!0,method:"PUT",path:"/api/user/".concat(encodeURIComponent(e)),body:t},(function(e){return e.body}))}},{key:"removeUser",value:function(e){return this.request({absolutePath:!0,method:"DELETE",path:"/_api/user/".concat(encodeURIComponent(e))},(function(e){return e.body}))}},{key:"getUserAccessLevel",value:function(e,t){var r,n=t.database,o=t.collection,i=ge(n)?n.name:null!==(r=null==n?void 0:n.normalize("NFC"))&&void 0!==r?r:Object(f.isArangoCollection)(o)?o._db.name:this._name,a=o?"/".concat(encodeURIComponent(Object(f.isArangoCollection)(o)?o.name:o.normalize("NFC"))):"";return this.request({absolutePath:!0,path:"/_api/user/".concat(encodeURIComponent(e),"/database/").concat(encodeURIComponent(i)).concat(a)},(function(e){return e.body}))}},{key:"setUserAccessLevel",value:function(e,t){var r,n=t.database,o=t.collection,i=t.grant,a=ge(n)?n.name:null!==(r=null==n?void 0:n.normalize("NFC"))&&void 0!==r?r:Object(f.isArangoCollection)(o)?o._db.name:this._name,u=o?"/".concat(encodeURIComponent(Object(f.isArangoCollection)(o)?o.name:o.normalize("NFC"))):"";return this.request({absolutePath:!0,method:"PUT",path:"/_api/user/".concat(encodeURIComponent(e),"/database/").concat(encodeURIComponent(a)).concat(u),body:{grant:i}},(function(e){return e.body}))}},{key:"clearUserAccessLevel",value:function(e,t){var r,n=t.database,o=t.collection,i=ge(n)?n.name:null!==(r=null==n?void 0:n.normalize("NFC"))&&void 0!==r?r:Object(f.isArangoCollection)(o)?o._db.name:this._name,a=o?"/".concat(encodeURIComponent(Object(f.isArangoCollection)(o)?o.name:o.normalize("NFC"))):"";return this.request({absolutePath:!0,method:"DELETE",path:"/_api/user/".concat(encodeURIComponent(e),"/database/").concat(encodeURIComponent(i)).concat(a)},(function(e){return e.body}))}},{key:"getUserDatabases",value:function(e,t){return this.request({absolutePath:!0,path:"/_api/user/".concat(encodeURIComponent(e),"/database"),qs:{full:t}})}},{key:"executeTransaction",value:function(e,t,r){return this.request({method:"POST",path:"/_api/transaction",body:de({collections:we(e),action:t},r)},(function(e){return e.body.result}))}},{key:"transaction",value:function(e){return new te(this,e)}},{key:"beginTransaction",value:function(e,t){var r=this;return this.request({method:"POST",path:"/_api/transaction/begin",body:de({collections:we(e)},t)},(function(e){return new te(r,e.body.result.id)}))}},{key:"listTransactions",value:function(){return this._connection.request({path:"/_api/transaction"},(function(e){return e.body.transactions}))}},{key:"transactions",value:(b=fe(regeneratorRuntime.mark((function e(){var t,r=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.listTransactions();case 2:return t=e.sent,e.abrupt("return",t.map((function(e){return r.transaction(e.id)})));case 4:case"end":return e.stop()}}),e,this)}))),function(){return b.apply(this,arguments)})},{key:"query",value:function(e){function t(t,r,n){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}((function(e,t,r){var n=this;Object(h.isAqlQuery)(e)?(r=t,t=e.bindVars,e=e.query):Object(h.isAqlLiteral)(e)&&(e=e.toAQL());var o=r||{},i=o.allowDirtyRead,a=o.retryOnConflict,u=o.count,s=o.batchSize,c=o.cache,l=o.memoryLimit,f=o.ttl,p=o.timeout,d=ye(o,ue);return this.request({method:"POST",path:"/_api/cursor",body:{query:e,bindVars:t,count:u,batchSize:s,cache:c,memoryLimit:l,ttl:f,options:d},allowDirtyRead:i,retryOnConflict:a,timeout:p},(function(e){return new M.a(n,e.body,e.arangojsHostId,i).items}))}))},{key:"explain",value:function(e,t,r){return Object(h.isAqlQuery)(e)?(r=t,t=e.bindVars,e=e.query):Object(h.isAqlLiteral)(e)&&(e=e.toAQL()),this.request({method:"POST",path:"/_api/explain",body:{query:e,bindVars:t,options:r}},(function(e){return e.body}))}},{key:"parse",value:function(e){return Object(h.isAqlQuery)(e)?e=e.query:Object(h.isAqlLiteral)(e)&&(e=e.toAQL()),this.request({method:"POST",path:"/_api/query",body:{query:e}},(function(e){return e.body}))}},{key:"queryTracking",value:function(e){return this.request(e?{method:"PUT",path:"/_api/query/properties",body:e}:{method:"GET",path:"/_api/query/properties"},(function(e){return e.body}))}},{key:"listRunningQueries",value:function(){return this.request({method:"GET",path:"/_api/query/current"},(function(e){return e.body}))}},{key:"listSlowQueries",value:function(){return this.request({method:"GET",path:"/_api/query/slow"},(function(e){return e.body}))}},{key:"clearSlowQueries",value:function(){return this.request({method:"DELETE",path:"/_api/query/slow"},(function(){}))}},{key:"killQuery",value:function(e){return this.request({method:"DELETE",path:"/_api/query/".concat(encodeURIComponent(e))},(function(){}))}},{key:"listFunctions",value:function(){return this.request({path:"/_api/aqlfunction"},(function(e){return e.body.result}))}},{key:"createFunction",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return this.request({method:"POST",path:"/_api/aqlfunction",body:{name:e,code:t,isDeterministic:r}},(function(e){return e.body}))}},{key:"dropFunction",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.request({method:"DELETE",path:"/_api/aqlfunction/".concat(encodeURIComponent(e)),qs:{group:t}},(function(e){return e.body}))}},{key:"listServices",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this.request({path:"/_api/foxx",qs:{excludeSystem:e}},(function(e){return e.body}))}},{key:"installService",value:(m=fe(regeneratorRuntime.mark((function e(t,r){var n,o,i,a,u,s=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=s.length>2&&void 0!==s[2]?s[2]:{},o=n.configuration,i=n.dependencies,a=ye(n,se),e.next=4,G({configuration:o,dependencies:i,source:r});case 4:return u=e.sent,e.next=7,this.request(de(de({},u),{},{method:"POST",path:"/_api/foxx",isBinary:!0,qs:de(de({},a),{},{mount:t})}),(function(e){return e.body}));case 7:return e.abrupt("return",e.sent);case 8:case"end":return e.stop()}}),e,this)}))),function(e,t){return m.apply(this,arguments)})},{key:"replaceService",value:(v=fe(regeneratorRuntime.mark((function e(t,r){var n,o,i,a,u,s=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=s.length>2&&void 0!==s[2]?s[2]:{},o=n.configuration,i=n.dependencies,a=ye(n,ce),e.next=4,G({configuration:o,dependencies:i,source:r});case 4:return u=e.sent,e.next=7,this.request(de(de({},u),{},{method:"PUT",path:"/_api/foxx/service",isBinary:!0,qs:de(de({},a),{},{mount:t})}),(function(e){return e.body}));case 7:return e.abrupt("return",e.sent);case 8:case"end":return e.stop()}}),e,this)}))),function(e,t){return v.apply(this,arguments)})},{key:"upgradeService",value:(y=fe(regeneratorRuntime.mark((function e(t,r){var n,o,i,a,u,s=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=s.length>2&&void 0!==s[2]?s[2]:{},o=n.configuration,i=n.dependencies,a=ye(n,le),e.next=4,G({configuration:o,dependencies:i,source:r});case 4:return u=e.sent,e.next=7,this.request(de(de({},u),{},{method:"PATCH",path:"/_api/foxx/service",isBinary:!0,qs:de(de({},a),{},{mount:t})}),(function(e){return e.body}));case 7:return e.abrupt("return",e.sent);case 8:case"end":return e.stop()}}),e,this)}))),function(e,t){return y.apply(this,arguments)})},{key:"uninstallService",value:function(e,t){return this.request({method:"DELETE",path:"/_api/foxx/service",qs:de(de({},t),{},{mount:e})},(function(){}))}},{key:"getService",value:function(e){return this.request({path:"/_api/foxx/service",qs:{mount:e}},(function(e){return e.body}))}},{key:"getServiceConfiguration",value:(d=fe(regeneratorRuntime.mark((function e(t){var r,n,o,i,a,u,s=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=s.length>1&&void 0!==s[1]&&s[1],e.next=3,this.request({path:"/_api/foxx/configuration",qs:{mount:t,minimal:r}},(function(e){return e.body}));case 3:if(n=e.sent,r&&Object.keys(n).every((function(e){return n[e].title}))){e.next=6;break}return e.abrupt("return",n);case 6:for(o={},i=0,a=Object.keys(n);i<a.length;i++)u=a[i],o[u]=n[u].current;return e.abrupt("return",o);case 9:case"end":return e.stop()}}),e,this)}))),function(e){return d.apply(this,arguments)})},{key:"replaceServiceConfiguration",value:(p=fe(regeneratorRuntime.mark((function e(t,r){var n,o,i,a,u,s,c=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=c.length>2&&void 0!==c[2]&&c[2],e.next=3,this.request({method:"PUT",path:"/_api/foxx/configuration",body:r,qs:{mount:t,minimal:n}},(function(e){return e.body}));case 3:if(o=e.sent,!n&&o.values&&Object.keys(o.values).every((function(e){return o.values[e].title}))){e.next=6;break}return e.abrupt("return",o);case 6:return e.next=8,this.getServiceConfiguration(t,!1);case 8:if(i=e.sent,o.warnings)for(a=0,u=Object.keys(i);a<u.length;a++)s=u[a],i[s].warning=o.warnings[s];return e.abrupt("return",i);case 11:case"end":return e.stop()}}),e,this)}))),function(e,t){return p.apply(this,arguments)})},{key:"updateServiceConfiguration",value:(c=fe(regeneratorRuntime.mark((function e(t,r){var n,o,i,a,u,s,c=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=c.length>2&&void 0!==c[2]&&c[2],e.next=3,this.request({method:"PATCH",path:"/_api/foxx/configuration",body:r,qs:{mount:t,minimal:n}},(function(e){return e.body}));case 3:if(o=e.sent,!n&&o.values&&Object.keys(o.values).every((function(e){return o.values[e].title}))){e.next=6;break}return e.abrupt("return",o);case 6:return e.next=8,this.getServiceConfiguration(t,!1);case 8:if(i=e.sent,o.warnings)for(a=0,u=Object.keys(i);a<u.length;a++)s=u[a],i[s].warning=o.warnings[s];return e.abrupt("return",i);case 11:case"end":return e.stop()}}),e,this)}))),function(e,t){return c.apply(this,arguments)})},{key:"getServiceDependencies",value:(s=fe(regeneratorRuntime.mark((function e(t){var r,n,o,i,a,u,s=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=s.length>1&&void 0!==s[1]&&s[1],e.next=3,this.request({path:"/_api/foxx/dependencies",qs:{mount:t,minimal:r}},(function(e){return e.body}));case 3:if(n=e.sent,r&&Object.keys(n).every((function(e){return n[e].title}))){e.next=6;break}return e.abrupt("return",n);case 6:for(o={},i=0,a=Object.keys(n);i<a.length;i++)u=a[i],o[u]=n[u].current;return e.abrupt("return",o);case 9:case"end":return e.stop()}}),e,this)}))),function(e){return s.apply(this,arguments)})},{key:"replaceServiceDependencies",value:(u=fe(regeneratorRuntime.mark((function e(t,r){var n,o,i,a,u,s,c=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=c.length>2&&void 0!==c[2]&&c[2],e.next=3,this.request({method:"PUT",path:"/_api/foxx/dependencies",body:r,qs:{mount:t,minimal:n}},(function(e){return e.body}));case 3:if(o=e.sent,!n&&o.values&&Object.keys(o.values).every((function(e){return o.values[e].title}))){e.next=6;break}return e.abrupt("return",o);case 6:return e.next=8,this.getServiceDependencies(t,!1);case 8:if(i=e.sent,o.warnings)for(a=0,u=Object.keys(i);a<u.length;a++)s=u[a],i[s].warning=o.warnings[s];return e.abrupt("return",i);case 11:case"end":return e.stop()}}),e,this)}))),function(e,t){return u.apply(this,arguments)})},{key:"updateServiceDependencies",value:(a=fe(regeneratorRuntime.mark((function e(t,r){var n,o,i,a,u,s,c=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=c.length>2&&void 0!==c[2]&&c[2],e.next=3,this.request({method:"PATCH",path:"/_api/foxx/dependencies",body:r,qs:{mount:t,minimal:n}},(function(e){return e.body}));case 3:if(o=e.sent,!n&&o.values&&Object.keys(o.values).every((function(e){return o.values[e].title}))){e.next=6;break}return e.abrupt("return",o);case 6:return e.next=8,this.getServiceDependencies(t,!1);case 8:if(i=e.sent,o.warnings)for(a=0,u=Object.keys(i);a<u.length;a++)s=u[a],i[s].warning=o.warnings[s];return e.abrupt("return",i);case 11:case"end":return e.stop()}}),e,this)}))),function(e,t){return a.apply(this,arguments)})},{key:"setServiceDevelopmentMode",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return this.request({method:t?"POST":"DELETE",path:"/_api/foxx/development",qs:{mount:e}},(function(e){return e.body}))}},{key:"listServiceScripts",value:function(e){return this.request({path:"/_api/foxx/scripts",qs:{mount:e}},(function(e){return e.body}))}},{key:"runServiceScript",value:function(e,t,r){return this.request({method:"POST",path:"/_api/foxx/scripts/".concat(encodeURIComponent(t)),body:r,qs:{mount:e}},(function(e){return e.body}))}},{key:"runServiceTests",value:function(e,t){return this.request({method:"POST",path:"/_api/foxx/tests",qs:de(de({},t),{},{mount:e})},(function(e){return e.body}))}},{key:"getServiceReadme",value:function(e){return this.request({path:"/_api/foxx/readme",qs:{mount:e}},(function(e){return e.body}))}},{key:"getServiceDocumentation",value:function(e){return this.request({path:"/_api/foxx/swagger",qs:{mount:e}},(function(e){return e.body}))}},{key:"downloadService",value:function(e){return this.request({method:"POST",path:"/_api/foxx/download",qs:{mount:e},expectBinary:!0},(function(e){return e.body}))}},{key:"commitLocalServiceState",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this.request({method:"POST",path:"/_api/foxx/commit",qs:{replace:e}},(function(){}))}}])&&me(t.prototype,r),i&&me(t,i),Object.defineProperty(t,"prototype",{writable:!1}),e}()}])}));
|
|
1
|
+
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.arangojs=e():t.arangojs=e()}(self,(function(){return function(){var t={192:function(t,e,r){var n;n="undefined"!=typeof window?window:void 0!==r.g?r.g:"undefined"!=typeof self?self:{},t.exports=n},534:function(t){t.exports=function(t){if(!t)return!1;var r=e.call(t);return"[object Function]"===r||"function"==typeof t&&"[object RegExp]"!==r||"undefined"!=typeof window&&(t===window.setTimeout||t===window.alert||t===window.confirm||t===window.prompt)};var e=Object.prototype.toString},69:function(t){var e=function(t){return t.replace(/^\s+|\s+$/g,"")};t.exports=function(t){if(!t)return{};for(var r,n={},o=e(t).split("\n"),i=0;i<o.length;i++){var s=o[i],a=s.indexOf(":"),h=e(s.slice(0,a)).toLowerCase(),u=e(s.slice(a+1));void 0===n[h]?n[h]=u:(r=n[h],"[object Array]"===Object.prototype.toString.call(r)?n[h].push(u):n[h]=[n[h],u])}return n}},588:function(t){var e=function(t){"use strict";var e,r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},s=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",h=i.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function c(t,e,r,n){var i=e&&e.prototype instanceof y?e:y,s=Object.create(i.prototype),a=new S(n||[]);return o(s,"_invoke",{value:C(t,r,a)}),s}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=c;var d="suspendedStart",p="executing",m="completed",f={};function y(){}function _(){}function g(){}var b={};u(b,s,(function(){return this}));var v=Object.getPrototypeOf,w=v&&v(v(I([])));w&&w!==r&&n.call(w,s)&&(b=w);var q=g.prototype=y.prototype=Object.create(b);function x(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function T(t,e){function r(o,i,s,a){var h=l(t[o],t,i);if("throw"!==h.type){var u=h.arg,c=u.value;return c&&"object"==typeof c&&n.call(c,"__await")?e.resolve(c.__await).then((function(t){r("next",t,s,a)}),(function(t){r("throw",t,s,a)})):e.resolve(c).then((function(t){u.value=t,s(u)}),(function(t){return r("throw",t,s,a)}))}a(h.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function C(t,e,r){var n=d;return function(o,i){if(n===p)throw new Error("Generator is already running");if(n===m){if("throw"===o)throw i;return A()}for(r.method=o,r.arg=i;;){var s=r.delegate;if(s){var a=U(s,r);if(a){if(a===f)continue;return a}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===d)throw n=m,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=p;var h=l(t,e,r);if("normal"===h.type){if(n=r.done?m:"suspendedYield",h.arg===f)continue;return{value:h.arg,done:r.done}}"throw"===h.type&&(n=m,r.method="throw",r.arg=h.arg)}}}function U(t,r){var n=t.iterator[r.method];if(n===e){if(r.delegate=null,"throw"===r.method){if(t.iterator.return&&(r.method="return",r.arg=e,U(t,r),"throw"===r.method))return f;r.method="throw",r.arg=new TypeError("The iterator does not provide a 'throw' method")}return f}var o=l(n,t.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,f;var i=o.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,f):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,f)}function R(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function E(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function S(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(R,this),this.reset(!0)}function I(t){if(t){var r=t[s];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o<t.length;)if(n.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}return{next:A}}function A(){return{value:e,done:!0}}return _.prototype=g,o(q,"constructor",{value:g,configurable:!0}),o(g,"constructor",{value:_,configurable:!0}),_.displayName=u(g,h,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===_||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,g):(t.__proto__=g,u(t,h,"GeneratorFunction")),t.prototype=Object.create(q),t},t.awrap=function(t){return{__await:t}},x(T.prototype),u(T.prototype,a,(function(){return this})),t.AsyncIterator=T,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var s=new T(c(e,r,n,o),i);return t.isGeneratorFunction(r)?s:s.next().then((function(t){return t.done?t.value:s.next()}))},x(q),u(q,h,"Generator"),u(q,s,(function(){return this})),u(q,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=I,S.prototype={constructor:S,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(E),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function o(n,o){return a.type="throw",a.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var s=this.tryEntries[i],a=s.completion;if("root"===s.tryLoc)return o("end");if(s.tryLoc<=this.prev){var h=n.call(s,"catchLoc"),u=n.call(s,"finallyLoc");if(h&&u){if(this.prev<s.catchLoc)return o(s.catchLoc,!0);if(this.prev<s.finallyLoc)return o(s.finallyLoc)}else if(h){if(this.prev<s.catchLoc)return o(s.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<s.finallyLoc)return o(s.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var s=i?i.completion:{};return s.type=t,s.arg=e,i?(this.method="next",this.next=i.finallyLoc,f):this.complete(s)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),E(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;E(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:I(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),f}},t}(t.exports);try{regeneratorRuntime=e}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=e:Function("r","regeneratorRuntime = r")(e)}},994:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(107);class o{constructor(t){if(this.length=0,this.unlinkCleanup=t=>{this.first===t&&(this.first=this.first.behind),this.last===t&&(this.last=this.last.before),this.length--},t){t instanceof o&&(t=t.values());for(const e of t)this.push(e)}}clear(t=!1){if(t)for(;this.first;)this.first.unlink(!0);this.first=this.last=void 0,this.length=0}every(t,e){e&&(t=t.bind(e));for(const e of this.keys())if(!t(e.value,e,this))return!1;return!0}filter(t,e){e&&(t=t.bind(e));const r=new o;for(const[e,n]of this)t(n,e,this)&&r.push(n);return r}find(t,e){e&&(t=t.bind(e));for(const[e,r]of this)if(t(r,e,this))return r}findItem(t,e){e&&(t=t.bind(e));for(const[e,r]of this)if(t(r,e,this))return e}forEach(t,e){e&&(t=t.bind(e));for(const[e,r]of this)t(r,e,this)}includes(t,e=0){let r=this.getItemByIndex(e);for(;r;){if(r.value===t)return!0;r=r.behind}return!1}itemOf(t,e=0){let r=this.getItemByIndex(e);for(;r;){if(r.value===t)return r;r=r.behind}}lastItemOf(t,e=-1){let r=this.getItemByIndex(e);for(;r;){if(r.value===t)return r;r=r.before}}map(t,e){e&&(t=t.bind(e));const r=new o;for(const[e,n]of this)r.push(t(n,e,this));return r}reduce(t,e){let r=this.first;if(!r){if(!e)throw new TypeError("Empty accumulator on empty LinkedList is not allowed.");return e}if(void 0===e){if(e=r.value,!r.behind)return e;r=r.behind}do{e=t(e,r.value,r,this),r=r.behind}while(r);return e}reduceRight(t,e){let r=this.last;if(!r){if(!e)throw new TypeError("Empty accumulator on empty LinkedList is not allowed.");return e}if(void 0===e){if(e=r.value,!r.before)return e;r=r.before}do{e=t(e,r.value,r,this),r=r.before}while(r);return e}some(t,e){e&&(t=t.bind(e));for(const[e,r]of this)if(t(r,e,this))return!0;return!1}join(t){return[...this.values()].join(t)}concat(...t){const e=new o(this);for(const r of t)r instanceof o?e.push(...r.values()):e.push(r);return e}pop(){if(!this.last)return;const t=this.last;return t.unlink(),t.value}push(...t){for(const e of t){const t=new n.LinkedListItem(e,this.unlinkCleanup);this.first&&this.last?(this.last.insertBehind(t),this.last=t):this.first=this.last=t,this.length++}return this.length}unshift(...t){for(const e of t){const t=new n.LinkedListItem(e,this.unlinkCleanup);this.last&&this.first?(t.insertBehind(this.first),this.first=t):this.first=this.last=t,this.length++}return this.length}remove(t){for(const e of this.keys())if(e.value===t)return e.unlink(),!0;return!1}removeAllOccurrences(t){let e=!1;for(const r of this.keys())r.value===t&&(r.unlink(),e=!0);return e}shift(){if(!this.first)return;const t=this.first;return t.unlink(),t.value}*[Symbol.iterator](){let t=this.first;if(t)do{yield[t,t.value],t=t.behind}while(t)}entries(){return this[Symbol.iterator]()}*keys(){let t=this.first;if(t)do{yield t,t=t.behind}while(t)}*values(){let t=this.first;if(t)do{yield t.value,t=t.behind}while(t)}getItemByIndex(t){if(void 0===t)throw new Error("index must be a number!");if(!this.first)return;let e;if(t>0)for(e=this.first;e&&t--;)e=e.behind;else{if(!(t<0))return this.first;for(e=this.last;e&&++t;)e=e.before}return e}}e.LinkedList=o},107:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.LinkedListItem=class{constructor(t,e){this.value=t,this.unlinkCleanup=e}insertBehind(t){if(t.insertBefore(this),this.behind){let e=t;for(;e.behind;)e=e.behind;this.behind.insertBefore(e),e.insertBehind(this.behind)}this.behind=t}unlink(t=!1){this.before&&(this.before.behind=this.behind),this.behind&&(this.behind.before=this.before),this.unlinkCleanup&&this.unlinkCleanup(this),this.unlinkCleanup=void 0,t&&(this.before=this.behind=void 0)}insertBefore(t){this.before=t,this.unlinkCleanup||(this.unlinkCleanup=t.unlinkCleanup)}}},95:function(t,e,r){"use strict";function n(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}Object.defineProperty(e,"__esModule",{value:!0}),n(r(994)),n(r(107))},377:function(t,e,r){"use strict";var n=r(192),o=r(534),i=r(69),s=r(786);function a(t,e,r){var n=t;return o(e)?(r=e,"string"==typeof t&&(n={uri:t})):n=s(e,{uri:t}),n.callback=r,n}function h(t,e,r){return u(e=a(t,e,r))}function u(t){if(void 0===t.callback)throw new Error("callback argument missing");var e=!1,r=function(r,n,o){e||(e=!0,t.callback(r,n,o))};function n(){var t=void 0;if(t=c.response?c.response:c.responseText||function(t){try{if("document"===t.responseType)return t.responseXML;var e=t.responseXML&&"parsererror"===t.responseXML.documentElement.nodeName;if(""===t.responseType&&!e)return t.responseXML}catch(t){}return null}(c),_)try{t=JSON.parse(t)}catch(t){}return t}function o(t){return clearTimeout(l),t instanceof Error||(t=new Error(""+(t||"Unknown XMLHttpRequest Error"))),t.statusCode=0,r(t,g)}function s(){if(!u){var e;clearTimeout(l),e=t.useXDR&&void 0===c.status?200:1223===c.status?204:c.status;var o=g,s=null;return 0!==e?(o={body:n(),statusCode:e,method:p,headers:{},url:d,rawRequest:c},c.getAllResponseHeaders&&(o.headers=i(c.getAllResponseHeaders()))):s=new Error("Internal XMLHttpRequest Error"),r(s,o,o.body)}}var a,u,c=t.xhr||null;c||(c=t.cors||t.useXDR?new h.XDomainRequest:new h.XMLHttpRequest);var l,d=c.url=t.uri||t.url,p=c.method=t.method||"GET",m=t.body||t.data,f=c.headers=t.headers||{},y=!!t.sync,_=!1,g={body:void 0,headers:{},statusCode:0,method:p,url:d,rawRequest:c};if("json"in t&&!1!==t.json&&(_=!0,f.accept||f.Accept||(f.Accept="application/json"),"GET"!==p&&"HEAD"!==p&&(f["content-type"]||f["Content-Type"]||(f["Content-Type"]="application/json"),m=JSON.stringify(!0===t.json?m:t.json))),c.onreadystatechange=function(){4===c.readyState&&setTimeout(s,0)},c.onload=s,c.onerror=o,c.onprogress=function(){},c.onabort=function(){u=!0},c.ontimeout=o,c.open(p,d,!y,t.username,t.password),y||(c.withCredentials=!!t.withCredentials),!y&&t.timeout>0&&(l=setTimeout((function(){if(!u){u=!0,c.abort("timeout");var t=new Error("XMLHttpRequest timeout");t.code="ETIMEDOUT",o(t)}}),t.timeout)),c.setRequestHeader)for(a in f)f.hasOwnProperty(a)&&c.setRequestHeader(a,f[a]);else if(t.headers&&!function(t){for(var e in t)if(t.hasOwnProperty(e))return!1;return!0}(t.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in t&&(c.responseType=t.responseType),"beforeSend"in t&&"function"==typeof t.beforeSend&&t.beforeSend(c),c.send(m||null),c}t.exports=h,t.exports.default=h,h.XMLHttpRequest=n.XMLHttpRequest||function(){},h.XDomainRequest="withCredentials"in new h.XMLHttpRequest?h.XMLHttpRequest:n.XDomainRequest,function(t,e){for(var r=0;r<t.length;r++)e(t[r])}(["get","put","post","patch","head","delete"],(function(t){h["delete"===t?"del":t]=function(e,r,n){return(r=a(e,r,n)).method=t.toUpperCase(),u(r)}}))},786:function(t){t.exports=function(){for(var t={},r=0;r<arguments.length;r++){var n=arguments[r];for(var o in n)e.call(n,o)&&(t[o]=n[o])}return t};var e=Object.prototype.hasOwnProperty},594:function(t,e,r){"use strict";r.d(e,{L:function(){return s},W:function(){return i}});var n=r(43),o=r(979);function i(t){return Boolean(t&&t.isArangoAnalyzer)}class s{constructor(t,e){this._db=t,this._name=e.normalize("NFC")}get isArangoAnalyzer(){return!0}get name(){return this._name}async exists(){try{return await this.get(),!0}catch(t){if((0,n.Pp)(t)&&t.errorNum===o.IB)return!1;throw t}}get(){return this._db.request({path:`/_api/analyzer/${encodeURIComponent(this._name)}`})}create(t){return this._db.request({method:"POST",path:"/_api/analyzer",body:{name:this._name,...t}})}drop(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this._db.request({method:"DELETE",path:`/_api/analyzer/${encodeURIComponent(this._name)}`,qs:{force:t}})}}},97:function(t,e,r){"use strict";r.r(e),r.d(e,{aql:function(){return c},isAqlLiteral:function(){return u},isAqlQuery:function(){return a},isGeneratedAqlQuery:function(){return h},join:function(){return d},literal:function(){return l}});var n=r(594),o=r(91),i=r(909),s=r(94);function a(t){return Boolean(t&&"string"==typeof t.query&&t.bindVars)}function h(t){return a(t)&&"function"==typeof t._source}function u(t){return Boolean(t&&"function"==typeof t.toAQL)}function c(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),a=1;a<e;a++)r[a-1]=arguments[a];const c=[...t],l={},d=[];let p=c[0];for(let t=0;t<r.length;t++){const e=r[t];let a=e;if(h(e)){const n=e._source();n.args.length?(p+=n.strings[0],r.splice(t,1,...n.args),c.splice(t,2,c[t]+n.strings[0],...n.strings.slice(1,n.args.length),n.strings[n.args.length]+c[t+1])):(p+=e.query+c[t+1],r.splice(t,1),c.splice(t,2,c[t]+e.query+c[t+1])),t-=1;continue}if(void 0===e){p+=c[t+1];continue}if(u(e)){p+=`${e.toAQL()}${c[t+1]}`;continue}const m=d.indexOf(e),f=-1!==m;let y=`value${f?m:d.length}`;((0,o.isArangoCollection)(e)||(0,i.Vp)(e)||(0,s.isArangoView)(e)||(0,n.W)(e))&&(y=`@${y}`,a=e.name),f||(d.push(e),l[y]=a),p+=`@${y}${c[t+1]}`}return{query:p,bindVars:l,_source:()=>({strings:c,args:r})}}function l(t){return u(t)?t:{toAQL(){return void 0===t?"":String(t)}}}function d(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:" ";return t.length?1===t.length?c`${t[0]}`:c(["",...Array(t.length-1).fill(e),""],...t):c``}},91:function(t,e,r){"use strict";r.r(e),r.d(e,{Collection:function(){return p},CollectionStatus:function(){return d},CollectionType:function(){return l},collectionToString:function(){return c},isArangoCollection:function(){return u}});var n=r(97),o=r(267),i=r(974),s=r(43);function a(t,e){if("string"!=typeof t){if(t.id)return a(t.id,e);throw new Error("Index handle must be a string or an object with an id attribute")}if(t.includes("/")){const[r,...n]=t.split("/"),o=r.normalize("NFC");if(o!==e)throw new Error(`Index ID "${t}" does not match collection name "${e}"`);return[o,...n].join("/")}return`${e}/${t}`}var h=r(979);function u(t){return Boolean(t&&t.isArangoCollection)}function c(t){return u(t)?String(t.name):String(t).normalize("NFC")}let l,d;!function(t){t[t.DOCUMENT_COLLECTION=2]="DOCUMENT_COLLECTION",t[t.EDGE_COLLECTION=3]="EDGE_COLLECTION"}(l||(l={})),function(t){t[t.NEWBORN=1]="NEWBORN",t[t.UNLOADED=2]="UNLOADED",t[t.LOADED=3]="LOADED",t[t.UNLOADING=4]="UNLOADING",t[t.DELETED=5]="DELETED",t[t.LOADING=6]="LOADING"}(d||(d={}));class p{constructor(t,e){this._name=e.normalize("NFC"),this._db=t}get isArangoCollection(){return!0}get name(){return this._name}get(){return this._db.request({path:`/_api/collection/${encodeURIComponent(this._name)}`})}async exists(){try{return await this.get(),!0}catch(t){if((0,s.Pp)(t)&&t.errorNum===h.Xf)return!1;throw t}}create(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{waitForSyncReplication:e,enforceReplicationFactor:r,...o}=t;o.computedValues&&(o.computedValues=o.computedValues.map((t=>(0,n.isAqlLiteral)(t.expression)?{...t,expression:t.expression.toAQL()}:(0,n.isAqlQuery)(t.expression)?{...t,expression:t.expression.query}:t)));const i={};return"boolean"==typeof e&&(i.waitForSyncReplication=e?1:0),"boolean"==typeof r&&(i.enforceReplicationFactor=r?1:0),this._db.request({method:"POST",path:"/_api/collection",qs:i,body:{...o,name:this._name}})}properties(t){return t?this._db.request({method:"PUT",path:`/_api/collection/${encodeURIComponent(this._name)}/properties`,body:t}):this._db.request({path:`/_api/collection/${encodeURIComponent(this._name)}/properties`})}count(){return this._db.request({path:`/_api/collection/${encodeURIComponent(this._name)}/count`})}async recalculateCount(){return this._db.request({method:"PUT",path:`/_api/collection/${encodeURIComponent(this._name)}/recalculateCount`},(t=>t.body.result))}figures(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this._db.request({path:`/_api/collection/${encodeURIComponent(this._name)}/figures`,qs:{details:t}})}revision(){return this._db.request({path:`/_api/collection/${encodeURIComponent(this._name)}/revision`})}checksum(t){return this._db.request({path:`/_api/collection/${encodeURIComponent(this._name)}/checksum`,qs:t})}async loadIndexes(){return this._db.request({method:"PUT",path:`/_api/collection/${encodeURIComponent(this._name)}/loadIndexesIntoMemory`},(t=>t.body.result))}async rename(t){const e=await this._db.renameCollection(this._name,t);return this._name=t.normalize("NFC"),e}truncate(){return this._db.request({method:"PUT",path:`/_api/collection/${this._name}/truncate`})}drop(t){return this._db.request({method:"DELETE",path:`/_api/collection/${encodeURIComponent(this._name)}`,qs:t})}getResponsibleShard(t){return this._db.request({method:"PUT",path:`/_api/collection/${encodeURIComponent(this._name)}/responsibleShard`,body:t},(t=>t.body.shardId))}documentId(t){return(0,i.q)(t,this._name)}async documentExists(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{ifMatch:r,ifNoneMatch:n}=e,o={};r&&(o["if-match"]=r),n&&(o["if-none-match"]=n);try{return await this._db.request({method:"HEAD",path:`/_api/document/${encodeURI((0,i.q)(t,this._name))}`,headers:o},(t=>{if(n&&304===t.statusCode)throw new s.oo(t);return!0}))}catch(t){if(404===t.code)return!1;throw t}}documents(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{allowDirtyRead:r}=e;return this._db.request({method:"PUT",path:`/_api/document/${encodeURIComponent(this._name)}`,qs:{onlyget:!0},allowDirtyRead:r,body:t})}async document(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};"boolean"==typeof e&&(e={graceful:e});const{allowDirtyRead:r,graceful:n=!1,ifMatch:o,ifNoneMatch:a}=e,u={};o&&(u["if-match"]=o),a&&(u["if-none-match"]=a);const c=this._db.request({path:`/_api/document/${encodeURI((0,i.q)(t,this._name))}`,headers:u,allowDirtyRead:r},(t=>{if(a&&304===t.statusCode)throw new s.oo(t);return t.body}));if(!n)return c;try{return await c}catch(t){if((0,s.Pp)(t)&&t.errorNum===h.Gk)return null;throw t}}save(t,e){return this._db.request({method:"POST",path:`/_api/document/${encodeURIComponent(this._name)}`,body:t,qs:e},(t=>null!=e&&e.silent?void 0:t.body))}saveAll(t,e){return this._db.request({method:"POST",path:`/_api/document/${encodeURIComponent(this._name)}`,body:t,qs:e},(t=>null!=e&&e.silent?void 0:t.body))}replace(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{ifMatch:n,...o}=r,s={};return n&&(s["if-match"]=n),this._db.request({method:"PUT",path:`/_api/document/${encodeURI((0,i.q)(t,this._name))}`,headers:s,body:e,qs:o},(t=>null!=r&&r.silent?void 0:t.body))}replaceAll(t,e){return this._db.request({method:"PUT",path:`/_api/document/${encodeURIComponent(this._name)}`,body:t,qs:e},(t=>null!=e&&e.silent?void 0:t.body))}update(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{ifMatch:n,...o}=r,s={};return n&&(s["if-match"]=n),this._db.request({method:"PATCH",path:`/_api/document/${encodeURI((0,i.q)(t,this._name))}`,headers:s,body:e,qs:o},(t=>null!=r&&r.silent?void 0:t.body))}updateAll(t,e){return this._db.request({method:"PATCH",path:`/_api/document/${encodeURIComponent(this._name)}`,body:t,qs:e},(t=>null!=e&&e.silent?void 0:t.body))}remove(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{ifMatch:r,...n}=e,o={};return r&&(o["if-match"]=r),this._db.request({method:"DELETE",path:`/_api/document/${encodeURI((0,i.q)(t,this._name))}`,headers:o,qs:n},(t=>null!=e&&e.silent?void 0:t.body))}removeAll(t,e){return this._db.request({method:"DELETE",path:`/_api/document/${encodeURIComponent(this._name)}`,body:t,qs:e},(t=>null!=e&&e.silent?void 0:t.body))}import(t){const e={...arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},collection:this._name};return Array.isArray(t)&&(e.type=Array.isArray(t[0])?void 0:"documents",t=t.map((t=>JSON.stringify(t))).join("\r\n")+"\r\n"),this._db.request({method:"POST",path:"/_api/import",body:t,isBinary:!0,qs:e})}_edges(t,e,r){const{allowDirtyRead:n}=e;return this._db.request({path:`/_api/edges/${encodeURIComponent(this._name)}`,allowDirtyRead:n,qs:{direction:r,vertex:(0,i.q)(t,this._name,!1)}})}edges(t,e){return this._edges(t,e)}inEdges(t,e){return this._edges(t,e,"in")}outEdges(t,e){return this._edges(t,e,"out")}traversal(t,e){return this._db.request({method:"POST",path:"/_api/traversal",body:{...e,startVertex:t,edgeCollection:this._name}},(t=>t.body.result))}list(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"id";return this._db.request({method:"PUT",path:"/_api/simple/all-keys",body:{type:t,collection:this._name}},(t=>new o.o(this._db,t.body,t.arangojsHostUrl).items))}all(t){return this._db.request({method:"PUT",path:"/_api/simple/all",body:{...t,collection:this._name}},(t=>new o.o(this._db,t.body,t.arangojsHostUrl).items))}any(){return this._db.request({method:"PUT",path:"/_api/simple/any",body:{collection:this._name}},(t=>t.body.document))}byExample(t,e){return this._db.request({method:"PUT",path:"/_api/simple/by-example",body:{...e,example:t,collection:this._name}},(t=>new o.o(this._db,t.body,t.arangojsHostUrl).items))}firstExample(t){return this._db.request({method:"PUT",path:"/_api/simple/first-example",body:{example:t,collection:this._name}},(t=>t.body.document))}removeByExample(t,e){return this._db.request({method:"PUT",path:"/_api/simple/remove-by-example",body:{...e,example:t,collection:this._name}})}replaceByExample(t,e,r){return this._db.request({method:"PUT",path:"/_api/simple/replace-by-example",body:{...r,example:t,newValue:e,collection:this._name}})}updateByExample(t,e,r){return this._db.request({method:"PUT",path:"/_api/simple/update-by-example",body:{...r,example:t,newValue:e,collection:this._name}})}lookupByKeys(t){return this._db.request({method:"PUT",path:"/_api/simple/lookup-by-keys",body:{keys:t,collection:this._name}},(t=>t.body.documents))}removeByKeys(t,e){return this._db.request({method:"PUT",path:"/_api/simple/remove-by-keys",body:{options:e,keys:t,collection:this._name}})}indexes(){return this._db.request({path:"/_api/index",qs:{collection:this._name}},(t=>t.body.indexes))}index(t){return this._db.request({path:`/_api/index/${encodeURI(a(t,this._name))}`})}ensureIndex(t){return this._db.request({method:"POST",path:"/_api/index",body:t,qs:{collection:this._name}})}dropIndex(t){return this._db.request({method:"DELETE",path:`/_api/index/${encodeURI(a(t,this._name))}`})}fulltext(t,e){let{index:r,...n}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this._db.request({method:"PUT",path:"/_api/simple/fulltext",body:{...n,index:r?a(r,this._name):void 0,attribute:t,query:e,collection:this._name}},(t=>new o.o(this._db,t.body,t.arangojsHostUrl).items))}compact(){return this._db.request({method:"PUT",path:`/_api/collection/${this._name}/compact`},(t=>t.body))}}},267:function(t,e,r){"use strict";r.d(e,{o:function(){return o}});var n=r(95);class o{constructor(t,e,r,o){const s=new n.LinkedList(e.result.length?[new n.LinkedList(e.result)]:[]);this._db=t,this._batches=s,this._id=e.id,this._hasMore=Boolean(e.id&&e.hasMore),this._hostUrl=r,this._count=e.count,this._extra=e.extra,this._allowDirtyRead=o,this._itemsCursor=new i(this,{get isEmpty(){return!s.length},more:()=>this._more(),shift:()=>{var t;let e=null===(t=s.first)||void 0===t?void 0:t.value;for(;e&&!e.length;){var r;s.shift(),e=null===(r=s.first)||void 0===r?void 0:r.value}if(!e)return;const n=e.shift();return e.length||s.shift(),n}})}async _more(){if(!this.hasMore)return;const t=await this._db.request({method:"PUT",path:`/_api/cursor/${encodeURIComponent(this._id)}`,hostUrl:this._hostUrl,allowDirtyRead:this._allowDirtyRead});this._batches.push(new n.LinkedList(t.result)),this._hasMore=t.hasMore}get items(){return this._itemsCursor}get extra(){return this._extra}get count(){return this._count}get hasMore(){return this._hasMore}get hasNext(){return this.hasMore||Boolean(this._batches.length)}async*[Symbol.asyncIterator](){for(;this.hasNext;)yield this.next()}async loadAll(){for(;this._hasMore;)await this._more()}async all(){return this.map((t=>t))}async next(){for(;!this._batches.length&&this.hasNext;)await this._more();if(!this._batches.length)return;const t=this._batches.shift();if(!t)return;const e=[...t.values()];return t.clear(!0),e}async forEach(t){let e=0;for(;this.hasNext;){const r=t(await this.next(),e,this);if(e++,!1===r)return r;this.hasNext&&await this._more()}return!0}async map(t){let e=0;const r=[];for(;this.hasNext;){const n=await this.next();r.push(t(n,e,this)),e++}return r}async flatMap(t){let e=0;const r=[];for(;this.hasNext;){const n=t(await this.next(),e,this);Array.isArray(n)?r.push(...n):r.push(n),e++}return r}async reduce(t,e){let r=0;if(!this.hasNext)return e;void 0===e&&(e=await this.next(),r+=1);let n=e;for(;this.hasNext;)n=t(n,await this.next(),r,this),r++;return n}async kill(){if(this._batches.length){for(const t of this._batches.values())t.clear();this._batches.clear()}if(this.hasNext)return this._db.request({method:"DELETE",path:`/_api/cursor/${encodeURIComponent(this._id)}`},(()=>{this._hasMore=!1}))}}class i{constructor(t,e){this._batches=t,this._view=e}get batches(){return this._batches}get extra(){return this.batches.extra}get count(){return this.batches.count}get hasNext(){return this.batches.hasNext}async*[Symbol.asyncIterator](){for(;this.hasNext;)yield this.next()}async all(){return this.batches.flatMap((t=>t))}async next(){for(;this._view.isEmpty&&this.batches.hasMore;)await this._view.more();if(!this._view.isEmpty)return this._view.shift()}async forEach(t){let e=0;for(;this.hasNext;){const r=t(await this.next(),e,this);if(e++,!1===r)return r}return!0}async map(t){let e=0;const r=[];for(;this.hasNext;){const n=await this.next();r.push(t(n,e,this)),e++}return r}async flatMap(t){let e=0;const r=[];for(;this.hasNext;){const n=t(await this.next(),e,this);Array.isArray(n)?r.push(...n):r.push(n),e++}return r}async reduce(t,e){let r=0;if(!this.hasNext)return e;void 0===e&&(e=await this.next(),r+=1);let n=e;for(;this.hasNext;)n=t(n,await this.next(),r,this),r++;return n}async kill(){return this.batches.kill()}}},928:function(t,e,r){"use strict";r.r(e),r.d(e,{Database:function(){return U},isArangoDatabase:function(){return T}});var n=r(594),o=r(97),i=r(91),s=r(95),a=r(43);function h(t){return btoa(t)}var u=r(979);function c(t){const e=t.match(/^(tcp|ssl|tls)((?::|\+).+)/);e&&(t=("tcp"===e[1]?"http":"https")+e[2]);const r=t.match(/^(?:(http|https)\+)?unix:\/\/(\/.+)/);return r&&(t=`${r[1]||"http"}://unix:${r[2]}`),t}var l=r(377);function d(){return{error:!0,message:this.message}}function p(t,e){const r=new URL(t),n=h(`${r.username||"root"}:${r.password}`);r.username="",r.password="";const o=function(t,e){const r={};for(const n of Object.keys(t))e.includes(n)||(r[n]=t[n]);return r}(e,["maxSockets"]);return function(t,e){let{method:i,url:s,headers:a,body:h,timeout:u,expectBinary:c}=t;const p=new URL(s.pathname,r);(r.search||s.search)&&(p.search=s.search?`${r.search}&${s.search.slice(1)}`:r.search),a.authorization||(a.authorization=`Basic ${n}`);let m=(t,r)=>{m=()=>{},e(t,r)};const f=l({useXDR:!0,withCredentials:!0,...o,responseType:c?"blob":"text",url:String(p),body:h,method:i,headers:a,timeout:u},((t,e)=>{if(t){const e=t;e.request=f,e.toJSON=d,o.after&&o.after(e),m(e)}else{const t=e;t.request=f,t.body||(t.body=""),o.after&&o.after(null,t),m(null,t)}}));o.before&&o.before(f)}}function m(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}const f=/\/(json|javascript)(\W|$)/;class y{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};m(this,"_activeTasks",0),m(this,"_arangoVersion",30900),m(this,"_queue",new s.LinkedList),m(this,"_databases",new Map),m(this,"_hosts",[]),m(this,"_hostUrls",[]),m(this,"_transactionId",null),m(this,"_queueTimes",new s.LinkedList);const e=t.url?Array.isArray(t.url)?t.url:[t.url]:["http://127.0.0.1:8529"],r=3*("ROUND_ROBIN"===t.loadBalancingStrategy?e.length:1);void 0!==t.arangoVersion&&(this._arangoVersion=t.arangoVersion),this._agent=t.agent,this._agentOptions={maxSockets:r,...t.agentOptions},this._maxTasks=this._agentOptions.maxSockets,this._headers={...t.headers},this._loadBalancingStrategy=t.loadBalancingStrategy??"NONE",this._precaptureStackTraces=Boolean(t.precaptureStackTraces),this._responseQueueTimeSamples=t.responseQueueTimeSamples??10,this._retryOnConflict=t.retryOnConflict??0,this._responseQueueTimeSamples<0&&(this._responseQueueTimeSamples=1/0),!1===t.maxRetries?this._maxRetries=!1:this._maxRetries=Number(t.maxRetries??0),this.addToHostList(e),t.auth&&(t.auth.hasOwnProperty("token")?this.setBearerAuth(t.auth):this.setBasicAuth(t.auth)),"ONE_RANDOM"===this._loadBalancingStrategy?(this._activeHostUrl=this._hostUrls[Math.floor(Math.random()*this._hostUrls.length)],this._activeDirtyHostUrl=this._hostUrls[Math.floor(Math.random()*this._hostUrls.length)]):(this._activeHostUrl=this._hostUrls[0],this._activeDirtyHostUrl=this._hostUrls[0])}get isArangoConnection(){return!0}get queueTime(){return{getLatest:()=>{var t;return null===(t=this._queueTimes.last)||void 0===t?void 0:t.value[1]},getValues:()=>Array.from(this._queueTimes.values()),getAvg:()=>{let t=0;for(const[,[,e]]of this._queueTimes)t+=e/this._queueTimes.length;return t}}}_runQueue(){if(!this._queue.length||this._activeTasks>=this._maxTasks)return;const t=this._queue.shift();let e=this._activeHostUrl;void 0!==t.hostUrl?e=t.hostUrl:t.allowDirtyRead?(e=this._activeDirtyHostUrl,this._activeDirtyHostUrl=this._hostUrls[(this._hostUrls.indexOf(this._activeDirtyHostUrl)+1)%this._hostUrls.length],t.options.headers["x-arango-allow-dirty-read"]="true"):"ROUND_ROBIN"===this._loadBalancingStrategy&&(this._activeHostUrl=this._hostUrls[(this._hostUrls.indexOf(this._activeHostUrl)+1)%this._hostUrls.length]),this._activeTasks+=1;const r=(n,o)=>{if(this._activeTasks-=1,!n&&o)if(503===o.statusCode&&o.headers["x-arango-endpoint"]){const r=o.headers["x-arango-endpoint"],[n]=this.addToHostList(r);t.hostUrl=n,this._activeHostUrl===e&&(this._activeHostUrl=n),this._queue.push(t)}else{o.arangojsHostUrl=e;const i=o.headers["content-type"],s=o.headers["x-arango-queue-time-seconds"];if(s)for(this._queueTimes.push([Date.now(),Number(s)]);this._responseQueueTimeSamples<this._queueTimes.length;)this._queueTimes.shift();let h;if(o.body.length&&i&&i.match(f))try{h=o.body,h=JSON.parse(h)}catch(e){if(!t.options.expectBinary)return"string"!=typeof h&&(h=o.body.toString("utf-8")),e.res=o,t.stack&&(e.stack+=t.stack()),void r(e)}else h=o.body&&!t.options.expectBinary?o.body.toString("utf-8"):o.body;(0,a.NV)(h)?(o.body=h,n=new a.XM(o)):o.statusCode&&o.statusCode>=400?(o.body=h,n=new a.oo(o)):(t.options.expectBinary||(o.body=h),t.resolve(t.transform?t.transform(o):o))}n&&(!t.allowDirtyRead&&this._hosts.length>1&&this._activeHostUrl===e&&"ROUND_ROBIN"!==this._loadBalancingStrategy&&(this._activeHostUrl=this._hostUrls[(this._hostUrls.indexOf(this._activeHostUrl)+1)%this._hostUrls.length]),(0,a.Pp)(n)&&n.errorNum===u.Vt&&t.retryOnConflict>0?(t.retryOnConflict-=1,this._queue.push(t)):((0,a.g0)(n)&&"connect"===n.syscall&&"ECONNREFUSED"===n.code||(0,a.Pp)(n)&&n.errorNum===u.W2)&&void 0===t.hostUrl&&!1!==this._maxRetries&&t.retries<(this._maxRetries||this._hosts.length-1)?(t.retries+=1,this._queue.push(t)):(t.stack&&(n.stack+=t.stack()),t.reject(n))),this._runQueue()};try{this._hosts[this._hostUrls.indexOf(e)](t.options,r)}catch(t){r(t)}}_buildUrl(t){let{basePath:e,path:r,qs:n}=t;const o=`${e||""}${r||""}`;let i;return n&&(i="string"==typeof n?`?${n}`:`?${function(t){let e="";for(let[r,n]of Object.entries(t))if(void 0!==n)if(r=encodeURIComponent(r),Array.isArray(n))for(let t of n)t=null==t?"":encodeURIComponent(String(t)),e+=`&${r}=${t}`;else n=null===n?"":encodeURIComponent(String(n)),e+=`&${r}=${n}`;return e.slice(1)}(n)}`),i?{pathname:o,search:i}:{pathname:o}}setBearerAuth(t){this.setHeader("authorization",`Bearer ${t.token}`)}setBasicAuth(t){this.setHeader("authorization",`Basic ${h(`${t.username}:${t.password}`)}`)}setResponseQueueTimeSamples(t){for(t<0&&(t=1/0),this._responseQueueTimeSamples=t;this._responseQueueTimeSamples<this._queueTimes.length;)this._queueTimes.shift()}database(t,e){if(null!==e)return e?(this._databases.set(t,e),e):this._databases.get(t);this._databases.delete(t)}setHostList(t){const e=t.map((t=>c(t)));this._hosts.splice(0,this._hosts.length,...e.map((t=>{const e=this._hostUrls.indexOf(t);return-1!==e?this._hosts[e]:p(t,this._agentOptions,this._agent)}))),this._hostUrls.splice(0,this._hostUrls.length,...e)}addToHostList(t){const e=(Array.isArray(t)?t:[t]).map((t=>c(t))),r=e.filter((t=>-1===this._hostUrls.indexOf(t)));return this._hostUrls.push(...r),this._hosts.push(...r.map((t=>p(t,this._agentOptions,this._agent)))),e}setTransactionId(t){this._transactionId=t}clearTransactionId(){this._transactionId=null}setHeader(t,e){null===e?delete this._headers[t]:this._headers[t]=e}close(){for(const t of this._hosts)t.close&&t.close()}async waitForPropagation(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1/0;const r=this._hosts.length,n=[],o=Date.now();let i=0;for(;;){if(n.length===r)return;for(;n.includes(this._hostUrls[i]);)i=(i+1)%r;const s=this._hostUrls[i];try{await this.request({...t,hostUrl:s})}catch(t){if(o+e<Date.now())throw t;await new Promise((t=>setTimeout(t,1e3)));continue}n.includes(s)||n.push(s)}}request(t,e){let{hostUrl:r,method:n="GET",body:o,expectBinary:i=!1,isBinary:s=!1,allowDirtyRead:a=!1,retryOnConflict:h=this._retryOnConflict,timeout:u=0,headers:c,...l}=t;return new Promise(((t,d)=>{let p="text/plain";s?p="application/octet-stream":o&&("object"==typeof o?(o=JSON.stringify(o),p="application/json"):o=String(o));const m={...this._headers,"content-type":p,"x-arango-version":String(this._arangoVersion)};this._transactionId&&(m["x-arango-trx-id"]=this._transactionId);const f={retries:0,hostUrl:r,allowDirtyRead:a,retryOnConflict:h,options:{url:this._buildUrl(l),headers:{...m,...c},timeout:u,method:n,expectBinary:i,body:o},reject:d,resolve:t,transform:e};if(this._precaptureStackTraces)if("function"==typeof Error.captureStackTrace){const t={};Error.captureStackTrace(t),f.stack=()=>`\n${t.stack.split("\n").slice(3).join("\n")}`}else{const t=function(){let t=new Error;if(!t.stack)try{throw t}catch(e){t=e}return t}();Object.prototype.hasOwnProperty.call(t,"stack")&&(f.stack=()=>`\n${t.stack.split("\n").slice(4).join("\n")}`)}this._queue.push(f),this._runQueue()}))}}var _=r(267),g=r(909);function b(t,e){let r;try{r=new FormData;for(const e of Object.keys(t)){let n=t[e];void 0!==n&&(n instanceof Blob||"object"!=typeof n&&"function"!=typeof n||(n=JSON.stringify(n)),r.append(e,n))}}catch(t){return void e(t)}e(null,{body:r})}class v{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};e?"/"!==e.charAt(0)&&(e=`/${e}`):e="",this._db=t,this._path=e,this._headers=r}route(t,e){return t?"/"!==t.charAt(0)&&(t=`/${t}`):t="",new v(this._db,this._path+t,{...this._headers,...e})}request(t){const e={...t};return e.path&&"/"!==e.path?this._path&&"/"!==e.path.charAt(0)?e.path=`/${e.path}`:e.path=e.path:e.path="",e.basePath=this._path,e.headers={...this._headers,...e.headers},e.method=e.method?e.method.toUpperCase():"GET",this._db.request(e,!1)}delete(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];const n="string"==typeof e[0]?e.shift():void 0,[o,i]=e;return this.request({method:"DELETE",path:n,qs:o,headers:i})}get(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];const n="string"==typeof e[0]?e.shift():void 0,[o,i]=e;return this.request({method:"GET",path:n,qs:o,headers:i})}head(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];const n="string"==typeof e[0]?e.shift():void 0,[o,i]=e;return this.request({method:"HEAD",path:n,qs:o,headers:i})}patch(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];const n="string"==typeof e[0]?e.shift():void 0,[o,i,s]=e;return this.request({method:"PATCH",path:n,body:o,qs:i,headers:s})}post(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];const n="string"==typeof e[0]?e.shift():void 0,[o,i,s]=e;return this.request({method:"POST",path:n,body:o,qs:i,headers:s})}put(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];const n="string"==typeof e[0]?e.shift():void 0,[o,i,s]=e;return this.request({method:"PUT",path:n,body:o,qs:i,headers:s})}}class w{constructor(t,e){this._db=t,this._id=e}get isArangoTransaction(){return!0}get id(){return this._id}async exists(){try{return await this.get(),!0}catch(t){if((0,a.Pp)(t)&&t.errorNum===u.kO)return!1;throw t}}get(){return this._db.request({path:`/_api/transaction/${encodeURIComponent(this.id)}`},(t=>t.body.result))}commit(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{allowDirtyRead:e}=t;return this._db.request({method:"PUT",path:`/_api/transaction/${encodeURIComponent(this.id)}`,allowDirtyRead:e},(t=>t.body.result))}abort(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{allowDirtyRead:e}=t;return this._db.request({method:"DELETE",path:`/_api/transaction/${encodeURIComponent(this.id)}`,allowDirtyRead:e},(t=>t.body.result))}step(t){const e=this._db._connection;e.setTransactionId(this.id);try{const r=t();if(!r)throw new Error("Transaction callback was not an async function or did not return a promise!");return Promise.resolve(r)}finally{e.clearTransactionId()}}}var q=r(94);function x(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function T(t){return Boolean(t&&t.isArangoDatabase)}function C(t){if("string"==typeof t)return{write:[t]};if(Array.isArray(t))return{write:t.map(i.collectionToString)};if((0,i.isArangoCollection)(t))return{write:(0,i.collectionToString)(t)};const e={};return t&&(void 0!==t.allowImplicit&&(e.allowImplicit=t.allowImplicit),t.read&&(e.read=Array.isArray(t.read)?t.read.map(i.collectionToString):(0,i.collectionToString)(t.read)),t.write&&(e.write=Array.isArray(t.write)?t.write.map(i.collectionToString):(0,i.collectionToString)(t.write)),t.exclusive&&(e.exclusive=Array.isArray(t.exclusive)?t.exclusive.map(i.collectionToString):(0,i.collectionToString)(t.exclusive))),e}class U{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0;if(x(this,"_analyzers",new Map),x(this,"_collections",new Map),x(this,"_graphs",new Map),x(this,"_views",new Map),T(t)){const r=t._connection,n=(e||t.name).normalize("NFC");this._connection=r,this._name=n;const o=r.database(n);if(o)return o}else{const r=t,{databaseName:n,...o}="string"==typeof r||Array.isArray(r)?{databaseName:e,url:r}:r;this._connection=new y(o),this._name=(null==n?void 0:n.normalize("NFC"))||"_system"}}get isArangoDatabase(){return!0}get name(){return this._name}version(t){return this.request({method:"GET",path:"/_api/version",qs:{details:t}})}route(t,e){return new v(this,t,e)}request(t){let{absolutePath:e=!1,basePath:r,...n}=t,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t=>t.body;return e||(r=`/_db/${encodeURIComponent(this._name)}${r||""}`),this._connection.request({basePath:r,...n},o||void 0)}async acquireHostList(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const e=await this.request({path:"/_api/cluster/endpoints"},(t=>t.body.endpoints.map((t=>t.endpoint))));e.length>0&&(t?this._connection.setHostList(e):this._connection.addToHostList(e))}close(){this._connection.close()}async waitForPropagation(t,e){let{basePath:r,...n}=t;await this._connection.waitForPropagation({...n,basePath:`/_db/${encodeURIComponent(this._name)}${r||""}`},e)}get queueTime(){return this._connection.queueTime}setResponseQueueTimeSamples(t){this._connection.setResponseQueueTimeSamples(t)}useBasicAuth(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"root",e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return this._connection.setBasicAuth({username:t,password:e}),this}useBearerAuth(t){return this._connection.setBearerAuth({token:t}),this}login(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"root",e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return this.request({method:"POST",path:"/_open/auth",body:{username:t,password:e}},(t=>(this.useBearerAuth(t.body.jwt),t.body.jwt)))}database(t){return new U(this,t)}get(){return this.request({path:"/_api/database/current"},(t=>t.body.result))}async exists(){try{return await this.get(),!0}catch(t){if((0,a.Pp)(t)&&t.errorNum===u.zp)return!1;throw t}}createDatabase(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{users:r,...n}=Array.isArray(e)?{users:e}:e;return this.request({method:"POST",path:"/_api/database",body:{name:t.normalize("NFC"),users:r,options:n}},(()=>this.database(t)))}listDatabases(){return this.request({path:"/_api/database"},(t=>t.body.result))}listUserDatabases(){return this.request({path:"/_api/database/user"},(t=>t.body.result))}databases(){return this.request({path:"/_api/database"},(t=>t.body.result.map((t=>this.database(t)))))}userDatabases(){return this.request({path:"/_api/database/user"},(t=>t.body.result.map((t=>this.database(t)))))}dropDatabase(t){return t=t.normalize("NFC"),this.request({method:"DELETE",path:`/_api/database/${encodeURIComponent(t)}`},(t=>t.body.result))}collection(t){return t=t.normalize("NFC"),this._collections.has(t)||this._collections.set(t,new i.Collection(this,t)),this._collections.get(t)}async createCollection(t,e){const r=this.collection(t);return await r.create(e),r}async createEdgeCollection(t,e){return this.createCollection(t,{...e,type:i.CollectionType.EDGE_COLLECTION})}async renameCollection(t,e){t=t.normalize("NFC");const r=await this.request({method:"PUT",path:`/_api/collection/${encodeURIComponent(t)}/rename`,body:{name:e.normalize("NFC")}});return this._collections.delete(t),r}listCollections(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this.request({path:"/_api/collection",qs:{excludeSystem:t}},(t=>t.body.result))}async collections(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return(await this.listCollections(t)).map((t=>this.collection(t.name)))}graph(t){return t=t.normalize("NFC"),this._graphs.has(t)||this._graphs.set(t,new g.kJ(this,t)),this._graphs.get(t)}async createGraph(t,e,r){const n=this.graph(t.normalize("NFC"));return await n.create(e,r),n}listGraphs(){return this.request({path:"/_api/gharial"},(t=>t.body.graphs))}async graphs(){return(await this.listGraphs()).map((t=>this.graph(t._key)))}view(t){return t=t.normalize("NFC"),this._views.has(t)||this._views.set(t,new q.View(this,t)),this._views.get(t)}async createView(t,e){const r=this.view(t.normalize("NFC"));return await r.create(e),r}async renameView(t,e){t=t.normalize("NFC");const r=await this.request({method:"PUT",path:`/_api/view/${encodeURIComponent(t)}/rename`,body:{name:e.normalize("NFC")}});return this._views.delete(t),r}listViews(){return this.request({path:"/_api/view"},(t=>t.body.result))}async views(){return(await this.listViews()).map((t=>this.view(t.name)))}analyzer(t){return t=t.normalize("NFC"),this._analyzers.has(t)||this._analyzers.set(t,new n.L(this,t)),this._analyzers.get(t)}async createAnalyzer(t,e){const r=this.analyzer(t);return await r.create(e),r}listAnalyzers(){return this.request({path:"/_api/analyzer"},(t=>t.body.result))}async analyzers(){return(await this.listAnalyzers()).map((t=>this.analyzer(t.name)))}listUsers(){return this.request({absolutePath:!0,path:"/_api/user"})}getUser(t){return this.request({absolutePath:!0,path:`/_api/user/${encodeURIComponent(t)}`})}createUser(t,e){return"string"==typeof e&&(e={passwd:e}),this.request({absolutePath:!0,method:"POST",path:"/_api/user",body:{user:t,...e}},(t=>t.body))}updateUser(t,e){return"string"==typeof e&&(e={passwd:e}),this.request({absolutePath:!0,method:"PATCH",path:`/api/user/${encodeURIComponent(t)}`,body:e},(t=>t.body))}replaceUser(t,e){return"string"==typeof e&&(e={passwd:e}),this.request({absolutePath:!0,method:"PUT",path:`/api/user/${encodeURIComponent(t)}`,body:e},(t=>t.body))}removeUser(t){return this.request({absolutePath:!0,method:"DELETE",path:`/_api/user/${encodeURIComponent(t)}`},(t=>t.body))}getUserAccessLevel(t,e){let{database:r,collection:n}=e;const o=T(r)?r.name:(null==r?void 0:r.normalize("NFC"))??((0,i.isArangoCollection)(n)?n._db.name:this._name),s=n?`/${encodeURIComponent((0,i.isArangoCollection)(n)?n.name:n.normalize("NFC"))}`:"";return this.request({absolutePath:!0,path:`/_api/user/${encodeURIComponent(t)}/database/${encodeURIComponent(o)}${s}`},(t=>t.body.result))}setUserAccessLevel(t,e){let{database:r,collection:n,grant:o}=e;const s=T(r)?r.name:(null==r?void 0:r.normalize("NFC"))??((0,i.isArangoCollection)(n)?n._db.name:this._name),a=n?`/${encodeURIComponent((0,i.isArangoCollection)(n)?n.name:n.normalize("NFC"))}`:"";return this.request({absolutePath:!0,method:"PUT",path:`/_api/user/${encodeURIComponent(t)}/database/${encodeURIComponent(s)}${a}`,body:{grant:o}},(t=>t.body))}clearUserAccessLevel(t,e){let{database:r,collection:n}=e;const o=T(r)?r.name:(null==r?void 0:r.normalize("NFC"))??((0,i.isArangoCollection)(n)?n._db.name:this._name),s=n?`/${encodeURIComponent((0,i.isArangoCollection)(n)?n.name:n.normalize("NFC"))}`:"";return this.request({absolutePath:!0,method:"DELETE",path:`/_api/user/${encodeURIComponent(t)}/database/${encodeURIComponent(o)}${s}`},(t=>t.body))}getUserDatabases(t,e){return this.request({absolutePath:!0,path:`/_api/user/${encodeURIComponent(t)}/database`,qs:{full:e}},(t=>t.body.result))}executeTransaction(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{allowDirtyRead:n,...o}=r;return this.request({method:"POST",path:"/_api/transaction",allowDirtyRead:n,body:{collections:C(t),action:e,...o}},(t=>t.body.result))}transaction(t){return new w(this,t)}beginTransaction(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{allowDirtyRead:r,...n}=e;return this.request({method:"POST",path:"/_api/transaction/begin",allowDirtyRead:r,body:{collections:C(t),...n}},(t=>new w(this,t.body.result.id)))}listTransactions(){return this._connection.request({path:"/_api/transaction"},(t=>t.body.transactions))}async transactions(){return(await this.listTransactions()).map((t=>this.transaction(t.id)))}query(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};(0,o.isAqlQuery)(t)?(r=e??{},e=t.bindVars,t=t.query):(0,o.isAqlLiteral)(t)&&(t=t.toAQL());const{allowDirtyRead:n,retryOnConflict:i,count:s,batchSize:a,cache:h,memoryLimit:u,ttl:c,timeout:l,...d}=r;return this.request({method:"POST",path:"/_api/cursor",body:{query:t,bindVars:e,count:s,batchSize:a,cache:h,memoryLimit:u,ttl:c,options:d},allowDirtyRead:n,retryOnConflict:i,timeout:l},(t=>new _.o(this,t.body,t.arangojsHostUrl,n).items))}explain(t,e,r){return(0,o.isAqlQuery)(t)?(r=e,e=t.bindVars,t=t.query):(0,o.isAqlLiteral)(t)&&(t=t.toAQL()),this.request({method:"POST",path:"/_api/explain",body:{query:t,bindVars:e,options:r}})}parse(t){return(0,o.isAqlQuery)(t)?t=t.query:(0,o.isAqlLiteral)(t)&&(t=t.toAQL()),this.request({method:"POST",path:"/_api/query",body:{query:t}})}queryRules(){return this.request({path:"/_api/query/rules"})}queryTracking(t){return this.request(t?{method:"PUT",path:"/_api/query/properties",body:t}:{method:"GET",path:"/_api/query/properties"})}listRunningQueries(){return this.request({method:"GET",path:"/_api/query/current"})}listSlowQueries(){return this.request({method:"GET",path:"/_api/query/slow"})}clearSlowQueries(){return this.request({method:"DELETE",path:"/_api/query/slow"},(()=>{}))}killQuery(t){return this.request({method:"DELETE",path:`/_api/query/${encodeURIComponent(t)}`},(()=>{}))}listFunctions(){return this.request({path:"/_api/aqlfunction"},(t=>t.body.result))}createFunction(t,e){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return this.request({method:"POST",path:"/_api/aqlfunction",body:{name:t,code:e,isDeterministic:r}})}dropFunction(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.request({method:"DELETE",path:`/_api/aqlfunction/${encodeURIComponent(t)}`,qs:{group:e}})}listServices(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this.request({path:"/_api/foxx",qs:{excludeSystem:t}})}async installService(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{configuration:n,dependencies:o,...i}=r,s=await b({configuration:n,dependencies:o,source:e});return await this.request({...s,method:"POST",path:"/_api/foxx",isBinary:!0,qs:{...i,mount:t}})}async replaceService(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{configuration:n,dependencies:o,...i}=r,s=await b({configuration:n,dependencies:o,source:e});return await this.request({...s,method:"PUT",path:"/_api/foxx/service",isBinary:!0,qs:{...i,mount:t}})}async upgradeService(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{configuration:n,dependencies:o,...i}=r,s=await b({configuration:n,dependencies:o,source:e});return await this.request({...s,method:"PATCH",path:"/_api/foxx/service",isBinary:!0,qs:{...i,mount:t}})}uninstallService(t,e){return this.request({method:"DELETE",path:"/_api/foxx/service",qs:{...e,mount:t}},(()=>{}))}getService(t){return this.request({path:"/_api/foxx/service",qs:{mount:t}})}getServiceConfiguration(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.request({path:"/_api/foxx/configuration",qs:{mount:t,minimal:e}})}replaceServiceConfiguration(t,e){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return this.request({method:"PUT",path:"/_api/foxx/configuration",body:e,qs:{mount:t,minimal:r}})}updateServiceConfiguration(t,e){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return this.request({method:"PATCH",path:"/_api/foxx/configuration",body:e,qs:{mount:t,minimal:r}})}getServiceDependencies(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.request({path:"/_api/foxx/dependencies",qs:{mount:t,minimal:e}})}replaceServiceDependencies(t,e){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return this.request({method:"PUT",path:"/_api/foxx/dependencies",body:e,qs:{mount:t,minimal:r}})}updateServiceDependencies(t,e){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return this.request({method:"PATCH",path:"/_api/foxx/dependencies",body:e,qs:{mount:t,minimal:r}})}setServiceDevelopmentMode(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return this.request({method:e?"POST":"DELETE",path:"/_api/foxx/development",qs:{mount:t}})}listServiceScripts(t){return this.request({path:"/_api/foxx/scripts",qs:{mount:t}})}runServiceScript(t,e,r){return this.request({method:"POST",path:`/_api/foxx/scripts/${encodeURIComponent(e)}`,body:r,qs:{mount:t}})}runServiceTests(t,e){return this.request({method:"POST",path:"/_api/foxx/tests",qs:{...e,mount:t}})}getServiceReadme(t){return this.request({path:"/_api/foxx/readme",qs:{mount:t}})}getServiceDocumentation(t){return this.request({path:"/_api/foxx/swagger",qs:{mount:t}})}downloadService(t){return this.request({method:"POST",path:"/_api/foxx/download",qs:{mount:t},expectBinary:!0})}commitLocalServiceState(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this.request({method:"POST",path:"/_api/foxx/commit",qs:{replace:t}},(()=>{}))}}},974:function(t,e,r){"use strict";function n(t,e){let r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if("string"!=typeof t){if(t._id)return n(t._id,e);if(t._key)return n(t._key,e);throw new Error("Document handle must be a string or an object with a _key or _id attribute")}if(t.includes("/")){const[n,...o]=t.split("/"),i=n.normalize("NFC");if(r&&i!==e)throw new Error(`Document ID "${t}" does not match collection name "${e}"`);return[i,...o].join("/")}return`${e}/${t}`}r.d(e,{q:function(){return n}})},43:function(t,e,r){"use strict";function n(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}r.d(e,{NV:function(){return a},Pp:function(){return s},XM:function(){return u},g0:function(){return h},oo:function(){return c}});const o={0:"Network Error",304:"Not Modified",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Payload Too Large",414:"Request-URI Too Long",415:"Unsupported Media Type",416:"Requested Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",421:"Misdirected Request",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",444:"Connection Closed Without Response",451:"Unavailable For Legal Reasons",499:"Client Closed Request",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",510:"Not Extended",511:"Network Authentication Required",599:"Network Connect Timeout Error"},i=["fileName","lineNumber","columnNumber","stack","description","number"];function s(t){return Boolean(t&&t.isArangoError)}function a(t){return t&&t.hasOwnProperty("error")&&t.hasOwnProperty("code")&&t.hasOwnProperty("errorMessage")&&t.hasOwnProperty("errorNum")}function h(t){return Object.getPrototypeOf(t)===Error.prototype&&t.hasOwnProperty("code")&&t.hasOwnProperty("errno")&&t.hasOwnProperty("syscall")}class u extends Error{constructor(t){super(),n(this,"name","ArangoError"),this.response=t,this.message=t.body.errorMessage,this.errorNum=t.body.errorNum,this.code=t.body.code;const e=new Error(this.message);e.name=this.name;for(const t of i)e[t]&&(this[t]=e[t])}get isArangoError(){return!0}toJSON(){return{error:!0,errorMessage:this.message,errorNum:this.errorNum,code:this.code}}}class c extends Error{constructor(t){super(),n(this,"name","HttpError"),this.response=t,this.code=t.statusCode||500,this.message=o[this.code]||o[500];const e=new Error(this.message);e.name=this.name;for(const t of i)e[t]&&(this[t]=e[t])}toJSON(){return{error:!0,code:this.code}}}},909:function(t,e,r){"use strict";r.d(e,{Vp:function(){return a},kJ:function(){return d}});var n=r(91),o=r(974),i=r(43),s=r(979);function a(t){return Boolean(t&&t.isArangoGraph)}function h(t,e){const{new:r,old:n,[e]:o,...i}=t,s={...i,...o};return void 0!==r&&(s.new=r),void 0!==n&&(s.old=n),s}function u(t){const e={};return e.collection=(0,n.collectionToString)(t.collection),e.from=Array.isArray(t.from)?t.from.map(n.collectionToString):[(0,n.collectionToString)(t.from)],e.to=Array.isArray(t.to)?t.to.map(n.collectionToString):[(0,n.collectionToString)(t.to)],e}class c{constructor(t,e,r){this._db=t,this._collection=t.collection(e),this._name=this._collection.name,this._graph=r}get isArangoCollection(){return!0}get name(){return this._name}get collection(){return this._collection}get graph(){return this._graph}async vertexExists(t){try{return await this._db.request({method:"HEAD",path:`/_api/gharial/${encodeURIComponent(this.graph.name)}/vertex/${encodeURI((0,o.q)(t,this._name))}`},(()=>!0))}catch(t){if(404===t.code)return!1;throw t}}async vertex(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};"boolean"==typeof e&&(e={graceful:e});const{allowDirtyRead:r,graceful:n=!1,rev:a,...h}=e,u={};a&&(u["if-match"]=a);const c=this._db.request({path:`/_api/gharial/${encodeURIComponent(this.graph.name)}/vertex/${encodeURI((0,o.q)(t,this._name))}`,headers:u,qs:h,allowDirtyRead:r},(t=>t.body.vertex));if(!n)return c;try{return await c}catch(t){if((0,i.Pp)(t)&&t.errorNum===s.Gk)return null;throw t}}save(t,e){return this._db.request({method:"POST",path:`/_api/gharial/${encodeURIComponent(this.graph.name)}/vertex/${encodeURIComponent(this._name)}`,body:t,qs:e},(t=>h(t.body,"vertex")))}replace(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};"string"==typeof r&&(r={rev:r});const{rev:n,...i}=r,s={};return n&&(s["if-match"]=n),this._db.request({method:"PUT",path:`/_api/gharial/${encodeURIComponent(this.graph.name)}/vertex/${encodeURI((0,o.q)(t,this._name))}`,body:e,qs:i,headers:s},(t=>h(t.body,"vertex")))}update(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};"string"==typeof r&&(r={rev:r});const n={},{rev:i,...s}=r;return i&&(n["if-match"]=i),this._db.request({method:"PATCH",path:`/_api/gharial/${encodeURIComponent(this.graph.name)}/vertex/${encodeURI((0,o.q)(t,this._name))}`,body:e,qs:s,headers:n},(t=>h(t.body,"vertex")))}remove(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};"string"==typeof e&&(e={rev:e});const r={},{rev:n,...i}=e;return n&&(r["if-match"]=n),this._db.request({method:"DELETE",path:`/_api/gharial/${encodeURIComponent(this.graph.name)}/vertex/${encodeURI((0,o.q)(t,this._name))}`,qs:i,headers:r},(t=>h(t.body,"removed")))}}class l{constructor(t,e,r){this._db=t,this._collection=t.collection(e),this._name=this._collection.name,this._graph=r}get isArangoCollection(){return!0}get name(){return this._name}get collection(){return this._collection}get graph(){return this._graph}async edgeExists(t){try{return await this._db.request({method:"HEAD",path:`/_api/gharial/${encodeURIComponent(this.graph.name)}/edge/${encodeURI((0,o.q)(t,this._name))}`},(()=>!0))}catch(t){if(404===t.code)return!1;throw t}}async edge(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};"boolean"==typeof e&&(e={graceful:e});const{allowDirtyRead:r,graceful:n=!1,rev:a,...h}=e,u=this._db.request({path:`/_api/gharial/${encodeURIComponent(this.graph.name)}/edge/${encodeURI((0,o.q)(t,this._name))}`,qs:h,allowDirtyRead:r},(t=>t.body.edge));if(!n)return u;try{return await u}catch(t){if((0,i.Pp)(t)&&t.errorNum===s.Gk)return null;throw t}}save(t,e){return this._db.request({method:"POST",path:`/_api/gharial/${encodeURIComponent(this.graph.name)}/edge/${encodeURIComponent(this._name)}`,body:t,qs:e},(t=>h(t.body,"edge")))}replace(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};"string"==typeof r&&(r={rev:r});const{rev:n,...i}=r,s={};return n&&(s["if-match"]=n),this._db.request({method:"PUT",path:`/_api/gharial/${encodeURIComponent(this.graph.name)}/edge/${encodeURI((0,o.q)(t,this._name))}`,body:e,qs:i,headers:s},(t=>h(t.body,"edge")))}update(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};"string"==typeof r&&(r={rev:r});const{rev:n,...i}=r,s={};return n&&(s["if-match"]=n),this._db.request({method:"PATCH",path:`/_api/gharial/${encodeURIComponent(this.graph.name)}/edge/${encodeURI((0,o.q)(t,this._name))}`,body:e,qs:i,headers:s},(t=>h(t.body,"edge")))}remove(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};"string"==typeof e&&(e={rev:e});const{rev:r,...n}=e,i={};return r&&(i["if-match"]=r),this._db.request({method:"DELETE",path:`/_api/gharial/${encodeURIComponent(this.graph.name)}/edge/${encodeURI((0,o.q)(t,this._name))}`,qs:n,headers:i},(t=>h(t.body,"removed")))}}class d{constructor(t,e){this._name=e.normalize("NFC"),this._db=t}get isArangoGraph(){return!0}get name(){return this._name}async exists(){try{return await this.get(),!0}catch(t){if((0,i.Pp)(t)&&t.errorNum===s.D$)return!1;throw t}}get(){return this._db.request({path:`/_api/gharial/${encodeURIComponent(this._name)}`},(t=>t.body.graph))}create(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{orphanCollections:r,satellites:o,waitForSync:i,isSmart:s,isDisjoint:a,...h}=e;return this._db.request({method:"POST",path:"/_api/gharial",body:{orphanCollections:r&&(Array.isArray(r)?r.map(n.collectionToString):[(0,n.collectionToString)(r)]),edgeDefinitions:t.map(u),isSmart:s,isDisjoint:a,name:this._name,options:{...h,satellites:null==o?void 0:o.map(n.collectionToString)}},qs:{waitForSync:i}},(t=>t.body.graph))}drop(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this._db.request({method:"DELETE",path:`/_api/gharial/${encodeURIComponent(this._name)}`,qs:{dropCollections:t}},(t=>t.body.removed))}vertexCollection(t){return new c(this._db,(0,n.collectionToString)(t),this)}listVertexCollections(){return this._db.request({path:`/_api/gharial/${encodeURIComponent(this._name)}/vertex`},(t=>t.body.collections))}async vertexCollections(){return(await this.listVertexCollections()).map((t=>new c(this._db,t,this)))}addVertexCollection(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{satellites:r,...o}=e;return this._db.request({method:"POST",path:`/_api/gharial/${encodeURIComponent(this._name)}/vertex`,body:{collection:(0,n.collectionToString)(t),options:{...o,satellites:null==r?void 0:r.map(n.collectionToString)}}},(t=>t.body.graph))}removeVertexCollection(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this._db.request({method:"DELETE",path:`/_api/gharial/${encodeURIComponent(this._name)}/vertex/${encodeURIComponent((0,n.collectionToString)(t))}`,qs:{dropCollection:e}},(t=>t.body.graph))}edgeCollection(t){return new l(this._db,(0,n.collectionToString)(t),this)}listEdgeCollections(){return this._db.request({path:`/_api/gharial/${encodeURIComponent(this._name)}/edge`},(t=>t.body.collections))}async edgeCollections(){return(await this.listEdgeCollections()).map((t=>new l(this._db,t,this)))}addEdgeDefinition(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{satellites:r,...o}=e;return this._db.request({method:"POST",path:`/_api/gharial/${encodeURIComponent(this._name)}/edge`,body:{...u(t),options:{...o,satellites:null==r?void 0:r.map(n.collectionToString)}}},(t=>t.body.graph))}replaceEdgeDefinition(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=t,i=e;e&&!e.hasOwnProperty("collection")&&(r=e,e=void 0),e||(i=t,o=i.collection);const{satellites:s,...a}=r;return this._db.request({method:"PUT",path:`/_api/gharial/${encodeURIComponent(this._name)}/edge/${encodeURIComponent((0,n.collectionToString)(o))}`,body:{...u(i),options:{...a,satellites:null==s?void 0:s.map(n.collectionToString)}}},(t=>t.body.graph))}removeEdgeDefinition(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this._db.request({method:"DELETE",path:`/_api/gharial/${encodeURIComponent(this._name)}/edge/${encodeURIComponent((0,n.collectionToString)(t))}`,qs:{dropCollection:e}},(t=>t.body.graph))}traversal(t,e){return this._db.request({method:"POST",path:"/_api/traversal",body:{...e,startVertex:t,graphName:this._name}},(t=>t.body.result))}}},979:function(t,e,r){"use strict";r.d(e,{D$:function(){return l},Gk:function(){return a},IB:function(){return s},I_:function(){return u},Vt:function(){return i},W2:function(){return o},Xf:function(){return h},kO:function(){return n},zp:function(){return c}});const n=10,o=503,i=1200,s=1202,a=1202,h=1203,u=1203,c=1228,l=1924},94:function(t,e,r){"use strict";r.r(e),r.d(e,{View:function(){return s},isArangoView:function(){return i}});var n=r(43),o=r(979);function i(t){return Boolean(t&&t.isArangoView)}class s{constructor(t,e){this._db=t,this._name=e.normalize("NFC")}get isArangoView(){return!0}get name(){return this._name}get(){return this._db.request({path:`/_api/view/${encodeURIComponent(this._name)}`})}async exists(){try{return await this.get(),!0}catch(t){if((0,n.Pp)(t)&&t.errorNum===o.I_)return!1;throw t}}create(t){return this._db.request({method:"POST",path:"/_api/view",body:{...t,name:this._name}})}async rename(t){const e=this._db.renameView(this._name,t);return this._name=t.normalize("NFC"),e}properties(){return this._db.request({path:`/_api/view/${encodeURIComponent(this._name)}/properties`})}updateProperties(t){return this._db.request({method:"PATCH",path:`/_api/view/${encodeURIComponent(this._name)}/properties`,body:t??{}})}replaceProperties(t){return this._db.request({method:"PUT",path:`/_api/view/${encodeURIComponent(this._name)}/properties`,body:t??{}})}drop(){return this._db.request({method:"DELETE",path:`/_api/view/${encodeURIComponent(this._name)}`},(t=>t.body.result))}}},293:function(t,e,r){"use strict";const{aql:n}=r(97),{CollectionStatus:o,CollectionType:i}=r(91),{ViewType:s}=r(94),{Database:a}=r(928);function h(t){return"string"==typeof t||Array.isArray(t),new a(t)}t.exports=h,Object.assign(h,{aql:n,arangojs:h,CollectionStatus:o,CollectionType:i,Database:a,ViewType:s})}},e={};function r(n){var o=e[n];if(void 0!==o)return o.exports;var i=e[n]={exports:{}};return t[n](i,i.exports,r),i.exports}return r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,{a:e}),e},r.d=function(t,e){for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r(588),r(293)}()}));
|
|
2
2
|
//# sourceMappingURL=web.js.map
|