mongoose 6.2.3 → 6.2.4
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/.lgtm.yml +3 -0
- package/CHANGELOG.md +16 -0
- package/dist/browser.umd.js +43 -46
- package/lib/document.js +7 -11
- package/lib/helpers/document/cleanModifiedSubpaths.js +1 -0
- package/lib/helpers/isAsyncFunction.js +6 -7
- package/lib/query.js +3 -3
- package/lib/queryhelpers.js +0 -20
- package/lib/schema/SubdocumentPath.js +1 -1
- package/lib/schema/documentarray.js +5 -4
- package/lib/types/ArraySubdocument.js +1 -1
- package/package.json +1 -1
- package/types/Connection.d.ts +212 -0
- package/types/index.d.ts +30 -199
package/dist/browser.umd.js
CHANGED
|
@@ -229,7 +229,7 @@ e.noop=function(){},e.errorToPOJO=function(t){if(!(t instanceof Error))throw new
|
|
|
229
229
|
e.warn=function(t){return n.emitWarning(t,{code:"MONGOOSE"})}}).call(this,r(3).Buffer,r(5))},function(t,e){var r,n,i=t.exports={};function o(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function a(t){if(r===setTimeout)return setTimeout(t,0);if((r===o||!r)&&setTimeout)return r=setTimeout,setTimeout(t,0);try{return r(t,0)}catch(e){try{return r.call(null,t,0)}catch(e){return r.call(this,t,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:o}catch(t){r=o}try{n="function"==typeof clearTimeout?clearTimeout:s}catch(t){n=s}}();var u,h=[],f=!1,c=-1;function l(){f&&u&&(f=!1,u.length?h=u.concat(h):c=-1,h.length&&d())}function d(){if(!f){var t=a(l);f=!0;for(var e=h.length;e;){for(u=h,h=[];++c<e;)u&&u[c].run();c=-1,e=h.length}u=null,f=!1,function(t){if(n===clearTimeout)return clearTimeout(t);if((n===s||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(t);try{n(t)}catch(e){try{return n.call(null,t)}catch(e){return n.call(this,t)}}}(t)}}function p(t,e){this.fun=t,this.array=e}function y(){}i.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];h.push(new p(t,e)),1!==h.length||f||a(d)},p.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=y,i.addListener=y,i.once=y,i.off=y,i.removeListener=y,i.removeAllListeners=y,i.emit=y,i.prependListener=y,i.prependOnceListener=y,i.listeners=function(t){return[]},i.binding=function(t){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(t){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},function(t,e){function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"===("undefined"==typeof window?"undefined":r(window))&&(n=window)}t.exports=n},function(t,e,r){"use strict";var n=r(19);
|
|
230
230
|
/*!
|
|
231
231
|
* Module exports.
|
|
232
|
-
*/t.exports=n,n.messages=r(291),n.Messages=n.messages,n.DocumentNotFoundError=r(292),n.CastError=r(20),n.ValidationError=r(151),n.ValidatorError=r(152),n.VersionError=r(293),n.ParallelSaveError=r(294),n.OverwriteModelError=r(295),n.MissingSchemaError=r(296),n.MongooseServerSelectionError=r(297),n.DivergentArrayError=r(301),n.StrictModeError=r(44)},function(t,e,r){
|
|
232
|
+
*/t.exports=n,n.messages=r(291),n.Messages=n.messages,n.DocumentNotFoundError=r(292),n.CastError=r(20),n.ValidationError=r(151),n.ValidatorError=r(152),n.VersionError=r(293),n.ParallelSaveError=r(294),n.OverwriteModelError=r(295),n.MissingSchemaError=r(296),n.MongooseServerSelectionError=r(297),n.DivergentArrayError=r(301),n.StrictModeError=r(44)},function(t,e,r){"use strict";(function(n){
|
|
233
233
|
/*!
|
|
234
234
|
* Module dependencies.
|
|
235
235
|
*/
|
|
@@ -287,10 +287,10 @@ g.prototype.clone=function(){var t=Object.assign({},this.options),e=new this.con
|
|
|
287
287
|
/*!
|
|
288
288
|
* Module exports.
|
|
289
289
|
*/
|
|
290
|
-
t.exports=e=g,e.CastError=b,e.ValidatorError=v}).call(this,r(3).Buffer)},function(t,e){function r(t,e){if(!t)throw new Error(e||"Assertion failed")}t.exports=r,r.equal=function(t,e,r){if(t!=e)throw new Error(r||"Assertion failed: "+t+" != "+e)}},function(t,e,r){"use strict";var n=e,i=r(21),o=r(10),s=r(128);n.assert=o,n.toArray=s.toArray,n.zero2=s.zero2,n.toHex=s.toHex,n.encode=s.encode,n.getNAF=function(t,e,r){var n=new Array(Math.max(t.bitLength(),r)+1);n.fill(0);for(var i=1<<e+1,o=t.clone(),s=0;s<n.length;s++){var a,u=o.andln(i-1);o.isOdd()?(a=u>(i>>1)-1?(i>>1)-u:u,o.isubn(a)):a=0,n[s]=a,o.iushrn(1)}return n},n.getJSF=function(t,e){var r=[[],[]];t=t.clone(),e=e.clone();for(var n,i=0,o=0;t.cmpn(-i)>0||e.cmpn(-o)>0;){var s,a,u=t.andln(3)+i&3,h=e.andln(3)+o&3;3===u&&(u=-1),3===h&&(h=-1),s=0==(1&u)?0:3!==(n=t.andln(7)+i&7)&&5!==n||2!==h?u:-u,r[0].push(s),a=0==(1&h)?0:3!==(n=e.andln(7)+o&7)&&5!==n||2!==u?h:-h,r[1].push(a),2*i===s+1&&(i=1-i),2*o===a+1&&(o=1-o),t.iushrn(1),e.iushrn(1)}return r},n.cachedProperty=function(t,e,r){var n="_"+e;t.prototype[e]=function(){return void 0!==this[n]?this[n]:this[n]=r.call(this)}},n.parseBytes=function(t){return"string"==typeof t?n.toArray(t,"hex"):t},n.intFromLE=function(t){return new i(t,"hex","le")}},function(t,e,r){"use strict";function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var i,o="object"===("undefined"==typeof Reflect?"undefined":n(Reflect))?Reflect:null,s=o&&"function"==typeof o.apply?o.apply:function(t,e,r){return Function.prototype.apply.call(t,e,r)};i=o&&"function"==typeof o.ownKeys?o.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var a=Number.isNaN||function(t){return t!=t};function u(){u.init.call(this)}t.exports=u,t.exports.once=function(t,e){return new Promise((function(r,n){function i(r){t.removeListener(e,o),n(r)}function o(){"function"==typeof t.removeListener&&t.removeListener("error",i),r([].slice.call(arguments))}v(t,e,o,{once:!0}),"error"!==e&&function(t,e,r){"function"==typeof t.on&&v(t,"error",e,r)}(t,i,{once:!0})}))},u.EventEmitter=u,u.prototype._events=void 0,u.prototype._eventsCount=0,u.prototype._maxListeners=void 0;var h=10;function f(t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+n(t))}function c(t){return void 0===t._maxListeners?u.defaultMaxListeners:t._maxListeners}function l(t,e,r,n){var i,o,s,a;if(f(r),void 0===(o=t._events)?(o=t._events=Object.create(null),t._eventsCount=0):(void 0!==o.newListener&&(t.emit("newListener",e,r.listener?r.listener:r),o=t._events),s=o[e]),void 0===s)s=o[e]=r,++t._eventsCount;else if("function"==typeof s?s=o[e]=n?[r,s]:[s,r]:n?s.unshift(r):s.push(r),(i=c(t))>0&&s.length>i&&!s.warned){s.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=t,u.type=e,u.count=s.length,a=u,console&&console.warn&&console.warn(a)}return t}function d(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function p(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},i=d.bind(n);return i.listener=r,n.wrapFn=i,i}function y(t,e,r){var n=t._events;if(void 0===n)return[];var i=n[e];return void 0===i?[]:"function"==typeof i?r?[i.listener||i]:[i]:r?function(t){for(var e=new Array(t.length),r=0;r<e.length;++r)e[r]=t[r].listener||t[r];return e}(i):b(i,i.length)}function m(t){var e=this._events;if(void 0!==e){var r=e[t];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function b(t,e){for(var r=new Array(e),n=0;n<e;++n)r[n]=t[n];return r}function v(t,e,r,i){if("function"==typeof t.on)i.once?t.once(e,r):t.on(e,r);else{if("function"!=typeof t.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+n(t));t.addEventListener(e,(function n(o){i.once&&t.removeEventListener(e,n),r(o)}))}}Object.defineProperty(u,"defaultMaxListeners",{enumerable:!0,get:function(){return h},set:function(t){if("number"!=typeof t||t<0||a(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");h=t}}),u.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},u.prototype.setMaxListeners=function(t){if("number"!=typeof t||t<0||a(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this},u.prototype.getMaxListeners=function(){return c(this)},u.prototype.emit=function(t){for(var e=[],r=1;r<arguments.length;r++)e.push(arguments[r]);var n="error"===t,i=this._events;if(void 0!==i)n=n&&void 0===i.error;else if(!n)return!1;if(n){var o;if(e.length>0&&(o=e[0]),o instanceof Error)throw o;var a=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw a.context=o,a}var u=i[t];if(void 0===u)return!1;if("function"==typeof u)s(u,this,e);else{var h=u.length,f=b(u,h);for(r=0;r<h;++r)s(f[r],this,e)}return!0},u.prototype.addListener=function(t,e){return l(this,t,e,!1)},u.prototype.on=u.prototype.addListener,u.prototype.prependListener=function(t,e){return l(this,t,e,!0)},u.prototype.once=function(t,e){return f(e),this.on(t,p(this,t,e)),this},u.prototype.prependOnceListener=function(t,e){return f(e),this.prependListener(t,p(this,t,e)),this},u.prototype.removeListener=function(t,e){var r,n,i,o,s;if(f(e),void 0===(n=this._events))return this;if(void 0===(r=n[t]))return this;if(r===e||r.listener===e)0==--this._eventsCount?this._events=Object.create(null):(delete n[t],n.removeListener&&this.emit("removeListener",t,r.listener||e));else if("function"!=typeof r){for(i=-1,o=r.length-1;o>=0;o--)if(r[o]===e||r[o].listener===e){s=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():function(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}(r,i),1===r.length&&(n[t]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",t,s||e)}return this},u.prototype.off=u.prototype.removeListener,u.prototype.removeAllListeners=function(t){var e,r,n;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[t]&&(0==--this._eventsCount?this._events=Object.create(null):delete r[t]),this;if(0===arguments.length){var i,o=Object.keys(r);for(n=0;n<o.length;++n)"removeListener"!==(i=o[n])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(e=r[t]))this.removeListener(t,e);else if(void 0!==e)for(n=e.length-1;n>=0;n--)this.removeListener(t,e[n]);return this},u.prototype.listeners=function(t){return y(this,t,!0)},u.prototype.rawListeners=function(t){return y(this,t,!1)},u.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):m.call(t,e)},u.prototype.listenerCount=m,u.prototype.eventNames=function(){return this._eventsCount>0?i(this._events):[]}},function(t,e,r){"use strict";
|
|
290
|
+
t.exports=e=g,e.CastError=b,e.ValidatorError=v}).call(this,r(3).Buffer)},function(t,e,r){(function(t){function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var i=Object.getOwnPropertyDescriptors||function(t){for(var e=Object.keys(t),r={},n=0;n<e.length;n++)r[e[n]]=Object.getOwnPropertyDescriptor(t,e[n]);return r},o=/%[sdj%]/g;e.format=function(t){if(!v(t)){for(var e=[],r=0;r<arguments.length;r++)e.push(u(arguments[r]));return e.join(" ")}r=1;for(var n=arguments,i=n.length,s=String(t).replace(o,(function(t){if("%%"===t)return"%";if(r>=i)return t;switch(t){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(t){return"[Circular]"}default:return t}})),a=n[r];r<i;a=n[++r])m(a)||!_(a)?s+=" "+a:s+=" "+u(a);return s},e.deprecate=function(r,n){if(void 0!==t&&!0===t.noDeprecation)return r;if(void 0===t)return function(){return e.deprecate(r,n).apply(this,arguments)};var i=!1;return function(){if(!i){if(t.throwDeprecation)throw new Error(n);t.traceDeprecation?console.trace(n):console.error(n),i=!0}return r.apply(this,arguments)}};var s,a={};function u(t,r){var n={seen:[],stylize:f};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),y(r)?n.showHidden=r:r&&e._extend(n,r),g(n.showHidden)&&(n.showHidden=!1),g(n.depth)&&(n.depth=2),g(n.colors)&&(n.colors=!1),g(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=h),c(n,t,n.depth)}function h(t,e){var r=u.styles[e];return r?"["+u.colors[r][0]+"m"+t+"["+u.colors[r][1]+"m":t}function f(t,e){return t}function c(t,r,n){if(t.customInspect&&r&&O(r.inspect)&&r.inspect!==e.inspect&&(!r.constructor||r.constructor.prototype!==r)){var i=r.inspect(n,t);return v(i)||(i=c(t,i,n)),i}var o=function(t,e){if(g(e))return t.stylize("undefined","undefined");if(v(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}if(b(e))return t.stylize(""+e,"number");if(y(e))return t.stylize(""+e,"boolean");if(m(e))return t.stylize("null","null")}(t,r);if(o)return o;var s=Object.keys(r),a=function(t){var e={};return t.forEach((function(t,r){e[t]=!0})),e}(s);if(t.showHidden&&(s=Object.getOwnPropertyNames(r)),S(r)&&(s.indexOf("message")>=0||s.indexOf("description")>=0))return l(r);if(0===s.length){if(O(r)){var u=r.name?": "+r.name:"";return t.stylize("[Function"+u+"]","special")}if(w(r))return t.stylize(RegExp.prototype.toString.call(r),"regexp");if(M(r))return t.stylize(Date.prototype.toString.call(r),"date");if(S(r))return l(r)}var h,f="",_=!1,A=["{","}"];(p(r)&&(_=!0,A=["[","]"]),O(r))&&(f=" [Function"+(r.name?": "+r.name:"")+"]");return w(r)&&(f=" "+RegExp.prototype.toString.call(r)),M(r)&&(f=" "+Date.prototype.toUTCString.call(r)),S(r)&&(f=" "+l(r)),0!==s.length||_&&0!=r.length?n<0?w(r)?t.stylize(RegExp.prototype.toString.call(r),"regexp"):t.stylize("[Object]","special"):(t.seen.push(r),h=_?function(t,e,r,n,i){for(var o=[],s=0,a=e.length;s<a;++s)j(e,String(s))?o.push(d(t,e,r,n,String(s),!0)):o.push("");return i.forEach((function(i){i.match(/^\d+$/)||o.push(d(t,e,r,n,i,!0))})),o}(t,r,n,a,s):s.map((function(e){return d(t,r,n,a,e,_)})),t.seen.pop(),function(t,e,r){if(t.reduce((function(t,e){return e.indexOf("\n")>=0&&0,t+e.replace(/\u001b\[\d\d?m/g,"").length+1}),0)>60)return r[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+r[1];return r[0]+e+" "+t.join(", ")+" "+r[1]}(h,f,A)):A[0]+f+A[1]}function l(t){return"["+Error.prototype.toString.call(t)+"]"}function d(t,e,r,n,i,o){var s,a,u;if((u=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]}).get?a=u.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):u.set&&(a=t.stylize("[Setter]","special")),j(n,i)||(s="["+i+"]"),a||(t.seen.indexOf(u.value)<0?(a=m(r)?c(t,u.value,null):c(t,u.value,r-1)).indexOf("\n")>-1&&(a=o?a.split("\n").map((function(t){return" "+t})).join("\n").substr(2):"\n"+a.split("\n").map((function(t){return" "+t})).join("\n")):a=t.stylize("[Circular]","special")),g(s)){if(o&&i.match(/^\d+$/))return a;(s=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(s=s.substr(1,s.length-2),s=t.stylize(s,"name")):(s=s.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),s=t.stylize(s,"string"))}return s+": "+a}function p(t){return Array.isArray(t)}function y(t){return"boolean"==typeof t}function m(t){return null===t}function b(t){return"number"==typeof t}function v(t){return"string"==typeof t}function g(t){return void 0===t}function w(t){return _(t)&&"[object RegExp]"===A(t)}function _(t){return"object"===n(t)&&null!==t}function M(t){return _(t)&&"[object Date]"===A(t)}function S(t){return _(t)&&("[object Error]"===A(t)||t instanceof Error)}function O(t){return"function"==typeof t}function A(t){return Object.prototype.toString.call(t)}function E(t){return t<10?"0"+t.toString(10):t.toString(10)}e.debuglog=function(r){if(g(s)&&(s=t.env.NODE_DEBUG||""),r=r.toUpperCase(),!a[r])if(new RegExp("\\b"+r+"\\b","i").test(s)){var n=t.pid;a[r]=function(){var t=e.format.apply(e,arguments);console.error("%s %d: %s",r,n,t)}}else a[r]=function(){};return a[r]},e.inspect=u,u.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},u.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},e.isArray=p,e.isBoolean=y,e.isNull=m,e.isNullOrUndefined=function(t){return null==t},e.isNumber=b,e.isString=v,e.isSymbol=function(t){return"symbol"===n(t)},e.isUndefined=g,e.isRegExp=w,e.isObject=_,e.isDate=M,e.isError=S,e.isFunction=O,e.isPrimitive=function(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"===n(t)||void 0===t},e.isBuffer=r(282);var x=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function k(){var t=new Date,e=[E(t.getHours()),E(t.getMinutes()),E(t.getSeconds())].join(":");return[t.getDate(),x[t.getMonth()],e].join(" ")}function j(t,e){return Object.prototype.hasOwnProperty.call(t,e)}e.log=function(){console.log("%s - %s",k(),e.format.apply(e,arguments))},e.inherits=r(283),e._extend=function(t,e){if(!e||!_(e))return t;for(var r=Object.keys(e),n=r.length;n--;)t[r[n]]=e[r[n]];return t};var $="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function P(t,e){if(!t){var r=new Error("Promise was rejected with a falsy value");r.reason=t,t=r}return e(t)}e.promisify=function(t){if("function"!=typeof t)throw new TypeError('The "original" argument must be of type Function');if($&&t[$]){var e;if("function"!=typeof(e=t[$]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(e,$,{value:e,enumerable:!1,writable:!1,configurable:!0}),e}function e(){for(var e,r,n=new Promise((function(t,n){e=t,r=n})),i=[],o=0;o<arguments.length;o++)i.push(arguments[o]);i.push((function(t,n){t?r(t):e(n)}));try{t.apply(this,i)}catch(t){r(t)}return n}return Object.setPrototypeOf(e,Object.getPrototypeOf(t)),$&&Object.defineProperty(e,$,{value:e,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(e,i(t))},e.promisify.custom=$,e.callbackify=function(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');function r(){for(var r=[],n=0;n<arguments.length;n++)r.push(arguments[n]);var i=r.pop();if("function"!=typeof i)throw new TypeError("The last argument must be of type Function");var o=this,s=function(){return i.apply(o,arguments)};e.apply(this,r).then((function(e){t.nextTick(s,null,e)}),(function(e){t.nextTick(P,e,s)}))}return Object.setPrototypeOf(r,Object.getPrototypeOf(e)),Object.defineProperties(r,i(e)),r}}).call(this,r(5))},function(t,e){function r(t,e){if(!t)throw new Error(e||"Assertion failed")}t.exports=r,r.equal=function(t,e,r){if(t!=e)throw new Error(r||"Assertion failed: "+t+" != "+e)}},function(t,e,r){"use strict";var n=e,i=r(21),o=r(10),s=r(128);n.assert=o,n.toArray=s.toArray,n.zero2=s.zero2,n.toHex=s.toHex,n.encode=s.encode,n.getNAF=function(t,e,r){var n=new Array(Math.max(t.bitLength(),r)+1);n.fill(0);for(var i=1<<e+1,o=t.clone(),s=0;s<n.length;s++){var a,u=o.andln(i-1);o.isOdd()?(a=u>(i>>1)-1?(i>>1)-u:u,o.isubn(a)):a=0,n[s]=a,o.iushrn(1)}return n},n.getJSF=function(t,e){var r=[[],[]];t=t.clone(),e=e.clone();for(var n,i=0,o=0;t.cmpn(-i)>0||e.cmpn(-o)>0;){var s,a,u=t.andln(3)+i&3,h=e.andln(3)+o&3;3===u&&(u=-1),3===h&&(h=-1),s=0==(1&u)?0:3!==(n=t.andln(7)+i&7)&&5!==n||2!==h?u:-u,r[0].push(s),a=0==(1&h)?0:3!==(n=e.andln(7)+o&7)&&5!==n||2!==u?h:-h,r[1].push(a),2*i===s+1&&(i=1-i),2*o===a+1&&(o=1-o),t.iushrn(1),e.iushrn(1)}return r},n.cachedProperty=function(t,e,r){var n="_"+e;t.prototype[e]=function(){return void 0!==this[n]?this[n]:this[n]=r.call(this)}},n.parseBytes=function(t){return"string"==typeof t?n.toArray(t,"hex"):t},n.intFromLE=function(t){return new i(t,"hex","le")}},function(t,e,r){"use strict";function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var i,o="object"===("undefined"==typeof Reflect?"undefined":n(Reflect))?Reflect:null,s=o&&"function"==typeof o.apply?o.apply:function(t,e,r){return Function.prototype.apply.call(t,e,r)};i=o&&"function"==typeof o.ownKeys?o.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var a=Number.isNaN||function(t){return t!=t};function u(){u.init.call(this)}t.exports=u,t.exports.once=function(t,e){return new Promise((function(r,n){function i(r){t.removeListener(e,o),n(r)}function o(){"function"==typeof t.removeListener&&t.removeListener("error",i),r([].slice.call(arguments))}v(t,e,o,{once:!0}),"error"!==e&&function(t,e,r){"function"==typeof t.on&&v(t,"error",e,r)}(t,i,{once:!0})}))},u.EventEmitter=u,u.prototype._events=void 0,u.prototype._eventsCount=0,u.prototype._maxListeners=void 0;var h=10;function f(t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+n(t))}function c(t){return void 0===t._maxListeners?u.defaultMaxListeners:t._maxListeners}function l(t,e,r,n){var i,o,s,a;if(f(r),void 0===(o=t._events)?(o=t._events=Object.create(null),t._eventsCount=0):(void 0!==o.newListener&&(t.emit("newListener",e,r.listener?r.listener:r),o=t._events),s=o[e]),void 0===s)s=o[e]=r,++t._eventsCount;else if("function"==typeof s?s=o[e]=n?[r,s]:[s,r]:n?s.unshift(r):s.push(r),(i=c(t))>0&&s.length>i&&!s.warned){s.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=t,u.type=e,u.count=s.length,a=u,console&&console.warn&&console.warn(a)}return t}function d(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function p(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},i=d.bind(n);return i.listener=r,n.wrapFn=i,i}function y(t,e,r){var n=t._events;if(void 0===n)return[];var i=n[e];return void 0===i?[]:"function"==typeof i?r?[i.listener||i]:[i]:r?function(t){for(var e=new Array(t.length),r=0;r<e.length;++r)e[r]=t[r].listener||t[r];return e}(i):b(i,i.length)}function m(t){var e=this._events;if(void 0!==e){var r=e[t];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function b(t,e){for(var r=new Array(e),n=0;n<e;++n)r[n]=t[n];return r}function v(t,e,r,i){if("function"==typeof t.on)i.once?t.once(e,r):t.on(e,r);else{if("function"!=typeof t.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+n(t));t.addEventListener(e,(function n(o){i.once&&t.removeEventListener(e,n),r(o)}))}}Object.defineProperty(u,"defaultMaxListeners",{enumerable:!0,get:function(){return h},set:function(t){if("number"!=typeof t||t<0||a(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");h=t}}),u.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},u.prototype.setMaxListeners=function(t){if("number"!=typeof t||t<0||a(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this},u.prototype.getMaxListeners=function(){return c(this)},u.prototype.emit=function(t){for(var e=[],r=1;r<arguments.length;r++)e.push(arguments[r]);var n="error"===t,i=this._events;if(void 0!==i)n=n&&void 0===i.error;else if(!n)return!1;if(n){var o;if(e.length>0&&(o=e[0]),o instanceof Error)throw o;var a=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw a.context=o,a}var u=i[t];if(void 0===u)return!1;if("function"==typeof u)s(u,this,e);else{var h=u.length,f=b(u,h);for(r=0;r<h;++r)s(f[r],this,e)}return!0},u.prototype.addListener=function(t,e){return l(this,t,e,!1)},u.prototype.on=u.prototype.addListener,u.prototype.prependListener=function(t,e){return l(this,t,e,!0)},u.prototype.once=function(t,e){return f(e),this.on(t,p(this,t,e)),this},u.prototype.prependOnceListener=function(t,e){return f(e),this.prependListener(t,p(this,t,e)),this},u.prototype.removeListener=function(t,e){var r,n,i,o,s;if(f(e),void 0===(n=this._events))return this;if(void 0===(r=n[t]))return this;if(r===e||r.listener===e)0==--this._eventsCount?this._events=Object.create(null):(delete n[t],n.removeListener&&this.emit("removeListener",t,r.listener||e));else if("function"!=typeof r){for(i=-1,o=r.length-1;o>=0;o--)if(r[o]===e||r[o].listener===e){s=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():function(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}(r,i),1===r.length&&(n[t]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",t,s||e)}return this},u.prototype.off=u.prototype.removeListener,u.prototype.removeAllListeners=function(t){var e,r,n;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[t]&&(0==--this._eventsCount?this._events=Object.create(null):delete r[t]),this;if(0===arguments.length){var i,o=Object.keys(r);for(n=0;n<o.length;++n)"removeListener"!==(i=o[n])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(e=r[t]))this.removeListener(t,e);else if(void 0!==e)for(n=e.length-1;n>=0;n--)this.removeListener(t,e[n]);return this},u.prototype.listeners=function(t){return y(this,t,!0)},u.prototype.rawListeners=function(t){return y(this,t,!1)},u.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):m.call(t,e)},u.prototype.listenerCount=m,u.prototype.eventNames=function(){return this._eventsCount>0?i(this._events):[]}},function(t,e,r){"use strict";
|
|
291
291
|
/*!
|
|
292
292
|
* Module dependencies.
|
|
293
|
-
*/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}function i(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return o(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return o(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}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 s,a=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,s=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw s}}}}function o(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function s(t){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var a,u,h,f=r(12).EventEmitter,c=r(275),l=r(7),d=r(45),p=r(154),y=r(304),m=r(305),b=r(85),v=r(44),g=r(151),w=r(152),_=r(86),M=r(343),S=r(53),O=r(167),A=r(91).compile,E=r(91).defineKey,x=r(344).flatten,k=r(345),j=r(14),$=r(347),P=r(348),R=r(171),B=r(42),T=r(92),I=r(349),N=r(
|
|
293
|
+
*/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}function i(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return o(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return o(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}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 s,a=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,s=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw s}}}}function o(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function s(t){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var a,u,h,f=r(12).EventEmitter,c=r(275),l=r(7),d=r(45),p=r(154),y=r(304),m=r(305),b=r(85),v=r(44),g=r(151),w=r(152),_=r(86),M=r(343),S=r(53),O=r(167),A=r(91).compile,E=r(91).defineKey,x=r(344).flatten,k=r(345),j=r(14),$=r(347),P=r(348),R=r(171),B=r(42),T=r(92),I=r(349),N=r(9).inspect,D=r(34).internalToObjectOptions,C=r(350),L=r(81),q=r(351),U=r(4),F=r(353),z=U.clone,V=U.deepEqual,K=U.isMongooseObject,H=r(1).arrayAtomicsBackupSymbol,Z=r(1).arrayAtomicsSymbol,W=r(1).documentArrayParent,J=r(1).documentIsModified,Y=r(1).documentModifiedPaths,Q=r(1).documentSchemaSymbol,G=r(1).getSymbol,X=r(1).populateModelSymbol,tt=r(1).scopeSymbol,et=r(55).schemaMixedSymbol,rt=r(354),nt=U.specialProperties;function it(t,e,r,n){if("object"===s(r)&&null!=r&&(r=(n=r).skipId),n=Object.assign({},n),null==this.$__schema){var o=U.isObject(e)&&!e.instanceOfSchema?new b(e):e;this.$__setSchema(o),e=r,r=n,n=arguments[4]||{}}if(this.$__=new c,this.$isNew=!("isNew"in n)||n.isNew,"priorDoc"in n&&(this.$__.priorDoc=n.priorDoc),r&&(this.$__.skipId=r),null!=t&&"object"!==s(t))throw new y(t,"obj","Document");var a=!0;void 0!==n.defaults&&(this.$__.defaults=n.defaults,a=n.defaults);var u=this.$__schema;"boolean"==typeof e||"throw"===e?(this.$__.strictMode=e,e=void 0):(this.$__.strictMode=u.options.strict,void 0!==e&&(this.$__.selected=e));var h,f=u.requiredPaths(!0),l=i(f);try{for(l.s();!(h=l.n()).done;){var d=h.value;this.$__.activePaths.require(d)}}catch(t){l.e(t)}finally{l.f()}var p=null;U.isPOJO(e)&&(p=I(e),this.$__.fields=e,this.$__.exclude=p);var m=!1===p&&e?M(e):null;if(null==this._doc&&(this.$__buildDoc(t,e,r,p,m,!1),a&&st(this,e,p,m,!0,null)),t&&(this.$__original_set?this.$__original_set(t,void 0,!0):this.$set(t,void 0,!0),t instanceof it&&(this.$isNew=t.$isNew)),n.willInit&&a?n.skipDefaults&&(this.$__.skipDefaults=n.skipDefaults):a&&st(this,e,p,m,!1,n.skipDefaults),this.$__._id=this._id,!this.$__.strictMode&&t){var v=this,g=Object.keys(this._doc);g.forEach((function(t){t in u.tree||t in u.methods||t in u.virtuals||t.startsWith("$")||E({prop:t,subprops:null,prototype:v})}))}lt(this)}for(var ot in Object.defineProperty(it.prototype,"isNew",{get:function(){return this.$isNew},set:function(t){this.$isNew=t}}),Object.defineProperty(it.prototype,"errors",{get:function(){return this.$errors},set:function(t){this.$errors=t}}),
|
|
294
294
|
/*!
|
|
295
295
|
* Document exposes the NodeJS event emitter API, so you can use
|
|
296
296
|
* `on`, `once`, etc.
|
|
@@ -299,7 +299,7 @@ U.each(["on","once","emit","listeners","removeListener","setMaxListeners","remov
|
|
|
299
299
|
/*!
|
|
300
300
|
* ignore
|
|
301
301
|
*/
|
|
302
|
-
function st(t,e,r,n,i,o){for(var s=Object.keys(t.$__schema.paths),a=s.length,u=0;u<a;++u){var h=void 0,f="",c=s[u];if("_id"!==c||!t.$__.skipId)for(var l=t.$__schema.paths[c],d=l.splitPath(),p=d.length,y=!1,m=t._doc,b=0;b<p&&null!=m;++b){var v=d[b];if(f+=(f.length?".":"")+v,!0===r){if(f in e)break}else if(!1===r&&e&&!y){var g=l.$isSingleNested||l.$isMongooseDocumentArray;if(f in e||g&&n[f])y=!0;else if(
|
|
302
|
+
function st(t,e,r,n,i,o){for(var s=Object.keys(t.$__schema.paths),a=s.length,u=0;u<a;++u){var h=void 0,f="",c=s[u];if("_id"!==c||!t.$__.skipId)for(var l=t.$__schema.paths[c],d=l.splitPath(),p=d.length,y=!1,m=t._doc,b=0;b<p&&null!=m;++b){var v=d[b];if(f+=(f.length?".":"")+v,!0===r){if(f in e)break}else if(!1===r&&e&&!y){var g=l.$isSingleNested||l.$isMongooseDocumentArray;if(f in e||g&&null!=n&&n[f])y=!0;else if(null!=n&&!n[f])break}if(b===p-1){if(void 0!==m[v])break;if("function"==typeof l.defaultValue){if(!l.defaultValue.$runBeforeSetters&&i)break;if(l.defaultValue.$runBeforeSetters&&!i)break}else if(!i)continue;if(o&&o[f])break;if(e&&null!==r){if(!0===r){if(c in e)continue;try{h=l.getDefault(t,!1)}catch(e){t.invalidate(c,e);break}void 0!==h&&(m[v]=h,t.$__.activePaths.default(c))}else if(y){try{h=l.getDefault(t,!1)}catch(e){t.invalidate(c,e);break}void 0!==h&&(m[v]=h,t.$__.activePaths.default(c))}}else{try{h=l.getDefault(t,!1)}catch(e){t.invalidate(c,e);break}void 0!==h&&(m[v]=h,t.$__.activePaths.default(c))}}else m=m[v]}}}
|
|
303
303
|
/*!
|
|
304
304
|
* ignore
|
|
305
305
|
*/function at(t,e,r){if(null!=t){k(t);for(var n=Object.keys(r.$__schema.paths),i=n.length,o=-1===e.indexOf(".")?[e]:e.split("."),s=0;s<i;++s){var a="",u=n[s];if(u.startsWith(e+".")){var h=r.$__schema.paths[u],f=h.splitPath().slice(o.length),c=f.length;if(void 0!==h.defaultValue)for(var l=t,d=0;d<c&&null!=l;++d){var p=f[d];if(d===c-1){if(void 0!==l[p])break;try{var y=h.getDefault(r,!1);void 0!==y&&(l[p]=y)}catch(t){r.invalidate(e+"."+a,t);break}break}a+=(a.length?".":"")+p,l[p]=l[p]||{},l=l[p]}}}}}function ut(t){if(null==t)return!0;if("object"!==s(t)||Array.isArray(t))return!1;for(var e=0,r=Object.keys(t);e<r.length;e++){if(!ut(t[r[e]]))return!1}return!0}
|
|
@@ -354,7 +354,7 @@ it.prototype.toBSON=function(){return this.toObject(D)},it.prototype.init=functi
|
|
|
354
354
|
* @param {Object} doc object we are initializing
|
|
355
355
|
* @api private
|
|
356
356
|
*/
|
|
357
|
-
function t(e,r,n,i,o){o=o||"";var s,a,u,h=Object.keys(r),f=h.length,c=0,l=e.$__.strictMode,d=e.$__schema;for(;c<f;)p(c++);function p(f){if(u=h[f],a=o+u,s=d.path(a),!d.$isRootDiscriminator||e.$__isSelected(a))if(!s&&U.isPOJO(r[u]))n[u]||(n[u]={},l||u in d.tree||u in d.methods||u in d.virtuals||(e[u]=n[u])),t(e,r[u],n[u],i,a+".");else if(s){if(n.hasOwnProperty(u)&&void 0!==r[u]&&delete n[u],null===r[u])n[u]=s._castNullish(null);else if(void 0!==r[u]){var c=null==r[u].$__?null:r[u].$__.wasPopulated;if(s&&!c)try{n[u]=s.cast(r[u],e,!0)}catch(t){e.invalidate(t.path,new w({path:t.path,message:t.message,type:"cast",value:t.value,reason:t}))}else n[u]=r[u]}e.$isModified(a)||e.$__.activePaths.init(a)}else n[u]=r[u],l||(e[u]=r[u])}}(this,t,this._doc,e),C(this,e.populated),this.$emit("init",this),this.constructor.emit("init",this),this.$__._id=this._id;var f=!1===this.$__.exclude&&this.$__.fields?M(this.$__.fields):
|
|
357
|
+
function t(e,r,n,i,o){o=o||"";var s,a,u,h=Object.keys(r),f=h.length,c=0,l=e.$__.strictMode,d=e.$__schema;for(;c<f;)p(c++);function p(f){if(u=h[f],a=o+u,s=d.path(a),!d.$isRootDiscriminator||e.$__isSelected(a))if(!s&&U.isPOJO(r[u]))n[u]||(n[u]={},l||u in d.tree||u in d.methods||u in d.virtuals||(e[u]=n[u])),t(e,r[u],n[u],i,a+".");else if(s){if(n.hasOwnProperty(u)&&void 0!==r[u]&&delete n[u],null===r[u])n[u]=s._castNullish(null);else if(void 0!==r[u]){var c=null==r[u].$__?null:r[u].$__.wasPopulated;if(s&&!c)try{n[u]=s.cast(r[u],e,!0)}catch(t){e.invalidate(t.path,new w({path:t.path,message:t.message,type:"cast",value:t.value,reason:t}))}else n[u]=r[u]}e.$isModified(a)||e.$__.activePaths.init(a)}else n[u]=r[u],l||(e[u]=r[u])}}(this,t,this._doc,e),C(this,e.populated),this.$emit("init",this),this.constructor.emit("init",this),this.$__._id=this._id;var f=!1===this.$__.exclude&&this.$__.fields?M(this.$__.fields):null;return st(this,this.$__.fields,this.$__.exclude,f,!1,this.$__.skipDefaults),this},it.prototype.update=function(){var t=Array.prototype.slice.call(arguments);t.unshift({_id:this._id});var e=this.constructor.update.apply(this.constructor,t);return null!=this.$session()&&("session"in e.options||(e.options.session=this.$session())),e},it.prototype.updateOne=function(t,e,r){var n=this,i=this.constructor.updateOne({_id:this._id},t,e);return i.pre((function(t){n.constructor._middleware.execPre("updateOne",n,[n],t)})),i.post((function(t){n.constructor._middleware.execPost("updateOne",n,[n],{},t)})),null!=this.$session()&&("session"in i.options||(i.options.session=this.$session())),null!=r?i.exec(r):i},it.prototype.replaceOne=function(){var t=Array.prototype.slice.call(arguments);return t.unshift({_id:this._id}),this.constructor.replaceOne.apply(this.constructor,t)},it.prototype.$session=function(t){if(0===arguments.length)return null!=this.$__.session&&this.$__.session.hasEnded?(this.$__.session=null,null):this.$__.session;if(null!=t&&t.hasEnded)throw new l("Cannot set a document's session to a session that has ended. Make sure you haven't called `endSession()` on the session you are passing to `$session()`.");if(null!=t||null!=this.$__.session){if(this.$__.session=t,!this.$isSubdocument){var e,r=this.$getAllSubdocs(),n=i(r);try{for(n.s();!(e=n.n()).done;){var o=e.value;o.$session(t)}}catch(t){n.e(t)}finally{n.f()}}return t}},it.prototype.overwrite=function(t){for(var e=0,r=Array.from(new Set(Object.keys(this._doc).concat(Object.keys(t))));e<r.length;e++){var n=r[e];"_id"!==n&&(this.$__schema.options.versionKey&&n===this.$__schema.options.versionKey||this.$__schema.options.discriminatorKey&&n===this.$__schema.options.discriminatorKey||this.$set(n,t[n]))}return this},it.prototype.$set=function(t,e,r,o){var a=this;U.isPOJO(r)&&(o=r,r=void 0);var u,h,f,c,y=(o=o||{}).merge,m=r&&!0!==r,b=!0===r,g=this.$__schema.options.typeKey,w=0,_="strict"in o?o.strict:this.$__.strictMode;if(m&&((this.$__.adhocPaths||(this.$__.adhocPaths={}))[t]=this.$__schema.interpretAsType(t,r,this.$__schema.options)),null==t){var M=[e,t];t=M[0],e=M[1]}else if("string"!=typeof t){if(t instanceof it&&(t=t.$__isNested?t.toObject():t._doc),null==t){var S=[e,t];t=S[0],e=S[1]}c=e?e+".":"";var A=(u=P(this.$__schema,t)).length,E=o._skipMinimizeTopLevel||!1;if(0===A&&E)return delete o._skipMinimizeTopLevel,e&&this.$set(e,{}),this;for(var x=0;x<A;++x){var k=c+(f=u[x]);h=this.$__schema.pathType(k);var j=t[f];if(!0!==r||c||null==j||"nested"!==h||null==this._doc[f]?o=Object.assign({},o,{_skipMinimizeTopLevel:!1}):(delete this._doc[f],o=Object.assign({},o,{_skipMinimizeTopLevel:!0})),U.isNonBuiltinObject(j)&&"nested"===h)at(t[f],c+f,this),this.$set(c+f,t[f],b,Object.assign({},o,{_skipMarkModified:!0}));else if(_){if(b&&void 0===t[f]&&void 0!==this.$get(k))continue;if("adhocOrUndefined"===h&&(h=$(this,k,{typeOnly:!0})),"real"===h||"virtual"===h){var B=t[f];this.$set(c+f,B,b,o)}else if("nested"===h&&t[f]instanceof it)this.$set(c+f,t[f].toObject({transform:!1}),b,o);else if("throw"===_)throw"nested"===h?new p(f,t[f]):new v(f)}else void 0!==t[f]&&this.$set(c+f,t[f],b,o)}for(var T=0,I=Object.keys(this.$__schema.tree);T<I.length;T++){var N=I[T];if(this._doc.hasOwnProperty(N)){var C=this._doc[N];delete this._doc[N],this._doc[N]=C}}return this}var q=this.$__schema.pathType(t);"adhocOrUndefined"===q&&(q=$(this,t,{typeOnly:!0})),e=R(e);var F,z=null!=a.$__.priorDoc?a.$__.priorDoc.$__getValue(t):b?void 0:a.$__getValue(t);if("nested"===q&&e){if("object"===s(e)&&null!=e){if(null!=e.$__&&(e=e.toObject(D)),null==e)return this.invalidate(t,new l.CastError("Object",e,t)),this;var V=null!=this.$__.savedState&&this.$__.savedState.hasOwnProperty(t);if(null!=this.$__.savedState&&!this.$isNew&&!this.$__.savedState.hasOwnProperty(t)){var K=this.$__getValue(t);this.$__.savedState[t]=K;for(var H=0,Z=Object.keys(K||{});H<Z.length;H++){var W=Z[H];this.$__.savedState[t+"."+W]=K[W]}}if(y)return this.$set(e,t,b);this.$__setValue(t,null),O(this,t);var J=P(this.$__schema,e,t);this.$__setValue(t,{});var Y,Q=i(J);try{for(Q.s();!(Y=Q.n()).done;){var G=Y.value;this.$set(t+"."+G,e[G],b,o)}}catch(t){Q.e(t)}finally{Q.f()}return null!=z&&U.deepEqual(V?this.$__.savedState[t]:z,e)?this.unmarkModified(t):this.markModified(t),this}return this.invalidate(t,new l.CastError("Object",e,t)),this}var tt=-1===t.indexOf(".")?[t]:t.split(".");if("string"==typeof this.$__schema.aliases[tt[0]]&&(tt[0]=this.$__schema.aliases[tt[0]]),"adhocOrUndefined"===q&&_){var et;for(w=0;w<tt.length;++w){var rt=tt.slice(0,w+1).join(".");if(w+1<tt.length&&"virtual"===this.$__schema.pathType(rt))return L.set(t,e,this),this;if(null!=(F=this.$__schema.path(rt))&&F instanceof d){et=!0;break}}if(null==F&&(F=$(this,t)),!et&&!F){if("throw"===_)throw new v(t);return this}}else{if("virtual"===q)return(F=this.$__schema.virtualpath(t)).applySetters(e,this),this;F=this.$__path(t)}var nt,ot=this._doc,st="";for(w=0;w<tt.length-1;++w)ot=ot[tt[w]],st+=(0!==st.length?".":"")+tt[w],ot||(this.$set(st,{}),this.$__isSelected(st)||this.unmarkModified(st),ot=this.$__getValue(st));if(tt.length<=1)nt=t;else{var ut=tt.length;for(w=0;w<ut;++w){var ht=tt.slice(0,w+1).join(".");if(null===this.$get(ht,null,{getters:!1})){nt=ht;break}}nt||(nt=t)}if(!F)return this.$__set(nt,t,o,b,tt,F,e,z),this;if((F.$isSingleNested||F.$isMongooseArray)&&
|
|
358
358
|
/*!
|
|
359
359
|
* ignore
|
|
360
360
|
*/
|
|
@@ -413,7 +413,7 @@ n.prototype.hasOwnProperty("valueOf")||(n.prototype.valueOf=function(){return th
|
|
|
413
413
|
*/function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function i(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function s(t,e){if(e&&("object"===n(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function a(t){var e="function"==typeof Map?new Map:void 0;return(a=function(t){if(null===t||(r=t,-1===Function.toString.call(r).indexOf("[native code]")))return t;var r;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,n)}function n(){return u(t,arguments,c(this).constructor)}return n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),f(n,t)})(t)}function u(t,e,r){return(u=h()?Reflect.construct:function(t,e,r){var n=[null];n.push.apply(n,e);var i=new(Function.bind.apply(t,n));return r&&f(i,r.prototype),i}).apply(null,arguments)}function h(){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(t){return!1}}function f(t,e){return(f=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function c(t){return(c=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var l=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&f(t,e)}(d,t);var e,r,n,a,u,l=(e=d,r=h(),function(){var t,n=c(e);if(r){var i=c(this).constructor;t=Reflect.construct(n,arguments,i)}else t=n.apply(this,arguments);return s(this,t)});function d(){return o(this,d),l.apply(this,arguments)}return n=d,a&&i(n.prototype,a),u&&i(n,u),Object.defineProperty(n,"prototype",{writable:!1}),n}(a(Error));Object.defineProperty(l.prototype,"name",{value:"MongooseError"}),t.exports=l},function(t,e,r){"use strict";
|
|
414
414
|
/*!
|
|
415
415
|
* Module dependencies.
|
|
416
|
-
*/function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function s(t,e){return(s=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function a(t){var e=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(t){return!1}}();return function(){var r,n=h(t);if(e){var i=h(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return u(this,r)}}function u(t,e){if(e&&("object"===n(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function h(t){return(h=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var f=r(19),c=r(
|
|
416
|
+
*/function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function s(t,e){return(s=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function a(t){var e=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(t){return!1}}();return function(){var r,n=h(t);if(e){var i=h(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return u(this,r)}}function u(t,e){if(e&&("object"===n(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function h(t){return(h=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var f=r(19),c=r(9),l=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&s(t,e)}(f,t);var e,r,n,h=a(f);function f(t,e,r,n,o){var s;if(i(this,f),arguments.length>0){var a=d(e),c=p(e),l=y(o),b=m(null,t,a,r,l,c);(s=h.call(this,b)).init(t,e,r,n,o)}else s=h.call(this,m());return u(s)}return e=f,(r=[{key:"toJSON",value:function(){return{stringValue:this.stringValue,valueType:this.valueType,kind:this.kind,value:this.value,path:this.path,reason:this.reason,name:this.name,message:this.message}}
|
|
417
417
|
/*!
|
|
418
418
|
* ignore
|
|
419
419
|
*/},{key:"init",value:function(t,e,r,n,i){this.stringValue=d(e),this.messageFormat=y(i),this.kind=t,this.value=e,this.path=r,this.reason=n,this.valueType=p(e)}
|
|
@@ -484,13 +484,13 @@ var r=e.nextTick.bind(e);t.exports=function(t){return r(t)}}).call(this,r(5))},f
|
|
|
484
484
|
*
|
|
485
485
|
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
|
|
486
486
|
* @license MIT
|
|
487
|
-
*/function o(t,e){if(t===e)return 0;for(var r=t.length,n=e.length,i=0,o=Math.min(r,n);i<o;++i)if(t[i]!==e[i]){r=t[i],n=e[i];break}return r<n?-1:n<r?1:0}function s(t){return e.Buffer&&"function"==typeof e.Buffer.isBuffer?e.Buffer.isBuffer(t):!(null==t||!t._isBuffer)}var a=r(
|
|
487
|
+
*/function o(t,e){if(t===e)return 0;for(var r=t.length,n=e.length,i=0,o=Math.min(r,n);i<o;++i)if(t[i]!==e[i]){r=t[i],n=e[i];break}return r<n?-1:n<r?1:0}function s(t){return e.Buffer&&"function"==typeof e.Buffer.isBuffer?e.Buffer.isBuffer(t):!(null==t||!t._isBuffer)}var a=r(9),u=Object.prototype.hasOwnProperty,h=Array.prototype.slice,f="foo"===function(){}.name;function c(t){return Object.prototype.toString.call(t)}function l(t){return!s(t)&&("function"==typeof e.ArrayBuffer&&("function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(t):!!t&&(t instanceof DataView||!!(t.buffer&&t.buffer instanceof ArrayBuffer))))}var d=t.exports=g,p=/\s*function\s+([^\(\s]*)\s*/;function y(t){if(a.isFunction(t)){if(f)return t.name;var e=t.toString().match(p);return e&&e[1]}}function m(t,e){return"string"==typeof t?t.length<e?t:t.slice(0,e):t}function b(t){if(f||!a.isFunction(t))return a.inspect(t);var e=y(t);return"[Function"+(e?": "+e:"")+"]"}function v(t,e,r,n,i){throw new d.AssertionError({message:r,actual:t,expected:e,operator:n,stackStartFunction:i})}function g(t,e){t||v(t,!0,e,"==",d.ok)}function w(t,e,r,i){if(t===e)return!0;if(s(t)&&s(e))return 0===o(t,e);if(a.isDate(t)&&a.isDate(e))return t.getTime()===e.getTime();if(a.isRegExp(t)&&a.isRegExp(e))return t.source===e.source&&t.global===e.global&&t.multiline===e.multiline&&t.lastIndex===e.lastIndex&&t.ignoreCase===e.ignoreCase;if(null!==t&&"object"===n(t)||null!==e&&"object"===n(e)){if(l(t)&&l(e)&&c(t)===c(e)&&!(t instanceof Float32Array||t instanceof Float64Array))return 0===o(new Uint8Array(t.buffer),new Uint8Array(e.buffer));if(s(t)!==s(e))return!1;var u=(i=i||{actual:[],expected:[]}).actual.indexOf(t);return-1!==u&&u===i.expected.indexOf(e)||(i.actual.push(t),i.expected.push(e),function(t,e,r,n){if(null==t||null==e)return!1;if(a.isPrimitive(t)||a.isPrimitive(e))return t===e;if(r&&Object.getPrototypeOf(t)!==Object.getPrototypeOf(e))return!1;var i=_(t),o=_(e);if(i&&!o||!i&&o)return!1;if(i)return t=h.call(t),e=h.call(e),w(t,e,r);var s,u,f=O(t),c=O(e);if(f.length!==c.length)return!1;for(f.sort(),c.sort(),u=f.length-1;u>=0;u--)if(f[u]!==c[u])return!1;for(u=f.length-1;u>=0;u--)if(s=f[u],!w(t[s],e[s],r,n))return!1;return!0}(t,e,r,i))}return r?t===e:t==e}function _(t){return"[object Arguments]"==Object.prototype.toString.call(t)}function M(t,e){if(!t||!e)return!1;if("[object RegExp]"==Object.prototype.toString.call(e))return e.test(t);try{if(t instanceof e)return!0}catch(t){}return!Error.isPrototypeOf(e)&&!0===e.call({},t)}function S(t,e,r,n){var i;if("function"!=typeof e)throw new TypeError('"block" argument must be a function');"string"==typeof r&&(n=r,r=null),i=function(t){var e;try{t()}catch(t){e=t}return e}(e),n=(r&&r.name?" ("+r.name+").":".")+(n?" "+n:"."),t&&!i&&v(i,r,"Missing expected exception"+n);var o="string"==typeof n,s=!t&&i&&!r;if((!t&&a.isError(i)&&o&&M(i,r)||s)&&v(i,r,"Got unwanted exception"+n),t&&i&&r&&!M(i,r)||!t&&i)throw i}d.AssertionError=function(t){this.name="AssertionError",this.actual=t.actual,this.expected=t.expected,this.operator=t.operator,t.message?(this.message=t.message,this.generatedMessage=!1):(this.message=function(t){return m(b(t.actual),128)+" "+t.operator+" "+m(b(t.expected),128)}(this),this.generatedMessage=!0);var e=t.stackStartFunction||v;if(Error.captureStackTrace)Error.captureStackTrace(this,e);else{var r=new Error;if(r.stack){var n=r.stack,i=y(e),o=n.indexOf("\n"+i);if(o>=0){var s=n.indexOf("\n",o+1);n=n.substring(s+1)}this.stack=n}}},a.inherits(d.AssertionError,Error),d.fail=v,d.ok=g,d.equal=function(t,e,r){t!=e&&v(t,e,r,"==",d.equal)},d.notEqual=function(t,e,r){t==e&&v(t,e,r,"!=",d.notEqual)},d.deepEqual=function(t,e,r){w(t,e,!1)||v(t,e,r,"deepEqual",d.deepEqual)},d.deepStrictEqual=function(t,e,r){w(t,e,!0)||v(t,e,r,"deepStrictEqual",d.deepStrictEqual)},d.notDeepEqual=function(t,e,r){w(t,e,!1)&&v(t,e,r,"notDeepEqual",d.notDeepEqual)},d.notDeepStrictEqual=function t(e,r,n){w(e,r,!0)&&v(e,r,n,"notDeepStrictEqual",t)},d.strictEqual=function(t,e,r){t!==e&&v(t,e,r,"===",d.strictEqual)},d.notStrictEqual=function(t,e,r){t===e&&v(t,e,r,"!==",d.notStrictEqual)},d.throws=function(t,e,r){S(!0,t,e,r)},d.doesNotThrow=function(t,e,r){S(!1,t,e,r)},d.ifError=function(t){if(t)throw t},d.strict=i((function t(e,r){e||v(e,!0,r,"==",t)}),d,{equal:d.strictEqual,deepEqual:d.deepStrictEqual,notEqual:d.notStrictEqual,notDeepEqual:d.notDeepStrictEqual}),d.strict.strict=d.strict;var O=Object.keys||function(t){var e=[];for(var r in t)u.call(t,r)&&e.push(r);return e}}).call(this,r(6))},function(t,e,r){"use strict";
|
|
488
488
|
/*!
|
|
489
489
|
* Module dependencies.
|
|
490
490
|
*/function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function i(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function o(t,e){return(o=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function s(t){var e=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(t){return!1}}();return function(){var r,n=u(t);if(e){var i=u(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return a(this,r)}}function a(t,e){if(e&&("object"===n(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function u(t){return(u=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var h=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&o(t,e)}(u,t);var e,r,n,a=s(u);function u(t,e,r){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,u),e=e||"Field `"+t+"` is not in schema and strict mode is set to throw.",(n=a.call(this,e)).isImmutableError=!!r,n.path=t,n}return e=u,r&&i(e.prototype,r),n&&i(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(r(7));Object.defineProperty(h.prototype,"name",{value:"StrictModeError"}),t.exports=h},function(t,e,r){"use strict";
|
|
491
491
|
/*!
|
|
492
492
|
* Module dependencies.
|
|
493
|
-
*/var n=r(
|
|
493
|
+
*/var n=r(8),i=r(55),o=r(33),s=r(4);function a(t,e){if(e&&e.default){var r=e.default;Array.isArray(r)&&0===r.length?e.default=Array:!e.shared&&o(r)&&0===Object.keys(r).length&&(e.default=function(){return{}})}n.call(this,t,e,"Mixed"),this[i.schemaMixedSymbol]=!0}a.schemaName="Mixed",a.defaultOptions={},
|
|
494
494
|
/*!
|
|
495
495
|
* Inherits from SchemaType.
|
|
496
496
|
*/
|
|
@@ -511,7 +511,7 @@ t.exports=a},function(t,e,r){"use strict";
|
|
|
511
511
|
* @inherits Document
|
|
512
512
|
* @api private
|
|
513
513
|
*/
|
|
514
|
-
function a(t,e,r,n,a){o.isMongooseDocumentArray(e)?(this.__parentArray=e,this[s]=e.$parent()):(this.__parentArray=void 0,this[s]=void 0),this.$setIndex(a),this.$__parent=this[s],i.call(this,t,n,this[s],
|
|
514
|
+
function a(t,e,r,n,a){o.isMongooseDocumentArray(e)?(this.__parentArray=e,this[s]=e.$parent()):(this.__parentArray=void 0,this[s]=void 0),this.$setIndex(a),this.$__parent=this[s],i.call(this,t,n,this[s],r,{isNew:!0})}
|
|
515
515
|
/*!
|
|
516
516
|
* Inherit from Subdocument
|
|
517
517
|
*/for(var u in a.prototype=Object.create(i.prototype),a.prototype.constructor=a,Object.defineProperty(a.prototype,"$isSingleNested",{configurable:!1,writable:!1,value:!1}),Object.defineProperty(a.prototype,"$isDocumentArrayElement",{configurable:!1,writable:!1,value:!0}),n.prototype)a[u]=n.prototype[u];
|
|
@@ -600,7 +600,7 @@ var n=r(3),i=n.Buffer;function o(t,e){for(var r in t)e[r]=t[r]}function s(t,e,r)
|
|
|
600
600
|
/*!
|
|
601
601
|
* Module dependencies.
|
|
602
602
|
*/
|
|
603
|
-
function i(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function o(t){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function s(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return a(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return a(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}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 o,s=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return s=t.done,t},e:function(t){u=!0,o=t},f:function(){try{s||null==r.return||r.return()}finally{if(u)throw o}}}}function a(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var u,h=r(12).EventEmitter,f=r(306),c=r(19),l=r(
|
|
603
|
+
function i(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function o(t){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function s(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return a(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return a(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}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 o,s=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return s=t.done,t},e:function(t){u=!0,o=t},f:function(){try{s||null==r.return||r.return()}finally{if(u)throw o}}}}function a(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var u,h=r(12).EventEmitter,f=r(306),c=r(19),l=r(8),d=r(15),p=r(307),y=r(86),m=r(155),b=r(14),v=r(22),g=r(308),w=r(310),_=r(150),M=r(81),S=r(25).get().ReadPreference,O=r(311),A=r(4),E=r(315),x=r(316).middlewareFunctions,k=r(157).middlewareFunctions,j=x.concat(k).reduce((function(t,e){return t.add(e)}),new Set),$=A.isPOJO,P=0;function R(t,e){if(!(this instanceof R))return new R(t,e);if(this.obj=t,this.paths={},this.aliases={},this.subpaths={},this.virtuals={},this.singleNestedPaths={},this.nested={},this.inherits={},this.callQueue=[],this._indexes=[],this.methods={},this.methodOptions={},this.statics={},this.tree={},this.query={},this.childSchemas=[],this.plugins=[],this.$id=++P,this.mapPaths=[],this.s={hooks:new f},this.options=this.defaultOptions(e),Array.isArray(t)){var r,n=s(t);try{for(n.s();!(r=n.n()).done;){var i=r.value;this.add(i)}}catch(t){n.e(t)}finally{n.f()}}else t&&this.add(t);var o=t&&t._id&&A.isObject(t._id);!this.paths._id&&this.options._id&&!o&&m(this),this.setupTimestamp(this.options.timestamps)}
|
|
604
604
|
/*!
|
|
605
605
|
* Create virtual properties with alias field
|
|
606
606
|
*/
|
|
@@ -678,7 +678,7 @@ t.exports=s},function(t,e,r){"use strict";
|
|
|
678
678
|
*/e.String=r(318),e.Number=r(159),e.Boolean=r(321),e.DocumentArray=r(322),e.Subdocument=r(330),e.Array=r(88),e.Buffer=r(332),e.Date=r(334),e.ObjectId=r(337),e.Mixed=r(45),e.Decimal128=e.Decimal=r(339),e.Map=r(341),e.Oid=e.ObjectId,e.Object=e.Mixed,e.Bool=e.Boolean,e.ObjectID=e.ObjectId},function(t,e,r){"use strict";
|
|
679
679
|
/*!
|
|
680
680
|
* Module dependencies.
|
|
681
|
-
*/function n(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return i(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return i(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},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 s,a=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,s=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw s}}}}function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var o,s,a=r(83),u=r(153),h=r(19),f=r(323),c=r(
|
|
681
|
+
*/function n(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return i(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return i(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},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 s,a=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,s=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw s}}}}function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var o,s,a=r(83),u=r(153),h=r(19),f=r(323),c=r(8),l=c.CastError,d=r(45),p=r(324),y=r(325),m=r(164),b=r(9),v=r(4),g=r(56).castToNumber,w=r(165),_=r(57),M=Symbol("mongoose#isNestedArray"),S=Object.freeze({});function O(t,e,n,i){s||(s=r(58).Embedded);var o,a,u="type";if(i&&i.typeKey&&(u=i.typeKey),this.schemaOptions=i,e){var h={};v.isPOJO(e)&&(e[u]?(delete(h=v.clone(e))[u],e=e[u]):e=d),null!=n&&null!=n.ref&&null==h.ref&&(h.ref=n.ref),e===Object&&(e=d);var f="string"==typeof e?e:v.getFunctionName(e),l=r(87),p=l.hasOwnProperty(f)?l[f]:e;if(this.casterConstructor=p,this.casterConstructor instanceof O&&(this.casterConstructor[M]=!0),"function"!=typeof p||p.$isArraySubdocument||p.$isSchemaMap)this.caster=p,this.caster instanceof s||(this.caster.path=t);else{var y=this.caster instanceof s?null:t;this.caster=new p(y,h)}this.$embeddedSchemaType=this.caster}if(this.$isMongooseArray=!0,c.call(this,t,n,"Array"),null!=this.defaultValue&&(o=this.defaultValue,a="function"==typeof o),!("defaultValue"in this)||void 0!==this.defaultValue){var m=function(){return a?o.call(this):null!=o?[].concat(o):[]};m.$runBeforeSetters=!a,this.default(m)}}O.schemaName="Array",O.options={castNonArrays:!0},
|
|
682
682
|
/*!
|
|
683
683
|
* ignore
|
|
684
684
|
*/
|
|
@@ -734,7 +734,7 @@ function w(t,e){var r,i,s,a=null==t?null:t[y]&&t[y].caster&&t[y].caster.options&
|
|
|
734
734
|
/*!
|
|
735
735
|
* ignore
|
|
736
736
|
*/
|
|
737
|
-
function(t,e){if(!e)return!1;var r,i=n(t);try{for(i.s();!(r=i.n()).done;){var s=r.value;if(null==s)return!1;var a=s.constructor;if(!(s instanceof o)||a.modelName!==e&&a.baseModelName!==e)return!1}}catch(t){i.e(t)}finally{i.f()}return!0}(e,a)&&t[d].$populated(t[p],[],(r={},i=m,s=e[0].constructor,i in r?Object.defineProperty(r,i,{value:s,enumerable:!0,configurable:!0,writable:!0}):r[i]=s,r))}for(var _=function(){var t=S[M];if(null==Array.prototype[t])return"continue";g[t]=function(){var e=c.isMongooseArray(this)?this.__array:this,r=[].concat(e);return r[t].apply(r,arguments)}},M=0,S=["filter","flat","flatMap","map","slice"];M<S.length;M++)_();t.exports=g}).call(this,r(3).Buffer)},function(t,e,r){"use strict";var n=r(13),i=r(42),o=r(34).internalToObjectOptions,s=r(53),a=r(
|
|
737
|
+
function(t,e){if(!e)return!1;var r,i=n(t);try{for(i.s();!(r=i.n()).done;){var s=r.value;if(null==s)return!1;var a=s.constructor;if(!(s instanceof o)||a.modelName!==e&&a.baseModelName!==e)return!1}}catch(t){i.e(t)}finally{i.f()}return!0}(e,a)&&t[d].$populated(t[p],[],(r={},i=m,s=e[0].constructor,i in r?Object.defineProperty(r,i,{value:s,enumerable:!0,configurable:!0,writable:!0}):r[i]=s,r))}for(var _=function(){var t=S[M];if(null==Array.prototype[t])return"continue";g[t]=function(){var e=c.isMongooseArray(this)?this.__array:this,r=[].concat(e);return r[t].apply(r,arguments)}},M=0,S=["filter","flat","flatMap","map","slice"];M<S.length;M++)_();t.exports=g}).call(this,r(3).Buffer)},function(t,e,r){"use strict";var n=r(13),i=r(42),o=r(34).internalToObjectOptions,s=r(53),a=r(9),u=r(4);function h(t,e,r,i,o){if(null!=r){var s={isNew:r.isNew};"defaults"in r.$__&&(s.defaults=r.$__.defaults),o=Object.assign(s,o)}null!=o&&null!=o.path&&(this.$basePath=o.path),n.call(this,t,e,i,o),delete this.$__.priorDoc}t.exports=h,h.prototype=Object.create(n.prototype),Object.defineProperty(h.prototype,"$isSubdocument",{configurable:!1,writable:!1,value:!0}),Object.defineProperty(h.prototype,"$isSingleNested",{configurable:!1,writable:!1,value:!0}),
|
|
738
738
|
/*!
|
|
739
739
|
* ignore
|
|
740
740
|
*/
|
|
@@ -816,7 +816,7 @@ var n=r(43),i=r(284),o={_promise:null,get:function(){return o._promise},set:func
|
|
|
816
816
|
o.set(e.Promise),t.exports=o}).call(this,r(6))},function(t,e,r){"use strict";(function(t,r,n,i){function o(t){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}e.isNode=void 0!==t&&"object"==o(r)&&"object"==(void 0===n?"undefined":o(n))&&"function"==typeof i&&t.argv,e.isMongo=!e.isNode&&"function"==typeof printjson&&"function"==typeof ObjectId&&"function"==typeof rs&&"function"==typeof sh,e.isBrowser=!e.isNode&&!e.isMongo&&"undefined"!=typeof window,e.type=e.isNode?"node":e.isMongo?"mongo":e.isBrowser?"browser":"unknown"}).call(this,r(5),r(24)(t),r(6),r(3).Buffer)},function(t,e,r){"use strict";t.exports=function(t,e,r){for(var n={},i=0,o=Object.keys(e.tree);i<o.length;i++){var s=o[i];r&&(t.paths[s]||t.nested[s]||t.singleNestedPaths[s])||(n[s]=e.tree[s])}for(var a in t.add(n),t.callQueue=t.callQueue.concat(e.callQueue),t.method(e.methods),t.static(e.statics),e.query)t.query[a]=e.query[a];for(var u in e.virtuals)t.virtuals[u]=e.virtuals[u].clone();t.s.hooks.merge(e.s.hooks,!1)}},function(t,e,r){"use strict";
|
|
817
817
|
/*!
|
|
818
818
|
* Module requirements
|
|
819
|
-
*/function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function i(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function o(t,e){return(o=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function s(t){var e=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(t){return!1}}();return function(){var r,n=u(t);if(e){var i=u(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return a(this,r)}}function a(t,e){if(e&&("object"===n(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function u(t){return(u=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var h=r(19),f=r(22),c=r(
|
|
819
|
+
*/function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function i(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function o(t,e){return(o=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function s(t){var e=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(t){return!1}}();return function(){var r,n=u(t);if(e){var i=u(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return a(this,r)}}function a(t,e){if(e&&("object"===n(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function u(t){return(u=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var h=r(19),f=r(22),c=r(9),l=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&o(t,e)}(u,t);var e,r,n,a=s(u);function u(t){var e,r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,u),r="model"===f(t)?t.constructor.modelName+" validation failed":"Validation failed",(e=a.call(this,r)).errors={},e._message=r,t&&(t.$errors=e.errors),e}return e=u,(r=[{key:"toString",value:function(){return this.name+": "+d(this)}
|
|
820
820
|
/*!
|
|
821
821
|
* inspect helper
|
|
822
822
|
*/},{key:"inspect",value:function(){return Object.assign(new Error(this.message),this)}
|
|
@@ -897,7 +897,7 @@ o.middlewareFunctions=["deleteOne","save","validate","remove","updateOne","init"
|
|
|
897
897
|
*/t.exports=function(t,e){if(null==t)return t;if(t._id&&"string"==typeof t._id)return t._id;if(t.toString&&t.toString!==Object.prototype.toString&&!Array.isArray(t))return t.toString();throw new n("string",t,e)}},function(t,e,r){"use strict";
|
|
898
898
|
/*!
|
|
899
899
|
* Module requirements.
|
|
900
|
-
*/var n=r(7),i=r(320),o=r(
|
|
900
|
+
*/var n=r(7),i=r(320),o=r(8),s=r(160),a=r(161),u=r(4),h=o.CastError;function f(t,e){o.call(this,t,e,"Number")}
|
|
901
901
|
/*!
|
|
902
902
|
* ignore
|
|
903
903
|
*/
|
|
@@ -980,7 +980,7 @@ o.mixin={_subtype:void 0,_markModified:function(){var t=this[a];return t&&t.mark
|
|
|
980
980
|
/*!
|
|
981
981
|
* Module exports.
|
|
982
982
|
*/
|
|
983
|
-
o.Binary=n,t.exports=o}).call(this,r(3).Buffer)},function(t,e,r){"use strict";var n=r(25).get().ObjectId;t.exports=function(t){if(null==t)return t;if(t instanceof n)return t;if(t._id){if(t._id instanceof n)return t._id;if(t._id.toString instanceof Function)return new n(t._id.toString())}return t.toString instanceof Function?new n(t.toString()):new n(t)}},function(t,e,r){"use strict";function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function i(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return o(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return o(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}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 s,a=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,s=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw s}}}}function o(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function s(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function a(){return(a="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=u(t,e);if(n){var i=Object.getOwnPropertyDescriptor(n,e);return i.get?i.get.call(arguments.length<3?t:r):i.value}}).apply(this,arguments)}function u(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=p(t)););return t}function h(t,e){if(e&&("object"===n(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function f(t){var e="function"==typeof Map?new Map:void 0;return(f=function(t){if(null===t||(r=t,-1===Function.toString.call(r).indexOf("[native code]")))return t;var r;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,n)}function n(){return c(t,arguments,p(this).constructor)}return n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),d(n,t)})(t)}function c(t,e,r){return(c=l()?Reflect.construct:function(t,e,r){var n=[null];n.push.apply(n,e);var i=new(Function.bind.apply(t,n));return r&&d(i,r.prototype),i}).apply(null,arguments)}function l(){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(t){return!1}}function d(t,e){return(d=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function p(t){return(p=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var y=r(45),m=r(18),b=r(41),v=r(4).deepEqual,g=r(22),w=r(171),_=r(
|
|
983
|
+
o.Binary=n,t.exports=o}).call(this,r(3).Buffer)},function(t,e,r){"use strict";var n=r(25).get().ObjectId;t.exports=function(t){if(null==t)return t;if(t instanceof n)return t;if(t._id){if(t._id instanceof n)return t._id;if(t._id.toString instanceof Function)return new n(t._id.toString())}return t.toString instanceof Function?new n(t.toString()):new n(t)}},function(t,e,r){"use strict";function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function i(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return o(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return o(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}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 s,a=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,s=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw s}}}}function o(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function s(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function a(){return(a="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=u(t,e);if(n){var i=Object.getOwnPropertyDescriptor(n,e);return i.get?i.get.call(arguments.length<3?t:r):i.value}}).apply(this,arguments)}function u(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=p(t)););return t}function h(t,e){if(e&&("object"===n(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function f(t){var e="function"==typeof Map?new Map:void 0;return(f=function(t){if(null===t||(r=t,-1===Function.toString.call(r).indexOf("[native code]")))return t;var r;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,n)}function n(){return c(t,arguments,p(this).constructor)}return n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),d(n,t)})(t)}function c(t,e,r){return(c=l()?Reflect.construct:function(t,e,r){var n=[null];n.push.apply(n,e);var i=new(Function.bind.apply(t,n));return r&&d(i,r.prototype),i}).apply(null,arguments)}function l(){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(t){return!1}}function d(t,e){return(d=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function p(t){return(p=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var y=r(45),m=r(18),b=r(41),v=r(4).deepEqual,g=r(22),w=r(171),_=r(9),M=r(82),S=r(1).populateModelSymbol,O=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&d(t,e)}(c,t);var e,r,n,o,u,f=(e=c,r=l(),function(){var t,n=p(e);if(r){var i=p(this).constructor;t=Reflect.construct(n,arguments,i)}else t=n.apply(this,arguments);return h(this,t)});function c(t,e,r,n){var i;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,c),"Object"===g(t)&&(t=Object.keys(t).reduce((function(e,r){return e.concat([[r,t[r]]])}),[])),(i=f.call(this,t)).$__parent=null!=r&&null!=r.$__?r:null,i.$__path=e,i.$__schemaType=null==n?new y(e):n,i.$__runDeferred(),i}return n=c,(o=[{key:"$init",value:function(t,e){A(t),a(p(c.prototype),"set",this).call(this,t,e),null!=e&&e.$isSingleNested&&(e.$basePath=this.$__path+"."+t)}},{key:"$__set",value:function(t,e){a(p(c.prototype),"set",this).call(this,t,e)}},{key:"get",value:function(t,e){return t instanceof m&&(t=t.toString()),!1===(e=e||{}).getters?a(p(c.prototype),"get",this).call(this,t):this.$__schemaType.applyGetters(a(p(c.prototype),"get",this).call(this,t),this.$__parent)}},{key:"set",value:function(t,e){if(t instanceof m&&(t=t.toString()),A(t),e=w(e),null==this.$__schemaType)return this.$__deferred=this.$__deferred||[],void this.$__deferred.push({key:t,value:e});var r=this.$__path+"."+t,n=null!=this.$__parent&&this.$__parent.$__?this.$__parent.$populated(r)||this.$__parent.$populated(this.$__path):null,i=this.get(t);if(null!=n)null==e.$__&&(e=new n.options[S](e)),e.$__.wasPopulated={value:n.value};else try{e=this.$__schemaType.applySetters(e,this.$__parent,!1,this.get(t),{path:r})}catch(t){if(null!=this.$__parent&&null!=this.$__parent.$__)return void this.$__parent.invalidate(r,t);throw t}a(p(c.prototype),"set",this).call(this,t,e),null!=e&&e.$isSingleNested&&(e.$basePath=this.$__path+"."+t);var o=this.$__parent;null==o||null==o.$__||v(e,i)||o.markModified(this.$__path+"."+t)}},{key:"clear",value:function(){a(p(c.prototype),"clear",this).call(this);var t=this.$__parent;null!=t&&t.markModified(this.$__path)}},{key:"delete",value:function(t){t instanceof m&&(t=t.toString()),this.set(t,void 0),a(p(c.prototype),"delete",this).call(this,t)}},{key:"toBSON",value:function(){return new Map(this)}},{key:"toObject",value:function(t){if(t&&t.flattenMaps){var e,r={},n=i(this.keys());try{for(n.s();!(e=n.n()).done;){var o=e.value;r[o]=b(this.get(o),t)}}catch(t){n.e(t)}finally{n.f()}return r}return new Map(this)}},{key:"$toObject",value:function(){return this.constructor.prototype.toObject.apply(this,arguments)}},{key:"toJSON",value:function(t){if("boolean"!=typeof(t&&t.flattenMaps)||t.flattenMaps){var e,r={},n=i(this.keys());try{for(n.s();!(e=n.n()).done;){var o=e.value;r[o]=b(this.get(o),t)}}catch(t){n.e(t)}finally{n.f()}return r}return new Map(this)}},{key:"inspect",value:function(){return new Map(this)}},{key:"$__runDeferred",value:function(){if(this.$__deferred){var t,e=i(this.$__deferred);try{for(e.s();!(t=e.n()).done;){var r=t.value;this.set(r.key,r.value)}}catch(t){e.e(t)}finally{e.f()}this.$__deferred=null}}}])&&s(n.prototype,o),u&&s(n,u),Object.defineProperty(n,"prototype",{writable:!1}),c}(f(Map));
|
|
984
984
|
/*!
|
|
985
985
|
* Since maps are stored as objects under the hood, keys must be strings
|
|
986
986
|
* and can't contain any invalid characters
|
|
@@ -992,7 +992,7 @@ function A(t){var e=n(t);if("string"!==e)throw new TypeError("Mongoose maps only
|
|
|
992
992
|
t.exports=function(t,e,r,i,f){if(!r||!r.instanceOfSchema)throw new Error("You must pass a valid discriminator Schema");if(t.schema.discriminatorMapping&&!t.schema.discriminatorMapping.isRoot)throw new Error('Discriminator "'+e+'" can only be a discriminator of the root model');if(f){var c=a(t.base,"options.applyPluginsToDiscriminators",!1);t.base._applyPlugins(r,{skipTopLevel:!c})}var l=t.schema.options.discriminatorKey,d=t.schema.path(l);if(null!=d)u.hasUserDefinedProperty(d.options,"select")||(d.options.select=!0),d.options.$skipDiscriminatorCheck=!0;else{var p={};p[l]={default:void 0,select:!0,$skipDiscriminatorCheck:!0},p[l][t.schema.options.typeKey]=String,t.schema.add(p),s({prop:l,prototype:t.prototype,options:t.schema.options})}if(r.path(l)&&!0!==r.path(l).options.$skipDiscriminatorCheck)throw new Error('Discriminator "'+e+'" cannot have field with name "'+l+'"');var y=e;if(("string"==typeof i&&i.length||null!=i)&&(y=i),function(e,r){e._baseSchema=r,r.paths._id&&r.paths._id.options&&!r.paths._id.options.auto&&e.remove("_id");for(var i=[],s=0,a=Object.keys(r.paths);s<a.length;s++){var f=a[s];if(e.nested[f])i.push(f);else if(-1!==f.indexOf(".")){var c,p="",m=n(f.split(".").slice(0,-1));try{for(m.s();!(c=m.n()).done;){var b=c.value;p+=(p.length?".":"")+b,(e.paths[p]instanceof o||e.singleNestedPaths[p]instanceof o)&&i.push(f)}}catch(t){m.e(t)}finally{m.f()}}}u.merge(e,r,{isDiscriminatorSchemaMerge:!0,omit:{discriminators:!0,base:!0},omitNested:i.reduce((function(t,e){return t["tree."+e]=!0,t}),{})});for(var v=0,g=i;v<g.length;v++){var w=g[v];delete e.paths[w]}e.childSchemas.forEach((function(t){t.model.prototype.$__setSchema(t.schema)}));var _={};_[l]={default:y,select:!0,set:function(t){if(t===y||Array.isArray(y)&&u.deepEqual(t,y))return y;throw new Error("Can't set discriminator key \""+l+'"')},$skipDiscriminatorCheck:!0},_[l][e.options.typeKey]=d?d.options[e.options.typeKey]:String,e.add(_),e.discriminatorMapping={key:l,value:y,isRoot:!1},r.options.collection&&(e.options.collection=r.options.collection);var M=e.options.toJSON,S=e.options.toObject,O=e.options._id,A=e.options.id,E=Object.keys(e.options);e.options.discriminatorKey=r.options.discriminatorKey;for(var x=0,k=E;x<k.length;x++){var j=k[x];if(!h[j]){if("pluralization"===j&&1==e.options[j]&&null==r.options[j])continue;if(!u.deepEqual(e.options[j],r.options[j]))throw new Error("Can't customize discriminator option "+j+" (can only modify "+Object.keys(h).join(", ")+")")}}e.options=u.clone(r.options),M&&(e.options.toJSON=M),S&&(e.options.toObject=S),void 0!==O&&(e.options._id=O),e.options.id=A,e.s.hooks=t.schema.s.hooks.merge(e.s.hooks),e.plugins=Array.prototype.slice.call(r.plugins),e.callQueue=r.callQueue.concat(e.callQueue),delete e._requiredpaths}(r,t.schema),t.discriminators||(t.discriminators={}),t.schema.discriminatorMapping||(t.schema.discriminatorMapping={key:l,value:null,isRoot:!0}),t.schema.discriminators||(t.schema.discriminators={}),t.schema.discriminators[e]=r,t.discriminators[e]&&!r.options.overwriteModels)throw new Error('Discriminator with name "'+e+'" already exists');return r}},function(t,e,r){"use strict";var n=r(155);t.exports=function(t,e){return null==e||null==e._id||(t=t.clone(),e._id?t.paths._id||(n(t),t.options._id=!0):(t.remove("_id"),t.options._id=!1)),t}},function(t,e,r){"use strict";var n=r(57);
|
|
993
993
|
/*!
|
|
994
994
|
* Find the correct constructor, taking into account discriminators
|
|
995
|
-
*/t.exports=function(t,e){var r=t.schema.options.discriminatorKey;if(null!=e&&t.discriminators&&null!=e[r])if(t.discriminators[e[r]])t=t.discriminators[e[r]];else{var i=n(t.discriminators,e[r]);i&&(t=i)}return t}},function(t,e,r){"use strict";t.exports=r(176)},function(t,e,r){"use strict";(function(n){function i(t){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function s(t,e){return(s=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function a(t){var e=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(t){return!1}}();return function(){var r,n=h(t);if(e){var i=h(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return u(this,r)}}function u(t,e){if(e&&("object"===i(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function h(t){return(h=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}r(25).set(r(179));var f=r(274),c=r(148);f.setBrowser(!0),Object.defineProperty(e,"Promise",{get:function(){return c.get()},set:function(t){c.set(t)}}),e.PromiseProvider=c,e.Error=r(7),e.Schema=r(85),e.Types=r(58),e.VirtualType=r(86),e.SchemaType=r(
|
|
995
|
+
*/t.exports=function(t,e){var r=t.schema.options.discriminatorKey;if(null!=e&&t.discriminators&&null!=e[r])if(t.discriminators[e[r]])t=t.discriminators[e[r]];else{var i=n(t.discriminators,e[r]);i&&(t=i)}return t}},function(t,e,r){"use strict";t.exports=r(176)},function(t,e,r){"use strict";(function(n){function i(t){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function s(t,e){return(s=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function a(t){var e=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(t){return!1}}();return function(){var r,n=h(t);if(e){var i=h(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return u(this,r)}}function u(t,e){if(e&&("object"===i(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function h(t){return(h=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}r(25).set(r(179));var f=r(274),c=r(148);f.setBrowser(!0),Object.defineProperty(e,"Promise",{get:function(){return c.get()},set:function(t){c.set(t)}}),e.PromiseProvider=c,e.Error=r(7),e.Schema=r(85),e.Types=r(58),e.VirtualType=r(86),e.SchemaType=r(8),e.utils=r(4),e.Document=f(),e.model=function(t,r){var n=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&s(t,e)}(h,t);var e,n,i,u=a(h);function h(t,e){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,h),u.call(this,t,r,e)}return e=h,n&&o(e.prototype,n),i&&o(e,i),Object.defineProperty(e,"prototype",{writable:!1}),e}(e.Document);return n.modelName=t,n},
|
|
996
996
|
/*!
|
|
997
997
|
* Module exports.
|
|
998
998
|
*/
|
|
@@ -1135,7 +1135,7 @@ function t(e,r,n,i,o,s){for(var a,u=0;u<e.length&&u<r.length;++u)a=e[u],Array.is
|
|
|
1135
1135
|
object-assign
|
|
1136
1136
|
(c) Sindre Sorhus
|
|
1137
1137
|
@license MIT
|
|
1138
|
-
*/var n=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable;function s(t){if(null==t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}t.exports=function(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var e={},r=0;r<10;r++)e["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(e).map((function(t){return e[t]})).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach((function(t){n[t]=t})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(t){return!1}}()?Object.assign:function(t,e){for(var r,a,u=s(t),h=1;h<arguments.length;h++){for(var f in r=Object(arguments[h]))i.call(r,f)&&(u[f]=r[f]);if(n){a=n(r);for(var c=0;c<a.length;c++)o.call(r,a[c])&&(u[a[c]]=r[a[c]])}}return u}},function(t,e){function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}t.exports=function(t){return t&&"object"===r(t)&&"function"==typeof t.copy&&"function"==typeof t.fill&&"function"==typeof t.readUInt8}},function(t,e){"function"==typeof Object.create?t.exports=function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:t.exports=function(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}},function(t,e,r){"use strict";function n(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return i(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return i(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},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 s,a=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,s=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw s}}}}function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function o(t){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var s=r(43),a=r(
|
|
1138
|
+
*/var n=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable;function s(t){if(null==t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}t.exports=function(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var e={},r=0;r<10;r++)e["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(e).map((function(t){return e[t]})).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach((function(t){n[t]=t})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(t){return!1}}()?Object.assign:function(t,e){for(var r,a,u=s(t),h=1;h<arguments.length;h++){for(var f in r=Object(arguments[h]))i.call(r,f)&&(u[f]=r[f]);if(n){a=n(r);for(var c=0;c<a.length;c++)o.call(r,a[c])&&(u[a[c]]=r[a[c]])}}return u}},function(t,e){function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}t.exports=function(t){return t&&"object"===r(t)&&"function"==typeof t.copy&&"function"==typeof t.fill&&"function"==typeof t.readUInt8}},function(t,e){"function"==typeof Object.create?t.exports=function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:t.exports=function(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}},function(t,e,r){"use strict";function n(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return i(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return i(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},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 s,a=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,s=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw s}}}}function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function o(t){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var s=r(43),a=r(9),u=r(285),h=r(286)("mquery");function f(t,e){if(!(this instanceof f))return new f(t,e);var r=this.constructor.prototype;this.op=r.op||void 0,this.options=Object.assign({},r.options),this._conditions=r._conditions?u.clone(r._conditions):{},this._fields=r._fields?u.clone(r._fields):void 0,this._update=r._update?u.clone(r._update):void 0,this._path=r._path||void 0,this._distinct=r._distinct||void 0,this._collection=r._collection||void 0,this._traceFunction=r._traceFunction||void 0,e&&this.setOptions(e),t&&(t.find&&t.remove&&t.update?this.collection(t):this.find(t))}var c="$geoWithin";Object.defineProperty(f,"use$geoWithin",{get:function(){return"$geoWithin"==c},set:function(t){c=!0===t?"$geoWithin":"$within"}}),f.prototype.toConstructor=function(){function t(e,r){if(!(this instanceof t))return new t(e,r);f.call(this,e,r)}u.inherits(t,f);var e=t.prototype;return e.options={},e.setOptions(this.options),e.op=this.op,e._conditions=u.clone(this._conditions),e._fields=u.clone(this._fields),e._update=u.clone(this._update),e._path=this._path,e._distinct=this._distinct,e._collection=this._collection,e._traceFunction=this._traceFunction,t},f.prototype.setOptions=function(t){if(!t||!u.isObject(t))return this;for(var e,r=u.keys(t),n=0;n<r.length;++n)if("function"==typeof this[e=r[n]]){var i=Array.isArray(t[e])?t[e]:[t[e]];this[e].apply(this,i)}else this.options[e]=t[e];return this},f.prototype.collection=function(t){return this._collection=new f.Collection(t),this},f.prototype.collation=function(t){return this.options.collation=t,this},f.prototype.$where=function(t){return this._conditions.$where=t,this},f.prototype.where=function(){if(!arguments.length)return this;this.op||(this.op="find");var t=o(arguments[0]);if("string"==t)return this._path=arguments[0],2===arguments.length&&(this._conditions[this._path]=arguments[1]),this;if("object"==t&&!Array.isArray(arguments[0]))return this.merge(arguments[0]);throw new TypeError("path must be a string or object")},f.prototype.equals=function(t){this._ensurePath("equals");var e=this._path;return this._conditions[e]=t,this},f.prototype.eq=function(t){this._ensurePath("eq");var e=this._path;return this._conditions[e]=t,this},f.prototype.or=function(t){var e=this._conditions.$or||(this._conditions.$or=[]);return Array.isArray(t)||(t=[t]),e.push.apply(e,t),this},f.prototype.nor=function(t){var e=this._conditions.$nor||(this._conditions.$nor=[]);return Array.isArray(t)||(t=[t]),e.push.apply(e,t),this},f.prototype.and=function(t){var e=this._conditions.$and||(this._conditions.$and=[]);return Array.isArray(t)||(t=[t]),e.push.apply(e,t),this},
|
|
1139
1139
|
/*!
|
|
1140
1140
|
* gt, gte, lt, lte, ne, in, nin, all, regex, size, maxDistance
|
|
1141
1141
|
*
|
|
@@ -1175,7 +1175,7 @@ var i=["__proto__","constructor","prototype"],o=e.clone=function r(n,i){if(null=
|
|
|
1175
1175
|
e.cloneObject=function(t,e){var r,n=e&&e.minimize,s={},a=Object.keys(t),u=a.length,h=!1,f="",c=0;for(c=0;c<u;++c)f=a[c],-1===i.indexOf(f)&&(r=o(t[f],e),n&&void 0===r||(h||(h=!0),s[f]=r));return n?h&&s:s},e.cloneArray=function(t,e){for(var r=[],n=t.length,i=0;i<n;i++)r.push(o(t[i],e));return r},e.tick=function(t){if("function"==typeof t)return function(){var e=arguments;u((function(){t.apply(this,e)}))}},e.merge=function t(r,n){for(var o=0,s=Object.keys(n);o<s.length;o++){var a=s[o];-1===i.indexOf(a)&&(void 0===r[a]?r[a]=n[a]:e.isObject(n[a])?t(r[a],n[a]):r[a]=n[a])}},e.mergeClone=function t(r,n){for(var s=0,a=Object.keys(n);s<a.length;s++){var u=a[s];-1===i.indexOf(u)&&(void 0===r[u]?r[u]=o(n[u]):e.isObject(n[u])?t(r[u],n[u]):r[u]=o(n[u]))}},e.readPref=function(t){switch(t){case"p":t="primary";break;case"pp":t="primaryPreferred";break;case"s":t="secondary";break;case"sp":t="secondaryPreferred";break;case"n":t="nearest"}return t},e.readConcern=function(t){if("string"==typeof t){switch(t){case"l":t="local";break;case"a":t="available";break;case"m":t="majority";break;case"lz":t="linearizable";break;case"s":t="snapshot"}t={level:t}}return t};var s=Object.prototype.toString;e.toString=function(t){return s.call(t)};var a=e.isObject=function(t){return"[object Object]"==e.toString(t)};e.keys=Object.keys,e.create="function"==typeof Object.create?Object.create:function(t){if(arguments.length>1)throw new Error("Adding properties is not supported");function e(){}return e.prototype=t,new e},e.inherits=function(t,r){t.prototype=e.create(r.prototype),t.prototype.constructor=t};var u=e.soon="function"==typeof r?r:n.nextTick;e.isArgumentsObject=function(t){return"[object Arguments]"===Object.prototype.toString.call(t)}}).call(this,r(3).Buffer,r(108).setImmediate,r(5))},function(t,e,r){(function(n){var i;e.formatArgs=function(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+t.exports.humanize(this.diff),!this.useColors)return;var r="color: "+this.color;e.splice(1,0,r,"color: inherit");var n=0,i=0;e[0].replace(/%[a-zA-Z%]/g,(function(t){"%%"!==t&&(n++,"%c"===t&&(i=n))})),e.splice(i,0,r)},e.save=function(t){try{t?e.storage.setItem("debug",t):e.storage.removeItem("debug")}catch(t){}},e.load=function(){var t;try{t=e.storage.getItem("debug")}catch(t){}!t&&void 0!==n&&"env"in n&&(t=n.env.DEBUG);return t},e.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},e.storage=function(){try{return localStorage}catch(t){}}(),e.destroy=(i=!1,function(){i||(i=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}),e.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],e.log=console.debug||console.log||function(){},t.exports=r(287)(e),t.exports.formatters.j=function(t){try{return JSON.stringify(t)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}}).call(this,r(5))},function(t,e,r){function n(t){return function(t){if(Array.isArray(t))return i(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return i(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return i(t,e)}(t)||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 i(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}t.exports=function(t){function e(t){var r,n,o,s=null;function a(){for(var t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];if(a.enabled){var o=a,s=Number(new Date),u=s-(r||s);o.diff=u,o.prev=r,o.curr=s,r=s,n[0]=e.coerce(n[0]),"string"!=typeof n[0]&&n.unshift("%O");var h=0;n[0]=n[0].replace(/%([a-zA-Z%])/g,(function(t,r){if("%%"===t)return"%";h++;var i=e.formatters[r];if("function"==typeof i){var s=n[h];t=i.call(o,s),n.splice(h,1),h--}return t})),e.formatArgs.call(o,n);var f=o.log||e.log;f.apply(o,n)}}return a.namespace=t,a.useColors=e.useColors(),a.color=e.selectColor(t),a.extend=i,a.destroy=e.destroy,Object.defineProperty(a,"enabled",{enumerable:!0,configurable:!1,get:function(){return null!==s?s:(n!==e.namespaces&&(n=e.namespaces,o=e.enabled(t)),o)},set:function(t){s=t}}),"function"==typeof e.init&&e.init(a),a}function i(t,r){var n=e(this.namespace+(void 0===r?":":r)+t);return n.log=this.log,n}function o(t){return t.toString().substring(2,t.toString().length-2).replace(/\.\*\?$/,"*")}return e.debug=e,e.default=e,e.coerce=function(t){if(t instanceof Error)return t.stack||t.message;return t},e.disable=function(){var t=[].concat(n(e.names.map(o)),n(e.skips.map(o).map((function(t){return"-"+t})))).join(",");return e.enable(""),t},e.enable=function(t){var r;e.save(t),e.namespaces=t,e.names=[],e.skips=[];var n=("string"==typeof t?t:"").split(/[\s,]+/),i=n.length;for(r=0;r<i;r++)n[r]&&("-"===(t=n[r].replace(/\*/g,".*?"))[0]?e.skips.push(new RegExp("^"+t.substr(1)+"$")):e.names.push(new RegExp("^"+t+"$")))},e.enabled=function(t){if("*"===t[t.length-1])return!0;var r,n;for(r=0,n=e.skips.length;r<n;r++)if(e.skips[r].test(t))return!1;for(r=0,n=e.names.length;r<n;r++)if(e.names[r].test(t))return!0;return!1},e.humanize=r(143),e.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(t).forEach((function(r){e[r]=t[r]})),e.names=[],e.skips=[],e.formatters={},e.selectColor=function(t){for(var r=0,n=0;n<t.length;n++)r=(r<<5)-r+t.charCodeAt(n),r|=0;return e.colors[Math.abs(r)%e.colors.length]},e.enable(e.load()),e}},function(t,e,r){"use strict";var n=e;n.distinct=function(t){return t._fields&&Object.keys(t._fields).length>0?"field selection and slice":(Object.keys(n.distinct).every((function(r){return!t.options[r]||(e=r,!1)})),e);var e},n.distinct.select=n.distinct.slice=n.distinct.sort=n.distinct.limit=n.distinct.skip=n.distinct.batchSize=n.distinct.comment=n.distinct.maxScan=n.distinct.snapshot=n.distinct.hint=n.distinct.tailable=!0,n.findOneAndUpdate=n.findOneAndRemove=function(t){var e;return Object.keys(n.findOneAndUpdate).every((function(r){return!t.options[r]||(e=r,!1)})),e},n.findOneAndUpdate.limit=n.findOneAndUpdate.skip=n.findOneAndUpdate.batchSize=n.findOneAndUpdate.maxScan=n.findOneAndUpdate.snapshot=n.findOneAndUpdate.hint=n.findOneAndUpdate.tailable=n.findOneAndUpdate.comment=!0,n.count=function(t){return t._fields&&Object.keys(t._fields).length>0?"field selection and slice":(Object.keys(n.count).every((function(r){return!t.options[r]||(e=r,!1)})),e);var e},n.count.slice=n.count.batchSize=n.count.comment=n.count.maxScan=n.count.snapshot=n.count.tailable=!0},function(t,e,r){"use strict";var n=r(149);if("unknown"==n.type)throw new Error("Unknown environment");t.exports=n.isNode?r(290):(n.isMongo,r(54))},function(t,e,r){"use strict";function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function i(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function o(t,e){return(o=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function s(t){var e=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(t){return!1}}();return function(){var r,n=u(t);if(e){var i=u(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return a(this,r)}}function a(t,e){if(e&&("object"===n(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function u(t){return(u=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var h=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&o(t,e)}(u,t);var e,r,n,a=s(u);function u(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,u),(e=a.call(this)).collection=t,e.collectionName=t.collectionName,e}return e=u,(r=[{key:"find",value:function(t,e,r){var n=this.collection.find(t,e);try{n.toArray(r)}catch(t){r(t)}}},{key:"findOne",value:function(t,e,r){this.collection.findOne(t,e,r)}},{key:"count",value:function(t,e,r){this.collection.count(t,e,r)}},{key:"distinct",value:function(t,e,r,n){this.collection.distinct(t,e,r,n)}},{key:"update",value:function(t,e,r,n){this.collection.update(t,e,r,n)}},{key:"updateMany",value:function(t,e,r,n){this.collection.updateMany(t,e,r,n)}},{key:"updateOne",value:function(t,e,r,n){this.collection.updateOne(t,e,r,n)}},{key:"replaceOne",value:function(t,e,r,n){this.collection.replaceOne(t,e,r,n)}},{key:"deleteOne",value:function(t,e,r){this.collection.deleteOne(t,e,r)}},{key:"deleteMany",value:function(t,e,r){this.collection.deleteMany(t,e,r)}},{key:"remove",value:function(t,e,r){this.collection.remove(t,e,r)}},{key:"findOneAndDelete",value:function(t,e,r){this.collection.findOneAndDelete(t,e,r)}},{key:"findOneAndUpdate",value:function(t,e,r,n){this.collection.findOneAndUpdate(t,e,r,n)}},{key:"findCursor",value:function(t,e){return this.collection.find(t,e)}}])&&i(e.prototype,r),n&&i(e,n),Object.defineProperty(e,"prototype",{writable:!1}),u}(r(54));t.exports=h},function(t,e,r){"use strict";var n=t.exports={};n.DocumentNotFoundError=null,n.general={},n.general.default="Validator failed for path `{PATH}` with value `{VALUE}`",n.general.required="Path `{PATH}` is required.",n.Number={},n.Number.min="Path `{PATH}` ({VALUE}) is less than minimum allowed value ({MIN}).",n.Number.max="Path `{PATH}` ({VALUE}) is more than maximum allowed value ({MAX}).",n.Number.enum="`{VALUE}` is not a valid enum value for path `{PATH}`.",n.Date={},n.Date.min="Path `{PATH}` ({VALUE}) is before minimum allowed value ({MIN}).",n.Date.max="Path `{PATH}` ({VALUE}) is after maximum allowed value ({MAX}).",n.String={},n.String.enum="`{VALUE}` is not a valid enum value for path `{PATH}`.",n.String.match="Path `{PATH}` is invalid ({VALUE}).",n.String.minlength="Path `{PATH}` (`{VALUE}`) is shorter than the minimum allowed length ({MINLENGTH}).",n.String.maxlength="Path `{PATH}` (`{VALUE}`) is longer than the maximum allowed length ({MAXLENGTH})."},function(t,e,r){"use strict";
|
|
1176
1176
|
/*!
|
|
1177
1177
|
* Module dependencies.
|
|
1178
|
-
*/function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function i(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function o(t,e){return(o=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function s(t){var e=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(t){return!1}}();return function(){var r,n=u(t);if(e){var i=u(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return a(this,r)}}function a(t,e){if(e&&("object"===n(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function u(t){return(u=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var h=r(7),f=r(
|
|
1178
|
+
*/function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function i(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function o(t,e){return(o=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function s(t){var e=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(t){return!1}}();return function(){var r,n=u(t);if(e){var i=u(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return a(this,r)}}function a(t,e){if(e&&("object"===n(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function u(t){return(u=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var h=r(7),f=r(9),c=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&o(t,e)}(u,t);var e,r,n,a=s(u);
|
|
1179
1179
|
/*!
|
|
1180
1180
|
* OverwriteModel Error constructor.
|
|
1181
1181
|
*/function u(t,e,r,n){var i,o;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,u);var s=h.messages;return o=null!=s.DocumentNotFoundError?"function"==typeof s.DocumentNotFoundError?s.DocumentNotFoundError(t,e):s.DocumentNotFoundError:'No document found for query "'+f.inspect(t)+'" on model "'+e+'"',(i=a.call(this,o)).result=n,i.numAffected=r,i.filter=t,i.query=t,i}return e=u,r&&i(e.prototype,r),n&&i(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(h);Object.defineProperty(c.prototype,"name",{value:"DocumentNotFoundError"}),
|
|
@@ -1235,7 +1235,7 @@ t.exports=h},function(t,e,r){"use strict";
|
|
|
1235
1235
|
t.exports=h},function(t,e,r){"use strict";var n=r(44);
|
|
1236
1236
|
/*!
|
|
1237
1237
|
* ignore
|
|
1238
|
-
*/t.exports=function(t){var e,r;t.$immutable?(t.$immutableSetter=(e=t.path,r=t.options.immutable,function(t){if(null==this||null==this.$__)return t;if(this.isNew)return t;if(!("function"==typeof r?r.call(this,this):r))return t;var i=null!=this.$__.priorDoc?this.$__.priorDoc.$__getValue(e):this.$__getValue(e);if("throw"===this.$__.strictMode&&t!==i)throw new n(e,"Path `"+e+"` is immutable and strict mode is set to throw.",!0);return i}),t.set(t.$immutableSetter)):t.$immutableSetter&&(t.setters=t.setters.filter((function(e){return e!==t.$immutableSetter})),delete t.$immutableSetter)}},function(t,e,r){"use strict";var
|
|
1238
|
+
*/t.exports=function(t){var e,r;t.$immutable?(t.$immutableSetter=(e=t.path,r=t.options.immutable,function(t){if(null==this||null==this.$__)return t;if(this.isNew)return t;if(!("function"==typeof r?r.call(this,this):r))return t;var i=null!=this.$__.priorDoc?this.$__.priorDoc.$__getValue(e):this.$__getValue(e);if("throw"===this.$__.strictMode&&t!==i)throw new n(e,"Path `"+e+"` is immutable and strict mode is set to throw.",!0);return i}),t.set(t.$immutableSetter)):t.$immutableSetter&&(t.setters=t.setters.filter((function(e){return e!==t.$immutableSetter})),delete t.$immutableSetter)}},function(t,e,r){"use strict";function n(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(t){return void r(t)}a.done?e(u):Promise.resolve(u).then(n,i)}function i(t){return function(){var e=this,r=arguments;return new Promise((function(i,o){var s=t.apply(e,r);function a(t){n(s,i,o,a,u,"next",t)}function u(t){n(s,i,o,a,u,"throw",t)}a(void 0)}))}}var o=Object.getPrototypeOf(i(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:case"end":return t.stop()}}),t)}))));t.exports=function(t){return"function"==typeof t&&Object.getPrototypeOf(t)===o}},function(t,e,r){"use strict";
|
|
1239
1239
|
/*!
|
|
1240
1240
|
* Module dependencies.
|
|
1241
1241
|
*/function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function i(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function o(t,e){return(o=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function s(t){var e=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(t){return!1}}();return function(){var r,n=u(t);if(e){var i=u(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return a(this,r)}}function a(t,e){if(e&&("object"===n(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function u(t){return(u=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var h=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&o(t,e)}(u,t);var e,r,n,a=s(u);function u(t,e,r){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,u),a.call(this,'Parameter "'+e+'" to '+r+"() must be an object, got "+t.toString())}return e=u,r&&i(e.prototype,r),n&&i(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(r(7));Object.defineProperty(h.prototype,"name",{value:"ObjectParameterError"}),t.exports=h},function(t,e,r){"use strict";
|
|
@@ -1275,7 +1275,7 @@ function a(t,e,r){if(null!=e){if(Object.keys(e).some((function(t){return t.start
|
|
|
1275
1275
|
/*!
|
|
1276
1276
|
* ignore
|
|
1277
1277
|
*/
|
|
1278
|
-
function(t,e,r,i,o){var s=i,a=s,u=n(o,"overwrite",!1),h=n(o,"timestamps",!0);if(!h||null==s)return i;var f=null!=h&&!1===h.createdAt,c=null!=h&&!1===h.updatedAt;if(u)return i&&i.$set&&(i=i.$set,s.$set={},a=s.$set),c||!r||i[r]||(a[r]=t),f||!e||i[e]||(a[e]=t),s;if(i=i||{},Array.isArray(s))return s.push({$set:(l={},d=r,p=t,d in l?Object.defineProperty(l,d,{value:p,enumerable:!0,configurable:!0,writable:!0}):l[d]=p,l)}),s;var l,d,p;if(s.$set=s.$set||{},!c&&r&&(!i.$currentDate||!i.$currentDate[r])){var y=!1;if(-1!==r.indexOf("."))for(var m=r.split("."),b=1;b<m.length;++b){var v=m.slice(-b).join("."),g=m.slice(0,-b).join(".");if(null!=i[g]){i[g][v]=t,y=!0;break}if(i.$set&&i.$set[g]){i.$set[g][v]=t,y=!0;break}}y||(s.$set[r]=t),s.hasOwnProperty(r)&&delete s[r]}if(!f&&e){i[e]&&delete i[e],i.$set&&i.$set[e]&&delete i.$set[e];var w=!1;if(-1!==e.indexOf("."))for(var _=e.split("."),M=1;M<_.length;++M){var S=_.slice(-M).join("."),O=_.slice(0,-M).join(".");if(null!=i[O]){i[O][S]=t,w=!0;break}if(i.$set&&i.$set[O]){i.$set[O][S]=t,w=!0;break}}w||(s.$setOnInsert=s.$setOnInsert||{},s.$setOnInsert[e]=t)}0===Object.keys(s.$set).length&&delete s.$set;return s}},function(t,e,r){"use strict";var n=r(19),i=r(
|
|
1278
|
+
function(t,e,r,i,o){var s=i,a=s,u=n(o,"overwrite",!1),h=n(o,"timestamps",!0);if(!h||null==s)return i;var f=null!=h&&!1===h.createdAt,c=null!=h&&!1===h.updatedAt;if(u)return i&&i.$set&&(i=i.$set,s.$set={},a=s.$set),c||!r||i[r]||(a[r]=t),f||!e||i[e]||(a[e]=t),s;if(i=i||{},Array.isArray(s))return s.push({$set:(l={},d=r,p=t,d in l?Object.defineProperty(l,d,{value:p,enumerable:!0,configurable:!0,writable:!0}):l[d]=p,l)}),s;var l,d,p;if(s.$set=s.$set||{},!c&&r&&(!i.$currentDate||!i.$currentDate[r])){var y=!1;if(-1!==r.indexOf("."))for(var m=r.split("."),b=1;b<m.length;++b){var v=m.slice(-b).join("."),g=m.slice(0,-b).join(".");if(null!=i[g]){i[g][v]=t,y=!0;break}if(i.$set&&i.$set[g]){i.$set[g][v]=t,y=!0;break}}y||(s.$set[r]=t),s.hasOwnProperty(r)&&delete s[r]}if(!f&&e){i[e]&&delete i[e],i.$set&&i.$set[e]&&delete i.$set[e];var w=!1;if(-1!==e.indexOf("."))for(var _=e.split("."),M=1;M<_.length;++M){var S=_.slice(-M).join("."),O=_.slice(0,-M).join(".");if(null!=i[O]){i[O][S]=t,w=!0;break}if(i.$set&&i.$set[O]){i.$set[O][S]=t,w=!0;break}}w||(s.$setOnInsert=s.$setOnInsert||{},s.$setOnInsert[e]=t)}0===Object.keys(s.$set).length&&delete s.$set;return s}},function(t,e,r){"use strict";var n=r(19),i=r(9);t.exports=function(t,e){if("string"==typeof t)return;if("function"==typeof t)return;throw new n('Invalid ref at path "'+e+'". Got '+i.inspect(t,{depth:0}))}},function(t,e,r){"use strict";
|
|
1279
1279
|
/*!
|
|
1280
1280
|
* ignore
|
|
1281
1281
|
*/t.exports=i;var n=r(317);
|
|
@@ -1291,7 +1291,7 @@ function(t,e,r,i,o){var s=i,a=s,u=n(o,"overwrite",!1),h=n(o,"timestamps",!0);if(
|
|
|
1291
1291
|
function i(t,e){var r={useErrorHandlers:!0,numCallbackParams:1,nullResultByDefault:!0},n=e.hooks.filter((function(t){var e=function(t){var e={};t.hasOwnProperty("query")&&(e.query=t.query);t.hasOwnProperty("document")&&(e.document=t.document);return e}(t);return"updateOne"===t.name?null==e.query||!!e.query:"deleteOne"===t.name?!!e.query||0===Object.keys(e).length:"validate"===t.name||"remove"===t.name?!!e.query:null==t.query&&null==t.document||!!t.query}));t.prototype._execUpdate=n.createWrapper("update",t.prototype._execUpdate,null,r),t.prototype.__distinct=n.createWrapper("distinct",t.prototype.__distinct,null,r),t.prototype.validate=n.createWrapper("validate",t.prototype.validate,null,r),i.middlewareFunctions.filter((function(t){return"update"!==t&&"distinct"!==t&&"validate"!==t})).forEach((function(e){t.prototype["_".concat(e)]=n.createWrapper(e,t.prototype["_".concat(e)],null,r)}))}i.middlewareFunctions=n.concat(["validate"])},function(t,e,r){"use strict";t.exports=Object.freeze(["count","countDocuments","distinct","estimatedDocumentCount","find","findOne","findOneAndReplace","findOneAndUpdate","replaceOne","update","updateMany","updateOne","deleteMany","deleteOne","findOneAndDelete","findOneAndRemove","remove"])},function(t,e,r){"use strict";
|
|
1292
1292
|
/*!
|
|
1293
1293
|
* Module dependencies.
|
|
1294
|
-
*/function n(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return i(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return i(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},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 s,a=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,s=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw s}}}}function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var o=r(
|
|
1294
|
+
*/function n(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return i(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return i(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},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 s,a=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,s=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw s}}}}function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var o=r(8),s=r(7),a=r(319),u=r(158),h=r(4),f=o.CastError;function c(t,e){this.enumValues=[],this.regExp=null,o.call(this,t,e,"String")}
|
|
1295
1295
|
/*!
|
|
1296
1296
|
* ignore
|
|
1297
1297
|
*/
|
|
@@ -1326,7 +1326,7 @@ t.exports=f},function(t,e,r){"use strict";function n(t){return(n="function"==typ
|
|
|
1326
1326
|
t.exports=f},function(t,e,r){"use strict";
|
|
1327
1327
|
/*!
|
|
1328
1328
|
* Module dependencies.
|
|
1329
|
-
*/var n=r(20),i=r(
|
|
1329
|
+
*/var n=r(20),i=r(8),o=r(84),s=r(4);function a(t,e){i.call(this,t,e,"Boolean")}a.schemaName="Boolean",a.defaultOptions={},
|
|
1330
1330
|
/*!
|
|
1331
1331
|
* Inherits from SchemaType.
|
|
1332
1332
|
*/
|
|
@@ -1349,11 +1349,19 @@ a._checkRequired=function(t){return!0===t||!1===t},a.checkRequired=i.checkRequir
|
|
|
1349
1349
|
t.exports=a},function(t,e,r){"use strict";
|
|
1350
1350
|
/*!
|
|
1351
1351
|
* Module dependencies.
|
|
1352
|
-
*/var n,i,o=r(88),s=r(20),a=r(12).EventEmitter,u=r(329),h=r(
|
|
1352
|
+
*/var n,i,o=r(88),s=r(20),a=r(12).EventEmitter,u=r(329),h=r(8),f=r(172),c=r(173),l=r(9),d=r(4),p=r(174),y=r(1).arrayAtomicsSymbol,m=r(1).arrayPathSymbol,b=r(1).documentArrayParent;function v(t,e,r,n){null!=n&&null!=n._id?e=c(e,n):null!=r&&null!=r._id&&(e=c(e,r));var i=g(e,r);i.prototype.$basePath=t,o.call(this,t,i,r),this.schema=e,this.schemaOptions=n||{},this.$isMongooseDocumentArray=!0,this.Constructor=i,i.base=e.base;var s=this.defaultValue;"defaultValue"in this&&void 0===s||this.default((function(){var t=s.call(this);return null==t||Array.isArray(t)||(t=[t]),t}));var a=this;this.$embeddedSchemaType=new h(t+".$",{required:this&&this.schemaOptions&&this.schemaOptions.required||!1}),this.$embeddedSchemaType.cast=function(t,e,r){return a.cast(t,e,r)[0]},this.$embeddedSchemaType.$isMongooseDocumentArrayElement=!0,this.$embeddedSchemaType.caster=this.Constructor,this.$embeddedSchemaType.schema=this.schema}
|
|
1353
1353
|
/*!
|
|
1354
1354
|
* Ignore
|
|
1355
1355
|
*/
|
|
1356
|
-
function g(t,e,n){function o(){i.apply(this,arguments),this.$session(this.ownerDocument().$session())}i||(i=r(46)),t._preCompile();var s=null!=n?n.prototype:i.prototype;for(var u in o.prototype=Object.create(s),o.prototype.$__setSchema(t),o.schema=t,o.prototype.constructor=o,o.$isArraySubdocument=!0,o.events=new a,t.methods)o.prototype[u]=t.methods[u];for(var h in t.statics)o[h]=t.statics[h];for(var f in a.prototype)o[f]=a.prototype[f];return o.options=e,o}
|
|
1356
|
+
function g(t,e,n){function o(){i.apply(this,arguments),this.$session(this.ownerDocument().$session())}i||(i=r(46)),t._preCompile();var s=null!=n?n.prototype:i.prototype;for(var u in o.prototype=Object.create(s),o.prototype.$__setSchema(t),o.schema=t,o.prototype.constructor=o,o.$isArraySubdocument=!0,o.events=new a,t.methods)o.prototype[u]=t.methods[u];for(var h in t.statics)o[h]=t.statics[h];for(var f in a.prototype)o[f]=a.prototype[f];return o.options=e,o}v.schemaName="DocumentArray",v.options={castNonArrays:!0},
|
|
1357
|
+
/*!
|
|
1358
|
+
* Inherits from ArrayType.
|
|
1359
|
+
*/
|
|
1360
|
+
v.prototype=Object.create(o.prototype),v.prototype.constructor=v,v.prototype.OptionsConstructor=u,v.prototype.discriminator=function(t,e,r){"function"==typeof t&&(t=d.getFunctionName(t)),r=r||{};var n=d.isPOJO(r)?r.value:r,i="boolean"!=typeof r.clone||r.clone;e.instanceOfSchema&&i&&(e=e.clone());var o=g(e=f(this.casterConstructor,t,e,n),null,this.casterConstructor);o.baseCasterConstructor=this.casterConstructor;try{Object.defineProperty(o,"name",{value:t})}catch(t){}return this.casterConstructor.discriminators[t]=o,this.casterConstructor.discriminators[t]},v.prototype.doValidate=function(t,e,o,s){n||(n=r(27));var a=this;try{h.prototype.doValidate.call(this,t,(function(r){if(r)return e(r);var u,h=t&&t.length;if(!h)return e();if(s&&s.updateValidator)return e();d.isMongooseDocumentArray(t)||(t=new n(t,a.path,o));function f(t){null!=t&&(u=t),--h||e(u)}for(var c=0,l=h;c<l;++c){var y=t[c];if(null!=y){if(!(y instanceof i)){var m=p(a.casterConstructor,t[c]);y=t[c]=new m(y,t,void 0,void 0,c)}null==s||!s.validateModifiedOnly||y.$isModified()?y.$__validate(f):--h||e(u)}else--h||e(u)}}),o)}catch(t){return e(t)}},v.prototype.doValidateSync=function(t,e,r){var n=h.prototype.doValidateSync.call(this,t,e);if(null!=n)return n;var o=t&&t.length,s=null;if(o){for(var a=0,u=o;a<u;++a){var f=t[a];if(f){if(!(f instanceof i)){var c=p(this.casterConstructor,t[a]);f=t[a]=new c(f,t,void 0,void 0,a)}if(null==r||!r.validateModifiedOnly||f.$isModified()){var l=f.validateSync();l&&null==s&&(s=l)}}}return s}},
|
|
1361
|
+
/*!
|
|
1362
|
+
* ignore
|
|
1363
|
+
*/
|
|
1364
|
+
v.prototype.getDefault=function(t){var e="function"==typeof this.defaultValue?this.defaultValue.call(t):this.defaultValue;if(null==e)return e;n||(n=r(27)),Array.isArray(e)||(e=[e]),e=new n(e,this.path,t);for(var i=0;i<e.length;++i){var o=new(p(this.casterConstructor,e[i]))({},e,void 0,void 0,i);o.$init(e[i]),o.isNew=!0,Object.assign(o.$__.activePaths.default,o.$__.activePaths.init),o.$__.activePaths.init={},e[i]=o}return e};var w=Object.freeze({transform:!1,virtuals:!1}),_=Object.freeze({skipId:!0,willInit:!0});
|
|
1357
1365
|
/*!
|
|
1358
1366
|
* Scopes paths selected in a query to this array.
|
|
1359
1367
|
* Necessary for proper default application of subdocument values.
|
|
@@ -1362,15 +1370,7 @@ function g(t,e,n){function o(){i.apply(this,arguments),this.$session(this.ownerD
|
|
|
1362
1370
|
* @param {Object|undefined} fields - the root fields selected in the query
|
|
1363
1371
|
* @param {Boolean|undefined} init - if we are being created part of a query result
|
|
1364
1372
|
*/
|
|
1365
|
-
function
|
|
1366
|
-
/*!
|
|
1367
|
-
* Inherits from ArrayType.
|
|
1368
|
-
*/
|
|
1369
|
-
v.prototype=Object.create(o.prototype),v.prototype.constructor=v,v.prototype.OptionsConstructor=u,v.prototype.discriminator=function(t,e,r){"function"==typeof t&&(t=d.getFunctionName(t)),r=r||{};var n=d.isPOJO(r)?r.value:r,i="boolean"!=typeof r.clone||r.clone;e.instanceOfSchema&&i&&(e=e.clone());var o=g(e=f(this.casterConstructor,t,e,n),null,this.casterConstructor);o.baseCasterConstructor=this.casterConstructor;try{Object.defineProperty(o,"name",{value:t})}catch(t){}return this.casterConstructor.discriminators[t]=o,this.casterConstructor.discriminators[t]},v.prototype.doValidate=function(t,e,o,s){n||(n=r(27));var a=this;try{h.prototype.doValidate.call(this,t,(function(r){if(r)return e(r);var u,h=t&&t.length;if(!h)return e();if(s&&s.updateValidator)return e();d.isMongooseDocumentArray(t)||(t=new n(t,a.path,o));function f(t){null!=t&&(u=t),--h||e(u)}for(var c=0,l=h;c<l;++c){var y=t[c];if(null!=y){if(!(y instanceof i)){var m=p(a.casterConstructor,t[c]);y=t[c]=new m(y,t,void 0,void 0,c)}null==s||!s.validateModifiedOnly||y.$isModified()?y.$__validate(f):--h||e(u)}else--h||e(u)}}),o)}catch(t){return e(t)}},v.prototype.doValidateSync=function(t,e,r){var n=h.prototype.doValidateSync.call(this,t,e);if(null!=n)return n;var o=t&&t.length,s=null;if(o){for(var a=0,u=o;a<u;++a){var f=t[a];if(f){if(!(f instanceof i)){var c=p(this.casterConstructor,t[a]);f=t[a]=new c(f,t,void 0,void 0,a)}if(null==r||!r.validateModifiedOnly||f.$isModified()){var l=f.validateSync();l&&null==s&&(s=l)}}}return s}},
|
|
1370
|
-
/*!
|
|
1371
|
-
* ignore
|
|
1372
|
-
*/
|
|
1373
|
-
v.prototype.getDefault=function(t){var e="function"==typeof this.defaultValue?this.defaultValue.call(t):this.defaultValue;if(null==e)return e;n||(n=r(27)),Array.isArray(e)||(e=[e]),e=new n(e,this.path,t);for(var i=0;i<e.length;++i){var o=new(p(this.casterConstructor,e[i]))({},e,void 0,void 0,i);o.$init(e[i]),o.isNew=!0,Object.assign(o.$__.activePaths.default,o.$__.activePaths.init),o.$__.activePaths.init={},e[i]=o}return e},v.prototype.cast=function(t,e,o,a,u){if(n||(n=r(27)),null!=t&&null!=t[m]&&t===a)return t;var h,f,c={transform:!1,virtuals:!1};if(u=u||{},!Array.isArray(t)){if(!o&&!v.options.castNonArrays)throw new s("DocumentArray",l.inspect(t),this.path,null,this);return e&&o&&e.markModified(this.path),this.cast([t],e,o,a,u)}u.skipDocumentArrayCast&&!d.isMongooseDocumentArray(t)||(t=new n(t,this.path,e)),null!=a&&(t[y]=a[y]||{}),null!=u.arrayPathIndex&&(t[m]=this.path+"."+u.arrayPathIndex);for(var g=d.isMongooseDocumentArray(t)?t.__array:t,_=g.length,M={skipId:!0,willInit:!0},S=0;S<_;++S)if(g[S]){var O=p(this.casterConstructor,g[S]);if(!g[S].$__||g[S]instanceof O||(g[S]=g[S].toObject({transform:!1,virtuals:g[S].schema===O.schema})),g[S]instanceof i){if(g[S][b]!==e)if(o){var A=new O(null,t,M,h,S);g[S]=A.$init(g[S])}else{var E=new O(g[S],t,void 0,void 0,S);g[S]=E}null==g[S].__index&&g[S].$setIndex(S)}else if(null!=g[S])if(o)e?h||(h=w(this,e.$__.selected,o)):h=!0,f=new O(null,t,M,h,S),g[S]=f.$init(g[S]);else if(a&&"function"==typeof a.id&&(f=a.id(g[S]._id)),a&&f&&d.deepEqual(f.toObject(c),g[S]))f.set(g[S]),g[S]=f;else try{f=new O(g[S],t,void 0,void 0,S),g[S]=f}catch(e){var x=l.inspect(g[S]);throw new s("embedded",x,t[m],e,this)}}return t},
|
|
1373
|
+
function M(t,e,r){if(r&&e){for(var n,i,o,s=t.path+".",a=Object.keys(e),u=a.length,h={};u--;)if((i=a[u]).startsWith(s)){if("$"===(o=i.substring(s.length)))continue;o.startsWith("$.")&&(o=o.substring(2)),n||(n=!0),h[o]=e[i]}return n&&h||void 0}}v.prototype.cast=function(t,e,o,a,u){if(n||(n=r(27)),null!=t&&null!=t[m]&&t===a)return t;var h,f;if(u=u||{},!Array.isArray(t)){if(!o&&!v.options.castNonArrays)throw new s("DocumentArray",l.inspect(t),this.path,null,this);return e&&o&&e.markModified(this.path),this.cast([t],e,o,a,u)}u.skipDocumentArrayCast&&!d.isMongooseDocumentArray(t)||(t=new n(t,this.path,e)),null!=a&&(t[y]=a[y]||{}),null!=u.arrayPathIndex&&(t[m]=this.path+"."+u.arrayPathIndex);for(var c=d.isMongooseDocumentArray(t)?t.__array:t,g=c.length,S=0;S<g;++S)if(c[S]){var O=p(this.casterConstructor,c[S]);if(!c[S].$__||c[S]instanceof O||(c[S]=c[S].toObject({transform:!1,virtuals:c[S].schema===O.schema})),c[S]instanceof i){if(c[S][b]!==e)if(o){var A=new O(null,t,_,h,S);c[S]=A.$init(c[S])}else{var E=new O(c[S],t,void 0,void 0,S);c[S]=E}null==c[S].__index&&c[S].$setIndex(S)}else if(null!=c[S])if(o)e?h||(h=M(this,e.$__.selected,o)):h=!0,f=new O(null,t,_,h,S),c[S]=f.$init(c[S]);else if(a&&"function"==typeof a.id&&(f=a.id(c[S]._id)),a&&f&&d.deepEqual(f.toObject(w),c[S]))f.set(c[S]),c[S]=f;else try{f=new O(c[S],t,void 0,void 0,S),c[S]=f}catch(e){var x=l.inspect(c[S]);throw new s("embedded",x,t[m],e,this)}}return t},
|
|
1374
1374
|
/*!
|
|
1375
1375
|
* ignore
|
|
1376
1376
|
*/
|
|
@@ -1389,7 +1389,7 @@ t.exports=v},function(t,e,r){"use strict";function n(t){return(n="function"==typ
|
|
|
1389
1389
|
t.exports=f},function(t,e,r){"use strict";t.exports=function t(e){if(!Array.isArray(e))return{min:0,max:0,containsNonArrayItem:!0};if(0===e.length)return{min:1,max:1,containsNonArrayItem:!1};if(1===e.length&&!Array.isArray(e[0]))return{min:1,max:1,containsNonArrayItem:!1};for(var r=t(e[0]),n=1;n<e.length;++n){var i=t(e[n]);i.min<r.min&&(r.min=i.min),i.max>r.max&&(r.max=i.max),r.containsNonArrayItem=r.containsNonArrayItem||i.containsNonArrayItem}return r.min=r.min+1,r.max=r.max+1,r}},function(t,e,r){"use strict";
|
|
1390
1390
|
/*!
|
|
1391
1391
|
* Module dependencies.
|
|
1392
|
-
*/function n(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return i(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return i(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},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 s,a=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,s=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw s}}}}function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function o(t){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var s=r(20),a=r(44),u=r(87),h=r(326),f=r(327),c=r(14),l=r(22),d=r(162),p=r(164),y=r(
|
|
1392
|
+
*/function n(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return i(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return i(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},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 s,a=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,s=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw s}}}}function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function o(t){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var s=r(20),a=r(44),u=r(87),h=r(326),f=r(327),c=r(14),l=r(22),d=r(162),p=r(164),y=r(9),m=r(33),b=r(52),v=["Polygon","MultiPolygon"];function g(t,e,r){if(Array.isArray(t))t.forEach((function(n,i){if(Array.isArray(n)||m(n))return g(n,e,r);t[i]=e.castForQueryWrapper({val:n,context:r})}));else for(var n=Object.keys(t),i=n.length;i--;){var o=n[i],s=t[o];Array.isArray(s)||m(s)?(g(s,e,r),t[o]=s):t[o]=e.castForQuery({val:s,context:r})}}t.exports=function t(e,r,i,w){if(Array.isArray(r))throw new Error("Query filter must be an object, got an array ",y.inspect(r));if(null==r)return r;null!=e&&null!=e.discriminators&&null!=r[e.options.discriminatorKey]&&(e=d(e,r[e.options.discriminatorKey])||e);var _,M,S,O,A,E,x=Object.keys(r),k=x.length;for(i=i||{};k--;)if(E=r[O=x[k]],"$or"===O||"$nor"===O||"$and"===O){if(!Array.isArray(E))throw new s("Array",E,O);for(var j=0;j<E.length;++j){if(null==E[j]||"object"!==o(E[j]))throw new s("Object",E[j],O+"."+j);E[j]=t(e,E[j],i,w)}}else{if("$where"===O){if("string"!==(A=o(E))&&"function"!==A)throw new Error("Must have a string or function for $where");"function"===A&&(r[O]=E.toString());continue}if("$expr"===O){E=h(E,e);continue}if("$elemMatch"===O)E=t(e,E,i,w);else if("$text"===O)E=f(E,O);else{if(!e)continue;if(!(M=e.path(O)))for(var $=O.split("."),P=$.length;P--;){var R=$.slice(0,P).join("."),B=$.slice(P).join("."),T=e.path(R),I=T&&T.schema&&T.schema.options&&T.schema.options.discriminatorKey;if(null!=T&&null!=(T.schema&&T.schema.discriminators)&&null!=I&&B!==I){var N=c(r,R+"."+I);null!=N&&(M=T.schema.discriminators[N].path(B))}}if(M){if(null==E)continue;if("Object"===l(E))if(Object.keys(E).some(p))for(var D=Object.keys(E),C=void 0,L=D.length;L--;)if(S=E[C=D[L]],"$not"===C){if(S&&M){if((_=Object.keys(S)).length&&p(_[0]))for(var q in S)S[q]=M.castForQueryWrapper({$conditional:q,val:S[q],context:w});else E[C]=M.castForQueryWrapper({$conditional:C,val:S,context:w});continue}}else E[C]=M.castForQueryWrapper({$conditional:C,val:S,context:w});else r[O]=M.castForQueryWrapper({val:E,context:w});else if(Array.isArray(E)&&-1===["Buffer","Array"].indexOf(M.instance)){var U,F=[],z=n(E);try{for(z.s();!(U=z.n()).done;){var V=U.value;F.push(M.castForQueryWrapper({val:V,context:w}))}}catch(t){z.e(t)}finally{z.f()}r[O]={$in:F}}else r[O]=M.castForQueryWrapper({val:E,context:w})}else{for(var K=O.split("."),H=K.length,Z=void 0,W=void 0,J=void 0;H--&&(Z=K.slice(0,H).join("."),!(M=e.path(Z))););if(M){if(M.caster&&M.caster.schema){(J={})[W=K.slice(H).join(".")]=E;var Y=t(M.caster.schema,J,i,w)[W];void 0===Y?delete r[O]:r[O]=Y}else r[O]=E;continue}if(m(E)){var Q="";if(E.$near?Q="$near":E.$nearSphere?Q="$nearSphere":E.$within?Q="$within":E.$geoIntersects?Q="$geoIntersects":E.$geoWithin&&(Q="$geoWithin"),Q){var G=new u.Number("__QueryCasting__"),X=E[Q];if(null!=E.$maxDistance&&(E.$maxDistance=G.castForQueryWrapper({val:E.$maxDistance,context:w})),null!=E.$minDistance&&(E.$minDistance=G.castForQueryWrapper({val:E.$minDistance,context:w})),"$within"===Q){var tt=X.$center||X.$centerSphere||X.$box||X.$polygon;if(!tt)throw new Error("Bad $within parameter: "+JSON.stringify(E));X=tt}else if("$near"===Q&&"string"==typeof X.type&&Array.isArray(X.coordinates))X=X.coordinates;else if(("$near"===Q||"$nearSphere"===Q||"$geoIntersects"===Q)&&X.$geometry&&"string"==typeof X.$geometry.type&&Array.isArray(X.$geometry.coordinates))null!=X.$maxDistance&&(X.$maxDistance=G.castForQueryWrapper({val:X.$maxDistance,context:w})),null!=X.$minDistance&&(X.$minDistance=G.castForQueryWrapper({val:X.$minDistance,context:w})),b(X.$geometry)&&(X.$geometry=X.$geometry.toObject({transform:!1,virtuals:!1})),X=X.$geometry.coordinates;else if("$geoWithin"===Q)if(X.$geometry){b(X.$geometry)&&(X.$geometry=X.$geometry.toObject({virtuals:!1}));var et=X.$geometry.type;if(-1===v.indexOf(et))throw new Error('Invalid geoJSON type for $geoWithin "'+et+'", must be "Polygon" or "MultiPolygon"');X=X.$geometry.coordinates}else X=X.$box||X.$polygon||X.$center||X.$centerSphere,b(X)&&(X=X.toObject({virtuals:!1}));g(X,G,w);continue}}if(e.nested[O])continue;var rt="strict"in i?i.strict:e.options.strict,nt="strictQuery"in i?i.strictQuery:"strict"in i?i.strict:"strict"in e._userProvidedOptions?e._userProvidedOptions.strict:e.options.strictQuery;if(i.upsert&&rt){if("throw"===rt)throw new a(O);throw new a(O,'Path "'+O+'" is not in schema, strict mode is `true`, and upsert is `true`.')}if("throw"===nt)throw new a(O,'Path "'+O+"\" is not in schema and strictQuery is 'throw'.");nt&&delete r[O]}}}return r}},function(t,e,r){"use strict";function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var i=r(20),o=r(44),s=r(160),a=new Set(["$and","$or","$not"]),u=new Set(["$cmp","$eq","$lt","$lte","$gt","$gte"]),h=new Set(["$multiply","$divide","$log","$mod","$trunc","$avg","$max","$min","$stdDevPop","$stdDevSamp","$sum"]),f=new Set(["$abs","$exp","$ceil","$floor","$ln","$log10","$round","$sqrt","$sin","$cos","$tan","$asin","$acos","$atan","$atan2","$asinh","$acosh","$atanh","$sinh","$cosh","$tanh","$degreesToRadians","$radiansToDegrees"]),c=new Set(["$arrayElemAt","$first","$last"]),l=new Set(["$year","$month","$week","$dayOfMonth","$dayOfYear","$hour","$minute","$second","$isoDayOfWeek","$isoWeekYear","$isoWeek","$millisecond"]);function d(t,e,r){if(b(t))return t;null!=t.$cond?Array.isArray(t.$cond)?t.$cond=t.$cond.map((function(t){return d(t,e,r)})):(t.$cond.if=d(t.$cond.if,e,r),t.$cond.then=d(t.$cond.then,e,r),t.$cond.else=d(t.$cond.else,e,r)):null!=t.$ifNull?t.$ifNull.map((function(t){return d(t,e,r)})):null!=t.$switch&&(t.branches.map((function(t){return d(t,e,r)})),t.default=d(t.default,e,r));for(var n=0,i=Object.keys(t);n<i.length;n++){var s=i[n];a.has(s)?t[s]=t[s].map((function(t){return d(t,e,r)})):u.has(s)?t[s]=m(t[s],e,r):h.has(s)?t[s]=y(t[s]):f.has(s)&&(t[s]=p(t[s]))}return t.$in&&(t.$in=function(t,e,r){var n=t[1];if(!b(n))return t;var i=t[0],s=e.path(n.slice(1));if(null===s){if(!1===r)return t;if("throw"===r)throw new o("$in");return}if(!s.$isMongooseArray)throw new Error("Path must be an array for $in");return[s.$isMongooseDocumentArray?s.$embeddedSchemaType.cast(i):s.caster.cast(i),n]}(t.$in,e,r)),t.$size&&(t.$size=p(t.$size)),function(t){for(var e=Object.keys(t),r=0,n=e.length;r<n;++r)void 0===t[e[r]]&&delete t[e[r]]}(t),t}function p(t){if(!v(t))return t;try{return s(t)}catch(e){throw new i("Number",t)}}function y(t){if(!Array.isArray(t)){if(!v(t))return t;try{return s(t)}catch(e){throw new i("Number",t)}}return t.map((function(t){if(!v(t))return t;try{return s(t)}catch(e){throw new i("Number",t)}}))}function m(t,e,r){if(!Array.isArray(t)||2!==t.length)throw new Error("Comparison operator must be an array of length 2");t[0]=d(t[0],e,r);var a=t[0];if(v(t[1])){var u=null,h=null,f=null;if(b(a))u=a.slice(1),h=e.path(u);else if("object"===n(a)&&null!=a)for(var p=0,y=Object.keys(a);p<y.length;p++){var m=y[p];l.has(m)&&b(a[m])?(u=a[m].slice(1)+"."+m,f=s):c.has(m)&&b(a[m])&&(u=a[m].slice(1)+"."+m,null!=(h=e.path(a[m].slice(1)))&&(h.$isMongooseDocumentArray?h=h.$embeddedSchemaType:h.$isMongooseArray&&(h=h.caster)))}var g="object"===n(t[1])&&null!=t[1]&&null!=t[1].$literal;if(null!=h)t[1]=g?{$literal:h.cast(t[1].$literal)}:h.cast(t[1]);else if(null!=f)if(g)try{t[1]={$literal:f(t[1].$literal)}}catch(e){throw new i(f.name.replace(/^cast/,""),t[1],u+".$literal")}else try{t[1]=f(t[1])}catch(e){throw new i(f.name.replace(/^cast/,""),t[1],u)}else{if(null!=u&&!0===r)return;if(null!=u&&"throw"===r)throw new o(u)}}else t[1]=d(t[1]);return t}function b(t){return"string"==typeof t&&"$"===t[0]}function v(t){return("string"!=typeof t||"$"!==t[0])&&("object"!==n(t)||null===t||!Object.keys(t).find((function(t){return"$"===t[0]}))||null!=t.$literal)}t.exports=function(t,e,r){if("object"!==n(t)||null===t)throw new Error("`$expr` must be an object");return d(t,e,r)}},function(t,e,r){"use strict";function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var i=r(20),o=r(84),s=r(158);
|
|
1393
1393
|
/*!
|
|
1394
1394
|
* Casts val to an object suitable for `$text`. Throws an error if the object
|
|
1395
1395
|
* can't be casted.
|
|
@@ -1429,7 +1429,7 @@ function b(t){var e=t[l];if(e&&null!=e.$__.populated){var r,i=n(Object.keys(e.$_
|
|
|
1429
1429
|
t.exports=f},function(t,e,r){"use strict";
|
|
1430
1430
|
/*!
|
|
1431
1431
|
* Module dependencies.
|
|
1432
|
-
*/function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var i,o=r(20),s=r(12).EventEmitter,a=r(154),u=r(331),h=r(
|
|
1432
|
+
*/function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var i,o=r(20),s=r(12).EventEmitter,a=r(154),u=r(331),h=r(8),f=r(83),c=r(56).castToNumber,l=r(172),d=r(165),p=r(174),y=r(173),m=r(34).internalToObjectOptions,b=r(4);function v(t,e,r){t=y(t,r),this.caster=g(t),this.caster.path=e,this.caster.prototype.$basePath=e,this.schema=t,this.$isSingleNested=!0,h.call(this,e,r,"Embedded")}
|
|
1433
1433
|
/*!
|
|
1434
1434
|
* ignore
|
|
1435
1435
|
*/
|
|
@@ -1448,7 +1448,7 @@ function g(t,e){i||(i=r(90));var n=function(t,e,r){var n=this;this.$__parent=r,i
|
|
|
1448
1448
|
/*!
|
|
1449
1449
|
* ignore
|
|
1450
1450
|
*/
|
|
1451
|
-
v.prototype.$conditionalHandlers.$near=v.prototype.$conditionalHandlers.$nearSphere=d.cast$near,v.prototype.$conditionalHandlers.$within=v.prototype.$conditionalHandlers.$geoWithin=d.cast$within,v.prototype.$conditionalHandlers.$geoIntersects=d.cast$geoIntersects,v.prototype.$conditionalHandlers.$minDistance=c,v.prototype.$conditionalHandlers.$maxDistance=c,v.prototype.$conditionalHandlers.$exists=f,v.prototype.cast=function(t,e,r,i,o){if(t&&t.$isSingleNested&&t.parent===e)return t;if(null!=t&&("object"!==n(t)||Array.isArray(t)))throw new a(this.path,t);var s,u=p(this.caster,t),h=e&&e.$__&&e.$__.selected||{},f=this.path,c=Object.keys(h).reduce((function(t,e){return e.startsWith(f+".")&&(t[e.substring(f.length+1)]=h[e]),t}),{});return o=Object.assign({},o,{priorDoc:i}),r?((s=new u(void 0,c,e)).$init(t),s):0===Object.keys(t).length?new u({},c,e,void 0,o):new u(t,c,e,void 0,o)},v.prototype.castForQuery=function(t,e,r){var n;if(2===arguments.length){if(!(n=this.$conditionalHandlers[t]))throw new Error("Can't use "+t);return n.call(this,e)}if(null==(e=t))return e;this.options.runSetters&&(e=this._applySetters(e));var i=p(this.caster,e),s=null!=r&&null!=r.strict?r.strict:void 0;try{e=new i(e,s)}catch(t){if(!(t instanceof o))throw new o("Embedded",e,this.path,t,this);throw t}return e},v.prototype.doValidate=function(t,e,r,n){var i=p(this.caster,t);if(!t||t instanceof i||(t=new i(t,null,r)),n&&n.skipSchemaValidators)return t.validate(e);h.prototype.doValidate.call(this,t,(function(r){return r?e(r):t?void t.validate(e):e(null)}),r,n)},v.prototype.doValidateSync=function(t,e,r){if(!r||!r.skipSchemaValidators){var n=h.prototype.doValidateSync.call(this,t,e);if(n)return n}if(t)return t.validateSync()},v.prototype.discriminator=function(t,e,r){r=r||{};var n=b.isPOJO(r)?r.value:r,i="boolean"!=typeof r.clone||r.clone;return e.instanceOfSchema&&i&&(e=e.clone()),e=l(this.caster,t,e,n),this.caster.discriminators[t]=g(e,this.caster),this.caster.discriminators[t]},v.defaultOptions={},v.set=h.set,
|
|
1451
|
+
v.prototype.$conditionalHandlers.$near=v.prototype.$conditionalHandlers.$nearSphere=d.cast$near,v.prototype.$conditionalHandlers.$within=v.prototype.$conditionalHandlers.$geoWithin=d.cast$within,v.prototype.$conditionalHandlers.$geoIntersects=d.cast$geoIntersects,v.prototype.$conditionalHandlers.$minDistance=c,v.prototype.$conditionalHandlers.$maxDistance=c,v.prototype.$conditionalHandlers.$exists=f,v.prototype.cast=function(t,e,r,i,o){if(t&&t.$isSingleNested&&t.parent===e)return t;if(null!=t&&("object"!==n(t)||Array.isArray(t)))throw new a(this.path,t);var s,u=p(this.caster,t),h=e&&e.$__&&e.$__.selected||{},f=this.path,c=Object.keys(h).reduce((function(t,e){return e.startsWith(f+".")&&(t[e.substring(f.length+1)]=h[e]),t}),{});return o=Object.assign({},o,{priorDoc:i}),r?((s=new u(void 0,c,e)).$init(t),s):0===Object.keys(t).length?new u({},c,e,void 0,o):new u(t,c,e,void 0,o)},v.prototype.castForQuery=function(t,e,r){var n;if(2===arguments.length){if(!(n=this.$conditionalHandlers[t]))throw new Error("Can't use "+t);return n.call(this,e)}if(null==(e=t))return e;this.options.runSetters&&(e=this._applySetters(e));var i=p(this.caster,e),s=null!=r&&null!=r.strict?r.strict:void 0;try{e=new i(e,s)}catch(t){if(!(t instanceof o))throw new o("Embedded",e,this.path,t,this);throw t}return e},v.prototype.doValidate=function(t,e,r,n){var i=p(this.caster,t);if(!t||t instanceof i||(t=new i(t,null,null!=r&&null!=r.$__?r:null)),n&&n.skipSchemaValidators)return t.validate(e);h.prototype.doValidate.call(this,t,(function(r){return r?e(r):t?void t.validate(e):e(null)}),r,n)},v.prototype.doValidateSync=function(t,e,r){if(!r||!r.skipSchemaValidators){var n=h.prototype.doValidateSync.call(this,t,e);if(n)return n}if(t)return t.validateSync()},v.prototype.discriminator=function(t,e,r){r=r||{};var n=b.isPOJO(r)?r.value:r,i="boolean"!=typeof r.clone||r.clone;return e.instanceOfSchema&&i&&(e=e.clone()),e=l(this.caster,t,e,n),this.caster.discriminators[t]=g(e,this.caster),this.caster.discriminators[t]},v.defaultOptions={},v.set=h.set,
|
|
1452
1452
|
/*!
|
|
1453
1453
|
* ignore
|
|
1454
1454
|
*/
|
|
@@ -1456,7 +1456,7 @@ v.prototype.clone=function(){var t=Object.assign({},this.options),e=new this.con
|
|
|
1456
1456
|
/*!
|
|
1457
1457
|
* Module dependencies.
|
|
1458
1458
|
*/
|
|
1459
|
-
function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var i=r(168),o=r(333),s=r(
|
|
1459
|
+
function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var i=r(168),o=r(333),s=r(8),a=r(161),u=r(4),h=i.Binary,f=s.CastError;function c(t,e){s.call(this,t,e,"Buffer")}
|
|
1460
1460
|
/*!
|
|
1461
1461
|
* ignore
|
|
1462
1462
|
*/
|
|
@@ -1479,7 +1479,7 @@ t.exports=c}).call(this,r(3).Buffer)},function(t,e,r){"use strict";function n(t)
|
|
|
1479
1479
|
t.exports=f},function(t,e,r){"use strict";
|
|
1480
1480
|
/*!
|
|
1481
1481
|
* Module requirements.
|
|
1482
|
-
*/var n=r(7),i=r(335),o=r(
|
|
1482
|
+
*/var n=r(7),i=r(335),o=r(8),s=r(336),a=r(22),u=r(4),h=o.CastError;function f(t,e){o.call(this,t,e,"Date")}
|
|
1483
1483
|
/*!
|
|
1484
1484
|
* Date Query casting.
|
|
1485
1485
|
*
|
|
@@ -1512,7 +1512,7 @@ t.exports=f},function(t,e,r){"use strict";function n(t){return(n="function"==typ
|
|
|
1512
1512
|
t.exports=f},function(t,e,r){"use strict";var n=r(43);t.exports=function(t){return null==t||""===t?null:t instanceof Date?(n.ok(!isNaN(t.valueOf())),t):(n.ok("boolean"!=typeof t),e=t instanceof Number||"number"==typeof t?new Date(t):"string"==typeof t&&!isNaN(Number(t))&&(Number(t)>=275761||Number(t)<-271820)?new Date(Number(t)):"function"==typeof t.valueOf?new Date(t.valueOf()):new Date(t),isNaN(e.valueOf())?void n.ok(!1):e);var e}},function(t,e,r){"use strict";
|
|
1513
1513
|
/*!
|
|
1514
1514
|
* Module dependencies.
|
|
1515
|
-
*/var n,i=r(338),o=r(
|
|
1515
|
+
*/var n,i=r(338),o=r(8),s=r(169),a=r(22),u=r(18),h=r(4),f=o.CastError;function c(t,e){var r="string"==typeof t&&24===t.length&&/^[a-f0-9]+$/i.test(t),n=e&&e.suppressWarning;!r&&void 0!==t||n||h.warn("mongoose: To create a new ObjectId please try `Mongoose.Types.ObjectId` instead of using `Mongoose.Schema.ObjectId`. Set the `suppressWarning` option if you're trying to create a hex char path in your schema."),o.call(this,t,e,"ObjectID")}
|
|
1516
1516
|
/*!
|
|
1517
1517
|
* ignore
|
|
1518
1518
|
*/
|
|
@@ -1546,7 +1546,7 @@ c._defaultCaster=function(t){if(!(t instanceof u))throw new Error(t+" is not an
|
|
|
1546
1546
|
t.exports=f},function(t,e,r){"use strict";
|
|
1547
1547
|
/*!
|
|
1548
1548
|
* Module dependencies.
|
|
1549
|
-
*/var n=r(
|
|
1549
|
+
*/var n=r(8),i=n.CastError,o=r(32),s=r(340),a=r(4);function u(t,e){n.call(this,t,e,"Decimal128")}
|
|
1550
1550
|
/*!
|
|
1551
1551
|
* ignore
|
|
1552
1552
|
*/
|
|
@@ -1574,7 +1574,7 @@ t.exports=u},function(t,e,r){"use strict";(function(e){function n(t){return(n="f
|
|
|
1574
1574
|
/*!
|
|
1575
1575
|
* ignore
|
|
1576
1576
|
*/
|
|
1577
|
-
function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function i(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return o(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return o(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}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 s,a=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,s=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw s}}}}function o(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function s(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function a(){return(a="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=u(t,e);if(n){var i=Object.getOwnPropertyDescriptor(n,e);return i.get?i.get.call(arguments.length<3?t:r):i.value}}).apply(this,arguments)}function u(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=l(t)););return t}function h(t,e){return(h=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function f(t){var e=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(t){return!1}}();return function(){var r,n=l(t);if(e){var i=l(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return c(this,r)}}function c(t,e){if(e&&("object"===n(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function l(t){return(l=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var d=r(170),p=r(342),y=r(
|
|
1577
|
+
function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function i(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return o(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return o(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}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 s,a=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,s=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw s}}}}function o(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function s(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function a(){return(a="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=u(t,e);if(n){var i=Object.getOwnPropertyDescriptor(n,e);return i.get?i.get.call(arguments.length<3?t:r):i.value}}).apply(this,arguments)}function u(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=l(t)););return t}function h(t,e){return(h=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function f(t){var e=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(t){return!1}}();return function(){var r,n=l(t);if(e){var i=l(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return c(this,r)}}function c(t,e){if(e&&("object"===n(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function l(t){return(l=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var d=r(170),p=r(342),y=r(8),m=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&h(t,e)}(c,t);var r,n,o,u=f(c);function c(t,e){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,c),(r=u.call(this,t,e,"Map")).$isSchemaMap=!0,r}return r=c,(n=[{key:"set",value:function(t,e){return y.set(t,e)}},{key:"cast",value:function(t,r,n){if(t instanceof d)return t;var o=this.path;if(n){var s=new d({},o,r,this.$__schemaType);if(t instanceof e.Map){var a,u=i(t.keys());try{for(u.s();!(a=u.n()).done;){var h=a.value,f=t.get(h);f=null==f?s.$__schemaType._castNullish(f):s.$__schemaType.cast(f,r,!0,null,{path:o+"."+h}),s.$init(h,f)}}catch(t){u.e(t)}finally{u.f()}}else for(var c=0,l=Object.keys(t);c<l.length;c++){var p=l[c],y=t[p];y=null==y?s.$__schemaType._castNullish(y):s.$__schemaType.cast(y,r,!0,null,{path:o+"."+p}),s.$init(p,y)}return s}return new d(t,o,r,this.$__schemaType)}},{key:"clone",value:function(){var t=a(l(c.prototype),"clone",this).call(this);return null!=this.$__schemaType&&(t.$__schemaType=this.$__schemaType.clone()),t}}])&&s(r.prototype,n),o&&s(r,o),Object.defineProperty(r,"prototype",{writable:!1}),c}(y);m.prototype.OptionsConstructor=p,m.defaultOptions={},t.exports=m}).call(this,r(6))},function(t,e,r){"use strict";function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function i(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function s(t,e){return(s=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function a(t){var e=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(t){return!1}}();return function(){var r,n=h(t);if(e){var i=h(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return u(this,r)}}function u(t,e){if(e&&("object"===n(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function h(t){return(h=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var f=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&s(t,e)}(h,t);var e,r,n,u=a(h);function h(){return o(this,h),u.apply(this,arguments)}return e=h,r&&i(e.prototype,r),n&&i(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(r(15)),c=r(16);Object.defineProperty(f.prototype,"of",c),t.exports=f},function(t,e,r){"use strict";
|
|
1578
1578
|
/*!
|
|
1579
1579
|
* Creates an object that precomputes whether a given path has child fields in
|
|
1580
1580
|
* the projection.
|
|
@@ -1600,7 +1600,7 @@ function u(e){return e&&"object"===n(e)&&!(e instanceof Date)&&!(e instanceof s)
|
|
|
1600
1600
|
function e(r,n,i,o){var s;s=r&&a(r)&&!t.isBuffer(r)?Object.keys(r.toObject({transform:!1,virtuals:!1})||{}):Object.keys(r||{});var h=s.length,f={};n=n?n+".":"";for(var c=0;c<h;++c){var l=s[c],d=r[l];f[n+l]=d;var p=o&&o.path&&o.path(n+l),y=o&&o.nested&&o.nested[n+l];if(!p||"Mixed"!==p.instance){if(u(d)){if(i&&i.skipArrays&&Array.isArray(d))continue;var m=e(d,n+l,i,o);for(var b in m)f[b]=m[b];Array.isArray(d)&&(f[n+l]=d)}if(y)for(var v=Object.keys(o.paths),g=0,w=v;g<w.length;g++){var _=w[g];_.startsWith(n+l+".")&&!f.hasOwnProperty(_)&&(f[_]=void 0)}}}return f}
|
|
1601
1601
|
/*!
|
|
1602
1602
|
* ignore
|
|
1603
|
-
*/,e.modifiedPaths=function e(r,n,i){var o=Object.keys(r||{}),s=o.length;i=i||{},n=n?n+".":"";for(var h=0;h<s;++h){var f=o[h],c=r[f],l=n+f;if(i[l]=!0,-1!==l.indexOf("."))for(var d=l.split("."),p=d[0],y=1;y<d.length;++y)i[p]=!0,p+="."+d[y];!t.isBuffer(c)&&a(c)&&(c=c.toObject({transform:!1,virtuals:!1})),u(c)&&e(c,n+f,i)}return i}}).call(this,r(3).Buffer)},function(t,e,r){"use strict";function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var i=r(19),o=r(346),s=r(
|
|
1603
|
+
*/,e.modifiedPaths=function e(r,n,i){var o=Object.keys(r||{}),s=o.length;i=i||{},n=n?n+".":"";for(var h=0;h<s;++h){var f=o[h],c=r[f],l=n+f;if(i[l]=!0,-1!==l.indexOf("."))for(var d=l.split("."),p=d[0],y=1;y<d.length;++y)i[p]=!0,p+="."+d[y];!t.isBuffer(c)&&a(c)&&(c=c.toObject({transform:!1,virtuals:!1})),u(c)&&e(c,n+f,i)}return i}}).call(this,r(3).Buffer)},function(t,e,r){"use strict";function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var i=r(19),o=r(346),s=r(9);t.exports=function t(e){if(null!=e&&"object"===n(e)&&!Array.isArray(e)&&!e.$__)for(var r=0,a=Object.keys(e);r<a.length;r++){var u=a[r],h=e[u];if(-1===u.indexOf("."))t(e[u]);else try{delete e[u],o(e,u,h)}catch(t){if(!(t instanceof TypeError))throw t;throw new i('Conflicting dotted paths when setting document path, key: "'.concat(u,'", value: ').concat(s.inspect(h)))}}}},function(t,e,r){"use strict";function n(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return i(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return i(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},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 s,a=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,s=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw s}}}}function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}t.exports=function(t,e,r){if(-1!==e.indexOf(".")){var i,o=e.split("."),s=o.pop(),a=t,u=n(o);try{for(u.s();!(i=u.n()).done;){var h=i.value;null==a[h]&&(a[h]={}),a=a[h]}}catch(t){u.e(t)}finally{u.f()}a[s]=r}else t[e]=r}},function(t,e,r){"use strict";var n=r(14),i=r(162);
|
|
1604
1604
|
/*!
|
|
1605
1605
|
* Like `schema.path()`, except with a document, because impossible to
|
|
1606
1606
|
* determine path type without knowing the embedded discriminator key.
|
|
@@ -1626,9 +1626,6 @@ t.exports=function t(e,r,o){for(var s=(o=o||{}).typeOnly,a=-1===r.indexOf(".")?[
|
|
|
1626
1626
|
* @param {Object} option
|
|
1627
1627
|
*/
|
|
1628
1628
|
function c(t){return function(e){e.options||(e.options={}),null!=t&&Array.isArray(t.virtuals)&&((t=Object.assign({},t)).virtuals=t.virtuals.filter((function(t){return"string"==typeof t&&t.startsWith(e.path+".")})).map((function(t){return t.slice(e.path.length+1)}))),e.options.lean=t}}
|
|
1629
|
-
/*!
|
|
1630
|
-
* Handle the `WriteOpResult` from the server
|
|
1631
|
-
*/
|
|
1632
1629
|
/*!
|
|
1633
1630
|
* Prepare a set of path options for query population.
|
|
1634
1631
|
*
|
|
@@ -1660,7 +1657,7 @@ e.createModel=function(t,r,n,i,o){t.hooks.execPreSync("createModel",r);var s=t.s
|
|
|
1660
1657
|
/*!
|
|
1661
1658
|
* ignore
|
|
1662
1659
|
*/
|
|
1663
|
-
e.applyPaths=function(t,e){var r,o,u;if(t)for(u=(o=Object.keys(t)).length;u--;)if("+"!==o[u][0]){var f=t[o[u]];if(h(f)){r=!f;break}}var c=[],l=[],d=[];switch(function e(n,i){if(i||(i=""),-1!==d.indexOf(n))return[];d.push(n);var o=[];return n.eachPath((function(n,a){i&&(n=i+"."+n);var u=E(n,a);if(null!=u||Array.isArray(a)||!a.$isMongooseArray||a.$isMongooseDocumentArray||(u=E(n,a.caster)),null!=u&&o.push(u),a.schema){var h=e(a.schema,n);!1===r&&s(t,n,a.schema,c,h)}})),d.pop(),o}(e),r){case!0:var p,y=i(l);try{for(y.s();!(p=y.n()).done;){var m=p.value;t[m]=0}}catch(t){y.e(t)}finally{y.f()}break;case!1:e&&e.paths._id&&e.paths._id.options&&!1===e.paths._id.options.select&&(t._id=0);var b,v=i(c);try{for(v.s();!(b=v.n()).done;){var g=b.value;t[g]=t[g]||1}}catch(t){v.e(t)}finally{v.f()}break;case void 0:if(null==t)break;for(var w=0,_=Object.keys(t||{});w<_.length;w++){var M=_[w];M.startsWith("+")&&delete t[M]}var S,O=i(l);try{for(O.s();!(S=O.n()).done;){var A=S.value;t[A]=0}}catch(t){O.e(t)}finally{O.f()}}function E(e,i){var s="+"+e,u=t&&s in t;if(u&&delete t[s],"boolean"==typeof i.selected){if(u)return delete t[s],void(!1===r&&o.length>1&&!~o.indexOf(e)&&(t[e]=1));for(var h=e.split("."),f="",d=0;d<h.length;++d)if(f+=f.length?"."+h[d]:h[d],-1!==l.indexOf(f))return;if(!r&&i&&i.options&&i.options.$skipDiscriminatorCheck)for(var p="",y=0;y<h.length;++y){p+=(0===p.length?"":".")+h[y];var m=a(t,p,!1)||a(t,p+".$",!1);if(m&&"object"!==n(m))return}return(i.selected?c:l).push(e),e}}}
|
|
1660
|
+
e.applyPaths=function(t,e){var r,o,u;if(t)for(u=(o=Object.keys(t)).length;u--;)if("+"!==o[u][0]){var f=t[o[u]];if(h(f)){r=!f;break}}var c=[],l=[],d=[];switch(function e(n,i){if(i||(i=""),-1!==d.indexOf(n))return[];d.push(n);var o=[];return n.eachPath((function(n,a){i&&(n=i+"."+n);var u=E(n,a);if(null!=u||Array.isArray(a)||!a.$isMongooseArray||a.$isMongooseDocumentArray||(u=E(n,a.caster)),null!=u&&o.push(u),a.schema){var h=e(a.schema,n);!1===r&&s(t,n,a.schema,c,h)}})),d.pop(),o}(e),r){case!0:var p,y=i(l);try{for(y.s();!(p=y.n()).done;){var m=p.value;t[m]=0}}catch(t){y.e(t)}finally{y.f()}break;case!1:e&&e.paths._id&&e.paths._id.options&&!1===e.paths._id.options.select&&(t._id=0);var b,v=i(c);try{for(v.s();!(b=v.n()).done;){var g=b.value;t[g]=t[g]||1}}catch(t){v.e(t)}finally{v.f()}break;case void 0:if(null==t)break;for(var w=0,_=Object.keys(t||{});w<_.length;w++){var M=_[w];M.startsWith("+")&&delete t[M]}var S,O=i(l);try{for(O.s();!(S=O.n()).done;){var A=S.value;t[A]=0}}catch(t){O.e(t)}finally{O.f()}}function E(e,i){var s="+"+e,u=t&&s in t;if(u&&delete t[s],"boolean"==typeof i.selected){if(u)return delete t[s],void(!1===r&&o.length>1&&!~o.indexOf(e)&&(t[e]=1));for(var h=e.split("."),f="",d=0;d<h.length;++d)if(f+=f.length?"."+h[d]:h[d],-1!==l.indexOf(f))return;if(!r&&i&&i.options&&i.options.$skipDiscriminatorCheck)for(var p="",y=0;y<h.length;++y){p+=(0===p.length?"":".")+h[y];var m=a(t,p,!1)||a(t,p+".$",!1);if(m&&"object"!==n(m))return}return(i.selected?c:l).push(e),e}}}},function(t,e,r){"use strict";t.exports=function(t,e,r,n,i){var o=Object.keys(t).reduce((function(t,r){return t||r.startsWith(e+".")}),!1),s=e+"."+r.options.discriminatorKey;o||1!==i.length||i[0]!==s||n.splice(n.indexOf(s),1)}},function(t,e,r){"use strict";function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}t.exports=function(t){return!!t&&("object"===n(t)||"function"==typeof t)&&"function"==typeof t.then}},function(t,e,r){"use strict";var n=/\./g;t.exports=function(t){if(-1===t.indexOf("."))return[t];for(var e=t.split(n),r=e.length,i=new Array(r),o="",s=0;s<r;++s)o+=0!==o.length?"."+e[s]:e[s],i[s]=o;return i}},function(t,e,r){"use strict";
|
|
1664
1661
|
/*!
|
|
1665
1662
|
* Module dependencies.
|
|
1666
1663
|
*/var n=r(13),i=r(12).EventEmitter,o=r(7),s=r(85),a=r(18),u=o.ValidationError,h=r(157),f=r(33);function c(t,e,r,i,u){if(!(this instanceof c))return new c(t,e,r,i,u);if(f(e)&&!e.instanceOfSchema&&(e=new s(e)),e=this.schema||e,!this.schema&&e.options._id&&void 0===(t=t||{})._id&&(t._id=new a),!e)throw new o.MissingSchemaError;for(var l in this.$__setSchema(e),n.call(this,t,r,i,u),h(this,e,{decorateDoc:!0}),e.methods)this[l]=e.methods[l];for(var d in e.statics)this[d]=e.statics[d]}
|