neo4j-driver
Version:
The official Neo4j driver for Javascript
1 lines • 570 kB
JavaScript
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).neo4j=t()}(this,function(){"use strict";var r="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function D(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var U={},L={},e={},t={},n={},o={},F=(Object.defineProperty(o,"__esModule",{value:!0}),o.getBrokenObjectReason=o.isBrokenObject=o.createBrokenObject=void 0,"__isBrokenObject__"),B="__reason__";o.createBrokenObject=function(r,e){function n(){throw r}return void 0===e&&(e={}),new Proxy(e,{get:function(e,t){return t===F||(t===B?r:void("toJSON"!==t&&n()))},set:n,apply:n,construct:n,defineProperty:n,deleteProperty:n,getOwnPropertyDescriptor:n,getPrototypeOf:n,has:n,isExtensible:n,ownKeys:n,preventExtensions:n,setPrototypeOf:n})},o.isBrokenObject=function(e){return null!==e&&"object"==typeof e&&!0===e[F]},o.getBrokenObjectReason=function(e){return e[B]},Object.defineProperty(n,"__esModule",{value:!0}),n.stringify=void 0;var W=o;n.stringify=function(e,t){return JSON.stringify(e,function(e,r){return(0,W.isBrokenObject)(r)?{__isBrokenObject__:!0,__reason__:(0,W.getBrokenObjectReason)(r)}:"bigint"==typeof r?"".concat(r,"n"):!0!==(null==t?void 0:t.sortedElements)||"object"!=typeof r||Array.isArray(r)?!0!==(null==t?void 0:t.useCustomToString)||"object"!=typeof r||Array.isArray(r)||"function"!=typeof r.toString||r.toString===Object.prototype.toString?r:null==r?void 0:r.toString():Object.keys(r).sort().reduce(function(e,t){return e[t]=r[t],e},{})})};var q,z,V={},i=(i=V,Object.defineProperty(i,"__esModule",{value:!0}),i.rawPolyfilledDiagnosticRecord=void 0,i.rawPolyfilledDiagnosticRecord={OPERATION:"",OPERATION_CODE:"0",CURRENT_SCHEMA:"/"},Object.freeze(i.rawPolyfilledDiagnosticRecord),r&&r.__extends||(q=function(e,t){return(q=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}q(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)})),H=r&&r.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&("get"in o?t.__esModule:!o.writable&&!o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){e[n=void 0===n?r:n]=t[r]}),G=r&&r.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Y=r&&r.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&H(t,e,r);return G(t,e),t},K=(Object.defineProperty(t,"__esModule",{value:!0}),t.PROTOCOL_ERROR=t.SESSION_EXPIRED=t.SERVICE_UNAVAILABLE=t.GQLError=t.Neo4jError=t.isRetriableError=t.newGQLError=t.newError=void 0,Y(n)),Z=V,Y={DATABASE_ERROR:"DATABASE_ERROR",CLIENT_ERROR:"CLIENT_ERROR",TRANSIENT_ERROR:"TRANSIENT_ERROR",UNKNOWN:"UNKNOWN"},Q=(Object.freeze(Y),Object.values(Y)),X="ServiceUnavailable",J=(t.SERVICE_UNAVAILABLE=X,"SessionExpired"),$=(t.SESSION_EXPIRED=J,t.PROTOCOL_ERROR="ProtocolError",z=Error,i(ee,z),Object.defineProperty(ee.prototype,"diagnosticRecordAsJsonString",{get:function(){return K.stringify(this.diagnosticRecord,{useCustomToString:!0})},enumerable:!1,configurable:!0}),ee);function ee(e,t,r,n,o){var i=this;return(i=z.call(this,e,null!=o?{cause:o}:void 0)||this).constructor=ee,i.__proto__=ee.prototype,i.cause=null!=o?o:void 0,i.gqlStatus=t,i.gqlStatusDescription=r,i.diagnosticRecord=n,i.classification=void 0!==(e=i.diagnosticRecord)&&void 0!==e._classification&&Q.includes(e._classification)?null==e?void 0:e._classification:"UNKNOWN",i.rawClassification=null!=(o=null==n?void 0:n._classification)?o:void 0,i.name="GQLError",i}t.GQLError=$;i(ne,te=$),ne.isRetriable=function(e){return null!=e&&e instanceof ne&&e.retriable};var te,re=ne;function ne(e,t,r,n,o,i){e=te.call(this,e,r,n,o,i)||this;return e.constructor=ne,e.__proto__=ne.prototype,e.code=t,e.name="Neo4jError",e.retriable=(r=t)===X||r===J||"Neo.ClientError.Security.AuthorizationExpired"===r||function(e){return!0===(null==e?void 0:e.includes("TransientError"))}(r),e}t.Neo4jError=re,t.newError=function(e,t,r,n,o,i){return new re(e,null!=t?t:"N/A",null!=n?n:"50N42",null!=o?o:"error: general processing exception - unexpected error. "+e,null!=i?i:Z.rawPolyfilledDiagnosticRecord,r)},t.newGQLError=function(e,t,r,n,o){return new $(e,null!=r?r:"50N42",null!=n?n:"error: general processing exception - unexpected error. "+e,null!=o?o:Z.rawPolyfilledDiagnosticRecord,t)};Y=re.isRetriable;t.isRetriableError=Y;var i={},oe=(Object.defineProperty(i,"__esModule",{value:!0}),i.toString=i.toNumber=i.inSafeRange=i.isInt=i.int=void 0,t),ie=new Map,Y=(d.prototype.inSafeRange=function(){return this.greaterThanOrEqual(d.MIN_SAFE_VALUE)&&this.lessThanOrEqual(d.MAX_SAFE_VALUE)},d.prototype.toInt=function(){return this.low},d.prototype.toNumber=function(){return this.high*pe+(this.low>>>0)},d.prototype.toBigInt=function(){var e;return this.isZero()?BigInt(0):this.isPositive()?BigInt(this.high>>>0)*BigInt(pe)+BigInt(this.low>>>0):(e=this.negate(),BigInt(-1)*(BigInt(e.high>>>0)*BigInt(pe)+BigInt(e.low>>>0)))},d.prototype.toNumberOrInfinity=function(){return this.lessThan(d.MIN_SAFE_VALUE)?Number.NEGATIVE_INFINITY:this.greaterThan(d.MAX_SAFE_VALUE)?Number.POSITIVE_INFINITY:this.toNumber()},d.prototype.toString=function(e){if((e=null!=e?e:10)<2||36<e)throw RangeError("radix out of range: "+e.toString());if(this.isZero())return"0";var t,r,n;if(this.isNegative())return this.equals(d.MIN_VALUE)?(t=d.fromNumber(e),n=(r=this.div(t)).multiply(t).subtract(this),r.toString(e)+n.toInt().toString(e)):"-"+this.negate().toString(e);for(var o=d.fromNumber(Math.pow(e,6)),i=(n=this,"");;){var u=n.div(o),a=(n.subtract(u.multiply(o)).toInt()>>>0).toString(e);if((n=u).isZero())return a+i;for(;a.length<6;)a="0"+a;i=""+a+i}},d.prototype.valueOf=function(){return this.toBigInt()},d.prototype.getHighBits=function(){return this.high},d.prototype.getLowBits=function(){return this.low},d.prototype.getNumBitsAbs=function(){if(this.isNegative())return this.equals(d.MIN_VALUE)?64:this.negate().getNumBitsAbs();for(var e=0!==this.high?this.high:this.low,t=0,t=31;0<t&&0==(e&1<<t);t--);return 0!==this.high?t+33:t+1},d.prototype.isZero=function(){return 0===this.high&&0===this.low},d.prototype.isNegative=function(){return this.high<0},d.prototype.isPositive=function(){return 0<=this.high},d.prototype.isOdd=function(){return 1==(1&this.low)},d.prototype.isEven=function(){return 0==(1&this.low)},d.prototype.equals=function(e){e=d.fromValue(e);return this.high===e.high&&this.low===e.low},d.prototype.notEquals=function(e){return!this.equals(e)},d.prototype.lessThan=function(e){return this.compare(e)<0},d.prototype.lessThanOrEqual=function(e){return this.compare(e)<=0},d.prototype.greaterThan=function(e){return 0<this.compare(e)},d.prototype.greaterThanOrEqual=function(e){return 0<=this.compare(e)},d.prototype.compare=function(e){e=d.fromValue(e);if(this.equals(e))return 0;var t=this.isNegative(),r=e.isNegative();return t&&!r||(t||!r)&&this.subtract(e).isNegative()?-1:1},d.prototype.negate=function(){return this.equals(d.MIN_VALUE)?d.MIN_VALUE:this.not().add(d.ONE)},d.prototype.add=function(e){var e=d.fromValue(e),t=this.high>>>16,r=65535&this.high,n=this.low>>>16,o=65535&this.low,i=e.high>>>16,u=65535&e.high,a=e.low>>>16,s=0,c=0,l=0,f=0;return c+=(l=l+((f+=o+(65535&e.low))>>>16)+(n+a))>>>16,d.fromBits((l&=65535)<<16|(f&=65535),((s+=(c+=r+u)>>>16)+(t+i)&65535)<<16|(c&=65535))},d.prototype.subtract=function(e){e=d.fromValue(e);return this.add(e.negate())},d.prototype.multiply=function(e){if(this.isZero())return d.ZERO;e=d.fromValue(e);if(e.isZero())return d.ZERO;if(this.equals(d.MIN_VALUE))return e.isOdd()?d.MIN_VALUE:d.ZERO;if(e.equals(d.MIN_VALUE))return this.isOdd()?d.MIN_VALUE:d.ZERO;if(this.isNegative())return e.isNegative()?this.negate().multiply(e.negate()):this.negate().multiply(e).negate();if(e.isNegative())return this.multiply(e.negate()).negate();if(this.lessThan(he)&&e.lessThan(he))return d.fromNumber(this.toNumber()*e.toNumber());var t=this.high>>>16,r=65535&this.high,n=this.low>>>16,o=65535&this.low,i=e.high>>>16,u=65535&e.high,a=e.low>>>16,e=65535&e.low,s=0,c=0,l=0,f=(f=0)+((c=c+((l+=o*e)>>>16)+n*e)>>>16)+((c=(c&65535)+o*a)>>>16);return d.fromBits((c&=65535)<<16|(l&=65535),((s+=(f+=r*e)>>>16)+((f=(f&65535)+n*a)>>>16)+((f=(f&65535)+o*u)>>>16)+(t*e+r*a+n*u+o*i)&65535)<<16|(f&=65535))},d.prototype.div=function(e){var t,r,n,o=d.fromValue(e);if(o.isZero())throw(0,oe.newError)("division by zero");if(this.isZero())return d.ZERO;{if(this.equals(d.MIN_VALUE))return o.equals(d.ONE)||o.equals(d.NEG_ONE)?d.MIN_VALUE:o.equals(d.MIN_VALUE)?d.ONE:(n=this.shiftRight(1).div(o).shiftLeft(1)).equals(d.ZERO)?o.isNegative()?d.ONE:d.NEG_ONE:(t=this.subtract(o.multiply(n)),n.add(t.div(o)));if(o.equals(d.MIN_VALUE))return d.ZERO}if(this.isNegative())return o.isNegative()?this.negate().div(o.negate()):this.negate().div(o).negate();if(o.isNegative())return this.div(o.negate()).negate();for(r=d.ZERO,t=this;t.greaterThanOrEqual(o);){n=Math.max(1,Math.floor(t.toNumber()/o.toNumber()));for(var i=Math.ceil(Math.log(n)/Math.LN2),u=i<=48?1:Math.pow(2,i-48),a=d.fromNumber(n),s=a.multiply(o);s.isNegative()||s.greaterThan(t);)s=(a=d.fromNumber(n-=u)).multiply(o);a.isZero()&&(a=d.ONE),r=r.add(a),t=t.subtract(s)}return r},d.prototype.modulo=function(e){e=d.fromValue(e);return this.subtract(this.div(e).multiply(e))},d.prototype.not=function(){return d.fromBits(~this.low,~this.high)},d.prototype.and=function(e){e=d.fromValue(e);return d.fromBits(this.low&e.low,this.high&e.high)},d.prototype.or=function(e){e=d.fromValue(e);return d.fromBits(this.low|e.low,this.high|e.high)},d.prototype.xor=function(e){e=d.fromValue(e);return d.fromBits(this.low^e.low,this.high^e.high)},d.prototype.shiftLeft=function(e){e=d.toNumber(e);return 0==(e&=63)?d.ZERO:e<32?d.fromBits(this.low<<e,this.high<<e|this.low>>>32-e):d.fromBits(0,this.low<<e-32)},d.prototype.shiftRight=function(e){var t=d.toNumber(e),e=d.toNumber(e);return 0==(t&=63)?d.ZERO:e<32?d.fromBits(this.low>>>t|this.high<<32-t,this.high>>t):d.fromBits(this.high>>t-32,0<=this.high?0:-1)},d.isInteger=function(e){return!0===(null==e?void 0:e.__isInteger__)},d.fromInt=function(e){if(-128<=(e|=0)&&e<128&&null!=(t=ie.get(e)))return t;var t=new d(e,e<0?-1:0);return-128<=e&&e<128&&ie.set(e,t),t},d.fromBits=function(e,t){return new d(e,t)},d.fromNumber=function(e){return isNaN(e)||!isFinite(e)?d.ZERO:e<=-de?d.MIN_VALUE:de<=e+1?d.MAX_VALUE:e<0?d.fromNumber(-e).negate():new d(e%pe|0,e/pe|0)},d.fromString=function(e,t,r){var n=(void 0===r?{}:r).strictStringValidation;if(0===e.length)throw(0,oe.newError)("number format error: empty string");if("NaN"===e||"Infinity"===e||"+Infinity"===e||"-Infinity"===e)return d.ZERO;if((t=null!=t?t:10)<2||36<t)throw(0,oe.newError)("radix out of range: "+t.toString());if(0<(r=e.indexOf("-")))throw(0,oe.newError)('number format error: interior "-" character: '+e);if(0===r)return d.fromString(e.substring(1),t).negate();for(var o,i,u=d.fromNumber(Math.pow(t,8)),a=d.ZERO,s=0;s<e.length;s+=8){var c,l=Math.min(8,e.length-s),f=e.substring(s,s+l),p=parseInt(f,t);if(!0===n&&(o=f,c=p,i=t,Number.isNaN(o)||Number.isNaN(c)||function(e,t,r){e=e.toString(t),t=Math.max(r-e.length,0),r="0".repeat(t);return"".concat(r).concat(e)}(c,i,o.length)!==o.toLowerCase()))throw(0,oe.newError)('number format error: "'.concat(f,'" is NaN in radix ').concat(t,": ").concat(e));a=l<8?(c=d.fromNumber(Math.pow(t,l)),a.multiply(c).add(d.fromNumber(p))):(a=a.multiply(u)).add(d.fromNumber(p))}return a},d.fromValue=function(e,t){return void 0===t&&(t={}),e instanceof d?e:"number"==typeof e?(!0===t.ceilFloat&&(e=Math.ceil(e)),d.fromNumber(e)):"string"==typeof e?d.fromString(e,void 0,t):"bigint"==typeof e?d.fromString(e.toString()):new d(e.low,e.high)},d.toNumber=function(e){switch(typeof e){case"number":return e;case"bigint":return Number(e);default:return d.fromValue(e).toNumber()}},d.toString=function(e,t){return d.fromValue(e).toString(t)},d.inSafeRange=function(e){return d.fromValue(e).inSafeRange()},d.ZERO=d.fromInt(0),d.ONE=d.fromInt(1),d.NEG_ONE=d.fromInt(-1),d.MAX_VALUE=d.fromBits(-1,2147483647),d.MIN_VALUE=d.fromBits(0,-2147483648),d.MIN_SAFE_VALUE=d.fromBits(1,-2097152),d.MAX_SAFE_VALUE=d.fromBits(-1,2097151),d.__isInteger__=!0,d);function d(e,t){this.low=null!=e?e:0,this.high=null!=t?t:0}Object.defineProperty(Y.prototype,"__isInteger__",{value:!0,enumerable:!1,configurable:!1});var a,ue,ae,se,ce,le,fe,pe=4294967296,de=pe*pe/2,he=Y.fromInt(1<<24),u=Y.fromValue,u=(i.int=u,Y.isInteger),u=(i.isInt=u,Y.inSafeRange),u=(i.inSafeRange=u,Y.toNumber),u=(i.toNumber=u,Y.toString),u=(i.toString=u,i.default=Y,{}),Y={},s={},be=r&&r.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&("get"in o?t.__esModule:!o.writable&&!o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){e[n=void 0===n?r:n]=t[r]}),ye=r&&r.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),c=r&&r.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&be(t,e,r);return ye(t,e),t},_e=r&&r.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&n>=e.length?void 0:e)&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},ve=(Object.defineProperty(s,"__esModule",{value:!0}),s.ENCRYPTION_OFF=s.ENCRYPTION_ON=s.equals=s.validateQueryAndParameters=s.toNumber=s.assertValidDate=s.assertNumberOrInteger=s.assertNumber=s.assertString=s.assertObject=s.isString=s.isObject=s.isEmptyObjectOrNull=void 0,c(i)),me=n;s.ENCRYPTION_ON="ENCRYPTION_ON";function ge(e){return"object"==typeof e&&!Array.isArray(e)&&null!==e}function Oe(e,t){if(we(e))return e;throw new TypeError((0,me.stringify)(t)+" expected to be string but was: "+(0,me.stringify)(e))}function we(e){return"[object String]"===Object.prototype.toString.call(e)}function Ee(e,t){this._minNumber=e,this._maxNumber=t,this._minInteger=(0,se.int)(e),this._maxInteger=(0,se.int)(t)}function Pe(e,t,r){e=(0,se.int)(e),t=(0,se.int)(t),r=(0,se.int)(r);var n=e.multiply(365);return n=(n=(n=e.greaterThanOrEqual(0)?n.add(e.add(3).div(4).subtract(e.add(99).div(100)).add(e.add(399).div(400))):n.subtract(e.div(-4).subtract(e.div(-100)).add(e.div(-400)))).add(t.multiply(367).subtract(362).div(12))).add(r.subtract(1)),t.greaterThan(2)&&(n=n.subtract(1),function(e){if((e=(0,se.int)(e)).modulo(4).equals(0))return!e.modulo(100).equals(0)||!!e.modulo(400).equals(0)}(e)||(n=n.subtract(1))),n.subtract(a.DAYS_0000_TO_1970)}function Se(e,t){return 1===e?t%400==0||t%4==0&&t%100!=0?29:28:[0,2,4,6,7,9,11].includes(e)?31:30}function Te(e,t){return(0,ce.newError)("".concat(t,' is expected to be a valid ZoneId but was: "').concat(e,'"'))}function je(e,t,r){if((0,le.assertNumberOrInteger)(e,r),t.contains(e))return e;throw(0,ce.newError)("".concat(r," is expected to be in range ").concat(t.toString()," but was: ").concat(e.toString()))}function Ce(e,t){e=(0,se.int)(e),t=(0,se.int)(t);var r=e.div(t);return r=e.isPositive()!==t.isPositive()&&r.multiply(t).notEquals(e)?r.subtract(1):r}function Re(e,t){return e=(0,se.int)(e),t=(0,se.int)(t),e.subtract(Ce(e,t).multiply(t))}function Ie(e){return(e=(0,se.int)(e)).equals(0)?"":"."+Ae(e,9)}function Ae(e,t,r){var n=(e=(0,se.int)(e)).isNegative(),o=(e=n?e.negate():e).toString();if(null!=t)for(;o.length<t;)o="0"+o;return n?"-"+o:!0===(null==r?void 0:r.usePositiveSign)?"+"+o:o}s.ENCRYPTION_OFF="ENCRYPTION_OFF",s.isEmptyObjectOrNull=function(e){if(null===e)return!0;if(!ge(e))return!1;for(var t in e)if(void 0!==e[t])return!1;return!0},s.isObject=ge,s.validateQueryAndParameters=function(e,t,r){var n="",t=null!=t?t:{},r=null!=(r=null==r?void 0:r.skipAsserts)&&r;if("string"==typeof e?n=e:e instanceof String?n=e.toString():"object"==typeof e&&null!=e.text&&(n=e.text,t=null!=(e=e.parameters)?e:{}),!r){e=n;if(Oe(e,"Cypher query"),0===e.trim().length)throw new TypeError("Cypher query is expected to be a non-empty string.");r=t;if(!ge(r))throw e=null!=r.constructor?" "+r.constructor.name:"",new TypeError("Query parameters are expected to either be undefined/null or an object, given:".concat(e," ").concat(JSON.stringify(r)))}return{validatedQuery:n,params:t}},s.assertObject=function(e,t){if(ge(e))return e;throw new TypeError(t+" expected to be an object but was: "+(0,me.stringify)(e))},s.assertString=Oe,s.assertNumber=function(e,t){if("number"!=typeof e)throw new TypeError(t+" expected to be a number but was: "+(0,me.stringify)(e));return e},s.assertNumberOrInteger=function(e,t){if("number"==typeof e||"bigint"==typeof e||(0,ve.isInt)(e))return e;throw new TypeError(t+" expected to be either a number or an Integer object but was: "+(0,me.stringify)(e))},s.assertValidDate=function(e,t){if("[object Date]"!==Object.prototype.toString.call(e))throw new TypeError(t+" expected to be a standard JavaScript Date but was: "+(0,me.stringify)(e));if(Number.isNaN(e.getTime()))throw new TypeError(t+" expected to be valid JavaScript Date but its time was NaN: "+(0,me.stringify)(e));return e},s.isString=we,s.equals=function e(t,r){var n,o;if(t===r)return!0;if(null===t||null===r)return!1;if("object"!=typeof t||"object"!=typeof r)return!1;var i=Object.keys(t),u=Object.keys(r);if(i.length!==u.length)return!1;try{for(var a=_e(i),s=a.next();!s.done;s=a.next()){var c=s.value;if(!e(t[c],r[c]))return!1}}catch(e){n={error:e}}finally{try{s&&!s.done&&(o=a.return)&&o.call(a)}finally{if(n)throw n.error}}return!0},s.toNumber=function(e){return e instanceof ve.default?e.toNumber():"bigint"==typeof e?(0,ve.int)(e).toNumber():e},a=Y,ue=r&&r.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&("get"in o?t.__esModule:!o.writable&&!o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){e[n=void 0===n?r:n]=t[r]}),ae=r&&r.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),c=r&&r.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&ue(t,e,r);return ae(t,e),t},Object.defineProperty(a,"__esModule",{value:!0}),a.floorMod=a.floorDiv=a.assertValidZoneId=a.assertValidNanosecond=a.assertValidSecond=a.assertValidMinute=a.assertValidHour=a.assertValidDay=a.assertValidMonth=a.assertValidYear=a.timeZoneOffsetInSeconds=a.totalNanoseconds=a.newDate=a.toStandardDate=a.isoStringToStandardDate=a.dateToIsoString=a.timeZoneOffsetToIsoString=a.timeToIsoString=a.durationToIsoString=a.dateToEpochDay=a.localDateTimeToEpochSecond=a.localTimeToNanoOfDay=a.normalizeNanosecondsForDuration=a.normalizeSecondsForDuration=a.SECONDS_PER_DAY=a.DAYS_PER_400_YEAR_CYCLE=a.DAYS_0000_TO_1970=a.NANOS_PER_HOUR=a.NANOS_PER_MINUTE=a.NANOS_PER_MILLISECOND=a.NANOS_PER_SECOND=a.SECONDS_PER_HOUR=a.SECONDS_PER_MINUTE=a.MINUTES_PER_HOUR=a.NANOSECOND_OF_SECOND_RANGE=a.SECOND_OF_MINUTE_RANGE=a.MINUTE_OF_HOUR_RANGE=a.HOUR_OF_DAY_RANGE=a.DAY_OF_MONTH_RANGE=a.MONTH_OF_YEAR_RANGE=a.YEAR_RANGE=void 0,se=c(i),ce=t,le=s,Ee.prototype.contains=function(e){var t;return(0,se.isInt)(e)&&e instanceof se.default?e.greaterThanOrEqual(this._minInteger)&&e.lessThanOrEqual(this._maxInteger):"bigint"==typeof e?(t=(0,se.int)(e)).greaterThanOrEqual(this._minInteger)&&t.lessThanOrEqual(this._maxInteger):e>=this._minNumber&&e<=this._maxNumber},Ee.prototype.toString=function(){return"[".concat(this._minNumber,", ").concat(this._maxNumber,"]")},c=Ee,a.YEAR_RANGE=new c(-999999999,999999999),a.MONTH_OF_YEAR_RANGE=new c(1,12),a.DAY_OF_MONTH_RANGE=new c(1,31),a.HOUR_OF_DAY_RANGE=new c(0,23),a.MINUTE_OF_HOUR_RANGE=new c(0,59),a.SECOND_OF_MINUTE_RANGE=new c(0,59),a.NANOSECOND_OF_SECOND_RANGE=new c(0,999999999),a.MINUTES_PER_HOUR=60,a.SECONDS_PER_MINUTE=60,a.SECONDS_PER_HOUR=a.SECONDS_PER_MINUTE*a.MINUTES_PER_HOUR,a.NANOS_PER_SECOND=1e9,a.NANOS_PER_MILLISECOND=1e6,a.NANOS_PER_MINUTE=a.NANOS_PER_SECOND*a.SECONDS_PER_MINUTE,a.NANOS_PER_HOUR=a.NANOS_PER_MINUTE*a.MINUTES_PER_HOUR,a.DAYS_0000_TO_1970=719528,a.DAYS_PER_400_YEAR_CYCLE=146097,a.SECONDS_PER_DAY=86400,a.normalizeSecondsForDuration=function(e,t){return(0,se.int)(e).add(Ce(t,a.NANOS_PER_SECOND))},a.normalizeNanosecondsForDuration=function(e){return Re(e,a.NANOS_PER_SECOND)},a.localTimeToNanoOfDay=function(e,t,r,n){return e=(0,se.int)(e),t=(0,se.int)(t),r=(0,se.int)(r),n=(0,se.int)(n),(e=(e=(e=e.multiply(a.NANOS_PER_HOUR)).add(t.multiply(a.NANOS_PER_MINUTE))).add(r.multiply(a.NANOS_PER_SECOND))).add(n)},a.localDateTimeToEpochSecond=function(e,t,r,n,o,i,u){return e=Pe(e,t,r),t=function(e,t,r){e=(0,se.int)(e),t=(0,se.int)(t),r=(0,se.int)(r);e=e.multiply(a.SECONDS_PER_HOUR);return(e=e.add(t.multiply(a.SECONDS_PER_MINUTE))).add(r)}(n,o,i),e.multiply(a.SECONDS_PER_DAY).add(t)},a.dateToEpochDay=Pe,a.durationToIsoString=function(e,t,r,n){return e=Ae(e),t=Ae(t),r=function(e,t){e=(0,se.int)(e),t=(0,se.int)(t);var r,n=e.isNegative(),o=t.greaterThan(0);e=n&&o?e.equals(-1)?"-0":e.add(1).toString():e.toString();o&&(r=Ie((n?t.negate().add(2*a.NANOS_PER_SECOND):t.add(a.NANOS_PER_SECOND)).modulo(a.NANOS_PER_SECOND)));return null!=r?e+r:e}(r,n),"P".concat(e,"M").concat(t,"DT").concat(r,"S")},a.timeToIsoString=function(e,t,r,n){return e=Ae(e,2),t=Ae(t,2),r=Ae(r,2),n=Ie(n),"".concat(e,":").concat(t,":").concat(r).concat(n)},a.timeZoneOffsetToIsoString=function(e){if((e=(0,se.int)(e)).equals(0))return"Z";var t=(r=e.isNegative())?"-":"+",r=Ae((e=r?e.multiply(-1):e).div(a.SECONDS_PER_HOUR),2),n=Ae(e.div(a.SECONDS_PER_MINUTE).modulo(a.MINUTES_PER_HOUR),2);return null!=(e=(e=e.modulo(a.SECONDS_PER_MINUTE)).equals(0)?null:Ae(e,2))?"".concat(t).concat(r,":").concat(n,":").concat(e):"".concat(t).concat(r,":").concat(n)},a.dateToIsoString=function(e,t,r){return e=function(e){e=(0,se.int)(e);if(e.isNegative()||e.greaterThan(9999))return Ae(e,6,{usePositiveSign:!0});return Ae(e,4)}(e),t=Ae(t,2),r=Ae(r,2),"".concat(e,"-").concat(t,"-").concat(r)},a.isoStringToStandardDate=function(e){return new Date(e)},a.toStandardDate=function(e){return new Date(e)},a.newDate=function(e){return new Date(e)},a.totalNanoseconds=function(e,t){return t=null!=t?t:0,e=e.getMilliseconds()*a.NANOS_PER_MILLISECOND,t instanceof se.default?t.add(e):"bigint"==typeof t?t+BigInt(e):t+e},a.timeZoneOffsetInSeconds=function(e){var t=e.getSeconds()-e.getUTCSeconds(),r=e.getMinutes()-e.getUTCMinutes(),n=e.getHours()-e.getUTCHours(),e=(e=e).getMonth()===e.getUTCMonth()?e.getDate()-e.getUTCDate():e.getFullYear()>e.getUTCFullYear()||e.getMonth()>e.getUTCMonth()&&e.getFullYear()===e.getUTCFullYear()?e.getDate()+Se(e.getUTCMonth(),e.getUTCFullYear())-e.getUTCDate():e.getDate()-(e.getUTCDate()+Se(e.getMonth(),e.getFullYear()));return n*a.SECONDS_PER_HOUR+r*a.SECONDS_PER_MINUTE+t+e*a.SECONDS_PER_DAY},a.assertValidYear=function(e){return je(e,a.YEAR_RANGE,"Year")},a.assertValidMonth=function(e){return je(e,a.MONTH_OF_YEAR_RANGE,"Month")},a.assertValidDay=function(e){return je(e,a.DAY_OF_MONTH_RANGE,"Day")},a.assertValidHour=function(e){return je(e,a.HOUR_OF_DAY_RANGE,"Hour")},a.assertValidMinute=function(e){return je(e,a.MINUTE_OF_HOUR_RANGE,"Minute")},a.assertValidSecond=function(e){return je(e,a.SECOND_OF_MINUTE_RANGE,"Second")},a.assertValidNanosecond=function(e){return je(e,a.NANOSECOND_OF_SECOND_RANGE,"Nanosecond")},fe=new Map,a.assertValidZoneId=function(t,r){var e=fe.get(r);if(!0!==e){if(!1===e)throw Te(r,t);try{Intl.DateTimeFormat(void 0,{timeZone:r}),fe.set(r,!0)}catch(e){throw fe.set(r,!1),Te(r,t)}}},a.floorDiv=Ce,a.floorMod=Re;var ke=r&&r.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&("get"in o?t.__esModule:!o.writable&&!o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){e[n=void 0===n?r:n]=t[r]}),Me=r&&r.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),c=r&&r.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&ke(t,e,r);return Me(t,e),t},Ne=r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),u=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)u.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return u},l=(Object.defineProperty(u,"__esModule",{value:!0}),u.isDateTime=u.DateTime=u.isLocalDateTime=u.LocalDateTime=u.isDate=u.Date=u.isTime=u.Time=u.isLocalTime=u.LocalTime=u.isDuration=u.Duration=void 0,c(Y)),xe=s,De=t,Ue=c(i),c={value:!0,enumerable:!1,configurable:!1,writable:!1},Le="__isDuration__",Fe="__isLocalTime__",Be="__isTime__",We="__isDate__",qe="__isLocalDateTime__",ze="__isDateTime__",f=(Ve.prototype.toString=function(){return l.durationToIsoString(this.months,this.days,this.seconds,this.nanoseconds)},Ve);function Ve(e,t,r,n){this.months=(0,xe.assertNumberOrInteger)(e,"Months"),this.days=(0,xe.assertNumberOrInteger)(t,"Days"),(0,xe.assertNumberOrInteger)(r,"Seconds"),(0,xe.assertNumberOrInteger)(n,"Nanoseconds"),this.seconds=l.normalizeSecondsForDuration(r,n),this.nanoseconds=l.normalizeNanosecondsForDuration(n),Object.freeze(this)}u.Duration=f,Object.defineProperty(f.prototype,Le,c),u.isDuration=function(e){return Qe(e,Le)};He.fromStandardDate=function(e,t){Je(e,t);t=l.totalNanoseconds(e,t);return new He(e.getHours(),e.getMinutes(),e.getSeconds(),t instanceof Ue.default?t.toInt():"bigint"==typeof t?(0,Ue.int)(t).toInt():t)},He.prototype.toString=function(){return l.timeToIsoString(this.hour,this.minute,this.second,this.nanosecond)};f=He;function He(e,t,r,n){this.hour=l.assertValidHour(e),this.minute=l.assertValidMinute(t),this.second=l.assertValidSecond(r),this.nanosecond=l.assertValidNanosecond(n),Object.freeze(this)}u.LocalTime=f,Object.defineProperty(f.prototype,Fe,c),u.isLocalTime=function(e){return Qe(e,Fe)};Ge.fromStandardDate=function(e,t){return Je(e,t),new Ge(e.getHours(),e.getMinutes(),e.getSeconds(),(0,Ue.toNumber)(l.totalNanoseconds(e,t)),l.timeZoneOffsetInSeconds(e))},Ge.prototype.toString=function(){return l.timeToIsoString(this.hour,this.minute,this.second,this.nanosecond)+l.timeZoneOffsetToIsoString(this.timeZoneOffsetSeconds)};f=Ge;function Ge(e,t,r,n,o){this.hour=l.assertValidHour(e),this.minute=l.assertValidMinute(t),this.second=l.assertValidSecond(r),this.nanosecond=l.assertValidNanosecond(n),this.timeZoneOffsetSeconds=(0,xe.assertNumberOrInteger)(o,"Time zone offset in seconds"),Object.freeze(this)}u.Time=f,Object.defineProperty(f.prototype,Be,c),u.isTime=function(e){return Qe(e,Be)};Ye.fromStandardDate=function(e){return Je(e),new Ye(e.getFullYear(),e.getMonth()+1,e.getDate())},Ye.prototype.toStandardDate=function(){return l.isoStringToStandardDate(this.toString())},Ye.prototype.toString=function(){return l.dateToIsoString(this.year,this.month,this.day)};f=Ye;function Ye(e,t,r){this.year=l.assertValidYear(e),this.month=l.assertValidMonth(t),this.day=l.assertValidDay(r),Object.freeze(this)}u.Date=f,Object.defineProperty(f.prototype,We,c),u.isDate=function(e){return Qe(e,We)};Ke.fromStandardDate=function(e,t){return Je(e,t),new Ke(e.getFullYear(),e.getMonth()+1,e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),(0,Ue.toNumber)(l.totalNanoseconds(e,t)))},Ke.prototype.toStandardDate=function(){return l.isoStringToStandardDate(this.toString())},Ke.prototype.toString=function(){return Xe(this.year,this.month,this.day,this.hour,this.minute,this.second,this.nanosecond)};f=Ke;function Ke(e,t,r,n,o,i,u){this.year=l.assertValidYear(e),this.month=l.assertValidMonth(t),this.day=l.assertValidDay(r),this.hour=l.assertValidHour(n),this.minute=l.assertValidMinute(o),this.second=l.assertValidSecond(i),this.nanosecond=l.assertValidNanosecond(u),Object.freeze(this)}u.LocalDateTime=f,Object.defineProperty(f.prototype,qe,c),u.isLocalDateTime=function(e){return Qe(e,qe)};Ze.fromStandardDate=function(e,t){return Je(e,t),new Ze(e.getFullYear(),e.getMonth()+1,e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),(0,Ue.toNumber)(l.totalNanoseconds(e,t)),l.timeZoneOffsetInSeconds(e),null)},Ze.prototype.toStandardDate=function(){return l.toStandardDate(this._toUTC())},Ze.prototype.toString=function(){var e;return Xe(this.year,this.month,this.day,this.hour,this.minute,this.second,this.nanosecond)+(null!=this.timeZoneOffsetSeconds?l.timeZoneOffsetToIsoString(null!=(e=this.timeZoneOffsetSeconds)?e:0):"")+(null!=this.timeZoneId?"[".concat(this.timeZoneId,"]"):"")},Ze.prototype._toUTC=function(){if(void 0===this.timeZoneOffsetSeconds)throw new Error("Requires DateTime created with time zone offset");var e=l.localDateTimeToEpochSecond(this.year,this.month,this.day,this.hour,this.minute,this.second,this.nanosecond).subtract(null!=(e=this.timeZoneOffsetSeconds)?e:0);return(0,Ue.int)(e).multiply(1e3).add((0,Ue.int)(this.nanosecond).div(1e6)).toNumber()};f=Ze;function Ze(e,t,r,n,o,i,u,a,s){this.year=l.assertValidYear(e),this.month=l.assertValidMonth(t),this.day=l.assertValidDay(r),this.hour=l.assertValidHour(n),this.minute=l.assertValidMinute(o),this.second=l.assertValidSecond(i),this.nanosecond=l.assertValidNanosecond(u);e=Ne(function(e,t){var r=null!=e,n=null!=t&&""!==t;if(!r&&!n)throw(0,De.newError)("Unable to create DateTime without either time zone offset or id. Please specify either of them. Given offset: ".concat(e," and id: ").concat(t));var o=[void 0,void 0];r&&((0,xe.assertNumberOrInteger)(e,"Time zone offset in seconds"),o[0]=e);n&&((0,xe.assertString)(t,"Time zone ID"),l.assertValidZoneId("Time zone ID",t),o[1]=t);return o}(a,s),2),t=e[0],r=e[1];this.timeZoneOffsetSeconds=t,this.timeZoneId=null!=r?r:void 0,Object.freeze(this)}function Qe(e,t){return null!=e&&!0===e[t]}function Xe(e,t,r,n,o,i,u){return l.dateToIsoString(e,t,r)+"T"+l.timeToIsoString(n,o,i,u)}function Je(e,t){(0,xe.assertValidDate)(e,"Standard date"),null!=t&&(0,xe.assertNumberOrInteger)(t,"Nanosecond")}u.DateTime=f,Object.defineProperty(f.prototype,ze,c),u.isDateTime=function(e){return Qe(e,ze)};var f={},$e=(Object.defineProperty(f,"__esModule",{value:!0}),f.isPathSegment=f.PathSegment=f.isPath=f.Path=f.isUnboundRelationship=f.UnboundRelationship=f.isRelationship=f.Relationship=f.isNode=f.Node=void 0,n),c={value:!0,enumerable:!1,configurable:!1,writable:!1},et="__isNode__",tt="__isRelationship__",rt="__isUnboundRelationship__",nt="__isPath__",ot="__isPathSegment__";function it(e,t){return null!=e&&!0===e[t]}at.prototype.toString=function(){for(var e="("+this.elementId,t=0;t<this.labels.length;t++)e+=":"+this.labels[t];var r=Object.keys(this.properties);if(0<r.length){e+=" {";for(t=0;t<r.length;t++)0<t&&(e+=","),e+=r[t]+":"+(0,$e.stringify)(this.properties[r[t]]);e+="}"}return e+=")"};var ut=at;function at(e,t,r,n){this.identity=e,this.labels=t,this.properties=r,this.elementId=dt(n,function(){return e.toString()})}f.Node=ut,Object.defineProperty(ut.prototype,et,c),f.isNode=function(e){return it(e,et)};ct.prototype.toString=function(){var e="("+this.startNodeElementId+")-[:"+this.type,t=Object.keys(this.properties);if(0<t.length){e+=" {";for(var r=0;r<t.length;r++)0<r&&(e+=","),e+=t[r]+":"+(0,$e.stringify)(this.properties[t[r]]);e+="}"}return e+="]->("+this.endNodeElementId+")"};var st=ct;function ct(e,t,r,n,o,i,u,a){this.identity=e,this.start=t,this.end=r,this.type=n,this.properties=o,this.elementId=dt(i,function(){return e.toString()}),this.startNodeElementId=dt(u,function(){return t.toString()}),this.endNodeElementId=dt(a,function(){return r.toString()})}f.Relationship=st,Object.defineProperty(st.prototype,tt,c),f.isRelationship=function(e){return it(e,tt)};lt.prototype.bind=function(e,t){return new st(this.identity,e,t,this.type,this.properties,this.elementId)},lt.prototype.bindTo=function(e,t){return new st(this.identity,e.identity,t.identity,this.type,this.properties,this.elementId,e.elementId,t.elementId)},lt.prototype.toString=function(){var e="-[:"+this.type,t=Object.keys(this.properties);if(0<t.length){e+=" {";for(var r=0;r<t.length;r++)0<r&&(e+=","),e+=t[r]+":"+(0,$e.stringify)(this.properties[t[r]]);e+="}"}return e+="]->"};ut=lt;function lt(e,t,r,n){this.identity=e,this.type=t,this.properties=r,this.elementId=dt(n,function(){return e.toString()})}f.UnboundRelationship=ut,Object.defineProperty(ut.prototype,rt,c),f.isUnboundRelationship=function(e){return it(e,rt)};function ft(e,t,r){this.start=e,this.relationship=t,this.end=r}f.PathSegment=ft,Object.defineProperty(ft.prototype,ot,c),f.isPathSegment=function(e){return it(e,ot)};function pt(e,t,r){this.start=e,this.end=t,this.segments=r,this.length=r.length}function dt(e,t){return null==e?t():e}f.Path=pt,Object.defineProperty(pt.prototype,nt,c),f.isPath=function(e){return it(e,nt)};var ut={},ht=r&&r.__generator||function(n,o){var i,u,a,s={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},c={next:e(0),throw:e(1),return:e(2)};return"function"==typeof Symbol&&(c[Symbol.iterator]=function(){return this}),c;function e(r){return function(e){var t=[r,e];if(i)throw new TypeError("Generator is already executing.");for(;s=c&&t[c=0]?0:s;)try{if(i=1,u&&(a=2&t[0]?u.return:t[0]?u.throw||((a=u.return)&&a.call(u),0):u.next)&&!(a=a.call(u,t[1])).done)return a;switch(u=0,(t=a?[2&t[0],a.value]:t)[0]){case 0:case 1:a=t;break;case 4:return s.label++,{value:t[1],done:!1};case 5:s.label++,u=t[1],t=[0];continue;case 7:t=s.ops.pop(),s.trys.pop();continue;default:if(!(a=0<(a=s.trys).length&&a[a.length-1])&&(6===t[0]||2===t[0])){s=0;continue}if(3===t[0]&&(!a||t[1]>a[0]&&t[1]<a[3])){s.label=t[1];break}if(6===t[0]&&s.label<a[1]){s.label=a[1],a=t;break}if(a&&s.label<a[2]){s.label=a[2],s.ops.push(t);break}a[2]&&s.ops.pop(),s.trys.pop();continue}t=o.call(n,s)}catch(e){t=[6,e],u=0}finally{i=a=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}},bt=r&&r.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&n>=e.length?void 0:e)&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},yt=r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),u=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)u.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return u},_t=(Object.defineProperty(ut,"__esModule",{value:!0}),t);function vt(e,t,r){var n;this.keys=e,this.length=e.length,this._fields=t,this._fieldLookup=null!=r?r:(n={},e.forEach(function(e,t){n[e]=t}),n)}vt.prototype.forEach=function(e){var t,r;try{for(var n=bt(this.entries()),o=n.next();!o.done;o=n.next()){var i=yt(o.value,2),u=i[0];e(i[1],u,this)}}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}},vt.prototype.map=function(e){var t,r,n=[];try{for(var o=bt(this.entries()),i=o.next();!i.done;i=o.next()){var u=yt(i.value,2),a=u[0],s=u[1];n.push(e(s,a,this))}}catch(e){t={error:e}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}return n},vt.prototype.entries=function(){var t;return ht(this,function(e){switch(e.label){case 0:t=0,e.label=1;case 1:return t<this.keys.length?[4,[this.keys[t],this._fields[t]]]:[3,4];case 2:e.sent(),e.label=3;case 3:return t++,[3,1];case 4:return[2]}})},vt.prototype.values=function(){var t;return ht(this,function(e){switch(e.label){case 0:t=0,e.label=1;case 1:return t<this.keys.length?[4,this._fields[t]]:[3,4];case 2:e.sent(),e.label=3;case 3:return t++,[3,1];case 4:return[2]}})},vt.prototype[Symbol.iterator]=function(){var t;return ht(this,function(e){switch(e.label){case 0:t=0,e.label=1;case 1:return t<this.keys.length?[4,this._fields[t]]:[3,4];case 2:e.sent(),e.label=3;case 3:return t++,[3,1];case 4:return[2]}})},vt.prototype.toObject=function(){var t,e,r={};try{for(var n=bt(this.entries()),o=n.next();!o.done;o=n.next()){var i=yt(o.value,2),u=i[0],a=i[1];r[u]=a}}catch(e){t={error:e}}finally{try{o&&!o.done&&(e=n.return)&&e.call(n)}finally{if(t)throw t.error}}return r},vt.prototype.get=function(e){var t;if("number"!=typeof e){if(void 0===(t=this._fieldLookup[e]))throw(0,_t.newError)("This record has no field with key '".concat(e.toString(),"', available keys are: [")+this.keys.toString()+"].")}else t=e;if(t>this._fields.length-1||t<0)throw(0,_t.newError)("This record has no field with index '"+t.toString()+"'. Remember that indexes start at `0`, and make sure your query returns records in the shape you meant it to.");return this._fields[t]},vt.prototype.has=function(e){return"number"==typeof e?0<=e&&e<this._fields.length:void 0!==this._fieldLookup[e]},ut.default=vt;var c={},mt=(Object.defineProperty(c,"__esModule",{value:!0}),c.isPoint=c.Point=void 0,s),gt="__isPoint__",p=(Ot.prototype.toString=function(){return null==this.z||isNaN(this.z)?"Point{srid=".concat(wt(this.srid),", x=").concat(wt(this.x),", y=").concat(wt(this.y),"}"):"Point{srid=".concat(wt(this.srid),", x=").concat(wt(this.x),", y=").concat(wt(this.y),", z=").concat(wt(this.z),"}")},Ot);function Ot(e,t,r,n){this.srid=(0,mt.assertNumberOrInteger)(e,"SRID"),this.x=(0,mt.assertNumber)(t,"X coordinate"),this.y=(0,mt.assertNumber)(r,"Y coordinate"),this.z=null==n?n:(0,mt.assertNumber)(n,"Z coordinate"),Object.freeze(this)}function wt(e){return Number.isInteger(e)?e.toString()+".0":e.toString()}c.Point=p,Object.defineProperty(p.prototype,gt,{value:!0,enumerable:!1,configurable:!1,writable:!1}),c.isPoint=function(e){return null!=e&&!0===e[gt]};var p={},h={},Et={},b=(Object.defineProperty(Et,"__esModule",{value:!0}),Et.FailedObserver=Et.CompletedObserver=void 0,Pt.prototype.subscribe=function(e){Tt(e,e.onKeys,[]),Tt(e,e.onCompleted,{})},Pt.prototype.cancel=function(){},Pt.prototype.pause=function(){},Pt.prototype.resume=function(){},Pt.prototype.prepareToHandleSingleResponse=function(){},Pt.prototype.markCompleted=function(){},Pt.prototype.onError=function(e){throw new Error("CompletedObserver not supposed to call onError",{cause:e})},Pt);function Pt(){}function St(e){var t=e.error,e=e.onError;this._error=t,this._beforeError=e,this._observers=[],this.onError(t)}function Tt(e,t,r){null!=t&&t.bind(e)(r)}Et.CompletedObserver=b,St.prototype.subscribe=function(e){Tt(e,e.onError,this._error),this._observers.push(e)},St.prototype.onError=function(t){Tt(this,this._beforeError,t),this._observers.forEach(function(e){return Tt(e,e.onError,t)})},St.prototype.cancel=function(){},St.prototype.pause=function(){},St.prototype.resume=function(){},St.prototype.markCompleted=function(){},St.prototype.prepareToHandleSingleResponse=function(){},Et.FailedObserver=St;var b={},jt=r&&r.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&("get"in o?t.__esModule:!o.writable&&!o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){e[n=void 0===n?r:n]=t[r]}),Ct=r&&r.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),y=r&&r.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&jt(t,e,r);return Ct(t,e),t},Rt=r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),u=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)u.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return u},It=r&&r.__spreadArray||function(e,t,r){if(r||2===arguments.length)for(var n,o=0,i=t.length;o<i;o++)!n&&o in t||((n=n||Array.prototype.slice.call(t,0,o))[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))},At=(Object.defineProperty(b,"__esModule",{value:!0}),b.Bookmarks=void 0,y(s)),y=(kt.empty=function(){return Mt},kt.prototype.isEmpty=function(){return 0===this._values.length},kt.prototype.values=function(){return this._values},kt.prototype[Symbol.iterator]=function(){return this._values[Symbol.iterator]()},kt.prototype.asBeginTransactionParameters=function(){var e;return this.isEmpty()?{}:((e={}).bookmarks=this._values,e)},kt);function kt(e){this._values=function(e){if(null==e||""===e)return[];if(At.isString(e))return[e];if(Array.isArray(e)){for(var t=new Set,r=function r(e){return e.reduce(function(e,t){return Array.isArray(t)?e.concat(r(t)):e.concat(t)},[])}(e),n=0;n<r.length;n++){var o=r[n];if(null!=o){if(!At.isString(o))throw new TypeError("Bookmark value should be a string, given: '".concat(o,"'"));t.add(o)}}return It([],Rt(t),!1)}throw new TypeError("Bookmarks should either be a string or a string array, given: '".concat(e,"'"))}(e)}var Mt=new(b.Bookmarks=y)(null);var Nt,xt,y={},_=(Object.defineProperty(y,"__esModule",{value:!0}),y.TELEMETRY_APIS=y.BOLT_PROTOCOL_V5_8=y.BOLT_PROTOCOL_V5_7=y.BOLT_PROTOCOL_V5_6=y.BOLT_PROTOCOL_V5_5=y.BOLT_PROTOCOL_V5_4=y.BOLT_PROTOCOL_V5_3=y.BOLT_PROTOCOL_V5_2=y.BOLT_PROTOCOL_V5_1=y.BOLT_PROTOCOL_V5_0=y.BOLT_PROTOCOL_V4_4=y.BOLT_PROTOCOL_V4_3=y.BOLT_PROTOCOL_V4_2=y.BOLT_PROTOCOL_V4_1=y.BOLT_PROTOCOL_V4_0=y.BOLT_PROTOCOL_V3=y.BOLT_PROTOCOL_V2=y.BOLT_PROTOCOL_V1=y.DEFAULT_POOL_MAX_SIZE=y.DEFAULT_POOL_ACQUISITION_TIMEOUT=y.DEFAULT_CONNECTION_TIMEOUT_MILLIS=y.ACCESS_MODE_WRITE=y.ACCESS_MODE_READ=y.FETCH_ALL=void 0,y.FETCH_ALL=-1,y.DEFAULT_POOL_ACQUISITION_TIMEOUT=6e4,y.DEFAULT_POOL_MAX_SIZE=100,y.DEFAULT_CONNECTION_TIMEOUT_MILLIS=3e4,y.ACCESS_MODE_READ="READ",y.ACCESS_MODE_WRITE="WRITE",y.BOLT_PROTOCOL_V1=1,y.BOLT_PROTOCOL_V2=2,y.BOLT_PROTOCOL_V3=3,y.BOLT_PROTOCOL_V4_0=4,y.BOLT_PROTOCOL_V4_1=4.1,y.BOLT_PROTOCOL_V4_2=4.2,y.BOLT_PROTOCOL_V4_3=4.3,y.BOLT_PROTOCOL_V4_4=4.4,y.BOLT_PROTOCOL_V5_0=5,y.BOLT_PROTOCOL_V5_1=5.1,y.BOLT_PROTOCOL_V5_2=5.2,y.BOLT_PROTOCOL_V5_3=5.3,y.BOLT_PROTOCOL_V5_4=5.4,y.BOLT_PROTOCOL_V5_5=5.5,y.BOLT_PROTOCOL_V5_6=5.6,y.BOLT_PROTOCOL_V5_7=5.7,y.BOLT_PROTOCOL_V5_8=5.8,y.TELEMETRY_APIS={MANAGED_TRANSACTION:0,UNMANAGED_TRANSACTION:1,AUTO_COMMIT_TRANSACTION:2,EXECUTE_QUERY:3},{}),v={},m=r&&r.__extends||(Nt=function(e,t){return(Nt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}Nt(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),Dt=(Object.defineProperty(v,"__esModule",{value:!0}),v.Logger=void 0,t),Ut="error",Lt="warn",Ft="info",Bt="debug",Wt=((qt={})[Ut]=0,qt[Lt]=1,qt[Ft]=2,qt[Bt]=3,qt),qt=(zt.create=function(e){return null!=(null==e?void 0:e.logging)?new zt(function(e){if(null==(null==e?void 0:e.level))return"info";var e=e.level,t=Wt[e];if(null!=t||0===t)return e;throw(0,Dt.newError)("Illegal logging level: ".concat(e,". Supported levels are: ").concat(Object.keys(Wt).toString()))}(e=e.logging),function(e){if(null!=(null==e?void 0:e.logger)){var t=e.logger;if(null!=t&&"function"==typeof t)return t}throw(0,Dt.newError)("Illegal logger function: ".concat(null!=(e=null==(t=null==e?void 0:e.logger)?void 0:t.toString())?e:"undefined"))}(e)):this.noOp()},zt.noOp=function(){return Ht},zt.prototype.isErrorEnabled=function(){return Gt(this._level,Ut)},zt.prototype.error=function(e){this.isErrorEnabled()&&this._loggerFunction(Ut,e)},zt.prototype.isWarnEnabled=function(){return Gt(this._level,Lt)},zt.prototype.warn=function(e){this.isWarnEnabled()&&this._loggerFunction(Lt,e)},zt.prototype.isInfoEnabled=function(){return Gt(this._level,Ft)},zt.prototype.info=function(e){this.isInfoEnabled()&&this._loggerFunction(Ft,e)},zt.prototype.isDebugEnabled=function(){return Gt(this._level,Bt)},zt.prototype.debug=function(e){this.isDebugEnabled()&&this._loggerFunction(Bt,e)},zt);function zt(e,t){this._level=e,this._loggerFunction=t}function Vt(){return xt.call(this,Ft,function(e,t){})||this}v.Logger=qt,m(Vt,xt=qt),Vt.prototype.isErrorEnabled=function(){return!1},Vt.prototype.error=function(e){},Vt.prototype.isWarnEnabled=function(){return!1},Vt.prototype.warn=function(e){},Vt.prototype.isInfoEnabled=function(){return!1},Vt.prototype.info=function(e){},Vt.prototype.isDebugEnabled=function(){return!1},Vt.prototype.debug=function(e){};var Ht=new Vt;function Gt(e,t){return Wt[e]>=Wt[t]}var Yt,m=r&&r.__extends||(Yt=function(e,t){return(Yt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}Yt(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),Kt=r&&r.__awaiter||function(e,u,a,s){return new(a=a||Promise)(function(r,t){function n(e){try{i(s.next(e))}catch(e){t(e)}}function o(e){try{i(s.throw(e))}catch(e){t(e)}}function i(e){var t;e.done?r(e.value):((t=e.value)instanceof a?t:new a(function(e){e(t)})).then(n,o)}i((s=s.apply(e,u||[])).next())})},Zt=r&&r.__generator||function(n,o){var i,u,a,s={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},c={next:e(0),throw:e(1),return:e(2)};return"function"==typeof Symbol&&(c[Symbol.iterator]=function(){return this}),c;function e(r){return function(e){var t=[r,e];if(i)throw new TypeError("Generator is already executing.");for(;s=c&&t[c=0]?0:s;)try{if(i=1,u&&(a=2&t[0]?u.return:t[0]?u.throw||((a=u.return)&&a.call(u),0):u.next)&&!(a=a.call(u,t[1])).done)return a;switch(u=0,(t=a?[2&t[0],a.value]:t)[0]){case 0:case 1:a=t;break;case 4:return s.label++,{value:t[1],done:!1};case 5:s.label++,u=t[1],t=[0];continue;case 7:t=s.ops.pop(),s.trys.pop();continue;default:if(!(a=0<(a=s.trys).length&&a[a.length-1])&&(6===t[0]||2===t[0])){s=0;continue}if(3===t[0]&&(!a||t[1]>a[0]&&t[1]<a[3])){s.label=t[1];break}if(6===t[0]&&s.label<a[1]){s.label=a[1],a=t;break}if(a&&s.label<a[2]){s.label=a[2],s.ops.push(t);break}a[2]&&s.ops.pop(),s.trys.pop();continue}t=o.call(n,s)}catch(e){t=[6,e],u=0}finally{i=a=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}},Qt=(Object.defineProperty(_,"__esModule",{value:!0}),_.EMPTY_CONNECTION_HOLDER=_.ReadOnlyConnectionHolder=_.ConnectionHolder=void 0,t),Xt=s,Jt=y,$t=b,er=v,qt=(tr.prototype.mode=function(){return this._mode},tr.prototype.database=function(){return this._database},tr.prototype.setDatabase=function(e){this._database=e},tr.prototype.bookmarks=function(){return this._bookmarks},tr.prototype.connectionProvider=function(){return this._connectionProvider},tr.prototype.referenceCount=function(){return this._referenceCount},tr.prototype.initializeConnection=function(e){return 0!==this._referenceCount||null==this._connectionProvider?(this._referenceCount++,!1):(this._connectionPromise=this._createConnectionPromise(this._connectionProvider,e),this._referenceCount++,!0)},tr.prototype._createConnectionPromise=function(o,i){return Kt(this,void 0,void 0,function(){var t,r,n;return Zt(this,function(e){switch(e.label){case 0:return r=(t=o).acquireConnection,n={accessMode:this._mode,database:this._database},[4,this._getBookmarks()];case 1:return[4,r.apply(t,[(n.bookmarks=e.sent(),n.impersonatedUser=this._impersonatedUser,n.onDatabaseNameResolved=this._onDatabaseNameResolved,n.auth=this._auth,n.homeDb=i,n)])];case 2:return[2,e.sent()]}})})},tr.prototype._getBookmarks=function(){return Kt(this,void 0,void 0,function(){return Zt(this,function(e){switch(e.label){case 0:return[4,this._getConnectionAcquistionBookmarks()];case 1:return[2,e.sent()]}})})},tr.prototype.getConnection=function(){return this._connectionPromise},tr.prototype.releaseConnection=function(){return 0===this._referenceCount?this._connectionPromise:(this._referenceCount--,0===this._referenceCount?this._releaseConnection():this._connectionPromise)},tr.prototype.close=function(e){return this._closed=!0,0===this._referenceCount?this._connectionPromise:(this._referenceCount=0,this._releaseConnection(e))},tr.prototype.log=function(){return this._log},tr.prototype._releaseConnection=function(t){return this._connectionPromise=this._connectionPromise.then(function(e){return null!=e?e.isOpen()&&(e.hasOngoingObservableRequests()||!0===t)?e.resetAndFlush().catch(ur).then(function(){return e.release().then(function(){return null})}):e.release().then(function(){return null}):Promise.resolve(null)}).catch(this._logError),this._connectionPromise},tr.prototype._logError=function(e){return this._log.isWarnEnabled()&&this._log.warn("ConnectionHolder got an error while releasing the connection. Error ".concat(e,". Stacktrace: ").concat(e.stack)),null},tr);function tr(e){var t=e.mode,r=e.database,r=void 0===r?"":r,n=e.bookmarks,o=e.connectionProvider,i=e.