noxium 1.0.6 → 1.0.9

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.
Files changed (45) hide show
  1. package/README.md +169 -14
  2. package/build.ts +65 -0
  3. package/dist/drivers/mongo.cjs +1080 -0
  4. package/dist/drivers/mongo.cjs.map +456 -0
  5. package/dist/drivers/mongo.d.ts +4 -0
  6. package/dist/drivers/mongo.d.ts.map +1 -0
  7. package/dist/drivers/mongo.mjs +1081 -0
  8. package/dist/drivers/mongo.mjs.map +456 -0
  9. package/dist/drivers/sqlite.cjs +18 -0
  10. package/dist/drivers/sqlite.cjs.map +11 -0
  11. package/dist/drivers/sqlite.d.ts +4 -0
  12. package/dist/drivers/sqlite.d.ts.map +1 -0
  13. package/dist/drivers/sqlite.mjs +19 -0
  14. package/dist/drivers/sqlite.mjs.map +11 -0
  15. package/dist/error.cjs +18 -0
  16. package/dist/error.cjs.map +10 -0
  17. package/dist/error.d.ts +16 -0
  18. package/dist/error.d.ts.map +1 -0
  19. package/dist/error.mjs +19 -0
  20. package/dist/error.mjs.map +10 -0
  21. package/dist/noxium.cjs +1080 -0
  22. package/dist/noxium.cjs.map +473 -0
  23. package/dist/noxium.d.ts +21 -0
  24. package/dist/noxium.d.ts.map +1 -0
  25. package/dist/noxium.mjs +1081 -0
  26. package/dist/noxium.mjs.map +473 -0
  27. package/dist/schema.cjs +4 -0
  28. package/dist/schema.cjs.map +9 -0
  29. package/dist/schema.d.ts +84 -0
  30. package/dist/schema.d.ts.map +1 -0
  31. package/dist/schema.mjs +4 -0
  32. package/dist/schema.mjs.map +9 -0
  33. package/package.json +21 -23
  34. package/dist/cjs/createClient.cjs +0 -54
  35. package/dist/cjs/drivers/mongo.cjs +0 -61
  36. package/dist/cjs/drivers/sqlite.cjs +0 -74
  37. package/dist/cjs/error.cjs +0 -46
  38. package/dist/cjs/noxium.cjs +0 -39
  39. package/dist/cjs/schema.cjs +0 -2
  40. package/dist/esm/createClient.js +0 -52
  41. package/dist/esm/drivers/mongo.js +0 -59
  42. package/dist/esm/drivers/sqlite.js +0 -72
  43. package/dist/esm/error.js +0 -41
  44. package/dist/esm/noxium.js +0 -37
  45. package/dist/esm/schema.js +0 -1
@@ -0,0 +1,1081 @@
1
+ // @bun
2
+ var HX=Object.create;var{getPrototypeOf:GX,defineProperty:iS,getOwnPropertyNames:YX}=Object;var oS=Object.prototype.hasOwnProperty;function QX(e){return this[e]}var JX,XX,uS=(e,t,r)=>{var n=e!=null&&typeof e==="object";if(n){var s=t?JX??=new WeakMap:XX??=new WeakMap,i=s.get(e);if(i)return i}r=e!=null?HX(GX(e)):{};let o=t||!e||!e.__esModule||!oS.call(e,"default")?iS(r,"default",{value:e,enumerable:!0}):r;if(e&&typeof e==="object"||typeof e==="function"){for(let u of YX(e))if(!oS.call(o,u))iS(o,u,{get:QX.bind(e,u),enumerable:!0})}if(n)s.set(e,o);return o};var g=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var L=import.meta.require;var Ii=g(function(ZX){ZX.getBooleanOption=(e,t)=>{let r=!1;if(t in e&&typeof(r=e[t])!=="boolean")throw TypeError(`Expected the "${t}" option to be a boolean`);return r};ZX.cppdb=Symbol();ZX.inspect=Symbol.for("nodejs.util.inspect.custom")});var Bg=g(function(e9e,aS){class md extends Error{constructor(e,t){if(typeof t!=="string")throw TypeError("Expected second argument to be a string");super(""+e);if(this.code=t,typeof Error.captureStackTrace==="function")Error.captureStackTrace(this,md)}}Object.defineProperty(md.prototype,"name",{value:"SqliteError",writable:!0,enumerable:!1,configurable:!0});aS.exports=md});var cS=g(function(nZ){var{cppdb:$i}=Ii();nZ.prepare=function(t){return this[$i].prepare(t,this,!1,!1)};nZ.exec=function(t){return this[$i].exec(t),this};nZ.close=function(){return this[$i].close(),this};nZ.loadExtension=function(...t){return this[$i].loadExtension(...t),this};nZ.defaultSafeIntegers=function(...t){return this[$i].defaultSafeIntegers(...t),this};nZ.unsafeMode=function(...t){return this[$i].unsafeMode(...t),this};nZ.getters={name:{get:function(){return this[$i].name},enumerable:!0},open:{get:function(){return this[$i].open},enumerable:!0},inTransaction:{get:function(){return this[$i].inTransaction},enumerable:!0},readonly:{get:function(){return this[$i].readonly},enumerable:!0},memory:{get:function(){return this[$i].memory},enumerable:!0}}});var fS=g(function(r9e,hS){var{cppdb:hZ}=Ii(),lS=new WeakMap;hS.exports=function(t){if(typeof t!=="function")throw TypeError("Expected first argument to be a function");let r=this[hZ],n=fZ(r,this),{apply:s}=Function.prototype,i={default:{value:yd(s,t,r,n.default)},deferred:{value:yd(s,t,r,n.deferred)},immediate:{value:yd(s,t,r,n.immediate)},exclusive:{value:yd(s,t,r,n.exclusive)},database:{value:this,enumerable:!0}};return Object.defineProperties(i.default.value,i),Object.defineProperties(i.deferred.value,i),Object.defineProperties(i.immediate.value,i),Object.defineProperties(i.exclusive.value,i),i.default.value};var fZ=(e,t)=>{let r=lS.get(e);if(!r){let n={commit:e.prepare("COMMIT",t,!1,!1),rollback:e.prepare("ROLLBACK",t,!1,!1),savepoint:e.prepare("SAVEPOINT `\t_bs3.\t`",t,!1,!1),release:e.prepare("RELEASE `\t_bs3.\t`",t,!1,!1),rollbackTo:e.prepare("ROLLBACK TO `\t_bs3.\t`",t,!1,!1)};lS.set(e,r={default:Object.assign({begin:e.prepare("BEGIN",t,!1,!1)},n),deferred:Object.assign({begin:e.prepare("BEGIN DEFERRED",t,!1,!1)},n),immediate:Object.assign({begin:e.prepare("BEGIN IMMEDIATE",t,!1,!1)},n),exclusive:Object.assign({begin:e.prepare("BEGIN EXCLUSIVE",t,!1,!1)},n)})}return r},yd=(e,t,r,{begin:n,commit:s,rollback:i,savepoint:o,release:u,rollbackTo:a})=>function(){let l,f,h;if(r.inTransaction)l=o,f=u,h=a;else l=n,f=s,h=i;l.run();try{let d=e.call(t,this,arguments);if(d&&typeof d.then==="function")throw TypeError("Transaction function cannot return a promise");return f.run(),d}catch(d){if(r.inTransaction){if(h.run(),h!==i)f.run()}throw d}}});var pS=g(function(n9e,dS){var{getBooleanOption:dZ,cppdb:pZ}=Ii();dS.exports=function(t,r){if(r==null)r={};if(typeof t!=="string")throw TypeError("Expected first argument to be a string");if(typeof r!=="object")throw TypeError("Expected second argument to be an options object");let n=dZ(r,"simple"),s=this[pZ].prepare(`PRAGMA ${t}`,this,!0,!1);return n?s.pluck().get():s.all()}});var yS=g(function(s9e,mS){var{cppdb:mZ}=Ii();mS.exports=function(t){if(typeof t!=="string")throw TypeError("Expected first argument to be a string");return this[mZ].prepare(`EXPLAIN ${t}`,this,!1,!0).all()}});var wS=g(function(i9e,AS){var ES=L("fs"),_S=L("path"),{promisify:yZ}=L("util"),{cppdb:gZ}=Ii(),gS=yZ(ES.access);AS.exports=async function(t,r){if(r==null)r={};if(typeof t!=="string")throw TypeError("Expected first argument to be a string");if(typeof r!=="object")throw TypeError("Expected second argument to be an options object");t=t.trim();let n="attached"in r?r.attached:"main",s="progress"in r?r.progress:null;if(!t)throw TypeError("Backup filename cannot be an empty string");if(t===":memory:")throw TypeError('Invalid backup filename ":memory:"');if(typeof n!=="string")throw TypeError('Expected the "attached" option to be a string');if(!n)throw TypeError('The "attached" option cannot be an empty string');if(s!=null&&typeof s!=="function")throw TypeError('Expected the "progress" option to be a function');await gS(_S.dirname(t)).catch(()=>{throw TypeError("Cannot save backup because the directory does not exist")});let i=await gS(t).then(()=>!1,()=>!0);return EZ(this[gZ].backup(this,n,t,i),s||null)};var EZ=(e,t)=>{let r=0,n=!0;return new Promise((s,i)=>{setImmediate(function o(){try{let u=e.transfer(r);if(!u.remainingPages){e.close(),s(u);return}if(n)n=!1,r=100;if(t){let a=t(u);if(a!==void 0)if(typeof a==="number"&&a===a)r=Math.max(0,Math.min(2147483647,Math.round(a)));else throw TypeError("Expected progress callback to return a number or undefined")}setImmediate(o)}catch(u){e.close(),i(u)}})})}});var SS=g(function(o9e,OS){var{cppdb:_Z}=Ii();OS.exports=function(t){if(t==null)t={};if(typeof t!=="object")throw TypeError("Expected first argument to be an options object");let r="attached"in t?t.attached:"main";if(typeof r!=="string")throw TypeError('Expected the "attached" option to be a string');if(!r)throw TypeError('The "attached" option cannot be an empty string');return this[_Z].serialize(r)}});var bS=g(function(u9e,CS){var{getBooleanOption:gd,cppdb:AZ}=Ii();CS.exports=function(t,r,n){if(r==null)r={};if(typeof r==="function")n=r,r={};if(typeof t!=="string")throw TypeError("Expected first argument to be a string");if(typeof n!=="function")throw TypeError("Expected last argument to be a function");if(typeof r!=="object")throw TypeError("Expected second argument to be an options object");if(!t)throw TypeError("User-defined function name cannot be an empty string");let s="safeIntegers"in r?+gd(r,"safeIntegers"):2,i=gd(r,"deterministic"),o=gd(r,"directOnly"),u=gd(r,"varargs"),a=-1;if(!u){if(a=n.length,!Number.isInteger(a)||a<0)throw TypeError("Expected function.length to be a positive integer");if(a>100)throw RangeError("User-defined functions cannot have more than 100 arguments")}return this[AZ].function(n,t,a,s,i,o),this}});var MS=g(function(a9e,TS){var{getBooleanOption:Ed,cppdb:wZ}=Ii();TS.exports=function(t,r){if(typeof t!=="string")throw TypeError("Expected first argument to be a string");if(typeof r!=="object"||r===null)throw TypeError("Expected second argument to be an options object");if(!t)throw TypeError("User-defined function name cannot be an empty string");let n="start"in r?r.start:null,s=Ng(r,"step",!0),i=Ng(r,"inverse",!1),o=Ng(r,"result",!1),u="safeIntegers"in r?+Ed(r,"safeIntegers"):2,a=Ed(r,"deterministic"),c=Ed(r,"directOnly"),l=Ed(r,"varargs"),f=-1;if(!l){if(f=Math.max(DS(s),i?DS(i):0),f>0)f-=1;if(f>100)throw RangeError("User-defined functions cannot have more than 100 arguments")}return this[wZ].aggregate(n,s,i,o,t,f,u,a,c),this};var Ng=(e,t,r)=>{let n=t in e?e[t]:null;if(typeof n==="function")return n;if(n!=null)throw TypeError(`Expected the "${t}" option to be a function`);if(r)throw TypeError(`Missing required option "${t}"`);return null},DS=({length:e})=>{if(Number.isInteger(e)&&e>=0)return e;throw TypeError("Expected function.length to be a positive integer")}});var NS=g(function(c9e,BS){var{cppdb:OZ}=Ii();BS.exports=function(t,r){if(typeof t!=="string")throw TypeError("Expected first argument to be a string");if(!t)throw TypeError("Virtual table module name cannot be an empty string");let n=!1;if(typeof r==="object"&&r!==null)n=!0,r=PZ(FS(r,"used",t));else{if(typeof r!=="function")throw TypeError("Expected second argument to be a function or a table definition object");r=SZ(r)}return this[OZ].table(r,t,n),this};function SZ(e){return function(r,n,s,...i){let o={module:r,database:n,table:s},u=MZ.call(e,o,i);if(typeof u!=="object"||u===null)throw TypeError(`Virtual table module "${r}" did not return a table definition object`);return FS(u,"returned",r)}}function FS(e,t,r){if(!ch.call(e,"rows"))throw TypeError(`Virtual table module "${r}" ${t} a table definition without a "rows" property`);if(!ch.call(e,"columns"))throw TypeError(`Virtual table module "${r}" ${t} a table definition without a "columns" property`);let n=e.rows;if(typeof n!=="function"||Object.getPrototypeOf(n)!==xZ)throw TypeError(`Virtual table module "${r}" ${t} a table definition with an invalid "rows" property (should be a generator function)`);let s=e.columns;if(!Array.isArray(s)||!PS(s=[...s]))throw TypeError(`Virtual table module "${r}" ${t} a table definition with an invalid "columns" property (should be an array of strings)`);if(s.length!==new Set(s).size)throw TypeError(`Virtual table module "${r}" ${t} a table definition with duplicate column names`);if(!s.length)throw RangeError(`Virtual table module "${r}" ${t} a table definition with zero columns`);let i;if(ch.call(e,"parameters")){if(i=e.parameters,!Array.isArray(i)||!PS(i=[...i]))throw TypeError(`Virtual table module "${r}" ${t} a table definition with an invalid "parameters" property (should be an array of strings)`)}else i=TZ(n);if(i.length!==new Set(i).size)throw TypeError(`Virtual table module "${r}" ${t} a table definition with duplicate parameter names`);if(i.length>32)throw RangeError(`Virtual table module "${r}" ${t} a table definition with more than the maximum number of 32 parameters`);for(let c of i)if(s.includes(c))throw TypeError(`Virtual table module "${r}" ${t} a table definition with column "${c}" which was ambiguously defined as both a column and parameter`);let o=2;if(ch.call(e,"safeIntegers")){let c=e.safeIntegers;if(typeof c!=="boolean")throw TypeError(`Virtual table module "${r}" ${t} a table definition with an invalid "safeIntegers" property (should be a boolean)`);o=+c}let u=!1;if(ch.call(e,"directOnly")){if(u=e.directOnly,typeof u!=="boolean")throw TypeError(`Virtual table module "${r}" ${t} a table definition with an invalid "directOnly" property (should be a boolean)`)}return[`CREATE TABLE x(${[...i.map(xS).map((c)=>`${c} HIDDEN`),...s.map(xS)].join(", ")});`,CZ(n,new Map(s.map((c,l)=>[c,i.length+l])),r),i,o,u]}function CZ(e,t,r){return function*(...s){let i=s.map((o)=>Buffer.isBuffer(o)?Buffer.from(o):o);for(let o=0;o<t.size;++o)i.push(null);for(let o of e(...s))if(Array.isArray(o))bZ(o,i,t.size,r),yield i;else if(typeof o==="object"&&o!==null)DZ(o,i,t,r),yield i;else throw TypeError(`Virtual table module "${r}" yielded something that isn't a valid row object`)}}function bZ(e,t,r,n){if(e.length!==r)throw TypeError(`Virtual table module "${n}" yielded a row with an incorrect number of columns`);let s=t.length-r;for(let i=0;i<r;++i)t[i+s]=e[i]}function DZ(e,t,r,n){let s=0;for(let i of Object.keys(e)){let o=r.get(i);if(o===void 0)throw TypeError(`Virtual table module "${n}" yielded a row with an undeclared column "${i}"`);t[o]=e[i],s+=1}if(s!==r.size)throw TypeError(`Virtual table module "${n}" yielded a row with missing columns`)}function TZ({length:e}){if(!Number.isInteger(e)||e<0)throw TypeError("Expected function.length to be a positive integer");let t=[];for(let r=0;r<e;++r)t.push(`$${r+1}`);return t}var{hasOwnProperty:ch}=Object.prototype,{apply:MZ}=Function.prototype,xZ=Object.getPrototypeOf(function*(){}),xS=(e)=>`"${e.replace(/"/g,'""')}"`,PZ=(e)=>()=>e,PS=(e)=>{for(let t=0;t<e.length;++t)if(typeof e[t]!=="string")return!1;return!0}});var $S=g(function(l9e,IS){var FZ=function(){};IS.exports=function(t,r){return Object.assign(new FZ,this)}});var qS=g(function(h9e,kS){var RS=L("fs"),vS=L("path"),pu=Ii(),BZ=Bg();kS.exports=function(t,r){function n(i,o){if(new.target==null)return new n(i,o);let u,a;if(Buffer.isBuffer(i))u=i,i=":memory:";else if(typeof i==="number"){if(!Number.isInteger(i)||i<0||i>2147483647)throw TypeError("Expected the file descriptor to be a non-negative 32-bit integer");a=i,i=`fd:${a}`}if(i==null)i="";if(o==null)o={};if(typeof i!=="string")throw TypeError("Expected first argument to be a string");if(typeof o!=="object")throw TypeError("Expected second argument to be an options object");if("readOnly"in o)throw TypeError('Misspelled option "readOnly" should be "readonly"');if("memory"in o)throw TypeError('Option "memory" was removed in v7.0.0 (use ":memory:" filename instead)');let c=i.trim(),l=c===""||c===":memory:",f=pu.getBooleanOption(o,"readonly"),h=pu.getBooleanOption(o,"fileMustExist"),d="timeout"in o?o.timeout:5000,p="verbose"in o?o.verbose:null,m="nativeBinding"in o?o.nativeBinding:null,E="journalFd"in o?o.journalFd:void 0;if(f&&l&&!u)throw TypeError("In-memory/temporary databases cannot be readonly");if(!Number.isInteger(d)||d<0)throw TypeError('Expected the "timeout" option to be a positive integer');if(d>2147483647)throw RangeError('Option "timeout" cannot be greater than 2147483647');if(p!=null&&typeof p!=="function")throw TypeError('Expected the "verbose" option to be a function');if(a!==void 0&&E===void 0)throw TypeError('The "journalFd" option is required when opening a database from a file descriptor');if(a===void 0&&E!==void 0)throw TypeError('The "journalFd" option can only be used when opening a database from a file descriptor');if(E!==void 0&&!(Number.isInteger(E)&&E>=0&&E<=2147483647))throw TypeError('Expected the "journalFd" option to be a non-negative 32-bit integer');if(!r&&"nativeBinding"in o)throw TypeError('The "nativeBinding" option is only supported by the default better-sqlite3 entrypoint');if(r&&m!=null&&typeof m!=="string"&&typeof m!=="object")throw TypeError('Expected the "nativeBinding" option to be a string or addon object');let y=t(m);if(!y.isInitialized)y.initialize(BZ,NZ,IZ,$Z,RZ),y.isInitialized=!0;if(a===void 0&&!l&&!c.startsWith("file:")&&!RS.existsSync(vS.dirname(c)))throw TypeError("Cannot open database because the directory does not exist");Object.defineProperties(this,{[pu.cppdb]:{value:new y.Database(c,i,l,f,h,d,p||null,u||null,a??null,E??null)},...s.getters})}let s=cS();return n.prototype.prepare=s.prepare,n.prototype.transaction=fS(),n.prototype.pragma=pS(),n.prototype.explain=yS(),n.prototype.backup=wS(),n.prototype.serialize=SS(),n.prototype.function=bS(),n.prototype.aggregate=MS(),n.prototype.table=NS(),n.prototype.loadExtension=s.loadExtension,n.prototype.exec=s.exec,n.prototype.close=s.close,n.prototype.defaultSafeIntegers=s.defaultSafeIntegers,n.prototype.unsafeMode=s.unsafeMode,n.prototype[pu.inspect]=$S(),n};function NZ(...e){return e}function IZ(e,...t){let r=e.length;for(let n=0;n<t.length;++n)e[r+n]=t[n]}function $Z(...e){if(!e.includes("__proto__")){let t=e.map((n,s)=>`v${s}`).join(","),r=e.map((n,s)=>`${JSON.stringify(n)}:v${s}`).join(",");return Function(`return (${t}) => ({${r}})`)()}return(...t)=>{let r={};for(let n=0;n<e.length;++n)r[e[n]]=t[n];return r}}function RZ(e){return{value:e,done:!1}}});var LS=g(function(LZ){var __dirname="/home/runner/work/noxium/noxium/node_modules/better-sqlite3/lib",yu=L("fs"),mu=L("path"),vZ=["linux","darwin","win32"],kZ=["x64","arm64"],_d;function qZ(e){if(typeof e==="string")return(typeof __non_webpack_require__==="function"?__non_webpack_require__:L)(mu.resolve(e).replace(/(\.node)?$/,".node"));if(typeof e==="object"&&e!==null)return e;if(_d)return _d;let t=mu.join(__dirname,"..","build","Debug","better_sqlite3.node");if(!yu.existsSync(t))t=mu.join(__dirname,"..","build","Release","better_sqlite3.node");if(yu.existsSync(t))return _d=L(t);return _d=L(jS()||t)}function jS(){if(vZ.includes(process.platform)&&kZ.includes(process.arch)){let e=`${jZ()?"linuxmusl":process.platform}-${process.arch}`,t=mu.join(__dirname,"..","prebuilds",`${e}.node`);if(yu.existsSync(t))return t}return null}function jZ(){if(process.platform!=="linux")return!1;try{let r=yu.readFileSync("/proc/self/maps","latin1");if(/\/ld-musl-[^/\s]*\.so/.test(r))return!0;if(/\/(?:ld-linux[^/\s]*|libc)\.so\.\d/.test(r))return!1}catch{}let{report:e}=process,t=e.excludeNetwork;e.excludeNetwork=!0;try{return!e.getReport().header.glibcVersionRuntime}finally{e.excludeNetwork=t}}LZ.getBinding=qZ;LZ.getPrebuildPath=jS});var US=g(function(p9e,Ig){Ig.exports=qS()(LS().getBinding,!0);Ig.exports.SqliteError=Bg()});var Yg=g(function(Xee){var zZ=(()=>{let e=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Uint8Array.prototype),Symbol.toStringTag).get;return(t)=>e.call(t)})();function Cc(e){return zZ(e)==="Uint8Array"}function Lg(e){return typeof e==="object"&&e!=null&&Symbol.toStringTag in e&&(e[Symbol.toStringTag]==="ArrayBuffer"||e[Symbol.toStringTag]==="SharedArrayBuffer")}function Od(e){return e instanceof RegExp||Object.prototype.toString.call(e)==="[object RegExp]"}function bd(e){return typeof e==="object"&&e!=null&&Symbol.toStringTag in e&&e[Symbol.toStringTag]==="Map"}function Sd(e){return e instanceof Date||Object.prototype.toString.call(e)==="[object Date]"}function Ps(e,t){return JSON.stringify(e,(r,n)=>{if(typeof n==="bigint")return{$numberLong:`${n}`};else if(bd(n))return Object.fromEntries(n);return n})}function WZ(e){if(e!=null&&typeof e==="object"&&"stylize"in e&&typeof e.stylize==="function")return e.stylize}var yh=7,Dd=Symbol.for("@@mdb.bson.version"),gh=2147483647,Eh=-2147483648,uC=Math.pow(2,63)-1,aC=-Math.pow(2,63),cC=Math.pow(2,53),lC=-Math.pow(2,53),Ug=1,hC=2,dh=3,fh=4,Vg=5,KZ=6,fC=7,dC=8,pC=9,zg=10,Cd=11,HZ=12,Wg=13,mC=14,wd=15,ph=16,yC=17,Kg=18,gC=19,EC=255,_C=127,GZ=0,Hg=4,AC=Object.freeze({double:1,string:2,object:3,array:4,binData:5,undefined:6,objectId:7,bool:8,date:9,null:10,regex:11,dbPointer:12,javascript:13,symbol:14,javascriptWithScope:15,int:16,timestamp:17,long:18,decimal:19,minKey:-1,maxKey:127});class I extends Error{get bsonError(){return!0}get name(){return"BSONError"}constructor(e,t){super(e,t)}static isBSONError(e){return e!=null&&typeof e==="object"&&"bsonError"in e&&e.bsonError===!0&&"name"in e&&"message"in e&&"stack"in e}}class bc extends I{get name(){return"BSONVersionError"}constructor(){super(`Unsupported BSON version, bson types must be from bson ${yh}.x.x`)}}class mh extends I{get name(){return"BSONRuntimeError"}constructor(e){super(e)}}class vi extends I{get name(){return"BSONOffsetError"}offset;constructor(e,t,r){super(`${e}. offset: ${t}`,r);this.offset=t}}var VS,zS;function wC(e,t,r,n){if(n){VS??=new TextDecoder("utf8",{fatal:!0});try{return VS.decode(e.subarray(t,r))}catch(s){throw new I("Invalid UTF-8 string in BSON document",{cause:s})}}return zS??=new TextDecoder("utf8",{fatal:!1}),zS.decode(e.subarray(t,r))}function OC(e,t,r){if(e.length===0)return"";let n=r-t;if(n===0)return"";if(n>20)return null;if(n===1&&e[t]<128)return String.fromCharCode(e[t]);if(n===2&&e[t]<128&&e[t+1]<128)return String.fromCharCode(e[t])+String.fromCharCode(e[t+1]);if(n===3&&e[t]<128&&e[t+1]<128&&e[t+2]<128)return String.fromCharCode(e[t])+String.fromCharCode(e[t+1])+String.fromCharCode(e[t+2]);let s=[];for(let i=t;i<r;i++){let o=e[i];if(o>127)return null;s.push(o)}return String.fromCharCode(...s)}function YZ(e,t,r){if(t.length===0)return 0;if(t.length>25)return null;if(e.length-r<t.length)return null;for(let n=0,s=r;n<t.length;n++,s++){let i=t.charCodeAt(n);if(i>127)return null;e[s]=i}return t.length}function QZ(e){return Vs.fromNumberArray(Array.from({length:e},()=>Math.floor(Math.random()*256)))}function JZ(e){return crypto.getRandomValues(Vs.allocate(e))}var XZ=(()=>{let{crypto:e}=globalThis;if(e!=null&&typeof e.getRandomValues==="function")return JZ;else return QZ})(),Vs={isUint8Array:Cc,toLocalBufferType(e){if(Buffer.isBuffer(e))return e;if(ArrayBuffer.isView(e))return Buffer.from(e.buffer,e.byteOffset,e.byteLength);let t=e?.[Symbol.toStringTag]??Object.prototype.toString.call(e);if(t==="ArrayBuffer"||t==="SharedArrayBuffer"||t==="[object ArrayBuffer]"||t==="[object SharedArrayBuffer]")return Buffer.from(e);throw new I("Cannot create Buffer from the passed potentialBuffer.")},allocate(e){return Buffer.alloc(e)},allocateUnsafe(e){return Buffer.allocUnsafe(e)},compare(e,t){return Vs.toLocalBufferType(e).compare(t)},concat(e){return Buffer.concat(e)},copy(e,t,r,n,s){return Vs.toLocalBufferType(e).copy(t,r??0,n??0,s??e.length)},equals(e,t){return Vs.toLocalBufferType(e).equals(t)},fromNumberArray(e){return Buffer.from(e)},fromBase64(e){return Buffer.from(e,"base64")},fromUTF8(e){return Buffer.from(e,"utf8")},toBase64(e){return Vs.toLocalBufferType(e).toString("base64")},fromISO88591(e){return Buffer.from(e,"binary")},toISO88591(e){return Vs.toLocalBufferType(e).toString("binary")},fromHex(e){return Buffer.from(e,"hex")},toHex(e){return Vs.toLocalBufferType(e).toString("hex")},toUTF8(e,t,r,n){let s=r-t<=20?OC(e,t,r):null;if(s!=null)return s;let i=Vs.toLocalBufferType(e).toString("utf8",t,r);if(n){for(let o=0;o<i.length;o++)if(i.charCodeAt(o)===65533){wC(e,t,r,!0);break}}return i},utf8ByteLength(e){return Buffer.byteLength(e,"utf8")},encodeUTF8Into(e,t,r){let n=YZ(e,t,r);if(n!=null)return n;return Vs.toLocalBufferType(e).write(t,r,void 0,"utf8")},randomBytes:XZ,swap32(e){return Vs.toLocalBufferType(e).swap32()}};function ZZ(){let{navigator:e}=globalThis;return typeof e==="object"&&e.product==="ReactNative"}function eee(e){if(e<0)throw RangeError(`The argument 'byteLength' is invalid. Received ${e}`);return Pa.fromNumberArray(Array.from({length:e},()=>Math.floor(Math.random()*256)))}var tee=(()=>{let{crypto:e}=globalThis;if(e!=null&&typeof e.getRandomValues==="function")return(t)=>e.getRandomValues(Pa.allocate(t));else{if(ZZ()){let{console:t}=globalThis;t?.warn?.("BSON: For React Native please polyfill crypto.getRandomValues, e.g. using: https://www.npmjs.com/package/react-native-get-random-values.")}return eee}})(),WS=/(\d|[a-f])/i,Pa={isUint8Array:Cc,toLocalBufferType(e){let t=e?.[Symbol.toStringTag]??Object.prototype.toString.call(e);if(t==="Uint8Array")return e;if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength));if(t==="ArrayBuffer"||t==="SharedArrayBuffer"||t==="[object ArrayBuffer]"||t==="[object SharedArrayBuffer]")return new Uint8Array(e);throw new I("Cannot make a Uint8Array from passed potentialBuffer.")},allocate(e){if(typeof e!=="number")throw TypeError(`The "size" argument must be of type number. Received ${String(e)}`);return new Uint8Array(e)},allocateUnsafe(e){return Pa.allocate(e)},compare(e,t){if(e===t)return 0;let r=Math.min(e.length,t.length);for(let n=0;n<r;n++){if(e[n]<t[n])return-1;if(e[n]>t[n])return 1}if(e.length<t.length)return-1;if(e.length>t.length)return 1;return 0},concat(e){if(e.length===0)return Pa.allocate(0);let t=0;for(let s of e)t+=s.length;let r=Pa.allocate(t),n=0;for(let s of e)r.set(s,n),n+=s.length;return r},copy(e,t,r,n,s){if(s!==void 0&&s<0)throw RangeError(`The value of "sourceEnd" is out of range. It must be >= 0. Received ${s}`);if(s=s??e.length,n!==void 0&&(n<0||n>s))throw RangeError(`The value of "sourceStart" is out of range. It must be >= 0 and <= ${s}. Received ${n}`);if(n=n??0,r!==void 0&&r<0)throw RangeError(`The value of "targetStart" is out of range. It must be >= 0. Received ${r}`);r=r??0;let i=e.subarray(n,s),o=Math.min(i.length,t.length-r);if(o<=0)return 0;return t.set(i.subarray(0,o),r),o},equals(e,t){if(e.byteLength!==t.byteLength)return!1;for(let r=0;r<e.byteLength;r++)if(e[r]!==t[r])return!1;return!0},fromNumberArray(e){return Uint8Array.from(e)},fromBase64(e){return Uint8Array.from(atob(e),(t)=>t.charCodeAt(0))},fromUTF8(e){return new TextEncoder().encode(e)},toBase64(e){return btoa(Pa.toISO88591(e))},fromISO88591(e){return Uint8Array.from(e,(t)=>t.charCodeAt(0)&255)},toISO88591(e){return Array.from(Uint16Array.from(e),(t)=>String.fromCharCode(t)).join("")},fromHex(e){let t=e.length%2===0?e:e.slice(0,e.length-1),r=[];for(let n=0;n<t.length;n+=2){let s=t[n],i=t[n+1];if(!WS.test(s))break;if(!WS.test(i))break;let o=Number.parseInt(`${s}${i}`,16);r.push(o)}return Uint8Array.from(r)},toHex(e){return Array.from(e,(t)=>t.toString(16).padStart(2,"0")).join("")},toUTF8(e,t,r,n){let s=r-t<=20?OC(e,t,r):null;if(s!=null)return s;return wC(e,t,r,n)},utf8ByteLength(e){return new TextEncoder().encode(e).byteLength},encodeUTF8Into(e,t,r){let n=new TextEncoder().encode(t);return e.set(n,r),n.byteLength},randomBytes:tee,swap32(e){if(e.length%4!==0)throw RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<e.length;t+=4){let r=e[t],n=e[t+1],s=e[t+2],i=e[t+3];e[t]=i,e[t+1]=s,e[t+2]=n,e[t+3]=r}return e}},ree=typeof Buffer==="function"&&Buffer.prototype?._isBuffer!==!0,B=ree?Vs:Pa,Fa=Symbol.for("@@mdb.bson.type");class Kn{get[Fa](){return this._bsontype}get[Dd](){return yh}[Symbol.for("nodejs.util.inspect.custom")](e,t,r){return this.inspect(e,t,r)}}var Oc=new Float64Array(1),lt=new Uint8Array(Oc.buffer,0,8);Oc[0]=-1;var $g=lt[7]===0,Ee={isBigEndian:$g,getNonnegativeInt32LE(e,t){if(e[t+3]>127)throw RangeError(`Size cannot be negative at offset: ${t}`);return e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24},getInt32LE(e,t){return e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24},getUint32LE(e,t){return e[t]+e[t+1]*256+e[t+2]*65536+e[t+3]*16777216},getUint32BE(e,t){return e[t+3]+e[t+2]*256+e[t+1]*65536+e[t]*16777216},getBigInt64LE(e,t){let r=BigInt(e[t+4]+e[t+5]*256+e[t+6]*65536+(e[t+7]<<24)),n=BigInt(e[t]+e[t+1]*256+e[t+2]*65536+e[t+3]*16777216);return(r<<32n)+n},getFloat64LE:$g?(e,t)=>(lt[7]=e[t],lt[6]=e[t+1],lt[5]=e[t+2],lt[4]=e[t+3],lt[3]=e[t+4],lt[2]=e[t+5],lt[1]=e[t+6],lt[0]=e[t+7],Oc[0]):(e,t)=>(lt[0]=e[t],lt[1]=e[t+1],lt[2]=e[t+2],lt[3]=e[t+3],lt[4]=e[t+4],lt[5]=e[t+5],lt[6]=e[t+6],lt[7]=e[t+7],Oc[0]),setInt32BE(e,t,r){return e[t+3]=r,r>>>=8,e[t+2]=r,r>>>=8,e[t+1]=r,r>>>=8,e[t]=r,4},setInt32LE(e,t,r){return e[t]=r,r>>>=8,e[t+1]=r,r>>>=8,e[t+2]=r,r>>>=8,e[t+3]=r,4},setBigInt64LE(e,t,r){let n=0xffffffffn,s=Number(r&n);e[t]=s,s>>=8,e[t+1]=s,s>>=8,e[t+2]=s,s>>=8,e[t+3]=s;let i=Number(r>>32n&n);return e[t+4]=i,i>>=8,e[t+5]=i,i>>=8,e[t+6]=i,i>>=8,e[t+7]=i,8},setFloat64LE:$g?(e,t,r)=>(Oc[0]=r,e[t]=lt[7],e[t+1]=lt[6],e[t+2]=lt[5],e[t+3]=lt[4],e[t+4]=lt[3],e[t+5]=lt[2],e[t+6]=lt[1],e[t+7]=lt[0],8):(e,t,r)=>(Oc[0]=r,e[t]=lt[0],e[t+1]=lt[1],e[t+2]=lt[2],e[t+3]=lt[3],e[t+4]=lt[4],e[t+5]=lt[5],e[t+6]=lt[6],e[t+7]=lt[7],8)};class ve extends Kn{get _bsontype(){return"Binary"}static BSON_BINARY_SUBTYPE_DEFAULT=0;static BUFFER_SIZE=256;static SUBTYPE_DEFAULT=0;static SUBTYPE_FUNCTION=1;static SUBTYPE_BYTE_ARRAY=2;static SUBTYPE_UUID_OLD=3;static SUBTYPE_UUID=4;static SUBTYPE_MD5=5;static SUBTYPE_ENCRYPTED=6;static SUBTYPE_COLUMN=7;static SUBTYPE_SENSITIVE=8;static SUBTYPE_VECTOR=9;static SUBTYPE_USER_DEFINED=128;static VECTOR_TYPE=Object.freeze({Int8:3,Float32:39,PackedBit:16});buffer;sub_type;position;constructor(e,t){super();if(e!=null&&typeof e==="string"&&!ArrayBuffer.isView(e)&&!Lg(e)&&!Array.isArray(e))throw new I("Binary can only be constructed from Uint8Array or number[]");if(this.sub_type=(t??ve.BSON_BINARY_SUBTYPE_DEFAULT)&255,e==null)this.buffer=B.allocate(ve.BUFFER_SIZE),this.position=0;else this.buffer=Array.isArray(e)?B.fromNumberArray(e):B.toLocalBufferType(e),this.position=this.buffer.byteLength}put(e){if(typeof e==="string"&&e.length!==1)throw new I("only accepts single character String");else if(typeof e!=="number"&&e.length!==1)throw new I("only accepts single character Uint8Array or Array");let t;if(typeof e==="string")t=e.charCodeAt(0);else if(typeof e==="number")t=e;else t=e[0];if(t<0||t>255)throw new I("only accepts number in a valid unsigned byte range 0-255");if(this.buffer.byteLength>this.position)this.buffer[this.position++]=t;else{let r=B.allocate(ve.BUFFER_SIZE+this.buffer.length);r.set(this.buffer,0),this.buffer=r,this.buffer[this.position++]=t}}write(e,t){if(t=typeof t==="number"?t:this.position,this.buffer.byteLength<t+e.length){let r=B.allocate(this.buffer.byteLength+e.length);r.set(this.buffer,0),this.buffer=r}if(ArrayBuffer.isView(e))this.buffer.set(B.toLocalBufferType(e),t),this.position=t+e.byteLength>this.position?t+e.length:this.position;else if(typeof e==="string")throw new I("input cannot be string")}read(e,t){t=t&&t>0?t:this.position;let r=e+t;return this.buffer.subarray(e,r>this.position?this.position:r)}value(){return this.buffer.length===this.position?this.buffer:this.buffer.subarray(0,this.position)}length(){return this.position}toJSON(){return B.toBase64(this.buffer.subarray(0,this.position))}toString(e){if(e==="hex")return B.toHex(this.buffer.subarray(0,this.position));if(e==="base64")return B.toBase64(this.buffer.subarray(0,this.position));if(e==="utf8"||e==="utf-8")return B.toUTF8(this.buffer,0,this.position,!1);return B.toUTF8(this.buffer,0,this.position,!1)}toExtendedJSON(e){if(e=e||{},this.sub_type===ve.SUBTYPE_VECTOR)jo(this);let t=B.toBase64(this.buffer),r=Number(this.sub_type).toString(16);if(e.legacy)return{$binary:t,$type:r.length===1?"0"+r:r};return{$binary:{base64:t,subType:r.length===1?"0"+r:r}}}toUUID(){if(this.sub_type===ve.SUBTYPE_UUID)return new dn(this.buffer.subarray(0,this.position));throw new I(`Binary sub_type "${this.sub_type}" (${typeof this.sub_type}) is not supported for converting to UUID. Only 0x${ve.SUBTYPE_UUID.toString(16).padStart(2,"0")} is currently supported.`)}static createFromHexString(e,t){return new ve(B.fromHex(e),t)}static createFromBase64(e,t){return new ve(B.fromBase64(e),t)}static fromExtendedJSON(e,t){t=t||{};let r,n;if("$binary"in e){if(t.legacy&&typeof e.$binary==="string"&&"$type"in e)n=e.$type?parseInt(e.$type,16):0,r=B.fromBase64(e.$binary);else if(typeof e.$binary!=="string")n=e.$binary.subType?parseInt(e.$binary.subType,16):0,r=B.fromBase64(e.$binary.base64)}else if("$uuid"in e)n=4,r=dn.bytesFromString(e.$uuid);if(!r)throw new I(`Unexpected Binary Extended JSON format ${JSON.stringify(e)}`);return n===Hg?new dn(r):new ve(r,n)}inspect(e,t,r){r??=Ps;let n=B.toBase64(this.buffer.subarray(0,this.position)),s=r(n,t),i=r(this.sub_type,t);return`Binary.createFromBase64(${s}, ${i})`}toInt8Array(){if(this.sub_type!==ve.SUBTYPE_VECTOR)throw new I("Binary sub_type is not Vector");if(this.buffer[0]!==ve.VECTOR_TYPE.Int8)throw new I("Binary datatype field is not Int8");return jo(this),new Int8Array(this.buffer.buffer.slice(this.buffer.byteOffset+2,this.buffer.byteOffset+this.position))}toFloat32Array(){if(this.sub_type!==ve.SUBTYPE_VECTOR)throw new I("Binary sub_type is not Vector");if(this.buffer[0]!==ve.VECTOR_TYPE.Float32)throw new I("Binary datatype field is not Float32");jo(this);let e=new Uint8Array(this.buffer.buffer.slice(this.buffer.byteOffset+2,this.buffer.byteOffset+this.position));if(Ee.isBigEndian)B.swap32(e);return new Float32Array(e.buffer)}toPackedBits(){if(this.sub_type!==ve.SUBTYPE_VECTOR)throw new I("Binary sub_type is not Vector");if(this.buffer[0]!==ve.VECTOR_TYPE.PackedBit)throw new I("Binary datatype field is not packed bit");return jo(this),new Uint8Array(this.buffer.buffer.slice(this.buffer.byteOffset+2,this.buffer.byteOffset+this.position))}toBits(){if(this.sub_type!==ve.SUBTYPE_VECTOR)throw new I("Binary sub_type is not Vector");if(this.buffer[0]!==ve.VECTOR_TYPE.PackedBit)throw new I("Binary datatype field is not packed bit");jo(this);let t=(this.length()-2)*8-this.buffer[1],r=new Int8Array(t);for(let n=0;n<r.length;n++){let s=n/8|0,i=this.buffer[s+2],o=7-n%8,u=i>>o&1;r[n]=u}return r}static fromInt8Array(e){let t=B.allocate(e.byteLength+2);t[0]=ve.VECTOR_TYPE.Int8,t[1]=0;let r=new Uint8Array(e.buffer,e.byteOffset,e.byteLength);t.set(r,2);let n=new this(t,this.SUBTYPE_VECTOR);return jo(n),n}static fromFloat32Array(e){let t=B.allocate(e.byteLength+2);t[0]=ve.VECTOR_TYPE.Float32,t[1]=0;let r=new Uint8Array(e.buffer,e.byteOffset,e.byteLength);if(t.set(r,2),Ee.isBigEndian)B.swap32(new Uint8Array(t.buffer,2));let n=new this(t,this.SUBTYPE_VECTOR);return jo(n),n}static fromPackedBits(e,t=0){let r=B.allocate(e.byteLength+2);r[0]=ve.VECTOR_TYPE.PackedBit,r[1]=t,r.set(e,2);let n=new this(r,this.SUBTYPE_VECTOR);return jo(n),n}static fromBits(e){let t=e.length+7>>>3,r=new Uint8Array(t+2);r[0]=ve.VECTOR_TYPE.PackedBit;let n=e.length%8;r[1]=n===0?0:8-n;for(let s=0;s<e.length;s++){let i=s>>>3,o=e[s];if(o!==0&&o!==1)throw new I(`Invalid bit value at ${s}: must be 0 or 1, found ${e[s]}`);if(o===0)continue;let u=7-s%8;r[i+2]|=o<<u}return new this(r,ve.SUBTYPE_VECTOR)}}function jo(e){if(e.sub_type!==ve.SUBTYPE_VECTOR)return;let t=e.position,r=e.buffer[0],n=e.buffer[1];if((r===ve.VECTOR_TYPE.Float32||r===ve.VECTOR_TYPE.Int8)&&n!==0)throw new I("Invalid Vector: padding must be zero for int8 and float32 vectors");if(r===ve.VECTOR_TYPE.Float32){if(t!==0&&t-2!==0&&(t-2)%4!==0)throw new I("Invalid Vector: Float32 vector must contain a multiple of 4 bytes")}if(r===ve.VECTOR_TYPE.PackedBit&&n!==0&&t===2)throw new I("Invalid Vector: padding must be zero for packed bit vectors that are empty");if(r===ve.VECTOR_TYPE.PackedBit&&n>7)throw new I(`Invalid Vector: padding must be a value between 0 and 7. found: ${n}`)}var Rg=16,nee=/^[0-9A-F]{32}$/i,see=/^[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}$/i;class dn extends ve{constructor(e){let t;if(e==null)t=dn.generate();else if(e instanceof dn)t=B.toLocalBufferType(new Uint8Array(e.buffer));else if(ArrayBuffer.isView(e)&&e.byteLength===Rg)t=B.toLocalBufferType(e);else if(typeof e==="string")t=dn.bytesFromString(e);else throw new I("Argument passed in UUID constructor must be a UUID, a 16 byte Buffer or a 32/36 character hex string (dashes excluded/included, format: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx).");super(t,Hg)}get id(){return this.buffer}set id(e){this.buffer=e}toHexString(e=!0){if(e)return[B.toHex(this.buffer.subarray(0,4)),B.toHex(this.buffer.subarray(4,6)),B.toHex(this.buffer.subarray(6,8)),B.toHex(this.buffer.subarray(8,10)),B.toHex(this.buffer.subarray(10,16))].join("-");return B.toHex(this.buffer)}toString(e){if(e==="hex")return B.toHex(this.id);if(e==="base64")return B.toBase64(this.id);return this.toHexString()}toJSON(){return this.toHexString()}equals(e){if(!e)return!1;if(e instanceof dn)return B.equals(e.id,this.id);try{return B.equals(new dn(e).id,this.id)}catch{return!1}}toBinary(){return new ve(this.id,ve.SUBTYPE_UUID)}static generate(){let e=B.randomBytes(Rg);return e[6]=e[6]&15|64,e[8]=e[8]&63|128,e}static isValid(e){if(!e)return!1;if(typeof e==="string")return dn.isValidUUIDString(e);if(Cc(e))return e.byteLength===Rg;return e._bsontype==="Binary"&&e.sub_type===this.SUBTYPE_UUID&&e.buffer.byteLength===16}static createFromHexString(e){let t=dn.bytesFromString(e);return new dn(t)}static createFromBase64(e){return new dn(B.fromBase64(e))}static bytesFromString(e){if(!dn.isValidUUIDString(e))throw new I("UUID string representation must be 32 hex digits or canonical hyphenated representation");return B.fromHex(e.replace(/-/g,""))}static isValidUUIDString(e){return nee.test(e)||see.test(e)}inspect(e,t,r){return r??=Ps,`new UUID(${r(this.toHexString(),t)})`}}class Uo extends Kn{get _bsontype(){return"Code"}code;scope;constructor(e,t){super();this.code=e.toString(),this.scope=t??null}toJSON(){if(this.scope!=null)return{code:this.code,scope:this.scope};return{code:this.code}}toExtendedJSON(){if(this.scope)return{$code:this.code,$scope:this.scope};return{$code:this.code}}static fromExtendedJSON(e){return new Uo(e.$code,e.$scope)}inspect(e,t,r){r??=Ps;let n=r(this.code,t),s=n.includes(`
3
+ `);if(this.scope!=null)n+=`,${s?`
4
+ `:" "}${r(this.scope,t)}`;let i=s&&this.scope===null;return`new Code(${s?`
5
+ `:""}${n}${i?`
6
+ `:""})`}}function SC(e){return e!=null&&typeof e==="object"&&"$id"in e&&e.$id!=null&&"$ref"in e&&typeof e.$ref==="string"&&(!("$db"in e)||("$db"in e)&&typeof e.$db==="string")}class Ji extends Kn{get _bsontype(){return"DBRef"}collection;oid;db;fields;constructor(e,t,r,n){super();let s=e.split(".");if(s.length===2)r=s.shift(),e=s.shift();this.collection=e,this.oid=t,this.db=r,this.fields=n||{}}get namespace(){return this.collection}set namespace(e){this.collection=e}toJSON(){let e=Object.assign({$ref:this.collection,$id:this.oid},this.fields);if(this.db!=null)e.$db=this.db;return e}toExtendedJSON(e){e=e||{};let t={$ref:this.collection,$id:this.oid};if(e.legacy)return t;if(this.db)t.$db=this.db;return t=Object.assign(t,this.fields),t}static fromExtendedJSON(e){let t=Object.assign({},e);return delete t.$ref,delete t.$id,delete t.$db,new Ji(e.$ref,e.$id,e.$db,t)}inspect(e,t,r){r??=Ps;let n=[r(this.namespace,t),r(this.oid,t),...this.db?[r(this.db,t)]:[],...Object.keys(this.fields).length>0?[r(this.fields,t)]:[]];return n[1]=r===Ps?`new ObjectId(${n[1]})`:n[1],`new DBRef(${n.join(", ")})`}}function CC(e){if(e==="")return e;let t=0,r=e[t]==="-",n=e[t]==="+";if(n||r)t+=1;let s=!1;for(;t<e.length&&e[t]==="0";++t)s=!0;if(!s)return n?e.slice(1):e;return`${r?"-":""}${e.length===t?"0":e.slice(t)}`}function iee(e,t){t=t??10;let r="0123456789abcdefghijklmnopqrstuvwxyz".slice(0,t);return new RegExp(`[^-+${r}]`,"i").test(e)?!1:e}var Us=void 0;try{Us=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch{}var KS=65536,oee=16777216,Sc=KS*KS,bC=Sc*Sc,HS=bC/2,GS={},YS={},uee=20,aee=/^(\+?0|(\+|-)?[1-9][0-9]*)$/;class T extends Kn{get _bsontype(){return"Long"}get __isLong__(){return!0}high;low;unsigned;constructor(e=0,t,r){super();let n=typeof t==="boolean"?t:Boolean(r),s=typeof t==="number"?t:0,i=typeof e==="string"?T.fromString(e,n):typeof e==="bigint"?T.fromBigInt(e,n):{low:e|0,high:s|0,unsigned:n};this.low=i.low,this.high=i.high,this.unsigned=i.unsigned}static TWO_PWR_24=T.fromInt(oee);static MAX_UNSIGNED_VALUE=T.fromBits(-1,-1,!0);static ZERO=T.fromInt(0);static UZERO=T.fromInt(0,!0);static ONE=T.fromInt(1);static UONE=T.fromInt(1,!0);static NEG_ONE=T.fromInt(-1);static MAX_VALUE=T.fromBits(-1,2147483647,!1);static MIN_VALUE=T.fromBits(0,-2147483648,!1);static fromBits(e,t,r){return new T(e,t,r)}static fromInt(e,t){let r,n,s;if(t){if(e>>>=0,s=0<=e&&e<256){if(n=YS[e],n)return n}if(r=T.fromBits(e,(e|0)<0?-1:0,!0),s)YS[e]=r;return r}else{if(e|=0,s=-128<=e&&e<128){if(n=GS[e],n)return n}if(r=T.fromBits(e,e<0?-1:0,!1),s)GS[e]=r;return r}}static fromNumber(e,t){if(isNaN(e))return t?T.UZERO:T.ZERO;if(t){if(e<0)return T.UZERO;if(e>=bC)return T.MAX_UNSIGNED_VALUE}else{if(e<=-HS)return T.MIN_VALUE;if(e+1>=HS)return T.MAX_VALUE}if(e<0)return T.fromNumber(-e,t).neg();return T.fromBits(e%Sc|0,e/Sc|0,t)}static fromBigInt(e,t){let r=0xffffffffn,n=32n;return new T(Number(e&r),Number(e>>n&r),t)}static _fromString(e,t,r){if(e.length===0)throw new I("empty string");if(r<2||36<r)throw new I("radix");let n;if((n=e.indexOf("-"))>0)throw new I("interior hyphen");else if(n===0)return T._fromString(e.substring(1),t,r).neg();let s=T.fromNumber(Math.pow(r,8)),i=T.ZERO;for(let o=0;o<e.length;o+=8){let u=Math.min(8,e.length-o),a=parseInt(e.substring(o,o+u),r);if(u<8){let c=T.fromNumber(Math.pow(r,u));i=i.mul(c).add(T.fromNumber(a))}else i=i.mul(s),i=i.add(T.fromNumber(a))}return i.unsigned=t,i}static fromStringStrict(e,t,r){let n=!1;if(typeof t==="number")r=t,t=!1;else n=!!t;if(r??=10,e.trim()!==e)throw new I(`Input: '${e}' contains leading and/or trailing whitespace`);if(!iee(e,r))throw new I(`Input: '${e}' contains invalid characters for radix: ${r}`);let s=CC(e),i=T._fromString(s,n,r);if(i.toString(r).toLowerCase()!==s.toLowerCase())throw new I(`Input: ${e} is not representable as ${i.unsigned?"an unsigned":"a signed"} 64-bit Long ${r!=null?`with radix: ${r}`:""}`);return i}static fromString(e,t,r){let n=!1;if(typeof t==="number")r=t,t=!1;else n=!!t;if(r??=10,e==="NaN"&&r<24)return T.ZERO;else if((e==="Infinity"||e==="+Infinity"||e==="-Infinity")&&r<35)return T.ZERO;return T._fromString(e,n,r)}static fromBytes(e,t,r){return r?T.fromBytesLE(e,t):T.fromBytesBE(e,t)}static fromBytesLE(e,t){return new T(e[0]|e[1]<<8|e[2]<<16|e[3]<<24,e[4]|e[5]<<8|e[6]<<16|e[7]<<24,t)}static fromBytesBE(e,t){return new T(e[4]<<24|e[5]<<16|e[6]<<8|e[7],e[0]<<24|e[1]<<16|e[2]<<8|e[3],t)}static isLong(e){return e!=null&&typeof e==="object"&&"__isLong__"in e&&e.__isLong__===!0}static fromValue(e,t){if(typeof e==="number")return T.fromNumber(e,t);if(typeof e==="string")return T.fromString(e,t);return T.fromBits(e.low,e.high,typeof t==="boolean"?t:e.unsigned)}add(e){if(!T.isLong(e))e=T.fromValue(e);let t=this.high>>>16,r=this.high&65535,n=this.low>>>16,s=this.low&65535,i=e.high>>>16,o=e.high&65535,u=e.low>>>16,a=e.low&65535,c=0,l=0,f=0,h=0;return h+=s+a,f+=h>>>16,h&=65535,f+=n+u,l+=f>>>16,f&=65535,l+=r+o,c+=l>>>16,l&=65535,c+=t+i,c&=65535,T.fromBits(f<<16|h,c<<16|l,this.unsigned)}and(e){if(!T.isLong(e))e=T.fromValue(e);return T.fromBits(this.low&e.low,this.high&e.high,this.unsigned)}compare(e){if(!T.isLong(e))e=T.fromValue(e);if(this.eq(e))return 0;let t=this.isNegative(),r=e.isNegative();if(t&&!r)return-1;if(!t&&r)return 1;if(!this.unsigned)return this.sub(e).isNegative()?-1:1;return e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1}comp(e){return this.compare(e)}divide(e){if(!T.isLong(e))e=T.fromValue(e);if(e.isZero())throw new I("division by zero");if(Us){if(!this.unsigned&&this.high===-2147483648&&e.low===-1&&e.high===-1)return this;let s=(this.unsigned?Us.div_u:Us.div_s)(this.low,this.high,e.low,e.high);return T.fromBits(s,Us.get_high(),this.unsigned)}if(this.isZero())return this.unsigned?T.UZERO:T.ZERO;let t,r,n;if(!this.unsigned){if(this.eq(T.MIN_VALUE))if(e.eq(T.ONE)||e.eq(T.NEG_ONE))return T.MIN_VALUE;else if(e.eq(T.MIN_VALUE))return T.ONE;else if(t=this.shr(1).div(e).shl(1),t.eq(T.ZERO))return e.isNegative()?T.ONE:T.NEG_ONE;else return r=this.sub(e.mul(t)),n=t.add(r.div(e)),n;else if(e.eq(T.MIN_VALUE))return this.unsigned?T.UZERO:T.ZERO;if(this.isNegative()){if(e.isNegative())return this.neg().div(e.neg());return this.neg().div(e).neg()}else if(e.isNegative())return this.div(e.neg()).neg();n=T.ZERO}else{if(!e.unsigned)e=e.toUnsigned();if(e.gt(this))return T.UZERO;if(e.gt(this.shru(1)))return T.UONE;n=T.UZERO}r=this;while(r.gte(e)){t=Math.max(1,Math.floor(r.toNumber()/e.toNumber()));let s=Math.ceil(Math.log(t)/Math.LN2),i=s<=48?1:Math.pow(2,s-48),o=T.fromNumber(t),u=o.mul(e);while(u.isNegative()||u.gt(r))t-=i,o=T.fromNumber(t,this.unsigned),u=o.mul(e);if(o.isZero())o=T.ONE;n=n.add(o),r=r.sub(u)}return n}div(e){return this.divide(e)}equals(e){if(!T.isLong(e))e=T.fromValue(e);if(this.unsigned!==e.unsigned&&this.high>>>31===1&&e.high>>>31===1)return!1;return this.high===e.high&&this.low===e.low}eq(e){return this.equals(e)}getHighBits(){return this.high}getHighBitsUnsigned(){return this.high>>>0}getLowBits(){return this.low}getLowBitsUnsigned(){return this.low>>>0}getNumBitsAbs(){if(this.isNegative())return this.eq(T.MIN_VALUE)?64:this.neg().getNumBitsAbs();let e=this.high!==0?this.high:this.low,t;for(t=31;t>0;t--)if((e&1<<t)!==0)break;return this.high!==0?t+33:t+1}greaterThan(e){return this.comp(e)>0}gt(e){return this.greaterThan(e)}greaterThanOrEqual(e){return this.comp(e)>=0}gte(e){return this.greaterThanOrEqual(e)}ge(e){return this.greaterThanOrEqual(e)}isEven(){return(this.low&1)===0}isNegative(){return!this.unsigned&&this.high<0}isOdd(){return(this.low&1)===1}isPositive(){return this.unsigned||this.high>=0}isZero(){return this.high===0&&this.low===0}lessThan(e){return this.comp(e)<0}lt(e){return this.lessThan(e)}lessThanOrEqual(e){return this.comp(e)<=0}lte(e){return this.lessThanOrEqual(e)}modulo(e){if(!T.isLong(e))e=T.fromValue(e);if(Us){let t=(this.unsigned?Us.rem_u:Us.rem_s)(this.low,this.high,e.low,e.high);return T.fromBits(t,Us.get_high(),this.unsigned)}return this.sub(this.div(e).mul(e))}mod(e){return this.modulo(e)}rem(e){return this.modulo(e)}multiply(e){if(this.isZero())return T.ZERO;if(!T.isLong(e))e=T.fromValue(e);if(Us){let d=Us.mul(this.low,this.high,e.low,e.high);return T.fromBits(d,Us.get_high(),this.unsigned)}if(e.isZero())return T.ZERO;if(this.eq(T.MIN_VALUE))return e.isOdd()?T.MIN_VALUE:T.ZERO;if(e.eq(T.MIN_VALUE))return this.isOdd()?T.MIN_VALUE:T.ZERO;if(this.isNegative())if(e.isNegative())return this.neg().mul(e.neg());else return this.neg().mul(e).neg();else if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(T.TWO_PWR_24)&&e.lt(T.TWO_PWR_24))return T.fromNumber(this.toNumber()*e.toNumber(),this.unsigned);let t=this.high>>>16,r=this.high&65535,n=this.low>>>16,s=this.low&65535,i=e.high>>>16,o=e.high&65535,u=e.low>>>16,a=e.low&65535,c=0,l=0,f=0,h=0;return h+=s*a,f+=h>>>16,h&=65535,f+=n*a,l+=f>>>16,f&=65535,f+=s*u,l+=f>>>16,f&=65535,l+=r*a,c+=l>>>16,l&=65535,l+=n*u,c+=l>>>16,l&=65535,l+=s*o,c+=l>>>16,l&=65535,c+=t*a+r*u+n*o+s*i,c&=65535,T.fromBits(f<<16|h,c<<16|l,this.unsigned)}mul(e){return this.multiply(e)}negate(){if(!this.unsigned&&this.eq(T.MIN_VALUE))return T.MIN_VALUE;return this.not().add(T.ONE)}neg(){return this.negate()}not(){return T.fromBits(~this.low,~this.high,this.unsigned)}notEquals(e){return!this.equals(e)}neq(e){return this.notEquals(e)}ne(e){return this.notEquals(e)}or(e){if(!T.isLong(e))e=T.fromValue(e);return T.fromBits(this.low|e.low,this.high|e.high,this.unsigned)}shiftLeft(e){if(T.isLong(e))e=e.toInt();if((e&=63)===0)return this;else if(e<32)return T.fromBits(this.low<<e,this.high<<e|this.low>>>32-e,this.unsigned);else return T.fromBits(0,this.low<<e-32,this.unsigned)}shl(e){return this.shiftLeft(e)}shiftRight(e){if(T.isLong(e))e=e.toInt();if((e&=63)===0)return this;else if(e<32)return T.fromBits(this.low>>>e|this.high<<32-e,this.high>>e,this.unsigned);else return T.fromBits(this.high>>e-32,this.high>=0?0:-1,this.unsigned)}shr(e){return this.shiftRight(e)}shiftRightUnsigned(e){if(T.isLong(e))e=e.toInt();if(e&=63,e===0)return this;else{let t=this.high;if(e<32){let r=this.low;return T.fromBits(r>>>e|t<<32-e,t>>>e,this.unsigned)}else if(e===32)return T.fromBits(t,0,this.unsigned);else return T.fromBits(t>>>e-32,0,this.unsigned)}}shr_u(e){return this.shiftRightUnsigned(e)}shru(e){return this.shiftRightUnsigned(e)}subtract(e){if(!T.isLong(e))e=T.fromValue(e);return this.add(e.neg())}sub(e){return this.subtract(e)}toInt(){return this.unsigned?this.low>>>0:this.low}toNumber(){if(this.unsigned)return(this.high>>>0)*Sc+(this.low>>>0);return this.high*Sc+(this.low>>>0)}toBigInt(){return BigInt(this.toString())}toBytes(e){return e?this.toBytesLE():this.toBytesBE()}toBytesLE(){let e=this.high,t=this.low;return[t&255,t>>>8&255,t>>>16&255,t>>>24,e&255,e>>>8&255,e>>>16&255,e>>>24]}toBytesBE(){let e=this.high,t=this.low;return[e>>>24,e>>>16&255,e>>>8&255,e&255,t>>>24,t>>>16&255,t>>>8&255,t&255]}toSigned(){if(!this.unsigned)return this;return T.fromBits(this.low,this.high,!1)}toString(e){if(e=e||10,e<2||36<e)throw new I("radix");if(this.isZero())return"0";if(this.isNegative())if(this.eq(T.MIN_VALUE)){let s=T.fromNumber(e),i=this.div(s),o=i.mul(s).sub(this);return i.toString(e)+o.toInt().toString(e)}else return"-"+this.neg().toString(e);let t=T.fromNumber(Math.pow(e,6),this.unsigned),r=this,n="";while(!0){let s=r.div(t),o=(r.sub(s.mul(t)).toInt()>>>0).toString(e);if(r=s,r.isZero())return o+n;else{while(o.length<6)o="0"+o;n=""+o+n}}}toUnsigned(){if(this.unsigned)return this;return T.fromBits(this.low,this.high,!0)}xor(e){if(!T.isLong(e))e=T.fromValue(e);return T.fromBits(this.low^e.low,this.high^e.high,this.unsigned)}eqz(){return this.isZero()}le(e){return this.lessThanOrEqual(e)}toExtendedJSON(e){if(e&&e.relaxed)return this.toNumber();return{$numberLong:this.toString()}}static fromExtendedJSON(e,t){let{useBigInt64:r=!1,relaxed:n=!0}={...t};if(e.$numberLong.length>uee)throw new I("$numberLong string is too long");if(!aee.test(e.$numberLong))throw new I(`$numberLong string "${e.$numberLong}" is in an invalid format`);if(r){let i=BigInt(e.$numberLong);return BigInt.asIntN(64,i)}let s=T.fromString(e.$numberLong);if(n)return s.toNumber();return s}inspect(e,t,r){r??=Ps;let n=r(this.toString(),t),s=this.unsigned?`, ${r(this.unsigned,t)}`:"";return`new Long(${n}${s})`}}var cee=/^(\+|-)?(\d+|(\d*\.\d*))?(E|e)?([-+])?(\d+)?$/,lee=/^(\+|-)?(Infinity|inf)$/i,hee=/^(\+|-)?NaN$/i,wc=6111,lh=-6176,QS=6176,JS=34,vg=B.fromNumberArray([124,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0].reverse()),XS=B.fromNumberArray([248,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0].reverse()),ZS=B.fromNumberArray([120,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0].reverse()),fee=/^([-+])?(\d+)?$/,dee=31,eC=16383,pee=30,mee=31;function tC(e){return!isNaN(parseInt(e,10))}function yee(e){let t=T.fromNumber(1e9),r=T.fromNumber(0);if(!e.parts[0]&&!e.parts[1]&&!e.parts[2]&&!e.parts[3])return{quotient:e,rem:r};for(let n=0;n<=3;n++)r=r.shiftLeft(32),r=r.add(new T(e.parts[n],0)),e.parts[n]=r.div(t).low,r=r.modulo(t);return{quotient:e,rem:r}}function gee(e,t){if(!e&&!t)return{high:T.fromNumber(0),low:T.fromNumber(0)};let r=e.shiftRightUnsigned(32),n=new T(e.getLowBits(),0),s=t.shiftRightUnsigned(32),i=new T(t.getLowBits(),0),o=r.multiply(s),u=r.multiply(i),a=n.multiply(s),c=n.multiply(i);return o=o.add(u.shiftRightUnsigned(32)),u=new T(u.getLowBits(),0).add(a).add(c.shiftRightUnsigned(32)),o=o.add(u.shiftRightUnsigned(32)),c=u.shiftLeft(32).add(new T(c.getLowBits(),0)),{high:o,low:c}}function Eee(e,t){let r=e.high>>>0,n=t.high>>>0;if(r<n)return!0;else if(r===n){let s=e.low>>>0,i=t.low>>>0;if(s<i)return!0}return!1}function Ri(e,t){throw new I(`"${e}" is not a valid Decimal128 string - ${t}`)}class Sn extends Kn{get _bsontype(){return"Decimal128"}bytes;constructor(e){super();if(typeof e==="string")this.bytes=Sn.fromString(e).bytes;else if(e instanceof Uint8Array||Cc(e)){if(e.byteLength!==16)throw new I("Decimal128 must take a Buffer of 16 bytes");this.bytes=e}else throw new I("Decimal128 must take a Buffer or string")}static fromString(e){return Sn._fromString(e,{allowRounding:!1})}static fromStringWithRounding(e){return Sn._fromString(e,{allowRounding:!0})}static _fromString(e,t){let r=!1,n=!1,s=!1,i=!1,o=0,u=0,a=0,c=0,l=0,f=[0],h=0,d=0,p=0,m=0,E=new T(0,0),y=new T(0,0),_=0,w=0;if(e.length>=7000)throw new I(""+e+" not a valid Decimal128 string");let C=e.match(cee),A=e.match(lee),M=e.match(hee);if(!C&&!A&&!M||e.length===0)throw new I(""+e+" not a valid Decimal128 string");if(C){let P=C[2],ge=C[4],Me=C[5],oe=C[6];if(ge&&oe===void 0)Ri(e,"missing exponent power");if(ge&&P===void 0)Ri(e,"missing exponent base");if(ge===void 0&&(Me||oe))Ri(e,"missing e before exponent")}if(e[w]==="+"||e[w]==="-")n=!0,r=e[w++]==="-";if(!tC(e[w])&&e[w]!=="."){if(e[w]==="i"||e[w]==="I")return new Sn(r?XS:ZS);else if(e[w]==="N")return new Sn(vg)}while(tC(e[w])||e[w]==="."){if(e[w]==="."){if(s)Ri(e,"contains multiple periods");s=!0,w=w+1;continue}if(h<JS){if(e[w]!=="0"||i){if(!i)l=u;i=!0,f[d++]=parseInt(e[w],10),h=h+1}}if(i)a=a+1;if(s)c=c+1;u=u+1,w=w+1}if(s&&!u)throw new I(""+e+" not a valid Decimal128 string");if(e[w]==="e"||e[w]==="E"){let P=e.substr(++w).match(fee);if(!P||!P[2])return new Sn(vg);m=parseInt(P[0],10),w=w+P[0].length}if(e[w])return new Sn(vg);if(!h)f[0]=0,a=1,h=1,o=0;else if(p=h-1,o=a,o!==1)while(e[l+o-1+Number(n)+Number(s)]==="0")o=o-1;if(m<=c&&c>m+16384)m=lh;else m=m-c;while(m>wc){if(p=p+1,p>=JS){if(o===0){m=wc;break}Ri(e,"overflow")}m=m-1}if(t.allowRounding){while(m<lh||h<a){if(p===0&&o<h){m=lh,o=0;break}if(h<a)a=a-1;else p=p-1;if(m<wc)m=m+1;else{if(f.join("").match(/^0+$/)){m=wc;break}Ri(e,"overflow")}}if(p+1<o){let P=u;if(s)l=l+1,P=P+1;if(n)l=l+1,P=P+1;let ge=parseInt(e[l+p+1],10),Me=0;if(ge>=5){if(Me=1,ge===5){Me=f[p]%2===1?1:0;for(let oe=l+p+2;oe<P;oe++)if(parseInt(e[oe],10)){Me=1;break}}}if(Me){let oe=p;for(;oe>=0;oe--)if(++f[oe]>9){if(f[oe]=0,oe===0)if(m<wc)m=m+1,f[oe]=1;else return new Sn(r?XS:ZS)}else break}}}else{while(m<lh||h<a){if(p===0){if(o===0){m=lh;break}Ri(e,"exponent underflow")}if(h<a){if(e[a-1+Number(n)+Number(s)]!=="0"&&o!==0)Ri(e,"inexact rounding");a=a-1}else{if(f[p]!==0)Ri(e,"inexact rounding");p=p-1}if(m<wc)m=m+1;else Ri(e,"overflow")}if(p+1<o){if(s)l=l+1;if(n)l=l+1;if(parseInt(e[l+p+1],10)!==0)Ri(e,"inexact rounding")}}if(E=T.fromNumber(0),y=T.fromNumber(0),o===0)E=T.fromNumber(0),y=T.fromNumber(0);else if(p<17){let P=0;y=T.fromNumber(f[P++]),E=new T(0,0);for(;P<=p;P++)y=y.multiply(T.fromNumber(10)),y=y.add(T.fromNumber(f[P]))}else{let P=0;E=T.fromNumber(f[P++]);for(;P<=p-17;P++)E=E.multiply(T.fromNumber(10)),E=E.add(T.fromNumber(f[P]));y=T.fromNumber(f[P++]);for(;P<=p;P++)y=y.multiply(T.fromNumber(10)),y=y.add(T.fromNumber(f[P]))}let O=gee(E,T.fromString("100000000000000000"));if(O.low=O.low.add(y),Eee(O.low,y))O.high=O.high.add(T.fromNumber(1));_=m+QS;let x={low:T.fromNumber(0),high:T.fromNumber(0)};if(O.high.shiftRightUnsigned(49).and(T.fromNumber(1)).equals(T.fromNumber(1)))x.high=x.high.or(T.fromNumber(3).shiftLeft(61)),x.high=x.high.or(T.fromNumber(_).and(T.fromNumber(16383).shiftLeft(47))),x.high=x.high.or(O.high.and(T.fromNumber(140737488355327)));else x.high=x.high.or(T.fromNumber(_&16383).shiftLeft(49)),x.high=x.high.or(O.high.and(T.fromNumber(562949953421311)));if(x.low=O.low,r)x.high=x.high.or(T.fromString("9223372036854775808"));let v=B.allocateUnsafe(16);return w=0,v[w++]=x.low.low&255,v[w++]=x.low.low>>8&255,v[w++]=x.low.low>>16&255,v[w++]=x.low.low>>24&255,v[w++]=x.low.high&255,v[w++]=x.low.high>>8&255,v[w++]=x.low.high>>16&255,v[w++]=x.low.high>>24&255,v[w++]=x.high.low&255,v[w++]=x.high.low>>8&255,v[w++]=x.high.low>>16&255,v[w++]=x.high.low>>24&255,v[w++]=x.high.high&255,v[w++]=x.high.high>>8&255,v[w++]=x.high.high>>16&255,v[w++]=x.high.high>>24&255,new Sn(v)}toString(){let e,t=0,r=Array(36);for(let w=0;w<r.length;w++)r[w]=0;let n=0,s=!1,i,o={parts:[0,0,0,0]},u,a,c=[];n=0;let l=this.bytes,f=l[n++]|l[n++]<<8|l[n++]<<16|l[n++]<<24,h=l[n++]|l[n++]<<8|l[n++]<<16|l[n++]<<24,d=l[n++]|l[n++]<<8|l[n++]<<16|l[n++]<<24,p=l[n++]|l[n++]<<8|l[n++]<<16|l[n++]<<24;if(n=0,{low:new T(f,h),high:new T(d,p)}.high.lessThan(T.ZERO))c.push("-");let E=p>>26&dee;if(E>>3===3)if(E===pee)return c.join("")+"Infinity";else if(E===mee)return"NaN";else e=p>>15&eC,i=8+(p>>14&1);else i=p>>14&7,e=p>>17&eC;let y=e-QS;if(o.parts[0]=(p&16383)+((i&15)<<14),o.parts[1]=d,o.parts[2]=h,o.parts[3]=f,o.parts[0]===0&&o.parts[1]===0&&o.parts[2]===0&&o.parts[3]===0)s=!0;else for(a=3;a>=0;a--){let w=0,C=yee(o);if(o=C.quotient,w=C.rem.low,!w)continue;for(u=8;u>=0;u--)r[a*9+u]=w%10,w=Math.floor(w/10)}if(s)t=1,r[n]=0;else{t=36;while(!r[n])t=t-1,n=n+1}let _=t-1+y;if(_>=34||_<=-7||y>0){if(t>34){if(c.push("0"),y>0)c.push(`E+${y}`);else if(y<0)c.push(`E${y}`);return c.join("")}if(c.push(`${r[n++]}`),t=t-1,t)c.push(".");for(let w=0;w<t;w++)c.push(`${r[n++]}`);if(c.push("E"),_>0)c.push(`+${_}`);else c.push(`${_}`)}else if(y>=0)for(let w=0;w<t;w++)c.push(`${r[n++]}`);else{let w=t+y;if(w>0)for(let C=0;C<w;C++)c.push(`${r[n++]}`);else c.push("0");c.push(".");while(w++<0)c.push("0");for(let C=0;C<t-Math.max(w-1,0);C++)c.push(`${r[n++]}`)}return c.join("")}toJSON(){return{$numberDecimal:this.toString()}}toExtendedJSON(){return{$numberDecimal:this.toString()}}static fromExtendedJSON(e){return Sn.fromString(e.$numberDecimal)}inspect(e,t,r){return r??=Ps,`new Decimal128(${r(this.toString(),t)})`}}class zs extends Kn{get _bsontype(){return"Double"}value;constructor(e){super();if(e instanceof Number)e=e.valueOf();this.value=+e}static fromString(e){let t=Number(e);if(e==="NaN")return new zs(NaN);if(e==="Infinity")return new zs(1/0);if(e==="-Infinity")return new zs(-1/0);if(!Number.isFinite(t))throw new I(`Input: ${e} is not representable as a Double`);if(e.trim()!==e)throw new I(`Input: '${e}' contains whitespace`);if(e==="")throw new I("Input is an empty string");if(/[^-0-9.+eE]/.test(e))throw new I(`Input: '${e}' is not in decimal or exponential notation`);return new zs(t)}valueOf(){return this.value}toJSON(){return this.value}toString(e){return this.value.toString(e)}toExtendedJSON(e){if(e&&(e.legacy||e.relaxed&&isFinite(this.value)))return this.value;if(Object.is(Math.sign(this.value),-0))return{$numberDouble:"-0.0"};return{$numberDouble:Number.isInteger(this.value)?this.value.toFixed(1):this.value.toString()}}static fromExtendedJSON(e,t){let r=parseFloat(e.$numberDouble);return t&&t.relaxed?r:new zs(r)}inspect(e,t,r){return r??=Ps,`new Double(${r(this.value,t)})`}}class Vo extends Kn{get _bsontype(){return"Int32"}value;constructor(e){super();if(e instanceof Number)e=e.valueOf();this.value=+e|0}static fromString(e){let t=CC(e),r=Number(e);if(gh<r)throw new I(`Input: '${e}' is larger than the maximum value for Int32`);else if(Eh>r)throw new I(`Input: '${e}' is smaller than the minimum value for Int32`);else if(!Number.isSafeInteger(r))throw new I(`Input: '${e}' is not a safe integer`);else if(r.toString()!==t)throw new I(`Input: '${e}' is not a valid Int32 string`);return new Vo(r)}valueOf(){return this.value}toString(e){return this.value.toString(e)}toJSON(){return this.value}toExtendedJSON(e){if(e&&(e.relaxed||e.legacy))return this.value;return{$numberInt:this.value.toString()}}static fromExtendedJSON(e,t){return t&&t.relaxed?parseInt(e.$numberInt,10):new Vo(e.$numberInt)}inspect(e,t,r){return r??=Ps,`new Int32(${r(this.value,t)})`}}class Ba extends Kn{get _bsontype(){return"MaxKey"}toExtendedJSON(){return{$maxKey:1}}static fromExtendedJSON(){return new Ba}inspect(){return"new MaxKey()"}}class Na extends Kn{get _bsontype(){return"MinKey"}toExtendedJSON(){return{$minKey:1}}static fromExtendedJSON(){return new Na}inspect(){return"new MinKey()"}}var hh=new WeakMap,xs=[];for(let e=0;e<256;e++)xs.push(e.toString(16).padStart(2,"0"));var Td=new Int8Array(103);for(let e=48;e<=57;e++)Td[e]=e-48;for(let e=65;e<=70;e++)Td[e]=e-55;for(let e=97;e<=102;e++)Td[e]=e-87;class $t extends Kn{get _bsontype(){return"ObjectId"}static index=0;static PROCESS_UNIQUE=null;static resetState=()=>{this.index=Math.floor(Math.random()*16777216),this.PROCESS_UNIQUE=null};static{this.resetState();let e,t=!1;try{e=globalThis?.process?.getBuiltinModule?.("v8")??{}}catch{}let r=e?.startupSnapshot;try{t=r?.isBuildingSnapshot?.()}catch{}if(t)r?.addDeserializeCallback?.(this.resetState)}static cacheHexString;i0;i1;i2;i3;setFromBytes(e,t=0){this.i0=e[t]<<16|e[t+1]<<8|e[t+2],this.i1=e[t+3]<<16|e[t+4]<<8|e[t+5],this.i2=e[t+6]<<16|e[t+7]<<8|e[t+8],this.i3=e[t+9]<<16|e[t+10]<<8|e[t+11]}setFromHex(e){let t=Td;this.i0=t[e.charCodeAt(0)]<<20|t[e.charCodeAt(1)]<<16|t[e.charCodeAt(2)]<<12|t[e.charCodeAt(3)]<<8|t[e.charCodeAt(4)]<<4|t[e.charCodeAt(5)],this.i1=t[e.charCodeAt(6)]<<20|t[e.charCodeAt(7)]<<16|t[e.charCodeAt(8)]<<12|t[e.charCodeAt(9)]<<8|t[e.charCodeAt(10)]<<4|t[e.charCodeAt(11)],this.i2=t[e.charCodeAt(12)]<<20|t[e.charCodeAt(13)]<<16|t[e.charCodeAt(14)]<<12|t[e.charCodeAt(15)]<<8|t[e.charCodeAt(16)]<<4|t[e.charCodeAt(17)],this.i3=t[e.charCodeAt(18)]<<20|t[e.charCodeAt(19)]<<16|t[e.charCodeAt(20)]<<12|t[e.charCodeAt(21)]<<8|t[e.charCodeAt(22)]<<4|t[e.charCodeAt(23)]}constructor(e,t){super();if(typeof t==="number"){this.setFromBytes(e,t);return}let r;if(typeof e==="object"&&e&&"id"in e){if($t.is(e)&&typeof e.i0==="number"&&typeof e.i1==="number"&&typeof e.i2==="number"&&typeof e.i3==="number"){this.i0=e.i0,this.i1=e.i1,this.i2=e.i2,this.i3=e.i3;return}if(typeof e.id!=="string"&&!ArrayBuffer.isView(e.id))throw new I("Argument passed in must have an id that is of type string or Buffer");if("toHexString"in e&&typeof e.toHexString==="function")r=B.fromHex(e.toHexString());else r=e.id}else r=e;if(r==null){let n=Math.floor(Date.now()/1000),s=$t.getInc(),i=$t.PROCESS_UNIQUE??=B.randomBytes(5);this.i0=n>>>8&16777215,this.i1=(n&255)<<16|i[0]<<8|i[1],this.i2=i[2]<<16|i[3]<<8|i[4],this.i3=s&16777215}else if(ArrayBuffer.isView(r)&&r.byteLength===12)this.setFromBytes(r instanceof Uint8Array?r:B.toLocalBufferType(r));else if(typeof r==="string")if($t.validateHexString(r)){if(this.setFromHex(r),$t.cacheHexString)hh.set(this,r)}else throw new I("input must be a 24 character hex string, 12 byte Uint8Array, or an integer");else throw new I("Argument passed in does not match the accepted types")}get id(){let e=B.allocateUnsafe(12);return e[0]=this.i0>>>16&255,e[1]=this.i0>>>8&255,e[2]=this.i0&255,e[3]=this.i1>>>16&255,e[4]=this.i1>>>8&255,e[5]=this.i1&255,e[6]=this.i2>>>16&255,e[7]=this.i2>>>8&255,e[8]=this.i2&255,e[9]=this.i3>>>16&255,e[10]=this.i3>>>8&255,e[11]=this.i3&255,e}set id(e){let t=e instanceof Uint8Array?e:B.toLocalBufferType(e);if(this.setFromBytes(t),$t.cacheHexString)hh.set(this,B.toHex(t))}static validateHexString(e){if(e?.length!==24)return!1;for(let t=0;t<24;t++){let r=e.charCodeAt(t);if(r>=48&&r<=57||r>=97&&r<=102||r>=65&&r<=70)continue;return!1}return!0}toHexString(){if($t.cacheHexString){let i=hh.get(this);if(i)return i}let e=this.i0,t=this.i1,r=this.i2,n=this.i3,s=xs[e>>>16&255]+xs[e>>>8&255]+xs[e&255]+xs[t>>>16&255]+xs[t>>>8&255]+xs[t&255]+xs[r>>>16&255]+xs[r>>>8&255]+xs[r&255]+xs[n>>>16&255]+xs[n>>>8&255]+xs[n&255];if($t.cacheHexString)hh.set(this,s);return s}static getInc(){return $t.index=($t.index+1)%16777216}static generate(e){if(typeof e!=="number")e=Math.floor(Date.now()/1000);let t=$t.getInc(),r=B.allocateUnsafe(12);Ee.setInt32BE(r,0,e);let n=this.PROCESS_UNIQUE??=B.randomBytes(5);return r[4]=n[0],r[5]=n[1],r[6]=n[2],r[7]=n[3],r[8]=n[4],r[11]=t&255,r[10]=t>>>8&255,r[9]=t>>>16&255,r}toString(e){if(e==="base64")return B.toBase64(this.id);if(e==="hex")return this.toHexString();return this.toHexString()}toJSON(){return this.toHexString()}static is(e){return e!=null&&typeof e==="object"&&"_bsontype"in e&&e._bsontype==="ObjectId"}equals(e){if(e===void 0||e===null)return!1;if($t.is(e)&&typeof e.i0==="number"&&typeof e.i1==="number"&&typeof e.i2==="number"&&typeof e.i3==="number")return this.i3===e.i3&&this.i0===e.i0&&this.i1===e.i1&&this.i2===e.i2;if(typeof e==="string")return e.toLowerCase()===this.toHexString();if(typeof e==="object"&&typeof e.toHexString==="function"){let t=e.toHexString(),r=this.toHexString();return typeof t==="string"&&t.toLowerCase()===r}return!1}getTimestamp(){let e=new Date,t=this.i0*256+(this.i1>>>16);return e.setTime(t*1000),e}static createPk(){return new $t}serializeInto(e,t){return e[t]=this.i0>>>16&255,e[t+1]=this.i0>>>8&255,e[t+2]=this.i0&255,e[t+3]=this.i1>>>16&255,e[t+4]=this.i1>>>8&255,e[t+5]=this.i1&255,e[t+6]=this.i2>>>16&255,e[t+7]=this.i2>>>8&255,e[t+8]=this.i2&255,e[t+9]=this.i3>>>16&255,e[t+10]=this.i3>>>8&255,e[t+11]=this.i3&255,12}static createFromTime(e){let t=B.allocate(12);for(let r=11;r>=4;r--)t[r]=0;return Ee.setInt32BE(t,0,e),new $t(t)}static createFromHexString(e){if(e?.length!==24)throw new I("hex string must be 24 characters");return new $t(B.fromHex(e))}static createFromBase64(e){if(e?.length!==16)throw new I("base64 string must be 16 characters");return new $t(B.fromBase64(e))}static isValid(e){if(e==null)return!1;if(typeof e==="string")return $t.validateHexString(e);try{return new $t(e),!0}catch{return!1}}toExtendedJSON(){if(this.toHexString)return{$oid:this.toHexString()};return{$oid:this.toString("hex")}}static fromExtendedJSON(e){return new $t(e.$oid)}isCached(){return $t.cacheHexString&&hh.has(this)}inspect(e,t,r){return r??=Ps,`new ObjectId(${r(this.toHexString(),t)})`}}function _ee(e,t,r){let n=[{object:e,ignoreUndefined:r??!1,exit:!1}],s=new Set,i=0;while(n.length>0){let o=n.pop();if(o.exit){s.delete(o.object);continue}let{object:u,ignoreUndefined:a}=o;s.add(u),o.exit=!0,n.push(o),i+=5;let c=Array.isArray(u),l=!c&&(u instanceof Map||bd(u)),f=u;if(!c&&!l&&typeof u?.toBSON==="function")f=u.toBSON();if(c){let h=f;for(let d=0;d<h.length;d++)i+=kg(d.toString(),h[d],t,!0,a,n,s)}else if(l)for(let[h,d]of f)i+=kg(h,d,t,!1,a,n,s);else for(let h of Object.keys(f))i+=kg(h,f[h],t,!1,a,n,s)}return i}function kg(e,t,r=!1,n=!1,s=!1,i,o){if(typeof t?.toBSON==="function")t=t.toBSON();switch(typeof t){case"string":return 1+B.utf8ByteLength(e)+1+4+B.utf8ByteLength(t)+1;case"number":if(Math.floor(t)===t&&t>=lC&&t<=cC)if(!Object.is(t,-0)&&t>=Eh&&t<=gh)return B.utf8ByteLength(e)+1+5;else return B.utf8ByteLength(e)+1+9;else return B.utf8ByteLength(e)+1+9;case"undefined":if(n||!s)return B.utf8ByteLength(e)+1+1;return 0;case"boolean":return B.utf8ByteLength(e)+1+2;case"object":if(t!=null&&typeof t._bsontype==="string"&&t[Dd]!==yh)throw new bc;else if(t==null||t._bsontype==="MinKey"||t._bsontype==="MaxKey")return B.utf8ByteLength(e)+1+1;else if(t._bsontype==="ObjectId")return B.utf8ByteLength(e)+1+13;else if(t instanceof Date||Sd(t))return B.utf8ByteLength(e)+1+9;else if(ArrayBuffer.isView(t)||t instanceof ArrayBuffer||Lg(t))return B.utf8ByteLength(e)+1+6+t.byteLength;else if(t._bsontype==="Long"||t._bsontype==="Double"||t._bsontype==="Timestamp")return B.utf8ByteLength(e)+1+9;else if(t._bsontype==="Decimal128")return B.utf8ByteLength(e)+1+17;else if(t._bsontype==="Int32")return B.utf8ByteLength(e)+1+5;else if(t._bsontype==="Code")if(t.scope!=null&&typeof t.scope==="object"){if(o.has(t.scope))throw new I("Cannot convert circular structure to BSON");return i.push({object:t.scope,ignoreUndefined:s,exit:!1}),B.utf8ByteLength(e)+1+1+4+4+B.utf8ByteLength(t.code.toString())+1}else return B.utf8ByteLength(e)+1+1+4+B.utf8ByteLength(t.code.toString())+1;else if(t._bsontype==="Binary"){let u=t;if(u.sub_type===ve.SUBTYPE_BYTE_ARRAY)return B.utf8ByteLength(e)+1+(u.position+1+4+1+4);else return B.utf8ByteLength(e)+1+(u.position+1+4+1)}else if(t._bsontype==="BSONSymbol")return B.utf8ByteLength(e)+1+B.utf8ByteLength(t.value)+4+1+1;else if(t._bsontype==="DBRef"){let u=Object.assign({$ref:t.collection,$id:t.oid},t.fields);if(t.db!=null)u.$db=t.db;return i.push({object:u,ignoreUndefined:!0,exit:!1}),B.utf8ByteLength(e)+1+1}else if(t instanceof RegExp||Od(t))return B.utf8ByteLength(e)+1+1+B.utf8ByteLength(t.source)+1+(t.global?1:0)+(t.ignoreCase?1:0)+(t.multiline?1:0)+1;else if(t._bsontype==="BSONRegExp")return B.utf8ByteLength(e)+1+1+B.utf8ByteLength(t.pattern)+1+B.utf8ByteLength(t.options)+1;else{if(o.has(t))throw new I("Cannot convert circular structure to BSON");return i.push({object:t,ignoreUndefined:s,exit:!1}),B.utf8ByteLength(e)+1+1}case"function":if(r)return B.utf8ByteLength(e)+1+1+4+B.utf8ByteLength(t.toString())+1;return 0;case"bigint":return B.utf8ByteLength(e)+1+9;case"symbol":return 0;default:throw new I(`Unrecognized JS type: ${typeof t}`)}}function Aee(e){return e.split("").sort().join("")}class Ws extends Kn{get _bsontype(){return"BSONRegExp"}pattern;options;constructor(e,t){super();if(this.pattern=e,this.options=Aee(t??""),this.pattern.indexOf("\x00")!==-1)throw new I(`BSON Regex patterns cannot contain null bytes, found: ${JSON.stringify(this.pattern)}`);if(this.options.indexOf("\x00")!==-1)throw new I(`BSON Regex options cannot contain null bytes, found: ${JSON.stringify(this.options)}`);for(let r=0;r<this.options.length;r++)if(!(this.options[r]==="i"||this.options[r]==="m"||this.options[r]==="x"||this.options[r]==="l"||this.options[r]==="s"||this.options[r]==="u"))throw new I(`The regular expression option [${this.options[r]}] is not supported`)}static parseOptions(e){return e?e.split("").sort().join(""):""}toExtendedJSON(e){if(e=e||{},e.legacy)return{$regex:this.pattern,$options:this.options};return{$regularExpression:{pattern:this.pattern,options:this.options}}}static fromExtendedJSON(e){if("$regex"in e)if(typeof e.$regex!=="string"){if(e.$regex._bsontype==="BSONRegExp")return e}else return new Ws(e.$regex,Ws.parseOptions(e.$options));if("$regularExpression"in e)return new Ws(e.$regularExpression.pattern,Ws.parseOptions(e.$regularExpression.options));throw new I(`Unexpected BSONRegExp EJSON object form: ${JSON.stringify(e)}`)}inspect(e,t,r){let n=WZ(t)??((o)=>o);r??=Ps;let s=n(r(this.pattern),"regexp"),i=n(r(this.options),"regexp");return`new BSONRegExp(${s}, ${i})`}}class Ia extends Kn{get _bsontype(){return"BSONSymbol"}value;constructor(e){super();this.value=e}valueOf(){return this.value}toString(){return this.value}toJSON(){return this.value}toExtendedJSON(){return{$symbol:this.value}}static fromExtendedJSON(e){return new Ia(e.$symbol)}inspect(e,t,r){return r??=Ps,`new BSONSymbol(${r(this.value,t)})`}}var wee=T;class ki extends wee{get _bsontype(){return"Timestamp"}get[Fa](){return"Timestamp"}static MAX_VALUE=T.MAX_UNSIGNED_VALUE;get i(){return this.low>>>0}get t(){return this.high>>>0}constructor(e){if(e==null)super(0,0,!0);else if(typeof e==="bigint")super(e,!0);else if(T.isLong(e))super(e.low,e.high,!0);else if(typeof e==="object"&&"t"in e&&"i"in e){if(typeof e.t!=="number"&&(typeof e.t!=="object"||e.t._bsontype!=="Int32"))throw new I("Timestamp constructed from { t, i } must provide t as a number");if(typeof e.i!=="number"&&(typeof e.i!=="object"||e.i._bsontype!=="Int32"))throw new I("Timestamp constructed from { t, i } must provide i as a number");let t=Number(e.t),r=Number(e.i);if(t<0||Number.isNaN(t))throw new I("Timestamp constructed from { t, i } must provide a positive t");if(r<0||Number.isNaN(r))throw new I("Timestamp constructed from { t, i } must provide a positive i");if(t>4294967295)throw new I("Timestamp constructed from { t, i } must provide t equal or less than uint32 max");if(r>4294967295)throw new I("Timestamp constructed from { t, i } must provide i equal or less than uint32 max");super(r,t,!0)}else throw new I("A Timestamp can only be constructed with: bigint, Long, or { t: number; i: number }")}toJSON(){return{$timestamp:this.toString()}}static fromInt(e){return new ki(T.fromInt(e,!0))}static fromNumber(e){return new ki(T.fromNumber(e,!0))}static fromBits(e,t){return new ki({i:e,t})}static fromString(e,t){return new ki(T.fromString(e,!0,t))}toExtendedJSON(){return{$timestamp:{t:this.t,i:this.i}}}static fromExtendedJSON(e){let t=T.isLong(e.$timestamp.i)?e.$timestamp.i.getLowBitsUnsigned():e.$timestamp.i,r=T.isLong(e.$timestamp.t)?e.$timestamp.t.getLowBitsUnsigned():e.$timestamp.t;return new ki({t:r,i:t})}inspect(e,t,r){r??=Ps;let n=r(this.t,t),s=r(this.i,t);return`new Timestamp({ t: ${n}, i: ${s} })`}}var Oee=T.fromNumber(cC),See=T.fromNumber(lC);function DC(e,t,r){t=t==null?{}:t;let n=t&&t.index?t.index:0,s=Ee.getInt32LE(e,n);if(s<5)throw new I(`bson size must be >= 5, is ${s}`);if(t.allowObjectSmallerThanBufferSize&&e.length<s)throw new I(`buffer length ${e.length} must be >= bson size ${s}`);if(!t.allowObjectSmallerThanBufferSize&&e.length!==s)throw new I(`buffer length ${e.length} must === bson size ${s}`);if(s+n>e.byteLength)throw new I(`(bson size ${s} + options.index ${n} must be <= buffer length ${e.byteLength})`);if(e[n+s-1]!==0)throw new I("One object, sized correctly, with a spot for an EOO, but the EOO isn't 0x00");return Cee(e,n,t,r)}var rC=/^\$ref$|^\$id$|^\$db$/;function nC(e,t,r){if(t==="__proto__")Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0});else e[t]=r}function sC(e){if(SC(e)){let{$ref:t,$id:r,$db:n,...s}=e;return new Ji(t,r,n,s)}return e}function Cee(e,t,r,n=!1){r={...r};let s=r.fieldsAsRaw==null?null:r.fieldsAsRaw,i=r.raw==null?!1:r.raw,o=typeof r.bsonRegExp==="boolean"?r.bsonRegExp:!1,u=r.promoteBuffers??!1,a=r.promoteLongs??!0,c=r.promoteValues??!0,l=r.useBigInt64??!1;if(l&&!c)throw new I("Must either request bigint or Long for int64 deserialization");if(l&&!a)throw new I("Must either request bigint or Long for int64 deserialization");let f=r.validation==null?{utf8:!0}:r.validation,h=!0,d,p,m=f.utf8;if(typeof m==="boolean")d=m;else{h=!1;let v=Object.keys(m).map(function(P){return m[P]});if(v.length===0)throw new I("UTF-8 validation setting cannot be empty");if(typeof v[0]!=="boolean")throw new I("Invalid UTF-8 validation option, must specify boolean values");if(d=v[0],!v.every((P)=>P===d))throw new I("Invalid UTF-8 validation option - keys must be all true or all false")}if(!h){p=new Set;for(let v of Object.keys(m))p.add(v)}let E=t;if(e.length<5)throw new I("corrupt bson message < 5 bytes long");let y=Ee.getInt32LE(e,t);if(t+=4,y<5||y>e.length)throw new I("corrupt bson message");let _=n?[]:{},w=0,C=n?!1:null,A=null,M=_,O=n;while(!0){let v=e[t++];if(v===0)if(A)if(t===A.lastIndex){let H=A;if(A=H.prev,A===null)M=_,O=n;else M=A.holdingDocument,O=A.isArray;let Oe=H.holdingDocument;switch(H.elementType){case dh:if(H.isPossibleDBRef)Oe=sC(Oe);break;case fh:break;case wd:Oe=new Uo(H.functionString,H.holdingDocument);break;default:throw new I("Unexpected element type in frame stack")}nC(M,H.propertyName,Oe);continue}else{if(A.elementType===fh)throw new I("corrupted array bson");throw new I("Bad BSON Document: object not properly terminated")}else break;let P=t;while(e[P]!==0&&P<e.length)P++;if(P>=e.byteLength)throw new I("Bad BSON Document: illegal CString");let ge=O?A!==null?A.arrayIndex++:w++:B.toUTF8(e,t,P,!1),Me;if(A!==null)Me=A.validationSetting;else if(h||p?.has(ge))Me=d;else Me=!d;if(A!==null){if(A.isPossibleDBRef!==!1&&typeof ge==="string"&&ge[0]==="$")A.isPossibleDBRef=rC.test(ge)}else if(C!==!1&&ge[0]==="$")C=rC.test(ge);let oe,Yt=!1;if(t=P+1,v===hC){let H=Ee.getInt32LE(e,t);if(t+=4,H<=0||H>e.length-t||e[t+H-1]!==0)throw new I("bad string length in bson");oe=B.toUTF8(e,t,t+H-1,Me),t=t+H}else if(v===fC)oe=new $t(e,t),t=t+12;else if(v===ph&&c===!1)oe=new Vo(Ee.getInt32LE(e,t)),t+=4;else if(v===ph)oe=Ee.getInt32LE(e,t),t+=4;else if(v===Ug){if(oe=Ee.getFloat64LE(e,t),t+=8,c===!1)oe=new zs(oe)}else if(v===pC){let H=Ee.getInt32LE(e,t),Oe=Ee.getInt32LE(e,t+4);t+=8,oe=new Date(new T(H,Oe).toNumber())}else if(v===dC){if(e[t]!==0&&e[t]!==1)throw new I("illegal boolean type value");oe=e[t++]===1}else if(v===dh){let H=Ee.getInt32LE(e,t);if(H<5||H>e.length-t)throw new I("bad embedded document length in bson");if(i||(A?.raw??!1))oe=e.subarray(t,t+H),t=t+H;else{Yt=!0;let Oe={holdingDocument:{},elementType:dh,propertyName:ge,functionString:null,lastIndex:t+H,isArray:!1,arrayIndex:0,raw:!1,isPossibleDBRef:null,validationSetting:Me,prev:A};A=Oe,M=Oe.holdingDocument,O=!1,t=t+4}}else if(v===fh){let H=Ee.getInt32LE(e,t);if(H<5||H>e.length-t)throw new I("bad embedded array length in bson");let Oe=t+H,ct=!!(s&&s[ge])||(A?.raw??!1);Yt=!0;let ss={holdingDocument:[],elementType:fh,propertyName:ge,functionString:null,lastIndex:Oe,isArray:!0,arrayIndex:0,raw:ct,isPossibleDBRef:!1,validationSetting:Me,prev:A};A=ss,M=ss.holdingDocument,O=!0,t=t+4}else if(v===KZ)oe=void 0;else if(v===zg)oe=null;else if(v===Kg)if(l)oe=Ee.getBigInt64LE(e,t),t+=8;else{let H=Ee.getInt32LE(e,t),Oe=Ee.getInt32LE(e,t+4);t+=8;let ct=new T(H,Oe);if(a&&c===!0)oe=ct.lessThanOrEqual(Oee)&&ct.greaterThanOrEqual(See)?ct.toNumber():ct;else oe=ct}else if(v===gC){let H=B.allocateUnsafe(16);for(let Oe=0;Oe<16;Oe++)H[Oe]=e[t+Oe];t=t+16,oe=new Sn(H)}else if(v===Vg){let H=Ee.getInt32LE(e,t);t+=4;let Oe=H,ct=e[t++];if(H<0)throw new I("Negative binary type element size found");if(H>e.byteLength)throw new I("Binary type size larger than document size");if(ct===ve.SUBTYPE_BYTE_ARRAY){if(H=Ee.getInt32LE(e,t),t+=4,H<0)throw new I("Negative binary type element size found for subtype 0x02");if(H>Oe-4)throw new I("Binary type with subtype 0x02 contains too long binary size");if(H<Oe-4)throw new I("Binary type with subtype 0x02 contains too short binary size")}if(u&&c)oe=B.toLocalBufferType(e.subarray(t,t+H));else if(oe=new ve(e.subarray(t,t+H),ct),ct===Hg&&dn.isValid(oe))oe=oe.toUUID();t=t+H}else if(v===Cd&&o===!1){P=t;while(e[P]!==0&&P<e.length)P++;if(P>=e.length)throw new I("Bad BSON Document: illegal CString");let H=B.toUTF8(e,t,P,!1);t=P+1,P=t;while(e[P]!==0&&P<e.length)P++;if(P>=e.length)throw new I("Bad BSON Document: illegal CString");let Oe=B.toUTF8(e,t,P,!1);t=P+1;let ct=Array(Oe.length);for(P=0;P<Oe.length;P++)switch(Oe[P]){case"m":ct[P]="m";break;case"s":ct[P]="g";break;case"i":ct[P]="i";break}oe=new RegExp(H,ct.join(""))}else if(v===Cd&&o===!0){P=t;while(e[P]!==0&&P<e.length)P++;if(P>=e.length)throw new I("Bad BSON Document: illegal CString");let H=B.toUTF8(e,t,P,!1);t=P+1,P=t;while(e[P]!==0&&P<e.length)P++;if(P>=e.length)throw new I("Bad BSON Document: illegal CString");let Oe=B.toUTF8(e,t,P,!1);t=P+1,oe=new Ws(H,Oe)}else if(v===mC){let H=Ee.getInt32LE(e,t);if(t+=4,H<=0||H>e.length-t||e[t+H-1]!==0)throw new I("bad string length in bson");let Oe=B.toUTF8(e,t,t+H-1,Me);oe=c?Oe:new Ia(Oe),t=t+H}else if(v===yC)oe=new ki({i:Ee.getUint32LE(e,t),t:Ee.getUint32LE(e,t+4)}),t+=8;else if(v===EC)oe=new Na;else if(v===_C)oe=new Ba;else if(v===Wg){let H=Ee.getInt32LE(e,t);if(t+=4,H<=0||H>e.length-t||e[t+H-1]!==0)throw new I("bad string length in bson");let Oe=B.toUTF8(e,t,t+H-1,Me);oe=new Uo(Oe),t=t+H}else if(v===wd){let H=Ee.getInt32LE(e,t);if(t+=4,H<13)throw new I("code_w_scope total size shorter minimum expected length");let Oe=Ee.getInt32LE(e,t);if(t+=4,Oe<=0||Oe>e.length-t||e[t+Oe-1]!==0)throw new I("bad string length in bson");let ct=B.toUTF8(e,t,t+Oe-1,Me);t=t+Oe;let ss=t,ze=Ee.getInt32LE(e,t);if(ze<5||ze>e.length-t)throw new I("bad scope document size in code_w_scope");if(H<8+ze+Oe)throw new I("code_w_scope total size is too short, truncating scope");if(H>8+ze+Oe)throw new I("code_w_scope total size is too long, clips outer document");Yt=!0;let On={holdingDocument:{},elementType:wd,propertyName:ge,functionString:ct,lastIndex:ss+ze,isArray:!1,arrayIndex:0,raw:!1,isPossibleDBRef:null,validationSetting:Me,prev:A};A=On,M=On.holdingDocument,O=!1,t=t+4}else if(v===HZ){let H=Ee.getInt32LE(e,t);if(t+=4,H<=0||H>e.length-t||e[t+H-1]!==0)throw new I("bad string length in bson");let Oe=B.toUTF8(e,t,t+H-1,Me);t=t+H;let ct=B.allocateUnsafe(12);for(let ze=0;ze<12;ze++)ct[ze]=e[t+ze];let ss=new $t(ct);t=t+12,oe=new Ji(Oe,ss)}else throw new I(`Detected unknown BSON type ${v.toString(16)} for fieldname "${ge}"`);if(!Yt)nC(M,ge,oe)}if(A!==null)throw new I("corrupted bson, more objects expected based on the current document size");let x=_;if(y!==t-E){if(n)throw new I("corrupt array bson");throw new I("corrupt object bson")}if(!C)return x;return sC(x)}var Gg=/\x00/,bee=new Set(["$db","$ref","$id","$clusterTime"]);function Dee(e,t,r,n){e[n++]=hC;let s=B.encodeUTF8Into(e,t,n);n=n+s+1,e[n-1]=0;let i=B.encodeUTF8Into(e,r,n+4);return Ee.setInt32LE(e,n,i+1),n=n+4+i,e[n++]=0,n}function Tee(e,t,r,n){let i=!Object.is(r,-0)&&Number.isSafeInteger(r)&&r<=gh&&r>=Eh?ph:Ug;e[n++]=i;let o=B.encodeUTF8Into(e,t,n);if(n=n+o,e[n++]=0,i===ph)n+=Ee.setInt32LE(e,n,r);else n+=Ee.setFloat64LE(e,n,r);return n}function Mee(e,t,r,n){e[n++]=Kg;let s=B.encodeUTF8Into(e,t,n);return n+=s,e[n++]=0,n+=Ee.setBigInt64LE(e,n,r),n}function iC(e,t,r,n){e[n++]=zg;let s=B.encodeUTF8Into(e,t,n);return n=n+s,e[n++]=0,n}function xee(e,t,r,n){e[n++]=dC;let s=B.encodeUTF8Into(e,t,n);return n=n+s,e[n++]=0,e[n++]=r?1:0,n}function Pee(e,t,r,n){e[n++]=pC;let s=B.encodeUTF8Into(e,t,n);n=n+s,e[n++]=0;let i=T.fromNumber(r.getTime()),o=i.getLowBits(),u=i.getHighBits();return n+=Ee.setInt32LE(e,n,o),n+=Ee.setInt32LE(e,n,u),n}function Fee(e,t,r,n){e[n++]=Cd;let s=B.encodeUTF8Into(e,t,n);if(n=n+s,e[n++]=0,r.source&&r.source.match(Gg)!=null)throw new I("value "+r.source+" must not contain null bytes");if(n=n+B.encodeUTF8Into(e,r.source,n),e[n++]=0,r.ignoreCase)e[n++]=105;if(r.global)e[n++]=115;if(r.multiline)e[n++]=109;return e[n++]=0,n}function Bee(e,t,r,n){e[n++]=Cd;let s=B.encodeUTF8Into(e,t,n);if(n=n+s,e[n++]=0,r.pattern.match(Gg)!=null)throw new I("pattern "+r.pattern+" must not contain null bytes");n=n+B.encodeUTF8Into(e,r.pattern,n),e[n++]=0;let i=r.options.split("").sort().join("");return n=n+B.encodeUTF8Into(e,i,n),e[n++]=0,n}function Nee(e,t,r,n){if(r===null)e[n++]=zg;else if(r[Fa]==="MinKey")e[n++]=EC;else e[n++]=_C;let s=B.encodeUTF8Into(e,t,n);return n=n+s,e[n++]=0,n}function Iee(e,t,r,n){e[n++]=fC;let s=B.encodeUTF8Into(e,t,n);return n=n+s,e[n++]=0,n+=r.serializeInto(e,n),n}function $ee(e,t,r,n){e[n++]=Vg;let s=B.encodeUTF8Into(e,t,n);n=n+s,e[n++]=0;let i=r.length;if(n+=Ee.setInt32LE(e,n,i),e[n++]=GZ,i<=16)for(let o=0;o<i;o++)e[n+o]=r[o];else e.set(r,n);return n=n+i,n}function Ree(e,t,r,n){e[n++]=gC;let s=B.encodeUTF8Into(e,t,n);n=n+s,e[n++]=0;for(let i=0;i<16;i++)e[n+i]=r.bytes[i];return n+16}function vee(e,t,r,n){e[n++]=r[Fa]==="Long"?Kg:yC;let s=B.encodeUTF8Into(e,t,n);n=n+s,e[n++]=0;let i=r.getLowBits(),o=r.getHighBits();return n+=Ee.setInt32LE(e,n,i),n+=Ee.setInt32LE(e,n,o),n}function kee(e,t,r,n){r=r.valueOf(),e[n++]=ph;let s=B.encodeUTF8Into(e,t,n);return n=n+s,e[n++]=0,n+=Ee.setInt32LE(e,n,r),n}function qee(e,t,r,n){e[n++]=Ug;let s=B.encodeUTF8Into(e,t,n);return n=n+s,e[n++]=0,n+=Ee.setFloat64LE(e,n,r.value),n}function jee(e,t,r,n){e[n++]=Wg;let s=B.encodeUTF8Into(e,t,n);n=n+s,e[n++]=0;let i=r.toString(),o=B.encodeUTF8Into(e,i,n+4)+1;return Ee.setInt32LE(e,n,o),n=n+4+o-1,e[n++]=0,n}function Lee(e,t,r,n){e[n++]=Vg;let s=B.encodeUTF8Into(e,t,n);n=n+s,e[n++]=0;let{buffer:i,position:o}=r;if(r.sub_type===ve.SUBTYPE_BYTE_ARRAY)o=o+4;if(n+=Ee.setInt32LE(e,n,o),e[n++]=r.sub_type,r.sub_type===ve.SUBTYPE_BYTE_ARRAY)o=o-4,n+=Ee.setInt32LE(e,n,o);if(r.sub_type===ve.SUBTYPE_VECTOR)jo(r);if(o<=16)for(let u=0;u<o;u++)e[n+u]=i[u];else e.set(i,n);return n=n+r.position,n}function Uee(e,t,r,n){e[n++]=mC;let s=B.encodeUTF8Into(e,t,n);n=n+s,e[n++]=0;let i=B.encodeUTF8Into(e,r.value,n+4)+1;return Ee.setInt32LE(e,n,i),n=n+4+i-1,e[n++]=0,n}function Ad(e,t,r,n,s,i){if(Array.isArray(e))return{sourceObject:e,isArray:!0,objectSizeIndex:t,codeSizeIndex:r,iterTarget:e,keys:null,keyIndex:0,mapIterator:null,prev:n,checkKeys:s,ignoreUndefined:i};if(e instanceof Map||bd(e))return{sourceObject:e,isArray:!1,objectSizeIndex:t,codeSizeIndex:r,iterTarget:e,keys:null,keyIndex:0,mapIterator:e.entries(),prev:n,checkKeys:s,ignoreUndefined:i};let o=e;if(typeof o?.toBSON==="function"){if(o=o.toBSON(),o!=null&&typeof o!=="object")throw new I("toBSON function did not return an object")}return{sourceObject:e,isArray:!1,objectSizeIndex:t,codeSizeIndex:r,iterTarget:o,keys:Object.keys(o),keyIndex:0,mapIterator:null,prev:n,checkKeys:s,ignoreUndefined:i}}function TC(e,t,r,n,s,i,o){if(o==null){if(t==null)return e[0]=5,e[1]=0,e[2]=0,e[3]=0,e[4]=0,5;if(Array.isArray(t))throw new I("serialize does not support an array as the root input");if(typeof t!=="object")throw new I("serialize does not support non-object as the root input");else if("_bsontype"in t&&typeof t._bsontype==="string")throw new I("BSON types cannot be serialized as a document");else if(Sd(t)||Od(t)||Cc(t)||Lg(t))throw new I("date, regexp, typedarray, and arraybuffer cannot be BSON documents");o=new Set}o.add(t);let u=Ad(t,n,null,null,r,i),a=n+4;while(u!==null){let c=u,l,f;if(c.mapIterator!==null){let d=c.mapIterator.next();if(d.done){if(e[a++]=0,Ee.setInt32LE(e,c.objectSizeIndex,a-c.objectSizeIndex),c.codeSizeIndex!==null)Ee.setInt32LE(e,c.codeSizeIndex,a-c.codeSizeIndex);o.delete(c.sourceObject),u=c.prev;continue}l=d.value[0],f=d.value[1]}else if(c.keys!==null){if(c.keyIndex>=c.keys.length){if(e[a++]=0,Ee.setInt32LE(e,c.objectSizeIndex,a-c.objectSizeIndex),c.codeSizeIndex!==null)Ee.setInt32LE(e,c.codeSizeIndex,a-c.codeSizeIndex);o.delete(c.sourceObject),u=c.prev;continue}l=c.keys[c.keyIndex++],f=c.iterTarget[l]}else{let d=c.iterTarget;if(c.keyIndex>=d.length){if(e[a++]=0,Ee.setInt32LE(e,c.objectSizeIndex,a-c.objectSizeIndex),c.codeSizeIndex!==null)Ee.setInt32LE(e,c.codeSizeIndex,a-c.codeSizeIndex);o.delete(c.sourceObject),u=c.prev;continue}let p=c.keyIndex++;l=String(p),f=d[p]}if(typeof f?.toBSON==="function")f=f.toBSON();if(!c.isArray&&typeof l==="string"&&!(l[0]==="$"&&bee.has(l))){if(Gg.test(l))throw new I("key "+l+" must not contain null bytes");if(c.checkKeys){if(l[0]==="$")throw new I("key "+l+" must not start with '$'");else if(l.includes("."))throw new I("key "+l+" must not contain '.'")}}let h=typeof f;if(f===void 0){if(c.isArray||c.ignoreUndefined===!1)a=iC(e,l,f,a)}else if(f===null)a=iC(e,l,f,a);else if(h==="string")a=Dee(e,l,f,a);else if(h==="number")a=Tee(e,l,f,a);else if(h==="bigint")a=Mee(e,l,f,a);else if(h==="boolean")a=xee(e,l,f,a);else if(h==="object"&&f._bsontype==null)if(f instanceof Date||Sd(f))a=Pee(e,l,f,a);else if(f instanceof Uint8Array||Cc(f))a=$ee(e,l,f,a);else if(f instanceof RegExp||Od(f))a=Fee(e,l,f,a);else{if(o.has(f))throw new I("Cannot convert circular structure to BSON");let d=Array.isArray(f);e[a++]=d?fh:dh,a+=B.encodeUTF8Into(e,l,a),e[a++]=0;let p=a;o.add(f),u=Ad(f,p,null,c,c.checkKeys,c.ignoreUndefined),a+=4}else if(h==="object"){if(f[Dd]!==yh)throw new bc;let d=f[Fa];if(d==="ObjectId")a=Iee(e,l,f,a);else if(d==="Decimal128")a=Ree(e,l,f,a);else if(d==="Long"||d==="Timestamp")a=vee(e,l,f,a);else if(d==="Double")a=qee(e,l,f,a);else if(d==="Code"){let p=f;if(p.scope&&typeof p.scope==="object"){e[a++]=wd,a+=B.encodeUTF8Into(e,l,a),e[a++]=0;let m=a;a+=4;let E=p.code,y=B.encodeUTF8Into(e,E,a+4)+1;Ee.setInt32LE(e,a,y),e[a+4+y-1]=0,a=a+y+4;let _=p.scope;if(o.has(_))throw new I("Cannot convert circular structure to BSON");o.add(_),u=Ad(_,a,m,c,c.checkKeys,c.ignoreUndefined),a+=4}else{e[a++]=Wg,a+=B.encodeUTF8Into(e,l,a),e[a++]=0;let m=p.code.toString(),E=B.encodeUTF8Into(e,m,a+4)+1;Ee.setInt32LE(e,a,E),a=a+4+E-1,e[a++]=0}}else if(d==="Binary")a=Lee(e,l,f,a);else if(d==="BSONSymbol")a=Uee(e,l,f,a);else if(d==="DBRef"){let p=f,m=Object.assign({$ref:p.collection,$id:p.oid},p.db!=null?{$db:p.db}:null,p.fields);e[a++]=dh,a+=B.encodeUTF8Into(e,l,a),e[a++]=0,o.add(m),u=Ad(m,a,null,c,!1,!0),a+=4}else if(d==="BSONRegExp")a=Bee(e,l,f,a);else if(d==="Int32")a=kee(e,l,f,a);else if(d==="MinKey"||d==="MaxKey")a=Nee(e,l,f,a);else if(typeof f._bsontype<"u")throw new I(`Unrecognized or invalid _bsontype: ${String(f._bsontype)}`)}else if(h==="function"&&s)a=jee(e,l,f,a)}return a}function Vee(e){return e!=null&&typeof e==="object"&&"_bsontype"in e&&typeof e._bsontype==="string"}var zee={$oid:$t,$binary:ve,$uuid:ve,$symbol:Ia,$numberInt:Vo,$numberDecimal:Sn,$numberDouble:zs,$numberLong:T,$minKey:Na,$maxKey:Ba,$regex:Ws,$regularExpression:Ws,$timestamp:ki};function MC(e,t={}){if(typeof e==="number"){let n=e<=gh&&e>=Eh,s=e<=uC&&e>=aC;if(t.relaxed||t.legacy)return e;if(Number.isInteger(e)&&!Object.is(e,-0)){if(n)return new Vo(e);if(s){if(t.useBigInt64)return BigInt(e);return T.fromNumber(e)}}return new zs(e)}if(e==null||typeof e!=="object")return e;if(e.$undefined)return null;let r=Object.keys(e).filter((n)=>n.startsWith("$")&&e[n]!=null);for(let n=0;n<r.length;n++){let s=zee[r[n]];if(s)return s.fromExtendedJSON(e,t)}if(e.$date!=null){let n=e.$date,s=new Date;if(t.legacy)if(typeof n==="number")s.setTime(n);else if(typeof n==="string")s.setTime(Date.parse(n));else if(typeof n==="bigint")s.setTime(Number(n));else throw new mh(`Unrecognized type for EJSON date: ${typeof n}`);else if(typeof n==="string")s.setTime(Date.parse(n));else if(T.isLong(n))s.setTime(n.toNumber());else if(typeof n==="number"&&t.relaxed)s.setTime(n);else if(typeof n==="bigint")s.setTime(Number(n));else throw new mh(`Unrecognized type for EJSON date: ${typeof n}`);return s}if(e.$code!=null){let n=Object.assign({},e);if(e.$scope)n.$scope=MC(e.$scope);return Uo.fromExtendedJSON(e)}if(SC(e)||e.$dbPointer){let n=e.$ref?e:e.$dbPointer;if(n instanceof Ji)return n;let s=Object.keys(n).filter((o)=>o.startsWith("$")),i=!0;if(s.forEach((o)=>{if(["$ref","$id","$db"].indexOf(o)===-1)i=!1}),i)return Ji.fromExtendedJSON(n)}return e}function Wee(e,t){return e.map((r,n)=>{t.seenObjects.push({propertyName:`index ${n}`,obj:null});try{return Lo(r,t)}finally{t.seenObjects.pop()}})}function oC(e){let t=e.toISOString();return e.getUTCMilliseconds()!==0?t:t.slice(0,-5)+"Z"}function Lo(e,t){if(e instanceof Map||bd(e)){let r=Object.create(null);for(let[n,s]of e){if(typeof n!=="string")throw new I("Can only serialize maps with string keys");r[n]=s}return Lo(r,t)}if((typeof e==="object"||typeof e==="function")&&e!==null){let r=t.seenObjects.findIndex((n)=>n.obj===e);if(r!==-1){let n=t.seenObjects.map((l)=>l.propertyName),s=n.slice(0,r).map((l)=>`${l} -> `).join(""),i=n[r],o=" -> "+n.slice(r+1,n.length-1).map((l)=>`${l} -> `).join(""),u=n[n.length-1],a=" ".repeat(s.length+i.length/2),c="-".repeat(o.length+(i.length+u.length)/2-1);throw new I(`Converting circular structure to EJSON:
7
+ ${s}${i}${o}${u}
8
+ ${a}\\${c}/`)}t.seenObjects[t.seenObjects.length-1].obj=e}if(Array.isArray(e))return Wee(e,t);if(e===void 0)return t.ignoreUndefined?void 0:null;if(e instanceof Date||Sd(e)){let r=e.getTime(),n=r>-1&&r<253402300800000;if(t.legacy)return t.relaxed&&n?{$date:e.getTime()}:{$date:oC(e)};return t.relaxed&&n?{$date:oC(e)}:{$date:{$numberLong:e.getTime().toString()}}}if(typeof e==="number"&&(!t.relaxed||!isFinite(e))){if(Number.isInteger(e)&&!Object.is(e,-0)){if(e>=Eh&&e<=gh)return{$numberInt:e.toString()};if(e>=aC&&e<=uC)return{$numberLong:e.toString()}}return{$numberDouble:Object.is(e,-0)?"-0.0":e.toString()}}if(typeof e==="bigint"){if(!t.relaxed)return{$numberLong:BigInt.asIntN(64,e).toString()};return Number(BigInt.asIntN(64,e))}if(e instanceof RegExp||Od(e)){let r=e.flags;if(r===void 0){let s=e.toString().match(/[gimuy]*$/);if(s)r=s[0]}return new Ws(e.source,r).toExtendedJSON(t)}if(e!=null&&typeof e==="object")return Hee(e,t);return e}var Kee={Binary:(e)=>new ve(e.value(),e.sub_type),Code:(e)=>new Uo(e.code,e.scope),DBRef:(e)=>new Ji(e.collection||e.namespace,e.oid,e.db,e.fields),Decimal128:(e)=>new Sn(e.bytes),Double:(e)=>new zs(e.value),Int32:(e)=>new Vo(e.value),Long:(e)=>T.fromBits(e.low!=null?e.low:e.low_,e.low!=null?e.high:e.high_,e.low!=null?e.unsigned:e.unsigned_),MaxKey:()=>new Ba,MinKey:()=>new Na,ObjectId:(e)=>new $t(e),BSONRegExp:(e)=>new Ws(e.pattern,e.options),BSONSymbol:(e)=>new Ia(e.value),Timestamp:(e)=>ki.fromBits(e.low,e.high)};function Hee(e,t){if(e==null||typeof e!=="object")throw new I("not an object instance");let r=e._bsontype;if(typeof r>"u"){let n={};for(let s of Object.keys(e)){t.seenObjects.push({propertyName:s,obj:null});try{let i=Lo(e[s],t);if(s==="__proto__")Object.defineProperty(n,s,{value:i,writable:!0,enumerable:!0,configurable:!0});else n[s]=i}finally{t.seenObjects.pop()}}return n}else if(e!=null&&typeof e==="object"&&typeof e._bsontype==="string"&&e[Dd]!==yh)throw new bc;else if(Vee(e)){let n=e;if(typeof n.toExtendedJSON!=="function"){let s=Kee[e._bsontype];if(!s)throw new I("Unrecognized or invalid _bsontype: "+e._bsontype);n=s(n)}if(r==="Code"&&n.scope)n=new Uo(n.code,Lo(n.scope,t));else if(r==="DBRef"&&n.oid)n=new Ji(Lo(n.collection,t),Lo(n.oid,t),Lo(n.db,t),Lo(n.fields,t));return n.toExtendedJSON(t)}else throw new I("_bsontype must be a string, but was: "+typeof r)}function xC(e,t){let r={useBigInt64:t?.useBigInt64??!1,relaxed:t?.relaxed??!0,legacy:t?.legacy??!1};return JSON.parse(e,(n,s)=>{if(n.indexOf("\x00")!==-1)throw new I(`BSON Document field names cannot contain null bytes, found: ${JSON.stringify(n)}`);return MC(s,r)})}function PC(e,t,r,n){if(r!=null&&typeof r==="object")n=r,r=void 0;if(t!=null&&typeof t==="object"&&!Array.isArray(t))n=t,t=void 0;let s=Object.assign({relaxed:!0,legacy:!1},n,{seenObjects:[{propertyName:"(root)",obj:null}]}),i=Lo(e,s);return JSON.stringify(i,t,r)}function Gee(e,t){return t=t||{},JSON.parse(PC(e,t))}function Yee(e,t){return t=t||{},xC(JSON.stringify(e),t)}var $a=Object.create(null);$a.parse=xC;$a.stringify=PC;$a.serialize=Gee;$a.deserialize=Yee;Object.freeze($a);var tr={double:1,string:2,object:3,array:4,binData:5,undefined:6,objectId:7,bool:8,date:9,null:10,regex:11,dbPointer:12,javascript:13,symbol:14,javascriptWithScope:15,int:16,timestamp:17,long:18,decimal:19,minKey:255,maxKey:127};function qg(e,t){try{return Ee.getNonnegativeInt32LE(e,t)}catch(r){throw new vi("BSON size cannot be negative",t,{cause:r})}}function jg(e,t){let r=t;for(;e[r];r++);if(r>=e.length-1)throw new vi("Null terminator not found",t);return r}function Qee(e,t=0){if(t??=0,e.length<5)throw new vi(`Input must be at least 5 bytes, got ${e.length} bytes`,t);let r=qg(e,t);if(r>e.length-t)throw new vi(`Parsed documentSize (${r} bytes) does not match input length (${e.length} bytes)`,t);if(e[t+r-1]!==0)throw new vi("BSON documents must end in 0x00",t+r);let n=[],s=t+4;while(s<=r+t){let i=e[s];if(s+=1,i===0){if(s-t!==r)throw new vi("Invalid 0x00 type byte",s);break}let o=s,u=jg(e,s)-o;s+=u+1;let a;if(i===tr.double||i===tr.long||i===tr.date||i===tr.timestamp)a=8;else if(i===tr.int)a=4;else if(i===tr.objectId)a=12;else if(i===tr.decimal)a=16;else if(i===tr.bool)a=1;else if(i===tr.null||i===tr.undefined||i===tr.maxKey||i===tr.minKey)a=0;else if(i===tr.regex)a=jg(e,jg(e,s)+1)+1-s;else if(i===tr.object||i===tr.array||i===tr.javascriptWithScope)a=qg(e,s);else if(i===tr.string||i===tr.binData||i===tr.dbPointer||i===tr.javascript||i===tr.symbol){if(a=qg(e,s)+4,i===tr.binData)a+=1;if(i===tr.dbPointer)a+=12}else throw new vi(`Invalid 0x${i.toString(16).padStart(2,"0")} type byte`,s);if(s+a>t+r-1)throw new vi("value reports length larger than document",s);n.push([i,o,u,s,a]),s+=a}return n}var Dc=Object.create(null);Dc.parseToElements=Qee;Dc.ByteUtils=B;Dc.NumberUtils=Ee;Object.freeze(Dc);var FC=17825792,gu=B.allocate(FC);function BC(e){if(gu.length<e)gu=B.allocate(e)}function NC(e,t={}){let r=typeof t.checkKeys==="boolean"?t.checkKeys:!1,n=typeof t.serializeFunctions==="boolean"?t.serializeFunctions:!1,s=typeof t.ignoreUndefined==="boolean"?t.ignoreUndefined:!0,i=typeof t.minInternalBufferSize==="number"?t.minInternalBufferSize:FC;if(gu.length<i)gu=B.allocate(i);let o=TC(gu,e,r,0,n,s,null),u=B.allocateUnsafe(o);return u.set(gu.subarray(0,o),0),u}function IC(e,t,r={}){let n=typeof r.checkKeys==="boolean"?r.checkKeys:!1,s=typeof r.serializeFunctions==="boolean"?r.serializeFunctions:!1,i=typeof r.ignoreUndefined==="boolean"?r.ignoreUndefined:!0,o=typeof r.index==="number"?r.index:0,u=TC(gu,e,n,0,s,i,null);return t.set(gu.subarray(0,u),o),o+u-1}function $C(e,t={}){return DC(B.toLocalBufferType(e),t)}function RC(e,t={}){t=t||{};let r=typeof t.serializeFunctions==="boolean"?t.serializeFunctions:!1,n=typeof t.ignoreUndefined==="boolean"?t.ignoreUndefined:!0;return _ee(e,r,n)}function vC(e,t,r,n,s,i){let o=Object.assign({allowObjectSmallerThanBufferSize:!0,index:0},i),u=B.toLocalBufferType(e),a=t;for(let c=0;c<r;c++){let l=Ee.getInt32LE(u,a);o.index=a,n[s+c]=DC(u,o),a=a+l}return a}var Jee=Object.freeze({__proto__:null,BSONError:I,BSONOffsetError:vi,BSONRegExp:Ws,BSONRuntimeError:mh,BSONSymbol:Ia,BSONType:AC,BSONValue:Kn,BSONVersionError:bc,Binary:ve,ByteUtils:B,Code:Uo,DBRef:Ji,Decimal128:Sn,Double:zs,EJSON:$a,Int32:Vo,Long:T,MaxKey:Ba,MinKey:Na,NumberUtils:Ee,ObjectId:$t,Timestamp:ki,UUID:dn,bsonType:Fa,calculateObjectSize:RC,deserialize:$C,deserializeStream:vC,onDemand:Dc,serialize:NC,serializeWithBufferAndIndex:IC,setInternalBufferSize:BC});Xee.BSON=Jee;Xee.BSONError=I;Xee.BSONOffsetError=vi;Xee.BSONRegExp=Ws;Xee.BSONRuntimeError=mh;Xee.BSONSymbol=Ia;Xee.BSONType=AC;Xee.BSONValue=Kn;Xee.BSONVersionError=bc;Xee.Binary=ve;Xee.ByteUtils=B;Xee.Code=Uo;Xee.DBRef=Ji;Xee.Decimal128=Sn;Xee.Double=zs;Xee.EJSON=$a;Xee.Int32=Vo;Xee.Long=T;Xee.MaxKey=Ba;Xee.MinKey=Na;Xee.NumberUtils=Ee;Xee.ObjectId=$t;Xee.Timestamp=ki;Xee.UUID=dn;Xee.bsonType=Fa;Xee.calculateObjectSize=RC;Xee.deserialize=$C;Xee.deserializeStream=vC;Xee.onDemand=Dc;Xee.serialize=NC;Xee.serializeWithBufferAndIndex=IC;Xee.setInternalBufferSize=BC});var Se=g(function(zt){Object.defineProperty(zt,"__esModule",{value:!0});zt.setUint32LE=zt.readUint8=zt.readInt32LE=zt.UUID=zt.Timestamp=zt.serialize=zt.ObjectId=zt.NumberUtils=zt.MinKey=zt.MaxKey=zt.Long=zt.Int32=zt.EJSON=zt.Double=zt.deserialize=zt.Decimal128=zt.DBRef=zt.Code=zt.calculateObjectSize=zt.ByteUtils=zt.BSONType=zt.BSONSymbol=zt.BSONRegExp=zt.BSONError=zt.BSON=zt.Binary=void 0;zt.parseToElementsToArray=Fte;zt.pluckBSONSerializeOptions=$te;zt.resolveBSONOptions=Rte;zt.parseUtf8ValidationOption=vte;var Md=Yg(),rr=Yg();Object.defineProperty(zt,"Binary",{enumerable:!0,get:function(){return rr.Binary}});Object.defineProperty(zt,"BSON",{enumerable:!0,get:function(){return rr.BSON}});Object.defineProperty(zt,"BSONError",{enumerable:!0,get:function(){return rr.BSONError}});Object.defineProperty(zt,"BSONRegExp",{enumerable:!0,get:function(){return rr.BSONRegExp}});Object.defineProperty(zt,"BSONSymbol",{enumerable:!0,get:function(){return rr.BSONSymbol}});Object.defineProperty(zt,"BSONType",{enumerable:!0,get:function(){return rr.BSONType}});Object.defineProperty(zt,"ByteUtils",{enumerable:!0,get:function(){return rr.ByteUtils}});Object.defineProperty(zt,"calculateObjectSize",{enumerable:!0,get:function(){return rr.calculateObjectSize}});Object.defineProperty(zt,"Code",{enumerable:!0,get:function(){return rr.Code}});Object.defineProperty(zt,"DBRef",{enumerable:!0,get:function(){return rr.DBRef}});Object.defineProperty(zt,"Decimal128",{enumerable:!0,get:function(){return rr.Decimal128}});Object.defineProperty(zt,"deserialize",{enumerable:!0,get:function(){return rr.deserialize}});Object.defineProperty(zt,"Double",{enumerable:!0,get:function(){return rr.Double}});Object.defineProperty(zt,"EJSON",{enumerable:!0,get:function(){return rr.EJSON}});Object.defineProperty(zt,"Int32",{enumerable:!0,get:function(){return rr.Int32}});Object.defineProperty(zt,"Long",{enumerable:!0,get:function(){return rr.Long}});Object.defineProperty(zt,"MaxKey",{enumerable:!0,get:function(){return rr.MaxKey}});Object.defineProperty(zt,"MinKey",{enumerable:!0,get:function(){return rr.MinKey}});Object.defineProperty(zt,"NumberUtils",{enumerable:!0,get:function(){return rr.NumberUtils}});Object.defineProperty(zt,"ObjectId",{enumerable:!0,get:function(){return rr.ObjectId}});Object.defineProperty(zt,"serialize",{enumerable:!0,get:function(){return rr.serialize}});Object.defineProperty(zt,"Timestamp",{enumerable:!0,get:function(){return rr.Timestamp}});Object.defineProperty(zt,"UUID",{enumerable:!0,get:function(){return rr.UUID}});function Fte(e,t){let r=Md.BSON.onDemand.parseToElements(e,t);return Array.isArray(r)?r:[...r]}var kC=(e,t,r)=>{if(t<0||t+r>e.length)throw RangeError(`Attempt to access memory outside buffer bounds: buffer length: ${e.length}, offset: ${t}, length: ${r}`)},Bte=(e,t)=>(kC(e,t,4),Md.NumberUtils.getInt32LE(e,t));zt.readInt32LE=Bte;var Nte=(e,t)=>(kC(e,t,1),e[t]);zt.readUint8=Nte;var Ite=(e,t,r)=>(e[t]=r,r>>>=8,e[t+1]=r,r>>>=8,e[t+2]=r,r>>>=8,e[t+3]=r,4);zt.setUint32LE=Ite;function $te(e){let{fieldsAsRaw:t,useBigInt64:r,promoteValues:n,promoteBuffers:s,promoteLongs:i,serializeFunctions:o,ignoreUndefined:u,bsonRegExp:a,raw:c,enableUtf8Validation:l}=e;return{fieldsAsRaw:t,useBigInt64:r,promoteValues:n,promoteBuffers:s,promoteLongs:i,serializeFunctions:o,ignoreUndefined:u,bsonRegExp:a,raw:c,enableUtf8Validation:l}}function Rte(e,t){let r=t?.bsonOptions;return{raw:e?.raw??r?.raw??!1,useBigInt64:e?.useBigInt64??r?.useBigInt64??!1,promoteLongs:e?.promoteLongs??r?.promoteLongs??!0,promoteValues:e?.promoteValues??r?.promoteValues??!0,promoteBuffers:e?.promoteBuffers??r?.promoteBuffers??!1,ignoreUndefined:e?.ignoreUndefined??r?.ignoreUndefined??!1,bsonRegExp:e?.bsonRegExp??r?.bsonRegExp??!1,serializeFunctions:e?.serializeFunctions??r?.serializeFunctions??!1,fieldsAsRaw:e?.fieldsAsRaw??r?.fieldsAsRaw??{},enableUtf8Validation:e?.enableUtf8Validation??r?.enableUtf8Validation??!0}}function vte(e){if(e?.enableUtf8Validation===!1)return{utf8:!1};return{utf8:{writeErrors:!1}}}});var J=g(function(_b){Object.defineProperty(_b,"__esModule",{value:!0});_b.MongoWriteConcernError=_b.MongoServerSelectionError=_b.MongoSystemError=_b.MongoMissingDependencyError=_b.MongoMissingCredentialsError=_b.MongoCompatibilityError=_b.MongoInvalidArgumentError=_b.MongoParseError=_b.MongoNetworkTimeoutError=_b.MongoNetworkError=_b.MongoClientClosedError=_b.MongoTopologyClosedError=_b.MongoCursorExhaustedError=_b.MongoServerClosedError=_b.MongoCursorInUseError=_b.MongoOperationTimeoutError=_b.MongoUnexpectedServerResponseError=_b.MongoGridFSChunkError=_b.MongoGridFSStreamError=_b.MongoTailableCursorError=_b.MongoChangeStreamError=_b.MongoClientBulkWriteExecutionError=_b.MongoClientBulkWriteCursorError=_b.MongoClientBulkWriteError=_b.MongoGCPError=_b.MongoAzureError=_b.MongoOIDCError=_b.MongoAWSError=_b.MongoKerberosError=_b.MongoExpiredSessionError=_b.MongoTransactionError=_b.MongoNotConnectedError=_b.MongoDecompressionError=_b.MongoBatchReExecutionError=_b.MongoStalePrimaryError=_b.MongoRuntimeError=_b.MongoAPIError=_b.MongoDriverError=_b.MongoServerError=_b.MongoError=_b.MongoErrorLabel=_b.GET_MORE_RESUMABLE_CODES=_b.MONGODB_ERROR_CODES=_b.NODE_IS_RECOVERING_ERROR_MESSAGE=_b.LEGACY_NOT_PRIMARY_OR_SECONDARY_ERROR_MESSAGE=_b.LEGACY_NOT_WRITABLE_PRIMARY_ERROR_MESSAGE=void 0;_b.isNamespaceNotFoundError=zte;_b.needsRetryableWriteLabel=Kte;_b.isRetryableWriteError=Hte;_b.isRetryableReadError=Gte;_b.isNodeShuttingDownError=Zte;_b.isStateChangeError=ere;_b.isNetworkTimeoutError=tre;_b.isResumableError=rre;_b.LEGACY_NOT_WRITABLE_PRIMARY_ERROR_MESSAGE=new RegExp("not master","i");_b.LEGACY_NOT_PRIMARY_OR_SECONDARY_ERROR_MESSAGE=new RegExp("not master or secondary","i");_b.NODE_IS_RECOVERING_ERROR_MESSAGE=new RegExp("node is recovering","i");_b.MONGODB_ERROR_CODES=Object.freeze({HostUnreachable:6,HostNotFound:7,AuthenticationFailed:18,NetworkTimeout:89,ShutdownInProgress:91,PrimarySteppedDown:189,ExceededTimeLimit:262,SocketException:9001,NotWritablePrimary:10107,InterruptedAtShutdown:11600,InterruptedDueToReplStateChange:11602,NotPrimaryNoSecondaryOk:13435,NotPrimaryOrSecondary:13436,StaleShardVersion:63,StaleEpoch:150,StaleConfig:13388,RetryChangeStream:234,FailedToSatisfyReadPreference:133,CursorNotFound:43,LegacyNotPrimary:10058,WriteConcernTimeout:64,NamespaceNotFound:26,IllegalOperation:20,MaxTimeMSExpired:50,UnknownReplWriteConcern:79,UnsatisfiableWriteConcern:100,Reauthenticate:391,ReadConcernMajorityNotAvailableYet:134});function zte(e){return Number(e?.code)===_b.MONGODB_ERROR_CODES.NamespaceNotFound}_b.GET_MORE_RESUMABLE_CODES=new Set([_b.MONGODB_ERROR_CODES.HostUnreachable,_b.MONGODB_ERROR_CODES.HostNotFound,_b.MONGODB_ERROR_CODES.NetworkTimeout,_b.MONGODB_ERROR_CODES.ShutdownInProgress,_b.MONGODB_ERROR_CODES.PrimarySteppedDown,_b.MONGODB_ERROR_CODES.ExceededTimeLimit,_b.MONGODB_ERROR_CODES.SocketException,_b.MONGODB_ERROR_CODES.NotWritablePrimary,_b.MONGODB_ERROR_CODES.InterruptedAtShutdown,_b.MONGODB_ERROR_CODES.InterruptedDueToReplStateChange,_b.MONGODB_ERROR_CODES.NotPrimaryNoSecondaryOk,_b.MONGODB_ERROR_CODES.NotPrimaryOrSecondary,_b.MONGODB_ERROR_CODES.StaleShardVersion,_b.MONGODB_ERROR_CODES.StaleEpoch,_b.MONGODB_ERROR_CODES.StaleConfig,_b.MONGODB_ERROR_CODES.RetryChangeStream,_b.MONGODB_ERROR_CODES.FailedToSatisfyReadPreference,_b.MONGODB_ERROR_CODES.CursorNotFound]);_b.MongoErrorLabel=Object.freeze({RetryableWriteError:"RetryableWriteError",TransientTransactionError:"TransientTransactionError",UnknownTransactionCommitResult:"UnknownTransactionCommitResult",ResumableChangeStreamError:"ResumableChangeStreamError",HandshakeError:"HandshakeError",ResetPool:"ResetPool",PoolRequestedRetry:"PoolRequestedRetry",InterruptInUseConnections:"InterruptInUseConnections",NoWritesPerformed:"NoWritesPerformed",RetryableError:"RetryableError",SystemOverloadedError:"SystemOverloadedError"});function Wte(e){return e!=null&&typeof e==="object"&&"errors"in e&&Array.isArray(e.errors)}class Xi extends Error{get errorLabels(){return Array.from(this.errorLabelSet)}constructor(e,t){super(e,t);this.errorLabelSet=new Set}static buildErrorMessage(e){if(typeof e==="string")return e;if(Wte(e)&&e.message.length===0)return e.errors.length===0?"AggregateError has an empty errors array. Please check the `cause` property for more information.":e.errors.map(({message:t})=>t).join(", ");return e!=null&&typeof e==="object"&&"message"in e&&typeof e.message==="string"?e.message:"empty error message"}get name(){return"MongoError"}get errmsg(){return this.message}hasErrorLabel(e){return this.errorLabelSet.has(e)}addErrorLabel(e){this.errorLabelSet.add(e)}}_b.MongoError=Xi;class xd extends Xi{constructor(e){super(e.message||e.errmsg||e.$err||"n/a");if(e.errorLabels)for(let t of e.errorLabels)this.addErrorLabel(t);this.errorResponse=e;for(let t in e)if(t!=="errorLabels"&&t!=="errmsg"&&t!=="message"&&t!=="errorResponse")this[t]=e[t]}get name(){return"MongoServerError"}}_b.MongoServerError=xd;class Tc extends Xi{constructor(e,t){super(e,t)}get name(){return"MongoDriverError"}}_b.MongoDriverError=Tc;class Cn extends Tc{constructor(e,t){super(e,t)}get name(){return"MongoAPIError"}}_b.MongoAPIError=Cn;class Fs extends Tc{constructor(e,t){super(e,t)}get name(){return"MongoRuntimeError"}}_b.MongoRuntimeError=Fs;class LC extends Fs{constructor(e,t){super(e,t)}get name(){return"MongoStalePrimaryError"}}_b.MongoStalePrimaryError=LC;class UC extends Cn{constructor(e="This batch has already been executed, create new batch to execute"){super(e)}get name(){return"MongoBatchReExecutionError"}}_b.MongoBatchReExecutionError=UC;class VC extends Fs{constructor(e){super(e)}get name(){return"MongoDecompressionError"}}_b.MongoDecompressionError=VC;class zC extends Cn{constructor(e){super(e)}get name(){return"MongoNotConnectedError"}}_b.MongoNotConnectedError=zC;class WC extends Cn{constructor(e){super(e)}get name(){return"MongoTransactionError"}}_b.MongoTransactionError=WC;class KC extends Cn{constructor(e="Cannot use a session that has ended"){super(e)}get name(){return"MongoExpiredSessionError"}}_b.MongoExpiredSessionError=KC;class HC extends Fs{constructor(e){super(e)}get name(){return"MongoKerberosError"}}_b.MongoKerberosError=HC;class GC extends Fs{constructor(e,t){super(e,t)}get name(){return"MongoAWSError"}}_b.MongoAWSError=GC;class Pd extends Fs{constructor(e){super(e)}get name(){return"MongoOIDCError"}}_b.MongoOIDCError=Pd;class YC extends Pd{constructor(e){super(e)}get name(){return"MongoAzureError"}}_b.MongoAzureError=YC;class QC extends Pd{constructor(e){super(e)}get name(){return"MongoGCPError"}}_b.MongoGCPError=QC;class JC extends xd{constructor(e){super(e);this.writeConcernErrors=[],this.writeErrors=new Map}get name(){return"MongoClientBulkWriteError"}}_b.MongoClientBulkWriteError=JC;class XC extends Fs{constructor(e){super(e)}get name(){return"MongoClientBulkWriteCursorError"}}_b.MongoClientBulkWriteCursorError=XC;class ZC extends Fs{constructor(e){super(e)}get name(){return"MongoClientBulkWriteExecutionError"}}_b.MongoClientBulkWriteExecutionError=ZC;class eb extends Fs{constructor(e){super(e)}get name(){return"MongoChangeStreamError"}}_b.MongoChangeStreamError=eb;class tb extends Cn{constructor(e="Tailable cursor does not support this operation"){super(e)}get name(){return"MongoTailableCursorError"}}_b.MongoTailableCursorError=tb;class rb extends Fs{constructor(e){super(e)}get name(){return"MongoGridFSStreamError"}}_b.MongoGridFSStreamError=rb;class nb extends Fs{constructor(e){super(e)}get name(){return"MongoGridFSChunkError"}}_b.MongoGridFSChunkError=nb;class sb extends Fs{constructor(e,t){super(e,t)}get name(){return"MongoUnexpectedServerResponseError"}}_b.MongoUnexpectedServerResponseError=sb;class ib extends Tc{get name(){return"MongoOperationTimeoutError"}}_b.MongoOperationTimeoutError=ib;class ob extends Cn{constructor(e="Cursor is already initialized"){super(e)}get name(){return"MongoCursorInUseError"}}_b.MongoCursorInUseError=ob;class ub extends Cn{constructor(e="Server is closed"){super(e)}get name(){return"MongoServerClosedError"}}_b.MongoServerClosedError=ub;class ab extends Cn{constructor(e){super(e||"Cursor is exhausted")}get name(){return"MongoCursorExhaustedError"}}_b.MongoCursorExhaustedError=ab;class cb extends Cn{constructor(e="Topology is closed"){super(e)}get name(){return"MongoTopologyClosedError"}}_b.MongoTopologyClosedError=cb;class lb extends Cn{constructor(){super("Operation interrupted because client was closed")}get name(){return"MongoClientClosedError"}}_b.MongoClientClosedError=lb;class Ra extends Xi{constructor(e,t){super(e,{cause:t?.cause});this.beforeHandshake=!!t?.beforeHandshake}get name(){return"MongoNetworkError"}}_b.MongoNetworkError=Ra;class hb extends Ra{constructor(e,t){super(e,t)}get name(){return"MongoNetworkTimeoutError"}}_b.MongoNetworkTimeoutError=hb;class fb extends Tc{constructor(e){super(e)}get name(){return"MongoParseError"}}_b.MongoParseError=fb;class db extends Cn{constructor(e,t){super(e,t)}get name(){return"MongoInvalidArgumentError"}}_b.MongoInvalidArgumentError=db;class pb extends Cn{constructor(e){super(e)}get name(){return"MongoCompatibilityError"}}_b.MongoCompatibilityError=pb;class mb extends Cn{constructor(e){super(e)}get name(){return"MongoMissingCredentialsError"}}_b.MongoMissingCredentialsError=mb;class yb extends Cn{constructor(e,t){super(e,t);this.dependencyName=t.dependencyName}get name(){return"MongoMissingDependencyError"}}_b.MongoMissingDependencyError=yb;class Qg extends Xi{constructor(e,t){if(t&&t.error)super(Xi.buildErrorMessage(t.error.message||t.error),{cause:t.error});else super(e);if(t)this.reason=t;this.code=t.error?.code}get name(){return"MongoSystemError"}}_b.MongoSystemError=Qg;class Jg extends Qg{constructor(e,t){super(e,t)}get name(){return"MongoServerSelectionError"}}_b.MongoServerSelectionError=Jg;class Xg extends xd{constructor(e){super({...e.writeConcernError,...e});this.errInfo=e.writeConcernError.errInfo,this.result=e}get name(){return"MongoWriteConcernError"}}_b.MongoWriteConcernError=Xg;var gb=new Set([_b.MONGODB_ERROR_CODES.HostUnreachable,_b.MONGODB_ERROR_CODES.HostNotFound,_b.MONGODB_ERROR_CODES.NetworkTimeout,_b.MONGODB_ERROR_CODES.ShutdownInProgress,_b.MONGODB_ERROR_CODES.PrimarySteppedDown,_b.MONGODB_ERROR_CODES.SocketException,_b.MONGODB_ERROR_CODES.NotWritablePrimary,_b.MONGODB_ERROR_CODES.InterruptedAtShutdown,_b.MONGODB_ERROR_CODES.InterruptedDueToReplStateChange,_b.MONGODB_ERROR_CODES.NotPrimaryNoSecondaryOk,_b.MONGODB_ERROR_CODES.NotPrimaryOrSecondary,_b.MONGODB_ERROR_CODES.ExceededTimeLimit,_b.MONGODB_ERROR_CODES.ReadConcernMajorityNotAvailableYet]),jC=gb;function Kte(e){if(e instanceof Ra)return!0;if(e instanceof Xi){if(!e.hasErrorLabel(_b.MongoErrorLabel.HandshakeError))return!1}if(e instanceof Xg){let n=e.result.writeConcernError.code??Number(e.code);return jC.has(Number.isNaN(n)?0:n)}if(e instanceof Xi)return jC.has(Number(e.code));if(_b.LEGACY_NOT_WRITABLE_PRIMARY_ERROR_MESSAGE.test(e.message))return!0;if(_b.NODE_IS_RECOVERING_ERROR_MESSAGE.test(e.message))return!0;return!1}function Hte(e){return e.hasErrorLabel(_b.MongoErrorLabel.RetryableWriteError)||e.hasErrorLabel(_b.MongoErrorLabel.PoolRequestedRetry)}function Gte(e){if(typeof e.code==="number"?gb.has(e.code):!1)return!0;if(e instanceof Ra)return!0;if(_b.LEGACY_NOT_WRITABLE_PRIMARY_ERROR_MESSAGE.test(e.message))return!0;if(_b.NODE_IS_RECOVERING_ERROR_MESSAGE.test(e.message))return!0;return!1}var Yte=new Set([_b.MONGODB_ERROR_CODES.ShutdownInProgress,_b.MONGODB_ERROR_CODES.PrimarySteppedDown,_b.MONGODB_ERROR_CODES.InterruptedAtShutdown,_b.MONGODB_ERROR_CODES.InterruptedDueToReplStateChange,_b.MONGODB_ERROR_CODES.NotPrimaryOrSecondary]),Qte=new Set([_b.MONGODB_ERROR_CODES.NotWritablePrimary,_b.MONGODB_ERROR_CODES.NotPrimaryNoSecondaryOk,_b.MONGODB_ERROR_CODES.LegacyNotPrimary]),Jte=new Set([_b.MONGODB_ERROR_CODES.InterruptedAtShutdown,_b.MONGODB_ERROR_CODES.ShutdownInProgress]);function Eb(e){if(typeof e.code==="number")return Yte.has(e.code);return _b.LEGACY_NOT_PRIMARY_OR_SECONDARY_ERROR_MESSAGE.test(e.message)||_b.NODE_IS_RECOVERING_ERROR_MESSAGE.test(e.message)}function Xte(e){if(typeof e.code==="number")return Qte.has(e.code);if(Eb(e))return!1;return _b.LEGACY_NOT_WRITABLE_PRIMARY_ERROR_MESSAGE.test(e.message)}function Zte(e){return!!(typeof e.code==="number"&&Jte.has(e.code))}function ere(e){return Eb(e)||Xte(e)}function tre(e){return!!(e instanceof Ra&&e.message.match(/timed out/))}function rre(e,t){if(e==null||!(e instanceof Xi))return!1;if(e instanceof Ra)return!0;if(e instanceof Jg)return!0;if(t!=null&&t>=9){if(e.code===_b.MONGODB_ERROR_CODES.CursorNotFound)return!0;return e.hasErrorLabel(_b.MongoErrorLabel.ResumableChangeStreamError)}if(typeof e.code==="number")return _b.GET_MORE_RESUMABLE_CODES.has(e.code);return!1}});var wr=g(function(Sb){Object.defineProperty(Sb,"__esModule",{value:!0});Sb.END=Sb.CHANGE=Sb.INIT=Sb.MORE=Sb.RESPONSE=Sb.SERVER_HEARTBEAT_FAILED=Sb.SERVER_HEARTBEAT_SUCCEEDED=Sb.SERVER_HEARTBEAT_STARTED=Sb.COMMAND_FAILED=Sb.COMMAND_SUCCEEDED=Sb.COMMAND_STARTED=Sb.CLUSTER_TIME_RECEIVED=Sb.CONNECTION_CHECKED_IN=Sb.CONNECTION_CHECKED_OUT=Sb.CONNECTION_CHECK_OUT_FAILED=Sb.CONNECTION_CHECK_OUT_STARTED=Sb.CONNECTION_CLOSED=Sb.CONNECTION_READY=Sb.CONNECTION_CREATED=Sb.CONNECTION_POOL_READY=Sb.CONNECTION_POOL_CLEARED=Sb.CONNECTION_POOL_CLOSED=Sb.CONNECTION_POOL_CREATED=Sb.WAITING_FOR_SUITABLE_SERVER=Sb.SERVER_SELECTION_SUCCEEDED=Sb.SERVER_SELECTION_FAILED=Sb.SERVER_SELECTION_STARTED=Sb.TOPOLOGY_DESCRIPTION_CHANGED=Sb.TOPOLOGY_CLOSED=Sb.TOPOLOGY_OPENING=Sb.SERVER_DESCRIPTION_CHANGED=Sb.SERVER_CLOSED=Sb.SERVER_OPENING=Sb.DESCRIPTION_RECEIVED=Sb.UNPINNED=Sb.PINNED=Sb.MESSAGE=Sb.ENDED=Sb.CLOSED=Sb.CONNECT=Sb.OPEN=Sb.CLOSE=Sb.TIMEOUT=Sb.ERROR=Sb.SYSTEM_JS_COLLECTION=Sb.SYSTEM_COMMAND_COLLECTION=Sb.SYSTEM_USER_COLLECTION=Sb.SYSTEM_PROFILE_COLLECTION=Sb.SYSTEM_INDEX_COLLECTION=Sb.SYSTEM_NAMESPACE_COLLECTION=void 0;Sb.kDecoratedKeys=Sb.kDecorateResult=Sb.LEGACY_HELLO_COMMAND_CAMEL_CASE=Sb.LEGACY_HELLO_COMMAND=Sb.MONGO_CLIENT_EVENTS=Sb.LOCAL_SERVER_EVENTS=Sb.SERVER_RELAY_EVENTS=Sb.APM_EVENTS=Sb.TOPOLOGY_EVENTS=Sb.CMAP_EVENTS=Sb.HEARTBEAT_EVENTS=Sb.RESUME_TOKEN_CHANGED=void 0;Sb.SYSTEM_NAMESPACE_COLLECTION="system.namespaces";Sb.SYSTEM_INDEX_COLLECTION="system.indexes";Sb.SYSTEM_PROFILE_COLLECTION="system.profile";Sb.SYSTEM_USER_COLLECTION="system.users";Sb.SYSTEM_COMMAND_COLLECTION="$cmd";Sb.SYSTEM_JS_COLLECTION="system.js";Sb.ERROR="error";Sb.TIMEOUT="timeout";Sb.CLOSE="close";Sb.OPEN="open";Sb.CONNECT="connect";Sb.CLOSED="closed";Sb.ENDED="ended";Sb.MESSAGE="message";Sb.PINNED="pinned";Sb.UNPINNED="unpinned";Sb.DESCRIPTION_RECEIVED="descriptionReceived";Sb.SERVER_OPENING="serverOpening";Sb.SERVER_CLOSED="serverClosed";Sb.SERVER_DESCRIPTION_CHANGED="serverDescriptionChanged";Sb.TOPOLOGY_OPENING="topologyOpening";Sb.TOPOLOGY_CLOSED="topologyClosed";Sb.TOPOLOGY_DESCRIPTION_CHANGED="topologyDescriptionChanged";Sb.SERVER_SELECTION_STARTED="serverSelectionStarted";Sb.SERVER_SELECTION_FAILED="serverSelectionFailed";Sb.SERVER_SELECTION_SUCCEEDED="serverSelectionSucceeded";Sb.WAITING_FOR_SUITABLE_SERVER="waitingForSuitableServer";Sb.CONNECTION_POOL_CREATED="connectionPoolCreated";Sb.CONNECTION_POOL_CLOSED="connectionPoolClosed";Sb.CONNECTION_POOL_CLEARED="connectionPoolCleared";Sb.CONNECTION_POOL_READY="connectionPoolReady";Sb.CONNECTION_CREATED="connectionCreated";Sb.CONNECTION_READY="connectionReady";Sb.CONNECTION_CLOSED="connectionClosed";Sb.CONNECTION_CHECK_OUT_STARTED="connectionCheckOutStarted";Sb.CONNECTION_CHECK_OUT_FAILED="connectionCheckOutFailed";Sb.CONNECTION_CHECKED_OUT="connectionCheckedOut";Sb.CONNECTION_CHECKED_IN="connectionCheckedIn";Sb.CLUSTER_TIME_RECEIVED="clusterTimeReceived";Sb.COMMAND_STARTED="commandStarted";Sb.COMMAND_SUCCEEDED="commandSucceeded";Sb.COMMAND_FAILED="commandFailed";Sb.SERVER_HEARTBEAT_STARTED="serverHeartbeatStarted";Sb.SERVER_HEARTBEAT_SUCCEEDED="serverHeartbeatSucceeded";Sb.SERVER_HEARTBEAT_FAILED="serverHeartbeatFailed";Sb.RESPONSE="response";Sb.MORE="more";Sb.INIT="init";Sb.CHANGE="change";Sb.END="end";Sb.RESUME_TOKEN_CHANGED="resumeTokenChanged";Sb.HEARTBEAT_EVENTS=Object.freeze([Sb.SERVER_HEARTBEAT_STARTED,Sb.SERVER_HEARTBEAT_SUCCEEDED,Sb.SERVER_HEARTBEAT_FAILED]);Sb.CMAP_EVENTS=Object.freeze([Sb.CONNECTION_POOL_CREATED,Sb.CONNECTION_POOL_READY,Sb.CONNECTION_POOL_CLEARED,Sb.CONNECTION_POOL_CLOSED,Sb.CONNECTION_CREATED,Sb.CONNECTION_READY,Sb.CONNECTION_CLOSED,Sb.CONNECTION_CHECK_OUT_STARTED,Sb.CONNECTION_CHECK_OUT_FAILED,Sb.CONNECTION_CHECKED_OUT,Sb.CONNECTION_CHECKED_IN]);Sb.TOPOLOGY_EVENTS=Object.freeze([Sb.SERVER_OPENING,Sb.SERVER_CLOSED,Sb.SERVER_DESCRIPTION_CHANGED,Sb.TOPOLOGY_OPENING,Sb.TOPOLOGY_CLOSED,Sb.TOPOLOGY_DESCRIPTION_CHANGED,Sb.ERROR,Sb.TIMEOUT,Sb.CLOSE]);Sb.APM_EVENTS=Object.freeze([Sb.COMMAND_STARTED,Sb.COMMAND_SUCCEEDED,Sb.COMMAND_FAILED]);Sb.SERVER_RELAY_EVENTS=Object.freeze([Sb.SERVER_HEARTBEAT_STARTED,Sb.SERVER_HEARTBEAT_SUCCEEDED,Sb.SERVER_HEARTBEAT_FAILED,Sb.COMMAND_STARTED,Sb.COMMAND_SUCCEEDED,Sb.COMMAND_FAILED,...Sb.CMAP_EVENTS]);Sb.LOCAL_SERVER_EVENTS=Object.freeze([Sb.CONNECT,Sb.DESCRIPTION_RECEIVED,Sb.CLOSED,Sb.ENDED]);Sb.MONGO_CLIENT_EVENTS=Object.freeze([...Sb.CMAP_EVENTS,...Sb.APM_EVENTS,...Sb.TOPOLOGY_EVENTS,...Sb.HEARTBEAT_EVENTS]);Sb.LEGACY_HELLO_COMMAND="ismaster";Sb.LEGACY_HELLO_COMMAND_CAMEL_CASE="isMaster";Sb.kDecorateResult=Symbol.for("@@mdb.decorateDecryptionResult");Sb.kDecoratedKeys=Symbol.for("@@mdb.decryptedKeys")});var eo=g(function(Zb){Object.defineProperty(Zb,"__esModule",{value:!0});Zb.getKerberos=One;Zb.getZstdLibrary=Cne;Zb.getAwsCredentialProvider=bne;Zb.getGcpMetadata=Dne;Zb.getSnappy=Tne;Zb.getSocks=Mne;Zb.getMongoDBClientEncryption=xne;var Zi=L("zlib"),is=J();function Nd(e){return new Proxy(e?{kModuleError:e}:{},{get:(r,n)=>{if(n==="kModuleError")return e;throw e},set:()=>{throw e}})}function One(){let e;try{e=(()=>{throw new Error("Cannot require module "+"kerberos");})()}catch(t){e=Nd(new is.MongoMissingDependencyError("Optional module `kerberos` not found. Please install it to enable kerberos authentication",{cause:t,dependencyName:"kerberos"}))}return e}function Sne(){if(typeof Zi.zstdCompress!=="function"||typeof Zi.zstdDecompress!=="function")return null;return{compress(e,t){let r=t==null?{}:{params:{[Zi.constants.ZSTD_c_compressionLevel]:t}};return new Promise((n,s)=>{Zi.zstdCompress(e,r,(i,o)=>{if(i)return s(i);n(o)})})},decompress(e){return new Promise((t,r)=>{Zi.zstdDecompress(e,(n,s)=>{if(n)return r(n);t(s)})})}}}function Cne(){let e=Sne();if(e!=null)return e;let t;try{t=(()=>{throw new Error("Cannot require module "+"@mongodb-js/zstd");})()}catch(r){t=Nd(new is.MongoMissingDependencyError("Built-in zstd is unavailable (requires Node.js 22.15.0 or later) and optional module `@mongodb-js/zstd` not found. Please upgrade Node.js or install `@mongodb-js/zstd` to enable zstd compression",{cause:r,dependencyName:"zstd"}))}return t}function bne(){try{return (()=>{throw new Error("Cannot require module "+"@aws-sdk/credential-providers");})()}catch(e){return Nd(new is.MongoMissingDependencyError("Optional module `@aws-sdk/credential-providers` not found. Please install it to enable getting aws credentials via the official sdk.",{cause:e,dependencyName:"@aws-sdk/credential-providers"}))}}function Dne(){try{return (()=>{throw new Error("Cannot require module "+"gcp-metadata");})()}catch(e){return Nd(new is.MongoMissingDependencyError("Optional module `gcp-metadata` not found. Please install it to enable getting gcp credentials via the official sdk.",{cause:e,dependencyName:"gcp-metadata"}))}}function Tne(){try{return (()=>{throw new Error("Cannot require module "+"snappy");})()}catch(e){return{kModuleError:new is.MongoMissingDependencyError("Optional module `snappy` not found. Please install it to enable snappy compression",{cause:e,dependencyName:"snappy"})}}}function Mne(){try{return (()=>{throw new Error("Cannot require module "+"socks");})()}catch(e){return{kModuleError:new is.MongoMissingDependencyError("Optional module `socks` not found. Please install it to connections over a SOCKS5 proxy",{cause:e,dependencyName:"socks"})}}}function xne(){let e=null;try{e=(()=>{throw new Error("Cannot require module "+"mongodb-client-encryption");})()}catch(t){return{kModuleError:new is.MongoMissingDependencyError("Optional module `mongodb-client-encryption` not found. Please install it to use auto encryption or ClientEncryption.",{cause:t,dependencyName:"mongodb-client-encryption"})}}return e}});var zo=g(function(e9){Object.defineProperty(e9,"__esModule",{value:!0});e9.OP_MSG=e9.OP_COMPRESSED=e9.OP_DELETE=e9.OP_QUERY=e9.OP_INSERT=e9.OP_UPDATE=e9.OP_REPLY=e9.MIN_SUPPORTED_RAW_DATA_SERVER_VERSION=e9.MIN_SUPPORTED_RAW_DATA_WIRE_VERSION=e9.MIN_SUPPORTED_QE_SERVER_VERSION=e9.MIN_SUPPORTED_QE_WIRE_VERSION=e9.MAX_SUPPORTED_WIRE_VERSION=e9.MIN_SUPPORTED_WIRE_VERSION=e9.MIN_SUPPORTED_SNAPSHOT_READS_SERVER_VERSION=e9.MIN_SUPPORTED_SNAPSHOT_READS_WIRE_VERSION=e9.MAX_SUPPORTED_SERVER_VERSION=e9.MIN_SUPPORTED_SERVER_VERSION=void 0;e9.MIN_SUPPORTED_SERVER_VERSION="4.4";e9.MAX_SUPPORTED_SERVER_VERSION="9.0";e9.MIN_SUPPORTED_SNAPSHOT_READS_WIRE_VERSION=13;e9.MIN_SUPPORTED_SNAPSHOT_READS_SERVER_VERSION="5.0";e9.MIN_SUPPORTED_WIRE_VERSION=9;e9.MAX_SUPPORTED_WIRE_VERSION=29;e9.MIN_SUPPORTED_QE_WIRE_VERSION=21;e9.MIN_SUPPORTED_QE_SERVER_VERSION="7.0";e9.MIN_SUPPORTED_RAW_DATA_WIRE_VERSION=27;e9.MIN_SUPPORTED_RAW_DATA_SERVER_VERSION="8.2";e9.OP_REPLY=1;e9.OP_UPDATE=2001;e9.OP_INSERT=2002;e9.OP_QUERY=2004;e9.OP_DELETE=2006;e9.OP_COMPRESSED=2012;e9.OP_MSG=2013});var wh=g(function(i9){Object.defineProperty(i9,"__esModule",{value:!0});i9.uncompressibleCommands=i9.Compressor=void 0;i9.compress=rse;i9.decompress=n9;i9.compressCommand=nse;i9.decompressResponse=sse;var $d=L("zlib"),os=Se(),Id=wr(),Rd=eo(),xc=J(),Ks=Au(),Mc=zo();i9.Compressor=Object.freeze({none:0,snappy:1,zlib:2,zstd:3});i9.uncompressibleCommands=new Set(["hello",Id.LEGACY_HELLO_COMMAND,Id.LEGACY_HELLO_COMMAND_CAMEL_CASE,"saslStart","saslContinue","getnonce","authenticate","createUser","updateUser","copydbSaslStart","copydbgetnonce","copydb"]);var Zne=3,ese=(e)=>new Promise((t,r)=>{$d.inflate(e,(n,s)=>{if(n)return r(n);t(s)})}),tse=(e,t)=>new Promise((r,n)=>{$d.deflate(e,t,(s,i)=>{if(s)return n(s);r(i)})}),_u,va=null;function r9(){if(va==null){let e=Rd.getSnappy();if("kModuleError"in e)throw e.kModuleError;va=e}return va}async function rse(e,t){let r={};switch(e.agreedCompressor){case"snappy":return va??=r9(),await va.compress(t);case"zstd":{if(s9(),"kModuleError"in _u)throw _u.kModuleError;return await _u.compress(t,Zne)}case"zlib":{if(e.zlibCompressionLevel)r.level=e.zlibCompressionLevel;return await tse(t,r)}default:throw new xc.MongoInvalidArgumentError(`Unknown compressor ${e.agreedCompressor} failed to compress`)}}async function n9(e,t){if(e!==i9.Compressor.snappy&&e!==i9.Compressor.zstd&&e!==i9.Compressor.zlib&&e!==i9.Compressor.none)throw new xc.MongoDecompressionError(`Server sent message compressed using an unsupported compressor. (Received compressor ID ${e})`);switch(e){case i9.Compressor.snappy:return va??=r9(),await va.uncompress(t,{asBuffer:!0});case i9.Compressor.zstd:{if(s9(),"kModuleError"in _u)throw _u.kModuleError;return await _u.decompress(t)}case i9.Compressor.zlib:return await ese(t);default:return t}}function s9(){if(!_u)_u=Rd.getZstdLibrary()}var Ah=16;async function nse(e,t){let n=await(t.agreedCompressor==="none"||!Ks.OpCompressedRequest.canCompress(e)?e:new Ks.OpCompressedRequest(e,{agreedCompressor:t.agreedCompressor??"none",zlibCompressionLevel:t.zlibCompressionLevel??0})).toBin();return os.ByteUtils.concat(n)}async function sse(e){let t={length:os.readInt32LE(e,0),requestId:os.readInt32LE(e,4),responseTo:os.readInt32LE(e,8),opCode:os.readInt32LE(e,12)};if(t.opCode!==Mc.OP_COMPRESSED){let u=t.opCode===Mc.OP_MSG?Ks.OpMsgResponse:Ks.OpReply,a=e.subarray(Ah);return new u(e,t,a)}let r={...t,fromCompressed:!0,opCode:os.readInt32LE(e,Ah),length:os.readInt32LE(e,Ah+4)},n=e[Ah+8],s=e.slice(Ah+9),i=r.opCode===Mc.OP_MSG?Ks.OpMsgResponse:Ks.OpReply,o=await n9(n,s);if(o.length!==r.length)throw new xc.MongoDecompressionError("Message body and message header must be the same length");return new i(e,r,o)}});var Au=g(function(m9){Object.defineProperty(m9,"__esModule",{value:!0});m9.OpCompressedRequest=m9.OpMsgResponse=m9.OpMsgRequest=m9.DocumentSequence=m9.OpReply=m9.OpQueryRequest=void 0;m9.makeDocumentSequence=Ase;var ne=Se(),to=J(),Pc=wh(),Hs=zo(),Fc=0,cse=2,lse=4,hse=8,fse=16,dse=32,pse=64,mse=128,yse=1,gse=2,Ese=4,_se=8,a9=ne.ByteUtils.encodeUTF8Into;class uE{constructor(e,t,r){this.moreToCome=!1;let n=`${e}.$cmd`;if(typeof e!=="string")throw new to.MongoRuntimeError("Database name must be a string for a query");if(t==null)throw new to.MongoRuntimeError("A query document must be specified for query");if(n.indexOf("\x00")!==-1)throw new to.MongoRuntimeError("Namespace cannot contain a null character");this.databaseName=e,this.query=t,this.ns=n,this.numberToSkip=r.numberToSkip||0,this.numberToReturn=r.numberToReturn||0,this.returnFieldSelector=r.returnFieldSelector||void 0,this.requestId=r.requestId??uE.getRequestId(),this.pre32Limit=r.pre32Limit,this.serializeFunctions=typeof r.serializeFunctions==="boolean"?r.serializeFunctions:!1,this.ignoreUndefined=typeof r.ignoreUndefined==="boolean"?r.ignoreUndefined:!1,this.maxBsonSize=r.maxBsonSize||16777216,this.checkKeys=typeof r.checkKeys==="boolean"?r.checkKeys:!1,this.batchSize=this.numberToReturn,this.tailable=!1,this.secondaryOk=typeof r.secondaryOk==="boolean"?r.secondaryOk:!1,this.oplogReplay=!1,this.noCursorTimeout=!1,this.awaitData=!1,this.exhaust=!1,this.partial=!1}incRequestId(){this.requestId=Fc++}nextRequestId(){return Fc+1}static getRequestId(){return++Fc}toBin(){let e=[],t=null,r=0;if(this.tailable)r|=cse;if(this.secondaryOk)r|=lse;if(this.oplogReplay)r|=hse;if(this.noCursorTimeout)r|=fse;if(this.awaitData)r|=dse;if(this.exhaust)r|=pse;if(this.partial)r|=mse;if(this.batchSize!==this.numberToReturn)this.numberToReturn=this.batchSize;let n=ne.ByteUtils.allocate(20+ne.ByteUtils.utf8ByteLength(this.ns)+1+4+4);e.push(n);let s=ne.BSON.serialize(this.query,{checkKeys:this.checkKeys,serializeFunctions:this.serializeFunctions,ignoreUndefined:this.ignoreUndefined});if(e.push(s),this.returnFieldSelector&&Object.keys(this.returnFieldSelector).length>0)t=ne.BSON.serialize(this.returnFieldSelector,{checkKeys:this.checkKeys,serializeFunctions:this.serializeFunctions,ignoreUndefined:this.ignoreUndefined}),e.push(t);let i=n.length+s.length+(t?t.length:0),o=4;return n[3]=i>>24&255,n[2]=i>>16&255,n[1]=i>>8&255,n[0]=i&255,n[o+3]=this.requestId>>24&255,n[o+2]=this.requestId>>16&255,n[o+1]=this.requestId>>8&255,n[o]=this.requestId&255,o=o+4,n[o+3]=0,n[o+2]=0,n[o+1]=0,n[o]=0,o=o+4,n[o+3]=Hs.OP_QUERY>>24&255,n[o+2]=Hs.OP_QUERY>>16&255,n[o+1]=Hs.OP_QUERY>>8&255,n[o]=Hs.OP_QUERY&255,o=o+4,n[o+3]=r>>24&255,n[o+2]=r>>16&255,n[o+1]=r>>8&255,n[o]=r&255,o=o+4,o=o+a9(n,this.ns,o)+1,n[o-1]=0,n[o+3]=this.numberToSkip>>24&255,n[o+2]=this.numberToSkip>>16&255,n[o+1]=this.numberToSkip>>8&255,n[o]=this.numberToSkip&255,o=o+4,n[o+3]=this.numberToReturn>>24&255,n[o+2]=this.numberToReturn>>16&255,n[o+1]=this.numberToReturn>>8&255,n[o]=this.numberToReturn&255,o=o+4,e}}m9.OpQueryRequest=uE;class c9{constructor(e,t,r,n){this.index=0,this.sections=[],this.moreToCome=!1,this.parsed=!1,this.raw=e,this.data=r,this.opts=n??{useBigInt64:!1,promoteLongs:!0,promoteValues:!0,promoteBuffers:!1,bsonRegExp:!1},this.length=t.length,this.requestId=t.requestId,this.responseTo=t.responseTo,this.opCode=t.opCode,this.fromCompressed=t.fromCompressed,this.useBigInt64=typeof this.opts.useBigInt64==="boolean"?this.opts.useBigInt64:!1,this.promoteLongs=typeof this.opts.promoteLongs==="boolean"?this.opts.promoteLongs:!0,this.promoteValues=typeof this.opts.promoteValues==="boolean"?this.opts.promoteValues:!0,this.promoteBuffers=typeof this.opts.promoteBuffers==="boolean"?this.opts.promoteBuffers:!1,this.bsonRegExp=typeof this.opts.bsonRegExp==="boolean"?this.opts.bsonRegExp:!1}isParsed(){return this.parsed}parse(){if(this.parsed)return this.sections[0];if(this.index=20,this.responseFlags=ne.readInt32LE(this.data,0),this.cursorId=new ne.BSON.Long(ne.readInt32LE(this.data,4),ne.readInt32LE(this.data,8)),this.startingFrom=ne.readInt32LE(this.data,12),this.numberReturned=ne.readInt32LE(this.data,16),this.numberReturned<0||this.numberReturned>4294967295)throw RangeError(`OP_REPLY numberReturned is an invalid array length ${this.numberReturned}`);this.cursorNotFound=(this.responseFlags&yse)!==0,this.queryFailure=(this.responseFlags&gse)!==0,this.shardConfigStale=(this.responseFlags&Ese)!==0,this.awaitCapable=(this.responseFlags&_se)!==0;for(let e=0;e<this.numberReturned;e++){let t=this.data[this.index]|this.data[this.index+1]<<8|this.data[this.index+2]<<16|this.data[this.index+3]<<24,r=this.data.subarray(this.index,this.index+t);this.sections.push(r),this.index=this.index+t}return this.parsed=!0,this.sections[0]}}m9.OpReply=c9;var l9=1,h9=2,f9=65536;class vd{constructor(e,t){this.field=e,this.documents=[],this.chunks=[],this.serializedDocumentsLength=0;let r=ne.ByteUtils.allocateUnsafe(5+this.field.length+1);if(r[0]=1,a9(r,`${this.field}\x00`,5),this.chunks.push(r),this.header=r,t)for(let n of t)this.push(n,ne.BSON.serialize(n))}push(e,t){if(this.serializedDocumentsLength+=t.length,this.documents.push(e),this.chunks.push(t),this.header)ne.NumberUtils.setInt32LE(this.header,1,4+this.field.length+1+this.serializedDocumentsLength);return this.serializedDocumentsLength+this.header.length}toBin(){return ne.ByteUtils.concat(this.chunks)}}m9.DocumentSequence=vd;function Ase(e,t,r){let n=new vd(e);for(let s=0;s<t.length;s++)n.push(t[s],r[s]);return n}class kd{constructor(e,t,r){if(t==null)throw new to.MongoInvalidArgumentError("Query document must be specified for query");this.databaseName=e,this.command=t,this.command.$db=e,this.options=r??{},this.requestId=r.requestId?r.requestId:kd.getRequestId(),this.serializeFunctions=typeof r.serializeFunctions==="boolean"?r.serializeFunctions:!1,this.ignoreUndefined=typeof r.ignoreUndefined==="boolean"?r.ignoreUndefined:!1,this.checkKeys=typeof r.checkKeys==="boolean"?r.checkKeys:!1,this.maxBsonSize=r.maxBsonSize||16777216,this.checksumPresent=!1,this.moreToCome=r.moreToCome??t.writeConcern?.w===0,this.exhaustAllowed=typeof r.exhaustAllowed==="boolean"?r.exhaustAllowed:!1}toBin(){let e=[],t=0;if(this.checksumPresent)t|=l9;if(this.moreToCome)t|=h9;if(this.exhaustAllowed)t|=f9;let r=ne.ByteUtils.allocate(20);e.push(r);let n=r.length,s=this.command;return n+=this.makeSections(e,s),ne.NumberUtils.setInt32LE(r,0,n),ne.NumberUtils.setInt32LE(r,4,this.requestId),ne.NumberUtils.setInt32LE(r,8,0),ne.NumberUtils.setInt32LE(r,12,Hs.OP_MSG),ne.setUint32LE(r,16,t),e}makeSections(e,t){let r=this.extractDocumentSequences(t),n=ne.ByteUtils.allocateUnsafe(1);n[0]=0;let s=this.serializeBson(t);return e.push(n),e.push(s),e.push(r),n.length+s.length+r.length}extractDocumentSequences(e){let t=[];for(let[r,n]of Object.entries(e))if(n instanceof vd)t.push(n.toBin()),delete e[r];if(t.length>0)return ne.ByteUtils.concat(t);return ne.ByteUtils.allocate(0)}serializeBson(e){return ne.BSON.serialize(e,{checkKeys:this.checkKeys,serializeFunctions:this.serializeFunctions,ignoreUndefined:this.ignoreUndefined})}static getRequestId(){return Fc=Fc+1&2147483647,Fc}}m9.OpMsgRequest=kd;class d9{constructor(e,t,r,n){this.index=0,this.sections=[],this.parsed=!1,this.raw=e,this.data=r,this.opts=n??{useBigInt64:!1,promoteLongs:!0,promoteValues:!0,promoteBuffers:!1,bsonRegExp:!1},this.length=t.length,this.requestId=t.requestId,this.responseTo=t.responseTo,this.opCode=t.opCode,this.fromCompressed=t.fromCompressed,this.responseFlags=ne.readInt32LE(r,0),this.checksumPresent=(this.responseFlags&l9)!==0,this.moreToCome=(this.responseFlags&h9)!==0,this.exhaustAllowed=(this.responseFlags&f9)!==0,this.useBigInt64=typeof this.opts.useBigInt64==="boolean"?this.opts.useBigInt64:!1,this.promoteLongs=typeof this.opts.promoteLongs==="boolean"?this.opts.promoteLongs:!0,this.promoteValues=typeof this.opts.promoteValues==="boolean"?this.opts.promoteValues:!0,this.promoteBuffers=typeof this.opts.promoteBuffers==="boolean"?this.opts.promoteBuffers:!1,this.bsonRegExp=typeof this.opts.bsonRegExp==="boolean"?this.opts.bsonRegExp:!1}isParsed(){return this.parsed}parse(){if(this.parsed)return this.sections[0];this.index=4;while(this.index<this.data.length){let e=this.data[this.index++];if(e===0){let t=ne.readInt32LE(this.data,this.index),r=this.data.subarray(this.index,this.index+t);this.sections.push(r),this.index+=t}else if(e===1)throw new to.MongoRuntimeError("OP_MSG Payload Type 1 detected unsupported protocol")}return this.parsed=!0,this.sections[0]}}m9.OpMsgResponse=d9;var oE=16,u9=9;class p9{constructor(e,t){this.command=e,this.options={zlibCompressionLevel:t.zlibCompressionLevel,agreedCompressor:t.agreedCompressor}}static canCompress(e){let t=e instanceof kd?e.command:e.query,r=Object.keys(t)[0];return!Pc.uncompressibleCommands.has(r)}async toBin(){let e=ne.ByteUtils.concat(this.command.toBin()),t=e.slice(oE),r=ne.readInt32LE(e,12),n=await Pc.compress(this.options,t),s=ne.ByteUtils.allocate(oE);ne.NumberUtils.setInt32LE(s,0,oE+u9+n.length),ne.NumberUtils.setInt32LE(s,4,this.command.requestId),ne.NumberUtils.setInt32LE(s,8,0),ne.NumberUtils.setInt32LE(s,12,Hs.OP_COMPRESSED);let i=ne.ByteUtils.allocate(u9);return ne.NumberUtils.setInt32LE(i,0,r),ne.NumberUtils.setInt32LE(i,4,t.length),i[8]=Pc.Compressor[this.options.agreedCompressor],[s,i,n]}}m9.OpCompressedRequest=p9});var qi=g(function(g9){Object.defineProperty(g9,"__esModule",{value:!0});g9.ReadConcern=g9.ReadConcernLevel=void 0;g9.ReadConcernLevel=Object.freeze({local:"local",majority:"majority",linearizable:"linearizable",available:"available",snapshot:"snapshot"});class Nc{constructor(e){this.level=g9.ReadConcernLevel[e]??e}static fromOptions(e){if(e==null)return;if(e.readConcern){let{readConcern:t}=e;if(t instanceof Nc)return t;else if(typeof t==="string")return new Nc(t);else if("level"in t&&t.level)return new Nc(t.level)}if(e.level)return new Nc(e.level);return}static get MAJORITY(){return g9.ReadConcernLevel.majority}static get AVAILABLE(){return g9.ReadConcernLevel.available}static get LINEARIZABLE(){return g9.ReadConcernLevel.linearizable}static get SNAPSHOT(){return g9.ReadConcernLevel.snapshot}toJSON(){return{level:this.level}}}g9.ReadConcern=Nc});var Ur=g(function(_9){Object.defineProperty(_9,"__esModule",{value:!0});_9.ReadPreference=_9.ReadPreferenceMode=void 0;var us=J();_9.ReadPreferenceMode=Object.freeze({primary:"primary",primaryPreferred:"primaryPreferred",secondary:"secondary",secondaryPreferred:"secondaryPreferred",nearest:"nearest"});class Rt{static{this.PRIMARY=_9.ReadPreferenceMode.primary}static{this.PRIMARY_PREFERRED=_9.ReadPreferenceMode.primaryPreferred}static{this.SECONDARY=_9.ReadPreferenceMode.secondary}static{this.SECONDARY_PREFERRED=_9.ReadPreferenceMode.secondaryPreferred}static{this.NEAREST=_9.ReadPreferenceMode.nearest}static{this.primary=new Rt(_9.ReadPreferenceMode.primary)}static{this.primaryPreferred=new Rt(_9.ReadPreferenceMode.primaryPreferred)}static{this.secondary=new Rt(_9.ReadPreferenceMode.secondary)}static{this.secondaryPreferred=new Rt(_9.ReadPreferenceMode.secondaryPreferred)}static{this.nearest=new Rt(_9.ReadPreferenceMode.nearest)}constructor(e,t,r){if(!Rt.isValid(e))throw new us.MongoInvalidArgumentError(`Invalid read preference mode ${JSON.stringify(e)}`);if(r==null&&typeof t==="object"&&!Array.isArray(t))r=t,t=void 0;else if(t&&!Array.isArray(t))throw new us.MongoInvalidArgumentError("ReadPreference tags must be an array");if(this.mode=e,this.tags=t,this.hedge=r?.hedge,this.maxStalenessSeconds=void 0,r=r??{},r.maxStalenessSeconds!=null){if(r.maxStalenessSeconds<=0)throw new us.MongoInvalidArgumentError("maxStalenessSeconds must be a positive integer");this.maxStalenessSeconds=r.maxStalenessSeconds}if(this.mode===Rt.PRIMARY){if(this.tags&&Array.isArray(this.tags)&&this.tags.length>0)throw new us.MongoInvalidArgumentError("Primary read preference cannot be combined with tags");if(this.maxStalenessSeconds)throw new us.MongoInvalidArgumentError("Primary read preference cannot be combined with maxStalenessSeconds");if(this.hedge)throw new us.MongoInvalidArgumentError("Primary read preference cannot be combined with hedge")}}get preference(){return this.mode}static fromString(e){return new Rt(e)}static fromOptions(e){if(!e)return;let t=e.readPreference??e.session?.transaction.options.readPreference,r=e.readPreferenceTags;if(t==null)return;if(typeof t==="string")return new Rt(t,r,{maxStalenessSeconds:e.maxStalenessSeconds,hedge:e.hedge});else if(!(t instanceof Rt)&&typeof t==="object"){let n=t.mode||t.preference;if(n&&typeof n==="string")return new Rt(n,t.tags??r,{maxStalenessSeconds:t.maxStalenessSeconds,hedge:e.hedge})}if(r)t.tags=r;return t}static translate(e){if(e.readPreference==null)return e;let t=e.readPreference;if(typeof t==="string")e.readPreference=new Rt(t);else if(t&&!(t instanceof Rt)&&typeof t==="object"){let r=t.mode||t.preference;if(r&&typeof r==="string")e.readPreference=new Rt(r,t.tags,{maxStalenessSeconds:t.maxStalenessSeconds})}else if(!(t instanceof Rt))throw new us.MongoInvalidArgumentError(`Invalid read preference: ${t}`);return e}static isValid(e){return new Set([Rt.PRIMARY,Rt.PRIMARY_PREFERRED,Rt.SECONDARY,Rt.SECONDARY_PREFERRED,Rt.NEAREST,null]).has(e)}isValid(e){return Rt.isValid(typeof e==="string"?e:this.mode)}secondaryOk(){return new Set([Rt.PRIMARY_PREFERRED,Rt.SECONDARY,Rt.SECONDARY_PREFERRED,Rt.NEAREST]).has(this.mode)}equals(e){return e.mode===this.mode}toJSON(){let e={mode:this.mode};if(Array.isArray(this.tags))e.tags=this.tags;if(this.maxStalenessSeconds)e.maxStalenessSeconds=this.maxStalenessSeconds;if(this.hedge)e.hedge=this.hedge;return e}}_9.ReadPreference=Rt});var as=g(function(w9){Object.defineProperty(w9,"__esModule",{value:!0});w9.ServerType=w9.TopologyType=w9.STATE_CONNECTED=w9.STATE_CONNECTING=w9.STATE_CLOSED=w9.STATE_CLOSING=void 0;w9._advanceClusterTime=Tse;w9.STATE_CLOSING="closing";w9.STATE_CLOSED="closed";w9.STATE_CONNECTING="connecting";w9.STATE_CONNECTED="connected";w9.TopologyType=Object.freeze({Single:"Single",ReplicaSetNoPrimary:"ReplicaSetNoPrimary",ReplicaSetWithPrimary:"ReplicaSetWithPrimary",Sharded:"Sharded",Unknown:"Unknown",LoadBalanced:"LoadBalanced"});w9.ServerType=Object.freeze({Standalone:"Standalone",Mongos:"Mongos",PossiblePrimary:"PossiblePrimary",RSPrimary:"RSPrimary",RSSecondary:"RSSecondary",RSArbiter:"RSArbiter",RSOther:"RSOther",RSGhost:"RSGhost",Unknown:"Unknown",LoadBalancer:"LoadBalancer"});function Tse(e,t){if(e.clusterTime==null)e.clusterTime=t;else if(t.clusterTime.greaterThan(e.clusterTime.clusterTime))e.clusterTime=t}});var Hn=g(function(C9){Object.defineProperty(C9,"__esModule",{value:!0});C9.WriteConcern=C9.WRITE_CONCERN_KEYS=void 0;C9.throwIfWriteConcernError=Ise;var qd=dt(),S9=J();C9.WRITE_CONCERN_KEYS=["w","wtimeout","j","journal","fsync"];class Oh{constructor(e,t,r,n){if(e!=null)if(!Number.isNaN(Number(e)))this.w=Number(e);else this.w=e;if(t!=null)this.wtimeoutMS=this.wtimeout=t;if(r!=null)this.journal=this.j=r;if(n!=null)this.journal=this.j=n?!0:!1}static apply(e,t){let r={};if(t.w!=null)r.w=t.w;if(t.wtimeoutMS!=null)r.wtimeout=t.wtimeoutMS;if(t.journal!=null)r.j=t.j;return e.writeConcern=r,e}static fromOptions(e,t){if(e==null)return;t=t??{};let r;if(typeof e==="string"||typeof e==="number")r={w:e};else if(e instanceof Oh)r=e;else r=e.writeConcern;let s={...t instanceof Oh?t:t.writeConcern,...r},{w:i=void 0,wtimeout:o=void 0,j:u=void 0,fsync:a=void 0,journal:c=void 0,wtimeoutMS:l=void 0}=s;if(i!=null||o!=null||l!=null||u!=null||c!=null||a!=null)return new Oh(i,o??l,u??c,a);return}}C9.WriteConcern=Oh;function Ise(e){if(typeof e==="object"&&e!=null){let t=qd.MongoDBResponse.is(e)&&e.has("writeConcernError")?e.toObject():!qd.MongoDBResponse.is(e)&&("writeConcernError"in e)?e:null;if(t!=null)throw new S9.MongoWriteConcernError(t)}}});var ae=g(function(W9){Object.defineProperty(W9,"__esModule",{value:!0});W9.kDispose=W9.randomBytes=W9.COSMOS_DB_MSG=W9.DOCUMENT_DB_MSG=W9.COSMOS_DB_CHECK=W9.DOCUMENT_DB_CHECK=W9.MONGODB_WARNING_CODE=W9.DEFAULT_PK_FACTORY=W9.HostAddress=W9.BufferPool=W9.List=W9.MongoDBCollectionNamespace=W9.MongoDBNamespace=void 0;W9.isUint8Array=vse;W9.hostMatchesWildcards=kse;W9.normalizeHintField=qse;W9.isObject=aE;W9.mergeOptions=Lse;W9.filterOptions=Use;W9.isPromiseLike=Vse;W9.decorateWithCollation=zse;W9.decorateWithReadConcern=Wse;W9.getTopology=Kse;W9.ns=Hse;W9.makeCounter=Gse;W9.uuidV4=Yse;W9.maxWireVersion=Qse;W9.arrayStrictEqual=Jse;W9.errorStrictEqual=Xse;W9.makeStateMachine=Zse;W9.processTimeMS=$9;W9.calculateDurationInMs=eie;W9.hasAtomicOperators=R9;W9.resolveTimeoutOptions=tie;W9.resolveOptions=rie;W9.isSuperset=v9;W9.isHello=nie;W9.setDifference=sie;W9.isRecord=oie;W9.emitWarning=q9;W9.emitWarningOnce=uie;W9.enumToString=aie;W9.supportsRetryableWrites=cie;W9.shuffle=lie;W9.commandSupportsReadConcern=hie;W9.commandSupportsAfterClusterTime=fie;W9.compareObjectId=die;W9.parseInteger=j9;W9.parseUnsignedInteger=pie;W9.checkParentDomainMatch=L9;W9.dnsNameToASCII=U9;W9.normalizeDnsName=V9;W9.verifySrvHost=yie;W9.get=gie;W9.isHostMatch=Eie;W9.promiseWithResolvers=hE;W9.squashError=_ie;W9.once=wie;W9.maybeAddIdToDocuments=Oie;W9.fileIsAccessible=Sie;W9.csotMin=Cie;W9.noop=bie;W9.decorateDecryptionResult=z9;W9.addAbortListener=fE;W9.abortable=Die;var T9=L("fs"),M9=L("http"),x9=L("process"),Ic=L("timers"),P9=L("url"),Pr=Se(),jd=zo(),wu=wr(),Ot=J(),F9=qi(),B9=Ur(),N9=as(),I9=Hn();function vse(e){return e!=null&&typeof e==="object"&&Symbol.toStringTag in e&&e[Symbol.toStringTag]==="Uint8Array"}function kse(e,t){for(let r of t){if(e===r)return!0;if(r.startsWith("*.")){let n=r.substring(2);if(e===n||e.endsWith(`.${n}`))return!0}if(r.startsWith("*/")){let n=r.substring(2);if(e===n||e.endsWith(`/${n}`))return!0}}return!1}function qse(e){let t=void 0;if(typeof e==="string")t=e;else if(Array.isArray(e))t={},e.forEach((r)=>{t[r]=1});else if(e!=null&&typeof e==="object"){t={};for(let r in e)t[r]=e[r]}return t}var jse=(e)=>Object.prototype.toString.call(e);function aE(e){return jse(e)==="[object Object]"}function Lse(e,t){return{...e,...t}}function Use(e,t){let r={};for(let n in e)if(t.includes(n))r[n]=e[n];return r}function Vse(e){return e!=null&&typeof e==="object"&&"then"in e&&typeof e.then==="function"}function zse(e,t){if(t.collation&&typeof t.collation==="object")e.collation=t.collation}function Wse(e,t,r){if(r&&r.session&&r.session.inTransaction())return;let n=Object.assign({},e.readConcern||{});if(t.s.readConcern)Object.assign(n,t.s.readConcern);if(Object.keys(n).length>0)Object.assign(e,{readConcern:n})}function Kse(e){if("topology"in e&&e.topology)return e.topology;else if("client"in e&&e.client.topology)return e.client.topology;throw new Ot.MongoNotConnectedError("MongoClient must be connected to perform this operation")}function Hse(e){return Ch.fromString(e)}class Ch{constructor(e,t){this.db=e,this.collection=t===""?void 0:t}toString(){return this.collection?`${this.db}.${this.collection}`:this.db}withCollection(e){return new cE(this.db,e)}static fromString(e){if(typeof e!=="string"||e==="")throw new Ot.MongoRuntimeError(`Cannot parse namespace from "${e}"`);let[t,...r]=e.split("."),n=r.join(".");return new Ch(t,n===""?void 0:n)}}W9.MongoDBNamespace=Ch;class cE extends Ch{constructor(e,t){super(e,t);this.collection=t}static fromString(e){return super.fromString(e)}}W9.MongoDBCollectionNamespace=cE;function*Gse(e=0){let t=e;while(!0){let r=t;t+=1,yield r}}function Yse(){let e=crypto.getRandomValues(new Uint8Array(16));return e[6]=e[6]&15|64,e[8]=e[8]&63|128,e}function Qse(e){if(e){if(e.hello)return e.hello.maxWireVersion;if(e.serverApi?.version)return jd.MAX_SUPPORTED_WIRE_VERSION;if(e.loadBalanced)return jd.MAX_SUPPORTED_WIRE_VERSION;if("lastHello"in e&&typeof e.lastHello==="function"){let t=e.lastHello();if(t)return t.maxWireVersion}if(e.description&&"maxWireVersion"in e.description&&e.description.maxWireVersion!=null)return e.description.maxWireVersion}return 0}function Jse(e,t){if(!Array.isArray(e)||!Array.isArray(t))return!1;return e.length===t.length&&e.every((r,n)=>r===t[n])}function Xse(e,t){if(e===t)return!0;if(!e||!t)return e===t;if(e==null&&t!=null||e!=null&&t==null)return!1;if(e.constructor.name!==t.constructor.name)return!1;if(e.message!==t.message)return!1;return!0}function Zse(e){return function(r,n){let s=e[r.s.state];if(s&&s.indexOf(n)<0)throw new Ot.MongoRuntimeError(`illegal state transition from [${r.s.state}] => [${n}], allowed: [${s}]`);r.emit("stateChanged",r.s.state,n),r.s.state=n}}function $9(){return Math.floor(performance.now())}function eie(e){if(typeof e!=="number")return-1;let t=$9()-e;return t<0?0:t}function R9(e,t){if(Array.isArray(e)){for(let n of e)if(R9(n))return!0;return!1}let r=Object.keys(e);if(t?.ignoreUndefined){let n=!0;for(let s of r)if(e[s]!==void 0){n=!1;break}if(n)throw new Ot.MongoInvalidArgumentError("Update operations require that all atomic operators have defined values, but none were provided.")}return r.length>0&&r[0][0]==="$"}function tie(e,t){let{socketTimeoutMS:r,serverSelectionTimeoutMS:n,waitQueueTimeoutMS:s}=e.s.options;return{socketTimeoutMS:r,serverSelectionTimeoutMS:n,waitQueueTimeoutMS:s,...t,timeoutMS:void 0}}function rie(e,t){let r=Object.assign({},t,Pr.resolveBSONOptions(t,e));if(!t?.session?.inTransaction()){let i=F9.ReadConcern.fromOptions(t)??e?.readConcern;if(i)r.readConcern=i;let o=I9.WriteConcern.fromOptions(t)??e?.writeConcern;if(o)r.writeConcern=o}r.timeoutMS=void 0;let s=B9.ReadPreference.fromOptions(t)??e?.readPreference;if(s)r.readPreference=s;return r}function v9(e,t){e=Array.isArray(e)?new Set(e):e,t=Array.isArray(t)?new Set(t):t;for(let r of t)if(!e.has(r))return!1;return!0}function nie(e){return e[wu.LEGACY_HELLO_COMMAND]||e.hello?!0:!1}function sie(e,t){let r=new Set(e);for(let n of t)r.delete(n);return r}var iie=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);function oie(e,t=void 0){if(!aE(e))return!1;let r=e.constructor;if(r&&r.prototype){if(!aE(r.prototype))return!1;if(!iie(r.prototype,"isPrototypeOf"))return!1}if(t){let n=Object.keys(e);return v9(n,t)}return!0}class lE{get length(){return this.count}get[Symbol.toStringTag](){return"List"}constructor(){this.count=0,this.head={next:null,prev:null,value:null},this.head.next=this.head,this.head.prev=this.head}toArray(){return Array.from(this)}toString(){return`head <=> ${this.toArray().join(" <=> ")} <=> head`}*[Symbol.iterator](){for(let e of this.nodes())yield e.value}*nodes(){let e=this.head.next;while(e!==this.head){let{next:t}=e;yield e,e=t}}push(e){this.count+=1;let t={next:this.head,prev:this.head.prev,value:e};this.head.prev.next=t,this.head.prev=t}pushMany(e){for(let t of e)this.push(t)}unshift(e){this.count+=1;let t={next:this.head.next,prev:this.head,value:e};this.head.next.prev=t,this.head.next=t}remove(e){if(e===this.head||this.length===0)return null;this.count-=1;let{prev:t,next:r}=e;return t.next=r,r.prev=t,e.value}shift(){return this.remove(this.head.next)}pop(){return this.remove(this.head.prev)}prune(e){for(let t of this.nodes())if(e(t.value))this.remove(t)}clear(){this.count=0,this.head.next=this.head,this.head.prev=this.head}first(){return this.head.next.value}last(){return this.head.prev.value}}W9.List=lE;class k9{constructor(){this.buffers=new lE,this.totalByteLength=0}get length(){return this.totalByteLength}append(e){this.buffers.push(e),this.totalByteLength+=e.length}getInt32(){if(this.totalByteLength<4)return null;let e=this.buffers.first();if(e!=null&&e.byteLength>=4)return Pr.NumberUtils.getInt32LE(e,0);let t=this.read(4),r=Pr.NumberUtils.getInt32LE(t,0);return this.totalByteLength+=4,this.buffers.unshift(t),r}read(e){if(typeof e!=="number"||e<0)throw new Ot.MongoInvalidArgumentError('Argument "size" must be a non-negative number');if(e>this.totalByteLength)return Pr.ByteUtils.allocate(0);let t=Pr.ByteUtils.allocateUnsafe(e);for(let r=0;r<e;){let n=this.buffers.shift();if(n==null)break;let s=e-r,i=Math.min(s,n.byteLength),o=n.subarray(0,i);if(t.set(o,r),r+=i,this.totalByteLength-=i,i<n.byteLength)this.buffers.unshift(n.subarray(i))}return t}}W9.BufferPool=k9;class Sh{constructor(e){this.host=void 0,this.port=void 0,this.socketPath=void 0,this.isIPv6=!1;let t=e.split(" ").join("%20");if(t.endsWith(".sock")){this.socketPath=decodeURIComponent(t);return}let r=`iLoveJS://${t}`,n;try{n=new URL(r)}catch(u){delete u.input;let a=new Ot.MongoRuntimeError("Unable to parse host with URL");throw a.cause=u,a}let s=n.hostname,i=n.port,o=decodeURIComponent(s).toLowerCase();if(o.startsWith("[")&&o.endsWith("]"))this.isIPv6=!0,o=o.substring(1,s.length-1);if(this.host=o.toLowerCase(),typeof i==="number")this.port=i;else if(typeof i==="string"&&i!=="")this.port=Number.parseInt(i,10);else this.port=27017;if(this.port===0)throw new Ot.MongoParseError("Invalid port (zero) with hostname");Object.freeze(this)}[Symbol.for("nodejs.util.inspect.custom")](){return this.inspect()}inspect(){return`new HostAddress('${this.toString()}')`}toString(){if(typeof this.host==="string"){if(this.isIPv6)return`[${this.host}]:${this.port}`;return`${this.host}:${this.port}`}return`${this.socketPath}`}static fromString(e){return new Sh(e)}static fromHostPort(e,t){if(e.includes(":"))e=`[${e}]`;return Sh.fromString(`${e}:${t}`)}static fromSrvRecord({name:e,port:t}){return Sh.fromHostPort(e,t)}toHostPort(){if(this.socketPath)return{host:this.socketPath,port:0};let e=this.host??"",t=this.port??0;return{host:e,port:t}}}W9.HostAddress=Sh;W9.DEFAULT_PK_FACTORY={createPk(){return new Pr.ObjectId}};W9.MONGODB_WARNING_CODE="MONGODB DRIVER";function q9(e){return x9.emitWarning(e,{code:W9.MONGODB_WARNING_CODE})}var D9=new Set;function uie(e){if(!D9.has(e))return D9.add(e),q9(e)}function aie(e){return Object.values(e).join(", ")}function cie(e){if(!e)return!1;if(e.loadBalanced)return!0;if(e.description.logicalSessionTimeoutMinutes!=null){if(e.description.type!==N9.ServerType.Standalone)return!0}return!1}function lie(e,t=0){let r=Array.from(e);if(t>r.length)throw new Ot.MongoRuntimeError("Limit must be less than the number of items");let n=r.length,s=t%r.length===0?1:r.length-t;while(n>s){let i=Math.floor(Math.random()*n);n-=1;let o=r[n];r[n]=r[i],r[i]=o}return t%r.length===0?r:r.slice(s)}function hie(e){if(e.aggregate||e.count||e.distinct||e.find||e.geoNear)return!0;return!1}function fie(e){if(e.aggregate||e.count||e.distinct||e.find||e.geoNear)return!0;if(e.bulkWrite||e.create||e.createIndexes||e.delete||e.drop||e.dropDatabase||e.dropIndexes||e.findAndModify||e.insert||e.update)return!0;return!1}function die(e,t){if(e==null&&t==null)return 0;if(e==null)return-1;if(t==null)return 1;return Pr.ByteUtils.compare(e.id,t.id)}function j9(e){if(typeof e==="number")return Math.trunc(e);let t=Number.parseInt(String(e),10);return Number.isNaN(t)?null:t}function pie(e){let t=j9(e);return t!=null&&t>=0?t:null}function L9(e,t){let r=V9(t),n=/^.*?\./,s=r.split(".").length<3,i=`.${e.replace(n,"")}`,o=s?r:`.${r.replace(n,"")}`;if(!o.startsWith("."))o="."+o;if(s&&e.split(".").length<=r.split(".").length)throw new Ot.MongoAPIError("Server record does not have at least one more domain level than parent URI");if(!i.endsWith(o))throw new Ot.MongoAPIError("Server record does not share hostname with parent URI")}var mie=/[\u0000-\u0020\u007F#%/:<>?@[\\\]^|]/;function U9(e){if(mie.test(e))return null;let t=/^\p{ASCII}*$/u.test(e)?e.toLowerCase():P9.domainToASCII(e);return t===""?null:t}function V9(e){let t=e.endsWith(".")?e.slice(0,-1):e,r=U9(t);if(r==null)throw new Ot.MongoAPIError("Invalid DNS host name");return r}function yie(e,t,r){let{srvAllowedHostsSuffix:n,srvHostValidator:s}=r;if(s!=null){if(!s(e))throw new Ot.MongoAPIError("Server record was rejected by srvHostValidator");return}if(n!=null){if(!e.endsWith(n))throw new Ot.MongoAPIError("Server record does not end with srvAllowedHostsSuffix");return}L9(e,t)}function gie(e,t={}){return new Promise((r,n)=>{let s,i=M9.get(e,t,(o)=>{o.setEncoding("utf8");let u="";o.on("data",(a)=>u+=a),o.on("end",()=>{Ic.clearTimeout(s),r({status:o.statusCode,body:u})})}).on("error",(o)=>{Ic.clearTimeout(s),n(o)}).end();s=Ic.setTimeout(()=>{i.destroy(new Ot.MongoNetworkTimeoutError("request timed out after 10 seconds"))},1e4)})}W9.DOCUMENT_DB_CHECK=/(\.docdb\.amazonaws\.com$)|(\.docdb-elastic\.amazonaws\.com$)/;W9.COSMOS_DB_CHECK=/\.cosmos\.azure\.com$/;W9.DOCUMENT_DB_MSG="You appear to be connected to a DocumentDB cluster. For more information regarding feature compatibility and support please visit https://www.mongodb.com/supportability/documentdb";W9.COSMOS_DB_MSG="You appear to be connected to a CosmosDB cluster. For more information regarding feature compatibility and support please visit https://www.mongodb.com/supportability/cosmosdb";function Eie(e,t){return t&&e.test(t.toLowerCase())?!0:!1}function hE(){let e,t;return{promise:new Promise(function(s,i){e=s,t=i}),resolve:e,reject:t}}function _ie(e){return}var Aie=(e)=>Promise.resolve(crypto.getRandomValues(new Uint8Array(e)));W9.randomBytes=Aie;async function wie(e,t,r){r?.signal?.throwIfAborted();let{promise:n,resolve:s,reject:i}=hE(),o=(c)=>s(c),u=(c)=>i(c),a=fE(r?.signal,function(){i(this.reason)});e.once(t,o).once("error",u);try{return await n}finally{e.off(t,o),e.off("error",u),a?.[W9.kDispose]()}}function Oie(e,t,r){if(r.forceServerObjectId??e.db.options?.forceServerObjectId??!1)return t;if(t._id==null)t._id=e.s.pkFactory.createPk();return t}async function Sie(e,t){try{return await T9.promises.access(e,t),!0}catch{return!1}}function Cie(e,t){if(e===0)return t;if(t===0)return e;return Math.min(e,t)}function bie(){return}function z9(e,t,r=!0){if(r){if(Pr.ByteUtils.isUint8Array(t))t=Pr.deserialize(t);if(Pr.ByteUtils.isUint8Array(e))throw new Ot.MongoRuntimeError("Expected result of decryption to be deserialized BSON object")}if(!e||typeof e!=="object")return;for(let n of Object.keys(e)){let s=t[n];if(s&&s._bsontype==="Binary"&&s.sub_type===6){if(!e[wu.kDecoratedKeys])Object.defineProperty(e,wu.kDecoratedKeys,{value:[],configurable:!0,enumerable:!1,writable:!1});e[wu.kDecoratedKeys].push(n);continue}z9(e[n],s,!1)}}W9.kDispose=Symbol.dispose??Symbol("dispose");function fE(e,t){if(e==null)return;return e.addEventListener("abort",t,{once:!0}),{[W9.kDispose]:()=>e.removeEventListener("abort",t)}}async function Die(e,{signal:t}){if(t==null)return await e;let{promise:r,reject:n}=hE(),s=t.aborted?n(t.reason):fE(t,function(){n(this.reason)});try{return await Promise.race([e,r])}finally{s?.[W9.kDispose]()}}});var Y9=g(function(H9){Object.defineProperty(H9,"__esModule",{value:!0});H9.OnDemandDocument=void 0;var ee=Se(),Dh={type:0,nameOffset:1,nameLength:2,offset:3,length:4};class Ld{constructor(e,t=0,r=!1,n){this.cache=Object.create(null),this.indexFound=Object.create(null),this.bson=e,this.offset=t,this.isArray=r,this.elements=n??ee.parseToElementsToArray(this.bson,t)}isElementName(e,t){let r=t[Dh.nameLength],n=t[Dh.nameOffset];if(e.length!==r)return!1;let s=n+r;for(let i=n,o=0;o<e.length&&i<s;o++,i++)if(this.bson[i]!==e.charCodeAt(o))return!1;return!0}getElement(e){let t=this.cache[e];if(t===!1)return null;if(t!=null)return t;if(typeof e==="number")if(this.isArray)if(e<this.elements.length){let n={element:this.elements[e],value:void 0};return this.cache[e]=n,this.indexFound[e]=!0,n}else return null;else return null;for(let r=0;r<this.elements.length;r++){let n=this.elements[r];if(!(r in this.indexFound)&&this.isElementName(e,n)){let s={element:n,value:void 0};return this.cache[e]=s,this.indexFound[r]=!0,s}}return this.cache[e]=!1,null}toJSValue(e,t){let r=e[Dh.type],n=e[Dh.offset],s=e[Dh.length];if(t!==r)return null;switch(t){case ee.BSONType.null:case ee.BSONType.undefined:return null;case ee.BSONType.double:return ee.NumberUtils.getFloat64LE(this.bson,n);case ee.BSONType.int:return ee.NumberUtils.getInt32LE(this.bson,n);case ee.BSONType.long:return ee.NumberUtils.getBigInt64LE(this.bson,n);case ee.BSONType.bool:return Boolean(this.bson[n]);case ee.BSONType.objectId:return new ee.ObjectId(this.bson.subarray(n,n+12));case ee.BSONType.timestamp:return new ee.Timestamp(ee.NumberUtils.getBigInt64LE(this.bson,n));case ee.BSONType.string:return ee.ByteUtils.toUTF8(this.bson,n+4,n+s-1,!1);case ee.BSONType.binData:{let i=ee.NumberUtils.getInt32LE(this.bson,n),o=this.bson[n+4];if(o===2){let u=ee.NumberUtils.getInt32LE(this.bson,n+1+4);if(u<0)throw new ee.BSONError("Negative binary type element size found for subtype 0x02");if(u>i-4)throw new ee.BSONError("Binary type with subtype 0x02 contains too long binary size");if(u<i-4)throw new ee.BSONError("Binary type with subtype 0x02 contains too short binary size");return new ee.Binary(this.bson.subarray(n+1+4+4,n+1+4+4+u),2)}return new ee.Binary(this.bson.subarray(n+1+4,n+1+4+i),o)}case ee.BSONType.date:return new Date(Number(ee.NumberUtils.getBigInt64LE(this.bson,n)));case ee.BSONType.object:return new Ld(this.bson,n);case ee.BSONType.array:return new Ld(this.bson,n,!0);default:throw new ee.BSONError(`Unsupported BSON type: ${t}`)}}size(){return this.elements.length}has(e){let t=this.cache[e];if(t===!1)return!1;if(t!=null)return!0;return this.getElement(e)!=null}get(e,t,r){let n=this.getElement(e);if(n==null)if(r===!0)throw new ee.BSONError(`BSON element "${e}" is missing`);else return null;if(n.value==null){let s=this.toJSValue(n.element,t);if(s==null)if(r===!0)throw new ee.BSONError(`BSON element "${e}" is missing`);else return null;n.value=s}return n.value}getNumber(e,t){let r=this.get(e,ee.BSONType.bool),n=r==null?null:r?1:0,s=this.get(e,ee.BSONType.long),i=s==null?null:Number(s),o=n??i??this.get(e,ee.BSONType.int)??this.get(e,ee.BSONType.double);if(t===!0&&o==null)throw new ee.BSONError(`BSON element "${e}" is missing`);return o}toObject(e){return ee.deserialize(this.bson,{...e,index:this.offset,allowObjectSmallerThanBufferSize:!0})}toBytes(){let e=ee.NumberUtils.getInt32LE(this.bson,this.offset);return this.bson.subarray(this.offset,this.offset+e)}}H9.OnDemandDocument=Ld});var dt=g(function(e7){Object.defineProperty(e7,"__esModule",{value:!0});e7.ClientBulkWriteCursorResponse=e7.ExplainedCursorResponse=e7.CursorResponse=e7.MongoDBResponse=void 0;e7.isErrorResponse=J9;var se=Se(),cs=J(),Vd=ae(),Q9=Y9(),Ud={type:0,nameOffset:1,nameLength:2,offset:3,length:4};function J9(e,t){for(let r=0;r<t.length;r++){let n=t[r];if(n[Ud.nameLength]===2){let s=n[Ud.nameOffset];if(e[s]===111&&e[s+1]===107){let i=n[Ud.offset],o=n[Ud.length];for(let u=i;u<i+o;u++)if(e[u]!==0)return!1;return!0}}}return!0}class $c extends Q9.OnDemandDocument{get(e,t,r){try{return super.get(e,t,r)}catch(n){throw new cs.MongoUnexpectedServerResponseError(n.message,{cause:n})}}static is(e){return e instanceof $c}static make(e){let t=se.parseToElementsToArray(e,0);return J9(e,t)?new $c(e,0,!1,t):new this(e,0,!1,t)}static{this.empty=new $c(new Uint8Array([13,0,0,0,16,111,107,0,1,0,0,0,0]))}get isMaxTimeExpiredError(){if(this.ok===0&&this.code===cs.MONGODB_ERROR_CODES.MaxTimeMSExpired)return!0;if(this.ok===0)return!1;if(this.get("writeConcernError",se.BSONType.object)?.getNumber("code")===cs.MONGODB_ERROR_CODES.MaxTimeMSExpired)return!0;let r=this.get("writeErrors",se.BSONType.array);if(r?.size()){for(let n=0;n<r.size();n++)if(r.get(n,se.BSONType.object)?.getNumber("code")===cs.MONGODB_ERROR_CODES.MaxTimeMSExpired)return!0}return!1}get recoveryToken(){return this.get("recoveryToken",se.BSONType.object)?.toObject({promoteValues:!1,promoteLongs:!1,promoteBuffers:!1,validation:{utf8:!0}})??null}get atClusterTime(){return this.get("cursor",se.BSONType.object)?.get("atClusterTime",se.BSONType.timestamp)??this.get("atClusterTime",se.BSONType.timestamp)}get operationTime(){return this.get("operationTime",se.BSONType.timestamp)}get ok(){return this.getNumber("ok")?1:0}get $err(){return this.get("$err",se.BSONType.string)}get errmsg(){return this.get("errmsg",se.BSONType.string)}get code(){return this.getNumber("code")}get $clusterTime(){if(!("clusterTime"in this)){let e=this.get("$clusterTime",se.BSONType.object);if(e==null)return this.clusterTime=null,null;let t=e.get("clusterTime",se.BSONType.timestamp,!0),r=e.get("signature",se.BSONType.object)?.toObject();this.clusterTime={clusterTime:t,signature:r}}return this.clusterTime??null}toObject(e){let t={...se.pluckBSONSerializeOptions(e??{}),validation:se.parseUtf8ValidationOption(e)};return super.toObject(t)}}e7.MongoDBResponse=$c;class ka extends $c{constructor(){super(...arguments);this._batch=null,this.iterated=0,this._encryptedBatch=null}static get emptyGetMore(){return new ka(se.serialize({ok:1,cursor:{id:0n,nextBatch:[]}}))}static is(e){return e instanceof ka||e===ka.emptyGetMore}get cursor(){return this.get("cursor",se.BSONType.object,!0)}get id(){try{return se.Long.fromBigInt(this.cursor.get("id",se.BSONType.long,!0))}catch(e){throw new cs.MongoUnexpectedServerResponseError(e.message,{cause:e})}}get ns(){let e=this.cursor.get("ns",se.BSONType.string);if(e!=null)return Vd.ns(e);return null}get length(){return Math.max(this.batchSize-this.iterated,0)}get encryptedBatch(){if(this.encryptedResponse==null)return null;if(this._encryptedBatch!=null)return this._encryptedBatch;let e=this.encryptedResponse?.get("cursor",se.BSONType.object);if(e?.has("firstBatch"))this._encryptedBatch=e.get("firstBatch",se.BSONType.array,!0);else if(e?.has("nextBatch"))this._encryptedBatch=e.get("nextBatch",se.BSONType.array,!0);else throw new cs.MongoUnexpectedServerResponseError("Cursor document did not contain a batch");return this._encryptedBatch}get batch(){if(this._batch!=null)return this._batch;let e=this.cursor;if(e.has("firstBatch"))this._batch=e.get("firstBatch",se.BSONType.array,!0);else if(e.has("nextBatch"))this._batch=e.get("nextBatch",se.BSONType.array,!0);else throw new cs.MongoUnexpectedServerResponseError("Cursor document did not contain a batch");return this._batch}get batchSize(){return this.batch?.size()}get postBatchResumeToken(){return this.cursor.get("postBatchResumeToken",se.BSONType.object)?.toObject({promoteValues:!1,promoteLongs:!1,promoteBuffers:!1,validation:{utf8:!0}})??null}shift(e){if(this.iterated>=this.batchSize)return null;let t=this.batch.get(this.iterated,se.BSONType.object,!0)??null,r=this.encryptedBatch?.get(this.iterated,se.BSONType.object,!0)??null;if(this.iterated+=1,e?.raw)return t.toBytes();else{let n=t.toObject(e);if(r)Vd.decorateDecryptionResult(n,r.toObject(e),!0);return n}}clear(){this.iterated=this.batchSize}}e7.CursorResponse=ka;class X9 extends ka{constructor(){super(...arguments);this.isExplain=!0,this._length=1}get id(){return se.Long.fromBigInt(0n)}get batchSize(){return 0}get ns(){return null}get length(){return this._length}shift(e){if(this._length===0)return null;return this._length-=1,this.toObject(e)}}e7.ExplainedCursorResponse=X9;class Z9 extends ka{get insertedCount(){return this.get("nInserted",se.BSONType.int,!0)}get upsertedCount(){return this.get("nUpserted",se.BSONType.int,!0)}get matchedCount(){return this.get("nMatched",se.BSONType.int,!0)}get modifiedCount(){return this.get("nModified",se.BSONType.int,!0)}get deletedCount(){return this.get("nDeleted",se.BSONType.int,!0)}get writeConcernError(){return this.get("writeConcernError",se.BSONType.object,!1)}}e7.ClientBulkWriteCursorResponse=Z9});var pE=g(function(r7){Object.defineProperty(r7,"__esModule",{value:!0});r7.Explain=r7.ExplainVerbosity=void 0;r7.decorateWithExplain=joe;r7.ExplainVerbosity=Object.freeze({queryPlanner:"queryPlanner",queryPlannerExtended:"queryPlannerExtended",executionStats:"executionStats",allPlansExecution:"allPlansExecution"});class zd{constructor(e,t){if(typeof e==="boolean")this.verbosity=e?r7.ExplainVerbosity.allPlansExecution:r7.ExplainVerbosity.queryPlanner;else this.verbosity=e;this.maxTimeMS=t}static fromOptions({explain:e}={}){if(e==null)return;if(typeof e==="boolean"||typeof e==="string")return new zd(e);let{verbosity:t,maxTimeMS:r}=e;return new zd(t,r)}}r7.Explain=zd;function joe(e,t){let{verbosity:r,maxTimeMS:n}=t,s={explain:e,verbosity:r};if(typeof n==="number")s.maxTimeMS=n;return s}});var Mt=g(function(o7){Object.defineProperty(o7,"__esModule",{value:!0});o7.AbstractOperation=o7.Aspect=void 0;o7.defineAspects=Uoe;var s7=Se(),vc=Ur();o7.Aspect={READ_OPERATION:Symbol("READ_OPERATION"),WRITE_OPERATION:Symbol("WRITE_OPERATION"),RETRYABLE:Symbol("RETRYABLE"),EXPLAINABLE:Symbol("EXPLAINABLE"),SKIP_COLLATION:Symbol("SKIP_COLLATION"),CURSOR_CREATING:Symbol("CURSOR_CREATING"),MUST_SELECT_SAME_SERVER:Symbol("MUST_SELECT_SAME_SERVER"),COMMAND_BATCHING:Symbol("COMMAND_BATCHING"),SUPPORTS_RAW_DATA:Symbol("SUPPORTS_RAW_DATA")};class i7{constructor(e={}){this.readPreference=this.hasAspect(o7.Aspect.WRITE_OPERATION)?vc.ReadPreference.primary:vc.ReadPreference.fromOptions(e)??vc.ReadPreference.primary,this.bsonOptions=s7.resolveBSONOptions(e),this._session=e.session!=null?e.session:void 0,this.options=e,this.bypassPinningCheck=!!e.bypassPinningCheck,this.attemptsMade=0}hasAspect(e){let t=this.constructor;if(t.aspects==null)return!1;return t.aspects.has(e)}get session(){return this._session}set session(e){this._session=e}clearSession(){this._session=void 0}resetBatch(){return!0}get canRetryRead(){return this.hasAspect(o7.Aspect.RETRYABLE)&&this.hasAspect(o7.Aspect.READ_OPERATION)}get canRetryWrite(){return this.hasAspect(o7.Aspect.RETRYABLE)&&this.hasAspect(o7.Aspect.WRITE_OPERATION)}handleOk(e){return e.toObject(this.bsonOptions)}handleError(e){throw e}}o7.AbstractOperation=i7;function Uoe(e,t){if(!Array.isArray(t)&&!(t instanceof Set))t=[t];return t=new Set(t),Object.defineProperty(e,"aspects",{value:t,writable:!1}),t}});var nr=g(function(f7){Object.defineProperty(f7,"__esModule",{value:!0});f7.CommandOperation=void 0;var a7=zo(),c7=J(),Wd=pE(),l7=qi(),Ou=ae(),Kd=Hn(),ls=Mt();class h7 extends ls.AbstractOperation{constructor(e,t){super(t);this.options=t??{};let r=t?.dbName||t?.authdb;if(r)this.ns=new Ou.MongoDBNamespace(r,"$cmd");else this.ns=e?e.s.namespace.withCollection("$cmd"):new Ou.MongoDBNamespace("admin","$cmd");if(this.readConcern=l7.ReadConcern.fromOptions(t),this.writeConcern=Kd.WriteConcern.fromOptions(t),this.hasAspect(ls.Aspect.EXPLAINABLE))this.explain=Wd.Explain.fromOptions(t);else if(t?.explain!=null)throw new c7.MongoInvalidArgumentError('Option "explain" is not supported on this command')}get canRetryWrite(){if(this.hasAspect(ls.Aspect.EXPLAINABLE))return this.explain==null;return super.canRetryWrite}buildOptions(e){return{...this.options,...this.bsonOptions,timeoutContext:e,readPreference:this.readPreference,session:this.session}}buildCommand(e,t){let r=this.buildCommandDocument(e,t),n=this.session&&this.session.inTransaction();if(this.readConcern&&Ou.commandSupportsReadConcern(r)&&!n)Object.assign(r,{readConcern:this.readConcern});if(this.writeConcern&&this.hasAspect(ls.Aspect.WRITE_OPERATION)&&!n)Kd.WriteConcern.apply(r,this.writeConcern);if(this.options.collation&&typeof this.options.collation==="object"&&!this.hasAspect(ls.Aspect.SKIP_COLLATION))Object.assign(r,{collation:this.options.collation});if(typeof this.options.maxTimeMS==="number")r.maxTimeMS=this.options.maxTimeMS;if(this.options.rawData!=null&&this.hasAspect(ls.Aspect.SUPPORTS_RAW_DATA)&&Ou.maxWireVersion(e)>=a7.MIN_SUPPORTED_RAW_DATA_WIRE_VERSION)r.rawData=this.options.rawData;if(this.hasAspect(ls.Aspect.EXPLAINABLE)&&this.explain)return Wd.decorateWithExplain(r,this.explain);return r}}f7.CommandOperation=h7});var EE=g(function(g7){Object.defineProperty(g7,"__esModule",{value:!0});g7.DeleteManyOperation=g7.DeleteOneOperation=g7.DeleteOperation=void 0;g7.makeDeleteStatement=gE;var p7=Au(),m7=dt(),Su=J(),y7=nr(),St=Mt();class Th extends y7.CommandOperation{constructor(e,t,r,n){super(void 0,r);this.SERVER_COMMAND_RESPONSE_TYPE=m7.MongoDBResponse,this.options=r,this.ns=e,this.statements=t,this.serializedOperations=n}get commandName(){return"delete"}get canRetryWrite(){if(super.canRetryWrite===!1)return!1;return this.statements.every((e)=>e.limit!=null?e.limit>0:!0)}buildCommandDocument(e,t){let r=this.options,n=typeof r.ordered==="boolean"?r.ordered:!0,s={delete:this.ns.collection,deletes:this.serializedOperations?p7.makeDocumentSequence("deletes",this.statements,this.serializedOperations):this.statements,ordered:n};if(r.let)s.let=r.let;if(r.comment!==void 0)s.comment=r.comment;return s}}g7.DeleteOperation=Th;class mE extends Th{constructor(e,t,r){super(e,[gE(t,{...r,limit:1})],r)}handleOk(e){let t=super.handleOk(e);if(this.explain)return t;if(t.code)throw new Su.MongoServerError(t);if(t.writeErrors)throw new Su.MongoServerError(t.writeErrors[0]);return{acknowledged:this.writeConcern?.w!==0,deletedCount:t.n}}}g7.DeleteOneOperation=mE;class yE extends Th{constructor(e,t,r){super(e,[gE(t,r)],r)}handleOk(e){let t=super.handleOk(e);if(this.explain)return t;if(t.code)throw new Su.MongoServerError(t);if(t.writeErrors)throw new Su.MongoServerError(t.writeErrors[0]);return{acknowledged:this.writeConcern?.w!==0,deletedCount:t.n}}}g7.DeleteManyOperation=yE;function gE(e,t){let r={q:e,limit:typeof t.limit==="number"?t.limit:0};if(t.collation)r.collation=t.collation;if(t.hint)r.hint=t.hint;return r}St.defineAspects(Th,[St.Aspect.RETRYABLE,St.Aspect.WRITE_OPERATION,St.Aspect.SUPPORTS_RAW_DATA]);St.defineAspects(mE,[St.Aspect.RETRYABLE,St.Aspect.WRITE_OPERATION,St.Aspect.EXPLAINABLE,St.Aspect.SKIP_COLLATION,St.Aspect.SUPPORTS_RAW_DATA]);St.defineAspects(yE,[St.Aspect.WRITE_OPERATION,St.Aspect.EXPLAINABLE,St.Aspect.SKIP_COLLATION,St.Aspect.SUPPORTS_RAW_DATA])});var kc=g(function(S7){Object.defineProperty(S7,"__esModule",{value:!0});S7.DeprioritizedServers=S7.MIN_SECONDARY_WRITE_WIRE_VERSION=void 0;S7.writableServerSelector=Goe;S7.sameServerSelector=Yoe;S7.secondaryWritableServerSelector=Qoe;S7.readPreferenceServerSelector=wE;var ro=J(),Yd=Ur(),Kr=as(),Hoe=1e4,_7=90;S7.MIN_SECONDARY_WRITE_WIRE_VERSION=13;class O7{constructor(e){this.deprioritized=new Set;for(let t of e??[])this.add(t)}add({address:e}){this.deprioritized.add(e)}has({address:e}){return this.deprioritized.has(e)}}S7.DeprioritizedServers=O7;function OE(e,t){let r=e.filter((n)=>!t.has(n));return r.length?r:e}function Goe(){return function(t,r,n){let s=OE(r.filter(({isWritable:i})=>i),n);return Wo(t,s)}}function Yoe(e){return function(r,n,s){if(!e)return[];return n.filter((i)=>i.address===e.address&&i.type!==Kr.ServerType.Unknown)}}function Qoe(e,t){if(!t||!e||e&&e<S7.MIN_SECONDARY_WRITE_WIRE_VERSION)return wE(Yd.ReadPreference.primary);return wE(t)}function _E(e,t,r){if(e.maxStalenessSeconds==null||e.maxStalenessSeconds<0)return r;let n=e.maxStalenessSeconds,s=(t.heartbeatFrequencyMS+Hoe)/1000;if(n<s)throw new ro.MongoInvalidArgumentError(`Option "maxStalenessSeconds" must be at least ${s} seconds`);if(n<_7)throw new ro.MongoInvalidArgumentError(`Option "maxStalenessSeconds" must be at least ${_7} seconds`);if(t.type===Kr.TopologyType.ReplicaSetWithPrimary){let i=Array.from(t.servers.values()).filter(Gd)[0];return r.filter((o)=>{let a=(o.lastUpdateTime-o.lastWriteDate-(i.lastUpdateTime-i.lastWriteDate)+t.heartbeatFrequencyMS)/1000,c=e.maxStalenessSeconds??0;return a<=c})}if(t.type===Kr.TopologyType.ReplicaSetNoPrimary){if(r.length===0)return r;let i=r.reduce((o,u)=>u.lastWriteDate>o.lastWriteDate?u:o);return r.filter((o)=>{let a=(i.lastWriteDate-o.lastWriteDate+t.heartbeatFrequencyMS)/1000,c=e.maxStalenessSeconds??0;return a<=c})}return r}function Joe(e,t){return Object.entries(e).every(([r,n])=>t[r]!=null&&t[r]===n)}function AE({tags:e},t){if(e==null||e.length===0)return t;for(let r of e){let n=t.filter((s)=>Joe(r,s.tags));if(n.length)return n}return[]}function Wo(e,t){let r=t.reduce((s,i)=>Math.min(i.roundTripTime,s),1/0),n=r+e.localThresholdMS;return t.filter((s)=>s.roundTripTime<=n&&s.roundTripTime>=r)}function Gd(e){return e.type===Kr.ServerType.RSPrimary}function A7(e){return e.type===Kr.ServerType.RSSecondary}function Xoe(e){return e.type===Kr.ServerType.RSSecondary||e.type===Kr.ServerType.RSPrimary}function w7(e){return e.type!==Kr.ServerType.Unknown}function Zoe(e){return e.type===Kr.ServerType.LoadBalancer}function Hd(e){return(t)=>!e.has(t)}function eue(e,t,r,n){let s=e.mode;switch(s){case"primary":return r.filter(Gd);case"primaryPreferred":{let i=r.filter(Gd),o=i.filter(Hd(n));if(o.length)return o;let u=AE(e,_E(e,t,r.filter(A7))),a=u.filter(Hd(n));if(a.length)return Wo(t,a);return i.length?i:Wo(t,u)}case"nearest":{let i=OE(AE(e,_E(e,t,r.filter(Xoe))),n);return Wo(t,i)}case"secondary":case"secondaryPreferred":{let i=AE(e,_E(e,t,r.filter(A7))),o=i.filter(Hd(n));if(o.length)return Wo(t,o);if(s===Yd.ReadPreference.SECONDARY_PREFERRED){let u=r.filter(Gd),a=u.filter(Hd(n));if(a.length)return a;return i.length?Wo(t,i):u}return Wo(t,i)}default:{let i=s;throw new ro.MongoRuntimeError(`unexpected readPreference=${s} (should never happen). Please report a bug in the Node driver Jira project.`)}}}function wE(e){if(!e.isValid())throw new ro.MongoInvalidArgumentError("Invalid read preference specified");return function(r,n,s){switch(r.type){case"Single":return Wo(r,n.filter(w7));case"ReplicaSetNoPrimary":case"ReplicaSetWithPrimary":return eue(e,r,n,s);case"Sharded":{let i=OE(n,s);return Wo(r,i.filter(w7))}case"Unknown":return[];case"LoadBalanced":return n.filter(Zoe);default:{let i=r.type;throw new ro.MongoRuntimeError(`unexpected topology type: ${r.type} (this should never happen). Please file a bug in the Node driver Jira project.`)}}}}});var Gn=g(function(D7){Object.defineProperty(D7,"__esModule",{value:!0});D7.LegacyTimeoutContext=D7.CSOTTimeoutContext=D7.TimeoutContext=D7.Timeout=D7.TimeoutError=void 0;var Qd=L("timers"),hs=J(),qc=ae();class Jd extends Error{get name(){return"TimeoutError"}constructor(e,t){super(e,t);this.duration=t.duration}static is(e){return e!=null&&typeof e==="object"&&"name"in e&&e.name==="TimeoutError"}}D7.TimeoutError=Jd;class Bs extends Promise{get remainingTime(){if(this.timedOut)return 0;if(this.duration===0)return 1/0;return this.start+this.duration-Math.trunc(performance.now())}get timeElapsed(){return Math.trunc(performance.now())-this.start}constructor(e=()=>null,t){let r=t?.duration??0,n=!!t?.unref,s=t?.rejection;if(r<0)throw new hs.MongoInvalidArgumentError("Cannot create a Timeout with a negative duration");let i;super((o,u)=>{i=u,e(qc.noop,u)});if(this.ended=null,this.timedOut=!1,this.cleared=!1,this.duration=r,this.start=Math.trunc(performance.now()),s==null&&this.duration>0){if(this.id=Qd.setTimeout(()=>{this.ended=Math.trunc(performance.now()),this.timedOut=!0,i(new Jd(`Expired after ${r}ms`,{duration:r}))},this.duration),typeof this.id.unref==="function"&&n)this.id.unref()}else if(s!=null)this.ended=Math.trunc(performance.now()),this.timedOut=!0,i(s)}clear(){Qd.clearTimeout(this.id),this.id=void 0,this.timedOut=!1,this.cleared=!0}throwIfExpired(){if(this.timedOut)throw this.then(void 0,qc.squashError),new Jd("Timed out",{duration:this.duration})}static expires(e,t){return new Bs(void 0,{duration:e,unref:t})}static reject(e){return new Bs(void 0,{duration:0,unref:!0,rejection:e})}}D7.Timeout=Bs;function iue(e){return e!=null&&typeof e==="object"&&"serverSelectionTimeoutMS"in e&&typeof e.serverSelectionTimeoutMS==="number"&&"waitQueueTimeoutMS"in e&&typeof e.waitQueueTimeoutMS==="number"}class Zd{static create(e){if(e.session?.timeoutContext!=null)return e.session?.timeoutContext;if(iue(e))return new ep(e);else throw new hs.MongoRuntimeError("Unrecognized options")}}D7.TimeoutContext=Zd;class Xd extends Zd{constructor(e){super();this.minRoundTripTime=0,this.start=Math.trunc(performance.now()),this.timeoutMS=e.timeoutMS,this.serverSelectionTimeoutMS=e.serverSelectionTimeoutMS,this.socketTimeoutMS=e.socketTimeoutMS,this.clearServerSelectionTimeout=!1}get maxTimeMS(){return this.remainingTimeMS-this.minRoundTripTime}get remainingTimeMS(){let e=Math.trunc(performance.now())-this.start;return this.timeoutMS<=0?1/0:this.timeoutMS-e}csotEnabled(){return!0}get serverSelectionTimeout(){if(typeof this._serverSelectionTimeout!=="object"||this._serverSelectionTimeout?.cleared){let{remainingTimeMS:e,serverSelectionTimeoutMS:t}=this;if(e<=0)return Bs.reject(new hs.MongoOperationTimeoutError(`Timed out in server selection after ${this.timeoutMS}ms`));if(t!==0&&qc.csotMin(e,t)===t)this._serverSelectionTimeout=Bs.expires(t);else if(e>0&&Number.isFinite(e))this._serverSelectionTimeout=Bs.expires(e);else this._serverSelectionTimeout=null}return this._serverSelectionTimeout}get connectionCheckoutTimeout(){if(typeof this._connectionCheckoutTimeout!=="object"||this._connectionCheckoutTimeout?.cleared)if(typeof this._serverSelectionTimeout==="object")this._connectionCheckoutTimeout=this._serverSelectionTimeout;else throw new hs.MongoRuntimeError("Unreachable. If you are seeing this error, please file a ticket on the NODE driver project on Jira");return this._connectionCheckoutTimeout}get timeoutForSocketWrite(){let{remainingTimeMS:e}=this;if(!Number.isFinite(e))return null;if(e>0)return Bs.expires(e);return Bs.reject(new hs.MongoOperationTimeoutError("Timed out before socket write"))}get timeoutForSocketRead(){let{remainingTimeMS:e}=this;if(!Number.isFinite(e))return null;if(e>0)return Bs.expires(e);return Bs.reject(new hs.MongoOperationTimeoutError("Timed out before socket read"))}refresh(){this.start=Math.trunc(performance.now()),this.minRoundTripTime=0,this._serverSelectionTimeout?.clear(),this._connectionCheckoutTimeout?.clear()}clear(){this._serverSelectionTimeout?.clear(),this._connectionCheckoutTimeout?.clear()}getRemainingTimeMSOrThrow(e){let{remainingTimeMS:t}=this;if(t<=0)throw new hs.MongoOperationTimeoutError(e??`Expired after ${this.timeoutMS}ms`);return t}clone(){let e=new Xd({timeoutMS:this.timeoutMS,serverSelectionTimeoutMS:this.serverSelectionTimeoutMS});return e.start=this.start,e}refreshed(){return new Xd(this)}addMaxTimeMSToCommand(e,t){if(t.omitMaxTimeMS)return;let r=this.remainingTimeMS-this.minRoundTripTime;if(r>0&&Number.isFinite(r))e.maxTimeMS=r}getSocketTimeoutMS(){return 0}}D7.CSOTTimeoutContext=Xd;class ep extends Zd{constructor(e){super();this.options=e,this.clearServerSelectionTimeout=!0}csotEnabled(){return!1}get serverSelectionTimeout(){if(this.options.serverSelectionTimeoutMS!=null&&this.options.serverSelectionTimeoutMS>0)return Bs.expires(this.options.serverSelectionTimeoutMS);return null}get connectionCheckoutTimeout(){if(this.options.waitQueueTimeoutMS!=null&&this.options.waitQueueTimeoutMS>0)return Bs.expires(this.options.waitQueueTimeoutMS);return null}get timeoutForSocketWrite(){return null}get timeoutForSocketRead(){return null}refresh(){return}clear(){return}get maxTimeMS(){return null}refreshed(){return new ep(this.options)}addMaxTimeMSToCommand(e,t){}getSocketTimeoutMS(){return this.options.socketTimeoutMS}}D7.LegacyTimeoutContext=ep});var Mh=g(function(F7){Object.defineProperty(F7,"__esModule",{value:!0});F7.AggregateOperation=F7.DB_AGGREGATE_COLLECTION=void 0;var jc=dt(),M7=J(),x7=Hn(),P7=nr(),Gs=Mt();F7.DB_AGGREGATE_COLLECTION=1;class SE extends P7.CommandOperation{constructor(e,t,r){super(void 0,{...r,dbName:e.db});if(this.SERVER_COMMAND_RESPONSE_TYPE=jc.CursorResponse,this.options={...r},this.target=e.collection||F7.DB_AGGREGATE_COLLECTION,this.pipeline=t,this.hasWriteStage=!1,typeof r?.out==="string")this.pipeline=this.pipeline.concat({$out:r.out}),this.hasWriteStage=!0;else if(t.length>0){let n=t[t.length-1];if(n.$out||n.$merge)this.hasWriteStage=!0}if(!this.hasWriteStage)delete this.options.writeConcern;if(r?.cursor!=null&&typeof r.cursor!=="object")throw new M7.MongoInvalidArgumentError("Cursor options must be an object");this.SERVER_COMMAND_RESPONSE_TYPE=this.explain?jc.ExplainedCursorResponse:jc.CursorResponse}get commandName(){return"aggregate"}get canRetryRead(){return!this.hasWriteStage}addToPipeline(e){this.pipeline.push(e)}buildCommandDocument(){let e=this.options,t={aggregate:this.target,pipeline:this.pipeline};if(this.hasWriteStage&&this.writeConcern)x7.WriteConcern.apply(t,this.writeConcern);if(e.bypassDocumentValidation===!0)t.bypassDocumentValidation=e.bypassDocumentValidation;if(typeof e.allowDiskUse==="boolean")t.allowDiskUse=e.allowDiskUse;if(e.hint)t.hint=e.hint;if(e.let)t.let=e.let;if(e.comment!==void 0)t.comment=e.comment;if(t.cursor=e.cursor||{},e.batchSize&&!this.hasWriteStage)t.cursor.batchSize=e.batchSize;return t}handleOk(e){return e}}F7.AggregateOperation=SE;Gs.defineAspects(SE,[Gs.Aspect.READ_OPERATION,Gs.Aspect.RETRYABLE,Gs.Aspect.EXPLAINABLE,Gs.Aspect.CURSOR_CREATING,Gs.Aspect.SUPPORTS_RAW_DATA])});var Lc=g(function(R7){Object.defineProperty(R7,"__esModule",{value:!0});R7.RunCursorCommandOperation=R7.RunCommandOperation=void 0;var tp=dt(),I7=Mt();class CE extends I7.AbstractOperation{constructor(e,t,r){super(r);this.SERVER_COMMAND_RESPONSE_TYPE=tp.MongoDBResponse,this.command=t,this.options=r,this.ns=e.withCollection("$cmd")}get commandName(){return"runCommand"}buildCommand(e,t){return this.command}buildOptions(e){return{...this.options,session:this.session,timeoutContext:e,signal:this.options.signal,readPreference:this.options.readPreference}}}R7.RunCommandOperation=CE;class $7 extends CE{constructor(){super(...arguments);this.SERVER_COMMAND_RESPONSE_TYPE=tp.CursorResponse}handleOk(e){return e}}R7.RunCursorCommandOperation=$7});var Hr=g(function(W7){Object.defineProperty(W7,"__esModule",{value:!0});W7.BASE_BACKOFF_MS=void 0;W7.executeOperation=fue;W7.autoConnect=V7;W7.calculateBaseBackoffMS=z7;var q7=L("timers/promises"),j7=zo(),xe=J(),rp=Ur(),L7=as(),Cu=kc(),U7=Gn(),bu=ae(),np=Mh(),Fr=Mt(),sp=Lc(),hue=xe.MONGODB_ERROR_CODES.IllegalOperation,k7="This MongoDB deployment does not support retryable writes. Please add retryWrites=false to your connection string.";async function fue(e,t,r){if(!(t instanceof Fr.AbstractOperation))throw new xe.MongoRuntimeError("This method requires a valid operation instance");let n=e.topology==null?await bu.abortable(V7(e),t.options):e.topology,s=t.session,i;if(s==null)i=Symbol(),s=e.startSession({owner:i,explicit:!1});else if(s.hasEnded)throw new xe.MongoExpiredSessionError("Use of expired sessions is not permitted");else if(s.snapshotEnabled&&bu.maxWireVersion(n)<j7.MIN_SUPPORTED_SNAPSHOT_READS_WIRE_VERSION)throw new xe.MongoCompatibilityError("Snapshot reads require MongoDB 5.0 or later");else if(s.client!==e)throw new xe.MongoInvalidArgumentError("ClientSession must be from the same MongoClient");t.session??=s;let o=t.readPreference??rp.ReadPreference.primary,u=!!s?.inTransaction(),a=t.hasAspect(Fr.Aspect.READ_OPERATION);if(u&&!o.equals(rp.ReadPreference.primary)&&(a||t.commandName==="runCommand"))throw new xe.MongoTransactionError(`Read preference in a transaction must be primary, not: ${o.mode}`);if(s?.isPinned&&s.transaction.isCommitted&&!t.bypassPinningCheck)s.unpin();r??=U7.TimeoutContext.create({session:s,serverSelectionTimeoutMS:e.s.options.serverSelectionTimeoutMS,waitQueueTimeoutMS:e.s.options.waitQueueTimeoutMS,timeoutMS:t.options.timeoutMS});try{return await pue(t,{topology:n,timeoutContext:r,session:s,readPreference:o})}finally{if(s?.owner!=null&&s.owner===i)await s.endSession()}}async function V7(e){if(e.topology==null){if(e.s.hasBeenClosed)throw new xe.MongoNotConnectedError("Client must be connected before running operations");e.s.options.__skipPingOnConnect=!0;try{if(await e.connect(),e.topology==null)throw new xe.MongoRuntimeError("client.connect did not create a topology but also did not throw");return e.topology}finally{delete e.s.options.__skipPingOnConnect}}return e.topology}W7.BASE_BACKOFF_MS=100;var due=1e4;function z7(e){if(!(e instanceof xe.MongoServerError))return W7.BASE_BACKOFF_MS;let t=e.errorResponse.baseBackoffMS,n=typeof t==="number"||typeof t==="bigint"||typeof t==="object"?Number(t):NaN;return Number.isFinite(n)&&n>0?n:W7.BASE_BACKOFF_MS}async function pue(e,{topology:t,timeoutContext:r,session:n,readPreference:s}){let i;if(e.hasAspect(Fr.Aspect.MUST_SELECT_SAME_SERVER))i=Cu.sameServerSelector(e.server?.description);else if(e instanceof np.AggregateOperation&&e.hasWriteStage)i=Cu.secondaryWritableServerSelector(t.commonWireVersion,s);else i=s;let o=await t.selectServer(i,{session:n,operationName:e.commandName,timeoutContext:r,signal:e.options.signal,deprioritizedServers:new Cu.DeprioritizedServers}),u=e.hasAspect(Fr.Aspect.READ_OPERATION),a=e.hasAspect(Fr.Aspect.WRITE_OPERATION),c=n?.inTransaction()??!1,l=t.s.options.retryReads&&!c&&e.canRetryRead,f=t.s.options.retryWrites&&!c&&bu.supportsRetryableWrites(o)&&e.canRetryWrite,h=e.hasAspect(Fr.Aspect.RETRYABLE)&&n!=null&&(u&&l||a&&f);if(a&&f&&n!=null)e.options.willRetryWrite=!0,n.incrementTransactionNumber();let d=new Cu.DeprioritizedServers,p=typeof e.maxAttempts==="number"?e.maxAttempts:h?r.csotEnabled()?1/0:2:1,m=null;for(let y=0;y<p;y++){e.attemptsMade=y+1,e.server=o;try{try{let _=await o.command(e,r);return e.handleOk(_)}catch(_){return e.handleError(_)}}catch(_){if(!(_ instanceof xe.MongoError))throw _;if(m==null)m=_;else if(!_.hasErrorLabel(xe.MongoErrorLabel.NoWritesPerformed))m=_;if(r.clear(),a&&_.code===hue)throw new xe.MongoServerError({message:k7,errmsg:k7,originalError:_});if(!E(e,_))throw m;if(_.hasErrorLabel(xe.MongoErrorLabel.SystemOverloadedError)){let w=t.s.options.maxAdaptiveRetries+1;p=Math.min(w,e.maxAttempts??w)}if(y+1>=p)throw m;if(_ instanceof xe.MongoNetworkError&&e.hasAspect(Fr.Aspect.CURSOR_CREATING)&&n!=null&&n.isPinned&&!n.inTransaction())n.unpin({force:!0,forceClear:!0});if(_.hasErrorLabel(xe.MongoErrorLabel.SystemOverloadedError)&&e.hasAspect(Fr.Aspect.CURSOR_CREATING)&&n!=null&&n.isPinned&&!n.inTransaction())n.unpin({force:!0});if(_.hasErrorLabel(xe.MongoErrorLabel.SystemOverloadedError)){let w=z7(_),C=Math.random()*Math.min(due,w*2**(y+1));if(r.csotEnabled()&&C>r.remainingTimeMS)throw m;await q7.setTimeout(C)}if(t.description.type===L7.TopologyType.Sharded||_.hasErrorLabel(xe.MongoErrorLabel.SystemOverloadedError)&&t.s.options.enableOverloadRetargeting)d.add(o.description);if(o=await t.selectServer(i,{session:n,operationName:e.commandName,deprioritizedServers:d,signal:e.options.signal}),a&&!bu.supportsRetryableWrites(o)&&!_.hasErrorLabel(xe.MongoErrorLabel.SystemOverloadedError))throw new xe.MongoUnexpectedServerResponseError("Selected server does not support retryable writes");if(e.hasAspect(Fr.Aspect.COMMAND_BATCHING))e.resetBatch()}}throw m??new xe.MongoRuntimeError("Should never happen: operation execution loop terminated but no error was recorded.");function E(y,_){if(_.hasErrorLabel(xe.MongoErrorLabel.SystemOverloadedError)&&_.hasErrorLabel(xe.MongoErrorLabel.RetryableError)){if(y instanceof sp.RunCommandOperation)return t.s.options.retryReads&&t.s.options.retryWrites;if(y instanceof np.AggregateOperation&&y.hasWriteStage)return t.s.options.retryWrites;let w=u&&t.s.options.retryReads,C=a&&t.s.options.retryWrites;return w||C}if(y instanceof sp.RunCommandOperation)return!1;if(y.hasAspect(Fr.Aspect.COMMAND_BATCHING))return y.canRetryWrite&&xe.isRetryableWriteError(_);return a&&f&&xe.isRetryableWriteError(_)||u&&l&&xe.isRetryableReadError(_)}}});var DE=g(function(Q7){Object.defineProperty(Q7,"__esModule",{value:!0});Q7.InsertOneOperation=Q7.InsertOperation=void 0;var K7=Au(),H7=dt(),op=J(),G7=ae(),Y7=nr(),bn=Mt();class up extends Y7.CommandOperation{constructor(e,t,r,n){super(void 0,r);this.SERVER_COMMAND_RESPONSE_TYPE=H7.MongoDBResponse,this.options={...r,checkKeys:r.checkKeys??!1},this.ns=e,this.documents=t,this.serializedOperations=n}get commandName(){return"insert"}buildCommandDocument(e,t){let r=this.options??{},n=typeof r.ordered==="boolean"?r.ordered:!0,s={insert:this.ns.collection,documents:this.serializedOperations?K7.makeDocumentSequence("documents",this.documents,this.serializedOperations):this.documents,ordered:n};if(typeof r.bypassDocumentValidation==="boolean")s.bypassDocumentValidation=r.bypassDocumentValidation;if(r.comment!==void 0)s.comment=r.comment;return s}}Q7.InsertOperation=up;class bE extends up{constructor(e,t,r){super(e.s.namespace,[G7.maybeAddIdToDocuments(e,t,r)],r)}handleOk(e){let t=super.handleOk(e);if(t.code)throw new op.MongoServerError(t);if(t.writeErrors)throw new op.MongoServerError(t.writeErrors[0]);return{acknowledged:this.writeConcern?.w!==0,insertedId:this.documents[0]._id}}}Q7.InsertOneOperation=bE;bn.defineAspects(up,[bn.Aspect.RETRYABLE,bn.Aspect.WRITE_OPERATION,bn.Aspect.SUPPORTS_RAW_DATA]);bn.defineAspects(bE,[bn.Aspect.RETRYABLE,bn.Aspect.WRITE_OPERATION,bn.Aspect.SUPPORTS_RAW_DATA])});var Vc=g(function(X7){Object.defineProperty(X7,"__esModule",{value:!0});X7.formatSort=xue;var ap=J();function Uc(e=1){let t=`${e}`.toLowerCase();if(_ue(e))return e;switch(t){case"ascending":case"asc":case"1":return 1;case"descending":case"desc":case"-1":return-1;default:throw new ap.MongoInvalidArgumentError(`Invalid sort direction: ${JSON.stringify(e)}`)}}function _ue(e){return typeof e==="object"&&e!=null&&"$meta"in e&&typeof e.$meta==="string"}function Aue(e){if(Array.isArray(e)&&e.length===2)try{return Uc(e[1]),!0}catch{return!1}return!1}function wue(e){return Array.isArray(e)&&Array.isArray(e[0])}function Oue(e){return e instanceof Map&&e.size>0}function Sue(e){return Array.isArray(e)}function Cue(e){return new Map([[`${e[0]}`,Uc(e[1])]])}function bue(e){let t=e.map(([r,n])=>[`${r}`,Uc(n)]);return new Map(t)}function Due(e){let t=e.map((r)=>[`${r}`,1]);return new Map(t)}function Tue(e){let t=Object.entries(e).map(([r,n])=>[`${r}`,Uc(n)]);return new Map(t)}function Mue(e){let t=Array.from(e).map(([r,n])=>[`${r}`,Uc(n)]);return new Map(t)}function xue(e,t){if(e==null)return;if(typeof e==="string")return new Map([[e,Uc(t)]]);if(typeof e!=="object")throw new ap.MongoInvalidArgumentError(`Invalid sort format: ${JSON.stringify(e)} Sort must be a valid object`);if(!Sue(e)){if(Oue(e))return Mue(e);if(Object.keys(e).length)return Tue(e);return}if(!e.length)return;if(wue(e))return bue(e);if(Aue(e))return Cue(e);return Due(e)}});var PE=g(function(n8){Object.defineProperty(n8,"__esModule",{value:!0});n8.ReplaceOneOperation=n8.UpdateManyOperation=n8.UpdateOneOperation=n8.UpdateOperation=void 0;n8.makeUpdateStatement=cp;var Z7=Au(),e8=dt(),ar=J(),t8=Vc(),zc=ae(),r8=nr(),qe=Mt();class Wc extends r8.CommandOperation{constructor(e,t,r,n){super(void 0,r);this.SERVER_COMMAND_RESPONSE_TYPE=e8.MongoDBResponse,this.options=r,this.ns=e,this.statements=t,this.serializedOperations=n}get commandName(){return"update"}get canRetryWrite(){if(super.canRetryWrite===!1)return!1;return this.statements.every((e)=>e.multi==null||e.multi===!1)}buildCommandDocument(e,t){let r=this.options,n={update:this.ns.collection,updates:this.serializedOperations?Z7.makeDocumentSequence("updates",this.statements,this.serializedOperations):this.statements,ordered:r.ordered??!0};if(typeof r.bypassDocumentValidation==="boolean")n.bypassDocumentValidation=r.bypassDocumentValidation;if(r.let)n.let=r.let;if(r.comment!==void 0)n.comment=r.comment;return n}}n8.UpdateOperation=Wc;class TE extends Wc{constructor(e,t,r,n){super(e,[cp(t,r,{...n,multi:!1})],n);if(!zc.hasAtomicOperators(r,n))throw new ar.MongoInvalidArgumentError("Update document requires atomic operators")}handleOk(e){let t=super.handleOk(e);if(this.explain!=null)return t;if(t.code)throw new ar.MongoServerError(t);if(t.writeErrors)throw new ar.MongoServerError(t.writeErrors[0]);return{acknowledged:this.writeConcern?.w!==0,modifiedCount:t.nModified??t.n,upsertedId:Array.isArray(t.upserted)&&t.upserted.length>0?t.upserted[0]._id:null,upsertedCount:Array.isArray(t.upserted)&&t.upserted.length?t.upserted.length:0,matchedCount:Array.isArray(t.upserted)&&t.upserted.length>0?0:t.n}}}n8.UpdateOneOperation=TE;class ME extends Wc{constructor(e,t,r,n){super(e,[cp(t,r,{...n,multi:!0})],n);if(!zc.hasAtomicOperators(r,n))throw new ar.MongoInvalidArgumentError("Update document requires atomic operators")}handleOk(e){let t=super.handleOk(e);if(this.explain!=null)return t;if(t.code)throw new ar.MongoServerError(t);if(t.writeErrors)throw new ar.MongoServerError(t.writeErrors[0]);return{acknowledged:this.writeConcern?.w!==0,modifiedCount:t.nModified??t.n,upsertedId:Array.isArray(t.upserted)&&t.upserted.length>0?t.upserted[0]._id:null,upsertedCount:Array.isArray(t.upserted)&&t.upserted.length?t.upserted.length:0,matchedCount:Array.isArray(t.upserted)&&t.upserted.length>0?0:t.n}}}n8.UpdateManyOperation=ME;class xE extends Wc{constructor(e,t,r,n){super(e,[cp(t,r,{...n,multi:!1})],n);if(zc.hasAtomicOperators(r))throw new ar.MongoInvalidArgumentError("Replacement document must not contain atomic operators")}handleOk(e){let t=super.handleOk(e);if(this.explain!=null)return t;if(t.code)throw new ar.MongoServerError(t);if(t.writeErrors)throw new ar.MongoServerError(t.writeErrors[0]);return{acknowledged:this.writeConcern?.w!==0,modifiedCount:t.nModified??t.n,upsertedId:Array.isArray(t.upserted)&&t.upserted.length>0?t.upserted[0]._id:null,upsertedCount:Array.isArray(t.upserted)&&t.upserted.length?t.upserted.length:0,matchedCount:Array.isArray(t.upserted)&&t.upserted.length>0?0:t.n}}}n8.ReplaceOneOperation=xE;function cp(e,t,r){if(e==null||typeof e!=="object")throw new ar.MongoInvalidArgumentError("Selector must be a valid JavaScript object");if(t==null||typeof t!=="object")throw new ar.MongoInvalidArgumentError("Document must be a valid JavaScript object");let n={q:e,u:t};if(typeof r.upsert==="boolean")n.upsert=r.upsert;if(r.multi)n.multi=r.multi;if(r.hint)n.hint=r.hint;if(r.arrayFilters)n.arrayFilters=r.arrayFilters;if(r.collation)n.collation=r.collation;if(!r.multi&&r.sort!=null)n.sort=t8.formatSort(r.sort);return n}qe.defineAspects(Wc,[qe.Aspect.RETRYABLE,qe.Aspect.WRITE_OPERATION,qe.Aspect.SKIP_COLLATION,qe.Aspect.SUPPORTS_RAW_DATA]);qe.defineAspects(TE,[qe.Aspect.RETRYABLE,qe.Aspect.WRITE_OPERATION,qe.Aspect.EXPLAINABLE,qe.Aspect.SKIP_COLLATION,qe.Aspect.SUPPORTS_RAW_DATA]);qe.defineAspects(ME,[qe.Aspect.WRITE_OPERATION,qe.Aspect.EXPLAINABLE,qe.Aspect.SKIP_COLLATION,qe.Aspect.SUPPORTS_RAW_DATA]);qe.defineAspects(xE,[qe.Aspect.RETRYABLE,qe.Aspect.WRITE_OPERATION,qe.Aspect.SKIP_COLLATION,qe.Aspect.SUPPORTS_RAW_DATA])});var Hc=g(function(f8){Object.defineProperty(f8,"__esModule",{value:!0});f8.BulkOperationBase=f8.FindOperators=f8.MongoBulkWriteError=f8.WriteError=f8.WriteConcernError=f8.BulkWriteResult=f8.Batch=f8.BatchType=void 0;f8.mergeBatchResults=FE;var fp=Se(),We=J(),no=EE(),o8=Hr(),u8=DE(),fs=PE(),a8=Gn(),Br=ae(),lp=Hn();f8.BatchType=Object.freeze({INSERT:1,UPDATE:2,DELETE:3});class c8{constructor(e,t){this.originalZeroIndex=t,this.currentIndex=0,this.originalIndexes=[],this.batchType=e,this.operations=[],this.serializedOperations=[],this.size=0,this.sizeBytes=0}}f8.Batch=c8;class Ko{static generateIdMap(e){let t={};for(let r of e)t[r.index]=r._id;return t}constructor(e,t){this.result=e,this.insertedCount=this.result.nInserted??0,this.matchedCount=this.result.nMatched??0,this.modifiedCount=this.result.nModified??0,this.deletedCount=this.result.nRemoved??0,this.upsertedCount=this.result.upserted.length??0,this.upsertedIds=Ko.generateIdMap(this.result.upserted),this.insertedIds=Ko.generateIdMap(this.getSuccessfullyInsertedIds(e,t)),Object.defineProperty(this,"result",{value:this.result,enumerable:!1})}get ok(){return this.result.ok}getSuccessfullyInsertedIds(e,t){if(e.writeErrors.length===0)return e.insertedIds;if(t)return e.insertedIds.slice(0,e.writeErrors[0].index);return e.insertedIds.filter(({index:r})=>!e.writeErrors.some((n)=>r===n.index))}getUpsertedIdAt(e){return this.result.upserted[e]}getRawResponse(){return this.result}hasWriteErrors(){return this.result.writeErrors.length>0}getWriteErrorCount(){return this.result.writeErrors.length}getWriteErrorAt(e){return e<this.result.writeErrors.length?this.result.writeErrors[e]:void 0}getWriteErrors(){return this.result.writeErrors}getWriteConcernError(){if(this.result.writeConcernErrors.length===0)return;else if(this.result.writeConcernErrors.length===1)return this.result.writeConcernErrors[0];else{let e="";for(let t=0;t<this.result.writeConcernErrors.length;t++){let r=this.result.writeConcernErrors[t];if(e=e+r.errmsg,t===0)e=e+" and "}return new Ph({errmsg:e,code:We.MONGODB_ERROR_CODES.WriteConcernTimeout})}}toString(){return`BulkWriteResult(${fp.EJSON.stringify(this.result)})`}isOk(){return this.result.ok===1}}f8.BulkWriteResult=Ko;class Ph{constructor(e){this.serverError=e}get code(){return this.serverError.code}get errmsg(){return this.serverError.errmsg}get errInfo(){return this.serverError.errInfo}toJSON(){return this.serverError}toString(){return`WriteConcernError(${this.errmsg})`}}f8.WriteConcernError=Ph;class hp{constructor(e){this.err=e}get code(){return this.err.code}get index(){return this.err.index}get errmsg(){return this.err.errmsg}get errInfo(){return this.err.errInfo}getOperation(){return this.err.op}toJSON(){return{code:this.err.code,index:this.err.index,errmsg:this.err.errmsg,op:this.err.op}}toString(){return`WriteError(${JSON.stringify(this.toJSON())})`}}f8.WriteError=hp;function FE(e,t,r,n){if(r)n=r;else if(n&&n.result)n=n.result;if(n==null)return;if(n.ok===0&&t.ok===1){t.ok=0;let i={index:0,code:n.code||0,errmsg:n.message,errInfo:n.errInfo,op:e.operations[0]};t.writeErrors.push(new hp(i));return}else if(n.ok===0&&t.ok===0)return;if(h8(e)&&n.n)t.nInserted=t.nInserted+n.n;if(NE(e)&&n.n)t.nRemoved=t.nRemoved+n.n;let s=0;if(Array.isArray(n.upserted)){s=n.upserted.length;for(let i=0;i<n.upserted.length;i++)t.upserted.push({index:n.upserted[i].index+e.originalZeroIndex,_id:n.upserted[i]._id})}else if(n.upserted)s=1,t.upserted.push({index:e.originalZeroIndex,_id:n.upserted});if(BE(e)&&n.n){let i=n.nModified;if(t.nUpserted=t.nUpserted+s,t.nMatched=t.nMatched+(n.n-s),typeof i==="number")t.nModified=t.nModified+i;else t.nModified=0}if(Array.isArray(n.writeErrors))for(let i=0;i<n.writeErrors.length;i++){let o={index:e.originalIndexes[n.writeErrors[i].index],code:n.writeErrors[i].code,errmsg:n.writeErrors[i].errmsg,errInfo:n.writeErrors[i].errInfo,op:e.operations[n.writeErrors[i].index]};t.writeErrors.push(new hp(o))}if(n.writeConcernError)t.writeConcernErrors.push(new Ph(n.writeConcernError))}async function i8(e,t){if(e.s.batches.length===0)return new Ko(e.s.bulkResult,e.isOrdered);for(let n of e.s.batches){let s=Br.resolveOptions(e,{...t,ordered:e.isOrdered});if(s.bypassDocumentValidation!==!0)delete s.bypassDocumentValidation;if(e.s.bypassDocumentValidation===!0)s.bypassDocumentValidation=!0;if(e.s.checkKeys===!1)s.checkKeys=!1;if(e.retryWrites){if(BE(n))e.retryWrites=e.retryWrites&&!n.operations.some((h)=>h.multi);if(NE(n))e.retryWrites=e.retryWrites&&!n.operations.some((h)=>h.limit===0)}let i=e.s.bsonOptions,u=!e.s.usingAutoEncryption&&s.ignoreUndefined===i.ignoreUndefined&&s.serializeFunctions===i.serializeFunctions&&(s.checkKeys??!1)===e.s.checkKeys?n.serializedOperations:void 0,a=h8(n)?new u8.InsertOperation(e.s.namespace,n.operations,s,u):BE(n)?new fs.UpdateOperation(e.s.namespace,n.operations,s,u):NE(n)?new no.DeleteOperation(e.s.namespace,n.operations,s,u):null;if(a==null)throw new We.MongoRuntimeError(`Unknown batchType: ${n.batchType}`);let c=null,l;try{l=await o8.executeOperation(e.s.collection.client,a,s.timeoutContext)}catch(h){c=h}if(n.serializedOperations=[],c!=null)if(c instanceof We.MongoWriteConcernError){FE(n,e.s.bulkResult,c,l);let h=new Ko(e.s.bulkResult,e.isOrdered);throw new Kc({message:c.result.writeConcernError.errmsg,code:c.result.writeConcernError.code},h)}else throw new Kc(c,new Ko(e.s.bulkResult,e.isOrdered));FE(n,e.s.bulkResult,c,l);let f=new Ko(e.s.bulkResult,e.isOrdered);e.handleWriteError(f)}e.s.batches.length=0;let r=new Ko(e.s.bulkResult,e.isOrdered);return e.handleWriteError(r),r}class Kc extends We.MongoServerError{constructor(e,t){super(e);if(this.writeErrors=[],e instanceof Ph)this.err=e;else if(!(e instanceof Error))this.message=e.message,this.code=e.code,this.writeErrors=e.writeErrors??[];this.result=t,Object.assign(this,e)}get name(){return"MongoBulkWriteError"}get insertedCount(){return this.result.insertedCount}get matchedCount(){return this.result.matchedCount}get modifiedCount(){return this.result.modifiedCount}get deletedCount(){return this.result.deletedCount}get upsertedCount(){return this.result.upsertedCount}get insertedIds(){return this.result.insertedIds}get upsertedIds(){return this.result.upsertedIds}}f8.MongoBulkWriteError=Kc;class IE{constructor(e){this.bulkOperation=e}update(e){let t=xh(this.bulkOperation);return this.bulkOperation.addToOperationsList(f8.BatchType.UPDATE,fs.makeUpdateStatement(t.selector,e,{...t,multi:!0}))}updateOne(e){if(!Br.hasAtomicOperators(e,this.bulkOperation.bsonOptions))throw new We.MongoInvalidArgumentError("Update document requires atomic operators");let t=xh(this.bulkOperation);return this.bulkOperation.addToOperationsList(f8.BatchType.UPDATE,fs.makeUpdateStatement(t.selector,e,{...t,multi:!1}))}replaceOne(e){if(Br.hasAtomicOperators(e))throw new We.MongoInvalidArgumentError("Replacement document must not use atomic operators");let t=xh(this.bulkOperation);return this.bulkOperation.addToOperationsList(f8.BatchType.UPDATE,fs.makeUpdateStatement(t.selector,e,{...t,multi:!1}))}deleteOne(){let e=xh(this.bulkOperation);return this.bulkOperation.addToOperationsList(f8.BatchType.DELETE,no.makeDeleteStatement(e.selector,{...e,limit:1}))}delete(){let e=xh(this.bulkOperation);return this.bulkOperation.addToOperationsList(f8.BatchType.DELETE,no.makeDeleteStatement(e.selector,{...e,limit:0}))}upsert(){if(!this.bulkOperation.s.currentOp)this.bulkOperation.s.currentOp={};return this.bulkOperation.s.currentOp.upsert=!0,this}collation(e){if(!this.bulkOperation.s.currentOp)this.bulkOperation.s.currentOp={};return this.bulkOperation.s.currentOp.collation=e,this}arrayFilters(e){if(!this.bulkOperation.s.currentOp)this.bulkOperation.s.currentOp={};return this.bulkOperation.s.currentOp.arrayFilters=e,this}hint(e){if(!this.bulkOperation.s.currentOp)this.bulkOperation.s.currentOp={};return this.bulkOperation.s.currentOp.hint=e,this}}f8.FindOperators=IE;class l8{constructor(e,t,r){this.collection=e,this.retryWrites=e.db.options?.retryWrites,this.isOrdered=r;let n=Br.getTopology(e);t=t==null?{}:t;let s=e.s.namespace,i=!1,o=void 0,u=n.lastHello(),a=!!(n.s.options&&n.s.options.autoEncrypter),c=u&&u.maxBsonObjectSize?u.maxBsonObjectSize:16777216,l=a?2097152:c,f=u&&u.maxWriteBatchSize?u.maxWriteBatchSize:1000,h=(f-1).toString(10).length+2,d={ok:1,writeErrors:[],writeConcernErrors:[],insertedIds:[],nInserted:0,nUpserted:0,nMatched:0,nModified:0,nRemoved:0,upserted:[]};if(this.s={bulkResult:d,currentBatch:void 0,currentIndex:0,currentBatchSize:0,currentBatchSizeBytes:0,currentInsertBatch:void 0,currentUpdateBatch:void 0,currentRemoveBatch:void 0,batches:[],writeConcern:lp.WriteConcern.fromOptions(t),maxBsonObjectSize:c,maxBatchSizeBytes:l,maxWriteBatchSize:f,maxKeySize:h,namespace:s,topology:n,options:t,bsonOptions:fp.resolveBSONOptions(t),currentOp:o,executed:i,collection:e,err:void 0,checkKeys:typeof t.checkKeys==="boolean"?t.checkKeys:!1,usingAutoEncryption:a},t.bypassDocumentValidation===!0)this.s.bypassDocumentValidation=!0}insert(e){return Br.maybeAddIdToDocuments(this.collection,e,{forceServerObjectId:this.shouldForceServerObjectId()}),this.addToOperationsList(f8.BatchType.INSERT,e)}find(e){if(!e)throw new We.MongoInvalidArgumentError("Bulk find operation must specify a selector");return this.s.currentOp={selector:e},new IE(this)}raw(e){if(e==null||typeof e!=="object")throw new We.MongoInvalidArgumentError("Operation must be an object with an operation key");if("insertOne"in e){let t=this.shouldForceServerObjectId(),r=e.insertOne&&e.insertOne.document==null?e.insertOne:e.insertOne.document;return Br.maybeAddIdToDocuments(this.collection,r,{forceServerObjectId:t}),this.addToOperationsList(f8.BatchType.INSERT,r)}if("replaceOne"in e||"updateOne"in e||"updateMany"in e){if("replaceOne"in e){if("q"in e.replaceOne)throw new We.MongoInvalidArgumentError("Raw operations are not allowed");let t=fs.makeUpdateStatement(e.replaceOne.filter,e.replaceOne.replacement,{...e.replaceOne,multi:!1});if(Br.hasAtomicOperators(t.u))throw new We.MongoInvalidArgumentError("Replacement document must not use atomic operators");return this.addToOperationsList(f8.BatchType.UPDATE,t)}if("updateOne"in e){if("q"in e.updateOne)throw new We.MongoInvalidArgumentError("Raw operations are not allowed");let t=fs.makeUpdateStatement(e.updateOne.filter,e.updateOne.update,{...e.updateOne,multi:!1});if(!Br.hasAtomicOperators(t.u,this.bsonOptions))throw new We.MongoInvalidArgumentError("Update document requires atomic operators");return this.addToOperationsList(f8.BatchType.UPDATE,t)}if("updateMany"in e){if("q"in e.updateMany)throw new We.MongoInvalidArgumentError("Raw operations are not allowed");let t=fs.makeUpdateStatement(e.updateMany.filter,e.updateMany.update,{...e.updateMany,multi:!0});if(!Br.hasAtomicOperators(t.u,this.bsonOptions))throw new We.MongoInvalidArgumentError("Update document requires atomic operators");return this.addToOperationsList(f8.BatchType.UPDATE,t)}}if("deleteOne"in e){if("q"in e.deleteOne)throw new We.MongoInvalidArgumentError("Raw operations are not allowed");return this.addToOperationsList(f8.BatchType.DELETE,no.makeDeleteStatement(e.deleteOne.filter,{...e.deleteOne,limit:1}))}if("deleteMany"in e){if("q"in e.deleteMany)throw new We.MongoInvalidArgumentError("Raw operations are not allowed");return this.addToOperationsList(f8.BatchType.DELETE,no.makeDeleteStatement(e.deleteMany.filter,{...e.deleteMany,limit:0}))}throw new We.MongoInvalidArgumentError("bulkWrite only supports insertOne, updateOne, updateMany, deleteOne, deleteMany")}get length(){return this.s.currentIndex}get bsonOptions(){return this.s.bsonOptions}get writeConcern(){return this.s.writeConcern}get batches(){let e=[...this.s.batches];if(this.isOrdered){if(this.s.currentBatch)e.push(this.s.currentBatch)}else{if(this.s.currentInsertBatch)e.push(this.s.currentInsertBatch);if(this.s.currentUpdateBatch)e.push(this.s.currentUpdateBatch);if(this.s.currentRemoveBatch)e.push(this.s.currentRemoveBatch)}return e}async execute(e={}){if(this.s.executed)throw new We.MongoBatchReExecutionError;let t=lp.WriteConcern.fromOptions(e);if(t)this.s.writeConcern=t;if(this.isOrdered){if(this.s.currentBatch)this.s.batches.push(this.s.currentBatch)}else{if(this.s.currentInsertBatch)this.s.batches.push(this.s.currentInsertBatch);if(this.s.currentUpdateBatch)this.s.batches.push(this.s.currentUpdateBatch);if(this.s.currentRemoveBatch)this.s.batches.push(this.s.currentRemoveBatch)}if(this.s.batches.length===0)throw new We.MongoInvalidArgumentError("Invalid BulkOperation, Batch cannot be empty");this.s.executed=!0;let r=Br.resolveOptions(this.collection,{...this.s.options,...e});if(r.timeoutContext??=a8.TimeoutContext.create({session:r.session,timeoutMS:r.timeoutMS,serverSelectionTimeoutMS:this.collection.client.s.options.serverSelectionTimeoutMS,waitQueueTimeoutMS:this.collection.client.s.options.waitQueueTimeoutMS}),r.session==null)return await this.collection.client.withSession({explicit:!1},async(n)=>await i8(this,{...r,session:n}));return await i8(this,{...r})}handleWriteError(e){if(this.s.bulkResult.writeErrors.length>0){let r=this.s.bulkResult.writeErrors[0].errmsg?this.s.bulkResult.writeErrors[0].errmsg:"write operation failed";throw new Kc({message:r,code:this.s.bulkResult.writeErrors[0].code,writeErrors:this.s.bulkResult.writeErrors},e)}let t=e.getWriteConcernError();if(t)throw new Kc(t,e)}shouldForceServerObjectId(){return this.s.options.forceServerObjectId===!0||this.s.collection.db.options?.forceServerObjectId===!0}}f8.BulkOperationBase=l8;function h8(e){return e.batchType===f8.BatchType.INSERT}function BE(e){return e.batchType===f8.BatchType.UPDATE}function NE(e){return e.batchType===f8.BatchType.DELETE}function xh(e){let{currentOp:t}=e.s;if(e.s.currentOp=void 0,!t)t={};return t}});var m8=g(function(f7e,p8){var Uue=Hc().BulkWriteResult;p8.exports=Uue});var Du=g(function(d7e,y8){/*!
9
+ * Centralize this so we can more easily work around issues with people
10
+ * stubbing out `process.nextTick()` in tests using sinon:
11
+ * https://github.com/sinonjs/lolex#automatically-incrementing-mocked-time
12
+ * See gh-6074
13
+ */var Vue=typeof process<"u"&&typeof process.nextTick==="function"?process.nextTick.bind(process):(e)=>setTimeout(e,0);y8.exports=function(t){return Vue(t)}});var $E=g(function(p7e,E8){/*!
14
+ * Module dependencies.
15
+ */var zue=L("events").EventEmitter,g8=Du();function Tt(e,t,r){if(r===void 0)r={};if(this.opts=r,this.name=e,this.collectionName=e,this.conn=t,this.queue=[],this.buffer=!t?._hasOpened,this.emitter=new zue,t?._hasOpened)this.onOpen()}Tt.prototype.name;Tt.prototype.collectionName;Tt.prototype.conn;Tt.prototype.onOpen=function(){this.buffer=!1,g8(()=>this.doQueue())};Tt.prototype.onClose=function(){};Tt.prototype.addQueue=function(e,t){return this.queue.push([e,t]),this};Tt.prototype.removeQueue=function(e,t){let r=this.queue.findIndex((n)=>n[0]===e&&n[1]===t);if(r===-1)return!1;return this.queue.splice(r,1),!0};Tt.prototype.doQueue=function(){for(let t of this.queue)if(typeof t[0]==="function")t[0].apply(this,t[1]);else this[t[0]].apply(this,t[1]);this.queue=[];let e=this;return g8(function(){e.emitter.emit("queue")}),this};Tt.prototype.ensureIndex=function(){throw Error("Collection#ensureIndex unimplemented by driver")};Tt.prototype.createIndex=function(){throw Error("Collection#createIndex unimplemented by driver")};Tt.prototype.findAndModify=function(){throw Error("Collection#findAndModify unimplemented by driver")};Tt.prototype.findOneAndUpdate=function(){throw Error("Collection#findOneAndUpdate unimplemented by driver")};Tt.prototype.findOneAndDelete=function(){throw Error("Collection#findOneAndDelete unimplemented by driver")};Tt.prototype.findOneAndReplace=function(){throw Error("Collection#findOneAndReplace unimplemented by driver")};Tt.prototype.findOne=function(){throw Error("Collection#findOne unimplemented by driver")};Tt.prototype.find=function(){throw Error("Collection#find unimplemented by driver")};Tt.prototype.insert=function(){throw Error("Collection#insert unimplemented by driver")};Tt.prototype.insertOne=function(){throw Error("Collection#insertOne unimplemented by driver")};Tt.prototype.insertMany=function(){throw Error("Collection#insertMany unimplemented by driver")};Tt.prototype.save=function(){throw Error("Collection#save unimplemented by driver")};Tt.prototype.updateOne=function(){throw Error("Collection#updateOne unimplemented by driver")};Tt.prototype.updateMany=function(){throw Error("Collection#updateMany unimplemented by driver")};Tt.prototype.deleteOne=function(){throw Error("Collection#deleteOne unimplemented by driver")};Tt.prototype.deleteMany=function(){throw Error("Collection#deleteMany unimplemented by driver")};Tt.prototype.getIndexes=function(){throw Error("Collection#getIndexes unimplemented by driver")};Tt.prototype.watch=function(){throw Error("Collection#watch unimplemented by driver")};/*!
16
+ * ignore
17
+ */Tt.prototype._shouldBufferCommands=function(){let t=this.opts;if(t.bufferCommands!=null)return t.bufferCommands;if(t?.schemaUserProvidedOptions?.bufferCommands!=null)return t.schemaUserProvidedOptions.bufferCommands;return this.conn._shouldBufferCommands()};/*!
18
+ * ignore
19
+ */Tt.prototype._getBufferTimeoutMS=function(){let t=this.conn,r=this.opts;if(r.bufferTimeoutMS!=null)return r.bufferTimeoutMS;if(r?.schemaUserProvidedOptions?.bufferTimeoutMS!=null)return r.schemaUserProvidedOptions.bufferTimeoutMS;return t._getBufferTimeoutMS()};/*!
20
+ * Module exports.
21
+ */E8.exports=Tt});var Le=g(function(m7e,_8){/*!
22
+ * ignore
23
+ */class RE extends Error{}Object.defineProperty(RE.prototype,"name",{value:"MongooseError"});_8.exports=RE});var b8=g(function(S8){Object.defineProperty(S8,"__esModule",{value:!0});S8.ListDatabasesOperation=void 0;var A8=dt(),w8=ae(),O8=nr(),Gc=Mt();class vE extends O8.CommandOperation{constructor(e,t){super(e,t);this.SERVER_COMMAND_RESPONSE_TYPE=A8.MongoDBResponse,this.options=t??{},this.ns=new w8.MongoDBNamespace("admin","$cmd")}get commandName(){return"listDatabases"}buildCommandDocument(e,t){let r={listDatabases:1};if(typeof this.options.nameOnly==="boolean")r.nameOnly=this.options.nameOnly;if(this.options.filter)r.filter=this.options.filter;if(typeof this.options.authorizedDatabases==="boolean")r.authorizedDatabases=this.options.authorizedDatabases;if(this.options.comment!==void 0)r.comment=this.options.comment;return r}}S8.ListDatabasesOperation=vE;Gc.defineAspects(vE,[Gc.Aspect.READ_OPERATION,Gc.Aspect.RETRYABLE])});var qE=g(function(M8){Object.defineProperty(M8,"__esModule",{value:!0});M8.RemoveUserOperation=void 0;var D8=dt(),T8=nr(),dp=Mt();class kE extends T8.CommandOperation{constructor(e,t,r){super(e,r);this.SERVER_COMMAND_RESPONSE_TYPE=D8.MongoDBResponse,this.options=r,this.username=t}get commandName(){return"dropUser"}buildCommandDocument(e){return{dropUser:this.username}}handleOk(e){return!0}}M8.RemoveUserOperation=kE;dp.defineAspects(kE,[dp.Aspect.WRITE_OPERATION])});var $8=g(function(N8){Object.defineProperty(N8,"__esModule",{value:!0});N8.ValidateCollectionOperation=void 0;var P8=dt(),Yc=J(),F8=nr();class B8 extends F8.CommandOperation{constructor(e,t,r){super(e.s.db,r);this.SERVER_COMMAND_RESPONSE_TYPE=P8.MongoDBResponse,this.options=r,this.collectionName=t}get commandName(){return"validate"}buildCommandDocument(e,t){return{validate:this.collectionName,...Object.fromEntries(Object.entries(this.options).filter((r)=>r[0]!=="session"))}}handleOk(e){let t=super.handleOk(e);if(t.result!=null&&typeof t.result!=="string")throw new Yc.MongoUnexpectedServerResponseError("Error with validation data");if(t.result!=null&&t.result.match(/exception|corrupt/)!=null)throw new Yc.MongoUnexpectedServerResponseError(`Invalid collection ${this.collectionName}`);if(t.valid!=null&&!t.valid)throw new Yc.MongoUnexpectedServerResponseError(`Invalid collection ${this.collectionName}`);return e}}N8.ValidateCollectionOperation=B8});var jE=g(function(V8){Object.defineProperty(V8,"__esModule",{value:!0});V8.Admin=void 0;var R8=Se(),Tu=Hr(),v8=b8(),k8=qE(),q8=Lc(),j8=$8(),L8=ae();class U8{constructor(e){this.s={db:e}}async command(e,t){return await Tu.executeOperation(this.s.db.client,new q8.RunCommandOperation(new L8.MongoDBNamespace("admin"),e,{...R8.resolveBSONOptions(t),session:t?.session,readPreference:t?.readPreference,timeoutMS:t?.timeoutMS??this.s.db.timeoutMS}))}async buildInfo(e){return await this.command({buildinfo:1},e)}async serverInfo(e){return await this.command({buildinfo:1},e)}async serverStatus(e){return await this.command({serverStatus:1},e)}async ping(e){return await this.command({ping:1},e)}async removeUser(e,t){return await Tu.executeOperation(this.s.db.client,new k8.RemoveUserOperation(this.s.db,e,{dbName:"admin",...t}))}async validateCollection(e,t={}){return await Tu.executeOperation(this.s.db.client,new j8.ValidateCollectionOperation(this,e,t))}async listDatabases(e){return await Tu.executeOperation(this.s.db.client,new v8.ListDatabasesOperation(this.s.db,{timeoutMS:this.s.db.timeoutMS,...e}))}async replSetGetStatus(e){return await this.command({replSetGetStatus:1},e)}}V8.Admin=U8});var LE=g(function(K8){Object.defineProperty(K8,"__esModule",{value:!0});K8.OrderedBulkOperation=void 0;var pp=Se(),mp=J(),Mu=Hc();class W8 extends Mu.BulkOperationBase{constructor(e,t){super(e,t,!0)}addToOperationsList(e,t){let r,n;if(this.s.usingAutoEncryption)n=pp.calculateObjectSize(t,{checkKeys:!1,ignoreUndefined:!1});else{let i=this.s.bsonOptions;r=pp.serialize(t,{checkKeys:this.s.checkKeys,ignoreUndefined:i.ignoreUndefined,serializeFunctions:i.serializeFunctions}),n=r.length}if(n>=this.s.maxBsonObjectSize)throw new mp.MongoInvalidArgumentError(`Document is larger than the maximum size ${this.s.maxBsonObjectSize}`);if(this.s.currentBatch==null)this.s.currentBatch=new Mu.Batch(e,this.s.currentIndex);let s=this.s.maxKeySize;if(this.s.currentBatchSize+1>=this.s.maxWriteBatchSize||this.s.currentBatchSize>0&&this.s.currentBatchSizeBytes+s+n>=this.s.maxBatchSizeBytes||this.s.currentBatch.batchType!==e)this.s.batches.push(this.s.currentBatch),this.s.currentBatch=new Mu.Batch(e,this.s.currentIndex),this.s.currentBatchSize=0,this.s.currentBatchSizeBytes=0;if(e===Mu.BatchType.INSERT)this.s.bulkResult.insertedIds.push({index:this.s.currentIndex,_id:t._id});if(Array.isArray(t))throw new mp.MongoInvalidArgumentError("Operation passed in cannot be an Array");if(this.s.currentBatch.originalIndexes.push(this.s.currentIndex),this.s.currentBatch.operations.push(t),r!=null)this.s.currentBatch.serializedOperations.push(r);return this.s.currentBatchSize+=1,this.s.currentBatchSizeBytes+=s+n,this.s.currentIndex+=1,this}}K8.OrderedBulkOperation=W8});var UE=g(function(Y8){Object.defineProperty(Y8,"__esModule",{value:!0});Y8.UnorderedBulkOperation=void 0;var yp=Se(),gp=J(),Gr=Hc();class G8 extends Gr.BulkOperationBase{constructor(e,t){super(e,t,!1)}handleWriteError(e){if(this.s.batches.length)return;return super.handleWriteError(e)}addToOperationsList(e,t){let r,n;if(this.s.usingAutoEncryption)n=yp.calculateObjectSize(t,{checkKeys:!1,ignoreUndefined:!1});else{let i=this.s.bsonOptions;r=yp.serialize(t,{checkKeys:this.s.checkKeys,ignoreUndefined:i.ignoreUndefined,serializeFunctions:i.serializeFunctions}),n=r.length}if(n>=this.s.maxBsonObjectSize)throw new gp.MongoInvalidArgumentError(`Document is larger than the maximum size ${this.s.maxBsonObjectSize}`);if(this.s.currentBatch=void 0,e===Gr.BatchType.INSERT)this.s.currentBatch=this.s.currentInsertBatch;else if(e===Gr.BatchType.UPDATE)this.s.currentBatch=this.s.currentUpdateBatch;else if(e===Gr.BatchType.DELETE)this.s.currentBatch=this.s.currentRemoveBatch;let s=this.s.maxKeySize;if(this.s.currentBatch==null)this.s.currentBatch=new Gr.Batch(e,this.s.currentIndex);if(this.s.currentBatch.size+1>=this.s.maxWriteBatchSize||this.s.currentBatch.size>0&&this.s.currentBatch.sizeBytes+s+n>=this.s.maxBatchSizeBytes||this.s.currentBatch.batchType!==e)this.s.batches.push(this.s.currentBatch),this.s.currentBatch=new Gr.Batch(e,this.s.currentIndex);if(Array.isArray(t))throw new gp.MongoInvalidArgumentError("Operation passed in cannot be an Array");if(this.s.currentBatch.operations.push(t),r!=null)this.s.currentBatch.serializedOperations.push(r);if(this.s.currentBatch.originalIndexes.push(this.s.currentIndex),this.s.currentIndex=this.s.currentIndex+1,e===Gr.BatchType.INSERT)this.s.currentInsertBatch=this.s.currentBatch,this.s.bulkResult.insertedIds.push({index:this.s.currentIndex-1,_id:t._id});else if(e===Gr.BatchType.UPDATE)this.s.currentUpdateBatch=this.s.currentBatch;else if(e===Gr.BatchType.DELETE)this.s.currentRemoveBatch=this.s.currentBatch;return this.s.currentBatch.size+=1,this.s.currentBatch.sizeBytes+=s+n,this}}Y8.UnorderedBulkOperation=G8});var Fu=g(function(t5){Object.defineProperty(t5,"__esModule",{value:!0});t5.MongoLogger=t5.MongoLoggableComponent=t5.SEVERITY_LEVEL_MAP=t5.DEFAULT_MAX_DOCUMENT_LENGTH=t5.SeverityLevel=void 0;t5.parseSeverityFromString=WE;t5.createStdioLogger=qa;t5.stringifyWithMaxLen=Pu;t5.defaultLogTransform=Z8;var Ys=L("process"),J8=L("util"),Ap=Se(),Ce=wr(),ds=ae();t5.SeverityLevel=Object.freeze({EMERGENCY:"emergency",ALERT:"alert",CRITICAL:"critical",ERROR:"error",WARNING:"warn",NOTICE:"notice",INFORMATIONAL:"info",DEBUG:"debug",TRACE:"trace",OFF:"off"});t5.DEFAULT_MAX_DOCUMENT_LENGTH=1000;class X8 extends Map{constructor(e){let t=[];for(let[r,n]of e)t.push([n,r]);t.push(...e);super(t)}getNumericSeverityLevel(e){return this.get(e)}getSeverityLevelName(e){return this.get(e)}}t5.SEVERITY_LEVEL_MAP=new X8([[t5.SeverityLevel.OFF,-1/0],[t5.SeverityLevel.EMERGENCY,0],[t5.SeverityLevel.ALERT,1],[t5.SeverityLevel.CRITICAL,2],[t5.SeverityLevel.ERROR,3],[t5.SeverityLevel.WARNING,4],[t5.SeverityLevel.NOTICE,5],[t5.SeverityLevel.INFORMATIONAL,6],[t5.SeverityLevel.DEBUG,7],[t5.SeverityLevel.TRACE,8]]);t5.MongoLoggableComponent=Object.freeze({COMMAND:"command",TOPOLOGY:"topology",SERVER_SELECTION:"serverSelection",CONNECTION:"connection",CLIENT:"client"});function WE(e){let t=Object.values(t5.SeverityLevel),r=e?.toLowerCase();if(r!=null&&t.includes(r))return r;return null}function qa(e){return{write:(t)=>new Promise((r,n)=>{let s=J8.inspect(t,{compact:!0,breakLength:1/0});e.write(`${s}
24
+ `,"utf-8",(i)=>{if(i)return n(i);r(!0)})})}}function Wue({MONGODB_LOG_PATH:e},{mongodbLogPath:t}){if(typeof t==="string"&&/^stderr$/i.test(t))return{mongodbLogPath:qa(Ys.stderr),mongodbLogPathIsStdErr:!0};if(typeof t==="string"&&/^stdout$/i.test(t))return{mongodbLogPath:qa(Ys.stdout),mongodbLogPathIsStdErr:!1};if(typeof t==="object"&&typeof t?.write==="function")return{mongodbLogPath:t,mongodbLogPathIsStdErr:!1};if(e&&/^stderr$/i.test(e))return{mongodbLogPath:qa(Ys.stderr),mongodbLogPathIsStdErr:!0};if(e&&/^stdout$/i.test(e))return{mongodbLogPath:qa(Ys.stdout),mongodbLogPathIsStdErr:!1};return{mongodbLogPath:qa(Ys.stderr),mongodbLogPathIsStdErr:!0}}function Qc(e,t,r){return WE(e)??WE(t)??r}function Kue(e,t){let r=t5.SEVERITY_LEVEL_MAP.getNumericSeverityLevel(e),n=t5.SEVERITY_LEVEL_MAP.getNumericSeverityLevel(t);return r<n?-1:r>n?1:0}function Pu(e,t,r={}){let n="",s=0,i=function(u,a){if(s>=t)return;if(u==="")return s+=1,a;if(s+=u.length+4,a==null)return a;switch(typeof a){case"string":s+=a.length+2;break;case"number":case"bigint":s+=String(a).length;break;case"boolean":s+=a?4:5;break;case"object":if(ds.isUint8Array(a))s+=22+a.byteLength+a.byteLength*0.33+18|0;else if("_bsontype"in a){let c=a;switch(c._bsontype){case"Int32":s+=String(c.value).length;break;case"Double":s+=(c.value|0)===c.value?String(c.value).length+2:String(c.value).length;break;case"Long":s+=c.toString().length;break;case"ObjectId":s+=35;break;case"MaxKey":case"MinKey":s+=13;break;case"Binary":s+=22+a.position+a.position*0.33+18|0;break;case"Timestamp":s+=19+String(c.t).length+5+String(c.i).length+2;break;case"Code":if(c.scope==null)s+=c.code.length+10+2;else s+=c.code.length+10+11;break;case"BSONRegExp":s+=34+c.pattern.length+13+c.options.length+3;break}}}return a};if(typeof e==="string")n=e;else if(typeof e==="function")n=e.name;else try{if(t!==0)n=Ap.EJSON.stringify(e,i,0,r);else n=Ap.EJSON.stringify(e,r)}catch(o){n=`Extended JSON serialization failed with: ${o.message}`}if(t!==0&&n.length>t&&n.charCodeAt(t-1)!==n.codePointAt(t-1)){if(t--,t===0)return""}return t!==0&&n.length>t?`${n.slice(0,t)}...`:n}function Hue(e){let t=e;return t.toLog!==void 0&&typeof t.toLog==="function"}function Ep(e,t,r=t5.DEFAULT_MAX_DOCUMENT_LENGTH){let{selector:n,operation:s,topologyDescription:i,message:o}=t;return e.selector=Pu(n,r),e.operation=s,e.topologyDescription=Pu(i,r),e.message=o,e}function VE(e,t){e.commandName=t.commandName,e.requestId=t.requestId,e.driverConnectionId=t.connectionId;let{host:r,port:n}=ds.HostAddress.fromString(t.address).toHostPort();if(e.serverHost=r,e.serverPort=n,t?.serviceId)e.serviceId=t.serviceId.toHexString();return e.databaseName=t.databaseName,e.serverConnectionId=t.serverConnectionId,e}function Ns(e,t){let{host:r,port:n}=ds.HostAddress.fromString(t.address).toHostPort();return e.serverHost=r,e.serverPort=n,e}function xu(e,t){return e.topologyId=t.topologyId,e}function zE(e,t){let{awaited:r,connectionId:n}=t;e.awaited=r,e.driverConnectionId=t.connectionId;let{host:s,port:i}=ds.HostAddress.fromString(n).toHostPort();return e.serverHost=s,e.serverPort=i,e}function Z8(e,t=t5.DEFAULT_MAX_DOCUMENT_LENGTH){let r=Object.create(null);switch(e.name){case Ce.SERVER_SELECTION_STARTED:return r=Ep(r,e,t),r;case Ce.SERVER_SELECTION_FAILED:return r=Ep(r,e,t),r.failure=e.failure?.message,r;case Ce.SERVER_SELECTION_SUCCEEDED:return r=Ep(r,e,t),r.serverHost=e.serverHost,r.serverPort=e.serverPort,r;case Ce.WAITING_FOR_SUITABLE_SERVER:return r=Ep(r,e,t),r.remainingTimeMS=e.remainingTimeMS,r;case Ce.COMMAND_STARTED:return r=VE(r,e),r.message="Command started",r.command=Pu(e.command,t,{relaxed:!0}),r.databaseName=e.databaseName,r;case Ce.COMMAND_SUCCEEDED:return r=VE(r,e),r.message="Command succeeded",r.durationMS=e.duration,r.reply=Pu(e.reply,t,{relaxed:!0}),r;case Ce.COMMAND_FAILED:return r=VE(r,e),r.message="Command failed",r.durationMS=e.duration,r.failure=e.failure?.message??"(redacted)",r;case Ce.CONNECTION_POOL_CREATED:if(r=Ns(r,e),r.message="Connection pool created",e.options){let{maxIdleTimeMS:n,minPoolSize:s,maxPoolSize:i,maxConnecting:o,waitQueueTimeoutMS:u}=e.options;r={...r,maxIdleTimeMS:n,minPoolSize:s,maxPoolSize:i,maxConnecting:o,waitQueueTimeoutMS:u}}return r;case Ce.CONNECTION_POOL_READY:return r=Ns(r,e),r.message="Connection pool ready",r;case Ce.CONNECTION_POOL_CLEARED:if(r=Ns(r,e),r.message="Connection pool cleared",e.serviceId?._bsontype==="ObjectId")r.serviceId=e.serviceId?.toHexString();return r;case Ce.CONNECTION_POOL_CLOSED:return r=Ns(r,e),r.message="Connection pool closed",r;case Ce.CONNECTION_CREATED:return r=Ns(r,e),r.message="Connection created",r.driverConnectionId=e.connectionId,r;case Ce.CONNECTION_READY:return r=Ns(r,e),r.message="Connection ready",r.driverConnectionId=e.connectionId,r.durationMS=e.durationMS,r;case Ce.CONNECTION_CLOSED:switch(r=Ns(r,e),r.message="Connection closed",r.driverConnectionId=e.connectionId,e.reason){case"stale":r.reason="Connection became stale because the pool was cleared";break;case"idle":r.reason="Connection has been available but unused for longer than the configured max idle time";break;case"error":if(r.reason="An error occurred while using the connection",e.error)r.error=e.error;break;case"poolClosed":r.reason="Connection pool was closed";break;default:r.reason=`Unknown close reason: ${e.reason}`}return r;case Ce.CONNECTION_CHECK_OUT_STARTED:return r=Ns(r,e),r.message="Connection checkout started",r;case Ce.CONNECTION_CHECK_OUT_FAILED:switch(r=Ns(r,e),r.message="Connection checkout failed",e.reason){case"poolClosed":r.reason="Connection pool was closed";break;case"timeout":r.reason="Wait queue timeout elapsed without a connection becoming available";break;case"connectionError":if(r.reason="An error occurred while trying to establish a new connection",e.error)r.error=e.error;break;default:r.reason=`Unknown close reason: ${e.reason}`}return r.durationMS=e.durationMS,r;case Ce.CONNECTION_CHECKED_OUT:return r=Ns(r,e),r.message="Connection checked out",r.driverConnectionId=e.connectionId,r.durationMS=e.durationMS,r;case Ce.CONNECTION_CHECKED_IN:return r=Ns(r,e),r.message="Connection checked in",r.driverConnectionId=e.connectionId,r;case Ce.SERVER_OPENING:return r=xu(r,e),r=Ns(r,e),r.message="Starting server monitoring",r;case Ce.SERVER_CLOSED:return r=xu(r,e),r=Ns(r,e),r.message="Stopped server monitoring",r;case Ce.SERVER_HEARTBEAT_STARTED:return r=xu(r,e),r=zE(r,e),r.message="Server heartbeat started",r;case Ce.SERVER_HEARTBEAT_SUCCEEDED:return r=xu(r,e),r=zE(r,e),r.message="Server heartbeat succeeded",r.durationMS=e.duration,r.serverConnectionId=e.serverConnectionId,r.reply=Pu(e.reply,t,{relaxed:!0}),r;case Ce.SERVER_HEARTBEAT_FAILED:return r=xu(r,e),r=zE(r,e),r.message="Server heartbeat failed",r.durationMS=e.duration,r.failure=e.failure?.message,r;case Ce.TOPOLOGY_OPENING:return r=xu(r,e),r.message="Starting topology monitoring",r;case Ce.TOPOLOGY_CLOSED:return r=xu(r,e),r.message="Stopped topology monitoring",r;case Ce.TOPOLOGY_DESCRIPTION_CHANGED:return r=xu(r,e),r.message="Topology description changed",r.previousDescription=r.reply=Pu(e.previousDescription,t),r.newDescription=r.reply=Pu(e.newDescription,t),r;default:for(let[n,s]of Object.entries(e))if(s!=null)r[n]=s}return r}class e5{constructor(e){this.pendingLog=null,this.error=this.log.bind(this,"error"),this.warn=this.log.bind(this,"warn"),this.info=this.log.bind(this,"info"),this.debug=this.log.bind(this,"debug"),this.trace=this.log.bind(this,"trace"),this.componentSeverities=e.componentSeverities,this.maxDocumentLength=e.maxDocumentLength,this.logDestination=e.logDestination,this.logDestinationIsStdErr=e.logDestinationIsStdErr,this.severities=this.createLoggingSeverities()}createLoggingSeverities(){let e=Object();for(let t of Object.values(t5.MongoLoggableComponent)){e[t]={};for(let r of Object.values(t5.SeverityLevel))e[t][r]=Kue(r,this.componentSeverities[t])<=0}return e}turnOffSeverities(){for(let e of Object.values(t5.MongoLoggableComponent)){this.componentSeverities[e]=t5.SeverityLevel.OFF;for(let t of Object.values(t5.SeverityLevel))this.severities[e][t]=!1}}logWriteFailureHandler(e){if(this.logDestinationIsStdErr){this.turnOffSeverities(),this.clearPendingLog();return}this.logDestination=qa(Ys.stderr),this.logDestinationIsStdErr=!0,this.clearPendingLog(),this.error(t5.MongoLoggableComponent.CLIENT,{toLog:function(){return{message:"User input for mongodbLogPath is now invalid. Logging is halted.",error:e.message}}}),this.turnOffSeverities(),this.clearPendingLog()}clearPendingLog(){this.pendingLog=null}willLog(e,t){if(t===t5.SeverityLevel.OFF)return!1;return this.severities[e][t]}log(e,t,r){if(!this.willLog(t,e))return;let n={t:new Date,c:t,s:e};if(typeof r==="string")n.message=r;else if(typeof r==="object")if(Hue(r))n={...n,...r.toLog()};else n={...n,...Z8(r,this.maxDocumentLength)};if(ds.isPromiseLike(this.pendingLog)){this.pendingLog=this.pendingLog.then(()=>this.logDestination.write(n)).then(this.clearPendingLog.bind(this),this.logWriteFailureHandler.bind(this));return}try{let s=this.logDestination.write(n);if(ds.isPromiseLike(s))this.pendingLog=s.then(this.clearPendingLog.bind(this),this.logWriteFailureHandler.bind(this))}catch(s){this.logWriteFailureHandler(s)}}static resolveOptions(e,t){let r=Wue(e,t),n={...e,...t,mongodbLogPath:r.mongodbLogPath,mongodbLogPathIsStdErr:r.mongodbLogPathIsStdErr},s=Qc(n.mongodbLogComponentSeverities?.default,n.MONGODB_LOG_ALL,t5.SeverityLevel.OFF);return{componentSeverities:{command:Qc(n.mongodbLogComponentSeverities?.command,n.MONGODB_LOG_COMMAND,s),topology:Qc(n.mongodbLogComponentSeverities?.topology,n.MONGODB_LOG_TOPOLOGY,s),serverSelection:Qc(n.mongodbLogComponentSeverities?.serverSelection,n.MONGODB_LOG_SERVER_SELECTION,s),connection:Qc(n.mongodbLogComponentSeverities?.connection,n.MONGODB_LOG_CONNECTION,s),client:Qc(n.mongodbLogComponentSeverities?.client,n.MONGODB_LOG_CLIENT,s),default:s},maxDocumentLength:n.mongodbLogMaxDocumentLength??ds.parseUnsignedInteger(n.MONGODB_LOG_MAX_DOCUMENT_LENGTH)??1000,logDestination:n.mongodbLogPath,logDestinationIsStdErr:n.mongodbLogPathIsStdErr}}}t5.MongoLogger=e5});var Is=g(function(u5){Object.defineProperty(u5,"__esModule",{value:!0});u5.CancellationToken=u5.TypedEventEmitter=void 0;var n5=L("events"),s5=Fu(),i5=ae();class GE extends n5.EventEmitter{emitAndLog(e,...t){if(this.emit(e,...t),this.component)this.mongoLogger?.debug(this.component,t[0])}emitAndLogHeartbeat(e,t,r,...n){if(this.emit(e,...n),this.component){let s={topologyId:t,serverConnectionId:r??null,...n[0]};this.mongoLogger?.debug(this.component,s)}}emitAndLogCommand(e,t,r,n,...s){if(e)this.emit(t,...s);if(n){let i={databaseName:r,...s[0]};this.mongoLogger?.debug(s5.MongoLoggableComponent.COMMAND,i)}}}u5.TypedEventEmitter=GE;class o5 extends GE{constructor(...e){super(...e);this.on("error",i5.noop)}}u5.CancellationToken=o5});var QE=g(function(l5){Object.defineProperty(l5,"__esModule",{value:!0});l5.GetMoreOperation=void 0;var c5=dt(),wp=J(),Bu=Mt();class YE extends Bu.AbstractOperation{constructor(e,t,r,n){super(n);this.SERVER_COMMAND_RESPONSE_TYPE=c5.CursorResponse,this.options=n,this.ns=e,this.cursorId=t,this.server=r}get commandName(){return"getMore"}buildCommand(e){if(this.cursorId==null||this.cursorId.isZero())throw new wp.MongoRuntimeError("Unable to iterate cursor with no id");let t=this.ns.collection;if(t==null)throw new wp.MongoRuntimeError("A collection name must be determined before getMore");let r={getMore:this.cursorId,collection:t};if(typeof this.options.batchSize==="number")r.batchSize=Math.abs(this.options.batchSize);if(typeof this.options.maxAwaitTimeMS==="number")r.maxTimeMS=this.options.maxAwaitTimeMS;if(this.options.comment!==void 0)r.comment=this.options.comment;return r}buildOptions(e){return{returnFieldSelector:null,documentsReturnedIn:"nextBatch",timeoutContext:e,...this.options}}handleOk(e){return e}}l5.GetMoreOperation=YE;Bu.defineAspects(YE,[Bu.Aspect.READ_OPERATION,Bu.Aspect.MUST_SELECT_SAME_SERVER])});var y5=g(function(p5){Object.defineProperty(p5,"__esModule",{value:!0});p5.KillCursorsOperation=void 0;var f5=dt(),d5=J(),Jc=Mt();class JE extends Jc.AbstractOperation{constructor(e,t,r,n){super(n);this.SERVER_COMMAND_RESPONSE_TYPE=f5.MongoDBResponse,this.ns=t,this.cursorId=e,this.server=r}get commandName(){return"killCursors"}buildCommand(e,t){let r=this.ns.collection;if(r==null)throw new d5.MongoRuntimeError("A collection name must be determined before killCursors");return{killCursors:r,cursors:[this.cursorId]}}buildOptions(e){return{session:this.session,timeoutContext:e}}handleError(e){}}p5.KillCursorsOperation=JE;Jc.defineAspects(JE,[Jc.Aspect.MUST_SELECT_SAME_SERVER])});var XE=g(function(g5){Object.defineProperty(g5,"__esModule",{value:!0});g5.ConnectionPoolMetrics=void 0;class Xc{constructor(){this.txnConnections=0,this.cursorConnections=0,this.otherConnections=0}static{this.TXN="txn"}static{this.CURSOR="cursor"}static{this.OTHER="other"}markPinned(e){if(e===Xc.TXN)this.txnConnections+=1;else if(e===Xc.CURSOR)this.cursorConnections+=1;else this.otherConnections+=1}markUnpinned(e){if(e===Xc.TXN)this.txnConnections-=1;else if(e===Xc.CURSOR)this.cursorConnections-=1;else this.otherConnections-=1}info(e){return`Timed out while checking out a connection from connection pool: maxPoolSize: ${e}, connections in use by cursors: ${this.cursorConnections}, connections in use by transactions: ${this.txnConnections}, connections in use by other operations: ${this.otherConnections}`}reset(){this.txnConnections=0,this.cursorConnections=0,this.otherConnections=0}}g5.ConnectionPoolMetrics=Xc});var ZE=g(function(S5){Object.defineProperty(S5,"__esModule",{value:!0});S5.Transaction=S5.TxnState=void 0;S5.isTransactionCommand=rae;var Op=J(),_5=qi(),A5=Ur(),w5=Hn();S5.TxnState=Object.freeze({NO_TRANSACTION:"NO_TRANSACTION",STARTING_TRANSACTION:"STARTING_TRANSACTION",TRANSACTION_IN_PROGRESS:"TRANSACTION_IN_PROGRESS",TRANSACTION_COMMITTED:"TRANSACTION_COMMITTED",TRANSACTION_COMMITTED_EMPTY:"TRANSACTION_COMMITTED_EMPTY",TRANSACTION_ABORTED:"TRANSACTION_ABORTED"});var Zue={[S5.TxnState.NO_TRANSACTION]:[S5.TxnState.NO_TRANSACTION,S5.TxnState.STARTING_TRANSACTION],[S5.TxnState.STARTING_TRANSACTION]:[S5.TxnState.TRANSACTION_IN_PROGRESS,S5.TxnState.TRANSACTION_COMMITTED,S5.TxnState.TRANSACTION_COMMITTED_EMPTY,S5.TxnState.TRANSACTION_ABORTED],[S5.TxnState.TRANSACTION_IN_PROGRESS]:[S5.TxnState.TRANSACTION_IN_PROGRESS,S5.TxnState.TRANSACTION_COMMITTED,S5.TxnState.TRANSACTION_ABORTED],[S5.TxnState.TRANSACTION_COMMITTED]:[S5.TxnState.TRANSACTION_COMMITTED,S5.TxnState.TRANSACTION_COMMITTED_EMPTY,S5.TxnState.STARTING_TRANSACTION,S5.TxnState.NO_TRANSACTION],[S5.TxnState.TRANSACTION_ABORTED]:[S5.TxnState.STARTING_TRANSACTION,S5.TxnState.NO_TRANSACTION],[S5.TxnState.TRANSACTION_COMMITTED_EMPTY]:[S5.TxnState.TRANSACTION_COMMITTED_EMPTY,S5.TxnState.NO_TRANSACTION]},eae=new Set([S5.TxnState.STARTING_TRANSACTION,S5.TxnState.TRANSACTION_IN_PROGRESS]),tae=new Set([S5.TxnState.TRANSACTION_COMMITTED,S5.TxnState.TRANSACTION_COMMITTED_EMPTY,S5.TxnState.TRANSACTION_ABORTED]);class O5{constructor(e){e=e??{},this.state=S5.TxnState.NO_TRANSACTION,this.options={};let t=w5.WriteConcern.fromOptions(e);if(t){if(t.w===0)throw new Op.MongoTransactionError("Transactions do not support unacknowledged write concern");this.options.writeConcern=t}if(e.readConcern)this.options.readConcern=_5.ReadConcern.fromOptions(e);if(e.readPreference)this.options.readPreference=A5.ReadPreference.fromOptions(e);if(e.maxCommitTimeMS)this.options.maxTimeMS=e.maxCommitTimeMS;this._pinnedServer=void 0,this._recoveryToken=void 0}get server(){return this._pinnedServer}get recoveryToken(){return this._recoveryToken}get isPinned(){return!!this.server}get isStarting(){return this.state===S5.TxnState.STARTING_TRANSACTION}get isActive(){return eae.has(this.state)}get isCommitted(){return tae.has(this.state)}transition(e){let t=Zue[this.state];if(t&&t.includes(e)){if(this.state=e,this.state===S5.TxnState.NO_TRANSACTION||this.state===S5.TxnState.STARTING_TRANSACTION||this.state===S5.TxnState.TRANSACTION_ABORTED)this.unpinServer();return}throw new Op.MongoRuntimeError(`Attempted illegal state transition from [${this.state}] to [${e}]`)}pinServer(e){if(this.isActive)this._pinnedServer=e}unpinServer(){this._pinnedServer=void 0}}S5.Transaction=O5;function rae(e){return!!(e.commitTransaction||e.abortTransaction)}});var Fh=g(function(F5){Object.defineProperty(F5,"__esModule",{value:!0});F5.ServerSessionPool=F5.ServerSession=F5.ClientSession=void 0;F5.maybeClearPinnedConnection=Sp;F5.applySession=iae;F5.updateSessionFromResponse=oae;var T5=L("timers/promises"),Js=Se(),Iu=XE(),Cp=wr(),U=J(),M5=Is(),Nu=Hr(),Zc=Lc(),x5=qi(),el=Ur(),tl=as(),he=ZE(),pt=ae(),Qs=Hn();class t_ extends M5.TypedEventEmitter{constructor(e,t,r,n){super();if(this.timeoutContext=null,this.on("error",pt.noop),e==null)throw new U.MongoRuntimeError("ClientSession requires a MongoClient");if(t==null||!(t instanceof r_))throw new U.MongoRuntimeError("ClientSession requires a ServerSessionPool");if(r=r??{},this.snapshotEnabled=r.snapshot===!0,r.causalConsistency===!0&&this.snapshotEnabled)throw new U.MongoInvalidArgumentError('Properties "causalConsistency" and "snapshot" are mutually exclusive');this.client=e,this.sessionPool=t,this.hasEnded=!1,this.clientOptions=n,this.explicit=!!r.explicit,this._serverSession=this.explicit?this.sessionPool.acquire():null,this.txnNumberIncrement=0;let s=this.explicit&&r.snapshot!==!0;this.supports={causalConsistency:r.causalConsistency??s},this.clusterTime=r.initialClusterTime,this.operationTime=void 0,this.owner=r.owner,this.defaultTransactionOptions={...r.defaultTransactionOptions},this.transaction=new he.Transaction}get id(){return this.serverSession?.id}get serverSession(){let e=this._serverSession;if(e==null){if(this.explicit)throw new U.MongoRuntimeError("Unexpected null serverSession for an explicit session");if(this.hasEnded)throw new U.MongoRuntimeError("Unexpected null serverSession for an ended implicit session");e=this.sessionPool.acquire(),this._serverSession=e}return e}get loadBalanced(){return this.client.topology?.description.type===tl.TopologyType.LoadBalanced}pin(e){if(this.pinnedConnection)throw TypeError("Cannot pin multiple connections to the same session");this.pinnedConnection=e,e.emit(Cp.PINNED,this.inTransaction()?Iu.ConnectionPoolMetrics.TXN:Iu.ConnectionPoolMetrics.CURSOR)}unpin(e){if(this.loadBalanced)return Sp(this,e);this.transaction.unpinServer()}get isPinned(){return this.loadBalanced?!!this.pinnedConnection:this.transaction.isPinned}async endSession(e){try{if(this.inTransaction())await this.abortTransaction({...e,throwTimeout:!0})}catch(t){if(t.name==="MongoOperationTimeoutError")throw t;pt.squashError(t)}finally{if(!this.hasEnded){let t=this.serverSession;if(t!=null)this.sessionPool.release(t),this._serverSession=new Dp(t);this.hasEnded=!0,this.emit("ended",this)}Sp(this,{force:!0,...e})}}async[Symbol.asyncDispose](){await this.endSession({force:!0})}advanceOperationTime(e){if(this.operationTime==null){this.operationTime=e;return}if(e.greaterThan(this.operationTime))this.operationTime=e}advanceClusterTime(e){if(!e||typeof e!=="object")throw new U.MongoInvalidArgumentError("input cluster time must be an object");if(!e.clusterTime||e.clusterTime._bsontype!=="Timestamp")throw new U.MongoInvalidArgumentError('input cluster time "clusterTime" property must be a valid BSON Timestamp');if(!e.signature||e.signature.hash?._bsontype!=="Binary"||typeof e.signature.keyId!=="bigint"&&typeof e.signature.keyId!=="number"&&e.signature.keyId?._bsontype!=="Long")throw new U.MongoInvalidArgumentError('input cluster time must have a valid "signature" property with BSON Binary hash and BSON Long keyId');tl._advanceClusterTime(this,e)}equals(e){if(!(e instanceof t_))return!1;if(this.id==null||e.id==null)return!1;return Js.ByteUtils.equals(this.id.id.buffer,e.id.id.buffer)}incrementTransactionNumber(){this.txnNumberIncrement+=1}inTransaction(){return this.transaction.isActive}startTransaction(e){if(this.snapshotEnabled)throw new U.MongoCompatibilityError("Transactions are not supported in snapshot sessions");if(this.inTransaction())throw new U.MongoTransactionError("Transaction already in progress");if(this.isPinned&&this.transaction.isCommitted)this.unpin();this.commitAttempted=!1,this.incrementTransactionNumber(),this.transaction=new he.Transaction({readConcern:e?.readConcern??this.defaultTransactionOptions.readConcern??this.clientOptions?.readConcern,writeConcern:e?.writeConcern??this.defaultTransactionOptions.writeConcern??this.clientOptions?.writeConcern,readPreference:e?.readPreference??this.defaultTransactionOptions.readPreference??this.clientOptions?.readPreference,maxCommitTimeMS:e?.maxCommitTimeMS??this.defaultTransactionOptions.maxCommitTimeMS}),this.transaction.transition(he.TxnState.STARTING_TRANSACTION)}async commitTransaction(e){if(this.transaction.state===he.TxnState.NO_TRANSACTION)throw new U.MongoTransactionError("No transaction started");if(this.transaction.state===he.TxnState.STARTING_TRANSACTION||this.transaction.state===he.TxnState.TRANSACTION_COMMITTED_EMPTY){this.transaction.transition(he.TxnState.TRANSACTION_COMMITTED_EMPTY);return}if(this.transaction.state===he.TxnState.TRANSACTION_ABORTED)throw new U.MongoTransactionError("Cannot call commitTransaction after calling abortTransaction");let t={commitTransaction:1},r=this.transaction.options.writeConcern??this.clientOptions?.writeConcern;if(r!=null)if(this.timeoutContext==null)Qs.WriteConcern.apply(t,{wtimeoutMS:1e4,w:"majority",...r});else{let s=Object.keys(r);if(s.length>2||!s.includes("wtimeoutMS")&&!s.includes("wTimeoutMS"))Qs.WriteConcern.apply(t,{...r,wtimeoutMS:void 0})}if(this.transaction.state===he.TxnState.TRANSACTION_COMMITTED||this.commitAttempted)if(this.timeoutContext==null)Qs.WriteConcern.apply(t,{wtimeoutMS:1e4,...r,w:"majority"});else Qs.WriteConcern.apply(t,{w:"majority",...r,wtimeoutMS:void 0});if(typeof this.transaction.options.maxTimeMS==="number")t.maxTimeMS=this.transaction.options.maxTimeMS;if(this.transaction.recoveryToken)t.recoveryToken=this.transaction.recoveryToken;let n=new Zc.RunCommandOperation(new pt.MongoDBNamespace("admin"),t,{session:this,readPreference:el.ReadPreference.primary,bypassPinningCheck:!0});n.maxAttempts=this.clientOptions.maxAdaptiveRetries+1;try{await Nu.executeOperation(this.client,n),this.commitAttempted=void 0;return}catch(s){this.commitAttempted=!0;let i=this.clientOptions.maxAdaptiveRetries+1-n.attemptsMade;if(i<=0)throw s;if(s instanceof U.MongoError&&U.isRetryableWriteError(s)){Qs.WriteConcern.apply(t,{wtimeoutMS:1e4,...r,w:"majority"}),this.unpin({force:!0});try{let o=new Zc.RunCommandOperation(new pt.MongoDBNamespace("admin"),t,{session:this,readPreference:el.ReadPreference.primary,bypassPinningCheck:!0});o.maxAttempts=i,await Nu.executeOperation(this.client,o);return}catch(o){if(D5(o))o.addErrorLabel(U.MongoErrorLabel.UnknownTransactionCommitResult);if(b5(o))this.unpin({error:o});throw o}}if(D5(s))s.addErrorLabel(U.MongoErrorLabel.UnknownTransactionCommitResult);if(b5(s))this.unpin({error:s});throw s}finally{this.transaction.transition(he.TxnState.TRANSACTION_COMMITTED)}}async abortTransaction(e){if(this.transaction.state===he.TxnState.NO_TRANSACTION)throw new U.MongoTransactionError("No transaction started");if(this.transaction.state===he.TxnState.STARTING_TRANSACTION){this.transaction.transition(he.TxnState.TRANSACTION_ABORTED);return}if(this.transaction.state===he.TxnState.TRANSACTION_ABORTED)throw new U.MongoTransactionError("Cannot call abortTransaction twice");if(this.transaction.state===he.TxnState.TRANSACTION_COMMITTED||this.transaction.state===he.TxnState.TRANSACTION_COMMITTED_EMPTY)throw new U.MongoTransactionError("Cannot call abortTransaction after calling commitTransaction");let t={abortTransaction:1},r=this.transaction.options.writeConcern??this.clientOptions?.writeConcern;if(r!=null)Qs.WriteConcern.apply(t,{wtimeoutMS:1e4,w:"majority",...r});if(this.transaction.recoveryToken)t.recoveryToken=this.transaction.recoveryToken;let n=new Zc.RunCommandOperation(new pt.MongoDBNamespace("admin"),t,{session:this,readPreference:el.ReadPreference.primary,bypassPinningCheck:!0});try{await Nu.executeOperation(this.client,n),this.unpin();return}catch(s){if(this.unpin(),s.name==="MongoRuntimeError")throw s;if(e?.throwTimeout&&s.name==="MongoOperationTimeoutError")throw s;if(s instanceof U.MongoError&&U.isRetryableWriteError(s))try{await Nu.executeOperation(this.client,n);return}catch(i){if(i.name==="MongoRuntimeError")throw i;if(e?.throwTimeout&&i.name==="MongoOperationTimeoutError")throw i}}finally{if(this.transaction.transition(he.TxnState.TRANSACTION_ABORTED),this.loadBalanced)Sp(this,{force:!1})}}toBSON(){throw new U.MongoRuntimeError("ClientSession cannot be serialized to BSON.")}async withTransaction(e,t){let n=!!this.timeoutContext?.csotEnabled(),s=this.timeoutContext?.csotEnabled()?this.timeoutContext.remainingTimeMS:120000,i=pt.processTimeMS()+s,o=!1,u,a=null;try{e:for(let c=0,l=!1;!o;++c,l=c>0){if(l){let m=Math.random()*Math.min(5*1.5**c,500);if(pt.processTimeMS()+m>=i)throw e_(a??new U.MongoRuntimeError("Transaction retry did not record an error: should never occur. Please file a bug."),n);await T5.setTimeout(m)}this.startTransaction(t);try{let f=e(this);if(!pt.isPromiseLike(f))throw new U.MongoInvalidArgumentError("Function provided to `withTransaction` must return a Promise");if(u=await f,this.transaction.state===he.TxnState.NO_TRANSACTION||this.transaction.state===he.TxnState.TRANSACTION_COMMITTED||this.transaction.state===he.TxnState.TRANSACTION_ABORTED)return u}catch(f){if(!(f instanceof U.MongoError)||f instanceof U.MongoInvalidArgumentError)throw await this.abortTransaction(),f;if(a=f,this.transaction.state===he.TxnState.STARTING_TRANSACTION||this.transaction.state===he.TxnState.TRANSACTION_IN_PROGRESS)await this.abortTransaction();if(f.hasErrorLabel(U.MongoErrorLabel.TransientTransactionError)){if(pt.processTimeMS()>=i)throw e_(a,n);continue e}throw f}t:while(!o)try{await this.commitTransaction(),o=!0}catch(f){if(a=f,f.hasErrorLabel(U.MongoErrorLabel.UnknownTransactionCommitResult)&&!bp(f)){if(pt.processTimeMS()>=i)throw e_(f,n);continue t}if(f.hasErrorLabel(U.MongoErrorLabel.TransientTransactionError))continue e;throw f}}return u}finally{this.timeoutContext=null}}}F5.ClientSession=t_;function e_(e,t){if(e instanceof U.MongoOperationTimeoutError)return e;if(t){let r=new U.MongoOperationTimeoutError("Timed out during withTransaction",{cause:e});if(e instanceof U.MongoError)for(let n of e.errorLabels)r.addErrorLabel(n);return r}return e}var sae=new Set(["CannotSatisfyWriteConcern","UnknownReplWriteConcern","UnsatisfiableWriteConcern"]);function b5(e){if(e instanceof U.MongoError){if(U.isRetryableWriteError(e)||e instanceof U.MongoWriteConcernError||bp(e)){if(P5(e))return!0}else if(e.hasErrorLabel(U.MongoErrorLabel.TransientTransactionError))return!0}return!1}function D5(e){let t=U.isRetryableWriteError(e);return t||=e instanceof U.MongoWriteConcernError,t||=bp(e),t&&=P5(e),t}function P5(e){let t=e instanceof U.MongoServerError&&e.codeName&&sae.has(e.codeName);return bp(e)||!t&&e.code!==U.MONGODB_ERROR_CODES.UnsatisfiableWriteConcern&&e.code!==U.MONGODB_ERROR_CODES.UnknownReplWriteConcern}function Sp(e,t){let r=e.pinnedConnection,n=t?.error;if(e.inTransaction()&&n&&n instanceof U.MongoError&&n.hasErrorLabel(U.MongoErrorLabel.TransientTransactionError))return;let s=e.client.topology;if(r&&s!=null){let o=Array.from(s.s.servers.values())[0];if(t?.error==null||t?.force){if(o.pool.checkIn(r),e.pinnedConnection=void 0,r.emit(Cp.UNPINNED,e.transaction.state!==he.TxnState.NO_TRANSACTION?Iu.ConnectionPoolMetrics.TXN:Iu.ConnectionPoolMetrics.CURSOR),t?.forceClear)o.pool.clear({serviceId:r.serviceId})}}}function bp(e){if(e==null||!(e instanceof U.MongoServerError))return!1;return e.code===U.MONGODB_ERROR_CODES.MaxTimeMSExpired||e.writeConcernError?.code===U.MONGODB_ERROR_CODES.MaxTimeMSExpired}class Dp{constructor(e){if(e!=null){let t=Js.ByteUtils.allocateUnsafe(16);t.set(e.id.id.buffer),this.id={id:new Js.Binary(t,e.id.id.sub_type)},this.lastUse=e.lastUse,this.txnNumber=e.txnNumber,this.isDirty=e.isDirty;return}this.id={id:new Js.Binary(pt.uuidV4(),Js.Binary.SUBTYPE_UUID)},this.lastUse=pt.processTimeMS(),this.txnNumber=0,this.isDirty=!1}hasTimedOut(e){return Math.round(pt.calculateDurationInMs(this.lastUse)%86400000%3600000/60000)>e-1}}F5.ServerSession=Dp;class r_{constructor(e){if(e==null)throw new U.MongoRuntimeError("ServerSessionPool requires a MongoClient");this.client=e,this.sessions=new pt.List}acquire(){let e=this.client.topology?.logicalSessionTimeoutMinutes??10,t=null;while(this.sessions.length>0){let r=this.sessions.shift();if(r!=null&&(!!this.client.topology?.loadBalanced||!r.hasTimedOut(e))){t=r;break}}if(t==null)t=new Dp;return t}release(e){let t=this.client.topology?.logicalSessionTimeoutMinutes??10;if(this.client.topology?.loadBalanced&&!t)this.sessions.unshift(e);if(!t)return;if(this.sessions.prune((r)=>r.hasTimedOut(t)),!e.hasTimedOut(t)){if(e.isDirty)return;this.sessions.unshift(e)}}}F5.ServerSessionPool=r_;function iae(e,t,r){if(e.hasEnded)return new U.MongoExpiredSessionError;let n=e.serverSession;if(n==null)return new U.MongoRuntimeError("Unable to acquire server session");if(r.writeConcern?.w===0){if(e&&e.explicit)return new U.MongoAPIError("Cannot have explicit session with unacknowledged writes");return}n.lastUse=pt.processTimeMS(),t.lsid=n.id;let s=e.inTransaction()||he.isTransactionCommand(t);if(!!r.willRetryWrite||s)n.txnNumber+=e.txnNumberIncrement,e.txnNumberIncrement=0,t.txnNumber=Js.Long.fromNumber(n.txnNumber);if(!s){if(e.transaction.state!==he.TxnState.NO_TRANSACTION)e.transaction.transition(he.TxnState.NO_TRANSACTION);if(e.supports.causalConsistency&&e.operationTime&&pt.commandSupportsAfterClusterTime(t))t.readConcern=t.readConcern||{},Object.assign(t.readConcern,{afterClusterTime:e.operationTime});else if(e.snapshotEnabled){if(t.readConcern=t.readConcern||{level:x5.ReadConcernLevel.snapshot},e.snapshotTime!=null)Object.assign(t.readConcern,{atClusterTime:e.snapshotTime})}return}if(t.autocommit=!1,e.transaction.state===he.TxnState.STARTING_TRANSACTION){t.startTransaction=!0;let o=e.transaction.options.readConcern||e?.clientOptions?.readConcern;if(o)t.readConcern=o;if(e.supports.causalConsistency&&e.operationTime)t.readConcern=t.readConcern||{},Object.assign(t.readConcern,{afterClusterTime:e.operationTime})}return}function oae(e,t){if(t.$clusterTime)tl._advanceClusterTime(e,t.$clusterTime);if(t.operationTime&&e&&e.supports.causalConsistency)e.advanceOperationTime(t.operationTime);if(t.recoveryToken&&e&&e.inTransaction())e.transaction._recoveryToken=t.recoveryToken;if(e?.snapshotEnabled&&e.snapshotTime==null){let r=t.atClusterTime;if(r)e.snapshotTime=r}if(e.transaction.state===he.TxnState.STARTING_TRANSACTION){if(t.ok===1)e.transaction.transition(he.TxnState.TRANSACTION_IN_PROGRESS);else if(!new U.MongoServerError(t.toObject()).hasErrorLabel(U.MongoErrorLabel.RetryableError))e.transaction.transition(he.TxnState.TRANSACTION_IN_PROGRESS)}}});var ps=g(function(L5){Object.defineProperty(L5,"__esModule",{value:!0});L5.CursorTimeoutContext=L5.AbstractCursor=L5.CursorTimeoutMode=L5.CURSOR_FLAGS=void 0;var I5=L("stream"),Xs=Se(),mt=J(),$5=Is(),Tp=Hr(),R5=QE(),v5=y5(),Mp=qi(),$u=Ur(),k5=Fh(),rl=Gn(),vt=ae();L5.CURSOR_FLAGS=["tailable","oplogReplay","noCursorTimeout","awaitData","exhaust","partial"];function N5(){this.client.s.activeCursors.delete(this)}L5.CursorTimeoutMode=Object.freeze({ITERATION:"iteration",LIFETIME:"cursorLifetime"});class q5 extends $5.TypedEventEmitter{static{this.CLOSE="close"}constructor(e,t,r={}){super();if(this.documents=null,this.hasEmittedClose=!1,this.on("error",vt.noop),r.timeoutMS=void 0,r.timeoutMode=void 0,!e.s.isMongoClient)throw new mt.MongoRuntimeError("Cursor must be constructed with MongoClient");this.cursorClient=e,this.cursorNamespace=t,this.cursorId=null,this.initialized=!1,this.isClosed=!1,this.isKilled=!1,this.cursorOptions={readPreference:r.readPreference&&r.readPreference instanceof $u.ReadPreference?r.readPreference:$u.ReadPreference.primary,...Xs.pluckBSONSerializeOptions(r),tailable:r.tailable,awaitData:r.awaitData};let n=Mp.ReadConcern.fromOptions(r);if(n)this.cursorOptions.readConcern=n;if(typeof r.batchSize==="number")this.cursorOptions.batchSize=r.batchSize;if(r.comment!==void 0)this.cursorOptions.comment=r.comment;if(typeof r.maxTimeMS==="number")this.cursorOptions.maxTimeMS=r.maxTimeMS;if(typeof r.maxAwaitTimeMS==="number")this.cursorOptions.maxAwaitTimeMS=r.maxAwaitTimeMS;this.cursorSession=r.session??null,this.deserializationOptions={...this.cursorOptions,validation:{utf8:r?.enableUtf8Validation===!1?!1:!0}},this.timeoutContext=r.timeoutContext,this.signal=r.signal,this.abortListener=vt.addAbortListener(this.signal,()=>void this.close().then(void 0,vt.squashError)),this.trackCursor()}get id(){return this.cursorId??void 0}get isDead(){return(this.cursorId?.isZero()??!1)||this.isClosed||this.isKilled}get client(){return this.cursorClient}get server(){return this.selectedServer}get namespace(){return this.cursorNamespace}get readPreference(){return this.cursorOptions.readPreference}get readConcern(){return this.cursorOptions.readConcern}get session(){return this.cursorSession}set session(e){this.cursorSession=e}get closed(){return this.isClosed&&(this.documents?.length??0)===0}get killed(){return this.isKilled}get loadBalanced(){return!!this.cursorClient.topology?.loadBalanced}async[Symbol.asyncDispose](){await this.close()}trackCursor(){if(this.cursorClient.s.activeCursors.add(this),!this.listeners("close").includes(N5))this.once("close",N5)}bufferedCount(){return this.documents?.length??0}readBufferedDocuments(e){let t=[],r=Math.min(e??this.documents?.length??0,this.documents?.length??0);for(let n=0;n<r;n++){let s=this.documents?.shift(this.deserializationOptions);if(s!=null)t.push(s)}return t}async*[Symbol.asyncIterator](){if(this.signal?.throwIfAborted(),this.closed)return;try{while(!0){if(this.isKilled)return;if(this.closed)return;if(this.cursorId!=null&&this.isDead&&(this.documents?.length??0)===0)return;let e=await this.next();if(e===null)return;yield e,this.signal?.throwIfAborted()}}finally{if(!this.isClosed)try{await this.close()}catch(e){vt.squashError(e)}}}stream(){let e=new j5(this),t=vt.addAbortListener(this.signal,function(){e.destroy(this.reason)});return e.once("end",()=>{t?.[vt.kDispose]()}),e}async hasNext(){if(this.signal?.throwIfAborted(),this.cursorId===Xs.Long.ZERO)return!1;if(this.cursorOptions.timeoutMode===L5.CursorTimeoutMode.ITERATION&&this.cursorId!=null)this.timeoutContext?.refresh();try{do{if((this.documents?.length??0)!==0)return!0;await this.fetchBatch()}while(!this.isDead||(this.documents?.length??0)!==0)}finally{if(this.cursorOptions.timeoutMode===L5.CursorTimeoutMode.ITERATION)this.timeoutContext?.clear()}return!1}async next(){if(this.signal?.throwIfAborted(),this.cursorId===Xs.Long.ZERO)throw new mt.MongoCursorExhaustedError;if(this.cursorOptions.timeoutMode===L5.CursorTimeoutMode.ITERATION&&this.cursorId!=null)this.timeoutContext?.refresh();try{do{let e=this.documents?.shift(this.deserializationOptions);if(e!=null){if(this.transform!=null)return await this.transformDocument(e);return e}await this.fetchBatch()}while(!this.isDead||(this.documents?.length??0)!==0)}finally{if(this.cursorOptions.timeoutMode===L5.CursorTimeoutMode.ITERATION)this.timeoutContext?.clear()}return null}async tryNext(){if(this.signal?.throwIfAborted(),this.cursorId===Xs.Long.ZERO)throw new mt.MongoCursorExhaustedError;if(this.cursorOptions.timeoutMode===L5.CursorTimeoutMode.ITERATION&&this.cursorId!=null)this.timeoutContext?.refresh();try{let e=this.documents?.shift(this.deserializationOptions);if(e!=null){if(this.transform!=null)return await this.transformDocument(e);return e}if(await this.fetchBatch(),e=this.documents?.shift(this.deserializationOptions),e!=null){if(this.transform!=null)return await this.transformDocument(e);return e}}finally{if(this.cursorOptions.timeoutMode===L5.CursorTimeoutMode.ITERATION)this.timeoutContext?.clear()}return null}async forEach(e){if(this.signal?.throwIfAborted(),typeof e!=="function")throw new mt.MongoInvalidArgumentError('Argument "iterator" must be a function');for await(let t of this)if(e(t)===!1)break}async close(e){await this.cleanup()}async toArray(){this.signal?.throwIfAborted();let e=[];for await(let t of this){e.push(t);let r=this.readBufferedDocuments();if(this.transform!=null)for(let n of r)e.push(await this.transformDocument(n));else for(let n of r)e.push(n)}return e}addCursorFlag(e,t){if(this.throwIfInitialized(),!L5.CURSOR_FLAGS.includes(e))throw new mt.MongoInvalidArgumentError(`Flag ${e} is not one of ${L5.CURSOR_FLAGS}`);if(typeof t!=="boolean")throw new mt.MongoInvalidArgumentError(`Flag ${e} must be a boolean value`);return this.cursorOptions[e]=t,this}map(e){this.throwIfInitialized();let t=this.transform;if(t)this.transform=(r)=>e(t(r));else this.transform=e;return this}withReadPreference(e){if(this.throwIfInitialized(),e instanceof $u.ReadPreference)this.cursorOptions.readPreference=e;else if(typeof e==="string")this.cursorOptions.readPreference=$u.ReadPreference.fromString(e);else throw new mt.MongoInvalidArgumentError(`Invalid read preference: ${e}`);return this}withReadConcern(e){this.throwIfInitialized();let t=Mp.ReadConcern.fromOptions({readConcern:e});if(t)this.cursorOptions.readConcern=t;return this}maxTimeMS(e){if(this.throwIfInitialized(),typeof e!=="number")throw new mt.MongoInvalidArgumentError("Argument for maxTimeMS must be a number");return this.cursorOptions.maxTimeMS=e,this}batchSize(e){if(this.throwIfInitialized(),this.cursorOptions.tailable)throw new mt.MongoTailableCursorError("Tailable cursor does not support batchSize");if(typeof e!=="number")throw new mt.MongoInvalidArgumentError('Operation "batchSize" requires an integer');return this.cursorOptions.batchSize=e,this}rewind(){if(this.timeoutContext&&this.timeoutContext.owner!==this)throw new mt.MongoAPIError("Cannot rewind cursor that does not own its timeout context.");if(!this.initialized)return;if(this.cursorId=null,this.documents?.clear(),this.timeoutContext?.clear(),this.timeoutContext=void 0,this.isClosed=!1,this.isKilled=!1,this.initialized=!1,this.hasEmittedClose=!1,this.trackCursor(),this.cursorSession?.explicit===!1){if(!this.cursorSession.hasEnded)this.cursorSession.endSession().then(void 0,vt.squashError);this.cursorSession=null}}async getMore(){if(this.cursorId==null)throw new mt.MongoRuntimeError("Unexpected null cursor id. A cursor creating command should have set this");if(this.selectedServer==null)throw new mt.MongoRuntimeError("Unexpected null selectedServer. A cursor creating command should have set this");if(this.cursorSession==null)throw new mt.MongoRuntimeError("Unexpected null session. A cursor creating command should have set this");let e={...this.cursorOptions,session:this.cursorSession,batchSize:this.cursorOptions.batchSize},t=new R5.GetMoreOperation(this.cursorNamespace,this.cursorId,this.selectedServer,e);return await Tp.executeOperation(this.cursorClient,t,this.timeoutContext)}async cursorInit(){if(this.cursorOptions.timeoutMS!=null)this.timeoutContext??=new Bh(rl.TimeoutContext.create({serverSelectionTimeoutMS:this.client.s.options.serverSelectionTimeoutMS,timeoutMS:this.cursorOptions.timeoutMS}),this);try{this.cursorSession??=this.cursorClient.startSession({owner:this,explicit:!1});let e=await this._initialize(this.cursorSession);this.cursorOptions.omitMaxTimeMS=this.cursorOptions.timeoutMS!=null;let t=e.response;this.selectedServer=e.server,this.cursorId=t.id,this.cursorNamespace=t.ns??this.namespace,this.documents=t,this.initialized=!0}catch(e){throw this.initialized=!0,await this.cleanup(void 0,e),e}if(this.isDead)await this.cleanup();return}async fetchBatch(){if(this.isClosed)return;if(this.isDead){await this.cleanup();return}if(this.cursorId==null){if(await this.cursorInit(),(this.documents?.length??0)!==0||this.isDead)return}try{let e=await this.getMore();this.cursorId=e.id,this.documents=e}catch(e){try{await this.cleanup(void 0,e)}catch(t){vt.squashError(t)}throw e}if(this.isDead)await this.cleanup()}async cleanup(e,t){this.abortListener?.[vt.kDispose](),this.isClosed=!0;let r=()=>{if(e!=null)return this.timeoutContext?.clear(),new Bh(rl.TimeoutContext.create({serverSelectionTimeoutMS:this.client.s.options.serverSelectionTimeoutMS,timeoutMS:e}),this);else return this.timeoutContext?.refreshed()};await(async(i)=>{try{await i()}finally{this.emitClose()}})(async()=>{let i=this.cursorSession;if(!i)return;try{if(!this.isKilled&&this.cursorId&&!this.cursorId.isZero()&&this.cursorNamespace&&this.selectedServer&&!i.hasEnded){this.isKilled=!0;let o=this.cursorId;this.cursorId=Xs.Long.ZERO,await Tp.executeOperation(this.cursorClient,new v5.KillCursorsOperation(o,this.cursorNamespace,this.selectedServer,{session:i}),r())}}catch(o){vt.squashError(o)}finally{if(i.owner===this)await i.endSession({error:t});if(!i.inTransaction())k5.maybeClearPinnedConnection(i,{error:t})}})}emitClose(){try{if(!this.hasEmittedClose&&((this.documents?.length??0)===0||this.isClosed))this.emit("close")}finally{this.hasEmittedClose=!0}}async transformDocument(e){if(this.transform==null)return e;try{let t=this.transform(e);if(t===null)throw new mt.MongoAPIError("Cursor returned a `null` document, but the cursor is not exhausted. Mapping documents to `null` is not supported in the cursor transform.");return t}catch(t){try{await this.close()}catch(r){vt.squashError(r)}throw t}}throwIfInitialized(){if(this.initialized)throw new mt.MongoCursorInUseError}}L5.AbstractCursor=q5;class j5 extends I5.Readable{constructor(e){super({objectMode:!0,autoDestroy:!1,highWaterMark:1});this._readInProgress=!1,this._cursor=e}_read(e){if(!this._readInProgress)this._readInProgress=!0,this._readNext()}_destroy(e,t){this._cursor.close().then(()=>t(e),(r)=>t(r))}_readNext(){if(this._cursor.id===Xs.Long.ZERO){this.push(null);return}this._cursor.next().then((e)=>{if(e==null)this.push(null);else if(this.destroyed)this._cursor.close().then(void 0,vt.squashError);else{if(this.push(e))return this._readNext();this._readInProgress=!1}},(e)=>{if(e.message.match(/server is closed/))return this._cursor.close().then(void 0,vt.squashError),this.push(null);if(e.message.match(/operation was interrupted/))return this.push(null);return this.destroy(e)}).catch((e)=>{this._readInProgress=!1,this.destroy(e)})}}class Bh extends rl.TimeoutContext{constructor(e,t){super();this.timeoutContext=e,this.owner=t}get serverSelectionTimeout(){return this.timeoutContext.serverSelectionTimeout}get connectionCheckoutTimeout(){return this.timeoutContext.connectionCheckoutTimeout}get clearServerSelectionTimeout(){return this.timeoutContext.clearServerSelectionTimeout}get timeoutForSocketWrite(){return this.timeoutContext.timeoutForSocketWrite}get timeoutForSocketRead(){return this.timeoutContext.timeoutForSocketRead}csotEnabled(){return this.timeoutContext.csotEnabled()}refresh(){if(typeof this.owner!=="symbol")return this.timeoutContext.refresh()}clear(){if(typeof this.owner!=="symbol")return this.timeoutContext.clear()}get maxTimeMS(){return this.timeoutContext.maxTimeMS}get timeoutMS(){return this.timeoutContext.csotEnabled()?this.timeoutContext.timeoutMS:null}refreshed(){return new Bh(this.timeoutContext.refreshed(),this.owner)}addMaxTimeMSToCommand(e,t){this.timeoutContext.addMaxTimeMSToCommand(e,t)}getSocketTimeoutMS(){return this.timeoutContext.getSocketTimeoutMS()}}L5.CursorTimeoutContext=Bh});var xp=g(function(W5){Object.defineProperty(W5,"__esModule",{value:!0});W5.ExplainableCursor=void 0;var V5=ps();class z5 extends V5.AbstractCursor{resolveExplainTimeoutOptions(e,t){let r,n;if(e==null&&t==null)r=void 0,n=void 0;else if(e!=null&&t==null)r=typeof e!=="object"?e:("verbosity"in e)?e:void 0,n=typeof e==="object"&&"timeoutMS"in e?e:void 0;else r=e,n=t;return{timeout:n,explain:r}}}W5.ExplainableCursor=z5});var Nh=g(function(Y5){Object.defineProperty(Y5,"__esModule",{value:!0});Y5.AggregationCursor=void 0;var Pp=J(),Fp=Mh(),Bp=Hr(),H5=ae(),Np=ps(),G5=xp();class s_ extends G5.ExplainableCursor{constructor(e,t,r=[],n={}){super(e,t,n);this.pipeline=r,this.aggregateOptions=n;let s=this.pipeline[this.pipeline.length-1];if(this.cursorOptions.timeoutMS!=null&&this.cursorOptions.timeoutMode===Np.CursorTimeoutMode.ITERATION&&(s?.$merge!=null||s?.$out!=null))throw new Pp.MongoAPIError("Cannot use $out or $merge stage with ITERATION timeoutMode")}clone(){let e=H5.mergeOptions({},this.aggregateOptions);return delete e.session,new s_(this.client,this.namespace,this.pipeline,{...e})}map(e){return super.map(e)}async _initialize(e){let t={...this.aggregateOptions,...this.cursorOptions,session:e,signal:this.signal},r=new Fp.AggregateOperation(this.namespace,this.pipeline,t),n=await Bp.executeOperation(this.client,r,this.timeoutContext);return{server:r.server,session:e,response:n}}async explain(e,t){let{explain:r,timeout:n}=this.resolveExplainTimeoutOptions(e,t);return(await Bp.executeOperation(this.client,new Fp.AggregateOperation(this.namespace,this.pipeline,{...this.aggregateOptions,...this.cursorOptions,...n,explain:r??!0}))).shift(this.deserializationOptions)}addStage(e){if(this.throwIfInitialized(),this.cursorOptions.timeoutMS!=null&&this.cursorOptions.timeoutMode===Np.CursorTimeoutMode.ITERATION&&(e.$out!=null||e.$merge!=null))throw new Pp.MongoAPIError("Cannot use $out or $merge stage with ITERATION timeoutMode");return this.pipeline.push(e),this}group(e){return this.addStage({$group:e})}limit(e){return this.addStage({$limit:e})}match(e){return this.addStage({$match:e})}out(e){return this.addStage({$out:e})}project(e){return this.addStage({$project:e})}lookup(e){return this.addStage({$lookup:e})}redact(e){return this.addStage({$redact:e})}skip(e){return this.addStage({$skip:e})}sort(e){return this.addStage({$sort:e})}unwind(e){return this.addStage({$unwind:e})}geoNear(e){return this.addStage({$geoNear:e})}}Y5.AggregationCursor=s_});var o_=g(function(Z5){Object.defineProperty(Z5,"__esModule",{value:!0});Z5.CountOperation=void 0;var J5=dt(),X5=nr(),Ru=Mt();class i_ extends X5.CommandOperation{constructor(e,t,r){super({s:{namespace:e}},r);this.SERVER_COMMAND_RESPONSE_TYPE=J5.MongoDBResponse,this.options=r,this.collectionName=e.collection,this.query=t}get commandName(){return"count"}buildCommandDocument(e,t){let r=this.options,n={count:this.collectionName,query:this.query};if(typeof r.limit==="number")n.limit=r.limit;if(typeof r.skip==="number")n.skip=r.skip;if(r.hint!=null)n.hint=r.hint;if(typeof r.maxTimeMS==="number")n.maxTimeMS=r.maxTimeMS;return n}handleOk(e){return e.getNumber("n")??0}}Z5.CountOperation=i_;Ru.defineAspects(i_,[Ru.Aspect.READ_OPERATION,Ru.Aspect.RETRYABLE,Ru.Aspect.SUPPORTS_RAW_DATA])});var uD=g(function(iD){Object.defineProperty(iD,"__esModule",{value:!0});iD.FindOperation=void 0;var nl=dt(),tD=J(),rD=Vc(),nD=ae(),sD=nr(),Zs=Mt();class u_ extends sD.CommandOperation{constructor(e,t={},r={}){super(void 0,r);if(this.SERVER_COMMAND_RESPONSE_TYPE=nl.CursorResponse,this.options={...r},delete this.options.writeConcern,this.ns=e,typeof t!=="object"||Array.isArray(t))throw new tD.MongoInvalidArgumentError("Query filter must be a plain object or ObjectId");this.filter=t!=null&&t._bsontype==="ObjectId"?{_id:t}:t,this.SERVER_COMMAND_RESPONSE_TYPE=this.explain?nl.ExplainedCursorResponse:nl.CursorResponse}get commandName(){return"find"}buildOptions(e){return{...this.options,...this.bsonOptions,documentsReturnedIn:"firstBatch",session:this.session,timeoutContext:e}}handleOk(e){return e}buildCommandDocument(){return dae(this.ns,this.filter,this.options)}}iD.FindOperation=u_;function dae(e,t,r){let n={find:e.collection,filter:t};if(r.sort)n.sort=rD.formatSort(r.sort);if(r.projection){let s=r.projection;if(s&&Array.isArray(s))s=s.length?s.reduce((i,o)=>(i[o]=1,i),{}):{_id:1};n.projection=s}if(r.hint)n.hint=nD.normalizeHintField(r.hint);if(typeof r.skip==="number")n.skip=r.skip;if(typeof r.limit==="number")if(r.limit<0)n.limit=-r.limit,n.singleBatch=!0;else n.limit=r.limit;if(typeof r.batchSize==="number")if(r.batchSize<0)n.limit=-r.batchSize;else if(r.batchSize===r.limit)n.batchSize=r.batchSize+1;else n.batchSize=r.batchSize;if(typeof r.singleBatch==="boolean")n.singleBatch=r.singleBatch;if(r.comment!==void 0)n.comment=r.comment;if(r.max)n.max=r.max;if(r.min)n.min=r.min;if(typeof r.returnKey==="boolean")n.returnKey=r.returnKey;if(typeof r.showRecordId==="boolean")n.showRecordId=r.showRecordId;if(typeof r.tailable==="boolean")n.tailable=r.tailable;if(typeof r.oplogReplay==="boolean")n.oplogReplay=r.oplogReplay;if(typeof r.timeout==="boolean")n.noCursorTimeout=!r.timeout;else if(typeof r.noCursorTimeout==="boolean")n.noCursorTimeout=r.noCursorTimeout;if(typeof r.awaitData==="boolean")n.awaitData=r.awaitData;if(typeof r.allowPartialResults==="boolean")n.allowPartialResults=r.allowPartialResults;if(typeof r.allowDiskUse==="boolean")n.allowDiskUse=r.allowDiskUse;if(r.let)n.let=r.let;return n}Zs.defineAspects(u_,[Zs.Aspect.READ_OPERATION,Zs.Aspect.RETRYABLE,Zs.Aspect.EXPLAINABLE,Zs.Aspect.CURSOR_CREATING,Zs.Aspect.SUPPORTS_RAW_DATA])});var c_=g(function(hD){Object.defineProperty(hD,"__esModule",{value:!0});hD.FindCursor=hD.FLAGS=void 0;var aD=dt(),cr=J(),cD=o_(),sl=Hr(),Ip=uD(),il=Vc(),vu=ae(),lD=xp();hD.FLAGS=["tailable","oplogReplay","noCursorTimeout","awaitData","exhaust","partial"];class a_ extends lD.ExplainableCursor{constructor(e,t,r={},n={}){super(e,t,n);if(this.numReturned=0,this.cursorFilter=r,this.findOptions=n,n.sort!=null)this.findOptions.sort=il.formatSort(n.sort)}clone(){let e=vu.mergeOptions({},this.findOptions);return delete e.session,new a_(this.client,this.namespace,this.cursorFilter,{...e})}map(e){return super.map(e)}async _initialize(e){let t={...this.findOptions,...this.cursorOptions,session:e,signal:this.signal},r=new Ip.FindOperation(this.namespace,this.cursorFilter,t),n=await sl.executeOperation(this.client,r,this.timeoutContext);return this.numReturned=n.batchSize,{server:r.server,session:e,response:n}}async getMore(){let e=this.numReturned,t=this.findOptions.limit??1/0,r=t-e;if(e===t&&!this.id?.isZero()){try{await this.close()}catch(i){vu.squashError(i)}return aD.CursorResponse.emptyGetMore}let n=vu.noop,{batchSize:s}=this.cursorOptions;if(s!=null&&s>r)this.cursorOptions.batchSize=r,n=()=>{this.cursorOptions.batchSize=s};try{let i=await super.getMore();return this.numReturned=this.numReturned+i.batchSize,i}finally{n?.()}}async count(e){if(vu.emitWarningOnce("cursor.count is deprecated and will be removed in the next major version, please use `collection.estimatedDocumentCount` or `collection.countDocuments` instead "),typeof e==="boolean")throw new cr.MongoInvalidArgumentError("Invalid first parameter to count");return await sl.executeOperation(this.client,new cD.CountOperation(this.namespace,this.cursorFilter,{...this.findOptions,...this.cursorOptions,...e}))}async explain(e,t){let{explain:r,timeout:n}=this.resolveExplainTimeoutOptions(e,t);return(await sl.executeOperation(this.client,new Ip.FindOperation(this.namespace,this.cursorFilter,{...this.findOptions,...this.cursorOptions,...n,explain:r??!0}))).shift(this.deserializationOptions)}filter(e){return this.throwIfInitialized(),this.cursorFilter=e,this}hint(e){return this.throwIfInitialized(),this.findOptions.hint=e,this}min(e){return this.throwIfInitialized(),this.findOptions.min=e,this}max(e){return this.throwIfInitialized(),this.findOptions.max=e,this}returnKey(e){return this.throwIfInitialized(),this.findOptions.returnKey=e,this}showRecordId(e){return this.throwIfInitialized(),this.findOptions.showRecordId=e,this}addQueryModifier(e,t){if(this.throwIfInitialized(),e[0]!=="$")throw new cr.MongoInvalidArgumentError(`${e} is not a valid query modifier`);switch(e.substr(1)){case"comment":this.findOptions.comment=t;break;case"explain":this.findOptions.explain=t;break;case"hint":this.findOptions.hint=t;break;case"max":this.findOptions.max=t;break;case"maxTimeMS":this.findOptions.maxTimeMS=t;break;case"min":this.findOptions.min=t;break;case"orderby":this.findOptions.sort=il.formatSort(t);break;case"query":this.cursorFilter=t;break;case"returnKey":this.findOptions.returnKey=t;break;case"showDiskLoc":this.findOptions.showRecordId=t;break;default:throw new cr.MongoInvalidArgumentError(`Invalid query modifier: ${e}`)}return this}comment(e){return this.throwIfInitialized(),this.findOptions.comment=e,this}maxAwaitTimeMS(e){if(this.throwIfInitialized(),typeof e!=="number")throw new cr.MongoInvalidArgumentError("Argument for maxAwaitTimeMS must be a number");return this.findOptions.maxAwaitTimeMS=e,this}maxTimeMS(e){if(this.throwIfInitialized(),typeof e!=="number")throw new cr.MongoInvalidArgumentError("Argument for maxTimeMS must be a number");return this.findOptions.maxTimeMS=e,this}project(e){return this.throwIfInitialized(),this.findOptions.projection=e,this}sort(e,t){if(this.throwIfInitialized(),this.findOptions.tailable)throw new cr.MongoTailableCursorError("Tailable cursor does not support sorting");return this.findOptions.sort=il.formatSort(e,t),this}allowDiskUse(e=!0){if(this.throwIfInitialized(),!this.findOptions.sort)throw new cr.MongoInvalidArgumentError('Option "allowDiskUse" requires a sort specification');if(!e)return this.findOptions.allowDiskUse=!1,this;return this.findOptions.allowDiskUse=!0,this}collation(e){return this.throwIfInitialized(),this.findOptions.collation=e,this}limit(e){if(this.throwIfInitialized(),this.findOptions.tailable)throw new cr.MongoTailableCursorError("Tailable cursor does not support limit");if(typeof e!=="number")throw new cr.MongoInvalidArgumentError('Operation "limit" requires an integer');return this.findOptions.limit=e,this}skip(e){if(this.throwIfInitialized(),this.findOptions.tailable)throw new cr.MongoTailableCursorError("Tailable cursor does not support skip");if(typeof e!=="number")throw new cr.MongoInvalidArgumentError('Operation "skip" requires an integer');return this.findOptions.skip=e,this}}hD.FindCursor=a_});var $h=g(function(pD){Object.defineProperty(pD,"__esModule",{value:!0});pD.ListIndexesOperation=pD.DropIndexOperation=pD.CreateIndexesOperation=void 0;var ol=dt(),dD=ae(),ul=nr(),lr=Mt(),mae=new Set(["background","unique","name","partialFilterExpression","sparse","hidden","expireAfterSeconds","storageEngine","collation","version","weights","default_language","language_override","textIndexVersion","2dsphereIndexVersion","bits","min","max","bucketSize","wildcardProjection"]);function yae(e){return typeof e==="number"||e==="2d"||e==="2dsphere"||e==="text"||e==="geoHaystack"}function gae(e){return Array.isArray(e)&&e.length===2&&yae(e[1])}function Eae(e){let t=new Map,r=!Array.isArray(e)||gae(e)?[e]:e;for(let n of r)if(typeof n==="string")t.set(n,1);else if(Array.isArray(n))t.set(n[0],n[1]??1);else if(n instanceof Map)for(let[s,i]of n)t.set(s,i);else if(dD.isObject(n))for(let[s,i]of Object.entries(n))t.set(s,i);return t}var _ae=new Map([["version","v"],["defaultLanguage","default_language"],["languageOverride","language_override"]]);function Aae(e,t){let r=Object.entries(e).filter(([n])=>n!=="key"&&(t||mae.has(n)));return Object.fromEntries(r.map(([n,s])=>[_ae.get(n)??n,s]))}class Ih extends ul.CommandOperation{constructor(e,t,r,n,s){super(e,s);this.SERVER_COMMAND_RESPONSE_TYPE=ol.MongoDBResponse,this.options={...s},this.options.collation=void 0,this.collectionName=t,this.indexes=r.map((i)=>{let o=i.key instanceof Map?i.key:new Map(Object.entries(i.key)),u=i.name??Array.from(o).flat().join("_");return{...Aae(i,n),name:u,key:o}}),this.ns=e.s.namespace}static fromIndexDescriptionArray(e,t,r,n,s){return new Ih(e,t,r,n,s)}static fromIndexSpecification(e,t,r,n,s,i){let o=Eae(r),u={...s,key:o};return new Ih(e,t,[u],n,i??s)}get commandName(){return"createIndexes"}buildCommandDocument(e){let t=this.options,r=this.indexes,n={createIndexes:this.collectionName,indexes:r};if(t.commitQuorum!=null)n.commitQuorum=t.commitQuorum;return n}handleOk(e){return this.indexes.map((r)=>r.name||"")}}pD.CreateIndexesOperation=Ih;class l_ extends ul.CommandOperation{constructor(e,t,r){super(e,r);this.SERVER_COMMAND_RESPONSE_TYPE=ol.MongoDBResponse,this.options=r??{},this.collection=e,this.indexName=t,this.ns=e.fullNamespace}get commandName(){return"dropIndexes"}buildCommandDocument(e){return{dropIndexes:this.collection.collectionName,index:this.indexName}}}pD.DropIndexOperation=l_;class h_ extends ul.CommandOperation{constructor(e,t){super(e,t);this.SERVER_COMMAND_RESPONSE_TYPE=ol.CursorResponse,this.options={...t},delete this.options.writeConcern,this.collectionNamespace=e.s.namespace}get commandName(){return"listIndexes"}buildCommandDocument(e){let t=this.options.batchSize?{batchSize:this.options.batchSize}:{},r={listIndexes:this.collectionNamespace.collection,cursor:t};if(this.options.comment!==void 0)r.comment=this.options.comment;return r}handleOk(e){return e}}pD.ListIndexesOperation=h_;lr.defineAspects(h_,[lr.Aspect.READ_OPERATION,lr.Aspect.RETRYABLE,lr.Aspect.CURSOR_CREATING,lr.Aspect.SUPPORTS_RAW_DATA]);lr.defineAspects(Ih,[lr.Aspect.WRITE_OPERATION,lr.Aspect.SUPPORTS_RAW_DATA]);lr.defineAspects(l_,[lr.Aspect.WRITE_OPERATION,lr.Aspect.SUPPORTS_RAW_DATA])});var d_=g(function(_D){Object.defineProperty(_D,"__esModule",{value:!0});_D.ListIndexesCursor=void 0;var yD=Hr(),gD=$h(),ED=ps();class f_ extends ED.AbstractCursor{constructor(e,t){super(e.client,e.s.namespace,{...t});this.parent=e,this.options=t}clone(){return new f_(this.parent,{...this.options,...this.cursorOptions})}async _initialize(e){let t=new gD.ListIndexesOperation(this.parent,{...this.cursorOptions,...this.options,session:e}),r=await yD.executeOperation(this.parent.client,t,this.timeoutContext);return{server:t.server,session:e,response:r}}}_D.ListIndexesCursor=f_});var bD=g(function(SD){Object.defineProperty(SD,"__esModule",{value:!0});SD.ListSearchIndexesCursor=void 0;var wD=Nh();class OD extends wD.AggregationCursor{constructor({fullNamespace:e,client:t},r,n={}){let s=r==null?[{$listSearchIndexes:{}}]:[{$listSearchIndexes:{name:r}}];super(t,e,s,n)}}SD.ListSearchIndexesCursor=OD});var PD=g(function(MD){Object.defineProperty(MD,"__esModule",{value:!0});MD.DistinctOperation=void 0;var DD=dt(),TD=nr(),so=Mt();class p_ extends TD.CommandOperation{constructor(e,t,r,n){super(e,n);this.SERVER_COMMAND_RESPONSE_TYPE=DD.MongoDBResponse,this.options=n??{},this.collection=e,this.key=t,this.query=r}get commandName(){return"distinct"}buildCommandDocument(e){let t={distinct:this.collection.collectionName,key:this.key,query:this.query};if(this.options.comment!==void 0)t.comment=this.options.comment;if(this.options.hint!=null)t.hint=this.options.hint;return t}handleOk(e){if(this.explain)return e.toObject(this.bsonOptions);return e.toObject(this.bsonOptions).values}}MD.DistinctOperation=p_;so.defineAspects(p_,[so.Aspect.READ_OPERATION,so.Aspect.RETRYABLE,so.Aspect.EXPLAINABLE,so.Aspect.SUPPORTS_RAW_DATA])});var $D=g(function(ND){Object.defineProperty(ND,"__esModule",{value:!0});ND.EstimatedDocumentCountOperation=void 0;var FD=dt(),BD=nr(),io=Mt();class m_ extends BD.CommandOperation{constructor(e,t={}){super(e,t);this.SERVER_COMMAND_RESPONSE_TYPE=FD.MongoDBResponse,this.options=t,this.collectionName=e.collectionName}get commandName(){return"count"}buildCommandDocument(e,t){let r={count:this.collectionName};if(typeof this.options.maxTimeMS==="number")r.maxTimeMS=this.options.maxTimeMS;if(this.options.comment!==void 0)r.comment=this.options.comment;return r}handleOk(e){return e.getNumber("n")??0}}ND.EstimatedDocumentCountOperation=m_;io.defineAspects(m_,[io.Aspect.READ_OPERATION,io.Aspect.RETRYABLE,io.Aspect.CURSOR_CREATING,io.Aspect.SUPPORTS_RAW_DATA])});var y_=g(function(zD){Object.defineProperty(zD,"__esModule",{value:!0});zD.FindOneAndUpdateOperation=zD.FindOneAndReplaceOperation=zD.FindOneAndDeleteOperation=zD.FindAndModifyOperation=zD.ReturnDocument=void 0;var RD=dt(),ms=J(),vD=Ur(),kD=Vc(),al=ae(),qD=nr(),oo=Mt();zD.ReturnDocument=Object.freeze({BEFORE:"before",AFTER:"after"});function jD(e,t){if(e.new=t.returnDocument===zD.ReturnDocument.AFTER,e.upsert=t.upsert===!0,t.bypassDocumentValidation===!0)e.bypassDocumentValidation=t.bypassDocumentValidation;return e}class cl extends qD.CommandOperation{constructor(e,t,r){super(e,r);this.SERVER_COMMAND_RESPONSE_TYPE=RD.MongoDBResponse,this.options=r,this.readPreference=vD.ReadPreference.primary,this.collection=e,this.query=t}get commandName(){return"findAndModify"}buildCommandDocument(e,t){let r=this.options,n={findAndModify:this.collection.collectionName,query:this.query,remove:!1,new:!1,upsert:!1};r.includeResultMetadata??=!1;let s=kD.formatSort(r.sort);if(s)n.sort=s;if(r.projection)n.fields=r.projection;if(r.maxTimeMS)n.maxTimeMS=r.maxTimeMS;if(r.writeConcern)n.writeConcern=r.writeConcern;if(r.let)n.let=r.let;if(r.comment!==void 0)n.comment=r.comment;if(al.decorateWithCollation(n,r),r.hint)n.hint=r.hint;return n}handleOk(e){let t=super.handleOk(e);return this.options.includeResultMetadata?t:t.value??null}}zD.FindAndModifyOperation=cl;class LD extends cl{constructor(e,t,r){if(t==null||typeof t!=="object")throw new ms.MongoInvalidArgumentError('Argument "filter" must be an object');super(e,t,r)}buildCommandDocument(e,t){let r=super.buildCommandDocument(e,t);return r.remove=!0,r}}zD.FindOneAndDeleteOperation=LD;class UD extends cl{constructor(e,t,r,n){if(t==null||typeof t!=="object")throw new ms.MongoInvalidArgumentError('Argument "filter" must be an object');if(r==null||typeof r!=="object")throw new ms.MongoInvalidArgumentError('Argument "replacement" must be an object');if(al.hasAtomicOperators(r))throw new ms.MongoInvalidArgumentError("Replacement document must not contain atomic operators");super(e,t,n);this.replacement=r}buildCommandDocument(e,t){let r=super.buildCommandDocument(e,t);return r.update=this.replacement,jD(r,this.options),r}}zD.FindOneAndReplaceOperation=UD;class VD extends cl{constructor(e,t,r,n){if(t==null||typeof t!=="object")throw new ms.MongoInvalidArgumentError('Argument "filter" must be an object');if(r==null||typeof r!=="object")throw new ms.MongoInvalidArgumentError('Argument "update" must be an object');if(!al.hasAtomicOperators(r,n))throw new ms.MongoInvalidArgumentError("Update document requires atomic operators");super(e,t,n);this.update=r,this.options=n}buildCommandDocument(e,t){let r=super.buildCommandDocument(e,t);if(r.update=this.update,jD(r,this.options),this.options.arrayFilters)r.arrayFilters=this.options.arrayFilters;return r}}zD.FindOneAndUpdateOperation=VD;oo.defineAspects(cl,[oo.Aspect.WRITE_OPERATION,oo.Aspect.RETRYABLE,oo.Aspect.EXPLAINABLE,oo.Aspect.SUPPORTS_RAW_DATA])});var E_=g(function(JD){Object.defineProperty(JD,"__esModule",{value:!0});JD.RenameOperation=void 0;var HD=dt(),GD=ll(),YD=ae(),QD=nr(),$p=Mt();class g_ extends QD.CommandOperation{constructor(e,t,r){super(e,r);this.SERVER_COMMAND_RESPONSE_TYPE=HD.MongoDBResponse,this.collection=e,this.newName=t,this.options=r,this.ns=new YD.MongoDBNamespace("admin","$cmd")}get commandName(){return"renameCollection"}buildCommandDocument(e,t){let r=this.collection.namespace,n=this.collection.s.namespace.withCollection(this.newName).toString(),s=typeof this.options.dropTarget==="boolean"?this.options.dropTarget:!1;return{renameCollection:r,to:n,dropTarget:s}}handleOk(e){return new GD.Collection(this.collection.db,this.newName,this.collection.s.options)}}JD.RenameOperation=g_;$p.defineAspects(g_,[$p.Aspect.WRITE_OPERATION])});var sT=g(function(rT){Object.defineProperty(rT,"__esModule",{value:!0});rT.CreateSearchIndexesOperation=void 0;var ZD=dt(),eT=Mt();class tT extends eT.AbstractOperation{constructor(e,t){super();this.SERVER_COMMAND_RESPONSE_TYPE=ZD.MongoDBResponse,this.collection=e,this.descriptions=t,this.ns=e.fullNamespace}get commandName(){return"createSearchIndexes"}buildCommand(e,t){return{createSearchIndexes:this.collection.fullNamespace.collection,indexes:this.descriptions}}handleOk(e){return super.handleOk(e).indexesCreated.map((t)=>t.name)}buildOptions(e){return{session:this.session,timeoutContext:e}}}rT.CreateSearchIndexesOperation=tT});var lT=g(function(aT){Object.defineProperty(aT,"__esModule",{value:!0});aT.DropSearchIndexOperation=void 0;var iT=dt(),Rp=J(),oT=Mt();class uT extends oT.AbstractOperation{constructor(e,t){super();this.SERVER_COMMAND_RESPONSE_TYPE=iT.MongoDBResponse,this.collection=e,this.name=t,this.ns=e.fullNamespace}get commandName(){return"dropSearchIndex"}buildCommand(e,t){let n={dropSearchIndex:this.collection.fullNamespace.collection};if(typeof this.name==="string")n.name=this.name;return n}handleOk(e){}buildOptions(e){return{session:this.session,timeoutContext:e}}handleError(e){if(!(e instanceof Rp.MongoServerError&&Rp.isNamespaceNotFoundError(e)))throw e}}aT.DropSearchIndexOperation=uT});var yT=g(function(pT){Object.defineProperty(pT,"__esModule",{value:!0});pT.UpdateSearchIndexOperation=void 0;var hT=dt(),fT=Mt();class dT extends fT.AbstractOperation{constructor(e,t,r){super();this.SERVER_COMMAND_RESPONSE_TYPE=hT.MongoDBResponse,this.collection=e,this.name=t,this.definition=r,this.ns=e.fullNamespace}get commandName(){return"updateSearchIndex"}buildCommand(e,t){return{updateSearchIndex:this.collection.fullNamespace.collection,name:this.name,definition:this.definition}}handleOk(e){}buildOptions(e){return{session:this.session,timeoutContext:e}}}pT.UpdateSearchIndexOperation=dT});var ll=g(function($T){Object.defineProperty($T,"__esModule",{value:!0});$T.Collection=void 0;var gT=Se(),ET=LE(),_T=UE(),AT=pl(),wT=Nh(),OT=c_(),ST=d_(),CT=bD(),ys=J(),bT=o_(),vp=EE(),DT=PD(),TT=$D(),je=Hr(),hl=y_(),uo=$h(),MT=DE(),xT=E_(),PT=sT(),FT=lT(),BT=yT(),fl=PE(),NT=qi(),dl=Ur(),fe=ae(),kp=Hn();class IT{constructor(e,t,r){this.db=e,this.s={db:e,options:r,namespace:new fe.MongoDBCollectionNamespace(e.databaseName,t),pkFactory:e.options?.pkFactory??fe.DEFAULT_PK_FACTORY,readPreference:dl.ReadPreference.fromOptions(r),bsonOptions:gT.resolveBSONOptions(r,e),readConcern:NT.ReadConcern.fromOptions(r),writeConcern:kp.WriteConcern.fromOptions(r)},this.client=e.client}get dbName(){return this.s.namespace.db}get collectionName(){return this.s.namespace.collection}get namespace(){return this.fullNamespace.toString()}get fullNamespace(){return this.s.namespace}get readConcern(){if(this.s.readConcern==null)return this.db.readConcern;return this.s.readConcern}get readPreference(){if(this.s.readPreference==null)return this.db.readPreference;return this.s.readPreference}get bsonOptions(){return this.s.bsonOptions}get writeConcern(){if(this.s.writeConcern==null)return this.db.writeConcern;return this.s.writeConcern}get hint(){return this.s.collectionHint}set hint(e){this.s.collectionHint=fe.normalizeHintField(e)}get timeoutMS(){return}async insertOne(e,t){return await je.executeOperation(this.client,new MT.InsertOneOperation(this,e,fe.resolveOptions(this,t)))}async insertMany(e,t){if(!Array.isArray(e))throw new ys.MongoInvalidArgumentError('Argument "docs" must be an array of documents');t=fe.resolveOptions(this,t??{});let r=kp.WriteConcern.fromOptions(t)?.w!==0;try{let n=await this.bulkWrite(e.map((s)=>({insertOne:{document:s}})),t);return{acknowledged:r,insertedCount:n.insertedCount,insertedIds:n.insertedIds}}catch(n){if(n&&n.message==="Operation must be an object with an operation key")throw new ys.MongoInvalidArgumentError("Collection.insertMany() cannot be called with an array that has null/undefined values");throw n}}async bulkWrite(e,t){if(!Array.isArray(e))throw new ys.MongoInvalidArgumentError('Argument "operations" must be an array of documents');if(t=fe.resolveOptions(this,t??{}),this.client.topology==null)await je.autoConnect(this.client);let n=t.ordered===!1?this.initializeUnorderedBulkOp(t):this.initializeOrderedBulkOp(t);for(let s of e)n.raw(s);return await n.execute({...t})}async updateOne(e,t,r){return await je.executeOperation(this.client,new fl.UpdateOneOperation(this.s.namespace,e,t,fe.resolveOptions(this,r)))}async replaceOne(e,t,r){return await je.executeOperation(this.client,new fl.ReplaceOneOperation(this.s.namespace,e,t,fe.resolveOptions(this,r)))}async updateMany(e,t,r){return await je.executeOperation(this.client,new fl.UpdateManyOperation(this.s.namespace,e,t,fe.resolveOptions(this,r)))}async deleteOne(e={},t={}){return await je.executeOperation(this.client,new vp.DeleteOneOperation(this.s.namespace,e,fe.resolveOptions(this,t)))}async deleteMany(e={},t={}){return await je.executeOperation(this.client,new vp.DeleteManyOperation(this.s.namespace,e,fe.resolveOptions(this,t)))}async rename(e,t){return await je.executeOperation(this.client,new xT.RenameOperation(this,e,fe.resolveOptions(void 0,{...t,readPreference:dl.ReadPreference.PRIMARY})))}async drop(e){return await this.db.dropCollection(this.collectionName,e)}async findOne(e={},t={}){let{...r}=t;r.singleBatch=!0;let n=this.find(e,r).limit(1),s=await n.next();return await n.close(),s}find(e={},t={}){return new OT.FindCursor(this.client,this.s.namespace,e,fe.resolveOptions(this,t))}async options(e){e=fe.resolveOptions(this,e);let[t]=await this.db.listCollections({name:this.collectionName},{...e,nameOnly:!1}).toArray();if(t==null||t.options==null)throw new ys.MongoAPIError(`collection ${this.namespace} not found`);return t.options}async isCapped(e){let{capped:t}=await this.options(e);return Boolean(t)}async createIndex(e,t,r){let n=r==null?uo.CreateIndexesOperation.fromIndexSpecification(this,this.collectionName,e,!1,fe.resolveOptions(this,t),void 0):uo.CreateIndexesOperation.fromIndexSpecification(this,this.collectionName,e,!0,t,fe.resolveOptions(this,r));return(await je.executeOperation(this.client,n))[0]}async createIndexes(e,t,r=!1){return await je.executeOperation(this.client,uo.CreateIndexesOperation.fromIndexDescriptionArray(this,this.collectionName,e,r,fe.resolveOptions(this,{...t,maxTimeMS:void 0})))}async dropIndex(e,t){return await je.executeOperation(this.client,new uo.DropIndexOperation(this,e,{...fe.resolveOptions(this,t),readPreference:dl.ReadPreference.primary}))}async dropIndexes(e){try{return await je.executeOperation(this.client,new uo.DropIndexOperation(this,"*",fe.resolveOptions(this,e))),!0}catch(t){if(t instanceof ys.MongoServerError&&ys.isNamespaceNotFoundError(t))return!1;throw t}}listIndexes(e){return new ST.ListIndexesCursor(this,fe.resolveOptions(this,e))}async indexExists(e,t){let r=Array.isArray(e)?e:[e],n=new Set(await this.listIndexes(t).map(({name:s})=>s).toArray());return r.every((s)=>n.has(s))}async indexInformation(e){return await this.indexes({...e,full:e?.full??!1})}async estimatedDocumentCount(e){return await je.executeOperation(this.client,new TT.EstimatedDocumentCountOperation(this,fe.resolveOptions(this,e)))}async countDocuments(e={},t={}){let r=[];if(r.push({$match:e}),typeof t.skip==="number")r.push({$skip:t.skip});if(typeof t.limit==="number")r.push({$limit:t.limit});r.push({$group:{_id:1,n:{$sum:1}}});let n=this.aggregate(r,t),s=await n.next();return await n.close(),s?.n??0}async distinct(e,t={},r={}){return await je.executeOperation(this.client,new DT.DistinctOperation(this,e,t,fe.resolveOptions(this,r)))}async indexes(e){let t=await this.listIndexes(e).toArray();if(e?.full??!0)return t;return Object.fromEntries(t.map(({name:s,key:i})=>[s,Object.entries(i)]))}async findOneAndDelete(e,t){return await je.executeOperation(this.client,new hl.FindOneAndDeleteOperation(this,e,fe.resolveOptions(this,t)))}async findOneAndReplace(e,t,r){return await je.executeOperation(this.client,new hl.FindOneAndReplaceOperation(this,e,t,fe.resolveOptions(this,r)))}async findOneAndUpdate(e,t,r){return await je.executeOperation(this.client,new hl.FindOneAndUpdateOperation(this,e,t,fe.resolveOptions(this,r)))}aggregate(e=[],t){if(!Array.isArray(e))throw new ys.MongoInvalidArgumentError('Argument "pipeline" must be an array of aggregation stages');return new wT.AggregationCursor(this.client,this.s.namespace,e,fe.resolveOptions(this,t))}watch(e=[],t={}){if(!Array.isArray(e))t=e,e=[];return new AT.ChangeStream(this,e,fe.resolveOptions(this,t))}initializeUnorderedBulkOp(e){return new _T.UnorderedBulkOperation(this,fe.resolveOptions(this,e))}initializeOrderedBulkOp(e){return new ET.OrderedBulkOperation(this,fe.resolveOptions(this,e))}async count(e={},t={}){return await je.executeOperation(this.client,new bT.CountOperation(this.fullNamespace,e,fe.resolveOptions(this,t)))}listSearchIndexes(e,t){t=typeof e==="object"?e:t==null?{}:t;let r=e==null?null:typeof e==="object"?null:e;return new CT.ListSearchIndexesCursor(this,r,{...t})}async createSearchIndex(e){let[t]=await this.createSearchIndexes([e]);return t}async createSearchIndexes(e){return await je.executeOperation(this.client,new PT.CreateSearchIndexesOperation(this,e))}async dropSearchIndex(e){return await je.executeOperation(this.client,new FT.DropSearchIndexOperation(this,e))}async updateSearchIndex(e,t){return await je.executeOperation(this.client,new BT.UpdateSearchIndexOperation(this,e,t))}}$T.Collection=IT});var A_=g(function(jT){Object.defineProperty(jT,"__esModule",{value:!0});jT.ChangeStreamCursor=void 0;var ml=pl(),qp=wr(),vT=Mh(),kT=Hr(),jp=ae(),qT=ps();class __ extends qT.AbstractCursor{constructor(e,t,r=[],n={}){super(e,t,{...n,tailable:!0,awaitData:!0});if(this.pipeline=r,this.changeStreamCursorOptions=n,this._resumeToken=null,this.startAtOperationTime=n.startAtOperationTime??null,n.startAfter)this.resumeToken=n.startAfter;else if(n.resumeAfter)this.resumeToken=n.resumeAfter}set resumeToken(e){this._resumeToken=e,this.emit(ml.ChangeStream.RESUME_TOKEN_CHANGED,e)}get resumeToken(){return this._resumeToken}get resumeOptions(){let e={...this.changeStreamCursorOptions};for(let t of["resumeAfter","startAfter","startAtOperationTime"])delete e[t];if(this.resumeToken!=null)if(this.changeStreamCursorOptions.startAfter&&!this.hasReceived)e.startAfter=this.resumeToken;else e.resumeAfter=this.resumeToken;else if(this.startAtOperationTime!=null)e.startAtOperationTime=this.startAtOperationTime;return e}cacheResumeToken(e){if(this.bufferedCount()===0&&this.postBatchResumeToken)this.resumeToken=this.postBatchResumeToken;else this.resumeToken=e;this.hasReceived=!0}_processBatch(e){let{postBatchResumeToken:t}=e;if(t){if(this.postBatchResumeToken=t,e.batchSize===0)this.resumeToken=t}}clone(){return new __(this.client,this.namespace,this.pipeline,{...this.cursorOptions})}async _initialize(e){let t=new vT.AggregateOperation(this.namespace,this.pipeline,{...this.cursorOptions,...this.changeStreamCursorOptions,session:e}),r=await kT.executeOperation(e.client,t,this.timeoutContext),n=t.server;if(this.maxWireVersion=jp.maxWireVersion(n),this.startAtOperationTime==null&&this.changeStreamCursorOptions.resumeAfter==null&&this.changeStreamCursorOptions.startAfter==null)this.startAtOperationTime=r.operationTime;return this._processBatch(r),this.emit(qp.INIT,r),this.emit(qp.RESPONSE),{server:n,session:e,response:r}}async getMore(){let e=await super.getMore();return this.maxWireVersion=jp.maxWireVersion(this.server),this._processBatch(e),this.emit(ml.ChangeStream.MORE,e),this.emit(ml.ChangeStream.RESPONSE),e}}jT.ChangeStreamCursor=__});var WT=g(function(VT){Object.defineProperty(VT,"__esModule",{value:!0});VT.ListCollectionsOperation=void 0;var yl=dt(),UT=nr(),ao=Mt();class w_ extends UT.CommandOperation{constructor(e,t,r){super(e,r);if(this.SERVER_COMMAND_RESPONSE_TYPE=yl.CursorResponse,this.options={...r},delete this.options.writeConcern,this.db=e,this.filter=t,this.nameOnly=!!this.options.nameOnly,this.authorizedCollections=!!this.options.authorizedCollections,typeof this.options.batchSize==="number")this.batchSize=this.options.batchSize;this.SERVER_COMMAND_RESPONSE_TYPE=this.explain?yl.ExplainedCursorResponse:yl.CursorResponse}get commandName(){return"listCollections"}buildCommandDocument(e){let t={listCollections:1,filter:this.filter,cursor:this.batchSize?{batchSize:this.batchSize}:{},nameOnly:this.nameOnly,authorizedCollections:this.authorizedCollections};if(this.options.comment!==void 0)t.comment=this.options.comment;return t}handleOk(e){return e}}VT.ListCollectionsOperation=w_;ao.defineAspects(w_,[ao.Aspect.READ_OPERATION,ao.Aspect.RETRYABLE,ao.Aspect.CURSOR_CREATING,ao.Aspect.SUPPORTS_RAW_DATA])});var S_=g(function(YT){Object.defineProperty(YT,"__esModule",{value:!0});YT.ListCollectionsCursor=void 0;var KT=Hr(),HT=WT(),GT=ps();class O_ extends GT.AbstractCursor{constructor(e,t,r){super(e.client,e.s.namespace,{...r});this.parent=e,this.filter=t,this.options=r}clone(){return new O_(this.parent,this.filter,{...this.options,...this.cursorOptions})}async _initialize(e){let t=new HT.ListCollectionsOperation(this.parent,this.filter,{...this.cursorOptions,...this.options,session:e,signal:this.signal}),r=await KT.executeOperation(this.parent.client,t,this.timeoutContext);return{server:t.server,session:e,response:r}}}YT.ListCollectionsCursor=O_});var sM=g(function(rM){Object.defineProperty(rM,"__esModule",{value:!0});rM.RunCommandCursor=void 0;var ei=J(),Lp=Hr(),JT=QE(),XT=Lc(),ZT=ae(),eM=ps();class tM extends eM.AbstractCursor{setComment(e){return this.getMoreOptions.comment=e,this}setMaxTimeMS(e){return this.getMoreOptions.maxAwaitTimeMS=e,this}setBatchSize(e){return this.getMoreOptions.batchSize=e,this}clone(){throw new ei.MongoAPIError("Clone not supported, create a new cursor with db.runCursorCommand")}withReadConcern(e){throw new ei.MongoAPIError("RunCommandCursor does not support readConcern it must be attached to the command being run")}addCursorFlag(e,t){throw new ei.MongoAPIError("RunCommandCursor does not support cursor flags, they must be attached to the command being run")}maxTimeMS(e){throw new ei.MongoAPIError("maxTimeMS must be configured on the command document directly, to configure getMore.maxTimeMS use cursor.setMaxTimeMS()")}batchSize(e){throw new ei.MongoAPIError("batchSize must be configured on the command document directly, to configure getMore.batchSize use cursor.setBatchSize()")}constructor(e,t,r={}){super(e.client,ZT.ns(e.namespace),r);this.getMoreOptions={},this.db=e,this.command=Object.freeze({...t})}async _initialize(e){let t=new XT.RunCursorCommandOperation(this.db.s.namespace,this.command,{...this.cursorOptions,session:e,readPreference:this.cursorOptions.readPreference}),r=await Lp.executeOperation(this.client,t,this.timeoutContext);return{server:t.server,session:e,response:r}}async getMore(){if(!this.session)throw new ei.MongoRuntimeError("Unexpected null session. A cursor creating command should have set this");let e=new JT.GetMoreOperation(this.namespace,this.id,this.server,{...this.cursorOptions,session:this.session,...this.getMoreOptions});return await Lp.executeOperation(this.client,e,this.timeoutContext)}}rM.RunCommandCursor=tM});var pM=g(function(fM){Object.defineProperty(fM,"__esModule",{value:!0});fM.CreateCollectionOperation=void 0;fM.createCollections=Mae;var Up=zo(),iM=dt(),oM=ll(),uM=J(),aM=Gn(),cM=ae(),lM=nr(),gl=Hr(),hM=$h(),Vp=Mt(),Dae=new Set(["w","wtimeout","timeoutMS","j","fsync","pkFactory","raw","readPreference","session","readConcern","writeConcern","raw","fieldsAsRaw","useBigInt64","promoteLongs","promoteValues","promoteBuffers","bsonRegExp","serializeFunctions","ignoreUndefined","enableUtf8Validation"]),Tae="Driver support of Queryable Encryption is incompatible with server. Upgrade server to use Queryable Encryption.";class Rh extends lM.CommandOperation{constructor(e,t,r={}){super(e,r);this.SERVER_COMMAND_RESPONSE_TYPE=iM.MongoDBResponse,this.options=r,this.db=e,this.name=t}get commandName(){return"create"}buildCommandDocument(e,t){let r=([n,s])=>s!=null&&typeof s!=="function"&&!Dae.has(n);return{create:this.name,...Object.fromEntries(Object.entries(this.options).filter(r))}}handleOk(e){return new oM.Collection(this.db,this.name,this.options)}}fM.CreateCollectionOperation=Rh;async function Mae(e,t,r){let n=aM.TimeoutContext.create({session:r.session,serverSelectionTimeoutMS:e.client.s.options.serverSelectionTimeoutMS,waitQueueTimeoutMS:e.client.s.options.waitQueueTimeoutMS,timeoutMS:r.timeoutMS}),s=r.encryptedFields??e.client.s.options.autoEncryption?.encryptedFieldsMap?.[`${e.databaseName}.${t}`];if(s){class o extends Rh{buildCommandDocument(c,l){if(!c.description.loadBalanced&&cM.maxWireVersion(c)<Up.MIN_SUPPORTED_QE_WIRE_VERSION)throw new uM.MongoCompatibilityError(`${Tae} The minimum server version required is ${Up.MIN_SUPPORTED_QE_SERVER_VERSION}`);return super.buildCommandDocument(c,l)}}let u=s.escCollection??`enxcol_.${t}.esc`,a=s.ecocCollection??`enxcol_.${t}.ecoc`;for(let c of[u,a]){let l=new o(e,c,{clusteredIndex:{key:{_id:1},unique:!0},session:r.session});await gl.executeOperation(e.client,l,n)}if(!r.encryptedFields)r={...r,encryptedFields:s}}let i=await gl.executeOperation(e.client,new Rh(e,t,r),n);if(s){let o=hM.CreateIndexesOperation.fromIndexSpecification(e,t,{__safeContent__:1},!1,{session:r.session},void 0);await gl.executeOperation(e.client,o,n)}return i}Vp.defineAspects(Rh,[Vp.Aspect.WRITE_OPERATION])});var wM=g(function(_M){Object.defineProperty(_M,"__esModule",{value:!0});_M.DropDatabaseOperation=_M.DropCollectionOperation=void 0;_M.dropCollections=Pae;var mM=qu(),Wp=dt(),yM=ps(),gM=J(),EM=Gn(),Kp=nr(),zp=Hr(),ku=Mt();class vh extends Kp.CommandOperation{constructor(e,t,r={}){super(e,r);this.SERVER_COMMAND_RESPONSE_TYPE=Wp.MongoDBResponse,this.options=r,this.name=t}get commandName(){return"drop"}buildCommandDocument(e,t){return{drop:this.name}}handleOk(e){return!0}handleError(e){if(!(e instanceof mM.MongoServerError&&gM.isNamespaceNotFoundError(e)))throw e;return!1}}_M.DropCollectionOperation=vh;async function Pae(e,t,r){let n=EM.TimeoutContext.create({session:r.session,serverSelectionTimeoutMS:e.client.s.options.serverSelectionTimeoutMS,waitQueueTimeoutMS:e.client.s.options.waitQueueTimeoutMS,timeoutMS:r.timeoutMS}),s=e.client.s.options.autoEncryption?.encryptedFieldsMap,i=r.encryptedFields??s?.[`${e.databaseName}.${t}`];if(!i&&s)i=(await e.listCollections({name:t},{nameOnly:!1,session:r.session,timeoutContext:new yM.CursorTimeoutContext(n,Symbol())}).toArray())?.[0]?.options?.encryptedFields;if(i){let o=i.escCollection||`enxcol_.${t}.esc`,u=i.ecocCollection||`enxcol_.${t}.ecoc`;for(let a of[o,u]){let c=new vh(e,a,r);await zp.executeOperation(e.client,c,n)}}return await zp.executeOperation(e.client,new vh(e,t,r),n)}class C_ extends Kp.CommandOperation{constructor(e,t){super(e,t);this.SERVER_COMMAND_RESPONSE_TYPE=Wp.MongoDBResponse,this.options=t}get commandName(){return"dropDatabase"}buildCommandDocument(e,t){return{dropDatabase:1}}handleOk(e){return!0}}_M.DropDatabaseOperation=C_;ku.defineAspects(vh,[ku.Aspect.WRITE_OPERATION]);ku.defineAspects(C_,[ku.Aspect.WRITE_OPERATION])});var xM=g(function(TM){Object.defineProperty(TM,"__esModule",{value:!0});TM.ProfilingLevelOperation=void 0;var OM=Se(),SM=dt(),Hp=J(),CM=nr();class bM extends SM.MongoDBResponse{get was(){return this.get("was",OM.BSONType.int,!0)}}class DM extends CM.CommandOperation{constructor(e,t){super(e,t);this.SERVER_COMMAND_RESPONSE_TYPE=bM,this.options=t}get commandName(){return"profile"}buildCommandDocument(e){return{profile:-1}}handleOk(e){if(e.ok===1){let t=e.was;if(t===0)return"off";if(t===1)return"slow_only";if(t===2)return"all";throw new Hp.MongoUnexpectedServerResponseError(`Illegal profiling level value ${t}`)}else throw new Hp.MongoUnexpectedServerResponseError("Error with profile command")}}TM.ProfilingLevelOperation=DM});var b_=g(function($M){Object.defineProperty($M,"__esModule",{value:!0});$M.SetProfilingLevelOperation=$M.ProfilingLevel=void 0;var PM=dt(),FM=J(),BM=ae(),NM=nr(),Nae=new Set(["off","slow_only","all"]);$M.ProfilingLevel=Object.freeze({off:"off",slowOnly:"slow_only",all:"all"});class IM extends NM.CommandOperation{constructor(e,t,r){super(e,r);switch(this.SERVER_COMMAND_RESPONSE_TYPE=PM.MongoDBResponse,this.options=r,t){case $M.ProfilingLevel.off:this.profile=0;break;case $M.ProfilingLevel.slowOnly:this.profile=1;break;case $M.ProfilingLevel.all:this.profile=2;break;default:this.profile=0;break}this.level=t}get commandName(){return"profile"}buildCommandDocument(e){let t=this.level;if(!Nae.has(t))throw new FM.MongoInvalidArgumentError(`Profiling level must be one of "${BM.enumToString($M.ProfilingLevel)}"`);return{profile:this.profile}}handleOk(e){return this.level}}$M.SetProfilingLevelOperation=IM});var LM=g(function(qM){Object.defineProperty(qM,"__esModule",{value:!0});qM.DbStatsOperation=void 0;var vM=dt(),kM=nr(),Gp=Mt();class D_ extends kM.CommandOperation{constructor(e,t){super(e,t);this.SERVER_COMMAND_RESPONSE_TYPE=vM.MongoDBResponse,this.options=t}get commandName(){return"dbStats"}buildCommandDocument(e){let t={dbStats:!0};if(this.options.scale!=null)t.scale=this.options.scale;return t}}qM.DbStatsOperation=D_;Gp.defineAspects(D_,[Gp.Aspect.READ_OPERATION])});var em=g(function(sx){Object.defineProperty(sx,"__esModule",{value:!0});sx.Db=void 0;var UM=jE(),Yp=Se(),VM=pl(),Qp=ll(),ti=wr(),zM=Nh(),WM=S_(),KM=sM(),Jp=J(),HM=pM(),Xp=wM(),Tn=Hr(),GM=$h(),YM=xM(),QM=qE(),JM=E_(),XM=Lc(),ZM=b_(),ex=LM(),tx=qi(),Zp=Ur(),Ye=ae(),rx=Hn(),Iae=["writeConcern","readPreference","readPreferenceTags","native_parser","forceServerObjectId","pkFactory","serializeFunctions","raw","authSource","ignoreUndefined","readConcern","retryMiliSeconds","numberOfRetries","useBigInt64","promoteBuffers","promoteLongs","bsonRegExp","enableUtf8Validation","promoteValues","compression","retryWrites"];class nx{static{this.SYSTEM_NAMESPACE_COLLECTION=ti.SYSTEM_NAMESPACE_COLLECTION}static{this.SYSTEM_INDEX_COLLECTION=ti.SYSTEM_INDEX_COLLECTION}static{this.SYSTEM_PROFILE_COLLECTION=ti.SYSTEM_PROFILE_COLLECTION}static{this.SYSTEM_USER_COLLECTION=ti.SYSTEM_USER_COLLECTION}static{this.SYSTEM_COMMAND_COLLECTION=ti.SYSTEM_COMMAND_COLLECTION}static{this.SYSTEM_JS_COLLECTION=ti.SYSTEM_JS_COLLECTION}constructor(e,t,r){if(r=r??{},r=Ye.filterOptions(r,Iae),typeof t==="string"&&t.includes("."))throw new Jp.MongoInvalidArgumentError("Database names cannot contain the character '.'");this.s={options:r,readPreference:Zp.ReadPreference.fromOptions(r),bsonOptions:Yp.resolveBSONOptions(r,e),pkFactory:r?.pkFactory??Ye.DEFAULT_PK_FACTORY,readConcern:tx.ReadConcern.fromOptions(r),writeConcern:rx.WriteConcern.fromOptions(r),namespace:new Ye.MongoDBNamespace(t)},this.client=e}get databaseName(){return this.s.namespace.db}get options(){return this.s.options}get secondaryOk(){return this.s.readPreference?.preference!=="primary"||!1}get readConcern(){return this.s.readConcern}get readPreference(){if(this.s.readPreference==null)return this.client.readPreference;return this.s.readPreference}get bsonOptions(){return this.s.bsonOptions}get writeConcern(){return this.s.writeConcern}get namespace(){return this.s.namespace.toString()}get timeoutMS(){return}async createCollection(e,t){return t=Ye.resolveOptions(this,t),await HM.createCollections(this,e,t)}async command(e,t){return await Tn.executeOperation(this.client,new XM.RunCommandOperation(this.s.namespace,e,Ye.resolveOptions(void 0,{...Yp.resolveBSONOptions(t),timeoutMS:t?.timeoutMS??this.timeoutMS,session:t?.session,readPreference:t?.readPreference,signal:t?.signal})))}aggregate(e=[],t){return new zM.AggregationCursor(this.client,this.s.namespace,e,Ye.resolveOptions(this,t))}admin(){return new UM.Admin(this)}collection(e,t={}){if(typeof t==="function")throw new Jp.MongoInvalidArgumentError("The callback form of this helper has been removed.");return new Qp.Collection(this,e,Ye.resolveOptions(this,t))}async stats(e){return await Tn.executeOperation(this.client,new ex.DbStatsOperation(this,Ye.resolveOptions(this,e)))}listCollections(e={},t={}){return new WM.ListCollectionsCursor(this,e,Ye.resolveOptions(this,t))}async renameCollection(e,t,r){return await Tn.executeOperation(this.client,new JM.RenameOperation(this.collection(e),t,Ye.resolveOptions(void 0,{...r,readPreference:Zp.ReadPreference.primary})))}async dropCollection(e,t){return t=Ye.resolveOptions(this,t),await Xp.dropCollections(this,e,t)}async dropDatabase(e){return await Tn.executeOperation(this.client,new Xp.DropDatabaseOperation(this,Ye.resolveOptions(this,e)))}async collections(e){return e=Ye.resolveOptions(this,e),(await this.listCollections({},{...e,nameOnly:!0}).toArray()).filter(({name:r})=>!r.includes("$")).map(({name:r})=>new Qp.Collection(this,r,this.s.options))}async createIndex(e,t,r){return(await Tn.executeOperation(this.client,GM.CreateIndexesOperation.fromIndexSpecification(this,e,t,!1,r??{},void 0)))[0]}async removeUser(e,t){return await Tn.executeOperation(this.client,new QM.RemoveUserOperation(this,e,Ye.resolveOptions(this,t)))}async setProfilingLevel(e,t){return await Tn.executeOperation(this.client,new ZM.SetProfilingLevelOperation(this,e,Ye.resolveOptions(this,t)))}async profilingLevel(e){return await Tn.executeOperation(this.client,new YM.ProfilingLevelOperation(this,Ye.resolveOptions(this,e)))}async indexInformation(e,t){return await this.collection(e).indexInformation(Ye.resolveOptions(this,t))}watch(e=[],t={}){if(!Array.isArray(e))t=e,e=[];return new VM.ChangeStream(this,e,Ye.resolveOptions(this,t))}runCursorCommand(e,t){return new KM.RunCommandCursor(this,e,{...t})}}sx.Db=nx});var ju=g(function(cx){Object.defineProperty(cx,"__esModule",{value:!0});cx.AuthProvider=cx.AuthContext=void 0;var ox=J();class ux{constructor(e,t,r){this.reauthenticating=!1,this.connection=e,this.credentials=t,this.options=r}}cx.AuthContext=ux;class ax{async prepare(e,t){return e}async reauth(e){if(e.reauthenticating)throw new ox.MongoRuntimeError("Reauthentication already in progress.");try{e.reauthenticating=!0,await this.auth(e)}finally{e.reauthenticating=!1}}}cx.AuthProvider=ax});var nm=g(function(gx){Object.defineProperty(gx,"__esModule",{value:!0});gx.GSSAPI=gx.GSSAPICanonicalizationValue=void 0;gx.performGSSAPICanonicalizeHostName=yx;gx.resolveCname=M_;var El=L("dns"),hx=eo(),rm=J(),fx=ae(),dx=ju();gx.GSSAPICanonicalizationValue=Object.freeze({on:!0,off:!1,none:"none",forward:"forward",forwardAndReverse:"forwardAndReverse"});async function T_(e,t){return await e.command(fx.ns("$external.$cmd"),t)}var qh;class px extends dx.AuthProvider{async auth(e){let{connection:t,credentials:r}=e;if(r==null)throw new rm.MongoMissingCredentialsError("Credentials required for GSSAPI authentication");let{username:n}=r,s=await Rae(e),i=await s.step(""),o=await T_(t,vae(i)),u=await mx(s,10,o.payload),a=await T_(t,kae(u,o.conversationId)),c=await qae(s,n,a.payload);await T_(t,{saslContinue:1,conversationId:a.conversationId,payload:c})}}gx.GSSAPI=px;async function Rae({options:{hostAddress:e,runtime:t},credentials:r}){if(!e||typeof e.host!=="string"||!r)throw new rm.MongoInvalidArgumentError("Connection must have host and port and credentials defined.");let{os:n}=await t;if(jae(),"kModuleError"in qh)throw qh.kModuleError;let{initializeClient:s}=qh,{username:i,password:o}=r,u=r.mechanismProperties,a=u.SERVICE_NAME??"mongodb",c=await yx(e.host,u),l={};if(o!=null)Object.assign(l,{user:i,password:o});let f=u.SERVICE_HOST??c,h=`${a}${n.platform()==="win32"?"/":"@"}${f}`;if("SERVICE_REALM"in u)h=`${h}@${u.SERVICE_REALM}`;return await s(h,l)}function vae(e){return{saslStart:1,mechanism:"GSSAPI",payload:e,autoAuthorize:1}}function kae(e,t){return{saslContinue:1,conversationId:t,payload:e}}async function mx(e,t,r){try{return await e.step(r)||""}catch(n){if(t===0)throw n;return await mx(e,t-1,r)}}async function qae(e,t,r){let n=await e.unwrap(r);return await e.wrap(n||"",{user:t})}async function yx(e,t){let r=t.CANONICALIZE_HOST_NAME;if(!r||r===gx.GSSAPICanonicalizationValue.none)return e;if(r===gx.GSSAPICanonicalizationValue.on||r===gx.GSSAPICanonicalizationValue.forwardAndReverse){let{address:n}=await El.promises.lookup(e);try{let s=await El.promises.resolve(n,"PTR");return s.length>0?s[0]:e}catch{return await M_(e)}}else return await M_(e)}async function M_(e){try{let t=await El.promises.resolve(e,"CNAME");return t.length>0?t[0]:e}catch{return e}}function jae(){if(!qh)qh=hx.getKerberos()}});var co=g(function(_x){Object.defineProperty(_x,"__esModule",{value:!0});_x.AUTH_MECHS_AUTH_SRC_EXTERNAL=_x.AuthMechanism=void 0;_x.AuthMechanism=Object.freeze({MONGODB_AWS:"MONGODB-AWS",MONGODB_DEFAULT:"DEFAULT",MONGODB_GSSAPI:"GSSAPI",MONGODB_PLAIN:"PLAIN",MONGODB_SCRAM_SHA1:"SCRAM-SHA-1",MONGODB_SCRAM_SHA256:"SCRAM-SHA-256",MONGODB_X509:"MONGODB-X509",MONGODB_OIDC:"MONGODB-OIDC"});_x.AUTH_MECHS_AUTH_SRC_EXTERNAL=new Set([_x.AuthMechanism.MONGODB_GSSAPI,_x.AuthMechanism.MONGODB_AWS,_x.AuthMechanism.MONGODB_OIDC,_x.AuthMechanism.MONGODB_X509])});var im=g(function(Cx){Object.defineProperty(Cx,"__esModule",{value:!0});Cx.MongoCredentials=Cx.DEFAULT_ALLOWED_HOSTS=void 0;var xt=J(),Sx=nm(),yt=co();function Vae(e){if(e){if(Array.isArray(e.saslSupportedMechs))return e.saslSupportedMechs.includes(yt.AuthMechanism.MONGODB_SCRAM_SHA256)?yt.AuthMechanism.MONGODB_SCRAM_SHA256:yt.AuthMechanism.MONGODB_SCRAM_SHA1}return yt.AuthMechanism.MONGODB_SCRAM_SHA256}var wx=["test","azure","gcp","k8s"],Ox="Auth mechanism property ALLOWED_HOSTS must be an array of strings.";Cx.DEFAULT_ALLOWED_HOSTS=["*.mongodb.net","*.mongodb-qa.net","*.mongodb-dev.net","*.mongodbgov.net","localhost","127.0.0.1","::1","*.mongo.com"];var zae="TOKEN_RESOURCE must be set in the auth mechanism properties when ENVIRONMENT is azure or gcp.";class sm{constructor(e){if(this.username=e.username??"",this.password=e.password,this.source=e.source,!this.source&&e.db)this.source=e.db;if(this.mechanism=e.mechanism||yt.AuthMechanism.MONGODB_DEFAULT,this.mechanismProperties=e.mechanismProperties||{},this.mechanism===yt.AuthMechanism.MONGODB_OIDC&&!this.mechanismProperties.ALLOWED_HOSTS)this.mechanismProperties={...this.mechanismProperties,ALLOWED_HOSTS:Cx.DEFAULT_ALLOWED_HOSTS};Object.freeze(this.mechanismProperties),Object.freeze(this)}equals(e){return this.mechanism===e.mechanism&&this.username===e.username&&this.password===e.password&&this.source===e.source}resolveAuthMechanism(e){if(this.mechanism.match(/DEFAULT/i))return new sm({username:this.username,password:this.password,source:this.source,mechanism:Vae(e),mechanismProperties:this.mechanismProperties});return this}validate(){if((this.mechanism===yt.AuthMechanism.MONGODB_GSSAPI||this.mechanism===yt.AuthMechanism.MONGODB_PLAIN||this.mechanism===yt.AuthMechanism.MONGODB_SCRAM_SHA1||this.mechanism===yt.AuthMechanism.MONGODB_SCRAM_SHA256)&&!this.username)throw new xt.MongoMissingCredentialsError(`Username required for mechanism '${this.mechanism}'`);if(this.mechanism===yt.AuthMechanism.MONGODB_PLAIN&&(this.username.includes("\x00")||this.password.includes("\x00")))throw new xt.MongoInvalidArgumentError(`Username and password cannot contain NUL characters for mechanism '${this.mechanism}'`);if(this.mechanism===yt.AuthMechanism.MONGODB_OIDC){if(this.username&&this.mechanismProperties.ENVIRONMENT&&this.mechanismProperties.ENVIRONMENT!=="azure")throw new xt.MongoInvalidArgumentError(`username and a non-azure ENVIRONMENT may not be used together for mechanism '${this.mechanism}'.`);if(this.username&&this.password)throw new xt.MongoInvalidArgumentError(`No password is allowed with a username for '${this.mechanism}'.`);if((this.mechanismProperties.ENVIRONMENT==="azure"||this.mechanismProperties.ENVIRONMENT==="gcp")&&!this.mechanismProperties.TOKEN_RESOURCE)throw new xt.MongoInvalidArgumentError(zae);if(this.mechanismProperties.ENVIRONMENT&&!wx.includes(this.mechanismProperties.ENVIRONMENT))throw new xt.MongoInvalidArgumentError(`Currently only a ENVIRONMENT in ${wx.join(",")} is supported for mechanism '${this.mechanism}'.`);if(!this.mechanismProperties.ENVIRONMENT&&!this.mechanismProperties.OIDC_CALLBACK&&!this.mechanismProperties.OIDC_HUMAN_CALLBACK)throw new xt.MongoInvalidArgumentError(`Either a ENVIRONMENT, OIDC_CALLBACK, or OIDC_HUMAN_CALLBACK must be specified for mechanism '${this.mechanism}'.`);if(this.mechanismProperties.ENVIRONMENT&&(this.mechanismProperties.OIDC_CALLBACK||this.mechanismProperties.OIDC_HUMAN_CALLBACK))throw new xt.MongoInvalidArgumentError(`ENVIRONMENT may not be used together with OIDC_CALLBACK or OIDC_HUMAN_CALLBACK for mechanism '${this.mechanism}'.`);if(this.mechanismProperties.ALLOWED_HOSTS){let t=this.mechanismProperties.ALLOWED_HOSTS;if(!Array.isArray(t))throw new xt.MongoInvalidArgumentError(Ox);for(let r of t)if(typeof r!=="string")throw new xt.MongoInvalidArgumentError(Ox)}}if(yt.AUTH_MECHS_AUTH_SRC_EXTERNAL.has(this.mechanism)){if(this.source!=null&&this.source!=="$external")throw new xt.MongoAPIError(`Invalid source for mechanism '${this.mechanism}' specified, it must be '$external'.`)}if(this.mechanism===yt.AuthMechanism.MONGODB_PLAIN&&this.source==null)throw new xt.MongoAPIError("PLAIN Authentication Mechanism needs an auth source");if(this.mechanism===yt.AuthMechanism.MONGODB_X509&&this.password!=null){if(this.password===""){Reflect.set(this,"password",void 0);return}throw new xt.MongoAPIError("Password not allowed for mechanism MONGODB-X509")}let e=this.mechanismProperties.CANONICALIZE_HOST_NAME??!1;if(!Object.values(Sx.GSSAPICanonicalizationValue).includes(e))throw new xt.MongoAPIError("Invalid CANONICALIZE_HOST_NAME value")}[Symbol.for("nodejs.util.inspect.custom")](e,t,r){return r(this.toJSON(),t)}toJSON(){let e={...this,username:"<redacted>",password:"<redacted>"};if(this.mechanismProperties.AWS_SESSION_TOKEN!=null)e.mechanismProperties={...this.mechanismProperties,AWS_SESSION_TOKEN:"<redacted>"};return e}static merge(e,t){return new sm({username:t.username??e?.username??"",password:t.password??e?.password??"",mechanism:t.mechanism??e?.mechanism??yt.AuthMechanism.MONGODB_DEFAULT,mechanismProperties:t.mechanismProperties??e?.mechanismProperties??{},source:t.source??t.db??e?.source??"admin"})}}Cx.MongoCredentials=sm});var Tx=g(function(o8e,Wae){Wae.exports={name:"mongodb",version:"7.9.1",description:"The official MongoDB driver for Node.js",main:"lib/index.js",files:["lib","src","etc/prepare.js","mongodb.d.ts","tsconfig.json"],types:"mongodb.d.ts",repository:{type:"git",url:"git@github.com:mongodb/node-mongodb-native.git"},keywords:["mongodb","driver","official"],author:{name:"The MongoDB NodeJS Team",email:"dbx-node@mongodb.com"},dependencies:{"@mongodb-js/saslprep":"^1.5.0",bson:"^7.3.2","mongodb-connection-string-url":"^7.0.2"},peerDependencies:{"@aws-sdk/credential-providers":"^3.806.0","@mongodb-js/zstd":"^7.0.0","gcp-metadata":"^7.0.1",kerberos:"^7.0.0","mongodb-client-encryption":"^7.2.0",snappy:"^7.3.2",socks:"^2.8.6"},peerDependenciesMeta:{"@aws-sdk/credential-providers":{optional:!0},"@mongodb-js/zstd":{optional:!0},kerberos:{optional:!0},snappy:{optional:!0},"mongodb-client-encryption":{optional:!0},"gcp-metadata":{optional:!0},socks:{optional:!0}},devDependencies:{"@aws-sdk/credential-providers":"^3.1117.0","@iarna/toml":"^2.2.5","@istanbuljs/nyc-config-typescript":"^1.0.2","@microsoft/api-extractor":"^7.59.0","@microsoft/tsdoc-config":"^0.18.1","@mongodb-js/zstd":"^7.0.0","@types/chai-subset":"^1.3.6","@types/express":"^5.0.6","@types/kerberos":"^1.1.5","@types/mocha":"^10.0.10","@types/node":"^22.20.1","@types/saslprep":"^1.0.3","@types/semver":"^7.8.0","@types/sinon":"^17.0.4","@types/whatwg-url":"^13.0.0","@typescript-eslint/eslint-plugin":"^8.68.0","@typescript-eslint/parser":"^8.68.0",aws4:"^1.13.2",chai:"^5.3.3","chai-subset":"^1.6.0",chalk:"^4.1.2",esbuild:"^0.28.2",eslint:"^9.39.5","eslint-config-prettier":"^10.1.8","eslint-plugin-mocha":"^10.5.0","eslint-plugin-prettier":"^5.5.6","eslint-plugin-simple-import-sort":"^12.1.1","eslint-plugin-tsdoc":"^0.5.2","eslint-plugin-unused-imports":"^4.4.1",express:"^5.2.1","gcp-metadata":"^7.0.1","js-yaml":"^4.3.1",mocha:"^11.8.0","mocha-sinon":"^2.1.2","mongodb-client-encryption":"^7.2.1",nyc:"^17.1.0",prettier:"3.6.2",semver:"^7.8.5",sinon:"^18.0.1","sinon-chai":"^4.0.1",snappy:"^7.4.3",socks:"^2.8.9","source-map-support":"^0.5.21","ts-node":"^10.9.2",tsd:"^0.33.0",typescript:"5.8.3","typescript-cached-transpile":"^0.0.6","v8-heapsnapshot":"^1.3.1",yargs:"^18.1.0"},license:"Apache-2.0",engines:{node:">=20.19.0"},bugs:{url:"https://jira.mongodb.org/projects/NODE/issues/"},homepage:"https://github.com/mongodb/node-mongodb-native",scripts:{"build:evergreen":"node .evergreen/generate_evergreen_tasks.js","build:ts":"node ./node_modules/typescript/bin/tsc","build:dts":"npm run build:ts && api-extractor run && node etc/clean_definition_files.cjs && ESLINT_USE_FLAT_CONFIG=false eslint --no-ignore --fix mongodb.d.ts","build:docs":"./etc/docs/build.ts","build:typedoc":"typedoc","build:nightly":"node ./.github/scripts/nightly.mjs","check:bench":"npm --prefix test/benchmarks/driver_bench start","check:coverage":"nyc npm run test:all","check:integration-coverage":"nyc npm run check:test","check:lambda":"npm run build:bundle && nyc mocha --config test/mocha_lambda.js test/integration/node-specific/examples/handler.test.js","check:lambda:aws":"npm run build:bundle && nyc mocha --config test/mocha_lambda.js test/integration/node-specific/examples/aws_handler.test.js","check:lint":"npm run build:dts && npm run check:dts && npm run check:eslint && npm run check:tsd","check:eslint":"npm run build:dts && ESLINT_USE_FLAT_CONFIG=false eslint -v && ESLINT_USE_FLAT_CONFIG=false eslint --max-warnings=0 --ext '.js,.ts' src test","check:tsd":"tsd --version && tsd","check:dependencies":"npm run build:bundle && mocha test/action/dependency.test.ts","check:dts":"npm run build:bundle && node ./node_modules/typescript/bin/tsc --target es2023 --module commonjs --noEmit mongodb.d.ts && tsd","check:search-indexes":"npm run build:bundle && nyc mocha --config test/mocha_mongodb.js test/manual/search-index-management.prose.test.ts","check:test":"npm run build:bundle && nyc mocha --config test/mocha_mongodb.js test/integration","check:test:debug":"npm run mocha:debug -- --config test/mocha_mongodb.js test/integration","check:test-bundled":"MONGODB_BUNDLED=true npm run check:test","check:unit":"npm run build:bundle && nyc mocha test/unit","check:unit:debug":"npm run mocha:debug -- test/unit","check:unit-bundled":"MONGODB_BUNDLED=true npm run check:unit","check:ts":"node ./node_modules/typescript/bin/tsc -v && node ./node_modules/typescript/bin/tsc --noEmit","check:atlas":"npm run build:bundle && nyc mocha --config test/manual/mocharc.js test/manual/atlas_connectivity.test.ts","check:drivers-atlas-testing":"npm run build:bundle && nyc mocha --config test/mocha_mongodb.js test/atlas/drivers_atlas_testing.test.ts","check:aws":"npm run build:bundle && nyc mocha --config test/mocha_mongodb.js test/integration/auth/mongodb_aws.test.ts test/integration/auth/mongodb_aws.prose.test.ts","check:oidc-auth":"npm run build:bundle && nyc mocha --config test/mocha_mongodb.js test/integration/auth/auth.spec.test.ts","check:oidc-test":"npm run build:bundle && nyc mocha --config test/mocha_mongodb.js test/integration/auth/mongodb_oidc.prose.test.ts","check:kerberos":"npm run build:bundle && nyc mocha --config test/manual/mocharc.js test/manual/kerberos.test.ts","check:tls":"npm run build:bundle && nyc mocha --config test/manual/mocharc.js test/manual/tls_support.test.ts","check:ldap":"npm run build:bundle && nyc mocha --config test/manual/mocharc.js test/manual/ldap.test.ts","check:socks5":"npm run build:bundle && nyc mocha --config test/manual/mocharc.js test/manual/socks5.test.ts","check:csfle":"npm run build:bundle && nyc mocha --config test/mocha_mongodb.js test/integration/client-side-encryption","check:snappy":"npm run build:bundle && nyc mocha test/unit/assorted/snappy.test.js","check:x509":"npm run build:bundle && nyc mocha test/manual/x509_auth.test.ts","check:sfp":"npm run build:bundle && nyc mocha test/manual/sfp.test.ts","mocha:debug":"npm run build:bundle && node --inspect --enable-source-maps --no-experimental-strip-types ./node_modules/mocha/bin/mocha.js","build:bundle":"npm run bundle:driver && npm run bundle:types && npm run build:runtime-barrel","build:runtime-barrel":"node etc/build-runtime-barrel.mjs","bundle:driver":"node etc/bundle-driver.mjs","bundle:types":"npx tsc --project ./tsconfig.json --declaration --emitDeclarationOnly --declarationDir test/tools/runner/bundle/types","fix:eslint":"npm run check:eslint -- --fix",prepare:"node etc/prepare.js","preview:docs":"ts-node etc/docs/preview.ts","switch:to-bundled":"MONGODB_BUNDLED=true npm run build:runtime-barrel","switch:to-unbundled":"MONGODB_BUNDLED=false npm run build:runtime-barrel",test:"npm run check:lint && npm run test:all","test:all":"npm run check:unit && npm run check:test","update:docs":"npm run build:docs -- --yes"},tsd:{directory:"test/types",compilerOptions:{strict:!0,target:"esnext",module:"commonjs",moduleResolution:"node"}}}});var x_=g(function(Fx){Object.defineProperty(Fx,"__esModule",{value:!0});Fx.LimitedSizeDocument=void 0;Fx.isDriverInfoEqual=Hae;Fx.makeClientMetadata=Gae;Fx.getFAASEnv=Px;var _l=L("process"),Nr=Se(),om=J(),xx=ae(),Kae=Tx().version;function Hae(e,t){let r=(n,s)=>(n||=void 0,s||=void 0,n===s);return r(e.name,t.name)&&r(e.platform,t.platform)&&r(e.version,t.version)}class um{constructor(e){this.document=new Map,this.documentSize=5,this.maxSize=e}ifItFitsItSits(e,t){let r=Nr.BSON.serialize(new Map().set(e,t)).byteLength-5;if(r+this.documentSize>this.maxSize)return!1;return this.documentSize+=r,this.document.set(e,t),!0}toObject(){return Nr.BSON.deserialize(Nr.BSON.serialize(this.document),{promoteLongs:!1,promoteBuffers:!1,promoteValues:!1,useBigInt64:!1})}}Fx.LimitedSizeDocument=um;async function Gae(e,{appName:t="",runtime:r}){let{os:n}=await r,s=new um(512);if(t.length>0){let c=Nr.ByteUtils.utf8ByteLength(t)<=128?t:Nr.ByteUtils.toUTF8(Nr.ByteUtils.fromUTF8(t),0,128,!1);s.ifItFitsItSits("application",{name:c})}let i={name:"nodejs",version:Kae};for(let{name:c="",version:l=""}of e){if(c.length>0)i.name=`${i.name}|${c}`;if(l.length>0)i.version=`${i.version}|${l}`}if(!s.ifItFitsItSits("driver",i))throw new om.MongoInvalidArgumentError("Unable to include driverInfo name and version, metadata cannot exceed 512 bytes");let o=Jae();for(let{platform:c=""}of e)if(c.length>0)o=`${o}|${c}`;if(!s.ifItFitsItSits("platform",o))throw new om.MongoInvalidArgumentError("Unable to include driverInfo platform, metadata cannot exceed 512 bytes");let u=new Map().set("name",n.platform()).set("architecture",n.arch()).set("version",n.release()).set("type",n.type());if(!s.ifItFitsItSits("os",u))for(let c of u.keys()){if(u.delete(c),u.size===0)break;if(s.ifItFitsItSits("os",u))break}let a=Px();if(a!=null){if(!s.ifItFitsItSits("env",a))for(let c of a.keys()){if(a.delete(c),a.size===0)break;if(s.ifItFitsItSits("env",a))break}}return await Qae(s.toObject())}var Mx;async function Yae(){Mx??=xx.fileIsAccessible("/.dockerenv");let e=await Mx,{KUBERNETES_SERVICE_HOST:t=""}=_l.env,r=t.length>0?!0:!1,n={};if(e)n.runtime="docker";if(r)n.orchestrator="kubernetes";return n}async function Qae(e){let t=await Yae();if(Object.keys(t).length===0)return e;let r=new um(512),n={...e?.env,container:t};for(let[s,i]of Object.entries(e))if(s!=="env")r.ifItFitsItSits(s,i);else if(!r.ifItFitsItSits("env",n))r.ifItFitsItSits("env",i);if(!("env"in e))r.ifItFitsItSits("env",n);return r.toObject()}function Px(){let{AWS_EXECUTION_ENV:e="",AWS_LAMBDA_RUNTIME_API:t="",FUNCTIONS_WORKER_RUNTIME:r="",K_SERVICE:n="",FUNCTION_NAME:s="",VERCEL:i="",AWS_LAMBDA_FUNCTION_MEMORY_SIZE:o="",AWS_REGION:u="",FUNCTION_MEMORY_MB:a="",FUNCTION_REGION:c="",FUNCTION_TIMEOUT_SEC:l="",VERCEL_REGION:f=""}=_l.env,h=e.startsWith("AWS_Lambda_")||t.length>0,d=r.length>0,p=n.length>0||s.length>0,m=i.length>0,E=new Map;if(m&&!(d||p)){if(f.length>0)E.set("region",f);return E.set("name","vercel"),E}if(h&&!(d||p||m)){if(u.length>0)E.set("region",u);if(o.length>0&&Number.isInteger(+o))E.set("memory_mb",new Nr.Int32(o));return E.set("name","aws.lambda"),E}if(d&&!(p||h||m))return E.set("name","azure.func"),E;if(p&&!(d||h||m)){if(c.length>0)E.set("region",c);if(a.length>0&&Number.isInteger(+a))E.set("memory_mb",new Nr.Int32(a));if(l.length>0&&Number.isInteger(+l))E.set("timeout_sec",new Nr.Int32(l));return E.set("name","gcp.func"),E}return null}function Jae(){let e=Nr.NumberUtils.isBigEndian?"BE":"LE";if("Deno"in globalThis)return`Deno v${typeof Deno?.version?.deno==="string"?Deno?.version?.deno:"0.0.0-unknown"}, ${e}`;if("Bun"in globalThis)return`Bun v${typeof Bun?.version==="string"?Bun?.version:"0.0.0-unknown"}, ${e}`;return`Node.js ${_l.version}, ${e}`}});var cm=g(function(Ho){function Wt(e,t,r){if(r.globals)e=r.globals[e.name];return new e(`${r.context?r.context:"Value"} ${t}.`)}function Al(e,t){if(typeof e==="bigint")throw Wt(TypeError,"is a BigInt which cannot be converted to a number",t);if(!t.globals)return Number(e);return t.globals.Number(e)}function Ix(e){if(e>0&&e%1===0.5&&(e&1)===0||e<0&&e%1===-0.5&&(e&1)===1)return Lh(Math.floor(e));return Lh(Math.round(e))}function am(e){return Lh(Math.trunc(e))}function Nx(e){return e<0?-1:1}function tce(e,t){let r=e%t;if(Nx(t)!==Nx(r))return r+t;return r}function Lh(e){return e===0?0:e}function wl(e,{unsigned:t}){let r,n;if(t)r=0,n=2**e-1;else r=-(2**(e-1)),n=2**(e-1)-1;let s=2**e,i=2**(e-1);return(o,u={})=>{let a=Al(o,u);if(a=Lh(a),u.enforceRange){if(!Number.isFinite(a))throw Wt(TypeError,"is not a finite number",u);if(a=am(a),a<r||a>n)throw Wt(TypeError,`is outside the accepted range of ${r} to ${n}, inclusive`,u);return a}if(!Number.isNaN(a)&&u.clamp)return a=Math.min(Math.max(a,r),n),a=Ix(a),a;if(!Number.isFinite(a)||a===0)return 0;if(a=am(a),a>=r&&a<=n)return a;if(a=tce(a,s),!t&&a>=i)return a-s;return a}}function $x(e,{unsigned:t}){let r=Number.MAX_SAFE_INTEGER,n=t?0:Number.MIN_SAFE_INTEGER,s=t?BigInt.asUintN:BigInt.asIntN;return(i,o={})=>{let u=Al(i,o);if(u=Lh(u),o.enforceRange){if(!Number.isFinite(u))throw Wt(TypeError,"is not a finite number",o);if(u=am(u),u<n||u>r)throw Wt(TypeError,`is outside the accepted range of ${n} to ${r}, inclusive`,o);return u}if(!Number.isNaN(u)&&o.clamp)return u=Math.min(Math.max(u,n),r),u=Ix(u),u;if(!Number.isFinite(u)||u===0)return 0;let a=BigInt(am(u));return a=s(e,a),Number(a)}}Ho.any=(e)=>e;Ho.undefined=()=>{return};Ho.boolean=(e)=>Boolean(e);Ho.byte=wl(8,{unsigned:!1});Ho.octet=wl(8,{unsigned:!0});Ho.short=wl(16,{unsigned:!1});Ho["unsigned short"]=wl(16,{unsigned:!0});Ho.long=wl(32,{unsigned:!1});Ho["unsigned long"]=wl(32,{unsigned:!0});Ho["long long"]=$x(64,{unsigned:!1});Ho["unsigned long long"]=$x(64,{unsigned:!0});Ho.double=(e,t={})=>{let r=Al(e,t);if(!Number.isFinite(r))throw Wt(TypeError,"is not a finite floating-point value",t);return r};Ho["unrestricted double"]=(e,t={})=>Al(e,t);Ho.float=(e,t={})=>{let r=Al(e,t);if(!Number.isFinite(r))throw Wt(TypeError,"is not a finite floating-point value",t);if(Object.is(r,-0))return r;let n=Math.fround(r);if(!Number.isFinite(n))throw Wt(TypeError,"is outside the range of a single-precision floating-point value",t);return n};Ho["unrestricted float"]=(e,t={})=>{let r=Al(e,t);if(isNaN(r))return r;if(Object.is(r,-0))return r;return Math.fround(r)};Ho.DOMString=(e,t={})=>{if(t.treatNullAsEmptyString&&e===null)return"";if(typeof e==="symbol")throw Wt(TypeError,"is a symbol, which cannot be converted to a string",t);return(t.globals?t.globals.String:String)(e)};Ho.ByteString=(e,t={})=>{let r=Ho.DOMString(e,t);if(/[^\x00-\xFF]/.test(r))throw Wt(TypeError,"is not a valid ByteString",t);return r};Ho.USVString=(e,t={})=>Ho.DOMString(e,t).toWellFormed();Ho.object=(e,t={})=>{if(e===null||typeof e!=="object"&&typeof e!=="function")throw Wt(TypeError,"is not an object",t);return e};var rce=Object.getOwnPropertyDescriptor(ArrayBuffer.prototype,"byteLength").get,nce=Object.getOwnPropertyDescriptor(SharedArrayBuffer.prototype,"byteLength").get;function Rx(e){try{return rce.call(e),!0}catch{return!1}}function P_(e){try{return nce.call(e),!0}catch{return!1}}var sce=Object.getOwnPropertyDescriptor(ArrayBuffer.prototype,"resizable").get,ice=Object.getOwnPropertyDescriptor(SharedArrayBuffer.prototype,"growable").get;function vx(e){try{return sce.call(e)}catch{return!1}}function kx(e){try{return ice.call(e)}catch{return!1}}function qx(e){try{return new Uint8Array(e),!1}catch{return!0}}Ho.ArrayBuffer=(e,t={})=>{if(!Rx(e))throw Wt(TypeError,"is not an ArrayBuffer",t);if(!t.allowResizable&&vx(e))throw Wt(TypeError,"is a resizable ArrayBuffer",t);if(qx(e))throw Wt(TypeError,"is a detached ArrayBuffer",t);return e};Ho.SharedArrayBuffer=(e,t={})=>{if(!P_(e))throw Wt(TypeError,"is not a SharedArrayBuffer",t);if(!t.allowResizable&&kx(e))throw Wt(TypeError,"is a growable SharedArrayBuffer",t);return e};var oce=Object.getOwnPropertyDescriptor(DataView.prototype,"byteLength").get;Ho.DataView=(e,t={})=>{try{oce.call(e)}catch{throw Wt(TypeError,"is not a DataView",t)}return Ho.ArrayBufferView(e,t)};var uce=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Uint8Array).prototype,Symbol.toStringTag).get;[Int8Array,Int16Array,Int32Array,Uint8Array,Uint16Array,Uint32Array,Uint8ClampedArray,Float32Array,Float64Array].forEach((e)=>{let{name:t}=e,r=/^[AEIOU]/u.test(t)?"an":"a";Ho[t]=(n,s={})=>{if(!ArrayBuffer.isView(n)||uce.call(n)!==t)throw Wt(TypeError,`is not ${r} ${t} object`,s);return Ho.ArrayBufferView(n,s)}});Ho.ArrayBufferView=(e,t={})=>{if(!ArrayBuffer.isView(e))throw Wt(TypeError,"is not a view on an ArrayBuffer or SharedArrayBuffer",t);if(!t.allowShared&&P_(e.buffer))throw Wt(TypeError,"is a view on a SharedArrayBuffer, which is not allowed",t);if(!t.allowResizable){if(vx(e.buffer))throw Wt(TypeError,"is a view on a resizable ArrayBuffer, which is not allowed",t);else if(kx(e.buffer))throw Wt(TypeError,"is a view on a growable SharedArrayBuffer, which is not allowed",t)}if(qx(e.buffer))throw Wt(TypeError,"is a view on a detached ArrayBuffer",t);return e};Ho.BufferSource=(e,t={})=>{if(ArrayBuffer.isView(e))return Ho.ArrayBufferView(e,t);if(Rx(e))return Ho.ArrayBuffer(e,t);else if(t.allowShared&&P_(e))return Ho.SharedArrayBuffer(e,t);if(t.allowShared)throw Wt(TypeError,"is not an ArrayBuffer, SharedArrayBuffer, or a view on one",t);else throw Wt(TypeError,"is not an ArrayBuffer or a view on one",t)};Ho.DOMTimeStamp=Ho["unsigned long long"]});var hm=g(function(Yx,Qx){function Vx(e){return typeof e==="object"&&e!==null||typeof e==="function"}var Mce=Function.call.bind(Function.call);function xce(e,t){for(let r of Reflect.ownKeys(t)){let n=Reflect.getOwnPropertyDescriptor(t,r);if(n&&!Reflect.defineProperty(e,r,n))throw TypeError(`Cannot redefine property: ${String(r)}`)}}function Pce(e,t){let r=Kx(e);return Object.defineProperties(Object.create(r["%Object.prototype%"]),Object.getOwnPropertyDescriptors(t))}var zx=Symbol("wrapper"),Wx=Symbol("impl"),Ol=Symbol("SameObject caches"),lm=Symbol.for("[webidl2js] constructor registry"),Fce=Object.getPrototypeOf(Object.getPrototypeOf(async function*(){}).prototype);function Kx(e){if(Object.hasOwn(e,lm))return e[lm];let t=Object.create(null);t["%Object.prototype%"]=e.Object.prototype,t["%IteratorPrototype%"]=Object.getPrototypeOf(Object.getPrototypeOf(new e.Array()[Symbol.iterator]()));try{t["%AsyncIteratorPrototype%"]=Object.getPrototypeOf(Object.getPrototypeOf(e.eval("(async function* () {})").prototype))}catch{t["%AsyncIteratorPrototype%"]=Fce}return e[lm]=t,t}function Bce(e,t,r){if(!e[Ol])e[Ol]=Object.create(null);if(t in e[Ol])return e[Ol][t];return e[Ol][t]=r(),e[Ol][t]}function Hx(e){return e?e[zx]:null}function Gx(e){return e?e[Wx]:null}function Nce(e){let t=Hx(e);return t?t:e}function Ice(e){let t=Gx(e);return t?t:e}var $ce=Symbol("internal");function Rce(e){if(typeof e!=="string")return!1;let t=e>>>0;if(t===4294967295)return!1;let r=`${t}`;if(e!==r)return!1;return!0}var vce=Object.getOwnPropertyDescriptor(ArrayBuffer.prototype,"byteLength").get;function kce(e){try{return vce.call(e),!0}catch{return!1}}function qce([e,t],r){let n;switch(r){case"key":n=e;break;case"value":n=t;break;case"key+value":n=[e,t];break}return{value:n,done:!1}}function jce(e,t,r,n,s){if(s===void 0){let o=Reflect.getPrototypeOf(e);if(o!==null)return Reflect.set(o,t,r,n);s={writable:!0,enumerable:!0,configurable:!0,value:void 0}}if(Lce(s)){if(!s.writable)return!1;if(!Vx(n))return!1;let o=Reflect.getOwnPropertyDescriptor(n,t);if(o!==void 0){if(Uce(o))return!1;if(o.writable===!1)return!1;return Reflect.defineProperty(n,t,{value:r})}return Reflect.defineProperty(n,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}let i=s.set;if(i===void 0)return!1;return Mce(i,n,r),!0}function Lce(e){return Object.hasOwn(e,"value")||Object.hasOwn(e,"writable")}function Uce(e){return Object.hasOwn(e,"get")||Object.hasOwn(e,"set")}var Vce=Symbol("supports property index"),zce=Symbol("supported property indices"),Wce=Symbol("supports property name"),Kce=Symbol("supported property names"),Hce=Symbol("indexed property get"),Gce=Symbol("indexed property set new"),Yce=Symbol("indexed property set existing"),Qce=Symbol("named property get"),Jce=Symbol("named property set new"),Xce=Symbol("named property set existing"),Zce=Symbol("named property delete"),ele=Symbol("async iterator get the next iteration result"),tle=Symbol("async iterator return steps"),rle=Symbol("async iterator initialization steps"),nle=Symbol("async iterator end of iteration");Qx.exports=Yx={isObject:Vx,define:xce,newObjectInRealm:Pce,wrapperSymbol:zx,implSymbol:Wx,getSameObject:Bce,ctorRegistrySymbol:lm,initCtorRegistry:Kx,wrapperForImpl:Hx,implForWrapper:Gx,tryWrapperForImpl:Nce,tryImplForWrapper:Ice,iterInternalSymbol:$ce,isArrayBuffer:kce,isArrayIndexPropName:Rce,supportsPropertyIndex:Vce,supportedPropertyIndices:zce,supportsPropertyName:Wce,supportedPropertyNames:Kce,indexedGet:Hce,indexedSetNew:Gce,indexedSetExisting:Yce,namedGet:Qce,namedSetNew:Jce,namedSetExisting:Xce,namedDelete:Zce,asyncIteratorNext:ele,asyncIteratorReturn:tle,asyncIteratorInit:rle,asyncIteratorEOI:nle,iteratorResult:qce,ordinarySetWithOwnDescriptor:jce}});var sP=g(function(c8e,nP){var sle=/^xn--/,ile=/[^\0-\x7F]/,ole=/[\x2E\u3002\uFF0E\uFF61]/g,ule={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},lo=Math.floor,N_=String.fromCharCode;function Lu(e){throw RangeError(ule[e])}function ale(e,t){let r=[],n=e.length;while(n--)r[n]=t(e[n]);return r}function Xx(e,t){let r=e.split("@"),n="";if(r.length>1)n=r[0]+"@",e=r[1];e=e.replace(ole,".");let s=e.split("."),i=ale(s,t).join(".");return n+i}function Zx(e){let t=[],r=0,n=e.length;while(r<n){let s=e.charCodeAt(r++);if(s>=55296&&s<=56319&&r<n){let i=e.charCodeAt(r++);if((i&64512)==56320)t.push(((s&1023)<<10)+(i&1023)+65536);else t.push(s),r--}else t.push(s)}return t}var cle=(e)=>String.fromCodePoint(...e),lle=function(e){if(e>=48&&e<58)return 26+(e-48);if(e>=65&&e<91)return e-65;if(e>=97&&e<123)return e-97;return 36},Jx=function(e,t){return e+22+75*(e<26)-((t!=0)<<5)},eP=function(e,t,r){let n=0;e=r?lo(e/700):e>>1,e+=lo(e/t);for(;e>455;n+=36)e=lo(e/35);return lo(n+36*e/(e+38))},tP=function(e){let t=[],r=e.length,n=0,s=128,i=72,o=e.lastIndexOf("-");if(o<0)o=0;for(let u=0;u<o;++u){if(e.charCodeAt(u)>=128)Lu("not-basic");t.push(e.charCodeAt(u))}for(let u=o>0?o+1:0;u<r;){let a=n;for(let l=1,f=36;;f+=36){if(u>=r)Lu("invalid-input");let h=lle(e.charCodeAt(u++));if(h>=36)Lu("invalid-input");if(h>lo((2147483647-n)/l))Lu("overflow");n+=h*l;let d=f<=i?1:f>=i+26?26:f-i;if(h<d)break;let p=36-d;if(l>lo(2147483647/p))Lu("overflow");l*=p}let c=t.length+1;if(i=eP(n-a,c,a==0),lo(n/c)>2147483647-s)Lu("overflow");s+=lo(n/c),n%=c,t.splice(n++,0,s)}return String.fromCodePoint(...t)},rP=function(e){let t=[];e=Zx(e);let r=e.length,n=128,s=0,i=72;for(let a of e)if(a<128)t.push(N_(a));let o=t.length,u=o;if(o)t.push("-");while(u<r){let a=2147483647;for(let l of e)if(l>=n&&l<a)a=l;let c=u+1;if(a-n>lo((2147483647-s)/c))Lu("overflow");s+=(a-n)*c,n=a;for(let l of e){if(l<n&&++s>2147483647)Lu("overflow");if(l===n){let f=s;for(let h=36;;h+=36){let d=h<=i?1:h>=i+26?26:h-i;if(f<d)break;let p=f-d,m=36-d;t.push(N_(Jx(d+p%m,0))),f=lo(p/m)}t.push(N_(Jx(f,0))),i=eP(s,c,u===o),s=0,++u}}++s,++n}return t.join("")},hle=function(e){return Xx(e,function(t){return sle.test(t)?tP(t.slice(4).toLowerCase()):t})},fle=function(e){return Xx(e,function(t){return ile.test(t)?"xn--"+rP(t):t})},dle={version:"2.3.1",ucs2:{decode:Zx,encode:cle},decode:tP,encode:rP,toASCII:fle,toUnicode:hle};nP.exports=dle});var oP=g(function(l8e,iP){var ple=/[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0897-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CF3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u180F\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ADD\u1AE0-\u1AEB\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\u{101FD}\u{102E0}\u{10376}-\u{1037A}\u{10A01}-\u{10A03}\u{10A05}\u{10A06}\u{10A0C}-\u{10A0F}\u{10A38}-\u{10A3A}\u{10A3F}\u{10AE5}\u{10AE6}\u{10D24}-\u{10D27}\u{10D69}-\u{10D6D}\u{10EAB}\u{10EAC}\u{10EFA}-\u{10EFF}\u{10F46}-\u{10F50}\u{10F82}-\u{10F85}\u{11000}-\u{11002}\u{11038}-\u{11046}\u{11070}\u{11073}\u{11074}\u{1107F}-\u{11082}\u{110B0}-\u{110BA}\u{110C2}\u{11100}-\u{11102}\u{11127}-\u{11134}\u{11145}\u{11146}\u{11173}\u{11180}-\u{11182}\u{111B3}-\u{111C0}\u{111C9}-\u{111CC}\u{111CE}\u{111CF}\u{1122C}-\u{11237}\u{1123E}\u{11241}\u{112DF}-\u{112EA}\u{11300}-\u{11303}\u{1133B}\u{1133C}\u{1133E}-\u{11344}\u{11347}\u{11348}\u{1134B}-\u{1134D}\u{11357}\u{11362}\u{11363}\u{11366}-\u{1136C}\u{11370}-\u{11374}\u{113B8}-\u{113C0}\u{113C2}\u{113C5}\u{113C7}-\u{113CA}\u{113CC}-\u{113D0}\u{113D2}\u{113E1}\u{113E2}\u{11435}-\u{11446}\u{1145E}\u{114B0}-\u{114C3}\u{115AF}-\u{115B5}\u{115B8}-\u{115C0}\u{115DC}\u{115DD}\u{11630}-\u{11640}\u{116AB}-\u{116B7}\u{1171D}-\u{1172B}\u{1182C}-\u{1183A}\u{11930}-\u{11935}\u{11937}\u{11938}\u{1193B}-\u{1193E}\u{11940}\u{11942}\u{11943}\u{119D1}-\u{119D7}\u{119DA}-\u{119E0}\u{119E4}\u{11A01}-\u{11A0A}\u{11A33}-\u{11A39}\u{11A3B}-\u{11A3E}\u{11A47}\u{11A51}-\u{11A5B}\u{11A8A}-\u{11A99}\u{11B60}-\u{11B67}\u{11C2F}-\u{11C36}\u{11C38}-\u{11C3F}\u{11C92}-\u{11CA7}\u{11CA9}-\u{11CB6}\u{11D31}-\u{11D36}\u{11D3A}\u{11D3C}\u{11D3D}\u{11D3F}-\u{11D45}\u{11D47}\u{11D8A}-\u{11D8E}\u{11D90}\u{11D91}\u{11D93}-\u{11D97}\u{11EF3}-\u{11EF6}\u{11F00}\u{11F01}\u{11F03}\u{11F34}-\u{11F3A}\u{11F3E}-\u{11F42}\u{11F5A}\u{13440}\u{13447}-\u{13455}\u{1611E}-\u{1612F}\u{16AF0}-\u{16AF4}\u{16B30}-\u{16B36}\u{16F4F}\u{16F51}-\u{16F87}\u{16F8F}-\u{16F92}\u{16FE4}\u{16FF0}\u{16FF1}\u{1BC9D}\u{1BC9E}\u{1CF00}-\u{1CF2D}\u{1CF30}-\u{1CF46}\u{1D165}-\u{1D169}\u{1D16D}-\u{1D172}\u{1D17B}-\u{1D182}\u{1D185}-\u{1D18B}\u{1D1AA}-\u{1D1AD}\u{1D242}-\u{1D244}\u{1DA00}-\u{1DA36}\u{1DA3B}-\u{1DA6C}\u{1DA75}\u{1DA84}\u{1DA9B}-\u{1DA9F}\u{1DAA1}-\u{1DAAF}\u{1E000}-\u{1E006}\u{1E008}-\u{1E018}\u{1E01B}-\u{1E021}\u{1E023}\u{1E024}\u{1E026}-\u{1E02A}\u{1E08F}\u{1E130}-\u{1E136}\u{1E2AE}\u{1E2EC}-\u{1E2EF}\u{1E4EC}-\u{1E4EF}\u{1E5EE}\u{1E5EF}\u{1E6E3}\u{1E6E6}\u{1E6EE}\u{1E6EF}\u{1E6F5}\u{1E8D0}-\u{1E8D6}\u{1E944}-\u{1E94A}\u{E0100}-\u{E01EF}]/u,mle=/[\u094D\u09CD\u0A4D\u0ACD\u0B4D\u0BCD\u0C4D\u0CCD\u0D3B\u0D3C\u0D4D\u0DCA\u0E3A\u0EBA\u0F84\u1039\u103A\u1714\u1715\u1734\u17D2\u1A60\u1B44\u1BAA\u1BAB\u1BF2\u1BF3\u2D7F\uA806\uA82C\uA8C4\uA953\uA9C0\uAAF6\uABED\u{10A3F}\u{11046}\u{11070}\u{1107F}\u{110B9}\u{11133}\u{11134}\u{111C0}\u{11235}\u{112EA}\u{1134D}\u{113CE}-\u{113D0}\u{11442}\u{114C2}\u{115BF}\u{1163F}\u{116B6}\u{1172B}\u{11839}\u{1193D}\u{1193E}\u{119E0}\u{11A34}\u{11A47}\u{11A99}\u{11C3F}\u{11D44}\u{11D45}\u{11D97}\u{11F41}\u{11F42}\u{1612F}]/u,yle=/[\u0620\u0626\u0628\u062A-\u062E\u0633-\u063F\u0641-\u0647\u0649\u064A\u066E\u066F\u0678-\u0687\u069A-\u06BF\u06C1\u06C2\u06CC\u06CE\u06D0\u06D1\u06FA-\u06FC\u06FF\u0712-\u0714\u071A-\u071D\u071F-\u0727\u0729\u072B\u072D\u072E\u074E-\u0758\u075C-\u076A\u076D-\u0770\u0772\u0775-\u0777\u077A-\u077F\u07CA-\u07EA\u0841-\u0845\u0848\u084A-\u0853\u0855\u0860\u0862-\u0865\u0868\u0886\u0889-\u088D\u088F\u08A0-\u08A9\u08AF\u08B0\u08B3-\u08B8\u08BA-\u08C8\u1807\u1820-\u1878\u1887-\u18A8\u18AA\uA840-\uA872\u{10AC0}-\u{10AC4}\u{10ACD}\u{10AD3}-\u{10ADC}\u{10ADE}-\u{10AE0}\u{10AEB}-\u{10AEE}\u{10B80}\u{10B82}\u{10B86}-\u{10B88}\u{10B8A}\u{10B8B}\u{10B8D}\u{10B90}\u{10BAD}\u{10BAE}\u{10D00}-\u{10D21}\u{10D23}\u{10EC3}\u{10EC4}\u{10EC6}\u{10EC7}\u{10F30}-\u{10F32}\u{10F34}-\u{10F44}\u{10F51}-\u{10F53}\u{10F70}-\u{10F73}\u{10F76}-\u{10F81}\u{10FB0}\u{10FB2}\u{10FB3}\u{10FB8}\u{10FBB}\u{10FBC}\u{10FBE}\u{10FBF}\u{10FC1}\u{10FC4}\u{10FCA}\u{10FCB}\u{1E900}-\u{1E943}][\xAD\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u061C\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u070F\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0897-\u089F\u08CA-\u08E1\u08E3-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962\u0963\u0981\u09BC\u09C1-\u09C4\u09CD\u09E2\u09E3\u09FE\u0A01\u0A02\u0A3C\u0A41\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7\u0AC8\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01\u0B3C\u0B3F\u0B41-\u0B44\u0B4D\u0B55\u0B56\u0B62\u0B63\u0B82\u0BC0\u0BCD\u0C00\u0C04\u0C3C\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81\u0CBC\u0CBF\u0CC6\u0CCC\u0CCD\u0CE2\u0CE3\u0D00\u0D01\u0D3B\u0D3C\u0D41-\u0D44\u0D4D\u0D62\u0D63\u0D81\u0DCA\u0DD2-\u0DD4\u0DD6\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0F18\u0F19\u0F35\u0F37\u0F39\u0F71-\u0F7E\u0F80-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032-\u1037\u1039\u103A\u103D\u103E\u1058\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085\u1086\u108D\u109D\u135D-\u135F\u1712-\u1714\u1732\u1733\u1752\u1753\u1772\u1773\u17B4\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D3\u17DD\u180B-\u180D\u180F\u1885\u1886\u18A9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193B\u1A17\u1A18\u1A1B\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1AB0-\u1ADD\u1AE0-\u1AEB\u1B00-\u1B03\u1B34\u1B36-\u1B3A\u1B3C\u1B42\u1B6B-\u1B73\u1B80\u1B81\u1BA2-\u1BA5\u1BA8\u1BA9\u1BAB-\u1BAD\u1BE6\u1BE8\u1BE9\u1BED\u1BEF-\u1BF1\u1C2C-\u1C33\u1C36\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DFF\u200B\u200E\u200F\u202A-\u202E\u2060-\u2064\u206A-\u206F\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302D\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA825\uA826\uA82C\uA8C4\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA951\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uA9BD\uA9E5\uAA29-\uAA2E\uAA31\uAA32\uAA35\uAA36\uAA43\uAA4C\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEC\uAAED\uAAF6\uABE5\uABE8\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFEFF\uFFF9-\uFFFB\u{101FD}\u{102E0}\u{10376}-\u{1037A}\u{10A01}-\u{10A03}\u{10A05}\u{10A06}\u{10A0C}-\u{10A0F}\u{10A38}-\u{10A3A}\u{10A3F}\u{10AE5}\u{10AE6}\u{10D24}-\u{10D27}\u{10D69}-\u{10D6D}\u{10EAB}\u{10EAC}\u{10EFA}-\u{10EFF}\u{10F46}-\u{10F50}\u{10F82}-\u{10F85}\u{11001}\u{11038}-\u{11046}\u{11070}\u{11073}\u{11074}\u{1107F}-\u{11081}\u{110B3}-\u{110B6}\u{110B9}\u{110BA}\u{110C2}\u{11100}-\u{11102}\u{11127}-\u{1112B}\u{1112D}-\u{11134}\u{11173}\u{11180}\u{11181}\u{111B6}-\u{111BE}\u{111C9}-\u{111CC}\u{111CF}\u{1122F}-\u{11231}\u{11234}\u{11236}\u{11237}\u{1123E}\u{11241}\u{112DF}\u{112E3}-\u{112EA}\u{11300}\u{11301}\u{1133B}\u{1133C}\u{11340}\u{11366}-\u{1136C}\u{11370}-\u{11374}\u{113BB}-\u{113C0}\u{113CE}\u{113D0}\u{113D2}\u{113E1}\u{113E2}\u{11438}-\u{1143F}\u{11442}-\u{11444}\u{11446}\u{1145E}\u{114B3}-\u{114B8}\u{114BA}\u{114BF}\u{114C0}\u{114C2}\u{114C3}\u{115B2}-\u{115B5}\u{115BC}\u{115BD}\u{115BF}\u{115C0}\u{115DC}\u{115DD}\u{11633}-\u{1163A}\u{1163D}\u{1163F}\u{11640}\u{116AB}\u{116AD}\u{116B0}-\u{116B5}\u{116B7}\u{1171D}\u{1171F}\u{11722}-\u{11725}\u{11727}-\u{1172B}\u{1182F}-\u{11837}\u{11839}\u{1183A}\u{1193B}\u{1193C}\u{1193E}\u{11943}\u{119D4}-\u{119D7}\u{119DA}\u{119DB}\u{119E0}\u{11A01}-\u{11A0A}\u{11A33}-\u{11A38}\u{11A3B}-\u{11A3E}\u{11A47}\u{11A51}-\u{11A56}\u{11A59}-\u{11A5B}\u{11A8A}-\u{11A96}\u{11A98}\u{11A99}\u{11B60}\u{11B62}-\u{11B64}\u{11B66}\u{11C30}-\u{11C36}\u{11C38}-\u{11C3D}\u{11C3F}\u{11C92}-\u{11CA7}\u{11CAA}-\u{11CB0}\u{11CB2}\u{11CB3}\u{11CB5}\u{11CB6}\u{11D31}-\u{11D36}\u{11D3A}\u{11D3C}\u{11D3D}\u{11D3F}-\u{11D45}\u{11D47}\u{11D90}\u{11D91}\u{11D95}\u{11D97}\u{11EF3}\u{11EF4}\u{11F00}\u{11F01}\u{11F36}-\u{11F3A}\u{11F40}\u{11F42}\u{11F5A}\u{13430}-\u{13440}\u{13447}-\u{13455}\u{1611E}-\u{16129}\u{1612D}-\u{1612F}\u{16AF0}-\u{16AF4}\u{16B30}-\u{16B36}\u{16F4F}\u{16F8F}-\u{16F92}\u{16FE4}\u{1BC9D}\u{1BC9E}\u{1BCA0}-\u{1BCA3}\u{1CF00}-\u{1CF2D}\u{1CF30}-\u{1CF46}\u{1D167}-\u{1D169}\u{1D173}-\u{1D182}\u{1D185}-\u{1D18B}\u{1D1AA}-\u{1D1AD}\u{1D242}-\u{1D244}\u{1DA00}-\u{1DA36}\u{1DA3B}-\u{1DA6C}\u{1DA75}\u{1DA84}\u{1DA9B}-\u{1DA9F}\u{1DAA1}-\u{1DAAF}\u{1E000}-\u{1E006}\u{1E008}-\u{1E018}\u{1E01B}-\u{1E021}\u{1E023}\u{1E024}\u{1E026}-\u{1E02A}\u{1E08F}\u{1E130}-\u{1E136}\u{1E2AE}\u{1E2EC}-\u{1E2EF}\u{1E4EC}-\u{1E4EF}\u{1E5EE}\u{1E5EF}\u{1E6E3}\u{1E6E6}\u{1E6EE}\u{1E6EF}\u{1E6F5}\u{1E8D0}-\u{1E8D6}\u{1E944}-\u{1E94B}\u{E0001}\u{E0020}-\u{E007F}\u{E0100}-\u{E01EF}]*\u200C[\xAD\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u061C\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u070F\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0897-\u089F\u08CA-\u08E1\u08E3-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962\u0963\u0981\u09BC\u09C1-\u09C4\u09CD\u09E2\u09E3\u09FE\u0A01\u0A02\u0A3C\u0A41\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7\u0AC8\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01\u0B3C\u0B3F\u0B41-\u0B44\u0B4D\u0B55\u0B56\u0B62\u0B63\u0B82\u0BC0\u0BCD\u0C00\u0C04\u0C3C\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81\u0CBC\u0CBF\u0CC6\u0CCC\u0CCD\u0CE2\u0CE3\u0D00\u0D01\u0D3B\u0D3C\u0D41-\u0D44\u0D4D\u0D62\u0D63\u0D81\u0DCA\u0DD2-\u0DD4\u0DD6\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0F18\u0F19\u0F35\u0F37\u0F39\u0F71-\u0F7E\u0F80-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032-\u1037\u1039\u103A\u103D\u103E\u1058\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085\u1086\u108D\u109D\u135D-\u135F\u1712-\u1714\u1732\u1733\u1752\u1753\u1772\u1773\u17B4\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D3\u17DD\u180B-\u180D\u180F\u1885\u1886\u18A9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193B\u1A17\u1A18\u1A1B\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1AB0-\u1ADD\u1AE0-\u1AEB\u1B00-\u1B03\u1B34\u1B36-\u1B3A\u1B3C\u1B42\u1B6B-\u1B73\u1B80\u1B81\u1BA2-\u1BA5\u1BA8\u1BA9\u1BAB-\u1BAD\u1BE6\u1BE8\u1BE9\u1BED\u1BEF-\u1BF1\u1C2C-\u1C33\u1C36\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DFF\u200B\u200E\u200F\u202A-\u202E\u2060-\u2064\u206A-\u206F\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302D\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA825\uA826\uA82C\uA8C4\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA951\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uA9BD\uA9E5\uAA29-\uAA2E\uAA31\uAA32\uAA35\uAA36\uAA43\uAA4C\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEC\uAAED\uAAF6\uABE5\uABE8\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFEFF\uFFF9-\uFFFB\u{101FD}\u{102E0}\u{10376}-\u{1037A}\u{10A01}-\u{10A03}\u{10A05}\u{10A06}\u{10A0C}-\u{10A0F}\u{10A38}-\u{10A3A}\u{10A3F}\u{10AE5}\u{10AE6}\u{10D24}-\u{10D27}\u{10D69}-\u{10D6D}\u{10EAB}\u{10EAC}\u{10EFA}-\u{10EFF}\u{10F46}-\u{10F50}\u{10F82}-\u{10F85}\u{11001}\u{11038}-\u{11046}\u{11070}\u{11073}\u{11074}\u{1107F}-\u{11081}\u{110B3}-\u{110B6}\u{110B9}\u{110BA}\u{110C2}\u{11100}-\u{11102}\u{11127}-\u{1112B}\u{1112D}-\u{11134}\u{11173}\u{11180}\u{11181}\u{111B6}-\u{111BE}\u{111C9}-\u{111CC}\u{111CF}\u{1122F}-\u{11231}\u{11234}\u{11236}\u{11237}\u{1123E}\u{11241}\u{112DF}\u{112E3}-\u{112EA}\u{11300}\u{11301}\u{1133B}\u{1133C}\u{11340}\u{11366}-\u{1136C}\u{11370}-\u{11374}\u{113BB}-\u{113C0}\u{113CE}\u{113D0}\u{113D2}\u{113E1}\u{113E2}\u{11438}-\u{1143F}\u{11442}-\u{11444}\u{11446}\u{1145E}\u{114B3}-\u{114B8}\u{114BA}\u{114BF}\u{114C0}\u{114C2}\u{114C3}\u{115B2}-\u{115B5}\u{115BC}\u{115BD}\u{115BF}\u{115C0}\u{115DC}\u{115DD}\u{11633}-\u{1163A}\u{1163D}\u{1163F}\u{11640}\u{116AB}\u{116AD}\u{116B0}-\u{116B5}\u{116B7}\u{1171D}\u{1171F}\u{11722}-\u{11725}\u{11727}-\u{1172B}\u{1182F}-\u{11837}\u{11839}\u{1183A}\u{1193B}\u{1193C}\u{1193E}\u{11943}\u{119D4}-\u{119D7}\u{119DA}\u{119DB}\u{119E0}\u{11A01}-\u{11A0A}\u{11A33}-\u{11A38}\u{11A3B}-\u{11A3E}\u{11A47}\u{11A51}-\u{11A56}\u{11A59}-\u{11A5B}\u{11A8A}-\u{11A96}\u{11A98}\u{11A99}\u{11B60}\u{11B62}-\u{11B64}\u{11B66}\u{11C30}-\u{11C36}\u{11C38}-\u{11C3D}\u{11C3F}\u{11C92}-\u{11CA7}\u{11CAA}-\u{11CB0}\u{11CB2}\u{11CB3}\u{11CB5}\u{11CB6}\u{11D31}-\u{11D36}\u{11D3A}\u{11D3C}\u{11D3D}\u{11D3F}-\u{11D45}\u{11D47}\u{11D90}\u{11D91}\u{11D95}\u{11D97}\u{11EF3}\u{11EF4}\u{11F00}\u{11F01}\u{11F36}-\u{11F3A}\u{11F40}\u{11F42}\u{11F5A}\u{13430}-\u{13440}\u{13447}-\u{13455}\u{1611E}-\u{16129}\u{1612D}-\u{1612F}\u{16AF0}-\u{16AF4}\u{16B30}-\u{16B36}\u{16F4F}\u{16F8F}-\u{16F92}\u{16FE4}\u{1BC9D}\u{1BC9E}\u{1BCA0}-\u{1BCA3}\u{1CF00}-\u{1CF2D}\u{1CF30}-\u{1CF46}\u{1D167}-\u{1D169}\u{1D173}-\u{1D182}\u{1D185}-\u{1D18B}\u{1D1AA}-\u{1D1AD}\u{1D242}-\u{1D244}\u{1DA00}-\u{1DA36}\u{1DA3B}-\u{1DA6C}\u{1DA75}\u{1DA84}\u{1DA9B}-\u{1DA9F}\u{1DAA1}-\u{1DAAF}\u{1E000}-\u{1E006}\u{1E008}-\u{1E018}\u{1E01B}-\u{1E021}\u{1E023}\u{1E024}\u{1E026}-\u{1E02A}\u{1E08F}\u{1E130}-\u{1E136}\u{1E2AE}\u{1E2EC}-\u{1E2EF}\u{1E4EC}-\u{1E4EF}\u{1E5EE}\u{1E5EF}\u{1E6E3}\u{1E6E6}\u{1E6EE}\u{1E6EF}\u{1E6F5}\u{1E8D0}-\u{1E8D6}\u{1E944}-\u{1E94B}\u{E0001}\u{E0020}-\u{E007F}\u{E0100}-\u{E01EF}]*[\u0620\u0622-\u063F\u0641-\u064A\u066E\u066F\u0671-\u0673\u0675-\u06D3\u06D5\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u077F\u07CA-\u07EA\u0840-\u0858\u0860\u0862-\u0865\u0867-\u086A\u0870-\u0882\u0886\u0889-\u088F\u08A0-\u08AC\u08AE-\u08C8\u1807\u1820-\u1878\u1887-\u18A8\u18AA\uA840-\uA871\u{10AC0}-\u{10AC5}\u{10AC7}\u{10AC9}\u{10ACA}\u{10ACE}-\u{10AD6}\u{10AD8}-\u{10AE1}\u{10AE4}\u{10AEB}-\u{10AEF}\u{10B80}-\u{10B91}\u{10BA9}-\u{10BAE}\u{10D01}-\u{10D23}\u{10EC2}-\u{10EC4}\u{10EC6}\u{10EC7}\u{10F30}-\u{10F44}\u{10F51}-\u{10F54}\u{10F70}-\u{10F81}\u{10FB0}\u{10FB2}-\u{10FB6}\u{10FB8}-\u{10FBF}\u{10FC1}-\u{10FC4}\u{10FC9}\u{10FCA}\u{1E900}-\u{1E943}]/u,gle=/[\u05BE\u05C0\u05C3\u05C6\u05D0-\u05EA\u05EF-\u05F4\u0600-\u0605\u0608\u060B\u060D\u061B-\u064A\u0660-\u0669\u066B-\u066F\u0671-\u06D5\u06DD\u06E5\u06E6\u06EE\u06EF\u06FA-\u070D\u070F\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07C0-\u07EA\u07F4\u07F5\u07FA\u07FE-\u0815\u081A\u0824\u0828\u0830-\u083E\u0840-\u0858\u085E\u0860-\u086A\u0870-\u0891\u08A0-\u08C9\u08E2\u200F\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBC2\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFC\uFE70-\uFE74\uFE76-\uFEFC\u{10800}-\u{10805}\u{10808}\u{1080A}-\u{10835}\u{10837}\u{10838}\u{1083C}\u{1083F}-\u{10855}\u{10857}-\u{1089E}\u{108A7}-\u{108AF}\u{108E0}-\u{108F2}\u{108F4}\u{108F5}\u{108FB}-\u{1091B}\u{10920}-\u{10939}\u{1093F}-\u{10959}\u{10980}-\u{109B7}\u{109BC}-\u{109CF}\u{109D2}-\u{10A00}\u{10A10}-\u{10A13}\u{10A15}-\u{10A17}\u{10A19}-\u{10A35}\u{10A40}-\u{10A48}\u{10A50}-\u{10A58}\u{10A60}-\u{10A9F}\u{10AC0}-\u{10AE4}\u{10AEB}-\u{10AF6}\u{10B00}-\u{10B35}\u{10B40}-\u{10B55}\u{10B58}-\u{10B72}\u{10B78}-\u{10B91}\u{10B99}-\u{10B9C}\u{10BA9}-\u{10BAF}\u{10C00}-\u{10C48}\u{10C80}-\u{10CB2}\u{10CC0}-\u{10CF2}\u{10CFA}-\u{10D23}\u{10D30}-\u{10D39}\u{10D40}-\u{10D65}\u{10D6F}-\u{10D85}\u{10D8E}\u{10D8F}\u{10E60}-\u{10E7E}\u{10E80}-\u{10EA9}\u{10EAD}\u{10EB0}\u{10EB1}\u{10EC2}-\u{10EC7}\u{10F00}-\u{10F27}\u{10F30}-\u{10F45}\u{10F51}-\u{10F59}\u{10F70}-\u{10F81}\u{10F86}-\u{10F89}\u{10FB0}-\u{10FCB}\u{10FE0}-\u{10FF6}\u{1E800}-\u{1E8C4}\u{1E8C7}-\u{1E8CF}\u{1E900}-\u{1E943}\u{1E94B}\u{1E950}-\u{1E959}\u{1E95E}\u{1E95F}\u{1EC71}-\u{1ECB4}\u{1ED01}-\u{1ED3D}\u{1EE00}-\u{1EE03}\u{1EE05}-\u{1EE1F}\u{1EE21}\u{1EE22}\u{1EE24}\u{1EE27}\u{1EE29}-\u{1EE32}\u{1EE34}-\u{1EE37}\u{1EE39}\u{1EE3B}\u{1EE42}\u{1EE47}\u{1EE49}\u{1EE4B}\u{1EE4D}-\u{1EE4F}\u{1EE51}\u{1EE52}\u{1EE54}\u{1EE57}\u{1EE59}\u{1EE5B}\u{1EE5D}\u{1EE5F}\u{1EE61}\u{1EE62}\u{1EE64}\u{1EE67}-\u{1EE6A}\u{1EE6C}-\u{1EE72}\u{1EE74}-\u{1EE77}\u{1EE79}-\u{1EE7C}\u{1EE7E}\u{1EE80}-\u{1EE89}\u{1EE8B}-\u{1EE9B}\u{1EEA1}-\u{1EEA3}\u{1EEA5}-\u{1EEA9}\u{1EEAB}-\u{1EEBB}]/u,Ele=/[A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02B8\u02BB-\u02C1\u02D0\u02D1\u02E0-\u02E4\u02EE\u0370-\u0373\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0482\u048A-\u052F\u0531-\u0556\u0559-\u0589\u0903-\u0939\u093B\u093D-\u0940\u0949-\u094C\u094E-\u0950\u0958-\u0961\u0964-\u0980\u0982\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD-\u09C0\u09C7\u09C8\u09CB\u09CC\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E1\u09E6-\u09F1\u09F4-\u09FA\u09FC\u09FD\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3E-\u0A40\u0A59-\u0A5C\u0A5E\u0A66-\u0A6F\u0A72-\u0A74\u0A76\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD-\u0AC0\u0AC9\u0ACB\u0ACC\u0AD0\u0AE0\u0AE1\u0AE6-\u0AF0\u0AF9\u0B02\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B3E\u0B40\u0B47\u0B48\u0B4B\u0B4C\u0B57\u0B5C\u0B5D\u0B5F-\u0B61\u0B66-\u0B77\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE\u0BBF\u0BC1\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCC\u0BD0\u0BD7\u0BE6-\u0BF2\u0C01-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C41-\u0C44\u0C58-\u0C5A\u0C5C\u0C5D\u0C60\u0C61\u0C66-\u0C6F\u0C77\u0C7F\u0C80\u0C82-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD-\u0CC4\u0CC6-\u0CC8\u0CCA\u0CCB\u0CD5\u0CD6\u0CDC-\u0CDE\u0CE0\u0CE1\u0CE6-\u0CEF\u0CF1-\u0CF3\u0D02-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D40\u0D46-\u0D48\u0D4A-\u0D4C\u0D4E\u0D4F\u0D54-\u0D61\u0D66-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCF-\u0DD1\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2-\u0DF4\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E4F-\u0E5B\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00-\u0F17\u0F1A-\u0F34\u0F36\u0F38\u0F3E-\u0F47\u0F49-\u0F6C\u0F7F\u0F85\u0F88-\u0F8C\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE-\u0FDA\u1000-\u102C\u1031\u1038\u103B\u103C\u103F-\u1057\u105A-\u105D\u1061-\u1070\u1075-\u1081\u1083\u1084\u1087-\u108C\u108E-\u109C\u109E-\u10C5\u10C7\u10CD\u10D0-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1360-\u137C\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u167F\u1681-\u169A\u16A0-\u16F8\u1700-\u1711\u1715\u171F-\u1731\u1734-\u1736\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17B6\u17BE-\u17C5\u17C7\u17C8\u17D4-\u17DA\u17DC\u17E0-\u17E9\u1810-\u1819\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1923-\u1926\u1929-\u192B\u1930\u1931\u1933-\u1938\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A16\u1A19\u1A1A\u1A1E-\u1A55\u1A57\u1A61\u1A63\u1A64\u1A6D-\u1A72\u1A80-\u1A89\u1A90-\u1A99\u1AA0-\u1AAD\u1B04-\u1B33\u1B35\u1B3B\u1B3D-\u1B41\u1B43-\u1B4C\u1B4E-\u1B6A\u1B74-\u1B7F\u1B82-\u1BA1\u1BA6\u1BA7\u1BAA\u1BAE-\u1BE5\u1BE7\u1BEA-\u1BEC\u1BEE\u1BF2\u1BF3\u1BFC-\u1C2B\u1C34\u1C35\u1C3B-\u1C49\u1C4D-\u1C8A\u1C90-\u1CBA\u1CBD-\u1CC7\u1CD3\u1CE1\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5-\u1CF7\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200E\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u214F\u2160-\u2188\u2336-\u237A\u2395\u249C-\u24E9\u26AC\u2800-\u28FF\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D70\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u302E\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u3190-\u31BF\u31F0-\u321C\u3220-\u324F\u3260-\u327B\u327F-\u32B0\u32C0-\u32CB\u32D0-\u3376\u337B-\u33DD\u33E0-\u33FE\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA60C\uA610-\uA62B\uA640-\uA66E\uA680-\uA69D\uA6A0-\uA6EF\uA6F2-\uA6F7\uA722-\uA787\uA789-\uA7DC\uA7F1-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA824\uA827\uA830-\uA837\uA840-\uA873\uA880-\uA8C3\uA8CE-\uA8D9\uA8F2-\uA8FE\uA900-\uA925\uA92E-\uA946\uA952\uA953\uA95F-\uA97C\uA983-\uA9B2\uA9B4\uA9B5\uA9BA\uA9BB\uA9BE-\uA9CD\uA9CF-\uA9D9\uA9DE-\uA9E4\uA9E6-\uA9FE\uAA00-\uAA28\uAA2F\uAA30\uAA33\uAA34\uAA40-\uAA42\uAA44-\uAA4B\uAA4D\uAA50-\uAA59\uAA5C-\uAA7B\uAA7D-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAAEB\uAAEE-\uAAF5\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB69\uAB70-\uABE4\uABE6\uABE7\uABE9-\uABEC\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uD800-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC\u{10000}-\u{1000B}\u{1000D}-\u{10026}\u{10028}-\u{1003A}\u{1003C}\u{1003D}\u{1003F}-\u{1004D}\u{10050}-\u{1005D}\u{10080}-\u{100FA}\u{10100}\u{10102}\u{10107}-\u{10133}\u{10137}-\u{1013F}\u{1018D}\u{1018E}\u{101D0}-\u{101FC}\u{10280}-\u{1029C}\u{102A0}-\u{102D0}\u{10300}-\u{10323}\u{1032D}-\u{1034A}\u{10350}-\u{10375}\u{10380}-\u{1039D}\u{1039F}-\u{103C3}\u{103C8}-\u{103D5}\u{10400}-\u{1049D}\u{104A0}-\u{104A9}\u{104B0}-\u{104D3}\u{104D8}-\u{104FB}\u{10500}-\u{10527}\u{10530}-\u{10563}\u{1056F}-\u{1057A}\u{1057C}-\u{1058A}\u{1058C}-\u{10592}\u{10594}\u{10595}\u{10597}-\u{105A1}\u{105A3}-\u{105B1}\u{105B3}-\u{105B9}\u{105BB}\u{105BC}\u{105C0}-\u{105F3}\u{10600}-\u{10736}\u{10740}-\u{10755}\u{10760}-\u{10767}\u{10780}-\u{10785}\u{10787}-\u{107B0}\u{107B2}-\u{107BA}\u{11000}\u{11002}-\u{11037}\u{11047}-\u{1104D}\u{11066}-\u{1106F}\u{11071}\u{11072}\u{11075}\u{11082}-\u{110B2}\u{110B7}\u{110B8}\u{110BB}-\u{110C1}\u{110CD}\u{110D0}-\u{110E8}\u{110F0}-\u{110F9}\u{11103}-\u{11126}\u{1112C}\u{11136}-\u{11147}\u{11150}-\u{11172}\u{11174}-\u{11176}\u{11182}-\u{111B5}\u{111BF}-\u{111C8}\u{111CD}\u{111CE}\u{111D0}-\u{111DF}\u{111E1}-\u{111F4}\u{11200}-\u{11211}\u{11213}-\u{1122E}\u{11232}\u{11233}\u{11235}\u{11238}-\u{1123D}\u{1123F}\u{11240}\u{11280}-\u{11286}\u{11288}\u{1128A}-\u{1128D}\u{1128F}-\u{1129D}\u{1129F}-\u{112A9}\u{112B0}-\u{112DE}\u{112E0}-\u{112E2}\u{112F0}-\u{112F9}\u{11302}\u{11303}\u{11305}-\u{1130C}\u{1130F}\u{11310}\u{11313}-\u{11328}\u{1132A}-\u{11330}\u{11332}\u{11333}\u{11335}-\u{11339}\u{1133D}-\u{1133F}\u{11341}-\u{11344}\u{11347}\u{11348}\u{1134B}-\u{1134D}\u{11350}\u{11357}\u{1135D}-\u{11363}\u{11380}-\u{11389}\u{1138B}\u{1138E}\u{11390}-\u{113B5}\u{113B7}-\u{113BA}\u{113C2}\u{113C5}\u{113C7}-\u{113CA}\u{113CC}\u{113CD}\u{113CF}\u{113D1}\u{113D3}-\u{113D5}\u{113D7}\u{113D8}\u{11400}-\u{11437}\u{11440}\u{11441}\u{11445}\u{11447}-\u{1145B}\u{1145D}\u{1145F}-\u{11461}\u{11480}-\u{114B2}\u{114B9}\u{114BB}-\u{114BE}\u{114C1}\u{114C4}-\u{114C7}\u{114D0}-\u{114D9}\u{11580}-\u{115B1}\u{115B8}-\u{115BB}\u{115BE}\u{115C1}-\u{115DB}\u{11600}-\u{11632}\u{1163B}\u{1163C}\u{1163E}\u{11641}-\u{11644}\u{11650}-\u{11659}\u{11680}-\u{116AA}\u{116AC}\u{116AE}\u{116AF}\u{116B6}\u{116B8}\u{116B9}\u{116C0}-\u{116C9}\u{116D0}-\u{116E3}\u{11700}-\u{1171A}\u{1171E}\u{11720}\u{11721}\u{11726}\u{11730}-\u{11746}\u{11800}-\u{1182E}\u{11838}\u{1183B}\u{118A0}-\u{118F2}\u{118FF}-\u{11906}\u{11909}\u{1190C}-\u{11913}\u{11915}\u{11916}\u{11918}-\u{11935}\u{11937}\u{11938}\u{1193D}\u{1193F}-\u{11942}\u{11944}-\u{11946}\u{11950}-\u{11959}\u{119A0}-\u{119A7}\u{119AA}-\u{119D3}\u{119DC}-\u{119DF}\u{119E1}-\u{119E4}\u{11A00}\u{11A07}\u{11A08}\u{11A0B}-\u{11A32}\u{11A39}\u{11A3A}\u{11A3F}-\u{11A46}\u{11A50}\u{11A57}\u{11A58}\u{11A5C}-\u{11A89}\u{11A97}\u{11A9A}-\u{11AA2}\u{11AB0}-\u{11AF8}\u{11B00}-\u{11B09}\u{11B61}\u{11B65}\u{11B67}\u{11BC0}-\u{11BE1}\u{11BF0}-\u{11BF9}\u{11C00}-\u{11C08}\u{11C0A}-\u{11C2F}\u{11C3E}-\u{11C45}\u{11C50}-\u{11C6C}\u{11C70}-\u{11C8F}\u{11CA9}\u{11CB1}\u{11CB4}\u{11D00}-\u{11D06}\u{11D08}\u{11D09}\u{11D0B}-\u{11D30}\u{11D46}\u{11D50}-\u{11D59}\u{11D60}-\u{11D65}\u{11D67}\u{11D68}\u{11D6A}-\u{11D8E}\u{11D93}\u{11D94}\u{11D96}\u{11D98}\u{11DA0}-\u{11DA9}\u{11DB0}-\u{11DDB}\u{11DE0}-\u{11DE9}\u{11EE0}-\u{11EF2}\u{11EF5}-\u{11EF8}\u{11F02}-\u{11F10}\u{11F12}-\u{11F35}\u{11F3E}\u{11F3F}\u{11F41}\u{11F43}-\u{11F59}\u{11FB0}\u{11FC0}-\u{11FD4}\u{11FFF}-\u{12399}\u{12400}-\u{1246E}\u{12470}-\u{12474}\u{12480}-\u{12543}\u{12F90}-\u{12FF2}\u{13000}-\u{1343F}\u{13441}-\u{13446}\u{13460}-\u{143FA}\u{14400}-\u{14646}\u{16100}-\u{1611D}\u{1612A}-\u{1612C}\u{16130}-\u{16139}\u{16800}-\u{16A38}\u{16A40}-\u{16A5E}\u{16A60}-\u{16A69}\u{16A6E}-\u{16ABE}\u{16AC0}-\u{16AC9}\u{16AD0}-\u{16AED}\u{16AF5}\u{16B00}-\u{16B2F}\u{16B37}-\u{16B45}\u{16B50}-\u{16B59}\u{16B5B}-\u{16B61}\u{16B63}-\u{16B77}\u{16B7D}-\u{16B8F}\u{16D40}-\u{16D79}\u{16E40}-\u{16E9A}\u{16EA0}-\u{16EB8}\u{16EBB}-\u{16ED3}\u{16F00}-\u{16F4A}\u{16F50}-\u{16F87}\u{16F93}-\u{16F9F}\u{16FE0}\u{16FE1}\u{16FE3}\u{16FF0}-\u{16FF6}\u{17000}-\u{18CD5}\u{18CFF}-\u{18D1E}\u{18D80}-\u{18DF2}\u{1AFF0}-\u{1AFF3}\u{1AFF5}-\u{1AFFB}\u{1AFFD}\u{1AFFE}\u{1B000}-\u{1B122}\u{1B132}\u{1B150}-\u{1B152}\u{1B155}\u{1B164}-\u{1B167}\u{1B170}-\u{1B2FB}\u{1BC00}-\u{1BC6A}\u{1BC70}-\u{1BC7C}\u{1BC80}-\u{1BC88}\u{1BC90}-\u{1BC99}\u{1BC9C}\u{1BC9F}\u{1CCD6}-\u{1CCEF}\u{1CF50}-\u{1CFC3}\u{1D000}-\u{1D0F5}\u{1D100}-\u{1D126}\u{1D129}-\u{1D166}\u{1D16A}-\u{1D172}\u{1D183}\u{1D184}\u{1D18C}-\u{1D1A9}\u{1D1AE}-\u{1D1E8}\u{1D2C0}-\u{1D2D3}\u{1D2E0}-\u{1D2F3}\u{1D360}-\u{1D378}\u{1D400}-\u{1D454}\u{1D456}-\u{1D49C}\u{1D49E}\u{1D49F}\u{1D4A2}\u{1D4A5}\u{1D4A6}\u{1D4A9}-\u{1D4AC}\u{1D4AE}-\u{1D4B9}\u{1D4BB}\u{1D4BD}-\u{1D4C3}\u{1D4C5}-\u{1D505}\u{1D507}-\u{1D50A}\u{1D50D}-\u{1D514}\u{1D516}-\u{1D51C}\u{1D51E}-\u{1D539}\u{1D53B}-\u{1D53E}\u{1D540}-\u{1D544}\u{1D546}\u{1D54A}-\u{1D550}\u{1D552}-\u{1D6A5}\u{1D6A8}-\u{1D6C0}\u{1D6C2}-\u{1D6DA}\u{1D6DC}-\u{1D6FA}\u{1D6FC}-\u{1D714}\u{1D716}-\u{1D734}\u{1D736}-\u{1D74E}\u{1D750}-\u{1D76E}\u{1D770}-\u{1D788}\u{1D78A}-\u{1D7A8}\u{1D7AA}-\u{1D7C2}\u{1D7C4}-\u{1D7CB}\u{1D800}-\u{1D9FF}\u{1DA37}-\u{1DA3A}\u{1DA6D}-\u{1DA74}\u{1DA76}-\u{1DA83}\u{1DA85}-\u{1DA8B}\u{1DF00}-\u{1DF1E}\u{1DF25}-\u{1DF2A}\u{1E030}-\u{1E06D}\u{1E100}-\u{1E12C}\u{1E137}-\u{1E13D}\u{1E140}-\u{1E149}\u{1E14E}\u{1E14F}\u{1E290}-\u{1E2AD}\u{1E2C0}-\u{1E2EB}\u{1E2F0}-\u{1E2F9}\u{1E4D0}-\u{1E4EB}\u{1E4F0}-\u{1E4F9}\u{1E5D0}-\u{1E5ED}\u{1E5F0}-\u{1E5FA}\u{1E5FF}\u{1E6C0}-\u{1E6DE}\u{1E6E0}-\u{1E6E2}\u{1E6E4}\u{1E6E5}\u{1E6E7}-\u{1E6ED}\u{1E6F0}-\u{1E6F4}\u{1E6FE}\u{1E6FF}\u{1E7E0}-\u{1E7E6}\u{1E7E8}-\u{1E7EB}\u{1E7ED}\u{1E7EE}\u{1E7F0}-\u{1E7FE}\u{1F110}-\u{1F12E}\u{1F130}-\u{1F169}\u{1F170}-\u{1F1AC}\u{1F1E6}-\u{1F202}\u{1F210}-\u{1F23B}\u{1F240}-\u{1F248}\u{1F250}\u{1F251}\u{20000}-\u{2A6DF}\u{2A700}-\u{2B81D}\u{2B820}-\u{2CEAD}\u{2CEB0}-\u{2EBE0}\u{2EBF0}-\u{2EE5D}\u{2F800}-\u{2FA1D}\u{30000}-\u{3134A}\u{31350}-\u{33479}\u{F0000}-\u{FFFFD}\u{100000}-\u{10FFFD}]/u,_le=/[\u05BE\u05C0\u05C3\u05C6\u05D0-\u05EA\u05EF-\u05F4\u0608\u060B\u060D\u061B-\u064A\u066D-\u066F\u0671-\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u070D\u070F\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07C0-\u07EA\u07F4\u07F5\u07FA\u07FE-\u0815\u081A\u0824\u0828\u0830-\u083E\u0840-\u0858\u085E\u0860-\u086A\u0870-\u088F\u08A0-\u08C9\u200F\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBC2\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFC\uFE70-\uFE74\uFE76-\uFEFC\u{10800}-\u{10805}\u{10808}\u{1080A}-\u{10835}\u{10837}\u{10838}\u{1083C}\u{1083F}-\u{10855}\u{10857}-\u{1089E}\u{108A7}-\u{108AF}\u{108E0}-\u{108F2}\u{108F4}\u{108F5}\u{108FB}-\u{1091B}\u{10920}-\u{10939}\u{1093F}-\u{10959}\u{10980}-\u{109B7}\u{109BC}-\u{109CF}\u{109D2}-\u{10A00}\u{10A10}-\u{10A13}\u{10A15}-\u{10A17}\u{10A19}-\u{10A35}\u{10A40}-\u{10A48}\u{10A50}-\u{10A58}\u{10A60}-\u{10A9F}\u{10AC0}-\u{10AE4}\u{10AEB}-\u{10AF6}\u{10B00}-\u{10B35}\u{10B40}-\u{10B55}\u{10B58}-\u{10B72}\u{10B78}-\u{10B91}\u{10B99}-\u{10B9C}\u{10BA9}-\u{10BAF}\u{10C00}-\u{10C48}\u{10C80}-\u{10CB2}\u{10CC0}-\u{10CF2}\u{10CFA}-\u{10D23}\u{10D4A}-\u{10D65}\u{10D6F}-\u{10D85}\u{10D8E}\u{10D8F}\u{10E80}-\u{10EA9}\u{10EAD}\u{10EB0}\u{10EB1}\u{10EC2}-\u{10EC7}\u{10F00}-\u{10F27}\u{10F30}-\u{10F45}\u{10F51}-\u{10F59}\u{10F70}-\u{10F81}\u{10F86}-\u{10F89}\u{10FB0}-\u{10FCB}\u{10FE0}-\u{10FF6}\u{1E800}-\u{1E8C4}\u{1E8C7}-\u{1E8CF}\u{1E900}-\u{1E943}\u{1E94B}\u{1E950}-\u{1E959}\u{1E95E}\u{1E95F}\u{1EC71}-\u{1ECB4}\u{1ED01}-\u{1ED3D}\u{1EE00}-\u{1EE03}\u{1EE05}-\u{1EE1F}\u{1EE21}\u{1EE22}\u{1EE24}\u{1EE27}\u{1EE29}-\u{1EE32}\u{1EE34}-\u{1EE37}\u{1EE39}\u{1EE3B}\u{1EE42}\u{1EE47}\u{1EE49}\u{1EE4B}\u{1EE4D}-\u{1EE4F}\u{1EE51}\u{1EE52}\u{1EE54}\u{1EE57}\u{1EE59}\u{1EE5B}\u{1EE5D}\u{1EE5F}\u{1EE61}\u{1EE62}\u{1EE64}\u{1EE67}-\u{1EE6A}\u{1EE6C}-\u{1EE72}\u{1EE74}-\u{1EE77}\u{1EE79}-\u{1EE7C}\u{1EE7E}\u{1EE80}-\u{1EE89}\u{1EE8B}-\u{1EE9B}\u{1EEA1}-\u{1EEA3}\u{1EEA5}-\u{1EEA9}\u{1EEAB}-\u{1EEBB}]/u,Ale=/^[\0-\x08\x0E-\x1B!-@\[-`\{-\x84\x86-\xA9\xAB-\xB4\xB6-\xB9\xBB-\xBF\xD7\xF7\u02B9\u02BA\u02C2-\u02CF\u02D2-\u02DF\u02E5-\u02ED\u02EF-\u036F\u0374\u0375\u037E\u0384\u0385\u0387\u03F6\u0483-\u0489\u058A\u058D-\u058F\u0591-\u05C7\u05D0-\u05EA\u05EF-\u05F4\u0600-\u070D\u070F-\u074A\u074D-\u07B1\u07C0-\u07FA\u07FD-\u082D\u0830-\u083E\u0840-\u085B\u085E\u0860-\u086A\u0870-\u0891\u0897-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962\u0963\u0981\u09BC\u09C1-\u09C4\u09CD\u09E2\u09E3\u09F2\u09F3\u09FB\u09FE\u0A01\u0A02\u0A3C\u0A41\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7\u0AC8\u0ACD\u0AE2\u0AE3\u0AF1\u0AFA-\u0AFF\u0B01\u0B3C\u0B3F\u0B41-\u0B44\u0B4D\u0B55\u0B56\u0B62\u0B63\u0B82\u0BC0\u0BCD\u0BF3-\u0BFA\u0C00\u0C04\u0C3C\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C78-\u0C7E\u0C81\u0CBC\u0CCC\u0CCD\u0CE2\u0CE3\u0D00\u0D01\u0D3B\u0D3C\u0D41-\u0D44\u0D4D\u0D62\u0D63\u0D81\u0DCA\u0DD2-\u0DD4\u0DD6\u0E31\u0E34-\u0E3A\u0E3F\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0F18\u0F19\u0F35\u0F37\u0F39-\u0F3D\u0F71-\u0F7E\u0F80-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032-\u1037\u1039\u103A\u103D\u103E\u1058\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085\u1086\u108D\u109D\u135D-\u135F\u1390-\u1399\u1400\u169B\u169C\u1712-\u1714\u1732\u1733\u1752\u1753\u1772\u1773\u17B4\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D3\u17DB\u17DD\u17F0-\u17F9\u1800-\u180F\u1885\u1886\u18A9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193B\u1940\u1944\u1945\u19DE-\u19FF\u1A17\u1A18\u1A1B\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1AB0-\u1ADD\u1AE0-\u1AEB\u1B00-\u1B03\u1B34\u1B36-\u1B3A\u1B3C\u1B42\u1B6B-\u1B73\u1B80\u1B81\u1BA2-\u1BA5\u1BA8\u1BA9\u1BAB-\u1BAD\u1BE6\u1BE8\u1BE9\u1BED\u1BEF-\u1BF1\u1C2C-\u1C33\u1C36\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DFF\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u200B-\u200D\u200F-\u2027\u202F-\u205E\u2060-\u2064\u206A-\u2070\u2074-\u207E\u2080-\u208E\u20A0-\u20C1\u20D0-\u20F0\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u2150-\u215F\u2189-\u218B\u2190-\u2335\u237B-\u2394\u2396-\u2429\u2440-\u244A\u2460-\u249B\u24EA-\u26AB\u26AD-\u27FF\u2900-\u2B73\u2B76-\u2BFF\u2CE5-\u2CEA\u2CEF-\u2CF1\u2CF9-\u2CFF\u2D7F\u2DE0-\u2E5D\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3001-\u3004\u3008-\u3020\u302A-\u302D\u3030\u3036\u3037\u303D-\u303F\u3099-\u309C\u30A0\u30FB\u31C0-\u31E5\u31EF\u321D\u321E\u3250-\u325F\u327C-\u327E\u32B1-\u32BF\u32CC-\u32CF\u3377-\u337A\u33DE\u33DF\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA60D-\uA60F\uA66F-\uA67F\uA69E\uA69F\uA6F0\uA6F1\uA700-\uA721\uA788\uA802\uA806\uA80B\uA825\uA826\uA828-\uA82C\uA838\uA839\uA874-\uA877\uA8C4\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA951\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uA9BD\uA9E5\uAA29-\uAA2E\uAA31\uAA32\uAA35\uAA36\uAA43\uAA4C\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEC\uAAED\uAAF6\uAB6A\uAB6B\uABE5\uABE8\uABED\uFB1D-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFDCF\uFDF0-\uFE19\uFE20-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFE70-\uFE74\uFE76-\uFEFC\uFEFF\uFF01-\uFF20\uFF3B-\uFF40\uFF5B-\uFF65\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFF9-\uFFFD\u{10101}\u{10140}-\u{1018C}\u{10190}-\u{1019C}\u{101A0}\u{101FD}\u{102E0}-\u{102FB}\u{10376}-\u{1037A}\u{10800}-\u{10805}\u{10808}\u{1080A}-\u{10835}\u{10837}\u{10838}\u{1083C}\u{1083F}-\u{10855}\u{10857}-\u{1089E}\u{108A7}-\u{108AF}\u{108E0}-\u{108F2}\u{108F4}\u{108F5}\u{108FB}-\u{1091B}\u{1091F}-\u{10939}\u{1093F}-\u{10959}\u{10980}-\u{109B7}\u{109BC}-\u{109CF}\u{109D2}-\u{10A03}\u{10A05}\u{10A06}\u{10A0C}-\u{10A13}\u{10A15}-\u{10A17}\u{10A19}-\u{10A35}\u{10A38}-\u{10A3A}\u{10A3F}-\u{10A48}\u{10A50}-\u{10A58}\u{10A60}-\u{10A9F}\u{10AC0}-\u{10AE6}\u{10AEB}-\u{10AF6}\u{10B00}-\u{10B35}\u{10B39}-\u{10B55}\u{10B58}-\u{10B72}\u{10B78}-\u{10B91}\u{10B99}-\u{10B9C}\u{10BA9}-\u{10BAF}\u{10C00}-\u{10C48}\u{10C80}-\u{10CB2}\u{10CC0}-\u{10CF2}\u{10CFA}-\u{10D27}\u{10D30}-\u{10D39}\u{10D40}-\u{10D65}\u{10D69}-\u{10D85}\u{10D8E}\u{10D8F}\u{10E60}-\u{10E7E}\u{10E80}-\u{10EA9}\u{10EAB}-\u{10EAD}\u{10EB0}\u{10EB1}\u{10EC2}-\u{10EC7}\u{10ED0}-\u{10ED8}\u{10EFA}-\u{10F27}\u{10F30}-\u{10F59}\u{10F70}-\u{10F89}\u{10FB0}-\u{10FCB}\u{10FE0}-\u{10FF6}\u{11001}\u{11038}-\u{11046}\u{11052}-\u{11065}\u{11070}\u{11073}\u{11074}\u{1107F}-\u{11081}\u{110B3}-\u{110B6}\u{110B9}\u{110BA}\u{110C2}\u{11100}-\u{11102}\u{11127}-\u{1112B}\u{1112D}-\u{11134}\u{11173}\u{11180}\u{11181}\u{111B6}-\u{111BE}\u{111C9}-\u{111CC}\u{111CF}\u{1122F}-\u{11231}\u{11234}\u{11236}\u{11237}\u{1123E}\u{11241}\u{112DF}\u{112E3}-\u{112EA}\u{11300}\u{11301}\u{1133B}\u{1133C}\u{11340}\u{11366}-\u{1136C}\u{11370}-\u{11374}\u{113BB}-\u{113C0}\u{113CE}\u{113D0}\u{113D2}\u{113E1}\u{113E2}\u{11438}-\u{1143F}\u{11442}-\u{11444}\u{11446}\u{1145E}\u{114B3}-\u{114B8}\u{114BA}\u{114BF}\u{114C0}\u{114C2}\u{114C3}\u{115B2}-\u{115B5}\u{115BC}\u{115BD}\u{115BF}\u{115C0}\u{115DC}\u{115DD}\u{11633}-\u{1163A}\u{1163D}\u{1163F}\u{11640}\u{11660}-\u{1166C}\u{116AB}\u{116AD}\u{116B0}-\u{116B5}\u{116B7}\u{1171D}\u{1171F}\u{11722}-\u{11725}\u{11727}-\u{1172B}\u{1182F}-\u{11837}\u{11839}\u{1183A}\u{1193B}\u{1193C}\u{1193E}\u{11943}\u{119D4}-\u{119D7}\u{119DA}\u{119DB}\u{119E0}\u{11A01}-\u{11A06}\u{11A09}\u{11A0A}\u{11A33}-\u{11A38}\u{11A3B}-\u{11A3E}\u{11A47}\u{11A51}-\u{11A56}\u{11A59}-\u{11A5B}\u{11A8A}-\u{11A96}\u{11A98}\u{11A99}\u{11B60}\u{11B62}-\u{11B64}\u{11B66}\u{11C30}-\u{11C36}\u{11C38}-\u{11C3D}\u{11C92}-\u{11CA7}\u{11CAA}-\u{11CB0}\u{11CB2}\u{11CB3}\u{11CB5}\u{11CB6}\u{11D31}-\u{11D36}\u{11D3A}\u{11D3C}\u{11D3D}\u{11D3F}-\u{11D45}\u{11D47}\u{11D90}\u{11D91}\u{11D95}\u{11D97}\u{11EF3}\u{11EF4}\u{11F00}\u{11F01}\u{11F36}-\u{11F3A}\u{11F40}\u{11F42}\u{11F5A}\u{11FD5}-\u{11FF1}\u{13440}\u{13447}-\u{13455}\u{1611E}-\u{16129}\u{1612D}-\u{1612F}\u{16AF0}-\u{16AF4}\u{16B30}-\u{16B36}\u{16F4F}\u{16F8F}-\u{16F92}\u{16FE2}\u{16FE4}\u{1BC9D}\u{1BC9E}\u{1BCA0}-\u{1BCA3}\u{1CC00}-\u{1CCD5}\u{1CCF0}-\u{1CCFC}\u{1CD00}-\u{1CEB3}\u{1CEBA}-\u{1CED0}\u{1CEE0}-\u{1CEF0}\u{1CF00}-\u{1CF2D}\u{1CF30}-\u{1CF46}\u{1D167}-\u{1D169}\u{1D173}-\u{1D182}\u{1D185}-\u{1D18B}\u{1D1AA}-\u{1D1AD}\u{1D1E9}\u{1D1EA}\u{1D200}-\u{1D245}\u{1D300}-\u{1D356}\u{1D6C1}\u{1D6DB}\u{1D6FB}\u{1D715}\u{1D735}\u{1D74F}\u{1D76F}\u{1D789}\u{1D7A9}\u{1D7C3}\u{1D7CE}-\u{1D7FF}\u{1DA00}-\u{1DA36}\u{1DA3B}-\u{1DA6C}\u{1DA75}\u{1DA84}\u{1DA9B}-\u{1DA9F}\u{1DAA1}-\u{1DAAF}\u{1E000}-\u{1E006}\u{1E008}-\u{1E018}\u{1E01B}-\u{1E021}\u{1E023}\u{1E024}\u{1E026}-\u{1E02A}\u{1E08F}\u{1E130}-\u{1E136}\u{1E2AE}\u{1E2EC}-\u{1E2EF}\u{1E2FF}\u{1E4EC}-\u{1E4EF}\u{1E5EE}\u{1E5EF}\u{1E6E3}\u{1E6E6}\u{1E6EE}\u{1E6EF}\u{1E6F5}\u{1E800}-\u{1E8C4}\u{1E8C7}-\u{1E8D6}\u{1E900}-\u{1E94B}\u{1E950}-\u{1E959}\u{1E95E}\u{1E95F}\u{1EC71}-\u{1ECB4}\u{1ED01}-\u{1ED3D}\u{1EE00}-\u{1EE03}\u{1EE05}-\u{1EE1F}\u{1EE21}\u{1EE22}\u{1EE24}\u{1EE27}\u{1EE29}-\u{1EE32}\u{1EE34}-\u{1EE37}\u{1EE39}\u{1EE3B}\u{1EE42}\u{1EE47}\u{1EE49}\u{1EE4B}\u{1EE4D}-\u{1EE4F}\u{1EE51}\u{1EE52}\u{1EE54}\u{1EE57}\u{1EE59}\u{1EE5B}\u{1EE5D}\u{1EE5F}\u{1EE61}\u{1EE62}\u{1EE64}\u{1EE67}-\u{1EE6A}\u{1EE6C}-\u{1EE72}\u{1EE74}-\u{1EE77}\u{1EE79}-\u{1EE7C}\u{1EE7E}\u{1EE80}-\u{1EE89}\u{1EE8B}-\u{1EE9B}\u{1EEA1}-\u{1EEA3}\u{1EEA5}-\u{1EEA9}\u{1EEAB}-\u{1EEBB}\u{1EEF0}\u{1EEF1}\u{1F000}-\u{1F02B}\u{1F030}-\u{1F093}\u{1F0A0}-\u{1F0AE}\u{1F0B1}-\u{1F0BF}\u{1F0C1}-\u{1F0CF}\u{1F0D1}-\u{1F0F5}\u{1F100}-\u{1F10F}\u{1F12F}\u{1F16A}-\u{1F16F}\u{1F1AD}\u{1F260}-\u{1F265}\u{1F300}-\u{1F6D8}\u{1F6DC}-\u{1F6EC}\u{1F6F0}-\u{1F6FC}\u{1F700}-\u{1F7D9}\u{1F7E0}-\u{1F7EB}\u{1F7F0}\u{1F800}-\u{1F80B}\u{1F810}-\u{1F847}\u{1F850}-\u{1F859}\u{1F860}-\u{1F887}\u{1F890}-\u{1F8AD}\u{1F8B0}-\u{1F8BB}\u{1F8C0}\u{1F8C1}\u{1F8D0}-\u{1F8D8}\u{1F900}-\u{1FA57}\u{1FA60}-\u{1FA6D}\u{1FA70}-\u{1FA7C}\u{1FA80}-\u{1FA8A}\u{1FA8E}-\u{1FAC6}\u{1FAC8}\u{1FACD}-\u{1FADC}\u{1FADF}-\u{1FAEA}\u{1FAEF}-\u{1FAF8}\u{1FB00}-\u{1FB92}\u{1FB94}-\u{1FBFA}\u{E0001}\u{E0020}-\u{E007F}\u{E0100}-\u{E01EF}]*$/u,wle=/[0-9\xB2\xB3\xB9\u05BE\u05C0\u05C3\u05C6\u05D0-\u05EA\u05EF-\u05F4\u0600-\u0605\u0608\u060B\u060D\u061B-\u064A\u0660-\u0669\u066B-\u066F\u0671-\u06D5\u06DD\u06E5\u06E6\u06EE-\u070D\u070F\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07C0-\u07EA\u07F4\u07F5\u07FA\u07FE-\u0815\u081A\u0824\u0828\u0830-\u083E\u0840-\u0858\u085E\u0860-\u086A\u0870-\u0891\u08A0-\u08C9\u08E2\u200F\u2070\u2074-\u2079\u2080-\u2089\u2488-\u249B\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBC2\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFC\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\u{102E1}-\u{102FB}\u{10800}-\u{10805}\u{10808}\u{1080A}-\u{10835}\u{10837}\u{10838}\u{1083C}\u{1083F}-\u{10855}\u{10857}-\u{1089E}\u{108A7}-\u{108AF}\u{108E0}-\u{108F2}\u{108F4}\u{108F5}\u{108FB}-\u{1091B}\u{10920}-\u{10939}\u{1093F}-\u{10959}\u{10980}-\u{109B7}\u{109BC}-\u{109CF}\u{109D2}-\u{10A00}\u{10A10}-\u{10A13}\u{10A15}-\u{10A17}\u{10A19}-\u{10A35}\u{10A40}-\u{10A48}\u{10A50}-\u{10A58}\u{10A60}-\u{10A9F}\u{10AC0}-\u{10AE4}\u{10AEB}-\u{10AF6}\u{10B00}-\u{10B35}\u{10B40}-\u{10B55}\u{10B58}-\u{10B72}\u{10B78}-\u{10B91}\u{10B99}-\u{10B9C}\u{10BA9}-\u{10BAF}\u{10C00}-\u{10C48}\u{10C80}-\u{10CB2}\u{10CC0}-\u{10CF2}\u{10CFA}-\u{10D23}\u{10D30}-\u{10D39}\u{10D40}-\u{10D65}\u{10D6F}-\u{10D85}\u{10D8E}\u{10D8F}\u{10E60}-\u{10E7E}\u{10E80}-\u{10EA9}\u{10EAD}\u{10EB0}\u{10EB1}\u{10EC2}-\u{10EC7}\u{10F00}-\u{10F27}\u{10F30}-\u{10F45}\u{10F51}-\u{10F59}\u{10F70}-\u{10F81}\u{10F86}-\u{10F89}\u{10FB0}-\u{10FCB}\u{10FE0}-\u{10FF6}\u{1CCF0}-\u{1CCF9}\u{1D7CE}-\u{1D7FF}\u{1E800}-\u{1E8C4}\u{1E8C7}-\u{1E8CF}\u{1E900}-\u{1E943}\u{1E94B}\u{1E950}-\u{1E959}\u{1E95E}\u{1E95F}\u{1EC71}-\u{1ECB4}\u{1ED01}-\u{1ED3D}\u{1EE00}-\u{1EE03}\u{1EE05}-\u{1EE1F}\u{1EE21}\u{1EE22}\u{1EE24}\u{1EE27}\u{1EE29}-\u{1EE32}\u{1EE34}-\u{1EE37}\u{1EE39}\u{1EE3B}\u{1EE42}\u{1EE47}\u{1EE49}\u{1EE4B}\u{1EE4D}-\u{1EE4F}\u{1EE51}\u{1EE52}\u{1EE54}\u{1EE57}\u{1EE59}\u{1EE5B}\u{1EE5D}\u{1EE5F}\u{1EE61}\u{1EE62}\u{1EE64}\u{1EE67}-\u{1EE6A}\u{1EE6C}-\u{1EE72}\u{1EE74}-\u{1EE77}\u{1EE79}-\u{1EE7C}\u{1EE7E}\u{1EE80}-\u{1EE89}\u{1EE8B}-\u{1EE9B}\u{1EEA1}-\u{1EEA3}\u{1EEA5}-\u{1EEA9}\u{1EEAB}-\u{1EEBB}\u{1F100}-\u{1F10A}\u{1FBF0}-\u{1FBF9}][\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0897-\u089F\u08CA-\u08E1\u08E3-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962\u0963\u0981\u09BC\u09C1-\u09C4\u09CD\u09E2\u09E3\u09FE\u0A01\u0A02\u0A3C\u0A41\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7\u0AC8\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01\u0B3C\u0B3F\u0B41-\u0B44\u0B4D\u0B55\u0B56\u0B62\u0B63\u0B82\u0BC0\u0BCD\u0C00\u0C04\u0C3C\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81\u0CBC\u0CCC\u0CCD\u0CE2\u0CE3\u0D00\u0D01\u0D3B\u0D3C\u0D41-\u0D44\u0D4D\u0D62\u0D63\u0D81\u0DCA\u0DD2-\u0DD4\u0DD6\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0F18\u0F19\u0F35\u0F37\u0F39\u0F71-\u0F7E\u0F80-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032-\u1037\u1039\u103A\u103D\u103E\u1058\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085\u1086\u108D\u109D\u135D-\u135F\u1712-\u1714\u1732\u1733\u1752\u1753\u1772\u1773\u17B4\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D3\u17DD\u180B-\u180D\u180F\u1885\u1886\u18A9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193B\u1A17\u1A18\u1A1B\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1AB0-\u1ADD\u1AE0-\u1AEB\u1B00-\u1B03\u1B34\u1B36-\u1B3A\u1B3C\u1B42\u1B6B-\u1B73\u1B80\u1B81\u1BA2-\u1BA5\u1BA8\u1BA9\u1BAB-\u1BAD\u1BE6\u1BE8\u1BE9\u1BED\u1BEF-\u1BF1\u1C2C-\u1C33\u1C36\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302D\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA825\uA826\uA82C\uA8C4\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA951\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uA9BD\uA9E5\uAA29-\uAA2E\uAA31\uAA32\uAA35\uAA36\uAA43\uAA4C\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEC\uAAED\uAAF6\uABE5\uABE8\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\u{101FD}\u{102E0}\u{10376}-\u{1037A}\u{10A01}-\u{10A03}\u{10A05}\u{10A06}\u{10A0C}-\u{10A0F}\u{10A38}-\u{10A3A}\u{10A3F}\u{10AE5}\u{10AE6}\u{10D24}-\u{10D27}\u{10D69}-\u{10D6D}\u{10EAB}\u{10EAC}\u{10EFA}-\u{10EFF}\u{10F46}-\u{10F50}\u{10F82}-\u{10F85}\u{11001}\u{11038}-\u{11046}\u{11070}\u{11073}\u{11074}\u{1107F}-\u{11081}\u{110B3}-\u{110B6}\u{110B9}\u{110BA}\u{110C2}\u{11100}-\u{11102}\u{11127}-\u{1112B}\u{1112D}-\u{11134}\u{11173}\u{11180}\u{11181}\u{111B6}-\u{111BE}\u{111C9}-\u{111CC}\u{111CF}\u{1122F}-\u{11231}\u{11234}\u{11236}\u{11237}\u{1123E}\u{11241}\u{112DF}\u{112E3}-\u{112EA}\u{11300}\u{11301}\u{1133B}\u{1133C}\u{11340}\u{11366}-\u{1136C}\u{11370}-\u{11374}\u{113BB}-\u{113C0}\u{113CE}\u{113D0}\u{113D2}\u{113E1}\u{113E2}\u{11438}-\u{1143F}\u{11442}-\u{11444}\u{11446}\u{1145E}\u{114B3}-\u{114B8}\u{114BA}\u{114BF}\u{114C0}\u{114C2}\u{114C3}\u{115B2}-\u{115B5}\u{115BC}\u{115BD}\u{115BF}\u{115C0}\u{115DC}\u{115DD}\u{11633}-\u{1163A}\u{1163D}\u{1163F}\u{11640}\u{116AB}\u{116AD}\u{116B0}-\u{116B5}\u{116B7}\u{1171D}\u{1171F}\u{11722}-\u{11725}\u{11727}-\u{1172B}\u{1182F}-\u{11837}\u{11839}\u{1183A}\u{1193B}\u{1193C}\u{1193E}\u{11943}\u{119D4}-\u{119D7}\u{119DA}\u{119DB}\u{119E0}\u{11A01}-\u{11A06}\u{11A09}\u{11A0A}\u{11A33}-\u{11A38}\u{11A3B}-\u{11A3E}\u{11A47}\u{11A51}-\u{11A56}\u{11A59}-\u{11A5B}\u{11A8A}-\u{11A96}\u{11A98}\u{11A99}\u{11B60}\u{11B62}-\u{11B64}\u{11B66}\u{11C30}-\u{11C36}\u{11C38}-\u{11C3D}\u{11C92}-\u{11CA7}\u{11CAA}-\u{11CB0}\u{11CB2}\u{11CB3}\u{11CB5}\u{11CB6}\u{11D31}-\u{11D36}\u{11D3A}\u{11D3C}\u{11D3D}\u{11D3F}-\u{11D45}\u{11D47}\u{11D90}\u{11D91}\u{11D95}\u{11D97}\u{11EF3}\u{11EF4}\u{11F00}\u{11F01}\u{11F36}-\u{11F3A}\u{11F40}\u{11F42}\u{11F5A}\u{13440}\u{13447}-\u{13455}\u{1611E}-\u{16129}\u{1612D}-\u{1612F}\u{16AF0}-\u{16AF4}\u{16B30}-\u{16B36}\u{16F4F}\u{16F8F}-\u{16F92}\u{16FE4}\u{1BC9D}\u{1BC9E}\u{1CF00}-\u{1CF2D}\u{1CF30}-\u{1CF46}\u{1D167}-\u{1D169}\u{1D17B}-\u{1D182}\u{1D185}-\u{1D18B}\u{1D1AA}-\u{1D1AD}\u{1D242}-\u{1D244}\u{1DA00}-\u{1DA36}\u{1DA3B}-\u{1DA6C}\u{1DA75}\u{1DA84}\u{1DA9B}-\u{1DA9F}\u{1DAA1}-\u{1DAAF}\u{1E000}-\u{1E006}\u{1E008}-\u{1E018}\u{1E01B}-\u{1E021}\u{1E023}\u{1E024}\u{1E026}-\u{1E02A}\u{1E08F}\u{1E130}-\u{1E136}\u{1E2AE}\u{1E2EC}-\u{1E2EF}\u{1E4EC}-\u{1E4EF}\u{1E5EE}\u{1E5EF}\u{1E6E3}\u{1E6E6}\u{1E6EE}\u{1E6EF}\u{1E6F5}\u{1E8D0}-\u{1E8D6}\u{1E944}-\u{1E94A}\u{E0100}-\u{E01EF}]*$/u,Ole=/[0-9\xB2\xB3\xB9\u06F0-\u06F9\u2070\u2074-\u2079\u2080-\u2089\u2488-\u249B\uFF10-\uFF19\u{102E1}-\u{102FB}\u{1CCF0}-\u{1CCF9}\u{1D7CE}-\u{1D7FF}\u{1F100}-\u{1F10A}\u{1FBF0}-\u{1FBF9}]/u,Sle=/[\u0600-\u0605\u0660-\u0669\u066B\u066C\u06DD\u0890\u0891\u08E2\u{10D30}-\u{10D39}\u{10D40}-\u{10D49}\u{10E60}-\u{10E7E}]/u,Cle=/^[\0-\x08\x0E-\x1B!-\x84\x86-\u0377\u037A-\u037F\u0384-\u038A\u038C\u038E-\u03A1\u03A3-\u052F\u0531-\u0556\u0559-\u058A\u058D-\u058F\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0606\u0607\u0609\u060A\u060C\u060E-\u061A\u064B-\u065F\u066A\u0670\u06D6-\u06DC\u06DE-\u06E4\u06E7-\u06ED\u06F0-\u06F9\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07F6-\u07F9\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0897-\u089F\u08CA-\u08E1\u08E3-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09FE\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A76\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AF1\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B77\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BFA\u0C00-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3C-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C5C\u0C5D\u0C60-\u0C63\u0C66-\u0C6F\u0C77-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDC-\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1-\u0CF3\u0D00-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4F\u0D54-\u0D63\u0D66-\u0D7F\u0D81-\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2-\u0DF4\u0E01-\u0E3A\u0E3F-\u0E5B\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECE\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00-\u0F47\u0F49-\u0F6C\u0F71-\u0F97\u0F99-\u0FBC\u0FBE-\u0FCC\u0FCE-\u0FDA\u1000-\u10C5\u10C7\u10CD\u10D0-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u137C\u1380-\u1399\u13A0-\u13F5\u13F8-\u13FD\u1400-\u167F\u1681-\u169C\u16A0-\u16F8\u1700-\u1715\u171F-\u1736\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17DD\u17E0-\u17E9\u17F0-\u17F9\u1800-\u1819\u1820-\u1878\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1940\u1944-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u19DE-\u1A1B\u1A1E-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA0-\u1AAD\u1AB0-\u1ADD\u1AE0-\u1AEB\u1B00-\u1B4C\u1B4E-\u1BF3\u1BFC-\u1C37\u1C3B-\u1C49\u1C4D-\u1C8A\u1C90-\u1CBA\u1CBD-\u1CC7\u1CD0-\u1CFA\u1D00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FC4\u1FC6-\u1FD3\u1FD6-\u1FDB\u1FDD-\u1FEF\u1FF2-\u1FF4\u1FF6-\u1FFE\u200B-\u200E\u2010-\u2027\u202F-\u205E\u2060-\u2064\u206A-\u2071\u2074-\u208E\u2090-\u209C\u20A0-\u20C1\u20D0-\u20F0\u2100-\u218B\u2190-\u2429\u2440-\u244A\u2460-\u2B73\u2B76-\u2CF3\u2CF9-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D70\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2E5D\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3001-\u303F\u3041-\u3096\u3099-\u30FF\u3105-\u312F\u3131-\u318E\u3190-\u31E5\u31EF-\u321E\u3220-\uA48C\uA490-\uA4C6\uA4D0-\uA62B\uA640-\uA6F7\uA700-\uA7DC\uA7F1-\uA82C\uA830-\uA839\uA840-\uA877\uA880-\uA8C5\uA8CE-\uA8D9\uA8E0-\uA953\uA95F-\uA97C\uA980-\uA9CD\uA9CF-\uA9D9\uA9DE-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA5C-\uAAC2\uAADB-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB6B\uAB70-\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uD800-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1E\uFB29\uFBC3-\uFBD2\uFD3E-\uFD4F\uFD90\uFD91\uFDC8-\uFDCF\uFDFD-\uFE19\uFE20-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFEFF\uFF01-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFF9-\uFFFD\u{10000}-\u{1000B}\u{1000D}-\u{10026}\u{10028}-\u{1003A}\u{1003C}\u{1003D}\u{1003F}-\u{1004D}\u{10050}-\u{1005D}\u{10080}-\u{100FA}\u{10100}-\u{10102}\u{10107}-\u{10133}\u{10137}-\u{1018E}\u{10190}-\u{1019C}\u{101A0}\u{101D0}-\u{101FD}\u{10280}-\u{1029C}\u{102A0}-\u{102D0}\u{102E0}-\u{102FB}\u{10300}-\u{10323}\u{1032D}-\u{1034A}\u{10350}-\u{1037A}\u{10380}-\u{1039D}\u{1039F}-\u{103C3}\u{103C8}-\u{103D5}\u{10400}-\u{1049D}\u{104A0}-\u{104A9}\u{104B0}-\u{104D3}\u{104D8}-\u{104FB}\u{10500}-\u{10527}\u{10530}-\u{10563}\u{1056F}-\u{1057A}\u{1057C}-\u{1058A}\u{1058C}-\u{10592}\u{10594}\u{10595}\u{10597}-\u{105A1}\u{105A3}-\u{105B1}\u{105B3}-\u{105B9}\u{105BB}\u{105BC}\u{105C0}-\u{105F3}\u{10600}-\u{10736}\u{10740}-\u{10755}\u{10760}-\u{10767}\u{10780}-\u{10785}\u{10787}-\u{107B0}\u{107B2}-\u{107BA}\u{1091F}\u{10A01}-\u{10A03}\u{10A05}\u{10A06}\u{10A0C}-\u{10A0F}\u{10A38}-\u{10A3A}\u{10A3F}\u{10AE5}\u{10AE6}\u{10B39}-\u{10B3F}\u{10D24}-\u{10D27}\u{10D69}-\u{10D6E}\u{10EAB}\u{10EAC}\u{10ED0}-\u{10ED8}\u{10EFA}-\u{10EFF}\u{10F46}-\u{10F50}\u{10F82}-\u{10F85}\u{11000}-\u{1104D}\u{11052}-\u{11075}\u{1107F}-\u{110C2}\u{110CD}\u{110D0}-\u{110E8}\u{110F0}-\u{110F9}\u{11100}-\u{11134}\u{11136}-\u{11147}\u{11150}-\u{11176}\u{11180}-\u{111DF}\u{111E1}-\u{111F4}\u{11200}-\u{11211}\u{11213}-\u{11241}\u{11280}-\u{11286}\u{11288}\u{1128A}-\u{1128D}\u{1128F}-\u{1129D}\u{1129F}-\u{112A9}\u{112B0}-\u{112EA}\u{112F0}-\u{112F9}\u{11300}-\u{11303}\u{11305}-\u{1130C}\u{1130F}\u{11310}\u{11313}-\u{11328}\u{1132A}-\u{11330}\u{11332}\u{11333}\u{11335}-\u{11339}\u{1133B}-\u{11344}\u{11347}\u{11348}\u{1134B}-\u{1134D}\u{11350}\u{11357}\u{1135D}-\u{11363}\u{11366}-\u{1136C}\u{11370}-\u{11374}\u{11380}-\u{11389}\u{1138B}\u{1138E}\u{11390}-\u{113B5}\u{113B7}-\u{113C0}\u{113C2}\u{113C5}\u{113C7}-\u{113CA}\u{113CC}-\u{113D5}\u{113D7}\u{113D8}\u{113E1}\u{113E2}\u{11400}-\u{1145B}\u{1145D}-\u{11461}\u{11480}-\u{114C7}\u{114D0}-\u{114D9}\u{11580}-\u{115B5}\u{115B8}-\u{115DD}\u{11600}-\u{11644}\u{11650}-\u{11659}\u{11660}-\u{1166C}\u{11680}-\u{116B9}\u{116C0}-\u{116C9}\u{116D0}-\u{116E3}\u{11700}-\u{1171A}\u{1171D}-\u{1172B}\u{11730}-\u{11746}\u{11800}-\u{1183B}\u{118A0}-\u{118F2}\u{118FF}-\u{11906}\u{11909}\u{1190C}-\u{11913}\u{11915}\u{11916}\u{11918}-\u{11935}\u{11937}\u{11938}\u{1193B}-\u{11946}\u{11950}-\u{11959}\u{119A0}-\u{119A7}\u{119AA}-\u{119D7}\u{119DA}-\u{119E4}\u{11A00}-\u{11A47}\u{11A50}-\u{11AA2}\u{11AB0}-\u{11AF8}\u{11B00}-\u{11B09}\u{11B60}-\u{11B67}\u{11BC0}-\u{11BE1}\u{11BF0}-\u{11BF9}\u{11C00}-\u{11C08}\u{11C0A}-\u{11C36}\u{11C38}-\u{11C45}\u{11C50}-\u{11C6C}\u{11C70}-\u{11C8F}\u{11C92}-\u{11CA7}\u{11CA9}-\u{11CB6}\u{11D00}-\u{11D06}\u{11D08}\u{11D09}\u{11D0B}-\u{11D36}\u{11D3A}\u{11D3C}\u{11D3D}\u{11D3F}-\u{11D47}\u{11D50}-\u{11D59}\u{11D60}-\u{11D65}\u{11D67}\u{11D68}\u{11D6A}-\u{11D8E}\u{11D90}\u{11D91}\u{11D93}-\u{11D98}\u{11DA0}-\u{11DA9}\u{11DB0}-\u{11DDB}\u{11DE0}-\u{11DE9}\u{11EE0}-\u{11EF8}\u{11F00}-\u{11F10}\u{11F12}-\u{11F3A}\u{11F3E}-\u{11F5A}\u{11FB0}\u{11FC0}-\u{11FF1}\u{11FFF}-\u{12399}\u{12400}-\u{1246E}\u{12470}-\u{12474}\u{12480}-\u{12543}\u{12F90}-\u{12FF2}\u{13000}-\u{13455}\u{13460}-\u{143FA}\u{14400}-\u{14646}\u{16100}-\u{16139}\u{16800}-\u{16A38}\u{16A40}-\u{16A5E}\u{16A60}-\u{16A69}\u{16A6E}-\u{16ABE}\u{16AC0}-\u{16AC9}\u{16AD0}-\u{16AED}\u{16AF0}-\u{16AF5}\u{16B00}-\u{16B45}\u{16B50}-\u{16B59}\u{16B5B}-\u{16B61}\u{16B63}-\u{16B77}\u{16B7D}-\u{16B8F}\u{16D40}-\u{16D79}\u{16E40}-\u{16E9A}\u{16EA0}-\u{16EB8}\u{16EBB}-\u{16ED3}\u{16F00}-\u{16F4A}\u{16F4F}-\u{16F87}\u{16F8F}-\u{16F9F}\u{16FE0}-\u{16FE4}\u{16FF0}-\u{16FF6}\u{17000}-\u{18CD5}\u{18CFF}-\u{18D1E}\u{18D80}-\u{18DF2}\u{1AFF0}-\u{1AFF3}\u{1AFF5}-\u{1AFFB}\u{1AFFD}\u{1AFFE}\u{1B000}-\u{1B122}\u{1B132}\u{1B150}-\u{1B152}\u{1B155}\u{1B164}-\u{1B167}\u{1B170}-\u{1B2FB}\u{1BC00}-\u{1BC6A}\u{1BC70}-\u{1BC7C}\u{1BC80}-\u{1BC88}\u{1BC90}-\u{1BC99}\u{1BC9C}-\u{1BCA3}\u{1CC00}-\u{1CCFC}\u{1CD00}-\u{1CEB3}\u{1CEBA}-\u{1CED0}\u{1CEE0}-\u{1CEF0}\u{1CF00}-\u{1CF2D}\u{1CF30}-\u{1CF46}\u{1CF50}-\u{1CFC3}\u{1D000}-\u{1D0F5}\u{1D100}-\u{1D126}\u{1D129}-\u{1D1EA}\u{1D200}-\u{1D245}\u{1D2C0}-\u{1D2D3}\u{1D2E0}-\u{1D2F3}\u{1D300}-\u{1D356}\u{1D360}-\u{1D378}\u{1D400}-\u{1D454}\u{1D456}-\u{1D49C}\u{1D49E}\u{1D49F}\u{1D4A2}\u{1D4A5}\u{1D4A6}\u{1D4A9}-\u{1D4AC}\u{1D4AE}-\u{1D4B9}\u{1D4BB}\u{1D4BD}-\u{1D4C3}\u{1D4C5}-\u{1D505}\u{1D507}-\u{1D50A}\u{1D50D}-\u{1D514}\u{1D516}-\u{1D51C}\u{1D51E}-\u{1D539}\u{1D53B}-\u{1D53E}\u{1D540}-\u{1D544}\u{1D546}\u{1D54A}-\u{1D550}\u{1D552}-\u{1D6A5}\u{1D6A8}-\u{1D7CB}\u{1D7CE}-\u{1DA8B}\u{1DA9B}-\u{1DA9F}\u{1DAA1}-\u{1DAAF}\u{1DF00}-\u{1DF1E}\u{1DF25}-\u{1DF2A}\u{1E000}-\u{1E006}\u{1E008}-\u{1E018}\u{1E01B}-\u{1E021}\u{1E023}\u{1E024}\u{1E026}-\u{1E02A}\u{1E030}-\u{1E06D}\u{1E08F}\u{1E100}-\u{1E12C}\u{1E130}-\u{1E13D}\u{1E140}-\u{1E149}\u{1E14E}\u{1E14F}\u{1E290}-\u{1E2AE}\u{1E2C0}-\u{1E2F9}\u{1E2FF}\u{1E4D0}-\u{1E4F9}\u{1E5D0}-\u{1E5FA}\u{1E5FF}\u{1E6C0}-\u{1E6DE}\u{1E6E0}-\u{1E6F5}\u{1E6FE}\u{1E6FF}\u{1E7E0}-\u{1E7E6}\u{1E7E8}-\u{1E7EB}\u{1E7ED}\u{1E7EE}\u{1E7F0}-\u{1E7FE}\u{1E8D0}-\u{1E8D6}\u{1E944}-\u{1E94A}\u{1EEF0}\u{1EEF1}\u{1F000}-\u{1F02B}\u{1F030}-\u{1F093}\u{1F0A0}-\u{1F0AE}\u{1F0B1}-\u{1F0BF}\u{1F0C1}-\u{1F0CF}\u{1F0D1}-\u{1F0F5}\u{1F100}-\u{1F1AD}\u{1F1E6}-\u{1F202}\u{1F210}-\u{1F23B}\u{1F240}-\u{1F248}\u{1F250}\u{1F251}\u{1F260}-\u{1F265}\u{1F300}-\u{1F6D8}\u{1F6DC}-\u{1F6EC}\u{1F6F0}-\u{1F6FC}\u{1F700}-\u{1F7D9}\u{1F7E0}-\u{1F7EB}\u{1F7F0}\u{1F800}-\u{1F80B}\u{1F810}-\u{1F847}\u{1F850}-\u{1F859}\u{1F860}-\u{1F887}\u{1F890}-\u{1F8AD}\u{1F8B0}-\u{1F8BB}\u{1F8C0}\u{1F8C1}\u{1F8D0}-\u{1F8D8}\u{1F900}-\u{1FA57}\u{1FA60}-\u{1FA6D}\u{1FA70}-\u{1FA7C}\u{1FA80}-\u{1FA8A}\u{1FA8E}-\u{1FAC6}\u{1FAC8}\u{1FACD}-\u{1FADC}\u{1FADF}-\u{1FAEA}\u{1FAEF}-\u{1FAF8}\u{1FB00}-\u{1FB92}\u{1FB94}-\u{1FBFA}\u{20000}-\u{2A6DF}\u{2A700}-\u{2B81D}\u{2B820}-\u{2CEAD}\u{2CEB0}-\u{2EBE0}\u{2EBF0}-\u{2EE5D}\u{2F800}-\u{2FA1D}\u{30000}-\u{3134A}\u{31350}-\u{33479}\u{E0001}\u{E0020}-\u{E007F}\u{E0100}-\u{E01EF}\u{F0000}-\u{FFFFD}\u{100000}-\u{10FFFD}]*$/u,ble=/[0-9A-Za-z\xAA\xB2\xB3\xB5\xB9\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02B8\u02BB-\u02C1\u02D0\u02D1\u02E0-\u02E4\u02EE\u0370-\u0373\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0482\u048A-\u052F\u0531-\u0556\u0559-\u0589\u06F0-\u06F9\u0903-\u0939\u093B\u093D-\u0940\u0949-\u094C\u094E-\u0950\u0958-\u0961\u0964-\u0980\u0982\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD-\u09C0\u09C7\u09C8\u09CB\u09CC\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E1\u09E6-\u09F1\u09F4-\u09FA\u09FC\u09FD\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3E-\u0A40\u0A59-\u0A5C\u0A5E\u0A66-\u0A6F\u0A72-\u0A74\u0A76\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD-\u0AC0\u0AC9\u0ACB\u0ACC\u0AD0\u0AE0\u0AE1\u0AE6-\u0AF0\u0AF9\u0B02\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B3E\u0B40\u0B47\u0B48\u0B4B\u0B4C\u0B57\u0B5C\u0B5D\u0B5F-\u0B61\u0B66-\u0B77\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE\u0BBF\u0BC1\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCC\u0BD0\u0BD7\u0BE6-\u0BF2\u0C01-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C41-\u0C44\u0C58-\u0C5A\u0C5C\u0C5D\u0C60\u0C61\u0C66-\u0C6F\u0C77\u0C7F\u0C80\u0C82-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD-\u0CC4\u0CC6-\u0CC8\u0CCA\u0CCB\u0CD5\u0CD6\u0CDC-\u0CDE\u0CE0\u0CE1\u0CE6-\u0CEF\u0CF1-\u0CF3\u0D02-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D40\u0D46-\u0D48\u0D4A-\u0D4C\u0D4E\u0D4F\u0D54-\u0D61\u0D66-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCF-\u0DD1\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2-\u0DF4\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E4F-\u0E5B\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00-\u0F17\u0F1A-\u0F34\u0F36\u0F38\u0F3E-\u0F47\u0F49-\u0F6C\u0F7F\u0F85\u0F88-\u0F8C\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE-\u0FDA\u1000-\u102C\u1031\u1038\u103B\u103C\u103F-\u1057\u105A-\u105D\u1061-\u1070\u1075-\u1081\u1083\u1084\u1087-\u108C\u108E-\u109C\u109E-\u10C5\u10C7\u10CD\u10D0-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1360-\u137C\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u167F\u1681-\u169A\u16A0-\u16F8\u1700-\u1711\u1715\u171F-\u1731\u1734-\u1736\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17B6\u17BE-\u17C5\u17C7\u17C8\u17D4-\u17DA\u17DC\u17E0-\u17E9\u1810-\u1819\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1923-\u1926\u1929-\u192B\u1930\u1931\u1933-\u1938\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A16\u1A19\u1A1A\u1A1E-\u1A55\u1A57\u1A61\u1A63\u1A64\u1A6D-\u1A72\u1A80-\u1A89\u1A90-\u1A99\u1AA0-\u1AAD\u1B04-\u1B33\u1B35\u1B3B\u1B3D-\u1B41\u1B43-\u1B4C\u1B4E-\u1B6A\u1B74-\u1B7F\u1B82-\u1BA1\u1BA6\u1BA7\u1BAA\u1BAE-\u1BE5\u1BE7\u1BEA-\u1BEC\u1BEE\u1BF2\u1BF3\u1BFC-\u1C2B\u1C34\u1C35\u1C3B-\u1C49\u1C4D-\u1C8A\u1C90-\u1CBA\u1CBD-\u1CC7\u1CD3\u1CE1\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5-\u1CF7\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200E\u2070\u2071\u2074-\u2079\u207F-\u2089\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u214F\u2160-\u2188\u2336-\u237A\u2395\u2488-\u24E9\u26AC\u2800-\u28FF\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D70\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u302E\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u3190-\u31BF\u31F0-\u321C\u3220-\u324F\u3260-\u327B\u327F-\u32B0\u32C0-\u32CB\u32D0-\u3376\u337B-\u33DD\u33E0-\u33FE\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA60C\uA610-\uA62B\uA640-\uA66E\uA680-\uA69D\uA6A0-\uA6EF\uA6F2-\uA6F7\uA722-\uA787\uA789-\uA7DC\uA7F1-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA824\uA827\uA830-\uA837\uA840-\uA873\uA880-\uA8C3\uA8CE-\uA8D9\uA8F2-\uA8FE\uA900-\uA925\uA92E-\uA946\uA952\uA953\uA95F-\uA97C\uA983-\uA9B2\uA9B4\uA9B5\uA9BA\uA9BB\uA9BE-\uA9CD\uA9CF-\uA9D9\uA9DE-\uA9E4\uA9E6-\uA9FE\uAA00-\uAA28\uAA2F\uAA30\uAA33\uAA34\uAA40-\uAA42\uAA44-\uAA4B\uAA4D\uAA50-\uAA59\uAA5C-\uAA7B\uAA7D-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAAEB\uAAEE-\uAAF5\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB69\uAB70-\uABE4\uABE6\uABE7\uABE9-\uABEC\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uD800-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFF10-\uFF19\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC\u{10000}-\u{1000B}\u{1000D}-\u{10026}\u{10028}-\u{1003A}\u{1003C}\u{1003D}\u{1003F}-\u{1004D}\u{10050}-\u{1005D}\u{10080}-\u{100FA}\u{10100}\u{10102}\u{10107}-\u{10133}\u{10137}-\u{1013F}\u{1018D}\u{1018E}\u{101D0}-\u{101FC}\u{10280}-\u{1029C}\u{102A0}-\u{102D0}\u{102E1}-\u{102FB}\u{10300}-\u{10323}\u{1032D}-\u{1034A}\u{10350}-\u{10375}\u{10380}-\u{1039D}\u{1039F}-\u{103C3}\u{103C8}-\u{103D5}\u{10400}-\u{1049D}\u{104A0}-\u{104A9}\u{104B0}-\u{104D3}\u{104D8}-\u{104FB}\u{10500}-\u{10527}\u{10530}-\u{10563}\u{1056F}-\u{1057A}\u{1057C}-\u{1058A}\u{1058C}-\u{10592}\u{10594}\u{10595}\u{10597}-\u{105A1}\u{105A3}-\u{105B1}\u{105B3}-\u{105B9}\u{105BB}\u{105BC}\u{105C0}-\u{105F3}\u{10600}-\u{10736}\u{10740}-\u{10755}\u{10760}-\u{10767}\u{10780}-\u{10785}\u{10787}-\u{107B0}\u{107B2}-\u{107BA}\u{11000}\u{11002}-\u{11037}\u{11047}-\u{1104D}\u{11066}-\u{1106F}\u{11071}\u{11072}\u{11075}\u{11082}-\u{110B2}\u{110B7}\u{110B8}\u{110BB}-\u{110C1}\u{110CD}\u{110D0}-\u{110E8}\u{110F0}-\u{110F9}\u{11103}-\u{11126}\u{1112C}\u{11136}-\u{11147}\u{11150}-\u{11172}\u{11174}-\u{11176}\u{11182}-\u{111B5}\u{111BF}-\u{111C8}\u{111CD}\u{111CE}\u{111D0}-\u{111DF}\u{111E1}-\u{111F4}\u{11200}-\u{11211}\u{11213}-\u{1122E}\u{11232}\u{11233}\u{11235}\u{11238}-\u{1123D}\u{1123F}\u{11240}\u{11280}-\u{11286}\u{11288}\u{1128A}-\u{1128D}\u{1128F}-\u{1129D}\u{1129F}-\u{112A9}\u{112B0}-\u{112DE}\u{112E0}-\u{112E2}\u{112F0}-\u{112F9}\u{11302}\u{11303}\u{11305}-\u{1130C}\u{1130F}\u{11310}\u{11313}-\u{11328}\u{1132A}-\u{11330}\u{11332}\u{11333}\u{11335}-\u{11339}\u{1133D}-\u{1133F}\u{11341}-\u{11344}\u{11347}\u{11348}\u{1134B}-\u{1134D}\u{11350}\u{11357}\u{1135D}-\u{11363}\u{11380}-\u{11389}\u{1138B}\u{1138E}\u{11390}-\u{113B5}\u{113B7}-\u{113BA}\u{113C2}\u{113C5}\u{113C7}-\u{113CA}\u{113CC}\u{113CD}\u{113CF}\u{113D1}\u{113D3}-\u{113D5}\u{113D7}\u{113D8}\u{11400}-\u{11437}\u{11440}\u{11441}\u{11445}\u{11447}-\u{1145B}\u{1145D}\u{1145F}-\u{11461}\u{11480}-\u{114B2}\u{114B9}\u{114BB}-\u{114BE}\u{114C1}\u{114C4}-\u{114C7}\u{114D0}-\u{114D9}\u{11580}-\u{115B1}\u{115B8}-\u{115BB}\u{115BE}\u{115C1}-\u{115DB}\u{11600}-\u{11632}\u{1163B}\u{1163C}\u{1163E}\u{11641}-\u{11644}\u{11650}-\u{11659}\u{11680}-\u{116AA}\u{116AC}\u{116AE}\u{116AF}\u{116B6}\u{116B8}\u{116B9}\u{116C0}-\u{116C9}\u{116D0}-\u{116E3}\u{11700}-\u{1171A}\u{1171E}\u{11720}\u{11721}\u{11726}\u{11730}-\u{11746}\u{11800}-\u{1182E}\u{11838}\u{1183B}\u{118A0}-\u{118F2}\u{118FF}-\u{11906}\u{11909}\u{1190C}-\u{11913}\u{11915}\u{11916}\u{11918}-\u{11935}\u{11937}\u{11938}\u{1193D}\u{1193F}-\u{11942}\u{11944}-\u{11946}\u{11950}-\u{11959}\u{119A0}-\u{119A7}\u{119AA}-\u{119D3}\u{119DC}-\u{119DF}\u{119E1}-\u{119E4}\u{11A00}\u{11A07}\u{11A08}\u{11A0B}-\u{11A32}\u{11A39}\u{11A3A}\u{11A3F}-\u{11A46}\u{11A50}\u{11A57}\u{11A58}\u{11A5C}-\u{11A89}\u{11A97}\u{11A9A}-\u{11AA2}\u{11AB0}-\u{11AF8}\u{11B00}-\u{11B09}\u{11B61}\u{11B65}\u{11B67}\u{11BC0}-\u{11BE1}\u{11BF0}-\u{11BF9}\u{11C00}-\u{11C08}\u{11C0A}-\u{11C2F}\u{11C3E}-\u{11C45}\u{11C50}-\u{11C6C}\u{11C70}-\u{11C8F}\u{11CA9}\u{11CB1}\u{11CB4}\u{11D00}-\u{11D06}\u{11D08}\u{11D09}\u{11D0B}-\u{11D30}\u{11D46}\u{11D50}-\u{11D59}\u{11D60}-\u{11D65}\u{11D67}\u{11D68}\u{11D6A}-\u{11D8E}\u{11D93}\u{11D94}\u{11D96}\u{11D98}\u{11DA0}-\u{11DA9}\u{11DB0}-\u{11DDB}\u{11DE0}-\u{11DE9}\u{11EE0}-\u{11EF2}\u{11EF5}-\u{11EF8}\u{11F02}-\u{11F10}\u{11F12}-\u{11F35}\u{11F3E}\u{11F3F}\u{11F41}\u{11F43}-\u{11F59}\u{11FB0}\u{11FC0}-\u{11FD4}\u{11FFF}-\u{12399}\u{12400}-\u{1246E}\u{12470}-\u{12474}\u{12480}-\u{12543}\u{12F90}-\u{12FF2}\u{13000}-\u{1343F}\u{13441}-\u{13446}\u{13460}-\u{143FA}\u{14400}-\u{14646}\u{16100}-\u{1611D}\u{1612A}-\u{1612C}\u{16130}-\u{16139}\u{16800}-\u{16A38}\u{16A40}-\u{16A5E}\u{16A60}-\u{16A69}\u{16A6E}-\u{16ABE}\u{16AC0}-\u{16AC9}\u{16AD0}-\u{16AED}\u{16AF5}\u{16B00}-\u{16B2F}\u{16B37}-\u{16B45}\u{16B50}-\u{16B59}\u{16B5B}-\u{16B61}\u{16B63}-\u{16B77}\u{16B7D}-\u{16B8F}\u{16D40}-\u{16D79}\u{16E40}-\u{16E9A}\u{16EA0}-\u{16EB8}\u{16EBB}-\u{16ED3}\u{16F00}-\u{16F4A}\u{16F50}-\u{16F87}\u{16F93}-\u{16F9F}\u{16FE0}\u{16FE1}\u{16FE3}\u{16FF0}-\u{16FF6}\u{17000}-\u{18CD5}\u{18CFF}-\u{18D1E}\u{18D80}-\u{18DF2}\u{1AFF0}-\u{1AFF3}\u{1AFF5}-\u{1AFFB}\u{1AFFD}\u{1AFFE}\u{1B000}-\u{1B122}\u{1B132}\u{1B150}-\u{1B152}\u{1B155}\u{1B164}-\u{1B167}\u{1B170}-\u{1B2FB}\u{1BC00}-\u{1BC6A}\u{1BC70}-\u{1BC7C}\u{1BC80}-\u{1BC88}\u{1BC90}-\u{1BC99}\u{1BC9C}\u{1BC9F}\u{1CCD6}-\u{1CCF9}\u{1CF50}-\u{1CFC3}\u{1D000}-\u{1D0F5}\u{1D100}-\u{1D126}\u{1D129}-\u{1D166}\u{1D16A}-\u{1D172}\u{1D183}\u{1D184}\u{1D18C}-\u{1D1A9}\u{1D1AE}-\u{1D1E8}\u{1D2C0}-\u{1D2D3}\u{1D2E0}-\u{1D2F3}\u{1D360}-\u{1D378}\u{1D400}-\u{1D454}\u{1D456}-\u{1D49C}\u{1D49E}\u{1D49F}\u{1D4A2}\u{1D4A5}\u{1D4A6}\u{1D4A9}-\u{1D4AC}\u{1D4AE}-\u{1D4B9}\u{1D4BB}\u{1D4BD}-\u{1D4C3}\u{1D4C5}-\u{1D505}\u{1D507}-\u{1D50A}\u{1D50D}-\u{1D514}\u{1D516}-\u{1D51C}\u{1D51E}-\u{1D539}\u{1D53B}-\u{1D53E}\u{1D540}-\u{1D544}\u{1D546}\u{1D54A}-\u{1D550}\u{1D552}-\u{1D6A5}\u{1D6A8}-\u{1D6C0}\u{1D6C2}-\u{1D6DA}\u{1D6DC}-\u{1D6FA}\u{1D6FC}-\u{1D714}\u{1D716}-\u{1D734}\u{1D736}-\u{1D74E}\u{1D750}-\u{1D76E}\u{1D770}-\u{1D788}\u{1D78A}-\u{1D7A8}\u{1D7AA}-\u{1D7C2}\u{1D7C4}-\u{1D7CB}\u{1D7CE}-\u{1D9FF}\u{1DA37}-\u{1DA3A}\u{1DA6D}-\u{1DA74}\u{1DA76}-\u{1DA83}\u{1DA85}-\u{1DA8B}\u{1DF00}-\u{1DF1E}\u{1DF25}-\u{1DF2A}\u{1E030}-\u{1E06D}\u{1E100}-\u{1E12C}\u{1E137}-\u{1E13D}\u{1E140}-\u{1E149}\u{1E14E}\u{1E14F}\u{1E290}-\u{1E2AD}\u{1E2C0}-\u{1E2EB}\u{1E2F0}-\u{1E2F9}\u{1E4D0}-\u{1E4EB}\u{1E4F0}-\u{1E4F9}\u{1E5D0}-\u{1E5ED}\u{1E5F0}-\u{1E5FA}\u{1E5FF}\u{1E6C0}-\u{1E6DE}\u{1E6E0}-\u{1E6E2}\u{1E6E4}\u{1E6E5}\u{1E6E7}-\u{1E6ED}\u{1E6F0}-\u{1E6F4}\u{1E6FE}\u{1E6FF}\u{1E7E0}-\u{1E7E6}\u{1E7E8}-\u{1E7EB}\u{1E7ED}\u{1E7EE}\u{1E7F0}-\u{1E7FE}\u{1F100}-\u{1F10A}\u{1F110}-\u{1F12E}\u{1F130}-\u{1F169}\u{1F170}-\u{1F1AC}\u{1F1E6}-\u{1F202}\u{1F210}-\u{1F23B}\u{1F240}-\u{1F248}\u{1F250}\u{1F251}\u{1FBF0}-\u{1FBF9}\u{20000}-\u{2A6DF}\u{2A700}-\u{2B81D}\u{2B820}-\u{2CEAD}\u{2CEB0}-\u{2EBE0}\u{2EBF0}-\u{2EE5D}\u{2F800}-\u{2FA1D}\u{30000}-\u{3134A}\u{31350}-\u{33479}\u{F0000}-\u{FFFFD}\u{100000}-\u{10FFFD}][\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0897-\u089F\u08CA-\u08E1\u08E3-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962\u0963\u0981\u09BC\u09C1-\u09C4\u09CD\u09E2\u09E3\u09FE\u0A01\u0A02\u0A3C\u0A41\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7\u0AC8\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01\u0B3C\u0B3F\u0B41-\u0B44\u0B4D\u0B55\u0B56\u0B62\u0B63\u0B82\u0BC0\u0BCD\u0C00\u0C04\u0C3C\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81\u0CBC\u0CCC\u0CCD\u0CE2\u0CE3\u0D00\u0D01\u0D3B\u0D3C\u0D41-\u0D44\u0D4D\u0D62\u0D63\u0D81\u0DCA\u0DD2-\u0DD4\u0DD6\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0F18\u0F19\u0F35\u0F37\u0F39\u0F71-\u0F7E\u0F80-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032-\u1037\u1039\u103A\u103D\u103E\u1058\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085\u1086\u108D\u109D\u135D-\u135F\u1712-\u1714\u1732\u1733\u1752\u1753\u1772\u1773\u17B4\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D3\u17DD\u180B-\u180D\u180F\u1885\u1886\u18A9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193B\u1A17\u1A18\u1A1B\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1AB0-\u1ADD\u1AE0-\u1AEB\u1B00-\u1B03\u1B34\u1B36-\u1B3A\u1B3C\u1B42\u1B6B-\u1B73\u1B80\u1B81\u1BA2-\u1BA5\u1BA8\u1BA9\u1BAB-\u1BAD\u1BE6\u1BE8\u1BE9\u1BED\u1BEF-\u1BF1\u1C2C-\u1C33\u1C36\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302D\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA825\uA826\uA82C\uA8C4\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA951\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uA9BD\uA9E5\uAA29-\uAA2E\uAA31\uAA32\uAA35\uAA36\uAA43\uAA4C\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEC\uAAED\uAAF6\uABE5\uABE8\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\u{101FD}\u{102E0}\u{10376}-\u{1037A}\u{10A01}-\u{10A03}\u{10A05}\u{10A06}\u{10A0C}-\u{10A0F}\u{10A38}-\u{10A3A}\u{10A3F}\u{10AE5}\u{10AE6}\u{10D24}-\u{10D27}\u{10D69}-\u{10D6D}\u{10EAB}\u{10EAC}\u{10EFA}-\u{10EFF}\u{10F46}-\u{10F50}\u{10F82}-\u{10F85}\u{11001}\u{11038}-\u{11046}\u{11070}\u{11073}\u{11074}\u{1107F}-\u{11081}\u{110B3}-\u{110B6}\u{110B9}\u{110BA}\u{110C2}\u{11100}-\u{11102}\u{11127}-\u{1112B}\u{1112D}-\u{11134}\u{11173}\u{11180}\u{11181}\u{111B6}-\u{111BE}\u{111C9}-\u{111CC}\u{111CF}\u{1122F}-\u{11231}\u{11234}\u{11236}\u{11237}\u{1123E}\u{11241}\u{112DF}\u{112E3}-\u{112EA}\u{11300}\u{11301}\u{1133B}\u{1133C}\u{11340}\u{11366}-\u{1136C}\u{11370}-\u{11374}\u{113BB}-\u{113C0}\u{113CE}\u{113D0}\u{113D2}\u{113E1}\u{113E2}\u{11438}-\u{1143F}\u{11442}-\u{11444}\u{11446}\u{1145E}\u{114B3}-\u{114B8}\u{114BA}\u{114BF}\u{114C0}\u{114C2}\u{114C3}\u{115B2}-\u{115B5}\u{115BC}\u{115BD}\u{115BF}\u{115C0}\u{115DC}\u{115DD}\u{11633}-\u{1163A}\u{1163D}\u{1163F}\u{11640}\u{116AB}\u{116AD}\u{116B0}-\u{116B5}\u{116B7}\u{1171D}\u{1171F}\u{11722}-\u{11725}\u{11727}-\u{1172B}\u{1182F}-\u{11837}\u{11839}\u{1183A}\u{1193B}\u{1193C}\u{1193E}\u{11943}\u{119D4}-\u{119D7}\u{119DA}\u{119DB}\u{119E0}\u{11A01}-\u{11A06}\u{11A09}\u{11A0A}\u{11A33}-\u{11A38}\u{11A3B}-\u{11A3E}\u{11A47}\u{11A51}-\u{11A56}\u{11A59}-\u{11A5B}\u{11A8A}-\u{11A96}\u{11A98}\u{11A99}\u{11B60}\u{11B62}-\u{11B64}\u{11B66}\u{11C30}-\u{11C36}\u{11C38}-\u{11C3D}\u{11C92}-\u{11CA7}\u{11CAA}-\u{11CB0}\u{11CB2}\u{11CB3}\u{11CB5}\u{11CB6}\u{11D31}-\u{11D36}\u{11D3A}\u{11D3C}\u{11D3D}\u{11D3F}-\u{11D45}\u{11D47}\u{11D90}\u{11D91}\u{11D95}\u{11D97}\u{11EF3}\u{11EF4}\u{11F00}\u{11F01}\u{11F36}-\u{11F3A}\u{11F40}\u{11F42}\u{11F5A}\u{13440}\u{13447}-\u{13455}\u{1611E}-\u{16129}\u{1612D}-\u{1612F}\u{16AF0}-\u{16AF4}\u{16B30}-\u{16B36}\u{16F4F}\u{16F8F}-\u{16F92}\u{16FE4}\u{1BC9D}\u{1BC9E}\u{1CF00}-\u{1CF2D}\u{1CF30}-\u{1CF46}\u{1D167}-\u{1D169}\u{1D17B}-\u{1D182}\u{1D185}-\u{1D18B}\u{1D1AA}-\u{1D1AD}\u{1D242}-\u{1D244}\u{1DA00}-\u{1DA36}\u{1DA3B}-\u{1DA6C}\u{1DA75}\u{1DA84}\u{1DA9B}-\u{1DA9F}\u{1DAA1}-\u{1DAAF}\u{1E000}-\u{1E006}\u{1E008}-\u{1E018}\u{1E01B}-\u{1E021}\u{1E023}\u{1E024}\u{1E026}-\u{1E02A}\u{1E08F}\u{1E130}-\u{1E136}\u{1E2AE}\u{1E2EC}-\u{1E2EF}\u{1E4EC}-\u{1E4EF}\u{1E5EE}\u{1E5EF}\u{1E6E3}\u{1E6E6}\u{1E6EE}\u{1E6EF}\u{1E6F5}\u{1E8D0}-\u{1E8D6}\u{1E944}-\u{1E94A}\u{E0100}-\u{E01EF}]*$/u;iP.exports={combiningMarks:ple,combiningClassVirama:mle,validZWNJ:yle,bidiDomain:gle,bidiS1LTR:Ele,bidiS1RTL:_le,bidiS2:Ale,bidiS3:wle,bidiS4EN:Ole,bidiS4AN:Sle,bidiS5:Cle,bidiS6:ble}});var uP=g(function(h8e,Dle){Dle.exports=[[[0,44],2],[[45,46],2],[47,2],[[48,57],2],[[58,64],2],[65,1,"a"],[66,1,"b"],[67,1,"c"],[68,1,"d"],[69,1,"e"],[70,1,"f"],[71,1,"g"],[72,1,"h"],[73,1,"i"],[74,1,"j"],[75,1,"k"],[76,1,"l"],[77,1,"m"],[78,1,"n"],[79,1,"o"],[80,1,"p"],[81,1,"q"],[82,1,"r"],[83,1,"s"],[84,1,"t"],[85,1,"u"],[86,1,"v"],[87,1,"w"],[88,1,"x"],[89,1,"y"],[90,1,"z"],[[91,96],2],[[97,122],2],[[123,127],2],[[128,159],3],[160,1," "],[[161,167],2],[168,1," \u0308"],[169,2],[170,1,"a"],[[171,172],2],[173,7],[174,2],[175,1," \u0304"],[[176,177],2],[178,1,"2"],[179,1,"3"],[180,1," \u0301"],[181,1,"\u03BC"],[182,2],[183,2],[184,1," \u0327"],[185,1,"1"],[186,1,"o"],[187,2],[188,1,"1\u20444"],[189,1,"1\u20442"],[190,1,"3\u20444"],[191,2],[192,1,"\xE0"],[193,1,"\xE1"],[194,1,"\xE2"],[195,1,"\xE3"],[196,1,"\xE4"],[197,1,"\xE5"],[198,1,"\xE6"],[199,1,"\xE7"],[200,1,"\xE8"],[201,1,"\xE9"],[202,1,"\xEA"],[203,1,"\xEB"],[204,1,"\xEC"],[205,1,"\xED"],[206,1,"\xEE"],[207,1,"\xEF"],[208,1,"\xF0"],[209,1,"\xF1"],[210,1,"\xF2"],[211,1,"\xF3"],[212,1,"\xF4"],[213,1,"\xF5"],[214,1,"\xF6"],[215,2],[216,1,"\xF8"],[217,1,"\xF9"],[218,1,"\xFA"],[219,1,"\xFB"],[220,1,"\xFC"],[221,1,"\xFD"],[222,1,"\xFE"],[223,6,"ss"],[[224,246],2],[247,2],[[248,255],2],[256,1,"\u0101"],[257,2],[258,1,"\u0103"],[259,2],[260,1,"\u0105"],[261,2],[262,1,"\u0107"],[263,2],[264,1,"\u0109"],[265,2],[266,1,"\u010B"],[267,2],[268,1,"\u010D"],[269,2],[270,1,"\u010F"],[271,2],[272,1,"\u0111"],[273,2],[274,1,"\u0113"],[275,2],[276,1,"\u0115"],[277,2],[278,1,"\u0117"],[279,2],[280,1,"\u0119"],[281,2],[282,1,"\u011B"],[283,2],[284,1,"\u011D"],[285,2],[286,1,"\u011F"],[287,2],[288,1,"\u0121"],[289,2],[290,1,"\u0123"],[291,2],[292,1,"\u0125"],[293,2],[294,1,"\u0127"],[295,2],[296,1,"\u0129"],[297,2],[298,1,"\u012B"],[299,2],[300,1,"\u012D"],[301,2],[302,1,"\u012F"],[303,2],[304,1,"i\u0307"],[305,2],[[306,307],1,"ij"],[308,1,"\u0135"],[309,2],[310,1,"\u0137"],[[311,312],2],[313,1,"\u013A"],[314,2],[315,1,"\u013C"],[316,2],[317,1,"\u013E"],[318,2],[[319,320],1,"l\xB7"],[321,1,"\u0142"],[322,2],[323,1,"\u0144"],[324,2],[325,1,"\u0146"],[326,2],[327,1,"\u0148"],[328,2],[329,1,"\u02BCn"],[330,1,"\u014B"],[331,2],[332,1,"\u014D"],[333,2],[334,1,"\u014F"],[335,2],[336,1,"\u0151"],[337,2],[338,1,"\u0153"],[339,2],[340,1,"\u0155"],[341,2],[342,1,"\u0157"],[343,2],[344,1,"\u0159"],[345,2],[346,1,"\u015B"],[347,2],[348,1,"\u015D"],[349,2],[350,1,"\u015F"],[351,2],[352,1,"\u0161"],[353,2],[354,1,"\u0163"],[355,2],[356,1,"\u0165"],[357,2],[358,1,"\u0167"],[359,2],[360,1,"\u0169"],[361,2],[362,1,"\u016B"],[363,2],[364,1,"\u016D"],[365,2],[366,1,"\u016F"],[367,2],[368,1,"\u0171"],[369,2],[370,1,"\u0173"],[371,2],[372,1,"\u0175"],[373,2],[374,1,"\u0177"],[375,2],[376,1,"\xFF"],[377,1,"\u017A"],[378,2],[379,1,"\u017C"],[380,2],[381,1,"\u017E"],[382,2],[383,1,"s"],[384,2],[385,1,"\u0253"],[386,1,"\u0183"],[387,2],[388,1,"\u0185"],[389,2],[390,1,"\u0254"],[391,1,"\u0188"],[392,2],[393,1,"\u0256"],[394,1,"\u0257"],[395,1,"\u018C"],[[396,397],2],[398,1,"\u01DD"],[399,1,"\u0259"],[400,1,"\u025B"],[401,1,"\u0192"],[402,2],[403,1,"\u0260"],[404,1,"\u0263"],[405,2],[406,1,"\u0269"],[407,1,"\u0268"],[408,1,"\u0199"],[[409,411],2],[412,1,"\u026F"],[413,1,"\u0272"],[414,2],[415,1,"\u0275"],[416,1,"\u01A1"],[417,2],[418,1,"\u01A3"],[419,2],[420,1,"\u01A5"],[421,2],[422,1,"\u0280"],[423,1,"\u01A8"],[424,2],[425,1,"\u0283"],[[426,427],2],[428,1,"\u01AD"],[429,2],[430,1,"\u0288"],[431,1,"\u01B0"],[432,2],[433,1,"\u028A"],[434,1,"\u028B"],[435,1,"\u01B4"],[436,2],[437,1,"\u01B6"],[438,2],[439,1,"\u0292"],[440,1,"\u01B9"],[[441,443],2],[444,1,"\u01BD"],[[445,451],2],[[452,454],1,"d\u017E"],[[455,457],1,"lj"],[[458,460],1,"nj"],[461,1,"\u01CE"],[462,2],[463,1,"\u01D0"],[464,2],[465,1,"\u01D2"],[466,2],[467,1,"\u01D4"],[468,2],[469,1,"\u01D6"],[470,2],[471,1,"\u01D8"],[472,2],[473,1,"\u01DA"],[474,2],[475,1,"\u01DC"],[[476,477],2],[478,1,"\u01DF"],[479,2],[480,1,"\u01E1"],[481,2],[482,1,"\u01E3"],[483,2],[484,1,"\u01E5"],[485,2],[486,1,"\u01E7"],[487,2],[488,1,"\u01E9"],[489,2],[490,1,"\u01EB"],[491,2],[492,1,"\u01ED"],[493,2],[494,1,"\u01EF"],[[495,496],2],[[497,499],1,"dz"],[500,1,"\u01F5"],[501,2],[502,1,"\u0195"],[503,1,"\u01BF"],[504,1,"\u01F9"],[505,2],[506,1,"\u01FB"],[507,2],[508,1,"\u01FD"],[509,2],[510,1,"\u01FF"],[511,2],[512,1,"\u0201"],[513,2],[514,1,"\u0203"],[515,2],[516,1,"\u0205"],[517,2],[518,1,"\u0207"],[519,2],[520,1,"\u0209"],[521,2],[522,1,"\u020B"],[523,2],[524,1,"\u020D"],[525,2],[526,1,"\u020F"],[527,2],[528,1,"\u0211"],[529,2],[530,1,"\u0213"],[531,2],[532,1,"\u0215"],[533,2],[534,1,"\u0217"],[535,2],[536,1,"\u0219"],[537,2],[538,1,"\u021B"],[539,2],[540,1,"\u021D"],[541,2],[542,1,"\u021F"],[543,2],[544,1,"\u019E"],[545,2],[546,1,"\u0223"],[547,2],[548,1,"\u0225"],[549,2],[550,1,"\u0227"],[551,2],[552,1,"\u0229"],[553,2],[554,1,"\u022B"],[555,2],[556,1,"\u022D"],[557,2],[558,1,"\u022F"],[559,2],[560,1,"\u0231"],[561,2],[562,1,"\u0233"],[563,2],[[564,566],2],[[567,569],2],[570,1,"\u2C65"],[571,1,"\u023C"],[572,2],[573,1,"\u019A"],[574,1,"\u2C66"],[[575,576],2],[577,1,"\u0242"],[578,2],[579,1,"\u0180"],[580,1,"\u0289"],[581,1,"\u028C"],[582,1,"\u0247"],[583,2],[584,1,"\u0249"],[585,2],[586,1,"\u024B"],[587,2],[588,1,"\u024D"],[589,2],[590,1,"\u024F"],[591,2],[[592,680],2],[[681,685],2],[[686,687],2],[688,1,"h"],[689,1,"\u0266"],[690,1,"j"],[691,1,"r"],[692,1,"\u0279"],[693,1,"\u027B"],[694,1,"\u0281"],[695,1,"w"],[696,1,"y"],[[697,705],2],[[706,709],2],[[710,721],2],[[722,727],2],[728,1," \u0306"],[729,1," \u0307"],[730,1," \u030A"],[731,1," \u0328"],[732,1," \u0303"],[733,1," \u030B"],[734,2],[735,2],[736,1,"\u0263"],[737,1,"l"],[738,1,"s"],[739,1,"x"],[740,1,"\u0295"],[[741,745],2],[[746,747],2],[748,2],[749,2],[750,2],[[751,767],2],[[768,831],2],[832,1,"\u0300"],[833,1,"\u0301"],[834,2],[835,1,"\u0313"],[836,1,"\u0308\u0301"],[837,1,"\u03B9"],[[838,846],2],[847,7],[[848,855],2],[[856,860],2],[[861,863],2],[[864,865],2],[866,2],[[867,879],2],[880,1,"\u0371"],[881,2],[882,1,"\u0373"],[883,2],[884,1,"\u02B9"],[885,2],[886,1,"\u0377"],[887,2],[[888,889],3],[890,1," \u03B9"],[[891,893],2],[894,1,";"],[895,1,"\u03F3"],[[896,899],3],[900,1," \u0301"],[901,1," \u0308\u0301"],[902,1,"\u03AC"],[903,1,"\xB7"],[904,1,"\u03AD"],[905,1,"\u03AE"],[906,1,"\u03AF"],[907,3],[908,1,"\u03CC"],[909,3],[910,1,"\u03CD"],[911,1,"\u03CE"],[912,2],[913,1,"\u03B1"],[914,1,"\u03B2"],[915,1,"\u03B3"],[916,1,"\u03B4"],[917,1,"\u03B5"],[918,1,"\u03B6"],[919,1,"\u03B7"],[920,1,"\u03B8"],[921,1,"\u03B9"],[922,1,"\u03BA"],[923,1,"\u03BB"],[924,1,"\u03BC"],[925,1,"\u03BD"],[926,1,"\u03BE"],[927,1,"\u03BF"],[928,1,"\u03C0"],[929,1,"\u03C1"],[930,3],[931,1,"\u03C3"],[932,1,"\u03C4"],[933,1,"\u03C5"],[934,1,"\u03C6"],[935,1,"\u03C7"],[936,1,"\u03C8"],[937,1,"\u03C9"],[938,1,"\u03CA"],[939,1,"\u03CB"],[[940,961],2],[962,6,"\u03C3"],[[963,974],2],[975,1,"\u03D7"],[976,1,"\u03B2"],[977,1,"\u03B8"],[978,1,"\u03C5"],[979,1,"\u03CD"],[980,1,"\u03CB"],[981,1,"\u03C6"],[982,1,"\u03C0"],[983,2],[984,1,"\u03D9"],[985,2],[986,1,"\u03DB"],[987,2],[988,1,"\u03DD"],[989,2],[990,1,"\u03DF"],[991,2],[992,1,"\u03E1"],[993,2],[994,1,"\u03E3"],[995,2],[996,1,"\u03E5"],[997,2],[998,1,"\u03E7"],[999,2],[1000,1,"\u03E9"],[1001,2],[1002,1,"\u03EB"],[1003,2],[1004,1,"\u03ED"],[1005,2],[1006,1,"\u03EF"],[1007,2],[1008,1,"\u03BA"],[1009,1,"\u03C1"],[1010,1,"\u03C3"],[1011,2],[1012,1,"\u03B8"],[1013,1,"\u03B5"],[1014,2],[1015,1,"\u03F8"],[1016,2],[1017,1,"\u03C3"],[1018,1,"\u03FB"],[1019,2],[1020,2],[1021,1,"\u037B"],[1022,1,"\u037C"],[1023,1,"\u037D"],[1024,1,"\u0450"],[1025,1,"\u0451"],[1026,1,"\u0452"],[1027,1,"\u0453"],[1028,1,"\u0454"],[1029,1,"\u0455"],[1030,1,"\u0456"],[1031,1,"\u0457"],[1032,1,"\u0458"],[1033,1,"\u0459"],[1034,1,"\u045A"],[1035,1,"\u045B"],[1036,1,"\u045C"],[1037,1,"\u045D"],[1038,1,"\u045E"],[1039,1,"\u045F"],[1040,1,"\u0430"],[1041,1,"\u0431"],[1042,1,"\u0432"],[1043,1,"\u0433"],[1044,1,"\u0434"],[1045,1,"\u0435"],[1046,1,"\u0436"],[1047,1,"\u0437"],[1048,1,"\u0438"],[1049,1,"\u0439"],[1050,1,"\u043A"],[1051,1,"\u043B"],[1052,1,"\u043C"],[1053,1,"\u043D"],[1054,1,"\u043E"],[1055,1,"\u043F"],[1056,1,"\u0440"],[1057,1,"\u0441"],[1058,1,"\u0442"],[1059,1,"\u0443"],[1060,1,"\u0444"],[1061,1,"\u0445"],[1062,1,"\u0446"],[1063,1,"\u0447"],[1064,1,"\u0448"],[1065,1,"\u0449"],[1066,1,"\u044A"],[1067,1,"\u044B"],[1068,1,"\u044C"],[1069,1,"\u044D"],[1070,1,"\u044E"],[1071,1,"\u044F"],[[1072,1103],2],[1104,2],[[1105,1116],2],[1117,2],[[1118,1119],2],[1120,1,"\u0461"],[1121,2],[1122,1,"\u0463"],[1123,2],[1124,1,"\u0465"],[1125,2],[1126,1,"\u0467"],[1127,2],[1128,1,"\u0469"],[1129,2],[1130,1,"\u046B"],[1131,2],[1132,1,"\u046D"],[1133,2],[1134,1,"\u046F"],[1135,2],[1136,1,"\u0471"],[1137,2],[1138,1,"\u0473"],[1139,2],[1140,1,"\u0475"],[1141,2],[1142,1,"\u0477"],[1143,2],[1144,1,"\u0479"],[1145,2],[1146,1,"\u047B"],[1147,2],[1148,1,"\u047D"],[1149,2],[1150,1,"\u047F"],[1151,2],[1152,1,"\u0481"],[1153,2],[1154,2],[[1155,1158],2],[1159,2],[[1160,1161],2],[1162,1,"\u048B"],[1163,2],[1164,1,"\u048D"],[1165,2],[1166,1,"\u048F"],[1167,2],[1168,1,"\u0491"],[1169,2],[1170,1,"\u0493"],[1171,2],[1172,1,"\u0495"],[1173,2],[1174,1,"\u0497"],[1175,2],[1176,1,"\u0499"],[1177,2],[1178,1,"\u049B"],[1179,2],[1180,1,"\u049D"],[1181,2],[1182,1,"\u049F"],[1183,2],[1184,1,"\u04A1"],[1185,2],[1186,1,"\u04A3"],[1187,2],[1188,1,"\u04A5"],[1189,2],[1190,1,"\u04A7"],[1191,2],[1192,1,"\u04A9"],[1193,2],[1194,1,"\u04AB"],[1195,2],[1196,1,"\u04AD"],[1197,2],[1198,1,"\u04AF"],[1199,2],[1200,1,"\u04B1"],[1201,2],[1202,1,"\u04B3"],[1203,2],[1204,1,"\u04B5"],[1205,2],[1206,1,"\u04B7"],[1207,2],[1208,1,"\u04B9"],[1209,2],[1210,1,"\u04BB"],[1211,2],[1212,1,"\u04BD"],[1213,2],[1214,1,"\u04BF"],[1215,2],[1216,1,"\u04CF"],[1217,1,"\u04C2"],[1218,2],[1219,1,"\u04C4"],[1220,2],[1221,1,"\u04C6"],[1222,2],[1223,1,"\u04C8"],[1224,2],[1225,1,"\u04CA"],[1226,2],[1227,1,"\u04CC"],[1228,2],[1229,1,"\u04CE"],[1230,2],[1231,2],[1232,1,"\u04D1"],[1233,2],[1234,1,"\u04D3"],[1235,2],[1236,1,"\u04D5"],[1237,2],[1238,1,"\u04D7"],[1239,2],[1240,1,"\u04D9"],[1241,2],[1242,1,"\u04DB"],[1243,2],[1244,1,"\u04DD"],[1245,2],[1246,1,"\u04DF"],[1247,2],[1248,1,"\u04E1"],[1249,2],[1250,1,"\u04E3"],[1251,2],[1252,1,"\u04E5"],[1253,2],[1254,1,"\u04E7"],[1255,2],[1256,1,"\u04E9"],[1257,2],[1258,1,"\u04EB"],[1259,2],[1260,1,"\u04ED"],[1261,2],[1262,1,"\u04EF"],[1263,2],[1264,1,"\u04F1"],[1265,2],[1266,1,"\u04F3"],[1267,2],[1268,1,"\u04F5"],[1269,2],[1270,1,"\u04F7"],[1271,2],[1272,1,"\u04F9"],[1273,2],[1274,1,"\u04FB"],[1275,2],[1276,1,"\u04FD"],[1277,2],[1278,1,"\u04FF"],[1279,2],[1280,1,"\u0501"],[1281,2],[1282,1,"\u0503"],[1283,2],[1284,1,"\u0505"],[1285,2],[1286,1,"\u0507"],[1287,2],[1288,1,"\u0509"],[1289,2],[1290,1,"\u050B"],[1291,2],[1292,1,"\u050D"],[1293,2],[1294,1,"\u050F"],[1295,2],[1296,1,"\u0511"],[1297,2],[1298,1,"\u0513"],[1299,2],[1300,1,"\u0515"],[1301,2],[1302,1,"\u0517"],[1303,2],[1304,1,"\u0519"],[1305,2],[1306,1,"\u051B"],[1307,2],[1308,1,"\u051D"],[1309,2],[1310,1,"\u051F"],[1311,2],[1312,1,"\u0521"],[1313,2],[1314,1,"\u0523"],[1315,2],[1316,1,"\u0525"],[1317,2],[1318,1,"\u0527"],[1319,2],[1320,1,"\u0529"],[1321,2],[1322,1,"\u052B"],[1323,2],[1324,1,"\u052D"],[1325,2],[1326,1,"\u052F"],[1327,2],[1328,3],[1329,1,"\u0561"],[1330,1,"\u0562"],[1331,1,"\u0563"],[1332,1,"\u0564"],[1333,1,"\u0565"],[1334,1,"\u0566"],[1335,1,"\u0567"],[1336,1,"\u0568"],[1337,1,"\u0569"],[1338,1,"\u056A"],[1339,1,"\u056B"],[1340,1,"\u056C"],[1341,1,"\u056D"],[1342,1,"\u056E"],[1343,1,"\u056F"],[1344,1,"\u0570"],[1345,1,"\u0571"],[1346,1,"\u0572"],[1347,1,"\u0573"],[1348,1,"\u0574"],[1349,1,"\u0575"],[1350,1,"\u0576"],[1351,1,"\u0577"],[1352,1,"\u0578"],[1353,1,"\u0579"],[1354,1,"\u057A"],[1355,1,"\u057B"],[1356,1,"\u057C"],[1357,1,"\u057D"],[1358,1,"\u057E"],[1359,1,"\u057F"],[1360,1,"\u0580"],[1361,1,"\u0581"],[1362,1,"\u0582"],[1363,1,"\u0583"],[1364,1,"\u0584"],[1365,1,"\u0585"],[1366,1,"\u0586"],[[1367,1368],3],[1369,2],[[1370,1375],2],[1376,2],[[1377,1414],2],[1415,1,"\u0565\u0582"],[1416,2],[1417,2],[1418,2],[[1419,1420],3],[[1421,1422],2],[1423,2],[1424,3],[[1425,1441],2],[1442,2],[[1443,1455],2],[[1456,1465],2],[1466,2],[[1467,1469],2],[1470,2],[1471,2],[1472,2],[[1473,1474],2],[1475,2],[1476,2],[1477,2],[1478,2],[1479,2],[[1480,1487],3],[[1488,1514],2],[[1515,1518],3],[1519,2],[[1520,1524],2],[[1525,1535],3],[[1536,1539],3],[1540,3],[1541,3],[[1542,1546],2],[1547,2],[1548,2],[[1549,1551],2],[[1552,1557],2],[[1558,1562],2],[1563,2],[1564,3],[1565,2],[1566,2],[1567,2],[1568,2],[[1569,1594],2],[[1595,1599],2],[1600,2],[[1601,1618],2],[[1619,1621],2],[[1622,1624],2],[[1625,1630],2],[1631,2],[[1632,1641],2],[[1642,1645],2],[[1646,1647],2],[[1648,1652],2],[1653,1,"\u0627\u0674"],[1654,1,"\u0648\u0674"],[1655,1,"\u06C7\u0674"],[1656,1,"\u064A\u0674"],[[1657,1719],2],[[1720,1721],2],[[1722,1726],2],[1727,2],[[1728,1742],2],[1743,2],[[1744,1747],2],[1748,2],[[1749,1756],2],[1757,3],[1758,2],[[1759,1768],2],[1769,2],[[1770,1773],2],[[1774,1775],2],[[1776,1785],2],[[1786,1790],2],[1791,2],[[1792,1805],2],[1806,3],[1807,3],[[1808,1836],2],[[1837,1839],2],[[1840,1866],2],[[1867,1868],3],[[1869,1871],2],[[1872,1901],2],[[1902,1919],2],[[1920,1968],2],[1969,2],[[1970,1983],3],[[1984,2037],2],[[2038,2042],2],[[2043,2044],3],[2045,2],[[2046,2047],2],[[2048,2093],2],[[2094,2095],3],[[2096,2110],2],[2111,3],[[2112,2139],2],[[2140,2141],3],[2142,2],[2143,3],[[2144,2154],2],[[2155,2159],3],[[2160,2183],2],[2184,2],[[2185,2190],2],[2191,2],[[2192,2193],3],[[2194,2198],3],[2199,2],[[2200,2207],2],[2208,2],[2209,2],[[2210,2220],2],[[2221,2226],2],[[2227,2228],2],[2229,2],[[2230,2237],2],[[2238,2247],2],[[2248,2258],2],[2259,2],[[2260,2273],2],[2274,3],[2275,2],[[2276,2302],2],[2303,2],[2304,2],[[2305,2307],2],[2308,2],[[2309,2361],2],[[2362,2363],2],[[2364,2381],2],[2382,2],[2383,2],[[2384,2388],2],[2389,2],[[2390,2391],2],[2392,1,"\u0915\u093C"],[2393,1,"\u0916\u093C"],[2394,1,"\u0917\u093C"],[2395,1,"\u091C\u093C"],[2396,1,"\u0921\u093C"],[2397,1,"\u0922\u093C"],[2398,1,"\u092B\u093C"],[2399,1,"\u092F\u093C"],[[2400,2403],2],[[2404,2405],2],[[2406,2415],2],[2416,2],[[2417,2418],2],[[2419,2423],2],[2424,2],[[2425,2426],2],[[2427,2428],2],[2429,2],[[2430,2431],2],[2432,2],[[2433,2435],2],[2436,3],[[2437,2444],2],[[2445,2446],3],[[2447,2448],2],[[2449,2450],3],[[2451,2472],2],[2473,3],[[2474,2480],2],[2481,3],[2482,2],[[2483,2485],3],[[2486,2489],2],[[2490,2491],3],[2492,2],[2493,2],[[2494,2500],2],[[2501,2502],3],[[2503,2504],2],[[2505,2506],3],[[2507,2509],2],[2510,2],[[2511,2518],3],[2519,2],[[2520,2523],3],[2524,1,"\u09A1\u09BC"],[2525,1,"\u09A2\u09BC"],[2526,3],[2527,1,"\u09AF\u09BC"],[[2528,2531],2],[[2532,2533],3],[[2534,2545],2],[[2546,2554],2],[2555,2],[2556,2],[2557,2],[2558,2],[[2559,2560],3],[2561,2],[2562,2],[2563,2],[2564,3],[[2565,2570],2],[[2571,2574],3],[[2575,2576],2],[[2577,2578],3],[[2579,2600],2],[2601,3],[[2602,2608],2],[2609,3],[2610,2],[2611,1,"\u0A32\u0A3C"],[2612,3],[2613,2],[2614,1,"\u0A38\u0A3C"],[2615,3],[[2616,2617],2],[[2618,2619],3],[2620,2],[2621,3],[[2622,2626],2],[[2627,2630],3],[[2631,2632],2],[[2633,2634],3],[[2635,2637],2],[[2638,2640],3],[2641,2],[[2642,2648],3],[2649,1,"\u0A16\u0A3C"],[2650,1,"\u0A17\u0A3C"],[2651,1,"\u0A1C\u0A3C"],[2652,2],[2653,3],[2654,1,"\u0A2B\u0A3C"],[[2655,2661],3],[[2662,2676],2],[2677,2],[2678,2],[[2679,2688],3],[[2689,2691],2],[2692,3],[[2693,2699],2],[2700,2],[2701,2],[2702,3],[[2703,2705],2],[2706,3],[[2707,2728],2],[2729,3],[[2730,2736],2],[2737,3],[[2738,2739],2],[2740,3],[[2741,2745],2],[[2746,2747],3],[[2748,2757],2],[2758,3],[[2759,2761],2],[2762,3],[[2763,2765],2],[[2766,2767],3],[2768,2],[[2769,2783],3],[2784,2],[[2785,2787],2],[[2788,2789],3],[[2790,2799],2],[2800,2],[2801,2],[[2802,2808],3],[2809,2],[[2810,2815],2],[2816,3],[[2817,2819],2],[2820,3],[[2821,2828],2],[[2829,2830],3],[[2831,2832],2],[[2833,2834],3],[[2835,2856],2],[2857,3],[[2858,2864],2],[2865,3],[[2866,2867],2],[2868,3],[2869,2],[[2870,2873],2],[[2874,2875],3],[[2876,2883],2],[2884,2],[[2885,2886],3],[[2887,2888],2],[[2889,2890],3],[[2891,2893],2],[[2894,2900],3],[2901,2],[[2902,2903],2],[[2904,2907],3],[2908,1,"\u0B21\u0B3C"],[2909,1,"\u0B22\u0B3C"],[2910,3],[[2911,2913],2],[[2914,2915],2],[[2916,2917],3],[[2918,2927],2],[2928,2],[2929,2],[[2930,2935],2],[[2936,2945],3],[[2946,2947],2],[2948,3],[[2949,2954],2],[[2955,2957],3],[[2958,2960],2],[2961,3],[[2962,2965],2],[[2966,2968],3],[[2969,2970],2],[2971,3],[2972,2],[2973,3],[[2974,2975],2],[[2976,2978],3],[[2979,2980],2],[[2981,2983],3],[[2984,2986],2],[[2987,2989],3],[[2990,2997],2],[2998,2],[[2999,3001],2],[[3002,3005],3],[[3006,3010],2],[[3011,3013],3],[[3014,3016],2],[3017,3],[[3018,3021],2],[[3022,3023],3],[3024,2],[[3025,3030],3],[3031,2],[[3032,3045],3],[3046,2],[[3047,3055],2],[[3056,3058],2],[[3059,3066],2],[[3067,3071],3],[3072,2],[[3073,3075],2],[3076,2],[[3077,3084],2],[3085,3],[[3086,3088],2],[3089,3],[[3090,3112],2],[3113,3],[[3114,3123],2],[3124,2],[[3125,3129],2],[[3130,3131],3],[3132,2],[3133,2],[[3134,3140],2],[3141,3],[[3142,3144],2],[3145,3],[[3146,3149],2],[[3150,3156],3],[[3157,3158],2],[3159,3],[[3160,3161],2],[3162,2],[3163,3],[3164,2],[3165,2],[[3166,3167],3],[[3168,3169],2],[[3170,3171],2],[[3172,3173],3],[[3174,3183],2],[[3184,3190],3],[3191,2],[[3192,3199],2],[3200,2],[3201,2],[[3202,3203],2],[3204,2],[[3205,3212],2],[3213,3],[[3214,3216],2],[3217,3],[[3218,3240],2],[3241,3],[[3242,3251],2],[3252,3],[[3253,3257],2],[[3258,3259],3],[[3260,3261],2],[[3262,3268],2],[3269,3],[[3270,3272],2],[3273,3],[[3274,3277],2],[[3278,3284],3],[[3285,3286],2],[[3287,3291],3],[3292,2],[3293,2],[3294,2],[3295,3],[[3296,3297],2],[[3298,3299],2],[[3300,3301],3],[[3302,3311],2],[3312,3],[[3313,3314],2],[3315,2],[[3316,3327],3],[3328,2],[3329,2],[[3330,3331],2],[3332,2],[[3333,3340],2],[3341,3],[[3342,3344],2],[3345,3],[[3346,3368],2],[3369,2],[[3370,3385],2],[3386,2],[[3387,3388],2],[3389,2],[[3390,3395],2],[3396,2],[3397,3],[[3398,3400],2],[3401,3],[[3402,3405],2],[3406,2],[3407,2],[[3408,3411],3],[[3412,3414],2],[3415,2],[[3416,3422],2],[3423,2],[[3424,3425],2],[[3426,3427],2],[[3428,3429],3],[[3430,3439],2],[[3440,3445],2],[[3446,3448],2],[3449,2],[[3450,3455],2],[3456,3],[3457,2],[[3458,3459],2],[3460,3],[[3461,3478],2],[[3479,3481],3],[[3482,3505],2],[3506,3],[[3507,3515],2],[3516,3],[3517,2],[[3518,3519],3],[[3520,3526],2],[[3527,3529],3],[3530,2],[[3531,3534],3],[[3535,3540],2],[3541,3],[3542,2],[3543,3],[[3544,3551],2],[[3552,3557],3],[[3558,3567],2],[[3568,3569],3],[[3570,3571],2],[3572,2],[[3573,3584],3],[[3585,3634],2],[3635,1,"\u0E4D\u0E32"],[[3636,3642],2],[[3643,3646],3],[3647,2],[[3648,3662],2],[3663,2],[[3664,3673],2],[[3674,3675],2],[[3676,3712],3],[[3713,3714],2],[3715,3],[3716,2],[3717,3],[3718,2],[[3719,3720],2],[3721,2],[3722,2],[3723,3],[3724,2],[3725,2],[[3726,3731],2],[[3732,3735],2],[3736,2],[[3737,3743],2],[3744,2],[[3745,3747],2],[3748,3],[3749,2],[3750,3],[3751,2],[[3752,3753],2],[[3754,3755],2],[3756,2],[[3757,3762],2],[3763,1,"\u0ECD\u0EB2"],[[3764,3769],2],[3770,2],[[3771,3773],2],[[3774,3775],3],[[3776,3780],2],[3781,3],[3782,2],[3783,3],[[3784,3789],2],[3790,2],[3791,3],[[3792,3801],2],[[3802,3803],3],[3804,1,"\u0EAB\u0E99"],[3805,1,"\u0EAB\u0EA1"],[[3806,3807],2],[[3808,3839],3],[3840,2],[[3841,3850],2],[3851,2],[3852,1,"\u0F0B"],[[3853,3863],2],[[3864,3865],2],[[3866,3871],2],[[3872,3881],2],[[3882,3892],2],[3893,2],[3894,2],[3895,2],[3896,2],[3897,2],[[3898,3901],2],[[3902,3906],2],[3907,1,"\u0F42\u0FB7"],[[3908,3911],2],[3912,3],[[3913,3916],2],[3917,1,"\u0F4C\u0FB7"],[[3918,3921],2],[3922,1,"\u0F51\u0FB7"],[[3923,3926],2],[3927,1,"\u0F56\u0FB7"],[[3928,3931],2],[3932,1,"\u0F5B\u0FB7"],[[3933,3944],2],[3945,1,"\u0F40\u0FB5"],[3946,2],[[3947,3948],2],[[3949,3952],3],[[3953,3954],2],[3955,1,"\u0F71\u0F72"],[3956,2],[3957,1,"\u0F71\u0F74"],[3958,1,"\u0FB2\u0F80"],[3959,1,"\u0FB2\u0F71\u0F80"],[3960,1,"\u0FB3\u0F80"],[3961,1,"\u0FB3\u0F71\u0F80"],[[3962,3968],2],[3969,1,"\u0F71\u0F80"],[[3970,3972],2],[3973,2],[[3974,3979],2],[[3980,3983],2],[[3984,3986],2],[3987,1,"\u0F92\u0FB7"],[[3988,3989],2],[3990,2],[3991,2],[3992,3],[[3993,3996],2],[3997,1,"\u0F9C\u0FB7"],[[3998,4001],2],[4002,1,"\u0FA1\u0FB7"],[[4003,4006],2],[4007,1,"\u0FA6\u0FB7"],[[4008,4011],2],[4012,1,"\u0FAB\u0FB7"],[4013,2],[[4014,4016],2],[[4017,4023],2],[4024,2],[4025,1,"\u0F90\u0FB5"],[[4026,4028],2],[4029,3],[[4030,4037],2],[4038,2],[[4039,4044],2],[4045,3],[4046,2],[4047,2],[[4048,4049],2],[[4050,4052],2],[[4053,4056],2],[[4057,4058],2],[[4059,4095],3],[[4096,4129],2],[4130,2],[[4131,4135],2],[4136,2],[[4137,4138],2],[4139,2],[[4140,4146],2],[[4147,4149],2],[[4150,4153],2],[[4154,4159],2],[[4160,4169],2],[[4170,4175],2],[[4176,4185],2],[[4186,4249],2],[[4250,4253],2],[[4254,4255],2],[4256,1,"\u2D00"],[4257,1,"\u2D01"],[4258,1,"\u2D02"],[4259,1,"\u2D03"],[4260,1,"\u2D04"],[4261,1,"\u2D05"],[4262,1,"\u2D06"],[4263,1,"\u2D07"],[4264,1,"\u2D08"],[4265,1,"\u2D09"],[4266,1,"\u2D0A"],[4267,1,"\u2D0B"],[4268,1,"\u2D0C"],[4269,1,"\u2D0D"],[4270,1,"\u2D0E"],[4271,1,"\u2D0F"],[4272,1,"\u2D10"],[4273,1,"\u2D11"],[4274,1,"\u2D12"],[4275,1,"\u2D13"],[4276,1,"\u2D14"],[4277,1,"\u2D15"],[4278,1,"\u2D16"],[4279,1,"\u2D17"],[4280,1,"\u2D18"],[4281,1,"\u2D19"],[4282,1,"\u2D1A"],[4283,1,"\u2D1B"],[4284,1,"\u2D1C"],[4285,1,"\u2D1D"],[4286,1,"\u2D1E"],[4287,1,"\u2D1F"],[4288,1,"\u2D20"],[4289,1,"\u2D21"],[4290,1,"\u2D22"],[4291,1,"\u2D23"],[4292,1,"\u2D24"],[4293,1,"\u2D25"],[4294,3],[4295,1,"\u2D27"],[[4296,4300],3],[4301,1,"\u2D2D"],[[4302,4303],3],[[4304,4342],2],[[4343,4344],2],[[4345,4346],2],[4347,2],[4348,1,"\u10DC"],[[4349,4351],2],[[4352,4441],2],[[4442,4446],2],[[4447,4448],7],[[4449,4514],2],[[4515,4519],2],[[4520,4601],2],[[4602,4607],2],[[4608,4614],2],[4615,2],[[4616,4678],2],[4679,2],[4680,2],[4681,3],[[4682,4685],2],[[4686,4687],3],[[4688,4694],2],[4695,3],[4696,2],[4697,3],[[4698,4701],2],[[4702,4703],3],[[4704,4742],2],[4743,2],[4744,2],[4745,3],[[4746,4749],2],[[4750,4751],3],[[4752,4782],2],[4783,2],[4784,2],[4785,3],[[4786,4789],2],[[4790,4791],3],[[4792,4798],2],[4799,3],[4800,2],[4801,3],[[4802,4805],2],[[4806,4807],3],[[4808,4814],2],[4815,2],[[4816,4822],2],[4823,3],[[4824,4846],2],[4847,2],[[4848,4878],2],[4879,2],[4880,2],[4881,3],[[4882,4885],2],[[4886,4887],3],[[4888,4894],2],[4895,2],[[4896,4934],2],[4935,2],[[4936,4954],2],[[4955,4956],3],[[4957,4958],2],[4959,2],[4960,2],[[4961,4988],2],[[4989,4991],3],[[4992,5007],2],[[5008,5017],2],[[5018,5023],3],[[5024,5108],2],[5109,2],[[5110,5111],3],[5112,1,"\u13F0"],[5113,1,"\u13F1"],[5114,1,"\u13F2"],[5115,1,"\u13F3"],[5116,1,"\u13F4"],[5117,1,"\u13F5"],[[5118,5119],3],[5120,2],[[5121,5740],2],[[5741,5742],2],[[5743,5750],2],[[5751,5759],2],[5760,3],[[5761,5786],2],[[5787,5788],2],[[5789,5791],3],[[5792,5866],2],[[5867,5872],2],[[5873,5880],2],[[5881,5887],3],[[5888,5900],2],[5901,2],[[5902,5908],2],[5909,2],[[5910,5918],3],[5919,2],[[5920,5940],2],[[5941,5942],2],[[5943,5951],3],[[5952,5971],2],[[5972,5983],3],[[5984,5996],2],[5997,3],[[5998,6000],2],[6001,3],[[6002,6003],2],[[6004,6015],3],[[6016,6067],2],[[6068,6069],7],[[6070,6099],2],[[6100,6102],2],[6103,2],[[6104,6107],2],[6108,2],[6109,2],[[6110,6111],3],[[6112,6121],2],[[6122,6127],3],[[6128,6137],2],[[6138,6143],3],[[6144,6154],2],[[6155,6158],7],[6159,7],[[6160,6169],2],[[6170,6175],3],[[6176,6263],2],[6264,2],[[6265,6271],3],[[6272,6313],2],[6314,2],[[6315,6319],3],[[6320,6389],2],[[6390,6399],3],[[6400,6428],2],[[6429,6430],2],[6431,3],[[6432,6443],2],[[6444,6447],3],[[6448,6459],2],[[6460,6463],3],[6464,2],[[6465,6467],3],[[6468,6469],2],[[6470,6509],2],[[6510,6511],3],[[6512,6516],2],[[6517,6527],3],[[6528,6569],2],[[6570,6571],2],[[6572,6575],3],[[6576,6601],2],[[6602,6607],3],[[6608,6617],2],[6618,2],[[6619,6621],3],[[6622,6623],2],[[6624,6655],2],[[6656,6683],2],[[6684,6685],3],[[6686,6687],2],[[6688,6750],2],[6751,3],[[6752,6780],2],[[6781,6782],3],[[6783,6793],2],[[6794,6799],3],[[6800,6809],2],[[6810,6815],3],[[6816,6822],2],[6823,2],[[6824,6829],2],[[6830,6831],3],[[6832,6845],2],[6846,2],[[6847,6848],2],[[6849,6862],2],[[6863,6877],2],[[6878,6879],3],[[6880,6891],2],[[6892,6911],3],[[6912,6987],2],[6988,2],[6989,3],[[6990,6991],2],[[6992,7001],2],[[7002,7018],2],[[7019,7027],2],[[7028,7036],2],[[7037,7038],2],[7039,2],[[7040,7082],2],[[7083,7085],2],[[7086,7097],2],[[7098,7103],2],[[7104,7155],2],[[7156,7163],3],[[7164,7167],2],[[7168,7223],2],[[7224,7226],3],[[7227,7231],2],[[7232,7241],2],[[7242,7244],3],[[7245,7293],2],[[7294,7295],2],[7296,1,"\u0432"],[7297,1,"\u0434"],[7298,1,"\u043E"],[7299,1,"\u0441"],[[7300,7301],1,"\u0442"],[7302,1,"\u044A"],[7303,1,"\u0463"],[7304,1,"\uA64B"],[7305,1,"\u1C8A"],[7306,2],[[7307,7311],3],[7312,1,"\u10D0"],[7313,1,"\u10D1"],[7314,1,"\u10D2"],[7315,1,"\u10D3"],[7316,1,"\u10D4"],[7317,1,"\u10D5"],[7318,1,"\u10D6"],[7319,1,"\u10D7"],[7320,1,"\u10D8"],[7321,1,"\u10D9"],[7322,1,"\u10DA"],[7323,1,"\u10DB"],[7324,1,"\u10DC"],[7325,1,"\u10DD"],[7326,1,"\u10DE"],[7327,1,"\u10DF"],[7328,1,"\u10E0"],[7329,1,"\u10E1"],[7330,1,"\u10E2"],[7331,1,"\u10E3"],[7332,1,"\u10E4"],[7333,1,"\u10E5"],[7334,1,"\u10E6"],[7335,1,"\u10E7"],[7336,1,"\u10E8"],[7337,1,"\u10E9"],[7338,1,"\u10EA"],[7339,1,"\u10EB"],[7340,1,"\u10EC"],[7341,1,"\u10ED"],[7342,1,"\u10EE"],[7343,1,"\u10EF"],[7344,1,"\u10F0"],[7345,1,"\u10F1"],[7346,1,"\u10F2"],[7347,1,"\u10F3"],[7348,1,"\u10F4"],[7349,1,"\u10F5"],[7350,1,"\u10F6"],[7351,1,"\u10F7"],[7352,1,"\u10F8"],[7353,1,"\u10F9"],[7354,1,"\u10FA"],[[7355,7356],3],[7357,1,"\u10FD"],[7358,1,"\u10FE"],[7359,1,"\u10FF"],[[7360,7367],2],[[7368,7375],3],[[7376,7378],2],[7379,2],[[7380,7410],2],[[7411,7414],2],[7415,2],[[7416,7417],2],[7418,2],[[7419,7423],3],[[7424,7467],2],[7468,1,"a"],[7469,1,"\xE6"],[7470,1,"b"],[7471,2],[7472,1,"d"],[7473,1,"e"],[7474,1,"\u01DD"],[7475,1,"g"],[7476,1,"h"],[7477,1,"i"],[7478,1,"j"],[7479,1,"k"],[7480,1,"l"],[7481,1,"m"],[7482,1,"n"],[7483,2],[7484,1,"o"],[7485,1,"\u0223"],[7486,1,"p"],[7487,1,"r"],[7488,1,"t"],[7489,1,"u"],[7490,1,"w"],[7491,1,"a"],[7492,1,"\u0250"],[7493,1,"\u0251"],[7494,1,"\u1D02"],[7495,1,"b"],[7496,1,"d"],[7497,1,"e"],[7498,1,"\u0259"],[7499,1,"\u025B"],[7500,1,"\u025C"],[7501,1,"g"],[7502,2],[7503,1,"k"],[7504,1,"m"],[7505,1,"\u014B"],[7506,1,"o"],[7507,1,"\u0254"],[7508,1,"\u1D16"],[7509,1,"\u1D17"],[7510,1,"p"],[7511,1,"t"],[7512,1,"u"],[7513,1,"\u1D1D"],[7514,1,"\u026F"],[7515,1,"v"],[7516,1,"\u1D25"],[7517,1,"\u03B2"],[7518,1,"\u03B3"],[7519,1,"\u03B4"],[7520,1,"\u03C6"],[7521,1,"\u03C7"],[7522,1,"i"],[7523,1,"r"],[7524,1,"u"],[7525,1,"v"],[7526,1,"\u03B2"],[7527,1,"\u03B3"],[7528,1,"\u03C1"],[7529,1,"\u03C6"],[7530,1,"\u03C7"],[7531,2],[[7532,7543],2],[7544,1,"\u043D"],[[7545,7578],2],[7579,1,"\u0252"],[7580,1,"c"],[7581,1,"\u0255"],[7582,1,"\xF0"],[7583,1,"\u025C"],[7584,1,"f"],[7585,1,"\u025F"],[7586,1,"\u0261"],[7587,1,"\u0265"],[7588,1,"\u0268"],[7589,1,"\u0269"],[7590,1,"\u026A"],[7591,1,"\u1D7B"],[7592,1,"\u029D"],[7593,1,"\u026D"],[7594,1,"\u1D85"],[7595,1,"\u029F"],[7596,1,"\u0271"],[7597,1,"\u0270"],[7598,1,"\u0272"],[7599,1,"\u0273"],[7600,1,"\u0274"],[7601,1,"\u0275"],[7602,1,"\u0278"],[7603,1,"\u0282"],[7604,1,"\u0283"],[7605,1,"\u01AB"],[7606,1,"\u0289"],[7607,1,"\u028A"],[7608,1,"\u1D1C"],[7609,1,"\u028B"],[7610,1,"\u028C"],[7611,1,"z"],[7612,1,"\u0290"],[7613,1,"\u0291"],[7614,1,"\u0292"],[7615,1,"\u03B8"],[[7616,7619],2],[[7620,7626],2],[[7627,7654],2],[[7655,7669],2],[[7670,7673],2],[7674,2],[7675,2],[7676,2],[7677,2],[[7678,7679],2],[7680,1,"\u1E01"],[7681,2],[7682,1,"\u1E03"],[7683,2],[7684,1,"\u1E05"],[7685,2],[7686,1,"\u1E07"],[7687,2],[7688,1,"\u1E09"],[7689,2],[7690,1,"\u1E0B"],[7691,2],[7692,1,"\u1E0D"],[7693,2],[7694,1,"\u1E0F"],[7695,2],[7696,1,"\u1E11"],[7697,2],[7698,1,"\u1E13"],[7699,2],[7700,1,"\u1E15"],[7701,2],[7702,1,"\u1E17"],[7703,2],[7704,1,"\u1E19"],[7705,2],[7706,1,"\u1E1B"],[7707,2],[7708,1,"\u1E1D"],[7709,2],[7710,1,"\u1E1F"],[7711,2],[7712,1,"\u1E21"],[7713,2],[7714,1,"\u1E23"],[7715,2],[7716,1,"\u1E25"],[7717,2],[7718,1,"\u1E27"],[7719,2],[7720,1,"\u1E29"],[7721,2],[7722,1,"\u1E2B"],[7723,2],[7724,1,"\u1E2D"],[7725,2],[7726,1,"\u1E2F"],[7727,2],[7728,1,"\u1E31"],[7729,2],[7730,1,"\u1E33"],[7731,2],[7732,1,"\u1E35"],[7733,2],[7734,1,"\u1E37"],[7735,2],[7736,1,"\u1E39"],[7737,2],[7738,1,"\u1E3B"],[7739,2],[7740,1,"\u1E3D"],[7741,2],[7742,1,"\u1E3F"],[7743,2],[7744,1,"\u1E41"],[7745,2],[7746,1,"\u1E43"],[7747,2],[7748,1,"\u1E45"],[7749,2],[7750,1,"\u1E47"],[7751,2],[7752,1,"\u1E49"],[7753,2],[7754,1,"\u1E4B"],[7755,2],[7756,1,"\u1E4D"],[7757,2],[7758,1,"\u1E4F"],[7759,2],[7760,1,"\u1E51"],[7761,2],[7762,1,"\u1E53"],[7763,2],[7764,1,"\u1E55"],[7765,2],[7766,1,"\u1E57"],[7767,2],[7768,1,"\u1E59"],[7769,2],[7770,1,"\u1E5B"],[7771,2],[7772,1,"\u1E5D"],[7773,2],[7774,1,"\u1E5F"],[7775,2],[7776,1,"\u1E61"],[7777,2],[7778,1,"\u1E63"],[7779,2],[7780,1,"\u1E65"],[7781,2],[7782,1,"\u1E67"],[7783,2],[7784,1,"\u1E69"],[7785,2],[7786,1,"\u1E6B"],[7787,2],[7788,1,"\u1E6D"],[7789,2],[7790,1,"\u1E6F"],[7791,2],[7792,1,"\u1E71"],[7793,2],[7794,1,"\u1E73"],[7795,2],[7796,1,"\u1E75"],[7797,2],[7798,1,"\u1E77"],[7799,2],[7800,1,"\u1E79"],[7801,2],[7802,1,"\u1E7B"],[7803,2],[7804,1,"\u1E7D"],[7805,2],[7806,1,"\u1E7F"],[7807,2],[7808,1,"\u1E81"],[7809,2],[7810,1,"\u1E83"],[7811,2],[7812,1,"\u1E85"],[7813,2],[7814,1,"\u1E87"],[7815,2],[7816,1,"\u1E89"],[7817,2],[7818,1,"\u1E8B"],[7819,2],[7820,1,"\u1E8D"],[7821,2],[7822,1,"\u1E8F"],[7823,2],[7824,1,"\u1E91"],[7825,2],[7826,1,"\u1E93"],[7827,2],[7828,1,"\u1E95"],[[7829,7833],2],[7834,1,"a\u02BE"],[7835,1,"\u1E61"],[[7836,7837],2],[7838,1,"\xDF"],[7839,2],[7840,1,"\u1EA1"],[7841,2],[7842,1,"\u1EA3"],[7843,2],[7844,1,"\u1EA5"],[7845,2],[7846,1,"\u1EA7"],[7847,2],[7848,1,"\u1EA9"],[7849,2],[7850,1,"\u1EAB"],[7851,2],[7852,1,"\u1EAD"],[7853,2],[7854,1,"\u1EAF"],[7855,2],[7856,1,"\u1EB1"],[7857,2],[7858,1,"\u1EB3"],[7859,2],[7860,1,"\u1EB5"],[7861,2],[7862,1,"\u1EB7"],[7863,2],[7864,1,"\u1EB9"],[7865,2],[7866,1,"\u1EBB"],[7867,2],[7868,1,"\u1EBD"],[7869,2],[7870,1,"\u1EBF"],[7871,2],[7872,1,"\u1EC1"],[7873,2],[7874,1,"\u1EC3"],[7875,2],[7876,1,"\u1EC5"],[7877,2],[7878,1,"\u1EC7"],[7879,2],[7880,1,"\u1EC9"],[7881,2],[7882,1,"\u1ECB"],[7883,2],[7884,1,"\u1ECD"],[7885,2],[7886,1,"\u1ECF"],[7887,2],[7888,1,"\u1ED1"],[7889,2],[7890,1,"\u1ED3"],[7891,2],[7892,1,"\u1ED5"],[7893,2],[7894,1,"\u1ED7"],[7895,2],[7896,1,"\u1ED9"],[7897,2],[7898,1,"\u1EDB"],[7899,2],[7900,1,"\u1EDD"],[7901,2],[7902,1,"\u1EDF"],[7903,2],[7904,1,"\u1EE1"],[7905,2],[7906,1,"\u1EE3"],[7907,2],[7908,1,"\u1EE5"],[7909,2],[7910,1,"\u1EE7"],[7911,2],[7912,1,"\u1EE9"],[7913,2],[7914,1,"\u1EEB"],[7915,2],[7916,1,"\u1EED"],[7917,2],[7918,1,"\u1EEF"],[7919,2],[7920,1,"\u1EF1"],[7921,2],[7922,1,"\u1EF3"],[7923,2],[7924,1,"\u1EF5"],[7925,2],[7926,1,"\u1EF7"],[7927,2],[7928,1,"\u1EF9"],[7929,2],[7930,1,"\u1EFB"],[7931,2],[7932,1,"\u1EFD"],[7933,2],[7934,1,"\u1EFF"],[7935,2],[[7936,7943],2],[7944,1,"\u1F00"],[7945,1,"\u1F01"],[7946,1,"\u1F02"],[7947,1,"\u1F03"],[7948,1,"\u1F04"],[7949,1,"\u1F05"],[7950,1,"\u1F06"],[7951,1,"\u1F07"],[[7952,7957],2],[[7958,7959],3],[7960,1,"\u1F10"],[7961,1,"\u1F11"],[7962,1,"\u1F12"],[7963,1,"\u1F13"],[7964,1,"\u1F14"],[7965,1,"\u1F15"],[[7966,7967],3],[[7968,7975],2],[7976,1,"\u1F20"],[7977,1,"\u1F21"],[7978,1,"\u1F22"],[7979,1,"\u1F23"],[7980,1,"\u1F24"],[7981,1,"\u1F25"],[7982,1,"\u1F26"],[7983,1,"\u1F27"],[[7984,7991],2],[7992,1,"\u1F30"],[7993,1,"\u1F31"],[7994,1,"\u1F32"],[7995,1,"\u1F33"],[7996,1,"\u1F34"],[7997,1,"\u1F35"],[7998,1,"\u1F36"],[7999,1,"\u1F37"],[[8000,8005],2],[[8006,8007],3],[8008,1,"\u1F40"],[8009,1,"\u1F41"],[8010,1,"\u1F42"],[8011,1,"\u1F43"],[8012,1,"\u1F44"],[8013,1,"\u1F45"],[[8014,8015],3],[[8016,8023],2],[8024,3],[8025,1,"\u1F51"],[8026,3],[8027,1,"\u1F53"],[8028,3],[8029,1,"\u1F55"],[8030,3],[8031,1,"\u1F57"],[[8032,8039],2],[8040,1,"\u1F60"],[8041,1,"\u1F61"],[8042,1,"\u1F62"],[8043,1,"\u1F63"],[8044,1,"\u1F64"],[8045,1,"\u1F65"],[8046,1,"\u1F66"],[8047,1,"\u1F67"],[8048,2],[8049,1,"\u03AC"],[8050,2],[8051,1,"\u03AD"],[8052,2],[8053,1,"\u03AE"],[8054,2],[8055,1,"\u03AF"],[8056,2],[8057,1,"\u03CC"],[8058,2],[8059,1,"\u03CD"],[8060,2],[8061,1,"\u03CE"],[[8062,8063],3],[8064,1,"\u1F00\u03B9"],[8065,1,"\u1F01\u03B9"],[8066,1,"\u1F02\u03B9"],[8067,1,"\u1F03\u03B9"],[8068,1,"\u1F04\u03B9"],[8069,1,"\u1F05\u03B9"],[8070,1,"\u1F06\u03B9"],[8071,1,"\u1F07\u03B9"],[8072,1,"\u1F00\u03B9"],[8073,1,"\u1F01\u03B9"],[8074,1,"\u1F02\u03B9"],[8075,1,"\u1F03\u03B9"],[8076,1,"\u1F04\u03B9"],[8077,1,"\u1F05\u03B9"],[8078,1,"\u1F06\u03B9"],[8079,1,"\u1F07\u03B9"],[8080,1,"\u1F20\u03B9"],[8081,1,"\u1F21\u03B9"],[8082,1,"\u1F22\u03B9"],[8083,1,"\u1F23\u03B9"],[8084,1,"\u1F24\u03B9"],[8085,1,"\u1F25\u03B9"],[8086,1,"\u1F26\u03B9"],[8087,1,"\u1F27\u03B9"],[8088,1,"\u1F20\u03B9"],[8089,1,"\u1F21\u03B9"],[8090,1,"\u1F22\u03B9"],[8091,1,"\u1F23\u03B9"],[8092,1,"\u1F24\u03B9"],[8093,1,"\u1F25\u03B9"],[8094,1,"\u1F26\u03B9"],[8095,1,"\u1F27\u03B9"],[8096,1,"\u1F60\u03B9"],[8097,1,"\u1F61\u03B9"],[8098,1,"\u1F62\u03B9"],[8099,1,"\u1F63\u03B9"],[8100,1,"\u1F64\u03B9"],[8101,1,"\u1F65\u03B9"],[8102,1,"\u1F66\u03B9"],[8103,1,"\u1F67\u03B9"],[8104,1,"\u1F60\u03B9"],[8105,1,"\u1F61\u03B9"],[8106,1,"\u1F62\u03B9"],[8107,1,"\u1F63\u03B9"],[8108,1,"\u1F64\u03B9"],[8109,1,"\u1F65\u03B9"],[8110,1,"\u1F66\u03B9"],[8111,1,"\u1F67\u03B9"],[[8112,8113],2],[8114,1,"\u1F70\u03B9"],[8115,1,"\u03B1\u03B9"],[8116,1,"\u03AC\u03B9"],[8117,3],[8118,2],[8119,1,"\u1FB6\u03B9"],[8120,1,"\u1FB0"],[8121,1,"\u1FB1"],[8122,1,"\u1F70"],[8123,1,"\u03AC"],[8124,1,"\u03B1\u03B9"],[8125,1," \u0313"],[8126,1,"\u03B9"],[8127,1," \u0313"],[8128,1," \u0342"],[8129,1," \u0308\u0342"],[8130,1,"\u1F74\u03B9"],[8131,1,"\u03B7\u03B9"],[8132,1,"\u03AE\u03B9"],[8133,3],[8134,2],[8135,1,"\u1FC6\u03B9"],[8136,1,"\u1F72"],[8137,1,"\u03AD"],[8138,1,"\u1F74"],[8139,1,"\u03AE"],[8140,1,"\u03B7\u03B9"],[8141,1," \u0313\u0300"],[8142,1," \u0313\u0301"],[8143,1," \u0313\u0342"],[[8144,8146],2],[8147,1,"\u0390"],[[8148,8149],3],[[8150,8151],2],[8152,1,"\u1FD0"],[8153,1,"\u1FD1"],[8154,1,"\u1F76"],[8155,1,"\u03AF"],[8156,3],[8157,1," \u0314\u0300"],[8158,1," \u0314\u0301"],[8159,1," \u0314\u0342"],[[8160,8162],2],[8163,1,"\u03B0"],[[8164,8167],2],[8168,1,"\u1FE0"],[8169,1,"\u1FE1"],[8170,1,"\u1F7A"],[8171,1,"\u03CD"],[8172,1,"\u1FE5"],[8173,1," \u0308\u0300"],[8174,1," \u0308\u0301"],[8175,1,"`"],[[8176,8177],3],[8178,1,"\u1F7C\u03B9"],[8179,1,"\u03C9\u03B9"],[8180,1,"\u03CE\u03B9"],[8181,3],[8182,2],[8183,1,"\u1FF6\u03B9"],[8184,1,"\u1F78"],[8185,1,"\u03CC"],[8186,1,"\u1F7C"],[8187,1,"\u03CE"],[8188,1,"\u03C9\u03B9"],[8189,1," \u0301"],[8190,1," \u0314"],[8191,3],[[8192,8202],1," "],[8203,7],[[8204,8205],6,""],[[8206,8207],3],[8208,2],[8209,1,"\u2010"],[[8210,8214],2],[8215,1," \u0333"],[[8216,8227],2],[[8228,8230],3],[8231,2],[[8232,8238],3],[8239,1," "],[[8240,8242],2],[8243,1,"\u2032\u2032"],[8244,1,"\u2032\u2032\u2032"],[8245,2],[8246,1,"\u2035\u2035"],[8247,1,"\u2035\u2035\u2035"],[[8248,8251],2],[8252,1,"!!"],[8253,2],[8254,1," \u0305"],[[8255,8262],2],[8263,1,"??"],[8264,1,"?!"],[8265,1,"!?"],[[8266,8269],2],[[8270,8274],2],[[8275,8276],2],[[8277,8278],2],[8279,1,"\u2032\u2032\u2032\u2032"],[[8280,8286],2],[8287,1," "],[[8288,8291],7],[8292,7],[8293,3],[[8294,8297],3],[[8298,8303],7],[8304,1,"0"],[8305,1,"i"],[[8306,8307],3],[8308,1,"4"],[8309,1,"5"],[8310,1,"6"],[8311,1,"7"],[8312,1,"8"],[8313,1,"9"],[8314,1,"+"],[8315,1,"\u2212"],[8316,1,"="],[8317,1,"("],[8318,1,")"],[8319,1,"n"],[8320,1,"0"],[8321,1,"1"],[8322,1,"2"],[8323,1,"3"],[8324,1,"4"],[8325,1,"5"],[8326,1,"6"],[8327,1,"7"],[8328,1,"8"],[8329,1,"9"],[8330,1,"+"],[8331,1,"\u2212"],[8332,1,"="],[8333,1,"("],[8334,1,")"],[8335,3],[8336,1,"a"],[8337,1,"e"],[8338,1,"o"],[8339,1,"x"],[8340,1,"\u0259"],[8341,1,"h"],[8342,1,"k"],[8343,1,"l"],[8344,1,"m"],[8345,1,"n"],[8346,1,"p"],[8347,1,"s"],[8348,1,"t"],[[8349,8351],3],[[8352,8359],2],[8360,1,"rs"],[[8361,8362],2],[8363,2],[8364,2],[[8365,8367],2],[[8368,8369],2],[[8370,8373],2],[[8374,8376],2],[8377,2],[8378,2],[[8379,8381],2],[8382,2],[8383,2],[8384,2],[8385,2],[[8386,8399],3],[[8400,8417],2],[[8418,8419],2],[[8420,8426],2],[8427,2],[[8428,8431],2],[8432,2],[[8433,8447],3],[8448,1,"a/c"],[8449,1,"a/s"],[8450,1,"c"],[8451,1,"\xB0c"],[8452,2],[8453,1,"c/o"],[8454,1,"c/u"],[8455,1,"\u025B"],[8456,2],[8457,1,"\xB0f"],[8458,1,"g"],[[8459,8462],1,"h"],[8463,1,"\u0127"],[[8464,8465],1,"i"],[[8466,8467],1,"l"],[8468,2],[8469,1,"n"],[8470,1,"no"],[[8471,8472],2],[8473,1,"p"],[8474,1,"q"],[[8475,8477],1,"r"],[[8478,8479],2],[8480,1,"sm"],[8481,1,"tel"],[8482,1,"tm"],[8483,2],[8484,1,"z"],[8485,2],[8486,1,"\u03C9"],[8487,2],[8488,1,"z"],[8489,2],[8490,1,"k"],[8491,1,"\xE5"],[8492,1,"b"],[8493,1,"c"],[8494,2],[[8495,8496],1,"e"],[8497,1,"f"],[8498,1,"\u214E"],[8499,1,"m"],[8500,1,"o"],[8501,1,"\u05D0"],[8502,1,"\u05D1"],[8503,1,"\u05D2"],[8504,1,"\u05D3"],[8505,1,"i"],[8506,2],[8507,1,"fax"],[8508,1,"\u03C0"],[[8509,8510],1,"\u03B3"],[8511,1,"\u03C0"],[8512,1,"\u2211"],[[8513,8516],2],[[8517,8518],1,"d"],[8519,1,"e"],[8520,1,"i"],[8521,1,"j"],[[8522,8523],2],[8524,2],[8525,2],[8526,2],[8527,2],[8528,1,"1\u20447"],[8529,1,"1\u20449"],[8530,1,"1\u204410"],[8531,1,"1\u20443"],[8532,1,"2\u20443"],[8533,1,"1\u20445"],[8534,1,"2\u20445"],[8535,1,"3\u20445"],[8536,1,"4\u20445"],[8537,1,"1\u20446"],[8538,1,"5\u20446"],[8539,1,"1\u20448"],[8540,1,"3\u20448"],[8541,1,"5\u20448"],[8542,1,"7\u20448"],[8543,1,"1\u2044"],[8544,1,"i"],[8545,1,"ii"],[8546,1,"iii"],[8547,1,"iv"],[8548,1,"v"],[8549,1,"vi"],[8550,1,"vii"],[8551,1,"viii"],[8552,1,"ix"],[8553,1,"x"],[8554,1,"xi"],[8555,1,"xii"],[8556,1,"l"],[8557,1,"c"],[8558,1,"d"],[8559,1,"m"],[8560,1,"i"],[8561,1,"ii"],[8562,1,"iii"],[8563,1,"iv"],[8564,1,"v"],[8565,1,"vi"],[8566,1,"vii"],[8567,1,"viii"],[8568,1,"ix"],[8569,1,"x"],[8570,1,"xi"],[8571,1,"xii"],[8572,1,"l"],[8573,1,"c"],[8574,1,"d"],[8575,1,"m"],[[8576,8578],2],[8579,1,"\u2184"],[8580,2],[[8581,8584],2],[8585,1,"0\u20443"],[[8586,8587],2],[[8588,8591],3],[[8592,8682],2],[[8683,8691],2],[[8692,8703],2],[[8704,8747],2],[8748,1,"\u222B\u222B"],[8749,1,"\u222B\u222B\u222B"],[8750,2],[8751,1,"\u222E\u222E"],[8752,1,"\u222E\u222E\u222E"],[[8753,8945],2],[[8946,8959],2],[8960,2],[8961,2],[[8962,9000],2],[9001,1,"\u3008"],[9002,1,"\u3009"],[[9003,9082],2],[9083,2],[9084,2],[[9085,9114],2],[[9115,9166],2],[[9167,9168],2],[[9169,9179],2],[[9180,9191],2],[9192,2],[[9193,9203],2],[[9204,9210],2],[[9211,9214],2],[9215,2],[[9216,9252],2],[[9253,9254],2],[[9255,9257],2],[[9258,9279],3],[[9280,9290],2],[[9291,9311],3],[9312,1,"1"],[9313,1,"2"],[9314,1,"3"],[9315,1,"4"],[9316,1,"5"],[9317,1,"6"],[9318,1,"7"],[9319,1,"8"],[9320,1,"9"],[9321,1,"10"],[9322,1,"11"],[9323,1,"12"],[9324,1,"13"],[9325,1,"14"],[9326,1,"15"],[9327,1,"16"],[9328,1,"17"],[9329,1,"18"],[9330,1,"19"],[9331,1,"20"],[9332,1,"(1)"],[9333,1,"(2)"],[9334,1,"(3)"],[9335,1,"(4)"],[9336,1,"(5)"],[9337,1,"(6)"],[9338,1,"(7)"],[9339,1,"(8)"],[9340,1,"(9)"],[9341,1,"(10)"],[9342,1,"(11)"],[9343,1,"(12)"],[9344,1,"(13)"],[9345,1,"(14)"],[9346,1,"(15)"],[9347,1,"(16)"],[9348,1,"(17)"],[9349,1,"(18)"],[9350,1,"(19)"],[9351,1,"(20)"],[[9352,9371],3],[9372,1,"(a)"],[9373,1,"(b)"],[9374,1,"(c)"],[9375,1,"(d)"],[9376,1,"(e)"],[9377,1,"(f)"],[9378,1,"(g)"],[9379,1,"(h)"],[9380,1,"(i)"],[9381,1,"(j)"],[9382,1,"(k)"],[9383,1,"(l)"],[9384,1,"(m)"],[9385,1,"(n)"],[9386,1,"(o)"],[9387,1,"(p)"],[9388,1,"(q)"],[9389,1,"(r)"],[9390,1,"(s)"],[9391,1,"(t)"],[9392,1,"(u)"],[9393,1,"(v)"],[9394,1,"(w)"],[9395,1,"(x)"],[9396,1,"(y)"],[9397,1,"(z)"],[9398,1,"a"],[9399,1,"b"],[9400,1,"c"],[9401,1,"d"],[9402,1,"e"],[9403,1,"f"],[9404,1,"g"],[9405,1,"h"],[9406,1,"i"],[9407,1,"j"],[9408,1,"k"],[9409,1,"l"],[9410,1,"m"],[9411,1,"n"],[9412,1,"o"],[9413,1,"p"],[9414,1,"q"],[9415,1,"r"],[9416,1,"s"],[9417,1,"t"],[9418,1,"u"],[9419,1,"v"],[9420,1,"w"],[9421,1,"x"],[9422,1,"y"],[9423,1,"z"],[9424,1,"a"],[9425,1,"b"],[9426,1,"c"],[9427,1,"d"],[9428,1,"e"],[9429,1,"f"],[9430,1,"g"],[9431,1,"h"],[9432,1,"i"],[9433,1,"j"],[9434,1,"k"],[9435,1,"l"],[9436,1,"m"],[9437,1,"n"],[9438,1,"o"],[9439,1,"p"],[9440,1,"q"],[9441,1,"r"],[9442,1,"s"],[9443,1,"t"],[9444,1,"u"],[9445,1,"v"],[9446,1,"w"],[9447,1,"x"],[9448,1,"y"],[9449,1,"z"],[9450,1,"0"],[[9451,9470],2],[9471,2],[[9472,9621],2],[[9622,9631],2],[[9632,9711],2],[[9712,9719],2],[[9720,9727],2],[[9728,9747],2],[[9748,9749],2],[[9750,9751],2],[9752,2],[9753,2],[[9754,9839],2],[[9840,9841],2],[[9842,9853],2],[[9854,9855],2],[[9856,9865],2],[[9866,9873],2],[[9874,9884],2],[9885,2],[[9886,9887],2],[[9888,9889],2],[[9890,9905],2],[9906,2],[[9907,9916],2],[[9917,9919],2],[[9920,9923],2],[[9924,9933],2],[9934,2],[[9935,9953],2],[9954,2],[9955,2],[[9956,9959],2],[[9960,9983],2],[9984,2],[[9985,9988],2],[9989,2],[[9990,9993],2],[[9994,9995],2],[[9996,10023],2],[10024,2],[[10025,10059],2],[10060,2],[10061,2],[10062,2],[[10063,10066],2],[[10067,10069],2],[10070,2],[10071,2],[[10072,10078],2],[[10079,10080],2],[[10081,10087],2],[[10088,10101],2],[[10102,10132],2],[[10133,10135],2],[[10136,10159],2],[10160,2],[[10161,10174],2],[10175,2],[[10176,10182],2],[[10183,10186],2],[10187,2],[10188,2],[10189,2],[[10190,10191],2],[[10192,10219],2],[[10220,10223],2],[[10224,10239],2],[[10240,10495],2],[[10496,10763],2],[10764,1,"\u222B\u222B\u222B\u222B"],[[10765,10867],2],[10868,1,"::="],[10869,1,"=="],[10870,1,"==="],[[10871,10971],2],[10972,1,"\u2ADD\u0338"],[[10973,11007],2],[[11008,11021],2],[[11022,11027],2],[[11028,11034],2],[[11035,11039],2],[[11040,11043],2],[[11044,11084],2],[[11085,11087],2],[[11088,11092],2],[[11093,11097],2],[[11098,11123],2],[[11124,11125],3],[[11126,11157],2],[11158,2],[11159,2],[[11160,11193],2],[[11194,11196],2],[[11197,11208],2],[11209,2],[[11210,11217],2],[11218,2],[[11219,11243],2],[[11244,11247],2],[[11248,11262],2],[11263,2],[11264,1,"\u2C30"],[11265,1,"\u2C31"],[11266,1,"\u2C32"],[11267,1,"\u2C33"],[11268,1,"\u2C34"],[11269,1,"\u2C35"],[11270,1,"\u2C36"],[11271,1,"\u2C37"],[11272,1,"\u2C38"],[11273,1,"\u2C39"],[11274,1,"\u2C3A"],[11275,1,"\u2C3B"],[11276,1,"\u2C3C"],[11277,1,"\u2C3D"],[11278,1,"\u2C3E"],[11279,1,"\u2C3F"],[11280,1,"\u2C40"],[11281,1,"\u2C41"],[11282,1,"\u2C42"],[11283,1,"\u2C43"],[11284,1,"\u2C44"],[11285,1,"\u2C45"],[11286,1,"\u2C46"],[11287,1,"\u2C47"],[11288,1,"\u2C48"],[11289,1,"\u2C49"],[11290,1,"\u2C4A"],[11291,1,"\u2C4B"],[11292,1,"\u2C4C"],[11293,1,"\u2C4D"],[11294,1,"\u2C4E"],[11295,1,"\u2C4F"],[11296,1,"\u2C50"],[11297,1,"\u2C51"],[11298,1,"\u2C52"],[11299,1,"\u2C53"],[11300,1,"\u2C54"],[11301,1,"\u2C55"],[11302,1,"\u2C56"],[11303,1,"\u2C57"],[11304,1,"\u2C58"],[11305,1,"\u2C59"],[11306,1,"\u2C5A"],[11307,1,"\u2C5B"],[11308,1,"\u2C5C"],[11309,1,"\u2C5D"],[11310,1,"\u2C5E"],[11311,1,"\u2C5F"],[[11312,11358],2],[11359,2],[11360,1,"\u2C61"],[11361,2],[11362,1,"\u026B"],[11363,1,"\u1D7D"],[11364,1,"\u027D"],[[11365,11366],2],[11367,1,"\u2C68"],[11368,2],[11369,1,"\u2C6A"],[11370,2],[11371,1,"\u2C6C"],[11372,2],[11373,1,"\u0251"],[11374,1,"\u0271"],[11375,1,"\u0250"],[11376,1,"\u0252"],[11377,2],[11378,1,"\u2C73"],[11379,2],[11380,2],[11381,1,"\u2C76"],[[11382,11383],2],[[11384,11387],2],[11388,1,"j"],[11389,1,"v"],[11390,1,"\u023F"],[11391,1,"\u0240"],[11392,1,"\u2C81"],[11393,2],[11394,1,"\u2C83"],[11395,2],[11396,1,"\u2C85"],[11397,2],[11398,1,"\u2C87"],[11399,2],[11400,1,"\u2C89"],[11401,2],[11402,1,"\u2C8B"],[11403,2],[11404,1,"\u2C8D"],[11405,2],[11406,1,"\u2C8F"],[11407,2],[11408,1,"\u2C91"],[11409,2],[11410,1,"\u2C93"],[11411,2],[11412,1,"\u2C95"],[11413,2],[11414,1,"\u2C97"],[11415,2],[11416,1,"\u2C99"],[11417,2],[11418,1,"\u2C9B"],[11419,2],[11420,1,"\u2C9D"],[11421,2],[11422,1,"\u2C9F"],[11423,2],[11424,1,"\u2CA1"],[11425,2],[11426,1,"\u2CA3"],[11427,2],[11428,1,"\u2CA5"],[11429,2],[11430,1,"\u2CA7"],[11431,2],[11432,1,"\u2CA9"],[11433,2],[11434,1,"\u2CAB"],[11435,2],[11436,1,"\u2CAD"],[11437,2],[11438,1,"\u2CAF"],[11439,2],[11440,1,"\u2CB1"],[11441,2],[11442,1,"\u2CB3"],[11443,2],[11444,1,"\u2CB5"],[11445,2],[11446,1,"\u2CB7"],[11447,2],[11448,1,"\u2CB9"],[11449,2],[11450,1,"\u2CBB"],[11451,2],[11452,1,"\u2CBD"],[11453,2],[11454,1,"\u2CBF"],[11455,2],[11456,1,"\u2CC1"],[11457,2],[11458,1,"\u2CC3"],[11459,2],[11460,1,"\u2CC5"],[11461,2],[11462,1,"\u2CC7"],[11463,2],[11464,1,"\u2CC9"],[11465,2],[11466,1,"\u2CCB"],[11467,2],[11468,1,"\u2CCD"],[11469,2],[11470,1,"\u2CCF"],[11471,2],[11472,1,"\u2CD1"],[11473,2],[11474,1,"\u2CD3"],[11475,2],[11476,1,"\u2CD5"],[11477,2],[11478,1,"\u2CD7"],[11479,2],[11480,1,"\u2CD9"],[11481,2],[11482,1,"\u2CDB"],[11483,2],[11484,1,"\u2CDD"],[11485,2],[11486,1,"\u2CDF"],[11487,2],[11488,1,"\u2CE1"],[11489,2],[11490,1,"\u2CE3"],[[11491,11492],2],[[11493,11498],2],[11499,1,"\u2CEC"],[11500,2],[11501,1,"\u2CEE"],[[11502,11505],2],[11506,1,"\u2CF3"],[11507,2],[[11508,11512],3],[[11513,11519],2],[[11520,11557],2],[11558,3],[11559,2],[[11560,11564],3],[11565,2],[[11566,11567],3],[[11568,11621],2],[[11622,11623],2],[[11624,11630],3],[11631,1,"\u2D61"],[11632,2],[[11633,11646],3],[11647,2],[[11648,11670],2],[[11671,11679],3],[[11680,11686],2],[11687,3],[[11688,11694],2],[11695,3],[[11696,11702],2],[11703,3],[[11704,11710],2],[11711,3],[[11712,11718],2],[11719,3],[[11720,11726],2],[11727,3],[[11728,11734],2],[11735,3],[[11736,11742],2],[11743,3],[[11744,11775],2],[[11776,11799],2],[[11800,11803],2],[[11804,11805],2],[[11806,11822],2],[11823,2],[11824,2],[11825,2],[[11826,11835],2],[[11836,11842],2],[[11843,11844],2],[[11845,11849],2],[[11850,11854],2],[11855,2],[[11856,11858],2],[[11859,11869],2],[[11870,11903],3],[[11904,11929],2],[11930,3],[[11931,11934],2],[11935,1,"\u6BCD"],[[11936,12018],2],[12019,1,"\u9F9F"],[[12020,12031],3],[12032,1,"\u4E00"],[12033,1,"\u4E28"],[12034,1,"\u4E36"],[12035,1,"\u4E3F"],[12036,1,"\u4E59"],[12037,1,"\u4E85"],[12038,1,"\u4E8C"],[12039,1,"\u4EA0"],[12040,1,"\u4EBA"],[12041,1,"\u513F"],[12042,1,"\u5165"],[12043,1,"\u516B"],[12044,1,"\u5182"],[12045,1,"\u5196"],[12046,1,"\u51AB"],[12047,1,"\u51E0"],[12048,1,"\u51F5"],[12049,1,"\u5200"],[12050,1,"\u529B"],[12051,1,"\u52F9"],[12052,1,"\u5315"],[12053,1,"\u531A"],[12054,1,"\u5338"],[12055,1,"\u5341"],[12056,1,"\u535C"],[12057,1,"\u5369"],[12058,1,"\u5382"],[12059,1,"\u53B6"],[12060,1,"\u53C8"],[12061,1,"\u53E3"],[12062,1,"\u56D7"],[12063,1,"\u571F"],[12064,1,"\u58EB"],[12065,1,"\u5902"],[12066,1,"\u590A"],[12067,1,"\u5915"],[12068,1,"\u5927"],[12069,1,"\u5973"],[12070,1,"\u5B50"],[12071,1,"\u5B80"],[12072,1,"\u5BF8"],[12073,1,"\u5C0F"],[12074,1,"\u5C22"],[12075,1,"\u5C38"],[12076,1,"\u5C6E"],[12077,1,"\u5C71"],[12078,1,"\u5DDB"],[12079,1,"\u5DE5"],[12080,1,"\u5DF1"],[12081,1,"\u5DFE"],[12082,1,"\u5E72"],[12083,1,"\u5E7A"],[12084,1,"\u5E7F"],[12085,1,"\u5EF4"],[12086,1,"\u5EFE"],[12087,1,"\u5F0B"],[12088,1,"\u5F13"],[12089,1,"\u5F50"],[12090,1,"\u5F61"],[12091,1,"\u5F73"],[12092,1,"\u5FC3"],[12093,1,"\u6208"],[12094,1,"\u6236"],[12095,1,"\u624B"],[12096,1,"\u652F"],[12097,1,"\u6534"],[12098,1,"\u6587"],[12099,1,"\u6597"],[12100,1,"\u65A4"],[12101,1,"\u65B9"],[12102,1,"\u65E0"],[12103,1,"\u65E5"],[12104,1,"\u66F0"],[12105,1,"\u6708"],[12106,1,"\u6728"],[12107,1,"\u6B20"],[12108,1,"\u6B62"],[12109,1,"\u6B79"],[12110,1,"\u6BB3"],[12111,1,"\u6BCB"],[12112,1,"\u6BD4"],[12113,1,"\u6BDB"],[12114,1,"\u6C0F"],[12115,1,"\u6C14"],[12116,1,"\u6C34"],[12117,1,"\u706B"],[12118,1,"\u722A"],[12119,1,"\u7236"],[12120,1,"\u723B"],[12121,1,"\u723F"],[12122,1,"\u7247"],[12123,1,"\u7259"],[12124,1,"\u725B"],[12125,1,"\u72AC"],[12126,1,"\u7384"],[12127,1,"\u7389"],[12128,1,"\u74DC"],[12129,1,"\u74E6"],[12130,1,"\u7518"],[12131,1,"\u751F"],[12132,1,"\u7528"],[12133,1,"\u7530"],[12134,1,"\u758B"],[12135,1,"\u7592"],[12136,1,"\u7676"],[12137,1,"\u767D"],[12138,1,"\u76AE"],[12139,1,"\u76BF"],[12140,1,"\u76EE"],[12141,1,"\u77DB"],[12142,1,"\u77E2"],[12143,1,"\u77F3"],[12144,1,"\u793A"],[12145,1,"\u79B8"],[12146,1,"\u79BE"],[12147,1,"\u7A74"],[12148,1,"\u7ACB"],[12149,1,"\u7AF9"],[12150,1,"\u7C73"],[12151,1,"\u7CF8"],[12152,1,"\u7F36"],[12153,1,"\u7F51"],[12154,1,"\u7F8A"],[12155,1,"\u7FBD"],[12156,1,"\u8001"],[12157,1,"\u800C"],[12158,1,"\u8012"],[12159,1,"\u8033"],[12160,1,"\u807F"],[12161,1,"\u8089"],[12162,1,"\u81E3"],[12163,1,"\u81EA"],[12164,1,"\u81F3"],[12165,1,"\u81FC"],[12166,1,"\u820C"],[12167,1,"\u821B"],[12168,1,"\u821F"],[12169,1,"\u826E"],[12170,1,"\u8272"],[12171,1,"\u8278"],[12172,1,"\u864D"],[12173,1,"\u866B"],[12174,1,"\u8840"],[12175,1,"\u884C"],[12176,1,"\u8863"],[12177,1,"\u897E"],[12178,1,"\u898B"],[12179,1,"\u89D2"],[12180,1,"\u8A00"],[12181,1,"\u8C37"],[12182,1,"\u8C46"],[12183,1,"\u8C55"],[12184,1,"\u8C78"],[12185,1,"\u8C9D"],[12186,1,"\u8D64"],[12187,1,"\u8D70"],[12188,1,"\u8DB3"],[12189,1,"\u8EAB"],[12190,1,"\u8ECA"],[12191,1,"\u8F9B"],[12192,1,"\u8FB0"],[12193,1,"\u8FB5"],[12194,1,"\u9091"],[12195,1,"\u9149"],[12196,1,"\u91C6"],[12197,1,"\u91CC"],[12198,1,"\u91D1"],[12199,1,"\u9577"],[12200,1,"\u9580"],[12201,1,"\u961C"],[12202,1,"\u96B6"],[12203,1,"\u96B9"],[12204,1,"\u96E8"],[12205,1,"\u9751"],[12206,1,"\u975E"],[12207,1,"\u9762"],[12208,1,"\u9769"],[12209,1,"\u97CB"],[12210,1,"\u97ED"],[12211,1,"\u97F3"],[12212,1,"\u9801"],[12213,1,"\u98A8"],[12214,1,"\u98DB"],[12215,1,"\u98DF"],[12216,1,"\u9996"],[12217,1,"\u9999"],[12218,1,"\u99AC"],[12219,1,"\u9AA8"],[12220,1,"\u9AD8"],[12221,1,"\u9ADF"],[12222,1,"\u9B25"],[12223,1,"\u9B2F"],[12224,1,"\u9B32"],[12225,1,"\u9B3C"],[12226,1,"\u9B5A"],[12227,1,"\u9CE5"],[12228,1,"\u9E75"],[12229,1,"\u9E7F"],[12230,1,"\u9EA5"],[12231,1,"\u9EBB"],[12232,1,"\u9EC3"],[12233,1,"\u9ECD"],[12234,1,"\u9ED1"],[12235,1,"\u9EF9"],[12236,1,"\u9EFD"],[12237,1,"\u9F0E"],[12238,1,"\u9F13"],[12239,1,"\u9F20"],[12240,1,"\u9F3B"],[12241,1,"\u9F4A"],[12242,1,"\u9F52"],[12243,1,"\u9F8D"],[12244,1,"\u9F9C"],[12245,1,"\u9FA0"],[[12246,12271],3],[[12272,12283],3],[[12284,12287],3],[12288,1," "],[12289,2],[12290,1,"."],[[12291,12292],2],[[12293,12295],2],[[12296,12329],2],[[12330,12333],2],[[12334,12341],2],[12342,1,"\u3012"],[12343,2],[12344,1,"\u5341"],[12345,1,"\u5344"],[12346,1,"\u5345"],[12347,2],[12348,2],[12349,2],[12350,2],[12351,2],[12352,3],[[12353,12436],2],[[12437,12438],2],[[12439,12440],3],[[12441,12442],2],[12443,1," \u3099"],[12444,1," \u309A"],[[12445,12446],2],[12447,1,"\u3088\u308A"],[12448,2],[[12449,12542],2],[12543,1,"\u30B3\u30C8"],[[12544,12548],3],[[12549,12588],2],[12589,2],[12590,2],[12591,2],[12592,3],[12593,1,"\u1100"],[12594,1,"\u1101"],[12595,1,"\u11AA"],[12596,1,"\u1102"],[12597,1,"\u11AC"],[12598,1,"\u11AD"],[12599,1,"\u1103"],[12600,1,"\u1104"],[12601,1,"\u1105"],[12602,1,"\u11B0"],[12603,1,"\u11B1"],[12604,1,"\u11B2"],[12605,1,"\u11B3"],[12606,1,"\u11B4"],[12607,1,"\u11B5"],[12608,1,"\u111A"],[12609,1,"\u1106"],[12610,1,"\u1107"],[12611,1,"\u1108"],[12612,1,"\u1121"],[12613,1,"\u1109"],[12614,1,"\u110A"],[12615,1,"\u110B"],[12616,1,"\u110C"],[12617,1,"\u110D"],[12618,1,"\u110E"],[12619,1,"\u110F"],[12620,1,"\u1110"],[12621,1,"\u1111"],[12622,1,"\u1112"],[12623,1,"\u1161"],[12624,1,"\u1162"],[12625,1,"\u1163"],[12626,1,"\u1164"],[12627,1,"\u1165"],[12628,1,"\u1166"],[12629,1,"\u1167"],[12630,1,"\u1168"],[12631,1,"\u1169"],[12632,1,"\u116A"],[12633,1,"\u116B"],[12634,1,"\u116C"],[12635,1,"\u116D"],[12636,1,"\u116E"],[12637,1,"\u116F"],[12638,1,"\u1170"],[12639,1,"\u1171"],[12640,1,"\u1172"],[12641,1,"\u1173"],[12642,1,"\u1174"],[12643,1,"\u1175"],[12644,7],[12645,1,"\u1114"],[12646,1,"\u1115"],[12647,1,"\u11C7"],[12648,1,"\u11C8"],[12649,1,"\u11CC"],[12650,1,"\u11CE"],[12651,1,"\u11D3"],[12652,1,"\u11D7"],[12653,1,"\u11D9"],[12654,1,"\u111C"],[12655,1,"\u11DD"],[12656,1,"\u11DF"],[12657,1,"\u111D"],[12658,1,"\u111E"],[12659,1,"\u1120"],[12660,1,"\u1122"],[12661,1,"\u1123"],[12662,1,"\u1127"],[12663,1,"\u1129"],[12664,1,"\u112B"],[12665,1,"\u112C"],[12666,1,"\u112D"],[12667,1,"\u112E"],[12668,1,"\u112F"],[12669,1,"\u1132"],[12670,1,"\u1136"],[12671,1,"\u1140"],[12672,1,"\u1147"],[12673,1,"\u114C"],[12674,1,"\u11F1"],[12675,1,"\u11F2"],[12676,1,"\u1157"],[12677,1,"\u1158"],[12678,1,"\u1159"],[12679,1,"\u1184"],[12680,1,"\u1185"],[12681,1,"\u1188"],[12682,1,"\u1191"],[12683,1,"\u1192"],[12684,1,"\u1194"],[12685,1,"\u119E"],[12686,1,"\u11A1"],[12687,3],[[12688,12689],2],[12690,1,"\u4E00"],[12691,1,"\u4E8C"],[12692,1,"\u4E09"],[12693,1,"\u56DB"],[12694,1,"\u4E0A"],[12695,1,"\u4E2D"],[12696,1,"\u4E0B"],[12697,1,"\u7532"],[12698,1,"\u4E59"],[12699,1,"\u4E19"],[12700,1,"\u4E01"],[12701,1,"\u5929"],[12702,1,"\u5730"],[12703,1,"\u4EBA"],[[12704,12727],2],[[12728,12730],2],[[12731,12735],2],[[12736,12751],2],[[12752,12771],2],[[12772,12773],2],[[12774,12782],3],[12783,3],[[12784,12799],2],[12800,1,"(\u1100)"],[12801,1,"(\u1102)"],[12802,1,"(\u1103)"],[12803,1,"(\u1105)"],[12804,1,"(\u1106)"],[12805,1,"(\u1107)"],[12806,1,"(\u1109)"],[12807,1,"(\u110B)"],[12808,1,"(\u110C)"],[12809,1,"(\u110E)"],[12810,1,"(\u110F)"],[12811,1,"(\u1110)"],[12812,1,"(\u1111)"],[12813,1,"(\u1112)"],[12814,1,"(\uAC00)"],[12815,1,"(\uB098)"],[12816,1,"(\uB2E4)"],[12817,1,"(\uB77C)"],[12818,1,"(\uB9C8)"],[12819,1,"(\uBC14)"],[12820,1,"(\uC0AC)"],[12821,1,"(\uC544)"],[12822,1,"(\uC790)"],[12823,1,"(\uCC28)"],[12824,1,"(\uCE74)"],[12825,1,"(\uD0C0)"],[12826,1,"(\uD30C)"],[12827,1,"(\uD558)"],[12828,1,"(\uC8FC)"],[12829,1,"(\uC624\uC804)"],[12830,1,"(\uC624\uD6C4)"],[12831,3],[12832,1,"(\u4E00)"],[12833,1,"(\u4E8C)"],[12834,1,"(\u4E09)"],[12835,1,"(\u56DB)"],[12836,1,"(\u4E94)"],[12837,1,"(\u516D)"],[12838,1,"(\u4E03)"],[12839,1,"(\u516B)"],[12840,1,"(\u4E5D)"],[12841,1,"(\u5341)"],[12842,1,"(\u6708)"],[12843,1,"(\u706B)"],[12844,1,"(\u6C34)"],[12845,1,"(\u6728)"],[12846,1,"(\u91D1)"],[12847,1,"(\u571F)"],[12848,1,"(\u65E5)"],[12849,1,"(\u682A)"],[12850,1,"(\u6709)"],[12851,1,"(\u793E)"],[12852,1,"(\u540D)"],[12853,1,"(\u7279)"],[12854,1,"(\u8CA1)"],[12855,1,"(\u795D)"],[12856,1,"(\u52B4)"],[12857,1,"(\u4EE3)"],[12858,1,"(\u547C)"],[12859,1,"(\u5B66)"],[12860,1,"(\u76E3)"],[12861,1,"(\u4F01)"],[12862,1,"(\u8CC7)"],[12863,1,"(\u5354)"],[12864,1,"(\u796D)"],[12865,1,"(\u4F11)"],[12866,1,"(\u81EA)"],[12867,1,"(\u81F3)"],[12868,1,"\u554F"],[12869,1,"\u5E7C"],[12870,1,"\u6587"],[12871,1,"\u7B8F"],[[12872,12879],2],[12880,1,"pte"],[12881,1,"21"],[12882,1,"22"],[12883,1,"23"],[12884,1,"24"],[12885,1,"25"],[12886,1,"26"],[12887,1,"27"],[12888,1,"28"],[12889,1,"29"],[12890,1,"30"],[12891,1,"31"],[12892,1,"32"],[12893,1,"33"],[12894,1,"34"],[12895,1,"35"],[12896,1,"\u1100"],[12897,1,"\u1102"],[12898,1,"\u1103"],[12899,1,"\u1105"],[12900,1,"\u1106"],[12901,1,"\u1107"],[12902,1,"\u1109"],[12903,1,"\u110B"],[12904,1,"\u110C"],[12905,1,"\u110E"],[12906,1,"\u110F"],[12907,1,"\u1110"],[12908,1,"\u1111"],[12909,1,"\u1112"],[12910,1,"\uAC00"],[12911,1,"\uB098"],[12912,1,"\uB2E4"],[12913,1,"\uB77C"],[12914,1,"\uB9C8"],[12915,1,"\uBC14"],[12916,1,"\uC0AC"],[12917,1,"\uC544"],[12918,1,"\uC790"],[12919,1,"\uCC28"],[12920,1,"\uCE74"],[12921,1,"\uD0C0"],[12922,1,"\uD30C"],[12923,1,"\uD558"],[12924,1,"\uCC38\uACE0"],[12925,1,"\uC8FC\uC758"],[12926,1,"\uC6B0"],[12927,2],[12928,1,"\u4E00"],[12929,1,"\u4E8C"],[12930,1,"\u4E09"],[12931,1,"\u56DB"],[12932,1,"\u4E94"],[12933,1,"\u516D"],[12934,1,"\u4E03"],[12935,1,"\u516B"],[12936,1,"\u4E5D"],[12937,1,"\u5341"],[12938,1,"\u6708"],[12939,1,"\u706B"],[12940,1,"\u6C34"],[12941,1,"\u6728"],[12942,1,"\u91D1"],[12943,1,"\u571F"],[12944,1,"\u65E5"],[12945,1,"\u682A"],[12946,1,"\u6709"],[12947,1,"\u793E"],[12948,1,"\u540D"],[12949,1,"\u7279"],[12950,1,"\u8CA1"],[12951,1,"\u795D"],[12952,1,"\u52B4"],[12953,1,"\u79D8"],[12954,1,"\u7537"],[12955,1,"\u5973"],[12956,1,"\u9069"],[12957,1,"\u512A"],[12958,1,"\u5370"],[12959,1,"\u6CE8"],[12960,1,"\u9805"],[12961,1,"\u4F11"],[12962,1,"\u5199"],[12963,1,"\u6B63"],[12964,1,"\u4E0A"],[12965,1,"\u4E2D"],[12966,1,"\u4E0B"],[12967,1,"\u5DE6"],[12968,1,"\u53F3"],[12969,1,"\u533B"],[12970,1,"\u5B97"],[12971,1,"\u5B66"],[12972,1,"\u76E3"],[12973,1,"\u4F01"],[12974,1,"\u8CC7"],[12975,1,"\u5354"],[12976,1,"\u591C"],[12977,1,"36"],[12978,1,"37"],[12979,1,"38"],[12980,1,"39"],[12981,1,"40"],[12982,1,"41"],[12983,1,"42"],[12984,1,"43"],[12985,1,"44"],[12986,1,"45"],[12987,1,"46"],[12988,1,"47"],[12989,1,"48"],[12990,1,"49"],[12991,1,"50"],[12992,1,"1\u6708"],[12993,1,"2\u6708"],[12994,1,"3\u6708"],[12995,1,"4\u6708"],[12996,1,"5\u6708"],[12997,1,"6\u6708"],[12998,1,"7\u6708"],[12999,1,"8\u6708"],[13000,1,"9\u6708"],[13001,1,"10\u6708"],[13002,1,"11\u6708"],[13003,1,"12\u6708"],[13004,1,"hg"],[13005,1,"erg"],[13006,1,"ev"],[13007,1,"ltd"],[13008,1,"\u30A2"],[13009,1,"\u30A4"],[13010,1,"\u30A6"],[13011,1,"\u30A8"],[13012,1,"\u30AA"],[13013,1,"\u30AB"],[13014,1,"\u30AD"],[13015,1,"\u30AF"],[13016,1,"\u30B1"],[13017,1,"\u30B3"],[13018,1,"\u30B5"],[13019,1,"\u30B7"],[13020,1,"\u30B9"],[13021,1,"\u30BB"],[13022,1,"\u30BD"],[13023,1,"\u30BF"],[13024,1,"\u30C1"],[13025,1,"\u30C4"],[13026,1,"\u30C6"],[13027,1,"\u30C8"],[13028,1,"\u30CA"],[13029,1,"\u30CB"],[13030,1,"\u30CC"],[13031,1,"\u30CD"],[13032,1,"\u30CE"],[13033,1,"\u30CF"],[13034,1,"\u30D2"],[13035,1,"\u30D5"],[13036,1,"\u30D8"],[13037,1,"\u30DB"],[13038,1,"\u30DE"],[13039,1,"\u30DF"],[13040,1,"\u30E0"],[13041,1,"\u30E1"],[13042,1,"\u30E2"],[13043,1,"\u30E4"],[13044,1,"\u30E6"],[13045,1,"\u30E8"],[13046,1,"\u30E9"],[13047,1,"\u30EA"],[13048,1,"\u30EB"],[13049,1,"\u30EC"],[13050,1,"\u30ED"],[13051,1,"\u30EF"],[13052,1,"\u30F0"],[13053,1,"\u30F1"],[13054,1,"\u30F2"],[13055,1,"\u4EE4\u548C"],[13056,1,"\u30A2\u30D1\u30FC\u30C8"],[13057,1,"\u30A2\u30EB\u30D5\u30A1"],[13058,1,"\u30A2\u30F3\u30DA\u30A2"],[13059,1,"\u30A2\u30FC\u30EB"],[13060,1,"\u30A4\u30CB\u30F3\u30B0"],[13061,1,"\u30A4\u30F3\u30C1"],[13062,1,"\u30A6\u30A9\u30F3"],[13063,1,"\u30A8\u30B9\u30AF\u30FC\u30C9"],[13064,1,"\u30A8\u30FC\u30AB\u30FC"],[13065,1,"\u30AA\u30F3\u30B9"],[13066,1,"\u30AA\u30FC\u30E0"],[13067,1,"\u30AB\u30A4\u30EA"],[13068,1,"\u30AB\u30E9\u30C3\u30C8"],[13069,1,"\u30AB\u30ED\u30EA\u30FC"],[13070,1,"\u30AC\u30ED\u30F3"],[13071,1,"\u30AC\u30F3\u30DE"],[13072,1,"\u30AE\u30AC"],[13073,1,"\u30AE\u30CB\u30FC"],[13074,1,"\u30AD\u30E5\u30EA\u30FC"],[13075,1,"\u30AE\u30EB\u30C0\u30FC"],[13076,1,"\u30AD\u30ED"],[13077,1,"\u30AD\u30ED\u30B0\u30E9\u30E0"],[13078,1,"\u30AD\u30ED\u30E1\u30FC\u30C8\u30EB"],[13079,1,"\u30AD\u30ED\u30EF\u30C3\u30C8"],[13080,1,"\u30B0\u30E9\u30E0"],[13081,1,"\u30B0\u30E9\u30E0\u30C8\u30F3"],[13082,1,"\u30AF\u30EB\u30BC\u30A4\u30ED"],[13083,1,"\u30AF\u30ED\u30FC\u30CD"],[13084,1,"\u30B1\u30FC\u30B9"],[13085,1,"\u30B3\u30EB\u30CA"],[13086,1,"\u30B3\u30FC\u30DD"],[13087,1,"\u30B5\u30A4\u30AF\u30EB"],[13088,1,"\u30B5\u30F3\u30C1\u30FC\u30E0"],[13089,1,"\u30B7\u30EA\u30F3\u30B0"],[13090,1,"\u30BB\u30F3\u30C1"],[13091,1,"\u30BB\u30F3\u30C8"],[13092,1,"\u30C0\u30FC\u30B9"],[13093,1,"\u30C7\u30B7"],[13094,1,"\u30C9\u30EB"],[13095,1,"\u30C8\u30F3"],[13096,1,"\u30CA\u30CE"],[13097,1,"\u30CE\u30C3\u30C8"],[13098,1,"\u30CF\u30A4\u30C4"],[13099,1,"\u30D1\u30FC\u30BB\u30F3\u30C8"],[13100,1,"\u30D1\u30FC\u30C4"],[13101,1,"\u30D0\u30FC\u30EC\u30EB"],[13102,1,"\u30D4\u30A2\u30B9\u30C8\u30EB"],[13103,1,"\u30D4\u30AF\u30EB"],[13104,1,"\u30D4\u30B3"],[13105,1,"\u30D3\u30EB"],[13106,1,"\u30D5\u30A1\u30E9\u30C3\u30C9"],[13107,1,"\u30D5\u30A3\u30FC\u30C8"],[13108,1,"\u30D6\u30C3\u30B7\u30A7\u30EB"],[13109,1,"\u30D5\u30E9\u30F3"],[13110,1,"\u30D8\u30AF\u30BF\u30FC\u30EB"],[13111,1,"\u30DA\u30BD"],[13112,1,"\u30DA\u30CB\u30D2"],[13113,1,"\u30D8\u30EB\u30C4"],[13114,1,"\u30DA\u30F3\u30B9"],[13115,1,"\u30DA\u30FC\u30B8"],[13116,1,"\u30D9\u30FC\u30BF"],[13117,1,"\u30DD\u30A4\u30F3\u30C8"],[13118,1,"\u30DC\u30EB\u30C8"],[13119,1,"\u30DB\u30F3"],[13120,1,"\u30DD\u30F3\u30C9"],[13121,1,"\u30DB\u30FC\u30EB"],[13122,1,"\u30DB\u30FC\u30F3"],[13123,1,"\u30DE\u30A4\u30AF\u30ED"],[13124,1,"\u30DE\u30A4\u30EB"],[13125,1,"\u30DE\u30C3\u30CF"],[13126,1,"\u30DE\u30EB\u30AF"],[13127,1,"\u30DE\u30F3\u30B7\u30E7\u30F3"],[13128,1,"\u30DF\u30AF\u30ED\u30F3"],[13129,1,"\u30DF\u30EA"],[13130,1,"\u30DF\u30EA\u30D0\u30FC\u30EB"],[13131,1,"\u30E1\u30AC"],[13132,1,"\u30E1\u30AC\u30C8\u30F3"],[13133,1,"\u30E1\u30FC\u30C8\u30EB"],[13134,1,"\u30E4\u30FC\u30C9"],[13135,1,"\u30E4\u30FC\u30EB"],[13136,1,"\u30E6\u30A2\u30F3"],[13137,1,"\u30EA\u30C3\u30C8\u30EB"],[13138,1,"\u30EA\u30E9"],[13139,1,"\u30EB\u30D4\u30FC"],[13140,1,"\u30EB\u30FC\u30D6\u30EB"],[13141,1,"\u30EC\u30E0"],[13142,1,"\u30EC\u30F3\u30C8\u30B2\u30F3"],[13143,1,"\u30EF\u30C3\u30C8"],[13144,1,"0\u70B9"],[13145,1,"1\u70B9"],[13146,1,"2\u70B9"],[13147,1,"3\u70B9"],[13148,1,"4\u70B9"],[13149,1,"5\u70B9"],[13150,1,"6\u70B9"],[13151,1,"7\u70B9"],[13152,1,"8\u70B9"],[13153,1,"9\u70B9"],[13154,1,"10\u70B9"],[13155,1,"11\u70B9"],[13156,1,"12\u70B9"],[13157,1,"13\u70B9"],[13158,1,"14\u70B9"],[13159,1,"15\u70B9"],[13160,1,"16\u70B9"],[13161,1,"17\u70B9"],[13162,1,"18\u70B9"],[13163,1,"19\u70B9"],[13164,1,"20\u70B9"],[13165,1,"21\u70B9"],[13166,1,"22\u70B9"],[13167,1,"23\u70B9"],[13168,1,"24\u70B9"],[13169,1,"hpa"],[13170,1,"da"],[13171,1,"au"],[13172,1,"bar"],[13173,1,"ov"],[13174,1,"pc"],[13175,1,"dm"],[13176,1,"dm2"],[13177,1,"dm3"],[13178,1,"iu"],[13179,1,"\u5E73\u6210"],[13180,1,"\u662D\u548C"],[13181,1,"\u5927\u6B63"],[13182,1,"\u660E\u6CBB"],[13183,1,"\u682A\u5F0F\u4F1A\u793E"],[13184,1,"pa"],[13185,1,"na"],[13186,1,"\u03BCa"],[13187,1,"ma"],[13188,1,"ka"],[13189,1,"kb"],[13190,1,"mb"],[13191,1,"gb"],[13192,1,"cal"],[13193,1,"kcal"],[13194,1,"pf"],[13195,1,"nf"],[13196,1,"\u03BCf"],[13197,1,"\u03BCg"],[13198,1,"mg"],[13199,1,"kg"],[13200,1,"hz"],[13201,1,"khz"],[13202,1,"mhz"],[13203,1,"ghz"],[13204,1,"thz"],[13205,1,"\u03BCl"],[13206,1,"ml"],[13207,1,"dl"],[13208,1,"kl"],[13209,1,"fm"],[13210,1,"nm"],[13211,1,"\u03BCm"],[13212,1,"mm"],[13213,1,"cm"],[13214,1,"km"],[13215,1,"mm2"],[13216,1,"cm2"],[13217,1,"m2"],[13218,1,"km2"],[13219,1,"mm3"],[13220,1,"cm3"],[13221,1,"m3"],[13222,1,"km3"],[13223,1,"m\u2215s"],[13224,1,"m\u2215s2"],[13225,1,"pa"],[13226,1,"kpa"],[13227,1,"mpa"],[13228,1,"gpa"],[13229,1,"rad"],[13230,1,"rad\u2215s"],[13231,1,"rad\u2215s2"],[13232,1,"ps"],[13233,1,"ns"],[13234,1,"\u03BCs"],[13235,1,"ms"],[13236,1,"pv"],[13237,1,"nv"],[13238,1,"\u03BCv"],[13239,1,"mv"],[13240,1,"kv"],[13241,1,"mv"],[13242,1,"pw"],[13243,1,"nw"],[13244,1,"\u03BCw"],[13245,1,"mw"],[13246,1,"kw"],[13247,1,"mw"],[13248,1,"k\u03C9"],[13249,1,"m\u03C9"],[13250,3],[13251,1,"bq"],[13252,1,"cc"],[13253,1,"cd"],[13254,1,"c\u2215kg"],[13255,3],[13256,1,"db"],[13257,1,"gy"],[13258,1,"ha"],[13259,1,"hp"],[13260,1,"in"],[13261,1,"kk"],[13262,1,"km"],[13263,1,"kt"],[13264,1,"lm"],[13265,1,"ln"],[13266,1,"log"],[13267,1,"lx"],[13268,1,"mb"],[13269,1,"mil"],[13270,1,"mol"],[13271,1,"ph"],[13272,3],[13273,1,"ppm"],[13274,1,"pr"],[13275,1,"sr"],[13276,1,"sv"],[13277,1,"wb"],[13278,1,"v\u2215m"],[13279,1,"a\u2215m"],[13280,1,"1\u65E5"],[13281,1,"2\u65E5"],[13282,1,"3\u65E5"],[13283,1,"4\u65E5"],[13284,1,"5\u65E5"],[13285,1,"6\u65E5"],[13286,1,"7\u65E5"],[13287,1,"8\u65E5"],[13288,1,"9\u65E5"],[13289,1,"10\u65E5"],[13290,1,"11\u65E5"],[13291,1,"12\u65E5"],[13292,1,"13\u65E5"],[13293,1,"14\u65E5"],[13294,1,"15\u65E5"],[13295,1,"16\u65E5"],[13296,1,"17\u65E5"],[13297,1,"18\u65E5"],[13298,1,"19\u65E5"],[13299,1,"20\u65E5"],[13300,1,"21\u65E5"],[13301,1,"22\u65E5"],[13302,1,"23\u65E5"],[13303,1,"24\u65E5"],[13304,1,"25\u65E5"],[13305,1,"26\u65E5"],[13306,1,"27\u65E5"],[13307,1,"28\u65E5"],[13308,1,"29\u65E5"],[13309,1,"30\u65E5"],[13310,1,"31\u65E5"],[13311,1,"gal"],[[13312,19893],2],[[19894,19903],2],[[19904,19967],2],[[19968,40869],2],[[40870,40891],2],[[40892,40899],2],[[40900,40907],2],[40908,2],[[40909,40917],2],[[40918,40938],2],[[40939,40943],2],[[40944,40956],2],[[40957,40959],2],[[40960,42124],2],[[42125,42127],3],[[42128,42145],2],[[42146,42147],2],[[42148,42163],2],[42164,2],[[42165,42176],2],[42177,2],[[42178,42180],2],[42181,2],[42182,2],[[42183,42191],3],[[42192,42237],2],[[42238,42239],2],[[42240,42508],2],[[42509,42511],2],[[42512,42539],2],[[42540,42559],3],[42560,1,"\uA641"],[42561,2],[42562,1,"\uA643"],[42563,2],[42564,1,"\uA645"],[42565,2],[42566,1,"\uA647"],[42567,2],[42568,1,"\uA649"],[42569,2],[42570,1,"\uA64B"],[42571,2],[42572,1,"\uA64D"],[42573,2],[42574,1,"\uA64F"],[42575,2],[42576,1,"\uA651"],[42577,2],[42578,1,"\uA653"],[42579,2],[42580,1,"\uA655"],[42581,2],[42582,1,"\uA657"],[42583,2],[42584,1,"\uA659"],[42585,2],[42586,1,"\uA65B"],[42587,2],[42588,1,"\uA65D"],[42589,2],[42590,1,"\uA65F"],[42591,2],[42592,1,"\uA661"],[42593,2],[42594,1,"\uA663"],[42595,2],[42596,1,"\uA665"],[42597,2],[42598,1,"\uA667"],[42599,2],[42600,1,"\uA669"],[42601,2],[42602,1,"\uA66B"],[42603,2],[42604,1,"\uA66D"],[[42605,42607],2],[[42608,42611],2],[[42612,42619],2],[[42620,42621],2],[42622,2],[42623,2],[42624,1,"\uA681"],[42625,2],[42626,1,"\uA683"],[42627,2],[42628,1,"\uA685"],[42629,2],[42630,1,"\uA687"],[42631,2],[42632,1,"\uA689"],[42633,2],[42634,1,"\uA68B"],[42635,2],[42636,1,"\uA68D"],[42637,2],[42638,1,"\uA68F"],[42639,2],[42640,1,"\uA691"],[42641,2],[42642,1,"\uA693"],[42643,2],[42644,1,"\uA695"],[42645,2],[42646,1,"\uA697"],[42647,2],[42648,1,"\uA699"],[42649,2],[42650,1,"\uA69B"],[42651,2],[42652,1,"\u044A"],[42653,1,"\u044C"],[42654,2],[42655,2],[[42656,42725],2],[[42726,42735],2],[[42736,42737],2],[[42738,42743],2],[[42744,42751],3],[[42752,42774],2],[[42775,42778],2],[[42779,42783],2],[[42784,42785],2],[42786,1,"\uA723"],[42787,2],[42788,1,"\uA725"],[42789,2],[42790,1,"\uA727"],[42791,2],[42792,1,"\uA729"],[42793,2],[42794,1,"\uA72B"],[42795,2],[42796,1,"\uA72D"],[42797,2],[42798,1,"\uA72F"],[[42799,42801],2],[42802,1,"\uA733"],[42803,2],[42804,1,"\uA735"],[42805,2],[42806,1,"\uA737"],[42807,2],[42808,1,"\uA739"],[42809,2],[42810,1,"\uA73B"],[42811,2],[42812,1,"\uA73D"],[42813,2],[42814,1,"\uA73F"],[42815,2],[42816,1,"\uA741"],[42817,2],[42818,1,"\uA743"],[42819,2],[42820,1,"\uA745"],[42821,2],[42822,1,"\uA747"],[42823,2],[42824,1,"\uA749"],[42825,2],[42826,1,"\uA74B"],[42827,2],[42828,1,"\uA74D"],[42829,2],[42830,1,"\uA74F"],[42831,2],[42832,1,"\uA751"],[42833,2],[42834,1,"\uA753"],[42835,2],[42836,1,"\uA755"],[42837,2],[42838,1,"\uA757"],[42839,2],[42840,1,"\uA759"],[42841,2],[42842,1,"\uA75B"],[42843,2],[42844,1,"\uA75D"],[42845,2],[42846,1,"\uA75F"],[42847,2],[42848,1,"\uA761"],[42849,2],[42850,1,"\uA763"],[42851,2],[42852,1,"\uA765"],[42853,2],[42854,1,"\uA767"],[42855,2],[42856,1,"\uA769"],[42857,2],[42858,1,"\uA76B"],[42859,2],[42860,1,"\uA76D"],[42861,2],[42862,1,"\uA76F"],[42863,2],[42864,1,"\uA76F"],[[42865,42872],2],[42873,1,"\uA77A"],[42874,2],[42875,1,"\uA77C"],[42876,2],[42877,1,"\u1D79"],[42878,1,"\uA77F"],[42879,2],[42880,1,"\uA781"],[42881,2],[42882,1,"\uA783"],[42883,2],[42884,1,"\uA785"],[42885,2],[42886,1,"\uA787"],[[42887,42888],2],[[42889,42890],2],[42891,1,"\uA78C"],[42892,2],[42893,1,"\u0265"],[42894,2],[42895,2],[42896,1,"\uA791"],[42897,2],[42898,1,"\uA793"],[42899,2],[[42900,42901],2],[42902,1,"\uA797"],[42903,2],[42904,1,"\uA799"],[42905,2],[42906,1,"\uA79B"],[42907,2],[42908,1,"\uA79D"],[42909,2],[42910,1,"\uA79F"],[42911,2],[42912,1,"\uA7A1"],[42913,2],[42914,1,"\uA7A3"],[42915,2],[42916,1,"\uA7A5"],[42917,2],[42918,1,"\uA7A7"],[42919,2],[42920,1,"\uA7A9"],[42921,2],[42922,1,"\u0266"],[42923,1,"\u025C"],[42924,1,"\u0261"],[42925,1,"\u026C"],[42926,1,"\u026A"],[42927,2],[42928,1,"\u029E"],[42929,1,"\u0287"],[42930,1,"\u029D"],[42931,1,"\uAB53"],[42932,1,"\uA7B5"],[42933,2],[42934,1,"\uA7B7"],[42935,2],[42936,1,"\uA7B9"],[42937,2],[42938,1,"\uA7BB"],[42939,2],[42940,1,"\uA7BD"],[42941,2],[42942,1,"\uA7BF"],[42943,2],[42944,1,"\uA7C1"],[42945,2],[42946,1,"\uA7C3"],[42947,2],[42948,1,"\uA794"],[42949,1,"\u0282"],[42950,1,"\u1D8E"],[42951,1,"\uA7C8"],[42952,2],[42953,1,"\uA7CA"],[42954,2],[42955,1,"\u0264"],[42956,1,"\uA7CD"],[42957,2],[42958,1,"\uA7CF"],[42959,2],[42960,1,"\uA7D1"],[42961,2],[42962,1,"\uA7D3"],[42963,2],[42964,1,"\uA7D5"],[42965,2],[42966,1,"\uA7D7"],[42967,2],[42968,1,"\uA7D9"],[42969,2],[42970,1,"\uA7DB"],[42971,2],[42972,1,"\u019B"],[[42973,42992],3],[42993,1,"s"],[42994,1,"c"],[42995,1,"f"],[42996,1,"q"],[42997,1,"\uA7F6"],[42998,2],[42999,2],[43000,1,"\u0127"],[43001,1,"\u0153"],[43002,2],[[43003,43007],2],[[43008,43047],2],[[43048,43051],2],[43052,2],[[43053,43055],3],[[43056,43065],2],[[43066,43071],3],[[43072,43123],2],[[43124,43127],2],[[43128,43135],3],[[43136,43204],2],[43205,2],[[43206,43213],3],[[43214,43215],2],[[43216,43225],2],[[43226,43231],3],[[43232,43255],2],[[43256,43258],2],[43259,2],[43260,2],[43261,2],[[43262,43263],2],[[43264,43309],2],[[43310,43311],2],[[43312,43347],2],[[43348,43358],3],[43359,2],[[43360,43388],2],[[43389,43391],3],[[43392,43456],2],[[43457,43469],2],[43470,3],[[43471,43481],2],[[43482,43485],3],[[43486,43487],2],[[43488,43518],2],[43519,3],[[43520,43574],2],[[43575,43583],3],[[43584,43597],2],[[43598,43599],3],[[43600,43609],2],[[43610,43611],3],[[43612,43615],2],[[43616,43638],2],[[43639,43641],2],[[43642,43643],2],[[43644,43647],2],[[43648,43714],2],[[43715,43738],3],[[43739,43741],2],[[43742,43743],2],[[43744,43759],2],[[43760,43761],2],[[43762,43766],2],[[43767,43776],3],[[43777,43782],2],[[43783,43784],3],[[43785,43790],2],[[43791,43792],3],[[43793,43798],2],[[43799,43807],3],[[43808,43814],2],[43815,3],[[43816,43822],2],[43823,3],[[43824,43866],2],[43867,2],[43868,1,"\uA727"],[43869,1,"\uAB37"],[43870,1,"\u026B"],[43871,1,"\uAB52"],[[43872,43875],2],[[43876,43877],2],[[43878,43879],2],[43880,2],[43881,1,"\u028D"],[[43882,43883],2],[[43884,43887],3],[43888,1,"\u13A0"],[43889,1,"\u13A1"],[43890,1,"\u13A2"],[43891,1,"\u13A3"],[43892,1,"\u13A4"],[43893,1,"\u13A5"],[43894,1,"\u13A6"],[43895,1,"\u13A7"],[43896,1,"\u13A8"],[43897,1,"\u13A9"],[43898,1,"\u13AA"],[43899,1,"\u13AB"],[43900,1,"\u13AC"],[43901,1,"\u13AD"],[43902,1,"\u13AE"],[43903,1,"\u13AF"],[43904,1,"\u13B0"],[43905,1,"\u13B1"],[43906,1,"\u13B2"],[43907,1,"\u13B3"],[43908,1,"\u13B4"],[43909,1,"\u13B5"],[43910,1,"\u13B6"],[43911,1,"\u13B7"],[43912,1,"\u13B8"],[43913,1,"\u13B9"],[43914,1,"\u13BA"],[43915,1,"\u13BB"],[43916,1,"\u13BC"],[43917,1,"\u13BD"],[43918,1,"\u13BE"],[43919,1,"\u13BF"],[43920,1,"\u13C0"],[43921,1,"\u13C1"],[43922,1,"\u13C2"],[43923,1,"\u13C3"],[43924,1,"\u13C4"],[43925,1,"\u13C5"],[43926,1,"\u13C6"],[43927,1,"\u13C7"],[43928,1,"\u13C8"],[43929,1,"\u13C9"],[43930,1,"\u13CA"],[43931,1,"\u13CB"],[43932,1,"\u13CC"],[43933,1,"\u13CD"],[43934,1,"\u13CE"],[43935,1,"\u13CF"],[43936,1,"\u13D0"],[43937,1,"\u13D1"],[43938,1,"\u13D2"],[43939,1,"\u13D3"],[43940,1,"\u13D4"],[43941,1,"\u13D5"],[43942,1,"\u13D6"],[43943,1,"\u13D7"],[43944,1,"\u13D8"],[43945,1,"\u13D9"],[43946,1,"\u13DA"],[43947,1,"\u13DB"],[43948,1,"\u13DC"],[43949,1,"\u13DD"],[43950,1,"\u13DE"],[43951,1,"\u13DF"],[43952,1,"\u13E0"],[43953,1,"\u13E1"],[43954,1,"\u13E2"],[43955,1,"\u13E3"],[43956,1,"\u13E4"],[43957,1,"\u13E5"],[43958,1,"\u13E6"],[43959,1,"\u13E7"],[43960,1,"\u13E8"],[43961,1,"\u13E9"],[43962,1,"\u13EA"],[43963,1,"\u13EB"],[43964,1,"\u13EC"],[43965,1,"\u13ED"],[43966,1,"\u13EE"],[43967,1,"\u13EF"],[[43968,44010],2],[44011,2],[[44012,44013],2],[[44014,44015],3],[[44016,44025],2],[[44026,44031],3],[[44032,55203],2],[[55204,55215],3],[[55216,55238],2],[[55239,55242],3],[[55243,55291],2],[[55292,55295],3],[[55296,57343],3],[[57344,63743],3],[63744,1,"\u8C48"],[63745,1,"\u66F4"],[63746,1,"\u8ECA"],[63747,1,"\u8CC8"],[63748,1,"\u6ED1"],[63749,1,"\u4E32"],[63750,1,"\u53E5"],[[63751,63752],1,"\u9F9C"],[63753,1,"\u5951"],[63754,1,"\u91D1"],[63755,1,"\u5587"],[63756,1,"\u5948"],[63757,1,"\u61F6"],[63758,1,"\u7669"],[63759,1,"\u7F85"],[63760,1,"\u863F"],[63761,1,"\u87BA"],[63762,1,"\u88F8"],[63763,1,"\u908F"],[63764,1,"\u6A02"],[63765,1,"\u6D1B"],[63766,1,"\u70D9"],[63767,1,"\u73DE"],[63768,1,"\u843D"],[63769,1,"\u916A"],[63770,1,"\u99F1"],[63771,1,"\u4E82"],[63772,1,"\u5375"],[63773,1,"\u6B04"],[63774,1,"\u721B"],[63775,1,"\u862D"],[63776,1,"\u9E1E"],[63777,1,"\u5D50"],[63778,1,"\u6FEB"],[63779,1,"\u85CD"],[63780,1,"\u8964"],[63781,1,"\u62C9"],[63782,1,"\u81D8"],[63783,1,"\u881F"],[63784,1,"\u5ECA"],[63785,1,"\u6717"],[63786,1,"\u6D6A"],[63787,1,"\u72FC"],[63788,1,"\u90CE"],[63789,1,"\u4F86"],[63790,1,"\u51B7"],[63791,1,"\u52DE"],[63792,1,"\u64C4"],[63793,1,"\u6AD3"],[63794,1,"\u7210"],[63795,1,"\u76E7"],[63796,1,"\u8001"],[63797,1,"\u8606"],[63798,1,"\u865C"],[63799,1,"\u8DEF"],[63800,1,"\u9732"],[63801,1,"\u9B6F"],[63802,1,"\u9DFA"],[63803,1,"\u788C"],[63804,1,"\u797F"],[63805,1,"\u7DA0"],[63806,1,"\u83C9"],[63807,1,"\u9304"],[63808,1,"\u9E7F"],[63809,1,"\u8AD6"],[63810,1,"\u58DF"],[63811,1,"\u5F04"],[63812,1,"\u7C60"],[63813,1,"\u807E"],[63814,1,"\u7262"],[63815,1,"\u78CA"],[63816,1,"\u8CC2"],[63817,1,"\u96F7"],[63818,1,"\u58D8"],[63819,1,"\u5C62"],[63820,1,"\u6A13"],[63821,1,"\u6DDA"],[63822,1,"\u6F0F"],[63823,1,"\u7D2F"],[63824,1,"\u7E37"],[63825,1,"\u964B"],[63826,1,"\u52D2"],[63827,1,"\u808B"],[63828,1,"\u51DC"],[63829,1,"\u51CC"],[63830,1,"\u7A1C"],[63831,1,"\u7DBE"],[63832,1,"\u83F1"],[63833,1,"\u9675"],[63834,1,"\u8B80"],[63835,1,"\u62CF"],[63836,1,"\u6A02"],[63837,1,"\u8AFE"],[63838,1,"\u4E39"],[63839,1,"\u5BE7"],[63840,1,"\u6012"],[63841,1,"\u7387"],[63842,1,"\u7570"],[63843,1,"\u5317"],[63844,1,"\u78FB"],[63845,1,"\u4FBF"],[63846,1,"\u5FA9"],[63847,1,"\u4E0D"],[63848,1,"\u6CCC"],[63849,1,"\u6578"],[63850,1,"\u7D22"],[63851,1,"\u53C3"],[63852,1,"\u585E"],[63853,1,"\u7701"],[63854,1,"\u8449"],[63855,1,"\u8AAA"],[63856,1,"\u6BBA"],[63857,1,"\u8FB0"],[63858,1,"\u6C88"],[63859,1,"\u62FE"],[63860,1,"\u82E5"],[63861,1,"\u63A0"],[63862,1,"\u7565"],[63863,1,"\u4EAE"],[63864,1,"\u5169"],[63865,1,"\u51C9"],[63866,1,"\u6881"],[63867,1,"\u7CE7"],[63868,1,"\u826F"],[63869,1,"\u8AD2"],[63870,1,"\u91CF"],[63871,1,"\u52F5"],[63872,1,"\u5442"],[63873,1,"\u5973"],[63874,1,"\u5EEC"],[63875,1,"\u65C5"],[63876,1,"\u6FFE"],[63877,1,"\u792A"],[63878,1,"\u95AD"],[63879,1,"\u9A6A"],[63880,1,"\u9E97"],[63881,1,"\u9ECE"],[63882,1,"\u529B"],[63883,1,"\u66C6"],[63884,1,"\u6B77"],[63885,1,"\u8F62"],[63886,1,"\u5E74"],[63887,1,"\u6190"],[63888,1,"\u6200"],[63889,1,"\u649A"],[63890,1,"\u6F23"],[63891,1,"\u7149"],[63892,1,"\u7489"],[63893,1,"\u79CA"],[63894,1,"\u7DF4"],[63895,1,"\u806F"],[63896,1,"\u8F26"],[63897,1,"\u84EE"],[63898,1,"\u9023"],[63899,1,"\u934A"],[63900,1,"\u5217"],[63901,1,"\u52A3"],[63902,1,"\u54BD"],[63903,1,"\u70C8"],[63904,1,"\u88C2"],[63905,1,"\u8AAA"],[63906,1,"\u5EC9"],[63907,1,"\u5FF5"],[63908,1,"\u637B"],[63909,1,"\u6BAE"],[63910,1,"\u7C3E"],[63911,1,"\u7375"],[63912,1,"\u4EE4"],[63913,1,"\u56F9"],[63914,1,"\u5BE7"],[63915,1,"\u5DBA"],[63916,1,"\u601C"],[63917,1,"\u73B2"],[63918,1,"\u7469"],[63919,1,"\u7F9A"],[63920,1,"\u8046"],[63921,1,"\u9234"],[63922,1,"\u96F6"],[63923,1,"\u9748"],[63924,1,"\u9818"],[63925,1,"\u4F8B"],[63926,1,"\u79AE"],[63927,1,"\u91B4"],[63928,1,"\u96B8"],[63929,1,"\u60E1"],[63930,1,"\u4E86"],[63931,1,"\u50DA"],[63932,1,"\u5BEE"],[63933,1,"\u5C3F"],[63934,1,"\u6599"],[63935,1,"\u6A02"],[63936,1,"\u71CE"],[63937,1,"\u7642"],[63938,1,"\u84FC"],[63939,1,"\u907C"],[63940,1,"\u9F8D"],[63941,1,"\u6688"],[63942,1,"\u962E"],[63943,1,"\u5289"],[63944,1,"\u677B"],[63945,1,"\u67F3"],[63946,1,"\u6D41"],[63947,1,"\u6E9C"],[63948,1,"\u7409"],[63949,1,"\u7559"],[63950,1,"\u786B"],[63951,1,"\u7D10"],[63952,1,"\u985E"],[63953,1,"\u516D"],[63954,1,"\u622E"],[63955,1,"\u9678"],[63956,1,"\u502B"],[63957,1,"\u5D19"],[63958,1,"\u6DEA"],[63959,1,"\u8F2A"],[63960,1,"\u5F8B"],[63961,1,"\u6144"],[63962,1,"\u6817"],[63963,1,"\u7387"],[63964,1,"\u9686"],[63965,1,"\u5229"],[63966,1,"\u540F"],[63967,1,"\u5C65"],[63968,1,"\u6613"],[63969,1,"\u674E"],[63970,1,"\u68A8"],[63971,1,"\u6CE5"],[63972,1,"\u7406"],[63973,1,"\u75E2"],[63974,1,"\u7F79"],[63975,1,"\u88CF"],[63976,1,"\u88E1"],[63977,1,"\u91CC"],[63978,1,"\u96E2"],[63979,1,"\u533F"],[63980,1,"\u6EBA"],[63981,1,"\u541D"],[63982,1,"\u71D0"],[63983,1,"\u7498"],[63984,1,"\u85FA"],[63985,1,"\u96A3"],[63986,1,"\u9C57"],[63987,1,"\u9E9F"],[63988,1,"\u6797"],[63989,1,"\u6DCB"],[63990,1,"\u81E8"],[63991,1,"\u7ACB"],[63992,1,"\u7B20"],[63993,1,"\u7C92"],[63994,1,"\u72C0"],[63995,1,"\u7099"],[63996,1,"\u8B58"],[63997,1,"\u4EC0"],[63998,1,"\u8336"],[63999,1,"\u523A"],[64000,1,"\u5207"],[64001,1,"\u5EA6"],[64002,1,"\u62D3"],[64003,1,"\u7CD6"],[64004,1,"\u5B85"],[64005,1,"\u6D1E"],[64006,1,"\u66B4"],[64007,1,"\u8F3B"],[64008,1,"\u884C"],[64009,1,"\u964D"],[64010,1,"\u898B"],[64011,1,"\u5ED3"],[64012,1,"\u5140"],[64013,1,"\u55C0"],[[64014,64015],2],[64016,1,"\u585A"],[64017,2],[64018,1,"\u6674"],[[64019,64020],2],[64021,1,"\u51DE"],[64022,1,"\u732A"],[64023,1,"\u76CA"],[64024,1,"\u793C"],[64025,1,"\u795E"],[64026,1,"\u7965"],[64027,1,"\u798F"],[64028,1,"\u9756"],[64029,1,"\u7CBE"],[64030,1,"\u7FBD"],[64031,2],[64032,1,"\u8612"],[64033,2],[64034,1,"\u8AF8"],[[64035,64036],2],[64037,1,"\u9038"],[64038,1,"\u90FD"],[[64039,64041],2],[64042,1,"\u98EF"],[64043,1,"\u98FC"],[64044,1,"\u9928"],[64045,1,"\u9DB4"],[64046,1,"\u90DE"],[64047,1,"\u96B7"],[64048,1,"\u4FAE"],[64049,1,"\u50E7"],[64050,1,"\u514D"],[64051,1,"\u52C9"],[64052,1,"\u52E4"],[64053,1,"\u5351"],[64054,1,"\u559D"],[64055,1,"\u5606"],[64056,1,"\u5668"],[64057,1,"\u5840"],[64058,1,"\u58A8"],[64059,1,"\u5C64"],[64060,1,"\u5C6E"],[64061,1,"\u6094"],[64062,1,"\u6168"],[64063,1,"\u618E"],[64064,1,"\u61F2"],[64065,1,"\u654F"],[64066,1,"\u65E2"],[64067,1,"\u6691"],[64068,1,"\u6885"],[64069,1,"\u6D77"],[64070,1,"\u6E1A"],[64071,1,"\u6F22"],[64072,1,"\u716E"],[64073,1,"\u722B"],[64074,1,"\u7422"],[64075,1,"\u7891"],[64076,1,"\u793E"],[64077,1,"\u7949"],[64078,1,"\u7948"],[64079,1,"\u7950"],[64080,1,"\u7956"],[64081,1,"\u795D"],[64082,1,"\u798D"],[64083,1,"\u798E"],[64084,1,"\u7A40"],[64085,1,"\u7A81"],[64086,1,"\u7BC0"],[64087,1,"\u7DF4"],[64088,1,"\u7E09"],[64089,1,"\u7E41"],[64090,1,"\u7F72"],[64091,1,"\u8005"],[64092,1,"\u81ED"],[[64093,64094],1,"\u8279"],[64095,1,"\u8457"],[64096,1,"\u8910"],[64097,1,"\u8996"],[64098,1,"\u8B01"],[64099,1,"\u8B39"],[64100,1,"\u8CD3"],[64101,1,"\u8D08"],[64102,1,"\u8FB6"],[64103,1,"\u9038"],[64104,1,"\u96E3"],[64105,1,"\u97FF"],[64106,1,"\u983B"],[64107,1,"\u6075"],[64108,1,"\uD850\uDEEE"],[64109,1,"\u8218"],[[64110,64111],3],[64112,1,"\u4E26"],[64113,1,"\u51B5"],[64114,1,"\u5168"],[64115,1,"\u4F80"],[64116,1,"\u5145"],[64117,1,"\u5180"],[64118,1,"\u52C7"],[64119,1,"\u52FA"],[64120,1,"\u559D"],[64121,1,"\u5555"],[64122,1,"\u5599"],[64123,1,"\u55E2"],[64124,1,"\u585A"],[64125,1,"\u58B3"],[64126,1,"\u5944"],[64127,1,"\u5954"],[64128,1,"\u5A62"],[64129,1,"\u5B28"],[64130,1,"\u5ED2"],[64131,1,"\u5ED9"],[64132,1,"\u5F69"],[64133,1,"\u5FAD"],[64134,1,"\u60D8"],[64135,1,"\u614E"],[64136,1,"\u6108"],[64137,1,"\u618E"],[64138,1,"\u6160"],[64139,1,"\u61F2"],[64140,1,"\u6234"],[64141,1,"\u63C4"],[64142,1,"\u641C"],[64143,1,"\u6452"],[64144,1,"\u6556"],[64145,1,"\u6674"],[64146,1,"\u6717"],[64147,1,"\u671B"],[64148,1,"\u6756"],[64149,1,"\u6B79"],[64150,1,"\u6BBA"],[64151,1,"\u6D41"],[64152,1,"\u6EDB"],[64153,1,"\u6ECB"],[64154,1,"\u6F22"],[64155,1,"\u701E"],[64156,1,"\u716E"],[64157,1,"\u77A7"],[64158,1,"\u7235"],[64159,1,"\u72AF"],[64160,1,"\u732A"],[64161,1,"\u7471"],[64162,1,"\u7506"],[64163,1,"\u753B"],[64164,1,"\u761D"],[64165,1,"\u761F"],[64166,1,"\u76CA"],[64167,1,"\u76DB"],[64168,1,"\u76F4"],[64169,1,"\u774A"],[64170,1,"\u7740"],[64171,1,"\u78CC"],[64172,1,"\u7AB1"],[64173,1,"\u7BC0"],[64174,1,"\u7C7B"],[64175,1,"\u7D5B"],[64176,1,"\u7DF4"],[64177,1,"\u7F3E"],[64178,1,"\u8005"],[64179,1,"\u8352"],[64180,1,"\u83EF"],[64181,1,"\u8779"],[64182,1,"\u8941"],[64183,1,"\u8986"],[64184,1,"\u8996"],[64185,1,"\u8ABF"],[64186,1,"\u8AF8"],[64187,1,"\u8ACB"],[64188,1,"\u8B01"],[64189,1,"\u8AFE"],[64190,1,"\u8AED"],[64191,1,"\u8B39"],[64192,1,"\u8B8A"],[64193,1,"\u8D08"],[64194,1,"\u8F38"],[64195,1,"\u9072"],[64196,1,"\u9199"],[64197,1,"\u9276"],[64198,1,"\u967C"],[64199,1,"\u96E3"],[64200,1,"\u9756"],[64201,1,"\u97DB"],[64202,1,"\u97FF"],[64203,1,"\u980B"],[64204,1,"\u983B"],[64205,1,"\u9B12"],[64206,1,"\u9F9C"],[64207,1,"\uD84A\uDC4A"],[64208,1,"\uD84A\uDC44"],[64209,1,"\uD84C\uDFD5"],[64210,1,"\u3B9D"],[64211,1,"\u4018"],[64212,1,"\u4039"],[64213,1,"\uD854\uDE49"],[64214,1,"\uD857\uDCD0"],[64215,1,"\uD85F\uDED3"],[64216,1,"\u9F43"],[64217,1,"\u9F8E"],[[64218,64255],3],[64256,1,"ff"],[64257,1,"fi"],[64258,1,"fl"],[64259,1,"ffi"],[64260,1,"ffl"],[[64261,64262],1,"st"],[[64263,64274],3],[64275,1,"\u0574\u0576"],[64276,1,"\u0574\u0565"],[64277,1,"\u0574\u056B"],[64278,1,"\u057E\u0576"],[64279,1,"\u0574\u056D"],[[64280,64284],3],[64285,1,"\u05D9\u05B4"],[64286,2],[64287,1,"\u05F2\u05B7"],[64288,1,"\u05E2"],[64289,1,"\u05D0"],[64290,1,"\u05D3"],[64291,1,"\u05D4"],[64292,1,"\u05DB"],[64293,1,"\u05DC"],[64294,1,"\u05DD"],[64295,1,"\u05E8"],[64296,1,"\u05EA"],[64297,1,"+"],[64298,1,"\u05E9\u05C1"],[64299,1,"\u05E9\u05C2"],[64300,1,"\u05E9\u05BC\u05C1"],[64301,1,"\u05E9\u05BC\u05C2"],[64302,1,"\u05D0\u05B7"],[64303,1,"\u05D0\u05B8"],[64304,1,"\u05D0\u05BC"],[64305,1,"\u05D1\u05BC"],[64306,1,"\u05D2\u05BC"],[64307,1,"\u05D3\u05BC"],[64308,1,"\u05D4\u05BC"],[64309,1,"\u05D5\u05BC"],[64310,1,"\u05D6\u05BC"],[64311,3],[64312,1,"\u05D8\u05BC"],[64313,1,"\u05D9\u05BC"],[64314,1,"\u05DA\u05BC"],[64315,1,"\u05DB\u05BC"],[64316,1,"\u05DC\u05BC"],[64317,3],[64318,1,"\u05DE\u05BC"],[64319,3],[64320,1,"\u05E0\u05BC"],[64321,1,"\u05E1\u05BC"],[64322,3],[64323,1,"\u05E3\u05BC"],[64324,1,"\u05E4\u05BC"],[64325,3],[64326,1,"\u05E6\u05BC"],[64327,1,"\u05E7\u05BC"],[64328,1,"\u05E8\u05BC"],[64329,1,"\u05E9\u05BC"],[64330,1,"\u05EA\u05BC"],[64331,1,"\u05D5\u05B9"],[64332,1,"\u05D1\u05BF"],[64333,1,"\u05DB\u05BF"],[64334,1,"\u05E4\u05BF"],[64335,1,"\u05D0\u05DC"],[[64336,64337],1,"\u0671"],[[64338,64341],1,"\u067B"],[[64342,64345],1,"\u067E"],[[64346,64349],1,"\u0680"],[[64350,64353],1,"\u067A"],[[64354,64357],1,"\u067F"],[[64358,64361],1,"\u0679"],[[64362,64365],1,"\u06A4"],[[64366,64369],1,"\u06A6"],[[64370,64373],1,"\u0684"],[[64374,64377],1,"\u0683"],[[64378,64381],1,"\u0686"],[[64382,64385],1,"\u0687"],[[64386,64387],1,"\u068D"],[[64388,64389],1,"\u068C"],[[64390,64391],1,"\u068E"],[[64392,64393],1,"\u0688"],[[64394,64395],1,"\u0698"],[[64396,64397],1,"\u0691"],[[64398,64401],1,"\u06A9"],[[64402,64405],1,"\u06AF"],[[64406,64409],1,"\u06B3"],[[64410,64413],1,"\u06B1"],[[64414,64415],1,"\u06BA"],[[64416,64419],1,"\u06BB"],[[64420,64421],1,"\u06C0"],[[64422,64425],1,"\u06C1"],[[64426,64429],1,"\u06BE"],[[64430,64431],1,"\u06D2"],[[64432,64433],1,"\u06D3"],[[64434,64449],2],[64450,2],[[64451,64466],2],[[64467,64470],1,"\u06AD"],[[64471,64472],1,"\u06C7"],[[64473,64474],1,"\u06C6"],[[64475,64476],1,"\u06C8"],[64477,1,"\u06C7\u0674"],[[64478,64479],1,"\u06CB"],[[64480,64481],1,"\u06C5"],[[64482,64483],1,"\u06C9"],[[64484,64487],1,"\u06D0"],[[64488,64489],1,"\u0649"],[[64490,64491],1,"\u0626\u0627"],[[64492,64493],1,"\u0626\u06D5"],[[64494,64495],1,"\u0626\u0648"],[[64496,64497],1,"\u0626\u06C7"],[[64498,64499],1,"\u0626\u06C6"],[[64500,64501],1,"\u0626\u06C8"],[[64502,64504],1,"\u0626\u06D0"],[[64505,64507],1,"\u0626\u0649"],[[64508,64511],1,"\u06CC"],[64512,1,"\u0626\u062C"],[64513,1,"\u0626\u062D"],[64514,1,"\u0626\u0645"],[64515,1,"\u0626\u0649"],[64516,1,"\u0626\u064A"],[64517,1,"\u0628\u062C"],[64518,1,"\u0628\u062D"],[64519,1,"\u0628\u062E"],[64520,1,"\u0628\u0645"],[64521,1,"\u0628\u0649"],[64522,1,"\u0628\u064A"],[64523,1,"\u062A\u062C"],[64524,1,"\u062A\u062D"],[64525,1,"\u062A\u062E"],[64526,1,"\u062A\u0645"],[64527,1,"\u062A\u0649"],[64528,1,"\u062A\u064A"],[64529,1,"\u062B\u062C"],[64530,1,"\u062B\u0645"],[64531,1,"\u062B\u0649"],[64532,1,"\u062B\u064A"],[64533,1,"\u062C\u062D"],[64534,1,"\u062C\u0645"],[64535,1,"\u062D\u062C"],[64536,1,"\u062D\u0645"],[64537,1,"\u062E\u062C"],[64538,1,"\u062E\u062D"],[64539,1,"\u062E\u0645"],[64540,1,"\u0633\u062C"],[64541,1,"\u0633\u062D"],[64542,1,"\u0633\u062E"],[64543,1,"\u0633\u0645"],[64544,1,"\u0635\u062D"],[64545,1,"\u0635\u0645"],[64546,1,"\u0636\u062C"],[64547,1,"\u0636\u062D"],[64548,1,"\u0636\u062E"],[64549,1,"\u0636\u0645"],[64550,1,"\u0637\u062D"],[64551,1,"\u0637\u0645"],[64552,1,"\u0638\u0645"],[64553,1,"\u0639\u062C"],[64554,1,"\u0639\u0645"],[64555,1,"\u063A\u062C"],[64556,1,"\u063A\u0645"],[64557,1,"\u0641\u062C"],[64558,1,"\u0641\u062D"],[64559,1,"\u0641\u062E"],[64560,1,"\u0641\u0645"],[64561,1,"\u0641\u0649"],[64562,1,"\u0641\u064A"],[64563,1,"\u0642\u062D"],[64564,1,"\u0642\u0645"],[64565,1,"\u0642\u0649"],[64566,1,"\u0642\u064A"],[64567,1,"\u0643\u0627"],[64568,1,"\u0643\u062C"],[64569,1,"\u0643\u062D"],[64570,1,"\u0643\u062E"],[64571,1,"\u0643\u0644"],[64572,1,"\u0643\u0645"],[64573,1,"\u0643\u0649"],[64574,1,"\u0643\u064A"],[64575,1,"\u0644\u062C"],[64576,1,"\u0644\u062D"],[64577,1,"\u0644\u062E"],[64578,1,"\u0644\u0645"],[64579,1,"\u0644\u0649"],[64580,1,"\u0644\u064A"],[64581,1,"\u0645\u062C"],[64582,1,"\u0645\u062D"],[64583,1,"\u0645\u062E"],[64584,1,"\u0645\u0645"],[64585,1,"\u0645\u0649"],[64586,1,"\u0645\u064A"],[64587,1,"\u0646\u062C"],[64588,1,"\u0646\u062D"],[64589,1,"\u0646\u062E"],[64590,1,"\u0646\u0645"],[64591,1,"\u0646\u0649"],[64592,1,"\u0646\u064A"],[64593,1,"\u0647\u062C"],[64594,1,"\u0647\u0645"],[64595,1,"\u0647\u0649"],[64596,1,"\u0647\u064A"],[64597,1,"\u064A\u062C"],[64598,1,"\u064A\u062D"],[64599,1,"\u064A\u062E"],[64600,1,"\u064A\u0645"],[64601,1,"\u064A\u0649"],[64602,1,"\u064A\u064A"],[64603,1,"\u0630\u0670"],[64604,1,"\u0631\u0670"],[64605,1,"\u0649\u0670"],[64606,1," \u064C\u0651"],[64607,1," \u064D\u0651"],[64608,1," \u064E\u0651"],[64609,1," \u064F\u0651"],[64610,1," \u0650\u0651"],[64611,1," \u0651\u0670"],[64612,1,"\u0626\u0631"],[64613,1,"\u0626\u0632"],[64614,1,"\u0626\u0645"],[64615,1,"\u0626\u0646"],[64616,1,"\u0626\u0649"],[64617,1,"\u0626\u064A"],[64618,1,"\u0628\u0631"],[64619,1,"\u0628\u0632"],[64620,1,"\u0628\u0645"],[64621,1,"\u0628\u0646"],[64622,1,"\u0628\u0649"],[64623,1,"\u0628\u064A"],[64624,1,"\u062A\u0631"],[64625,1,"\u062A\u0632"],[64626,1,"\u062A\u0645"],[64627,1,"\u062A\u0646"],[64628,1,"\u062A\u0649"],[64629,1,"\u062A\u064A"],[64630,1,"\u062B\u0631"],[64631,1,"\u062B\u0632"],[64632,1,"\u062B\u0645"],[64633,1,"\u062B\u0646"],[64634,1,"\u062B\u0649"],[64635,1,"\u062B\u064A"],[64636,1,"\u0641\u0649"],[64637,1,"\u0641\u064A"],[64638,1,"\u0642\u0649"],[64639,1,"\u0642\u064A"],[64640,1,"\u0643\u0627"],[64641,1,"\u0643\u0644"],[64642,1,"\u0643\u0645"],[64643,1,"\u0643\u0649"],[64644,1,"\u0643\u064A"],[64645,1,"\u0644\u0645"],[64646,1,"\u0644\u0649"],[64647,1,"\u0644\u064A"],[64648,1,"\u0645\u0627"],[64649,1,"\u0645\u0645"],[64650,1,"\u0646\u0631"],[64651,1,"\u0646\u0632"],[64652,1,"\u0646\u0645"],[64653,1,"\u0646\u0646"],[64654,1,"\u0646\u0649"],[64655,1,"\u0646\u064A"],[64656,1,"\u0649\u0670"],[64657,1,"\u064A\u0631"],[64658,1,"\u064A\u0632"],[64659,1,"\u064A\u0645"],[64660,1,"\u064A\u0646"],[64661,1,"\u064A\u0649"],[64662,1,"\u064A\u064A"],[64663,1,"\u0626\u062C"],[64664,1,"\u0626\u062D"],[64665,1,"\u0626\u062E"],[64666,1,"\u0626\u0645"],[64667,1,"\u0626\u0647"],[64668,1,"\u0628\u062C"],[64669,1,"\u0628\u062D"],[64670,1,"\u0628\u062E"],[64671,1,"\u0628\u0645"],[64672,1,"\u0628\u0647"],[64673,1,"\u062A\u062C"],[64674,1,"\u062A\u062D"],[64675,1,"\u062A\u062E"],[64676,1,"\u062A\u0645"],[64677,1,"\u062A\u0647"],[64678,1,"\u062B\u0645"],[64679,1,"\u062C\u062D"],[64680,1,"\u062C\u0645"],[64681,1,"\u062D\u062C"],[64682,1,"\u062D\u0645"],[64683,1,"\u062E\u062C"],[64684,1,"\u062E\u0645"],[64685,1,"\u0633\u062C"],[64686,1,"\u0633\u062D"],[64687,1,"\u0633\u062E"],[64688,1,"\u0633\u0645"],[64689,1,"\u0635\u062D"],[64690,1,"\u0635\u062E"],[64691,1,"\u0635\u0645"],[64692,1,"\u0636\u062C"],[64693,1,"\u0636\u062D"],[64694,1,"\u0636\u062E"],[64695,1,"\u0636\u0645"],[64696,1,"\u0637\u062D"],[64697,1,"\u0638\u0645"],[64698,1,"\u0639\u062C"],[64699,1,"\u0639\u0645"],[64700,1,"\u063A\u062C"],[64701,1,"\u063A\u0645"],[64702,1,"\u0641\u062C"],[64703,1,"\u0641\u062D"],[64704,1,"\u0641\u062E"],[64705,1,"\u0641\u0645"],[64706,1,"\u0642\u062D"],[64707,1,"\u0642\u0645"],[64708,1,"\u0643\u062C"],[64709,1,"\u0643\u062D"],[64710,1,"\u0643\u062E"],[64711,1,"\u0643\u0644"],[64712,1,"\u0643\u0645"],[64713,1,"\u0644\u062C"],[64714,1,"\u0644\u062D"],[64715,1,"\u0644\u062E"],[64716,1,"\u0644\u0645"],[64717,1,"\u0644\u0647"],[64718,1,"\u0645\u062C"],[64719,1,"\u0645\u062D"],[64720,1,"\u0645\u062E"],[64721,1,"\u0645\u0645"],[64722,1,"\u0646\u062C"],[64723,1,"\u0646\u062D"],[64724,1,"\u0646\u062E"],[64725,1,"\u0646\u0645"],[64726,1,"\u0646\u0647"],[64727,1,"\u0647\u062C"],[64728,1,"\u0647\u0645"],[64729,1,"\u0647\u0670"],[64730,1,"\u064A\u062C"],[64731,1,"\u064A\u062D"],[64732,1,"\u064A\u062E"],[64733,1,"\u064A\u0645"],[64734,1,"\u064A\u0647"],[64735,1,"\u0626\u0645"],[64736,1,"\u0626\u0647"],[64737,1,"\u0628\u0645"],[64738,1,"\u0628\u0647"],[64739,1,"\u062A\u0645"],[64740,1,"\u062A\u0647"],[64741,1,"\u062B\u0645"],[64742,1,"\u062B\u0647"],[64743,1,"\u0633\u0645"],[64744,1,"\u0633\u0647"],[64745,1,"\u0634\u0645"],[64746,1,"\u0634\u0647"],[64747,1,"\u0643\u0644"],[64748,1,"\u0643\u0645"],[64749,1,"\u0644\u0645"],[64750,1,"\u0646\u0645"],[64751,1,"\u0646\u0647"],[64752,1,"\u064A\u0645"],[64753,1,"\u064A\u0647"],[64754,1,"\u0640\u064E\u0651"],[64755,1,"\u0640\u064F\u0651"],[64756,1,"\u0640\u0650\u0651"],[64757,1,"\u0637\u0649"],[64758,1,"\u0637\u064A"],[64759,1,"\u0639\u0649"],[64760,1,"\u0639\u064A"],[64761,1,"\u063A\u0649"],[64762,1,"\u063A\u064A"],[64763,1,"\u0633\u0649"],[64764,1,"\u0633\u064A"],[64765,1,"\u0634\u0649"],[64766,1,"\u0634\u064A"],[64767,1,"\u062D\u0649"],[64768,1,"\u062D\u064A"],[64769,1,"\u062C\u0649"],[64770,1,"\u062C\u064A"],[64771,1,"\u062E\u0649"],[64772,1,"\u062E\u064A"],[64773,1,"\u0635\u0649"],[64774,1,"\u0635\u064A"],[64775,1,"\u0636\u0649"],[64776,1,"\u0636\u064A"],[64777,1,"\u0634\u062C"],[64778,1,"\u0634\u062D"],[64779,1,"\u0634\u062E"],[64780,1,"\u0634\u0645"],[64781,1,"\u0634\u0631"],[64782,1,"\u0633\u0631"],[64783,1,"\u0635\u0631"],[64784,1,"\u0636\u0631"],[64785,1,"\u0637\u0649"],[64786,1,"\u0637\u064A"],[64787,1,"\u0639\u0649"],[64788,1,"\u0639\u064A"],[64789,1,"\u063A\u0649"],[64790,1,"\u063A\u064A"],[64791,1,"\u0633\u0649"],[64792,1,"\u0633\u064A"],[64793,1,"\u0634\u0649"],[64794,1,"\u0634\u064A"],[64795,1,"\u062D\u0649"],[64796,1,"\u062D\u064A"],[64797,1,"\u062C\u0649"],[64798,1,"\u062C\u064A"],[64799,1,"\u062E\u0649"],[64800,1,"\u062E\u064A"],[64801,1,"\u0635\u0649"],[64802,1,"\u0635\u064A"],[64803,1,"\u0636\u0649"],[64804,1,"\u0636\u064A"],[64805,1,"\u0634\u062C"],[64806,1,"\u0634\u062D"],[64807,1,"\u0634\u062E"],[64808,1,"\u0634\u0645"],[64809,1,"\u0634\u0631"],[64810,1,"\u0633\u0631"],[64811,1,"\u0635\u0631"],[64812,1,"\u0636\u0631"],[64813,1,"\u0634\u062C"],[64814,1,"\u0634\u062D"],[64815,1,"\u0634\u062E"],[64816,1,"\u0634\u0645"],[64817,1,"\u0633\u0647"],[64818,1,"\u0634\u0647"],[64819,1,"\u0637\u0645"],[64820,1,"\u0633\u062C"],[64821,1,"\u0633\u062D"],[64822,1,"\u0633\u062E"],[64823,1,"\u0634\u062C"],[64824,1,"\u0634\u062D"],[64825,1,"\u0634\u062E"],[64826,1,"\u0637\u0645"],[64827,1,"\u0638\u0645"],[[64828,64829],1,"\u0627\u064B"],[[64830,64831],2],[[64832,64847],2],[64848,1,"\u062A\u062C\u0645"],[[64849,64850],1,"\u062A\u062D\u062C"],[64851,1,"\u062A\u062D\u0645"],[64852,1,"\u062A\u062E\u0645"],[64853,1,"\u062A\u0645\u062C"],[64854,1,"\u062A\u0645\u062D"],[64855,1,"\u062A\u0645\u062E"],[[64856,64857],1,"\u062C\u0645\u062D"],[64858,1,"\u062D\u0645\u064A"],[64859,1,"\u062D\u0645\u0649"],[64860,1,"\u0633\u062D\u062C"],[64861,1,"\u0633\u062C\u062D"],[64862,1,"\u0633\u062C\u0649"],[[64863,64864],1,"\u0633\u0645\u062D"],[64865,1,"\u0633\u0645\u062C"],[[64866,64867],1,"\u0633\u0645\u0645"],[[64868,64869],1,"\u0635\u062D\u062D"],[64870,1,"\u0635\u0645\u0645"],[[64871,64872],1,"\u0634\u062D\u0645"],[64873,1,"\u0634\u062C\u064A"],[[64874,64875],1,"\u0634\u0645\u062E"],[[64876,64877],1,"\u0634\u0645\u0645"],[64878,1,"\u0636\u062D\u0649"],[[64879,64880],1,"\u0636\u062E\u0645"],[[64881,64882],1,"\u0637\u0645\u062D"],[64883,1,"\u0637\u0645\u0645"],[64884,1,"\u0637\u0645\u064A"],[64885,1,"\u0639\u062C\u0645"],[[64886,64887],1,"\u0639\u0645\u0645"],[64888,1,"\u0639\u0645\u0649"],[64889,1,"\u063A\u0645\u0645"],[64890,1,"\u063A\u0645\u064A"],[64891,1,"\u063A\u0645\u0649"],[[64892,64893],1,"\u0641\u062E\u0645"],[64894,1,"\u0642\u0645\u062D"],[64895,1,"\u0642\u0645\u0645"],[64896,1,"\u0644\u062D\u0645"],[64897,1,"\u0644\u062D\u064A"],[64898,1,"\u0644\u062D\u0649"],[[64899,64900],1,"\u0644\u062C\u062C"],[[64901,64902],1,"\u0644\u062E\u0645"],[[64903,64904],1,"\u0644\u0645\u062D"],[64905,1,"\u0645\u062D\u062C"],[64906,1,"\u0645\u062D\u0645"],[64907,1,"\u0645\u062D\u064A"],[64908,1,"\u0645\u062C\u062D"],[64909,1,"\u0645\u062C\u0645"],[64910,1,"\u0645\u062E\u062C"],[64911,1,"\u0645\u062E\u0645"],[[64912,64913],2],[64914,1,"\u0645\u062C\u062E"],[64915,1,"\u0647\u0645\u062C"],[64916,1,"\u0647\u0645\u0645"],[64917,1,"\u0646\u062D\u0645"],[64918,1,"\u0646\u062D\u0649"],[[64919,64920],1,"\u0646\u062C\u0645"],[64921,1,"\u0646\u062C\u0649"],[64922,1,"\u0646\u0645\u064A"],[64923,1,"\u0646\u0645\u0649"],[[64924,64925],1,"\u064A\u0645\u0645"],[64926,1,"\u0628\u062E\u064A"],[64927,1,"\u062A\u062C\u064A"],[64928,1,"\u062A\u062C\u0649"],[64929,1,"\u062A\u062E\u064A"],[64930,1,"\u062A\u062E\u0649"],[64931,1,"\u062A\u0645\u064A"],[64932,1,"\u062A\u0645\u0649"],[64933,1,"\u062C\u0645\u064A"],[64934,1,"\u062C\u062D\u0649"],[64935,1,"\u062C\u0645\u0649"],[64936,1,"\u0633\u062E\u0649"],[64937,1,"\u0635\u062D\u064A"],[64938,1,"\u0634\u062D\u064A"],[64939,1,"\u0636\u062D\u064A"],[64940,1,"\u0644\u062C\u064A"],[64941,1,"\u0644\u0645\u064A"],[64942,1,"\u064A\u062D\u064A"],[64943,1,"\u064A\u062C\u064A"],[64944,1,"\u064A\u0645\u064A"],[64945,1,"\u0645\u0645\u064A"],[64946,1,"\u0642\u0645\u064A"],[64947,1,"\u0646\u062D\u064A"],[64948,1,"\u0642\u0645\u062D"],[64949,1,"\u0644\u062D\u0645"],[64950,1,"\u0639\u0645\u064A"],[64951,1,"\u0643\u0645\u064A"],[64952,1,"\u0646\u062C\u062D"],[64953,1,"\u0645\u062E\u064A"],[64954,1,"\u0644\u062C\u0645"],[64955,1,"\u0643\u0645\u0645"],[64956,1,"\u0644\u062C\u0645"],[64957,1,"\u0646\u062C\u062D"],[64958,1,"\u062C\u062D\u064A"],[64959,1,"\u062D\u062C\u064A"],[64960,1,"\u0645\u062C\u064A"],[64961,1,"\u0641\u0645\u064A"],[64962,1,"\u0628\u062D\u064A"],[64963,1,"\u0643\u0645\u0645"],[64964,1,"\u0639\u062C\u0645"],[64965,1,"\u0635\u0645\u0645"],[64966,1,"\u0633\u062E\u064A"],[64967,1,"\u0646\u062C\u064A"],[[64968,64974],2],[64975,2],[[64976,65007],3],[65008,1,"\u0635\u0644\u06D2"],[65009,1,"\u0642\u0644\u06D2"],[65010,1,"\u0627\u0644\u0644\u0647"],[65011,1,"\u0627\u0643\u0628\u0631"],[65012,1,"\u0645\u062D\u0645\u062F"],[65013,1,"\u0635\u0644\u0639\u0645"],[65014,1,"\u0631\u0633\u0648\u0644"],[65015,1,"\u0639\u0644\u064A\u0647"],[65016,1,"\u0648\u0633\u0644\u0645"],[65017,1,"\u0635\u0644\u0649"],[65018,1,"\u0635\u0644\u0649 \u0627\u0644\u0644\u0647 \u0639\u0644\u064A\u0647 \u0648\u0633\u0644\u0645"],[65019,1,"\u062C\u0644 \u062C\u0644\u0627\u0644\u0647"],[65020,1,"\u0631\u06CC\u0627\u0644"],[65021,2],[[65022,65023],2],[[65024,65039],7],[65040,1,","],[65041,1,"\u3001"],[65042,3],[65043,1,":"],[65044,1,";"],[65045,1,"!"],[65046,1,"?"],[65047,1,"\u3016"],[65048,1,"\u3017"],[65049,3],[[65050,65055],3],[[65056,65059],2],[[65060,65062],2],[[65063,65069],2],[[65070,65071],2],[65072,3],[65073,1,"\u2014"],[65074,1,"\u2013"],[[65075,65076],1,"_"],[65077,1,"("],[65078,1,")"],[65079,1,"{"],[65080,1,"}"],[65081,1,"\u3014"],[65082,1,"\u3015"],[65083,1,"\u3010"],[65084,1,"\u3011"],[65085,1,"\u300A"],[65086,1,"\u300B"],[65087,1,"\u3008"],[65088,1,"\u3009"],[65089,1,"\u300C"],[65090,1,"\u300D"],[65091,1,"\u300E"],[65092,1,"\u300F"],[[65093,65094],2],[65095,1,"["],[65096,1,"]"],[[65097,65100],1," \u0305"],[[65101,65103],1,"_"],[65104,1,","],[65105,1,"\u3001"],[65106,3],[65107,3],[65108,1,";"],[65109,1,":"],[65110,1,"?"],[65111,1,"!"],[65112,1,"\u2014"],[65113,1,"("],[65114,1,")"],[65115,1,"{"],[65116,1,"}"],[65117,1,"\u3014"],[65118,1,"\u3015"],[65119,1,"#"],[65120,1,"&"],[65121,1,"*"],[65122,1,"+"],[65123,1,"-"],[65124,1,"<"],[65125,1,">"],[65126,1,"="],[65127,3],[65128,1,"\\"],[65129,1,"$"],[65130,1,"%"],[65131,1,"@"],[[65132,65135],3],[65136,1," \u064B"],[65137,1,"\u0640\u064B"],[65138,1," \u064C"],[65139,2],[65140,1," \u064D"],[65141,3],[65142,1," \u064E"],[65143,1,"\u0640\u064E"],[65144,1," \u064F"],[65145,1,"\u0640\u064F"],[65146,1," \u0650"],[65147,1,"\u0640\u0650"],[65148,1," \u0651"],[65149,1,"\u0640\u0651"],[65150,1," \u0652"],[65151,1,"\u0640\u0652"],[65152,1,"\u0621"],[[65153,65154],1,"\u0622"],[[65155,65156],1,"\u0623"],[[65157,65158],1,"\u0624"],[[65159,65160],1,"\u0625"],[[65161,65164],1,"\u0626"],[[65165,65166],1,"\u0627"],[[65167,65170],1,"\u0628"],[[65171,65172],1,"\u0629"],[[65173,65176],1,"\u062A"],[[65177,65180],1,"\u062B"],[[65181,65184],1,"\u062C"],[[65185,65188],1,"\u062D"],[[65189,65192],1,"\u062E"],[[65193,65194],1,"\u062F"],[[65195,65196],1,"\u0630"],[[65197,65198],1,"\u0631"],[[65199,65200],1,"\u0632"],[[65201,65204],1,"\u0633"],[[65205,65208],1,"\u0634"],[[65209,65212],1,"\u0635"],[[65213,65216],1,"\u0636"],[[65217,65220],1,"\u0637"],[[65221,65224],1,"\u0638"],[[65225,65228],1,"\u0639"],[[65229,65232],1,"\u063A"],[[65233,65236],1,"\u0641"],[[65237,65240],1,"\u0642"],[[65241,65244],1,"\u0643"],[[65245,65248],1,"\u0644"],[[65249,65252],1,"\u0645"],[[65253,65256],1,"\u0646"],[[65257,65260],1,"\u0647"],[[65261,65262],1,"\u0648"],[[65263,65264],1,"\u0649"],[[65265,65268],1,"\u064A"],[[65269,65270],1,"\u0644\u0622"],[[65271,65272],1,"\u0644\u0623"],[[65273,65274],1,"\u0644\u0625"],[[65275,65276],1,"\u0644\u0627"],[[65277,65278],3],[65279,7],[65280,3],[65281,1,"!"],[65282,1,'"'],[65283,1,"#"],[65284,1,"$"],[65285,1,"%"],[65286,1,"&"],[65287,1,"'"],[65288,1,"("],[65289,1,")"],[65290,1,"*"],[65291,1,"+"],[65292,1,","],[65293,1,"-"],[65294,1,"."],[65295,1,"/"],[65296,1,"0"],[65297,1,"1"],[65298,1,"2"],[65299,1,"3"],[65300,1,"4"],[65301,1,"5"],[65302,1,"6"],[65303,1,"7"],[65304,1,"8"],[65305,1,"9"],[65306,1,":"],[65307,1,";"],[65308,1,"<"],[65309,1,"="],[65310,1,">"],[65311,1,"?"],[65312,1,"@"],[65313,1,"a"],[65314,1,"b"],[65315,1,"c"],[65316,1,"d"],[65317,1,"e"],[65318,1,"f"],[65319,1,"g"],[65320,1,"h"],[65321,1,"i"],[65322,1,"j"],[65323,1,"k"],[65324,1,"l"],[65325,1,"m"],[65326,1,"n"],[65327,1,"o"],[65328,1,"p"],[65329,1,"q"],[65330,1,"r"],[65331,1,"s"],[65332,1,"t"],[65333,1,"u"],[65334,1,"v"],[65335,1,"w"],[65336,1,"x"],[65337,1,"y"],[65338,1,"z"],[65339,1,"["],[65340,1,"\\"],[65341,1,"]"],[65342,1,"^"],[65343,1,"_"],[65344,1,"`"],[65345,1,"a"],[65346,1,"b"],[65347,1,"c"],[65348,1,"d"],[65349,1,"e"],[65350,1,"f"],[65351,1,"g"],[65352,1,"h"],[65353,1,"i"],[65354,1,"j"],[65355,1,"k"],[65356,1,"l"],[65357,1,"m"],[65358,1,"n"],[65359,1,"o"],[65360,1,"p"],[65361,1,"q"],[65362,1,"r"],[65363,1,"s"],[65364,1,"t"],[65365,1,"u"],[65366,1,"v"],[65367,1,"w"],[65368,1,"x"],[65369,1,"y"],[65370,1,"z"],[65371,1,"{"],[65372,1,"|"],[65373,1,"}"],[65374,1,"~"],[65375,1,"\u2985"],[65376,1,"\u2986"],[65377,1,"."],[65378,1,"\u300C"],[65379,1,"\u300D"],[65380,1,"\u3001"],[65381,1,"\u30FB"],[65382,1,"\u30F2"],[65383,1,"\u30A1"],[65384,1,"\u30A3"],[65385,1,"\u30A5"],[65386,1,"\u30A7"],[65387,1,"\u30A9"],[65388,1,"\u30E3"],[65389,1,"\u30E5"],[65390,1,"\u30E7"],[65391,1,"\u30C3"],[65392,1,"\u30FC"],[65393,1,"\u30A2"],[65394,1,"\u30A4"],[65395,1,"\u30A6"],[65396,1,"\u30A8"],[65397,1,"\u30AA"],[65398,1,"\u30AB"],[65399,1,"\u30AD"],[65400,1,"\u30AF"],[65401,1,"\u30B1"],[65402,1,"\u30B3"],[65403,1,"\u30B5"],[65404,1,"\u30B7"],[65405,1,"\u30B9"],[65406,1,"\u30BB"],[65407,1,"\u30BD"],[65408,1,"\u30BF"],[65409,1,"\u30C1"],[65410,1,"\u30C4"],[65411,1,"\u30C6"],[65412,1,"\u30C8"],[65413,1,"\u30CA"],[65414,1,"\u30CB"],[65415,1,"\u30CC"],[65416,1,"\u30CD"],[65417,1,"\u30CE"],[65418,1,"\u30CF"],[65419,1,"\u30D2"],[65420,1,"\u30D5"],[65421,1,"\u30D8"],[65422,1,"\u30DB"],[65423,1,"\u30DE"],[65424,1,"\u30DF"],[65425,1,"\u30E0"],[65426,1,"\u30E1"],[65427,1,"\u30E2"],[65428,1,"\u30E4"],[65429,1,"\u30E6"],[65430,1,"\u30E8"],[65431,1,"\u30E9"],[65432,1,"\u30EA"],[65433,1,"\u30EB"],[65434,1,"\u30EC"],[65435,1,"\u30ED"],[65436,1,"\u30EF"],[65437,1,"\u30F3"],[65438,1,"\u3099"],[65439,1,"\u309A"],[65440,7],[65441,1,"\u1100"],[65442,1,"\u1101"],[65443,1,"\u11AA"],[65444,1,"\u1102"],[65445,1,"\u11AC"],[65446,1,"\u11AD"],[65447,1,"\u1103"],[65448,1,"\u1104"],[65449,1,"\u1105"],[65450,1,"\u11B0"],[65451,1,"\u11B1"],[65452,1,"\u11B2"],[65453,1,"\u11B3"],[65454,1,"\u11B4"],[65455,1,"\u11B5"],[65456,1,"\u111A"],[65457,1,"\u1106"],[65458,1,"\u1107"],[65459,1,"\u1108"],[65460,1,"\u1121"],[65461,1,"\u1109"],[65462,1,"\u110A"],[65463,1,"\u110B"],[65464,1,"\u110C"],[65465,1,"\u110D"],[65466,1,"\u110E"],[65467,1,"\u110F"],[65468,1,"\u1110"],[65469,1,"\u1111"],[65470,1,"\u1112"],[[65471,65473],3],[65474,1,"\u1161"],[65475,1,"\u1162"],[65476,1,"\u1163"],[65477,1,"\u1164"],[65478,1,"\u1165"],[65479,1,"\u1166"],[[65480,65481],3],[65482,1,"\u1167"],[65483,1,"\u1168"],[65484,1,"\u1169"],[65485,1,"\u116A"],[65486,1,"\u116B"],[65487,1,"\u116C"],[[65488,65489],3],[65490,1,"\u116D"],[65491,1,"\u116E"],[65492,1,"\u116F"],[65493,1,"\u1170"],[65494,1,"\u1171"],[65495,1,"\u1172"],[[65496,65497],3],[65498,1,"\u1173"],[65499,1,"\u1174"],[65500,1,"\u1175"],[[65501,65503],3],[65504,1,"\xA2"],[65505,1,"\xA3"],[65506,1,"\xAC"],[65507,1," \u0304"],[65508,1,"\xA6"],[65509,1,"\xA5"],[65510,1,"\u20A9"],[65511,3],[65512,1,"\u2502"],[65513,1,"\u2190"],[65514,1,"\u2191"],[65515,1,"\u2192"],[65516,1,"\u2193"],[65517,1,"\u25A0"],[65518,1,"\u25CB"],[[65519,65528],3],[[65529,65531],3],[65532,3],[65533,3],[[65534,65535],3],[[65536,65547],2],[65548,3],[[65549,65574],2],[65575,3],[[65576,65594],2],[65595,3],[[65596,65597],2],[65598,3],[[65599,65613],2],[[65614,65615],3],[[65616,65629],2],[[65630,65663],3],[[65664,65786],2],[[65787,65791],3],[[65792,65794],2],[[65795,65798],3],[[65799,65843],2],[[65844,65846],3],[[65847,65855],2],[[65856,65930],2],[[65931,65932],2],[[65933,65934],2],[65935,3],[[65936,65947],2],[65948,2],[[65949,65951],3],[65952,2],[[65953,65999],3],[[66000,66044],2],[66045,2],[[66046,66175],3],[[66176,66204],2],[[66205,66207],3],[[66208,66256],2],[[66257,66271],3],[66272,2],[[66273,66299],2],[[66300,66303],3],[[66304,66334],2],[66335,2],[[66336,66339],2],[[66340,66348],3],[[66349,66351],2],[[66352,66368],2],[66369,2],[[66370,66377],2],[66378,2],[[66379,66383],3],[[66384,66426],2],[[66427,66431],3],[[66432,66461],2],[66462,3],[66463,2],[[66464,66499],2],[[66500,66503],3],[[66504,66511],2],[[66512,66517],2],[[66518,66559],3],[66560,1,"\uD801\uDC28"],[66561,1,"\uD801\uDC29"],[66562,1,"\uD801\uDC2A"],[66563,1,"\uD801\uDC2B"],[66564,1,"\uD801\uDC2C"],[66565,1,"\uD801\uDC2D"],[66566,1,"\uD801\uDC2E"],[66567,1,"\uD801\uDC2F"],[66568,1,"\uD801\uDC30"],[66569,1,"\uD801\uDC31"],[66570,1,"\uD801\uDC32"],[66571,1,"\uD801\uDC33"],[66572,1,"\uD801\uDC34"],[66573,1,"\uD801\uDC35"],[66574,1,"\uD801\uDC36"],[66575,1,"\uD801\uDC37"],[66576,1,"\uD801\uDC38"],[66577,1,"\uD801\uDC39"],[66578,1,"\uD801\uDC3A"],[66579,1,"\uD801\uDC3B"],[66580,1,"\uD801\uDC3C"],[66581,1,"\uD801\uDC3D"],[66582,1,"\uD801\uDC3E"],[66583,1,"\uD801\uDC3F"],[66584,1,"\uD801\uDC40"],[66585,1,"\uD801\uDC41"],[66586,1,"\uD801\uDC42"],[66587,1,"\uD801\uDC43"],[66588,1,"\uD801\uDC44"],[66589,1,"\uD801\uDC45"],[66590,1,"\uD801\uDC46"],[66591,1,"\uD801\uDC47"],[66592,1,"\uD801\uDC48"],[66593,1,"\uD801\uDC49"],[66594,1,"\uD801\uDC4A"],[66595,1,"\uD801\uDC4B"],[66596,1,"\uD801\uDC4C"],[66597,1,"\uD801\uDC4D"],[66598,1,"\uD801\uDC4E"],[66599,1,"\uD801\uDC4F"],[[66600,66637],2],[[66638,66717],2],[[66718,66719],3],[[66720,66729],2],[[66730,66735],3],[66736,1,"\uD801\uDCD8"],[66737,1,"\uD801\uDCD9"],[66738,1,"\uD801\uDCDA"],[66739,1,"\uD801\uDCDB"],[66740,1,"\uD801\uDCDC"],[66741,1,"\uD801\uDCDD"],[66742,1,"\uD801\uDCDE"],[66743,1,"\uD801\uDCDF"],[66744,1,"\uD801\uDCE0"],[66745,1,"\uD801\uDCE1"],[66746,1,"\uD801\uDCE2"],[66747,1,"\uD801\uDCE3"],[66748,1,"\uD801\uDCE4"],[66749,1,"\uD801\uDCE5"],[66750,1,"\uD801\uDCE6"],[66751,1,"\uD801\uDCE7"],[66752,1,"\uD801\uDCE8"],[66753,1,"\uD801\uDCE9"],[66754,1,"\uD801\uDCEA"],[66755,1,"\uD801\uDCEB"],[66756,1,"\uD801\uDCEC"],[66757,1,"\uD801\uDCED"],[66758,1,"\uD801\uDCEE"],[66759,1,"\uD801\uDCEF"],[66760,1,"\uD801\uDCF0"],[66761,1,"\uD801\uDCF1"],[66762,1,"\uD801\uDCF2"],[66763,1,"\uD801\uDCF3"],[66764,1,"\uD801\uDCF4"],[66765,1,"\uD801\uDCF5"],[66766,1,"\uD801\uDCF6"],[66767,1,"\uD801\uDCF7"],[66768,1,"\uD801\uDCF8"],[66769,1,"\uD801\uDCF9"],[66770,1,"\uD801\uDCFA"],[66771,1,"\uD801\uDCFB"],[[66772,66775],3],[[66776,66811],2],[[66812,66815],3],[[66816,66855],2],[[66856,66863],3],[[66864,66915],2],[[66916,66926],3],[66927,2],[66928,1,"\uD801\uDD97"],[66929,1,"\uD801\uDD98"],[66930,1,"\uD801\uDD99"],[66931,1,"\uD801\uDD9A"],[66932,1,"\uD801\uDD9B"],[66933,1,"\uD801\uDD9C"],[66934,1,"\uD801\uDD9D"],[66935,1,"\uD801\uDD9E"],[66936,1,"\uD801\uDD9F"],[66937,1,"\uD801\uDDA0"],[66938,1,"\uD801\uDDA1"],[66939,3],[66940,1,"\uD801\uDDA3"],[66941,1,"\uD801\uDDA4"],[66942,1,"\uD801\uDDA5"],[66943,1,"\uD801\uDDA6"],[66944,1,"\uD801\uDDA7"],[66945,1,"\uD801\uDDA8"],[66946,1,"\uD801\uDDA9"],[66947,1,"\uD801\uDDAA"],[66948,1,"\uD801\uDDAB"],[66949,1,"\uD801\uDDAC"],[66950,1,"\uD801\uDDAD"],[66951,1,"\uD801\uDDAE"],[66952,1,"\uD801\uDDAF"],[66953,1,"\uD801\uDDB0"],[66954,1,"\uD801\uDDB1"],[66955,3],[66956,1,"\uD801\uDDB3"],[66957,1,"\uD801\uDDB4"],[66958,1,"\uD801\uDDB5"],[66959,1,"\uD801\uDDB6"],[66960,1,"\uD801\uDDB7"],[66961,1,"\uD801\uDDB8"],[66962,1,"\uD801\uDDB9"],[66963,3],[66964,1,"\uD801\uDDBB"],[66965,1,"\uD801\uDDBC"],[66966,3],[[66967,66977],2],[66978,3],[[66979,66993],2],[66994,3],[[66995,67001],2],[67002,3],[[67003,67004],2],[[67005,67007],3],[[67008,67059],2],[[67060,67071],3],[[67072,67382],2],[[67383,67391],3],[[67392,67413],2],[[67414,67423],3],[[67424,67431],2],[[67432,67455],3],[67456,2],[67457,1,"\u02D0"],[67458,1,"\u02D1"],[67459,1,"\xE6"],[67460,1,"\u0299"],[67461,1,"\u0253"],[67462,3],[67463,1,"\u02A3"],[67464,1,"\uAB66"],[67465,1,"\u02A5"],[67466,1,"\u02A4"],[67467,1,"\u0256"],[67468,1,"\u0257"],[67469,1,"\u1D91"],[67470,1,"\u0258"],[67471,1,"\u025E"],[67472,1,"\u02A9"],[67473,1,"\u0264"],[67474,1,"\u0262"],[67475,1,"\u0260"],[67476,1,"\u029B"],[67477,1,"\u0127"],[67478,1,"\u029C"],[67479,1,"\u0267"],[67480,1,"\u0284"],[67481,1,"\u02AA"],[67482,1,"\u02AB"],[67483,1,"\u026C"],[67484,1,"\uD837\uDF04"],[67485,1,"\uA78E"],[67486,1,"\u026E"],[67487,1,"\uD837\uDF05"],[67488,1,"\u028E"],[67489,1,"\uD837\uDF06"],[67490,1,"\xF8"],[67491,1,"\u0276"],[67492,1,"\u0277"],[67493,1,"q"],[67494,1,"\u027A"],[67495,1,"\uD837\uDF08"],[67496,1,"\u027D"],[67497,1,"\u027E"],[67498,1,"\u0280"],[67499,1,"\u02A8"],[67500,1,"\u02A6"],[67501,1,"\uAB67"],[67502,1,"\u02A7"],[67503,1,"\u0288"],[67504,1,"\u2C71"],[67505,3],[67506,1,"\u028F"],[67507,1,"\u02A1"],[67508,1,"\u02A2"],[67509,1,"\u0298"],[67510,1,"\u01C0"],[67511,1,"\u01C1"],[67512,1,"\u01C2"],[67513,1,"\uD837\uDF0A"],[67514,1,"\uD837\uDF1E"],[[67515,67583],3],[[67584,67589],2],[[67590,67591],3],[67592,2],[67593,3],[[67594,67637],2],[67638,3],[[67639,67640],2],[[67641,67643],3],[67644,2],[[67645,67646],3],[67647,2],[[67648,67669],2],[67670,3],[[67671,67679],2],[[67680,67702],2],[[67703,67711],2],[[67712,67742],2],[[67743,67750],3],[[67751,67759],2],[[67760,67807],3],[[67808,67826],2],[67827,3],[[67828,67829],2],[[67830,67834],3],[[67835,67839],2],[[67840,67861],2],[[67862,67865],2],[[67866,67867],2],[[67868,67870],3],[67871,2],[[67872,67897],2],[[67898,67902],3],[67903,2],[[67904,67929],2],[[67930,67967],3],[[67968,68023],2],[[68024,68027],3],[[68028,68029],2],[[68030,68031],2],[[68032,68047],2],[[68048,68049],3],[[68050,68095],2],[[68096,68099],2],[68100,3],[[68101,68102],2],[[68103,68107],3],[[68108,68115],2],[68116,3],[[68117,68119],2],[68120,3],[[68121,68147],2],[[68148,68149],2],[[68150,68151],3],[[68152,68154],2],[[68155,68158],3],[68159,2],[[68160,68167],2],[68168,2],[[68169,68175],3],[[68176,68184],2],[[68185,68191],3],[[68192,68220],2],[[68221,68223],2],[[68224,68252],2],[[68253,68255],2],[[68256,68287],3],[[68288,68295],2],[68296,2],[[68297,68326],2],[[68327,68330],3],[[68331,68342],2],[[68343,68351],3],[[68352,68405],2],[[68406,68408],3],[[68409,68415],2],[[68416,68437],2],[[68438,68439],3],[[68440,68447],2],[[68448,68466],2],[[68467,68471],3],[[68472,68479],2],[[68480,68497],2],[[68498,68504],3],[[68505,68508],2],[[68509,68520],3],[[68521,68527],2],[[68528,68607],3],[[68608,68680],2],[[68681,68735],3],[68736,1,"\uD803\uDCC0"],[68737,1,"\uD803\uDCC1"],[68738,1,"\uD803\uDCC2"],[68739,1,"\uD803\uDCC3"],[68740,1,"\uD803\uDCC4"],[68741,1,"\uD803\uDCC5"],[68742,1,"\uD803\uDCC6"],[68743,1,"\uD803\uDCC7"],[68744,1,"\uD803\uDCC8"],[68745,1,"\uD803\uDCC9"],[68746,1,"\uD803\uDCCA"],[68747,1,"\uD803\uDCCB"],[68748,1,"\uD803\uDCCC"],[68749,1,"\uD803\uDCCD"],[68750,1,"\uD803\uDCCE"],[68751,1,"\uD803\uDCCF"],[68752,1,"\uD803\uDCD0"],[68753,1,"\uD803\uDCD1"],[68754,1,"\uD803\uDCD2"],[68755,1,"\uD803\uDCD3"],[68756,1,"\uD803\uDCD4"],[68757,1,"\uD803\uDCD5"],[68758,1,"\uD803\uDCD6"],[68759,1,"\uD803\uDCD7"],[68760,1,"\uD803\uDCD8"],[68761,1,"\uD803\uDCD9"],[68762,1,"\uD803\uDCDA"],[68763,1,"\uD803\uDCDB"],[68764,1,"\uD803\uDCDC"],[68765,1,"\uD803\uDCDD"],[68766,1,"\uD803\uDCDE"],[68767,1,"\uD803\uDCDF"],[68768,1,"\uD803\uDCE0"],[68769,1,"\uD803\uDCE1"],[68770,1,"\uD803\uDCE2"],[68771,1,"\uD803\uDCE3"],[68772,1,"\uD803\uDCE4"],[68773,1,"\uD803\uDCE5"],[68774,1,"\uD803\uDCE6"],[68775,1,"\uD803\uDCE7"],[68776,1,"\uD803\uDCE8"],[68777,1,"\uD803\uDCE9"],[68778,1,"\uD803\uDCEA"],[68779,1,"\uD803\uDCEB"],[68780,1,"\uD803\uDCEC"],[68781,1,"\uD803\uDCED"],[68782,1,"\uD803\uDCEE"],[68783,1,"\uD803\uDCEF"],[68784,1,"\uD803\uDCF0"],[68785,1,"\uD803\uDCF1"],[68786,1,"\uD803\uDCF2"],[[68787,68799],3],[[68800,68850],2],[[68851,68857],3],[[68858,68863],2],[[68864,68903],2],[[68904,68911],3],[[68912,68921],2],[[68922,68927],3],[[68928,68943],2],[68944,1,"\uD803\uDD70"],[68945,1,"\uD803\uDD71"],[68946,1,"\uD803\uDD72"],[68947,1,"\uD803\uDD73"],[68948,1,"\uD803\uDD74"],[68949,1,"\uD803\uDD75"],[68950,1,"\uD803\uDD76"],[68951,1,"\uD803\uDD77"],[68952,1,"\uD803\uDD78"],[68953,1,"\uD803\uDD79"],[68954,1,"\uD803\uDD7A"],[68955,1,"\uD803\uDD7B"],[68956,1,"\uD803\uDD7C"],[68957,1,"\uD803\uDD7D"],[68958,1,"\uD803\uDD7E"],[68959,1,"\uD803\uDD7F"],[68960,1,"\uD803\uDD80"],[68961,1,"\uD803\uDD81"],[68962,1,"\uD803\uDD82"],[68963,1,"\uD803\uDD83"],[68964,1,"\uD803\uDD84"],[68965,1,"\uD803\uDD85"],[[68966,68968],3],[[68969,68973],2],[68974,2],[[68975,68997],2],[[68998,69005],3],[[69006,69007],2],[[69008,69215],3],[[69216,69246],2],[69247,3],[[69248,69289],2],[69290,3],[[69291,69292],2],[69293,2],[[69294,69295],3],[[69296,69297],2],[[69298,69313],3],[[69314,69316],2],[[69317,69319],2],[[69320,69327],3],[[69328,69336],2],[[69337,69369],3],[[69370,69371],2],[69372,2],[[69373,69375],2],[[69376,69404],2],[[69405,69414],2],[69415,2],[[69416,69423],3],[[69424,69456],2],[[69457,69465],2],[[69466,69487],3],[[69488,69509],2],[[69510,69513],2],[[69514,69551],3],[[69552,69572],2],[[69573,69579],2],[[69580,69599],3],[[69600,69622],2],[[69623,69631],3],[[69632,69702],2],[[69703,69709],2],[[69710,69713],3],[[69714,69733],2],[[69734,69743],2],[[69744,69749],2],[[69750,69758],3],[69759,2],[[69760,69818],2],[[69819,69820],2],[69821,3],[[69822,69825],2],[69826,2],[[69827,69836],3],[69837,3],[[69838,69839],3],[[69840,69864],2],[[69865,69871],3],[[69872,69881],2],[[69882,69887],3],[[69888,69940],2],[69941,3],[[69942,69951],2],[[69952,69955],2],[[69956,69958],2],[69959,2],[[69960,69967],3],[[69968,70003],2],[[70004,70005],2],[70006,2],[[70007,70015],3],[[70016,70084],2],[[70085,70088],2],[[70089,70092],2],[70093,2],[[70094,70095],2],[[70096,70105],2],[70106,2],[70107,2],[70108,2],[[70109,70111],2],[70112,3],[[70113,70132],2],[[70133,70143],3],[[70144,70161],2],[70162,3],[[70163,70199],2],[[70200,70205],2],[70206,2],[[70207,70209],2],[[70210,70271],3],[[70272,70278],2],[70279,3],[70280,2],[70281,3],[[70282,70285],2],[70286,3],[[70287,70301],2],[70302,3],[[70303,70312],2],[70313,2],[[70314,70319],3],[[70320,70378],2],[[70379,70383],3],[[70384,70393],2],[[70394,70399],3],[70400,2],[[70401,70403],2],[70404,3],[[70405,70412],2],[[70413,70414],3],[[70415,70416],2],[[70417,70418],3],[[70419,70440],2],[70441,3],[[70442,70448],2],[70449,3],[[70450,70451],2],[70452,3],[[70453,70457],2],[70458,3],[70459,2],[[70460,70468],2],[[70469,70470],3],[[70471,70472],2],[[70473,70474],3],[[70475,70477],2],[[70478,70479],3],[70480,2],[[70481,70486],3],[70487,2],[[70488,70492],3],[[70493,70499],2],[[70500,70501],3],[[70502,70508],2],[[70509,70511],3],[[70512,70516],2],[[70517,70527],3],[[70528,70537],2],[70538,3],[70539,2],[[70540,70541],3],[70542,2],[70543,3],[[70544,70581],2],[70582,3],[[70583,70592],2],[70593,3],[70594,2],[[70595,70596],3],[70597,2],[70598,3],[[70599,70602],2],[70603,3],[[70604,70611],2],[[70612,70613],2],[70614,3],[[70615,70616],2],[[70617,70624],3],[[70625,70626],2],[[70627,70655],3],[[70656,70730],2],[[70731,70735],2],[[70736,70745],2],[70746,2],[70747,2],[70748,3],[70749,2],[70750,2],[70751,2],[[70752,70753],2],[[70754,70783],3],[[70784,70853],2],[70854,2],[70855,2],[[70856,70863],3],[[70864,70873],2],[[70874,71039],3],[[71040,71093],2],[[71094,71095],3],[[71096,71104],2],[[71105,71113],2],[[71114,71127],2],[[71128,71133],2],[[71134,71167],3],[[71168,71232],2],[[71233,71235],2],[71236,2],[[71237,71247],3],[[71248,71257],2],[[71258,71263],3],[[71264,71276],2],[[71277,71295],3],[[71296,71351],2],[71352,2],[71353,2],[[71354,71359],3],[[71360,71369],2],[[71370,71375],3],[[71376,71395],2],[[71396,71423],3],[[71424,71449],2],[71450,2],[[71451,71452],3],[[71453,71467],2],[[71468,71471],3],[[71472,71481],2],[[71482,71487],2],[[71488,71494],2],[[71495,71679],3],[[71680,71738],2],[71739,2],[[71740,71839],3],[71840,1,"\uD806\uDCC0"],[71841,1,"\uD806\uDCC1"],[71842,1,"\uD806\uDCC2"],[71843,1,"\uD806\uDCC3"],[71844,1,"\uD806\uDCC4"],[71845,1,"\uD806\uDCC5"],[71846,1,"\uD806\uDCC6"],[71847,1,"\uD806\uDCC7"],[71848,1,"\uD806\uDCC8"],[71849,1,"\uD806\uDCC9"],[71850,1,"\uD806\uDCCA"],[71851,1,"\uD806\uDCCB"],[71852,1,"\uD806\uDCCC"],[71853,1,"\uD806\uDCCD"],[71854,1,"\uD806\uDCCE"],[71855,1,"\uD806\uDCCF"],[71856,1,"\uD806\uDCD0"],[71857,1,"\uD806\uDCD1"],[71858,1,"\uD806\uDCD2"],[71859,1,"\uD806\uDCD3"],[71860,1,"\uD806\uDCD4"],[71861,1,"\uD806\uDCD5"],[71862,1,"\uD806\uDCD6"],[71863,1,"\uD806\uDCD7"],[71864,1,"\uD806\uDCD8"],[71865,1,"\uD806\uDCD9"],[71866,1,"\uD806\uDCDA"],[71867,1,"\uD806\uDCDB"],[71868,1,"\uD806\uDCDC"],[71869,1,"\uD806\uDCDD"],[71870,1,"\uD806\uDCDE"],[71871,1,"\uD806\uDCDF"],[[71872,71913],2],[[71914,71922],2],[[71923,71934],3],[71935,2],[[71936,71942],2],[[71943,71944],3],[71945,2],[[71946,71947],3],[[71948,71955],2],[71956,3],[[71957,71958],2],[71959,3],[[71960,71989],2],[71990,3],[[71991,71992],2],[[71993,71994],3],[[71995,72003],2],[[72004,72006],2],[[72007,72015],3],[[72016,72025],2],[[72026,72095],3],[[72096,72103],2],[[72104,72105],3],[[72106,72151],2],[[72152,72153],3],[[72154,72161],2],[72162,2],[[72163,72164],2],[[72165,72191],3],[[72192,72254],2],[[72255,72262],2],[72263,2],[[72264,72271],3],[[72272,72323],2],[[72324,72325],2],[[72326,72345],2],[[72346,72348],2],[72349,2],[[72350,72354],2],[[72355,72367],3],[[72368,72383],2],[[72384,72440],2],[[72441,72447],3],[[72448,72457],2],[[72458,72543],3],[[72544,72551],2],[[72552,72639],3],[[72640,72672],2],[72673,2],[[72674,72687],3],[[72688,72697],2],[[72698,72703],3],[[72704,72712],2],[72713,3],[[72714,72758],2],[72759,3],[[72760,72768],2],[[72769,72773],2],[[72774,72783],3],[[72784,72793],2],[[72794,72812],2],[[72813,72815],3],[[72816,72817],2],[[72818,72847],2],[[72848,72849],3],[[72850,72871],2],[72872,3],[[72873,72886],2],[[72887,72959],3],[[72960,72966],2],[72967,3],[[72968,72969],2],[72970,3],[[72971,73014],2],[[73015,73017],3],[73018,2],[73019,3],[[73020,73021],2],[73022,3],[[73023,73031],2],[[73032,73039],3],[[73040,73049],2],[[73050,73055],3],[[73056,73061],2],[73062,3],[[73063,73064],2],[73065,3],[[73066,73102],2],[73103,3],[[73104,73105],2],[73106,3],[[73107,73112],2],[[73113,73119],3],[[73120,73129],2],[[73130,73135],3],[[73136,73179],2],[[73180,73183],3],[[73184,73193],2],[[73194,73439],3],[[73440,73462],2],[[73463,73464],2],[[73465,73471],3],[[73472,73488],2],[73489,3],[[73490,73530],2],[[73531,73533],3],[[73534,73538],2],[[73539,73551],2],[[73552,73561],2],[73562,2],[[73563,73647],3],[73648,2],[[73649,73663],3],[[73664,73713],2],[[73714,73726],3],[73727,2],[[73728,74606],2],[[74607,74648],2],[74649,2],[[74650,74751],3],[[74752,74850],2],[[74851,74862],2],[74863,3],[[74864,74867],2],[74868,2],[[74869,74879],3],[[74880,75075],2],[[75076,77711],3],[[77712,77808],2],[[77809,77810],2],[[77811,77823],3],[[77824,78894],2],[78895,2],[[78896,78904],3],[[78905,78911],3],[[78912,78933],2],[[78934,78943],3],[[78944,82938],2],[[82939,82943],3],[[82944,83526],2],[[83527,90367],3],[[90368,90425],2],[[90426,92159],3],[[92160,92728],2],[[92729,92735],3],[[92736,92766],2],[92767,3],[[92768,92777],2],[[92778,92781],3],[[92782,92783],2],[[92784,92862],2],[92863,3],[[92864,92873],2],[[92874,92879],3],[[92880,92909],2],[[92910,92911],3],[[92912,92916],2],[92917,2],[[92918,92927],3],[[92928,92982],2],[[92983,92991],2],[[92992,92995],2],[[92996,92997],2],[[92998,93007],3],[[93008,93017],2],[93018,3],[[93019,93025],2],[93026,3],[[93027,93047],2],[[93048,93052],3],[[93053,93071],2],[[93072,93503],3],[[93504,93548],2],[[93549,93551],2],[[93552,93561],2],[[93562,93759],3],[93760,1,"\uD81B\uDE60"],[93761,1,"\uD81B\uDE61"],[93762,1,"\uD81B\uDE62"],[93763,1,"\uD81B\uDE63"],[93764,1,"\uD81B\uDE64"],[93765,1,"\uD81B\uDE65"],[93766,1,"\uD81B\uDE66"],[93767,1,"\uD81B\uDE67"],[93768,1,"\uD81B\uDE68"],[93769,1,"\uD81B\uDE69"],[93770,1,"\uD81B\uDE6A"],[93771,1,"\uD81B\uDE6B"],[93772,1,"\uD81B\uDE6C"],[93773,1,"\uD81B\uDE6D"],[93774,1,"\uD81B\uDE6E"],[93775,1,"\uD81B\uDE6F"],[93776,1,"\uD81B\uDE70"],[93777,1,"\uD81B\uDE71"],[93778,1,"\uD81B\uDE72"],[93779,1,"\uD81B\uDE73"],[93780,1,"\uD81B\uDE74"],[93781,1,"\uD81B\uDE75"],[93782,1,"\uD81B\uDE76"],[93783,1,"\uD81B\uDE77"],[93784,1,"\uD81B\uDE78"],[93785,1,"\uD81B\uDE79"],[93786,1,"\uD81B\uDE7A"],[93787,1,"\uD81B\uDE7B"],[93788,1,"\uD81B\uDE7C"],[93789,1,"\uD81B\uDE7D"],[93790,1,"\uD81B\uDE7E"],[93791,1,"\uD81B\uDE7F"],[[93792,93823],2],[[93824,93850],2],[[93851,93855],3],[93856,1,"\uD81B\uDEBB"],[93857,1,"\uD81B\uDEBC"],[93858,1,"\uD81B\uDEBD"],[93859,1,"\uD81B\uDEBE"],[93860,1,"\uD81B\uDEBF"],[93861,1,"\uD81B\uDEC0"],[93862,1,"\uD81B\uDEC1"],[93863,1,"\uD81B\uDEC2"],[93864,1,"\uD81B\uDEC3"],[93865,1,"\uD81B\uDEC4"],[93866,1,"\uD81B\uDEC5"],[93867,1,"\uD81B\uDEC6"],[93868,1,"\uD81B\uDEC7"],[93869,1,"\uD81B\uDEC8"],[93870,1,"\uD81B\uDEC9"],[93871,1,"\uD81B\uDECA"],[93872,1,"\uD81B\uDECB"],[93873,1,"\uD81B\uDECC"],[93874,1,"\uD81B\uDECD"],[93875,1,"\uD81B\uDECE"],[93876,1,"\uD81B\uDECF"],[93877,1,"\uD81B\uDED0"],[93878,1,"\uD81B\uDED1"],[93879,1,"\uD81B\uDED2"],[93880,1,"\uD81B\uDED3"],[[93881,93882],3],[[93883,93907],2],[[93908,93951],3],[[93952,94020],2],[[94021,94026],2],[[94027,94030],3],[94031,2],[[94032,94078],2],[[94079,94087],2],[[94088,94094],3],[[94095,94111],2],[[94112,94175],3],[94176,2],[94177,2],[94178,2],[94179,2],[94180,2],[[94181,94191],3],[[94192,94193],2],[[94194,94195],2],[[94196,94198],2],[[94199,94207],3],[[94208,100332],2],[[100333,100337],2],[[100338,100343],2],[[100344,100351],2],[[100352,101106],2],[[101107,101589],2],[[101590,101630],3],[101631,2],[[101632,101640],2],[[101641,101662],2],[[101663,101759],3],[[101760,101874],2],[[101875,110575],3],[[110576,110579],2],[110580,3],[[110581,110587],2],[110588,3],[[110589,110590],2],[110591,3],[[110592,110593],2],[[110594,110878],2],[[110879,110882],2],[[110883,110897],3],[110898,2],[[110899,110927],3],[[110928,110930],2],[[110931,110932],3],[110933,2],[[110934,110947],3],[[110948,110951],2],[[110952,110959],3],[[110960,111355],2],[[111356,113663],3],[[113664,113770],2],[[113771,113775],3],[[113776,113788],2],[[113789,113791],3],[[113792,113800],2],[[113801,113807],3],[[113808,113817],2],[[113818,113819],3],[113820,2],[[113821,113822],2],[113823,2],[[113824,113827],7],[[113828,117759],3],[[117760,117973],2],[117974,1,"a"],[117975,1,"b"],[117976,1,"c"],[117977,1,"d"],[117978,1,"e"],[117979,1,"f"],[117980,1,"g"],[117981,1,"h"],[117982,1,"i"],[117983,1,"j"],[117984,1,"k"],[117985,1,"l"],[117986,1,"m"],[117987,1,"n"],[117988,1,"o"],[117989,1,"p"],[117990,1,"q"],[117991,1,"r"],[117992,1,"s"],[117993,1,"t"],[117994,1,"u"],[117995,1,"v"],[117996,1,"w"],[117997,1,"x"],[117998,1,"y"],[117999,1,"z"],[118000,1,"0"],[118001,1,"1"],[118002,1,"2"],[118003,1,"3"],[118004,1,"4"],[118005,1,"5"],[118006,1,"6"],[118007,1,"7"],[118008,1,"8"],[118009,1,"9"],[[118010,118012],2],[[118013,118015],3],[[118016,118451],2],[[118452,118457],3],[[118458,118480],2],[[118481,118495],3],[[118496,118512],2],[[118513,118527],3],[[118528,118573],2],[[118574,118575],3],[[118576,118598],2],[[118599,118607],3],[[118608,118723],2],[[118724,118783],3],[[118784,119029],2],[[119030,119039],3],[[119040,119078],2],[[119079,119080],3],[119081,2],[[119082,119133],2],[119134,1,"\uD834\uDD57\uD834\uDD65"],[119135,1,"\uD834\uDD58\uD834\uDD65"],[119136,1,"\uD834\uDD58\uD834\uDD65\uD834\uDD6E"],[119137,1,"\uD834\uDD58\uD834\uDD65\uD834\uDD6F"],[119138,1,"\uD834\uDD58\uD834\uDD65\uD834\uDD70"],[119139,1,"\uD834\uDD58\uD834\uDD65\uD834\uDD71"],[119140,1,"\uD834\uDD58\uD834\uDD65\uD834\uDD72"],[[119141,119154],2],[[119155,119162],7],[[119163,119226],2],[119227,1,"\uD834\uDDB9\uD834\uDD65"],[119228,1,"\uD834\uDDBA\uD834\uDD65"],[119229,1,"\uD834\uDDB9\uD834\uDD65\uD834\uDD6E"],[119230,1,"\uD834\uDDBA\uD834\uDD65\uD834\uDD6E"],[119231,1,"\uD834\uDDB9\uD834\uDD65\uD834\uDD6F"],[119232,1,"\uD834\uDDBA\uD834\uDD65\uD834\uDD6F"],[[119233,119261],2],[[119262,119272],2],[[119273,119274],2],[[119275,119295],3],[[119296,119365],2],[[119366,119487],3],[[119488,119507],2],[[119508,119519],3],[[119520,119539],2],[[119540,119551],3],[[119552,119638],2],[[119639,119647],3],[[119648,119665],2],[[119666,119672],2],[[119673,119807],3],[119808,1,"a"],[119809,1,"b"],[119810,1,"c"],[119811,1,"d"],[119812,1,"e"],[119813,1,"f"],[119814,1,"g"],[119815,1,"h"],[119816,1,"i"],[119817,1,"j"],[119818,1,"k"],[119819,1,"l"],[119820,1,"m"],[119821,1,"n"],[119822,1,"o"],[119823,1,"p"],[119824,1,"q"],[119825,1,"r"],[119826,1,"s"],[119827,1,"t"],[119828,1,"u"],[119829,1,"v"],[119830,1,"w"],[119831,1,"x"],[119832,1,"y"],[119833,1,"z"],[119834,1,"a"],[119835,1,"b"],[119836,1,"c"],[119837,1,"d"],[119838,1,"e"],[119839,1,"f"],[119840,1,"g"],[119841,1,"h"],[119842,1,"i"],[119843,1,"j"],[119844,1,"k"],[119845,1,"l"],[119846,1,"m"],[119847,1,"n"],[119848,1,"o"],[119849,1,"p"],[119850,1,"q"],[119851,1,"r"],[119852,1,"s"],[119853,1,"t"],[119854,1,"u"],[119855,1,"v"],[119856,1,"w"],[119857,1,"x"],[119858,1,"y"],[119859,1,"z"],[119860,1,"a"],[119861,1,"b"],[119862,1,"c"],[119863,1,"d"],[119864,1,"e"],[119865,1,"f"],[119866,1,"g"],[119867,1,"h"],[119868,1,"i"],[119869,1,"j"],[119870,1,"k"],[119871,1,"l"],[119872,1,"m"],[119873,1,"n"],[119874,1,"o"],[119875,1,"p"],[119876,1,"q"],[119877,1,"r"],[119878,1,"s"],[119879,1,"t"],[119880,1,"u"],[119881,1,"v"],[119882,1,"w"],[119883,1,"x"],[119884,1,"y"],[119885,1,"z"],[119886,1,"a"],[119887,1,"b"],[119888,1,"c"],[119889,1,"d"],[119890,1,"e"],[119891,1,"f"],[119892,1,"g"],[119893,3],[119894,1,"i"],[119895,1,"j"],[119896,1,"k"],[119897,1,"l"],[119898,1,"m"],[119899,1,"n"],[119900,1,"o"],[119901,1,"p"],[119902,1,"q"],[119903,1,"r"],[119904,1,"s"],[119905,1,"t"],[119906,1,"u"],[119907,1,"v"],[119908,1,"w"],[119909,1,"x"],[119910,1,"y"],[119911,1,"z"],[119912,1,"a"],[119913,1,"b"],[119914,1,"c"],[119915,1,"d"],[119916,1,"e"],[119917,1,"f"],[119918,1,"g"],[119919,1,"h"],[119920,1,"i"],[119921,1,"j"],[119922,1,"k"],[119923,1,"l"],[119924,1,"m"],[119925,1,"n"],[119926,1,"o"],[119927,1,"p"],[119928,1,"q"],[119929,1,"r"],[119930,1,"s"],[119931,1,"t"],[119932,1,"u"],[119933,1,"v"],[119934,1,"w"],[119935,1,"x"],[119936,1,"y"],[119937,1,"z"],[119938,1,"a"],[119939,1,"b"],[119940,1,"c"],[119941,1,"d"],[119942,1,"e"],[119943,1,"f"],[119944,1,"g"],[119945,1,"h"],[119946,1,"i"],[119947,1,"j"],[119948,1,"k"],[119949,1,"l"],[119950,1,"m"],[119951,1,"n"],[119952,1,"o"],[119953,1,"p"],[119954,1,"q"],[119955,1,"r"],[119956,1,"s"],[119957,1,"t"],[119958,1,"u"],[119959,1,"v"],[119960,1,"w"],[119961,1,"x"],[119962,1,"y"],[119963,1,"z"],[119964,1,"a"],[119965,3],[119966,1,"c"],[119967,1,"d"],[[119968,119969],3],[119970,1,"g"],[[119971,119972],3],[119973,1,"j"],[119974,1,"k"],[[119975,119976],3],[119977,1,"n"],[119978,1,"o"],[119979,1,"p"],[119980,1,"q"],[119981,3],[119982,1,"s"],[119983,1,"t"],[119984,1,"u"],[119985,1,"v"],[119986,1,"w"],[119987,1,"x"],[119988,1,"y"],[119989,1,"z"],[119990,1,"a"],[119991,1,"b"],[119992,1,"c"],[119993,1,"d"],[119994,3],[119995,1,"f"],[119996,3],[119997,1,"h"],[119998,1,"i"],[119999,1,"j"],[120000,1,"k"],[120001,1,"l"],[120002,1,"m"],[120003,1,"n"],[120004,3],[120005,1,"p"],[120006,1,"q"],[120007,1,"r"],[120008,1,"s"],[120009,1,"t"],[120010,1,"u"],[120011,1,"v"],[120012,1,"w"],[120013,1,"x"],[120014,1,"y"],[120015,1,"z"],[120016,1,"a"],[120017,1,"b"],[120018,1,"c"],[120019,1,"d"],[120020,1,"e"],[120021,1,"f"],[120022,1,"g"],[120023,1,"h"],[120024,1,"i"],[120025,1,"j"],[120026,1,"k"],[120027,1,"l"],[120028,1,"m"],[120029,1,"n"],[120030,1,"o"],[120031,1,"p"],[120032,1,"q"],[120033,1,"r"],[120034,1,"s"],[120035,1,"t"],[120036,1,"u"],[120037,1,"v"],[120038,1,"w"],[120039,1,"x"],[120040,1,"y"],[120041,1,"z"],[120042,1,"a"],[120043,1,"b"],[120044,1,"c"],[120045,1,"d"],[120046,1,"e"],[120047,1,"f"],[120048,1,"g"],[120049,1,"h"],[120050,1,"i"],[120051,1,"j"],[120052,1,"k"],[120053,1,"l"],[120054,1,"m"],[120055,1,"n"],[120056,1,"o"],[120057,1,"p"],[120058,1,"q"],[120059,1,"r"],[120060,1,"s"],[120061,1,"t"],[120062,1,"u"],[120063,1,"v"],[120064,1,"w"],[120065,1,"x"],[120066,1,"y"],[120067,1,"z"],[120068,1,"a"],[120069,1,"b"],[120070,3],[120071,1,"d"],[120072,1,"e"],[120073,1,"f"],[120074,1,"g"],[[120075,120076],3],[120077,1,"j"],[120078,1,"k"],[120079,1,"l"],[120080,1,"m"],[120081,1,"n"],[120082,1,"o"],[120083,1,"p"],[120084,1,"q"],[120085,3],[120086,1,"s"],[120087,1,"t"],[120088,1,"u"],[120089,1,"v"],[120090,1,"w"],[120091,1,"x"],[120092,1,"y"],[120093,3],[120094,1,"a"],[120095,1,"b"],[120096,1,"c"],[120097,1,"d"],[120098,1,"e"],[120099,1,"f"],[120100,1,"g"],[120101,1,"h"],[120102,1,"i"],[120103,1,"j"],[120104,1,"k"],[120105,1,"l"],[120106,1,"m"],[120107,1,"n"],[120108,1,"o"],[120109,1,"p"],[120110,1,"q"],[120111,1,"r"],[120112,1,"s"],[120113,1,"t"],[120114,1,"u"],[120115,1,"v"],[120116,1,"w"],[120117,1,"x"],[120118,1,"y"],[120119,1,"z"],[120120,1,"a"],[120121,1,"b"],[120122,3],[120123,1,"d"],[120124,1,"e"],[120125,1,"f"],[120126,1,"g"],[120127,3],[120128,1,"i"],[120129,1,"j"],[120130,1,"k"],[120131,1,"l"],[120132,1,"m"],[120133,3],[120134,1,"o"],[[120135,120137],3],[120138,1,"s"],[120139,1,"t"],[120140,1,"u"],[120141,1,"v"],[120142,1,"w"],[120143,1,"x"],[120144,1,"y"],[120145,3],[120146,1,"a"],[120147,1,"b"],[120148,1,"c"],[120149,1,"d"],[120150,1,"e"],[120151,1,"f"],[120152,1,"g"],[120153,1,"h"],[120154,1,"i"],[120155,1,"j"],[120156,1,"k"],[120157,1,"l"],[120158,1,"m"],[120159,1,"n"],[120160,1,"o"],[120161,1,"p"],[120162,1,"q"],[120163,1,"r"],[120164,1,"s"],[120165,1,"t"],[120166,1,"u"],[120167,1,"v"],[120168,1,"w"],[120169,1,"x"],[120170,1,"y"],[120171,1,"z"],[120172,1,"a"],[120173,1,"b"],[120174,1,"c"],[120175,1,"d"],[120176,1,"e"],[120177,1,"f"],[120178,1,"g"],[120179,1,"h"],[120180,1,"i"],[120181,1,"j"],[120182,1,"k"],[120183,1,"l"],[120184,1,"m"],[120185,1,"n"],[120186,1,"o"],[120187,1,"p"],[120188,1,"q"],[120189,1,"r"],[120190,1,"s"],[120191,1,"t"],[120192,1,"u"],[120193,1,"v"],[120194,1,"w"],[120195,1,"x"],[120196,1,"y"],[120197,1,"z"],[120198,1,"a"],[120199,1,"b"],[120200,1,"c"],[120201,1,"d"],[120202,1,"e"],[120203,1,"f"],[120204,1,"g"],[120205,1,"h"],[120206,1,"i"],[120207,1,"j"],[120208,1,"k"],[120209,1,"l"],[120210,1,"m"],[120211,1,"n"],[120212,1,"o"],[120213,1,"p"],[120214,1,"q"],[120215,1,"r"],[120216,1,"s"],[120217,1,"t"],[120218,1,"u"],[120219,1,"v"],[120220,1,"w"],[120221,1,"x"],[120222,1,"y"],[120223,1,"z"],[120224,1,"a"],[120225,1,"b"],[120226,1,"c"],[120227,1,"d"],[120228,1,"e"],[120229,1,"f"],[120230,1,"g"],[120231,1,"h"],[120232,1,"i"],[120233,1,"j"],[120234,1,"k"],[120235,1,"l"],[120236,1,"m"],[120237,1,"n"],[120238,1,"o"],[120239,1,"p"],[120240,1,"q"],[120241,1,"r"],[120242,1,"s"],[120243,1,"t"],[120244,1,"u"],[120245,1,"v"],[120246,1,"w"],[120247,1,"x"],[120248,1,"y"],[120249,1,"z"],[120250,1,"a"],[120251,1,"b"],[120252,1,"c"],[120253,1,"d"],[120254,1,"e"],[120255,1,"f"],[120256,1,"g"],[120257,1,"h"],[120258,1,"i"],[120259,1,"j"],[120260,1,"k"],[120261,1,"l"],[120262,1,"m"],[120263,1,"n"],[120264,1,"o"],[120265,1,"p"],[120266,1,"q"],[120267,1,"r"],[120268,1,"s"],[120269,1,"t"],[120270,1,"u"],[120271,1,"v"],[120272,1,"w"],[120273,1,"x"],[120274,1,"y"],[120275,1,"z"],[120276,1,"a"],[120277,1,"b"],[120278,1,"c"],[120279,1,"d"],[120280,1,"e"],[120281,1,"f"],[120282,1,"g"],[120283,1,"h"],[120284,1,"i"],[120285,1,"j"],[120286,1,"k"],[120287,1,"l"],[120288,1,"m"],[120289,1,"n"],[120290,1,"o"],[120291,1,"p"],[120292,1,"q"],[120293,1,"r"],[120294,1,"s"],[120295,1,"t"],[120296,1,"u"],[120297,1,"v"],[120298,1,"w"],[120299,1,"x"],[120300,1,"y"],[120301,1,"z"],[120302,1,"a"],[120303,1,"b"],[120304,1,"c"],[120305,1,"d"],[120306,1,"e"],[120307,1,"f"],[120308,1,"g"],[120309,1,"h"],[120310,1,"i"],[120311,1,"j"],[120312,1,"k"],[120313,1,"l"],[120314,1,"m"],[120315,1,"n"],[120316,1,"o"],[120317,1,"p"],[120318,1,"q"],[120319,1,"r"],[120320,1,"s"],[120321,1,"t"],[120322,1,"u"],[120323,1,"v"],[120324,1,"w"],[120325,1,"x"],[120326,1,"y"],[120327,1,"z"],[120328,1,"a"],[120329,1,"b"],[120330,1,"c"],[120331,1,"d"],[120332,1,"e"],[120333,1,"f"],[120334,1,"g"],[120335,1,"h"],[120336,1,"i"],[120337,1,"j"],[120338,1,"k"],[120339,1,"l"],[120340,1,"m"],[120341,1,"n"],[120342,1,"o"],[120343,1,"p"],[120344,1,"q"],[120345,1,"r"],[120346,1,"s"],[120347,1,"t"],[120348,1,"u"],[120349,1,"v"],[120350,1,"w"],[120351,1,"x"],[120352,1,"y"],[120353,1,"z"],[120354,1,"a"],[120355,1,"b"],[120356,1,"c"],[120357,1,"d"],[120358,1,"e"],[120359,1,"f"],[120360,1,"g"],[120361,1,"h"],[120362,1,"i"],[120363,1,"j"],[120364,1,"k"],[120365,1,"l"],[120366,1,"m"],[120367,1,"n"],[120368,1,"o"],[120369,1,"p"],[120370,1,"q"],[120371,1,"r"],[120372,1,"s"],[120373,1,"t"],[120374,1,"u"],[120375,1,"v"],[120376,1,"w"],[120377,1,"x"],[120378,1,"y"],[120379,1,"z"],[120380,1,"a"],[120381,1,"b"],[120382,1,"c"],[120383,1,"d"],[120384,1,"e"],[120385,1,"f"],[120386,1,"g"],[120387,1,"h"],[120388,1,"i"],[120389,1,"j"],[120390,1,"k"],[120391,1,"l"],[120392,1,"m"],[120393,1,"n"],[120394,1,"o"],[120395,1,"p"],[120396,1,"q"],[120397,1,"r"],[120398,1,"s"],[120399,1,"t"],[120400,1,"u"],[120401,1,"v"],[120402,1,"w"],[120403,1,"x"],[120404,1,"y"],[120405,1,"z"],[120406,1,"a"],[120407,1,"b"],[120408,1,"c"],[120409,1,"d"],[120410,1,"e"],[120411,1,"f"],[120412,1,"g"],[120413,1,"h"],[120414,1,"i"],[120415,1,"j"],[120416,1,"k"],[120417,1,"l"],[120418,1,"m"],[120419,1,"n"],[120420,1,"o"],[120421,1,"p"],[120422,1,"q"],[120423,1,"r"],[120424,1,"s"],[120425,1,"t"],[120426,1,"u"],[120427,1,"v"],[120428,1,"w"],[120429,1,"x"],[120430,1,"y"],[120431,1,"z"],[120432,1,"a"],[120433,1,"b"],[120434,1,"c"],[120435,1,"d"],[120436,1,"e"],[120437,1,"f"],[120438,1,"g"],[120439,1,"h"],[120440,1,"i"],[120441,1,"j"],[120442,1,"k"],[120443,1,"l"],[120444,1,"m"],[120445,1,"n"],[120446,1,"o"],[120447,1,"p"],[120448,1,"q"],[120449,1,"r"],[120450,1,"s"],[120451,1,"t"],[120452,1,"u"],[120453,1,"v"],[120454,1,"w"],[120455,1,"x"],[120456,1,"y"],[120457,1,"z"],[120458,1,"a"],[120459,1,"b"],[120460,1,"c"],[120461,1,"d"],[120462,1,"e"],[120463,1,"f"],[120464,1,"g"],[120465,1,"h"],[120466,1,"i"],[120467,1,"j"],[120468,1,"k"],[120469,1,"l"],[120470,1,"m"],[120471,1,"n"],[120472,1,"o"],[120473,1,"p"],[120474,1,"q"],[120475,1,"r"],[120476,1,"s"],[120477,1,"t"],[120478,1,"u"],[120479,1,"v"],[120480,1,"w"],[120481,1,"x"],[120482,1,"y"],[120483,1,"z"],[120484,1,"\u0131"],[120485,1,"\u0237"],[[120486,120487],3],[120488,1,"\u03B1"],[120489,1,"\u03B2"],[120490,1,"\u03B3"],[120491,1,"\u03B4"],[120492,1,"\u03B5"],[120493,1,"\u03B6"],[120494,1,"\u03B7"],[120495,1,"\u03B8"],[120496,1,"\u03B9"],[120497,1,"\u03BA"],[120498,1,"\u03BB"],[120499,1,"\u03BC"],[120500,1,"\u03BD"],[120501,1,"\u03BE"],[120502,1,"\u03BF"],[120503,1,"\u03C0"],[120504,1,"\u03C1"],[120505,1,"\u03B8"],[120506,1,"\u03C3"],[120507,1,"\u03C4"],[120508,1,"\u03C5"],[120509,1,"\u03C6"],[120510,1,"\u03C7"],[120511,1,"\u03C8"],[120512,1,"\u03C9"],[120513,1,"\u2207"],[120514,1,"\u03B1"],[120515,1,"\u03B2"],[120516,1,"\u03B3"],[120517,1,"\u03B4"],[120518,1,"\u03B5"],[120519,1,"\u03B6"],[120520,1,"\u03B7"],[120521,1,"\u03B8"],[120522,1,"\u03B9"],[120523,1,"\u03BA"],[120524,1,"\u03BB"],[120525,1,"\u03BC"],[120526,1,"\u03BD"],[120527,1,"\u03BE"],[120528,1,"\u03BF"],[120529,1,"\u03C0"],[120530,1,"\u03C1"],[[120531,120532],1,"\u03C3"],[120533,1,"\u03C4"],[120534,1,"\u03C5"],[120535,1,"\u03C6"],[120536,1,"\u03C7"],[120537,1,"\u03C8"],[120538,1,"\u03C9"],[120539,1,"\u2202"],[120540,1,"\u03B5"],[120541,1,"\u03B8"],[120542,1,"\u03BA"],[120543,1,"\u03C6"],[120544,1,"\u03C1"],[120545,1,"\u03C0"],[120546,1,"\u03B1"],[120547,1,"\u03B2"],[120548,1,"\u03B3"],[120549,1,"\u03B4"],[120550,1,"\u03B5"],[120551,1,"\u03B6"],[120552,1,"\u03B7"],[120553,1,"\u03B8"],[120554,1,"\u03B9"],[120555,1,"\u03BA"],[120556,1,"\u03BB"],[120557,1,"\u03BC"],[120558,1,"\u03BD"],[120559,1,"\u03BE"],[120560,1,"\u03BF"],[120561,1,"\u03C0"],[120562,1,"\u03C1"],[120563,1,"\u03B8"],[120564,1,"\u03C3"],[120565,1,"\u03C4"],[120566,1,"\u03C5"],[120567,1,"\u03C6"],[120568,1,"\u03C7"],[120569,1,"\u03C8"],[120570,1,"\u03C9"],[120571,1,"\u2207"],[120572,1,"\u03B1"],[120573,1,"\u03B2"],[120574,1,"\u03B3"],[120575,1,"\u03B4"],[120576,1,"\u03B5"],[120577,1,"\u03B6"],[120578,1,"\u03B7"],[120579,1,"\u03B8"],[120580,1,"\u03B9"],[120581,1,"\u03BA"],[120582,1,"\u03BB"],[120583,1,"\u03BC"],[120584,1,"\u03BD"],[120585,1,"\u03BE"],[120586,1,"\u03BF"],[120587,1,"\u03C0"],[120588,1,"\u03C1"],[[120589,120590],1,"\u03C3"],[120591,1,"\u03C4"],[120592,1,"\u03C5"],[120593,1,"\u03C6"],[120594,1,"\u03C7"],[120595,1,"\u03C8"],[120596,1,"\u03C9"],[120597,1,"\u2202"],[120598,1,"\u03B5"],[120599,1,"\u03B8"],[120600,1,"\u03BA"],[120601,1,"\u03C6"],[120602,1,"\u03C1"],[120603,1,"\u03C0"],[120604,1,"\u03B1"],[120605,1,"\u03B2"],[120606,1,"\u03B3"],[120607,1,"\u03B4"],[120608,1,"\u03B5"],[120609,1,"\u03B6"],[120610,1,"\u03B7"],[120611,1,"\u03B8"],[120612,1,"\u03B9"],[120613,1,"\u03BA"],[120614,1,"\u03BB"],[120615,1,"\u03BC"],[120616,1,"\u03BD"],[120617,1,"\u03BE"],[120618,1,"\u03BF"],[120619,1,"\u03C0"],[120620,1,"\u03C1"],[120621,1,"\u03B8"],[120622,1,"\u03C3"],[120623,1,"\u03C4"],[120624,1,"\u03C5"],[120625,1,"\u03C6"],[120626,1,"\u03C7"],[120627,1,"\u03C8"],[120628,1,"\u03C9"],[120629,1,"\u2207"],[120630,1,"\u03B1"],[120631,1,"\u03B2"],[120632,1,"\u03B3"],[120633,1,"\u03B4"],[120634,1,"\u03B5"],[120635,1,"\u03B6"],[120636,1,"\u03B7"],[120637,1,"\u03B8"],[120638,1,"\u03B9"],[120639,1,"\u03BA"],[120640,1,"\u03BB"],[120641,1,"\u03BC"],[120642,1,"\u03BD"],[120643,1,"\u03BE"],[120644,1,"\u03BF"],[120645,1,"\u03C0"],[120646,1,"\u03C1"],[[120647,120648],1,"\u03C3"],[120649,1,"\u03C4"],[120650,1,"\u03C5"],[120651,1,"\u03C6"],[120652,1,"\u03C7"],[120653,1,"\u03C8"],[120654,1,"\u03C9"],[120655,1,"\u2202"],[120656,1,"\u03B5"],[120657,1,"\u03B8"],[120658,1,"\u03BA"],[120659,1,"\u03C6"],[120660,1,"\u03C1"],[120661,1,"\u03C0"],[120662,1,"\u03B1"],[120663,1,"\u03B2"],[120664,1,"\u03B3"],[120665,1,"\u03B4"],[120666,1,"\u03B5"],[120667,1,"\u03B6"],[120668,1,"\u03B7"],[120669,1,"\u03B8"],[120670,1,"\u03B9"],[120671,1,"\u03BA"],[120672,1,"\u03BB"],[120673,1,"\u03BC"],[120674,1,"\u03BD"],[120675,1,"\u03BE"],[120676,1,"\u03BF"],[120677,1,"\u03C0"],[120678,1,"\u03C1"],[120679,1,"\u03B8"],[120680,1,"\u03C3"],[120681,1,"\u03C4"],[120682,1,"\u03C5"],[120683,1,"\u03C6"],[120684,1,"\u03C7"],[120685,1,"\u03C8"],[120686,1,"\u03C9"],[120687,1,"\u2207"],[120688,1,"\u03B1"],[120689,1,"\u03B2"],[120690,1,"\u03B3"],[120691,1,"\u03B4"],[120692,1,"\u03B5"],[120693,1,"\u03B6"],[120694,1,"\u03B7"],[120695,1,"\u03B8"],[120696,1,"\u03B9"],[120697,1,"\u03BA"],[120698,1,"\u03BB"],[120699,1,"\u03BC"],[120700,1,"\u03BD"],[120701,1,"\u03BE"],[120702,1,"\u03BF"],[120703,1,"\u03C0"],[120704,1,"\u03C1"],[[120705,120706],1,"\u03C3"],[120707,1,"\u03C4"],[120708,1,"\u03C5"],[120709,1,"\u03C6"],[120710,1,"\u03C7"],[120711,1,"\u03C8"],[120712,1,"\u03C9"],[120713,1,"\u2202"],[120714,1,"\u03B5"],[120715,1,"\u03B8"],[120716,1,"\u03BA"],[120717,1,"\u03C6"],[120718,1,"\u03C1"],[120719,1,"\u03C0"],[120720,1,"\u03B1"],[120721,1,"\u03B2"],[120722,1,"\u03B3"],[120723,1,"\u03B4"],[120724,1,"\u03B5"],[120725,1,"\u03B6"],[120726,1,"\u03B7"],[120727,1,"\u03B8"],[120728,1,"\u03B9"],[120729,1,"\u03BA"],[120730,1,"\u03BB"],[120731,1,"\u03BC"],[120732,1,"\u03BD"],[120733,1,"\u03BE"],[120734,1,"\u03BF"],[120735,1,"\u03C0"],[120736,1,"\u03C1"],[120737,1,"\u03B8"],[120738,1,"\u03C3"],[120739,1,"\u03C4"],[120740,1,"\u03C5"],[120741,1,"\u03C6"],[120742,1,"\u03C7"],[120743,1,"\u03C8"],[120744,1,"\u03C9"],[120745,1,"\u2207"],[120746,1,"\u03B1"],[120747,1,"\u03B2"],[120748,1,"\u03B3"],[120749,1,"\u03B4"],[120750,1,"\u03B5"],[120751,1,"\u03B6"],[120752,1,"\u03B7"],[120753,1,"\u03B8"],[120754,1,"\u03B9"],[120755,1,"\u03BA"],[120756,1,"\u03BB"],[120757,1,"\u03BC"],[120758,1,"\u03BD"],[120759,1,"\u03BE"],[120760,1,"\u03BF"],[120761,1,"\u03C0"],[120762,1,"\u03C1"],[[120763,120764],1,"\u03C3"],[120765,1,"\u03C4"],[120766,1,"\u03C5"],[120767,1,"\u03C6"],[120768,1,"\u03C7"],[120769,1,"\u03C8"],[120770,1,"\u03C9"],[120771,1,"\u2202"],[120772,1,"\u03B5"],[120773,1,"\u03B8"],[120774,1,"\u03BA"],[120775,1,"\u03C6"],[120776,1,"\u03C1"],[120777,1,"\u03C0"],[[120778,120779],1,"\u03DD"],[[120780,120781],3],[120782,1,"0"],[120783,1,"1"],[120784,1,"2"],[120785,1,"3"],[120786,1,"4"],[120787,1,"5"],[120788,1,"6"],[120789,1,"7"],[120790,1,"8"],[120791,1,"9"],[120792,1,"0"],[120793,1,"1"],[120794,1,"2"],[120795,1,"3"],[120796,1,"4"],[120797,1,"5"],[120798,1,"6"],[120799,1,"7"],[120800,1,"8"],[120801,1,"9"],[120802,1,"0"],[120803,1,"1"],[120804,1,"2"],[120805,1,"3"],[120806,1,"4"],[120807,1,"5"],[120808,1,"6"],[120809,1,"7"],[120810,1,"8"],[120811,1,"9"],[120812,1,"0"],[120813,1,"1"],[120814,1,"2"],[120815,1,"3"],[120816,1,"4"],[120817,1,"5"],[120818,1,"6"],[120819,1,"7"],[120820,1,"8"],[120821,1,"9"],[120822,1,"0"],[120823,1,"1"],[120824,1,"2"],[120825,1,"3"],[120826,1,"4"],[120827,1,"5"],[120828,1,"6"],[120829,1,"7"],[120830,1,"8"],[120831,1,"9"],[[120832,121343],2],[[121344,121398],2],[[121399,121402],2],[[121403,121452],2],[[121453,121460],2],[121461,2],[[121462,121475],2],[121476,2],[[121477,121483],2],[[121484,121498],3],[[121499,121503],2],[121504,3],[[121505,121519],2],[[121520,122623],3],[[122624,122654],2],[[122655,122660],3],[[122661,122666],2],[[122667,122879],3],[[122880,122886],2],[122887,3],[[122888,122904],2],[[122905,122906],3],[[122907,122913],2],[122914,3],[[122915,122916],2],[122917,3],[[122918,122922],2],[[122923,122927],3],[122928,1,"\u0430"],[122929,1,"\u0431"],[122930,1,"\u0432"],[122931,1,"\u0433"],[122932,1,"\u0434"],[122933,1,"\u0435"],[122934,1,"\u0436"],[122935,1,"\u0437"],[122936,1,"\u0438"],[122937,1,"\u043A"],[122938,1,"\u043B"],[122939,1,"\u043C"],[122940,1,"\u043E"],[122941,1,"\u043F"],[122942,1,"\u0440"],[122943,1,"\u0441"],[122944,1,"\u0442"],[122945,1,"\u0443"],[122946,1,"\u0444"],[122947,1,"\u0445"],[122948,1,"\u0446"],[122949,1,"\u0447"],[122950,1,"\u0448"],[122951,1,"\u044B"],[122952,1,"\u044D"],[122953,1,"\u044E"],[122954,1,"\uA689"],[122955,1,"\u04D9"],[122956,1,"\u0456"],[122957,1,"\u0458"],[122958,1,"\u04E9"],[122959,1,"\u04AF"],[122960,1,"\u04CF"],[122961,1,"\u0430"],[122962,1,"\u0431"],[122963,1,"\u0432"],[122964,1,"\u0433"],[122965,1,"\u0434"],[122966,1,"\u0435"],[122967,1,"\u0436"],[122968,1,"\u0437"],[122969,1,"\u0438"],[122970,1,"\u043A"],[122971,1,"\u043B"],[122972,1,"\u043E"],[122973,1,"\u043F"],[122974,1,"\u0441"],[122975,1,"\u0443"],[122976,1,"\u0444"],[122977,1,"\u0445"],[122978,1,"\u0446"],[122979,1,"\u0447"],[122980,1,"\u0448"],[122981,1,"\u044A"],[122982,1,"\u044B"],[122983,1,"\u0491"],[122984,1,"\u0456"],[122985,1,"\u0455"],[122986,1,"\u045F"],[122987,1,"\u04AB"],[122988,1,"\uA651"],[122989,1,"\u04B1"],[[122990,123022],3],[123023,2],[[123024,123135],3],[[123136,123180],2],[[123181,123183],3],[[123184,123197],2],[[123198,123199],3],[[123200,123209],2],[[123210,123213],3],[123214,2],[123215,2],[[123216,123535],3],[[123536,123566],2],[[123567,123583],3],[[123584,123641],2],[[123642,123646],3],[123647,2],[[123648,124111],3],[[124112,124153],2],[[124154,124367],3],[[124368,124410],2],[[124411,124414],3],[124415,2],[[124416,124607],3],[[124608,124638],2],[124639,3],[[124640,124661],2],[[124662,124669],3],[[124670,124671],2],[[124672,124895],3],[[124896,124902],2],[124903,3],[[124904,124907],2],[124908,3],[[124909,124910],2],[124911,3],[[124912,124926],2],[124927,3],[[124928,125124],2],[[125125,125126],3],[[125127,125135],2],[[125136,125142],2],[[125143,125183],3],[125184,1,"\uD83A\uDD22"],[125185,1,"\uD83A\uDD23"],[125186,1,"\uD83A\uDD24"],[125187,1,"\uD83A\uDD25"],[125188,1,"\uD83A\uDD26"],[125189,1,"\uD83A\uDD27"],[125190,1,"\uD83A\uDD28"],[125191,1,"\uD83A\uDD29"],[125192,1,"\uD83A\uDD2A"],[125193,1,"\uD83A\uDD2B"],[125194,1,"\uD83A\uDD2C"],[125195,1,"\uD83A\uDD2D"],[125196,1,"\uD83A\uDD2E"],[125197,1,"\uD83A\uDD2F"],[125198,1,"\uD83A\uDD30"],[125199,1,"\uD83A\uDD31"],[125200,1,"\uD83A\uDD32"],[125201,1,"\uD83A\uDD33"],[125202,1,"\uD83A\uDD34"],[125203,1,"\uD83A\uDD35"],[125204,1,"\uD83A\uDD36"],[125205,1,"\uD83A\uDD37"],[125206,1,"\uD83A\uDD38"],[125207,1,"\uD83A\uDD39"],[125208,1,"\uD83A\uDD3A"],[125209,1,"\uD83A\uDD3B"],[125210,1,"\uD83A\uDD3C"],[125211,1,"\uD83A\uDD3D"],[125212,1,"\uD83A\uDD3E"],[125213,1,"\uD83A\uDD3F"],[125214,1,"\uD83A\uDD40"],[125215,1,"\uD83A\uDD41"],[125216,1,"\uD83A\uDD42"],[125217,1,"\uD83A\uDD43"],[[125218,125258],2],[125259,2],[[125260,125263],3],[[125264,125273],2],[[125274,125277],3],[[125278,125279],2],[[125280,126064],3],[[126065,126132],2],[[126133,126208],3],[[126209,126269],2],[[126270,126463],3],[126464,1,"\u0627"],[126465,1,"\u0628"],[126466,1,"\u062C"],[126467,1,"\u062F"],[126468,3],[126469,1,"\u0648"],[126470,1,"\u0632"],[126471,1,"\u062D"],[126472,1,"\u0637"],[126473,1,"\u064A"],[126474,1,"\u0643"],[126475,1,"\u0644"],[126476,1,"\u0645"],[126477,1,"\u0646"],[126478,1,"\u0633"],[126479,1,"\u0639"],[126480,1,"\u0641"],[126481,1,"\u0635"],[126482,1,"\u0642"],[126483,1,"\u0631"],[126484,1,"\u0634"],[126485,1,"\u062A"],[126486,1,"\u062B"],[126487,1,"\u062E"],[126488,1,"\u0630"],[126489,1,"\u0636"],[126490,1,"\u0638"],[126491,1,"\u063A"],[126492,1,"\u066E"],[126493,1,"\u06BA"],[126494,1,"\u06A1"],[126495,1,"\u066F"],[126496,3],[126497,1,"\u0628"],[126498,1,"\u062C"],[126499,3],[126500,1,"\u0647"],[[126501,126502],3],[126503,1,"\u062D"],[126504,3],[126505,1,"\u064A"],[126506,1,"\u0643"],[126507,1,"\u0644"],[126508,1,"\u0645"],[126509,1,"\u0646"],[126510,1,"\u0633"],[126511,1,"\u0639"],[126512,1,"\u0641"],[126513,1,"\u0635"],[126514,1,"\u0642"],[126515,3],[126516,1,"\u0634"],[126517,1,"\u062A"],[126518,1,"\u062B"],[126519,1,"\u062E"],[126520,3],[126521,1,"\u0636"],[126522,3],[126523,1,"\u063A"],[[126524,126529],3],[126530,1,"\u062C"],[[126531,126534],3],[126535,1,"\u062D"],[126536,3],[126537,1,"\u064A"],[126538,3],[126539,1,"\u0644"],[126540,3],[126541,1,"\u0646"],[126542,1,"\u0633"],[126543,1,"\u0639"],[126544,3],[126545,1,"\u0635"],[126546,1,"\u0642"],[126547,3],[126548,1,"\u0634"],[[126549,126550],3],[126551,1,"\u062E"],[126552,3],[126553,1,"\u0636"],[126554,3],[126555,1,"\u063A"],[126556,3],[126557,1,"\u06BA"],[126558,3],[126559,1,"\u066F"],[126560,3],[126561,1,"\u0628"],[126562,1,"\u062C"],[126563,3],[126564,1,"\u0647"],[[126565,126566],3],[126567,1,"\u062D"],[126568,1,"\u0637"],[126569,1,"\u064A"],[126570,1,"\u0643"],[126571,3],[126572,1,"\u0645"],[126573,1,"\u0646"],[126574,1,"\u0633"],[126575,1,"\u0639"],[126576,1,"\u0641"],[126577,1,"\u0635"],[126578,1,"\u0642"],[126579,3],[126580,1,"\u0634"],[126581,1,"\u062A"],[126582,1,"\u062B"],[126583,1,"\u062E"],[126584,3],[126585,1,"\u0636"],[126586,1,"\u0638"],[126587,1,"\u063A"],[126588,1,"\u066E"],[126589,3],[126590,1,"\u06A1"],[126591,3],[126592,1,"\u0627"],[126593,1,"\u0628"],[126594,1,"\u062C"],[126595,1,"\u062F"],[126596,1,"\u0647"],[126597,1,"\u0648"],[126598,1,"\u0632"],[126599,1,"\u062D"],[126600,1,"\u0637"],[126601,1,"\u064A"],[126602,3],[126603,1,"\u0644"],[126604,1,"\u0645"],[126605,1,"\u0646"],[126606,1,"\u0633"],[126607,1,"\u0639"],[126608,1,"\u0641"],[126609,1,"\u0635"],[126610,1,"\u0642"],[126611,1,"\u0631"],[126612,1,"\u0634"],[126613,1,"\u062A"],[126614,1,"\u062B"],[126615,1,"\u062E"],[126616,1,"\u0630"],[126617,1,"\u0636"],[126618,1,"\u0638"],[126619,1,"\u063A"],[[126620,126624],3],[126625,1,"\u0628"],[126626,1,"\u062C"],[126627,1,"\u062F"],[126628,3],[126629,1,"\u0648"],[126630,1,"\u0632"],[126631,1,"\u062D"],[126632,1,"\u0637"],[126633,1,"\u064A"],[126634,3],[126635,1,"\u0644"],[126636,1,"\u0645"],[126637,1,"\u0646"],[126638,1,"\u0633"],[126639,1,"\u0639"],[126640,1,"\u0641"],[126641,1,"\u0635"],[126642,1,"\u0642"],[126643,1,"\u0631"],[126644,1,"\u0634"],[126645,1,"\u062A"],[126646,1,"\u062B"],[126647,1,"\u062E"],[126648,1,"\u0630"],[126649,1,"\u0636"],[126650,1,"\u0638"],[126651,1,"\u063A"],[[126652,126703],3],[[126704,126705],2],[[126706,126975],3],[[126976,127019],2],[[127020,127023],3],[[127024,127123],2],[[127124,127135],3],[[127136,127150],2],[[127151,127152],3],[[127153,127166],2],[127167,2],[127168,3],[[127169,127183],2],[127184,3],[[127185,127199],2],[[127200,127221],2],[[127222,127231],3],[127232,3],[127233,1,"0,"],[127234,1,"1,"],[127235,1,"2,"],[127236,1,"3,"],[127237,1,"4,"],[127238,1,"5,"],[127239,1,"6,"],[127240,1,"7,"],[127241,1,"8,"],[127242,1,"9,"],[[127243,127244],2],[[127245,127247],2],[127248,1,"(a)"],[127249,1,"(b)"],[127250,1,"(c)"],[127251,1,"(d)"],[127252,1,"(e)"],[127253,1,"(f)"],[127254,1,"(g)"],[127255,1,"(h)"],[127256,1,"(i)"],[127257,1,"(j)"],[127258,1,"(k)"],[127259,1,"(l)"],[127260,1,"(m)"],[127261,1,"(n)"],[127262,1,"(o)"],[127263,1,"(p)"],[127264,1,"(q)"],[127265,1,"(r)"],[127266,1,"(s)"],[127267,1,"(t)"],[127268,1,"(u)"],[127269,1,"(v)"],[127270,1,"(w)"],[127271,1,"(x)"],[127272,1,"(y)"],[127273,1,"(z)"],[127274,1,"\u3014s\u3015"],[127275,1,"c"],[127276,1,"r"],[127277,1,"cd"],[127278,1,"wz"],[127279,2],[127280,1,"a"],[127281,1,"b"],[127282,1,"c"],[127283,1,"d"],[127284,1,"e"],[127285,1,"f"],[127286,1,"g"],[127287,1,"h"],[127288,1,"i"],[127289,1,"j"],[127290,1,"k"],[127291,1,"l"],[127292,1,"m"],[127293,1,"n"],[127294,1,"o"],[127295,1,"p"],[127296,1,"q"],[127297,1,"r"],[127298,1,"s"],[127299,1,"t"],[127300,1,"u"],[127301,1,"v"],[127302,1,"w"],[127303,1,"x"],[127304,1,"y"],[127305,1,"z"],[127306,1,"hv"],[127307,1,"mv"],[127308,1,"sd"],[127309,1,"ss"],[127310,1,"ppv"],[127311,1,"wc"],[[127312,127318],2],[127319,2],[[127320,127326],2],[127327,2],[[127328,127337],2],[127338,1,"mc"],[127339,1,"md"],[127340,1,"mr"],[[127341,127343],2],[[127344,127352],2],[127353,2],[127354,2],[[127355,127356],2],[[127357,127358],2],[127359,2],[[127360,127369],2],[[127370,127373],2],[[127374,127375],2],[127376,1,"dj"],[[127377,127386],2],[[127387,127404],2],[127405,2],[[127406,127461],3],[[127462,127487],2],[127488,1,"\u307B\u304B"],[127489,1,"\u30B3\u30B3"],[127490,1,"\u30B5"],[[127491,127503],3],[127504,1,"\u624B"],[127505,1,"\u5B57"],[127506,1,"\u53CC"],[127507,1,"\u30C7"],[127508,1,"\u4E8C"],[127509,1,"\u591A"],[127510,1,"\u89E3"],[127511,1,"\u5929"],[127512,1,"\u4EA4"],[127513,1,"\u6620"],[127514,1,"\u7121"],[127515,1,"\u6599"],[127516,1,"\u524D"],[127517,1,"\u5F8C"],[127518,1,"\u518D"],[127519,1,"\u65B0"],[127520,1,"\u521D"],[127521,1,"\u7D42"],[127522,1,"\u751F"],[127523,1,"\u8CA9"],[127524,1,"\u58F0"],[127525,1,"\u5439"],[127526,1,"\u6F14"],[127527,1,"\u6295"],[127528,1,"\u6355"],[127529,1,"\u4E00"],[127530,1,"\u4E09"],[127531,1,"\u904A"],[127532,1,"\u5DE6"],[127533,1,"\u4E2D"],[127534,1,"\u53F3"],[127535,1,"\u6307"],[127536,1,"\u8D70"],[127537,1,"\u6253"],[127538,1,"\u7981"],[127539,1,"\u7A7A"],[127540,1,"\u5408"],[127541,1,"\u6E80"],[127542,1,"\u6709"],[127543,1,"\u6708"],[127544,1,"\u7533"],[127545,1,"\u5272"],[127546,1,"\u55B6"],[127547,1,"\u914D"],[[127548,127551],3],[127552,1,"\u3014\u672C\u3015"],[127553,1,"\u3014\u4E09\u3015"],[127554,1,"\u3014\u4E8C\u3015"],[127555,1,"\u3014\u5B89\u3015"],[127556,1,"\u3014\u70B9\u3015"],[127557,1,"\u3014\u6253\u3015"],[127558,1,"\u3014\u76D7\u3015"],[127559,1,"\u3014\u52DD\u3015"],[127560,1,"\u3014\u6557\u3015"],[[127561,127567],3],[127568,1,"\u5F97"],[127569,1,"\u53EF"],[[127570,127583],3],[[127584,127589],2],[[127590,127743],3],[[127744,127776],2],[[127777,127788],2],[[127789,127791],2],[[127792,127797],2],[127798,2],[[127799,127868],2],[127869,2],[[127870,127871],2],[[127872,127891],2],[[127892,127903],2],[[127904,127940],2],[127941,2],[[127942,127946],2],[[127947,127950],2],[[127951,127955],2],[[127956,127967],2],[[127968,127984],2],[[127985,127991],2],[[127992,127999],2],[[128000,128062],2],[128063,2],[128064,2],[128065,2],[[128066,128247],2],[128248,2],[[128249,128252],2],[[128253,128254],2],[128255,2],[[128256,128317],2],[[128318,128319],2],[[128320,128323],2],[[128324,128330],2],[[128331,128335],2],[[128336,128359],2],[[128360,128377],2],[128378,2],[[128379,128419],2],[128420,2],[[128421,128506],2],[[128507,128511],2],[128512,2],[[128513,128528],2],[128529,2],[[128530,128532],2],[128533,2],[128534,2],[128535,2],[128536,2],[128537,2],[128538,2],[128539,2],[[128540,128542],2],[128543,2],[[128544,128549],2],[[128550,128551],2],[[128552,128555],2],[128556,2],[128557,2],[[128558,128559],2],[[128560,128563],2],[128564,2],[[128565,128576],2],[[128577,128578],2],[[128579,128580],2],[[128581,128591],2],[[128592,128639],2],[[128640,128709],2],[[128710,128719],2],[128720,2],[[128721,128722],2],[[128723,128724],2],[128725,2],[[128726,128727],2],[128728,2],[[128729,128731],3],[128732,2],[[128733,128735],2],[[128736,128748],2],[[128749,128751],3],[[128752,128755],2],[[128756,128758],2],[[128759,128760],2],[128761,2],[128762,2],[[128763,128764],2],[[128765,128767],3],[[128768,128883],2],[[128884,128886],2],[[128887,128890],2],[[128891,128895],2],[[128896,128980],2],[[128981,128984],2],[128985,2],[[128986,128991],3],[[128992,129003],2],[[129004,129007],3],[129008,2],[[129009,129023],3],[[129024,129035],2],[[129036,129039],3],[[129040,129095],2],[[129096,129103],3],[[129104,129113],2],[[129114,129119],3],[[129120,129159],2],[[129160,129167],3],[[129168,129197],2],[[129198,129199],3],[[129200,129201],2],[[129202,129211],2],[[129212,129215],3],[[129216,129217],2],[[129218,129231],3],[[129232,129240],2],[[129241,129279],3],[[129280,129291],2],[129292,2],[[129293,129295],2],[[129296,129304],2],[[129305,129310],2],[129311,2],[[129312,129319],2],[[129320,129327],2],[129328,2],[[129329,129330],2],[[129331,129342],2],[129343,2],[[129344,129355],2],[129356,2],[[129357,129359],2],[[129360,129374],2],[[129375,129387],2],[[129388,129392],2],[129393,2],[129394,2],[[129395,129398],2],[[129399,129400],2],[129401,2],[129402,2],[129403,2],[[129404,129407],2],[[129408,129412],2],[[129413,129425],2],[[129426,129431],2],[[129432,129442],2],[[129443,129444],2],[[129445,129450],2],[[129451,129453],2],[[129454,129455],2],[[129456,129465],2],[[129466,129471],2],[129472,2],[[129473,129474],2],[[129475,129482],2],[129483,2],[129484,2],[[129485,129487],2],[[129488,129510],2],[[129511,129535],2],[[129536,129619],2],[[129620,129623],2],[[129624,129631],3],[[129632,129645],2],[[129646,129647],3],[[129648,129651],2],[129652,2],[[129653,129655],2],[[129656,129658],2],[[129659,129660],2],[[129661,129663],3],[[129664,129666],2],[[129667,129670],2],[[129671,129672],2],[129673,2],[129674,2],[[129675,129677],3],[129678,2],[129679,2],[[129680,129685],2],[[129686,129704],2],[[129705,129708],2],[[129709,129711],2],[[129712,129718],2],[[129719,129722],2],[[129723,129725],2],[129726,2],[129727,2],[[129728,129730],2],[[129731,129733],2],[129734,2],[129735,3],[129736,2],[[129737,129740],3],[129741,2],[[129742,129743],2],[[129744,129750],2],[[129751,129753],2],[[129754,129755],2],[129756,2],[[129757,129758],3],[129759,2],[[129760,129767],2],[129768,2],[129769,2],[129770,2],[[129771,129774],3],[129775,2],[[129776,129782],2],[[129783,129784],2],[[129785,129791],3],[[129792,129938],2],[129939,3],[[129940,129994],2],[[129995,130031],2],[130032,1,"0"],[130033,1,"1"],[130034,1,"2"],[130035,1,"3"],[130036,1,"4"],[130037,1,"5"],[130038,1,"6"],[130039,1,"7"],[130040,1,"8"],[130041,1,"9"],[130042,2],[[130043,131069],3],[[131070,131071],3],[[131072,173782],2],[[173783,173789],2],[[173790,173791],2],[[173792,173823],3],[[173824,177972],2],[[177973,177976],2],[177977,2],[[177978,177983],2],[[177984,178205],2],[[178206,178207],3],[[178208,183969],2],[[183970,183981],2],[[183982,183983],3],[[183984,191456],2],[[191457,191471],3],[[191472,192093],2],[[192094,194559],3],[194560,1,"\u4E3D"],[194561,1,"\u4E38"],[194562,1,"\u4E41"],[194563,1,"\uD840\uDD22"],[194564,1,"\u4F60"],[194565,1,"\u4FAE"],[194566,1,"\u4FBB"],[194567,1,"\u5002"],[194568,1,"\u507A"],[194569,1,"\u5099"],[194570,1,"\u50E7"],[194571,1,"\u50CF"],[194572,1,"\u349E"],[194573,1,"\uD841\uDE3A"],[194574,1,"\u514D"],[194575,1,"\u5154"],[194576,1,"\u5164"],[194577,1,"\u5177"],[194578,1,"\uD841\uDD1C"],[194579,1,"\u34B9"],[194580,1,"\u5167"],[194581,1,"\u518D"],[194582,1,"\uD841\uDD4B"],[194583,1,"\u5197"],[194584,1,"\u51A4"],[194585,1,"\u4ECC"],[194586,1,"\u51AC"],[194587,1,"\u51B5"],[194588,1,"\uD864\uDDDF"],[194589,1,"\u51F5"],[194590,1,"\u5203"],[194591,1,"\u34DF"],[194592,1,"\u523B"],[194593,1,"\u5246"],[194594,1,"\u5272"],[194595,1,"\u5277"],[194596,1,"\u3515"],[194597,1,"\u52C7"],[194598,1,"\u52C9"],[194599,1,"\u52E4"],[194600,1,"\u52FA"],[194601,1,"\u5305"],[194602,1,"\u5306"],[194603,1,"\u5317"],[194604,1,"\u5349"],[194605,1,"\u5351"],[194606,1,"\u535A"],[194607,1,"\u5373"],[194608,1,"\u537D"],[[194609,194611],1,"\u537F"],[194612,1,"\uD842\uDE2C"],[194613,1,"\u7070"],[194614,1,"\u53CA"],[194615,1,"\u53DF"],[194616,1,"\uD842\uDF63"],[194617,1,"\u53EB"],[194618,1,"\u53F1"],[194619,1,"\u5406"],[194620,1,"\u549E"],[194621,1,"\u5438"],[194622,1,"\u5448"],[194623,1,"\u5468"],[194624,1,"\u54A2"],[194625,1,"\u54F6"],[194626,1,"\u5510"],[194627,1,"\u5553"],[194628,1,"\u5563"],[[194629,194630],1,"\u5584"],[194631,1,"\u5599"],[194632,1,"\u55AB"],[194633,1,"\u55B3"],[194634,1,"\u55C2"],[194635,1,"\u5716"],[194636,1,"\u5606"],[194637,1,"\u5717"],[194638,1,"\u5651"],[194639,1,"\u5674"],[194640,1,"\u5207"],[194641,1,"\u58EE"],[194642,1,"\u57CE"],[194643,1,"\u57F4"],[194644,1,"\u580D"],[194645,1,"\u578B"],[194646,1,"\u5832"],[194647,1,"\u5831"],[194648,1,"\u58AC"],[194649,1,"\uD845\uDCE4"],[194650,1,"\u58F2"],[194651,1,"\u58F7"],[194652,1,"\u5906"],[194653,1,"\u591A"],[194654,1,"\u5922"],[194655,1,"\u5962"],[194656,1,"\uD845\uDEA8"],[194657,1,"\uD845\uDEEA"],[194658,1,"\u59EC"],[194659,1,"\u5A1B"],[194660,1,"\u5A27"],[194661,1,"\u59D8"],[194662,1,"\u5A66"],[194663,1,"\u36EE"],[194664,1,"\u36FC"],[194665,1,"\u5B08"],[[194666,194667],1,"\u5B3E"],[194668,1,"\uD846\uDDC8"],[194669,1,"\u5BC3"],[194670,1,"\u5BD8"],[194671,1,"\u5BE7"],[194672,1,"\u5BF3"],[194673,1,"\uD846\uDF18"],[194674,1,"\u5BFF"],[194675,1,"\u5C06"],[194676,1,"\u5F53"],[194677,1,"\u5C22"],[194678,1,"\u3781"],[194679,1,"\u5C60"],[194680,1,"\u5C6E"],[194681,1,"\u5CC0"],[194682,1,"\u5C8D"],[194683,1,"\uD847\uDDE4"],[194684,1,"\u5D43"],[194685,1,"\uD847\uDDE6"],[194686,1,"\u5D6E"],[194687,1,"\u5D6B"],[194688,1,"\u5D7C"],[194689,1,"\u5DE1"],[194690,1,"\u5DE2"],[194691,1,"\u382F"],[194692,1,"\u5DFD"],[194693,1,"\u5E28"],[194694,1,"\u5E3D"],[194695,1,"\u5E69"],[194696,1,"\u3862"],[194697,1,"\uD848\uDD83"],[194698,1,"\u387C"],[194699,1,"\u5EB0"],[194700,1,"\u5EB3"],[194701,1,"\u5EB6"],[194702,1,"\u5ECA"],[194703,1,"\uD868\uDF92"],[194704,1,"\u5EFE"],[[194705,194706],1,"\uD848\uDF31"],[194707,1,"\u8201"],[[194708,194709],1,"\u5F22"],[194710,1,"\u38C7"],[194711,1,"\uD84C\uDEB8"],[194712,1,"\uD858\uDDDA"],[194713,1,"\u5F62"],[194714,1,"\u5F6B"],[194715,1,"\u38E3"],[194716,1,"\u5F9A"],[194717,1,"\u5FCD"],[194718,1,"\u5FD7"],[194719,1,"\u5FF9"],[194720,1,"\u6081"],[194721,1,"\u393A"],[194722,1,"\u391C"],[194723,1,"\u6094"],[194724,1,"\uD849\uDED4"],[194725,1,"\u60C7"],[194726,1,"\u6148"],[194727,1,"\u614C"],[194728,1,"\u614E"],[194729,1,"\u614C"],[194730,1,"\u617A"],[194731,1,"\u618E"],[194732,1,"\u61B2"],[194733,1,"\u61A4"],[194734,1,"\u61AF"],[194735,1,"\u61DE"],[194736,1,"\u61F2"],[194737,1,"\u61F6"],[194738,1,"\u6210"],[194739,1,"\u621B"],[194740,1,"\u625D"],[194741,1,"\u62B1"],[194742,1,"\u62D4"],[194743,1,"\u6350"],[194744,1,"\uD84A\uDF0C"],[194745,1,"\u633D"],[194746,1,"\u62FC"],[194747,1,"\u6368"],[194748,1,"\u6383"],[194749,1,"\u63E4"],[194750,1,"\uD84A\uDFF1"],[194751,1,"\u6422"],[194752,1,"\u63C5"],[194753,1,"\u63A9"],[194754,1,"\u3A2E"],[194755,1,"\u6469"],[194756,1,"\u647E"],[194757,1,"\u649D"],[194758,1,"\u6477"],[194759,1,"\u3A6C"],[194760,1,"\u654F"],[194761,1,"\u656C"],[194762,1,"\uD84C\uDC0A"],[194763,1,"\u65E3"],[194764,1,"\u66F8"],[194765,1,"\u6649"],[194766,1,"\u3B19"],[194767,1,"\u6691"],[194768,1,"\u3B08"],[194769,1,"\u3AE4"],[194770,1,"\u5192"],[194771,1,"\u5195"],[194772,1,"\u6700"],[194773,1,"\u669C"],[194774,1,"\u80AD"],[194775,1,"\u43D9"],[194776,1,"\u6717"],[194777,1,"\u671B"],[194778,1,"\u6721"],[194779,1,"\u675E"],[194780,1,"\u6753"],[194781,1,"\uD84C\uDFC3"],[194782,1,"\u3B49"],[194783,1,"\u67FA"],[194784,1,"\u6785"],[194785,1,"\u6852"],[194786,1,"\u6885"],[194787,1,"\uD84D\uDC6D"],[194788,1,"\u688E"],[194789,1,"\u681F"],[194790,1,"\u6914"],[194791,1,"\u3B9D"],[194792,1,"\u6942"],[194793,1,"\u69A3"],[194794,1,"\u69EA"],[194795,1,"\u6AA8"],[194796,1,"\uD84D\uDEA3"],[194797,1,"\u6ADB"],[194798,1,"\u3C18"],[194799,1,"\u6B21"],[194800,1,"\uD84E\uDCA7"],[194801,1,"\u6B54"],[194802,1,"\u3C4E"],[194803,1,"\u6B72"],[194804,1,"\u6B9F"],[194805,1,"\u6BBA"],[194806,1,"\u6BBB"],[194807,1,"\uD84E\uDE8D"],[194808,1,"\uD847\uDD0B"],[194809,1,"\uD84E\uDEFA"],[194810,1,"\u6C4E"],[194811,1,"\uD84F\uDCBC"],[194812,1,"\u6CBF"],[194813,1,"\u6CCD"],[194814,1,"\u6C67"],[194815,1,"\u6D16"],[194816,1,"\u6D3E"],[194817,1,"\u6D77"],[194818,1,"\u6D41"],[194819,1,"\u6D69"],[194820,1,"\u6D78"],[194821,1,"\u6D85"],[194822,1,"\uD84F\uDD1E"],[194823,1,"\u6D34"],[194824,1,"\u6E2F"],[194825,1,"\u6E6E"],[194826,1,"\u3D33"],[194827,1,"\u6ECB"],[194828,1,"\u6EC7"],[194829,1,"\uD84F\uDED1"],[194830,1,"\u6DF9"],[194831,1,"\u6F6E"],[194832,1,"\uD84F\uDF5E"],[194833,1,"\uD84F\uDF8E"],[194834,1,"\u6FC6"],[194835,1,"\u7039"],[194836,1,"\u701E"],[194837,1,"\u701B"],[194838,1,"\u3D96"],[194839,1,"\u704A"],[194840,1,"\u707D"],[194841,1,"\u7077"],[194842,1,"\u70AD"],[194843,1,"\uD841\uDD25"],[194844,1,"\u7145"],[194845,1,"\uD850\uDE63"],[194846,1,"\u719C"],[194847,1,"\uD850\uDFAB"],[194848,1,"\u7228"],[194849,1,"\u7235"],[194850,1,"\u7250"],[194851,1,"\uD851\uDE08"],[194852,1,"\u7280"],[194853,1,"\u7295"],[194854,1,"\uD851\uDF35"],[194855,1,"\uD852\uDC14"],[194856,1,"\u737A"],[194857,1,"\u738B"],[194858,1,"\u3EAC"],[194859,1,"\u73A5"],[[194860,194861],1,"\u3EB8"],[194862,1,"\u7447"],[194863,1,"\u745C"],[194864,1,"\u7471"],[194865,1,"\u7485"],[194866,1,"\u74CA"],[194867,1,"\u3F1B"],[194868,1,"\u7524"],[194869,1,"\uD853\uDC36"],[194870,1,"\u753E"],[194871,1,"\uD853\uDC92"],[194872,1,"\u7570"],[194873,1,"\uD848\uDD9F"],[194874,1,"\u7610"],[194875,1,"\uD853\uDFA1"],[194876,1,"\uD853\uDFB8"],[194877,1,"\uD854\uDC44"],[194878,1,"\u3FFC"],[194879,1,"\u4008"],[194880,1,"\u76F4"],[194881,1,"\uD854\uDCF3"],[194882,1,"\uD854\uDCF2"],[194883,1,"\uD854\uDD19"],[194884,1,"\uD854\uDD33"],[194885,1,"\u771E"],[[194886,194887],1,"\u771F"],[194888,1,"\u774A"],[194889,1,"\u4039"],[194890,1,"\u778B"],[194891,1,"\u4046"],[194892,1,"\u4096"],[194893,1,"\uD855\uDC1D"],[194894,1,"\u784E"],[194895,1,"\u788C"],[194896,1,"\u78CC"],[194897,1,"\u40E3"],[194898,1,"\uD855\uDE26"],[194899,1,"\u7956"],[194900,1,"\uD855\uDE9A"],[194901,1,"\uD855\uDEC5"],[194902,1,"\u798F"],[194903,1,"\u79EB"],[194904,1,"\u412F"],[194905,1,"\u7A40"],[194906,1,"\u7A4A"],[194907,1,"\u7A4F"],[194908,1,"\uD856\uDD7C"],[[194909,194910],1,"\uD856\uDEA7"],[194911,1,"\u7AEE"],[194912,1,"\u4202"],[194913,1,"\uD856\uDFAB"],[194914,1,"\u7BC6"],[194915,1,"\u7BC9"],[194916,1,"\u4227"],[194917,1,"\uD857\uDC80"],[194918,1,"\u7CD2"],[194919,1,"\u42A0"],[194920,1,"\u7CE8"],[194921,1,"\u7CE3"],[194922,1,"\u7D00"],[194923,1,"\uD857\uDF86"],[194924,1,"\u7D63"],[194925,1,"\u4301"],[194926,1,"\u7DC7"],[194927,1,"\u7E02"],[194928,1,"\u7E45"],[194929,1,"\u4334"],[194930,1,"\uD858\uDE28"],[194931,1,"\uD858\uDE47"],[194932,1,"\u4359"],[194933,1,"\uD858\uDED9"],[194934,1,"\u7F7A"],[194935,1,"\uD858\uDF3E"],[194936,1,"\u7F95"],[194937,1,"\u7FFA"],[194938,1,"\u8005"],[194939,1,"\uD859\uDCDA"],[194940,1,"\uD859\uDD23"],[194941,1,"\u8060"],[194942,1,"\uD859\uDDA8"],[194943,1,"\u8070"],[194944,1,"\uD84C\uDF5F"],[194945,1,"\u43D5"],[194946,1,"\u80B2"],[194947,1,"\u8103"],[194948,1,"\u440B"],[194949,1,"\u813E"],[194950,1,"\u5AB5"],[194951,1,"\uD859\uDFA7"],[194952,1,"\uD859\uDFB5"],[194953,1,"\uD84C\uDF93"],[194954,1,"\uD84C\uDF9C"],[194955,1,"\u8201"],[194956,1,"\u8204"],[194957,1,"\u8F9E"],[194958,1,"\u446B"],[194959,1,"\u8291"],[194960,1,"\u828B"],[194961,1,"\u829D"],[194962,1,"\u52B3"],[194963,1,"\u82B1"],[194964,1,"\u82B3"],[194965,1,"\u82BD"],[194966,1,"\u82E6"],[194967,1,"\uD85A\uDF3C"],[194968,1,"\u82E5"],[194969,1,"\u831D"],[194970,1,"\u8363"],[194971,1,"\u83AD"],[194972,1,"\u8323"],[194973,1,"\u83BD"],[194974,1,"\u83E7"],[194975,1,"\u8457"],[194976,1,"\u8353"],[194977,1,"\u83CA"],[194978,1,"\u83CC"],[194979,1,"\u83DC"],[194980,1,"\uD85B\uDC36"],[194981,1,"\uD85B\uDD6B"],[194982,1,"\uD85B\uDCD5"],[194983,1,"\u452B"],[194984,1,"\u84F1"],[194985,1,"\u84F3"],[194986,1,"\u8516"],[194987,1,"\uD85C\uDFCA"],[194988,1,"\u8564"],[194989,1,"\uD85B\uDF2C"],[194990,1,"\u455D"],[194991,1,"\u4561"],[194992,1,"\uD85B\uDFB1"],[194993,1,"\uD85C\uDCD2"],[194994,1,"\u456B"],[194995,1,"\u8650"],[194996,1,"\u865C"],[194997,1,"\u8667"],[194998,1,"\u8669"],[194999,1,"\u86A9"],[195000,1,"\u8688"],[195001,1,"\u870E"],[195002,1,"\u86E2"],[195003,1,"\u8779"],[195004,1,"\u8728"],[195005,1,"\u876B"],[195006,1,"\u8786"],[195007,1,"\u45D7"],[195008,1,"\u87E1"],[195009,1,"\u8801"],[195010,1,"\u45F9"],[195011,1,"\u8860"],[195012,1,"\u8863"],[195013,1,"\uD85D\uDE67"],[195014,1,"\u88D7"],[195015,1,"\u88DE"],[195016,1,"\u4635"],[195017,1,"\u88FA"],[195018,1,"\u34BB"],[195019,1,"\uD85E\uDCAE"],[195020,1,"\uD85E\uDD66"],[195021,1,"\u46BE"],[195022,1,"\u46C7"],[195023,1,"\u8AA0"],[195024,1,"\u8AED"],[195025,1,"\u8B8A"],[195026,1,"\u8C55"],[195027,1,"\uD85F\uDCA8"],[195028,1,"\u8CAB"],[195029,1,"\u8CC1"],[195030,1,"\u8D1B"],[195031,1,"\u8D77"],[195032,1,"\uD85F\uDF2F"],[195033,1,"\uD842\uDC04"],[195034,1,"\u8DCB"],[195035,1,"\u8DBC"],[195036,1,"\u8DF0"],[195037,1,"\uD842\uDCDE"],[195038,1,"\u8ED4"],[195039,1,"\u8F38"],[195040,1,"\uD861\uDDD2"],[195041,1,"\uD861\uDDED"],[195042,1,"\u9094"],[195043,1,"\u90F1"],[195044,1,"\u9111"],[195045,1,"\uD861\uDF2E"],[195046,1,"\u911B"],[195047,1,"\u9238"],[195048,1,"\u92D7"],[195049,1,"\u92D8"],[195050,1,"\u927C"],[195051,1,"\u93F9"],[195052,1,"\u9415"],[195053,1,"\uD862\uDFFA"],[195054,1,"\u958B"],[195055,1,"\u4995"],[195056,1,"\u95B7"],[195057,1,"\uD863\uDD77"],[195058,1,"\u49E6"],[195059,1,"\u96C3"],[195060,1,"\u5DB2"],[195061,1,"\u9723"],[195062,1,"\uD864\uDD45"],[195063,1,"\uD864\uDE1A"],[195064,1,"\u4A6E"],[195065,1,"\u4A76"],[195066,1,"\u97E0"],[195067,1,"\uD865\uDC0A"],[195068,1,"\u4AB2"],[195069,1,"\uD865\uDC96"],[[195070,195071],1,"\u980B"],[195072,1,"\u9829"],[195073,1,"\uD865\uDDB6"],[195074,1,"\u98E2"],[195075,1,"\u4B33"],[195076,1,"\u9929"],[195077,1,"\u99A7"],[195078,1,"\u99C2"],[195079,1,"\u99FE"],[195080,1,"\u4BCE"],[195081,1,"\uD866\uDF30"],[195082,1,"\u9B12"],[195083,1,"\u9C40"],[195084,1,"\u9CFD"],[195085,1,"\u4CCE"],[195086,1,"\u4CED"],[195087,1,"\u9D67"],[195088,1,"\uD868\uDCCE"],[195089,1,"\u4CF8"],[195090,1,"\uD868\uDD05"],[195091,1,"\uD868\uDE0E"],[195092,1,"\uD868\uDE91"],[195093,1,"\u9EBB"],[195094,1,"\u4D56"],[195095,1,"\u9EF9"],[195096,1,"\u9EFE"],[195097,1,"\u9F05"],[195098,1,"\u9F0F"],[195099,1,"\u9F16"],[195100,1,"\u9F3B"],[195101,1,"\uD869\uDE00"],[[195102,196605],3],[[196606,196607],3],[[196608,201546],2],[[201547,201551],3],[[201552,205743],2],[[205744,210041],2],[[210042,262141],3],[[262142,262143],3],[[262144,327677],3],[[327678,327679],3],[[327680,393213],3],[[393214,393215],3],[[393216,458749],3],[[458750,458751],3],[[458752,524285],3],[[524286,524287],3],[[524288,589821],3],[[589822,589823],3],[[589824,655357],3],[[655358,655359],3],[[655360,720893],3],[[720894,720895],3],[[720896,786429],3],[[786430,786431],3],[[786432,851965],3],[[851966,851967],3],[[851968,917501],3],[[917502,917503],3],[917504,3],[917505,3],[[917506,917535],3],[[917536,917631],3],[[917632,917759],3],[[917760,917999],7],[[918000,983037],3],[[983038,983039],3],[[983040,1048573],3],[[1048574,1048575],3],[[1048576,1114109],3],[[1114110,1114111],3]]});var cP=g(function(Tle,aP){Tle.STATUS_MAPPING={mapped:1,valid:2,disallowed:3,deviation:6,ignored:7}});var dP=g(function(f8e,fP){var Sl=sP(),Qt=oP(),I_=uP(),{STATUS_MAPPING:Uu}=cP();function $_(e){return/[^\x00-\x7F]/u.test(e)}function lP(e){let t=0,r=I_.length-1;while(t<=r){let n=Math.floor((t+r)/2),s=I_[n],i=Array.isArray(s[0])?s[0][0]:s[0],o=Array.isArray(s[0])?s[0][1]:s[0];if(i<=e&&o>=e)return s.slice(1);else if(i>e)r=n-1;else t=n+1}return null}function xle(e,{transitionalProcessing:t}){let r="";for(let n of e){let[s,i]=lP(n.codePointAt(0));switch(s){case Uu.disallowed:r+=n;break;case Uu.ignored:break;case Uu.mapped:if(t&&n==="\u1E9E")r+="ss";else r+=i;break;case Uu.deviation:if(t)r+=i;else r+=n;break;case Uu.valid:r+=n;break}}return r}function Ple(e,{checkHyphens:t,checkBidi:r,checkJoiners:n,transitionalProcessing:s,useSTD3ASCIIRules:i,isBidi:o}){if(e.length===0)return!0;if(e.normalize("NFC")!==e)return!1;let u=Array.from(e);if(t){if(u[2]==="-"&&u[3]==="-"||(e.startsWith("-")||e.endsWith("-")))return!1}if(!t){if(e.startsWith("xn--"))return!1}if(e.includes("."))return!1;if(Qt.combiningMarks.test(u[0]))return!1;for(let a of u){let c=a.codePointAt(0),[l]=lP(c);if(s){if(l!==Uu.valid)return!1}else if(l!==Uu.valid&&l!==Uu.deviation)return!1;if(i&&c<=127){if(!/^(?:[a-z]|[0-9]|-)$/u.test(a))return!1}}if(n){let a=0;for(let[c,l]of u.entries())if(l==="\u200C"||l==="\u200D"){if(c>0){if(Qt.combiningClassVirama.test(u[c-1]))continue;if(l==="\u200C"){let f=u.indexOf("\u200C",c+1),h=f<0?u.slice(a):u.slice(a,f);if(Qt.validZWNJ.test(h.join(""))){a=c+1;continue}}}return!1}}if(r&&o){let a;if(Qt.bidiS1LTR.test(u[0]))a=!1;else if(Qt.bidiS1RTL.test(u[0]))a=!0;else return!1;if(a){if(!Qt.bidiS2.test(e)||!Qt.bidiS3.test(e)||Qt.bidiS4EN.test(e)&&Qt.bidiS4AN.test(e))return!1}else if(!Qt.bidiS5.test(e)||!Qt.bidiS6.test(e))return!1}return!0}function Fle(e){let t=e.map((r)=>{if(r.startsWith("xn--"))try{return Sl.decode(r.substring(4))}catch{return""}return r}).join(".");return Qt.bidiDomain.test(t)}function hP(e,t){let r=xle(e,t);r=r.normalize("NFC");let n=r.split("."),s=Fle(n),i=!1;for(let[o,u]of n.entries()){let a=u,c=t.transitionalProcessing;if(a.startsWith("xn--")){if($_(a)){i=!0;continue}try{a=Sl.decode(a.substring(4))}catch{if(!t.ignoreInvalidPunycode){i=!0;continue}}if(n[o]=a,a===""||!$_(a))i=!0;c=!1}if(i)continue;if(!Ple(a,{...t,transitionalProcessing:c,isBidi:s}))i=!0}return{string:n.join("."),error:i}}function Ble(e,{checkHyphens:t=!1,checkBidi:r=!1,checkJoiners:n=!1,useSTD3ASCIIRules:s=!1,verifyDNSLength:i=!1,transitionalProcessing:o=!1,ignoreInvalidPunycode:u=!1}={}){let a=hP(e,{checkHyphens:t,checkBidi:r,checkJoiners:n,useSTD3ASCIIRules:s,transitionalProcessing:o,ignoreInvalidPunycode:u}),c=a.string.split(".");if(c=c.map((l)=>{if($_(l))try{return`xn--${Sl.encode(l)}`}catch{a.error=!0}return l}),i){let l=c.join(".").length;if(l>253||l===0)a.error=!0;for(let f=0;f<c.length;++f)if(c[f].length>63||c[f].length===0){a.error=!0;break}}if(a.error)return null;return c.join(".")}function Nle(e,{checkHyphens:t=!1,checkBidi:r=!1,checkJoiners:n=!1,useSTD3ASCIIRules:s=!1,transitionalProcessing:i=!1,ignoreInvalidPunycode:o=!1}={}){let u=hP(e,{checkHyphens:t,checkBidi:r,checkJoiners:n,useSTD3ASCIIRules:s,transitionalProcessing:i,ignoreInvalidPunycode:o});return{domain:u.string,error:u.error}}fP.exports={toASCII:Ble,toUnicode:Nle}});var v_=g(function(d8e,mP){function R_(e){return e>=48&&e<=57}function pP(e){return e>=65&&e<=90||e>=97&&e<=122}function Ile(e){return pP(e)||R_(e)}function $le(e){return R_(e)||e>=65&&e<=70||e>=97&&e<=102}mP.exports={isASCIIDigit:R_,isASCIIAlpha:pP,isASCIIAlphanumeric:Ile,isASCIIHex:$le}});var fm=g(function(p8e,yP){var Rle=new TextEncoder,vle=new TextDecoder("utf-8",{ignoreBOM:!0});function kle(e){return Rle.encode(e)}function qle(e){return vle.decode(e)}yP.exports={utf8Encode:kle,utf8DecodeWithoutBOM:qle}});var dm=g(function(m8e,SP){var{isASCIIHex:gP}=v_(),{utf8Encode:EP}=fm();function et(e){return e.codePointAt(0)}function jle(e){let t=e.toString(16).toUpperCase();if(t.length===1)t=`0${t}`;return`%${t}`}function _P(e){let t=new Uint8Array(e.byteLength),r=0;for(let n=0;n<e.byteLength;++n){let s=e[n];if(s!==37)t[r++]=s;else if(s===37&&(!gP(e[n+1])||!gP(e[n+2])))t[r++]=s;else{let i=parseInt(String.fromCodePoint(e[n+1],e[n+2]),16);t[r++]=i,n+=2}}return t.slice(0,r)}function Lle(e){let t=EP(e);return _P(t)}function k_(e){return e<=31||e>126}var Ule=new Set([et(" "),et('"'),et("<"),et(">"),et("`")]);function Vle(e){return k_(e)||Ule.has(e)}var zle=new Set([et(" "),et('"'),et("#"),et("<"),et(">")]);function q_(e){return k_(e)||zle.has(e)}function Wle(e){return q_(e)||e===et("'")}var Kle=new Set([et("?"),et("`"),et("{"),et("}"),et("^")]);function AP(e){return q_(e)||Kle.has(e)}var Hle=new Set([et("/"),et(":"),et(";"),et("="),et("@"),et("["),et("\\"),et("]"),et("|")]);function wP(e){return AP(e)||Hle.has(e)}var Gle=new Set([et("$"),et("%"),et("&"),et("+"),et(",")]);function Yle(e){return wP(e)||Gle.has(e)}var Qle=new Set([et("!"),et("'"),et("("),et(")"),et("~")]);function Jle(e){return Yle(e)||Qle.has(e)}function OP(e,t){let r=EP(e),n="";for(let s of r)if(!t(s))n+=String.fromCharCode(s);else n+=jle(s);return n}function Xle(e,t){return OP(String.fromCodePoint(e),t)}function Zle(e,t,r=!1){let n="";for(let s of e)if(r&&s===" ")n+="+";else n+=OP(s,t);return n}SP.exports={isC0ControlPercentEncode:k_,isFragmentPercentEncode:Vle,isQueryPercentEncode:q_,isSpecialQueryPercentEncode:Wle,isPathPercentEncode:AP,isUserinfoPercentEncode:wP,isURLEncodedPercentEncode:Jle,percentDecodeString:Lle,percentDecodeBytes:_P,utf8PercentEncodeString:Zle,utf8PercentEncodeCodePoint:Xle}});var W_=g(function(mm,Yn){var MP=dP(),st=v_(),{utf8DecodeWithoutBOM:e1e}=fm(),{percentDecodeString:t1e,utf8PercentEncodeCodePoint:ym,utf8PercentEncodeString:gm,isC0ControlPercentEncode:xP,isFragmentPercentEncode:r1e,isQueryPercentEncode:n1e,isSpecialQueryPercentEncode:s1e,isPathPercentEncode:i1e,isUserinfoPercentEncode:U_}=dm();function K(e){return e.codePointAt(0)}var PP={ftp:21,file:null,http:80,https:443,ws:80,wss:443},$e=Symbol("failure");function CP(e){return[...e].length}function bP(e,t){let r=e[t];return isNaN(r)?void 0:String.fromCodePoint(r)}function DP(e){return e==="."||e.toLowerCase()==="%2e"}function o1e(e){return e=e.toLowerCase(),e===".."||e==="%2e."||e===".%2e"||e==="%2e%2e"}function u1e(e,t){return st.isASCIIAlpha(e)&&(t===K(":")||t===K("|"))}function FP(e){return e.length===2&&st.isASCIIAlpha(e.codePointAt(0))&&(e[1]===":"||e[1]==="|")}function a1e(e){return e.length===2&&st.isASCIIAlpha(e.codePointAt(0))&&e[1]===":"}function BP(e){return e.search(/\u0000|\u0009|\u000A|\u000D|\u0020|#|\/|:|<|>|\?|@|\[|\\|\]|\^|\|/u)!==-1}function c1e(e){return BP(e)||e.search(/[\u0000-\u001F]|%|\u007F/u)!==-1}function pm(e){return PP[e]!==void 0}function mn(e){return pm(e.scheme)}function j_(e){return!pm(e.scheme)}function NP(e){return PP[e]}function IP(e){if(e==="")return $e;let t=10;if(e.length>=2&&e.charAt(0)==="0"&&e.charAt(1).toLowerCase()==="x")e=e.substring(2),t=16;else if(e.length>=2&&e.charAt(0)==="0")e=e.substring(1),t=8;if(e==="")return 0;let r=/[^0-7]/u;if(t===10)r=/[^0-9]/u;if(t===16)r=/[^0-9A-Fa-f]/u;if(r.test(e))return $e;return parseInt(e,t)}function l1e(e){let t=e.split(".");if(t[t.length-1]===""){if(t.length>1)t.pop()}if(t.length>4)return $e;let r=[];for(let i of t){let o=IP(i);if(o===$e)return $e;r.push(o)}for(let i=0;i<r.length-1;++i)if(r[i]>255)return $e;if(r[r.length-1]>=256**(5-r.length))return $e;let n=r.pop(),s=0;for(let i of r)n+=i*256**(3-s),++s;return n}function h1e(e){let t="",r=e;for(let n=1;n<=4;++n){if(t=String(r%256)+t,n!==4)t=`.${t}`;r=Math.floor(r/256)}return t}function f1e(e){let t=[0,0,0,0,0,0,0,0],r=0,n=null,s=0;if(e=Array.from(e,(i)=>i.codePointAt(0)),e[s]===K(":")){if(e[s+1]!==K(":"))return $e;s+=2,++r,n=r}while(s<e.length){if(r===8)return $e;if(e[s]===K(":")){if(n!==null)return $e;++s,++r,n=r;continue}let i=0,o=0;while(o<4&&st.isASCIIHex(e[s]))i=i*16+parseInt(bP(e,s),16),++s,++o;if(e[s]===K(".")){if(o===0)return $e;if(s-=o,r>6)return $e;let u=0;while(e[s]!==void 0){let a=null;if(u>0)if(e[s]===K(".")&&u<4)++s;else return $e;if(!st.isASCIIDigit(e[s]))return $e;while(st.isASCIIDigit(e[s])){let c=parseInt(bP(e,s));if(a===null)a=c;else if(a===0)return $e;else a=a*10+c;if(a>255)return $e;++s}if(t[r]=t[r]*256+a,++u,u===2||u===4)++r}if(u!==4)return $e;break}else if(e[s]===K(":")){if(++s,e[s]===void 0)return $e}else if(e[s]!==void 0)return $e;t[r]=i,++r}if(n!==null){let i=r-n;r=7;while(r!==0&&i>0){let o=t[n+i-1];t[n+i-1]=t[r],t[r]=o,--r,--i}}else if(n===null&&r!==8)return $e;return t}function d1e(e){let t="",r=y1e(e),n=!1;for(let s=0;s<=7;++s){if(n&&e[s]===0)continue;else if(n)n=!1;if(r===s){t+=s===0?"::":":",n=!0;continue}if(t+=e[s].toString(16),s!==7)t+=":"}return t}function L_(e,t=!1){if(e[0]==="["){if(e[e.length-1]!=="]")return $e;return f1e(e.substring(1,e.length-1))}if(t)return m1e(e);let r=e1e(t1e(e)),n=g1e(r);if(n===$e)return $e;if(p1e(n))return l1e(n);return n}function p1e(e){let t=e.split(".");if(t[t.length-1]===""){if(t.length===1)return!1;t.pop()}let r=t[t.length-1];if(IP(r)!==$e)return!0;if(/^[0-9]+$/u.test(r))return!0;return!1}function m1e(e){if(BP(e))return $e;return gm(e,xP)}function y1e(e){let t=null,r=1,n=null,s=0;for(let i=0;i<e.length;++i)if(e[i]!==0){if(s>r)t=n,r=s;n=null,s=0}else{if(n===null)n=i;++s}if(s>r)return n;return t}function V_(e){if(typeof e==="number")return h1e(e);if(e instanceof Array)return`[${d1e(e)}]`;return e}function g1e(e,t=!1){let r=MP.toASCII(e,{checkHyphens:t,checkBidi:!0,checkJoiners:!0,useSTD3ASCIIRules:t,transitionalProcessing:!1,verifyDNSLength:t,ignoreInvalidPunycode:!1});if(r===null)return $e;if(!t){if(r==="")return $e;if(c1e(r))return $e}return r}function E1e(e){let t=0,r=e.length;for(;t<r;++t)if(e.charCodeAt(t)>32)break;for(;r>t;--r)if(e.charCodeAt(r-1)>32)break;return e.substring(t,r)}function _1e(e){return e.replace(/\u0009|\u000A|\u000D/ug,"")}function $P(e){let{path:t}=e;if(t.length===0)return;if(e.scheme==="file"&&t.length===1&&w1e(t[0]))return;t.pop()}function RP(e){return e.username!==""||e.password!==""}function A1e(e){return e.host===null||e.host===""||e.scheme==="file"}function Uh(e){return typeof e.path==="string"}function w1e(e){return/^[A-Za-z]:$/u.test(e)}function hr(e,t,r,n,s){if(this.pointer=0,this.input=e,this.base=t||null,this.encodingOverride=r||"utf-8",this.stateOverride=s,this.url=n,this.failure=!1,this.parseError=!1,!this.url){this.url={scheme:"",username:"",password:"",host:null,port:null,path:[],query:null,fragment:null};let o=E1e(this.input);if(o!==this.input)this.parseError=!0;this.input=o}let i=_1e(this.input);if(i!==this.input)this.parseError=!0;this.input=i,this.state=s||"scheme start",this.buffer="",this.atSignSeen=!1,this.insideBrackets=!1,this.passwordTokenSeen=!1,this.input=Array.from(this.input,(o)=>o.codePointAt(0));for(;this.pointer<=this.input.length;++this.pointer){let o=this.input[this.pointer],u=isNaN(o)?void 0:String.fromCodePoint(o),a=this[`parse ${this.state}`](o,u);if(!a)break;else if(a===$e){this.failure=!0;break}}}hr.prototype["parse scheme start"]=function(t,r){if(st.isASCIIAlpha(t))this.buffer+=r.toLowerCase(),this.state="scheme";else if(!this.stateOverride)this.state="no scheme",--this.pointer;else return this.parseError=!0,$e;return!0};hr.prototype["parse scheme"]=function(t,r){if(st.isASCIIAlphanumeric(t)||t===K("+")||t===K("-")||t===K("."))this.buffer+=r.toLowerCase();else if(t===K(":")){if(this.stateOverride){if(mn(this.url)&&!pm(this.buffer))return!1;if(!mn(this.url)&&pm(this.buffer))return!1;if((RP(this.url)||this.url.port!==null)&&this.buffer==="file")return!1;if(this.url.scheme==="file"&&this.url.host==="")return!1}if(this.url.scheme=this.buffer,this.stateOverride){if(this.url.port===NP(this.url.scheme))this.url.port=null;return!1}if(this.buffer="",this.url.scheme==="file"){if(this.input[this.pointer+1]!==K("/")||this.input[this.pointer+2]!==K("/"))this.parseError=!0;this.state="file"}else if(mn(this.url)&&this.base!==null&&this.base.scheme===this.url.scheme)this.state="special relative or authority";else if(mn(this.url))this.state="special authority slashes";else if(this.input[this.pointer+1]===K("/"))this.state="path or authority",++this.pointer;else this.url.path="",this.state="opaque path"}else if(!this.stateOverride)this.buffer="",this.state="no scheme",this.pointer=-1;else return this.parseError=!0,$e;return!0};hr.prototype["parse no scheme"]=function(t){if(this.base===null||Uh(this.base)&&t!==K("#"))return $e;else if(Uh(this.base)&&t===K("#"))this.url.scheme=this.base.scheme,this.url.path=this.base.path,this.url.query=this.base.query,this.url.fragment="",this.state="fragment";else if(this.base.scheme==="file")this.state="file",--this.pointer;else this.state="relative",--this.pointer;return!0};hr.prototype["parse special relative or authority"]=function(t){if(t===K("/")&&this.input[this.pointer+1]===K("/"))this.state="special authority ignore slashes",++this.pointer;else this.parseError=!0,this.state="relative",--this.pointer;return!0};hr.prototype["parse path or authority"]=function(t){if(t===K("/"))this.state="authority";else this.state="path",--this.pointer;return!0};hr.prototype["parse relative"]=function(t){if(this.url.scheme=this.base.scheme,t===K("/"))this.state="relative slash";else if(mn(this.url)&&t===K("\\"))this.parseError=!0,this.state="relative slash";else if(this.url.username=this.base.username,this.url.password=this.base.password,this.url.host=this.base.host,this.url.port=this.base.port,this.url.path=this.base.path.slice(),this.url.query=this.base.query,t===K("?"))this.url.query="",this.state="query";else if(t===K("#"))this.url.fragment="",this.state="fragment";else if(!isNaN(t))this.url.query=null,this.url.path.pop(),this.state="path",--this.pointer;return!0};hr.prototype["parse relative slash"]=function(t){if(mn(this.url)&&(t===K("/")||t===K("\\"))){if(t===K("\\"))this.parseError=!0;this.state="special authority ignore slashes"}else if(t===K("/"))this.state="authority";else this.url.username=this.base.username,this.url.password=this.base.password,this.url.host=this.base.host,this.url.port=this.base.port,this.state="path",--this.pointer;return!0};hr.prototype["parse special authority slashes"]=function(t){if(t===K("/")&&this.input[this.pointer+1]===K("/"))this.state="special authority ignore slashes",++this.pointer;else this.parseError=!0,this.state="special authority ignore slashes",--this.pointer;return!0};hr.prototype["parse special authority ignore slashes"]=function(t){if(t!==K("/")&&t!==K("\\"))this.state="authority",--this.pointer;else this.parseError=!0;return!0};hr.prototype["parse authority"]=function(t,r){if(t===K("@")){if(this.parseError=!0,this.atSignSeen)this.buffer=`%40${this.buffer}`;this.atSignSeen=!0;let n=CP(this.buffer);for(let s=0;s<n;++s){let i=this.buffer.codePointAt(s);if(i===K(":")&&!this.passwordTokenSeen){this.passwordTokenSeen=!0;continue}let o=ym(i,U_);if(this.passwordTokenSeen)this.url.password+=o;else this.url.username+=o}this.buffer=""}else if(isNaN(t)||t===K("/")||t===K("?")||t===K("#")||mn(this.url)&&t===K("\\")){if(this.atSignSeen&&this.buffer==="")return this.parseError=!0,$e;this.pointer-=CP(this.buffer)+1,this.buffer="",this.state="host"}else this.buffer+=r;return!0};hr.prototype["parse hostname"]=hr.prototype["parse host"]=function(t,r){if(this.stateOverride&&this.url.scheme==="file")--this.pointer,this.state="file host";else if(t===K(":")&&!this.insideBrackets){if(this.buffer==="")return this.parseError=!0,$e;if(this.stateOverride==="hostname")return $e;let n=L_(this.buffer,j_(this.url));if(n===$e)return $e;this.url.host=n,this.buffer="",this.state="port"}else if(isNaN(t)||t===K("/")||t===K("?")||t===K("#")||mn(this.url)&&t===K("\\")){if(--this.pointer,mn(this.url)&&this.buffer==="")return this.parseError=!0,$e;else if(this.stateOverride&&this.buffer===""&&(RP(this.url)||this.url.port!==null))return this.parseError=!0,$e;let n=L_(this.buffer,j_(this.url));if(n===$e)return $e;if(this.url.host=n,this.buffer="",this.state="path start",this.stateOverride)return!1}else{if(t===K("["))this.insideBrackets=!0;else if(t===K("]"))this.insideBrackets=!1;this.buffer+=r}return!0};hr.prototype["parse port"]=function(t,r){if(st.isASCIIDigit(t))this.buffer+=r;else if(isNaN(t)||t===K("/")||t===K("?")||t===K("#")||mn(this.url)&&t===K("\\")||this.stateOverride){if(this.buffer!==""){let n=parseInt(this.buffer);if(n>65535)return this.parseError=!0,$e;if(this.url.port=n===NP(this.url.scheme)?null:n,this.buffer="",this.stateOverride)return!1}if(this.stateOverride)return $e;this.state="path start",--this.pointer}else return this.parseError=!0,$e;return!0};var O1e=new Set([K("/"),K("\\"),K("?"),K("#")]);function vP(e,t){let r=e.length-t;return r>=2&&u1e(e[t],e[t+1])&&(r===2||O1e.has(e[t+2]))}hr.prototype["parse file"]=function(t){if(this.url.scheme="file",this.url.host="",t===K("/")||t===K("\\")){if(t===K("\\"))this.parseError=!0;this.state="file slash"}else if(this.base!==null&&this.base.scheme==="file"){if(this.url.host=this.base.host,this.url.path=this.base.path.slice(),this.url.query=this.base.query,t===K("?"))this.url.query="",this.state="query";else if(t===K("#"))this.url.fragment="",this.state="fragment";else if(!isNaN(t)){if(this.url.query=null,!vP(this.input,this.pointer))$P(this.url);else this.parseError=!0,this.url.path=[];this.state="path",--this.pointer}}else this.state="path",--this.pointer;return!0};hr.prototype["parse file slash"]=function(t){if(t===K("/")||t===K("\\")){if(t===K("\\"))this.parseError=!0;this.state="file host"}else{if(this.base!==null&&this.base.scheme==="file"){if(!vP(this.input,this.pointer)&&a1e(this.base.path[0]))this.url.path.push(this.base.path[0]);this.url.host=this.base.host}this.state="path",--this.pointer}return!0};hr.prototype["parse file host"]=function(t,r){if(isNaN(t)||t===K("/")||t===K("\\")||t===K("?")||t===K("#"))if(--this.pointer,!this.stateOverride&&FP(this.buffer))this.parseError=!0,this.state="path";else if(this.buffer===""){if(this.url.host="",this.stateOverride)return!1;this.state="path start"}else{let n=L_(this.buffer,j_(this.url));if(n===$e)return $e;if(n==="localhost")n="";if(this.url.host=n,this.stateOverride)return!1;this.buffer="",this.state="path start"}else this.buffer+=r;return!0};hr.prototype["parse path start"]=function(t){if(mn(this.url)){if(t===K("\\"))this.parseError=!0;if(this.state="path",t!==K("/")&&t!==K("\\"))--this.pointer}else if(!this.stateOverride&&t===K("?"))this.url.query="",this.state="query";else if(!this.stateOverride&&t===K("#"))this.url.fragment="",this.state="fragment";else if(t!==void 0){if(this.state="path",t!==K("/"))--this.pointer}else if(this.stateOverride&&this.url.host===null)this.url.path.push("");return!0};hr.prototype["parse path"]=function(t){if(isNaN(t)||t===K("/")||mn(this.url)&&t===K("\\")||!this.stateOverride&&(t===K("?")||t===K("#"))){if(mn(this.url)&&t===K("\\"))this.parseError=!0;if(o1e(this.buffer)){if($P(this.url),t!==K("/")&&!(mn(this.url)&&t===K("\\")))this.url.path.push("")}else if(DP(this.buffer)&&t!==K("/")&&!(mn(this.url)&&t===K("\\")))this.url.path.push("");else if(!DP(this.buffer)){if(this.url.scheme==="file"&&this.url.path.length===0&&FP(this.buffer))this.buffer=`${this.buffer[0]}:`;this.url.path.push(this.buffer)}if(this.buffer="",t===K("?"))this.url.query="",this.state="query";if(t===K("#"))this.url.fragment="",this.state="fragment"}else{if(t===K("%")&&(!st.isASCIIHex(this.input[this.pointer+1])||!st.isASCIIHex(this.input[this.pointer+2])))this.parseError=!0;this.buffer+=ym(t,i1e)}return!0};hr.prototype["parse opaque path"]=function(t){if(t===K("?"))this.url.query="",this.state="query";else if(t===K("#"))this.url.fragment="",this.state="fragment";else if(t===K(" ")){let r=this.input[this.pointer+1];if(r===K("?")||r===K("#"))this.url.path+="%20";else this.url.path+=" "}else{if(!isNaN(t)&&t!==K("%"))this.parseError=!0;if(t===K("%")&&(!st.isASCIIHex(this.input[this.pointer+1])||!st.isASCIIHex(this.input[this.pointer+2])))this.parseError=!0;if(!isNaN(t))this.url.path+=ym(t,xP)}return!0};hr.prototype["parse query"]=function(t,r){if(!mn(this.url)||this.url.scheme==="ws"||this.url.scheme==="wss")this.encodingOverride="utf-8";if(!this.stateOverride&&t===K("#")||isNaN(t)){let n=mn(this.url)?s1e:n1e;if(this.url.query+=gm(this.buffer,n),this.buffer="",t===K("#"))this.url.fragment="",this.state="fragment"}else if(!isNaN(t)){if(t===K("%")&&(!st.isASCIIHex(this.input[this.pointer+1])||!st.isASCIIHex(this.input[this.pointer+2])))this.parseError=!0;this.buffer+=r}return!0};hr.prototype["parse fragment"]=function(t){if(!isNaN(t)){if(t===K("%")&&(!st.isASCIIHex(this.input[this.pointer+1])||!st.isASCIIHex(this.input[this.pointer+2])))this.parseError=!0;this.url.fragment+=ym(t,r1e)}return!0};function S1e(e,t){let r=`${e.scheme}:`;if(e.host!==null){if(r+="//",e.username!==""||e.password!==""){if(r+=e.username,e.password!=="")r+=`:${e.password}`;r+="@"}if(r+=V_(e.host),e.port!==null)r+=`:${e.port}`}if(e.host===null&&!Uh(e)&&e.path.length>1&&e.path[0]==="")r+="/.";if(r+=z_(e),e.query!==null)r+=`?${e.query}`;if(!t&&e.fragment!==null)r+=`#${e.fragment}`;return r}function C1e(e){let t=`${e.scheme}://`;if(t+=V_(e.host),e.port!==null)t+=`:${e.port}`;return t}function z_(e){if(Uh(e))return e.path;let t="";for(let r of e.path)t+=`/${r}`;return t}mm.serializeURL=S1e;mm.serializePath=z_;mm.serializeURLOrigin=function(e){switch(e.scheme){case"blob":{let t=mm.parseURL(z_(e));if(t===null)return"null";if(t.scheme!=="http"&&t.scheme!=="https")return"null";return mm.serializeURLOrigin(t)}case"ftp":case"http":case"https":case"ws":case"wss":return C1e({scheme:e.scheme,host:e.host,port:e.port});case"file":return"null";default:return"null"}};mm.basicURLParse=function(e,t){if(t===void 0)t={};let r=new hr(e,t.baseURL,t.encodingOverride,t.url,t.stateOverride);if(r.failure)return null;return r.url};mm.setTheUsername=function(e,t){e.username=gm(t,U_)};mm.setThePassword=function(e,t){e.password=gm(t,U_)};mm.serializeHost=V_;mm.cannotHaveAUsernamePasswordPort=A1e;mm.hasAnOpaquePath=Uh;mm.serializeInteger=function(e){return String(e)};mm.parseURL=function(e,t){if(t===void 0)t={};return mm.basicURLParse(e,{baseURL:t.baseURL,encodingOverride:t.encodingOverride})}});var K_=g(function(y8e,WP){var{utf8Encode:I1e,utf8DecodeWithoutBOM:qP}=fm(),{percentDecodeBytes:jP,utf8PercentEncodeString:LP,isURLEncodedPercentEncode:UP}=dm();function VP(e){return e.codePointAt(0)}function $1e(e){let t=k1e(e,VP("&")),r=[];for(let n of t){if(n.length===0)continue;let s,i,o=n.indexOf(VP("="));if(o>=0)s=n.slice(0,o),i=n.slice(o+1);else s=n,i=new Uint8Array(0);s=zP(s,43,32),i=zP(i,43,32);let u=qP(jP(s)),a=qP(jP(i));r.push([u,a])}return r}function R1e(e){return $1e(I1e(e))}function v1e(e){let t="";for(let[r,n]of e.entries()){let s=LP(n[0],UP,!0),i=LP(n[1],UP,!0);if(r!==0)t+="&";t+=`${s}=${i}`}return t}function k1e(e,t){let r=[],n=0,s=e.indexOf(t);while(s>=0)r.push(e.slice(n,s)),n=s+1,s=e.indexOf(t,n);if(n!==e.length)r.push(e.slice(n));return r}function zP(e,t,r){let n=e.indexOf(t);while(n>=0)e[n]=r,n=e.indexOf(t,n+1);return e}WP.exports={parseUrlencodedString:R1e,serializeUrlencoded:v1e}});var KP=g(function(q1e){var Em=cm(),Vu=hm();q1e.convert=(e,t,{context:r="The provided value"}={})=>{if(typeof t!=="function")throw new e.TypeError(r+" is not a function");function n(...s){let i=Vu.tryWrapperForImpl(this),o;for(let u=0;u<s.length;u++)s[u]=Vu.tryWrapperForImpl(s[u]);return o=Reflect.apply(t,i,s),o=Em.any(o,{context:r,globals:e}),o}return n.construct=(...s)=>{for(let o=0;o<s.length;o++)s[o]=Vu.tryWrapperForImpl(s[o]);let i=Reflect.construct(t,s);return i=Em.any(i,{context:r,globals:e}),i},n[Vu.wrapperSymbol]=t,n.objectReference=t,n}});var HP=g(function(L1e){var Cl=K_();L1e.implementation=class{constructor(t,r,{doNotStripQMark:n=!1}){let s=r[0];if(this._list=[],this._url=null,!n&&typeof s==="string"&&s[0]==="?")s=s.slice(1);if(Array.isArray(s))for(let i of s){if(i.length!==2)throw TypeError("Failed to construct 'URLSearchParams': parameter 1 sequence's element does not contain exactly two elements.");this._list.push([i[0],i[1]])}else if(typeof s==="object"&&Object.getPrototypeOf(s)===null)for(let i of Object.keys(s)){let o=s[i];this._list.push([i,o])}else this._list=Cl.parseUrlencodedString(s)}_updateSteps(){if(this._url!==null){let t=Cl.serializeUrlencoded(this._list);if(t==="")t=null;this._url._url.query=t}}get size(){return this._list.length}append(t,r){this._list.push([t,r]),this._updateSteps()}delete(t,r){let n=0;while(n<this._list.length)if(this._list[n][0]===t&&(r===void 0||this._list[n][1]===r))this._list.splice(n,1);else n++;this._updateSteps()}get(t){for(let r of this._list)if(r[0]===t)return r[1];return null}getAll(t){let r=[];for(let n of this._list)if(n[0]===t)r.push(n[1]);return r}has(t,r){for(let n of this._list)if(n[0]===t&&(r===void 0||n[1]===r))return!0;return!1}set(t,r){let n=!1,s=0;while(s<this._list.length)if(this._list[s][0]===t)if(n)this._list.splice(s,1);else n=!0,this._list[s][1]=r,s++;else s++;if(!n)this._list.push([t,r]);this._updateSteps()}sort(){this._list.sort((t,r)=>{if(t[0]<r[0])return-1;if(t[0]>r[0])return 1;return 0}),this._updateSteps()}[Symbol.iterator](){return this._list[Symbol.iterator]()}toString(){return Cl.serializeUrlencoded(this._list)}}});var G_=g(function(sr){var Pt=cm(),be=hm(),YP=KP(),GP=be.newObjectInRealm,Or=be.implSymbol,QP=be.ctorRegistrySymbol;sr.is=(e)=>be.isObject(e)&&Object.hasOwn(e,Or)&&e[Or]instanceof zu.implementation;sr.isImpl=(e)=>be.isObject(e)&&e instanceof zu.implementation;sr.convert=(e,t,{context:r="The provided value"}={})=>{if(sr.is(t))return be.implForWrapper(t);throw new e.TypeError(`${r} is not of type 'URLSearchParams'.`)};sr.createDefaultIterator=(e,t,r)=>{let s=e[QP]["URLSearchParams Iterator"],i=Object.create(s);return Object.defineProperty(i,be.iterInternalSymbol,{value:{target:t,kind:r,index:0},configurable:!0}),i};function JP(e,t){let r;if(t!==void 0)r=t.prototype;if(!be.isObject(r))r=e[QP].URLSearchParams.prototype;return Object.create(r)}sr.create=(e,t,r)=>{let n=JP(e);return sr.setup(n,e,t,r)};sr.createImpl=(e,t,r)=>{let n=sr.create(e,t,r);return be.implForWrapper(n)};sr._internalSetup=(e,t)=>{};sr.setup=(e,t,r=[],n={})=>{if(n.wrapper=e,sr._internalSetup(e,t),Object.defineProperty(e,Or,{value:new zu.implementation(t,r,n),configurable:!0}),e[Or][be.wrapperSymbol]=e,zu.init)zu.init(e[Or]);return e};sr.new=(e,t)=>{let r=JP(e,t);if(sr._internalSetup(r,e),Object.defineProperty(r,Or,{value:Object.create(zu.implementation.prototype),configurable:!0}),r[Or][be.wrapperSymbol]=r,zu.init)zu.init(r[Or]);return r[Or]};var V1e=new Set(["Window","Worker"]);sr.install=(e,t)=>{if(!t.some((s)=>V1e.has(s)))return;let r=be.initCtorRegistry(e);class n{constructor(){let s=[];{let i=arguments[0];if(i!==void 0)if(be.isObject(i))if(i[Symbol.iterator]!==void 0)if(!be.isObject(i))throw new e.TypeError("Failed to construct 'URLSearchParams': parameter 1 sequence is not an iterable object.");else{let o=[],u=i;for(let a of u){if(!be.isObject(a))throw new e.TypeError("Failed to construct 'URLSearchParams': parameter 1 sequence's element is not an iterable object.");else{let c=[],l=a;for(let f of l)f=Pt.USVString(f,{context:"Failed to construct 'URLSearchParams': parameter 1 sequence's element's element",globals:e}),c.push(f);a=c}o.push(a)}i=o}else if(!be.isObject(i))throw new e.TypeError("Failed to construct 'URLSearchParams': parameter 1 record is not an object.");else{let o=Object.create(null);for(let u of Reflect.ownKeys(i)){let a=Object.getOwnPropertyDescriptor(i,u);if(a&&a.enumerable){let c=u;c=Pt.USVString(c,{context:"Failed to construct 'URLSearchParams': parameter 1 record's key",globals:e});let l=i[u];l=Pt.USVString(l,{context:"Failed to construct 'URLSearchParams': parameter 1 record's value",globals:e}),o[c]=l}}i=o}else i=Pt.USVString(i,{context:"Failed to construct 'URLSearchParams': parameter 1",globals:e});else i="";s.push(i)}return sr.setup(Object.create(new.target.prototype),e,s)}append(s,i){let o=this!==null&&this!==void 0?this:e;if(!sr.is(o))throw new e.TypeError("'append' called on an object that is not a valid instance of URLSearchParams.");if(arguments.length<2)throw new e.TypeError(`Failed to execute 'append' on 'URLSearchParams': 2 arguments required, but only ${arguments.length} present.`);let u=[];{let a=arguments[0];a=Pt.USVString(a,{context:"Failed to execute 'append' on 'URLSearchParams': parameter 1",globals:e}),u.push(a)}{let a=arguments[1];a=Pt.USVString(a,{context:"Failed to execute 'append' on 'URLSearchParams': parameter 2",globals:e}),u.push(a)}return be.tryWrapperForImpl(o[Or].append(...u))}delete(s){let i=this!==null&&this!==void 0?this:e;if(!sr.is(i))throw new e.TypeError("'delete' called on an object that is not a valid instance of URLSearchParams.");if(arguments.length<1)throw new e.TypeError(`Failed to execute 'delete' on 'URLSearchParams': 1 argument required, but only ${arguments.length} present.`);let o=[];{let u=arguments[0];u=Pt.USVString(u,{context:"Failed to execute 'delete' on 'URLSearchParams': parameter 1",globals:e}),o.push(u)}{let u=arguments[1];if(u!==void 0)u=Pt.USVString(u,{context:"Failed to execute 'delete' on 'URLSearchParams': parameter 2",globals:e});o.push(u)}return be.tryWrapperForImpl(i[Or].delete(...o))}get(s){let i=this!==null&&this!==void 0?this:e;if(!sr.is(i))throw new e.TypeError("'get' called on an object that is not a valid instance of URLSearchParams.");if(arguments.length<1)throw new e.TypeError(`Failed to execute 'get' on 'URLSearchParams': 1 argument required, but only ${arguments.length} present.`);let o=[];{let u=arguments[0];u=Pt.USVString(u,{context:"Failed to execute 'get' on 'URLSearchParams': parameter 1",globals:e}),o.push(u)}return i[Or].get(...o)}getAll(s){let i=this!==null&&this!==void 0?this:e;if(!sr.is(i))throw new e.TypeError("'getAll' called on an object that is not a valid instance of URLSearchParams.");if(arguments.length<1)throw new e.TypeError(`Failed to execute 'getAll' on 'URLSearchParams': 1 argument required, but only ${arguments.length} present.`);let o=[];{let u=arguments[0];u=Pt.USVString(u,{context:"Failed to execute 'getAll' on 'URLSearchParams': parameter 1",globals:e}),o.push(u)}return be.tryWrapperForImpl(i[Or].getAll(...o))}has(s){let i=this!==null&&this!==void 0?this:e;if(!sr.is(i))throw new e.TypeError("'has' called on an object that is not a valid instance of URLSearchParams.");if(arguments.length<1)throw new e.TypeError(`Failed to execute 'has' on 'URLSearchParams': 1 argument required, but only ${arguments.length} present.`);let o=[];{let u=arguments[0];u=Pt.USVString(u,{context:"Failed to execute 'has' on 'URLSearchParams': parameter 1",globals:e}),o.push(u)}{let u=arguments[1];if(u!==void 0)u=Pt.USVString(u,{context:"Failed to execute 'has' on 'URLSearchParams': parameter 2",globals:e});o.push(u)}return i[Or].has(...o)}set(s,i){let o=this!==null&&this!==void 0?this:e;if(!sr.is(o))throw new e.TypeError("'set' called on an object that is not a valid instance of URLSearchParams.");if(arguments.length<2)throw new e.TypeError(`Failed to execute 'set' on 'URLSearchParams': 2 arguments required, but only ${arguments.length} present.`);let u=[];{let a=arguments[0];a=Pt.USVString(a,{context:"Failed to execute 'set' on 'URLSearchParams': parameter 1",globals:e}),u.push(a)}{let a=arguments[1];a=Pt.USVString(a,{context:"Failed to execute 'set' on 'URLSearchParams': parameter 2",globals:e}),u.push(a)}return be.tryWrapperForImpl(o[Or].set(...u))}sort(){let s=this!==null&&this!==void 0?this:e;if(!sr.is(s))throw new e.TypeError("'sort' called on an object that is not a valid instance of URLSearchParams.");return be.tryWrapperForImpl(s[Or].sort())}toString(){let s=this!==null&&this!==void 0?this:e;if(!sr.is(s))throw new e.TypeError("'toString' called on an object that is not a valid instance of URLSearchParams.");return s[Or].toString()}keys(){if(!sr.is(this))throw new e.TypeError("'keys' called on an object that is not a valid instance of URLSearchParams.");return sr.createDefaultIterator(e,this,"key")}values(){if(!sr.is(this))throw new e.TypeError("'values' called on an object that is not a valid instance of URLSearchParams.");return sr.createDefaultIterator(e,this,"value")}entries(){if(!sr.is(this))throw new e.TypeError("'entries' called on an object that is not a valid instance of URLSearchParams.");return sr.createDefaultIterator(e,this,"key+value")}forEach(s){if(!sr.is(this))throw new e.TypeError("'forEach' called on an object that is not a valid instance of URLSearchParams.");if(arguments.length<1)throw new e.TypeError("Failed to execute 'forEach' on 'iterable': 1 argument required, but only 0 present.");s=YP.convert(e,s,{context:"Failed to execute 'forEach' on 'iterable': The callback provided as parameter 1"});let i=arguments[1],o=Array.from(this[Or]),u=0;while(u<o.length){let[a,c]=o[u].map(be.tryWrapperForImpl);s.call(i,c,a,this),o=Array.from(this[Or]),u++}}get size(){let s=this!==null&&this!==void 0?this:e;if(!sr.is(s))throw new e.TypeError("'get size' called on an object that is not a valid instance of URLSearchParams.");return s[Or].size}}Object.defineProperties(n.prototype,{append:{enumerable:!0},delete:{enumerable:!0},get:{enumerable:!0},getAll:{enumerable:!0},has:{enumerable:!0},set:{enumerable:!0},sort:{enumerable:!0},toString:{enumerable:!0},keys:{enumerable:!0},values:{enumerable:!0},entries:{enumerable:!0},forEach:{enumerable:!0},size:{enumerable:!0},[Symbol.toStringTag]:{value:"URLSearchParams",configurable:!0},[Symbol.iterator]:{value:n.prototype.entries,configurable:!0,writable:!0}}),r.URLSearchParams=n,r["URLSearchParams Iterator"]=Object.create(r["%IteratorPrototype%"],{[Symbol.toStringTag]:{configurable:!0,value:"URLSearchParams Iterator"}}),be.define(r["URLSearchParams Iterator"],{next(){let s=this&&this[be.iterInternalSymbol];if(!s)throw new e.TypeError("next() called on a value that is not a URLSearchParams iterator object");let{target:i,kind:o,index:u}=s,a=Array.from(i[Or]),c=a.length;if(u>=c)return GP(e,{value:void 0,done:!0});let l=a[u];return s.index=u+1,GP(e,be.iteratorResult(l.map(be.tryWrapperForImpl),o))}}),Object.defineProperty(e,"URLSearchParams",{configurable:!0,writable:!0,value:n})};var zu=HP()});var tF=g(function(Y1e){var me=W_(),Am=K_(),eF=G_();Y1e.implementation=class e{constructor(t,[r,n]){let s=null;if(n!==void 0){if(s=me.basicURLParse(n),s===null)throw TypeError(`Invalid base URL: ${n}`)}let i=me.basicURLParse(r,{baseURL:s});if(i===null)throw TypeError(`Invalid URL: ${r}`);let o=i.query!==null?i.query:"";this._url=i,this._query=eF.createImpl(t,[o],{doNotStripQMark:!0}),this._query._url=this}static parse(t,r,n){try{return new e(t,[r,n])}catch{return null}}static canParse(t,r){let n=null;if(r!==void 0){if(n=me.basicURLParse(r),n===null)return!1}if(me.basicURLParse(t,{baseURL:n})===null)return!1;return!0}get href(){return me.serializeURL(this._url)}set href(t){let r=me.basicURLParse(t);if(r===null)throw TypeError(`Invalid URL: ${t}`);this._url=r,this._query._list.splice(0);let{query:n}=r;if(n!==null)this._query._list=Am.parseUrlencodedString(n)}get origin(){return me.serializeURLOrigin(this._url)}get protocol(){return`${this._url.scheme}:`}set protocol(t){me.basicURLParse(`${t}:`,{url:this._url,stateOverride:"scheme start"})}get username(){return this._url.username}set username(t){if(me.cannotHaveAUsernamePasswordPort(this._url))return;me.setTheUsername(this._url,t)}get password(){return this._url.password}set password(t){if(me.cannotHaveAUsernamePasswordPort(this._url))return;me.setThePassword(this._url,t)}get host(){let t=this._url;if(t.host===null)return"";if(t.port===null)return me.serializeHost(t.host);return`${me.serializeHost(t.host)}:${me.serializeInteger(t.port)}`}set host(t){if(me.hasAnOpaquePath(this._url))return;me.basicURLParse(t,{url:this._url,stateOverride:"host"})}get hostname(){if(this._url.host===null)return"";return me.serializeHost(this._url.host)}set hostname(t){if(me.hasAnOpaquePath(this._url))return;me.basicURLParse(t,{url:this._url,stateOverride:"hostname"})}get port(){if(this._url.port===null)return"";return me.serializeInteger(this._url.port)}set port(t){if(me.cannotHaveAUsernamePasswordPort(this._url))return;if(t==="")this._url.port=null;else me.basicURLParse(t,{url:this._url,stateOverride:"port"})}get pathname(){return me.serializePath(this._url)}set pathname(t){if(me.hasAnOpaquePath(this._url))return;this._url.path=[],me.basicURLParse(t,{url:this._url,stateOverride:"path start"})}get search(){if(this._url.query===null||this._url.query==="")return"";return`?${this._url.query}`}set search(t){let r=this._url;if(t===""){r.query=null,this._query._list=[];return}let n=t[0]==="?"?t.substring(1):t;r.query="",me.basicURLParse(n,{url:r,stateOverride:"query"}),this._query._list=Am.parseUrlencodedString(n)}get searchParams(){return this._query}get hash(){if(this._url.fragment===null||this._url.fragment==="")return"";return`#${this._url.fragment}`}set hash(t){if(t===""){this._url.fragment=null;return}let r=t[0]==="#"?t.substring(1):t;this._url.fragment="",me.basicURLParse(r,{url:this._url,stateOverride:"fragment"})}toJSON(){return this.href}}});var iF=g(function(At){var gt=cm(),qt=hm(),ht=qt.implSymbol,J1e=qt.ctorRegistrySymbol;At.is=(e)=>qt.isObject(e)&&Object.hasOwn(e,ht)&&e[ht]instanceof ho.implementation;At.isImpl=(e)=>qt.isObject(e)&&e instanceof ho.implementation;At.convert=(e,t,{context:r="The provided value"}={})=>{if(At.is(t))return qt.implForWrapper(t);throw new e.TypeError(`${r} is not of type 'URL'.`)};function rF(e,t){let r;if(t!==void 0)r=t.prototype;if(!qt.isObject(r))r=e[J1e].URL.prototype;return Object.create(r)}At.create=(e,t,r)=>{let n=rF(e);return At.setup(n,e,t,r)};At.createImpl=(e,t,r)=>{let n=At.create(e,t,r);return qt.implForWrapper(n)};At._internalSetup=(e,t)=>{};At.setup=(e,t,r=[],n={})=>{if(n.wrapper=e,At._internalSetup(e,t),Object.defineProperty(e,ht,{value:new ho.implementation(t,r,n),configurable:!0}),e[ht][qt.wrapperSymbol]=e,ho.init)ho.init(e[ht]);return e};At.new=(e,t)=>{let r=rF(e,t);if(At._internalSetup(r,e),Object.defineProperty(r,ht,{value:Object.create(ho.implementation.prototype),configurable:!0}),r[ht][qt.wrapperSymbol]=r,ho.init)ho.init(r[ht]);return r[ht]};var X1e=new Set(["Window","Worker"]);At.install=(e,t)=>{if(!t.some((s)=>X1e.has(s)))return;let r=qt.initCtorRegistry(e);class n{constructor(s){if(arguments.length<1)throw new e.TypeError(`Failed to construct 'URL': 1 argument required, but only ${arguments.length} present.`);let i=[];{let o=arguments[0];o=gt.USVString(o,{context:"Failed to construct 'URL': parameter 1",globals:e}),i.push(o)}{let o=arguments[1];if(o!==void 0)o=gt.USVString(o,{context:"Failed to construct 'URL': parameter 2",globals:e});i.push(o)}return At.setup(Object.create(new.target.prototype),e,i)}toJSON(){let s=this!==null&&this!==void 0?this:e;if(!At.is(s))throw new e.TypeError("'toJSON' called on an object that is not a valid instance of URL.");return s[ht].toJSON()}get href(){let s=this!==null&&this!==void 0?this:e;if(!At.is(s))throw new e.TypeError("'get href' called on an object that is not a valid instance of URL.");return s[ht].href}set href(s){let i=this!==null&&this!==void 0?this:e;if(!At.is(i))throw new e.TypeError("'set href' called on an object that is not a valid instance of URL.");s=gt.USVString(s,{context:"Failed to set the 'href' property on 'URL': The provided value",globals:e}),i[ht].href=s}toString(){let s=this;if(!At.is(s))throw new e.TypeError("'toString' called on an object that is not a valid instance of URL.");return s[ht].href}get origin(){let s=this!==null&&this!==void 0?this:e;if(!At.is(s))throw new e.TypeError("'get origin' called on an object that is not a valid instance of URL.");return s[ht].origin}get protocol(){let s=this!==null&&this!==void 0?this:e;if(!At.is(s))throw new e.TypeError("'get protocol' called on an object that is not a valid instance of URL.");return s[ht].protocol}set protocol(s){let i=this!==null&&this!==void 0?this:e;if(!At.is(i))throw new e.TypeError("'set protocol' called on an object that is not a valid instance of URL.");s=gt.USVString(s,{context:"Failed to set the 'protocol' property on 'URL': The provided value",globals:e}),i[ht].protocol=s}get username(){let s=this!==null&&this!==void 0?this:e;if(!At.is(s))throw new e.TypeError("'get username' called on an object that is not a valid instance of URL.");return s[ht].username}set username(s){let i=this!==null&&this!==void 0?this:e;if(!At.is(i))throw new e.TypeError("'set username' called on an object that is not a valid instance of URL.");s=gt.USVString(s,{context:"Failed to set the 'username' property on 'URL': The provided value",globals:e}),i[ht].username=s}get password(){let s=this!==null&&this!==void 0?this:e;if(!At.is(s))throw new e.TypeError("'get password' called on an object that is not a valid instance of URL.");return s[ht].password}set password(s){let i=this!==null&&this!==void 0?this:e;if(!At.is(i))throw new e.TypeError("'set password' called on an object that is not a valid instance of URL.");s=gt.USVString(s,{context:"Failed to set the 'password' property on 'URL': The provided value",globals:e}),i[ht].password=s}get host(){let s=this!==null&&this!==void 0?this:e;if(!At.is(s))throw new e.TypeError("'get host' called on an object that is not a valid instance of URL.");return s[ht].host}set host(s){let i=this!==null&&this!==void 0?this:e;if(!At.is(i))throw new e.TypeError("'set host' called on an object that is not a valid instance of URL.");s=gt.USVString(s,{context:"Failed to set the 'host' property on 'URL': The provided value",globals:e}),i[ht].host=s}get hostname(){let s=this!==null&&this!==void 0?this:e;if(!At.is(s))throw new e.TypeError("'get hostname' called on an object that is not a valid instance of URL.");return s[ht].hostname}set hostname(s){let i=this!==null&&this!==void 0?this:e;if(!At.is(i))throw new e.TypeError("'set hostname' called on an object that is not a valid instance of URL.");s=gt.USVString(s,{context:"Failed to set the 'hostname' property on 'URL': The provided value",globals:e}),i[ht].hostname=s}get port(){let s=this!==null&&this!==void 0?this:e;if(!At.is(s))throw new e.TypeError("'get port' called on an object that is not a valid instance of URL.");return s[ht].port}set port(s){let i=this!==null&&this!==void 0?this:e;if(!At.is(i))throw new e.TypeError("'set port' called on an object that is not a valid instance of URL.");s=gt.USVString(s,{context:"Failed to set the 'port' property on 'URL': The provided value",globals:e}),i[ht].port=s}get pathname(){let s=this!==null&&this!==void 0?this:e;if(!At.is(s))throw new e.TypeError("'get pathname' called on an object that is not a valid instance of URL.");return s[ht].pathname}set pathname(s){let i=this!==null&&this!==void 0?this:e;if(!At.is(i))throw new e.TypeError("'set pathname' called on an object that is not a valid instance of URL.");s=gt.USVString(s,{context:"Failed to set the 'pathname' property on 'URL': The provided value",globals:e}),i[ht].pathname=s}get search(){let s=this!==null&&this!==void 0?this:e;if(!At.is(s))throw new e.TypeError("'get search' called on an object that is not a valid instance of URL.");return s[ht].search}set search(s){let i=this!==null&&this!==void 0?this:e;if(!At.is(i))throw new e.TypeError("'set search' called on an object that is not a valid instance of URL.");s=gt.USVString(s,{context:"Failed to set the 'search' property on 'URL': The provided value",globals:e}),i[ht].search=s}get searchParams(){let s=this!==null&&this!==void 0?this:e;if(!At.is(s))throw new e.TypeError("'get searchParams' called on an object that is not a valid instance of URL.");return qt.getSameObject(this,"searchParams",()=>qt.tryWrapperForImpl(s[ht].searchParams))}get hash(){let s=this!==null&&this!==void 0?this:e;if(!At.is(s))throw new e.TypeError("'get hash' called on an object that is not a valid instance of URL.");return s[ht].hash}set hash(s){let i=this!==null&&this!==void 0?this:e;if(!At.is(i))throw new e.TypeError("'set hash' called on an object that is not a valid instance of URL.");s=gt.USVString(s,{context:"Failed to set the 'hash' property on 'URL': The provided value",globals:e}),i[ht].hash=s}static parse(s){if(arguments.length<1)throw new e.TypeError(`Failed to execute 'parse' on 'URL': 1 argument required, but only ${arguments.length} present.`);let i=[];{let o=arguments[0];o=gt.USVString(o,{context:"Failed to execute 'parse' on 'URL': parameter 1",globals:e}),i.push(o)}{let o=arguments[1];if(o!==void 0)o=gt.USVString(o,{context:"Failed to execute 'parse' on 'URL': parameter 2",globals:e});i.push(o)}return qt.tryWrapperForImpl(ho.implementation.parse(e,...i))}static canParse(s){if(arguments.length<1)throw new e.TypeError(`Failed to execute 'canParse' on 'URL': 1 argument required, but only ${arguments.length} present.`);let i=[];{let o=arguments[0];o=gt.USVString(o,{context:"Failed to execute 'canParse' on 'URL': parameter 1",globals:e}),i.push(o)}{let o=arguments[1];if(o!==void 0)o=gt.USVString(o,{context:"Failed to execute 'canParse' on 'URL': parameter 2",globals:e});i.push(o)}return ho.implementation.canParse(...i)}}if(Object.defineProperties(n.prototype,{toJSON:{enumerable:!0},href:{enumerable:!0},toString:{enumerable:!0},origin:{enumerable:!0},protocol:{enumerable:!0},username:{enumerable:!0},password:{enumerable:!0},host:{enumerable:!0},hostname:{enumerable:!0},port:{enumerable:!0},pathname:{enumerable:!0},search:{enumerable:!0},searchParams:{enumerable:!0},hash:{enumerable:!0},[Symbol.toStringTag]:{value:"URL",configurable:!0}}),Object.defineProperties(n,{parse:{enumerable:!0},canParse:{enumerable:!0}}),r.URL=n,Object.defineProperty(e,"URL",{configurable:!0,writable:!0,value:n}),t.includes("Window"))Object.defineProperty(e,"webkitURL",{configurable:!0,writable:!0,value:n})};var ho=tF()});var oF=g(function(ohe){var she=iF(),ihe=G_();ohe.URL=she;ohe.URLSearchParams=ihe});var uF=g(function(hhe){var{URL:che,URLSearchParams:lhe}=oF(),fr=W_(),wm=dm(),Om={Array,Object,Promise,String,TypeError};che.install(Om,["Window"]);lhe.install(Om,["Window"]);hhe.URL=Om.URL;hhe.URLSearchParams=Om.URLSearchParams;hhe.parseURL=fr.parseURL;hhe.basicURLParse=fr.basicURLParse;hhe.serializeURL=fr.serializeURL;hhe.serializePath=fr.serializePath;hhe.serializeHost=fr.serializeHost;hhe.serializeInteger=fr.serializeInteger;hhe.serializeURLOrigin=fr.serializeURLOrigin;hhe.setTheUsername=fr.setTheUsername;hhe.setThePassword=fr.setThePassword;hhe.cannotHaveAUsernamePasswordPort=fr.cannotHaveAUsernamePasswordPort;hhe.hasAnOpaquePath=fr.hasAnOpaquePath;hhe.percentDecodeString=wm.percentDecodeString;hhe.percentDecodeBytes=wm.percentDecodeBytes});var cF=g(function(fo){var The=fo&&fo.__createBinding||(Object.create?function(e,t,r,n){if(n===void 0)n=r;var s=Object.getOwnPropertyDescriptor(t,r);if(!s||("get"in s?!t.__esModule:s.writable||s.configurable))s={enumerable:!0,get:function(){return t[r]}};Object.defineProperty(e,n,s)}:function(e,t,r,n){if(n===void 0)n=r;e[n]=t[r]}),Mhe=fo&&fo.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),xhe=fo&&fo.__importStar||function(){var e=function(t){return e=Object.getOwnPropertyNames||function(r){var n=[];for(var s in r)if(Object.prototype.hasOwnProperty.call(r,s))n[n.length]=s;return n},e(t)};return function(t){if(t&&t.__esModule)return t;var r={};if(t!=null){for(var n=e(t),s=0;s<n.length;s++)if(n[s]!=="default")The(r,t,n[s])}return Mhe(r,t),r}}();Object.defineProperty(fo,"__esModule",{value:!0});fo.redactValidConnectionString=Phe;fo.redactConnectionString=Fhe;var aF=xhe(Q_());function Phe(e,t){let r=e.clone(),n=t?.replacementString??"_credentials_",s=t?.redactUsernames??!0;if((r.username||r.password)&&s)r.username=n,r.password="";else if(r.password)r.password=n;if(r.searchParams.has("authMechanismProperties")){let i=new aF.CommaAndColonSeparatedRecord(r.searchParams.get("authMechanismProperties"));if(i.get("AWS_SESSION_TOKEN"))i.set("AWS_SESSION_TOKEN",n),r.searchParams.set("authMechanismProperties",i.toString())}if(r.searchParams.has("tlsCertificateKeyFilePassword"))r.searchParams.set("tlsCertificateKeyFilePassword",n);if(r.searchParams.has("proxyUsername")&&s)r.searchParams.set("proxyUsername",n);if(r.searchParams.has("proxyPassword"))r.searchParams.set("proxyPassword",n);return r}function Fhe(e,t){let r=t?.replacementString??"<credentials>",n=t?.redactUsernames??!0,s;try{s=new aF.default(e)}catch{}if(s)return t={...t,replacementString:"___credentials___"},s.redact(t).toString().replace(/___credentials___/g,r);let i=r,o=[(u)=>u.replace(n?/(\/\/)(.*)(@)/g:/(\/\/[^@]*:)(.*)(@)/g,`$1${i}$3`),(u)=>u.replace(/(AWS_SESSION_TOKEN(:|%3A))([^,&]+)/gi,`$1${i}`),(u)=>u.replace(/(tlsCertificateKeyFilePassword=)([^&]+)/gi,`$1${i}`),(u)=>n?u.replace(/(proxyUsername=)([^&]+)/gi,`$1${i}`):u,(u)=>u.replace(/(proxyPassword=)([^&]+)/gi,`$1${i}`)];for(let u of o)e=u(e);return e}});var Q_=g(function(X_){Object.defineProperty(X_,"__esModule",{value:!0});X_.CommaAndColonSeparatedRecord=X_.ConnectionString=X_.redactConnectionString=void 0;var lF=uF(),Sm=cF();Object.defineProperty(X_,"redactConnectionString",{enumerable:!0,get:function(){return Sm.redactConnectionString}});var Vh="__this_is_a_placeholder__";function Bhe(e){return e.startsWith("mongodb://")||e.startsWith("mongodb+srv://")}var Nhe=/^(?<protocol>[^/]+):\/\/(?:(?<username>[^:@]*)(?::(?<password>[^@]*))?@)?(?<hosts>(?!:)[^/?@]*)(?<rest>.*)/;class J_ extends Map{delete(e){return super.delete(this._normalizeKey(e))}get(e){return super.get(this._normalizeKey(e))}has(e){return super.has(this._normalizeKey(e))}set(e,t){return super.set(this._normalizeKey(e),t)}_normalizeKey(e){e=`${e}`;for(let t of this.keys())if(t.toLowerCase()===e.toLowerCase()){e=t;break}return e}}function Ihe(e){return class extends e{append(r,n){return super.append(this._normalizeKey(r),n)}delete(r){return super.delete(this._normalizeKey(r))}get(r){return super.get(this._normalizeKey(r))}getAll(r){return super.getAll(this._normalizeKey(r))}has(r){return super.has(this._normalizeKey(r))}set(r,n){return super.set(this._normalizeKey(r),n)}keys(){return super.keys()}values(){return super.values()}entries(){return super.entries()}[Symbol.iterator](){return super[Symbol.iterator]()}_normalizeKey(r){return J_.prototype._normalizeKey.call(this,r)}}}class hF extends lF.URL{}class Li extends Error{get name(){return"MongoParseError"}}class zh extends hF{_hosts;constructor(e,t={}){let{looseValidation:r}=t;if(!r&&!Bhe(e))throw new Li('Invalid scheme, expected connection string to start with "mongodb://" or "mongodb+srv://"');let n=e.match(Nhe);if(!n)throw new Li("Invalid connection string");let{protocol:s,username:i,password:o,hosts:u,rest:a}=n.groups??{};if(!r){if(!s||!u)throw new Li("Protocol and host list are required in the uri");try{decodeURIComponent(i??""),decodeURIComponent(o??"")}catch(f){throw new Li(f.message)}let l=/[:/?#[\]@]/gi;if(i?.match(l))throw new Li(`Username contains unescaped characters ${i}`);if(!i||!o){let f=e.replace(`${s}://`,"");if(f.startsWith("@")||f.startsWith(":"))throw new Li("URI contained empty userinfo section")}if(o?.match(l))throw new Li("Password contains unescaped characters");if(a?.match(/^[^/?]*@/))throw new Li("Invalid connection string")}let c="";if(typeof i==="string")c+=i;if(typeof o==="string")c+=`:${o}`;if(c)c+="@";try{super(`${s.toLowerCase()}://${c}${Vh}${a}`)}catch(l){if(r)new zh(e,{...t,looseValidation:!1});if(typeof l.message==="string")l.message=l.message.replace(Vh,()=>u);throw l}if(this._hosts=u.split(","),!r){if(this.isSRV&&this.hosts.length!==1)throw new Li("mongodb+srv URI cannot have multiple service names");if(this.isSRV&&this.hosts.some((l)=>l.includes(":")))throw new Li("mongodb+srv URI cannot have port number")}if(!this.pathname)this.pathname="/";Object.setPrototypeOf(this.searchParams,Ihe(this.searchParams.constructor).prototype)}get host(){return Vh}set host(e){throw Error("No single host for connection string")}get hostname(){return Vh}set hostname(e){throw Error("No single host for connection string")}get port(){return""}set port(e){throw Error("No single host for connection string")}get href(){return this.toString()}set href(e){throw Error("Cannot set href for connection strings")}get isSRV(){return this.protocol.includes("srv")}get hosts(){return this._hosts}set hosts(e){this._hosts=e}toString(){return super.toString().replace(Vh,()=>this.hosts.join(","))}clone(){return new zh(this.toString(),{looseValidation:!0})}redact(e){return Sm.redactValidConnectionString(this,e)}typedSearchParams(){return this.searchParams}[Symbol.for("nodejs.util.inspect.custom")](){let{href:e,origin:t,protocol:r,username:n,password:s,hosts:i,pathname:o,search:u,searchParams:a,hash:c}=this;return{href:e,origin:t,protocol:r,username:n,password:s,hosts:i,pathname:o,search:u,searchParams:a,hash:c}}}X_.ConnectionString=zh;class fF extends J_{constructor(e){super();for(let t of(e??"").split(",")){if(!t)continue;let r=t.indexOf(":");if(r===-1)this.set(t,"");else this.set(t.slice(0,r),t.slice(r+1))}}toString(){return[...this].map((e)=>e.join(":")).join(",")}}X_.CommaAndColonSeparatedRecord=fF;X_.default=zh});var bl=g(function(AF){Object.defineProperty(AF,"__esModule",{value:!0});AF.MongoCryptKMSRequestNetworkTimeoutError=AF.MongoCryptAzureKMSRequestError=AF.MongoCryptCreateEncryptedCollectionError=AF.MongoCryptCreateDataKeyError=AF.MongoCryptInvalidArgumentError=AF.defaultErrorWrapper=AF.MongoCryptError=void 0;var pF=J();class Wu extends pF.MongoError{constructor(e,t={}){super(e,t)}get name(){return"MongoCryptError"}}AF.MongoCryptError=Wu;var vhe=(e)=>new Wu(e.message,{cause:e});AF.defaultErrorWrapper=vhe;class mF extends Wu{constructor(e){super(e)}get name(){return"MongoCryptInvalidArgumentError"}}AF.MongoCryptInvalidArgumentError=mF;class yF extends Wu{constructor(e,{cause:t}){super(`Unable to complete creating data keys: ${t.message}`,{cause:t});this.encryptedFields=e}get name(){return"MongoCryptCreateDataKeyError"}}AF.MongoCryptCreateDataKeyError=yF;class gF extends Wu{constructor(e,{cause:t}){super(`Unable to create collection: ${t.message}`,{cause:t});this.encryptedFields=e}get name(){return"MongoCryptCreateEncryptedCollectionError"}}AF.MongoCryptCreateEncryptedCollectionError=gF;class EF extends Wu{constructor(e,t){super(e);this.body=t}get name(){return"MongoCryptAzureKMSRequestError"}}AF.MongoCryptAzureKMSRequestError=EF;class _F extends Wu{get name(){return"MongoCryptKMSRequestNetworkTimeoutError"}}AF.MongoCryptKMSRequestNetworkTimeoutError=_F});var Z_=g(function(bF){Object.defineProperty(bF,"__esModule",{value:!0});bF.AWSSDKCredentialProvider=void 0;var OF=L("process"),SF=eo(),CF=J();class Ku{constructor(e){if(e)this._provider=e}static get awsSDK(){return Ku._awsSDK??=SF.getAwsCredentialProvider(),Ku._awsSDK}get provider(){if("kModuleError"in Ku.awsSDK)throw Ku.awsSDK.kModuleError;if(this._provider)return this._provider;let{AWS_STS_REGIONAL_ENDPOINTS:e="",AWS_REGION:t=""}=OF.env;e=e.toLowerCase(),t=t.toLowerCase();let r=t.length!==0&&e.length!==0,s=e==="regional"||e==="legacy"&&!new Set(["ap-northeast-1","ap-south-1","ap-southeast-1","ap-southeast-2","aws-global","ca-central-1","eu-central-1","eu-north-1","eu-west-1","eu-west-2","eu-west-3","sa-east-1","us-east-1","us-east-2","us-west-1","us-west-2"]).has(t);return this._provider=r&&s?Ku.awsSDK.fromNodeProviderChain({clientConfig:{region:t}}):Ku.awsSDK.fromNodeProviderChain(),this._provider}async getCredentials(){try{let e=await this.provider();return{AccessKeyId:e.accessKeyId,SecretAccessKey:e.secretAccessKey,Token:e.sessionToken,Expiration:e.expiration}}catch(e){throw new CF.MongoAWSError(e.message,{cause:e})}}}bF.AWSSDKCredentialProvider=Ku});var xF=g(function(MF){Object.defineProperty(MF,"__esModule",{value:!0});MF.loadAWSCredentials=zhe;var TF=Z_();async function zhe(e,t){let r=new TF.AWSSDKCredentialProvider(t),{SecretAccessKey:n="",AccessKeyId:s="",Token:i}=await r.getCredentials(),o={secretAccessKey:n,accessKeyId:s};return i!=null&&(o.sessionToken=i),{...e,aws:o}}});var r3=g(function($F){Object.defineProperty($F,"__esModule",{value:!0});$F.tokenCache=$F.AzureCredentialCache=$F.AZURE_BASE_URL=void 0;$F.addAzureParams=BF;$F.prepareRequest=NF;$F.fetchAzureKMSToken=IF;$F.loadAzureCredentials=Ghe;var PF=J(),FF=ae(),ri=bl(),Khe=6000;$F.AZURE_BASE_URL="http://169.254.169.254/metadata/identity/oauth2/token?";class e3{constructor(){this.cachedToken=null}async getToken(){if(this.cachedToken==null||this.needsRefresh(this.cachedToken))this.cachedToken=await this._getToken();return{accessToken:this.cachedToken.accessToken}}needsRefresh(e){return e.expiresOnTimestamp-Date.now()<=Khe}resetCache(){this.cachedToken=null}_getToken(){return IF()}}$F.AzureCredentialCache=e3;$F.tokenCache=new e3;async function Hhe(e){let{status:t,body:r}=e,n=(()=>{try{return JSON.parse(r)}catch{throw new ri.MongoCryptAzureKMSRequestError("Malformed JSON body in GET request.")}})();if(t!==200)throw new ri.MongoCryptAzureKMSRequestError("Unable to complete request.",n);if(!n.access_token)throw new ri.MongoCryptAzureKMSRequestError("Malformed response body - missing field `access_token`.");if(!n.expires_in)throw new ri.MongoCryptAzureKMSRequestError("Malformed response body - missing field `expires_in`.");let s=Number(n.expires_in)*1000;if(Number.isNaN(s))throw new ri.MongoCryptAzureKMSRequestError("Malformed response body - unable to parse int from `expires_in` field.");return{accessToken:n.access_token,expiresOnTimestamp:Date.now()+s}}function BF(e,t,r){if(e.searchParams.append("api-version","2018-02-01"),e.searchParams.append("resource",t),r)e.searchParams.append("client_id",r);return e}function NF(e){let t=new URL(e.url?.toString()??$F.AZURE_BASE_URL);return BF(t,"https://vault.azure.net"),{headers:{...e.headers,"Content-Type":"application/json",Metadata:!0},url:t}}async function IF(e={}){let{headers:t,url:r}=NF(e);try{let n=await FF.get(r,{headers:t});return await Hhe(n)}catch(n){if(n instanceof PF.MongoNetworkTimeoutError)throw new ri.MongoCryptAzureKMSRequestError(`[Azure KMS] ${n.message}`);throw n}}async function Ghe(e){let t=await $F.tokenCache.getToken();return{...e,azure:t}}});var qF=g(function(kF){Object.defineProperty(kF,"__esModule",{value:!0});kF.loadGCPCredentials=efe;var vF=eo();async function efe(e){let t=vF.getGcpMetadata();if("kModuleError"in t)return e;let{access_token:r}=await t.instance({property:"service-accounts/default/token"});return{...e,gcp:{accessToken:r}}}});var n3=g(function(VF){Object.defineProperty(VF,"__esModule",{value:!0});VF.isEmptyCredentials=Cm;VF.refreshKMSCredentials=rfe;var jF=xF(),LF=r3(),UF=qF();function Cm(e,t){let r=t[e];if(r==null)return!1;return typeof r==="object"&&Object.keys(r).length===0}async function rfe(e,t){let r=e;if(Cm("aws",e))r=await jF.loadAWSCredentials(r,t?.aws);if(Cm("gcp",e))r=await UF.loadGCPCredentials(r);if(Cm("azure",e))r=await LF.loadAzureCredentials(r);return r}});var s3=g(function(sB){Object.defineProperty(sB,"__esModule",{value:!0});sB.StateMachine=void 0;var bm=L("fs/promises"),WF=L("net"),KF=L("process"),HF=L("tls"),Yr=Se(),Dm=ps(),GF=eo(),Tm=J(),Hu=Gn(),Ir=ae(),YF=Mm(),Mn=bl(),Wh=null;function ife(){if(Wh==null){let e=GF.getSocks();if("kModuleError"in e)throw e.kModuleError;Wh=e}return Wh}var La=0,QF=1,JF=2,XF=3,ZF=7,eB=4,tB=5,rB=6,ofe=443,ufe=new Map([[La,"MONGOCRYPT_CTX_ERROR"],[QF,"MONGOCRYPT_CTX_NEED_MONGO_COLLINFO"],[JF,"MONGOCRYPT_CTX_NEED_MONGO_MARKINGS"],[XF,"MONGOCRYPT_CTX_NEED_MONGO_KEYS"],[ZF,"MONGOCRYPT_CTX_NEED_KMS_CREDENTIALS"],[eB,"MONGOCRYPT_CTX_NEED_KMS"],[tB,"MONGOCRYPT_CTX_READY"],[rB,"MONGOCRYPT_CTX_DONE"]]),afe=["tlsInsecure","tlsAllowInvalidCertificates","tlsAllowInvalidHostnames"];function zF(e){if(KF.env.MONGODB_CRYPT_DEBUG)console.error(e)}var cfe;class nB{constructor(e,t=Yr.pluckBSONSerializeOptions(e)){this.options=e,this.bsonOptions=t}async execute(e,t,r){let{_keyVaultNamespace:n,_keyVaultClient:s,_metaDataClient:i,_mongocryptdClient:o,_mongocryptdManager:u}=e,a=null,c=()=>t.status,l=()=>t.state;while(l()!==rB&&l()!==La)switch(r.signal?.throwIfAborted(),zF(`[context#${t.id}] ${ufe.get(l())||l()}`),l()){case QF:{let f=Yr.deserialize(t.nextMongoOperation());if(!i)throw new Mn.MongoCryptError("unreachable state machine state: entered MONGOCRYPT_CTX_NEED_MONGO_COLLINFO but metadata client is undefined");let h=this.fetchCollectionInfo(i,t.ns,f,r);for await(let d of h)if(t.addMongoOperationResponse(Yr.serialize(d)),l()===La)break;if(l()===La)break;t.finishMongoOperation();break}case JF:{let f=t.nextMongoOperation();if(l()===La)break;if(!o)throw new Mn.MongoCryptError("unreachable state machine state: entered MONGOCRYPT_CTX_NEED_MONGO_MARKINGS but mongocryptdClient is undefined");let h=u?await u.withRespawn(this.markCommand.bind(this,o,t.ns,f,r)):await this.markCommand(o,t.ns,f,r);t.addMongoOperationResponse(h),t.finishMongoOperation();break}case XF:{let f=t.nextMongoOperation(),h=await this.fetchKeys(s,n,f,r);if(h.length===0)a=cfe??=Yr.serialize({v:[]});for(let d of h)t.addMongoOperationResponse(Yr.serialize(d));t.finishMongoOperation();break}case ZF:{let f=await e.askForKMSCredentials();t.provideKMSProviders(Yr.serialize(f));break}case eB:{await Promise.all(this.requests(t,r)),t.finishKMSRequests();break}case tB:{let f=t.finalize();if(l()===La){let h=c().message||"Finalization error";throw new Mn.MongoCryptError(h)}a=f;break}default:throw new Mn.MongoCryptError(`Unknown state: ${l()}`)}if(l()===La||a==null){let f=c().message;if(!f)zF("unidentifiable error in MongoCrypt - received an error status from `libmongocrypt` but received no error message.");throw new Mn.MongoCryptError(f??"unidentifiable error in MongoCrypt - received an error status from `libmongocrypt` but received no error message.")}return a}async kmsRequest(e,t){let r=e.endpoint.split(":"),n=r[1]!=null?Number.parseInt(r[1],10):ofe,s={host:r[0],servername:r[0],port:n,...YF.autoSelectSocketOptions(this.options.socketOptions||{})},i=e.message,o=new Ir.BufferPool,u,a;function c(){for(let m of[a,u])if(m)m.destroy()}function l(m){return new Mn.MongoCryptError("KMS request failed",{cause:m})}function f(){return new Mn.MongoCryptError("KMS request closed")}let h=this.options.tlsOptions;if(h){let m=e.kmsProvider,E=h[m];if(E){let y=this.validateTlsOptions(m,E);if(y)throw y;try{await this.setTlsOptions(E,s)}catch(_){throw l(_)}}}let d,p;try{if(t?.signal?.throwIfAborted(),this.options.kmsConnectCallback){let C=t?.timeoutContext?.csotEnabled()?t.timeoutContext.getRemainingTimeMSOrThrow(`KMS request timed out after ${t.timeoutContext.timeoutMS}ms`):void 0,A=Number.isFinite(C)?C:void 0,M=new AbortController,O=Ir.addAbortListener(t?.signal,function(){M.abort(this.reason)}),x=this.options.kmsConnectCallback({host:s.host,port:s.port,timeoutMS:A,signal:M.signal});x.then((P)=>{if(M.signal.aborted)P.destroy()},()=>null);let v=A?Hu.Timeout.expires(A):void 0;try{s.socket=v?await Promise.race([x,v]):await x}catch(P){if(Hu.TimeoutError.is(P)){let ge=new Tm.MongoOperationTimeoutError("KMS request timed out");throw M.abort(ge),ge}throw l(P)}finally{v?.clear(),O?.[Ir.kDispose]()}}else if(this.options.proxyOptions&&this.options.proxyOptions.proxyHost){u=new WF.Socket;let{promise:C,reject:A,resolve:M}=Ir.promiseWithResolvers();u.once("error",(x)=>A(l(x))).once("close",()=>A(f())).once("connect",()=>M());let O={...s,host:this.options.proxyOptions.proxyHost,port:this.options.proxyOptions.proxyPort||1080};u.connect(O),await C;try{Wh??=ife(),s.socket=(await Wh.SocksClient.createConnection({existing_socket:u,command:"connect",destination:{host:s.host,port:s.port},proxy:{host:"iLoveJavaScript",port:0,type:5,userId:this.options.proxyOptions.proxyUsername,password:this.options.proxyOptions.proxyPassword}})).socket}catch(x){throw l(x)}}a=HF.connect(s,()=>{a.write(i)});let{promise:m,reject:E,resolve:y}=Ir.promiseWithResolvers();d=Ir.addAbortListener(t?.signal,function(){c(),E(this.reason)}),a.once("error",(C)=>E(l(C))).once("close",()=>E(f())).on("data",(C)=>{o.append(C);while(e.bytesNeeded>0&&o.length){let A=Math.min(e.bytesNeeded,o.length);e.addResponse(o.read(A))}if(e.bytesNeeded<=0)y()});let _=t?.timeoutContext?.csotEnabled()?t.timeoutContext.getRemainingTimeMSOrThrow(`KMS request timed out after ${t.timeoutContext.timeoutMS}ms`):void 0,w=Number.isFinite(_)?_:void 0;p=w?Hu.Timeout.expires(w):void 0,await(p?Promise.race([m,p]):m)}catch(m){if(Hu.TimeoutError.is(m))throw new Tm.MongoOperationTimeoutError("KMS request timed out");throw m}finally{c(),d?.[Ir.kDispose](),p?.clear()}}*requests(e,t){for(let r=e.nextKMSRequest();r!=null;r=e.nextKMSRequest())yield this.kmsRequest(r,t)}validateTlsOptions(e,t){let r=Object.keys(t);for(let n of afe)if(r.includes(n))return new Mn.MongoCryptError(`Insecure TLS options prohibited for ${e}: ${n}`)}async setTlsOptions(e,t){if(e.secureContext)t.secureContext=e.secureContext;if(e.tlsCertificateKeyFile){let r=await bm.readFile(e.tlsCertificateKeyFile);t.cert=t.key=r}if(e.tlsCAFile)t.ca=await bm.readFile(e.tlsCAFile);if(e.tlsCertificateKeyFilePassword)t.passphrase=e.tlsCertificateKeyFilePassword}fetchCollectionInfo(e,t,r,n){let{db:s}=Ir.MongoDBCollectionNamespace.fromString(t);return e.db(s).listCollections(r,{promoteLongs:!1,promoteValues:!1,timeoutContext:n?.timeoutContext&&new Dm.CursorTimeoutContext(n?.timeoutContext,Symbol()),signal:n?.signal,nameOnly:!1})}async markCommand(e,t,r,n){let{db:s}=Ir.MongoDBCollectionNamespace.fromString(t),i={promoteLongs:!1,promoteValues:!1},o=Yr.deserialize(r,i),u={timeoutMS:void 0,signal:void 0};if(n?.timeoutContext?.csotEnabled())u.timeoutMS=n.timeoutContext.remainingTimeMS;if(n?.signal)u.signal=n.signal;let a=await e.db(s).command(o,{...i,...u});return Yr.serialize(a,this.bsonOptions)}fetchKeys(e,t,r,n){let{db:s,collection:i}=Ir.MongoDBCollectionNamespace.fromString(t),o={timeoutContext:void 0,signal:void 0};if(n?.timeoutContext!=null)o.timeoutContext=new Dm.CursorTimeoutContext(n.timeoutContext,Symbol());if(n?.signal!=null)o.signal=n.signal;return e.db(s).collection(i,{readConcern:{level:"majority"}}).find(Yr.deserialize(r),o).toArray()}}sB.StateMachine=nB});var Mm=g(function(uB){Object.defineProperty(uB,"__esModule",{value:!0});uB.ClientEncryption=void 0;uB.autoSelectSocketOptions=Kh;var Ct=Se(),oB=eo(),po=Gn(),Ft=ae(),$r=bl(),xm=n3(),Gu=s3();class Pm{static getMongoCrypt(){let e=oB.getMongoDBClientEncryption();if("kModuleError"in e)throw e.kModuleError;return e.MongoCrypt}constructor(e,t){if(this._client=e,this._proxyOptions=t.proxyOptions??{},this._proxyOptions.proxyHost&&t.kmsConnectCallback)throw new $r.MongoCryptInvalidArgumentError("Cannot set both proxyOptions and kmsConnectCallback");this._tlsOptions=t.tlsOptions??{},this._kmsConnectCallback=t.kmsConnectCallback,this._kmsProviders=t.kmsProviders||{};let{timeoutMS:r}=Ft.resolveTimeoutOptions(e,t);if(this._timeoutMS=r,this._credentialProviders=t.credentialProviders,t.credentialProviders?.aws&&!xm.isEmptyCredentials("aws",this._kmsProviders))throw new $r.MongoCryptInvalidArgumentError("Can only provide a custom AWS credential provider when the state machine is configured for automatic AWS credential fetching");if(t.keyVaultNamespace==null)throw new $r.MongoCryptInvalidArgumentError("Missing required option `keyVaultNamespace`");let n={...t,kmsProviders:Ct.serialize(this._kmsProviders),errorWrapper:$r.defaultErrorWrapper};this._keyVaultNamespace=t.keyVaultNamespace,this._keyVaultClient=t.keyVaultClient||e;let s=Pm.getMongoCrypt();this._mongoCrypt=new s(n)}async createDataKey(e,t={}){if(t.keyAltNames&&!Array.isArray(t.keyAltNames))throw new $r.MongoCryptInvalidArgumentError(`Option "keyAltNames" must be an array of strings, but was of type ${typeof t.keyAltNames}.`);let r=void 0;if(t.keyAltNames&&t.keyAltNames.length>0)r=t.keyAltNames.map((h,d)=>{if(typeof h!=="string")throw new $r.MongoCryptInvalidArgumentError(`Option "keyAltNames" must be an array of strings, but item at index ${d} was of type ${typeof h}`);return Ct.serialize({keyAltName:h})});let n=void 0;if(t.keyMaterial)n=Ct.serialize({keyMaterial:t.keyMaterial});let s=Ct.serialize({provider:e,...t.masterKey}),i=this._mongoCrypt.makeDataKeyContext(s,{keyAltNames:r,keyMaterial:n}),o=new Gu.StateMachine({proxyOptions:this._proxyOptions,tlsOptions:this._tlsOptions,socketOptions:Kh(this._client.s.options),kmsConnectCallback:this._kmsConnectCallback}),u=t?.timeoutContext??po.TimeoutContext.create(Ft.resolveTimeoutOptions(this._client,{timeoutMS:this._timeoutMS})),a=Ct.deserialize(await o.execute(this,i,{timeoutContext:u})),{db:c,collection:l}=Ft.MongoDBCollectionNamespace.fromString(this._keyVaultNamespace),{insertedId:f}=await this._keyVaultClient.db(c).collection(l).insertOne(a,{writeConcern:{w:"majority"},timeoutMS:u?.csotEnabled()?u?.getRemainingTimeMSOrThrow():void 0});return f}async rewrapManyDataKey(e,t){let r=void 0;if(t){let h=Object.assign({provider:t.provider},t.masterKey);r=Ct.serialize(h)}let n=Ct.serialize(e),s=this._mongoCrypt.makeRewrapManyDataKeyContext(n,r),i=new Gu.StateMachine({proxyOptions:this._proxyOptions,tlsOptions:this._tlsOptions,socketOptions:Kh(this._client.s.options),kmsConnectCallback:this._kmsConnectCallback}),o=po.TimeoutContext.create(Ft.resolveTimeoutOptions(this._client,{timeoutMS:this._timeoutMS})),{v:u}=Ct.deserialize(await i.execute(this,s,{timeoutContext:o}));if(u.length===0)return{};let{db:a,collection:c}=Ft.MongoDBCollectionNamespace.fromString(this._keyVaultNamespace),l=u.map((h)=>({updateOne:{filter:{_id:h._id},update:{$set:{masterKey:h.masterKey,keyMaterial:h.keyMaterial},$currentDate:{updateDate:!0}}}}));return{bulkWriteResult:await this._keyVaultClient.db(a).collection(c).bulkWrite(l,{writeConcern:{w:"majority"},timeoutMS:o.csotEnabled()?o?.remainingTimeMS:void 0})}}async deleteKey(e){let{db:t,collection:r}=Ft.MongoDBCollectionNamespace.fromString(this._keyVaultNamespace);return await this._keyVaultClient.db(t).collection(r).deleteOne({_id:e},{writeConcern:{w:"majority"},timeoutMS:this._timeoutMS})}getKeys(){let{db:e,collection:t}=Ft.MongoDBCollectionNamespace.fromString(this._keyVaultNamespace);return this._keyVaultClient.db(e).collection(t).find({},{readConcern:{level:"majority"},timeoutMS:this._timeoutMS})}async getKey(e){let{db:t,collection:r}=Ft.MongoDBCollectionNamespace.fromString(this._keyVaultNamespace);return await this._keyVaultClient.db(t).collection(r).findOne({_id:e},{readConcern:{level:"majority"},timeoutMS:this._timeoutMS})}async getKeyByAltName(e){let{db:t,collection:r}=Ft.MongoDBCollectionNamespace.fromString(this._keyVaultNamespace);return await this._keyVaultClient.db(t).collection(r).findOne({keyAltNames:e},{readConcern:{level:"majority"},timeoutMS:this._timeoutMS})}async addKeyAltName(e,t){let{db:r,collection:n}=Ft.MongoDBCollectionNamespace.fromString(this._keyVaultNamespace);return await this._keyVaultClient.db(r).collection(n).findOneAndUpdate({_id:e},{$addToSet:{keyAltNames:t}},{writeConcern:{w:"majority"},returnDocument:"before",timeoutMS:this._timeoutMS})}async removeKeyAltName(e,t){let{db:r,collection:n}=Ft.MongoDBCollectionNamespace.fromString(this._keyVaultNamespace),s=[{$set:{keyAltNames:{$cond:[{$eq:["$keyAltNames",[t]]},"$$REMOVE",{$filter:{input:"$keyAltNames",cond:{$ne:["$$this",t]}}}]}}}];return await this._keyVaultClient.db(r).collection(n).findOneAndUpdate({_id:e},s,{writeConcern:{w:"majority"},returnDocument:"before",timeoutMS:this._timeoutMS})}async createEncryptedCollection(e,t,r){let{provider:n,masterKey:s,createCollectionOptions:{encryptedFields:{...i},...o}}=r,u=this._timeoutMS!=null?po.TimeoutContext.create(Ft.resolveTimeoutOptions(this._client,{timeoutMS:this._timeoutMS})):void 0;if(Array.isArray(i.fields)){let a=i.fields.map(async(f)=>f==null||typeof f!=="object"||f.keyId!=null?f:{...f,keyId:await this.createDataKey(n,{masterKey:s,timeoutContext:u?.csotEnabled()?u?.clone():void 0})}),c=await Promise.allSettled(a);i.fields=c.map((f,h)=>f.status==="fulfilled"?f.value:i.fields[h]);let l=c.find((f)=>f.status==="rejected");if(l!=null)throw new $r.MongoCryptCreateDataKeyError(i,{cause:l.reason})}try{return{collection:await e.createCollection(t,{...o,encryptedFields:i,timeoutMS:u?.csotEnabled()?u?.getRemainingTimeMSOrThrow():void 0}),encryptedFields:i}}catch(a){throw new $r.MongoCryptCreateEncryptedCollectionError(i,{cause:a})}}async encrypt(e,t){return await this._encrypt(e,!1,t)}async encryptExpression(e,t){return await this._encrypt(e,!0,t)}async decrypt(e){let t=Ct.serialize({v:e}),r=this._mongoCrypt.makeExplicitDecryptionContext(t),n=new Gu.StateMachine({proxyOptions:this._proxyOptions,tlsOptions:this._tlsOptions,socketOptions:Kh(this._client.s.options),kmsConnectCallback:this._kmsConnectCallback}),s=this._timeoutMS!=null?po.TimeoutContext.create(Ft.resolveTimeoutOptions(this._client,{timeoutMS:this._timeoutMS})):void 0,{v:i}=Ct.deserialize(await n.execute(this,r,{timeoutContext:s}));return i}async askForKMSCredentials(){return await xm.refreshKMSCredentials(this._kmsProviders,this._credentialProviders)}static get libmongocryptVersion(){return Pm.getMongoCrypt().libmongocryptVersion}async _encrypt(e,t,r){let{algorithm:n,keyId:s,keyAltName:i,contentionFactor:o,queryType:u,rangeOptions:a,stringOptions:c,textOptions:l}=r,f={expressionMode:t,algorithm:n};if(s)f.keyId=s.buffer;if(i){if(s)throw new $r.MongoCryptInvalidArgumentError('"options" cannot contain both "keyId" and "keyAltName"');if(typeof i!=="string")throw new $r.MongoCryptInvalidArgumentError(`"options.keyAltName" must be of type string, but was of type ${typeof i}`);f.keyAltName=Ct.serialize({keyAltName:i})}if(typeof o==="number"||typeof o==="bigint")f.contentionFactor=o;if(typeof u==="string")f.queryType=u;if(typeof a==="object")f.rangeOptions=Ct.serialize(a);let h=c??l;if(typeof h==="object")f.textOptions=Ct.serialize(h);let d=Ct.serialize({v:e}),p=new Gu.StateMachine({proxyOptions:this._proxyOptions,tlsOptions:this._tlsOptions,socketOptions:Kh(this._client.s.options),kmsConnectCallback:this._kmsConnectCallback}),m=this._mongoCrypt.makeExplicitEncryptionContext(d,f),E=this._timeoutMS!=null?po.TimeoutContext.create(Ft.resolveTimeoutOptions(this._client,{timeoutMS:this._timeoutMS})):void 0,{v:y}=Ct.deserialize(await p.execute(this,m,{timeoutContext:E}));return y}}uB.ClientEncryption=Pm;function Kh(e){let t={};if("autoSelectFamily"in e)t.autoSelectFamily=e.autoSelectFamily;if("autoSelectFamilyAttemptTimeout"in e)t.autoSelectFamilyAttemptTimeout=e.autoSelectFamilyAttemptTimeout;return t}});var fB=g(function(lB){Object.defineProperty(lB,"__esModule",{value:!0});lB.MongocryptdManager=void 0;var cB=J();class i3{static{this.DEFAULT_MONGOCRYPTD_URI="mongodb://localhost:27020"}constructor(e={}){if(this.spawnPath="",this.spawnArgs=[],this.uri=typeof e.mongocryptdURI==="string"&&e.mongocryptdURI.length>0?e.mongocryptdURI:i3.DEFAULT_MONGOCRYPTD_URI,this.bypassSpawn=!!e.mongocryptdBypassSpawn,Object.hasOwn(e,"mongocryptdSpawnPath")&&e.mongocryptdSpawnPath)this.spawnPath=e.mongocryptdSpawnPath;if(Object.hasOwn(e,"mongocryptdSpawnArgs")&&Array.isArray(e.mongocryptdSpawnArgs))this.spawnArgs=this.spawnArgs.concat(e.mongocryptdSpawnArgs);if(this.spawnArgs.filter((t)=>typeof t==="string").every((t)=>t.indexOf("--idleShutdownTimeoutSecs")<0))this.spawnArgs.push("--idleShutdownTimeoutSecs","60")}async spawn(){let e=this.spawnPath||"mongocryptd",{spawn:t}=L("child_process");this._child=t(e,this.spawnArgs,{stdio:"ignore",detached:!0}),this._child.on("error",()=>{}),this._child.unref()}async withRespawn(e){try{return await e()}catch(r){if(!(r instanceof cB.MongoNetworkTimeoutError&&!this.bypassSpawn))throw r}return await this.spawn(),await e()}}lB.MongocryptdManager=i3});var o3=g(function(_B){var dB;Object.defineProperty(_B,"__esModule",{value:!0});_B.AutoEncrypter=_B.AutoEncryptionLoggerLevel=void 0;var Fm=L("net"),xn=Se(),pB=wr(),mB=eo(),Dl=J(),yB=Ua(),gB=ae(),Tl=Mm(),Yu=bl(),EB=fB(),Bm=n3(),Nm=s3();_B.AutoEncryptionLoggerLevel=Object.freeze({FatalError:0,Error:1,Warning:2,Info:3,Trace:4});class Im{static{dB=pB.kDecorateResult}static getMongoCrypt(){let e=mB.getMongoDBClientEncryption();if("kModuleError"in e)throw e.kModuleError;return e.MongoCrypt}constructor(e,t){if(this[dB]=!1,this._client=e,this._bypassEncryption=t.bypassAutoEncryption===!0,this._keyVaultNamespace=t.keyVaultNamespace||"admin.datakeys",this._keyVaultClient=t.keyVaultClient||e,this._metaDataClient=t.metadataClient||e,this._proxyOptions=t.proxyOptions||{},this._proxyOptions.proxyHost&&t.kmsConnectCallback)throw new Yu.MongoCryptInvalidArgumentError("Cannot set both proxyOptions and kmsConnectCallback");if(this._tlsOptions=t.tlsOptions||{},this._kmsConnectCallback=t.kmsConnectCallback,this._kmsProviders=t.kmsProviders||{},this._credentialProviders=t.credentialProviders,t.credentialProviders?.aws&&!Bm.isEmptyCredentials("aws",this._kmsProviders))throw new Yu.MongoCryptInvalidArgumentError("Can only provide a custom AWS credential provider when the state machine is configured for automatic AWS credential fetching");let r={errorWrapper:Yu.defaultErrorWrapper};if(t.schemaMap)if(xn.ByteUtils.isUint8Array(t.schemaMap))r.schemaMap=t.schemaMap;else r.schemaMap=xn.serialize(t.schemaMap);if(t.encryptedFieldsMap)if(xn.ByteUtils.isUint8Array(t.encryptedFieldsMap))r.encryptedFieldsMap=t.encryptedFieldsMap;else r.encryptedFieldsMap=xn.serialize(t.encryptedFieldsMap);if(xn.ByteUtils.isUint8Array(this._kmsProviders))r.kmsProviders=this._kmsProviders;else r.kmsProviders=xn.serialize(this._kmsProviders);if(t.options?.logger)r.logger=t.options.logger;if(t.extraOptions&&t.extraOptions.cryptSharedLibPath)r.cryptSharedLibPath=t.extraOptions.cryptSharedLibPath;if(t.bypassQueryAnalysis)r.bypassQueryAnalysis=t.bypassQueryAnalysis;if(t.keyExpirationMS!=null)r.keyExpirationMS=t.keyExpirationMS;if(this._bypassMongocryptdAndCryptShared=this._bypassEncryption||!!t.bypassQueryAnalysis,t.extraOptions&&t.extraOptions.cryptSharedLibSearchPaths)r.cryptSharedLibSearchPaths=t.extraOptions.cryptSharedLibSearchPaths;else if(!this._bypassMongocryptdAndCryptShared)r.cryptSharedLibSearchPaths=["$SYSTEM"];let n=Im.getMongoCrypt();if(this._mongocrypt=new n(r),this._contextCounter=0,t.extraOptions&&t.extraOptions.cryptSharedLibRequired&&!this.cryptSharedLibVersionInfo)throw new Yu.MongoCryptInvalidArgumentError("`cryptSharedLibRequired` set but no crypt_shared library loaded");if(!this._bypassMongocryptdAndCryptShared&&!this.cryptSharedLibVersionInfo){this._mongocryptdManager=new EB.MongocryptdManager(t.extraOptions);let s={serverSelectionTimeoutMS:1e4};if((t.extraOptions==null||typeof t.extraOptions.mongocryptdURI!=="string")&&!Fm.getDefaultAutoSelectFamily)s.family=4;if(Fm.getDefaultAutoSelectFamily)Object.assign(s,Tl.autoSelectSocketOptions(this._client.s?.options??{}));this._mongocryptdClient=new yB.MongoClient(this._mongocryptdManager.uri,s)}}async init(){if(this._bypassMongocryptdAndCryptShared||this.cryptSharedLibVersionInfo)return;if(!this._mongocryptdManager)throw new Dl.MongoRuntimeError("Reached impossible state: mongocryptdManager is undefined when neither bypassSpawn nor the shared lib are specified.");if(!this._mongocryptdClient)throw new Dl.MongoRuntimeError("Reached impossible state: mongocryptdClient is undefined when neither bypassSpawn nor the shared lib are specified.");if(!this._mongocryptdManager.bypassSpawn)await this._mongocryptdManager.spawn();try{return await this._mongocryptdClient.connect()}catch(e){throw new Dl.MongoRuntimeError("Unable to connect to `mongocryptd`, please make sure it is running or in your PATH for auto-spawn",{cause:e})}}async close(){await this._mongocryptdClient?.close()}async encrypt(e,t,r={}){if(r.signal?.throwIfAborted(),this._bypassEncryption)return t;let n=xn.serialize(t,r),s=this._mongocrypt.makeEncryptionContext(gB.MongoDBCollectionNamespace.fromString(e).db,n);s.id=this._contextCounter++,s.ns=e,s.document=t;let i=new Nm.StateMachine({promoteValues:!1,promoteLongs:!1,proxyOptions:this._proxyOptions,tlsOptions:this._tlsOptions,socketOptions:Tl.autoSelectSocketOptions(this._client.s.options),kmsConnectCallback:this._kmsConnectCallback});return xn.deserialize(await i.execute(this,s,r),{promoteValues:!1,promoteLongs:!1})}async decrypt(e,t={}){t.signal?.throwIfAborted();let r=this._mongocrypt.makeDecryptionContext(e);return r.id=this._contextCounter++,await new Nm.StateMachine({...t,proxyOptions:this._proxyOptions,tlsOptions:this._tlsOptions,socketOptions:Tl.autoSelectSocketOptions(this._client.s.options),kmsConnectCallback:this._kmsConnectCallback}).execute(this,r,t)}async askForKMSCredentials(){return await Bm.refreshKMSCredentials(this._kmsProviders,this._credentialProviders)}get cryptSharedLibVersionInfo(){return this._mongocrypt.cryptSharedLibVersionInfo}static get libmongocryptVersion(){return Im.getMongoCrypt().libmongocryptVersion}}_B.AutoEncrypter=Im});var MB=g(function(DB){Object.defineProperty(DB,"__esModule",{value:!0});DB.Encrypter=void 0;var wB=o3(),OB=wr(),SB=eo(),$m=J(),CB=Ua();class bB{constructor(e,t,r){if(typeof r.autoEncryption!=="object")throw new $m.MongoInvalidArgumentError('Option "autoEncryption" must be specified');if(this.internalClient=null,this.bypassAutoEncryption=!!r.autoEncryption.bypassAutoEncryption,this.needsConnecting=!1,r.maxPoolSize===0&&r.autoEncryption.keyVaultClient==null)r.autoEncryption.keyVaultClient=e;else if(r.autoEncryption.keyVaultClient==null)r.autoEncryption.keyVaultClient=this.getInternalClient(e,t,r);if(this.bypassAutoEncryption)r.autoEncryption.metadataClient=void 0;else if(r.maxPoolSize===0)r.autoEncryption.metadataClient=e;else r.autoEncryption.metadataClient=this.getInternalClient(e,t,r);if(r.proxyHost)r.autoEncryption.proxyOptions={proxyHost:r.proxyHost,proxyPort:r.proxyPort,proxyUsername:r.proxyUsername,proxyPassword:r.proxyPassword};this.autoEncrypter=new wB.AutoEncrypter(e,r.autoEncryption)}getInternalClient(e,t,r){let n=this.internalClient;if(n==null){let s={};for(let i of[...Object.getOwnPropertyNames(r),...Object.getOwnPropertySymbols(r)]){if(["autoEncryption","minPoolSize","servers","caseTranslate","dbName"].includes(i))continue;Reflect.set(s,i,Reflect.get(r,i))}s.minPoolSize=0,n=new CB.MongoClient(t,s),this.internalClient=n;for(let i of OB.MONGO_CLIENT_EVENTS)for(let o of e.listeners(i))n.on(i,o);e.on("newListener",(i,o)=>{n?.on(i,o)}),this.needsConnecting=!0}return n}async connectInternalClient(){let e=this.internalClient;if(this.needsConnecting&&e!=null)this.needsConnecting=!1,await e.connect()}async close(e){let t;try{await this.autoEncrypter.close()}catch(n){t=n}let r=this.internalClient;if(r!=null&&e!==r)return await r.close();if(t!=null)throw t}static checkForMongoCrypt(){let e=SB.getMongoDBClientEncryption();if("kModuleError"in e)throw new $m.MongoMissingDependencyError("Auto-encryption requested, but the module is not installed. Please add `mongodb-client-encryption` as a dependency of your project",{cause:e.kModuleError,dependencyName:"mongodb-client-encryption"})}}DB.Encrypter=bB});var FB=g(function(xB){Object.defineProperty(xB,"__esModule",{value:!0});xB.ALLOWED_DRIVER_REQUIRE_PROPERTY_NAME=void 0;xB.resolveRuntimeAdapters=ffe;xB.ALLOWED_DRIVER_REQUIRE_PROPERTY_NAME="allowedDriverRequire";async function ffe(e){return{os:e.runtimeAdapters?.os??await import("os")}}});var h3=g(function(vB){Object.defineProperty(vB,"__esModule",{value:!0});vB.SENSITIVE_COMMANDS=vB.CommandFailedEvent=vB.CommandSucceededEvent=vB.CommandStartedEvent=void 0;var mo=wr(),vm=ae(),Rm=Au();class IB{constructor(e,t,r){this.name=mo.COMMAND_STARTED;let n=c3(t),s=u3(n),{address:i,connectionId:o,serviceId:u}=l3(e);if(vB.SENSITIVE_COMMANDS.has(s))this.commandObj={},this.commandObj[s]=!0;this.address=i,this.connectionId=o,this.serviceId=u,this.requestId=t.requestId,this.databaseName=t.databaseName,this.commandName=s,this.command=a3(s,n,n),this.serverConnectionId=r}get hasServiceId(){return!!this.serviceId}}vB.CommandStartedEvent=IB;class $B{constructor(e,t,r,n,s){this.name=mo.COMMAND_SUCCEEDED;let i=c3(t),o=u3(i),{address:u,connectionId:a,serviceId:c}=l3(e);this.address=u,this.connectionId=a,this.serviceId=c,this.requestId=t.requestId,this.commandName=o,this.duration=vm.calculateDurationInMs(n),this.reply=a3(o,i,yfe(r)),this.serverConnectionId=s,this.databaseName=t.databaseName}get hasServiceId(){return!!this.serviceId}}vB.CommandSucceededEvent=$B;class RB{constructor(e,t,r,n,s){this.name=mo.COMMAND_FAILED;let i=c3(t),o=u3(i),{address:u,connectionId:a,serviceId:c}=l3(e);this.address=u,this.connectionId=a,this.serviceId=c,this.requestId=t.requestId,this.commandName=o,this.duration=vm.calculateDurationInMs(n),this.failure=a3(o,i,r),this.serverConnectionId=s,this.databaseName=t.databaseName}get hasServiceId(){return!!this.serviceId}}vB.CommandFailedEvent=RB;vB.SENSITIVE_COMMANDS=new Set(["authenticate","saslStart","saslContinue","getnonce","createUser","updateUser","copydbgetnonce","copydbsaslstart","copydb"]);var pfe=new Set(["hello",mo.LEGACY_HELLO_COMMAND,mo.LEGACY_HELLO_COMMAND_CAMEL_CASE]),u3=(e)=>Object.keys(e)[0],mfe=(e)=>e.ns.split(".")[1],a3=(e,t,r)=>vB.SENSITIVE_COMMANDS.has(e)||pfe.has(e)&&t.speculativeAuthenticate?{}:r,BB={$query:"filter",$orderby:"sort",$hint:"hint",$comment:"comment",$maxScan:"maxScan",$max:"max",$min:"min",$returnKey:"returnKey",$showDiskLoc:"showRecordId",$maxTimeMS:"maxTimeMS",$snapshot:"snapshot"},NB={numberToSkip:"skip",numberToReturn:"batchSize",returnFieldSelector:"projection"};function c3(e){if(e instanceof Rm.OpMsgRequest){let n={...e.command};for(let s of Object.keys(n))if(n[s]instanceof Rm.DocumentSequence)n[s]=n[s].documents;return n}if(e.query?.$query){let n;if(e.ns==="admin.$cmd")n=Object.assign({},e.query.$query);else n={find:mfe(e)},Object.keys(BB).forEach((s)=>{if(e.query[s]!=null)n[BB[s]]={...e.query[s]}});return Object.keys(NB).forEach((s)=>{let i=s;if(e[i]!=null)n[NB[i]]=e[i]}),n}let t={},r={...e};if(e.query)t={...e.query},r.query=t;return e.query?t:r}function yfe(e){if(!e)return e;return e.result?e.result:e}function l3(e){let t;if("id"in e)t=e.id;return{address:e.address,serviceId:e.serviceId,connectionId:t}}});var Hh=g(function(UB){Object.defineProperty(UB,"__esModule",{value:!0});UB.ServerDescription=void 0;UB.parseServerType=jB;UB.compareTopologyVersion=LB;var ni=Se(),kB=J(),si=ae(),Ue=as(),Afe=new Set([Ue.ServerType.RSPrimary,Ue.ServerType.Standalone,Ue.ServerType.Mongos,Ue.ServerType.LoadBalancer]),wfe=new Set([Ue.ServerType.RSPrimary,Ue.ServerType.RSSecondary,Ue.ServerType.Mongos,Ue.ServerType.Standalone,Ue.ServerType.LoadBalancer]);class qB{constructor(e,t,r={}){if(e==null||e==="")throw new kB.MongoRuntimeError("ServerDescription must be provided with a non-empty address");this.address=typeof e==="string"?si.HostAddress.fromString(e).toString():e.toString(),this.type=jB(t,r),this.hosts=t?.hosts?.map((n)=>n.toLowerCase())??[],this.passives=t?.passives?.map((n)=>n.toLowerCase())??[],this.arbiters=t?.arbiters?.map((n)=>n.toLowerCase())??[],this.tags=t?.tags??{},this.minWireVersion=t?.minWireVersion??0,this.maxWireVersion=t?.maxWireVersion??0,this.roundTripTime=r?.roundTripTime??-1,this.minRoundTripTime=r?.minRoundTripTime??0,this.lastUpdateTime=si.processTimeMS(),this.lastWriteDate=t?.lastWrite?.lastWriteDate??0,this.error=r.error??null,this.error?.stack,this.topologyVersion=this.error?.topologyVersion??t?.topologyVersion??null,this.setName=t?.setName??null,this.setVersion=t?.setVersion??null,this.electionId=t?.electionId??null,this.logicalSessionTimeoutMinutes=t?.logicalSessionTimeoutMinutes??null,this.maxMessageSizeBytes=t?.maxMessageSizeBytes??null,this.maxWriteBatchSize=t?.maxWriteBatchSize??null,this.maxBsonObjectSize=t?.maxBsonObjectSize??null,this.primary=t?.primary??null,this.me=t?.me?.toLowerCase()??null,this.$clusterTime=t?.$clusterTime??null,this.iscryptd=Boolean(t?.iscryptd)}get hostAddress(){return si.HostAddress.fromString(this.address)}get allHosts(){return this.hosts.concat(this.arbiters).concat(this.passives)}get isReadable(){return this.type===Ue.ServerType.RSSecondary||this.isWritable}get isDataBearing(){return wfe.has(this.type)}get isWritable(){return Afe.has(this.type)}get host(){let e=`:${this.port}`.length;return this.address.slice(0,-e)}get port(){let e=this.address.split(":").pop();return e?Number.parseInt(e,10):27017}equals(e){let t=this.topologyVersion===e?.topologyVersion||LB(this.topologyVersion,e?.topologyVersion)===0,r=this.electionId!=null&&e?.electionId!=null?si.compareObjectId(this.electionId,e.electionId)===0:this.electionId===e?.electionId;return e!=null&&e.iscryptd===this.iscryptd&&si.errorStrictEqual(this.error,e.error)&&this.type===e.type&&this.minWireVersion===e.minWireVersion&&si.arrayStrictEqual(this.hosts,e.hosts)&&Ofe(this.tags,e.tags)&&this.setName===e.setName&&this.setVersion===e.setVersion&&r&&this.primary===e.primary&&this.logicalSessionTimeoutMinutes===e.logicalSessionTimeoutMinutes&&t}}UB.ServerDescription=qB;function jB(e,t){if(t?.loadBalanced)return Ue.ServerType.LoadBalancer;if(!e||!e.ok)return Ue.ServerType.Unknown;if(e.isreplicaset)return Ue.ServerType.RSGhost;if(e.msg&&e.msg==="isdbgrid")return Ue.ServerType.Mongos;if(e.setName)if(e.hidden)return Ue.ServerType.RSOther;else if(e.isWritablePrimary)return Ue.ServerType.RSPrimary;else if(e.secondary)return Ue.ServerType.RSSecondary;else if(e.arbiterOnly)return Ue.ServerType.RSArbiter;else return Ue.ServerType.RSOther;return Ue.ServerType.Standalone}function Ofe(e,t){let r=Object.keys(e),n=Object.keys(t);return r.length===n.length&&r.every((s)=>t[s]===e[s])}function LB(e,t){if(e==null||t==null)return-1;if(!e.processId.equals(t.processId))return-1;let r=typeof e.counter==="bigint"?ni.Long.fromBigInt(e.counter):ni.Long.isLong(e.counter)?e.counter:ni.Long.fromNumber(e.counter),n=typeof t.counter==="bigint"?ni.Long.fromBigInt(t.counter):ni.Long.isLong(t.counter)?t.counter:ni.Long.fromNumber(t.counter);return r.compare(n)}});var QB=g(function(GB){Object.defineProperty(GB,"__esModule",{value:!0});GB.StreamDescription=void 0;var zB=Se(),WB=as(),KB=Hh(),bfe=["minWireVersion","maxWireVersion","maxBsonObjectSize","maxMessageSizeBytes","maxWriteBatchSize","logicalSessionTimeoutMinutes"];class HB{constructor(e,t){this.hello=null,this.address=e,this.type=WB.ServerType.Unknown,this.minWireVersion=void 0,this.maxWireVersion=void 0,this.maxBsonObjectSize=16777216,this.maxMessageSizeBytes=48000000,this.maxWriteBatchSize=1e5,this.logicalSessionTimeoutMinutes=t?.logicalSessionTimeoutMinutes,this.loadBalanced=!!t?.loadBalanced,this.compressors=t&&t.compressors&&Array.isArray(t.compressors)?t.compressors:[],this.serverConnectionId=null}receiveResponse(e){if(e==null)return;if(this.hello=e,this.type=KB.parseServerType(e),"connectionId"in e)this.serverConnectionId=this.parseServerConnectionID(e.connectionId);else this.serverConnectionId=null;for(let t of bfe){if(e[t]!=null)this[t]=e[t];if("__nodejs_mock_server__"in e)this.__nodejs_mock_server__=e.__nodejs_mock_server__}if(e.compression)this.compressor=this.compressors.filter((t)=>e.compression?.includes(t))[0]}parseServerConnectionID(e){return zB.Long.isLong(e)?e.toBigInt():BigInt(e)}}GB.StreamDescription=HB});var XB=g(function(JB){Object.defineProperty(JB,"__esModule",{value:!0});JB.onData=Dfe;var yo=ae();function Dfe(e,{timeoutContext:t,signal:r}){r?.throwIfAborted();let n=new yo.List,s=new yo.List,i=null,o=!1,u={next(){let d=n.shift();if(d!=null)return Promise.resolve({value:d,done:!1});if(i!=null){let y=Promise.reject(i);return i=null,y}if(o)return h();let{promise:p,resolve:m,reject:E}=yo.promiseWithResolvers();return s.push({resolve:m,reject:E}),p},return(){return h()},throw(d){return f(d),Promise.resolve({value:void 0,done:!0})},[Symbol.asyncIterator](){return this},async[Symbol.asyncDispose](){await h()}};e.on("data",l),e.on("error",f);let a=yo.addAbortListener(r,function(){f(this.reason)}),c=t?.timeoutForSocketRead;return c?.throwIfExpired(),c?.then(void 0,f),u;function l(d){let p=s.shift();if(p!=null)p.resolve({value:d,done:!1});else n.push(d)}function f(d){let p=s.shift();if(p!=null)p.reject(d);else i=d;h()}function h(){e.off("data",l),e.off("error",f),a?.[yo.kDispose](),o=!0,c?.clear();let d={value:void 0,done:o};for(let p of s)p.resolve(d);return Promise.resolve(d)}}});var f3=g(function(iN){Object.defineProperty(iN,"__esModule",{value:!0});iN.TopologyDescription=void 0;var sN=Se(),Ju=zo(),Qu=J(),Ml=ae(),ie=as(),Pn=Hh(),Mfe=Ju.MIN_SUPPORTED_SERVER_VERSION,xfe=Ju.MAX_SUPPORTED_SERVER_VERSION,ZB=Ju.MIN_SUPPORTED_WIRE_VERSION,eN=Ju.MAX_SUPPORTED_WIRE_VERSION,Pfe=new Set([ie.ServerType.Mongos,ie.ServerType.Unknown]),tN=new Set([ie.ServerType.Mongos,ie.ServerType.Standalone]),rN=new Set([ie.ServerType.RSSecondary,ie.ServerType.RSArbiter,ie.ServerType.RSOther]);class Gh{constructor(e,t=null,r=null,n=null,s=null,i=null,o=null){o=o??{},this.type=e??ie.TopologyType.Unknown,this.servers=t??new Map,this.stale=!1,this.compatible=!0,this.heartbeatFrequencyMS=o.heartbeatFrequencyMS??0,this.localThresholdMS=o.localThresholdMS??15,this.setName=r??null,this.maxElectionId=s??null,this.maxSetVersion=n??null,this.commonWireVersion=i??0;for(let u of this.servers.values()){if(u.type===ie.ServerType.Unknown||u.type===ie.ServerType.LoadBalancer)continue;if(u.minWireVersion>eN)this.compatible=!1,this.compatibilityError=`Server at ${u.address} requires wire version ${u.minWireVersion}, but this version of the driver only supports up to ${eN} (MongoDB ${xfe})`;if(u.maxWireVersion<ZB){this.compatible=!1,this.compatibilityError=`Server at ${u.address} reports wire version ${u.maxWireVersion}, but this version of the driver requires at least ${ZB} (MongoDB ${Mfe}).`;break}}this.logicalSessionTimeoutMinutes=null;for(let[,u]of this.servers)if(u.isReadable){if(u.logicalSessionTimeoutMinutes==null){this.logicalSessionTimeoutMinutes=null;break}if(this.logicalSessionTimeoutMinutes==null){this.logicalSessionTimeoutMinutes=u.logicalSessionTimeoutMinutes;continue}this.logicalSessionTimeoutMinutes=Math.min(this.logicalSessionTimeoutMinutes,u.logicalSessionTimeoutMinutes)}}updateFromSrvPollingEvent(e,t=0){let r=e.hostnames(),n=new Set(this.servers.keys()),s=new Set(r),i=new Set;for(let u of n)if(s.delete(u),!r.has(u))i.add(u);if(s.size===0&&i.size===0)return this;let o=new Map(this.servers);for(let u of i)o.delete(u);if(s.size>0){if(t===0)for(let u of s)o.set(u,new Pn.ServerDescription(u));else if(o.size<t){let u=Ml.shuffle(s,t-o.size);for(let a of u)o.set(a,new Pn.ServerDescription(a))}}return new Gh(this.type,o,this.setName,this.maxSetVersion,this.maxElectionId,this.commonWireVersion,{heartbeatFrequencyMS:this.heartbeatFrequencyMS,localThresholdMS:this.localThresholdMS})}update(e){let t=e.address,{type:r,setName:n,maxSetVersion:s,maxElectionId:i,commonWireVersion:o}=this,u=e.type,a=new Map(this.servers);if(e.maxWireVersion!==0)if(o===0)o=e.maxWireVersion;else o=Math.min(o,e.maxWireVersion);if(typeof e.setName==="string"&&typeof n==="string"&&e.setName!==n)if(r===ie.TopologyType.Single)e=new Pn.ServerDescription(t);else a.delete(t);if(a.set(t,e),r===ie.TopologyType.Single)return new Gh(ie.TopologyType.Single,a,n,s,i,o,{heartbeatFrequencyMS:this.heartbeatFrequencyMS,localThresholdMS:this.localThresholdMS});if(r===ie.TopologyType.Unknown)if(u===ie.ServerType.Standalone&&this.servers.size!==1)a.delete(t);else r=Ffe(u);if(r===ie.TopologyType.Sharded){if(!Pfe.has(u))a.delete(t)}if(r===ie.TopologyType.ReplicaSetNoPrimary){if(tN.has(u))a.delete(t);if(u===ie.ServerType.RSPrimary){let c=nN(a,e,n,s,i);r=c[0],n=c[1],s=c[2],i=c[3]}else if(rN.has(u)){let c=Nfe(a,e,n);r=c[0],n=c[1]}}if(r===ie.TopologyType.ReplicaSetWithPrimary)if(tN.has(u))a.delete(t),r=Va(a);else if(u===ie.ServerType.RSPrimary){let c=nN(a,e,n,s,i);r=c[0],n=c[1],s=c[2],i=c[3]}else if(rN.has(u))r=Bfe(a,e,n);else r=Va(a);return new Gh(r,a,n,s,i,o,{heartbeatFrequencyMS:this.heartbeatFrequencyMS,localThresholdMS:this.localThresholdMS})}get error(){let e=Array.from(this.servers.values()).filter((t)=>t.error);if(e.length>0)return e[0].error;return null}get hasKnownServers(){return Array.from(this.servers.values()).some((e)=>e.type!==ie.ServerType.Unknown)}get hasDataBearingServers(){return Array.from(this.servers.values()).some((e)=>e.isDataBearing)}hasServer(e){return this.servers.has(e)}toJSON(){return sN.EJSON.serialize(this)}}iN.TopologyDescription=Gh;function Ffe(e){switch(e){case ie.ServerType.Standalone:return ie.TopologyType.Single;case ie.ServerType.Mongos:return ie.TopologyType.Sharded;case ie.ServerType.RSPrimary:return ie.TopologyType.ReplicaSetWithPrimary;case ie.ServerType.RSOther:case ie.ServerType.RSSecondary:return ie.TopologyType.ReplicaSetNoPrimary;default:return ie.TopologyType.Unknown}}function nN(e,t,r=null,n=null,s=null){let i=(a,c,l)=>`primary marked stale due to electionId/setVersion mismatch: server setVersion: ${a.setVersion}, server electionId: ${a.electionId}, topology setVersion: ${c}, topology electionId: ${l}`;if(r=r||t.setName,r!==t.setName)return e.delete(t.address),[Va(e),r,n,s];if(t.maxWireVersion>=17){let a=Ml.compareObjectId(s,t.electionId),c=a===0,l=a===-1,f=(n??-1)<=(t.setVersion??-1);if(l||c&&f)s=t.electionId,n=t.setVersion;else return e.set(t.address,new Pn.ServerDescription(t.address,void 0,{error:new Qu.MongoStalePrimaryError(i(t,n,s))})),[Va(e),r,n,s]}else{let a=t.electionId?t.electionId:null;if(t.setVersion&&a){if(n&&s){if(n>t.setVersion||Ml.compareObjectId(s,a)>0)return e.set(t.address,new Pn.ServerDescription(t.address,void 0,{error:new Qu.MongoStalePrimaryError(i(t,n,s))})),[Va(e),r,n,s]}s=t.electionId}if(t.setVersion!=null&&(n==null||t.setVersion>n))n=t.setVersion}for(let[a,c]of e)if(c.type===ie.ServerType.RSPrimary&&c.address!==t.address){e.set(a,new Pn.ServerDescription(c.address,void 0,{error:new Qu.MongoStalePrimaryError("primary marked stale due to discovery of newer primary")}));break}t.allHosts.forEach((a)=>{if(!e.has(a))e.set(a,new Pn.ServerDescription(a))});let o=Array.from(e.keys()),u=t.allHosts;return o.filter((a)=>u.indexOf(a)===-1).forEach((a)=>{e.delete(a)}),[Va(e),r,n,s]}function Bfe(e,t,r=null){if(r==null)throw new Qu.MongoRuntimeError('Argument "setName" is required if connected to a replica set');if(r!==t.setName||t.me&&t.address!==t.me)e.delete(t.address);return Va(e)}function Nfe(e,t,r=null){let n=ie.TopologyType.ReplicaSetNoPrimary;if(r=r??t.setName,r!==t.setName)return e.delete(t.address),[n,r];if(t.allHosts.forEach((s)=>{if(!e.has(s))e.set(s,new Pn.ServerDescription(s))}),t.me&&t.address!==t.me)e.delete(t.address);return[n,r]}function Va(e){for(let t of e.values())if(t.type===ie.ServerType.RSPrimary)return ie.TopologyType.ReplicaSetWithPrimary;return ie.TopologyType.ReplicaSetNoPrimary}});var lN=g(function(cN){Object.defineProperty(cN,"__esModule",{value:!0});cN.getReadPreference=Ife;cN.isSharded=$fe;var uN=J(),xl=Ur(),qm=as(),aN=f3();function Ife(e){let t=e?.readPreference??xl.ReadPreference.primary;if(typeof t==="string")t=xl.ReadPreference.fromString(t);if(!(t instanceof xl.ReadPreference))throw new uN.MongoInvalidArgumentError('Option "readPreference" must be a ReadPreference instance');return t}function $fe(e){if(e==null)return!1;if(e.description&&e.description.type===qm.ServerType.Mongos)return!0;if(e.description&&e.description instanceof aN.TopologyDescription)return Array.from(e.description.servers.values()).some((r)=>r.type===qm.ServerType.Mongos);return!1}});var Vm=g(function(_N){Object.defineProperty(_N,"__esModule",{value:!0});_N.CryptoConnection=_N.SizedMessageTransform=_N.Connection=void 0;_N.hasSessionSupport=kfe;var hN=L("stream"),Um=L("timers"),Nl=Se(),Fn=wr(),Pe=J(),jm=Fu(),fN=Is(),dN=Ur(),pN=as(),Pl=Fh(),Lm=Gn(),jt=ae(),Fl=h3(),Xu=Au(),mN=QB(),yN=wh(),gN=XB(),ii=dt(),Bl=lN();function kfe(e){return e.description.logicalSessionTimeoutMinutes!=null}function qfe(e,t){if(t.proxyHost)return t.hostAddress.toString();let{remoteAddress:r,remotePort:n}=e;if(typeof r==="string"&&typeof n==="number")return jt.HostAddress.fromHostPort(r,n).toString();return Nl.ByteUtils.toHex(jt.uuidV4())}class go extends fN.TypedEventEmitter{static{this.COMMAND_STARTED=Fn.COMMAND_STARTED}static{this.COMMAND_SUCCEEDED=Fn.COMMAND_SUCCEEDED}static{this.COMMAND_FAILED=Fn.COMMAND_FAILED}static{this.CLUSTER_TIME_RECEIVED=Fn.CLUSTER_TIME_RECEIVED}static{this.CLOSE=Fn.CLOSE}static{this.PINNED=Fn.PINNED}static{this.UNPINNED=Fn.UNPINNED}constructor(e,t){super();this.lastHelloMS=-1,this.helloOk=!1,this.delayedTimeoutId=null,this.closed=!1,this.clusterTime=null,this.error=null,this.dataEvents=null,this.on("error",jt.noop),this.socket=e,this.id=t.id,this.address=qfe(e,t),this.socketTimeoutMS=t.socketTimeoutMS??0,this.monitorCommands=t.monitorCommands,this.serverApi=t.serverApi,this.mongoLogger=t.mongoLogger,this.established=!1,this.description=new mN.StreamDescription(this.address,t),this.generation=t.generation,this.lastUseTime=jt.processTimeMS(),this.messageStream=this.socket.on("error",this.onSocketError.bind(this)).pipe(new d3({connection:this})).on("error",this.onTransformError.bind(this)),this.socket.on("close",this.onClose.bind(this)),this.socket.on("timeout",this.onTimeout.bind(this)),this.messageStream.pause()}get hello(){return this.description.hello}set hello(e){this.description.receiveResponse(e),Object.freeze(this.description)}get serviceId(){return this.hello?.serviceId}get loadBalanced(){return this.description.loadBalanced}get idleTime(){return jt.calculateDurationInMs(this.lastUseTime)}get hasSessionSupport(){return this.description.logicalSessionTimeoutMinutes!=null}get supportsOpMsg(){return this.description!=null&&jt.maxWireVersion(this)>=6&&!this.description.__nodejs_mock_server__}get shouldEmitAndLogCommand(){return(this.monitorCommands||this.established&&!this.authContext?.reauthenticating&&this.mongoLogger?.willLog(jm.MongoLoggableComponent.COMMAND,jm.SeverityLevel.DEBUG))??!1}markAvailable(){this.lastUseTime=jt.processTimeMS()}onSocketError(e){this.onError(new Pe.MongoNetworkError(e.message,{cause:e}))}onTransformError(e){this.onError(e)}onError(e){this.cleanup(e)}onClose(){let e=`connection ${this.id} to ${this.address} closed`;this.cleanup(new Pe.MongoNetworkError(e))}onTimeout(){this.delayedTimeoutId=Um.setTimeout(()=>{let e=`connection ${this.id} to ${this.address} timed out`,t=this.hello==null;this.cleanup(new Pe.MongoNetworkTimeoutError(e,{beforeHandshake:t}))},1).unref()}destroy(){if(this.closed)return;this.removeAllListeners(go.PINNED),this.removeAllListeners(go.UNPINNED);let e=`connection ${this.id} to ${this.address} closed`;this.cleanup(new Pe.MongoNetworkError(e))}cleanup(e){if(this.closed)return;this.socket.destroy(),this.error=e,this.dataEvents?.throw(e).then(void 0,jt.squashError),this.closed=!0,this.emit(go.CLOSE)}prepareCommand(e,t,r){let n={...t},s=Bl.getReadPreference(r),i=r?.session,o=this.clusterTime;if(this.serverApi){let{version:c,strict:l,deprecationErrors:f}=this.serverApi;if(n.apiVersion=c,l!=null)n.apiStrict=l;if(f!=null)n.apiDeprecationErrors=f}if(this.hasSessionSupport&&i){if(i.clusterTime&&o&&i.clusterTime.clusterTime.greaterThan(o.clusterTime))o=i.clusterTime;let c=Pl.applySession(i,n,r);if(c)throw c}else if(i?.explicit)throw new Pe.MongoCompatibilityError("Current topology does not support sessions");if(o)n.$clusterTime=o;if(this.description.type!==pN.ServerType.Standalone){if(!Bl.isSharded(this)&&!this.description.loadBalanced&&this.supportsOpMsg&&r.directConnection===!0&&s?.mode==="primary")n.$readPreference=dN.ReadPreference.primaryPreferred.toJSON();else if(Bl.isSharded(this)&&!this.supportsOpMsg&&s?.mode!=="primary")n={$query:n,$readPreference:s.toJSON()};else if(s?.mode!=="primary")n.$readPreference=s.toJSON()}let u={numberToSkip:0,numberToReturn:-1,checkKeys:!1,secondaryOk:s.secondaryOk(),...r};return r.timeoutContext?.addMaxTimeMSToCommand(n,r),this.supportsOpMsg?new Xu.OpMsgRequest(e,n,u):new Xu.OpQueryRequest(e,n,u)}async*sendWire(e,t,r){this.throwIfAborted();let n=t.socketTimeoutMS??t?.timeoutContext?.getSocketTimeoutMS()??this.socketTimeoutMS;this.socket.setTimeout(n);try{if(await this.writeCommand(e,{agreedCompressor:this.description.compressor??"none",zlibCompressionLevel:this.description.zlibCompressionLevel,timeoutContext:t.timeoutContext,signal:t.signal}),e.moreToCome){yield ii.MongoDBResponse.empty;return}if(this.throwIfAborted(),t.timeoutContext?.csotEnabled()&&t.timeoutContext.minRoundTripTime!=null&&t.timeoutContext.remainingTimeMS<t.timeoutContext.minRoundTripTime)throw new Pe.MongoOperationTimeoutError("Server roundtrip time is greater than the time remaining");for await(let s of this.readMany(t)){this.socket.setTimeout(0);let i=s.parse();yield(r??ii.MongoDBResponse).make(i),this.throwIfAborted(),this.socket.setTimeout(n)}}finally{this.socket.setTimeout(0)}}async*sendCommand(e,t,r,n){r?.signal?.throwIfAborted();let s=this.prepareCommand(e.db,t,r),i=0;if(this.shouldEmitAndLogCommand)i=jt.processTimeMS(),this.emitAndLogCommand(this.monitorCommands,go.COMMAND_STARTED,s.databaseName,this.established,new Fl.CommandStartedEvent(this,s,this.description.serverConnectionId));let o=r.documentsReturnedIn==null||!r.raw?r:{...r,raw:!1,fieldsAsRaw:{[r.documentsReturnedIn]:!0}},u=void 0,a=void 0;try{this.throwIfAborted();for await(u of this.sendWire(s,r,n)){if(a=void 0,r.session!=null)Pl.updateSessionFromResponse(r.session,u);if(u.$clusterTime)this.clusterTime=u.$clusterTime,this.emit(go.CLUSTER_TIME_RECEIVED,u.$clusterTime);if(u.ok===0){if(r.timeoutContext?.csotEnabled()&&u.isMaxTimeExpiredError)throw new Pe.MongoOperationTimeoutError("Server reported a timeout error",{cause:new Pe.MongoServerError(a??=u.toObject(o))});throw new Pe.MongoServerError(a??=u.toObject(o))}if(this.shouldEmitAndLogCommand)this.emitAndLogCommand(this.monitorCommands,go.COMMAND_SUCCEEDED,s.databaseName,this.established,new Fl.CommandSucceededEvent(this,s,s.moreToCome?{ok:1}:a??=u.toObject(o),i,this.description.serverConnectionId));if(n==null)yield a??=u.toObject(o);else yield u;this.throwIfAborted()}}catch(c){if(r.session!=null&&!(c instanceof Pe.MongoServerError))Pl.updateSessionFromResponse(r.session,ii.MongoDBResponse.empty);if(this.shouldEmitAndLogCommand)this.emitAndLogCommand(this.monitorCommands,go.COMMAND_FAILED,s.databaseName,this.established,new Fl.CommandFailedEvent(this,s,c,i,this.description.serverConnectionId));throw c}}async command(e,t,r={},n){this.throwIfAborted(),r.signal?.throwIfAborted();for await(let s of this.sendCommand(e,t,r,n)){if(r.timeoutContext?.csotEnabled()){if(ii.MongoDBResponse.is(s)){if(s.isMaxTimeExpiredError)throw new Pe.MongoOperationTimeoutError("Server reported a timeout error",{cause:new Pe.MongoServerError(s.toObject())})}else if(Array.isArray(s?.writeErrors)&&s.writeErrors.some((i)=>i?.code===Pe.MONGODB_ERROR_CODES.MaxTimeMSExpired)||s?.writeConcernError?.code===Pe.MONGODB_ERROR_CODES.MaxTimeMSExpired)throw new Pe.MongoOperationTimeoutError("Server reported a timeout error",{cause:new Pe.MongoServerError(s)})}return s}throw new Pe.MongoUnexpectedServerResponseError("Unable to get response from server")}exhaustCommand(e,t,r,n){(async()=>{this.throwIfAborted();for await(let i of this.sendCommand(e,t,r))n(void 0,i),this.throwIfAborted();throw new Pe.MongoUnexpectedServerResponseError("Server ended moreToCome unexpectedly")})().then(void 0,n)}throwIfAborted(){if(this.error)throw this.error}async writeCommand(e,t){let r=t.agreedCompressor==="none"||!Xu.OpCompressedRequest.canCompress(e)?e:new Xu.OpCompressedRequest(e,{agreedCompressor:t.agreedCompressor??"none",zlibCompressionLevel:t.zlibCompressionLevel??0}),n=Nl.ByteUtils.concat(await r.toBin());if(t.timeoutContext?.csotEnabled()){if(t.timeoutContext.minRoundTripTime!=null&&t.timeoutContext.remainingTimeMS<t.timeoutContext.minRoundTripTime)throw new Pe.MongoOperationTimeoutError("Server roundtrip time is greater than the time remaining")}try{if(this.socket.write(n))return}catch(u){let a=new Pe.MongoNetworkError("unexpected error writing to socket",{cause:u});throw this.onError(a),a}let s=jt.once(this.socket,"drain",t),i=t?.timeoutContext?.timeoutForSocketWrite,o=i?Promise.race([s,i]):s;try{return await o}catch(u){if(Lm.TimeoutError.is(u)){let a=new Pe.MongoOperationTimeoutError("Timed out at socket write");throw this.onError(a),a}else if(u===t.signal?.reason)this.onError(u);throw u}finally{i?.clear()}}async*readMany(e){try{this.dataEvents=gN.onData(this.messageStream,e),this.messageStream.resume();for await(let t of this.dataEvents){let r=await yN.decompressResponse(t);if(yield r,!r.moreToCome)return}}catch(t){if(Lm.TimeoutError.is(t)){let r=new Pe.MongoOperationTimeoutError(`Timed out during socket read (${t.duration}ms)`);throw this.dataEvents=null,this.onError(r),r}else if(t===e.signal?.reason)this.onError(t);throw t}finally{this.dataEvents=null,this.messageStream.pause()}}}_N.Connection=go;class d3 extends hN.Transform{constructor({connection:e}){super({writableObjectMode:!1,readableObjectMode:!0});this.bufferPool=new jt.BufferPool,this.connection=e}_transform(e,t,r){if(this.connection.delayedTimeoutId!=null)Um.clearTimeout(this.connection.delayedTimeoutId),this.connection.delayedTimeoutId=null;this.bufferPool.append(e);while(this.bufferPool.length){let n=this.bufferPool.getInt32();if(n==null)break;if(n<0)return r(new Pe.MongoParseError(`Message size cannot be negative: ${n}`));if(n>this.bufferPool.length)break;let s=this.bufferPool.read(n);if(!this.push(s))return r(new Pe.MongoRuntimeError("SizedMessageTransform does not support backpressure"))}r()}}_N.SizedMessageTransform=d3;class EN extends go{constructor(e,t){super(e,t);this.autoEncrypter=t.autoEncrypter}async command(e,t,r,n){let{autoEncrypter:s}=this;if(!s)throw new Pe.MongoRuntimeError("No AutoEncrypter available for encryption");if(jt.maxWireVersion(this)===0)return await super.command(e,t,r,n);let o=t.find||t.findAndModify?t.sort:null,u=t.createIndexes?t.indexes.map((h)=>h.key):null,a=await s.encrypt(e.toString(),t,r);if(o!=null&&(t.find||t.findAndModify))a.sort=o;if(u!=null&&t.createIndexes)for(let[h,d]of u.entries())a.indexes[h].key=d;let c=await super.command(e,a,r,n??ii.MongoDBResponse),l=await s.decrypt(c.toBytes(),r),f=n?.make(l)??Nl.deserialize(l,r);if(s[Fn.kDecorateResult]){if(n==null)jt.decorateDecryptionResult(f,c.toObject(),!0);else if(f instanceof ii.CursorResponse)f.encryptedResponse=c}return f}}_N.CryptoConnection=EN});var g3=g(function(MN){Object.defineProperty(MN,"__esModule",{value:!0});MN.LEGAL_TCP_SOCKET_OPTIONS=MN.LEGAL_TLS_SOCKET_OPTIONS=MN.DEFAULT_KEEP_ALIVE_INITIAL_DELAY_MS=void 0;MN.connect=Vfe;MN.makeConnection=bN;MN.performInitialHandshake=DN;MN.prepareHandshakeDocument=TN;MN.makeSocket=Wm;var Km=L("net"),wN=L("tls"),Hm=wr(),ON=eo(),De=J(),Il=ae(),SN=ju(),Zu=co(),zm=Vm(),oi=zo();function CN(e){e.addErrorLabel(De.MongoErrorLabel.SystemOverloadedError),e.addErrorLabel(De.MongoErrorLabel.RetryableError)}async function Vfe(e){let t=null;try{let r=await Wm(e);return t=bN(e,r),await DN(t,e),t}catch(r){throw t?.destroy(),r}}function bN(e,t){let r=e.connectionType??zm.Connection;if(e.autoEncrypter)r=zm.CryptoConnection;return new r(t,e)}function zfe(e,t){let r=Number(e.maxWireVersion),n=Number(e.minWireVersion),s=!Number.isNaN(r)&&r>=oi.MIN_SUPPORTED_WIRE_VERSION,i=!Number.isNaN(n)&&n<=oi.MAX_SUPPORTED_WIRE_VERSION;if(s){if(i)return null;let u=`Server at ${t.hostAddress} reports minimum wire version ${JSON.stringify(e.minWireVersion)}, but this version of the Node.js Driver requires at most ${oi.MAX_SUPPORTED_WIRE_VERSION} (MongoDB ${oi.MAX_SUPPORTED_SERVER_VERSION})`;return new De.MongoCompatibilityError(u)}let o=`Server at ${t.hostAddress} reports maximum wire version ${JSON.stringify(e.maxWireVersion)??0}, but this version of the Node.js Driver requires at least ${oi.MIN_SUPPORTED_WIRE_VERSION} (MongoDB ${oi.MIN_SUPPORTED_SERVER_VERSION})`;return new De.MongoCompatibilityError(o)}async function DN(e,t){let r=t.credentials;if(r){if(r.mechanism!==Zu.AuthMechanism.MONGODB_DEFAULT&&!t.authProviders.getOrCreateProvider(r.mechanism,r.mechanismProperties))throw new De.MongoInvalidArgumentError(`AuthMechanism '${r.mechanism}' not supported`)}let n=new SN.AuthContext(e,r,t);e.authContext=n;let s=await TN(n),i={...t,raw:!1};if(typeof t.connectTimeoutMS==="number")i.socketTimeoutMS=t.connectTimeoutMS;let o=new Date().getTime(),u=await c(s,i);if(!("isWritablePrimary"in u))u.isWritablePrimary=u[Hm.LEGACY_HELLO_COMMAND];if(u.helloOk)e.helloOk=!0;let a=zfe(u,t);if(a)throw a;if(t.loadBalanced){if(!u.serviceId)throw new De.MongoCompatibilityError("Driver attempted to initialize in load balancing mode, but the server does not support this mode.")}if(e.hello=u,e.lastHelloMS=new Date().getTime()-o,!u.arbiterOnly&&r){n.response=u;let l=r.resolveAuthMechanism(u),f=t.authProviders.getOrCreateProvider(l.mechanism,l.mechanismProperties);if(!f)throw new De.MongoInvalidArgumentError(`No AuthProvider for ${l.mechanism} defined.`);try{await f.auth(n)}catch(h){if(h instanceof De.MongoError){if(h.addErrorLabel(De.MongoErrorLabel.HandshakeError),De.needsRetryableWriteLabel(h))h.addErrorLabel(De.MongoErrorLabel.RetryableWriteError)}throw h}}e.established=!0;async function c(l,f){try{return await e.command(Il.ns("admin.$cmd"),l,f)}catch(h){if(h instanceof De.MongoError)h.addErrorLabel(De.MongoErrorLabel.HandshakeError);if(h instanceof De.MongoNetworkError)CN(h);throw h}}}async function TN(e){let t=e.options,r=t.compressors?t.compressors:[],{serverApi:n}=e.connection,s=await t.metadata,i={[n?.version||t.loadBalanced===!0?"hello":Hm.LEGACY_HELLO_COMMAND]:1,backpressure:"2",helloOk:!0,client:s,compression:r};if(t.loadBalanced===!0)i.loadBalanced=!0;let o=e.credentials;if(o){if(o.mechanism===Zu.AuthMechanism.MONGODB_DEFAULT&&o.username){i.saslSupportedMechs=`${o.source}.${o.username}`;let a=e.options.authProviders.getOrCreateProvider(Zu.AuthMechanism.MONGODB_SCRAM_SHA256,o.mechanismProperties);if(!a)throw new De.MongoInvalidArgumentError(`No AuthProvider for ${Zu.AuthMechanism.MONGODB_SCRAM_SHA256} defined.`);return await a.prepare(i,e)}let u=e.options.authProviders.getOrCreateProvider(o.mechanism,o.mechanismProperties);if(!u)throw new De.MongoInvalidArgumentError(`No AuthProvider for ${o.mechanism} defined.`);return await u.prepare(i,e)}return i}MN.DEFAULT_KEEP_ALIVE_INITIAL_DELAY_MS=120000;MN.LEGAL_TLS_SOCKET_OPTIONS=["allowPartialTrustChain","ALPNProtocols","ca","cert","checkServerIdentity","ciphers","crl","ecdhCurve","key","minDHSize","passphrase","pfx","rejectUnauthorized","secureContext","secureProtocol","servername","session"];MN.LEGAL_TCP_SOCKET_OPTIONS=["autoSelectFamily","autoSelectFamilyAttemptTimeout","keepAliveInitialDelay","family","hints","localAddress","localPort","lookup"];function p3(e){let t=e.hostAddress;if(!t)throw new De.MongoInvalidArgumentError('Option "hostAddress" is required');let r={};for(let n of MN.LEGAL_TCP_SOCKET_OPTIONS)if(e[n]!=null)r[n]=e[n];if(r.keepAliveInitialDelay??=MN.DEFAULT_KEEP_ALIVE_INITIAL_DELAY_MS,r.keepAlive=!0,r.noDelay=e.noDelay??!0,typeof t.socketPath==="string")return r.path=t.socketPath,r;else if(typeof t.host==="string")return r.host=t.host,r.port=t.port,r;else throw new De.MongoRuntimeError(`Unexpected HostAddress ${JSON.stringify(t)}`)}function Wfe(e){let t=p3(e);for(let r of MN.LEGAL_TLS_SOCKET_OPTIONS)if(e[r]!=null)t[r]=e[r];if(e.existingSocket)t.socket=e.existingSocket;if(t.servername==null&&t.host&&!Km.isIP(t.host))t.servername=t.host;return t}async function Wm(e){let t=e.tls??!1,r=e.connectTimeoutMS??30000,n=e.existingSocket,s=e.keepAliveInitialDelay??MN.DEFAULT_KEEP_ALIVE_INITIAL_DELAY_MS,i=e.noDelay??!0,o;if(e.proxyHost!=null)return await Hfe({...e,connectTimeoutMS:r});if(t){let f=wN.connect(Wfe(e));if(typeof f.disableRenegotiation==="function")f.disableRenegotiation();o=f}else if(n)o=n;else o=Km.createConnection(p3(e));o.setKeepAlive(!0,s),o.setNoDelay(i),o.setTimeout(r);let u=null,{promise:a,resolve:c,reject:l}=Il.promiseWithResolvers();if(n)c(o);else{let f=performance.now(),h=t?"secureConnect":"connect";if(o.once(h,()=>c(o)).once("error",(d)=>l(new De.MongoNetworkError(De.MongoError.buildErrorMessage(d),{cause:d}))).once("timeout",()=>{l(new De.MongoNetworkTimeoutError(`Socket '${h}' timed out after ${performance.now()-f|0}ms (connectTimeoutMS: ${r})`))}).once("close",()=>l(new De.MongoNetworkError(`Socket closed after ${performance.now()-f|0} during connection establishment`))),e.cancellationToken!=null)u=()=>l(new De.MongoNetworkError(`Socket connection establishment was cancelled after ${performance.now()-f|0}`)),e.cancellationToken.once("cancel",u)}try{return o=await a,o}catch(f){throw CN(f),o.destroy(),f}finally{if(o.setTimeout(0),u!=null)e.cancellationToken?.removeListener("cancel",u)}}var Yh=null;function Kfe(){if(Yh==null){let e=ON.getSocks();if("kModuleError"in e)throw e.kModuleError;Yh=e}return Yh}async function Hfe(e){let t=Il.HostAddress.fromHostPort(e.proxyHost??"",e.proxyPort??1080),r=await Wm({...e,hostAddress:t,tls:!1,proxyHost:void 0}),n=p3(e);if(typeof n.host!=="string"||typeof n.port!=="number")throw new De.MongoInvalidArgumentError("Can only make Socks5 connections to TCP hosts");Yh??=Kfe();let s;try{s=(await Yh.SocksClient.createConnection({existing_socket:r,timeout:e.connectTimeoutMS,command:"connect",destination:{host:n.host,port:n.port},proxy:{host:"iLoveJavaScript",port:0,type:5,userId:e.proxyUsername||void 0,password:e.proxyPassword||void 0}})).socket}catch(i){throw new De.MongoNetworkError(De.MongoError.buildErrorMessage(i),{cause:i})}return await Wm({...e,existingSocket:s,proxyHost:void 0})}});var Gm=g(function(qN){Object.defineProperty(qN,"__esModule",{value:!0});qN.ServerHeartbeatFailedEvent=qN.ServerHeartbeatSucceededEvent=qN.ServerHeartbeatStartedEvent=qN.TopologyClosedEvent=qN.TopologyOpeningEvent=qN.TopologyDescriptionChangedEvent=qN.ServerClosedEvent=qN.ServerOpeningEvent=qN.ServerDescriptionChangedEvent=void 0;var Qr=wr();class PN{constructor(e,t,r,n){this.name=Qr.SERVER_DESCRIPTION_CHANGED,this.topologyId=e,this.address=t,this.previousDescription=r,this.newDescription=n}}qN.ServerDescriptionChangedEvent=PN;class FN{constructor(e,t){this.name=Qr.SERVER_OPENING,this.topologyId=e,this.address=t}}qN.ServerOpeningEvent=FN;class BN{constructor(e,t){this.name=Qr.SERVER_CLOSED,this.topologyId=e,this.address=t}}qN.ServerClosedEvent=BN;class NN{constructor(e,t,r){this.name=Qr.TOPOLOGY_DESCRIPTION_CHANGED,this.topologyId=e,this.previousDescription=t,this.newDescription=r}}qN.TopologyDescriptionChangedEvent=NN;class IN{constructor(e){this.name=Qr.TOPOLOGY_OPENING,this.topologyId=e}}qN.TopologyOpeningEvent=IN;class $N{constructor(e){this.name=Qr.TOPOLOGY_CLOSED,this.topologyId=e}}qN.TopologyClosedEvent=$N;class RN{constructor(e,t){this.name=Qr.SERVER_HEARTBEAT_STARTED,this.connectionId=e,this.awaited=t}}qN.ServerHeartbeatStartedEvent=RN;class vN{constructor(e,t,r,n){this.name=Qr.SERVER_HEARTBEAT_SUCCEEDED,this.connectionId=e,this.duration=t,this.reply=r??{},this.awaited=n}}qN.ServerHeartbeatSucceededEvent=vN;class kN{constructor(e,t,r,n){this.name=Qr.SERVER_HEARTBEAT_FAILED,this.connectionId=e,this.duration=t,this.failure=r,this.awaited=n}}qN.ServerHeartbeatFailedEvent=kN});var E3=g(function(XN){Object.defineProperty(XN,"__esModule",{value:!0});XN.ConnectionPoolClearedEvent=XN.ConnectionCheckedInEvent=XN.ConnectionCheckedOutEvent=XN.ConnectionCheckOutFailedEvent=XN.ConnectionCheckOutStartedEvent=XN.ConnectionClosedEvent=XN.ConnectionReadyEvent=XN.ConnectionCreatedEvent=XN.ConnectionPoolClosedEvent=XN.ConnectionPoolReadyEvent=XN.ConnectionPoolCreatedEvent=XN.ConnectionPoolMonitoringEvent=void 0;var dr=wr(),$l=ae();class $s{constructor(e){this.time=new Date,this.address=e.address}}XN.ConnectionPoolMonitoringEvent=$s;class LN extends $s{constructor(e){super(e);this.name=dr.CONNECTION_POOL_CREATED;let{maxConnecting:t,maxPoolSize:r,minPoolSize:n,maxIdleTimeMS:s,waitQueueTimeoutMS:i}=e.options;this.options={maxConnecting:t,maxPoolSize:r,minPoolSize:n,maxIdleTimeMS:s,waitQueueTimeoutMS:i}}}XN.ConnectionPoolCreatedEvent=LN;class UN extends $s{constructor(e){super(e);this.name=dr.CONNECTION_POOL_READY}}XN.ConnectionPoolReadyEvent=UN;class VN extends $s{constructor(e){super(e);this.name=dr.CONNECTION_POOL_CLOSED}}XN.ConnectionPoolClosedEvent=VN;class zN extends $s{constructor(e,t){super(e);this.name=dr.CONNECTION_CREATED,this.connectionId=t.id}}XN.ConnectionCreatedEvent=zN;class WN extends $s{constructor(e,t,r){super(e);this.name=dr.CONNECTION_READY,this.durationMS=$l.processTimeMS()-r,this.connectionId=t.id}}XN.ConnectionReadyEvent=WN;class KN extends $s{constructor(e,t,r,n){super(e);this.name=dr.CONNECTION_CLOSED,this.connectionId=t.id,this.reason=r,this.serviceId=t.serviceId,this.error=n??null}}XN.ConnectionClosedEvent=KN;class HN extends $s{constructor(e){super(e);this.name=dr.CONNECTION_CHECK_OUT_STARTED}}XN.ConnectionCheckOutStartedEvent=HN;class GN extends $s{constructor(e,t,r,n){super(e);this.name=dr.CONNECTION_CHECK_OUT_FAILED,this.durationMS=$l.processTimeMS()-r,this.reason=t,this.error=n}}XN.ConnectionCheckOutFailedEvent=GN;class YN extends $s{constructor(e,t,r){super(e);this.name=dr.CONNECTION_CHECKED_OUT,this.durationMS=$l.processTimeMS()-r,this.connectionId=t.id}}XN.ConnectionCheckedOutEvent=YN;class QN extends $s{constructor(e,t){super(e);this.name=dr.CONNECTION_CHECKED_IN,this.connectionId=t.id}}XN.ConnectionCheckedInEvent=QN;class JN extends $s{constructor(e,t={}){super(e);this.name=dr.CONNECTION_POOL_CLEARED,this.serviceId=t.serviceId,this.interruptInUseConnections=t.interruptInUseConnections}}XN.ConnectionPoolClearedEvent=JN});var A3=g(function(nI){Object.defineProperty(nI,"__esModule",{value:!0});nI.WaitQueueTimeoutError=nI.PoolClearedOnNetworkError=nI.PoolClearedError=nI.PoolClosedError=void 0;var ea=J();class eI extends ea.MongoDriverError{constructor(e){super("Attempted to check out a connection from closed connection pool");this.address=e.address}get name(){return"MongoPoolClosedError"}}nI.PoolClosedError=eI;class _3 extends ea.MongoNetworkError{constructor(e,t){let r=t?t:`Connection pool for ${e.address} was cleared because another operation failed with: "${e.serverError?.message}"`;super(r,e.serverError?{cause:e.serverError}:void 0);this.address=e.address,this.addErrorLabel(ea.MongoErrorLabel.PoolRequestedRetry)}get name(){return"MongoPoolClearedError"}}nI.PoolClearedError=_3;class tI extends _3{constructor(e){super(e,`Connection to ${e.address} interrupted due to server monitor timeout`)}get name(){return"PoolClearedOnNetworkError"}}nI.PoolClearedOnNetworkError=tI;class rI extends ea.MongoDriverError{constructor(e,t){super(e);this.address=t}get name(){return"MongoWaitQueueTimeoutError"}}nI.WaitQueueTimeoutError=rI});var lI=g(function(aI){Object.defineProperty(aI,"__esModule",{value:!0});aI.ConnectionPool=aI.PoolState=void 0;var ai=L("timers"),Jt=wr(),pr=J(),Ym=Is(),iI=Gn(),Jr=ae(),oI=g3(),ta=Vm(),it=E3(),ci=A3(),uI=XE();aI.PoolState=Object.freeze({paused:"paused",ready:"ready",closed:"closed"});class Vr extends Ym.TypedEventEmitter{static{this.CONNECTION_POOL_CREATED=Jt.CONNECTION_POOL_CREATED}static{this.CONNECTION_POOL_CLOSED=Jt.CONNECTION_POOL_CLOSED}static{this.CONNECTION_POOL_CLEARED=Jt.CONNECTION_POOL_CLEARED}static{this.CONNECTION_POOL_READY=Jt.CONNECTION_POOL_READY}static{this.CONNECTION_CREATED=Jt.CONNECTION_CREATED}static{this.CONNECTION_READY=Jt.CONNECTION_READY}static{this.CONNECTION_CLOSED=Jt.CONNECTION_CLOSED}static{this.CONNECTION_CHECK_OUT_STARTED=Jt.CONNECTION_CHECK_OUT_STARTED}static{this.CONNECTION_CHECK_OUT_FAILED=Jt.CONNECTION_CHECK_OUT_FAILED}static{this.CONNECTION_CHECKED_OUT=Jt.CONNECTION_CHECKED_OUT}static{this.CONNECTION_CHECKED_IN=Jt.CONNECTION_CHECKED_IN}constructor(e,t){super();if(this.on("error",Jr.noop),this.options=Object.freeze({connectionType:ta.Connection,...t,maxPoolSize:t.maxPoolSize??100,minPoolSize:t.minPoolSize??0,maxConnecting:t.maxConnecting??2,maxIdleTimeMS:t.maxIdleTimeMS??0,waitQueueTimeoutMS:t.waitQueueTimeoutMS??0,minPoolSizeCheckFrequencyMS:t.minPoolSizeCheckFrequencyMS??100,autoEncrypter:t.autoEncrypter}),this.options.minPoolSize>this.options.maxPoolSize)throw new pr.MongoInvalidArgumentError("Connection pool minimum size must not be greater than maximum pool size");this.poolState=aI.PoolState.paused,this.server=e,this.connections=new Jr.List,this.pending=0,this.checkedOut=new Set,this.minPoolSizeTimer=void 0,this.generation=0,this.serviceGenerations=new Map,this.connectionCounter=Jr.makeCounter(1),this.cancellationToken=new Ym.CancellationToken,this.cancellationToken.setMaxListeners(1/0),this.waitQueue=new Jr.List,this.metrics=new uI.ConnectionPoolMetrics,this.processingWaitQueue=!1,this.mongoLogger=this.server.topology.client?.mongoLogger,this.component="connection",queueMicrotask(()=>{this.emitAndLog(Vr.CONNECTION_POOL_CREATED,new it.ConnectionPoolCreatedEvent(this))})}get address(){return this.options.hostAddress.toString()}get closed(){return this.poolState===aI.PoolState.closed}get totalConnectionCount(){return this.availableConnectionCount+this.pendingConnectionCount+this.currentCheckedOutCount}get availableConnectionCount(){return this.connections.length}get pendingConnectionCount(){return this.pending}get currentCheckedOutCount(){return this.checkedOut.size}get waitQueueSize(){return this.waitQueue.length}get loadBalanced(){return this.options.loadBalanced}get serverError(){return this.server.description.error}get checkedOutConnections(){return this.checkedOut}waitQueueErrorMetrics(){return this.metrics.info(this.options.maxPoolSize)}ready(){if(this.poolState!==aI.PoolState.paused)return;this.poolState=aI.PoolState.ready,this.emitAndLog(Vr.CONNECTION_POOL_READY,new it.ConnectionPoolReadyEvent(this)),ai.clearTimeout(this.minPoolSizeTimer),this.ensureMinPoolSize()}async checkOut(e){let t=Jr.processTimeMS();this.emitAndLog(Vr.CONNECTION_CHECK_OUT_STARTED,new it.ConnectionCheckOutStartedEvent(this));let{promise:r,resolve:n,reject:s}=Jr.promiseWithResolvers(),i=e.timeoutContext.connectionCheckoutTimeout,o={resolve:n,reject:s,cancelled:!1,checkoutTime:t},u=Jr.addAbortListener(e.signal,function(){o.cancelled=!0,s(this.reason)});this.waitQueue.push(o),queueMicrotask(()=>this.processWaitQueue());try{return i?.throwIfExpired(),await(i?Promise.race([r,i]):r)}catch(a){if(iI.TimeoutError.is(a)){i?.clear(),o.cancelled=!0,this.emitAndLog(Vr.CONNECTION_CHECK_OUT_FAILED,new it.ConnectionCheckOutFailedEvent(this,"timeout",o.checkoutTime));let c=new ci.WaitQueueTimeoutError(this.loadBalanced?this.waitQueueErrorMetrics():"Timed out while checking out a connection from connection pool",this.address);if(e.timeoutContext.csotEnabled())throw new pr.MongoOperationTimeoutError("Timed out during connection checkout",{cause:c});throw c}throw a}finally{u?.[Jr.kDispose](),i?.clear()}}checkIn(e){if(!this.checkedOut.has(e))return;let t=this.closed,r=this.connectionIsStale(e),n=!!(t||r||e.closed);if(!n)e.markAvailable(),this.connections.unshift(e);if(this.checkedOut.delete(e),this.emitAndLog(Vr.CONNECTION_CHECKED_IN,new it.ConnectionCheckedInEvent(this,e)),n){let s=e.closed?"error":t?"poolClosed":"stale";this.destroyConnection(e,s)}queueMicrotask(()=>this.processWaitQueue())}clear(e={}){if(this.closed)return;if(this.loadBalanced){let{serviceId:s}=e;if(!s)throw new pr.MongoRuntimeError("ConnectionPool.clear() called in load balanced mode with no serviceId.");let i=s.toHexString(),o=this.serviceGenerations.get(i);if(o==null)throw new pr.MongoRuntimeError("Service generations are required in load balancer mode.");else this.serviceGenerations.set(i,o+1);this.emitAndLog(Vr.CONNECTION_POOL_CLEARED,new it.ConnectionPoolClearedEvent(this,{serviceId:s}));return}let t=e.interruptInUseConnections??!1,r=this.generation;this.generation+=1;let n=this.poolState===aI.PoolState.paused;if(this.poolState=aI.PoolState.paused,this.clearMinPoolSizeTimer(),!n)this.emitAndLog(Vr.CONNECTION_POOL_CLEARED,new it.ConnectionPoolClearedEvent(this,{interruptInUseConnections:t}));if(t)queueMicrotask(()=>this.interruptInUseConnections(r));this.processWaitQueue()}interruptInUseConnections(e){for(let t of this.checkedOut)if(t.generation<=e)t.onError(new ci.PoolClearedOnNetworkError(this))}closeCheckedOutConnections(){for(let e of this.checkedOut)e.onError(new pr.MongoClientClosedError)}close(){if(this.closed)return;if(this.cancellationToken.emit("cancel"),typeof this.connectionCounter.return==="function")this.connectionCounter.return(void 0);this.poolState=aI.PoolState.closed,this.clearMinPoolSizeTimer(),this.processWaitQueue();for(let e of this.connections)this.emitAndLog(Vr.CONNECTION_CLOSED,new it.ConnectionClosedEvent(this,e,"poolClosed")),e.destroy();this.connections.clear(),this.emitAndLog(Vr.CONNECTION_POOL_CLOSED,new it.ConnectionPoolClosedEvent(this))}async reauthenticate(e){let t=e.authContext;if(!t)throw new pr.MongoRuntimeError("No auth context found on connection.");let r=t.credentials;if(!r)throw new pr.MongoMissingCredentialsError("Connection is missing credentials when asked to reauthenticate");let n=r.resolveAuthMechanism(e.hello),s=this.server.topology.client.s.authProviders.getOrCreateProvider(n.mechanism,n.mechanismProperties);if(!s)throw new pr.MongoMissingCredentialsError(`Reauthenticate failed due to no auth provider for ${r.mechanism}`);await s.reauth(t);return}clearMinPoolSizeTimer(){let e=this.minPoolSizeTimer;if(e)ai.clearTimeout(e)}destroyConnection(e,t){this.emitAndLog(Vr.CONNECTION_CLOSED,new it.ConnectionClosedEvent(this,e,t)),e.destroy()}connectionIsStale(e){let t=e.serviceId;if(this.loadBalanced&&t){let r=t.toHexString(),n=this.serviceGenerations.get(r);return e.generation!==n}return e.generation!==this.generation}connectionIsIdle(e){return!!(this.options.maxIdleTimeMS&&e.idleTime>this.options.maxIdleTimeMS)}destroyConnectionIfPerished(e){let t=this.connectionIsStale(e),r=this.connectionIsIdle(e);if(!t&&!r&&!e.closed)return!1;let n=e.closed?"error":t?"stale":"idle";return this.destroyConnection(e,n),!0}createConnection(e){let t={...this.options,id:this.connectionCounter.next().value,generation:this.generation,cancellationToken:this.cancellationToken,mongoLogger:this.mongoLogger,authProviders:this.server.topology.client.s.authProviders,metadata:this.server.topology.client.options.metadata};this.pending++;let r=Jr.processTimeMS();this.emitAndLog(Vr.CONNECTION_CREATED,new it.ConnectionCreatedEvent(this,{id:t.id})),oI.connect(t).then((n)=>{if(this.poolState!==aI.PoolState.ready){this.pending--,n.destroy(),e(this.closed?new ci.PoolClosedError(this):new ci.PoolClearedError(this));return}for(let s of[...Jt.APM_EVENTS,ta.Connection.CLUSTER_TIME_RECEIVED])n.on(s,(i)=>this.emit(s,i));if(this.loadBalanced){n.on(ta.Connection.PINNED,(i)=>this.metrics.markPinned(i)),n.on(ta.Connection.UNPINNED,(i)=>this.metrics.markUnpinned(i));let s=n.serviceId;if(s){let i,o=s.toHexString();if(i=this.serviceGenerations.get(o))n.generation=i;else this.serviceGenerations.set(o,0),n.generation=0}}n.markAvailable(),this.emitAndLog(Vr.CONNECTION_READY,new it.ConnectionReadyEvent(this,n,r)),this.pending--,e(void 0,n)},(n)=>{if(this.pending--,this.server.handleError(n),this.emitAndLog(Vr.CONNECTION_CLOSED,new it.ConnectionClosedEvent(this,{id:t.id,serviceId:void 0},"error",n)),n instanceof pr.MongoNetworkError||n instanceof pr.MongoServerError)n.connectionGeneration=t.generation;e(n??new pr.MongoRuntimeError("Connection creation failed without error"))})}ensureMinPoolSize(){let e=this.options.minPoolSize;if(this.poolState!==aI.PoolState.ready)return;if(this.connections.prune((t)=>this.destroyConnectionIfPerished(t)),this.totalConnectionCount<e&&this.pendingConnectionCount<this.options.maxConnecting)this.createConnection((t,r)=>{if(!t&&r)this.connections.push(r),queueMicrotask(()=>this.processWaitQueue());if(this.poolState===aI.PoolState.ready)ai.clearTimeout(this.minPoolSizeTimer),this.minPoolSizeTimer=ai.setTimeout(()=>this.ensureMinPoolSize(),this.options.minPoolSizeCheckFrequencyMS)});else ai.clearTimeout(this.minPoolSizeTimer),this.minPoolSizeTimer=ai.setTimeout(()=>this.ensureMinPoolSize(),this.options.minPoolSizeCheckFrequencyMS)}processWaitQueue(){if(this.processingWaitQueue)return;this.processingWaitQueue=!0;while(this.waitQueueSize){let r=this.waitQueue.first();if(!r){this.waitQueue.shift();continue}if(r.cancelled){this.waitQueue.shift();continue}if(this.poolState!==aI.PoolState.ready){let s=this.closed?"poolClosed":"connectionError",i=this.closed?new ci.PoolClosedError(this):new ci.PoolClearedError(this);this.emitAndLog(Vr.CONNECTION_CHECK_OUT_FAILED,new it.ConnectionCheckOutFailedEvent(this,s,r.checkoutTime,i)),this.waitQueue.shift(),r.reject(i);continue}if(!this.availableConnectionCount)break;let n=this.connections.shift();if(!n)break;if(!this.destroyConnectionIfPerished(n))this.checkedOut.add(n),this.emitAndLog(Vr.CONNECTION_CHECKED_OUT,new it.ConnectionCheckedOutEvent(this,n,r.checkoutTime)),this.waitQueue.shift(),r.resolve(n)}let{maxPoolSize:e,maxConnecting:t}=this.options;while(this.waitQueueSize>0&&this.pendingConnectionCount<t&&(e===0||this.totalConnectionCount<e)){let r=this.waitQueue.shift();if(!r||r.cancelled)continue;this.createConnection((n,s)=>{if(r.cancelled){if(!n&&s)this.connections.push(s)}else if(n)this.emitAndLog(Vr.CONNECTION_CHECK_OUT_FAILED,new it.ConnectionCheckOutFailedEvent(this,"connectionError",r.checkoutTime,n)),r.reject(n);else if(s)this.checkedOut.add(s),this.emitAndLog(Vr.CONNECTION_CHECKED_OUT,new it.ConnectionCheckedOutEvent(this,s,r.checkoutTime)),r.resolve(s);queueMicrotask(()=>this.processWaitQueue())})}this.processingWaitQueue=!1}}aI.ConnectionPool=Vr});var S3=g(function(_I){Object.defineProperty(_I,"__esModule",{value:!0});_I.Server=void 0;var fI=Vm(),dI=lI(),pI=A3(),Rr=wr(),Te=J(),mI=Is(),yI=Mh(),Rl=ZE(),li=ae(),Qm=Hn(),Ae=as(),gI=C3(),vl=Hh(),EI=kc(),Qh=li.makeStateMachine({[Ae.STATE_CLOSED]:[Ae.STATE_CLOSED,Ae.STATE_CONNECTING],[Ae.STATE_CONNECTING]:[Ae.STATE_CONNECTING,Ae.STATE_CLOSING,Ae.STATE_CONNECTED,Ae.STATE_CLOSED],[Ae.STATE_CONNECTED]:[Ae.STATE_CONNECTED,Ae.STATE_CLOSING,Ae.STATE_CLOSED],[Ae.STATE_CLOSING]:[Ae.STATE_CLOSING,Ae.STATE_CLOSED]});class za extends mI.TypedEventEmitter{static{this.SERVER_HEARTBEAT_STARTED=Rr.SERVER_HEARTBEAT_STARTED}static{this.SERVER_HEARTBEAT_SUCCEEDED=Rr.SERVER_HEARTBEAT_SUCCEEDED}static{this.SERVER_HEARTBEAT_FAILED=Rr.SERVER_HEARTBEAT_FAILED}static{this.CONNECT=Rr.CONNECT}static{this.DESCRIPTION_RECEIVED=Rr.DESCRIPTION_RECEIVED}static{this.CLOSED=Rr.CLOSED}static{this.ENDED=Rr.ENDED}constructor(e,t,r){super();this.on("error",li.noop),this.serverApi=r.serverApi;let n={hostAddress:t.hostAddress,...r};this.topology=e,this.pool=new dI.ConnectionPool(this,n),this.s={description:t,options:r,state:Ae.STATE_CLOSED,operationCount:0};for(let s of[...Rr.CMAP_EVENTS,...Rr.APM_EVENTS])this.pool.on(s,(i)=>this.emit(s,i));if(this.pool.on(fI.Connection.CLUSTER_TIME_RECEIVED,(s)=>{this.clusterTime=s}),this.loadBalanced){this.monitor=null;return}this.monitor=new gI.Monitor(this,this.s.options);for(let s of Rr.HEARTBEAT_EVENTS)this.monitor.on(s,(i)=>this.emit(s,i));this.monitor.on("resetServer",(s)=>w3(this,s)),this.monitor.on(za.SERVER_HEARTBEAT_SUCCEEDED,(s)=>{if(this.emit(za.DESCRIPTION_RECEIVED,new vl.ServerDescription(this.description.hostAddress,s.reply,{roundTripTime:this.monitor?.roundTripTime,minRoundTripTime:this.monitor?.minRoundTripTime})),this.s.state===Ae.STATE_CONNECTING)Qh(this,Ae.STATE_CONNECTED),this.emit(za.CONNECT,this)})}get clusterTime(){return this.topology.clusterTime}set clusterTime(e){this.topology.clusterTime=e}get description(){return this.s.description}get name(){return this.s.description.address}get autoEncrypter(){if(this.s.options&&this.s.options.autoEncrypter)return this.s.options.autoEncrypter;return}get loadBalanced(){return this.topology.description.type===Ae.TopologyType.LoadBalanced}connect(){if(this.s.state!==Ae.STATE_CLOSED)return;if(Qh(this,Ae.STATE_CONNECTING),!this.loadBalanced)this.monitor?.connect();else Qh(this,Ae.STATE_CONNECTED),this.emit(za.CONNECT,this)}closeCheckedOutConnections(){return this.pool.closeCheckedOutConnections()}close(){if(this.s.state===Ae.STATE_CLOSED)return;if(Qh(this,Ae.STATE_CLOSING),!this.loadBalanced)this.monitor?.close();this.pool.close(),Qh(this,Ae.STATE_CLOSED),this.emit("closed")}requestCheck(){if(!this.loadBalanced)this.monitor?.requestCheck()}async command(e,t){if(this.s.state===Ae.STATE_CLOSING||this.s.state===Ae.STATE_CLOSED)throw new Te.MongoServerClosedError;let r=e.session,n=r?.pinnedConnection;if(this.incrementOperationCount(),n==null)try{n=await this.pool.checkOut({timeoutContext:t,signal:e.options.signal})}catch(l){if(this.decrementOperationCount(),!(l instanceof pI.PoolClearedError))this.handleError(l);throw l}let s=null,i=()=>{if(this.decrementOperationCount(),r?.pinnedConnection!==n)if(s!=null){let l=()=>{this.pool.checkIn(n)};s.then(l,l)}else this.pool.checkIn(n)},o;try{o=e.buildCommand(n,r)}catch(l){throw i(),l}let u=e.buildOptions(t),a=e.ns;if(this.loadBalanced&&wde(o,r)&&!r?.pinnedConnection)r?.pin(n);if(u.directConnection=this.topology.s.options.directConnection,e instanceof yI.AggregateOperation&&e.hasWriteStage&&li.maxWireVersion(n)<EI.MIN_SECONDARY_WRITE_WIRE_VERSION)delete u.readPreference;if(this.description.iscryptd)u.omitMaxTimeMS=!0;try{try{let l=await n.command(a,o,u,e.SERVER_COMMAND_RESPONSE_TYPE);return Qm.throwIfWriteConcernError(l),l}catch(l){throw this.decorateCommandError(n,o,u,l)}}catch(l){if(l instanceof Te.MongoError&&l.code?.valueOf()===Te.MONGODB_ERROR_CODES.Reauthenticate){s=this.pool.reauthenticate(n),s.then(void 0,(f)=>{s=null,li.squashError(f)}),await li.abortable(s,u),s=null;try{let f=await n.command(a,o,u,e.SERVER_COMMAND_RESPONSE_TYPE);return Qm.throwIfWriteConcernError(f),f}catch(f){throw this.decorateCommandError(n,o,u,f)}}else throw l}finally{i()}}handleError(e,t){if(!(e instanceof Te.MongoError))return;if(Sde(this,e))return;let r=e instanceof Te.MongoNetworkError&&!(e instanceof Te.MongoNetworkTimeoutError),n=e instanceof Te.MongoNetworkError&&e.beforeHandshake,s=e.hasErrorLabel(Te.MongoErrorLabel.HandshakeError),i=e.hasErrorLabel(Te.MongoErrorLabel.SystemOverloadedError);if(Te.isStateChangeError(e)||e instanceof Te.MongoParseError){let o=Te.isNodeShuttingDownError(e);if(!this.loadBalanced){if(o)e.addErrorLabel(Te.MongoErrorLabel.ResetPool);w3(this,e),queueMicrotask(()=>this.requestCheck());return}if(t&&o)this.pool.clear({serviceId:t.serviceId})}else if(r||n||s){if(i)return;if(!this.loadBalanced)e.addErrorLabel(Te.MongoErrorLabel.ResetPool),w3(this,e);else if(t)this.pool.clear({serviceId:t.serviceId})}}decorateCommandError(e,t,r,n){if(typeof n!=="object"||n==null||!("name"in n))throw new Te.MongoRuntimeError("An unexpected error type: "+typeof n);if(n.name==="AbortError"&&"cause"in n&&n.cause instanceof Te.MongoError)n=n.cause;if(!(n instanceof Te.MongoError))return n;if(Ode(this.pool,e))return n;let s=r?.session;if(n instanceof Te.MongoNetworkError){if(s&&!s.hasEnded&&s.serverSession)s.serverSession.isDirty=!0;if(O3(s,t)&&!n.hasErrorLabel(Te.MongoErrorLabel.TransientTransactionError))n.addErrorLabel(Te.MongoErrorLabel.TransientTransactionError);if((hI(this.topology)||Rl.isTransactionCommand(t))&&li.supportsRetryableWrites(this)&&!O3(s,t))n.addErrorLabel(Te.MongoErrorLabel.RetryableWriteError)}else if((hI(this.topology)||Rl.isTransactionCommand(t))&&Te.needsRetryableWriteLabel(n)&&!O3(s,t))n.addErrorLabel(Te.MongoErrorLabel.RetryableWriteError);if(s&&s.isPinned&&n.hasErrorLabel(Te.MongoErrorLabel.TransientTransactionError))s.unpin({force:!0});return this.handleError(n,e),n}decrementOperationCount(){return this.s.operationCount-=1}incrementOperationCount(){return this.s.operationCount+=1}}_I.Server=za;function w3(e,t){if(e.loadBalanced)return;if(t instanceof Te.MongoNetworkError&&!(t instanceof Te.MongoNetworkTimeoutError))e.monitor?.reset();e.emit(za.DESCRIPTION_RECEIVED,new vl.ServerDescription(e.description.hostAddress,void 0,{error:t}))}function wde(e,t){if(t)return t.inTransaction()||t.transaction.isCommitted&&"commitTransaction"in e||"aggregate"in e||"find"in e||"getMore"in e||"listCollections"in e||"listIndexes"in e||"bulkWrite"in e;return!1}function Ode(e,t){if(t.serviceId)return t.generation!==e.serviceGenerations.get(t.serviceId.toHexString());return t.generation!==e.generation}function O3(e,t){return e&&e.inTransaction()&&!Rl.isTransactionCommand(t)}function hI(e){return e.s.options.retryWrites!==!1}function Sde(e,t){let r=e.pool.generation,n=t.connectionGeneration;if(n&&n<r)return!0;let s=e.description.topologyVersion;return vl.compareTopologyVersion(s,t.topologyVersion)>=0}});var C3=g(function(DI){Object.defineProperty(DI,"__esModule",{value:!0});DI.RTTSampler=DI.MonitorInterval=DI.RTTPinger=DI.Monitor=DI.ServerMonitoringMode=void 0;var Bn=L("timers"),Jm=Se(),ra=g3(),SI=x_(),jl=wr(),hi=J(),CI=Fu(),Xm=Is(),ot=ae(),ut=as(),Eo=Gm(),_o=S3(),kl="idle",Wa="monitoring",ql=ot.makeStateMachine({[ut.STATE_CLOSING]:[ut.STATE_CLOSING,kl,ut.STATE_CLOSED],[ut.STATE_CLOSED]:[ut.STATE_CLOSED,Wa],[kl]:[kl,Wa,ut.STATE_CLOSING],[Wa]:[Wa,kl,ut.STATE_CLOSING]}),Cde=new Set([ut.STATE_CLOSING,ut.STATE_CLOSED,Wa]);function Jh(e){return e.s.state===ut.STATE_CLOSED||e.s.state===ut.STATE_CLOSING}DI.ServerMonitoringMode=Object.freeze({auto:"auto",poll:"poll",stream:"stream"});class bI extends Xm.TypedEventEmitter{constructor(e,t){super();this.component=CI.MongoLoggableComponent.TOPOLOGY,this.on("error",ot.noop),this.server=e,this.connection=null,this.cancellationToken=new Xm.CancellationToken,this.cancellationToken.setMaxListeners(1/0),this.monitorId=void 0,this.s={state:ut.STATE_CLOSED},this.address=e.description.address,this.options=Object.freeze({connectTimeoutMS:t.connectTimeoutMS??1e4,heartbeatFrequencyMS:t.heartbeatFrequencyMS??1e4,minHeartbeatFrequencyMS:t.minHeartbeatFrequencyMS??500,serverMonitoringMode:t.serverMonitoringMode}),this.isRunningInFaasEnv=SI.getFAASEnv()!=null,this.mongoLogger=this.server.topology.client?.mongoLogger,this.rttSampler=new M3(10);let r=this.cancellationToken,n={id:"<monitor>",generation:e.pool.generation,cancellationToken:r,hostAddress:e.description.hostAddress,...t,raw:!1,useBigInt64:!1,promoteLongs:!0,promoteValues:!0,promoteBuffers:!0};if(delete n.credentials,n.autoEncrypter)delete n.autoEncrypter;this.connectOptions=Object.freeze(n)}connect(){if(this.s.state!==ut.STATE_CLOSED)return;let e=this.options.heartbeatFrequencyMS,t=this.options.minHeartbeatFrequencyMS;this.monitorId=new Zm(OI(this),{heartbeatFrequencyMS:e,minHeartbeatFrequencyMS:t,immediate:!0})}requestCheck(){if(Cde.has(this.s.state))return;this.monitorId?.wake()}reset(){let e=this.server.description.topologyVersion;if(Jh(this)||e==null)return;ql(this,ut.STATE_CLOSING),wI(this),ql(this,kl);let t=this.options.heartbeatFrequencyMS,r=this.options.minHeartbeatFrequencyMS;this.monitorId=new Zm(OI(this),{heartbeatFrequencyMS:t,minHeartbeatFrequencyMS:r})}close(){if(Jh(this))return;ql(this,ut.STATE_CLOSING),wI(this),this.emit("close"),ql(this,ut.STATE_CLOSED)}get roundTripTime(){return this.rttSampler.average()}get minRoundTripTime(){return this.rttSampler.min()}get latestRtt(){return this.rttSampler.last}addRttSample(e){this.rttSampler.addSample(e)}clearRttSamples(){this.rttSampler.clear()}}DI.Monitor=bI;function wI(e){e.monitorId?.stop(),e.monitorId=void 0,e.rttPinger?.close(),e.rttPinger=void 0,e.cancellationToken.emit("cancel"),e.connection?.destroy(),e.connection=null,e.clearRttSamples()}function b3(e,t){if(t==null)return!1;let r=e.options.serverMonitoringMode;if(r===DI.ServerMonitoringMode.poll)return!1;if(r===DI.ServerMonitoringMode.stream)return!0;if(e.isRunningInFaasEnv)return!1;return!0}function bde(e,t){let r,n,s=e.server.description.topologyVersion,i=b3(e,s);e.emitAndLogHeartbeat(_o.Server.SERVER_HEARTBEAT_STARTED,e.server.topology.s.id,void 0,new Eo.ServerHeartbeatStartedEvent(e.address,i));function o(c){e.connection?.destroy(),e.connection=null,e.emitAndLogHeartbeat(_o.Server.SERVER_HEARTBEAT_FAILED,e.server.topology.s.id,void 0,new Eo.ServerHeartbeatFailedEvent(e.address,ot.calculateDurationInMs(r),c,n));let l=!(c instanceof hi.MongoError)?new hi.MongoError(hi.MongoError.buildErrorMessage(c),{cause:c}):c;if(l.addErrorLabel(hi.MongoErrorLabel.ResetPool),l instanceof hi.MongoNetworkTimeoutError)l.addErrorLabel(hi.MongoErrorLabel.InterruptInUseConnections);e.emit("resetServer",l),t(c)}function u(c){if(!("isWritablePrimary"in c))c.isWritablePrimary=c[jl.LEGACY_HELLO_COMMAND];let l=i&&e.rttPinger?e.rttPinger.latestRtt??ot.calculateDurationInMs(r):ot.calculateDurationInMs(r);if(e.addRttSample(l),e.emitAndLogHeartbeat(_o.Server.SERVER_HEARTBEAT_SUCCEEDED,e.server.topology.s.id,c.connectionId,new Eo.ServerHeartbeatSucceededEvent(e.address,l,c,i)),i)e.emitAndLogHeartbeat(_o.Server.SERVER_HEARTBEAT_STARTED,e.server.topology.s.id,void 0,new Eo.ServerHeartbeatStartedEvent(e.address,!0)),r=ot.processTimeMS();else e.rttPinger?.close(),e.rttPinger=void 0,t(void 0,c)}let{connection:a}=e;if(a&&!a.closed){let{serverApi:c,helloOk:l}=a,f=e.options.connectTimeoutMS,h=e.options.heartbeatFrequencyMS,d={[c?.version||l?"hello":jl.LEGACY_HELLO_COMMAND]:1,...i&&s?{maxAwaitTimeMS:h,topologyVersion:Dde(s)}:{}},p=i?{socketTimeoutMS:f?f+h:0,exhaustAllowed:!0}:{socketTimeoutMS:f};if(i&&e.rttPinger==null)e.rttPinger=new T3(e);if(r=ot.processTimeMS(),i)return n=!0,a.exhaustCommand(ot.ns("admin.$cmd"),d,p,(m,E)=>{if(m)return o(m);return u(E)});n=!1,a.command(ot.ns("admin.$cmd"),d,p).then(u,o);return}(async()=>{let c=await ra.makeSocket(e.connectOptions),l=ra.makeConnection(e.connectOptions,c);r=ot.processTimeMS();try{return await ra.performInitialHandshake(l,e.connectOptions),l}catch(f){throw l.destroy(),f}})().then((c)=>{if(Jh(e)){c.destroy();return}let l=ot.calculateDurationInMs(r);e.addRttSample(l),e.connection=c,e.emitAndLogHeartbeat(_o.Server.SERVER_HEARTBEAT_SUCCEEDED,e.server.topology.s.id,c.hello?.connectionId,new Eo.ServerHeartbeatSucceededEvent(e.address,l,c.hello,b3(e,c.hello?.topologyVersion))),t(void 0,c.hello)},(c)=>{e.connection=null,n=!1,o(c)})}function OI(e){return(t)=>{if(e.s.state===Wa){queueMicrotask(t);return}ql(e,Wa);function r(){if(!Jh(e))ql(e,kl);t()}bde(e,(n,s)=>{if(n){if(e.server.description.type===ut.ServerType.Unknown)return r()}if(b3(e,s?.topologyVersion))Bn.setTimeout(()=>{if(!Jh(e))e.monitorId?.wake()},0);r()})}}function Dde(e){return{processId:e.processId,counter:Jm.Long.isLong(e.counter)?e.counter:Jm.Long.fromNumber(e.counter)}}class T3{constructor(e){this.connection=void 0,this.cancellationToken=e.cancellationToken,this.closed=!1,this.monitor=e,this.latestRtt=e.latestRtt??void 0;let t=e.options.heartbeatFrequencyMS;this.monitorId=Bn.setTimeout(()=>this.measureRoundTripTime(),t)}get roundTripTime(){return this.monitor.roundTripTime}get minRoundTripTime(){return this.monitor.minRoundTripTime}close(){this.closed=!0,Bn.clearTimeout(this.monitorId),this.connection?.destroy(),this.connection=void 0}measureAndReschedule(e,t){if(this.closed){t?.destroy();return}if(this.connection==null)this.connection=t;this.latestRtt=ot.calculateDurationInMs(e),this.monitorId=Bn.setTimeout(()=>this.measureRoundTripTime(),this.monitor.options.heartbeatFrequencyMS)}measureRoundTripTime(){let e=ot.processTimeMS();if(this.closed)return;let t=this.connection;if(t==null){ra.connect(this.monitor.connectOptions).then((n)=>{this.measureAndReschedule(e,n)},()=>{this.connection=void 0});return}let r=t.serverApi?.version||t.helloOk?"hello":jl.LEGACY_HELLO_COMMAND;t.command(ot.ns("admin.$cmd"),{[r]:1},void 0).then(()=>this.measureAndReschedule(e),()=>{this.connection?.destroy(),this.connection=void 0;return})}}DI.RTTPinger=T3;class Zm{constructor(e,t={}){if(this.isExpeditedCallToFnScheduled=!1,this.stopped=!1,this.isExecutionInProgress=!1,this.hasExecutedOnce=!1,this._executeAndReschedule=()=>{if(this.stopped)return;if(this.timerId)Bn.clearTimeout(this.timerId);this.isExpeditedCallToFnScheduled=!1,this.isExecutionInProgress=!0,this.fn(()=>{this.lastExecutionEnded=ot.processTimeMS(),this.isExecutionInProgress=!1,this._reschedule(this.heartbeatFrequencyMS)})},this.fn=e,this.lastExecutionEnded=-1/0,this.heartbeatFrequencyMS=t.heartbeatFrequencyMS??1000,this.minHeartbeatFrequencyMS=t.minHeartbeatFrequencyMS??500,t.immediate)this._executeAndReschedule();else this._reschedule(void 0)}wake(){let t=ot.processTimeMS()-this.lastExecutionEnded;if(t<0)return this._executeAndReschedule();if(this.isExecutionInProgress)return;if(this.isExpeditedCallToFnScheduled)return;if(t<this.minHeartbeatFrequencyMS){this.isExpeditedCallToFnScheduled=!0,this._reschedule(this.minHeartbeatFrequencyMS-t);return}this._executeAndReschedule()}stop(){if(this.stopped=!0,this.timerId)Bn.clearTimeout(this.timerId),this.timerId=void 0;this.lastExecutionEnded=-1/0,this.isExpeditedCallToFnScheduled=!1}toString(){return JSON.stringify(this)}toJSON(){let e=ot.processTimeMS(),t=e-this.lastExecutionEnded;return{timerId:this.timerId!=null?"set":"cleared",lastCallTime:this.lastExecutionEnded,isExpeditedCheckScheduled:this.isExpeditedCallToFnScheduled,stopped:this.stopped,heartbeatFrequencyMS:this.heartbeatFrequencyMS,minHeartbeatFrequencyMS:this.minHeartbeatFrequencyMS,currentTime:e,timeSinceLastCall:t}}_reschedule(e){if(this.stopped)return;if(this.timerId)Bn.clearTimeout(this.timerId);this.timerId=Bn.setTimeout(this._executeAndReschedule,e||this.heartbeatFrequencyMS)}}DI.MonitorInterval=Zm;class M3{constructor(e=10){this.rttSamples=new Float64Array(e),this.length=0,this.writeIndex=0}addSample(e){if(this.rttSamples[this.writeIndex++]=e,this.length<this.rttSamples.length)this.length++;this.writeIndex%=this.rttSamples.length}min(){if(this.length<2)return 0;let e=this.rttSamples[0];for(let t=1;t<this.length;t++)if(this.rttSamples[t]<e)e=this.rttSamples[t];return e}average(){if(this.length===0)return 0;let e=0;for(let t=0;t<this.length;t++)e+=this.rttSamples[t];return e/this.length}get last(){if(this.length===0)return null;return this.rttSamples[this.writeIndex===0?this.length-1:this.writeIndex-1]}clear(){this.length=0,this.writeIndex=0}}DI.RTTSampler=M3});var B3=g(function(vI){Object.defineProperty(vI,"__esModule",{value:!0});vI.DEFAULT_OPTIONS=vI.OPTIONS=void 0;vI.resolveSRVRecord=vde;vI.parseOptions=qde;var Ll=L("dns"),Pde=Q_(),Nn=L("process"),FI=L("url"),fi=im(),vr=co(),e0=wh(),t0=MB(),F=J(),na=Ua(),zl=Fu(),Ul=qi(),Zr=Ur(),BI=FB(),NI=C3(),Ke=ae(),Xr=Hn(),x3=["authSource","replicaSet","loadBalanced"],Fde=["srvMaxHosts","srvServiceName","srvAllowedHostsSuffix","srvHostValidator"],MI=new Set(["test","localhost","invalid","example","local","internal","corp","home","mail"]),Bde="loadBalanced option only supported with a single host in the URI",Nde="loadBalanced option not supported with a replicaSet option",Ide="loadBalanced option not supported when directConnection is provided";function II(e){let t=e==="SRV"?(r)=>Ll.promises.resolve(r,"SRV"):(r)=>Ll.promises.resolve(r,"TXT");return async function(n){try{return await t(n)}catch(s){if(s.code===Ll.TIMEOUT)return await t(n);else throw s}}}var $de=II("SRV"),Rde=II("TXT");async function vde(e){if(typeof e.srvHost!=="string")throw new F.MongoAPIError('Option "srvHost" must not be empty');let t=e.srvHost,r=Rde(t);r.then(void 0,Ke.squashError);let n=`_${e.srvServiceName}._tcp.${t}`,s=await $de(n);if(s.length===0)throw new F.MongoAPIError("No addresses found at host");let i=s.map(({name:h,port:d})=>{let p=Ke.normalizeDnsName(h);return Ke.verifySrvHost(p,t,e),Ke.HostAddress.fromString(`${p}:${d??27017}`)});P3(i,e,!0);let o;try{o=await r}catch(h){if(h.code!=="ENODATA"&&h.code!=="ENOTFOUND")throw h;return i}if(o.length>1)throw new F.MongoParseError("Multiple text records not allowed");let u=new FI.URLSearchParams(o[0].join(""));if([...u.keys()].some((h)=>!x3.includes(h)))throw new F.MongoParseError(`Text record may only set any of: ${x3.join(", ")}`);if(x3.some((h)=>u.get(h)===""))throw new F.MongoParseError("Cannot have empty URI params in DNS TXT Record");let c=u.get("authSource")??void 0,l=u.get("replicaSet")??void 0,f=u.get("loadBalanced")??void 0;if(!e.userSpecifiedAuthSource&&c&&e.credentials&&!vr.AUTH_MECHS_AUTH_SRC_EXTERNAL.has(e.credentials.mechanism))e.credentials=fi.MongoCredentials.merge(e.credentials,{source:c});if(!e.userSpecifiedReplicaSet&&l)e.replicaSet=l;if(f==="true")e.loadBalanced=!0;if(e.replicaSet&&e.srvMaxHosts>0)throw new F.MongoParseError("Cannot combine replicaSet option with srvMaxHosts");return P3(i,e,!0),i}function kde(e){if(!e)return;let t=(r,n)=>{if(e.has(r)&&e.has(n))throw new F.MongoAPIError(`The '${r}' option cannot be used with the '${n}' option`)};t("tlsInsecure","tlsAllowInvalidCertificates"),t("tlsInsecure","tlsAllowInvalidHostnames")}function Go(e,t){if(typeof t==="boolean")return t;switch(t){case"true":return!0;case"false":return!1;default:throw new F.MongoParseError(`${e} must be either "true" or "false"`)}}function F3(e,t){let r=Ke.parseInteger(t);if(r!=null)return r;throw new F.MongoParseError(`Expected ${e} to be stringified int value`)}function Xh(e,t){let r=F3(e,t);if(r<0)throw new F.MongoParseError(`${e} can only be a positive int value, got: ${r}`);return r}function*xI(e){if(e==="")return;let t=e.split(",");for(let r of t){let[n,s]=r.split(/:(.*)/);if(s==null)throw new F.MongoParseError("Cannot have undefined values in key value pairs");yield[n,s]}}class Zh extends Map{constructor(e=[]){super(e.map(([t,r])=>[t.toLowerCase(),r]))}has(e){return super.has(e.toLowerCase())}get(e){return super.get(e.toLowerCase())}set(e,t){return super.set(e.toLowerCase(),t)}delete(e){return super.delete(e.toLowerCase())}}function qde(e,t=void 0,r={}){if(t!=null&&!(t instanceof na.MongoClient))r=t,t=void 0;if(r.useBigInt64&&typeof r.promoteLongs==="boolean"&&!r.promoteLongs)throw new F.MongoAPIError("Must request either bigint or Long for int64 deserialization");if(r.useBigInt64&&typeof r.promoteValues==="boolean"&&!r.promoteValues)throw new F.MongoAPIError("Must request either bigint or Long for int64 deserialization");let n;try{n=new Pde.default(e)}catch(y){if(y.message?.startsWith("Username contains unescaped characters"))throw new F.MongoParseError("Username contains unescaped characters");throw y}let{hosts:s,isSRV:i}=n,o=Object.create(null);o.hosts=i?[]:s.map(Ke.HostAddress.fromString);let u=new Zh;if(n.pathname!=="/"&&n.pathname!==""){let y=decodeURIComponent(n.pathname[0]==="/"?n.pathname.slice(1):n.pathname);if(y)u.set("dbName",[y])}if(n.username!==""){let y={username:decodeURIComponent(n.username)};if(typeof n.password==="string")y.password=decodeURIComponent(n.password);u.set("auth",[y])}let a=new Set(Object.keys(vI.OPTIONS).map((y)=>y.toLowerCase())),c=Array.from(n.searchParams.keys()).flatMap((y,_)=>a.has(y.toLowerCase())?[]:[_+1]);if(c.length!==0)throw new F.MongoParseError(`connection string contains unsupported options, at position: ${c.join(", ")}`);for(let y of n.searchParams.keys()){let _=n.searchParams.getAll(y),w=Object.keys(vI.OPTIONS).find((A)=>A.toLowerCase()===y.toLowerCase()),C=/readPreferenceTags/i.test(y);if(!C&&_.length>1)throw new F.MongoInvalidArgumentError(`URI option "${w}" cannot appear more than once in the connection string`);if(!C&&_.includes("")&&!Ude(y))throw new F.MongoAPIError(`URI option "${w}" cannot be specified with no value`);if(!u.has(y))u.set(y,_)}let l=new Zh(Object.entries(r).filter(([,y])=>y!=null)),[f]=u.get("readPreference")??[];if(typeof f==="string"&&!Zr.ReadPreference.isValid(f))throw new F.MongoInvalidArgumentError("readPreference is not a valid read preference mode");if(u.has("serverApi"))throw new F.MongoParseError("URI cannot contain `serverApi`, it can only be passed to the client");if(u.has("srvHostValidator"))throw new F.MongoParseError("URI cannot contain `srvHostValidator`, it can only be passed to the client");let h=u.get("authMechanismProperties");if(h){for(let y of h)if(/(^|,)ALLOWED_HOSTS:/.test(y))throw new F.MongoParseError("Auth mechanism property ALLOWED_HOSTS is not allowed in the connection string.")}if(l.has("loadBalanced"))throw new F.MongoParseError("loadBalanced is only a valid option in the URI");let d=new Zh,p=new Set([...u.keys(),...l.keys()]);for(let y of p){let _=[],w=l.get(y);if(w!=null)_.push(w);let C=u.get(y)??[];_.push(...C),d.set(y,_)}if(d.has("tls")||d.has("ssl")){let y=(d.get("tls")||[]).concat(d.get("ssl")||[]).map(Go.bind(null,"tls/ssl"));if(new Set(y).size!==1)throw new F.MongoParseError("All values of tls/ssl must be the same.")}kde(d);let m=Ke.setDifference(p,a);if(m.size!==0){let y=m.size>1?"options":"option",_=m.size>1?"are":"is";throw new F.MongoParseError(`${y} ${Array.from(m).join(", ")} ${_} not supported`)}for(let[y,_]of Object.entries(vI.OPTIONS)){let w=d.get(y);if(!w||w.length===0){if(vI.DEFAULT_OPTIONS.has(y))PI(o,y,_,[vI.DEFAULT_OPTIONS.get(y)])}else{let{deprecated:C,ignored:A}=_;if(C){let M=typeof C==="string"?`: ${C}`:"";Ke.emitWarning(`${y} is a deprecated option${M}`)}if(A)continue;PI(o,y,_,w)}}if(o.credentials){let y=o.credentials.mechanism===vr.AuthMechanism.MONGODB_GSSAPI,_=o.credentials.mechanism===vr.AuthMechanism.MONGODB_X509,w=o.credentials.mechanism===vr.AuthMechanism.MONGODB_AWS,C=o.credentials.mechanism===vr.AuthMechanism.MONGODB_OIDC;if((y||_)&&d.has("authSource")&&o.credentials.source!=="$external")throw new F.MongoParseError(`authMechanism ${o.credentials.mechanism} requires an authSource of '$external'`);if(!(y||_||w||C)&&o.dbName&&!d.has("authSource"))o.credentials=fi.MongoCredentials.merge(o.credentials,{source:o.dbName});if(w){let{username:A,password:M}=o.credentials;if(A||M)throw new F.MongoAPIError("username and password cannot be provided when using MONGODB-AWS. Credentials must be provided in a manner that can be read by the AWS SDK.");if(o.credentials.mechanismProperties.AWS_SESSION_TOKEN)throw new F.MongoAPIError("AWS_SESSION_TOKEN cannot be provided when using MONGODB-AWS. Credentials must be provided in a manner that can be read by the AWS SDK.")}if(o.credentials.validate(),o.credentials.password===""&&o.credentials.username===""&&o.credentials.mechanism===vr.AuthMechanism.MONGODB_DEFAULT&&Object.keys(o.credentials.mechanismProperties).length===0)delete o.credentials}if(!o.dbName)o.dbName="test";if(P3(s,o,i),t&&o.autoEncryption)t0.Encrypter.checkForMongoCrypt(),o.encrypter=new t0.Encrypter(t,e,r),o.autoEncrypter=o.encrypter.autoEncrypter;if(o.userSpecifiedAuthSource=l.has("authSource")||u.has("authSource"),o.userSpecifiedReplicaSet=l.has("replicaSet")||u.has("replicaSet"),i){if(o.srvHost=s[0],o.directConnection)throw new F.MongoAPIError("SRV URI does not support directConnection");if(o.srvMaxHosts>0&&typeof o.replicaSet==="string")throw new F.MongoParseError("Cannot use srvMaxHosts option with replicaSet");if(o.srvAllowedHostsSuffix!=null&&o.srvHostValidator!=null)throw new F.MongoParseError("Cannot use srvAllowedHostsSuffix together with srvHostValidator");let y=!l.has("tls")&&!u.has("tls"),_=!l.has("ssl")&&!u.has("ssl");if(y&&_)o.tls=!0}else{let y=Fde.filter((_)=>u.has(_)||l.has(_));if(y.length>0)throw new F.MongoParseError(`Cannot use ${y.join(", ")} with a non-srv connection string`)}if(o.directConnection&&o.hosts.length!==1)throw new F.MongoParseError("directConnection option requires exactly one host");if(!o.proxyHost&&(o.proxyPort||o.proxyUsername||o.proxyPassword))throw new F.MongoParseError("Must specify proxyHost if other proxy options are passed");if(o.proxyUsername&&!o.proxyPassword||!o.proxyUsername&&o.proxyPassword)throw new F.MongoParseError("Can only specify both of proxy username/password or neither");if(["proxyHost","proxyPort","proxyUsername","proxyPassword"].map((y)=>u.get(y)??[]).some((y)=>y.length>1))throw new F.MongoParseError("Proxy options cannot be specified multiple times in the connection string");return o.mongoLoggerOptions=zl.MongoLogger.resolveOptions({MONGODB_LOG_COMMAND:Nn.env.MONGODB_LOG_COMMAND,MONGODB_LOG_TOPOLOGY:Nn.env.MONGODB_LOG_TOPOLOGY,MONGODB_LOG_SERVER_SELECTION:Nn.env.MONGODB_LOG_SERVER_SELECTION,MONGODB_LOG_CONNECTION:Nn.env.MONGODB_LOG_CONNECTION,MONGODB_LOG_CLIENT:Nn.env.MONGODB_LOG_CLIENT,MONGODB_LOG_ALL:Nn.env.MONGODB_LOG_ALL,MONGODB_LOG_MAX_DOCUMENT_LENGTH:Nn.env.MONGODB_LOG_MAX_DOCUMENT_LENGTH,MONGODB_LOG_PATH:Nn.env.MONGODB_LOG_PATH},{mongodbLogPath:o.mongodbLogPath,mongodbLogComponentSeverities:o.mongodbLogComponentSeverities,mongodbLogMaxDocumentLength:o.mongodbLogMaxDocumentLength}),o.runtime=BI.resolveRuntimeAdapters(r),o.runtime.then(void 0,Ke.squashError),o[$I]=jde,o.toJSON=RI,o}var $I=Symbol.for("nodejs.util.inspect.custom");function RI(){let e={...this};delete e[$I];for(let t of["proxyUsername","proxyPassword","passphrase"])if(e[t]!=null)e[t]="<redacted>";return e}function jde(e,t,r){return r(RI.call(this),t)}function P3(e,t,r){if(t.loadBalanced){if(e.length>1)throw new F.MongoParseError(Bde);if(t.replicaSet)throw new F.MongoParseError(Nde);if(t.directConnection)throw new F.MongoParseError(Ide);if(r&&t.srvMaxHosts>0)throw new F.MongoParseError("Cannot limit srv hosts with loadBalanced enabled")}return}function Lde(e){let t=e.replace(/^\.+|\.+$/g,"");if(t==="")throw new F.MongoParseError("srvAllowedHostsSuffix must contain at least one domain label");let r=Ke.dnsNameToASCII(t);if(r==null)throw new F.MongoParseError("srvAllowedHostsSuffix is not a valid domain name");if(!r.includes(".")&&!MI.has(r))throw new F.MongoParseError(`srvAllowedHostsSuffix must contain at least two domain labels, or be one of: ${[...MI].join(", ")}`);return`.${r}`}function Ude(e){return Object.entries(vI.OPTIONS).some(([t,r])=>r.ignored&&t.toLowerCase()===e.toLowerCase())}function PI(e,t,r,n){let{target:s,type:i,transform:o}=r,u=s??t;switch(i){case"boolean":e[u]=Go(u,n[0]);break;case"int":e[u]=F3(u,n[0]);break;case"uint":e[u]=Xh(u,n[0]);break;case"string":if(n[0]==null)break;e[u]=String(n[0]);break;case"record":if(!Ke.isRecord(n[0]))throw new F.MongoParseError(`${u} must be an object`);e[u]=n[0];break;case"any":e[u]=n[0];break;default:{if(!o)throw new F.MongoParseError("Descriptors missing a type must define a transform");let a=o({name:u,options:e,values:n});e[u]=a;break}}}vI.OPTIONS={enableOverloadRetargeting:{default:!1,type:"boolean"},appName:{type:"string"},auth:{target:"credentials",transform({name:e,options:t,values:[r]}){if(!Ke.isRecord(r,["username","password"]))throw new F.MongoParseError(`${e} must be an object with 'username' and 'password' properties`);return fi.MongoCredentials.merge(t.credentials,{username:r.username,password:r.password})}},authMechanism:{target:"credentials",transform({options:e,values:[t]}){let r=Object.values(vr.AuthMechanism),n;try{[n]=r.filter((o)=>o.match(RegExp(String.raw`\b${t}\b`,"i")))}catch{}if(!n)throw new F.MongoParseError(`authMechanism must be one of ${r}`);let s=e.credentials?.source;if(n===vr.AuthMechanism.MONGODB_PLAIN||vr.AUTH_MECHS_AUTH_SRC_EXTERNAL.has(n))s="$external";let i=e.credentials?.password;if(n===vr.AuthMechanism.MONGODB_X509&&i==="")i=void 0;return fi.MongoCredentials.merge(e.credentials,{mechanism:n,source:s,password:i})}},authMechanismProperties:{target:"credentials",transform({options:e,values:t}){let r=Object.create(null);for(let n of t)if(typeof n==="string")for(let[s,i]of xI(n))try{r[s]=Go(s,i)}catch{r[s]=i}else{if(!Ke.isRecord(n))throw new F.MongoParseError("AuthMechanismProperties must be an object");r={...n}}return fi.MongoCredentials.merge(e.credentials,{mechanismProperties:r})}},authSource:{target:"credentials",transform({options:e,values:[t]}){let r=String(t);return fi.MongoCredentials.merge(e.credentials,{source:r})}},autoEncryption:{type:"record"},autoSelectFamily:{type:"boolean"},autoSelectFamilyAttemptTimeout:{type:"uint"},bsonRegExp:{type:"boolean"},serverApi:{target:"serverApi",transform({values:[e]}){let t=typeof e==="string"?{version:e}:e,r=t&&t.version;if(!r)throw new F.MongoParseError(`Invalid \`serverApi\` property; must specify a version from the following enum: ["${Object.values(na.ServerApiVersion).join('", "')}"]`);if(!Object.values(na.ServerApiVersion).some((n)=>n===r))throw new F.MongoParseError(`Invalid server API version=${r}; must be in the following enum: ["${Object.values(na.ServerApiVersion).join('", "')}"]`);return t}},checkKeys:{type:"boolean"},compressors:{default:"none",target:"compressors",transform({values:e}){let t=new Set;for(let r of e){let n=typeof r==="string"?r.split(","):r;if(!Array.isArray(n))throw new F.MongoInvalidArgumentError("compressors must be an array or a comma-delimited list of strings");for(let s of n)if(Object.keys(e0.Compressor).includes(String(s)))t.add(String(s));else throw new F.MongoInvalidArgumentError(`compressors contains a value that is not a valid compression mechanism. Must be one of: ${Object.keys(e0.Compressor)}.`)}return[...t]}},connectTimeoutMS:{default:30000,type:"uint"},dbName:{type:"string"},directConnection:{default:!1,type:"boolean"},driverInfo:{default:{},type:"record"},enableUtf8Validation:{type:"boolean",default:!0},family:{transform({name:e,values:[t]}){let r=F3(e,t);if(r===4||r===6)return r;throw new F.MongoParseError(`Option 'family' must be 4 or 6 got ${r}.`)}},fieldsAsRaw:{type:"record"},forceServerObjectId:{default:!1,type:"boolean"},fsync:{deprecated:"Please use journal instead",target:"writeConcern",transform({name:e,options:t,values:[r]}){let n=Xr.WriteConcern.fromOptions({writeConcern:{...t.writeConcern,fsync:Go(e,r)}});if(!n)throw new F.MongoParseError(`Unable to make a writeConcern from fsync=${r}`);return n}},heartbeatFrequencyMS:{default:1e4,type:"uint"},ignoreUndefined:{type:"boolean"},j:{deprecated:"Please use journal instead",target:"writeConcern",transform({name:e,options:t,values:[r]}){let n=Xr.WriteConcern.fromOptions({writeConcern:{...t.writeConcern,journal:Go(e,r)}});if(!n)throw new F.MongoParseError(`Unable to make a writeConcern from journal=${r}`);return n}},journal:{target:"writeConcern",transform({name:e,options:t,values:[r]}){let n=Xr.WriteConcern.fromOptions({writeConcern:{...t.writeConcern,journal:Go(e,r)}});if(!n)throw new F.MongoParseError(`Unable to make a writeConcern from journal=${r}`);return n}},loadBalanced:{default:!1,type:"boolean"},localThresholdMS:{default:15,type:"uint"},maxAdaptiveRetries:{default:2,type:"uint"},maxConnecting:{default:2,transform({name:e,values:[t]}){let r=Xh(e,t);if(r===0)throw new F.MongoInvalidArgumentError("maxConnecting must be > 0 if specified");return r}},maxIdleTimeMS:{default:0,type:"uint"},maxPoolSize:{default:100,type:"uint"},maxStalenessSeconds:{target:"readPreference",transform({name:e,options:t,values:[r]}){let n=Xh(e,r);if(t.readPreference)return Zr.ReadPreference.fromOptions({readPreference:{...t.readPreference,maxStalenessSeconds:n}});else return new Zr.ReadPreference("secondary",void 0,{maxStalenessSeconds:n})}},minInternalBufferSize:{type:"uint"},minPoolSize:{default:0,type:"uint"},minHeartbeatFrequencyMS:{default:500,type:"uint"},monitorCommands:{default:!1,type:"boolean"},name:{target:"driverInfo",transform({values:[e],options:t}){return{...t.driverInfo,name:String(e)}}},noDelay:{default:!0,type:"boolean"},pkFactory:{default:Ke.DEFAULT_PK_FACTORY,transform({values:[e]}){if(Ke.isRecord(e,["createPk"])&&typeof e.createPk==="function")return e;throw new F.MongoParseError("Option pkFactory must be an object with a createPk function")}},promoteBuffers:{type:"boolean"},promoteLongs:{type:"boolean"},promoteValues:{type:"boolean"},useBigInt64:{type:"boolean"},proxyHost:{type:"string"},proxyPassword:{type:"string"},proxyPort:{type:"uint"},proxyUsername:{type:"string"},raw:{default:!1,type:"boolean"},readConcern:{transform({values:[e],options:t}){if(e instanceof Ul.ReadConcern||Ke.isRecord(e,["level"]))return Ul.ReadConcern.fromOptions({...t.readConcern,...e});throw new F.MongoParseError("ReadConcern must be an object")}},readConcernLevel:{target:"readConcern",transform({values:[e],options:t}){return Ul.ReadConcern.fromOptions({...t.readConcern,level:e})}},readPreference:{default:Zr.ReadPreference.primary,transform({values:[e],options:t}){if(e instanceof Zr.ReadPreference)return Zr.ReadPreference.fromOptions({readPreference:{...t.readPreference,...e},...e});if(Ke.isRecord(e,["mode"])){let r=Zr.ReadPreference.fromOptions({readPreference:{...t.readPreference,...e},...e});if(r)return r;else throw new F.MongoParseError(`Cannot make read preference from ${JSON.stringify(e)}`)}if(typeof e==="string"){let r={hedge:t.readPreference?.hedge,maxStalenessSeconds:t.readPreference?.maxStalenessSeconds};return new Zr.ReadPreference(e,t.readPreference?.tags,r)}throw new F.MongoParseError(`Unknown ReadPreference value: ${e}`)}},readPreferenceTags:{target:"readPreference",transform({values:e,options:t}){let r=Array.isArray(e[0])?e[0]:e,n=[];for(let s of r){let i=Object.create(null);if(typeof s==="string")for(let[o,u]of xI(s))i[o]=u;if(Ke.isRecord(s))for(let[o,u]of Object.entries(s))i[o]=u;n.push(i)}return Zr.ReadPreference.fromOptions({readPreference:t.readPreference,readPreferenceTags:n})}},replicaSet:{type:"string"},retryReads:{default:!0,type:"boolean"},retryWrites:{default:!0,type:"boolean"},runtimeAdapters:{type:"record"},serializeFunctions:{type:"boolean"},serverMonitoringMode:{default:"auto",transform({values:[e]}){if(!Object.values(NI.ServerMonitoringMode).includes(e))throw new F.MongoParseError("serverMonitoringMode must be one of `auto`, `poll`, or `stream`");return e}},serverSelectionTimeoutMS:{default:30000,type:"uint"},servername:{type:"string"},socketTimeoutMS:{default:0,type:"uint"},srvAllowedHostsSuffix:{transform({values:[e]}){if(typeof e!=="string")throw new F.MongoParseError("srvAllowedHostsSuffix must be a string");return Lde(e)}},srvHostValidator:{transform({values:[e]}){if(typeof e!=="function")throw new F.MongoParseError("srvHostValidator must be a function");return(t)=>{let r;try{r=e(t)}catch(n){throw new F.MongoAPIError("srvHostValidator threw an error",{cause:n})}if(typeof r!=="boolean")throw new F.MongoAPIError(`srvHostValidator must return a boolean, received ${typeof r}`);return r}}},srvMaxHosts:{type:"uint",default:0},srvServiceName:{type:"string",default:"mongodb"},ssl:{target:"tls",type:"boolean"},timeoutMS:{deprecated:"timeoutMS has no effect and will be removed in a future release",ignored:!0},tls:{type:"boolean"},tlsAllowInvalidCertificates:{target:"rejectUnauthorized",transform({name:e,values:[t]}){return!Go(e,t)}},tlsAllowInvalidHostnames:{target:"checkServerIdentity",transform({name:e,values:[t]}){return Go(e,t)?()=>{return}:void 0}},tlsCAFile:{type:"string"},tlsCRLFile:{type:"string"},tlsCertificateKeyFile:{type:"string"},tlsCertificateKeyFilePassword:{target:"passphrase",type:"any"},tlsInsecure:{transform({name:e,options:t,values:[r]}){let n=Go(e,r);if(n)t.checkServerIdentity=()=>{return},t.rejectUnauthorized=!1;else t.checkServerIdentity=t.tlsAllowInvalidHostnames?()=>{return}:void 0,t.rejectUnauthorized=t.tlsAllowInvalidCertificates?!1:!0;return n}},w:{target:"writeConcern",transform({values:[e],options:t}){return Xr.WriteConcern.fromOptions({writeConcern:{...t.writeConcern,w:e}})}},waitQueueTimeoutMS:{default:0,type:"uint"},writeConcern:{target:"writeConcern",transform({values:[e],options:t}){if(Ke.isRecord(e)||e instanceof Xr.WriteConcern)return Xr.WriteConcern.fromOptions({writeConcern:{...t.writeConcern,...e}});else if(e==="majority"||typeof e==="number")return Xr.WriteConcern.fromOptions({writeConcern:{...t.writeConcern,w:e}});throw new F.MongoParseError("Invalid WriteConcern cannot parse")}},wtimeout:{deprecated:"Please use wtimeoutMS instead",target:"writeConcern",transform({values:[e],options:t}){let r=Xr.WriteConcern.fromOptions({writeConcern:{...t.writeConcern,wtimeout:Xh("wtimeout",e)}});if(r)return r;throw new F.MongoParseError("Cannot make WriteConcern from wtimeout")}},wtimeoutMS:{target:"writeConcern",transform({values:[e],options:t}){let r=Xr.WriteConcern.fromOptions({writeConcern:{...t.writeConcern,wtimeoutMS:Xh("wtimeoutMS",e)}});if(r)return r;throw new F.MongoParseError("Cannot make WriteConcern from wtimeout")}},zlibCompressionLevel:{default:0,type:"int"},mongodbLogPath:{transform({values:[e]}){if(!(typeof e==="string"&&["stderr","stdout"].includes(e)||e&&typeof e==="object"&&("write"in e)&&typeof e.write==="function"))throw new F.MongoAPIError("Option 'mongodbLogPath' must be of type 'stderr' | 'stdout' | MongoDBLogWritable");return e}},mongodbLogComponentSeverities:{transform({values:[e]}){if(typeof e!=="object"||!e)throw new F.MongoAPIError("Option 'mongodbLogComponentSeverities' must be a non-null object");for(let[t,r]of Object.entries(e)){if(typeof r!=="string"||typeof t!=="string")throw new F.MongoAPIError("User input for option 'mongodbLogComponentSeverities' object cannot include a non-string key or value");if(!Object.values(zl.MongoLoggableComponent).some((n)=>n===t)&&t!=="default")throw new F.MongoAPIError(`User input for option 'mongodbLogComponentSeverities' contains invalid key: ${t}`);if(!Object.values(zl.SeverityLevel).some((n)=>n===r))throw new F.MongoAPIError(`Option 'mongodbLogComponentSeverities' does not support ${r} as a value for ${t}`)}return e}},mongodbLogMaxDocumentLength:{type:"uint"},connectionType:{type:"any"},srvPoller:{type:"any"},allowPartialTrustChain:{type:"any"},minDHSize:{type:"any"},pskCallback:{type:"any"},secureContext:{type:"any"},enableTrace:{type:"any"},requestCert:{type:"any"},rejectUnauthorized:{type:"any"},checkServerIdentity:{type:"any"},keepAliveInitialDelay:{type:"any"},ALPNProtocols:{type:"any"},SNICallback:{type:"any"},session:{type:"any"},requestOCSP:{type:"any"},localAddress:{type:"any"},localPort:{type:"any"},hints:{type:"any"},lookup:{type:"any"},ca:{type:"any"},cert:{type:"any"},ciphers:{type:"any"},crl:{type:"any"},ecdhCurve:{type:"any"},key:{type:"any"},passphrase:{type:"any"},pfx:{type:"any"},secureProtocol:{type:"any"},index:{type:"any"},__skipPingOnConnect:{type:"boolean"}};vI.DEFAULT_OPTIONS=new Zh(Object.entries(vI.OPTIONS).filter(([,e])=>e.default!=null).map(([e,t])=>[e,t.default]))});var jI=g(function(qI){Object.defineProperty(qI,"__esModule",{value:!0});qI.aws4Sign=Wde;var sa=Se(),kI=async(e)=>{let t=N3(e),r=await crypto.subtle.digest("SHA-256",t);return sa.ByteUtils.toHex(new Uint8Array(r))},ef=async(e,t)=>{let r;if(typeof e==="string")r=N3(e);else r=e;let n=await crypto.subtle.importKey("raw",r,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]),s=N3(t),i=await crypto.subtle.sign("HMAC",n,s);return new Uint8Array(i)},Ka=(e)=>e.toString().trim().replace(/\s+/g," ");function N3(e){let t=new Uint8Array(sa.ByteUtils.utf8ByteLength(e));return sa.ByteUtils.encodeUTF8Into(t,e,0),t}async function Wde(e,t){let n=e.date.toISOString().replace(/[:-]|\.\d{3}/g,""),s=n.substring(0,8),{method:i,path:o}=e,u="",a=new Headers({"content-length":Ka(e.headers["Content-Length"]),"content-type":Ka(e.headers["Content-Type"]),host:Ka(e.host),"x-amz-date":Ka(n),"x-mongodb-gs2-cb-flag":Ka(e.headers["X-MongoDB-GS2-CB-Flag"]),"x-mongodb-server-nonce":Ka(e.headers["X-MongoDB-Server-Nonce"])});if("sessionToken"in t&&t.sessionToken)a.append("x-amz-security-token",Ka(t.sessionToken));let c=Array.from(a.entries()).map(([v,P])=>`${v.toLowerCase()}:${P}`).sort().join(`
25
+ `),f=Array.from(a.keys()).map((v)=>v.toLowerCase()).sort().join(";"),h=await kI(e.body),d=[i,o,"",c+`
26
+ `,f,h].join(`
27
+ `),p=await kI(d),m="AWS4-HMAC-SHA256",E=`${s}/${e.region}/${e.service}/aws4_request`,y=[m,n,E,p].join(`
28
+ `),_=await ef("AWS4"+t.secretAccessKey,s),w=await ef(_,e.region),C=await ef(w,e.service),A=await ef(C,"aws4_request"),M=await ef(A,y),O=sa.ByteUtils.toHex(M);return{Authorization:["AWS4-HMAC-SHA256 Credential="+t.accessKeyId+"/"+E,"SignedHeaders="+f,"Signature="+O].join(", "),"X-Amz-Date":n}}});var YI=g(function(HI){Object.defineProperty(HI,"__esModule",{value:!0});HI.MongoDBAWS=void 0;var n0=Se(),Wl=Se(),Ao=J(),Kl=ae(),LI=ju(),UI=Z_(),VI=jI(),zI=im(),WI=co(),Hde=110,I3={useBigInt64:!1,promoteLongs:!0,promoteValues:!0,promoteBuffers:!1,bsonRegExp:!1};class KI extends LI.AuthProvider{constructor(e){super();this.credentialFetcher=new UI.AWSSDKCredentialProvider(e)}async auth(e){let{connection:t}=e;if(!e.credentials)throw new Ao.MongoMissingCredentialsError("AuthContext must provide credentials.");e.credentials=await Gde(e.credentials,this.credentialFetcher);let{credentials:r}=e,{username:n,password:s}=r,i=r.mechanismProperties.AWS_SESSION_TOKEN,o=i?{accessKeyId:n,secretAccessKey:s,sessionToken:i}:{accessKeyId:n,secretAccessKey:s},u=r.source,a=await Kl.randomBytes(32),c={saslStart:1,mechanism:"MONGODB-AWS",payload:Wl.serialize({r:a,p:Hde},I3)},l=await t.command(Kl.ns(`${u}.$cmd`),c,void 0),f=Wl.deserialize(l.payload.buffer,I3),h=f.h,d=f.s.buffer;if(d.length!==64)throw new Ao.MongoRuntimeError(`Invalid server nonce length ${d.length}, expected 64`);if(!n0.ByteUtils.equals(d.subarray(0,a.byteLength),a))throw new Ao.MongoRuntimeError("Server nonce does not begin with client nonce");if(h.length<1||h.length>255||h.indexOf("..")!==-1)throw new Ao.MongoRuntimeError(`Server returned an invalid host: "${h}"`);let p="Action=GetCallerIdentity&Version=2011-06-15",m=await VI.aws4Sign({method:"POST",host:h,region:Yde(f.h),service:"sts",headers:{"Content-Type":"application/x-www-form-urlencoded","Content-Length":p.length,"X-MongoDB-Server-Nonce":n0.ByteUtils.toBase64(d),"X-MongoDB-GS2-CB-Flag":"n"},path:"/",body:p,date:new Date},o),E={a:m.Authorization,d:m["X-Amz-Date"]};if(i)E.t=i;let y={saslContinue:1,conversationId:l.conversationId,payload:Wl.serialize(E,I3)};await t.command(Kl.ns(`${u}.$cmd`),y,void 0)}}HI.MongoDBAWS=KI;async function Gde(e,t){function r(s){if(!s.AccessKeyId||!s.SecretAccessKey)throw new Ao.MongoMissingCredentialsError("Could not obtain temporary MONGODB-AWS credentials");return new zI.MongoCredentials({username:s.AccessKeyId,password:s.SecretAccessKey,source:e.source,mechanism:WI.AuthMechanism.MONGODB_AWS,mechanismProperties:{AWS_SESSION_TOKEN:s.Token}})}let n=await t.getCredentials();return r(n)}function Yde(e){let t=e.split(".");if(t.length===1||t[1]==="amazonaws")return"us-east-1";return t[1]}});var JI=g(function(QI){Object.defineProperty(QI,"__esModule",{value:!0});QI.finishCommandDocument=Qde;QI.startCommandDocument=Jde;var di=Se(),s0=co();function Qde(e,t){if(t!=null)return{saslContinue:1,conversationId:t,payload:new di.Binary(di.BSON.serialize({jwt:e}))};return{saslStart:1,mechanism:s0.AuthMechanism.MONGODB_OIDC,payload:new di.Binary(di.BSON.serialize({jwt:e}))}}function Jde(e){let t={};if(e.username)t.n=e.username;return{saslStart:1,autoAuthorize:1,mechanism:s0.AuthMechanism.MONGODB_OIDC,payload:new di.Binary(di.BSON.serialize(t))}}});var R3=g(function(t$){Object.defineProperty(t$,"__esModule",{value:!0});t$.CallbackWorkflow=t$.AUTOMATED_TIMEOUT_MS=t$.HUMAN_TIMEOUT_MS=void 0;var XI=L("timers/promises"),ZI=J(),i0=ae(),Hl=JI();t$.HUMAN_TIMEOUT_MS=300000;t$.AUTOMATED_TIMEOUT_MS=60000;var epe=["accessToken","expiresInSeconds","refreshToken"],tpe="User provided OIDC callbacks must return a valid object with an accessToken.",$3=100;class e${constructor(e,t){this.cache=e,this.callback=this.withLock(t),this.lastExecutionTime=Date.now()-$3}async speculativeAuth(e,t){if(this.cache.hasAccessToken){let r=this.cache.getAccessToken();e.accessToken=r;let n=Hl.finishCommandDocument(r);return n.db=t.source,{speculativeAuthenticate:n}}return{}}async reauthenticate(e,t){if(this.cache.hasAccessToken)if(e.accessToken===this.cache.getAccessToken())this.cache.removeAccessToken(),delete e.accessToken;else e.accessToken=this.cache.getAccessToken();await this.execute(e,t)}async startAuthentication(e,t,r){let n;if(r?.speculativeAuthenticate)n=r.speculativeAuthenticate;else n=await e.command(i0.ns(t.source),Hl.startCommandDocument(t),void 0);return n}async finishAuthentication(e,t,r,n){await e.command(i0.ns(t.source),Hl.finishCommandDocument(r,n),void 0)}async executeAndValidateCallback(e){let t=await this.callback(e);if(rpe(t))throw new ZI.MongoMissingCredentialsError(tpe);return t}withLock(e){let t=Promise.resolve();return async(r)=>{let n=t.then(async()=>{let s=Date.now()-this.lastExecutionTime;if(s<=$3)await XI.setTimeout($3-s,{signal:r.timeoutContext});return this.lastExecutionTime=Date.now(),await e(r)});return t=n.then(()=>{return},()=>{return}),await n}}}t$.CallbackWorkflow=e$;function rpe(e){if(e==null||typeof e!=="object")return!0;if(!("accessToken"in e))return!0;return!Object.getOwnPropertyNames(e).every((t)=>epe.includes(t))}});var v3=g(function(i$){Object.defineProperty(i$,"__esModule",{value:!0});i$.AutomatedCallbackWorkflow=void 0;var Gl=J(),o0=Gn(),n$=u0(),Yl=R3();class s$ extends Yl.CallbackWorkflow{constructor(e,t){super(e,t)}async execute(e,t){if(this.cache.hasAccessToken){let n=this.cache.getAccessToken();if(!e.accessToken)e.accessToken=n;try{return await this.finishAuthentication(e,t,n)}catch(s){if(s instanceof Gl.MongoError&&s.code===Gl.MONGODB_ERROR_CODES.AuthenticationFailed)return this.cache.removeAccessToken(),await this.execute(e,t);else throw s}}let r=await this.fetchAccessToken(t);this.cache.put(r),e.accessToken=r.accessToken,await this.finishAuthentication(e,t,r.accessToken)}async fetchAccessToken(e){let t=new AbortController,r={timeoutContext:t.signal,version:n$.OIDC_VERSION};if(e.username)r.username=e.username;if(e.mechanismProperties.TOKEN_RESOURCE)r.tokenAudience=e.mechanismProperties.TOKEN_RESOURCE;let n=o0.Timeout.expires(Yl.AUTOMATED_TIMEOUT_MS);try{return await Promise.race([this.executeAndValidateCallback(r),n])}catch(s){if(o0.TimeoutError.is(s))throw t.abort(),new Gl.MongoOIDCError(`OIDC callback timed out after ${Yl.AUTOMATED_TIMEOUT_MS}ms.`);throw s}finally{n.clear()}}}i$.AutomatedCallbackWorkflow=s$});var l$=g(function(a$){Object.defineProperty(a$,"__esModule",{value:!0});a$.azureCallback=void 0;var a0=r3(),Ql=J(),u$=ae(),ipe=Object.freeze({Metadata:"true",Accept:"application/json"}),ope="Azure endpoint did not return a value with only access_token and expires_in properties",upe="TOKEN_RESOURCE must be set in the auth mechanism properties when ENVIRONMENT is azure.",ape=async(e)=>{let{tokenAudience:t,username:r}=e;if(!t)throw new Ql.MongoAzureError(upe);let n=await cpe(t,r);if(!lpe(n))throw new Ql.MongoAzureError(ope);return n};a$.azureCallback=ape;async function cpe(e,t){let r=new URL(a0.AZURE_BASE_URL);a0.addAzureParams(r,e,t);let n=await u$.get(r,{headers:ipe});if(n.status!==200)throw new Ql.MongoAzureError(`Status code ${n.status} returned from the Azure endpoint. Response body: ${n.body}`);let s=JSON.parse(n.body);return{accessToken:s.access_token,expiresInSeconds:Number(s.expires_in)}}function lpe(e){if(e==null||typeof e!=="object")return!1;return"accessToken"in e&&typeof e.accessToken==="string"&&"expiresInSeconds"in e&&typeof e.expiresInSeconds==="number"}});var p$=g(function(f$){Object.defineProperty(f$,"__esModule",{value:!0});f$.gcpCallback=void 0;var c0=J(),h$=ae(),hpe="http://metadata/computeMetadata/v1/instance/service-accounts/default/identity",fpe=Object.freeze({"Metadata-Flavor":"Google"}),dpe="TOKEN_RESOURCE must be set in the auth mechanism properties when ENVIRONMENT is gcp.",ppe=async(e)=>{let t=e.tokenAudience;if(!t)throw new c0.MongoGCPError(dpe);return await mpe(t)};f$.gcpCallback=ppe;async function mpe(e){let t=new URL(hpe);t.searchParams.append("audience",e);let r=await h$.get(t,{headers:fpe});if(r.status!==200)throw new c0.MongoGCPError(`Status code ${r.status} returned from the GCP endpoint. Response body: ${r.body}`);return{accessToken:r.body}}});var A$=g(function(E$){Object.defineProperty(E$,"__esModule",{value:!0});E$.k8sCallback=void 0;var g$=L("fs/promises"),ia=L("process"),ype="/var/run/secrets/kubernetes.io/serviceaccount/token",m$="AZURE_FEDERATED_TOKEN_FILE",y$="AWS_WEB_IDENTITY_TOKEN_FILE",gpe=async()=>{let e;if(ia.env[m$])e=ia.env[m$];else if(ia.env[y$])e=ia.env[y$];else e=ype;return{accessToken:await g$.readFile(e,"utf8")}};E$.k8sCallback=gpe});var k3=g(function(S$){Object.defineProperty(S$,"__esModule",{value:!0});S$.TokenCache=void 0;var w$=J();class l0 extends w$.MongoDriverError{}class O${get hasAccessToken(){return!!this.accessToken}get hasRefreshToken(){return!!this.refreshToken}get hasIdpInfo(){return!!this.idpInfo}getAccessToken(){if(!this.accessToken)throw new l0("Attempted to get an access token when none exists.");return this.accessToken}getRefreshToken(){if(!this.refreshToken)throw new l0("Attempted to get a refresh token when none exists.");return this.refreshToken}getIdpInfo(){if(!this.idpInfo)throw new l0("Attempted to get IDP information when none exists.");return this.idpInfo}put(e,t){if(this.accessToken=e.accessToken,this.refreshToken=e.refreshToken,this.expiresInSeconds=e.expiresInSeconds,t)this.idpInfo=t}removeAccessToken(){this.accessToken=void 0}removeRefreshToken(){this.refreshToken=void 0}}S$.TokenCache=O$});var P$=g(function(M$){Object.defineProperty(M$,"__esModule",{value:!0});M$.tokenMachineCallback=void 0;var b$=L("fs"),D$=L("process"),T$=J(),Epe="OIDC_TOKEN_FILE must be set in the environment.",_pe=async()=>{let e=D$.env.OIDC_TOKEN_FILE;if(!e)throw new T$.MongoAWSError(Epe);return{accessToken:await b$.promises.readFile(e,"utf8")}};M$.tokenMachineCallback=_pe});var u0=g(function(k$){Object.defineProperty(k$,"__esModule",{value:!0});k$.MongoDBOIDC=k$.OIDC_WORKFLOWS=k$.OIDC_VERSION=void 0;var h0=J(),B$=ju(),oa=v3(),N$=l$(),I$=p$(),$$=A$(),ua=k3(),R$=P$(),Ape="AuthContext must provide credentials.";k$.OIDC_VERSION=1;k$.OIDC_WORKFLOWS=new Map;k$.OIDC_WORKFLOWS.set("test",()=>new oa.AutomatedCallbackWorkflow(new ua.TokenCache,R$.tokenMachineCallback));k$.OIDC_WORKFLOWS.set("azure",()=>new oa.AutomatedCallbackWorkflow(new ua.TokenCache,N$.azureCallback));k$.OIDC_WORKFLOWS.set("gcp",()=>new oa.AutomatedCallbackWorkflow(new ua.TokenCache,I$.gcpCallback));k$.OIDC_WORKFLOWS.set("k8s",()=>new oa.AutomatedCallbackWorkflow(new ua.TokenCache,$$.k8sCallback));class v$ extends B$.AuthProvider{constructor(e){super();if(!e)throw new h0.MongoInvalidArgumentError("No workflow provided to the OIDC auth provider.");this.workflow=e}async auth(e){let{connection:t,reauthenticating:r,response:n}=e;if(n?.speculativeAuthenticate?.done&&!r)return;let s=F$(e);if(r)await this.workflow.reauthenticate(t,s);else await this.workflow.execute(t,s,n)}async prepare(e,t){let{connection:r}=t,n=F$(t),s=await this.workflow.speculativeAuth(r,n);return{...e,...s}}}k$.MongoDBOIDC=v$;function F$(e){let{credentials:t}=e;if(!t)throw new h0.MongoMissingCredentialsError(Ape);return t}});var W$=g(function(V$){Object.defineProperty(V$,"__esModule",{value:!0});V$.HumanCallbackWorkflow=void 0;var j$=Se(),wo=J(),f0=Gn(),L$=u0(),Jl=R3();class U$ extends Jl.CallbackWorkflow{constructor(e,t){super(e,t)}async execute(e,t){if(this.cache.hasAccessToken){let o=this.cache.getAccessToken();e.accessToken=o;try{return await this.finishAuthentication(e,t,o)}catch(u){if(u instanceof wo.MongoError&&u.code===wo.MONGODB_ERROR_CODES.AuthenticationFailed)return this.cache.removeAccessToken(),delete e.accessToken,await this.execute(e,t);else throw u}}if(this.cache.hasRefreshToken){let o=this.cache.getRefreshToken(),u=await this.fetchAccessToken(this.cache.getIdpInfo(),t,o);this.cache.put(u),e.accessToken=u.accessToken;try{return await this.finishAuthentication(e,t,u.accessToken)}catch(a){if(a instanceof wo.MongoError&&a.code===wo.MONGODB_ERROR_CODES.AuthenticationFailed)return this.cache.removeRefreshToken(),delete e.accessToken,await this.execute(e,t);else throw a}}let r=await this.startAuthentication(e,t),n=r.conversationId,s=j$.BSON.deserialize(r.payload.buffer),i=await this.fetchAccessToken(s,t);return this.cache.put(i,s),e.accessToken=i.accessToken,await this.finishAuthentication(e,t,i.accessToken,n)}async fetchAccessToken(e,t,r){let n=new AbortController,s={timeoutContext:n.signal,version:L$.OIDC_VERSION,idpInfo:e};if(t.username)s.username=t.username;if(r)s.refreshToken=r;let i=f0.Timeout.expires(Jl.HUMAN_TIMEOUT_MS);try{return await Promise.race([this.executeAndValidateCallback(s),i])}catch(o){if(f0.TimeoutError.is(o))throw n.abort(),new wo.MongoOIDCError(`OIDC callback timed out after ${Jl.HUMAN_TIMEOUT_MS}ms.`);throw o}finally{i.clear()}}}V$.HumanCallbackWorkflow=U$});var X$=g(function(Q$){Object.defineProperty(Q$,"__esModule",{value:!0});Q$.Plain=void 0;var d0=Se(),K$=J(),H$=ae(),G$=ju();class Y$ extends G$.AuthProvider{async auth(e){let{connection:t,credentials:r}=e;if(!r)throw new K$.MongoMissingCredentialsError("AuthContext must provide credentials.");let{username:n,password:s}=r,o={saslStart:1,mechanism:"PLAIN",payload:new d0.Binary(d0.ByteUtils.fromUTF8(`\x00${n}\x00${s}`)),autoAuthorize:1};await t.command(H$.ns("$external.$cmd"),o,void 0)}}Q$.Plain=Y$});var rR=g(function(d5e,tR){var Z$=(e)=>e.codePointAt(0),Ope=(e)=>e[0],Spe=(e)=>e[e.length-1];function eR(e){let t=[],r=e.length;for(let n=0;n<r;n+=1){let s=e.charCodeAt(n);if(s>=55296&&s<=56319&&r>n+1){let i=e.charCodeAt(n+1);if(i>=56320&&i<=57343){t.push((s-55296)*1024+i-56320+65536),n+=1;continue}}t.push(s)}return t}function rf({unassigned_code_points:e,commonly_mapped_to_nothing:t,non_ASCII_space_characters:r,prohibited_characters:n,bidirectional_r_al:s,bidirectional_l:i},o,u={}){let a=r,c=t;if(typeof o!=="string")throw TypeError("Expected string.");if(o.length===0)return"";let l=eR(o).map((_)=>a.get(_)?32:_).filter((_)=>!c.get(_)),f=String.fromCodePoint.apply(null,l).normalize("NFKC"),h=eR(f);if(h.some((_)=>n.get(_)))throw Error("Prohibited character, see https://tools.ietf.org/html/rfc4013#section-2.3");if(u.allowUnassigned!==!0){if(h.some((w)=>e.get(w)))throw Error("Unassigned code point, see https://tools.ietf.org/html/rfc4013#section-2.5")}let p=h.some((_)=>s.get(_)),m=h.some((_)=>i.get(_));if(p&&m)throw Error("String must not contain RandALCat and LCat at the same time, see https://tools.ietf.org/html/rfc3454#section-6");let E=s.get(Z$(Ope(f))),y=s.get(Z$(Spe(f)));if(p&&!(E&&y))throw Error("Bidirectional RandALCat character must be the first and the last character of the string, see https://tools.ietf.org/html/rfc3454#section-6");return f}rf.saslprep=rf;rf.default=rf;tR.exports=rf});var iR=g(function(p5e,sR){sR.exports=Yo;function Yo(e,t){if(!(this instanceof Yo))return new Yo(e,t);this.length=0,this.updates=[],this.path=new Uint16Array(4),this.pages=Array(32768),this.maxPages=this.pages.length,this.level=0,this.pageSize=e||1024,this.deduplicate=t?t.deduplicate:null,this.zeros=this.deduplicate?p0(this.deduplicate.length):null}Yo.prototype.updated=function(e){while(this.deduplicate&&e.buffer[e.deduplicate]===this.deduplicate[e.deduplicate])if(e.deduplicate++,e.deduplicate===this.deduplicate.length){if(e.deduplicate=0,e.buffer.equals&&e.buffer.equals(this.deduplicate))e.buffer=this.deduplicate;break}if(e.updated||!this.updates)return;e.updated=!0,this.updates.push(e)};Yo.prototype.lastUpdate=function(){if(!this.updates||!this.updates.length)return null;var e=this.updates.pop();return e.updated=!1,e};Yo.prototype._array=function(e,t){if(e>=this.maxPages){if(t)return;Cpe(this,e)}Tpe(e,this.path);var r=this.pages;for(var n=this.level;n>0;n--){var s=this.path[n],i=r[s];if(!i){if(t)return;i=r[s]=Array(32768)}r=i}return r};Yo.prototype.get=function(e,t){var r=this._array(e,t),n=this.path[0],s=r&&r[n];if(!s&&!t){if(s=r[n]=new nR(e,p0(this.pageSize)),e>=this.length)this.length=e+1}if(s&&s.buffer===this.deduplicate&&this.deduplicate&&!t)s.buffer=Dpe(s.buffer),s.deduplicate=0;return s};Yo.prototype.set=function(e,t){var r=this._array(e,!1),n=this.path[0];if(e>=this.length)this.length=e+1;if(!t||this.zeros&&t.equals&&t.equals(this.zeros)){r[n]=void 0;return}if(this.deduplicate&&t.equals&&t.equals(this.deduplicate))t=this.deduplicate;var s=r[n],i=bpe(t,this.pageSize);if(s)s.buffer=i;else r[n]=new nR(e,i)};Yo.prototype.toBuffer=function(){var e=Array(this.length),t=p0(this.pageSize),r=0;while(r<e.length){var n=this._array(r,!0);for(var s=0;s<32768&&r<e.length;s++)e[r++]=n&&n[s]?n[s].buffer:t}return Buffer.concat(e)};function Cpe(e,t){while(e.maxPages<t){var r=e.pages;e.pages=Array(32768),e.pages[0]=r,e.level++,e.maxPages*=32768}}function bpe(e,t){if(e.length===t)return e;if(e.length>t)return e.slice(0,t);var r=p0(t);return e.copy(r),r}function p0(e){if(Buffer.alloc)return Buffer.alloc(e);var t=new Buffer(e);return t.fill(0),t}function Dpe(e){var t=Buffer.allocUnsafe?Buffer.allocUnsafe(e.length):new Buffer(e.length);return e.copy(t),t}function nR(e,t){this.offset=e*t.length,this.buffer=t,this.updated=!1,this.deduplicate=0}function Tpe(e,t){e=(e-(t[0]=e&32767))/32768,e=(e-(t[1]=e&32767))/32768,t[3]=(e-(t[2]=e&32767))/32768&32767}});var uR=g(function(m5e,oR){var Mpe=iR();oR.exports=aa;function aa(e){if(!(this instanceof aa))return new aa(e);if(!e)e={};if(Buffer.isBuffer(e))e={buffer:e};if(this.pageOffset=e.pageOffset||0,this.pageSize=e.pageSize||1024,this.pages=e.pages||Mpe(this.pageSize),this.byteLength=this.pages.length*this.pageSize,this.length=8*this.byteLength,!Ppe(this.pageSize))throw Error("The page size should be a power of two");if(this._trackUpdates=!!e.trackUpdates,this._pageMask=this.pageSize-1,e.buffer){for(var t=0;t<e.buffer.length;t+=this.pageSize)this.pages.set(t/this.pageSize,e.buffer.slice(t,t+this.pageSize));this.byteLength=e.buffer.length,this.length=8*this.byteLength}}aa.prototype.get=function(e){var t=e&7,r=(e-t)/8;return!!(this.getByte(r)&128>>t)};aa.prototype.getByte=function(e){var t=e&this._pageMask,r=(e-t)/this.pageSize,n=this.pages.get(r,!0);return n?n.buffer[t+this.pageOffset]:0};aa.prototype.set=function(e,t){var r=e&7,n=(e-r)/8,s=this.getByte(n);return this.setByte(n,t?s|128>>r:s&(255^128>>r))};aa.prototype.toBuffer=function(){var e=xpe(this.pages.length*this.pageSize);for(var t=0;t<this.pages.length;t++){var r=this.pages.get(t,!0),n=t*this.pageSize;if(r)r.buffer.copy(e,n,this.pageOffset,this.pageOffset+this.pageSize)}return e};aa.prototype.setByte=function(e,t){var r=e&this._pageMask,n=(e-r)/this.pageSize,s=this.pages.get(n,!1);if(r+=this.pageOffset,s.buffer[r]===t)return!1;if(s.buffer[r]=t,e>=this.byteLength)this.byteLength=e+1,this.length=this.byteLength*8;if(this._trackUpdates)this.pages.updated(s);return!0};function xpe(e){if(Buffer.alloc)return Buffer.alloc(e);var t=new Buffer(e);return t.fill(0),t}function Ppe(e){return!(e&e-1)}});var aR=g(function(nf){var Fpe=nf&&nf.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(nf,"__esModule",{value:!0});nf.createMemoryCodePoints=Npe;var Bpe=Fpe(uR());function Npe(e){let t=0;function r(){let c=e.readUInt32BE(t);t+=4;let l=e.slice(t,t+c);return t+=c,(0,Bpe.default)({buffer:l})}let n=r(),s=r(),i=r(),o=r(),u=r(),a=r();return{unassigned_code_points:n,commonly_mapped_to_nothing:s,non_ASCII_space_characters:i,prohibited_characters:o,bidirectional_r_al:u,bidirectional_l:a}}});var hR=g(function(lR){Object.defineProperty(lR,"__esModule",{value:!0});var cR=L("zlib");lR.default=cR.gunzipSync(Buffer.from("H4sIAAAAAAACA+3dTYgcaRkA4LemO9Mhxm0FITnE9Cwr4jHgwgZ22B6YywqCJ0HQg5CL4sGTuOjCtGSF4CkHEW856MlTQHD3EJnWkU0Owh5VxE3LHlYQdNxd2U6mU59UV/d09fw4M2EySSXPAzNdP1/9fX/99bzVNZEN4jisRDulVFnQmLxm1aXF9Id/2/xMxNJ4XZlg576yuYlGt9gupV6xoFf8jhu9YvulVrFlp5XSx+lfvYhORGPXvqIRWSxERKtIm8bKFd10WNfKDS5Fo9jJWrq2+M2IlW+8uHgl/+BsROfPF4v5L7148Ur68Sha6dqZpYiVVy8tvLCWXo80Sf/lS89dGX2wHGvpzoXVn75/YWH5wmqe8uika82ViJXTy83Ve2k5Urozm38wm4/ls6t5uT6yfsTSJ7J3T0VKt8c5ExEXI8aFkH729c3eT+7EC6ca8cVULZUiYacX0R5PNWNxlh9L1y90q5kyzrpyy+9WcvOV6URntqw7La9sNVstXyczWVaWYbaaTYqzOHpr7pyiNT3/YzKuT63Z/FqKZlFTiuXtFM2vVOtIq7jiyKJbWZaOWD0euz0yoV2Z7kY0xq2x0YhfzVpmM5px9nTEH7JZ0ot5u39p0ma75Z472/s/H+2yr2inYyuq7fMvJivH2rM72N/Z3lyL31F2b1ya1P0zn816k2KP6JU9UzseucdQH5YqVeH/lFajSN2udg+TLJ9rksNxlvV2lki19rXKI43TPLejFu4ov7k3nMbhyhfY3Xb37f8BAGCf0eMTOH5szf154KmnNgKcnLb+Fzi2AfXktbN7fJelwTAiO/W5uQ2KINXRYu+znqo/WTAdLadURHmy3qciazd3bra4T3w16/f7t7Ms9U5gfJu10955sx1r3vmhBAAAAAAAgId20J1iZbDowNvIjuH427Gr5l/eiC+8OplZON8sVjx/qr9y+Pj+YRItT+NqAM+kkZs3AAAAAID6yfx1FwCAI97/dCh1/ub6SA0AAAAAAAAAgNoT/wcAAAAAAACA+hP/BwAAAAAAAID6E/8HAAAAAAAAgPoT/wcAAAAAAACA+hP/BwAAAAAAAID6E/8HAAAAAAAAgPoT/wcAAAAAAACA+hP/BwAAAAAAAID6E/8HAAAAAAAAgPoT/wcAAAAAAACA+hutp5SiQpYAAAAAAAAAQO2MIpZiT804flnAE2fhwjOeAZXr76kOAAAAAAAA8FjNf4N/l0NE3U/vuVQskLpSd4/Yh2xu9xTu0tFeeNYsLI2f/VMdNxTzj6Je9E/+6pp6Nn3awW3A54goe4Bss6v+PGsjQGMAAAAAAOBp5XEgwH6e7J7rwEQHRb/XvAMAAAAAAAA8yzoDeQDwVGjIAgAAAAAAAACoPfF/AAAAAAAAAKg/8X8AAAAAAAAAqD/xfwAAAAAAAACoP/F/AAAAAAAAAKg/8X8AAAAAAAAAqD/xfwAAAAAAAACoP/F/AAAAAAAAAKg/8X8AAAAAAAAAqD/xfwAAAAAAAACoP/F/AAAAAAAAAKg/8X8AAAAAAAAAqL/GSkSkClkCAAAAAAAAALXTSAAAAAAAAABA3Y1kAQAAAAAAAADUX8RSXZ9dsHC9+M8Fg2Ex/em1lAZpEBGttcrVjZqLEa+k0XpKw9mG4zWx4ukPUMhkAQAAAAAAABzBqbSe3//rXOS9HxGdo4TqR2XkutCdBu+LaPZw/lBbO7cbHnh2C7N7AIo4evEznllqLqWUp/LnYOtpM2bnOH66wI1+9GO4sOuISwv/TOlumu56FDv3NZhc4mR9v7zYIrafr40j/Cccvj9Xns3t3mu99E7qxUv3bqS0/ouNH/08++RGemfQ+nsx/5uNXsQPGulynPvv3ZTW37zd+1ovrqaYpP/122X6Xpx779Z3zr/3YOPKW1lkaRDf31pPaf3j/msRsVGkL+d/f+/m4sJsPm1cfSsr16e8m9Ldj/KsnyIuR3nXw83Is3EhxLd/2V773ks3m/cj/THKUummdP9qKhIOImuOU0Xjwb3y+oqt735rpTetVbF9n8R4x9crRfO77TKqVOZpDclv5bfK18lMnk+q0K18UpxF/RrGXE0Zxtqx3tWSj+vxbL4XaasfKb0dRbtLW73JsfPGg177H+OmGKlfvS1msllt7JEJm9XOJqXR+Fkfo1H66uy5H1v3Xx5+uJmGLw9jro2u7Loj4PnuR6+f+e3d261+eazNhzrL7X83MohoHpS4PddV8ki1it61//pw1g7z6p1U/26Nm2llST57B5rUvuG0XqSU/rPd7jYrqWcbd+beJQ77BgPMDwn37/8BAGCf0eMTOH4cPlufv9VGgJOzqf8Fjm1APXkd7B7f5dF57GPMaWy/MTvjvNvtXj6h8W2+GXvnzXaseeeHEgAAAAAAAB7aQXeKlcGiadBoEOeLb2dtpGOL2MyOtf391a3P/zD96c3JzIP3t4oV797vrh8+vn+YRL5bBuj/AQAAAABqJvfHXQAAHkX82zfXAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACeAgkAAAAAAAAAqLuRLAAAAAAAAACA2hv9D1iu/VAYaAYA","base64"))});var mR=g(function(q3,pR){var fR=q3&&q3.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},$pe=fR(rR()),dR=aR(),Rpe=fR(hR()),vpe=dR.createMemoryCodePoints(Rpe.default);function sf(e,t){return(0,$pe.default)(vpe,e,t)}sf.saslprep=sf;sf.default=sf;pR.exports=sf});var TR=g(function(bR){Object.defineProperty(bR,"__esModule",{value:!0});bR.ScramSHA256=bR.ScramSHA1=void 0;var gR=mR(),Be=Se(),Xt=J(),ca=ae(),ER=ju(),g0=co();class L3 extends ER.AuthProvider{constructor(e){super();this.cryptoMethod=e||"sha1"}async prepare(e,t){let r=this.cryptoMethod,n=t.credentials;if(!n)throw new Xt.MongoMissingCredentialsError("AuthContext must provide credentials.");let s=await ca.randomBytes(24);return t.nonce=s,{...e,speculativeAuthenticate:{...wR(r,n,s),db:n.source}}}async auth(e){let{reauthenticating:t,response:r}=e;if(r?.speculativeAuthenticate&&!t)return await OR(this.cryptoMethod,r.speculativeAuthenticate,e);return await kpe(this.cryptoMethod,e)}}function _R(e){return e.replace("=","=3D").replace(",","=2C")}function AR(e,t){return Be.ByteUtils.concat([Be.ByteUtils.fromUTF8("n="),Be.ByteUtils.fromUTF8(e),Be.ByteUtils.fromUTF8(",r="),Be.ByteUtils.fromUTF8(Be.ByteUtils.toBase64(t))])}function wR(e,t,r){let n=_R(t.username);return{saslStart:1,mechanism:e==="sha1"?g0.AuthMechanism.MONGODB_SCRAM_SHA1:g0.AuthMechanism.MONGODB_SCRAM_SHA256,payload:new Be.Binary(Be.ByteUtils.concat([Be.ByteUtils.fromUTF8("n,,"),AR(n,r)])),autoAuthorize:1,options:{skipEmptyExchange:!0}}}async function kpe(e,t){let{connection:r,credentials:n}=t;if(!n)throw new Xt.MongoMissingCredentialsError("AuthContext must provide credentials.");if(!t.nonce)throw new Xt.MongoInvalidArgumentError("AuthContext must contain a valid nonce property");let s=t.nonce,i=n.source,o=wR(e,n,s),u=await r.command(ca.ns(`${i}.$cmd`),o,void 0);await OR(e,u,t)}async function OR(e,t,r){let{connection:n,credentials:s}=r;if(!s)throw new Xt.MongoMissingCredentialsError("AuthContext must provide credentials.");if(!r.nonce)throw new Xt.MongoInvalidArgumentError("Unable to continue SCRAM without valid nonce");let i=r.nonce,o=s.source,u=_R(s.username),a=s.password,c=e==="sha256"?gR.saslprep(a):qpe(u,a),l=Be.ByteUtils.isUint8Array(t.payload)?new Be.Binary(t.payload):t.payload,f=yR(l),h=parseInt(f.i,10);if(h&&h<4096)throw new Xt.MongoRuntimeError(`Server returned an invalid iteration count ${h}`);let{s:d,r:p}=f;if(p.startsWith("nonce"))throw new Xt.MongoRuntimeError(`Server returned an invalid nonce: ${p}`);let m=`c=biws,r=${p}`,E=await zpe(c,Be.ByteUtils.fromBase64(d),h,e),y=await m0(e,E,"Client Key"),_=await m0(e,E,"Server Key"),w=await Lpe(e,y),C=AR(u,i),A=Be.ByteUtils.toUTF8(C,0,C.length,!1),M=Be.ByteUtils.toUTF8(l.buffer,0,l.position,!1),O=[A,M,m].join(","),x=await m0(e,w,O),v=`p=${jpe(y,x)}`,P=[m,v].join(","),ge=await m0(e,_,O),Me={saslContinue:1,conversationId:t.conversationId,payload:new Be.Binary(Be.ByteUtils.fromUTF8(P))},oe=await n.command(ca.ns(`${o}.$cmd`),Me,void 0),Yt=yR(oe.payload);if(!Wpe(Be.ByteUtils.fromBase64(Yt.v),ge))throw new Xt.MongoRuntimeError("Server returned an invalid signature");if(oe.done!==!1)return;let H={saslContinue:1,conversationId:oe.conversationId,payload:Be.ByteUtils.allocate(0)};await n.command(ca.ns(`${o}.$cmd`),H,void 0)}function yR(e){let t=Be.ByteUtils.toUTF8(e.buffer,0,e.position,!1),r={},n=t.split(",");for(let s=0;s<n.length;s++){let i=(n[s].match(/^([^=]*)=(.*)$/)??[]).slice(1);r[i[0]]=i[1]}return r}function qpe(e,t){if(typeof e!=="string")throw new Xt.MongoInvalidArgumentError("Username must be a string");if(typeof t!=="string")throw new Xt.MongoInvalidArgumentError("Password must be a string");if(t.length===0)throw new Xt.MongoInvalidArgumentError("Password cannot be empty");let r;try{r=L("crypto")}catch(n){throw new Xt.MongoRuntimeError("Node.js crypto module is required for SCRAM-SHA-1 authentication",{cause:n})}try{let n=r.createHash("md5");return n.update(`${e}:mongo:${t}`,"utf8"),n.digest("hex")}catch(n){if(r.getFips())throw Error("Auth mechanism SCRAM-SHA-1 is not supported in FIPS mode");throw n}}function jpe(e,t){let r=Math.max(e.length,t.length),n=[];for(let s=0;s<r;s+=1)n.push(e[s]^t[s]);return Be.ByteUtils.toBase64(Be.ByteUtils.fromNumberArray(n))}async function Lpe(e,t){let r=await crypto.subtle.digest(e==="sha256"?"SHA-256":"SHA-1",t);return new Uint8Array(r)}async function m0(e,t,r){let n=Be.ByteUtils.toLocalBufferType(t),s=await crypto.subtle.importKey("raw",n,{name:"HMAC",hash:{name:e==="sha256"?"SHA-256":"SHA-1"}},!1,["sign","verify"]),i=typeof r==="string"?new TextEncoder().encode(r):r,o=Be.ByteUtils.toLocalBufferType(i),u=await crypto.subtle.sign("HMAC",s,o);return new Uint8Array(u)}var y0={},j3=0;function Upe(){y0={},j3=0}var Vpe={sha256:32,sha1:20};async function zpe(e,t,r,n){let s=[e,Be.ByteUtils.toBase64(t),r].join("_");if(y0[s]!=null)return y0[s];let i=await crypto.subtle.importKey("raw",new TextEncoder().encode(e),{name:"PBKDF2"},!1,["deriveBits"]),o={name:"PBKDF2",salt:t,iterations:r,hash:{name:n==="sha256"?"SHA-256":"SHA-1"}},u=await crypto.subtle.deriveBits(o,i,Vpe[n]*8),a=new Uint8Array(u);if(j3>=200)Upe();return y0[s]=a,j3+=1,a}function Wpe(e,t){if(e.length!==t.length)return!1;let r=0;for(let n=0;n<e.length;n++)r|=e[n]^t[n];return r===0}class SR extends L3{constructor(){super("sha1")}}bR.ScramSHA1=SR;class CR extends L3{constructor(){super("sha256")}}bR.ScramSHA256=CR});var IR=g(function(BR){Object.defineProperty(BR,"__esModule",{value:!0});BR.X509=void 0;var E0=J(),xR=ae(),PR=ju();class FR extends PR.AuthProvider{async prepare(e,t){let{credentials:r}=t;if(!r)throw new E0.MongoMissingCredentialsError("AuthContext must provide credentials.");return{...e,speculativeAuthenticate:MR(r)}}async auth(e){let{connection:t,credentials:r}=e;if(!r)throw new E0.MongoMissingCredentialsError("AuthContext must provide credentials.");if(e.response?.speculativeAuthenticate)return;await t.command(xR.ns("$external.$cmd"),MR(r),void 0)}}BR.X509=FR;function MR(e){let t={authenticate:1,mechanism:"MONGODB-X509"};if(e.username)t.user=e.username;return t}});var U3=g(function(UR){Object.defineProperty(UR,"__esModule",{value:!0});UR.MongoClientAuthProviders=void 0;var $R=nm(),RR=YI(),w0=u0(),vR=v3(),kR=W$(),_0=k3(),qR=X$(),gs=co(),A0=TR(),jR=IR(),O0=J(),Hpe=new Map([[gs.AuthMechanism.MONGODB_AWS,({AWS_CREDENTIAL_PROVIDER:e})=>new RR.MongoDBAWS(e)],[gs.AuthMechanism.MONGODB_GSSAPI,()=>new $R.GSSAPI],[gs.AuthMechanism.MONGODB_OIDC,(e)=>new w0.MongoDBOIDC(Gpe(e))],[gs.AuthMechanism.MONGODB_PLAIN,()=>new qR.Plain],[gs.AuthMechanism.MONGODB_SCRAM_SHA1,()=>new A0.ScramSHA1],[gs.AuthMechanism.MONGODB_SCRAM_SHA256,()=>new A0.ScramSHA256],[gs.AuthMechanism.MONGODB_X509,()=>new jR.X509]]);class LR{constructor(){this.existingProviders=new Map}getOrCreateProvider(e,t){let r=this.existingProviders.get(e);if(r)return r;let n=Hpe.get(e);if(!n)throw new O0.MongoInvalidArgumentError(`authMechanism ${e} not supported`);let s=n(t);return this.existingProviders.set(e,s),s}}UR.MongoClientAuthProviders=LR;function Gpe(e){if(e.OIDC_HUMAN_CALLBACK)return new kR.HumanCallbackWorkflow(new _0.TokenCache,e.OIDC_HUMAN_CALLBACK);else if(e.OIDC_CALLBACK)return new vR.AutomatedCallbackWorkflow(new _0.TokenCache,e.OIDC_CALLBACK);else{let t=e.ENVIRONMENT,r=w0.OIDC_WORKFLOWS.get(t)?.();if(!r)throw new O0.MongoInvalidArgumentError(`Could not load workflow for environment ${e.ENVIRONMENT}`);return r}}});var z3=g(function(HR){Object.defineProperty(HR,"__esModule",{value:!0});HR.ClientBulkWriteOperation=void 0;var zR=dt(),WR=ae(),KR=nr(),Es=Mt();class V3 extends KR.CommandOperation{get commandName(){return"bulkWrite"}constructor(e,t){super(void 0,t);this.SERVER_COMMAND_RESPONSE_TYPE=zR.ClientBulkWriteCursorResponse,this.commandBuilder=e,this.options=t,this.ns=new WR.MongoDBNamespace("admin","$cmd")}resetBatch(){return this.commandBuilder.resetBatch()}get canRetryWrite(){return this.commandBuilder.isBatchRetryable}handleOk(e){return e}buildCommandDocument(e,t){let r=this.commandBuilder.buildBatch(e.description.maxMessageSizeBytes,e.description.maxWriteBatchSize,e.description.maxBsonObjectSize);if(!this.canRetryWrite)this.options.willRetryWrite=!1;return r}}HR.ClientBulkWriteOperation=V3;Es.defineAspects(V3,[Es.Aspect.WRITE_OPERATION,Es.Aspect.SKIP_COLLATION,Es.Aspect.CURSOR_CREATING,Es.Aspect.RETRYABLE,Es.Aspect.COMMAND_BATCHING,Es.Aspect.SUPPORTS_RAW_DATA])});var ev=g(function(XR){Object.defineProperty(XR,"__esModule",{value:!0});XR.ClientBulkWriteCursor=void 0;var YR=z3(),QR=Hr(),S0=ae(),JR=ps();class W3 extends JR.AbstractCursor{constructor(e,t,r={}){super(e,new S0.MongoDBNamespace("admin","$cmd"),r);this.commandBuilder=t,this.clientBulkWriteOptions=r}get response(){if(this.cursorResponse)return this.cursorResponse;return null}get operations(){return this.commandBuilder.lastOperations}clone(){let e=S0.mergeOptions({},this.clientBulkWriteOptions);return delete e.session,new W3(this.client,this.commandBuilder,{...e})}async _initialize(e){let t=new YR.ClientBulkWriteOperation(this.commandBuilder,{...this.clientBulkWriteOptions,...this.cursorOptions,session:e}),r=await QR.executeOperation(this.client,t,this.timeoutContext);return this.cursorResponse=r,{server:t.server,session:e,response:r}}}XR.ClientBulkWriteCursor=W3});var hv=g(function(iv){Object.defineProperty(iv,"__esModule",{value:!0});iv.buildReplaceOneOperation=iv.buildUpdateManyOperation=iv.buildUpdateOneOperation=iv.buildDeleteManyOperation=iv.buildDeleteOneOperation=iv.buildInsertOneOperation=iv.ClientBulkWriteCommandBuilder=void 0;iv.buildOperation=H3;var Xl=Se(),C0=Au(),Oo=J(),b0=Vc(),Zl=ae(),tv=1000;class rv{constructor(e,t,r){this.models=e,this.options=t,this.pkFactory=r??Zl.DEFAULT_PK_FACTORY,this.currentModelIndex=0,this.previousModelIndex=0,this.lastOperations=[],this.isBatchRetryable=!0}get errorsOnly(){if("verboseResults"in this.options)return!this.options.verboseResults;return!0}hasNextBatch(){return this.currentModelIndex<this.models.length}resetBatch(){return this.currentModelIndex=this.previousModelIndex,!0}buildBatch(e,t,r){this.isBatchRetryable=!0;let n=0,s=0,i=this.baseCommand(),o=new Map;this.previousModelIndex=this.currentModelIndex;while(this.currentModelIndex<this.models.length){let u=this.models[this.currentModelIndex],a=u.namespace,c=o.get(a);if(u.name==="deleteMany"||u.name==="updateMany")this.isBatchRetryable=!1;if(c!=null){let l=H3(u,c,this.pkFactory,this.options),f;try{f=Xl.BSON.serialize(l)}catch(h){throw new Oo.MongoInvalidArgumentError("Could not serialize operation to BSON",{cause:h})}if(K3("ops",f,r),n+f.length<e&&i.ops.documents.length<t)n=tv+i.ops.push(l,f),this.currentModelIndex++;else break}else{o.set(a,s);let l={ns:a},f=H3(u,s,this.pkFactory,this.options),h,d;try{h=Xl.BSON.serialize(l),d=Xl.BSON.serialize(f)}catch(p){throw new Oo.MongoInvalidArgumentError("Could not serialize ns info to BSON",{cause:p})}if(K3("nsInfo",h,r),K3("ops",d,r),n+h.length+d.length<e&&i.ops.documents.length<t)n=tv+i.nsInfo.push(l,h)+i.ops.push(f,d),s++,this.currentModelIndex++;else break}}return this.lastOperations=i.ops.documents,i}baseCommand(){let e={bulkWrite:1,errorsOnly:this.errorsOnly,ordered:this.options.ordered??!0,ops:new C0.DocumentSequence("ops"),nsInfo:new C0.DocumentSequence("nsInfo")};if(this.options.bypassDocumentValidation!=null)e.bypassDocumentValidation=this.options.bypassDocumentValidation;if(this.options.let)e.let=this.options.let;if(this.options.comment!==void 0)e.comment=this.options.comment;return e}}iv.ClientBulkWriteCommandBuilder=rv;function K3(e,t,r){if(t.length>r)throw new Oo.MongoInvalidArgumentError(`Client bulk write operation ${e} of length ${t.length} exceeds the max bson object size of ${r}`)}var Ype=(e,t,r)=>{let n={insert:t,document:e.document};return n.document._id=e.document._id??r.createPk(),n};iv.buildInsertOneOperation=Ype;var Qpe=(e,t)=>nv(e,t,!1);iv.buildDeleteOneOperation=Qpe;var Jpe=(e,t)=>nv(e,t,!0);iv.buildDeleteManyOperation=Jpe;function nv(e,t,r){let n={delete:t,multi:r,filter:e.filter};if(e.hint)n.hint=e.hint;if(e.collation)n.collation=e.collation;return n}var Xpe=(e,t,r)=>sv(e,t,!1,r);iv.buildUpdateOneOperation=Xpe;var Zpe=(e,t,r)=>sv(e,t,!0,r);iv.buildUpdateManyOperation=Zpe;function eme(e,t){if(!Zl.hasAtomicOperators(e,t))throw new Oo.MongoAPIError("Client bulk write update models must only contain atomic modifiers (start with $) and must not be empty.")}function sv(e,t,r,n){eme(e.update,n);let s={update:t,multi:r,filter:e.filter,updateMods:e.update};if(e.hint)s.hint=e.hint;if(e.upsert)s.upsert=e.upsert;if(e.arrayFilters)s.arrayFilters=e.arrayFilters;if(e.collation)s.collation=e.collation;if(!r&&"sort"in e&&e.sort!=null)s.sort=b0.formatSort(e.sort);return s}var tme=(e,t)=>{if(Zl.hasAtomicOperators(e.replacement))throw new Oo.MongoAPIError("Client bulk write replace models must not contain atomic modifiers (start with $) and must not be empty.");let r={update:t,multi:!1,filter:e.filter,updateMods:e.replacement};if(e.hint)r.hint=e.hint;if(e.upsert)r.upsert=e.upsert;if(e.collation)r.collation=e.collation;if(e.sort!=null)r.sort=b0.formatSort(e.sort);return r};iv.buildReplaceOneOperation=tme;function H3(e,t,r,n){switch(e.name){case"insertOne":return iv.buildInsertOneOperation(e,t,r);case"deleteOne":return iv.buildDeleteOneOperation(e,t);case"deleteMany":return iv.buildDeleteManyOperation(e,t);case"updateOne":return iv.buildUpdateOneOperation(e,t,n);case"updateMany":return iv.buildUpdateManyOperation(e,t,n);case"replaceOne":return iv.buildReplaceOneOperation(e,t)}}});var gv=g(function(mv){Object.defineProperty(mv,"__esModule",{value:!0});mv.ClientBulkWriteResultsMerger=void 0;var fv=qu(),dv=J(),sme={acknowledged:!1,insertedCount:0,upsertedCount:0,matchedCount:0,modifiedCount:0,deletedCount:0,insertResults:void 0,updateResults:void 0,deleteResults:void 0};class pv{static unacknowledged(){return sme}constructor(e){if(this.options=e,this.currentBatchOffset=0,this.writeConcernErrors=[],this.writeErrors=new Map,this.result={acknowledged:!0,insertedCount:0,upsertedCount:0,matchedCount:0,modifiedCount:0,deletedCount:0,insertResults:void 0,updateResults:void 0,deleteResults:void 0},e.verboseResults)this.result.insertResults=new Map,this.result.updateResults=new Map,this.result.deleteResults=new Map}get bulkWriteResult(){return{acknowledged:this.result.acknowledged,insertedCount:this.result.insertedCount,upsertedCount:this.result.upsertedCount,matchedCount:this.result.matchedCount,modifiedCount:this.result.modifiedCount,deletedCount:this.result.deletedCount,insertResults:this.result.insertResults,updateResults:this.result.updateResults,deleteResults:this.result.deleteResults}}async merge(e){let t;try{for await(let r of e)if(r.ok===1){if(this.options.verboseResults)this.processDocument(e,r)}else if(this.options.ordered){let n=new dv.MongoClientBulkWriteError({message:"Mongo client ordered bulk write encountered a write error."});throw n.writeErrors.set(r.idx+this.currentBatchOffset,{code:r.code,message:r.errmsg}),n.partialResult=this.result,n}else this.writeErrors.set(r.idx+this.currentBatchOffset,{code:r.code,message:r.errmsg})}catch(r){if(r instanceof fv.MongoWriteConcernError){let n=r.result;if(t={insertedCount:n.nInserted,upsertedCount:n.nUpserted,matchedCount:n.nMatched,modifiedCount:n.nModified,deletedCount:n.nDeleted,writeConcernError:n.writeConcernError},this.options.verboseResults&&n.cursor.firstBatch){for(let s of n.cursor.firstBatch)if(s.ok===1)this.processDocument(e,s)}}else throw r}finally{if(e.response){let r=e.response;this.incrementCounts(r)}this.currentBatchOffset+=e.operations.length}if(t){let r=t.writeConcernError;this.incrementCounts(t),this.writeConcernErrors.push({code:r.code,message:r.errmsg})}return this.result}processDocument(e,t){let r=e.operations[t.idx];if("insert"in r)this.result.insertResults?.set(t.idx+this.currentBatchOffset,{insertedId:r.document._id});if("update"in r){let n={matchedCount:t.n,modifiedCount:t.nModified??0,didUpsert:t.upserted!=null};if(t.upserted)n.upsertedId=t.upserted._id;this.result.updateResults?.set(t.idx+this.currentBatchOffset,n)}if("delete"in r)this.result.deleteResults?.set(t.idx+this.currentBatchOffset,{deletedCount:t.n})}incrementCounts(e){this.result.insertedCount+=e.insertedCount,this.result.upsertedCount+=e.upsertedCount,this.result.matchedCount+=e.matchedCount,this.result.modifiedCount+=e.modifiedCount,this.result.deletedCount+=e.deletedCount}}mv.ClientBulkWriteResultsMerger=pv});var Mv=g(function(Dv){Object.defineProperty(Dv,"__esModule",{value:!0});Dv.ClientBulkWriteExecutor=void 0;var D0=ps(),Ev=ev(),_s=J(),_v=Gn(),Av=ae(),wv=Hn(),Ov=Hr(),Sv=z3(),Cv=hv(),T0=gv();class bv{constructor(e,t,r){if(t.length===0)throw new _s.MongoClientBulkWriteExecutionError("No client bulk write models were provided.");if(this.client=e,this.operations=t,this.options={ordered:!0,bypassDocumentValidation:!1,verboseResults:!1,...r},!this.options.writeConcern)this.options.writeConcern=wv.WriteConcern.fromOptions(this.client.s.options);if(this.options.writeConcern?.w===0){if(this.options.verboseResults)throw new _s.MongoInvalidArgumentError("Cannot request unacknowledged write concern and verbose results");if(this.options.ordered)throw new _s.MongoInvalidArgumentError("Cannot request unacknowledged write concern and ordered writes")}}async execute(){let e=this.client.s.options.pkFactory,t=new Cv.ClientBulkWriteCommandBuilder(this.operations,this.options,e),r=Av.resolveTimeoutOptions(this.client,this.options),n=_v.TimeoutContext.create(r);if(this.options.writeConcern?.w===0){while(t.hasNextBatch()){let s=new Sv.ClientBulkWriteOperation(t,this.options);await Ov.executeOperation(this.client,s,n)}return T0.ClientBulkWriteResultsMerger.unacknowledged()}else{let s=new T0.ClientBulkWriteResultsMerger(this.options);while(t.hasNextBatch()){let i=new D0.CursorTimeoutContext(n,Symbol()),o={...this.options,timeoutContext:i,...r.timeoutMS!=null&&{timeoutMode:D0.CursorTimeoutMode.LIFETIME}},u=new Ev.ClientBulkWriteCursor(this.client,t,o);try{await s.merge(u)}catch(a){if(a instanceof _s.MongoServerError&&!(a instanceof _s.MongoClientBulkWriteError)){let c=new _s.MongoClientBulkWriteError({message:"Mongo client bulk write encountered an error during execution"});throw c.cause=a,c.partialResult=s.bulkWriteResult,c}else throw a}}if(s.writeConcernErrors.length>0||s.writeErrors.size>0){let i=new _s.MongoClientBulkWriteError({message:"Mongo client bulk write encountered errors during execution."});throw i.writeConcernErrors=s.writeConcernErrors,i.writeErrors=s.writeErrors,i.partialResult=s.bulkWriteResult,i}return s.bulkWriteResult}}}Dv.ClientBulkWriteExecutor=bv});var $v=g(function(Nv){Object.defineProperty(Nv,"__esModule",{value:!0});Nv.EndSessionsOperation=void 0;var xv=dt(),Pv=nr(),Fv=Ur(),Bv=ae(),M0=Mt();class Y3 extends Pv.CommandOperation{constructor(e){super();this.writeConcern={w:0},this.ns=Bv.MongoDBNamespace.fromString("admin.$cmd"),this.SERVER_COMMAND_RESPONSE_TYPE=xv.MongoDBResponse,this.sessions=e}buildCommandDocument(e,t){return{endSessions:this.sessions}}buildOptions(e){return{timeoutContext:e,readPreference:Fv.ReadPreference.primaryPreferred}}get commandName(){return"endSessions"}}Nv.EndSessionsOperation=Y3;M0.defineAspects(Y3,M0.Aspect.WRITE_OPERATION)});var Q3=g(function(Lv){Object.defineProperty(Lv,"__esModule",{value:!0});Lv.WaitingForSuitableServerEvent=Lv.ServerSelectionSucceededEvent=Lv.ServerSelectionFailedEvent=Lv.ServerSelectionStartedEvent=Lv.ServerSelectionEvent=void 0;var Rv=ae(),la=wr();class e1{constructor(e,t,r){this.selector=e,this.operation=r,this.topologyDescription=t}}Lv.ServerSelectionEvent=e1;class vv extends e1{constructor(e,t,r){super(e,t,r);this.name=la.SERVER_SELECTION_STARTED,this.message="Server selection started"}}Lv.ServerSelectionStartedEvent=vv;class kv extends e1{constructor(e,t,r,n){super(e,t,n);this.name=la.SERVER_SELECTION_FAILED,this.message="Server selection failed",this.failure=r}}Lv.ServerSelectionFailedEvent=kv;class qv extends e1{constructor(e,t,r,n){super(e,t,n);this.name=la.SERVER_SELECTION_SUCCEEDED,this.message="Server selection succeeded";let{host:s,port:i}=Rv.HostAddress.fromString(r).toHostPort();this.serverHost=s,this.serverPort=i}}Lv.ServerSelectionSucceededEvent=qv;class jv extends e1{constructor(e,t,r,n){super(e,t,n);this.name=la.WAITING_FOR_SUITABLE_SERVER,this.message="Waiting for suitable server to become available",this.remainingTimeMS=r}}Lv.WaitingForSuitableServerEvent=jv});var Z3=g(function(Kv){Object.defineProperty(Kv,"__esModule",{value:!0});Kv.SrvPoller=Kv.SrvPollingEvent=void 0;var Vv=L("dns"),t1=L("timers"),zv=J(),Wv=Is(),pi=ae();class J3{constructor(e){this.srvRecords=e}hostnames(){return new Set(this.srvRecords.map((e)=>pi.HostAddress.fromSrvRecord(e).toString()))}}Kv.SrvPollingEvent=J3;class X3 extends Wv.TypedEventEmitter{static{this.SRV_RECORD_DISCOVERY="srvRecordDiscovery"}constructor(e){super();if(this.on("error",pi.noop),!e||!e.srvHost)throw new zv.MongoRuntimeError("Options for SrvPoller must exist and include srvHost");this.srvHost=e.srvHost,this.srvMaxHosts=e.srvMaxHosts??0,this.srvServiceName=e.srvServiceName??"mongodb",this.srvAllowedHostsSuffix=e.srvAllowedHostsSuffix,this.srvHostValidator=e.srvHostValidator,this.rescanSrvIntervalMS=60000,this.heartbeatFrequencyMS=e.heartbeatFrequencyMS??1e4,this.haMode=!1,this.generation=0,this._timeout=void 0}get srvAddress(){return`_${this.srvServiceName}._tcp.${this.srvHost}`}get intervalMS(){return this.haMode?this.heartbeatFrequencyMS:this.rescanSrvIntervalMS}start(){if(!this._timeout)this.schedule()}stop(){if(this._timeout)t1.clearTimeout(this._timeout),this.generation+=1,this._timeout=void 0}schedule(){if(this._timeout)t1.clearTimeout(this._timeout);this._timeout=t1.setTimeout(()=>{this._poll().then(void 0,pi.squashError)},this.intervalMS)}success(e){this.haMode=!1,this.schedule(),this.emit(X3.SRV_RECORD_DISCOVERY,new J3(e))}failure(){this.haMode=!0,this.schedule()}async _poll(){let e=this.generation,t;try{t=await Vv.promises.resolve(this.srvAddress,"SRV")}catch{this.failure();return}if(e!==this.generation)return;let r=[];for(let n of t)try{let s=pi.normalizeDnsName(n.name);pi.verifySrvHost(s,this.srvHost,this),r.push({...n,name:s})}catch(s){pi.squashError(s)}if(!r.length){this.failure();return}this.success(r)}}Kv.SrvPoller=X3});var nk=g(function(tk){Object.defineProperty(tk,"__esModule",{value:!0});tk.Topology=void 0;var Qv=B3(),Bt=wr(),kr=J(),Ne=Fu(),Jv=Is(),So=Ur(),r1=Gn(),Nt=ae(),Z=as(),In=Gm(),x0=S3(),n1=Hh(),ha=kc(),$n=Q3(),fa=Z3(),P0=f3(),lme=0,of=Nt.makeStateMachine({[Z.STATE_CLOSED]:[Z.STATE_CLOSED,Z.STATE_CONNECTING],[Z.STATE_CONNECTING]:[Z.STATE_CONNECTING,Z.STATE_CLOSING,Z.STATE_CONNECTED,Z.STATE_CLOSED],[Z.STATE_CONNECTED]:[Z.STATE_CONNECTED,Z.STATE_CLOSING,Z.STATE_CLOSED],[Z.STATE_CLOSING]:[Z.STATE_CLOSING,Z.STATE_CLOSED]});class yn extends Jv.TypedEventEmitter{static{this.SERVER_OPENING=Bt.SERVER_OPENING}static{this.SERVER_CLOSED=Bt.SERVER_CLOSED}static{this.SERVER_DESCRIPTION_CHANGED=Bt.SERVER_DESCRIPTION_CHANGED}static{this.TOPOLOGY_OPENING=Bt.TOPOLOGY_OPENING}static{this.TOPOLOGY_CLOSED=Bt.TOPOLOGY_CLOSED}static{this.TOPOLOGY_DESCRIPTION_CHANGED=Bt.TOPOLOGY_DESCRIPTION_CHANGED}static{this.ERROR=Bt.ERROR}static{this.OPEN=Bt.OPEN}static{this.CONNECT=Bt.CONNECT}static{this.CLOSE=Bt.CLOSE}static{this.TIMEOUT=Bt.TIMEOUT}constructor(e,t,r){super();if(this.on("error",Nt.noop),this.client=e,r=r??{hosts:[Nt.HostAddress.fromString("localhost:27017")],...Object.fromEntries(Qv.DEFAULT_OPTIONS.entries())},typeof t==="string")t=[Nt.HostAddress.fromString(t)];else if(!Array.isArray(t))t=[t];let n=[];for(let a of t)if(typeof a==="string")n.push(Nt.HostAddress.fromString(a));else if(a instanceof Nt.HostAddress)n.push(a);else throw new kr.MongoRuntimeError(`Topology cannot be constructed from ${JSON.stringify(a)}`);let s=hme(r),i=lme++,o=r.srvMaxHosts==null||r.srvMaxHosts===0||r.srvMaxHosts>=n.length?n:Nt.shuffle(n,r.srvMaxHosts),u=new Map;for(let a of o)u.set(a.toString(),new n1.ServerDescription(a));if(this.waitQueue=new Nt.List,this.s={id:i,options:r,seedlist:n,state:Z.STATE_CLOSED,description:new P0.TopologyDescription(s,u,r.replicaSet,void 0,void 0,void 0,r),serverSelectionTimeoutMS:r.serverSelectionTimeoutMS,heartbeatFrequencyMS:r.heartbeatFrequencyMS,minHeartbeatFrequencyMS:r.minHeartbeatFrequencyMS,servers:new Map,credentials:r?.credentials,clusterTime:void 0,detectShardedTopology:(a)=>this.detectShardedTopology(a),detectSrvRecords:(a)=>this.detectSrvRecords(a)},this.mongoLogger=e.mongoLogger,this.component="topology",r.srvHost&&!r.loadBalanced)this.s.srvPoller=r.srvPoller??new fa.SrvPoller({heartbeatFrequencyMS:this.s.heartbeatFrequencyMS,srvHost:r.srvHost,srvMaxHosts:r.srvMaxHosts,srvServiceName:r.srvServiceName,srvAllowedHostsSuffix:r.srvAllowedHostsSuffix,srvHostValidator:r.srvHostValidator}),this.on(yn.TOPOLOGY_DESCRIPTION_CHANGED,this.s.detectShardedTopology);this.connectionLock=void 0}detectShardedTopology(e){let t=e.previousDescription.type,r=e.newDescription.type,n=t!==Z.TopologyType.Sharded&&r===Z.TopologyType.Sharded,i=!!this.s.srvPoller?.listeners(fa.SrvPoller.SRV_RECORD_DISCOVERY)?.includes(this.s.detectSrvRecords);if(n&&!i)this.s.srvPoller?.on(fa.SrvPoller.SRV_RECORD_DISCOVERY,this.s.detectSrvRecords),this.s.srvPoller?.start()}detectSrvRecords(e){let t=this.s.description;if(this.s.description=this.s.description.updateFromSrvPollingEvent(e,this.s.options.srvMaxHosts),this.s.description===t)return;Gv(this),this.emitAndLog(yn.TOPOLOGY_DESCRIPTION_CHANGED,new In.TopologyDescriptionChangedEvent(this.s.id,t,this.s.description))}get description(){return this.s.description}get loadBalanced(){return this.s.options.loadBalanced}get serverApi(){return this.s.options.serverApi}async connect(e){this.connectionLock??=this._connect(e);try{return await this.connectionLock,this}finally{this.connectionLock=void 0}}async _connect(e){if(e=e??{},this.s.state===Z.STATE_CONNECTED)return this;of(this,Z.STATE_CONNECTING),this.emitAndLog(yn.TOPOLOGY_OPENING,new In.TopologyOpeningEvent(this.s.id)),this.emitAndLog(yn.TOPOLOGY_DESCRIPTION_CHANGED,new In.TopologyDescriptionChangedEvent(this.s.id,new P0.TopologyDescription(Z.TopologyType.Unknown),this.s.description));let t=Array.from(this.s.description.servers.values());if(this.s.servers=new Map(t.map((o)=>[o.address,Zv(this,o)])),this.s.options.loadBalanced)for(let o of t){let u=new n1.ServerDescription(o.hostAddress,void 0,{loadBalanced:this.s.options.loadBalanced});this.serverUpdateHandler(u)}let r=this.client.s.options.serverSelectionTimeoutMS,n=e.readPreference??So.ReadPreference.primary,s=r1.TimeoutContext.create({timeoutMS:void 0,serverSelectionTimeoutMS:r,waitQueueTimeoutMS:this.client.s.options.waitQueueTimeoutMS}),i={operationName:"handshake",...e,timeoutContext:s,deprioritizedServers:new ha.DeprioritizedServers};try{let o=await this.selectServer(ha.readPreferenceServerSelector(n),i);if(this.s.options.__skipPingOnConnect!==!0){let a=await o.pool.checkOut({timeoutContext:s});return o.pool.checkIn(a),of(this,Z.STATE_CONNECTED),this.emit(yn.OPEN,this),this.emit(yn.CONNECT,this),this}return of(this,Z.STATE_CONNECTED),this.emit(yn.OPEN,this),this.emit(yn.CONNECT,this),this}catch(o){throw this.close(),o}}closeCheckedOutConnections(){for(let e of this.s.servers.values())e.closeCheckedOutConnections()}close(){if(this.s.state===Z.STATE_CLOSED||this.s.state===Z.STATE_CLOSING)return;for(let e of this.s.servers.values())Xv(e,this);if(this.s.servers.clear(),of(this,Z.STATE_CLOSING),ek(this.waitQueue,new kr.MongoTopologyClosedError),this.s.srvPoller)this.s.srvPoller.stop(),this.s.srvPoller.removeListener(fa.SrvPoller.SRV_RECORD_DISCOVERY,this.s.detectSrvRecords);this.removeListener(yn.TOPOLOGY_DESCRIPTION_CHANGED,this.s.detectShardedTopology),of(this,Z.STATE_CLOSED),this.emitAndLog(yn.TOPOLOGY_CLOSED,new In.TopologyClosedEvent(this.s.id))}async selectServer(e,t){let r;if(typeof e!=="function")if(typeof e==="string")r=ha.readPreferenceServerSelector(So.ReadPreference.fromString(e));else{let h;if(e instanceof So.ReadPreference)h=e;else So.ReadPreference.translate(t),h=t.readPreference||So.ReadPreference.primary;r=ha.readPreferenceServerSelector(h)}else r=e;if(t={serverSelectionTimeoutMS:this.s.serverSelectionTimeoutMS,...t},this.client.mongoLogger?.willLog(Ne.MongoLoggableComponent.SERVER_SELECTION,Ne.SeverityLevel.DEBUG))this.client.mongoLogger?.debug(Ne.MongoLoggableComponent.SERVER_SELECTION,new $n.ServerSelectionStartedEvent(e,this.description,t.operationName));let n;if(t.timeoutContext)n=t.timeoutContext.serverSelectionTimeout;else n=r1.Timeout.expires(t.serverSelectionTimeoutMS??0);let s=this.description.type===Z.TopologyType.Sharded,i=t.session,o=i&&i.transaction;if(s&&o&&o.server){if(this.client.mongoLogger?.willLog(Ne.MongoLoggableComponent.SERVER_SELECTION,Ne.SeverityLevel.DEBUG))this.client.mongoLogger?.debug(Ne.MongoLoggableComponent.SERVER_SELECTION,new $n.ServerSelectionSucceededEvent(e,this.description,o.server.pool.address,t.operationName));if(!t.timeoutContext||t.timeoutContext.clearServerSelectionTimeout)n?.clear();return o.server}let{promise:u,resolve:a,reject:c}=Nt.promiseWithResolvers(),l={serverSelector:r,topologyDescription:this.description,mongoLogger:this.client.mongoLogger,transaction:o,resolve:a,reject:c,cancelled:!1,startTime:Nt.processTimeMS(),operationName:t.operationName,waitingLogged:!1,deprioritizedServers:t.deprioritizedServers},f=Nt.addAbortListener(t.signal,function(){l.cancelled=!0,c(this.reason)});this.waitQueue.push(l),Yv(this);try{n?.throwIfExpired();let h=await(n?Promise.race([u,n]):u);if(t.timeoutContext?.csotEnabled()&&h.description.minRoundTripTime!==0)t.timeoutContext.minRoundTripTime=h.description.minRoundTripTime;return h}catch(h){if(r1.TimeoutError.is(h)){l.cancelled=!0;let d=new kr.MongoServerSelectionError(`Server selection timed out after ${n?.duration} ms`,this.description);if(this.client.mongoLogger?.willLog(Ne.MongoLoggableComponent.SERVER_SELECTION,Ne.SeverityLevel.DEBUG))this.client.mongoLogger?.debug(Ne.MongoLoggableComponent.SERVER_SELECTION,new $n.ServerSelectionFailedEvent(e,this.description,d,t.operationName));if(t.timeoutContext?.csotEnabled())throw new kr.MongoOperationTimeoutError("Timed out during server selection",{cause:d});throw d}throw h}finally{if(f?.[Nt.kDispose](),!t.timeoutContext||t.timeoutContext.clearServerSelectionTimeout)n?.clear()}}serverUpdateHandler(e){if(!this.s.description.hasServer(e.address))return;if(fme(this.s.description,e))return;let t=this.s.description,r=this.s.description.servers.get(e.address);if(!r)return;let n=e.$clusterTime;if(n)Z._advanceClusterTime(this,n);let s=r&&r.equals(e);if(this.s.description=this.s.description.update(e),this.s.description.compatibilityError){this.emit(yn.ERROR,new kr.MongoCompatibilityError(this.s.description.compatibilityError));return}if(!s){let i=this.s.description.servers.get(e.address);if(i)this.emit(yn.SERVER_DESCRIPTION_CHANGED,new In.ServerDescriptionChangedEvent(this.s.id,e.address,r,i))}if(Gv(this,e),this.waitQueue.length>0)Yv(this);if(!s)this.emitAndLog(yn.TOPOLOGY_DESCRIPTION_CHANGED,new In.TopologyDescriptionChangedEvent(this.s.id,t,this.s.description))}auth(e,t){if(typeof e==="function")t=e,e=void 0;if(typeof t==="function")t(void 0,!0)}isConnected(){return this.s.state===Z.STATE_CONNECTED}isDestroyed(){return this.s.state===Z.STATE_CLOSED}lastHello(){let e=Array.from(this.description.servers.values());if(e.length===0)return{};return e.filter((n)=>n.type!==Z.ServerType.Unknown)[0]||{maxWireVersion:this.description.commonWireVersion}}get commonWireVersion(){return this.description.commonWireVersion}get logicalSessionTimeoutMinutes(){return this.description.logicalSessionTimeoutMinutes}get clusterTime(){return this.s.clusterTime}set clusterTime(e){this.s.clusterTime=e}}tk.Topology=yn;function Xv(e,t){for(let r of Bt.LOCAL_SERVER_EVENTS)e.removeAllListeners(r);e.close(),t.emitAndLog(yn.SERVER_CLOSED,new In.ServerClosedEvent(t.s.id,e.description.address));for(let r of Bt.SERVER_RELAY_EVENTS)e.removeAllListeners(r)}function hme(e){if(e?.directConnection)return Z.TopologyType.Single;if(e?.replicaSet)return Z.TopologyType.ReplicaSetNoPrimary;if(e?.loadBalanced)return Z.TopologyType.LoadBalanced;return Z.TopologyType.Unknown}function Zv(e,t){e.emitAndLog(yn.SERVER_OPENING,new In.ServerOpeningEvent(e.s.id,t.address));let r=new x0.Server(e,t,e.s.options);for(let n of Bt.SERVER_RELAY_EVENTS)r.on(n,(s)=>e.emit(n,s));return r.on(x0.Server.DESCRIPTION_RECEIVED,(n)=>e.serverUpdateHandler(n)),r.connect(),r}function Gv(e,t){if(t&&e.s.servers.has(t.address)){let r=e.s.servers.get(t.address);if(r){if(r.s.description=t,t.error instanceof kr.MongoError&&t.error.hasErrorLabel(kr.MongoErrorLabel.ResetPool)){let n=t.error.hasErrorLabel(kr.MongoErrorLabel.InterruptInUseConnections);r.pool.clear({interruptInUseConnections:n})}else if(t.error==null){let n=e.s.description.type;if(t.isDataBearing||t.type!==Z.ServerType.Unknown&&n===Z.TopologyType.Single)r.pool.ready()}}}for(let r of e.description.servers.values())if(!e.s.servers.has(r.address)){let n=Zv(e,r);e.s.servers.set(r.address,n)}for(let r of e.s.servers){let n=r[0];if(e.description.hasServer(n))continue;if(!e.s.servers.has(n))continue;let s=e.s.servers.get(n);if(e.s.servers.delete(n),s)Xv(s,e)}}function ek(e,t){while(e.length){let r=e.shift();if(!r)continue;if(!r.cancelled){if(r.mongoLogger?.willLog(Ne.MongoLoggableComponent.SERVER_SELECTION,Ne.SeverityLevel.DEBUG))r.mongoLogger?.debug(Ne.MongoLoggableComponent.SERVER_SELECTION,new $n.ServerSelectionFailedEvent(r.serverSelector,r.topologyDescription,t,r.operationName));r.reject(t)}}}function Yv(e){if(e.s.state===Z.STATE_CLOSED){ek(e.waitQueue,new kr.MongoTopologyClosedError);return}let t=e.description.type===Z.TopologyType.Sharded,r=Array.from(e.description.servers.values()),n=e.waitQueue.length;for(let s=0;s<n;++s){let i=e.waitQueue.shift();if(!i)continue;if(i.cancelled)continue;let o;try{let{serverSelector:c,deprioritizedServers:l}=i;o=c?c(e.description,r,l):r}catch(c){if(e.client.mongoLogger?.willLog(Ne.MongoLoggableComponent.SERVER_SELECTION,Ne.SeverityLevel.DEBUG))e.client.mongoLogger?.debug(Ne.MongoLoggableComponent.SERVER_SELECTION,new $n.ServerSelectionFailedEvent(i.serverSelector,e.description,c,i.operationName));i.reject(c);continue}let u;if(o.length===0){if(!i.waitingLogged){if(e.client.mongoLogger?.willLog(Ne.MongoLoggableComponent.SERVER_SELECTION,Ne.SeverityLevel.INFORMATIONAL))e.client.mongoLogger?.info(Ne.MongoLoggableComponent.SERVER_SELECTION,new $n.WaitingForSuitableServerEvent(i.serverSelector,e.description,e.s.serverSelectionTimeoutMS!==0?e.s.serverSelectionTimeoutMS-(Nt.processTimeMS()-i.startTime):-1,i.operationName));i.waitingLogged=!0}e.waitQueue.push(i);continue}else if(o.length===1)u=e.s.servers.get(o[0].address);else{let c=Nt.shuffle(o,2),l=e.s.servers.get(c[0].address),f=e.s.servers.get(c[1].address);u=l&&f&&l.s.operationCount<f.s.operationCount?l:f}if(!u){let c=new kr.MongoServerSelectionError("server selection returned a server description but the server was not found in the topology",e.description);if(e.client.mongoLogger?.willLog(Ne.MongoLoggableComponent.SERVER_SELECTION,Ne.SeverityLevel.DEBUG))e.client.mongoLogger?.debug(Ne.MongoLoggableComponent.SERVER_SELECTION,new $n.ServerSelectionFailedEvent(i.serverSelector,e.description,c,i.operationName));i.reject(c);return}let a=i.transaction;if(t&&a&&a.isActive&&u)a.pinServer(u);if(e.client.mongoLogger?.willLog(Ne.MongoLoggableComponent.SERVER_SELECTION,Ne.SeverityLevel.DEBUG))e.client.mongoLogger?.debug(Ne.MongoLoggableComponent.SERVER_SELECTION,new $n.ServerSelectionSucceededEvent(i.serverSelector,i.topologyDescription,u.pool.address,i.operationName));i.resolve(u)}if(e.waitQueue.length>0)for(let[,s]of e.s.servers)queueMicrotask(function(){return s.requestCheck()})}function fme(e,t){let n=e.servers.get(t.address)?.topologyVersion;return n1.compareTopologyVersion(n,t.topologyVersion)>0}});var Ua=g(function(Ek){Object.defineProperty(Ek,"__esModule",{value:!0});Ek.MongoClient=Ek.ServerApiVersion=void 0;var s1=L("fs"),sk=qu(),ik=Se(),ok=pl(),uk=im(),ak=co(),F0=x_(),B0=B3(),ck=wr(),lk=em(),i1=J(),hk=U3(),N0=Fu(),fk=Is(),dk=Mv(),pk=$v(),mk=Hr(),yk=Ur(),I0=kc(),$0=nk(),R0=Fh(),Qe=ae();Ek.ServerApiVersion=Object.freeze({v1:"1"});class gk extends fk.TypedEventEmitter{constructor(e,t){super();this.driverInfoList=[],this.on("error",Qe.noop),this.options=B0.parseOptions(e,this,t),this.appendMetadata(this.options.driverInfo);let r=Object.values(this.options.mongoLoggerOptions.componentSeverities).some((s)=>s!==N0.SeverityLevel.OFF);this.mongoLogger=r?new N0.MongoLogger(this.options.mongoLoggerOptions):void 0;let n=this;this.s={url:e,bsonOptions:ik.resolveBSONOptions(this.options),namespace:Qe.ns("admin"),hasBeenClosed:!1,sessionPool:new R0.ServerSessionPool(this),activeSessions:new Set,activeCursors:new Set,authProviders:new hk.MongoClientAuthProviders,get options(){return n.options},get readConcern(){return n.options.readConcern},get writeConcern(){return n.options.writeConcern},get readPreference(){return n.options.readPreference},get isMongoClient(){return!0}},Object.defineProperty(this.s,"url",{enumerable:!1}),this.checkForNonGenuineHosts()}async[Symbol.asyncDispose](){await this.close()}appendMetadata(e){if(this.driverInfoList.some((r)=>F0.isDriverInfoEqual(r,e)))return;this.driverInfoList.push(e),this.options.metadata=F0.makeClientMetadata(this.driverInfoList,this.options).then(void 0,Qe.squashError).then((r)=>r??{})}checkForNonGenuineHosts(){let e=this.options.hosts.filter((s)=>Qe.isHostMatch(Qe.DOCUMENT_DB_CHECK,s.host)),t=Qe.isHostMatch(Qe.DOCUMENT_DB_CHECK,this.options.srvHost),r=this.options.hosts.filter((s)=>Qe.isHostMatch(Qe.COSMOS_DB_CHECK,s.host)),n=Qe.isHostMatch(Qe.COSMOS_DB_CHECK,this.options.srvHost);if(e.length!==0||t)this.mongoLogger?.info("client",Qe.DOCUMENT_DB_MSG);else if(r.length!==0||n)this.mongoLogger?.info("client",Qe.COSMOS_DB_MSG)}get serverApi(){return this.options.serverApi&&Object.freeze({...this.options.serverApi})}get monitorCommands(){return this.options.monitorCommands}set monitorCommands(e){this.options.monitorCommands=e}get autoEncrypter(){return this.options.autoEncrypter}get readConcern(){return this.s.readConcern}get writeConcern(){return this.s.writeConcern}get readPreference(){return this.s.readPreference}get bsonOptions(){return this.s.bsonOptions}get timeoutMS(){return}async bulkWrite(e,t){if(this.autoEncrypter)throw new i1.MongoInvalidArgumentError("MongoClient bulkWrite does not currently support automatic encryption.");return await new dk.ClientBulkWriteExecutor(this,e,Qe.resolveOptions(this,t)).execute()}async connect(){if(this.connectionLock)return await this.connectionLock;try{this.connectionLock=this._connect(),await this.connectionLock}finally{this.connectionLock=void 0}return this}async _connect(){if(this.topology&&this.topology.isConnected())return this;let e=this.options;if(e.tls){if(typeof e.tlsCAFile==="string")e.ca??=await s1.promises.readFile(e.tlsCAFile);if(typeof e.tlsCRLFile==="string")e.crl??=await s1.promises.readFile(e.tlsCRLFile);if(typeof e.tlsCertificateKeyFile==="string"){if(!e.key||!e.cert){let r=await s1.promises.readFile(e.tlsCertificateKeyFile);e.key??=r,e.cert??=r}}}if(typeof e.srvHost==="string"){let r=await B0.resolveSRVRecord(e);for(let[n,s]of r.entries())e.hosts[n]=s}if(e.credentials?.mechanism===ak.AuthMechanism.MONGODB_OIDC){let r=e.credentials?.mechanismProperties?.ALLOWED_HOSTS||uk.DEFAULT_ALLOWED_HOSTS;if(!e.credentials?.mechanismProperties?.ENVIRONMENT){for(let s of e.hosts)if(!Qe.hostMatchesWildcards(s.toHostPort().host,r))throw new i1.MongoInvalidArgumentError(`Host '${s}' is not valid for OIDC authentication with ALLOWED_HOSTS of '${r.join(",")}'`)}}this.topology=new $0.Topology(this,e.hosts,e),this.topology.once($0.Topology.OPEN,()=>this.emit("open",this));for(let r of ck.MONGO_CLIENT_EVENTS)this.topology.on(r,(...n)=>this.emit(r,...n));let t=async()=>{try{await this.topology?.connect(e)}catch(r){throw this.topology?.close(),r}};if(this.autoEncrypter)await this.autoEncrypter?.init(),await t(),await e.encrypter.connectInternalClient();else await t();return this}async close(e=!1){if(this.closeLock)return await this.closeLock;try{this.closeLock=this._close(),await this.closeLock}finally{this.closeLock=void 0}}async _close(){Object.defineProperty(this.s,"hasBeenClosed",{value:!0,enumerable:!0,configurable:!1,writable:!1}),this.topology?.closeCheckedOutConnections();let e=Array.from(this.s.activeCursors,(o)=>o.close());this.s.activeCursors.clear(),await Promise.all(e);let t=Array.from(this.s.activeSessions,(o)=>o.endSession());if(this.s.activeSessions.clear(),await Promise.all(t),this.topology==null)return;if(this.topology.description.type===sk.TopologyType.LoadBalanced||this.topology.description.logicalSessionTimeoutMinutes!=null)await i(this,this.topology);let n=this.topology;this.topology=void 0,n.close();let{encrypter:s}=this.options;if(s)await s.close(this);async function i(o,{description:u}){let a=I0.readPreferenceServerSelector(yk.ReadPreference.primaryPreferred),c=Array.from(u.servers.values());if(a(u,c,new I0.DeprioritizedServers).length!==0){let f=Array.from(o.s.sessionPool.sessions,({id:h})=>h);if(f.length!==0)try{await mk.executeOperation(o,new pk.EndSessionsOperation(f))}catch(h){Qe.squashError(h)}}}}db(e,t){if(t=t??{},!e)e=this.s.options.dbName;let r=Object.assign({},this.options,t);return new lk.Db(this,e,r)}static async connect(e,t){return await new this(e,t).connect()}startSession(e){let t=new R0.ClientSession(this,this.s.sessionPool,{explicit:!0,...e},this.options);return this.s.activeSessions.add(t),t.once("ended",()=>{this.s.activeSessions.delete(t)}),t}async withSession(e,t){let r={owner:Symbol(),...typeof e==="object"?e:{}},n=typeof e==="function"?e:t;if(n==null)throw new i1.MongoInvalidArgumentError("Missing required callback parameter");let s=this.startSession(r);try{return await n(s)}finally{try{await s.endSession()}catch(i){Qe.squashError(i)}}}watch(e=[],t={}){if(!Array.isArray(e))t=e,e=[];return new ok.ChangeStream(this,e,Qe.resolveOptions(this,t))}}Ek.MongoClient=gk});var pl=g(function(Mk){Object.defineProperty(Mk,"__esModule",{value:!0});Mk.ChangeStream=void 0;Mk.filterOutOptions=Tk;var Ak=ll(),mr=wr(),wk=ps(),Ok=A_(),Sk=em(),Je=J(),Ck=Ua(),bk=Is(),Dk=kc(),en=ae(),Ha={COLLECTION:Symbol("Collection"),DATABASE:Symbol("Database"),CLUSTER:Symbol("Cluster")},pme=[mr.RESUME_TOKEN_CHANGED,mr.END,mr.CLOSE],mme="A change stream document has been received that lacks a resume token (_id).",v0="ChangeStream is closed",yme=gme();function Tk(e){return Object.fromEntries(Object.entries(e).filter(([t,r])=>!yme.has(t)))}class Ga extends bk.TypedEventEmitter{async[Symbol.asyncDispose](){await this.close()}static{this.RESPONSE=mr.RESPONSE}static{this.MORE=mr.MORE}static{this.INIT=mr.INIT}static{this.CLOSE=mr.CLOSE}static{this.CHANGE=mr.CHANGE}static{this.END=mr.END}static{this.ERROR=mr.ERROR}static{this.RESUME_TOKEN_CHANGED=mr.RESUME_TOKEN_CHANGED}constructor(e,t=[],r={}){super();if(this.pipeline=t,this.options={...r},this.options.timeoutMS=void 0,this.options.timeoutMode=void 0,delete this.options.writeConcern,e instanceof Ak.Collection)this.type=Ha.COLLECTION;else if(e instanceof Sk.Db)this.type=Ha.DATABASE;else if(e instanceof Ck.MongoClient)this.type=Ha.CLUSTER;else throw new Je.MongoChangeStreamError("Parent provided to ChangeStream constructor must be an instance of Collection, Db, or MongoClient");if(this.contextOwner=Symbol(),this.parent=e,this.namespace=e.s.namespace,!this.options.readPreference&&e.readPreference)this.options.readPreference=e.readPreference;this.cursor=this._createChangeStreamCursor(r),this.isClosed=!1,this.mode=!1,this.on("newListener",(n)=>{if(n==="change"&&this.cursor&&this.listenerCount("change")===0)this._streamEvents(this.cursor)}),this.on("removeListener",(n)=>{if(n==="change"&&this.listenerCount("change")===0&&this.cursor)this.cursorStream?.removeAllListeners("data")})}get resumeToken(){return this.cursor?.resumeToken}bufferedCount(){return this.cursor?.bufferedCount()??0}async hasNext(){this._setIsIterator(),this.timeoutContext?.refresh();try{while(!0)try{return await this.cursor.hasNext()}catch(e){try{await this._processErrorIteratorMode(e,this.cursor.id!=null)}catch(t){if(t instanceof Je.MongoOperationTimeoutError&&this.cursor.id==null)throw t;try{await this.close()}catch(r){en.squashError(r)}throw t}}}finally{this.timeoutContext?.clear()}}async next(){this._setIsIterator(),this.timeoutContext?.refresh();try{while(!0)try{let e=await this.cursor.next();return this._processChange(e??null)}catch(e){try{await this._processErrorIteratorMode(e,this.cursor.id!=null)}catch(t){if(t instanceof Je.MongoOperationTimeoutError&&this.cursor.id==null)throw t;try{await this.close()}catch(r){en.squashError(r)}throw t}}}finally{this.timeoutContext?.clear()}}async tryNext(){this._setIsIterator(),this.timeoutContext?.refresh();try{while(!0)try{let e=await this.cursor.tryNext();if(!e)return null;return this._processChange(e)}catch(e){try{await this._processErrorIteratorMode(e,this.cursor.id!=null)}catch(t){if(t instanceof Je.MongoOperationTimeoutError&&this.cursor.id==null)throw t;try{await this.close()}catch(r){en.squashError(r)}throw t}}}finally{this.timeoutContext?.clear()}}async*[Symbol.asyncIterator](){if(this.closed)return;try{while(!0)yield await this.next()}finally{try{await this.close()}catch(e){en.squashError(e)}}}get closed(){return this.isClosed||this.cursor.closed}async close(){this.timeoutContext?.clear(),this.timeoutContext=void 0,this.isClosed=!0;let e=this.cursor;try{await e.close()}finally{this._endStream()}}stream(){if(this.closed)throw new Je.MongoChangeStreamError(v0);return this.cursor.stream()}_setIsEmitter(){if(this.mode==="iterator")throw new Je.MongoAPIError("ChangeStream cannot be used as an EventEmitter after being used as an iterator");this.mode="emitter"}_setIsIterator(){if(this.mode==="emitter")throw new Je.MongoAPIError("ChangeStream cannot be used as an iterator after being used as an EventEmitter");this.mode="iterator"}_createChangeStreamCursor(e){let t=Tk(e);if(this.type===Ha.CLUSTER)t.allChangesForCluster=!0;let r=[{$changeStream:t},...this.pipeline],n=this.type===Ha.CLUSTER?this.parent:this.type===Ha.DATABASE?this.parent.client:this.type===Ha.COLLECTION?this.parent.client:null;if(n==null)throw new Je.MongoRuntimeError(`Changestream type should only be one of cluster, database, collection. Found ${this.type.toString()}`);let s=new Ok.ChangeStreamCursor(n,this.namespace,r,{...e,timeoutContext:this.timeoutContext?new wk.CursorTimeoutContext(this.timeoutContext,this.contextOwner):void 0});for(let i of pme)s.on(i,(o)=>this.emit(i,o));if(this.listenerCount(Ga.CHANGE)>0)this._streamEvents(s);return s}_closeEmitterModeWithError(e){this.emit(Ga.ERROR,e),this.close().then(void 0,en.squashError)}_streamEvents(e){this._setIsEmitter();let t=this.cursorStream??e.stream();this.cursorStream=t,t.on("data",(r)=>{try{let n=this._processChange(r);this.emit(Ga.CHANGE,n)}catch(n){this.emit(Ga.ERROR,n)}this.timeoutContext?.refresh()}),t.on("error",(r)=>this._processErrorStreamMode(r,this.cursor.id!=null))}_endStream(){this.cursorStream?.removeAllListeners("data"),this.cursorStream?.removeAllListeners("close"),this.cursorStream?.removeAllListeners("end"),this.cursorStream?.destroy(),this.cursorStream=void 0}_processChange(e){if(this.isClosed)throw new Je.MongoAPIError(v0);if(e==null)throw new Je.MongoRuntimeError(v0);if(e&&!e._id)throw new Je.MongoChangeStreamError(mme);return this.cursor.cacheResumeToken(e._id),this.options.startAtOperationTime=void 0,e}_processErrorStreamMode(e,t){if(this.isClosed)return;if(t&&(Je.isResumableError(e,this.cursor.maxWireVersion)||e instanceof Je.MongoOperationTimeoutError))this._endStream(),this.cursor.close().then(()=>this._resume(e),(r)=>(en.squashError(r),this._resume(e))).then(()=>{if(e instanceof Je.MongoOperationTimeoutError)this.emit(Ga.ERROR,e)},()=>this._closeEmitterModeWithError(e));else this._closeEmitterModeWithError(e)}async _processErrorIteratorMode(e,t){if(this.isClosed)throw new Je.MongoAPIError(v0);if(t&&(Je.isResumableError(e,this.cursor.maxWireVersion)||e instanceof Je.MongoOperationTimeoutError)){try{await this.cursor.close()}catch(r){en.squashError(r)}if(await this._resume(e),e instanceof Je.MongoOperationTimeoutError)throw e}else{try{await this.close()}catch(r){en.squashError(r)}throw e}}async _resume(e){this.timeoutContext?.refresh();let t=en.getTopology(this.parent);try{await t.selectServer(this.cursor.readPreference,{operationName:"reconnect topology in change stream",timeoutContext:this.timeoutContext,deprioritizedServers:new Dk.DeprioritizedServers}),this.cursor=this._createChangeStreamCursor(this.cursor.resumeOptions)}catch{throw await this.close(),e}}}Mk.ChangeStream=Ga;function gme(){return new Set(Object.keys({allowDiskUse:"",authdb:"",batchSize:"",bsonRegExp:"",bypassDocumentValidation:"",bypassPinningCheck:"",checkKeys:"",collation:"",comment:"",cursor:"",dbName:"",enableUtf8Validation:"",explain:"",fieldsAsRaw:"",hint:"",ignoreUndefined:"",let:"",maxAwaitTimeMS:"",maxTimeMS:"",omitMaxTimeMS:"",out:"",promoteBuffers:"",promoteLongs:"",promoteValues:"",raw:"",rawData:"",readConcern:"",readPreference:"",serializeFunctions:"",session:"",timeoutContext:"",timeoutMS:"",timeoutMode:"",useBigInt64:"",willRetryWrite:"",writeConcern:""}))}});var t6=g(function(Nk){Object.defineProperty(Nk,"__esModule",{value:!0});Nk.GridFSBucketReadStream=void 0;var Fk=L("stream"),Bk=Se(),Lt=J();class e6 extends Fk.Readable{static{this.FILE="file"}constructor(e,t,r,n,s){super({emitClose:!0});this.s={bytesToTrim:0,bytesToSkip:0,bytesRead:0,chunks:e,expected:0,files:t,filter:n,init:!1,expectedEnd:0,options:{start:0,end:0,...s},readPreference:r}}_read(){if(this.destroyed)return;wme(this,()=>_me(this))}start(e=0){return Pk(this),this.s.options.start=e,this}end(e=0){return Pk(this),this.s.options.end=e,this}async abort(){this.push(null),this.destroy();let e=this.s.timeoutContext?.getRemainingTimeMSOrThrow();await this.s.cursor?.close({timeoutMS:e})}}Nk.GridFSBucketReadStream=e6;function Pk(e){if(e.s.init)throw new Lt.MongoGridFSStreamError("Options cannot be changed after the stream is initialized")}function _me(e){if(e.destroyed)return;if(!e.s.cursor)return;if(!e.s.file)return;let t=(r)=>{if(e.destroyed)return;if(!r){e.push(null),e.s.cursor?.close().then(void 0,(f)=>e.destroy(f));return}if(!e.s.file)return;let n=e.s.file.length-e.s.bytesRead,s=e.s.expected++,i=Math.min(e.s.file.chunkSize,n);if(r.n>s)return e.destroy(new Lt.MongoGridFSChunkError(`ChunkIsMissing: Got unexpected n: ${r.n}, expected: ${s}`));if(r.n<s)return e.destroy(new Lt.MongoGridFSChunkError(`ExtraChunk: Got unexpected n: ${r.n}, expected: ${s}`));let o=Bk.ByteUtils.isUint8Array(r.data)?r.data:r.data.buffer;if(o.byteLength!==i){if(n<=0)return e.destroy(new Lt.MongoGridFSChunkError(`ExtraChunk: Got unexpected n: ${r.n}, expected file length ${e.s.file.length} bytes but already read ${e.s.bytesRead} bytes`));return e.destroy(new Lt.MongoGridFSChunkError(`ChunkIsWrongSize: Got unexpected length: ${o.byteLength}, expected: ${i}`))}if(e.s.bytesRead+=o.byteLength,o.byteLength===0)return e.push(null);let u=null,a=null;if(e.s.bytesToSkip!=null)u=e.s.bytesToSkip,e.s.bytesToSkip=0;let c=s===e.s.expectedEnd-1,l=e.s.options.end-e.s.bytesToSkip;if(c&&e.s.bytesToTrim!=null)a=e.s.file.chunkSize-e.s.bytesToTrim;else if(e.s.options.end&&l<r.data.byteLength)a=l;if(u!=null||a!=null)o=o.slice(u||0,a||o.byteLength);e.push(o);return};e.s.cursor.next().then(t,(r)=>{if(e.destroyed)return;e.destroy(r)})}function Ame(e){let t={};if(e.s.readPreference)t.readPreference=e.s.readPreference;if(e.s.options&&e.s.options.sort)t.sort=e.s.options.sort;if(e.s.options&&e.s.options.skip)t.skip=e.s.options.skip;let r=(s)=>{if(e.destroyed)return;if(!s){let a=`FileNotFound: file ${e.s.filter._id!=null?e.s.filter._id.$eq:e.s.filter.filename} was not found`,c=new Lt.MongoRuntimeError(a);return c.code="ENOENT",e.destroy(c)}if(s.length<=0){e.push(null);return}if(e.destroyed){e.destroy();return}try{e.s.bytesToSkip=Ome(e,s,e.s.options)}catch(u){return e.destroy(u)}let i={files_id:{$eq:s._id}};if(e.s.options&&e.s.options.start!=null){let u=Math.floor(e.s.options.start/s.chunkSize);if(u>0)i.n={$gte:u}}let o;try{o=e.s.timeoutContext?.getRemainingTimeMSOrThrow(`Download timed out after ${e.s.timeoutContext?.timeoutMS}ms`)}catch(u){return e.destroy(u)}if(e.s.cursor=e.s.chunks.find(i,{timeoutMS:o}).sort({n:1}),e.s.readPreference)e.s.cursor.withReadPreference(e.s.readPreference);e.s.expectedEnd=Math.ceil(s.length/s.chunkSize),e.s.file=s;try{e.s.bytesToTrim=Sme(e,s,e.s.cursor,e.s.options)}catch(u){return e.destroy(u)}e.emit(e6.FILE,s);return},n;try{n=e.s.timeoutContext?.getRemainingTimeMSOrThrow(`Download timed out after ${e.s.timeoutContext?.timeoutMS}ms`)}catch(s){if(!e.destroyed)e.destroy(s);return}t.timeoutMS=n,e.s.files.findOne(e.s.filter,t).then(r,(s)=>{if(e.destroyed)return;e.destroy(s)})}function wme(e,t){if(e.s.file)return t();if(!e.s.init)Ame(e),e.s.init=!0;e.once("file",()=>{t()})}function Ome(e,t,r){if(r&&r.start!=null){if(r.start>t.length)throw new Lt.MongoInvalidArgumentError(`Stream start (${r.start}) must not be more than the length of the file (${t.length})`);if(r.start<0)throw new Lt.MongoInvalidArgumentError(`Stream start (${r.start}) must not be negative`);if(r.end!=null&&r.end<r.start)throw new Lt.MongoInvalidArgumentError(`Stream start (${r.start}) must not be greater than stream end (${r.end})`);return e.s.bytesRead=Math.floor(r.start/t.chunkSize)*t.chunkSize,e.s.expected=Math.floor(r.start/t.chunkSize),r.start-e.s.bytesRead}throw new Lt.MongoInvalidArgumentError("Start option must be defined")}function Sme(e,t,r,n){if(n&&n.end!=null){if(n.end>t.length)throw new Lt.MongoInvalidArgumentError(`Stream end (${n.end}) must not be more than the length of the file (${t.length})`);if(n.start==null||n.start<0)throw new Lt.MongoInvalidArgumentError(`Stream end (${n.end}) must not be negative`);let s=n.start!=null?Math.floor(n.start/t.chunkSize):0;return r.limit(Math.ceil(n.end/t.chunkSize)-s),e.s.expectedEnd=Math.ceil(n.end/t.chunkSize),Math.ceil(n.end/t.chunkSize)*t.chunkSize-n.end}throw new Lt.MongoInvalidArgumentError("End option must be defined")}});var n6=g(function(Uk){Object.defineProperty(Uk,"__esModule",{value:!0});Uk.GridFSBucketWriteStream=void 0;Uk.checkChunksIndex=jk;Uk.checkIndexes=Lk;var $k=L("stream"),tn=Se(),yr=J(),Rk=ae(),vk=Hn();class kk extends $k.Writable{constructor(e,t,r){super();this.gridFSFile=null,r=r??{},this.bucket=e,this.chunks=e.s._chunksCollection,this.filename=t,this.files=e.s._filesCollection,this.options=r,this.writeConcern=vk.WriteConcern.fromOptions(r)||e.s.options.writeConcern,this.done=!1,this.id=r.id?r.id:new tn.ObjectId,this.chunkSizeBytes=r.chunkSizeBytes||this.bucket.s.options.chunkSizeBytes,this.bufToStore=tn.ByteUtils.allocate(this.chunkSizeBytes),this.length=0,this.n=0,this.pos=0,this.state={streamEnd:!1,outstandingRequests:0,errored:!1,aborted:!1}}_construct(e){if(!this.bucket.s.calledOpenUploadStream)this.bucket.s.calledOpenUploadStream=!0,Lk(this).then(()=>{this.bucket.s.checkedIndexes=!0,this.bucket.emit("index"),e()},(t)=>{if(t instanceof yr.MongoOperationTimeoutError)return Ya(this,t,e);Rk.squashError(t),e()});else return queueMicrotask(e)}_write(e,t,r){bme(this,e,t,r)}_final(e){if(this.state.streamEnd)return queueMicrotask(e);this.state.streamEnd=!0,Dme(this,e)}async abort(){if(this.state.streamEnd)throw new yr.MongoAPIError("Cannot abort a stream that has already completed");if(this.state.aborted)throw new yr.MongoAPIError("Cannot call abort() on a stream twice");this.state.aborted=!0;let e=this.timeoutContext?.getRemainingTimeMSOrThrow(`Upload timed out after ${this.timeoutContext?.timeoutMS}ms`);await this.chunks.deleteMany({files_id:{$eq:this.id}},{timeoutMS:e})}}Uk.GridFSBucketWriteStream=kk;function Ya(e,t,r){if(e.state.errored){queueMicrotask(r);return}e.state.errored=!0,queueMicrotask(()=>r(t))}function qk(e,t,r){return{_id:new tn.ObjectId,files_id:e,n:t,data:r}}async function jk(e){let t={files_id:1,n:1},r;r=e.timeoutContext?.getRemainingTimeMSOrThrow(`Upload timed out after ${e.timeoutContext?.timeoutMS}ms`);let n;try{n=await e.chunks.listIndexes({timeoutMS:r}).toArray()}catch(i){if(i instanceof yr.MongoError&&yr.isNamespaceNotFoundError(i))n=[];else throw i}if(!n.find((i)=>{if(Object.keys(i.key).length===2&&i.key.files_id===1&&i.key.n===1)return!0;return!1}))r=e.timeoutContext?.getRemainingTimeMSOrThrow(`Upload timed out after ${e.timeoutContext?.timeoutMS}ms`),await e.chunks.createIndex(t,{unique:!0},{timeoutMS:r})}function r6(e,t){if(e.done)return queueMicrotask(t);if(e.state.streamEnd&&e.state.outstandingRequests===0&&!e.state.errored){e.done=!0;let r=Cme(e.id,e.length,e.chunkSizeBytes,e.filename,e.options.metadata);if(k0(e,t))return;let n=e.timeoutContext?.remainingTimeMS;if(n!=null&&n<=0)return Ya(e,new yr.MongoOperationTimeoutError(`Upload timed out after ${e.timeoutContext?.timeoutMS}ms`),t);e.files.insertOne(r,{writeConcern:e.writeConcern,timeoutMS:n}).then(()=>{e.gridFSFile=r,t()},(s)=>Ya(e,s,t));return}queueMicrotask(t)}async function Lk(e){let t=e.timeoutContext?.getRemainingTimeMSOrThrow(`Upload timed out after ${e.timeoutContext?.timeoutMS}ms`);if(await e.files.findOne({},{projection:{_id:1},timeoutMS:t})!=null)return;let n={filename:1,uploadDate:1},s;t=e.timeoutContext?.getRemainingTimeMSOrThrow(`Upload timed out after ${e.timeoutContext?.timeoutMS}ms`);let i={timeoutMS:t};try{s=await e.files.listIndexes(i).toArray()}catch(u){if(u instanceof yr.MongoError&&yr.isNamespaceNotFoundError(u))s=[];else throw u}if(!s.find((u)=>{if(Object.keys(u.key).length===2&&u.key.filename===1&&u.key.uploadDate===1)return!0;return!1}))t=e.timeoutContext?.getRemainingTimeMSOrThrow(`Upload timed out after ${e.timeoutContext?.timeoutMS}ms`),await e.files.createIndex(n,{},{timeoutMS:t});await jk(e)}function Cme(e,t,r,n,s){let i={_id:e,length:t,chunkSize:r,uploadDate:new Date,filename:n};if(s)i.metadata=s;return i}function bme(e,t,r,n){if(k0(e,n))return;let s=typeof t==="string"?tn.ByteUtils.fromUTF8(t):tn.ByteUtils.toLocalBufferType(t);if(e.length+=s.length,e.pos+s.length<e.chunkSizeBytes){tn.ByteUtils.copy(s,e.bufToStore,e.pos),e.pos+=s.length,queueMicrotask(n);return}let i=s.length,o=e.chunkSizeBytes-e.pos,u=Math.min(o,s.length),a=0;while(i>0){let c=s.length-i;tn.ByteUtils.copy(s,e.bufToStore,e.pos,c,c+u),e.pos+=u,o-=u;let l;if(o===0){l=qk(e.id,e.n,new Uint8Array(e.bufToStore));let f=e.timeoutContext?.remainingTimeMS;if(f!=null&&f<=0)return Ya(e,new yr.MongoOperationTimeoutError(`Upload timed out after ${e.timeoutContext?.timeoutMS}ms`),n);if(++e.state.outstandingRequests,++a,k0(e,n))return;e.chunks.insertOne(l,{writeConcern:e.writeConcern,timeoutMS:f}).then(()=>{if(--e.state.outstandingRequests,--a,!a)r6(e,n)},(h)=>Ya(e,h,n)),o=e.chunkSizeBytes,e.pos=0,++e.n}i-=u,u=Math.min(o,i)}}function Dme(e,t){if(e.pos===0)return r6(e,t);let r=tn.ByteUtils.allocate(e.pos);tn.ByteUtils.copy(e.bufToStore,r,0,0,e.pos);let n=qk(e.id,e.n,r);if(k0(e,t))return;let s=e.timeoutContext?.remainingTimeMS;if(s!=null&&s<=0)return Ya(e,new yr.MongoOperationTimeoutError(`Upload timed out after ${e.timeoutContext?.timeoutMS}ms`),t);++e.state.outstandingRequests,e.chunks.insertOne(n,{writeConcern:e.writeConcern,timeoutMS:s}).then(()=>{--e.state.outstandingRequests,r6(e,t)},(i)=>Ya(e,i,t))}function k0(e,t){if(e.state.aborted)return queueMicrotask(()=>t(new yr.MongoAPIError("Stream has been aborted"))),!0;return!1}});var Yk=g(function(Hk){Object.defineProperty(Hk,"__esModule",{value:!0});Hk.GridFSBucket=void 0;var o1=J(),zk=Is(),q0=Gn(),da=ae(),Wk=Hn(),j0=t6(),L0=n6(),xme={bucketName:"fs",chunkSizeBytes:261120};class Kk extends zk.TypedEventEmitter{static{this.INDEX="index"}constructor(e,t){super();this.on("error",da.noop),this.setMaxListeners(0);let r=da.resolveOptions(e,{...xme,...t,writeConcern:Wk.WriteConcern.fromOptions(t)});this.s={db:e,options:r,_chunksCollection:e.collection(r.bucketName+".chunks"),_filesCollection:e.collection(r.bucketName+".files"),checkedIndexes:!1,calledOpenUploadStream:!1}}openUploadStream(e,t){return new L0.GridFSBucketWriteStream(this,e,{timeoutMS:this.s.options.timeoutMS,...t})}openUploadStreamWithId(e,t,r){return new L0.GridFSBucketWriteStream(this,t,{timeoutMS:this.s.options.timeoutMS,...r,id:e})}openDownloadStream(e,t){return new j0.GridFSBucketReadStream(this.s._chunksCollection,this.s._filesCollection,this.s.options.readPreference,{_id:{$eq:e}},{timeoutMS:this.s.options.timeoutMS,...t})}async delete(e,t){let{timeoutMS:r}=da.resolveOptions(this.s.db,t),n=void 0;if(r)n=new q0.CSOTTimeoutContext({timeoutMS:r,serverSelectionTimeoutMS:this.s.db.client.s.options.serverSelectionTimeoutMS});let{deletedCount:s}=await this.s._filesCollection.deleteOne({_id:{$eq:e}},{timeoutMS:n?.remainingTimeMS}),i=n?.remainingTimeMS;if(i!=null&&i<=0)throw new o1.MongoOperationTimeoutError(`Timed out after ${r}ms`);if(await this.s._chunksCollection.deleteMany({files_id:{$eq:e}},{timeoutMS:i}),s===0)throw new o1.MongoRuntimeError(`File not found for id ${e}`)}find(e={},t={}){return this.s._filesCollection.find(e,t)}openDownloadStreamByName(e,t){let r={uploadDate:-1},n=void 0;if(t&&t.revision!=null)if(t.revision>=0)r={uploadDate:1},n=t.revision;else n=-t.revision-1;return new j0.GridFSBucketReadStream(this.s._chunksCollection,this.s._filesCollection,this.s.options.readPreference,{filename:e},{timeoutMS:this.s.options.timeoutMS,...t,sort:r,skip:n})}async rename(e,t,r){let n={_id:{$eq:e}},s={$set:{filename:t}},{matchedCount:i}=await this.s._filesCollection.updateOne(n,s,r);if(i===0)throw new o1.MongoRuntimeError(`File with id ${e} not found`)}async drop(e){let{timeoutMS:t}=da.resolveOptions(this.s.db,e),r=void 0;if(t)r=new q0.CSOTTimeoutContext({timeoutMS:t,serverSelectionTimeoutMS:this.s.db.client.s.options.serverSelectionTimeoutMS});if(r){await this.s._filesCollection.drop({timeoutMS:r.remainingTimeMS});let n=r.getRemainingTimeMSOrThrow(`Timed out after ${t}ms`);await this.s._chunksCollection.drop({timeoutMS:n})}else await this.s._filesCollection.drop(),await this.s._chunksCollection.drop()}}Hk.GridFSBucket=Kk});var qu=g(function(N){Object.defineProperty(N,"__esModule",{value:!0});N.MongoRuntimeError=N.MongoParseError=N.MongoOperationTimeoutError=N.MongoOIDCError=N.MongoNotConnectedError=N.MongoNetworkTimeoutError=N.MongoNetworkError=N.MongoMissingDependencyError=N.MongoMissingCredentialsError=N.MongoKerberosError=N.MongoInvalidArgumentError=N.MongoGridFSStreamError=N.MongoGridFSChunkError=N.MongoGCPError=N.MongoExpiredSessionError=N.MongoError=N.MongoDriverError=N.MongoDecompressionError=N.MongoCursorInUseError=N.MongoCursorExhaustedError=N.MongoCompatibilityError=N.MongoClientClosedError=N.MongoClientBulkWriteExecutionError=N.MongoClientBulkWriteError=N.MongoClientBulkWriteCursorError=N.MongoChangeStreamError=N.MongoBatchReExecutionError=N.MongoAzureError=N.MongoAWSError=N.MongoAPIError=N.ExplainableCursor=N.ChangeStreamCursor=N.ClientEncryption=N.MongoBulkWriteError=N.UUID=N.Timestamp=N.ObjectId=N.MinKey=N.MaxKey=N.Long=N.Int32=N.Double=N.Decimal128=N.DBRef=N.Code=N.BSONType=N.BSONSymbol=N.BSONRegExp=N.Binary=N.BSON=void 0;N.CommandStartedEvent=N.CommandFailedEvent=N.WriteConcern=N.ReadPreference=N.ReadConcern=N.TopologyType=N.ServerType=N.ReadPreferenceMode=N.ReadConcernLevel=N.ProfilingLevel=N.ReturnDocument=N.SeverityLevel=N.MongoLoggableComponent=N.ServerApiVersion=N.ExplainVerbosity=N.MongoErrorLabel=N.CursorTimeoutMode=N.CURSOR_FLAGS=N.Compressor=N.AuthMechanism=N.GSSAPICanonicalizationValue=N.AutoEncryptionLoggerLevel=N.BatchType=N.UnorderedBulkOperation=N.OrderedBulkOperation=N.MongoClient=N.ListIndexesCursor=N.ListCollectionsCursor=N.GridFSBucketWriteStream=N.GridFSBucketReadStream=N.GridFSBucket=N.FindCursor=N.Db=N.Collection=N.ClientSession=N.ChangeStream=N.CancellationToken=N.AggregationCursor=N.Admin=N.AbstractCursor=N.MongoWriteConcernError=N.MongoUnexpectedServerResponseError=N.MongoTransactionError=N.MongoTopologyClosedError=N.MongoTailableCursorError=N.MongoSystemError=N.MongoStalePrimaryError=N.MongoServerSelectionError=N.MongoServerError=N.MongoServerClosedError=void 0;N.MongoClientAuthProviders=N.MongoCryptKMSRequestNetworkTimeoutError=N.MongoCryptInvalidArgumentError=N.MongoCryptError=N.MongoCryptCreateEncryptedCollectionError=N.MongoCryptCreateDataKeyError=N.MongoCryptAzureKMSRequestError=N.SrvPollingEvent=N.WaitingForSuitableServerEvent=N.ServerSelectionSucceededEvent=N.ServerSelectionStartedEvent=N.ServerSelectionFailedEvent=N.ServerSelectionEvent=N.TopologyOpeningEvent=N.TopologyDescriptionChangedEvent=N.TopologyClosedEvent=N.ServerOpeningEvent=N.ServerHeartbeatSucceededEvent=N.ServerHeartbeatStartedEvent=N.ServerHeartbeatFailedEvent=N.ServerDescriptionChangedEvent=N.ServerClosedEvent=N.ConnectionReadyEvent=N.ConnectionPoolReadyEvent=N.ConnectionPoolMonitoringEvent=N.ConnectionPoolCreatedEvent=N.ConnectionPoolClosedEvent=N.ConnectionPoolClearedEvent=N.ConnectionCreatedEvent=N.ConnectionClosedEvent=N.ConnectionCheckOutStartedEvent=N.ConnectionCheckOutFailedEvent=N.ConnectionCheckedOutEvent=N.ConnectionCheckedInEvent=N.CommandSucceededEvent=void 0;var Qk=jE();Object.defineProperty(N,"Admin",{enumerable:!0,get:function(){return Qk.Admin}});var Jk=LE();Object.defineProperty(N,"OrderedBulkOperation",{enumerable:!0,get:function(){return Jk.OrderedBulkOperation}});var Xk=UE();Object.defineProperty(N,"UnorderedBulkOperation",{enumerable:!0,get:function(){return Xk.UnorderedBulkOperation}});var Zk=pl();Object.defineProperty(N,"ChangeStream",{enumerable:!0,get:function(){return Zk.ChangeStream}});var eq=ll();Object.defineProperty(N,"Collection",{enumerable:!0,get:function(){return eq.Collection}});var tq=ps();Object.defineProperty(N,"AbstractCursor",{enumerable:!0,get:function(){return tq.AbstractCursor}});var rq=Nh();Object.defineProperty(N,"AggregationCursor",{enumerable:!0,get:function(){return rq.AggregationCursor}});var nq=c_();Object.defineProperty(N,"FindCursor",{enumerable:!0,get:function(){return nq.FindCursor}});var sq=S_();Object.defineProperty(N,"ListCollectionsCursor",{enumerable:!0,get:function(){return sq.ListCollectionsCursor}});var iq=d_();Object.defineProperty(N,"ListIndexesCursor",{enumerable:!0,get:function(){return iq.ListIndexesCursor}});var oq=em();Object.defineProperty(N,"Db",{enumerable:!0,get:function(){return oq.Db}});var uq=Yk();Object.defineProperty(N,"GridFSBucket",{enumerable:!0,get:function(){return uq.GridFSBucket}});var aq=t6();Object.defineProperty(N,"GridFSBucketReadStream",{enumerable:!0,get:function(){return aq.GridFSBucketReadStream}});var cq=n6();Object.defineProperty(N,"GridFSBucketWriteStream",{enumerable:!0,get:function(){return cq.GridFSBucketWriteStream}});var lq=Ua();Object.defineProperty(N,"MongoClient",{enumerable:!0,get:function(){return lq.MongoClient}});var hq=Is();Object.defineProperty(N,"CancellationToken",{enumerable:!0,get:function(){return hq.CancellationToken}});var fq=Fh();Object.defineProperty(N,"ClientSession",{enumerable:!0,get:function(){return fq.ClientSession}});var Pme=Se();Object.defineProperty(N,"BSON",{enumerable:!0,get:function(){return Pme.BSON}});var Jn=Se();Object.defineProperty(N,"Binary",{enumerable:!0,get:function(){return Jn.Binary}});Object.defineProperty(N,"BSONRegExp",{enumerable:!0,get:function(){return Jn.BSONRegExp}});Object.defineProperty(N,"BSONSymbol",{enumerable:!0,get:function(){return Jn.BSONSymbol}});Object.defineProperty(N,"BSONType",{enumerable:!0,get:function(){return Jn.BSONType}});Object.defineProperty(N,"Code",{enumerable:!0,get:function(){return Jn.Code}});Object.defineProperty(N,"DBRef",{enumerable:!0,get:function(){return Jn.DBRef}});Object.defineProperty(N,"Decimal128",{enumerable:!0,get:function(){return Jn.Decimal128}});Object.defineProperty(N,"Double",{enumerable:!0,get:function(){return Jn.Double}});Object.defineProperty(N,"Int32",{enumerable:!0,get:function(){return Jn.Int32}});Object.defineProperty(N,"Long",{enumerable:!0,get:function(){return Jn.Long}});Object.defineProperty(N,"MaxKey",{enumerable:!0,get:function(){return Jn.MaxKey}});Object.defineProperty(N,"MinKey",{enumerable:!0,get:function(){return Jn.MinKey}});Object.defineProperty(N,"ObjectId",{enumerable:!0,get:function(){return Jn.ObjectId}});Object.defineProperty(N,"Timestamp",{enumerable:!0,get:function(){return Jn.Timestamp}});Object.defineProperty(N,"UUID",{enumerable:!0,get:function(){return Jn.UUID}});var Fme=Hc();Object.defineProperty(N,"MongoBulkWriteError",{enumerable:!0,get:function(){return Fme.MongoBulkWriteError}});var Bme=Mm();Object.defineProperty(N,"ClientEncryption",{enumerable:!0,get:function(){return Bme.ClientEncryption}});var Nme=A_();Object.defineProperty(N,"ChangeStreamCursor",{enumerable:!0,get:function(){return Nme.ChangeStreamCursor}});var Ime=xp();Object.defineProperty(N,"ExplainableCursor",{enumerable:!0,get:function(){return Ime.ExplainableCursor}});var Ve=J();Object.defineProperty(N,"MongoAPIError",{enumerable:!0,get:function(){return Ve.MongoAPIError}});Object.defineProperty(N,"MongoAWSError",{enumerable:!0,get:function(){return Ve.MongoAWSError}});Object.defineProperty(N,"MongoAzureError",{enumerable:!0,get:function(){return Ve.MongoAzureError}});Object.defineProperty(N,"MongoBatchReExecutionError",{enumerable:!0,get:function(){return Ve.MongoBatchReExecutionError}});Object.defineProperty(N,"MongoChangeStreamError",{enumerable:!0,get:function(){return Ve.MongoChangeStreamError}});Object.defineProperty(N,"MongoClientBulkWriteCursorError",{enumerable:!0,get:function(){return Ve.MongoClientBulkWriteCursorError}});Object.defineProperty(N,"MongoClientBulkWriteError",{enumerable:!0,get:function(){return Ve.MongoClientBulkWriteError}});Object.defineProperty(N,"MongoClientBulkWriteExecutionError",{enumerable:!0,get:function(){return Ve.MongoClientBulkWriteExecutionError}});Object.defineProperty(N,"MongoClientClosedError",{enumerable:!0,get:function(){return Ve.MongoClientClosedError}});Object.defineProperty(N,"MongoCompatibilityError",{enumerable:!0,get:function(){return Ve.MongoCompatibilityError}});Object.defineProperty(N,"MongoCursorExhaustedError",{enumerable:!0,get:function(){return Ve.MongoCursorExhaustedError}});Object.defineProperty(N,"MongoCursorInUseError",{enumerable:!0,get:function(){return Ve.MongoCursorInUseError}});Object.defineProperty(N,"MongoDecompressionError",{enumerable:!0,get:function(){return Ve.MongoDecompressionError}});Object.defineProperty(N,"MongoDriverError",{enumerable:!0,get:function(){return Ve.MongoDriverError}});Object.defineProperty(N,"MongoError",{enumerable:!0,get:function(){return Ve.MongoError}});Object.defineProperty(N,"MongoExpiredSessionError",{enumerable:!0,get:function(){return Ve.MongoExpiredSessionError}});Object.defineProperty(N,"MongoGCPError",{enumerable:!0,get:function(){return Ve.MongoGCPError}});Object.defineProperty(N,"MongoGridFSChunkError",{enumerable:!0,get:function(){return Ve.MongoGridFSChunkError}});Object.defineProperty(N,"MongoGridFSStreamError",{enumerable:!0,get:function(){return Ve.MongoGridFSStreamError}});Object.defineProperty(N,"MongoInvalidArgumentError",{enumerable:!0,get:function(){return Ve.MongoInvalidArgumentError}});Object.defineProperty(N,"MongoKerberosError",{enumerable:!0,get:function(){return Ve.MongoKerberosError}});Object.defineProperty(N,"MongoMissingCredentialsError",{enumerable:!0,get:function(){return Ve.MongoMissingCredentialsError}});Object.defineProperty(N,"MongoMissingDependencyError",{enumerable:!0,get:function(){return Ve.MongoMissingDependencyError}});Object.defineProperty(N,"MongoNetworkError",{enumerable:!0,get:function(){return Ve.MongoNetworkError}});Object.defineProperty(N,"MongoNetworkTimeoutError",{enumerable:!0,get:function(){return Ve.MongoNetworkTimeoutError}});Object.defineProperty(N,"MongoNotConnectedError",{enumerable:!0,get:function(){return Ve.MongoNotConnectedError}});Object.defineProperty(N,"MongoOIDCError",{enumerable:!0,get:function(){return Ve.MongoOIDCError}});Object.defineProperty(N,"MongoOperationTimeoutError",{enumerable:!0,get:function(){return Ve.MongoOperationTimeoutError}});Object.defineProperty(N,"MongoParseError",{enumerable:!0,get:function(){return Ve.MongoParseError}});Object.defineProperty(N,"MongoRuntimeError",{enumerable:!0,get:function(){return Ve.MongoRuntimeError}});Object.defineProperty(N,"MongoServerClosedError",{enumerable:!0,get:function(){return Ve.MongoServerClosedError}});Object.defineProperty(N,"MongoServerError",{enumerable:!0,get:function(){return Ve.MongoServerError}});Object.defineProperty(N,"MongoServerSelectionError",{enumerable:!0,get:function(){return Ve.MongoServerSelectionError}});Object.defineProperty(N,"MongoStalePrimaryError",{enumerable:!0,get:function(){return Ve.MongoStalePrimaryError}});Object.defineProperty(N,"MongoSystemError",{enumerable:!0,get:function(){return Ve.MongoSystemError}});Object.defineProperty(N,"MongoTailableCursorError",{enumerable:!0,get:function(){return Ve.MongoTailableCursorError}});Object.defineProperty(N,"MongoTopologyClosedError",{enumerable:!0,get:function(){return Ve.MongoTopologyClosedError}});Object.defineProperty(N,"MongoTransactionError",{enumerable:!0,get:function(){return Ve.MongoTransactionError}});Object.defineProperty(N,"MongoUnexpectedServerResponseError",{enumerable:!0,get:function(){return Ve.MongoUnexpectedServerResponseError}});Object.defineProperty(N,"MongoWriteConcernError",{enumerable:!0,get:function(){return Ve.MongoWriteConcernError}});var $me=Hc();Object.defineProperty(N,"BatchType",{enumerable:!0,get:function(){return $me.BatchType}});var Rme=o3();Object.defineProperty(N,"AutoEncryptionLoggerLevel",{enumerable:!0,get:function(){return Rme.AutoEncryptionLoggerLevel}});var vme=nm();Object.defineProperty(N,"GSSAPICanonicalizationValue",{enumerable:!0,get:function(){return vme.GSSAPICanonicalizationValue}});var kme=co();Object.defineProperty(N,"AuthMechanism",{enumerable:!0,get:function(){return kme.AuthMechanism}});var qme=wh();Object.defineProperty(N,"Compressor",{enumerable:!0,get:function(){return qme.Compressor}});var dq=ps();Object.defineProperty(N,"CURSOR_FLAGS",{enumerable:!0,get:function(){return dq.CURSOR_FLAGS}});Object.defineProperty(N,"CursorTimeoutMode",{enumerable:!0,get:function(){return dq.CursorTimeoutMode}});var jme=J();Object.defineProperty(N,"MongoErrorLabel",{enumerable:!0,get:function(){return jme.MongoErrorLabel}});var Lme=pE();Object.defineProperty(N,"ExplainVerbosity",{enumerable:!0,get:function(){return Lme.ExplainVerbosity}});var Ume=Ua();Object.defineProperty(N,"ServerApiVersion",{enumerable:!0,get:function(){return Ume.ServerApiVersion}});var pq=Fu();Object.defineProperty(N,"MongoLoggableComponent",{enumerable:!0,get:function(){return pq.MongoLoggableComponent}});Object.defineProperty(N,"SeverityLevel",{enumerable:!0,get:function(){return pq.SeverityLevel}});var Vme=y_();Object.defineProperty(N,"ReturnDocument",{enumerable:!0,get:function(){return Vme.ReturnDocument}});var zme=b_();Object.defineProperty(N,"ProfilingLevel",{enumerable:!0,get:function(){return zme.ProfilingLevel}});var Wme=qi();Object.defineProperty(N,"ReadConcernLevel",{enumerable:!0,get:function(){return Wme.ReadConcernLevel}});var Kme=Ur();Object.defineProperty(N,"ReadPreferenceMode",{enumerable:!0,get:function(){return Kme.ReadPreferenceMode}});var mq=as();Object.defineProperty(N,"ServerType",{enumerable:!0,get:function(){return mq.ServerType}});Object.defineProperty(N,"TopologyType",{enumerable:!0,get:function(){return mq.TopologyType}});var Hme=qi();Object.defineProperty(N,"ReadConcern",{enumerable:!0,get:function(){return Hme.ReadConcern}});var Gme=Ur();Object.defineProperty(N,"ReadPreference",{enumerable:!0,get:function(){return Gme.ReadPreference}});var Yme=Hn();Object.defineProperty(N,"WriteConcern",{enumerable:!0,get:function(){return Yme.WriteConcern}});var s6=h3();Object.defineProperty(N,"CommandFailedEvent",{enumerable:!0,get:function(){return s6.CommandFailedEvent}});Object.defineProperty(N,"CommandStartedEvent",{enumerable:!0,get:function(){return s6.CommandStartedEvent}});Object.defineProperty(N,"CommandSucceededEvent",{enumerable:!0,get:function(){return s6.CommandSucceededEvent}});var mi=E3();Object.defineProperty(N,"ConnectionCheckedInEvent",{enumerable:!0,get:function(){return mi.ConnectionCheckedInEvent}});Object.defineProperty(N,"ConnectionCheckedOutEvent",{enumerable:!0,get:function(){return mi.ConnectionCheckedOutEvent}});Object.defineProperty(N,"ConnectionCheckOutFailedEvent",{enumerable:!0,get:function(){return mi.ConnectionCheckOutFailedEvent}});Object.defineProperty(N,"ConnectionCheckOutStartedEvent",{enumerable:!0,get:function(){return mi.ConnectionCheckOutStartedEvent}});Object.defineProperty(N,"ConnectionClosedEvent",{enumerable:!0,get:function(){return mi.ConnectionClosedEvent}});Object.defineProperty(N,"ConnectionCreatedEvent",{enumerable:!0,get:function(){return mi.ConnectionCreatedEvent}});Object.defineProperty(N,"ConnectionPoolClearedEvent",{enumerable:!0,get:function(){return mi.ConnectionPoolClearedEvent}});Object.defineProperty(N,"ConnectionPoolClosedEvent",{enumerable:!0,get:function(){return mi.ConnectionPoolClosedEvent}});Object.defineProperty(N,"ConnectionPoolCreatedEvent",{enumerable:!0,get:function(){return mi.ConnectionPoolCreatedEvent}});Object.defineProperty(N,"ConnectionPoolMonitoringEvent",{enumerable:!0,get:function(){return mi.ConnectionPoolMonitoringEvent}});Object.defineProperty(N,"ConnectionPoolReadyEvent",{enumerable:!0,get:function(){return mi.ConnectionPoolReadyEvent}});Object.defineProperty(N,"ConnectionReadyEvent",{enumerable:!0,get:function(){return mi.ConnectionReadyEvent}});var Qo=Gm();Object.defineProperty(N,"ServerClosedEvent",{enumerable:!0,get:function(){return Qo.ServerClosedEvent}});Object.defineProperty(N,"ServerDescriptionChangedEvent",{enumerable:!0,get:function(){return Qo.ServerDescriptionChangedEvent}});Object.defineProperty(N,"ServerHeartbeatFailedEvent",{enumerable:!0,get:function(){return Qo.ServerHeartbeatFailedEvent}});Object.defineProperty(N,"ServerHeartbeatStartedEvent",{enumerable:!0,get:function(){return Qo.ServerHeartbeatStartedEvent}});Object.defineProperty(N,"ServerHeartbeatSucceededEvent",{enumerable:!0,get:function(){return Qo.ServerHeartbeatSucceededEvent}});Object.defineProperty(N,"ServerOpeningEvent",{enumerable:!0,get:function(){return Qo.ServerOpeningEvent}});Object.defineProperty(N,"TopologyClosedEvent",{enumerable:!0,get:function(){return Qo.TopologyClosedEvent}});Object.defineProperty(N,"TopologyDescriptionChangedEvent",{enumerable:!0,get:function(){return Qo.TopologyDescriptionChangedEvent}});Object.defineProperty(N,"TopologyOpeningEvent",{enumerable:!0,get:function(){return Qo.TopologyOpeningEvent}});var uf=Q3();Object.defineProperty(N,"ServerSelectionEvent",{enumerable:!0,get:function(){return uf.ServerSelectionEvent}});Object.defineProperty(N,"ServerSelectionFailedEvent",{enumerable:!0,get:function(){return uf.ServerSelectionFailedEvent}});Object.defineProperty(N,"ServerSelectionStartedEvent",{enumerable:!0,get:function(){return uf.ServerSelectionStartedEvent}});Object.defineProperty(N,"ServerSelectionSucceededEvent",{enumerable:!0,get:function(){return uf.ServerSelectionSucceededEvent}});Object.defineProperty(N,"WaitingForSuitableServerEvent",{enumerable:!0,get:function(){return uf.WaitingForSuitableServerEvent}});var Qme=Z3();Object.defineProperty(N,"SrvPollingEvent",{enumerable:!0,get:function(){return Qme.SrvPollingEvent}});var u1=bl();Object.defineProperty(N,"MongoCryptAzureKMSRequestError",{enumerable:!0,get:function(){return u1.MongoCryptAzureKMSRequestError}});Object.defineProperty(N,"MongoCryptCreateDataKeyError",{enumerable:!0,get:function(){return u1.MongoCryptCreateDataKeyError}});Object.defineProperty(N,"MongoCryptCreateEncryptedCollectionError",{enumerable:!0,get:function(){return u1.MongoCryptCreateEncryptedCollectionError}});Object.defineProperty(N,"MongoCryptError",{enumerable:!0,get:function(){return u1.MongoCryptError}});Object.defineProperty(N,"MongoCryptInvalidArgumentError",{enumerable:!0,get:function(){return u1.MongoCryptInvalidArgumentError}});Object.defineProperty(N,"MongoCryptKMSRequestNetworkTimeoutError",{enumerable:!0,get:function(){return u1.MongoCryptKMSRequestNetworkTimeoutError}});var Jme=U3();Object.defineProperty(N,"MongoClientAuthProviders",{enumerable:!0,get:function(){return Jme.MongoClientAuthProviders}})});var le=g(function(t0e){t0e.arrayAtomicsBackupSymbol=Symbol("mongoose#Array#atomicsBackup");t0e.arrayAtomicsSymbol=Symbol("mongoose#Array#_atomics");t0e.arrayParentSymbol=Symbol("mongoose#Array#_parent");t0e.arrayPathSymbol=Symbol("mongoose#Array#_path");t0e.arraySchemaSymbol=Symbol("mongoose#Array#_schema");t0e.documentArrayParent=Symbol("mongoose#documentArrayParent");t0e.documentIsSelected=Symbol("mongoose#Document#isSelected");t0e.documentIsModified=Symbol("mongoose#Document#isModified");t0e.documentModifiedPaths=Symbol("mongoose#Document#modifiedPaths");t0e.documentSchemaSymbol=Symbol("mongoose#Document#schema");t0e.getSymbol=Symbol("mongoose#Document#get");t0e.modelSymbol=Symbol("mongoose#Model");t0e.objectIdSymbol=Symbol("mongoose#ObjectId");t0e.populateModelSymbol=Symbol("mongoose#PopulateOptions#Model");t0e.schemaTypeSymbol=Symbol("mongoose#schemaType");t0e.sessionNewDocuments=Symbol("mongoose#ClientSession#newDocuments");t0e.scopeSymbol=Symbol("mongoose#Document#scope");t0e.validatorErrorSymbol=Symbol("mongoose#validatorError")});var pa=g(function(uMe,yq){var af=Se().ObjectId,A0e=le().objectIdSymbol;Object.defineProperty(af.prototype,"_id",{enumerable:!1,configurable:!0,get:function(){return this}});/*!
29
+ * Convenience `valueOf()` to allow comparing ObjectIds using double equals re: gh-7299
30
+ */if(!Object.hasOwn(af.prototype,"valueOf"))af.prototype.valueOf=function(){return this.toString()};af.prototype[A0e]=!0;yq.exports=af});var Rn=g(function(aMe,gq){gq.exports=function(t){if(t==null)return;if(typeof t.constructor!=="function")return;return t.constructor.name}});var Ui=g(function(w0e){/*!
31
+ * ignore
32
+ */w0e.internalToObjectOptions={transform:!1,virtuals:!1,getters:!1,_skipDepopulateTopLevel:!0,depopulate:!0,flattenDecimals:!1,useProjection:!1,versionKey:!0,flattenObjectIds:!1,flattenUUIDs:!1}});var U0=g(function(lMe,Eq){Eq.exports=Se().Decimal128});var ma=g(function(hMe,_q){_q.exports=new Set(["__proto__","constructor","prototype"])});var a1=g(function(fMe,Aq){Aq.exports=function(t,r){if(t==null)return;let n=Object.getPrototypeOf(t);return n==null?void 0:n[r]}});var V0=g(function(S0e){S0e.isMongooseArray=function(e){return Array.isArray(e)&&e.isMongooseArray}});var gn=g(function(pMe,wq){var b0e=a1();wq.exports=function(t){return t!=null&&t.$isMongooseDocumentPrototype===!0&&b0e(t,"$isMongooseDocumentPrototype")===!0}});var cf=g(function(mMe,Oq){var D0e=a1(),T0e=V0().isMongooseArray,M0e=gn();Oq.exports=function(e){return e!=null&&(T0e(e)||M0e(e)||e.isMongooseBuffer&&Buffer.isBuffer(e)||e.$isMongooseMap&&D0e(e,"$isMongooseMap"))}});var i6=g(function(yMe,Sq){var x0e=/^function\s*([^\s(]+)/;Sq.exports=function(e){return e.name||(e.toString().trim().match(x0e)||[])[1]}});var vn=g(function(gMe,Cq){function P0e(e,t){return e!=null&&e._bsontype===t}Cq.exports=P0e});var Qa=g(function(EMe,bq){bq.exports=function(e){return Buffer.isBuffer(e)||Object.prototype.toString.call(e)==="[object Object]"}});var c1=g(function(F0e){var Dq=Symbol("mongoose#trustedSymbol");F0e.trustedSymbol=Dq;F0e.trusted=function(t){if(t==null||typeof t!=="object"&&typeof t!=="function")return t;return t[Dq]=!0,t}});var Zt=g(function(AMe,Bq){var xq=U0(),I0e=pa(),Pq=ma(),$0e=cf(),R0e=i6(),Tq=a1(),o6=vn(),v0e=V0().isMongooseArray,k0e=gn(),q0e=Qa(),Fq=le(),u6=c1().trustedSymbol,l1=Se(),Mq=l1.UUID,a6=l1.Binary;function lf(e,t,r){if(e==null)return e;if(o6(e,"Double"))return new l1.Double(e.value);if(typeof e==="number"||typeof e==="string"||typeof e==="boolean"||typeof e==="bigint")return e;if(Array.isArray(e))return j0e(e,t);if($0e(e)){if(t){if(t.flattenUUIDs){if(e instanceof a6&&e._subtype===a6.SUBTYPE_UUID)return e.toString();if(Buffer.isBuffer(e)&&e.isMongooseBuffer&&e._subtype===a6.SUBTYPE_UUID)return e.toUUID().toString()}if(t.retainDocuments&&k0e(e)){let i=e.$clone();if(e.__index!=null)i.__index=e.__index;if(e.__parentArray!=null)i.__parentArray=t.parentArray??e.__parentArray;return i.$__setParent(t.parentDoc??e.$__parent),i}if(t.retainDocuments&&Tq(e,"$isMongooseMap")){let i=t.parentDoc??e.$__parent,u=new e.constructor({},e.$__path,i,e.$__schemaType);for(let[a,c]of e)u.$__set(a,lf(c,{...t,parentDoc:i}));return u}}let s;if(t?.json&&typeof e.toJSON==="function")s=e.toJSON(t);else s=e.toObject(t);return s}let n=e.constructor;if(n)switch(R0e(n)){case"Object":if(Tq(e.$__,"strictMode")!=null&&e._doc!=null)return e._doc;return c6(e,t,r);case"Date":return new n(+e);case"RegExp":return L0e(e);default:break}if(o6(e,"ObjectId")){if(t?.flattenObjectIds)return e.toJSON();return new I0e(e.id)}if(o6(e,"Decimal128")){if(t?.flattenDecimals)return e.toJSON();return xq.fromString(e.toString())}if(e instanceof Mq){if(t?.flattenUUIDs)return e.toJSON();return new Mq(e.buffer)}if(!n&&q0e(e))return c6(e,t,r);if(typeof e==="object"&&e[Fq.schemaTypeSymbol])return e.clone();if(t?.bson&&typeof e.toBSON==="function")return e;if(typeof e.valueOf==="function")return e.valueOf();return c6(e,t,r)}Bq.exports=lf;/*!
33
+ * ignore
34
+ */function c6(e,t,r){let n=t?.minimize,s=t?.omitUndefined,i=t?._seen,o={},u;if(i&&i.has(e))return i.get(e);else if(i)i.set(e,o);if(u6 in e&&t?.copyTrustedSymbol!==!1)o[u6]=e[u6];let a=Object.keys(e),c=a.length;for(let l=0;l<c;++l){let f=a[l];if(Pq.has(f))continue;let h=lf(e[f],t,!1);if((n===!1||s)&&typeof h>"u")delete o[f];else if(n!==!0||typeof h<"u")u||(u=!0),o[f]=h}return n&&!r?u&&o:o}function j0e(e,t){let r=t?._seen;if(r&&r.has(e))return r.get(e);let n=0,s=e.length,i=null;if(t?.retainDocuments){let o=t.parentDoc??(e.isMongooseArray?e.$parent():void 0);if(e.isMongooseDocumentArray)i=new(e.$schemaType()).schema.base.Types.DocumentArray([],e.$path(),o,e.$schemaType());else if(e.isMongooseArray)i=new(e.$parent()).schema.base.Types.Array([],e.$path(),o,e.$schemaType());else i=Array(s)}else i=Array(s);if(r)r.set(e,i);if(e=v0e(e)?e.__array:e,i.isMongooseDocumentArray){t={...t,parentArray:i};for(n=0;n<s;++n){let o=lf(e[n],t,!0);if(typeof o?.$setIndex==="function")o.$setIndex(n);i.set(n,o,!0)}}else for(n=0;n<s;++n)i[n]=lf(e[n],t,!0);return i}function L0e(e){let t=new RegExp(e.source,e.flags);if(t.lastIndex!==e.lastIndex)t.lastIndex=e.lastIndex;return t}});var vq=g(function(wMe,Rq){/*!
35
+ * Module dependencies.
36
+ */var ya=$E(),l6=Le(),h6=qu().Collection,Nq=pa(),Iq=Rn(),U0e=Ui().internalToObjectOptions,$q=L("stream"),f1=L("util"),V0e=Object.freeze({...U0e,copyTrustedSymbol:!1});function Vi(e,t,r){this.collection=null,this.Promise=r.Promise||Promise,this.modelName=r.modelName,delete r.modelName,this._closed=!1,ya.apply(this,arguments)}/*!
37
+ * Inherit from abstract Collection.
38
+ */Object.setPrototypeOf(Vi.prototype,ya.prototype);Vi.prototype.onOpen=function(){return this.collection=this.conn.db.collection(this.name),ya.prototype.onOpen.call(this),this.collection};Vi.prototype.onClose=function(e){ya.prototype.onClose.call(this,e)};Vi.prototype._getCollection=function(){if(this.collection)return this.collection;if(this.conn.db!=null)return this.collection=this.conn.db.collection(this.name),this.collection;return null};function z0e(e){Vi.prototype[e]=function(){let t=this._getCollection(),r=arguments,n=this,s=n?.conn?.base?.options?.debug,i=n?.conn?.options?.debug,o=i==null?s:i;if(this.conn.$wasForceClosed){let h=new l6("Connection was force closed");if(r.length>0&&typeof r[r.length-1]==="function"){r[r.length-1](h);return}else throw h}let u=null,a=null,c=this.conn.listenerCount("operation-start")>0||this.conn.listenerCount("operation-end")>0;if(c||o)u=new Nq;let l=null,f=null;if(this._shouldBufferCommands()&&this.buffer){if(u==null)u=new Nq;this.conn.emit("buffer",{_id:u,modelName:n.modelName,collectionName:n.name,method:e,args:r});let h=this._getBufferTimeoutMS();return f=new Promise((d,p)=>{this.addQueue(d),l=setTimeout(()=>{if(this.removeQueue(d)){let E="Operation `"+this.name+"."+e+"()` buffering timed out after "+h+"ms",y=new l6(E);this.conn.emit("buffer-end",{_id:u,modelName:n.modelName,collectionName:n.name,method:e,error:y}),p(y)}},h)}),f.then(()=>{if(l)clearTimeout(l);return this[e].apply(this,r)})}if(o)if(typeof o==="function"){if(a==null)a=Array.from(r);let h=null;if(typeof a[a.length-1]=="function")h=a.slice(0,a.length-1);else h=a;o.apply(n,[n.name,e].concat(h))}else if(o instanceof $q.Writable)this.$printToStream(n.name,e,r,o);else{let h=o.color==null?!0:o.color,d=o.shell==null?!1:o.shell,p=o.timestamp==null?!1:o.timestamp;this.$print(n.name,e,r,h,d,p)}if(c){if(a==null)a=Array.from(r);this.conn.emit("operation-start",{_id:u,modelName:n.modelName,collectionName:this.name,method:e,params:a})}try{if(t==null){let d="Cannot call `"+this.name+"."+e+"()` before initial connection is complete if `bufferCommands = false`. Make sure you `await mongoose.connect()` if you have `bufferCommands = false`.";throw new l6(d)}let h=t[e].apply(t,r);if(typeof h?.then==="function")return h.then((d)=>{if(l!=null)clearTimeout(l);if(c)this.conn.emit("operation-end",{_id:u,modelName:n.modelName,collectionName:this.name,method:e,result:d});return d},(d)=>{if(l!=null)clearTimeout(l);if(c)this.conn.emit("operation-end",{_id:u,modelName:n.modelName,collectionName:this.name,method:e,error:d});throw d});if(c)this.conn.emit("operation-end",{_id:u,modelName:n.modelName,collectionName:this.name,method:e,result:h});if(l!=null)clearTimeout(l);return h}catch(h){if(l!=null)clearTimeout(l);if(c)this.conn.emit("operation-end",{_id:u,modelName:n.modelName,collectionName:this.name,method:e,error:h});throw h}}}for(let e of Object.getOwnPropertyNames(h6.prototype)){if(Object.getOwnPropertyDescriptor(h6.prototype,e).get!==void 0)continue;if(typeof h6.prototype[e]!=="function")continue;z0e(e)}Vi.prototype.$print=function(e,t,r,n,s,i){let o="";if(i){let f=new Date().toISOString();o=n?`\x1B[0;90m[${f}]\x1B[0m `:`[${f}] `}let u=n?"\x1B[0;36mMongoose:\x1B[0m ":"Mongoose: ",a=[e,t].join("."),c=[];for(let f=r.length-1;f>=0;--f)if(this.$format(r[f])||c.length)c.unshift(this.$format(r[f],n,s));let l="("+c.join(", ")+")";console.info(o+u+a+l)};Vi.prototype.$printToStream=function(e,t,r,n){let s=[e,t].join("."),i=[];for(let u=r.length-1;u>=0;--u)if(this.$format(r[u])||i.length)i.unshift(this.$format(r[u]));let o="("+i.join(", ")+")";n.write(s+o,"utf8")};Vi.prototype.$format=function(e,t,r){let n=typeof e;if(n==="function"||n==="undefined")return"";return f6(e,!1,t,r)};function h1(e){let t={inspect:function(){return e}};if(f1.inspect.custom)t[f1.inspect.custom]=t.inspect;return t}function W0e(e){return f6(e,!0)}function K0e(e,t){e[t]=h1('ObjectId("'+e[t].toHexString()+'")')}function H0e(e,t,r){if(r)e[t]=h1('ISODate("'+e[t].toUTCString()+'")');else e[t]=h1('new Date("'+e[t].toUTCString()+'")')}function f6(e,t,r,n){if(typeof e?.toBSON==="function")e=e.toBSON();if(e==null)return e;let s=Zt(),i=t?e:s(e,V0e),o=Iq(i);if(o==="Binary")i="BinData("+i.sub_type+', "'+i.toString("base64")+'")';else if(o==="ObjectId")i=h1('ObjectId("'+i.toHexString()+'")');else if(o==="Date")i=h1('new Date("'+i.toUTCString()+'")');else if(o==="Object"){let u=Object.keys(i),a=u.length,c;for(let l=0;l<a;++l)if(c=u[l],i[c]){let f;if(typeof i[c].toBSON==="function")try{i[c]=i[c].toBSON()}catch(d){f=d}let h=Iq(i[c]);if(h==="Binary")i[c]="BinData("+i[c].sub_type+', "'+i[c].buffer.toString("base64")+'")';else if(h==="Object")i[c]=f6(i[c],!0);else if(h==="ObjectId")K0e(i,c);else if(h==="Date")H0e(i,c,n);else if(h==="ClientSession")i[c]=h1('ClientSession("'+(i[c]?.id?.id?.buffer||"").toString("hex")+'")');else if(Array.isArray(i[c]))i[c]=i[c].map(W0e);else if(f!=null)throw f}}if(t)return i;return f1.inspect(i,!1,10,r).replace(/\n/g,"").replace(/\s{2,}/g," ")}Vi.prototype.getIndexes=Vi.prototype.indexInformation;/*!
39
+ * Module exports.
40
+ */Rq.exports=Vi});var d6=g(function(OMe,jq){/*!
41
+ * Module dependencies.
42
+ */var G0e=L("events").EventEmitter,hf=Le();/*!
43
+ * ignore
44
+ */var kq=["close","change","end","error","resumeTokenChanged"];/*!
45
+ * ignore
46
+ */class qq extends G0e{constructor(e,t,r){super();if(this.driverChangeStream=null,this.closed=!1,this.bindedEvents=!1,this.pipeline=t,this.options=r,this.errored=!1,r?.hydrate&&!r.model)throw Error("Cannot create change stream with `hydrate: true` unless calling `Model.watch()`");this.$driverChangeStreamPromise=e.then((n)=>(this.driverChangeStream=n,setImmediate(()=>this.emit("ready")),this),(n)=>{throw this.errored=!0,this.emit("error",n),n})}_bindEvents(){if(this.bindedEvents)return;if(this.bindedEvents=!0,this.driverChangeStream==null){this.$driverChangeStreamPromise.then(()=>{this.driverChangeStream.on("close",()=>{this.closed=!0}),kq.forEach((e)=>{this.driverChangeStream.on(e,(t)=>{if(t?.fullDocument!=null&&this.options?.hydrate)t.fullDocument=this.options.model.hydrate(t.fullDocument);this.emit(e,t)})})},()=>{});return}this.driverChangeStream.on("close",()=>{this.closed=!0}),kq.forEach((e)=>{this.driverChangeStream.on(e,(t)=>{if(t?.fullDocument!=null&&this.options?.hydrate)t.fullDocument=this.options.model.hydrate(t.fullDocument);this.emit(e,t)})})}hasNext(e){if(this.errored)throw new hf("Cannot call hasNext() on errored ChangeStream");if(this.driverChangeStream!=null)return this.driverChangeStream.hasNext(e);return this.$driverChangeStreamPromise.then(()=>this.driverChangeStream.hasNext(e),(t)=>{if(e!=null)return e(t);throw t})}next(e){if(this.errored)throw new hf("Cannot call next() on errored ChangeStream");if(this.options?.hydrate){if(e!=null){let r=e;e=(n,s)=>{if(n!=null)return r(n);if(s.fullDocument!=null)s.fullDocument=this.options.model.hydrate(s.fullDocument);return r(null,s)}}let t;if(this.driverChangeStream!=null)t=this.driverChangeStream.next(e);else t=this.$driverChangeStreamPromise.then(()=>this.driverChangeStream.next(e),(r)=>{if(e!=null)return e(r);throw r});if(typeof t?.then==="function")t=t.then((r)=>{if(r.fullDocument!=null)r.fullDocument=this.options.model.hydrate(r.fullDocument);return r});return t}if(this.driverChangeStream!=null)return this.driverChangeStream.next(e);return this.$driverChangeStreamPromise.then(()=>this.driverChangeStream.next(e),(t)=>{if(e!=null)return e(t);throw t})}addListener(e,t){if(this.errored)throw new hf("Cannot call addListener() on errored ChangeStream");return this._bindEvents(),super.addListener(e,t)}on(e,t){if(this.errored)throw new hf("Cannot call on() on errored ChangeStream");return this._bindEvents(),super.on(e,t)}once(e,t){if(this.errored)throw new hf("Cannot call once() on errored ChangeStream");return this._bindEvents(),super.once(e,t)}close(){if(this.closed=!0,this.driverChangeStream)return this.driverChangeStream.close();else return this.$driverChangeStreamPromise.then(()=>this.driverChangeStream.close(),()=>{})}}/*!
47
+ * ignore
48
+ */jq.exports=qq});var Ja=g(function(SMe,Uq){function tt(){this._pres=new Map,this._posts=new Map}tt.skipWrappedFunction=function(){if(!(this instanceof tt.skipWrappedFunction))return new tt.skipWrappedFunction(...arguments);this.args=[...arguments]};tt.overwriteResult=function(){if(!(this instanceof tt.overwriteResult))return new tt.overwriteResult(...arguments);this.args=[...arguments]};tt.overwriteArguments=function(){if(!(this instanceof tt.overwriteArguments))return new tt.overwriteArguments(...arguments);this.args=[...arguments]};tt.prototype.execPre=async function(t,r,n,s){let i=this._pres.get(t)||[];if(s?.filter)i=i.filter(s.filter);let o=i.length,u=n,a=null;if(!o)return u;for(let c of i)try{let l=c.fn.apply(r,u);if(p6(l)){let f=await l;if(f instanceof tt.overwriteArguments)u=f.args}else if(l instanceof tt.overwriteArguments)u=l.args}catch(l){if(l instanceof tt.skipWrappedFunction){a=l;continue}if(l instanceof tt.overwriteArguments){u=l.args;continue}throw l}if(a)throw a;return u};tt.prototype.execPreSync=function(e,t,r,n){let s=this._pres.get(e)||[];if(n?.filter)s=s.filter(n.filter);let i=s.length,o=r||[];for(let u=0;u<i;++u){let a=s[u].fn.apply(t,o);if(a instanceof tt.overwriteArguments)o=a.args}return o};tt.prototype.execPost=async function(t,r,n,s){let i=this._posts.get(t)||[];if(s?.filter)i=i.filter(s.filter);let o=i.length,u=null;if(s&&s.error)u=s.error;if(!o){if(u!=null)throw u;return n}let a=null,c,l,f=function(E){if(E)l(E);else c()},h=n.slice();z0(h,s?.numCallbackParams);let d=h.length;h.push(f);let p=s?.error?[u,...h]:null;for(let m of i){let E=m.fn;if(a=new Promise((y,_)=>{c=y,l=_}),u)if(Lq(m,d))try{let y=E.apply(r,p);if(p6(y))await y;else if(E.length===d+2)await a}catch(y){if(y instanceof tt.overwriteResult){n=y.args,h=n.slice(),z0(h,s?.numCallbackParams),d=h.length,h.push(f);continue}u=y,p=[u,...h]}else continue;else if(Lq(m,d))continue;else{let y=null;try{if(y=E.apply(r,h),p6(y))y=await y;else if(E.length===d+1)y=await a}catch(_){if(_ instanceof tt.overwriteResult){n=_.args,h=n.slice(),z0(h,s?.numCallbackParams),d=h.length,h.push(f),p=[u,...h];continue}u=_,p=[u,...h];continue}if(y instanceof tt.overwriteResult){n=y.args,h=n.slice(),z0(h,s?.numCallbackParams),d=h.length,h.push(f);continue}}}if(u!=null)throw u;return n};/*!
49
+ * Handle the `numCallbackParams` option for `execPostSync`: fill `newArgs` with `null` until
50
+ * length is `numCallbackParams` if `numCallbackParams` is a number.
51
+ *
52
+ * @param {Array} newArgs The arguments to fill
53
+ * @param {number|null|undefined} numCallbackParams The number of callback parameters
54
+ */function z0(e,t){if(typeof t==="number"&&t>e.length)for(let r=e.length;r<t;++r)e.push(null)}tt.prototype.execPostSync=function(e,t,r,n){let s=this._posts.get(e)||[];if(n?.filter)s=s.filter(n.filter);let i=s.length;for(let o=0;o<i;++o){let u=s[o].fn.apply(t,r||[]);if(u instanceof tt.overwriteResult)r=u.args}return r};tt.prototype.createWrapperSync=function(e,t,r,n){let s=this,i=n?.getOptions;return function(...u){let a=r??this,c=typeof i==="function"?i(u):{},l=c.pre??c,f=c.post??c,h=s.execPreSync(e,a,u,l),d=t.apply(a,h);return s.execPostSync(e,a,[d],f)[0]}};tt.prototype.wrap=async function(t,r,n,s,i){let o=i?.getOptions,u=typeof o==="function"?o(s):{},a=u.pre??u,c=u.post??u,l,f=!1,h=s;try{h=await this.execPre(t,n,s,a)}catch(d){if(d instanceof tt.skipWrappedFunction)l=d.args,f=!0;else await this.execPost(t,n,s,{...i,...c,error:d})}if(!f)l=await r.apply(n,h);return l=await this.execPost(t,n,[l],{...i,...c}),l[0]};tt.prototype.filter=function(e){let t=this.clone(),r=Array.from(t._pres.keys());for(let s of r){let i=this._pres.get(s).map((o)=>Object.assign({},o,{name:s})).filter(e);if(i.length===0){t._pres.delete(s);continue}t._pres.set(s,i)}let n=Array.from(t._posts.keys());for(let s of n){let i=this._posts.get(s).map((o)=>Object.assign({},o,{name:s})).filter(e);if(i.length===0){t._posts.delete(s);continue}t._posts.set(s,i)}return t};tt.prototype.hasHooks=function(e){return this._pres.has(e)||this._posts.has(e)};tt.prototype.createWrapper=function(e,t,r,n){let s=this;if(!this.hasHooks(e))return t;return function(...o){let u=r??this;return s.wrap(e,t,u,o,n)}};tt.prototype.pre=function(e,t,r,n,s){if(typeof t==="function")r=t,t={};else if(t==null)t={};let i=this._pres.get(e)||[];if(this._pres.set(e,i),typeof r!=="function")throw Error('pre() requires a function, got "'+typeof r+'"');if(s)i.unshift(Object.assign({},t,{fn:r}));else i.push(Object.assign({},t,{fn:r}));return this};tt.prototype.post=function(e,t,r,n){let s=this._posts.get(e)||[];if(typeof t==="function")n=!!r,r=t,t={};if(typeof r!=="function")throw Error('post() requires a function, got "'+typeof r+'"');if(n)s.unshift(Object.assign({},t,{fn:r}));else s.push(Object.assign({},t,{fn:r}));return this._posts.set(e,s),this};tt.prototype.postError=function(t,r,n,s){if(typeof r==="function")s=!!n,n=r,r={};return this.post(t,{...r,errorHandler:!0},n,s)};tt.prototype.clone=function(){let e=new tt;for(let t of this._pres.keys()){let r=this._pres.get(t).slice();e._pres.set(t,r)}for(let t of this._posts.keys())e._posts.set(t,this._posts.get(t).slice());return e};tt.prototype.merge=function(e,t){t=arguments.length===1?!0:t;let r=t?this.clone():this;for(let n of e._pres.keys()){let s=r._pres.get(n)||[],i=e._pres.get(n).filter((u)=>s.map((a)=>a.fn).indexOf(u.fn)===-1),o=s.concat(i);r._pres.set(n,o)}for(let n of e._posts.keys()){let s=r._posts.get(n)||[],i=e._posts.get(n).filter((o)=>s.indexOf(o)===-1);r._posts.set(n,s.concat(i))}return r};function p6(e){return typeof e==="object"&&e!==null&&typeof e.then==="function"}function Lq(e,t){if(e.errorHandler)return!0;return e.fn.length===t+2}Uq.exports=tt});var y6=g(function(CMe,zq){var Y0e=/^\d+$/;class m6{constructor(){this.children=new Map,this.terminal=!1,this.hasWildcard=!1}}class Vq{constructor(e){if(this.root=new m6,e!=null)for(let t of e)this.add(t)}add(e){if(e.indexOf(".")===-1){this._addSegment(this.root,e).terminal=!0;return}let t=this.root;for(let r of e.split("."))t=this._addSegment(t,r);t.terminal=!0}_addSegment(e,t){let r=e.children.get(t);if(r==null){if(r=new m6,e.children.set(t,r),t==="$*")e.hasWildcard=!0}return r}matchesPathOrAncestor(e){return this._walk(e)===!0}overlapsPath(e){return this._walk(e)!==!1}_walk(e){if(typeof e==="string"){let r=[],n=this.root.children.get(e);if(n!=null){if(n.terminal)return!0;r.push(n)}if(this.root.hasWildcard){let s=this.root.children.get("$*");if(s.terminal)return!0;r.push(s)}return r.length===0?!1:r}let t=[this.root];for(let r of e){let n=[],s=Y0e.test(r);for(let i of t){if(s)n.push(i);let o=i.children.get(r);if(o!=null){if(o.terminal)return!0;n.push(o)}if(i.hasWildcard){let u=i.children.get("$*");if(u.terminal)return!0;n.push(u)}}if(n.length===0)return!1;t=n}return t}}zq.exports=Vq});var Hq=g(function(bMe,Kq){class Wq{constructor(e){this.paths=[],this.schemaTypes=[],this.defaultsByNestedPath=new Map;for(let t of Object.keys(e.paths)){let r=e.paths[t];if(r.defaultValue===void 0)continue;let n=r.splitPath();if(n[n.length-1]==="$*")continue;this.paths.push(t),this.schemaTypes.push(r);let s="";for(let i=0;i<n.length-1;++i){if(s=i===0?n[0]:s+"."+n[i],e.nested[s]!==!0)continue;let o=this.defaultsByNestedPath.get(s);if(o==null)o={paths:[],schemaTypes:[],depth:i+1},this.defaultsByNestedPath.set(s,o);o.paths.push(t),o.schemaTypes.push(r)}}}}Kq.exports=Wq});var Qq=g(function(Gq,Yq){var En=Yq.exports=Gq={};En.DocumentNotFoundError=null;En.general={};En.general.default="Validator failed for path `{PATH}` with value `{VALUE}`";En.general.required="Path `{PATH}` is required.";En.general.allowNull="Path `{PATH}` does not allow null values.";En.Number={};En.Number.min="Path `{PATH}` ({VALUE}) is less than minimum allowed value ({MIN}).";En.Number.max="Path `{PATH}` ({VALUE}) is more than maximum allowed value ({MAX}).";En.Number.enum="`{VALUE}` is not a valid enum value for path `{PATH}`.";En.Date={};En.Date.min="Path `{PATH}` ({VALUE}) is before minimum allowed value ({MIN}).";En.Date.max="Path `{PATH}` ({VALUE}) is after maximum allowed value ({MAX}).";En.String={};En.String.enum="`{VALUE}` is not a valid enum value for path `{PATH}`.";En.String.match="Path `{PATH}` is invalid ({VALUE}).";En.String.minlength="Path `{PATH}` (`{VALUE}`, length {LENGTH}) is shorter than the minimum allowed length ({MINLENGTH}).";En.String.maxlength="Path `{PATH}` (`{VALUE}`, length {LENGTH}) is longer than the maximum allowed length ({MAXLENGTH})."});var kn=g(function(DMe,ej){/*!
55
+ * Module dependencies.
56
+ */var Q0e=Le(),Zq=L("util");class _6 extends Q0e{constructor(e,t,r,n,s){if(arguments.length>0){let i=Jq(t),o=Xq(s),u=g6(null,e,t,r,o,i,n);super(u);this.init(e,t,r,n,s)}else super(g6())}toJSON(){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}}init(e,t,r,n,s){/*!
57
+ * ignore
58
+ */this.stringValue=E6(t),this.messageFormat=Xq(s),this.kind=e,this.value=t,this.path=r,this.reason=n,this.valueType=Jq(t)}copy(e){this.messageFormat=e.messageFormat,this.stringValue=e.stringValue,this.kind=e.kind,this.value=e.value,this.path=e.path,this.reason=e.reason,this.message=e.message,this.valueType=e.valueType}setModel(e){/*!
59
+ * ignore
60
+ */this.message=g6(e,this.kind,this.value,this.path,this.messageFormat,this.valueType,this.reason)}}Object.defineProperty(_6.prototype,"name",{value:"CastError"});function E6(e){let t=Zq.inspect(e);if(t=t.replace(/^'|'$/g,'"'),!t.startsWith('"'))t='"'+t+'"';return t}function Jq(e){if(e==null)return""+e;let t=typeof e;if(t!=="object")return t;if(typeof e.constructor!=="function")return t;return e.constructor.name}function Xq(e){let t=e?._castErrorMessage||null;if(typeof t==="string"||typeof t==="function")return t}/*!
61
+ * ignore
62
+ */function g6(e,t,r,n,s,i,o){if(typeof s==="string"){let u=E6(r),a=s.replace("{KIND}",t).replace("{VALUE}",u).replace("{PATH}",n);if(e!=null)a=a.replace("{MODEL}",e.modelName);return a}else if(typeof s==="function")return s(r,n,e,t);else{let u=E6(r),a=i?" (type "+i+")":"",c="Cast to "+t+" failed for value "+u+a+' at path "'+n+'"';if(e!=null)c+=' for model "'+e.modelName+'"';if(o!=null&&typeof o.constructor==="function"&&o.constructor.name!=="AssertionError"&&o.constructor.name!=="Error"&&o.constructor.name!=="BSONError")c+=' because of "'+o.constructor.name+'"';return c}}/*!
63
+ * exports
64
+ */ej.exports=_6});var W0=g(function(TMe,rj){/*!
65
+ * Module dependencies.
66
+ */var A6=Le(),tj=L("util");class w6 extends A6{constructor(e,t,r,n){let s,i=A6.messages;if(i.DocumentNotFoundError!=null)s=typeof i.DocumentNotFoundError==="function"?i.DocumentNotFoundError(e,t):i.DocumentNotFoundError;else s='No document found for query "'+tj.inspect(e)+'" on model "'+t+'"';super(s);this.result=n,this.numAffected=r,this.filter=e,this.query=e}}Object.defineProperty(w6.prototype,"name",{value:"DocumentNotFoundError"});/*!
67
+ * exports
68
+ */rj.exports=w6});var O6=g(function(MMe,nj){/*!
69
+ * ignore
70
+ */nj.exports=function(t){let r=Object.keys(t.errors||{}),n=r.length,s=[],i;for(let o=0;o<n;++o){if(i=r[o],t===t.errors[i])continue;s.push(i+": "+t.errors[i].message)}return s.join(", ")}});var Za=g(function(xMe,ij){/*!
71
+ * Module requirements
72
+ */var J0e=Le(),X0e=Rn(),K0=L("util"),sj=O6();class Xa extends J0e{constructor(e){let t;if(X0e(e)==="model")t=e.constructor.modelName+" validation failed";else t="Validation failed";super(t);if(this.errors={},this._message=t,e)e.$errors=this.errors}toString(){return this.name+": "+sj(this)}addError(e,t){if(t instanceof Xa){let{errors:r}=t;for(let n of Object.keys(r))this.addError(`${e}.${n}`,r[n]);return}this.errors[e]=t,this.message=this._message+": "+sj(this)}}if(K0.inspect.custom)Xa.prototype[K0.inspect.custom]=Xa.prototype.inspect;Object.defineProperty(Xa.prototype,"toJSON",{enumerable:!1,writable:!1,configurable:!0,value:function(){return Object.assign({},this,{name:this.name,message:this.message})}});Object.defineProperty(Xa.prototype,"name",{value:"ValidationError"});/*!
73
+ * Module exports
74
+ */ij.exports=Xa});var C6=g(function(PMe,aj){/*!
75
+ * Module dependencies.
76
+ */var S6=Le(),oj=L("util");class ff extends S6{constructor(e,t){let r=e.message;if(!r)r=S6.messages.general.default;let n=uj(r,e,t);super(n);e=Object.assign({},e,{message:n}),this.properties=e,this.kind=e.type,this.path=e.path,this.value=e.value,this.reason=e.reason}toString(){return this.message}toJSON(){return Object.assign({name:this.name,message:this.message},this)}}Object.defineProperty(ff.prototype,"name",{value:"ValidatorError"});Object.defineProperty(ff.prototype,"properties",{enumerable:!1,writable:!0,value:null});ff.prototype.formatMessage=uj;function uj(e,t,r){if(typeof e==="function")return e(t,r);let n=Object.keys(t);for(let s of n){if(s==="message")continue;let i="{"+s.toUpperCase()+"}";if(!e.includes(i))continue;let o;try{o=String(t[s])}catch{o=oj.inspect(t[s])}e=e.replace(i,o)}return e}/*!
77
+ * exports
78
+ */aj.exports=ff});var D6=g(function(FMe,cj){/*!
79
+ * Module dependencies.
80
+ */var Z0e=Le();class b6 extends Z0e{constructor(e,t,r){let n=r.join(", ");super('No matching document found for id "'+e._doc._id+'" version '+t+' modifiedPaths "'+n+'"');this.version=t,this.modifiedPaths=r}}Object.defineProperty(b6.prototype,"name",{value:"VersionError"});/*!
81
+ * exports
82
+ */cj.exports=b6});var M6=g(function(BMe,lj){/*!
83
+ * Module dependencies.
84
+ */var eye=Le();class T6 extends eye{constructor(e){super("Can't save() the same doc multiple times in parallel. Document: "+e._doc._id)}}Object.defineProperty(T6.prototype,"name",{value:"ParallelSaveError"});/*!
85
+ * exports
86
+ */lj.exports=T6});var P6=g(function(NMe,hj){/*!
87
+ * Module dependencies.
88
+ */var tye=Le();class x6 extends tye{constructor(e){super("Cannot overwrite `"+e+"` model once compiled.")}}Object.defineProperty(x6.prototype,"name",{value:"OverwriteModelError"});/*!
89
+ * exports
90
+ */hj.exports=x6});var dj=g(function(IMe,fj){/*!
91
+ * Module dependencies.
92
+ */var rye=Le();class F6 extends rye{constructor(e){let t=`Schema hasn't been registered for model "`+e+`".
93
+ Use mongoose.model(name, schema)`;super(t)}}Object.defineProperty(F6.prototype,"name",{value:"MissingSchemaError"});/*!
94
+ * exports
95
+ */fj.exports=F6});var N6=g(function($Me,pj){/*!
96
+ * Module dependencies.
97
+ */var nye=Le();class B6 extends nye{constructor(e,t,r){let n=r?.matchedCount??0,s=r?.insertedCount??0,i=t.map((u)=>u._id).join(", ");if(i.length>100)i=i.slice(0,100)+"...";let o=t.length-n-s;super(`${e}.bulkSave() was not able to update ${o} of the given documents due to incorrect version or optimistic concurrency, document ids: ${i}`);this.modelName=e,this.documents=t,this.bulkWriteResult=r,this.numDocumentsNotUpdated=o}}Object.defineProperty(B6.prototype,"name",{value:"MongooseBulkSaveIncompleteError"});/*!
98
+ * exports
99
+ */pj.exports=B6});var yj=g(function(RMe,mj){var sye=Rn();mj.exports=function(t){if(sye(t)!=="TopologyDescription")return!1;let r=Array.from(t.servers.values());return r.length>0&&r.every((n)=>n.type==="Unknown")}});var Ej=g(function(vMe,gj){var iye=Rn();gj.exports=function(t){if(iye(t)!=="TopologyDescription")return!1;if(t.servers.size===0)return!1;for(let r of t.servers.values())if(r.host.endsWith(".mongodb.net")===!1||r.port!==27017)return!1;return!0}});var Aj=g(function(kMe,_j){var oye=Rn(),uye="Client network socket disconnected before secure TLS connection was established";_j.exports=function(t){if(oye(t)!=="TopologyDescription")return!1;let r=Array.from(t.servers.values());return r.length>0&&r.every((n)=>n.error&&n.error.message.indexOf(uye)!==-1)}});var $6=g(function(qMe,wj){/*!
100
+ * Module dependencies.
101
+ */var aye=Le(),cye=yj(),lye=Ej(),hye=Aj();/*!
102
+ * ignore
103
+ */var fye="Could not connect to any servers in your MongoDB Atlas cluster. One common reason is that you're trying to access the database from an IP that isn't whitelisted. Make sure your current IP address is on your Atlas cluster's IP whitelist: https://www.mongodb.com/docs/atlas/security-whitelist/",dye="Mongoose is connecting with SSL enabled, but the server is not accepting SSL connections. Please ensure that the MongoDB server you are connecting to is configured to accept SSL connections. Learn more: https://mongoosejs.com/docs/tutorials/ssl.html";class I6 extends aye{assimilateError(e){let t=e.reason;if(lye(t)&&cye(t)&&e.message.indexOf("bad auth")===-1&&e.message.indexOf("Authentication failed")===-1)this.message=fye;else if(hye(t))this.message=dye;else this.message=e.message;for(let n in e)if(n!=="name")this[n]=e[n];return this.cause=t,this}}Object.defineProperty(I6.prototype,"name",{value:"MongooseServerSelectionError"});wj.exports=I6});var v6=g(function(jMe,Oj){/*!
104
+ * Module dependencies.
105
+ */var pye=Le();class R6 extends pye{constructor(e){let t="For your own good, using `document.save()` to update an array which was selected using an $elemMatch or $slice projection OR populated using skip, limit, query conditions, or exclusion of the _id field when the operation results in a $pop or $set of the entire array is not supported. The following path(s) would have been modified unsafely:\n "+e.join(`
106
+ `)+`
107
+ Use Model.updateOne() to update these arrays instead. See https://mongoosejs.com/docs/faq.html#divergent-array-error for more information.`;super(t)}}Object.defineProperty(R6.prototype,"name",{value:"DivergentArrayError"});/*!
108
+ * exports
109
+ */Oj.exports=R6});var ga=g(function(LMe,Sj){/*!
110
+ * Module dependencies.
111
+ */var mye=Le();class k6 extends mye{constructor(e,t,r){t=t||"Field `"+e+"` is not in schema and strict mode is set to throw.";super(t);this.isImmutableError=!!r,this.path=e}}Object.defineProperty(k6.prototype,"name",{value:"StrictModeError"});Sj.exports=k6});var j6=g(function(UMe,Cj){/*!
112
+ * Module dependencies.
113
+ */var yye=Le();class q6 extends yye{constructor(e,t){t=t||"Cannot populate path `"+e+"` because it is not in your schema. Set the `strictPopulate` option to false to override.";super(t);this.path=e}}Object.defineProperty(q6.prototype,"name",{value:"StrictPopulateError"});Cj.exports=q6});var Rs=g(function(bj,Dj){var rn=Le();/*!
114
+ * Module exports.
115
+ */Dj.exports=bj=rn;rn.messages=Qq();rn.Messages=rn.messages;rn.CastError=kn();rn.DocumentNotFoundError=W0();rn.ValidationError=Za();rn.ValidatorError=C6();rn.VersionError=D6();rn.ParallelSaveError=M6();rn.OverwriteModelError=P6();rn.MissingSchemaError=dj();rn.MongooseBulkSaveIncompleteError=N6();rn.MongooseServerSelectionError=$6();rn.DivergentArrayError=v6();rn.StrictModeError=ga();rn.StrictPopulateError=j6()});var vs=g(function(VMe,Tj){Tj.exports=Object.freeze({enumerable:!0,configurable:!0,writable:!0,value:void 0})});var As=g(function(zMe,Mj){var gye=Zt();class _n{constructor(e){if(e==null)return this;Object.assign(this,gye(e))}}var Xn=vs();Object.defineProperty(_n.prototype,"type",Xn);Object.defineProperty(_n.prototype,"validate",Xn);Object.defineProperty(_n.prototype,"cast",Xn);Object.defineProperty(_n.prototype,"required",Xn);Object.defineProperty(_n.prototype,"allowNull",Xn);Object.defineProperty(_n.prototype,"default",Xn);Object.defineProperty(_n.prototype,"ref",Xn);Object.defineProperty(_n.prototype,"refPath",Xn);Object.defineProperty(_n.prototype,"select",Xn);Object.defineProperty(_n.prototype,"index",Xn);Object.defineProperty(_n.prototype,"unique",Xn);Object.defineProperty(_n.prototype,"immutable",Xn);Object.defineProperty(_n.prototype,"sparse",Xn);Object.defineProperty(_n.prototype,"text",Xn);Object.defineProperty(_n.prototype,"transform",Xn);Mj.exports=_n});var H0=g(function(WMe,d1){var Eye=kn();d1.exports=function(t,r){if(d1.exports.convertToTrue.has(t))return!0;if(d1.exports.convertToFalse.has(t))return!1;if(t==null)return t;throw new Eye("boolean",t,r)};d1.exports.convertToTrue=new Set([!0,"true",1,"1","yes"]);d1.exports.convertToFalse=new Set([!1,"false",0,"0","no"])});var G0=g(function(KMe,xj){var _ye=H0();/*!
116
+ * ignore
117
+ */xj.exports=function(e){let t=this?.path??null;return _ye(e,t)}});var L6=g(function(HMe,Pj){/*!
118
+ * ignore
119
+ */Pj.exports=function(e){if(Array.isArray(e)){if(!e.every((t)=>typeof t==="number"||typeof t==="string"))throw Error("$type array values must be strings or numbers");return e}if(typeof e!=="number"&&typeof e!=="string")throw Error("$type parameter must be number, string, or array of numbers and strings");return e}});var yi=g(function(GMe,Fj){Fj.exports=function(t,r){for(let n=t;n!=null&&n!==Object.prototype;n=Object.getPrototypeOf(n))if(Object.hasOwn(n,r))return n[r];return}});var Nj=g(function(YMe,Bj){var Aye=ga();/*!
120
+ * ignore
121
+ */Bj.exports=function(e){if(e.$immutable)e.$immutableSetter=wye(e.path,e.options.immutable),e.set(e.$immutableSetter);else if(e.$immutableSetter)e.setters=e.setters.filter((t)=>t!==e.$immutableSetter),delete e.$immutableSetter};function wye(e,t){return function(n,s,i,o){if(this==null||this.$__==null)return n;if(this.isNew)return n;if(o?.overwriteImmutable)return n;if(!(typeof t==="function"?t.call(this,this):t))return n;let a=this.$__.priorDoc!=null?this.$__.priorDoc.$__getValue(e):this.$__getValue(e);if(this.$__.strictMode==="throw"&&n!==a)throw new Aye(e,"Path `"+e+"` is immutable and strict mode is set to throw.",!0);return a}}});var $j=g(function(QMe,Ij){Ij.exports=function(t){return typeof t==="function"&&t.constructor&&t.constructor.name==="AsyncFunction"}});var vj=g(function(JMe,Rj){Rj.exports=function(t){let r=Object.keys(t),n=!0;for(let s=0,i=r.length;s<i;++s)if(typeof t[r[s]]==="object"&&t[r[s]]!==null){n=!1;break}return n}});var qj=g(function(XMe,kj){var p1=1000,m1=p1*60,y1=m1*60,ec=y1*24,Oye=ec*7,Sye=ec*365.25;kj.exports=function(e,t){t=t||{};var r=typeof e;if(r==="string"&&e.length>0)return Cye(e);else if(r==="number"&&isFinite(e))return t.long?Dye(e):bye(e);throw Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function Cye(e){if(e=String(e),e.length>100)return;var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(!t)return;var r=parseFloat(t[1]),n=(t[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return r*Sye;case"weeks":case"week":case"w":return r*Oye;case"days":case"day":case"d":return r*ec;case"hours":case"hour":case"hrs":case"hr":case"h":return r*y1;case"minutes":case"minute":case"mins":case"min":case"m":return r*m1;case"seconds":case"second":case"secs":case"sec":case"s":return r*p1;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}function bye(e){var t=Math.abs(e);if(t>=ec)return Math.round(e/ec)+"d";if(t>=y1)return Math.round(e/y1)+"h";if(t>=m1)return Math.round(e/m1)+"m";if(t>=p1)return Math.round(e/p1)+"s";return e+"ms"}function Dye(e){var t=Math.abs(e);if(t>=ec)return Y0(e,t,ec,"day");if(t>=y1)return Y0(e,t,y1,"hour");if(t>=m1)return Y0(e,t,m1,"minute");if(t>=p1)return Y0(e,t,p1,"second");return e+" ms"}function Y0(e,t,r,n){var s=t>=r*1.5;return Math.round(e/r)+" "+n+(s?"s":"")}});var Lj=g(function(ZMe,jj){jj.exports=function(t){let r=[],n="",s="DEFAULT";for(let i=0;i<t.length;++i){if(s==="IN_SQUARE_BRACKETS"&&!/\d/.test(t[i])&&t[i]!=="]")s="DEFAULT",n=r[r.length-1]+"["+n,r.splice(r.length-1,1);if(t[i]==="["){if(s!=="IMMEDIATELY_AFTER_SQUARE_BRACKETS")r.push(n),n="";s="IN_SQUARE_BRACKETS"}else if(t[i]==="]")if(s==="IN_SQUARE_BRACKETS")s="IMMEDIATELY_AFTER_SQUARE_BRACKETS",r.push(n),n="";else s="DEFAULT",n+=t[i];else if(t[i]==="."){if(s!=="IMMEDIATELY_AFTER_SQUARE_BRACKETS")r.push(n),n="";s="DEFAULT"}else n+=t[i]}if(s!=="IMMEDIATELY_AFTER_SQUARE_BRACKETS")r.push(n);return r}});var Kj=g(function(Tye){var df=Lj(),Vj=["__proto__","constructor","prototype"];Tye.get=function(e,t,r,n){var s;if(typeof r=="function")if(r.length<2)n=r,r=void 0;else s=r,r=void 0;n||(n=Wj);var i=typeof e=="string"?df(e):e;if(!Array.isArray(i))throw TypeError("Invalid `path`. Must be either string or array");var o=t,u;for(var a=0;a<i.length;++a){if(u=i[a],typeof i[a]!=="string"&&typeof i[a]!=="number")throw TypeError("Each segment of path to `get()` must be a string or number, got "+typeof i[a]);if(Array.isArray(o)&&!/^\d+$/.test(u)){var c=i.slice(a);return[].concat(o).map(function(f){return f?Tye.get(c,f,r||s,n):n(void 0)})}if(s)o=s(o,u);else{var l=r&&o[r]?o[r]:o;o=l instanceof Map?l.get(u):l[u]}if(!o)return n(o)}return n(o)};Tye.has=function(e,t){var r=typeof e==="string"?df(e):e;if(!Array.isArray(r))throw TypeError("Invalid `path`. Must be either string or array");var n=r.length,s=t;for(var i=0;i<n;++i){if(typeof r[i]!=="string"&&typeof r[i]!=="number")throw TypeError("Each segment of path to `has()` must be a string or number, got "+typeof r[i]);if(s==null||typeof s!=="object"||!(r[i]in s))return!1;s=s[r[i]]}return!0};Tye.unset=function(e,t){var r=typeof e==="string"?df(e):e;if(!Array.isArray(r))throw TypeError("Invalid `path`. Must be either string or array");var n=r.length,s=t;for(var i=0;i<n;++i){if(s==null||typeof s!=="object"||!(r[i]in s))return!1;if(typeof r[i]!=="string"&&typeof r[i]!=="number")throw TypeError("Each segment of path to `unset()` must be a string or number, got "+typeof r[i]);if(Vj.indexOf(r[i])!==-1)return!1;if(i===n-1)return delete s[r[i]],!0;s=s instanceof Map?s.get(r[i]):s[r[i]]}return!0};Tye.set=function(e,t,r,n,s,i){var o;if(typeof n=="function")if(n.length<2)s=n,n=void 0;else o=n,n=void 0;s||(s=Wj);var u=typeof e=="string"?df(e):e;if(!Array.isArray(u))throw TypeError("Invalid `path`. Must be either string or array");if(r==null)return;for(var a=0;a<u.length;++a){if(typeof u[a]!=="string"&&typeof u[a]!=="number")throw TypeError("Each segment of path to `set()` must be a string or number, got "+typeof u[a]);if(Vj.indexOf(u[a])!==-1)return}var c=i||/\$/.test(e)&&i!==!1,l=r,f;for(var a=0,h=u.length-1;a<h;++a){if(f=u[a],f=="$")if(a==h-1)break;else continue;if(Array.isArray(l)&&!/^\d+$/.test(f)){var d=u.slice(a);if(!c&&Array.isArray(t))for(var p=0;p<l.length&&p<t.length;++p)Tye.set(d,t[p],l[p],n||o,s,c);else for(var p=0;p<l.length;++p)Tye.set(d,t,l[p],n||o,s,c);return}if(o)l=o(l,f);else{var m=n&&l[n]?l[n]:l;l=m instanceof Map?m.get(f):m[f]}if(!l)return}if(f=u[h],n&&l[n])l=l[n];if(Array.isArray(l)&&!/^\d+$/.test(f))if(!c&&Array.isArray(t))zj(l,t,f,o,n,s);else for(var p=0;p<l.length;++p){var E=l[p];if(E)if(o)o(E,f,s(t));else{if(E[n])E=E[n];E[f]=s(t)}}else if(o)o(l,f,s(t));else if(l instanceof Map)l.set(f,s(t));else l[f]=s(t)};/*!
122
+ * Split a string path into components delimited by '.' or
123
+ * '[\d+]'
124
+ *
125
+ * #### Example:
126
+ * stringToParts('foo[0].bar.1'); // ['foo', '0', 'bar', '1']
127
+ */Tye.stringToParts=df;/*!
128
+ * Recursively set nested arrays
129
+ */function zj(e,t,r,n,s,i){for(var o,u=0;u<e.length&&u<t.length;++u)if(o=e[u],Array.isArray(o)&&Array.isArray(t[u]))zj(o,t[u],r,n,s,i);else if(o)if(n)n(o,r,i(t[u]));else{if(o[s])o=o[s];o[r]=i(t[u])}}/*!
130
+ * Returns the value passed to it.
131
+ */function Wj(e){return e}});var ks=g(function(Hj,Gj){Gj.exports=Hj=Kj()});var Q0=g(function(txe,Qj){var Fye=Zt();class Yj{constructor(e){if(this._docs={},this._childDocs=[],e==null)return;if(e=Fye(e),Object.assign(this,e),typeof e.subPopulate==="object")this.populate=e.subPopulate;if(e.perDocumentLimit!=null&&e.limit!=null)throw Error("Can not use `limit` and `perDocumentLimit` at the same time. Path: `"+e.path+"`.")}}Qj.exports=Yj});var Jj=g(function(Bye){Bye.isMongooseDocumentArray=function(e){return Array.isArray(e)&&e.isMongooseDocumentArray}});var Co=g(function(nxe,Xj){Xj.exports=function(t){if(t==null||typeof t!=="object")return!1;let r=Object.getPrototypeOf(t);return!r||r.constructor.name==="Object"}});var J0=g(function(sxe,Zj){Zj.exports=function(t,r,n){let s=Object.keys(r.tree),i={};for(let o of s){if(n&&(t.paths[o]||t.nested[o]||t.singleNestedPaths[o]))continue;i[o]=r.tree[o]}t.options._isMerging=!0,t.add(i,null),delete t.options._isMerging,t.callQueue=t.callQueue.concat(r.callQueue),t.method(r.methods),t.static(r.statics);for(let[o,u]of Object.entries(r._userProvidedOptions))if(!(o in t._userProvidedOptions))t.set(o,u);for(let o in r.query)t.query[o]=r.query[o];for(let o in r.virtuals)t.virtuals[o]=r.virtuals[o].clone();t._indexes=t._indexes.concat(r._indexes||[]),t.s.hooks.merge(r.s.hooks,!1)}});var rL=g(function(eL,tL){/*!
132
+ * Module dependencies.
133
+ */var ixe=we(),gi=tL.exports=eL=function(){};gi.ctor=function(){let e=[...arguments],t=function(){this.paths={},this.states={}};return t.prototype=new gi,t.prototype.constructor=t,t.prototype.stateNames=e,e.forEach(function(r){t.prototype[r]=function(n){this._changeState(n,r)}}),t};gi.prototype._changeState=function(t,r){let n=this.paths[t];if(n===r)return;if(n!==void 0){let i=this.states[n];if(i)delete i[t]}this.paths[t]=r;let s=this.states[r];if(s==null)s=this.states[r]={};s[t]=!0};/*!
134
+ * ignore
135
+ */gi.prototype.clearAllExcept=function(t){let r=this.states[t],n=r==null?[]:Object.keys(r);if(n.length===0){this.paths={},this.states={};return}this.paths={};for(let s of n)this.paths[s]=t;this.states={[t]:this.states[t]}};/*!
136
+ * ignore
137
+ */gi.prototype.clear=function(t){if(this.states[t]==null)return;let r=Object.keys(this.states[t]);if(r.length===0)return;this.states[t]={};let n=r.length;while(n--)delete this.paths[r[n]]};/*!
138
+ * ignore
139
+ */gi.prototype.clearPath=function(t){let r=this.paths[t];if(!r)return;delete this.paths[t],delete this.states[r][t]};gi.prototype.getStatePaths=function(t){if(this.states[t]!=null)return this.states[t];return{}};gi.prototype.some=function(){let t=this,r=arguments.length?arguments:this.stateNames;return Array.prototype.some.call(r,function(n){if(t.states[n]==null)return!1;return Object.keys(t.states[n]).length})};gi.prototype._iter=function(t){return function(){let r=[...arguments],n=r.pop();if(!r.length)r=this.stateNames;let s=this;return r.reduce(function(o,u){if(s.states[u]==null)return o;return o.concat(Object.keys(s.states[u]))},[])[t](function(o,u,a){return n(o,u,a)})}};gi.prototype.forEach=function(){return this.forEach=this._iter("forEach"),this.forEach.apply(this,arguments)};gi.prototype.map=function(){return this.map=this._iter("map"),this.map.apply(this,arguments)};gi.prototype.clone=function(){let t=new this.constructor;t.paths={...this.paths};for(let r of this.stateNames){if(!(r in this.states))continue;t.states[r]=this.states[r]==null?this.states[r]:{...this.states[r]}}return t}});var oL=g(function(sL,iL){/*!
140
+ * Dependencies
141
+ */var nL=rL(),Iye=nL.ctor("require","modify","init","default","ignore");iL.exports=sL=ir;function ir(){this.activePaths=new Iye}ir.prototype.strictMode=!0;ir.prototype.fullPath=void 0;ir.prototype.selected=void 0;ir.prototype.selectedIndex=void 0;ir.prototype.shardval=void 0;ir.prototype.saveError=void 0;ir.prototype.validationError=void 0;ir.prototype.adhocPaths=void 0;ir.prototype.removing=void 0;ir.prototype.inserting=void 0;ir.prototype.saving=void 0;ir.prototype.version=void 0;ir.prototype._id=void 0;ir.prototype.ownerDocument=void 0;ir.prototype.populate=void 0;ir.prototype.populated=void 0;ir.prototype.primitiveAtomics=void 0;ir.prototype.wasPopulated=!1;ir.prototype.scope=void 0;ir.prototype.session=null;ir.prototype.pathsToScopes=null;ir.prototype.cachedRequired=null});var Z0=g(function(oxe,aL){/*!
142
+ * Module dependencies.
143
+ */var V6=Se().Binary,$ye=Se().UUID,X0=we();function Zn(e,t,r){let n=e;if(e==null)n=0;let s,i,o;if(Array.isArray(t))i=t[0],o=t[1];else s=t;let u;if(typeof n==="number"||n instanceof Number)u=Buffer.alloc(n);else u=Buffer.from(n,s,r);return X0.decorate(u,Zn.mixin),u.isMongooseBuffer=!0,u[Zn.pathSymbol]=i,u[uL]=o,u._subtype=0,u}var Rye=Symbol.for("mongoose#Buffer#_path"),uL=Symbol.for("mongoose#Buffer#_parent");Zn.pathSymbol=Rye;/*!
144
+ * Inherit from Buffer.
145
+ */Zn.mixin={_subtype:void 0,_markModified:function(){let e=this[uL];if(e)e.markModified(this[Zn.pathSymbol]);return this},write:function(){let e=Buffer.prototype.write.apply(this,arguments);if(e>0)this._markModified();return e},copy:function(e){let t=Buffer.prototype.copy.apply(this,arguments);if(e?.isMongooseBuffer)e._markModified();return t}};/*!
146
+ * Compile other Buffer methods marking this buffer as modified.
147
+ */X0.each(["writeUInt8","writeUInt16","writeUInt32","writeInt8","writeInt16","writeInt32","writeFloat","writeDouble","fill","utf8Write","binaryWrite","asciiWrite","set","writeUInt16LE","writeUInt16BE","writeUInt32LE","writeUInt32BE","writeInt16LE","writeInt16BE","writeInt32LE","writeInt32BE","writeFloatLE","writeFloatBE","writeDoubleLE","writeDoubleBE"],function(e){if(!Buffer.prototype[e])return;Zn.mixin[e]=function(){let t=Buffer.prototype[e].apply(this,arguments);return this._markModified(),t}});Zn.mixin.toObject=function(e){let t=typeof e==="number"?e:this._subtype||0;return new V6(Buffer.from(this),t)};Zn.mixin.$toObject=Zn.mixin.toObject;Zn.mixin.toBSON=function(){return new V6(this,this._subtype||0)};Zn.mixin.toUUID=function(){if(this._subtype!==4)throw Error("Cannot convert a Buffer with subtype "+this._subtype+" to a UUID");return new $ye(this)};Zn.mixin.equals=function(e){if(!Buffer.isBuffer(e))return!1;if(this.length!==e.length)return!1;for(let t=0;t<this.length;++t)if(this[t]!==e[t])return!1;return!0};Zn.mixin.subtype=function(e){if(typeof e!=="number")throw TypeError("Invalid subtype. Expected a number");if(this._subtype!==e)this._markModified();this._subtype=e};/*!
148
+ * Module exports.
149
+ */Zn.Binary=V6;aL.exports=Zn});var lL=g(function(uxe,cL){cL.exports=class{constructor(t,r,n){this.subdocSnapshot=t,this.activePaths=r,this.version=n}}});var ey=g(function(axe,hL){/*!
150
+ * Module dependencies.
151
+ */var vye=Le();class z6 extends vye{constructor(e,t){let r=Array.isArray(t)?"array":"primitive value";super("Tried to set nested object field `"+e+`\` to ${r} \``+t+"`");this.path=e}}Object.defineProperty(z6.prototype,"name",{value:"ObjectExpectedError"});hL.exports=z6});var ty=g(function(cxe,fL){/*!
152
+ * Module dependencies.
153
+ */var kye=Le();class W6 extends kye{constructor(e,t,r){super('Parameter "'+t+'" to '+r+'() must be an object, got "'+(e==null?e:e.toString())+'" (type '+typeof e+")")}}Object.defineProperty(W6.prototype,"name",{value:"ObjectParameterError"});fL.exports=W6});var pL=g(function(lxe,dL){/*!
154
+ * Module dependencies.
155
+ */var qye=Le();class K6 extends qye{constructor(e){super("Can't validate() the same doc multiple times in parallel. Document: "+e._doc._id)}}Object.defineProperty(K6.prototype,"name",{value:"ParallelValidateError"});/*!
156
+ * exports
157
+ */dL.exports=K6});var H6=g(function(hxe,mL){mL.exports=function(t){let r={},n=Object.keys(t);for(let s of n){if(s.indexOf(".")===-1){r[s]=1;continue}let i=s.split("."),o=i[0];for(let u=0;u<i.length;++u)if(r[o]=1,u+1<i.length)o=o+"."+i[u+1]}return r}});var gL=g(function(fxe,yL){yL.exports=function(t){if(t==null||typeof t!=="object")return!1;return t.$slice==null&&t.$elemMatch==null&&t.$meta==null&&t.$==null}});var ny=g(function(dxe,_L){var EL=gL();_L.exports=function(t,r,n,s,i,o,u){let{paths:a,schemaTypes:c}=t.$__schema._getDefaultsCache(),l=a.length,f=u?.skipParentChangeTracking,h=t.$__.skipId,d=!1;for(let p=0;p<l;++p){let m=a[p],E,y="";if(m==="_id"&&h)continue;let _=c[p];if(typeof _.defaultValue==="function"&&!_.defaultValue.$runBeforeSetters)d=!0;let w=_.splitPath(),C=w.length,A=!1,M=t._doc;if(C===1){if(n===!0){if(m in r)continue}else if(n===!1&&r){let O=_.$isSingleNested||_.$isMongooseDocumentArray;if(m in r&&!EL(r[m])||O&&s!=null&&s[m])A=!0;else if(s!=null&&!s[m])continue}if(M[m]!==void 0)continue;if(i!=null){if(typeof _.defaultValue==="function"){if(!_.defaultValue.$runBeforeSetters&&i)continue;if(_.defaultValue.$runBeforeSetters&&!i)continue}else if(!i)continue}if(o&&o[m])continue;if(r&&n!==null&&!(n===!0||A))continue;try{E=_.getDefault(t,!1)}catch(O){t.invalidate(m,O);continue}if(typeof E<"u")M[m]=E,ry(t,m,f);continue}for(let O=0;O<C;++O){if(M==null)break;let x=w[O];if(y=y.length?y+"."+x:x,n===!0){if(y in r)break}else if(n===!1&&r&&!A){let v=_.$isSingleNested||_.$isMongooseDocumentArray;if(y in r&&!EL(r[y])||O===C-1&&v&&s!=null&&s[y])A=!0;else if(s!=null&&!s[y])break}if(O===C-1){if(M[x]!==void 0)break;if(i!=null){if(typeof _.defaultValue==="function"){if(!_.defaultValue.$runBeforeSetters&&i)break;if(_.defaultValue.$runBeforeSetters&&!i)break}else if(!i)continue}if(o&&o[y])break;if(r&&n!==null){if(n===!0){if(m in r)continue;try{E=_.getDefault(t,!1)}catch(v){t.invalidate(m,v);break}if(typeof E<"u")M[x]=E,ry(t,m,f)}else if(A){try{E=_.getDefault(t,!1)}catch(v){t.invalidate(m,v);break}if(typeof E<"u")M[x]=E,ry(t,m,f)}}else{try{E=_.getDefault(t,!1)}catch(v){t.invalidate(m,v);break}if(typeof E<"u")M[x]=E,ry(t,m,f)}}else M=M[x]}}return d};/*!
158
+ * ignore
159
+ */function ry(e,t,r){if(e.$__.activePaths.default(t),!r&&e.$isSubdocument&&e.$isSingleNested&&e.$parent()!=null)e.$parent().$__.activePaths.default(e.$__pathRelativeToParent(t))}});var sy=g(function(pxe,wL){/*!
160
+ * ignore
161
+ */wL.exports=function(t,r,n){n=n||{};let s=n.skipDocArrays,i=0;if(!t)return i;for(let o of Object.keys(t.$__.activePaths.getStatePaths("modify"))){if(s){if(t.$__schema.path(o)?.$isMongooseDocumentArray)continue}if(o.startsWith(r+".")){if(t.$__.activePaths.clearPath(o),++i,t.$isSubdocument)AL(t,o)}}return i};function AL(e,t,r=new Set){if(r.has(e))throw Error("Infinite subdocument loop: subdoc with _id "+e._id+" is a parent of itself");let n=e.$parent(),s=e.$__pathRelativeToParent(void 0,!1)+"."+t;if(n.$__.activePaths.clearPath(s),n.$isSubdocument)AL(n,s,r)}});var G6=g(function(mxe,OL){OL.exports=function(t,r,n){if(r.has(t))return!0;for(let s of n)if(t.slice(0,s.length)===s&&t.charAt(s.length)===".")return!0;return!1}});var uy=g(function(Gye){var jye=Zt(),Lye=le().documentSchemaSymbol,Uye=Ui().internalToObjectOptions,Vye=gn(),oy=we(),g1,zye=le().getSymbol,iy=le().scopeSymbol,SL=oy.isPOJO;/*!
162
+ * exports
163
+ */Gye.compile=CL;Gye.defineKey=bL;var Wye=Object.freeze({minimize:!0,virtuals:!1,getters:!1,transform:!1}),Kye=Object.freeze({noDottedPath:!0});function CL(e,t,r,n){g1=g1||bo();let s=n.typeKey;for(let i of Object.keys(e)){let o=e[i],a=SL(o)&&oy.hasOwnKeys(o)&&(!o[s]||s==="type"&&SL(o.type)&&o.type.type)?o:null;bL({prop:i,subprops:a,prototype:t,prefix:r,options:n})}}function bL({prop:e,subprops:t,prototype:r,prefix:n,options:s}){g1=g1||bo();let i=(n?n+".":"")+e;n=n||"";let o=n?Object.freeze({}):Kye;if(t)Object.defineProperty(r,e,{enumerable:!0,configurable:!0,get:function(){if(!this.$__)return;let u=this;if(!this.$__.getters)this.$__.getters={};if(!this.$__.getters[i]){let a=Object.create(g1.prototype,Hye(this));if(!n)a.$__[iy]=this;a.$__.nestedPath=i,Object.defineProperty(a,"schema",{enumerable:!1,configurable:!0,writable:!1,value:r.schema}),Object.defineProperty(a,"$__schema",{enumerable:!1,configurable:!0,writable:!1,value:r.schema}),Object.defineProperty(a,Lye,{enumerable:!1,configurable:!0,writable:!1,value:r.schema}),Object.defineProperty(a,"toObject",{enumerable:!1,configurable:!0,writable:!1,value:function(){return jye(u.get(i,null,{virtuals:this&&this.schema&&this.schema.options&&this.schema.options.toObject&&this.schema.options.toObject.virtuals||null}))}}),Object.defineProperty(a,"$__get",{enumerable:!1,configurable:!0,writable:!1,value:function(){return u.get(i,null,{virtuals:this?.schema?.options?.toObject?.virtuals||null})}}),Object.defineProperty(a,"toJSON",{enumerable:!1,configurable:!0,writable:!1,value:function(){return u.get(i,null,{virtuals:this?.schema?.options?.toJSON?.virtuals||null})}}),Object.defineProperty(a,"$__isNested",{enumerable:!1,configurable:!0,writable:!1,value:!0}),Object.defineProperty(a,"$isEmpty",{enumerable:!1,configurable:!0,writable:!1,value:function(){return Object.keys(this.get(i,null,Wye)||{}).length===0}}),Object.defineProperty(a,"$__parent",{enumerable:!1,configurable:!0,writable:!1,value:this}),CL(t,a,i,s),this.$__.getters[i]=a}return this.$__.getters[i]},set:function(u){if(Vye(u)&&u.$__isNested)u=u.$__get();else if(u instanceof g1&&!u.$__isNested)u=u.$toObject(Uye);(this.$__[iy]||this).$set(i,u)}});else Object.defineProperty(r,e,{enumerable:!0,configurable:!0,get:function(){return this[zye].call(this.$__[iy]||this,i,null,o)},set:function(u){this.$set.call(this.$__[iy]||this,i,u)}})}function Hye(e){let t={};return Object.getOwnPropertyNames(e).forEach(function(r){if(["isNew","$__","$errors","errors","_doc","$locals","$op","__parentArray","__index","$isDocumentArrayElement"].indexOf(r)===-1)return;t[r]=Object.getOwnPropertyDescriptor(e,r),t[r].enumerable=!1}),t}});var TL=g(function(gxe,DL){DL.exports=function(t){if(t==null)return null;return Object.keys(t)[0]}});var qs=g(function(Exe,ML){ML.exports=function(t,r){if(t==null||r==null)return null;return Object.hasOwn(t,r)?t[r]:null}});var gr=g(function(_xe,xL){xL.exports=function(t,r,n){let s,i=!1;if(typeof r==="string"){if(r.indexOf(".")===-1){let a=Y6(t,r);if(a==null)return n;return a}s=r.split(".")}else if(i=!0,s=r,s.length===1){let a=Y6(t,s[0]);if(a==null)return n;return a}let o=r,u=t;for(let a of s){if(u==null)return n;if(!i&&u[o]!=null)return u[o];if(u=Y6(u,a),!i)o=o.substring(a.length+1)}return u==null?n:u};function Y6(e,t){if(e==null)return e;if(e instanceof Map)return e.get(t);return e[t]}});var Q6=g(function(Axe,FL){var PL=vn();FL.exports=function(t,r){if(typeof t==="string"&&typeof r==="string")return t===r;if(typeof t==="number"&&typeof r==="number")return t===r;if(PL(t,"ObjectId")&&PL(r,"ObjectId"))return t.toString()===r.toString();return!1}});var ay=g(function(wxe,BL){var Jye=Q6();BL.exports=function(t,r){if(t?.discriminators==null)return null;for(let n of Object.keys(t.discriminators)){let s=t.discriminators[n];if(s.discriminatorMapping==null)continue;if(Jye(s.discriminatorMapping.value,r))return s}return null}});var IL=g(function(Oxe,NL){var Xye=qs(),Zye=gr(),e2e=ay();NL.exports=function e(t,r,n){n=n||{};let s=n.typeOnly,i=Array.isArray(r)?r:r.indexOf(".")===-1?[r]:r.split("."),o=null,u="adhocOrUndefined",a=e2e(t.schema,t.get(t.schema.options.discriminatorKey))||t.schema;for(let c=0;c<i.length;++c){let l=i.slice(0,c+1).join(".");if(o=a.path(l),o==null){u="adhocOrUndefined";continue}if(o.instance==="Mixed")return s?"real":o;if(u=a.pathType(l),(o.$isSingleNested||o.$isMongooseDocumentArrayElement)&&o.schema.discriminators!=null){let f=o.schema.discriminators,h=t.get(l+"."+Zye(o,"schema.options.discriminatorKey"));if(h==null||Xye(f,h)==null)continue;let d=i.slice(c+1).join(".");return e(t.get(l),d,n)}}return s?u:o}});var RL=g(function(Sxe,$L){var t2e=gr();$L.exports=function(t,r,n){let s=Object.keys(r);if(s.length<=1)return s;let i=n!=null?Object.keys(t2e(t.tree,n,{})):Object.keys(t.tree),o=new Set(s),u=[];for(let a of i)if(o.delete(a))u.push(a);for(let a of o)u.push(a);return u}});var Do=g(function(Cxe,vL){vL.exports=function(t,r){return t!=null&&Object.hasOwn(t,r)?t[r]:void 0}});var qL=g(function(bxe,kL){kL.exports=function(t,r){if(r.length===1)return;let n=r[0],s=void 0;for(let i=0;i<r.length-1;++i){let o=t.path(n);if(o?.schema)s=o.schema.options.strict,t=o.schema,n=o.$isMongooseDocumentArray&&!isNaN(r[i+1])?"":r[i+1];else n+=n.length?"."+r[i+1]:r[i+1]}return s}});var cy=g(function(Dxe,LL){var r2e=a1(),jL=we(),n2e=new Set(["__index","__parentArray","_doc"]);LL.exports=function(t,r){if(jL.isPOJO(t)&&r2e(t.$__,"strictMode")!=null&&t._doc!=null){if(r){let n={};for(let s of Object.keys(t)){if(typeof s==="symbol")continue;if(s[0]==="$")continue;if(n2e.has(s))continue;n[s]=t[s]}return{...t._doc,...n}}return t._doc}return t}});var E1=g(function(Txe,UL){/*!
164
+ * ignore
165
+ */UL.exports=function(t){if(t==null)return!0;if(typeof t==="object")return!("$meta"in t)&&!("$slice"in t);return!0}});var tc=g(function(Mxe,VL){var s2e=E1(),i2e=Co();/*!
166
+ * ignore
167
+ */VL.exports=function e(t){if(t==null)return null;let r=Object.keys(t),n=null;if(r.length===1&&r[0]==="_id")n=!t._id;else for(let s=0;s<r.length;++s){let i=r[s];if(i!=="_id"&&s2e(t[i])){if(n=i2e(t[i])?e(t[i])??n:!t[i],n!=null)break}}return n}});var J6=g(function(xxe,zL){var o2e=E1();zL.exports=function(t,r){if(t==null)return!1;if(r==="_id")return t._id===0;let n=Object.keys(t),s=null;for(let i of n)if(o2e(t[i])){s=t[r]===1?"inclusive":"exclusive";break}if(s==="inclusive")return t[r]!==1;if(s==="exclusive")return t[r]===0;return!1}});var X6=g(function(Pxe,KL){var WL=we();KL.exports=function(t,r){if(t._doc._id==null||r==null||r.length===0)return;let n=String(t._doc._id);for(let s of r){if(s.isVirtual)continue;let o=s.path.split(".");for(let u=0;u<o.length-1;++u){let a=o.slice(0,u+1).join("."),c=o.slice(u+1).join("."),l=t.get(a);if(l==null)continue;if(WL.isMongooseDocumentArray(l)){for(let f=0;f<l.length;++f)if(l[f])l[f].populated(c,s._docs[n]==null?void 0:s._docs[n][f],s);break}}}}});var Z6=g(function(Fxe,GL){var{isPOJO:u2e}=we();GL.exports=HL;function HL(e){let t=Object.keys(e),r=t.length,n,s,i;while(r--){if(s=t[r],i=e[s],u2e(i))e[s]=HL(i);if(e[s]===void 0){delete e[s];continue}n=!0}return n?e:void 0}});var eA=g(function(Bxe,YL){var a2e=/\./g;YL.exports=function(t){if(t.indexOf(".")===-1)return[t];let r=t.split(a2e),n=r.length,s=Array(n),i="";for(let o=0;o<n;++o)i+=i.length!==0?"."+r[o]:r[o],s[o]=i;return s}});var JL=g(function(Nxe,QL){QL.exports=function(t,r,n,s,i){let o=Object.keys(t).reduce((a,c)=>a||c.startsWith(r+"."),!1),u=r+"."+n.options.discriminatorKey;if(!o&&i.length===1&&i[0]===u)s.splice(s.indexOf(u),1)}});var Ei=g(function(Ixe,XL){var c2e=Q6();XL.exports=function(t,r){if(t==null)return null;for(let n of Object.keys(t)){let s=t[n];if(s.schema&&s.schema.discriminatorMapping&&c2e(s.schema.discriminatorMapping.value,r))return s}return null}});var ly=g(function($xe,ZL){/*!
168
+ * ignore
169
+ */ZL.exports=function(t,r){let n=r.split("."),s="";for(let i=0;i<n.length;++i)if(s+=s.length?"."+n[i]:n[i],t[s])return!0;return!1}});var tA=g(function(Rxe,eU){/*!
170
+ * Store the read preference and read concern that the populate options `pops` inherit from
171
+ * `query`'s explicit settings. Schema-level `read` and `readConcern` defaults are not inherited:
172
+ * each populate query applies its own model's schema defaults. `_execPopulateQuery()` applies
173
+ * these unless the populate options set their own.
174
+ *
175
+ * Store them separately from `pop.options` because a query's clones share its populate options:
176
+ * inherited values written to `pop.options` would look like explicit settings to later executions.
177
+ */eU.exports=function(t,r){let n=t.options,s="readPreference"in n?n.readPreference:void 0;for(let i of r)i._inheritedReadPreference=s,i._inheritedReadConcern=n.readConcern}});var pf=g(function(nA){/*!
178
+ * Module dependencies
179
+ */var l2e=qs(),tU=Q0(),h2e=JL(),rU=gr(),f2e=Ei(),rA=E1(),d2e=tc(),p2e=Co(),m2e=Zt(),y2e=ly(),g2e=tA();nA.preparePopulationOptionsMQ=function(t,r){let n=t._mongooseOptions.populate,s=Object.keys(n).reduce((u,a)=>u.concat([n[a]]),[]);if(r.lean!=null)s.filter((u)=>u?.options?.lean==null).forEach(E2e(r.lean));let i=t?.options?.session||null;if(i!=null)s.forEach((u)=>{if(u.options==null){u.options={session:i};return}if(!("session"in u.options))u.options.session=i});let o=t._fieldsForExec();for(let u=0;u<s.length;++u)if(s[u]instanceof tU)s[u]=new tU({...s[u],_queryProjection:o,_localModel:t.model});else s[u]._queryProjection=o,s[u]._localModel=t.model;return g2e(t,s),s};nA.createModel=function(t,r,n,s,i){t.hooks.execPreSync("createModel",r);let o=t.schema?t.schema.discriminatorMapping:null,u=o?.isRoot?o.key:null,a={skipId:!0,isNew:!1,willInit:!0};if(i?.defaults!=null)a.defaults=i.defaults;if(i?.strict!=null)a.strict=i.strict;let c=r[u];if(u&&c&&t.discriminators){let l=l2e(t.discriminators,c)||f2e(t.discriminators,c);if(l){let f=m2e(s);return nA.applyPaths(f,l.schema),new l(void 0,f,a)}}return new t(void 0,n,a)};/*!
180
+ * ignore
181
+ */nA.createModelAndInit=function(t,r,n,s,i,o,u){let a={};if(o)a.populated=o;if(i?.middleware!=null)a.middleware=i.middleware;let c=nA.createModel(t,r,n,s,i);try{c.$init(r,a,u)}catch(l){u(l,c)}};/*!
182
+ * ignore
183
+ */nA.applyPaths=function(t,r,n){let s,i,o=new Set;if(t){if(n){for(let E of Object.keys(t))if(E[0]==="+"||E.startsWith("-+"))delete t[E]}i=Object.keys(t);let p=[];for(let E=0;E<i.length;++E){let y=i[E];if(i[E][0]!=="-")continue;if(delete t[y],y==="-_id")t._id=0;else p.push(y.slice(1))}i=Object.keys(t);let m=!1;for(let E=0;E<i.length;++E){if(i[E][0]==="+")continue;let y=t[i[E]];if(!rA(y))continue;if(y?.$elemMatch!=null){m=!0;continue}if(i[E]==="_id"&&i.length>1)continue;if(i[E]===r.options.discriminatorKey&&i.length>1&&y!=null&&!y)continue;if(p2e(y)&&!Object.keys(y).some((_)=>_.startsWith("$"))){if(s=d2e(y)??void 0,s===void 0)continue;break}s=!y;break}if(s===void 0&&m)s=!1;for(let E of p){let y=r.path(E);if(!y?.selected||s!==!1)t[E]=0,s=!0;else if(y?.selected&&s===!1)o.add(E)}}let u=[],a=[],c=[];if(r._hasSelectedPaths!==!1)l(r);if(n&&s===!1){let p=Object.keys(t);if(!p.some((m)=>(m!=="_id"||p.length===1)&&rA(t[m])&&t[m]))s=!0}switch(s){case!0:for(let p of a){if(d(t,p))continue;t[p]=0}break;case!1:if(r?.paths._id?.options?.select===!1)t._id=0;for(let p of u){if(o.has(p))continue;if(y2e(t,p))continue;t[p]=t[p]||1}break;case void 0:if(t==null)break;for(let p of Object.keys(t||{}))if(p.startsWith("+"))delete t[p];for(let p of a){if(t[p]!=null)continue;t[p]=0}break}function l(p,m){if(m||(m=""),c.indexOf(p)!==-1)return[];c.push(p);let E=[];return p.eachPath(function(y,_){if(m)y=m+"."+y;if(_.$isSchemaMap||y.endsWith(".$*")){let C="+"+y,A=t&&C in t;if(_.options?.select===!1&&n)h(y),a.push(y);else if(_.options?.select===!1&&!A)a.push(y);return}let w=f(y,_);if(w==null&&!Array.isArray(_)&&_.$isMongooseArray&&!_.$isMongooseDocumentArray)w=f(y,_.embeddedSchemaType);if(w!=null)E.push(w);if(_.schema){let C=l(_.schema,y);if(s===!1)h2e(t,y,_.schema,u,C)}}),c.pop(),E}function f(p,m){if(t==null)return;if(typeof m.selected!=="boolean")return;if(m.selected===!1&&n)h(p);else if(m.selected===!1&&t[p])return;if(!s&&m.selected&&p===r.options.discriminatorKey&&t[p]!=null&&!t[p]){delete t[p];return}if(s===!1&&m.selected&&t[p]!=null&&!t[p]){delete t[p];return}let E="+"+p;if(t&&E in t){if(delete t[E],s===!1&&i.length>1&&!~i.indexOf(p))t[p]=1;return}let _=p.split("."),w="";for(let C=0;C<_.length;++C)if(w+=w.length?"."+_[C]:_[C],a.indexOf(w)!==-1)return;if(!s&&(m?.options?.$skipDiscriminatorCheck||!1)){let C="";for(let A=0;A<_.length;++A){C+=(C.length===0?"":".")+_[A];let M=rU(t,C,!1)||rU(t,C+".$",!1);if(M&&typeof M!=="object")return}}return(m.selected?u:a).push(p),p}function h(p){for(let m of Object.keys(t)){if(rA(t[m])&&!t[m])continue;let E=m.endsWith(".$")?m.slice(0,-2):m;if(E===p||E.startsWith(p+".")||p.startsWith(E+"."))delete t[m]}}function d(p,m){let E=-1;while((E=m.indexOf(".",E+1))!==-1){let y=p[m.slice(0,E)];if(y!=null&&!y)return!0}return!1}};function E2e(e){return function(t){if(t.options||(t.options={}),Array.isArray(e?.virtuals))e=Object.assign({},e),e.virtuals=e.virtuals.filter((r)=>typeof r==="string"&&r.startsWith(t.path+".")).map((r)=>r.slice(t.path.length+1));t.options.lean=e}}});var zi=g(function(O2e){O2e.schemaMixedSymbol=Symbol.for("mongoose:schema_mixed");O2e.builtInMiddleware=Symbol.for("mongoose:built-in-middleware");O2e.skipOnSubdocuments=Symbol("mongoose:skip-on-subdocuments");O2e.requiresShardKey=Symbol.for("mongoose:requires-shard-key")});var Jo=g(function(qxe,iU){var T2e=Co(),sU=zi(),M2e=(e)=>e.fn[sU.builtInMiddleware];function sA(e,t){return e?.middleware===!1||e?.middleware?.[t]===!1?M2e:null}function x2e(e){let t=e[e.length-1],r=T2e(t)?t:null;return{pre:{filter:sA(r,"pre")},post:{filter:sA(r,"post")}}}iU.exports={buildMiddlewareFilter:sA,middlewareFiltersFromLastArg:x2e}});var iA=g(function(jxe,oU){function P2e(e){return!!e&&(typeof e==="object"||typeof e==="function")&&typeof e.then==="function"}oU.exports=P2e});var aU=g(function(Lxe,uU){uU.exports=function(t,r,n){let s=r[0],i=n,o=t;for(let u=0;u<r.length-1;++u){let a=i.path(s);if(a?.schema){let c=o.get(s);if(i=a.schema,s=r[u+1],Array.isArray(c)&&!isNaN(s))c=c[s],s="";if(c==null)break;o=c}else s+=s.length?"."+r[u+1]:r[u+1]}return o}});var hU=g(function(Uxe,lU){var F2e=Co();lU.exports=function(t,r){return cU(t,r,!0,new Set)};function cU(e,t,r,n){if(e==null)return e;if(e.$__!=null&&typeof e.toObject==="function")return r||e.$__isNested?e.toObject(t):e;if(!Array.isArray(e)&&!F2e(e))return e;if(n.has(e))return e;n.add(e);let s=e;for(let i of Object.keys(e)){let o=cU(e[i],t,!1,n);if(o===e[i])continue;if(s===e)s=Array.isArray(e)?Object.assign([],e):{...e};s[i]=o}return n.delete(e),s}});var dy=g(function(Vxe,fU){var nn=bo(),B2e=Ui().internalToObjectOptions,hy=L("util"),fy=we();fU.exports=It;function It(e,t,r,n){if(r!=null){let s={isNew:r.isNew};if("defaults"in r.$__)s.defaults=r.$__.defaults;n=Object.assign(s,n)}if(n?.path!=null)this.$basePath=n.path;if(nn.call(this,e,t,n),this.$__.priorDoc!==void 0)this.$__.priorDoc=void 0}It.prototype=Object.create(nn.prototype);Object.defineProperty(It.prototype,"$isSubdocument",{configurable:!1,writable:!1,value:!0});Object.defineProperty(It.prototype,"$isSingleNested",{configurable:!1,writable:!1,value:!0});/*!
184
+ * ignore
185
+ */It.prototype.toBSON=function(){return this.toObject(B2e)};It.prototype.save=async function(t){if(t=t||{},!t.suppressWarning)fy.warn("mongoose: calling `save()` on a subdoc does **not** save the document to MongoDB, it only runs save middleware. Use `subdoc.save({ suppressWarning: true })` to hide this warning if you're sure this behavior is right for your app.");return await this.$__save(t)};It.prototype.$__fullPath=function(e){if(!this.$__.fullPath)this.ownerDocument();return e?this.$__.fullPath+"."+e:this.$__.fullPath};It.prototype.$__pathRelativeToParent=function(e){if(e==null)return this.$basePath;if(!this.$basePath)return e;return[this.$basePath,e].join(".")};It.prototype.$__save=async function(t){try{await this._execDocumentPreHooks("save",t,[t])}catch(r){await this._execDocumentPostHooks("save",t,r);return}await this._execDocumentPostHooks("save",t)};/*!
186
+ * ignore
187
+ */It.prototype.$isValid=function(e){let t=this.$parent(),r=this.$__pathRelativeToParent(e);if(t!=null&&r!=null)return t.$isValid(r);return nn.prototype.$isValid.call(this,e)};/*!
188
+ * ignore
189
+ */It.prototype.markModified=function(e){nn.prototype.markModified.call(this,e);let t=this.$parent(),r=this.$__pathRelativeToParent(e);if(t==null||r==null)return;if(this.isNew)return;let n=this.$__pathRelativeToParent().replace(/\.$/,"");if(t.isDirectModified(n))return;this.$__parent.markModified(r,this)};/*!
190
+ * ignore
191
+ */It.prototype.isModified=function(e,t,r){let n=this.$parent();if(n!=null){if(Array.isArray(e)||typeof e==="string")e=Array.isArray(e)?e:e.split(" "),e=e.map((s)=>this.$__pathRelativeToParent(s)).filter((s)=>s!=null);else if(!e)e=this.$__pathRelativeToParent();return n.$isModified(e,t,r)}return nn.prototype.isModified.call(this,e,t,r)};It.prototype.$markValid=function(e){nn.prototype.$markValid.call(this,e);let t=this.$parent(),r=this.$__pathRelativeToParent(e);if(t!=null&&r!=null)t.$markValid(r)};/*!
192
+ * ignore
193
+ */It.prototype.invalidate=function(e,t,r){nn.prototype.invalidate.call(this,e,t,r);let n=this.$parent(),s=this.$__pathRelativeToParent(e);if(n!=null&&s!=null)n.invalidate(s,t,r);else if(t.kind==="cast"||t.name==="CastError"||s==null)throw t;return this.ownerDocument().$__.validationError};/*!
194
+ * ignore
195
+ */It.prototype.$ignore=function(e){nn.prototype.$ignore.call(this,e);let t=this.$parent(),r=this.$__pathRelativeToParent(e);if(t!=null&&r!=null)t.$ignore(r)};It.prototype.ownerDocument=function(){if(this.$__.ownerDocument)return this.$__.ownerDocument;let e=this,t=[],r=new Set([e]);while(!0){if(typeof e.$__pathRelativeToParent!=="function")break;t.unshift(e.$__pathRelativeToParent(void 0,!0));let n=e.$parent();if(n==null)break;if(e=n,r.has(e))throw Error("Infinite subdocument loop: subdoc with _id "+e._id+" is a parent of itself");r.add(e)}return this.$__.fullPath=t.join("."),this.$__.ownerDocument=e,this.$__.ownerDocument};/*!
196
+ * ignore
197
+ */It.prototype.$__fullPathWithIndexes=function(){let e=this,t=[],r=new Set([e]);while(!0){if(typeof e.$__pathRelativeToParent!=="function")break;t.unshift(e.$__pathRelativeToParent(void 0,!1));let n=e.$parent();if(n==null)break;if(e=n,r.has(e))throw Error("Infinite subdocument loop: subdoc with _id "+e._id+" is a parent of itself");r.add(e)}return t.join(".")};It.prototype.parent=function(){return this.$__parent};It.prototype.$parent=It.prototype.parent;/*!
198
+ * Sets this sub-documents parent document.
199
+ *
200
+ * @api private
201
+ */It.prototype.$__setParent=function(t){this.$__parent=t};It.prototype.$__removeFromParent=function(){this.$__parent.set(this.$basePath,null)};It.prototype.deleteOne=function(t){if(N2e(this),!t?.noop){this.$__removeFromParent();let r=this.ownerDocument();r.$__.removedSubdocs=r.$__.removedSubdocs||[],r.$__.removedSubdocs.push(this)}};/*!
202
+ * ignore
203
+ */It.prototype.populate=function(){throw Error('Mongoose does not support calling populate() on nested docs. Instead of `doc.nested.populate("path")`, use `doc.populate("nested.path")`')};It.prototype.inspect=function(){return this.toObject()};if(hy.inspect.custom)It.prototype[hy.inspect.custom]=It.prototype.inspect;It.prototype.$toObject=function(t,r){let n=nn.prototype.$toObject.call(this,t,r);if(fy.hasOwnKeys(n)===!1&&t?._calledWithOptions!=null){if((t._calledWithOptions?.minimize??this?.$__schemaTypeOptions?.minimize??t.minimize)&&!this.constructor.$__required&&!this.$isDocumentArrayElement)return}return n};function N2e(e){let t=e.ownerDocument();function r(){t.$removeListener("save",r),t.$removeListener("deleteOne",r),e.emit("deleteOne",e),e.constructor.emit("deleteOne",e)}t.$on("save",r),t.$on("deleteOne",r)}});var _1=g(function(zxe,mU){/*!
204
+ * Module dependencies.
205
+ */var dU=L("events").EventEmitter,py=dy(),pU=we(),I2e=le().arrayParentSymbol,oA=le().documentArrayParent;function es(e,t,r,n,s){let i;if(pU.isMongooseDocumentArray(t))this.__parentArray=t,i=t[I2e];else this.__parentArray=void 0;this[oA]=i,this.$setIndex(s),this.$__parent=i;let o={isNew:!0};if(i!=null&&"defaults"in i.$__)o.defaults=i.$__.defaults;if(typeof r==="object"&&r!=null)Object.assign(o,r);py.call(this,e,n,null,o)}/*!
206
+ * Inherit from Subdocument
207
+ */es.prototype=Object.create(py.prototype);es.prototype.constructor=es;Object.defineProperty(es.prototype,"$isSingleNested",{configurable:!1,writable:!1,value:!1});Object.defineProperty(es.prototype,"$isDocumentArrayElement",{configurable:!1,writable:!1,value:!0});for(let e in dU.prototype)es[e]=dU.prototype[e];/*!
208
+ * ignore
209
+ */es.prototype.$setIndex=function(e){if(this.__index=e,this.$__?.validationError!=null){let t=Object.keys(this.$__.validationError.errors);for(let r of t)this.invalidate(r,this.$__.validationError.errors[r])}};/*!
210
+ * ignore
211
+ */es.prototype.populate=function(){throw Error('Mongoose does not support calling populate() on nested docs. Instead of `doc.arr[0].populate("path")`, use `doc.populate("arr.0.path")`')};/*!
212
+ * ignore
213
+ */es.prototype.$__removeFromParent=function(){let e=this._doc._id;if(!e)throw Error("For your own good, Mongoose does not know how to remove an ArraySubdocument that has no _id");this.__parentArray.pull({_id:e})};es.prototype.$__fullPath=function(e,t){if(this.__index==null)return null;if(!this.$__.fullPath)this.ownerDocument();if(t)return e?this.$__.fullPath+"."+e:this.$__.fullPath;return e?this.$__.fullPath+"."+this.__index+"."+e:this.$__.fullPath+"."+this.__index};es.prototype.$__pathRelativeToParent=function(e,t){if(this.__index==null||!this.__parentArray?.$path)return null;if(t)return e==null?this.__parentArray.$path():this.__parentArray.$path()+"."+e;if(e==null)return this.__parentArray.$path()+"."+this.__index;return this.__parentArray.$path()+"."+this.__index+"."+e};es.prototype.$parent=function(){return this[oA]};/*!
214
+ * Sets this sub-documents parent document.
215
+ *
216
+ * @api private
217
+ */es.prototype.$__setParent=function(t){this[oA]=t,this.$__parent=t};es.prototype.parentArray=function(){return this.__parentArray};/*!
218
+ * Module exports.
219
+ */mU.exports=es});var Ey=g(function(Wxe,SU){var aA=bo(),uA=_1(),$2e=Le(),yU=sy(),R2e=Zt(),gU=Ui().internalToObjectOptions,gy=ks(),Xe=we(),rc=vn(),v2e=Se().UUID,k2e=le().arrayAtomicsBackupSymbol,Wi=le().arrayAtomicsSymbol,Ea=le().arrayParentSymbol,_a=le().arrayPathSymbol,Xo=le().arraySchemaSymbol,wU=le().populateModelSymbol,q2e=Symbol("mongoose#Array#sliced"),EU=Array.prototype.push;/*!
220
+ * ignore
221
+ */var yy={$__getAtomics(){let e=[],t=Object.keys(this[Wi]||{}),r=t.length,n=Object.assign({},gU,{_isNested:!0});if(r===0)return e[0]=["$set",this.toObject(n)],e;while(r--){let s=t[r],i=this[Wi][s];if(Xe.isMongooseObject(i))i=i.toObject(n);else if(Array.isArray(i))i=this.toObject.call(i,n);else if(Array.isArray(i?.$each))i.$each=this.toObject.call(i.$each,n);else if(typeof i?.valueOf==="function")i=i.valueOf();if(s==="$addToSet")i={$each:i};e.push([s,i])}return e},getAtomics(){return this.$__getAtomics()},clearAtomics(){this[k2e]=this[Wi],this[Wi]={}},$atomics(){/*!
222
+ * ignore
223
+ */return this[Wi]},$parent(){/*!
224
+ * ignore
225
+ */return this[Ea]},$path(){/*!
226
+ * ignore
227
+ */return this[_a]},$schemaType(){/*!
228
+ * ignore
229
+ */return this[Xo]},$shift(){this._registerAtomic("$pop",-1),this._markModified();let e=this.__array;if(e._shifted)return;return e._shifted=!0,[].shift.call(e)},$pop(){if(this._registerAtomic("$pop",1),this._markModified(),this._popped)return;return this._popped=!0,[].pop.call(this)},$schema(){/*!
230
+ * ignore
231
+ */return this[Xo]},_cast(e){let t=!1,r,n=this[Ea];if(n)t=n.$populated(this[_a],!0);if(t&&e!=null){if(r=t.options[wU],r==null)throw new $2e("No populated model found for path `"+this[_a]+"`. This is likely a bug in Mongoose, please report an issue on github.com/Automattic/mongoose.");if(Buffer.isBuffer(e)||rc(e,"ObjectId")||!Xe.isObject(e))e={_id:e};if(e.schema?.discriminatorMapping?.key===void 0)e=new r(e);return this[Xo].embeddedSchemaType.applySetters(e,n,!0)}return this[Xo].embeddedSchemaType.applySetters(e,n,!1)},_mapCast(e,t){return this._cast(e,this.length+t)},_markModified(e){let t=this[Ea],r;if(t){if(r=this[_a],arguments.length)r=r+"."+e;if(r!=null&&r.endsWith(".$"))return this;t.markModified(r,arguments.length!==0?e:t)}return this},_registerAtomic(e,t){if(this[q2e])return;if(e==="$set")return this[Wi]={$set:t},yU(this[Ea],this[_a]),this._markModified(),this;let r=this[Wi];if(e==="$pop"&&!("$pop"in r)){let s=this;this[Ea].once("save",function(){s._popped=s._shifted=null})}if(r.$set||Xe.hasOwnKeys(r)&&!(e in r))return this[Wi]={$set:this},this;let n;if(e==="$pullAll"||e==="$addToSet")r[e]||(r[e]=[]),r[e]=r[e].concat(t);else if(e==="$pullDocs"){let s=r.$pull||(r.$pull={});if(t[0]instanceof uA)n=s.$or||(s.$or=[]),Array.prototype.push.apply(n,t.map((i)=>i.toObject({transform:(o,u)=>{if(i==null||i.$__==null)return u;return Object.keys(i.$__.activePaths.getStatePaths("default")).forEach((a)=>{gy.unset(a,u),OU(u,a)}),u},virtuals:!1})));else n=s._id||(s._id={$in:[]}),n.$in=n.$in.concat(t)}else if(e==="$push")if(r.$push=r.$push||{$each:[]},t!=null&&Xe.hasUserDefinedProperty(t,"$each"))r.$push=t;else if(t.length===1)r.$push.$each.push(t[0]);else if(t.length<1e4)r.$push.$each.push(...t);else for(let s of t)r.$push.$each.push(s);else r[e]=t;return this},addToSet(){my(this,arguments),AU(this,arguments);let e=[].map.call(arguments,this._mapCast,this),t=[],r="";if(e[0]instanceof uA)r="doc";else if(e[0]instanceof Date)r="date";else if(rc(e[0],"ObjectId"))r="ObjectId";let n=Xe.isMongooseArray(e)?e.__array:e,s=Xe.isMongooseArray(this)?this.__array:this;return n.forEach(function(i){let o;switch(r){case"doc":o=this.some(function(u){return u.equals(i)});break;case"date":{let u=+i;o=this.some(function(a){return+a===u});break}case"ObjectId":o=this.find((u)=>u.toString()===i.toString());break;default:o=~this.indexOf(i);break}if(!o)this._markModified(),s.push(i),this._registerAtomic("$addToSet",i),[].push.call(t,i)},this),t},hasAtomics(){if(!Xe.isPOJO(this[Wi]))return 0;return Object.keys(this[Wi]).length},includes(e,t){return this.indexOf(e,t)!==-1},indexOf(e,t){if(rc(e,"ObjectId")||e instanceof v2e)e=e.toString();let r=null;if(e instanceof Date)r=j2e;else if(Buffer.isBuffer(e))r=L2e;else if(rc(e,"Double"))r=U2e;else if(rc(e,"Decimal128"))r=V2e;t=t==null?0:t;let n=this.length;for(let s=t;s<n;++s)if(r===null?e==this[s]:r(e,this[s]))return s;return-1},inspect(){return JSON.stringify(this)},nonAtomicPush(){let e=[].map.call(arguments,this._mapCast,this);this._markModified();let t=[].push.apply(this,e);return this._registerAtomic("$set",this),t},pop(){this._markModified();let e=[].pop.call(this);return this._registerAtomic("$set",this),e},pull(){let e=[].map.call(arguments,(s,i)=>this._cast(s,i,{defaults:!1}),this),t=this;if(Xe.isMongooseArray(t))t=t.__array;let r=t.length,n;this._markModified();while(r--)if(n=t[r],n instanceof aA){if(e.some(function(i){return n.equals(i)}))t.splice(r,1)}else if(~this.indexOf.call(e,n))t.splice(r,1);if(e[0]instanceof uA)this._registerAtomic("$pullDocs",e.map(function(s){let i=s.$__getValue("_id");if(i===void 0||s.$isDefault("_id"))return s;return i}));else this._registerAtomic("$pullAll",e);if(yU(this[Ea],this[_a])>0)this._registerAtomic("$set",this);return this},push(){let e=arguments,t=e,r=e[0]!=null&&Xe.hasUserDefinedProperty(e[0],"$each"),n=Xe.isMongooseArray(this)?this.__array:this;if(r)t=e[0],e=e[0].$each;if(this[Xo]==null)return EU.apply(this,e);my(this,e),AU(this,e),e=[].map.call(e,this._mapCast,this);let s,i=this[Wi];if(this._markModified(),r)if(t.$each=e,W2e(i.$push,t)){if(t.$position!=null)[].splice.apply(n,[t.$position,0].concat(e)),s=n.length;else s=[].push.apply(n,e);this._registerAtomic("$set",this)}else if(t.$position!=null)[].splice.apply(n,[t.$position,0].concat(e)),s=this.length;else s=[].push.apply(n,e);else if(t=e,s=EU.apply(n,e),i.$push?.$position!=null)this._registerAtomic("$set",this);return this._registerAtomic("$push",i.$push?.$each?.length?e:t),s},remove(){return this.pull.apply(this,arguments)},set(e,t,r){let n=this.__array;if(r)return n[e]=t,this;let s=yy._cast.call(this,t,e);return yy._markModified.call(this,e),n[e]=s,this},shift(){let e=Xe.isMongooseArray(this)?this.__array:this;this._markModified();let t=[].shift.call(e);return this._registerAtomic("$set",this),t},sort(){let e=Xe.isMongooseArray(this)?this.__array:this,t=[].sort.apply(e,arguments);return this._registerAtomic("$set",this),t},splice(){let e,t=Xe.isMongooseArray(this)?this.__array:this;if(this._markModified(),my(this,Array.prototype.slice.call(arguments,2)),arguments.length){let r;if(this[Xo]==null)r=arguments;else{r=[];for(let n=0;n<arguments.length;++n)r[n]=n<2?arguments[n]:this._cast(arguments[n],arguments[0]+(n-2))}e=[].splice.apply(t,r),this._registerAtomic("$set",this)}return e},toBSON(){/*!
232
+ * ignore
233
+ */return this.toObject(gU)},toObject(e){let t=Xe.isMongooseArray(this)?this.__array:this;if(e?.depopulate)return e=R2e(e),e._isNested=!0,[].concat(t).map(function(r){return r instanceof aA?r.toObject(e):r});return[].concat(t)},$toObject(){return this.constructor.prototype.toObject.apply(this,arguments)},unshift(){my(this,arguments);let e;if(this[Xo]==null)e=arguments;else e=[].map.call(arguments,this._cast,this);let t=Xe.isMongooseArray(this)?this.__array:this;return this._markModified(),[].unshift.apply(t,e),this._registerAtomic("$set",this),this.length}};/*!
234
+ * ignore
235
+ */function j2e(e,t){return t instanceof Date&&+e===+t}function L2e(e,t){return Buffer.isBuffer(t)&&(e._subtype||0)===(t._subtype||0)&&e.equals(t)}function U2e(e,t){if(!rc(t,"Double"))return!1;let r=e.valueOf(),n=t.valueOf();return r===n||Number.isNaN(r)&&Number.isNaN(n)}var _U=/^(-?)(\d+)(?:\.(\d*))?(?:E([+-]\d+))?$/;function V2e(e,t){if(!rc(t,"Decimal128"))return!1;let r=e.toString(),n=t.toString();if(r===n)return!0;let s=_U.exec(r),i=_U.exec(n);if(s===null||i===null)return!1;let o=s[3]||"",u=i[3]||"",a=BigInt(s[1]+s[2]+o),c=BigInt(i[1]+i[2]+u),l=(+s[4]||0)-o.length,f=(+i[4]||0)-u.length;return l>f?a*10n**BigInt(l-f)===c:c*10n**BigInt(f-l)===a}function z2e(e,t){if(!t)return!1;for(let r of e){if(r==null)return!1;let n=r.constructor;if(!(r instanceof aA)||n.modelName!==t&&n.baseModelName!==t)return!1}return!0}/*!
236
+ * Minimize _just_ empty objects along the path chain specified
237
+ * by `parts`, ignoring all other paths. Useful in cases where
238
+ * you want to minimize after unsetting a path.
239
+ *
240
+ * #### Example:
241
+ *
242
+ * const obj = { foo: { bar: { baz: {} } }, a: {} };
243
+ * _minimizePath(obj, 'foo.bar.baz');
244
+ * obj; // { a: {} }
245
+ */function OU(e,t,r){if(typeof t==="string"){if(t.indexOf(".")===-1)return;t=gy.stringToParts(t)}if(r=r||0,r>=t.length)return;if(e==null||typeof e!=="object")return;if(OU(e[t[0]],t,r+1),e[t[0]]!=null&&typeof e[t[0]]==="object"&&Xe.hasOwnKeys(e[t[0]])===!1)delete e[t[0]]}/*!
246
+ * ignore
247
+ */function my(e,t){let r=e==null?null:e[Xo]?.embeddedSchemaType?.options?.ref||null;if(e.length===0&&t.length!==0){if(z2e(t,r))e[Ea].$populated(e[_a],[],{[wU]:t[0].constructor})}}/*!
248
+ * If `docs` isn't all instances of the right model, depopulate `arr`
249
+ */function AU(e,t){let r=e==null?null:e[Xo]?.embeddedSchemaType?.options?.ref||null,n=e[Ea],s=e[_a];if(!r||!n.populated(s))return;for(let i of t){if(i==null)continue;if(typeof i!=="object"||i instanceof String||i instanceof Number||i instanceof Buffer||Xe.isMongooseType(i)){n.depopulate(s);break}}}/*!
250
+ * A `{ $each }` push can only join a pending `$push` when neither has
251
+ * `$position`, `$slice` or `$sort` (gh-14244, gh-16618)
252
+ */function W2e(e,t){if(!e?.$each?.length)return!1;return[e,t].some((r)=>r.$position!=null||r.$slice!=null||r.$sort!=null)}var K2e=["filter","flat","flatMap","map","slice"];for(let e of K2e){if(Array.prototype[e]==null)continue;yy[e]=function(){let t=Xe.isMongooseArray(this)?this.__array:this,r=[].concat(t);return r[e].apply(r,arguments)}}SU.exports=yy});var MU=g(function(Kxe,TU){var qr=Ey(),H2e=bo(),CU=qs(),bU=Ei(),G2e=Ui().internalToObjectOptions,sn=we(),Y2e=vn(),_y=le().arrayParentSymbol,cA=le().arrayPathSymbol,mf=le().arraySchemaSymbol,DU=le().documentArrayParent,Q2e=Array.prototype.reverse,J2e=Array.prototype.toString,lA={toBSON(){/*!
253
+ * ignore
254
+ */return this.toObject(G2e)},toString(){return J2e.call(this.__array.map((e)=>{if(e?.$__!=null)return e.toString();return e}))},getArrayParent(){/*!
255
+ * ignore
256
+ */return this[_y]},$schemaType(){/*!
257
+ * ignore
258
+ */return this[mf]},_cast(e,t,r){if(this[mf]==null)return e;let n=this[mf].Constructor;if((n.$isMongooseDocumentArray?sn.isMongooseDocumentArray(e):e instanceof n)||e?.constructor?.baseCasterConstructor===n){if(!(e[DU]&&e.__parentArray))e[DU]=this[_y],e.__parentArray=this;return e.$setIndex(t),e}if(e==null)return null;if(Buffer.isBuffer(e)||Y2e(e,"ObjectId")||!sn.isObject(e))e={_id:e};if(e&&n.discriminators&&n.schema&&n.schema.options&&n.schema.options.discriminatorKey){let o=typeof e[n.schema.options.discriminatorKey]==="string"?CU(n.discriminators,e[n.schema.options.discriminatorKey]):null;if(o)n=o;else{let u=bU(n.discriminators,e[n.schema.options.discriminatorKey]);if(u)n=u}}if(n.$isMongooseDocumentArray)return n.cast(e,this,void 0,void 0,t);let i=new n(e,this,r,void 0,t);return i.isNew=!0,i},id(e){if(e==null)return null;let t=this[mf],r=null;if(t?.schema)r=t.schema.path("_id");else if(t?.casterConstructor?.schema)r=t.casterConstructor.schema.path("_id");let n=null;if(r)try{n=r.cast(e)}catch{}let s;for(let i of this){if(!i)continue;if(s=i.get("_id"),s==null)continue;else if(s instanceof H2e){if(s=s.get("_id"),n!=null&&sn.deepEqual(n,s))return i;else if(n==null&&(e==s||sn.deepEqual(e,s)))return i}else if(n!=null&&sn.deepEqual(n,s))return i;else if(n==null&&(s==e||sn.deepEqual(e,s)))return i}return null},toObject(e){return[].concat(this.map(function(t){if(t==null)return null;if(typeof t.toObject!=="function")return t;return t.toObject(e)}))},$toObject(){return this.constructor.prototype.toObject.apply(this,arguments)},addToSet(){let e=qr.addToSet.apply(this,arguments);return Zo(this),e},push(){let e=X2e(arguments),t=qr.push.apply(this,arguments);if(e)Zo(this);return To(this),t},pop(){let e=qr.pop.apply(this,arguments);return To(this),e},$pop(){/*!
259
+ * ignore
260
+ */let e=qr.$pop.apply(this,arguments);return To(this),e},pull(){let e=qr.pull.apply(this,arguments);return Zo(this),To(this),e},shift(){let e=qr.shift.apply(this,arguments);return Zo(this),To(this),e},$shift(){/*!
261
+ * ignore
262
+ */let e=qr.$shift.apply(this,arguments);return Zo(this),To(this),e},splice(){let e=qr.splice.apply(this,arguments);return Zo(this),To(this),e},reverse(){return Q2e.call(this.__array),this._registerAtomic("$set",this),Zo(this),To(this),this},sort(){let e=qr.sort.apply(this,arguments);return Zo(this),To(this),e},unshift(){let e=qr.unshift.apply(this,arguments);return Zo(this),To(this),e},inspect(){return this.toObject()},create(e){let t=this[mf].Constructor;if(e&&t.discriminators&&t.schema&&t.schema.options&&t.schema.options.discriminatorKey){let r=typeof e[t.schema.options.discriminatorKey]==="string"?CU(t.discriminators,e[t.schema.options.discriminatorKey]):null;if(r)t=r;else{let n=bU(t.discriminators,e[t.schema.options.discriminatorKey]);if(n)t=n}}return new t(e,this)},notify(e){/*!
263
+ * ignore
264
+ */let t=this;return function r(n,s){s=s||t;let i=s.length;while(i--){if(s[i]==null)continue;switch(e){case"save":n=t[i];break;default:break}if(sn.isMongooseArray(s[i]))r(n,s[i]);else if(s[i])s[i].emit(e,n)}}},set(e,t,r){let n=this.__array;if(r)return n[e]=t,this;let s=lA._cast.call(this,t,e);return lA._markModified.call(this,e),n[e]=s,this},_markModified(e,t){let r=this[_y],n;if(r){if(n=this[cA],arguments.length)if(t!=null){let s=e.__index;n=n+"."+s+"."+t}else n=n+"."+e;if(n!=null&&n.endsWith(".$"))return this;r.markModified(n,arguments.length!==0?e:r)}return this}};TU.exports=lA;/*!
265
+ * ignore
266
+ */function Zo(e){let t=sn.isMongooseArray(e)?e.__array:e;for(let r=0;r<t.length;++r)if(typeof t[r]?.$setIndex==="function")t[r].$setIndex(r)}function X2e(e){return e[0]!=null&&sn.hasUserDefinedProperty(e[0],"$each")&&e[0].$position!=null}function To(e){let t=e[_y];if(!t||t.$__.populated==null)return;let r=Object.keys(t.$__.populated).filter((n)=>n.startsWith(e[cA]+"."));for(let n of r){let s=n.slice((e[cA]+".").length);if(!Array.isArray(t.$__.populated[n].value))continue;t.$__.populated[n].value=e.map((i)=>i.$populated(s))}}});var sc=g(function(Hxe,PU){/*!
267
+ * Module dependencies.
268
+ */var xU=Ey(),Ay=MU(),hA=le().arrayAtomicsSymbol,Z2e=le().arrayAtomicsBackupSymbol,fA=le().arrayParentSymbol,dA=le().arrayPathSymbol,nc=le().arraySchemaSymbol,ege=Array.prototype.push,tge=/^\d+$/;function rge(e,t,r,n){let s=[],i={[hA]:{},[Z2e]:void 0,[dA]:t,[nc]:void 0,[fA]:void 0};if(Array.isArray(e)){if(e[dA]===t&&e[fA]===r)i[hA]=Object.assign({},e[hA]);e.forEach((u)=>{ege.call(s,u)})}if(i[dA]=t,i.__array=s,r?.$__){i[fA]=r,i[nc]=r.$__schema.path(t);while(i[nc]!=null&&i[nc].$isMongooseArray&&!i[nc].$isMongooseDocumentArray)i[nc]=i[nc].embeddedSchemaType}let o=new Proxy(s,{get:function(u,a){if(a==="isMongooseArray"||a==="isMongooseArrayProxy"||a==="isMongooseDocumentArray"||a==="isMongooseDocumentArrayProxy")return!0;if(Object.hasOwn(i,a))return i[a];if(Object.hasOwn(Ay,a))return Ay[a];if(n?.virtuals&&Object.hasOwn(n.virtuals,a))return n.virtuals[a].applyGetters(void 0,u);if(Object.hasOwn(xU,a))return xU[a];return s[a]},set:function(u,a,c){if(typeof a==="string"&&tge.test(a))Ay.set.call(o,a,c,!1);else if(Object.hasOwn(i,a))i[a]=c;else if(n?.virtuals&&Object.hasOwn(n.virtuals,a))n.virtuals[a].applySetters(c,u);else s[a]=c;return!0}});return o}/*!
269
+ * Module exports.
270
+ */PU.exports=rge});var bo=g(function(nV,sV){/*!
271
+ * Module dependencies.
272
+ */var nge=v6(),gA=L("events").EventEmitter,sge=oL(),LU=Z0(),Sr=Rs(),ige=lL(),UU=ey(),AA=ty(),oge=pL(),FU=y6(),uge=ic(),A1=ga(),gf=Za(),VU=C6(),zU=H6(),EA=ny(),pA=sy(),Ki=Zt(),mA=G6(),age=uy().compile,cge=uy().defineKey,lge=TL(),hge=Rn(),yA=IL(),BU=RL(),WU=Do(),fge=qL(),dge=cy(),pge=E1(),mge=tc(),qn=gn(),NU=J6(),Oy=L("util").inspect,KU=Ui().internalToObjectOptions,yge=X6(),gge=Z6(),HU=ks(),wA=eA(),GU=pf(),{buildMiddlewareFilter:YU}=Jo(),V=we(),Ege=iA(),wy=V.deepEqual,_ge=Object.freeze({skipParentChangeTracking:!0}),Ef=le().arrayAtomicsBackupSymbol,ts=le().arrayAtomicsSymbol,Age=le().documentArrayParent,wge=le().documentIsModified,QU=le().documentModifiedPaths,Oge=le().documentSchemaSymbol,Sge=le().getSymbol,IU=le().modelSymbol,$U=le().populateModelSymbol,Cge=le().scopeSymbol,JU=zi().schemaMixedSymbol,bge=aU(),Dge=le().sessionNewDocuments,Tge=hU(),Sy,yf,OA=V.specialProperties;/*!
273
+ * Document internals that don't start with `$`. `isNew` is a getter/setter
274
+ * for `$isNew`.
275
+ */var Mge=new Set(["_doc","__parentArray","__index","isNew"]);function k(e,t,r){if(typeof r==="boolean")throw Error("The skipId parameter has been removed. Use { skipId: true } in the options parameter instead.");if(r==null)r={};let n=r.skipId;if(this.$__=new sge,this.$__schema==null){let l=V.isObject(t)&&!t.instanceOfSchema?new uge(t):t;this.$__setSchema(l),r=Object.assign({},r),t=r,n=r.skipId}if(r.isNew!=null&&r.isNew!==!0)this.$isNew=r.isNew;if(r.priorDoc!=null)this.$__.priorDoc=r.priorDoc;if(n)this.$__.skipId=n;if(e!=null&&typeof e!=="object")throw new AA(e,"obj","Document");let s=!0;if(r.defaults!==void 0)this.$__.defaults=r.defaults,s=r.defaults;let i=this.$__schema;if(typeof t==="boolean"||t==="throw"){if(t!==!0)this.$__.strictMode=t;t=void 0}else if(r.strict!==void 0)this.$__.strictMode=r.strict;else if(i.options.strict!==!0)this.$__.strictMode=i.options.strict;let o=i.requiredPaths();for(let l of o)this.$__.activePaths.require(l);let u=null;if(V.isPOJO(t)&&V.hasOwnKeys(t))u=mge(t),this.$__.selected=t,this.$__.exclude=u;let a=u===!1&&t?zU(t):null,c=!0;if(this._doc==null){if(this.$__buildDoc(e,t,n,u,a,!1),s)c=EA(this,t,u,a,!0,null,_ge)}if(e){let l=Object.assign({},r);if(this.$__original_set)this.$__original_set(e,void 0,!0,l);else this.$set(e,void 0,!0,l);if(e.$__!=null&&e instanceof k)this.$isNew=e.$isNew}if(r.willInit&&s){if(r.skipDefaults)this.$__.skipDefaults=r.skipDefaults}else if(s&&c)EA(this,t,u,a,!1,r.skipDefaults);if(!this.$__.strictMode&&e){let l=this;Object.keys(this._doc).forEach(function(h){if(!(h in i.tree)&&!(h in i.methods)&&!(h in i.virtuals)&&_A(h))cge({prop:h,subprops:null,prototype:l})})}vge(this)}k.prototype.$isMongooseDocumentPrototype=!0;Object.defineProperty(k.prototype,"isNew",{get:function(){return this.$isNew},set:function(e){this.$isNew=e}});Object.defineProperty(k.prototype,"errors",{get:function(){return this.$errors},set:function(e){this.$errors=e}});/*!
276
+ * ignore
277
+ */k.prototype.$isNew=!0;/*!
278
+ * Document exposes the NodeJS event emitter API, so you can use
279
+ * `on`, `once`, etc.
280
+ */V.each(["on","once","emit","listeners","removeListener","setMaxListeners","removeAllListeners","addListener"],function(e){k.prototype[e]=function(){if(!this.$__.emitter){if(e==="emit")return;this.$__.emitter=new gA,this.$__.emitter.setMaxListeners(0)}return this.$__.emitter[e].apply(this.$__.emitter,arguments)},k.prototype[`$${e}`]=k.prototype[e]});k.prototype.constructor=k;for(let e in gA.prototype)k[e]=gA.prototype[e];k.prototype.$__schema;k.prototype.schema;Object.defineProperty(k.prototype,"$locals",{configurable:!1,enumerable:!1,get:function(){if(this.$__.locals==null)this.$__.locals={};return this.$__.locals},set:function(e){this.$__.locals=e}});k.prototype.isNew;Object.defineProperty(k.prototype,"$where",{configurable:!1,enumerable:!1,writable:!0});k.prototype.id;k.prototype.$errors;Object.defineProperty(k.prototype,"$op",{get:function(){return this.$__.op||null},set:function(e){this.$__.op=e}});/*!
281
+ * ignore
282
+ */function xge(e,t,r){if(e==null)return;let n=r.$__schema._getDefaultsCache().defaultsByNestedPath.get(t);if(n==null)return;let{paths:s,schemaTypes:i,depth:o}=n,u=s.length;for(let a=0;a<u;++a){let c=s[a],l=i[a],f=l.splitPath(),h=f.length,d=e;for(let p=o;p<h;++p){let m=f[p];if(p===h-1){if(d[m]!==void 0)break;try{let E=l.getDefault(r,!1);if(E!==void 0)d[m]=E,r.$__.activePaths.default(c)}catch(E){r.invalidate(c,E)}break}if(d[m]==null)d[m]={};else if(typeof d[m]!=="object")break;d=d[m]}}}k.prototype.$__buildDoc=function(e,t,r,n,s){if(!V.hasOwnKeys(this.$__schema.nested)){this._doc={};return}let i={},o=Object.keys(this.$__schema.paths),u=o.length,a=0;for(;a<u;++a){let c=o[a];if(c.includes("$*"))continue;let l=this.$__schema.paths[c].splitPath(),f=l.length;if(f===1)continue;let h=f-1,d="",p=i,m=!1;for(let E=0;E<f;++E){let y=l[E];if(!d.length)d=y;else d+="."+y;if(n===!0){if(d in t)break}else if(n===!1&&t&&!m){if(d in t)m=!0;else if(!s[d])break}if(E<h)p=p[y]||(p[y]={})}}this._doc=i};/*!
283
+ * Converts to POJO when you use the document for querying
284
+ */k.prototype.toBSON=function(){return this.toObject(KU)};k.prototype.init=function(e,t,r){if(typeof t==="function")r=t,t=null;if(e==null)throw new AA(e,"doc","init");if(this.$__init(e,t),r)r(null,this);return this};k.prototype.$init=function(){return this.constructor.prototype.init.apply(this,arguments)};k.prototype.$__init=function(e,t){if(e==null)throw new AA(e,"doc","init");if(this.$isNew=!1,t=t||{},e._id!=null&&t.populated&&t.populated.length){let n=String(e._id);for(let s of t.populated){if(s.isVirtual)this.$populated(s.path,V.getValue(s.path,e),s);else this.$populated(s.path,s._docs[n],s);if(s._childDocs==null)continue;for(let i of s._childDocs){if(i?.$__==null)continue;i.$__.parent=this}s._childDocs=[]}}XU(this,e,this._doc,t),yge(this,t.populated),this.$emit("init",this),this.constructor.emit("init",this);let r=this.$__.exclude===!1&&this.$__.selected?zU(this.$__.selected):null;return EA(this,this.$__.selected,this.$__.exclude,r,!1,this.$__.skipDefaults),this};function XU(e,t,r,n,s){if(s=s||"",typeof t!=="object"||Array.isArray(t))throw new UU(e.$basePath,t);if(qn(t))t=t._doc;let i=Object.keys(t),o=i.length,u,a,c,l=e.$__.strictMode,f=e.$__schema,h=f.options.strictRead;for(let d=0;d<o;++d){if(c=i[d],OA.has(c))continue;if(a=s?s+c:c,u=f.path(a),f.$isRootDiscriminator&&!e.$__isSelected(a))continue;let p=t[c];if(!u&&h&&f.pathType(a)==="adhocOrUndefined"){if(h==="throw")throw new A1(a,"Field `"+a+"` is not in schema and strictRead is set to throw.");else if(h===!0)continue}if(!u&&V.isPOJO(p)){if(!Object.hasOwn(r,c)&&c in r)continue;if(!r[c]){if(r[c]={},!l&&!s&&!(c in f.tree)&&!(c in f.methods)&&!(c in f.virtuals)&&_A(c))e[c]=r[c];else if(n?.virtuals&&Object.hasOwn(f.virtuals,c))e[c]=r[c]}XU(e,p,r[c],n,a+".")}else if(!u){if(h==="throw")throw new A1(a,"Field `"+a+"` is not in schema and strictRead is set to throw.");else if(h===!0)continue;if(r[c]=p,!l&&!s){if(_A(c))e[c]=p}else if(n?.virtuals&&Object.hasOwn(f.virtuals,c))e[c]=p;else if(n?.strict==="throw")throw new A1(c)}else{if(Object.hasOwn(r,c)&&p!==void 0&&!n.hydratedPopulatedDocs)delete r[c];if(p===null)r[c]=u._castNullish(null);else if(p!==void 0){let E=qn(p)?p.$__.wasPopulated:null;if(u&&!E&&!n.hydratedPopulatedDocs)try{if(n?.setters)r[c]=u.applySetters(p,e,!1,null,n);else r[c]=u.cast(p,e,!0,void 0,n)}catch(y){e.invalidate(y.path,new VU({path:y.path,message:y.message,type:"cast",value:y.value,reason:y}))}else if(u&&n.hydratedPopulatedDocs){if(r[c]=u.cast(p,e,!0,void 0,{hydratedPopulatedDocs:!0}),qn(r[c])&&r[c].$__.wasPopulated)e.$populated(a,r[c].$__.wasPopulated.value,r[c].$__.wasPopulated.options);else if(Array.isArray(r[c])&&r[c].length&&qn(r[c][0])&&r[c][0].$__.wasPopulated)e.$populated(a,r[c].map((y)=>qn(y)?y.$__.wasPopulated?.value:null).filter((y)=>y!=null),r[c][0].$__.wasPopulated.options)}else r[c]=p}let m=e.$__.activePaths;if(m.states.modify==null||!e.$isModified(a))m.init(a)}}}function _A(e){return!e.startsWith("$")&&!Mge.has(e)}k.prototype.updateOne=function(t,r){let n=this.constructor.updateOne(),s=this;return n.pre(async function(){let o=await s._execDocumentPreHooks("updateOne",r,[s,t,r]);if(o[0]!==s||o[1]!==t||o[2]!==r)throw Error("Document updateOne pre hooks cannot overwrite arguments");if(n.updateOne({_id:s._doc._id},t,r),s.$where!=null)this.where(s.$where);if(s.$session()!=null){if(!("session"in n.options))n.options.session=s.$session()}return o}),n.post(function(){return s._execDocumentPostHooks("updateOne",r)}),n};k.prototype.replaceOne=function(){let t=[...arguments];return t.unshift({_id:this._doc._id}),this.constructor.replaceOne.apply(this.constructor,t)};k.prototype.$session=function(t){if(arguments.length===0){if(this.$__.session?.hasEnded)return this.$__.session=null,null;return this.$__.session}if(t?.hasEnded)throw new Sr("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(t==null&&this.$__.session==null)return;if(this.$__.session=t,!this.$isSubdocument){let r=this.$getAllSubdocs();for(let n of r)n.$session(t)}return t};k.prototype.$timestamps=function(t){if(arguments.length===0){if(this.$__.timestamps!=null)return this.$__.timestamps;if(this.$__schema)return this.$__schema.options.timestamps;return}let r=this.$timestamps();if(t!==r)this.$__.timestamps=t;return this};k.prototype.overwrite=function(t){let r=new Set(Object.keys(this._doc));for(let s of Object.keys(t))r.add(s);let n=this.$__schema.options;for(let s of r){if(s==="_id")continue;if(n.versionKey&&s===n.versionKey)continue;if(n.discriminatorKey&&s===n.discriminatorKey)continue;this.$set(s,t[s])}return this};k.prototype.$set=function(t,r,n,s){if(V.isPOJO(n))s=n,n=void 0;let i=n===!0;if(n&&!i){let y=this.$__.adhocPaths||(this.$__.adhocPaths={});y[t]=this.$__schema.interpretAsType(t,n,this.$__schema.options)}let o=s!=null&&"strict"in s,u=o?s.strict:this.$__.strictMode;if(t==null)[t,r]=[r,t];if(typeof t!=="string"){let y=t;if(y instanceof k)if(y.$__isNested)y=y.toObject();else y=y.$__schema===this.$__schema?CA(y,{...y._doc}):y._doc;let _=r?r+".":"";for(let A of BU(this.$__schema,y)){let M=_+A,O=y[A],x=this.$__schema.pathType(M);if(i&&!_&&O!=null&&x==="nested"&&this._doc[A]!=null)delete this._doc[A];if(x==="nested"&&V.isNonBuiltinObject(O)){this.$set(M,O,i,s),xge(this.$get(M),M,this);continue}if(u){if(i&&O===void 0&&this.$get(M)!==void 0)continue;if(x==="adhocOrUndefined")x=yA(this,M,{typeOnly:!0});if(x!=="real"&&x!=="virtual"){if(u==="throw")throw x==="nested"?new UU(A,O):new A1(A);if(x!=="nested"||O!=null)continue}}this.$set(M,O,i,s)}let w=this._doc,C={};for(let A of Object.keys(this.$__schema.tree))if(Object.hasOwn(w,A))C[A]=w[A];for(let A of Object.keys(w))if(!Object.hasOwn(C,A))C[A]=w[A];return this._doc=C,this}let a=t.indexOf(".");if(a!==-1){let y=this.$__schema.aliases[t.slice(0,a)];if(typeof y==="string")t=y+t.slice(a)}let c=a===-1?[t]:t.split("."),l=this.$__schema.pathType(t);if(l==="adhocOrUndefined")l=yA(this,c,{typeOnly:!0});if(l==="adhocOrUndefined"&&!o){let y=fge(this.$__schema,c);if(y!==void 0)u=y}r=dge(r,!0);let f=this.$__.priorDoc!=null?this.$__.priorDoc.$__getValue(t):i?void 0:this.$__getValue(t);if(l==="nested"&&r){if(typeof r==="object")r=Tge(r,KU);if(r==null||typeof r!=="object")return this.invalidate(t,new Sr.CastError("Object",r,t)),this;let y=this.$__.savedState,_=y!=null&&Object.hasOwn(y,t);if(y!=null&&!this.$isNew&&!_){let A=this.$__getValue(t);y[t]=A;for(let M of Object.keys(A||{}))y[t+"."+M]=A[M]}if(s?.merge)return this.$set(r,t,i,s);let w=this.$isModified(t);pA(this,t),this.$__setValue(t,{});let C={...s,_skipMarkModified:!0};for(let A of BU(this.$__schema,r,t))this.$set(t+"."+A,r[A],i,C);if(f!=null&&(!w||_)&&V.deepEqual(_?y[t]:f,r))this.unmarkModified(t);else this.markModified(t);return this}let h;if(l==="adhocOrUndefined"&&u){let y="";for(let _=0;_<c.length-1;++_)if(y=_===0?c[0]:y+"."+c[_],this.$__schema.pathType(y)==="virtual")return HU.set(t,r,this),this;if(h=this.$__schema.path(t)??yA(this,t),h==null){if(u==="throw")throw new A1(t);return this}}else if(l==="virtual")return this.$__schema.virtualpath(t).applySetters(r,this),this;else h=this.$__path(t);let d=t,p=this._doc,m="";for(let y=0;y<c.length-1;++y)if(p=p instanceof Map?p.get(c[y]):p[c[y]],m+=(m.length!==0?".":"")+c[y],!p){if(this.$set(m,{}),!this.$__isSelected(m))this.unmarkModified(m);if(p=this.$__getValue(m),p===null){d=m;break}}if(!h){if(this.$__set(d,t,s,i,c,h,r,f),l==="nested"&&r==null)pA(this,t);return this}if(h.$isSingleNested||h.$isMongooseArray)$ge(this,t);if(r!=null&&s?.merge&&h.$isSingleNested){if(r instanceof k)r=r.toObject({virtuals:!1,transform:!1});for(let y of Object.keys(r))this.$set(t+"."+y,r[y],i,s);return this}let E=!0;try{let y=!1;if(r instanceof k&&h.options!=null){let{modelName:A,baseModelName:M}=r.constructor,O=h.options.ref;if(typeof O==="function"&&!O[IU])O=O.call(this,this);if(O=O?.modelName||O,O!=null&&(O===A||O===M))y=!0;else if(h.options.refPath!=null){let x=h.options.refPath;if(typeof x==="function"&&!x[IU]){let P=this.$__fullPathWithIndexes?.();x=x.call(this,this,P?P+"."+t:t)}if(typeof x!=="string")throw new Sr("`refPath` must be a string or a function that returns a string, got "+Oy(x));let v=this.ownerDocument().get(x);y=v===A||v===M}}let _=!1;if(y&&(!r.$__.wasPopulated||V.deepEqual(r.$__.wasPopulated.value,r._doc._id))){let A=h.$isSingleNested?h.cast(r,this):r._doc._id;this.$populated(t,A,{[$U]:r.constructor}),r.$__.wasPopulated={value:A},_=!0}let w=h.options?.[this.$__schema.options.typeKey],C=Array.isArray(w)?w[0]?.ref:null;if(C&&Pge(r,C)){this.$populated(t,r.map((A)=>A._doc._id),{[$U]:r[0].constructor});for(let A of r)A.$__.wasPopulated={value:A._doc._id};_=!0}if(!y||!h.$isSingleNested){let A=this;if(WU(this.$__schema.singleNestedPaths,t)!=null&&c.length>1)A=bge(this,c,this.schema);let M={path:t};if(s?.overwriteImmutable)M.overwriteImmutable=!0;r=h.applySetters(r,A,!1,f,M)}if(h.$isMongooseDocumentArray&&Array.isArray(r)&&qn(r[0])&&r[0].$__.populated!=null){let A=r[0].$__.populated;for(let M of Object.keys(A))this.$populated(t+"."+M,r.map((O)=>O.$populated(M)),A[M].options);_=!0}if(!_&&this.$__.populated){if(Array.isArray(r)&&this.$__.populated[t]){for(let A=0;A<r.length;++A)if(r[A]instanceof k)r.set(A,r[A]._doc._id,!0)}delete this.$__.populated[t]}if(r!=null&&h.$isSingleNested)Rge(r,h,f);this.$markValid(t)}catch(y){if(y instanceof Sr.StrictModeError&&y.isImmutableError)this.invalidate(t,y);else if(y instanceof Sr.CastError)this.invalidate(y.path,y);else this.invalidate(t,new Sr.CastError(h.instance,r,t,y));E=!1}if(E){let y=null,_=null;if(!i){let w=this.$isSubdocument?this.ownerDocument():this;y=w.$__.savedState,_=this.$isSubdocument?this.$__.fullPath+"."+t:t,w.$__saveInitialState(_)}if(this.$__set(d,t,s,i,c,h,r,f),y!=null&&Object.hasOwn(y,_)){let w=this.$__.session,C=w?.[Dge]?.get(this)?.modifiedPaths,A=C!=null&&!C.has(_);if((!w?.transaction||A)&&V.deepEqual(r,y[_]))this.unmarkModified(t)}}if(h.$isSingleNested&&(this.isDirectModified(t)||r==null)||h.$isSchemaMap&&r==null)pA(this,t);return this};/*!
285
+ * ignore
286
+ */function Pge(e,t){if(!Array.isArray(e))return!1;if(e.length===0)return!1;for(let r of e){if(!(r instanceof k))return!1;if(r.constructor.modelName==null)return!1;if(r.constructor.modelName!=t&&r.constructor.baseModelName!=t)return!1}return!0}k.prototype.set=k.prototype.$set;k.prototype.$__shouldModify=function(e,t,r,n,s,i,o,u){if(r?._skipMarkModified)return!1;if(this.$isNew)return!0;if(t in this.$__.activePaths.getStatePaths("modify"))return!0;if(o===void 0&&!this.$__isSelected(t))return!0;if(o===void 0&&t in this.$__.activePaths.getStatePaths("default"))return!1;if(this.$populated(t)&&o instanceof k&&wy(o._doc._id,u))return!1;if(!wy(o,u!==void 0?u:V.getValue(t,this)))return!0;if(!n&&o!==null&&o!==void 0&&t in this.$__.activePaths.getStatePaths("default")&&wy(o,i.getDefault(this,n)))return!0;return!1};k.prototype.$__set=function(e,t,r,n,s,i,o,u){yf=yf||_1();let a=this.$isNew&&!r?._skipMarkModified?!0:this.$__shouldModify(e,t,r,n,s,i,o,u);if(a){if(this.$__.primitiveAtomics?.[t]){if(delete this.$__.primitiveAtomics[t],V.hasOwnKeys(this.$__.primitiveAtomics)===!1)delete this.$__.primitiveAtomics}if(this.markModified(e),o&&V.isMongooseArray(o)){if(o._registerAtomic("$set",o),V.isMongooseDocumentArray(o))o.forEach(function(d){d&&d.__parentArray&&(d.__parentArray=o)})}}else if(Array.isArray(o)&&Array.isArray(u)&&V.isMongooseArray(o)&&V.isMongooseArray(u)){if(o[ts]=u[ts],o[Ef]=u[Ef],V.isMongooseDocumentArray(o))o.forEach((d)=>{if(d!=null)d.$isNew=!1})}let c=this._doc,l=0,f=s.length,h="";for(;l<f;l++){let p=l+1===f;if(h+=h?"."+s[l]:s[l],OA.has(s[l]))continue;if(p)if(c instanceof Map)c.set(s[l],o);else if(c.$isSingleNested){if(!(s[l]in c))c[s[l]]=o,c._doc[s[l]]=o;else c._doc[s[l]]=o;if(a)c.markModified(s[l])}else c[s[l]]=o;else{let m=c instanceof Map,E=m?c.get(s[l]):c[s[l]],y=qn(c)&&!c.$__isNested?c._doc:c;if(!m&&!Object.hasOwn(y,s[l])&&s[l]in c)return;if(V.isPOJO(E))c=E;else if(E&&E instanceof yf)c=E;else if(E&&!Array.isArray(E)&&E.$isSingleNested)c=E;else if(E&&Array.isArray(E))c=E;else if(E==null){if(E={},m)c.set(s[l],E);else c[s[l]]=E;c=E}else c=E}}};k.prototype.$__getValue=function(e){if(typeof e!=="string"&&!Array.isArray(e))throw TypeError(`Invalid \`path\`. Must be either string or array. Got "${e}" (type ${typeof e})`);return V.getValue(e,this._doc)};k.prototype.$inc=function(t,r){if(r==null)r=1;if(Array.isArray(t))return t.forEach((a)=>this.$inc(a,r)),this;let n=this.$__path(t);if(n==null){if(this.$__.strictMode==="throw")throw new A1(t);else if(this.$__.strictMode===!0)return this}else if(n.instance!=="Number")return this.invalidate(t,new Sr.CastError(n.instance,r,t)),this;let s=this.$__getValue(t)||0,i=!1,o=null,u=r;try{r=n.cast(r),o=n.applySetters(s+r,this),u=o-s,i=!0}catch(a){this.invalidate(t,new Sr.CastError("number",r,t,a))}if(i){if(this.$__.primitiveAtomics=this.$__.primitiveAtomics||{},this.$__.primitiveAtomics[t]==null)this.$__.primitiveAtomics[t]={$inc:u};else this.$__.primitiveAtomics[t].$inc+=u;this.markModified(t),this.$__setValue(t,o)}return this};k.prototype.$__setValue=function(t,r){if(Array.isArray(t)&&t.length===1)return this._doc[t[0]]=r,this;return V.setValue(t,r,this._doc),this};k.prototype.get=function(e,t,r){let n;if(r==null)r={};if(t)n=this.$__schema.interpretAsType(e,t,this.$__schema.options);let s=r.noDottedPath,i=s?Object.hasOwn(this.$__schema.paths,e)?this.$__schema.paths[e]:void 0:this.$__path(e);if(i==null){if(i=this.$__schema.virtualpath(e),i!=null)return i.applyGetters(void 0,this)}if(s){let c=Object.hasOwn(this._doc,e)?this._doc[e]:void 0;if(n)c=n.cast(c);if(i!=null&&r.getters!==!1)return i.applyGetters(c,this);return c}if(i?.instance==="Mixed"){let c=this.$__schema.virtualpath(e);if(c!=null)i=c}let o=e.indexOf(".")!==-1,u=this._doc,a=o?e.split("."):[e];if(typeof this.$__schema.aliases[a[0]]==="string")a[0]=this.$__schema.aliases[a[0]];for(let c=0,l=a.length;c<l;c++){if(OA.has(a[c]))return;if(u&&u._doc)u=u._doc;if(u==null)u=void 0;else if(u instanceof Map)u=u.get(a[c],{getters:!1});else if(c===l-1)u=V.getValue(a[c],u);else u=u[a[c]]}if(n)u=n.cast(u);if(i!=null&&r.getters!==!1)u=i.applyGetters(u,this);else if(Object.hasOwn(this.$__schema.nested,e)&&r.virtuals)return CA(this,Ki(u)||{},{path:e});return u};/*!
287
+ * ignore
288
+ */k.prototype[Sge]=k.prototype.get;k.prototype.$get=k.prototype.get;k.prototype.$__path=function(e){let t=this.$__.adhocPaths,r=t&&Object.hasOwn(t,e)?t[e]:null;if(r)return r;return this.$__schema.path(e)};k.prototype.markModified=function(e,t){if(this.$__saveInitialState(e),this.$__.activePaths.modify(e),t!=null&&!this.$isSubdocument)this.$__.pathsToScopes=this.$__pathsToScopes||{},this.$__.pathsToScopes[e]=t};/*!
289
+ * ignore
290
+ */k.prototype.$__saveInitialState=function(t){let r=this.$__.savedState,n=t;if(r!=null){let s=n.indexOf("."),i=s===-1?n:n.slice(0,s);if(!Object.hasOwn(r,i))r[i]=Ki(this.$__getValue(i))}};k.prototype.unmarkModified=function(e){if(this.$__.activePaths.init(e),this.$__.pathsToScopes!=null)delete this.$__.pathsToScopes[e]};k.prototype.$ignore=function(e){this.$__.activePaths.ignore(e)};k.prototype.directModifiedPaths=function(){return Object.keys(this.$__.activePaths.getStatePaths("modify"))};k.prototype.$isEmpty=function(e){let t={minimize:!0,virtuals:!1,getters:!1,transform:!1};if(arguments.length!==0){let r=this.$get(e);if(r==null)return!0;if(typeof r!=="object")return!1;if(V.isPOJO(r))return ZU(r);return Object.keys(r.toObject(t)).length===0}return Object.keys(this.toObject(t)).length===0};/*!
291
+ * ignore
292
+ */function ZU(e){if(e==null)return!0;if(typeof e!=="object"||Array.isArray(e))return!1;for(let t of Object.keys(e))if(!ZU(e[t]))return!1;return!0}k.prototype.modifiedPaths=function(e){e=e||{};let t=Object.keys(this.$__.activePaths.getStatePaths("modify")),r=new Set,n=0,s=0,i=t.length;for(n=0;n<i;++n){let o=t[n],u=wA(o),a=u.length;for(s=0;s<a;++s)r.add(u[s]);if(!e.includeChildren)continue;let c=0,l=this.$get(o);if(typeof l==="object"&&l!==null){if(l._doc)l=l._doc;let f=l.length;if(Array.isArray(l))for(c=0;c<f;++c){let h=o+"."+c;if(!r.has(h)){if(r.add(h),qn(l[c])){let d=l[c].modifiedPaths(),p=0,m=d.length;for(p=0;p<m;++p)r.add(h+"."+d[p])}}}else{let h=Object.keys(l),d=0,p=h.length;for(d=0;d<p;++d)r.add(o+"."+h[d])}}}return Array.from(r)};k.prototype[QU]=k.prototype.modifiedPaths;k.prototype.isModified=function(e,t,r){if(e){let n=t?.ignoreAtomics,s=this.$__.activePaths.states.modify;if(s==null)return!1;if(typeof e==="string")e=e.indexOf(" ")===-1?[e]:e.split(" ");for(let a of e)if(s[a]!=null)return!0;let i=r||this[QU](),o=e.some(function(a){return!!~i.indexOf(a)}),u=Object.keys(s);if(n)u=u.filter((a)=>{let c=this.$__getValue(a);if(c?.[ts]!=null&&c[ts].$set===void 0)return!1;return!0});return o||e.some(function(a){return u.some(function(c){return c===a||a.startsWith(c+".")})})}return this.$__.activePaths.some("modify")};k.prototype.$isModified=k.prototype.isModified;k.prototype[wge]=k.prototype.isModified;k.prototype.$isDefault=function(e){if(e==null)return this.$__.activePaths.some("default");if(typeof e==="string"&&e.indexOf(" ")===-1)return Object.hasOwn(this.$__.activePaths.getStatePaths("default"),e);let t=e;if(!Array.isArray(t))t=t.split(" ");return t.some((r)=>Object.hasOwn(this.$__.activePaths.getStatePaths("default"),r))};k.prototype.$isDeleted=function(e){if(arguments.length===0)return!!this.$__.isDeleted;return this.$__.isDeleted=!!e,this};k.prototype.isDirectModified=function(e){if(e==null)return this.$__.activePaths.some("modify");if(typeof e==="string"&&e.indexOf(" ")===-1){let r=Object.hasOwn(this.$__.activePaths.getStatePaths("modify"),e);if(r||e.indexOf(".")===-1)return r;let n=e.split(".");for(let s=0;s<n.length-1;++s){let i=n.slice(0,s+1).join("."),o=this.$get(i);if(qn(o)&&o.isDirectModified(n.slice(s+1).join(".")))return!0}return!1}let t=e;if(typeof t==="string")t=t.split(" ");return t.some((r)=>this.isDirectModified(r))};k.prototype.isInit=function(e){if(e==null)return this.$__.activePaths.some("init");if(typeof e==="string"&&e.indexOf(" ")===-1)return Object.hasOwn(this.$__.activePaths.getStatePaths("init"),e);let t=e;if(!Array.isArray(t))t=t.split(" ");return t.some((r)=>Object.hasOwn(this.$__.activePaths.getStatePaths("init"),r))};k.prototype.isSelected=function(t){if(this.$__.selected==null)return!0;if(!t)return!1;if(t==="_id")return this.$__.selected._id!==0;if(t.indexOf(" ")!==-1)t=t.split(" ");if(Array.isArray(t))return t.some((o)=>this.$__isSelected(o));let r=eV(this),{paths:n,inclusive:s}=r;if(r.onlyId)return this.$__.selected._id===0;if(s===null)return!0;if(t in this.$__.selected)return s;let i=t.indexOf(".")!==-1;if(!r.hasNestedKey){if(i)for(let o=t.indexOf(".");o!==-1;o=t.indexOf(".",o+1)){let u=t.slice(0,o);if(u!=="_id"&&Object.hasOwn(this.$__.selected,u))return s}return!s}for(let o of n){if(o==="_id")continue;if(o.charAt(t.length)==="."&&o.slice(0,t.length)===t)return s||o!==t+".";if(i&&t.charAt(o.length)==="."&&t.slice(0,o.length)===o)return s}return!s};/*!
293
+ * Computes and caches the derived properties of `doc.$__.selected` that
294
+ * `isSelected()` and `isDirectSelected()` would otherwise recompute on every
295
+ * call. `$__.selected` is assigned once in the Document constructor and never
296
+ * mutated afterwards, so this can safely be cached for the document's lifetime.
297
+ */function eV(e){if(e.$__.selectedIndex!==void 0)return e.$__.selectedIndex;let t=e.$__.selected,r=Object.keys(t),n=null,s=!1;for(let i of r){if(i==="_id")continue;if(i.indexOf(".")!==-1)s=!0;if(n===null&&pge(t[i]))n=!!t[i]}return e.$__.selectedIndex={paths:r,inclusive:n,hasNestedKey:s,onlyId:r.length===1&&r[0]==="_id"}}k.prototype.$__isSelected=k.prototype.isSelected;k.prototype.isDirectSelected=function(t){if(this.$__.selected==null)return!0;if(t==="_id")return this.$__.selected._id!==0;if(t.indexOf(" ")!==-1)t=t.split(" ");if(Array.isArray(t))return t.some((n)=>this.isDirectSelected(n));let r=eV(this);if(r.onlyId)return this.$__.selected._id===0;if(r.inclusive===null)return!0;if(Object.hasOwn(this.$__.selected,t))return r.inclusive;return!r.inclusive};k.prototype.validate=async function(t,r){if(typeof t==="function"||typeof r==="function"||typeof arguments[2]==="function")throw new Sr("Document.prototype.validate() no longer accepts a callback");if(this.$op="validate",arguments.length===1){if(typeof arguments[0]==="object"&&!Array.isArray(arguments[0]))r=arguments[0],t=null}if(r&&typeof r.pathsToSkip==="string"){let i=r.pathsToSkip.indexOf(" ")===-1;r.pathsToSkip=i?[r.pathsToSkip]:r.pathsToSkip.split(" ")}let n=r?._skipParallelValidateCheck;if(this.$isSubdocument!=null);else if(this.$__.validating&&!n)throw new oge(this);else if(!n)this.$__.validating=!0;let s=this.$__middleware.hasHooks("validate");try{try{if(s)[r]=await this._execDocumentPreHooks("validate",r,[r]);else if(!n)await Promise.resolve()}catch(y){if(s)await this._execDocumentPostHooks("validate",r,y);return}if(this.$__.saveOptions&&this.$__.saveOptions.pathsToSave&&!t)t=[...this.$__.saveOptions.pathsToSave];let i=r&&typeof r==="object"&&"validateModifiedOnly"in r,o=r?.pathsToSkip||null,u;if(i)u=!!r.validateModifiedOnly;else u=this.$__schema.options.validateModifiedOnly;this.$__.validateModifiedOnly=u;let a=r?.validateAllPaths;if(a){if(o)throw TypeError("Cannot set both `validateAllPaths` and `pathsToSkip`");if(t)throw TypeError("Cannot set both `validateAllPaths` and `pathsToValidate`");if(i&&u)throw TypeError("Cannot set both `validateAllPaths` and `validateModifiedOnly`")}let c=this,l,f;if(a)[l,f]=tV(this);else{let y=rV(this,t,o);l=u?y[0].filter((_)=>this.$isModified(_)):y[0],f=y[1]}if(typeof t==="string")t=t.split(" ");if(l.length===0){let y=RU(this);if(s)await this._execDocumentPostHooks("validate",r,y);else if(y!=null)throw y;return}let h={},d=Array.isArray(this.$__.saveOptions?.pathsToSave)?new Set(this.$__.saveOptions.pathsToSave):null,p=[];for(let y=0;y<l.length;++y){let _=l[y];if(d!=null&&!d.has(_)){p.push(Promise.resolve(null));continue}if(_==null||h[_]){p.push(Promise.resolve(null));continue}h[_]=!0;let w=c.$__schema.path(_);if(!w){p.push(Promise.resolve(null));continue}if(!c.$isValid(_)){p.push(Promise.resolve(null));continue}if(w[JU]!=null&&_!==w.path){p.push(Promise.resolve(null));continue}let C=c.$__getValue(_),A;if(A=c.$populated(_))C=A;else if(qn(C)&&C.$__.wasPopulated)C=C._doc._id;let M=c.$__.pathsToScopes!=null&&_ in c.$__.pathsToScopes?c.$__.pathsToScopes[_]:c,O={...f[_],path:_,validateAllPaths:a,_nestedValidate:!0};if(u)O.validateModifiedOnly=!0;p.push(w.doValidate(C,M,O).then(()=>null,(x)=>{if((w.$isSingleNested||w.$isArraySubdocument||w.$isMongooseDocumentArray)&&x instanceof gf)return null;return x}))}let m=await Promise.all(p);for(let y=0;y<m.length;++y){let _=m[y];if(_==null)continue;if(this.$__.validationError==null)this.$__.validationError=new gf(this);c.invalidate(l[y],_,void 0,!0)}let E=RU(this);if(s)await this._execDocumentPostHooks("validate",r,E);else if(E!=null)throw E}finally{this.$__.validateModifiedOnly=void 0,this.$op=null,this.$__.validating=null}};k.prototype.$validate=k.prototype.validate;/*!
298
+ * Event emitting and error persisting logic that needs to happen in both the `paths.length === 0`
299
+ * and `paths.length > 0` cases in `Document.prototype.validate()`.
300
+ *
301
+ * @param {Document} doc
302
+ * @return {Error}
303
+ * @private
304
+ */function RU(e){let t=e.$__.validationError;if(e.$__.validationError=null,e.$__.validating=null,e.$__.validateModifiedOnly&&t!=null){let r=Object.keys(t.errors);for(let n of r)if(!e.$isModified(n))delete t.errors[n];if(V.hasOwnKeys(t.errors)===!1)t=void 0}if(e.$__.cachedRequired=null,e.$emit("validate",e),e.constructor.emit("validate",e),t){for(let r in t.errors)if(!e[Age]&&t.errors[r]instanceof Sr.CastError)e.invalidate(r,t.errors[r])}return t}/*!
305
+ * Build the list for `validateAllPaths`. The document array path validates
306
+ * every subdocument, but skips nullish elements. Add those elements separately
307
+ * so their element-level validators still run.
308
+ */function tV(e){let t=Object.keys(e.$__schema.paths).filter((n)=>n.charAt(n.length-1)!=="*"||n.charAt(n.length-2)!=="$"||n.charAt(n.length-3)!=="."),r={};for(let n=0;n<t.length;++n){let s=t[n],i=e.$__schema.path(s);if(i==null)continue;let o=e.$__getValue(s);if(!o)continue;if(i.$isSchemaMap)for(let u of o.keys())t.push(s+"."+u);else if(i.$isMongooseDocumentArray){if(i.embeddedSchemaType?.validators.length)for(let u=0;u<o.length;++u){let a=s+"."+u;t.push(a),r[a]={skipSubdocumentValidation:!0,index:u}}}else if(i.$isMongooseArray)SA(o,t,s)}return[t,r]}/*!
309
+ * ignore
310
+ */var vU=Object.freeze(["init","default","modify"]),kU=42;/*!
311
+ * Builds the list of paths to run validation on, plus per-path options for
312
+ * `doValidate()`.
313
+ *
314
+ * `activePaths` tells us which paths changed (`require`, `init`, `default`,
315
+ * `modify`), but that is neither a complete nor a minimal list of paths to
316
+ * validate, in four separate ways. Each phase below fixes exactly one:
317
+ *
318
+ * 1. Seed Collect the changed paths, dropping ones that have nothing to
319
+ * run and ones a subdocument already validates for us.
320
+ * 2. Resolve Some entries are not schema paths at all: a modified nested
321
+ * object is stored as one entry (`nest`), but the paths that
322
+ * have validators are its children (`nest.name`).
323
+ * 3. Cover Replace changed descendants with their actual subdocument or
324
+ * document array, which owns validation below that path.
325
+ * 4. Augment Primitive arrays, required document array elements, and maps
326
+ * need concrete element or key paths listed individually.
327
+ *
328
+ * Validating a subdocument or document array validates everything underneath
329
+ * it, so `arr` makes `arr.0.name` redundant. Phase 3 uses the actual
330
+ * subdocuments and their modified paths to remove descendants seeded earlier.
331
+ * It runs for nested documents as well, so every document selects containers
332
+ * from its own schema without relying on `$parentSchemaDocArray`.
333
+ *
334
+ * If a document array element is modified, for example `arr.0.name`,
335
+ * array-level validators on `arr` still run. This behavior dates back to gh-6818.
336
+ *
337
+ * `pathsToValidate` / `pathsToSkip` are applied before augment, so that asking
338
+ * for `arr` still validates its elements. Duplicates are fine; both callers
339
+ * skip paths they have already validated.
340
+ */function rV(e,t,r){let n=e.$__schema,{paths:s,singleNestedPaths:i}=n,o=e.$__.activePaths.states,u={},a={},c=new Set,l=o.require;if(l!=null){let p=null;for(let m in l){let E=Object.hasOwn(s,m),y=E?s[m]:n.path(m);if(typeof y?.originalRequiredValue==="function"){let w=e.$__.cachedRequired??(e.$__.cachedRequired={});try{w[m]=y.originalRequiredValue.call(e,e)}catch(C){e.invalidate(m,C)}}if(!e.$__isSelected(m)){if(p??=e.modifiedPaths(),!e.$isModified(m,null,p))continue}if(m.charCodeAt(m.length-1)===kU&&m.endsWith(".$*"))continue;let _=e.$__.cachedRequired;if(_!=null&&m in _&&!_[m])continue;if(!E&&y!=null&&Object.hasOwn(i,m))continue;if(c.add(m),y!=null&&y.schema!=null)a[m]=!0}}for(let p=0;p<vU.length;++p){let m=o[vU[p]];if(m==null)continue;for(let E in m){if(E.charCodeAt(E.length-1)===kU&&E.endsWith(".$*"))continue;let y=Object.hasOwn(s,E),_=y?s[E]:n.path(E);if(_!=null&&(Fge(_)||!y&&Object.hasOwn(i,E)))continue;if(_?.[JU]!=null&&E!==_.path)continue;if(c.add(E),_!=null&&_.schema!=null)a[E]=!0}}if(c.size===0&&e.$__hasOnlyPrimitiveValues())return[[],u];for(let p of c){if(!WU(n.nested,p))continue;c.delete(p);let m=e.$__getValue(p);if(m==null||Array.isArray(m))continue;for(let E of Object.keys(m)){let y=p+"."+E;if(c.add(y),Object.hasOwn(s,y)&&s[y].schema!=null)a[y]=!0}}let f=null,h=[],d=[];for(let p of Object.keys(s)){let m=s[p];if(m.$isSingleNested||m.$isMongooseDocumentArray){h.push([p,m]);continue}if(!m.$isSchemaMap||!m.$__schemaType.$isMongooseDocumentArray)continue;f??=e.modifiedPaths();let E=e.$get(p);if(E==null)continue;for(let y of E.keys()){let _=p+"."+y;if(f.includes(_))d.push([_,m.$__schemaType])}}for(let[p,m]of h.concat(d)){f??=e.modifiedPaths();let E;if(m.$isSingleNested){let _=e.$get(p);if(_==null)continue;E=[_]}else if(m.$isMongooseDocumentArray){if(E=e.$get(p),!E?.length)continue;if(f.includes(p)&&(m.validators.length>0||a[p]===!0)){if(a[p]!==!0&&!Object.hasOwn(o.modify,p))u[p]={skipSchemaValidators:!0};c.add(p),a[p]=!0}}else continue;let y=m.$isMongooseDocumentArray&&a[p]===!0;for(let _ of E){if(_==null||!_.$basePath)continue;let w=m.$isMongooseDocumentArray?p+"."+_.__index:_.$__pathRelativeToParent(),C=_.$parent();if(C==null)throw Error("Cannot validate subdocument that does not have a parent");if(y){c.delete(w);for(let A of _.modifiedPaths({includeChildren:!0}))c.delete(w+"."+A);if(p!==m.path&&Object.hasOwn(o.modify,w))u[w]={skipSchemaValidators:!1}}if(!e.$isModified(w,null,f)||Object.hasOwn(C.$__.activePaths.getStatePaths("modify"),w)||C.$isDefault(w))continue;if(!y)for(let A of _.modifiedPaths())c.delete(w+"."+A);if(!y&&a[p]!==!0)c.add(w);if(a[w]=!0,e.$__.pathsToScopes??={},e.$__.pathsToScopes[w]=_.$isDocumentArrayElement?_.__parentArray:_.$parent(),u[w]??=_.$isDocumentArrayElement?{}:{skipSchemaValidators:!0},_.$isDocumentArrayElement&&_.__index!=null)u[w].index=_.__index}}if(Array.isArray(t))c=Nge(c,t);else if(Array.isArray(r))c=Ige(c,r);Bge(e,c,u);for(let p of c){let m=n.path(p);if(!m||!m.$isSchemaMap)continue;let E=e.$__getValue(p);if(E==null)continue;for(let y of E.keys())c.add(p+"."+y)}return[Array.from(c),u]}/*!
341
+ * Optimization: skip paths that cannot produce a validation error, either a
342
+ * primitive with no validators or an array of primitives with no validators on
343
+ * the array or its elements.
344
+ */function Fge(e){if(!e.schema&&!e.embeddedSchemaType&&e.validators.length===0&&!e.$isSchemaMap&&!e.$isSchemaUnion)return!0;return!!e.$isMongooseArray&&!e.$isMongooseDocumentArray&&!e.embeddedSchemaType.$isMongooseArray&&e.validators.length===0&&e.embeddedSchemaType.validators.length===0}function Bge(e,t,r){for(let n of t){let s=e.$__schema.path(n);if(!s)continue;if(!s.$isMongooseArray||!Array.isArray(s)&&s.$isMongooseDocumentArray&&!s.embeddedSchemaType?.validators.length)continue;if(s.$isMongooseArray&&!s.$isMongooseDocumentArray&&!s.embeddedSchemaType.$isMongooseArray&&s.embeddedSchemaType.validators.length===0)continue;let i=e.$__getValue(n);if(s.$isMongooseDocumentArray){let o=i?.length??0;for(let u=0;u<o;++u){let a=n+"."+u;t.add(a),r[a]={...r[n],...r[a],skipSubdocumentValidation:!0,index:u}}continue}SA(i,t,n)}}function SA(e,t,r){if(e!=null){let n=e.length;for(let s=0;s<n;++s)if(Array.isArray(e[s]))SA(e[s],t,r+"."+s);else if(Array.isArray(t))t.push(r+"."+s);else t.add(r+"."+s)}}/*!
345
+ * ignore
346
+ */k.prototype._execDocumentPreHooks=function(t,r,n){let s=YU(r,"pre");return this.$__middleware.execPre(t,this,n||[],{filter:s})};/*!
347
+ * ignore
348
+ */k.prototype._execDocumentPostHooks=function(t,r,n){let s=YU(r,"post");return this.$__middleware.execPost(t,this,[this],{error:n,filter:s})};/*!
349
+ * ignore
350
+ */function Nge(e,t){let r=new Set(t),n=new Map([]);for(let i of t){if(i.indexOf(".")===-1)continue;let o=i.split("."),u=o[0];for(let a=1;a<o.length;++a)n.set(u,i),u=u+"."+o[a]}let s=new Set;for(let i of e){let o=!1,u=i.length;while((u=i.lastIndexOf(".",u-1))!==-1)if(r.has(i.slice(0,u))){o=!0;break}if(r.has(i)||o)s.add(i);else if(n.has(i))s.add(n.get(i))}return s}/*!
351
+ * ignore
352
+ */function Ige(e,t){t=new Set(t);for(let r of e)if(t.has(r))e.delete(r);return e}k.prototype.validateSync=function(){return V.warn("Mongoose: `Document.prototype.validateSync()` is deprecated and will be removed in Mongoose 10. Use `Document.prototype.validate()` instead."),this.$__validateSync.apply(this,arguments)};/*!
353
+ * ignore
354
+ */k.prototype.$__validateSync=function(e,t){let r=this;if(arguments.length===1&&typeof arguments[0]==="object"&&!Array.isArray(arguments[0]))t=arguments[0],e=null;let n=t&&typeof t==="object"&&"validateModifiedOnly"in t,s;if(n)s=!!t.validateModifiedOnly;else s=this.$__schema.options.validateModifiedOnly;let i=t?.pathsToSkip,o=t?.validateAllPaths;if(o){if(i)throw TypeError("Cannot set both `validateAllPaths` and `pathsToSkip`");if(e)throw TypeError("Cannot set both `validateAllPaths` and `pathsToValidate`")}if(typeof e==="string")e=e.indexOf(" ")===-1?[e]:e.split(" ");else if(typeof i==="string"&&i.indexOf(" ")!==-1)i=i.split(" ");let u,a;if(o)[u,a]=tV(this);else{let f=rV(this,e,i);u=s?f[0].filter((h)=>this.$isModified(h)):f[0],a=f[1]}let c={};for(let f=0,h=u.length;f<h;++f){let d=u[f];if(c[d])continue;c[d]=!0;let p=r.$__schema.path(d);if(!p)continue;if(!r.$isValid(d))continue;let m=r.$__getValue(d),E=a[d],y=p.doValidateSync(m,r,{...E!=null&&typeof E==="object"?E:null,skipSchemaValidators:typeof E==="object"?E.skipSchemaValidators:E,path:d,validateModifiedOnly:s,validateAllPaths:o,_nestedValidate:!0});if(y){if((p.$isSingleNested||p.$isArraySubdocument||p.$isMongooseDocumentArray)&&y instanceof gf)continue;r.invalidate(d,y,void 0,!0)}}let l=r.$__.validationError;if(r.$__.validationError=void 0,r.$emit("validate",r),r.constructor.emit("validate",r),l){for(let f in l.errors)if(l.errors[f]instanceof Sr.CastError)r.invalidate(f,l.errors[f])}return l};k.prototype.invalidate=function(e,t,r,n){if(!this.$__.validationError)this.$__.validationError=new gf(this);if(this.$__.validationError.errors[e])return;if(!t||typeof t==="string")t=new VU({path:e,message:t,type:n||"user defined",value:r});if(this.$__.validationError===t)return this.$__.validationError;if(typeof t.setModel==="function"){let s=this.ownerDocument();if(hge(s)==="model")t.setModel(s.constructor)}return this.$__.validationError.addError(e,t),this.$__.validationError};k.prototype.$markValid=function(e){if(!this.$__.validationError?.errors[e])return;if(delete this.$__.validationError.errors[e],V.hasOwnKeys(this.$__.validationError.errors)===!1)this.$__.validationError=null};/*!
355
+ * ignore
356
+ */function $ge(e,t){if(!e.$__.validationError)return;let r=Object.keys(e.$__.validationError.errors);for(let n of r)if(n.startsWith(t+"."))delete e.$__.validationError.errors[n];if(V.hasOwnKeys(e.$__.validationError.errors)===!1)e.$__.validationError=null}/*!
357
+ * ignore
358
+ */function Rge(e,t,r){let n=t.schema;if(n==null)return;for(let s of Object.keys(n.paths)){let i=n.paths[s];if(i.$immutableSetter==null)continue;let o=r==null?void 0:r.$__getValue(s);i.$immutableSetter.call(e,o)}}k.prototype.$isValid=function(e){if(this.$__.validationError==null||V.hasOwnKeys(this.$__.validationError.errors)===!1)return!0;if(e==null)return!1;if(e.indexOf(" ")!==-1)e=e.split(" ");if(Array.isArray(e))return e.some((t)=>this.$__.validationError.errors[t]==null);return this.$__.validationError.errors[e]==null};k.prototype.$__reset=function(t,r){r=r??this.$__hasOnlyPrimitiveValues();let n=!this.$isSubdocument&&!r?this.$getAllSubdocs({useCache:!0}):null;if(n?.length>0)for(let s of n)s.$__reset(t);if(!r)this.$__resetAtomics();if(!t)this.$__.backup={},this.$__.backup.activePaths={modify:this.$__.activePaths.getStatePaths("modify"),default:this.$__.activePaths.getStatePaths("default")},this.$__.backup.validationError=this.$__.validationError,this.$__.backup.errors=this.$errors;if(this.$__.activePaths.clearAllExcept("init"),this.$__.validationError)this.$__.validationError=void 0;if(this.$errors)this.$errors=void 0;for(let s of this.$__schema.requiredPaths())this.$__.activePaths.require(s);return this};/*!
359
+ * Clear atomics on all dirty (modified + default) paths. This is a lighter
360
+ * alternative to calling `$__dirty()` when we only need to clear atomics
361
+ * and don't need the full {path, value, schema} objects or parent-path
362
+ * deduplication.
363
+ */k.prototype.$__resetAtomics=function(){let t=this.$__.activePaths,r=t.getStatePaths("modify"),n=t.getStatePaths("default");qU(this,r),qU(this,n)};function qU(e,t){if(t==null)return;let r=e.$__schema.paths,n=Object.keys(t);for(let s=0;s<n.length;++s){let i=Object.hasOwn(r,n[s])?r[n[s]]:null;if(i!=null&&!i.$isMongooseArray&&!i.$isSchemaMap&&!i.$isSchemaUnion&&i.instance!=="Mixed")continue;let o=e.$__getValue(n[s]);if(o!=null){if(typeof o.clearAtomics==="function")o.clearAtomics();else if(o[ts])o[Ef]=o[ts],o[ts]={}}}}/*!
364
+ * ignore
365
+ */k.prototype.$__undoReset=function(){if(this.$__.backup?.activePaths==null)return;this.$__.activePaths.states.modify=this.$__.backup.activePaths.modify,this.$__.activePaths.states.default=this.$__.backup.activePaths.default,this.$__.validationError=this.$__.backup.validationError,this.$errors=this.$__.backup.errors;for(let t of this.$__dirty()){let r=t.value;if(r?.[ts]&&r[Ef])r[ts]=r[Ef]}if(!this.$isSubdocument)for(let t of this.$getAllSubdocs())t.$__undoReset()};k.prototype.$__dirty=function(){let e=this,t=this.$__.activePaths.map("modify",function(s){return{path:s,value:e.$__getValue(s),schema:e.$__path(s)}});t=t.concat(this.$__.activePaths.map("default",function(s){if(s==="_id"||e.$__getValue(s)==null)return;return{path:s,value:e.$__getValue(s),schema:e.$__path(s)}}));let r=new Map(t.filter((s)=>s!=null).map((s)=>[s.path,s.value])),n=[];return t.forEach(function(s){if(!s)return;let i=null,o=!1,u=wA(s.path);for(let a=0;a<u.length-1;a++)if(r.has(u[a])){i=r.get(u[a]),o=!0;break}if(!o)n.push(s);else if(i!=null&&i[ts]!=null&&i.hasAtomics())i[ts]={},i[ts].$set=i}),n};k.prototype.$__setSchema=function(e){age(e.tree,this,void 0,e.options);for(let t of Object.keys(e.virtuals))e.virtuals[t]._applyDefaultGetters();if(e.path("schema")==null)this.schema=e;this.$__schema=e,this.$__middleware=e._getDocumentMiddleware(this.$isSubdocument),this[Oge]=e};k.prototype.$__getArrayPathsToValidate=function(){return Sy||(Sy=sc()),this.$__.activePaths.map("init","modify",function(e){return this.$__getValue(e)}.bind(this)).filter(function(e){return e&&Array.isArray(e)&&V.isMongooseDocumentArray(e)&&e.length}).reduce(function(e,t){return e.concat(t)},[]).filter(function(e){return e})};k.prototype.$getAllSubdocs=function(e){if(e?.useCache&&this.$__.saveOptions?.__subdocs)return this.$__.saveOptions.__subdocs;Sy||(Sy=sc()),yf=yf||_1();let t=[];function r(n){let s=[];for(let{model:i}of n.$__schema.childSchemas){let o=n.$__getValue(i.path);if(o==null)continue;if(qn(o))s.push(o);if(Array.isArray(o)){for(let u of o)if(qn(u))s.push(u)}if(o instanceof Map){for(let u of o.values())if(qn(u))s.push(u)}}for(let i of s)r(i);t.push(...s)}if(r(this),this.$__.saveOptions)this.$__.saveOptions.__subdocs=t;return t};/*!
366
+ * Runs queued functions
367
+ */function vge(e){let t=e.$__schema&&e.$__schema.callQueue;if(!t.length)return;for(let r of t)if(r[0]!=="pre"&&r[0]!=="post"&&r[0]!=="on")e[r[0]].apply(e,r[1])}/*!
368
+ * ignore
369
+ */k.prototype.$__handleReject=function(t){if(this.$listeners("error").length)this.$emit("error",t);else if(this.constructor.listeners?.("error").length)this.constructor.emit("error",t)};k.prototype.$toObject=function(e,t){let r=this.$__schema._defaultToObjectOptions(t),n=this.$__hasOnlyPrimitiveValues();e=V.isPOJO(e)?{...e}:{},e._calledWithOptions=e._calledWithOptions||{...e};let s;if(e._calledWithOptions.minimize!=null)s=e.minimize;else if(this.$__schemaTypeOptions?.minimize!=null)s=this.$__schemaTypeOptions.minimize;else if(r?.minimize!=null)s=r.minimize;else s=this.$__schema.options.minimize;if(e.minimize=s,!n)e._seen=e._seen||new Map;if((e._calledWithOptions.depopulate??r?.depopulate??e.depopulate??!1)&&e._isNested&&this.$__.wasPopulated)return Ki(this.$__.wasPopulated.value||this._doc._id,e);if(r!=null){for(let d of Object.keys(r))if(e[d]==null)e[d]=r[d]}e._isNested=!0,e.json=t;let o=e._parentOptions;e._parentOptions=this.$isSubdocument?e:null;let u=e._calledWithOptions.schemaFieldsOnly??e.schemaFieldsOnly??r?.schemaFieldsOnly??!1,a;if(n&&!e.flattenObjectIds&&!e.flattenDecimals)a=this.$__toObjectShallow(u);else if(u){a={};for(let d of Object.keys(this.$__schema.paths)){let p=this.$__getValue(d);if(p===void 0)continue;let m=d,E=a;if(d.indexOf(".")!==-1){let y=d.split(".");m=y[y.length-1];for(let _=0;_<y.length-1;++_)E[y[_]]=E[y[_]]??{},E=E[y[_]]}if(p===null){E[m]=null;continue}E[m]=Ki(p,e)}}else a=Ki(this._doc,e)||{};let c=e._calledWithOptions.getters??e.getters??r?.getters??!1;if(c){if(kge(this,a),e.minimize)a=gge(a)||{}}let l=e._calledWithOptions.virtuals??r?.virtuals??o?.virtuals??void 0;if(l||c&&l!==!1)CA(this,a,e,e);if(e.versionKey===!1&&this.$__schema.options.versionKey)delete a[this.$__schema.options.versionKey];let f=e._calledWithOptions.transform??!0,h=void 0;if(f===!0)h=r?.transform;else if(typeof f==="function")h=f;if(f)qge(this,a);if(e.useProjection)jge(this,a);if(typeof h==="function"){let d=h(this,a,e);if(typeof d<"u")a=d}return a};/*!
370
+ * Internal shallow clone alternative to `$toObject()`: much faster, no options processing
371
+ */k.prototype.$__toObjectShallow=function(t){let r={};if(this._doc!=null){let n=t?Object.keys(this.$__schema.paths):Object.keys(this._doc);for(let s of n){let i=this._doc[s];if(i instanceof Date)r[s]=new Date(i);else if(i!==void 0)r[s]=i}}return r};k.prototype.toObject=function(e){return this.$toObject(e)};/*!
372
+ * Applies virtuals properties to `json`.
373
+ */function CA(e,t,r,n){let s=e.$__schema,i=s.virtuals,o=Object.keys(i),u=o.length,a=u,c,l,f=e._doc,h,d=typeof n?.aliases==="boolean"?n.aliases:!0;r=r||{};let p=null;if(Array.isArray(r.virtuals))p=new Set(r.virtuals);else if(r.virtuals?.pathsToSkip){p=new Set(o);for(let m=0;m<r.virtuals.pathsToSkip.length;m++)if(p.has(r.virtuals.pathsToSkip[m]))p.delete(r.virtuals.pathsToSkip[m])}if(!f)return t;for(u=0;u<a;++u){if(c=o[u],p!=null&&!p.has(c))continue;if(!d&&Object.hasOwn(s.aliases,c))continue;if(l=c,r.path!=null){if(!c.startsWith(r.path+"."))continue;l=c.substring(r.path.length+1)}if(l.indexOf(".")===-1&&l===c){if(h=i[c].applyGetters(void 0,e),h===void 0)continue;h=Ki(h,r),t[l]=h;continue}let m=l.split(".");if(h=Ki(e.get(c),r),h===void 0)continue;let E=m.length;f=t;for(let y=0;y<E-1;++y)f[m[y]]=f[m[y]]||{},f=f[m[y]];f[m[E-1]]=h}return t}function kge(e,t){let r=e.$__schema,n=Object.keys(r.paths),s=n.length,i,o=e._doc,u;if(!o)return t;while(s--){i=n[s];let a=r.paths[i];if(!a.getters?.length&&!a.embeddedSchemaType?.getters?.length)continue;if(!e.$__isSelected(i))continue;if(i.indexOf(".")===-1){if(t[i]=a.applyGetters(t[i],e),Array.isArray(t[i])&&a.embeddedSchemaType)for(let p=0;p<t[i].length;++p)t[i][p]=a.embeddedSchemaType.applyGetters(t[i][p],e);continue}let c=i.split("."),l=c.length,f=l-1,h=t,d;o=e._doc;for(let p=0;p<l;++p){if(d=c[p],u=o[d],h!=null&&typeof h!=="object")break;else if(p===f){if(h[d]=a.applyGetters(h[d],e),Array.isArray(h[d])&&a.embeddedSchemaType)for(let m=0;m<h[d].length;++m)h[d][m]=a.embeddedSchemaType.applyGetters(h[d][m],e)}else if(u==null){if(d in o)h[d]=u;break}else h=h[d]||(h[d]={});o=u}}return t}function qge(e,t){let r=e.$__schema,n=r.pathsWithTransforms();if(!e._doc||!n)return t;for(let i of n){let o=r.paths[i],u=o.options.transform??o.constructor?.defaultOptions?.transform,a=o.embeddedSchemaType?.options?.transform??o.embeddedSchemaType?.constructor?.defaultOptions?.transform;if(typeof u==="function"){let c=e.$get(i);if(c===void 0)continue;let l=u.call(e,c);jU(i,l),V.setValue(i,l,t)}else if(typeof a==="function"){let c=e.$get(i);if(c===void 0)continue;let l=[].concat(c);for(let f=0;f<l.length;++f){let h=a.call(e,l[f]);l[f]=h,jU(i,h)}t[i]=l}}return t}function jU(e,t){if(Ege(t))throw Error("`transform` function must be synchronous, but the transform on path `"+e+"` returned a promise.")}/*!
374
+ * ignore
375
+ */function jge(e,t){let r=e.$__schema,n=Object.keys(r.paths||{});if(!e._doc)return t;let i=e.$__.selected;if(i===void 0)i={},GU.applyPaths(i,r);if(i==null||V.hasOwnKeys(i)===!1)return t;for(let o of n)if(i[o]!=null&&!i[o])delete t[o];return t}k.prototype.toJSON=function(e){return this.$toObject(e,!0)};/*!
376
+ * ignore
377
+ */k.prototype.ownerDocument=function(){return this};k.prototype.parent=function(){if(this.$isSubdocument||this.$__.wasPopulated)return this.$__.parent;return this};k.prototype.$parent=k.prototype.parent;k.prototype.$__setParent=function(t){this.$__.parent=t,this.$__parent=t};k.prototype.inspect=function(e){let t=V.isPOJO(e),r;if(t)r=e,r.minimize=!1;let n=arguments.length>0?this.toObject(r):this.toObject();if(n==null)return"MongooseDocument { "+n+" }";return n};if(Oy.custom)k.prototype[Oy.custom]=k.prototype.inspect;k.prototype.toString=function(){let e=this.inspect();if(typeof e==="string")return e;return Oy(e)};k.prototype.equals=function(e){if(!e)return!1;let t=this.$__getValue("_id"),r=qn(e)?e.$__getValue("_id"):e;if(!t&&!r)return wy(this,e);return t&&t.equals?t.equals(r):t===r};k.prototype.populate=async function(){let t={},r=[...arguments];if(typeof r[r.length-1]==="function")throw new Sr("Document.prototype.populate() no longer accepts a callback");if(r.length!==0){let i=V.populate.apply(null,r);for(let o of i)t[o.path]=o}let n=V.object.vals(t),s=this.constructor;if(this.$__isNested){s=this.$__[Cge].constructor;let i=this.$__.nestedPath;n.forEach(function(o){o.path=i+"."+o.path})}if(this.$session()!=null){let i=this.$session();n.forEach((o)=>{if(o.options==null){o.options={session:i};return}if(!("session"in o.options))o.options.session=i})}return n.forEach((i)=>{i._localModel=s}),s.populate(this,n)};k.prototype.$getPopulatedDocs=function(){let t=[];if(this.$__.populated!=null)t=t.concat(Object.keys(this.$__.populated));let r=[];for(let n of t){let s=this.$get(n);if(Array.isArray(s))r=r.concat(s);else if(s instanceof k)r.push(s)}return r};k.prototype.populated=function(e,t,r){if(t==null||t===!0){if(!this.$__.populated)return;if(typeof e!=="string")return;let s=e.endsWith(".$*")?e.replace(/\.\$\*$/,""):e,i=this.$__.populated[s];if(i)return t===!0?i:i.value;return}this.$__.populated||(this.$__.populated={}),this.$__.populated[e]={value:t,options:r};let n=e.split(".");for(let s=0;s<n.length-1;++s){let i=n.slice(0,s+1).join("."),o=this.$get(i);if(qn(o)&&this.$populated(i)){let u=n.slice(s+1).join(".");o.$populated(u,t,r);break}}return t};k.prototype.$populated=k.prototype.populated;k.prototype.$assertPopulated=function(t,r){if(Array.isArray(t))return t.forEach((n)=>this.$assertPopulated(n,r)),this;if(arguments.length>1)this.$set(r);if(!this.$populated(t))throw new Sr(`Expected path "${t}" to be populated`);return this};k.prototype.depopulate=function(e){if(typeof e==="string")e=e.indexOf(" ")===-1?[e]:e.split(" ");let t,r=this.$$populatedVirtuals?Object.keys(this.$$populatedVirtuals):[],n=this.$__?.populated||{};if(arguments.length===0){for(let i of r)delete this.$$populatedVirtuals[i],delete this._doc[i],delete n[i];let s=Object.keys(n);for(let i of s){if(t=this.$populated(i),!t)continue;if(delete n[i],Array.isArray(t)){let o=V.getValue(i,this._doc);if(o.isMongooseArray){let u=o.__array;for(let a=0;a<u.length;++a){let c=u[a];if(c==null)continue;u[a]=c instanceof k?c._doc._id:c._id}}else V.setValue(i,t,this._doc)}else V.setValue(i,t,this._doc)}return this}for(let s of e)if(t=this.$populated(s),delete n[s],r.indexOf(s)!==-1)delete this.$$populatedVirtuals[s],delete this._doc[s];else if(t)if(Array.isArray(t)){let i=V.getValue(s,this._doc);if(i.isMongooseArray){let o=i.__array;for(let u=0;u<o.length;++u){let a=o[u];if(a==null)continue;o[u]=a instanceof k?a._doc._id:a._id}}else V.setValue(s,t,this._doc)}else V.setValue(s,t,this._doc);return this};k.prototype.$__fullPath=function(e){return e||""};k.prototype.$getChanges=function(){let e=this.$__delta();return e?e[1]:{}};k.prototype.getChanges=function(){return V.warn("`getChanges()` is deprecated, use `$getChanges()` instead."),this.$getChanges()};k.prototype.$__delta=function(t,r){let n=this.$__dirty(),s=n,i=null;if(t!=null){s=[],i=[];for(let h of n)if(mA(h.path,r,t))s.push(h);else i.push(h)}let o=this.$__schema.options.optimisticConcurrency;if(o)if(Array.isArray(o)){if(!this.$__schema.options._optimisticConcurrencyTrie)this.$__schema.options._optimisticConcurrencyTrie=new FU(o);let h=this.$__schema.options._optimisticConcurrencyTrie,d=this.directModifiedPaths();if(t==null?d.find((m)=>h.overlapsPath(m.indexOf(".")===-1?m:m.split("."))):d.find((m)=>h.overlapsPath(m.indexOf(".")===-1?m:m.split("."))&&mA(m,r,t)))this.$__.version=s.length?3:1}else if(Array.isArray(o?.exclude)){if(!this.$__schema.options._optimisticConcurrencyExcludeTrie)this.$__schema.options._optimisticConcurrencyExcludeTrie=new FU(o.exclude);let h=this.$__schema.options._optimisticConcurrencyExcludeTrie,d=this.directModifiedPaths();if(t==null?d.find((m)=>!h.matchesPathOrAncestor(m.indexOf(".")===-1?m:m.split("."))):d.find((m)=>!h.matchesPathOrAncestor(m.indexOf(".")===-1?m:m.split("."))&&mA(m,r,t)))this.$__.version=s.length?3:1}else this.$__.version=s.length?3:1;if(!s.length&&this.$__.version!==3)return;let u={},a={},c=s.length,l=[],f=0;if(u._id=this._doc._id,qn(u?._id))u._id=u._id.toObject({transform:!1,depopulate:!0});for(;f<c;++f){let h=s[f],d=h.value,p=Lge(this,h.path,d);if(p){l.push(p);continue}if(!this.$populated(h.path,!0)&&this.$__.selected){let E=h.path.split("."),y=E[0];if(this.$__.selected[y]&&this.$__.selected[y].$elemMatch)if(E.length>1&&E[1]==0&&typeof u[y]>"u")u[y]=this.$__.selected[y],E[1]="$",h.path=E.join(".");else{l.push(h.path);continue}}if(this.$isDefault(h.path)&&this.$__.selected){if(h.path.indexOf(".")===-1&&NU(this.$__.selected,h.path))continue;if(wA(h.path).find((y)=>NU(this.$__.isSelected,y)))continue}if(l.length)continue;if(d===void 0)eu(this,u,a,h,1,"$unset");else if(d===null)eu(this,u,a,h,null);else if(typeof d.getAtomics==="function")Uge(this,u,a,h,d);else if(d[LU.pathSymbol]&&Buffer.isBuffer(d))d=d.toObject(),eu(this,u,a,h,d);else if(this.$__.primitiveAtomics?.[h.path]!=null){let E=this.$__.primitiveAtomics[h.path],y=lge(E);eu(this,u,a,h,E[y],y)}else d=Ki(d,{depopulate:!0,transform:!1,virtuals:!1,getters:!1,omitUndefined:!0,_isNested:!0}),eu(this,u,a,h,d)}if(l.length)throw new nge(l);if(this.$__.version)this.$__version(u,a);if(V.hasOwnKeys(a)===!1)return[u,null,i];return[u,a,i]};function Lge(e,t,r){let n=e.$populated(t,!0);if(!n&&e.$__.selected){let i=t.split(".")[0];if(e.$__.selected[i]&&e.$__.selected[i].$slice!=null&&V.isMongooseArray(r)){if(r[ts].$set)return i}if(e.$__.selected[i+".$"])return i}if(!(n&&V.isMongooseArray(r)))return;if(n.options.match||n.options.options&&Object.hasOwn(n.options.options,"limit")||n.options.options?.skip||n.options.select&&(n.options.select._id===0||/\s?-_id\s?/.test(n.options.select))){let i=r[ts];if(V.hasOwnKeys(i)===!1||i.$set||i.$pop)return t}}function eu(e,t,r,n,s,i){if(i||(i="$set"),!r[i])r[i]={};if(r[i][n.path]=s,e.$__schema.options.versionKey===!1)return;if(Vge(e,n.path))return;if((3&e.$__.version)===3)return;if(e.$__schema.options.optimisticConcurrency===!0||Array.isArray(e.$__schema.options.optimisticConcurrency)||Array.isArray(e.$__schema.options.optimisticConcurrency?.exclude))return;switch(i){case"$set":case"$unset":case"$pop":case"$pull":case"$pullAll":case"$push":case"$addToSet":case"$inc":break;default:return}if(i==="$push"||i==="$addToSet"||i==="$pullAll"||i==="$pull")if(/\.\d+\.|\.\d+$/.test(n.path))e.$__.version=3;else e.$__.version|=2;else if(/^\$p/.test(i))e.$__.version=3;else if(Array.isArray(s))e.$__.version=3;else if(/\.\d+\.|\.\d+$/.test(n.path))e.$__.version|=1}function Uge(e,t,r,n,s){if(r.$set?.[n.path])return;if(typeof s.getAtomics==="function"){s.getAtomics().forEach(function(f){let h=f[0],d=f[1];eu(e,t,r,n,d,h)});return}if(typeof s.$__getAtomics==="function"){s.$__getAtomics().forEach(function(f){let h=f[0],d=f[1];eu(e,t,r,n,d,h)});return}let i=s[ts],o=Object.keys(i),u=o.length,a,c;if(u===0){if(V.isMongooseObject(s))s=s.toObject({depopulate:1,_isNested:!0});else if(s.valueOf)s=s.valueOf();return eu(e,t,r,n,s)}function l(f){return V.isMongooseObject(f)?f.toObject({depopulate:1,_isNested:!0}):f}while(u--){if(c=o[u],a=i[c],V.isMongooseObject(a))a=a.toObject({depopulate:!0,transform:!1,_isNested:!0});else if(Array.isArray(a))a=a.map(l);else if(a.valueOf)a=a.valueOf();if(c==="$addToSet")a={$each:a};eu(e,t,r,n,a,c)}}function Vge(e,t){let r=e.$__schema.options.skipVersioning;if(!r)return!1;return t=t.replace(/\.\d+\./,"."),r[t]}k.prototype.$clone=function(){let t=new this.constructor;if(t.$isNew=this.$isNew,this._doc)t._doc=Ki(this._doc,{retainDocuments:!0,parentDoc:t});if(this.$__){let n=new this.$__.constructor;for(let s of Object.getOwnPropertyNames(this.$__)){if(s==="activePaths")continue;n[s]=Ki(this.$__[s])}Object.assign(n.activePaths,Ki({...this.$__.activePaths})),t.$__=n}return t};k.prototype.$createModifiedPathsSnapshot=function(){let t=new WeakMap;if(!this.$isSubdocument){let r=this.$getAllSubdocs();for(let n of r)t.set(n,n.$__.activePaths.clone())}return new ige(t,this.$__.activePaths.clone(),this.$__.version)};k.prototype.$restoreModifiedPathsSnapshot=function(t){if(this.$__.activePaths=t.activePaths.clone(),this.$__.version=t.version,!this.$isSubdocument){let r=this.$getAllSubdocs();for(let n of r)if(t.subdocSnapshot.has(n))n.$__.activePaths=t.subdocSnapshot.get(n)}return this};k.prototype.$clearModifiedPaths=function(){if(this.$__.activePaths.clear("modify"),this.$__.activePaths.clear("init"),this.$__.version=0,!this.$isSubdocument){let t=this.$getAllSubdocs();for(let r of t)r.$clearModifiedPaths()}return this};/*!
378
+ * Check if the given document only has primitive values
379
+ */k.prototype.$__hasOnlyPrimitiveValues=function(){if(this.$__.populated)return!1;let t=this._doc;for(let r in t){let n=t[r];if(n==null||typeof n!=="object")continue;if(Array.isArray(n))return!1;if(n instanceof Date||n instanceof Boolean||n instanceof Number||n instanceof String)continue;let s=n._bsontype;if(s==="ObjectId"||s==="Decimal128")continue;return!1}return!0};/*!
380
+ * Increment this document's version if necessary.
381
+ */k.prototype._applyVersionIncrement=function(){if(!this.$__.version)return;let t=(2&this.$__.version)===2;if(this.$__.version=void 0,t){let r=this.$__schema.options.versionKey,n=this.$__getValue(r)||0;this.$__setValue(r,n+1)}};/*!
382
+ * Module exports.
383
+ */k.VERSION_WHERE=1;k.VERSION_INC=2;k.VERSION_ALL=3;k.ValidationError=gf;sV.exports=nV=k});var we=g(function(Cr){/*!
384
+ * Module dependencies.
385
+ */var zge=Se().UUID,Wge=qj(),Ty=ks(),Kge=pa(),lV=Q0(),DA=Zt(),Hge=Du(),Gge=Qa(),My=V0(),xy=Jj(),by=gn(),Aa=vn(),Yge=Co(),Qge=i6(),_f=cf(),Jge=J0(),tu=ma(),{trustedSymbol:O1}=c1(),bA;Cr.specialProperties=tu;Cr.isMongooseArray=My.isMongooseArray;Cr.isMongooseDocumentArray=xy.isMongooseDocumentArray;Cr.registerMongooseArray=My.registerMongooseArray;Cr.registerMongooseDocumentArray=xy.registerMongooseDocumentArray;var TA=/\s/,MA=/\s+/;Cr.toCollectionName=function(e,t){if(e==="system.profile")return e;if(e==="system.indexes")return e;if(typeof t==="function"){if(typeof e!=="string")throw TypeError("Collection name must be a string");if(e.length===0)throw TypeError("Collection name cannot be empty");return t(e)}return e};Cr.deepEqual=function e(t,r){if(t===r)return!0;if(typeof t!=="object"||typeof r!=="object")return t===r;if(t instanceof Date&&r instanceof Date)return t.getTime()===r.getTime();if(Aa(t,"ObjectId")&&Aa(r,"ObjectId")||Aa(t,"Decimal128")&&Aa(r,"Decimal128"))return t.toString()===r.toString();if(t instanceof RegExp&&r instanceof RegExp)return t.source===r.source&&t.ignoreCase===r.ignoreCase&&t.multiline===r.multiline&&t.global===r.global&&t.dotAll===r.dotAll&&t.unicode===r.unicode&&t.sticky===r.sticky&&t.hasIndices===r.hasIndices;if(t==null||r==null)return!1;if(t.prototype!==r.prototype)return!1;if(t instanceof Map||r instanceof Map){if(!(t instanceof Map)||!(r instanceof Map))return!1;return e(Array.from(t.keys()),Array.from(r.keys()))&&e(Array.from(t.values()),Array.from(r.values()))}if(t instanceof Set||r instanceof Set){if(!(t instanceof Set)||!(r instanceof Set))return!1;if(t.size!==r.size)return!1;return e(Array.from(t.values()),Array.from(r.values()))}if(t instanceof Number&&r instanceof Number)return t.valueOf()===r.valueOf();if(Buffer.isBuffer(t))return Cr.buffer.areEqual(t,r);if(Array.isArray(t)||Array.isArray(r)){if(!Array.isArray(t)||!Array.isArray(r))return!1;let o=t.length;if(o!==r.length)return!1;for(let u=0;u<o;++u)if(!e(t[u],r[u]))return!1;return!0}if(by(t))t=t._doc;else if(_f(t))t=t.toObject();if(by(r))r=r._doc;else if(_f(r))r=r.toObject();let n=Object.keys(t),s=Object.keys(r),i=n.length;if(i!==s.length)return!1;for(let o=i-1;o>=0;o--)if(n[o]!==s[o])return!1;for(let o of n)if(!e(t[o],r[o]))return!1;return!0};Cr.last=function(e){if(e==null)return;if(e.length>0)return e[e.length-1];return};/*!
386
+ * ignore
387
+ */Cr.cloneArrays=function(t){if(!Array.isArray(t))return t;return t.map((r)=>Cr.cloneArrays(r))};/*!
388
+ * ignore
389
+ */Cr.omit=function(t,r){if(r==null)return Object.assign({},t);if(!Array.isArray(r))r=[r];let n=Object.assign({},t);for(let s of r)delete n[s];return n};Cr.clonePOJOsAndArrays=function(t){if(t==null)return t;if(by(t))return t;if(Yge(t)){t={...t};for(let r of Object.keys(t))t[r]=Cr.clonePOJOsAndArrays(t[r]);return t}if(Array.isArray(t)){t=[...t];for(let r=0;r<t.length;++r)t[r]=Cr.clonePOJOsAndArrays(t[r]);return t}return t};Cr.merge=function e(t,r,n,s){if(n=n||{},r==null)return t;let i=Object.keys(r),o=0,u=i.length,a;if(r[O1])t[O1]=r[O1];s=s||"";let c=n.omitNested||{};while(o<u){if(a=i[o++],n.omit&&n.omit[a])continue;if(c[s])continue;if(tu.has(a))continue;if(t[a]==null)t[a]=Cr.clonePOJOsAndArrays(r[a]);else if(Cr.isObject(r[a])){if(!Cr.isObject(t[a]))t[a]={};if(r[a]!=null){if(n.isDiscriminatorSchemaMerge&&(r[a].$isSingleNested&&t[a].$isMongooseDocumentArray||r[a].$isMongooseDocumentArray&&t[a].$isSingleNested))continue;else if(r[a].instanceOfSchema){if(t[a].instanceOfSchema)Jge(t[a],r[a].clone(),n.isDiscriminatorSchemaMerge);else t[a]=r[a].clone();continue}else if(Aa(r[a],"ObjectId")){t[a]=new Kge(r[a]);continue}}e(t[a],r[a],n,s?s+"."+a:a)}else if(n.overwrite)t[a]=r[a]}return t};Cr.toObject=function e(t){bA||(bA=bo());let r;if(t==null)return t;if(t instanceof bA)return t.toObject();if(Array.isArray(t)){r=[];for(let n of t)r.push(e(n));return r}if(Cr.isPOJO(t)){if(r={},t[O1])r[O1]=t[O1];for(let n of Object.keys(t)){if(tu.has(n))continue;r[n]=e(t[n])}return r}return t};Cr.isObject=Gge;Cr.isPOJO=Co();Cr.isNonBuiltinObject=function(t){return typeof t==="object"&&!Array.isArray(t)&&!(t instanceof Date)&&!(t instanceof Boolean)&&!(t instanceof Number)&&!(t instanceof String)&&!Cr.isMongooseType(t)&&!(t instanceof zge)&&t!=null};Cr.isEmptyObject=function(t){if(t==null||typeof t!=="object")return!1;return Cr.hasOwnKeys(t)===!1};Cr.hasOwnKeys=function(t){for(let r in t)if(Object.prototype.hasOwnProperty.call(t,r))return!0;return!1};Cr.hasKey=function(t,r){let n=Object.keys(t);for(let s of n){if(s===r)return!0;if(Cr.isPOJO(t[s])&&Cr.hasKey(t[s],r))return!0}return!1};Cr.tick=function(t){if(typeof t!=="function")return;return function(){try{t.apply(this,arguments)}catch(r){Hge(function(){throw r})}}};Cr.isMongooseType=function(e){return Aa(e,"ObjectId")||Aa(e,"Decimal128")||e instanceof Buffer};Cr.isMongooseObject=_f;Cr.expires=function(t){if(!(t&&t.constructor.name==="Object"))return;if(!("expires"in t))return;t.expireAfterSeconds=typeof t.expires!=="string"?t.expires:Math.round(Wge(t.expires)/1000),delete t.expires};Cr.populate=function(t,r,n,s,i,o,u,a){let c=null;if(arguments.length===1){if(t instanceof lV)return t._docs={},t._childDocs=[],[t];if(Array.isArray(t))return l(t).map((h)=>Cr.populate(h)[0]);if(Cr.isObject(t))c=Object.assign({},t);else c={path:t}}else if(typeof n==="object")c={path:t,select:r,match:n,options:s};else c={path:t,select:r,model:n,match:s,options:i,populate:o,justOne:u,count:a};if(typeof c.path!=="string"&&!(Array.isArray(c.path)&&c.path.every((f)=>typeof f==="string")))throw TypeError("utils.populate: invalid path. Expected string or array of strings. Got typeof `"+typeof t+"`");return Xge(c);function l(f){let h=[];return f.forEach(function(d){if(TA.test(d.path))d.path.split(MA).forEach(function(m){let E=Object.assign({},d);E.path=m,h.push(E)});else h.push(d)}),h}};function Xge(e){if(Array.isArray(e.populate)){let n=[];e.populate.forEach(function(s){if(TA.test(s.path)){let i=Object.assign({},s);i.path.split(MA).forEach(function(u){i.path=u,n.push(Cr.populate(i)[0])})}else n.push(Cr.populate(s)[0])}),e.populate=Cr.populate(n)}else if(e.populate!=null&&typeof e.populate==="object")e.populate=Cr.populate(e.populate);let t=[],r=TA.test(e.path)?e.path.split(MA):Array.isArray(e.path)?e.path:[e.path];if(e.options!=null)e.options=DA(e.options);for(let n of r)t.push(new lV(Object.assign({},e,{path:n})));return t}Cr.getValue=function(e,t,r){return Ty.get(e,t,eEe,r)};/*!
390
+ * ignore
391
+ */var Zge=Object.freeze({getters:!1});function eEe(e,t){if(t==="$*"&&e instanceof Map)return e;let r=e?._doc||e;if(r?.isMongooseArrayProxy)r=r.__array;return r instanceof Map?r.get(t,Zge):r[t]}Cr.setValue=function(e,t,r,n,s){Ty.set(e,t,r,"_doc",n,s)};Cr.object={};Cr.object.vals=function(t){if(t==null)return[];let r=Object.keys(t),n=r.length,s=[];while(n--)s.push(t[r[n]]);return s};Cr.isNullOrUndefined=function(e){return e==null};/*!
392
+ * ignore
393
+ */Cr.array={};Cr.array.flatten=function e(t,r,n){return n||(n=[]),t.forEach(function(s){if(Array.isArray(s))e(s,r,n);else if(!r||r(s))n.push(s)}),n};/*!
394
+ * ignore
395
+ */Cr.hasUserDefinedProperty=function(e,t){if(e==null)return!1;if(Array.isArray(t)){for(let r of t)if(Cr.hasUserDefinedProperty(e,r))return!0;return!1}if(Object.hasOwn(e,t))return!0;if(typeof e==="object"&&t in e){let r=e[t];return r!==Object.prototype[t]&&r!==Array.prototype[t]}return!1};/*!
396
+ * ignore
397
+ */var iV=Math.pow(2,32)-1;Cr.isArrayIndex=function(e){if(typeof e==="number")return e>=0&&e<=iV;if(typeof e==="string"){if(!/^\d+$/.test(e))return!1;return e=+e,e>=0&&e<=iV}return!1};Cr.array.unique=function(e){let t=new Set,r=new Set,n=[];for(let s of e)if(typeof s==="number"||typeof s==="string"||s==null){if(t.has(s))continue;n.push(s),t.add(s)}else if(Aa(s,"ObjectId")){let i=s.toString();if(r.has(i))continue;n.push(s),r.add(i)}else n.push(s);return n};Cr.buffer={};Cr.buffer.areEqual=function(e,t){if(!Buffer.isBuffer(e))return!1;if(!Buffer.isBuffer(t))return!1;return e.equals(t)};Cr.getFunctionName=Qge;Cr.decorate=function(e,t){for(let r in t){if(tu.has(r))continue;e[r]=t[r]}};Cr.mergeClone=function(e,t){if(_f(t))t=t.toObject({transform:!1,virtuals:!1,depopulate:!0,getters:!1,flattenDecimals:!1});let r=Object.keys(t),n=r.length,s=0,i;while(s<n){if(i=r[s++],tu.has(i))continue;if(!Object.hasOwn(by(e)?e._doc:e,i)&&i in e)continue;if(typeof e[i]>"u")e[i]=DA(t[i],{transform:!1,virtuals:!1,depopulate:!0,getters:!1,flattenDecimals:!1});else{let o=t[i];if(o?.valueOf&&!(o instanceof Date))o=o.valueOf();if(Cr.isObject(o)){let u=o,a=Buffer.isBuffer(o)&&o.isMongooseBuffer;if(_f(o)&&!a)u=u.toObject({transform:!1,virtuals:!1,depopulate:!0,getters:!1,flattenDecimals:!1});if(a)u=Buffer.from(u);Cr.mergeClone(e[i],u)}else e[i]=DA(o,{flattenDecimals:!1})}}};Cr.each=function(e,t){for(let r of e)t(r)};Cr.renameObjKey=function(e,t,r){return Object.keys(e).reduce((s,i)=>{if(i===t)s[r]=e[t];else s[i]=e[i];return s},{})};/*!
398
+ * ignore
399
+ */Cr.getOption=function(e){let t=Array.prototype.slice.call(arguments,1);for(let r of t){if(r==null)continue;if(r[e]!=null)return r[e]}return null};/*!
400
+ * ignore
401
+ */Cr.noop=function(){};Cr.errorToPOJO=function(t){if(!(t instanceof Error))throw Error("`error` must be `instanceof Error`.");let n={};for(let s of Object.getOwnPropertyNames(t))n[s]=t[s];return n};/*!
402
+ * ignore
403
+ */Cr.warn=function(t){return process.emitWarning(t,{code:"MONGOOSE"})};Cr.injectTimestampsOption=function(t,r){if(r==null)return;t.timestamps=r}});var _r=g(function(Fy,_V){/*!
404
+ * Module dependencies.
405
+ */var Er=Rs(),EV=As(),BEe=G0(),NEe=L6(),Py=Zt(),IEe=yi(),PA=Nj(),$Ee=$j(),REe=gn(),FA=vj(),vEe=le().schemaTypeSymbol,jn=we(),Af=le().validatorErrorSymbol,kEe=le().documentIsModified,pV=le().populateModelSymbol,BA=Er.CastError,S1=Er.ValidatorError,qEe={_skipMarkModified:!0};function Ie(e,t,r,n){this[vEe]=!0,this.path=e,this.instance=r,this.schemaName=this.constructor.schemaName,this.validators=[],this.getters=Object.hasOwn(this.constructor,"getters")?this.constructor.getters.slice():[],this.setters=Object.hasOwn(this.constructor,"setters")?this.constructor.setters.slice():[],this.splitPath(),t=t||{};let s=this.constructor.defaultOptions||{},i=Object.keys(s);for(let a of i)if(a==="validate")this.validate(s.validate);else if(Object.hasOwn(s,a)&&!Object.hasOwn(t,a))t[a]=s[a];if(t.select==null)delete t.select;let o=this.OptionsConstructor||EV;if(this.options=new o(t),this.parentSchema=n,this._index=null,jn.hasUserDefinedProperty(this.options,"immutable"))this.$immutable=this.options.immutable,PA(this);let u=Object.keys(this.options);for(let a of u){if(a==="cast"){if(Array.isArray(this.options[a]))this.castFunction.apply(this,this.options[a]);else this.castFunction(this.options[a]);continue}if(jn.hasUserDefinedProperty(this.options,a)&&typeof this[a]==="function"){if(a==="index"&&this._index){if(t.index===!1){let f=this._index;if(typeof f==="object"&&f!=null){if(f.unique)throw new Er('Path "'+this.path+'" may not have `index` set to false and `unique` set to true');if(f.sparse)throw new Er('Path "'+this.path+'" may not have `index` set to false and `sparse` set to true')}this._index=!1}continue}let c=t[a];if(a==="default"){this.default(c);continue}let l=Array.isArray(c)?c:[c];this[a].apply(this,l)}}Object.defineProperty(this,"$$context",{enumerable:!1,configurable:!1,writable:!0,value:null})}Ie.prototype.OptionsConstructor=EV;Ie.prototype.path;Ie.prototype.toJSON=function(){let{parentSchema:t,...r}=this;return r};Ie.prototype._createJSONSchemaTypeDefinition=function(t,r,n){let s=n?.useBsonType,i=n?._overrideRequired??(this.options.required==null?n?._defaultRequired===!0||this.path==="_id":this.options.required&&typeof this.options.required!=="function"),o=this.options.allowNull!==!1;if(s){if(i||!o)return{bsonType:r};return{bsonType:[r,"null"]}}if(i||!o)return{type:t};return{type:[t,"null"]}};Ie.prototype._addJSONSchemaEnum=function(t){if(!Array.isArray(this.enumValues)||this.enumValues.length===0)return t;let r=Array.isArray(t.type??t.bsonType);return t.enum=r&&!this.enumValues.includes(null)?[...this.enumValues,null]:[...this.enumValues],t};Ie.prototype.validators;Ie.prototype.isRequired;Ie.prototype.splitPath=function(){if(this._presplitPath!=null)return this._presplitPath;if(this.path==null)return;return this._presplitPath=this.path.indexOf(".")===-1?[this.path]:this.path.split("."),this._presplitPath};Ie.cast=function(t){if(arguments.length===0)return this._cast;if(t===!1)t=(r)=>r;return this._cast=t,this._cast};Ie.prototype.castFunction=function(t,r){if(arguments.length===0)return this._castFunction;if(t===!1)t=this.constructor._defaultCaster||((n)=>n);if(typeof t==="string")return this._castErrorMessage=t,this._castFunction;if(t!=null)this._castFunction=t;if(r!=null)this._castErrorMessage=r;return this._castFunction};Ie.prototype.cast=function(){throw new Er("Base SchemaType class does not implement a `cast()` function")};Ie.set=function(t,r){if(!Object.hasOwn(this,"defaultOptions"))this.defaultOptions=Object.assign({},this.defaultOptions);this.defaultOptions[t]=r};Ie.get=function(e){this.getters=Object.hasOwn(this,"getters")?this.getters:[],this.getters.push(e)};Ie.prototype.default=function(e){if(arguments.length===1){if(e===void 0){this.defaultValue=void 0;return}if(e?.instanceOfSchema)throw new Er("Cannot set default value of path `"+this.path+"` to a mongoose Schema instance.");return this.defaultValue=e,this.defaultValue}else if(arguments.length>1)this.defaultValue=[...arguments];return this.defaultValue};Ie.prototype.index=function(e){return this._index=e,jn.expires(this._index),this};Ie.prototype.unique=function(t,r){if(this._index===!1){if(!t)return;throw new Er('Path "'+this.path+'" may not have `index` set to false and `unique` set to true')}if(!Object.hasOwn(this.options,"index")&&t===!1)return this;if(this._index==null||this._index===!0)this._index={};else if(typeof this._index==="string")this._index={type:this._index};if(this._index.unique=!!t,typeof r==="string")this._duplicateKeyErrorMessage=r;return this};Ie.prototype.text=function(e){if(this._index===!1){if(!e)return this;throw new Er('Path "'+this.path+'" may not have `index` set to false and `text` set to true')}if(!Object.hasOwn(this.options,"index")&&e===!1)return this;if(this._index===null||this._index===void 0||typeof this._index==="boolean")this._index={};else if(typeof this._index==="string")this._index={type:this._index};return this._index.text=e,this};Ie.prototype.sparse=function(e){if(this._index===!1){if(!e)return this;throw new Er('Path "'+this.path+'" may not have `index` set to false and `sparse` set to true')}if(!Object.hasOwn(this.options,"index")&&e===!1)return this;if(this._index==null||typeof this._index==="boolean")this._index={};else if(typeof this._index==="string")this._index={type:this._index};return this._index.sparse=e,this};Ie.prototype.immutable=function(e){return this.$immutable=e,PA(this),this};Ie.prototype.transform=function(e){return this.options.transform=e,this};Ie.prototype.set=function(e){if(typeof e!=="function")throw TypeError("A setter must be a function.");return this.setters.push(e),this};Ie.prototype.get=function(e){if(typeof e!=="function")throw TypeError("A getter must be a function.");return this.getters.push(e),this};Ie.prototype.validateAll=function(e){for(let t=0;t<e.length;t++)this.validate(e[t]);return this};Ie.prototype.validate=function(e,t,r){if(typeof e==="function"||e&&jn.getFunctionName(e.constructor)==="RegExp"){let o;if(typeof t==="function")o={validator:e,message:t},o.type=r||"user defined";else if(t instanceof Object&&!r){if(o=FA(t)?Object.assign({},t):Py(t),!o.message)o.message=o.msg;o.validator=e,o.type=o.type||"user defined"}else{if(t==null)t=Er.messages.general.default;if(!r)r="user defined";o={message:t,type:r,validator:e}}return this.validators.push(o),this}let n,s,i;for(n=0,s=arguments.length;n<s;n++){if(i=arguments[n],!jn.isPOJO(i)){let o="Invalid validator. Received ("+typeof i+") "+i+". See https://mongoosejs.com/docs/api/schematype.html#SchemaType.prototype.validate()";throw new Er(o)}this.validate(i.validator,i)}return this};Ie.prototype.required=function(e,t){let r={};if(arguments.length>0&&e==null)return this.validators=this.validators.filter(function(i){return i.validator!==this.requiredValidator},this),this.isRequired=!1,delete this.originalRequiredValue,this;if(typeof e==="object")r=e,t=r.message||t,e=e.isRequired;if(e===!1)return this.validators=this.validators.filter(function(i){return i.validator!==this.requiredValidator},this),this.isRequired=!1,delete this.originalRequiredValue,this;let n=this;if(this.isRequired=!0,this.originalRequiredValue=e,typeof this.originalRequiredValue!=="function"&&(jn.hasUserDefinedProperty(this.options,"allowNull")||this.allowNullValidator!=null))throw new Er('Path "'+this.path+'" may not have `allowNull` specified when `required` is true');if(this.requiredValidator=function(i){let o=this?.$__?.cachedRequired;if(o!=null&&!this.$__isSelected(n.path)&&!this[kEe](n.path))return!0;if(o!=null&&n.path in o){let u=o[n.path]?n.checkRequired(i,this):!0;return delete o[n.path],u}else if(typeof e==="function")return e.apply(this)?n.checkRequired(i,this):!0;return n.checkRequired(i,this)},typeof e==="string")t=e,e=void 0;let s=t||Er.messages.general.required;return this.validators.unshift(Object.assign({},r,{validator:this.requiredValidator,message:s,type:"required"})),this};Ie.prototype.allowNull=function(e){if(arguments.length>0&&this.isRequired&&typeof this.originalRequiredValue!=="function")throw new Er('Path "'+this.path+'" may not have `allowNull` specified when `required` is true');if(this.validators=this.validators.filter(function(t){return t.validator!==this.allowNullValidator},this),e!==!1)return delete this.options.allowNull,delete this.allowNullValidator,this;return this.options.allowNull=!1,this.allowNullValidator=function(t){return t!==null},this.validators.push({validator:this.allowNullValidator,message:Er.messages.general.allowNull,type:"allowNull"}),this};Ie.prototype.ref=function(e){return this.options.ref=e,this};Ie.prototype.getDefault=function(t,r,n,s){let i;if(this.defaultValue==null)return this.defaultValue;if(typeof this.defaultValue==="function"){let o=n?.context??t;if(this.defaultValue===Date.now||this.defaultValue===Array||this.defaultValue.name==="ObjectId"||this.defaultValue.name==="ObjectID")i=this.defaultValue.call(o);else i=this.defaultValue.call(o,o)}else i=this.defaultValue;if(i!=null){if(typeof i==="object"&&i!=null&&i._bsontype!=="ObjectId"&&!this.options?.shared)i=Py(i);if(n?.skipCast)return this._applySetters(i,t);let o=this.applySetters(i,t,r,void 0,s??qEe);if(o&&!Array.isArray(o)&&o.$isSingleNested)o.$__parent=t;return o}return i};Ie.prototype._applySetters=function(e,t,r,n,s){let i=e;if(r)return i;let o=this.setters;for(let u=o.length-1;u>=0;u--)i=o[u].call(t,i,n,this,s);return i};/*!
406
+ * ignore
407
+ */Ie.prototype._castNullish=function(t){return t};Ie.prototype.applySetters=function(e,t,r,n,s){let i=this._applySetters(e,t,r,n,s);if(i==null)return this._castNullish(i);return i=this.cast(i,t,r,n,s),i};Ie.prototype.applyGetters=function(e,t){let r=e,n=this.getters,s=n.length;if(s===0)return r;for(let i=0;i<s;++i)r=n[i].call(t,r,this);return r};Ie.prototype.select=function(t){return this.selected=!!t,this};Ie.prototype.doValidate=async function(t,r,n){let s=!1,i=this.path,o=this.validators.filter((a)=>typeof a==="object"&&a!==null);if(!o.length)return;let u=[];for(let a=0,c=o.length;a<c;++a){let l=o[a],f=l.validator,h,d=FA(l)?Object.assign({},l):Py(l);if(d.path=n?.path||i,d.fullPath=this.$fullPath,d.value=t,typeof t==="string")d.length=t.length;if(t===void 0&&f!==this.requiredValidator)continue;if(f instanceof RegExp){if(h=f.test(t),h===!1)throw s=new(d.ErrorConstructor||S1)(d,r),s[Af]=!0,s;continue}else if(typeof f!=="function")continue;try{if(d.propsParameter)h=f.call(r,t,d);else h=f.call(r,t)}catch(p){if(h=!1,d.reason=p,p.message)d.message=p.message}if(typeof h?.then==="function")u.push(h.then(function(p){if(p===!1)throw s=new(d.ErrorConstructor||S1)(d,r),s[Af]=!0,s},function(p){throw d.reason=p,d.message=p.message,h=!1,s=new(d.ErrorConstructor||S1)(d,r),s[Af]=!0,s}));else if(h!==void 0&&!h)throw s=new(d.ErrorConstructor||S1)(d,r),s[Af]=!0,s}await Promise.all(u)};function mV(e,t){if(e!==void 0&&!e){let n=new(t.ErrorConstructor||S1)(t);return n[Af]=!0,n}}Ie.prototype.doValidateSync=function(e,t,r){let n=this.path;if(!this.validators.length)return null;let i=this.validators;if(e===void 0)if(this.validators.length!==0&&this.validators[0].type==="required")i=[this.validators[0]];else return null;let o=null,u=0,a=i.length;for(u=0;u<a;++u){let c=i[u];if(c===null||typeof c!=="object")continue;let l=c.validator,f=FA(c)?Object.assign({},c):Py(c);if(f.path=r?.path||n,f.fullPath=this.$fullPath,f.value=e,typeof e==="string")f.length=e.length;let h=!1;if($Ee(l))continue;if(l instanceof RegExp){o=mV(l.test(e),f);continue}if(typeof l!=="function")continue;try{if(f.propsParameter)h=l.call(t,e,f);else h=l.call(t,e)}catch(d){h=!1,f.reason=d}if(typeof h?.then==="function")continue;if(o=mV(h,f),o)break}return o};Ie._isRef=function(e,t,r,n){let s=n&&(e.options?.ref||e.options?.refPath);if(!s&&r?.$__!=null){let i=r.$__fullPath(e.path,!0),o=r.ownerDocument();s=i!=null&&o.$populated(i)||r.$populated(e.path)}if(s){if(t==null)return!0;if(!Buffer.isBuffer(t)&&t._bsontype!=="Binary"&&jn.isObject(t))return!0;return n}return!1};/*!
408
+ * ignore
409
+ */Ie.prototype._castRef=function(t,r,n,s){if(t==null)return t;if(REe(t))return t.$__.wasPopulated=t.$__.wasPopulated||{value:t._doc._id},t;if(Buffer.isBuffer(t)||!jn.isObject(t)){if(n)return t;throw new BA(this.instance,t,this.path,null,this)}let i=r.$__fullPath(this.path,!0),o=r.ownerDocument(),u=o.$populated(i,!0),a=t;if(!r.$__.populated||!r.$__.populated[i]||!r.$__.populated[i].options||!r.$__.populated[i].options.options||!r.$__.populated[i].options.options.lean){let c=u?u.options[pV]:o.constructor.db.model(this.options.ref);a=c.hydrate(t,null,s),a.$__.wasPopulated={value:a._doc._id,options:{[pV]:c}}}return a};/*!
410
+ * ignore
411
+ */function yV(e,t){return this.castForQuery(null,e,t)}/*!
412
+ * ignore
413
+ */function jEe(e,t){let r=this;if(!Array.isArray(e))return[this.castForQuery(null,e,t)];return e.map(function(n){return r.castForQuery(null,n,t)})}function gV(e,t){let r=this;if(!Array.isArray(e))return[this.castForQuery(null,e,t)];return e.map(function(n){if(Array.isArray(n)&&n.length===0)return n;return r.castForQuery(null,n,t)})}Ie.prototype.$conditionalHandlers={$all:jEe,$eq:yV,$in:gV,$ne:yV,$nin:gV,$exists:BEe,$type:NEe};Ie.prototype.castForQuery=function(e,t,r){let n;if(e!=null){if(n=IEe(this.$conditionalHandlers,e),!n)throw new Er("Can't use "+e);return n.call(this,t,r)}try{return this.applySetters(t,r)}catch(s){if(s instanceof BA&&s.path===this.path&&this.$fullPath!=null)s.path=this.$fullPath;throw s}};Ie.checkRequired=function(e){if(arguments.length!==0)this._checkRequired=e;return this._checkRequired};Ie.prototype.checkRequired=function(e){return e!=null};Ie.prototype.clone=function(){let e=Object.assign({},this.options),t=new this.constructor(this.path,e,this.instance,this.parentSchema);if(t.validators=this.validators.slice(),this.requiredValidator!==void 0)t.requiredValidator=this.requiredValidator;if(this.allowNullValidator!==void 0)t.allowNullValidator=this.allowNullValidator;if(this.enumValidator!==void 0)t.enumValidator=this.enumValidator;if(this.minValidator!==void 0)t.minValidator=this.minValidator;if(this.maxValidator!==void 0)t.maxValidator=this.maxValidator;if(this.minlengthValidator!==void 0)t.minlengthValidator=this.minlengthValidator;if(this.maxlengthValidator!==void 0)t.maxlengthValidator=this.maxlengthValidator;if(this.defaultValue!==void 0)t.defaultValue=this.defaultValue;if(this.$immutable!==void 0&&this.options.immutable===void 0)t.$immutable=this.$immutable,PA(t);if(this._index!==void 0)t._index=this._index;if(this.selected!==void 0)t.selected=this.selected;if(this.isRequired!==void 0)t.isRequired=this.isRequired;if(this.originalRequiredValue!==void 0)t.originalRequiredValue=this.originalRequiredValue;return t.getters=this.getters.slice(),t.setters=this.setters.slice(),t};Ie.prototype.getEmbeddedSchemaType=function(){return this.embeddedSchemaType};/*!
414
+ * If _duplicateKeyErrorMessage is a string, replace unique index errors "E11000 duplicate key error" with this string.
415
+ *
416
+ * @api private
417
+ */Ie.prototype._duplicateKeyErrorMessage=null;Ie.prototype.toJSONSchema=function(t){throw new Er(`Converting unsupported SchemaType to JSON Schema: ${this.instance} at path "${this.path}"`)};Ie.prototype.autoEncryptionType=function(){return null};/*!
418
+ * Module exports.
419
+ */_V.exports=Fy=Ie;Fy.CastError=BA;Fy.ValidatorError=S1});var NA=g(function(Yxe,AV){var Hi=vs();class js{constructor(e){if(Object.assign(this,e),e?.options!=null)this.options=Object.assign({},e.options)}}Object.defineProperty(js.prototype,"ref",Hi);Object.defineProperty(js.prototype,"refPath",Hi);Object.defineProperty(js.prototype,"localField",Hi);Object.defineProperty(js.prototype,"foreignField",Hi);Object.defineProperty(js.prototype,"justOne",Hi);Object.defineProperty(js.prototype,"count",Hi);Object.defineProperty(js.prototype,"match",Hi);Object.defineProperty(js.prototype,"options",Hi);Object.defineProperty(js.prototype,"skip",Hi);Object.defineProperty(js.prototype,"limit",Hi);Object.defineProperty(js.prototype,"perDocumentLimit",Hi);AV.exports=js});var By=g(function(Qxe,wV){wV.exports=function(t,r,n){if(t==null)return t;if(t._doc!=null)t=t._doc;if(arguments.length>=3){if(typeof t!=="object")return;if(n===void 0)return;if(t instanceof Map)t.set(r,n);else t[r]=n;return n}if(r==="$*")return t instanceof Map?Array.from(t.values()):Object.keys(t).map((s)=>t[s]);if(t instanceof Map)return t.get(r);return t[r]}});var IA=g(function(Jxe,DV){var OV=Le(),LEe=J6(),SV=By(),Ny=ks(),Iy=L("util"),bV=we(),CV=/(\.\d+$|\.\d+\.)/g;DV.exports=function(t,r,n,s,i){if(t==null)return[];if(typeof t!=="string")throw new OV("`refPath` must be a string or a function that returns a string, got "+Iy.inspect(t));if(i!=null&&LEe(i,t))throw new OV("refPath `"+t+"` must not be excluded in projection, got "+Iy.inspect(i));if(CV.test(n)){let a=n.split(CV);if(a[a.length-1]==="")throw Error("Can't populate individual element in an array");let c="",l=t;for(let d=0;d<a.length;d+=2){let p=a[d];if(l.length>=p.length+1&&l.charAt(p.length)==="."&&l.slice(0,p.length)===p)c+=l.substring(0,p.length)+a[d+1],l=l.substring(p.length+1);else if(d===a.length-1){c+=l,l="";break}else throw Error("Could not normalize ref path, chunk "+p+" not in populated path")}let f=Ny.get(c,r,SV),h=Array.isArray(f)?f:[f];return h=bV.array.flatten(h),h}let o=Ny.get(t,r,SV),u;if(s!=null&&Object.hasOwn(s.virtuals,t))u=[s.virtuals[t].applyGetters(void 0,r)];else u=Array.isArray(o)?o:[o];return u}});var $y=g(function(Xxe,MV){var UEe=IA(),TV=we(),VEe=le().modelSymbol;function ru(e,t){this.path=t,this.getters=[],this.setters=[],this.options=Object.assign({},e)}ru.prototype._applyDefaultGetters=function(){if(this.getters.length>0||this.setters.length>0)return;let t="$"+this.path;this.getters.push(function(){return this.$locals[t]}),this.setters.push(function(r){this.$locals[t]=r})};/*!
420
+ * ignore
421
+ */ru.prototype.clone=function(){let e=new ru(this.options,this.path);return e.getters=[].concat(this.getters),e.setters=[].concat(this.setters),e};ru.prototype.get=function(e){return this.getters.push(e),this};ru.prototype.set=function(e){return this.setters.push(e),this};ru.prototype.applyGetters=function(e,t){if(TV.hasUserDefinedProperty(this.options,["ref","refPath"])&&t.$$populatedVirtuals&&Object.hasOwn(t.$$populatedVirtuals,this.path))e=t.$$populatedVirtuals[this.path];let r=e;for(let n of this.getters)r=n.call(t,r,this,t);return r};ru.prototype.applySetters=function(e,t){let r=e;for(let n of this.setters)r=n.call(t,r,this,t);return r};ru.prototype._getModelNamesForPopulate=function(t){if(this.options.refPath)return UEe(this.options.refPath,t,this.path);let r=null;if(typeof this.options.ref==="function"&&!this.options.ref[VEe])r=this.options.ref.call(t,t);else r=this.options.ref;if(r!=null&&!Array.isArray(r))return[r];return r};/*!
422
+ * exports
423
+ */MV.exports=ru});var $A=g(function(Zxe,xV){xV.exports=function(t){let r={_id:{auto:!0}};r._id[t.options.typeKey]="ObjectId",t.add(r)}});var RA=g(function(ePe,PV){PV.exports=function(t,r){let n=t.discriminatorMapping?.value;if(n&&!("sparse"in r)){let s=t.options.discriminatorKey;r.partialFilterExpression=r.partialFilterExpression||{},r.partialFilterExpression[s]=n}return r}});var BV=g(function(tPe,FV){var vA=gr(),zEe=Qa(),WEe=RA();FV.exports=function(t){let r=[],n=new WeakMap,s=t.constructor.indexTypes,i=new Map;return o(t),r;function o(a,c,l){if(n.has(a))return;n.set(a,!0),c=c||"";let f=Object.keys(a.paths);for(let h of f){let d=a.paths[h];if(l!=null&&l.paths[h])continue;if(d._duplicateKeyErrorMessage!=null)a._duplicateKeyErrorMessagesByPath=a._duplicateKeyErrorMessagesByPath||{},a._duplicateKeyErrorMessagesByPath[h]=d._duplicateKeyErrorMessage;if(d.$isMongooseDocumentArray||d.$isSingleNested){if(vA(d,"options.excludeIndexes")!==!0&&vA(d,"schemaOptions.excludeIndexes")!==!0&&vA(d,"schema.options.excludeIndexes")!==!0)o(d.schema,c+h+".");if(d.schema.discriminators!=null){let m=d.schema.discriminators,E=Object.keys(m);for(let y of E)o(m[y],c+h+".",d.schema)}if(d.$isMongooseDocumentArray)continue}let p=d._index||d.embeddedSchemaType&&d.embeddedSchemaType._index;if(p!==!1&&p!=null){let m={},E=zEe(p),y=E?{...p}:{},_=typeof p==="string"?p:E?p.type:!1;if(_&&s.indexOf(_)!==-1)m[c+h]=_;else if(y.text)m[c+h]="text",delete y.text;else{let C=!1;if(p==="descending"||p==="desc")C=!0;else if(p==="ascending"||p==="asc")C=!1;else C=Number(p)===-1;m[c+h]=C?-1:1}if(delete y.type,a.options.autoIndex!=null)y._autoIndex=a.options.autoIndex;let w=y?.name;if(typeof w==="string")if(i.has(w))Object.assign(i.get(w),m);else r.push([m,y]),i.set(w,m);else r.push([m,y]),i.set(w,m)}}if(n.delete(a),c)u(a,c);else a._indexes.forEach(function(h){let d=h[1];WEe(a,d)}),r=r.concat(a._indexes)}function u(a,c){let l=a._indexes,f=l.length;for(let h=0;h<f;++h){let d=l[h][0],p=l[h][1],m=Object.keys(d),E=m.length,y={};for(let w=0;w<E;++w){let C=m[w];y[c+C]=d[C]}let _=Object.assign({},p);if(p?.partialFilterExpression!=null){_.partialFilterExpression={};let w=p.partialFilterExpression;for(let C of Object.keys(w))_.partialFilterExpression[c+C]=w[C]}r.push([y,_])}}}});var kA=g(function(rPe,NV){NV.exports=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";break}return t}});var Ry=g(function(nPe,IV){/*!
424
+ * ignore
425
+ */IV.exports=function(t){if(!(!t.paths.id&&t.paths._id&&t.options.id))return t;if(t.aliases?.id)return t;return t.virtual("id").get(KEe),t};function KEe(){if(this._doc)return this._doc._id?.toString()??null;if(this._id!=null)return this._id.toString();return null}});var qA=g(function(sPe,$V){$V.exports=function(t,r){let n=Object.keys(t),s=Object.keys(r);if(n.length!==s.length)return!1;for(let i=0;i<n.length;i++){let o=n[i];if(o!==s[i]||t[o]!==r[o])return!1}return!0}});var vV=g(function(iPe,RV){RV.exports=function(t,r,n,s){if(s.justOne||s.count){if(t[r]=Array.isArray(n)?n[0]:n,typeof t[r]!=="object")t[r]=s.count?n:null}else t[r]=Array.isArray(n)?n:n==null?[]:[n],t[r]=t[r].filter(function(i){return i&&typeof i==="object"});return t[r]}});var wf=g(function(oPe,kV){kV.exports=function(t){if(t.indexOf("$")===-1)return t;return t.replace(/\.\$(\[[^\]]*\])?(?=\.|$)/g,".0")}});var vy=g(function(uPe,qV){qV.exports=HEe;/*!
426
+ * ignore
427
+ */function HEe(e,t){if(e==null)return null;if(typeof e==="boolean")return t;if(typeof e[t]==="boolean")return e[t]?t:null;if(!(t in e))return t;return e[t]}});var LA=g(function(aPe,LV){var jV=wf(),nu=vy();LV.exports=oc;/*!
428
+ * ignore
429
+ */function oc(e,t,r){if(t==null)return;if(Object.keys(t).some((u)=>u[0]==="$")){if(t.$push)o(t.$push);if(t.$addToSet)o(t.$addToSet);if(t.$set!=null){let u=Object.keys(t.$set);for(let a of u)jA(r,a,t.$set,e)}if(t.$setOnInsert!=null){let u=Object.keys(t.$setOnInsert);for(let a of u)jA(r,a,t.$setOnInsert,e)}}let i=Object.keys(t).filter((u)=>u[0]!=="$");for(let u of i)jA(r,u,t,e);function o(u){for(let a of Object.keys(u)){let c=r.path(jV(a));if(u[a]&&c&&c.$isMongooseDocumentArray&&c.schema.options.timestamps){let l=c.schema.options.timestamps,f=nu(l,"createdAt"),h=nu(l,"updatedAt");if(u[a].$each)u[a].$each.forEach(function(d){if(h!=null)d[h]=e;if(f!=null)d[f]=e;oc(e,d,c.schema)});else{if(h!=null)u[a][h]=e;if(f!=null)u[a][f]=e;oc(e,u[a],c.schema)}}}}}function GEe(e,t,r){let n=t.schema.options.timestamps,s=e.length;if(!n){for(let u=0;u<s;++u)oc(r,e[u],t.schema);return}let i=nu(n,"createdAt"),o=nu(n,"updatedAt");for(let u=0;u<s;++u){if(o!=null)e[u][o]=r;if(i!=null)e[u][i]=r;oc(r,e[u],t.schema)}}function YEe(e,t,r){let n=t.schema.options.timestamps;if(!n){oc(r,e,t.schema);return}let s=nu(n,"createdAt"),i=nu(n,"updatedAt");if(i!=null)e[i]=r;if(s!=null)e[s]=r;oc(r,e,t.schema)}function jA(e,t,r,n){let s=jV(t),i=e.path(s);if(!i)return;let o=[],u=s.split(".");for(let a=u.length-1;a>0;--a){let c=e.path(u.slice(0,a).join("."));if(c!=null&&(c.$isMongooseDocumentArray||c.$isSingleNested))o.push({parentPath:t.split(".").slice(0,a).join("."),parentSchemaType:c})}if(Array.isArray(r[t])&&i.$isMongooseDocumentArray)GEe(r[t],i,n);else if(r[t]&&i.$isSingleNested)YEe(r[t],i,n);else if(o.length>0)for(let a of o){let{parentPath:c,parentSchemaType:l}=a,f=l.schema.options.timestamps,h=nu(f,"updatedAt");if(!f||h==null)continue;if(l.$isSingleNested)r[c+"."+h]=n;else if(l.$isMongooseDocumentArray){let d=t.substring(c.length+1);if(/^\d+$/.test(d)){r[c+"."+d][h]=n;continue}let p=d.indexOf(".");d=p!==-1?d.substring(0,p):d,r[c+"."+d+"."+h]=n}}else if(i.schema!=null&&i.schema!=e&&r[t]){let a=i.schema.options.timestamps,c=nu(a,"createdAt"),l=nu(a,"updatedAt");if(!a)return;if(l!=null)r[t][l]=n;if(c!=null)r[t][c]=n}}});var VA=g(function(cPe,VV){/*!
430
+ * ignore
431
+ */var UV=we(),UA=gr();VV.exports=QEe;/*!
432
+ * ignore
433
+ */function QEe(e,t,r,n,s,i,o){let u=n,a=u,c=s?.timestamps??!0;if(!c||u==null)return n;let l=c?.createdAt===!1,f=c?.updatedAt===!1;if(o){if(n?.$set)n=n.$set,u.$set={},a=u.$set;if(!f&&r&&!n[r])a[r]=e;if(!l&&t&&!n[t])a[t]=e;return u}if(n=n||{},Array.isArray(u)){if(r==null||f)return u;return u.push({$set:{[r]:e}}),u}if(u.$set=u.$set||{},!f&&r&&!n.$currentDate?.[r]){let h=!1;if(r.indexOf(".")!==-1){let d=r.split(".");for(let p=1;p<d.length;++p){let m=d.slice(-p).join("."),E=d.slice(0,-p).join(".");if(n[E]!=null){n[E][m]=e,h=!0;break}else if(n.$set?.[E]){n.$set[E][m]=e,h=!0;break}}}if(!h)u.$set[r]=e;if(Object.hasOwn(u,r))delete u[r]}if(!l&&t){let h=s?.overwriteImmutable,d=UA(n,t)!=null||UA(n.$set,t)!=null||UA(n.$setOnInsert,t)!=null;if(h&&d){if(n[t]!=null)u.$set[t]=n[t],delete n[t]}else{if(n[t])delete n[t];if(n.$set?.[t])delete n.$set[t];let p=!1;if(t.indexOf(".")!==-1){let m=t.split(".");for(let E=1;E<m.length;++E){let y=m.slice(-E).join("."),_=m.slice(0,-E).join(".");if(n[_]!=null){n[_][y]=e,p=!0;break}else if(n.$set?.[_]){n.$set[_][y]=e,p=!0;break}}}if(!p&&i)u.$setOnInsert=u.$setOnInsert||{},u.$setOnInsert[t]=e}}if(UV.hasOwnKeys(u.$set)===!1)delete u.$set;return u}});var WV=g(function(lPe,zV){zV.exports=function(t,r,n,s,i){let o=r?.updatedAt===!1,u=r?.createdAt===!1,a=n!=null?n():t.ownerDocument().constructor.base.now();if(!u&&(t.isNew||t.$isSubdocument)&&s&&!t.$__getValue(s)&&t.$__isSelected(s))t.$set(s,a,void 0,{overwriteImmutable:!0});if(!o&&i&&(t.isNew||t.$isModified())){let c=a;if(t.isNew&&s!=null)c=t.$__getValue(s);t.$set(i,c)}}});var YV=g(function(hPe,GV){var JEe=LA(),XEe=VA(),ky=vy(),ZEe=WV(),qy=zi(),KV=new Set(["replaceOne","findOneAndReplace"]);GV.exports=function(t,r){let n=t.childSchemas.find(s);function s(l){return!!l.schema.options.timestamps}if(!r&&!n)return;let i=ky(r,"createdAt"),o=ky(r,"updatedAt"),u=r!=null&&Object.hasOwn(r,"currentTime")?r.currentTime:null,a={};if(t.$timestamps={createdAt:i,updatedAt:o},i&&!t.paths[i]){let f=t.base?.get("timestamps.createdAt.immutable")??null??!0;a[i]={[t.options.typeKey||"type"]:Date,immutable:f}}if(o&&!t.paths[o])a[o]=Date;t.add(a),t.pre("save",HV),t.methods.initializeTimestamps=function(l){if(l===!1)return this;let f=u!=null?u():this.constructor.base.now(),h=l!=null?ky(l,"createdAt"):i,d=l!=null?ky(l,"updatedAt"):o;if(h&&!this.get(h))this.$set(i,f);if(d&&!this.get(d))this.$set(o,f);if(this.$isSubdocument)return this;let p=this.$getAllSubdocs();for(let m of p)if(m.initializeTimestamps)m.initializeTimestamps(l);return this};let c={query:!0,model:!1};t.pre("findOneAndReplace",c,uc),t.pre("findOneAndUpdate",c,uc),t.pre("replaceOne",c,uc),t.pre("update",c,uc),t.pre("updateOne",c,uc),t.pre("updateMany",c,uc)};function HV(){let e=this.$__?.saveOptions?.timestamps;if(e===!1)return;let t=this.$__schema,{createdAt:r,updatedAt:n}=t.$timestamps,s=t.options.timestamps,i=s!=null&&Object.hasOwn(s,"currentTime")?s.currentTime:null;ZEe(this,e,i,r,n)}function uc(){let e=this.model.schema,{createdAt:t,updatedAt:r}=e.$timestamps,n=e.options.timestamps,s=n!=null&&Object.hasOwn(n,"currentTime")?n.currentTime:null,i=s!=null?s():this.model.base.now();if(KV.has(this.op)&&this.getUpdate()==null)this.setUpdate({});XEe(i,t,r,this.getUpdate(),this._mongooseOptions,this.options.upsert,KV.has(this.op)),JEe(i,this.getUpdate(),this.model.schema)}HV[qy.builtInMiddleware]=!0;uc[qy.builtInMiddleware]=!0});var XV=g(function(fPe,JV){var e_e=Le(),QV=L("util");JV.exports=t_e;function t_e(e,t){if(typeof e==="string")return;if(typeof e==="function")return;throw new e_e('Invalid ref at path "'+t+'". Got '+QV.inspect(e,{depth:0}))}});var Of=g(function(o_e){/*!
434
+ * ignore
435
+ */var ZV=Object.freeze(["countDocuments","distinct","estimatedDocumentCount","find","findOne","findOneAndReplace","findOneAndUpdate","replaceOne","updateMany","updateOne","deleteMany","deleteOne","findOneAndDelete"]);o_e.queryOperations=ZV;/*!
436
+ * ignore
437
+ */var r_e=ZV.concat(["validate"]);o_e.queryMiddlewareFunctions=r_e;/*!
438
+ * ignore
439
+ */var n_e=["aggregate"];o_e.aggregateMiddlewareFunctions=n_e;/*!
440
+ * ignore
441
+ */var s_e=["bulkWrite","createCollection","insertMany"];o_e.modelMiddlewareFunctions=s_e;/*!
442
+ * ignore
443
+ */var i_e=["validate","save","remove","updateOne","deleteOne","init"];o_e.documentMiddlewareFunctions=i_e});var oz=g(function(sz,iz){/*!
444
+ * Module dependencies.
445
+ */var Ly=Ey(),jy=le().arrayAtomicsSymbol,f_e=le().arrayAtomicsBackupSymbol,ez=le().arrayParentSymbol,d_e=le().arrayPathSymbol,tz=le().arraySchemaSymbol,rz=Array.prototype.push,nz=/^\d+$/;function p_e(e,t,r,n){let s;if(Array.isArray(e)){let u=e.length;if(u===0)s=[];else if(u===1)s=[,],s[0]=e[0];else if(u<1e4)s=[],rz.apply(s,e);else{s=[];for(let a=0;a<u;++a)rz.call(s,e[a])}}else s=[];let i={[jy]:{},[f_e]:void 0,[d_e]:t,[tz]:n,[ez]:void 0,isMongooseArray:!0,isMongooseArrayProxy:!0,__array:s};if(e&&e[jy]!=null)i[jy]=e[jy];if(r?.$__)i[ez]=r,i[tz]=n||r.schema.path(t);let o=new Proxy(s,{get:function(u,a){if(Object.hasOwn(i,a))return i[a];if(Object.hasOwn(Ly,a))return Ly[a];if(n?.virtuals&&Object.hasOwn(n.virtuals,a))return n.virtuals[a].applyGetters(void 0,u);if(typeof a==="string"&&nz.test(a)&&n?.embeddedSchemaType!=null)return n.embeddedSchemaType.applyGetters(s[a],r);return s[a]},set:function(u,a,c){if(typeof a==="string"&&nz.test(a))Ly.set.call(o,a,c,!1);else if(Object.hasOwn(i,a))i[a]=c;else if(n?.virtuals&&Object.hasOwn(n.virtuals,a))n.virtuals[a].applySetters(c,u);else s[a]=c;return!0}});return o}/*!
446
+ * Module exports.
447
+ */iz.exports=sz=p_e});var az=g(function(pPe,uz){uz.exports=Se().Double});var C1=g(function(mPe,lz){/*!
448
+ * Module dependencies.
449
+ */var wa=_r(),cz=zi(),m_e=Qa(),Uy=we();function _i(e,t,r,n){if(t?.default){let s=t.default;if(Array.isArray(s)&&s.length===0)t.default=Array;else if(!t.shared&&m_e(s)&&Uy.hasOwnKeys(s)===!1)t.default=function(){return{}}}wa.call(this,e,t,"Mixed",n),this[cz.schemaMixedSymbol]=!0}_i.schemaName="Mixed";_i.defaultOptions={};/*!
450
+ * Inherits from SchemaType.
451
+ */_i.prototype=Object.create(wa.prototype);_i.prototype.constructor=_i;_i.get=wa.get;_i.set=wa.set;_i.setters=[];_i.prototype.cast=function(e){if(e instanceof Error)return Uy.errorToPOJO(e);return e};_i.prototype.castForQuery=function(e,t){return t};_i.prototype.toJSONSchema=function(t){return{}};/*!
452
+ * Module exports.
453
+ */lz.exports=_i});var Wy=g(function(yPe,yz){var y_e=C1(),g_e=Le(),hz=Zt(),E_e=we().deepEqual,__e=we().isMongooseArray,A_e=Rn(),w_e=cy(),fz=gn(),zy=L("util"),mz=ma(),Vy=vn(),O_e=sy(),dz=le().populateModelSymbol;/*!
454
+ * ignore
455
+ */class Mo extends Map{constructor(e,t,r,n){if(A_e(e)==="Object")e=Object.keys(e).map((s)=>[s,e[s]]);super(e);this.$__parent=r?.$__!=null?r:null,this.$__path=t,this.$__schemaType=n==null?new y_e(t):n,this.$__runDeferred()}$init(e,t){if(pz(e),super.set(e,t),t?.$isSingleNested)t.$basePath=this.$__path+"."+e}$__set(e,t){super.set(e,t)}get(e,t){if(Vy(e,"ObjectId"))e=e.toString();if(t=t||{},t.getters===!1)return super.get(e);return this.$__schemaType.applyGetters(super.get(e),this.$__parent)}has(e){if(Vy(e,"ObjectId"))e=e.toString();return super.has(e)}set(e,t){if(Vy(e,"ObjectId"))e=e.toString();if(pz(e),t=w_e(t),this.$__schemaType==null){this.$__deferred=this.$__deferred||[],this.$__deferred.push({key:e,value:t});return}let r,n=this.$__parent,s=n?.$__?.populated?n.$populated(o.call(this),!0)||n.$populated(this.$__path,!0):null,i=this.get(e);if(s!=null){if(this.$__schemaType.$isSingleNested)throw new g_e(`Cannot manually populate single nested subdoc underneath Map at path "${this.$__path}". Try using an array instead of a Map.`);if(Array.isArray(t)&&this.$__schemaType.$isMongooseArray)t=t.map((u)=>{if(!fz(u))u=new s.options[dz](u);return u.$__.wasPopulated={value:u._doc._id},u});else if(t!=null){if(!fz(t))t=new s.options[dz](t);t.$__.wasPopulated={value:t._doc._id}}}else try{let u=this.$__schemaType.$isMongooseDocumentArray||this.$__schemaType.$isSingleNested||this.$__schemaType.$isMongooseArray||this.$__schemaType.$isSchemaMap?{path:o.call(this)}:null;t=this.$__schemaType.applySetters(t,this.$__parent,!1,this.get(e),u)}catch(u){if(this.$__parent?.$__!=null){this.$__parent.invalidate(o.call(this),u);return}throw u}if(super.set(e,t),n?.$__!=null&&!E_e(t,i)){let u=o.call(this);if(n.markModified(u),__e(t))t._registerAtomic("$set",t);if(this.$__schemaType.$isMongooseDocumentArray||this.$__schemaType.$isSingleNested)O_e(n,u)}function o(){if(r)return r;return r=this.$__path+"."+e,r}}clear(){super.clear();let e=this.$__parent;if(e!=null)e.markModified(this.$__path)}delete(e){if(Vy(e,"ObjectId"))e=e.toString();return this.set(e,void 0),super.delete(e)}toBSON(){return new Map(this)}toObject(e){if(e?.flattenMaps){let t={},r=this.keys();for(let n of r)t[n]=hz(this.get(n),e);return t}return new Map(this)}$toObject(){return this.constructor.prototype.toObject.apply(this,arguments)}toJSON(e){if(typeof e?.flattenMaps==="boolean"?e.flattenMaps:!0){let t={},r=this.keys();for(let n of r)t[n]=hz(this.get(n),e);return t}return new Map(this)}inspect(){return new Map(this)}$__runDeferred(){if(!this.$__deferred)return;for(let e of this.$__deferred)this.set(e.key,e.value);this.$__deferred=null}}if(zy.inspect.custom)Object.defineProperty(Mo.prototype,zy.inspect.custom,{enumerable:!1,writable:!1,configurable:!1,value:Mo.prototype.inspect});Object.defineProperty(Mo.prototype,"$__set",{enumerable:!1,writable:!0,configurable:!1});Object.defineProperty(Mo.prototype,"$__parent",{enumerable:!1,writable:!0,configurable:!1});Object.defineProperty(Mo.prototype,"$__path",{enumerable:!1,writable:!0,configurable:!1});Object.defineProperty(Mo.prototype,"$__schemaType",{enumerable:!1,writable:!0,configurable:!1});Object.defineProperty(Mo.prototype,"$isMongooseMap",{enumerable:!1,writable:!1,configurable:!1,value:!0});Object.defineProperty(Mo.prototype,"$__deferredCalls",{enumerable:!1,writable:!1,configurable:!1,value:!0});function pz(e){let t=typeof e;if(t!=="string")throw TypeError(`Mongoose maps only support string keys, got ${t}`);if(e.startsWith("$"))throw Error(`Mongoose maps do not support keys that start with "$", got "${e}"`);if(e.includes("."))throw Error(`Mongoose maps do not support keys that contain ".", got "${e}"`);if(mz.has(e))throw Error(`Mongoose maps do not support reserved key name "${e}"`)}yz.exports=Mo});var Ez=g(function(gPe,gz){gz.exports=Se().UUID});var b1=g(function(S_e){/*!
456
+ * Module exports.
457
+ */S_e.Array=oz();S_e.Buffer=Z0();S_e.Document=S_e.Embedded=_1();S_e.DocumentArray=sc();S_e.Double=az();S_e.Decimal128=U0();S_e.ObjectId=pa();S_e.Map=Wy();S_e.Subdocument=dy();S_e.UUID=Ez()});var Az=g(function(APe,_z){var I_e=As();class Sf extends I_e{}var zA=vs();Object.defineProperty(Sf.prototype,"enum",zA);Object.defineProperty(Sf.prototype,"of",zA);Object.defineProperty(Sf.prototype,"castNonArrays",zA);/*!
458
+ * ignore
459
+ */_z.exports=Sf});var Oz=g(function(wPe,wz){wz.exports=WA;function WA(e){if(!Array.isArray(e))return{min:0,max:0,containsNonArrayItem:!0};if(e.length===0)return{min:1,max:1,containsNonArrayItem:!1};if(e.length===1&&!Array.isArray(e[0]))return{min:1,max:1,containsNonArrayItem:!1};let t=WA(e[0]);for(let r=1;r<e.length;++r){let n=WA(e[r]);if(n.min<t.min)t.min=n.min;if(n.max>t.max)t.max=n.max;t.containsNonArrayItem=t.containsNonArrayItem||n.containsNonArrayItem}return t.min=t.min+1,t.max=t.max+1,t}});var Cf=g(function(OPe,Sz){Sz.exports=function(t){if(t==null)return t;if(t==="")return null;if(typeof t==="string"||typeof t==="boolean")t=Number(t);if(isNaN(t))throw Error("Cast to Number failed: value is not a valid number");if(t instanceof Number)return t.valueOf();if(typeof t==="number")return t;if(!Array.isArray(t)&&typeof t.valueOf==="function")return Number(t.valueOf());if(t.toString&&!Array.isArray(t)&&t.toString()==Number(t))return Number(t);throw Error("Cast to Number failed: value is not a valid number")}});var KA=g(function(SPe,Cz){Cz.exports=function(t){if(t==null||typeof t!=="object")return t;if(Array.isArray(t)){for(let r=t.length-1;r>=0;--r)if(t[r]===void 0)t.splice(r,1)}for(let r of Object.keys(t))if(t[r]===void 0)delete t[r];return t}});var Mz=g(function(CPe,Tz){var D1=kn(),Dz=ga(),Ky=Cf(),$_e=Co(),bz=KA(),R_e=new Set(["$and","$or"]),v_e=new Set(["$cmp","$eq","$lt","$lte","$gt","$gte"]),k_e=new Set(["$multiply","$divide","$log","$mod","$trunc","$avg","$max","$min","$stdDevPop","$stdDevSamp","$sum"]),q_e=new Set(["$abs","$exp","$ceil","$floor","$ln","$log10","$sqrt","$sin","$cos","$tan","$asin","$acos","$atan","$atan2","$asinh","$acosh","$atanh","$sinh","$cosh","$tanh","$degreesToRadians","$radiansToDegrees"]),j_e=new Set(["$arrayElemAt","$first","$last"]),L_e=new Set(["$year","$month","$week","$dayOfMonth","$dayOfYear","$hour","$minute","$second","$isoDayOfWeek","$isoWeekYear","$isoWeek","$millisecond"]),U_e=new Set(["$not"]);Tz.exports=function(t,r,n){if(typeof t==="boolean")return t;if(typeof t!=="object"||t===null)throw Error("`$expr` must be an object or boolean literal");return ws(t,r,n)};function ws(e,t,r){if(bf(e)||e===null)return e;if(e.$cond!=null)if(Array.isArray(e.$cond))e.$cond=e.$cond.map((s)=>ws(s,t,r));else e.$cond.if=ws(e.$cond.if,t,r),e.$cond.then=ws(e.$cond.then,t,r),e.$cond.else=ws(e.$cond.else,t,r);else if(e.$ifNull!=null)e.$ifNull.map((s)=>ws(s,t,r));else if(e.$switch!=null){if(Array.isArray(e.$switch.branches))for(let s of e.$switch.branches){if(s?.case!=null)s.case=ws(s.case,t,r);if(s?.then!=null)s.then=ws(s.then,t,r);bz(s)}if("default"in e.$switch)e.$switch.default=ws(e.$switch.default,t,r)}let n=Object.keys(e);for(let s of n)if(R_e.has(s))e[s]=e[s].map((i)=>ws(i,t,r));else if(v_e.has(s))e[s]=W_e(e[s],t,r);else if(k_e.has(s))e[s]=z_e(e[s],t,r);else if(q_e.has(s))e[s]=HA(e[s],t,r);else if(U_e.has(s))e[s]=ws(e[s],t,r);if(e.$in)e.$in=V_e(e.$in,t,r);if(e.$size)e.$size=HA(e.$size,t,r);if(e.$round){let s=e.$round;if(!Array.isArray(s)||s.length<1||s.length>2)throw new D1("Array",s,"$round");e.$round=s.map((i)=>HA(i,t,r))}return bz(e),e}function HA(e){if(!Df(e))return e;try{return Ky(e)}catch{throw new D1("Number",e)}}function V_e(e,t,r){let n=e[1];if(!bf(n))return e;let s=e[0],i=t.path(n.slice(1));if(i===null){if(r===!1)return e;else if(r==="throw")throw new Dz("$in");return}if(!i.$isMongooseArray)throw Error("Path must be an array for $in");if(!Df(s)&&(typeof s==="string"||$_e(s)))return[ws(s,t,r),n];if(typeof s==="object"&&s!=null&&s.$literal!=null)return[{$literal:i.embeddedSchemaType.cast(s.$literal)},n];return[i.embeddedSchemaType.cast(s),n]}function z_e(e){if(!Array.isArray(e)){if(!Df(e))return e;try{return Ky(e)}catch{throw new D1("Number",e)}}return e.map((t)=>{if(!Df(t))return t;try{return Ky(t)}catch{throw new D1("Number",t)}})}function W_e(e,t,r){if(!Array.isArray(e)||e.length!==2)throw Error("Comparison operator must be an array of length 2");e[0]=ws(e[0],t,r);let n=e[0];if(Df(e[1])){let s=null,i=null,o=null;if(bf(n))s=n.slice(1),i=t.path(s);else if(typeof n==="object"&&n!=null){for(let a of Object.keys(n))if(L_e.has(a)&&bf(n[a]))s=n[a].slice(1)+"."+a,o=Ky;else if(j_e.has(a)&&bf(n[a])){if(s=n[a].slice(1)+"."+a,i=t.path(n[a].slice(1)),i!=null){if(i.$isMongooseArray)i=i.embeddedSchemaType}}}let u=typeof e[1]==="object"&&e[1]!=null&&e[1].$literal!=null;if(i!=null)if(u)e[1]={$literal:i.cast(e[1].$literal)};else e[1]=i.cast(e[1]);else if(o!=null)if(u)try{e[1]={$literal:o(e[1].$literal)}}catch{throw new D1(o.name.replace(/^cast/,""),e[1],s+".$literal")}else try{e[1]=o(e[1])}catch{throw new D1(o.name.replace(/^cast/,""),e[1],s)}else if(s!=null&&r===!0)return;else if(s!=null&&r==="throw")throw new Dz(s)}else e[1]=ws(e[1],t,r);return e}function bf(e){return typeof e==="string"&&e[0]==="$"}function Df(e){if(typeof e==="string"&&e[0]==="$")return!1;if(typeof e==="object"&&e!==null&&Object.keys(e).find((t)=>t[0]==="$"))return e.$literal!=null;return!0}});var Hy=g(function(bPe,xz){var K_e=kn();xz.exports=function(t,r){if(t==null)return t;if(typeof t?._id==="string")return t._id;if(t.toString&&t.toString!==Object.prototype.toString&&!Array.isArray(t))return t.toString();throw new K_e("string",t,r)}});var Nz=g(function(DPe,Bz){var H_e=kn(),Pz=H0(),Fz=Hy();Bz.exports=function(t,r){if(t==null||typeof t!=="object")throw new H_e("$text",t,r);if(t.$search!=null)t.$search=Fz(t.$search,r+".$search");if(t.$language!=null)t.$language=Fz(t.$language,r+".$language");if(t.$caseSensitive!=null)t.$caseSensitive=Pz(t.$caseSensitive,r+".$caseSensitive");if(t.$diacriticSensitive!=null)t.$diacriticSensitive=Pz(t.$diacriticSensitive,r+".$diacriticSensitive");return t}});var GA=g(function(TPe,Iz){var G_e=Co();Iz.exports=function(t){if(!G_e(t))return t;let r=Object.keys(t);if(r.length!==1)return t;if(r[0]==="$eq")return t.$eq;if(r[0]==="$in"&&Array.isArray(t.$in)&&t.$in.length===1)return t.$in[0];return t}});var T1=g(function(MPe,$z){var Y_e=new Set(["$ref","$id","$db"]);$z.exports=function(t){return t[0]==="$"&&!Y_e.has(t)}});var Tf=g(function(Q_e){Q_e.logicalOperators=new Set(["$and","$or","$nor"])});var ac=g(function(PPe,Lz){/*!
460
+ * Module dependencies.
461
+ */var X_e=qs(),Rz=kn(),YA=ga(),qz=Mf(),Z_e=Mz(),e3e=Hy(),t3e=Nz(),r3e=gr(),vz=GA(),n3e=Do(),kz=ay(),QA=T1(),{logicalOperators:s3e}=Tf(),jz=L("util"),XA=Qa(),JA=cf(),Gy=we(),i3e=["Polygon","MultiPolygon"];Lz.exports=function e(t,r,n,s){if(Array.isArray(r))throw Error("Query filter must be an object, got an array "+jz.inspect(r));if(r==null)return r;if(t?.discriminators!=null&&r[t.options.discriminatorKey]!=null){let p=vz(r[t.options.discriminatorKey]);t=kz(t,p)||t}let i=Object.keys(r),o=i.length,u,a,c,l,f,h,d;n=n||{};while(o--)if(f=i[o],d=r[f],s3e.has(f)){if(!Array.isArray(d))throw new Rz("Array",d,f);for(let p=d.length-1;p>=0;p--){if(d[p]==null||typeof d[p]!=="object")throw new Rz("Object",d[p],f+"."+p);let m=Object.keys(d[p]).length,E=d[p][t.options.discriminatorKey];if(E==null)d[p]=e(t,d[p],n,s);else{let y=kz(s.schema,E);d[p]=e(y?y:t,d[p],n,s)}if(Gy.hasOwnKeys(d[p])===!1&&m!==0)d.splice(p,1)}if(d.length===0)delete r[f]}else if(f==="$where"){if(h=typeof d,h!=="string"&&h!=="function")throw Error("Must have a string or function for $where");if(h==="function")r[f]=d.toString();continue}else if(f==="$expr"){d=Z_e(d,t);continue}else if(f==="$elemMatch")d=e(t,d,n,s);else if(f==="$text")d=t3e(d,f);else if(f==="$comment"&&!Object.hasOwn(t.paths,"$comment"))d=e3e(d,f),r[f]=d;else if(QA(f))continue;else{if(!t)continue;if(c=t.path(f),!c){let p=f.split("."),m=p.length;while(m--){let E=p.slice(0,m).join("."),y=p.slice(m).join("."),_=t.path(E),w=_?.schema?.options?.discriminatorKey;if(_?.schema?.discriminators!=null&&w!=null&&y!==w){let C=vz(r3e(r,E+"."+w)),A=_.schema.discriminators,M=typeof C==="string"?X_e(A,C):null;if(M!=null)c=M.path(y)}}}if(!c){let p=f.split("."),m=p.length,E,y,_;while(m--)if(E=p.slice(0,m).join("."),c=t.path(E),c)break;if(c){if(c.schema){_={},y=p.slice(m).join("."),_[y]=d;let A=e(c.schema,_,n,s)[y];if(A===void 0)delete r[f];else r[f]=A}else r[f]=d;continue}if(XA(d)){let A="";if(d.$near)A="$near";else if(d.$nearSphere)A="$nearSphere";else if(d.$within)A="$within";else if(d.$geoIntersects)A="$geoIntersects";else if(d.$geoWithin)A="$geoWithin";if(A){let M=new qz.Number("__QueryCasting__",null,null,t),O=d[A];if(d.$maxDistance!=null)d.$maxDistance=M.castForQuery(null,d.$maxDistance,s);if(d.$minDistance!=null)d.$minDistance=M.castForQuery(null,d.$minDistance,s);if(A==="$within"){let x=O.$center||O.$centerSphere||O.$box||O.$polygon;if(!x)throw Error("Bad $within parameter: "+JSON.stringify(d));O=x}else if(A==="$near"&&typeof O.type==="string"&&Array.isArray(O.coordinates))O=O.coordinates;else if((A==="$near"||A==="$nearSphere"||A==="$geoIntersects")&&O.$geometry&&typeof O.$geometry.type==="string"&&Array.isArray(O.$geometry.coordinates)){if(O.$maxDistance!=null)O.$maxDistance=M.castForQuery(null,O.$maxDistance,s);if(O.$minDistance!=null)O.$minDistance=M.castForQuery(null,O.$minDistance,s);if(JA(O.$geometry))O.$geometry=O.$geometry.toObject({transform:!1,virtuals:!1});O=O.$geometry.coordinates}else if(A==="$geoWithin"){if(O.$geometry){if(JA(O.$geometry))O.$geometry=O.$geometry.toObject({virtuals:!1});let x=O.$geometry.type;if(i3e.indexOf(x)===-1)throw Error('Invalid geoJSON type for $geoWithin "'+x+'", must be "Polygon" or "MultiPolygon"');O=O.$geometry.coordinates}else if(O=O.$box||O.$polygon||O.$center||O.$centerSphere,JA(O))O=O.toObject({virtuals:!1})}ZA(O,M,s);continue}}if(n3e(t.nested,f))continue;let w="strict"in n?n.strict:t.options.strict,C=o3e(n,t._userProvidedOptions,t.options,s);if(n.upsert&&w){if(w==="throw")throw new YA(f);throw new YA(f,'Path "'+f+'" is not in schema, strict mode is `true`, and upsert is `true`.')}if(C==="throw")throw new YA(f,'Path "'+f+`" is not in schema and strictQuery is 'throw'.`);else if(C)delete r[f]}else if(d==null)continue;else if(Gy.isPOJO(d))if(a=Object.keys(d).some(QA),!a)r[f]=c.castForQuery(null,d,s);else{let p=Object.keys(d),m,E=p.length;while(E--)if(m=p[E],l=d[m],m==="$elemMatch"){if(l&&c?.schema!=null)e(c.schema,l,n,s);else if(l&&c?.$isMongooseArray)d[m]=c.castForQuery(m,l,s)}else if(m==="$not"){if(l&&c){if(u=Object.keys(l),u.length&&QA(u[0]))for(let y in l)l[y]=c.castForQuery(y,l[y],s);else d[m]=c.castForQuery(m,l,s);continue}}else d[m]=c.castForQuery(m,l,s)}else if(Array.isArray(d)&&["Buffer","Array"].indexOf(c.instance)===-1&&!n.sanitizeFilter){let p=[],m=d;for(let E of m)p.push(c.castForQuery(null,E,s));r[f]={$in:p}}else r[f]=c.castForQuery(null,d,s)}return r};function ZA(e,t,r){if(Array.isArray(e))e.forEach(function(n,s){if(Array.isArray(n)||XA(n))return ZA(n,t,r);e[s]=t.castForQuery(null,n,r)});else{let n=Object.keys(e),s=n.length;while(s--){let i=n[s],o=e[i];if(Array.isArray(o)||XA(o))ZA(o,t,r),e[i]=o;else e[i]=t.castForQuery(null,o,r)}}}function o3e(e,t,r,n){if("strictQuery"in e)return e.strictQuery;if("strictQuery"in t)return t.strictQuery;let s=n?.mongooseCollection?.conn?.base?.options;if(s){if("strictQuery"in s)return s.strictQuery}return r.strictQuery}});var Vz=g(function(FPe,Uz){var u3e=As();class M1 extends u3e{}var Yy=vs();Object.defineProperty(M1.prototype,"min",Yy);Object.defineProperty(M1.prototype,"max",Yy);Object.defineProperty(M1.prototype,"enum",Yy);Object.defineProperty(M1.prototype,"populate",Yy);/*!
462
+ * ignore
463
+ */Uz.exports=M1});var xf=g(function(BPe,Wz){/*!
464
+ * Module requirements.
465
+ */var a3e=kn();/*!
466
+ * ignore
467
+ */function c3e(e){let t=this;if(Array.isArray(e))return e.map(function(r){return zz(t.path,r)});else if(Buffer.isBuffer(e))return e;return zz(t.path,e)}/*!
468
+ * ignore
469
+ */function zz(e,t){let r=Number(t);if(isNaN(r))throw new a3e("number",t,e);return r}Wz.exports=c3e});var e4=g(function(NPe,Hz){/*!
470
+ * Module requirements.
471
+ */var su=Rs(),l3e=Vz(),on=_r(),h3e=Cf(),Qy=xf(),x1=we(),f3e=yi(),Kz=on.CastError;function Kt(e,t,r,n){this.enumValues=[],on.call(this,e,t,"Number",n)}Kt.get=on.get;Kt.set=on.set;Kt.setters=[];/*!
472
+ * ignore
473
+ */Kt._cast=h3e;Kt.cast=function(t){if(arguments.length===0)return this._cast;if(t===!1)t=this._defaultCaster;return this._cast=t,this._cast};/*!
474
+ * ignore
475
+ */Kt._defaultCaster=(e)=>{if(typeof e!=="number")throw Error();return e};Kt.schemaName="Number";Kt.defaultOptions={};/*!
476
+ * Inherits from SchemaType.
477
+ */Kt.prototype=Object.create(on.prototype);Kt.prototype.constructor=Kt;Kt.prototype.OptionsConstructor=l3e;/*!
478
+ * ignore
479
+ */Kt._checkRequired=(e)=>typeof e==="number"||e instanceof Number;Kt.checkRequired=on.checkRequired;Kt.prototype.checkRequired=function(t,r){if(typeof t==="object"&&on._isRef(this,t,r,!0))return t!=null;return(typeof this.constructor.checkRequired==="function"?this.constructor.checkRequired():Kt.checkRequired())(t)};Kt.prototype.min=function(e,t){if(this.minValidator)this.validators=this.validators.filter(function(r){return r.validator!==this.minValidator},this);if(e!=null){let r=t||su.messages.Number.min;if(typeof r==="string")r=r.replace(/{MIN}/,e);this.validators.push({validator:this.minValidator=function(n){return n==null||n>=e},message:r,type:"min",min:e})}return this};Kt.prototype.max=function(e,t){if(this.maxValidator)this.validators=this.validators.filter(function(r){return r.validator!==this.maxValidator},this);if(e!=null){let r=t||su.messages.Number.max;if(typeof r==="string")r=r.replace(/{MAX}/,e);this.validators.push({validator:this.maxValidator=function(n){return n==null||n<=e},message:r,type:"max",max:e})}return this};Kt.prototype.enum=function(e,t){if(this.enumValidator)this.validators=this.validators.filter(function(n){return n.validator!==this.enumValidator},this),this.enumValidator=!1;if(e==null||e===!1)return this.enumValues=[],delete this.options.enum,this;if(!Array.isArray(e)){if(x1.isPOJO(e)&&e.values!=null)t=e.message,e=e.values;else if(typeof e==="number")e=Array.prototype.slice.call(arguments),t=null;if(x1.isPOJO(e)){let s=Object.keys(e).sort(),i=Object.values(e).sort();if(s.length===i.length&&s.every((o,u)=>o===String(i[u]))&&i.filter((o)=>typeof o==="number").length===Math.floor(i.length/2))e=i.filter((o)=>typeof o==="number");else e=Object.values(e)}t=t||su.messages.Number.enum}t=t==null?su.messages.Number.enum:t;for(let n of e)if(n!==void 0)this.enumValues.push(this.cast(n));let r=this.enumValues;return this.enumValidator=(n)=>n==null||r.indexOf(n)!==-1,this.validators.push({validator:this.enumValidator,message:t,type:"enum",enumValues:r}),this};Kt.prototype.cast=function(e,t,r,n,s){if(typeof e!=="number"&&on._isRef(this,e,t,r)){if(e==null||x1.isNonBuiltinObject(e))return this._castRef(e,t,r,s)}let i=e?._id!==void 0?e._id:e,o;if(typeof this._castFunction==="function")o=this._castFunction;else if(typeof this.constructor.cast==="function")o=this.constructor.cast();else o=Kt.cast();try{return o(i)}catch(u){throw new Kz("Number",i,this.path,u,this)}};/*!
480
+ * ignore
481
+ */function Jy(e){return this.cast(e)}function d3e(e){let t=this;if(!Array.isArray(e))return[this.cast(e)];return e.map(function(r){return t.cast(r)})}var p3e={...on.prototype.$conditionalHandlers,$bitsAllClear:Qy,$bitsAnyClear:Qy,$bitsAllSet:Qy,$bitsAnySet:Qy,$gt:Jy,$gte:Jy,$lt:Jy,$lte:Jy,$mod:d3e};Object.defineProperty(Kt.prototype,"$conditionalHandlers",{enumerable:!1,value:p3e});Kt.prototype.castForQuery=function(e,t,r){let n;if(e!=null){if(n=f3e(this.$conditionalHandlers,e),!n)throw new su("Can't use "+e+" with Number.");return n.call(this,t,r)}try{t=this.applySetters(t,r)}catch(s){if(s instanceof Kz&&s.path===this.path&&this.$fullPath!=null)s.path=this.$fullPath;throw s}return t};Kt.prototype.toJSONSchema=function(t){return this._addJSONSchemaEnum(this._createJSONSchemaTypeDefinition("number","number",t))};/*!
482
+ * Module exports.
483
+ */Hz.exports=Kt});var Pf=g(function(m3e){/*!
484
+ * Module requirements.
485
+ */var Gz=e4();/*!
486
+ * ignore
487
+ */m3e.castToNumber=Yz;m3e.castArraysOfNumbers=Qz;/*!
488
+ * ignore
489
+ */function Yz(e){return Gz.cast()(e)}function Qz(e,t){e.forEach(function(r,n){if(Array.isArray(r))Qz(r,t);else e[n]=Yz.call(t,r)})}});var n4=g(function(w3e){/*!
490
+ * Module requirements.
491
+ */var Jz=Pf().castArraysOfNumbers,Ff=Pf().castToNumber;/*!
492
+ * ignore
493
+ */w3e.cast$geoIntersects=A3e;w3e.cast$near=E3e;w3e.cast$within=_3e;function E3e(e){let t=Xy();if(Array.isArray(e))return Jz(e,this),e;if(r4(this,e),e?.$geometry)return t4(e,this);if(!Array.isArray(e))throw TypeError("$near must be either an array or an object with a $geometry property");return t.prototype.castForQuery.call(this,null,e)}function t4(e,t){switch(e.$geometry.type){case"Polygon":case"LineString":case"Point":Jz(e.$geometry.coordinates,t);break;default:break}return r4(t,e),e}function _3e(e){if(r4(this,e),e.$box||e.$polygon){let t=e.$box?"$box":"$polygon";e[t].forEach((r)=>{if(!Array.isArray(r)){let n="Invalid $within $box argument. Expected an array, received "+r;throw TypeError(n)}r.forEach((n,s)=>{r[s]=Ff.call(this,n)})})}else if(e.$center||e.$centerSphere){let t=e.$center?"$center":"$centerSphere";e[t].forEach((r,n)=>{if(Array.isArray(r))r.forEach((s,i)=>{r[i]=Ff.call(this,s)});else e[t][n]=Ff.call(this,r)})}else if(e.$geometry)t4(e,this);return e}function A3e(e){if(!e.$geometry)return;return t4(e,this),e}function r4(e,t){if(t.$maxDistance)t.$maxDistance=Ff.call(e,t.$maxDistance);if(t.$minDistance)t.$minDistance=Ff.call(e,t.$minDistance)}});var Xy=g(function(RPe,tW){/*!
494
+ * Module dependencies.
495
+ */var b3e=G0(),D3e=L6(),eW=Le(),T3e=Az(),Ht=_r(),Zy=Ht.CastError,e2=C1(),M3e=NA(),Xz=$y(),x3e=Oz(),i4=ac(),P3e=Zt(),F3e=Rn(),Zz=T1(),Oa=L("util"),un=we(),B3e=Pf().castToNumber,P1=n4(),N3e=qs(),I3e=Ei(),$3e=yi(),Bf,s4,R3e=Object.freeze({});function rt(e,t,r,n,s){s4||(s4=b1().Embedded);let i="type";if(n?.typeKey)i=n.typeKey;if(this.schemaOptions=n,t){let a={};if(un.isPOJO(t))if(t[i])a=P3e(t),delete a[i],t=t[i];else t=e2;if(r?.ref!=null&&a.ref==null)a.ref=r.ref;if(t===Object)t=e2;let c=typeof t==="string"?t:un.getFunctionName(t),l=Mf(),f=Object.hasOwn(l,c)?l[c]:t;if(typeof f==="function")if(f===rt)this.embeddedSchemaType=new f(e,a,n,null,s);else this.embeddedSchemaType=new f(e,a,n,s);else if(f instanceof Ht){if(this.embeddedSchemaType=f,!(this.embeddedSchemaType instanceof s4))this.embeddedSchemaType.path=e}}this.$isMongooseArray=!0,Ht.call(this,e,r,"Array",s);let o,u;if(this.defaultValue!=null)o=this.defaultValue,u=typeof o==="function";if(!("defaultValue"in this)||this.defaultValue!=null){let a=function(){return u?o.call(this):o!=null?[].concat(o):[]};a.$runBeforeSetters=!u,this.default(a)}}rt.schemaName="Array";rt.options={castNonArrays:!0};/*!
496
+ * ignore
497
+ */rt.defaultOptions={};rt.set=Ht.set;rt.setters=[];rt.get=Ht.get;/*!
498
+ * Inherits from SchemaType.
499
+ */rt.prototype=Object.create(Ht.prototype);rt.prototype.constructor=rt;rt.prototype.OptionsConstructor=T3e;/*!
500
+ * ignore
501
+ */rt._checkRequired=Ht.prototype.checkRequired;rt.checkRequired=Ht.checkRequired;/*!
502
+ * Virtuals defined on this array itself.
503
+ */rt.prototype.virtuals=null;rt.prototype.checkRequired=function(t,r){if(typeof t==="object"&&Ht._isRef(this,t,r,!0))return!!t;return(typeof this.constructor.checkRequired==="function"?this.constructor.checkRequired():rt.checkRequired())(t)};rt.prototype.enum=function(){let e=this;while(!0){let r=e?.embeddedSchemaType?.instance;if(r==="Array"){e=e.embeddedSchemaType;continue}if(r!=="String"&&r!=="Number")throw Error("`enum` can only be set on an array of strings or numbers , not "+r);break}let t=arguments;if(!Array.isArray(arguments)&&un.isObject(arguments))t=un.object.vals(t);return e.embeddedSchemaType.enum.apply(e.embeddedSchemaType,t),this};rt.prototype.applyGetters=function(e,t){if(t?.$__!=null&&t.$populated(this.path))return e;return Ht.prototype.applyGetters.call(this,e,t)};rt.prototype._applySetters=function(e,t,r,n){if(this.embeddedSchemaType.$isMongooseArray&&e!=null&&e.length!==0){let s=[],i=this;while(i!=null&&i.$isMongooseArray&&!i.$isMongooseDocumentArray)s.push(i),i=i.embeddedSchemaType;let o=x3e(e);if(o.min===o.max&&o.max<s.length&&o.containsNonArrayItem&&s.slice(o.max).every((u)=>u.options.castNonArrays??rt.options.castNonArrays))for(let u=o.max;u<s.length;++u)e=[e]}return Ht.prototype._applySetters.call(this,e,t,r,n)};rt.prototype.cast=function(e,t,r,n,s){Bf||(Bf=b1().Array);let i,o;if(Array.isArray(e)){if(!e.length&&t){let d=t.schema.indexedPaths(),p=this.path;for(i=0,o=d.length;i<o;++i){let E=d[i][0][p];if(E==="2dsphere"||E==="2d")return}let m=this.path.endsWith(".coordinates")?this.path.substring(0,this.path.lastIndexOf(".")):null;if(m!=null){for(i=0,o=d.length;i<o;++i)if(d[i][0][m]==="2dsphere")return}}s=s||R3e;let c=un.isMongooseArray(e)?e.__array:e,l=s.path||this.path;if(s.arrayPathIndex!=null)l+="."+s.arrayPathIndex;if(e=Bf(c,l,t,this),c=e.__array,r&&t?.$__!=null&&t.$populated(this.path))return e;let f=this.embeddedSchemaType,h=f.$isMongooseArray;if(f&&this.embeddedSchemaType.constructor!==e2)try{let d=c.length;for(i=0;i<d;i++){let p={};if(h){if(s.arrayPath!=null)p.arrayPathIndex=i;else if(f._arrayParentPath!=null)p.arrayPathIndex=i}if(s.hydratedPopulatedDocs)p.hydratedPopulatedDocs=s.hydratedPopulatedDocs;if(s.virtuals)p.virtuals=s.virtuals;if(c[i]===void 0&&f.defaultValue!==void 0)c[i]=f.getDefault(t,r,null,p);else c[i]=f.applySetters(c[i],t,r,void 0,p)}}catch(d){throw new Zy("["+d.kind+"]",Oa.inspect(e),this.path+"."+i,d,this)}return e}let u=this.options.castNonArrays??rt.options.castNonArrays;if(r||u){if(t&&r)t.markModified(this.path);return this.cast([e],t,r)}throw new Zy("Array",Oa.inspect(e),this.path,null,this)};/*!
504
+ * ignore
505
+ */rt.prototype._castForPopulate=function(t,r){if(Bf||(Bf=b1().Array),Array.isArray(t)){let n,s=t.__array?t.__array:t,i=s.length;if(this.embeddedSchemaType&&this.embeddedSchemaType.constructor!==e2)try{for(n=0;n<i;n++){let o={};if(this.embeddedSchemaType.$isMongooseArray&&this.embeddedSchemaType._arrayParentPath!=null)o.arrayPathIndex=n;s[n]=this.embeddedSchemaType.cast(s[n],r,!1,void 0,o)}}catch(o){throw new Zy("["+o.kind+"]",Oa.inspect(t),this.path+"."+n,o,this)}return t}throw new Zy("Array",Oa.inspect(t),this.path,null,this)};rt.prototype.$toObject=rt.prototype.toObject;/*!
506
+ * ignore
507
+ */rt.prototype.discriminator=function(...e){let t=this;while(t.$isMongooseArray&&!t.$isMongooseDocumentArray)t=t.embeddedSchemaType;if(!t.$isMongooseDocumentArray)throw new eW("You can only add an embedded discriminator on a document array, "+this.path+" is a plain array");return t.discriminator(...e)};/*!
508
+ * ignore
509
+ */rt.prototype.clone=function(){let e=Object.assign({},this.options),t=new this.constructor(this.path,this.embeddedSchemaType,e,this.schemaOptions,this.parentSchema);if(t.validators=this.validators.slice(),this.requiredValidator!==void 0)t.requiredValidator=this.requiredValidator;return t};rt.prototype._castForQuery=function(e,t){let r=this.embeddedSchemaType,n=r?.schema?.options?.discriminatorKey,s=r?.discriminators;if(e&&s&&typeof n==="string"){let i=N3e(s,e[n]);if(i)r=i;else{let o=I3e(s,e[n]);if(o)r=o}}if(Array.isArray(e)){for(let i=this.setters.length-1;i>=0;i--)e=this.setters[i].call(this,e,this);e=e.map(function(i){if(un.isObject(i)&&i.$elemMatch)return i;return r.castForQuery(null,i,t)})}else e=r.castForQuery(null,e,t);return e};rt.prototype.castForQuery=function(e,t,r){let n;if(e!=null){if(n=$3e(this.$conditionalHandlers,e),!n)throw Error("Can't use "+e+" with Array.");return n.call(this,t,r)}else return this._castForQuery(t,r)};rt.prototype.virtual=function(t,r){if(t instanceof Xz||F3e(t)==="VirtualType")return this.virtual(t.path,t.options);if(r=new M3e(r),un.hasUserDefinedProperty(r,["ref","refPath"]))throw new eW("Cannot set populate virtual as a property of an array");let n=new Xz(r,t);if(this.virtuals===null)this.virtuals={};return this.virtuals[t]=n,n};function v3e(e,t){if(!Array.isArray(e))e=[e];return e=e.map((r)=>{if(!un.isObject(r))return r;if(r.$elemMatch!=null)return{$elemMatch:i4(this.embeddedSchemaType.schema,r.$elemMatch,null,this?.$$context)};let n={};return n[this.path]=r,i4(this.embeddedSchemaType.schema,n,null,this?.$$context)[this.path]},this),this.castForQuery(null,e,t)}function k3e(e,t){let r=Object.keys(e),n=r.length;for(let s=0;s<n;++s){let i=r[s],o=e[i];if(i==="$not"){if(un.isPOJO(o)){for(let u of Object.keys(o))if(Zz(u)&&o[u]!=null)o[u]=this.castForQuery(u,o[u],t)}continue}if(Zz(i)&&o!=null)e[i]=this.castForQuery(i,o,t)}return e}var Ut=rt.prototype.$conditionalHandlers={};Ut.$all=v3e;Ut.$options=String;Ut.$elemMatch=k3e;Ut.$geoIntersects=P1.cast$geoIntersects;Ut.$or=o4("$or");Ut.$and=o4("$and");Ut.$nor=o4("$nor");function o4(e){return function(r,n){if(!Array.isArray(r))throw TypeError("conditional "+e+" requires an array");let s=[];for(let i of r)s.push(i4(this.embeddedSchemaType.schema??n.schema,i,null,this?.$$context));return s}}Ut.$near=Ut.$nearSphere=P1.cast$near;Ut.$within=Ut.$geoWithin=P1.cast$within;Ut.$size=Ut.$minDistance=Ut.$maxDistance=B3e;Ut.$exists=b3e;Ut.$type=D3e;Ut.$eq=Ut.$gt=Ut.$gte=Ut.$lt=Ut.$lte=Ut.$not=Ut.$regex=Ut.$ne=rt.prototype._castForQuery;Ut.$nin=Ht.prototype.$conditionalHandlers.$nin;Ut.$in=Ht.prototype.$conditionalHandlers.$in;rt.prototype.toJSONSchema=function(t){let r=this.getEmbeddedSchemaType();return{...this._createJSONSchemaTypeDefinition("array","array",t),items:r.toJSONSchema(t)}};rt.prototype.autoEncryptionType=function(){return"array"};/*!
510
+ * Module exports.
511
+ */tW.exports=rt});var sW=g(function(vPe,nW){var{Long:q3e}=Se(),u4=9223372036854775807n,a4=-9223372036854775808n,rW=`Mongoose only supports BigInts between ${a4} and ${u4} because MongoDB does not support arbitrary precision integers`;nW.exports=function(t){if(t==null)return t;if(t==="")return null;if(typeof t==="bigint"){if(t>u4||t<a4)throw Error(rW);return t}if(t instanceof q3e)return t.toBigInt();if(typeof t==="string"||typeof t==="number"){if(t=BigInt(t),t>u4||t<a4)throw Error(rW);return t}throw Error(`Cannot convert value to BigInt: "${t}"`)}});var uW=g(function(kPe,oW){/*!
512
+ * Module dependencies.
513
+ */var iW=kn(),Ai=_r(),j3e=sW(),L3e=yi();function Ar(e,t,r,n){Ai.call(this,e,t,"BigInt",n)}Ar.schemaName="BigInt";Ar.defaultOptions={};/*!
514
+ * Inherits from SchemaType.
515
+ */Ar.prototype=Object.create(Ai.prototype);Ar.prototype.constructor=Ar;/*!
516
+ * ignore
517
+ */Ar._cast=j3e;Ar.set=Ai.set;Ar.setters=[];Ar.get=Ai.get;Ar.cast=function(t){if(arguments.length===0)return this._cast;if(t===!1)t=this._defaultCaster;return this._cast=t,this._cast};/*!
518
+ * ignore
519
+ */Ar._checkRequired=(e)=>e!=null;Ar.checkRequired=Ai.checkRequired;Ar.prototype.checkRequired=function(e){return this.constructor._checkRequired(e)};Ar.prototype.cast=function(e){let t;if(typeof this._castFunction==="function")t=this._castFunction;else if(typeof this.constructor.cast==="function")t=this.constructor.cast();else t=Ar.cast();try{return t(e)}catch(r){throw new iW("BigInt",e,this.path,r,this)}};/*!
520
+ * ignore
521
+ */var U3e={...Ai.prototype.$conditionalHandlers,$gt:t2,$gte:t2,$lt:t2,$lte:t2};Object.defineProperty(Ar.prototype,"$conditionalHandlers",{enumerable:!1,value:U3e});/*!
522
+ * ignore
523
+ */function t2(e,t){return this.castForQuery(null,e,t)}Ar.prototype.castForQuery=function(e,t,r){let n;if(e!=null){if(n=L3e(this.$conditionalHandlers,e),n)return n.call(this,t);return this.applySetters(t,r)}try{return this.applySetters(t,r)}catch(s){if(s instanceof iW&&s.path===this.path&&this.$fullPath!=null)s.path=this.$fullPath;throw s}};Ar.prototype._castNullish=function(t){if(typeof t>"u")return t;if((typeof this.constructor.cast==="function"?this.constructor.cast():Ar.cast())==null)return t;return t};Ar.prototype.toJSONSchema=function(t){return this._createJSONSchemaTypeDefinition("string","long",t)};Ar.prototype.autoEncryptionType=function(){return"long"};/*!
524
+ * Module exports.
525
+ */oW.exports=Ar});var lW=g(function(qPe,cW){/*!
526
+ * Module dependencies.
527
+ */var aW=kn(),wi=_r(),cc=H0(),V3e=yi();function Gt(e,t,r,n){wi.call(this,e,t,"Boolean",n)}Gt.schemaName="Boolean";Gt.defaultOptions={};/*!
528
+ * Inherits from SchemaType.
529
+ */Gt.prototype=Object.create(wi.prototype);Gt.prototype.constructor=Gt;/*!
530
+ * ignore
531
+ */Gt._cast=cc;Gt.set=wi.set;Gt.setters=[];Gt.get=wi.get;Gt.cast=function(t){if(arguments.length===0)return this._cast;if(t===!1)t=this._defaultCaster;return this._cast=t,this._cast};/*!
532
+ * ignore
533
+ */Gt._defaultCaster=(e)=>{if(e!=null&&typeof e!=="boolean")throw Error();return e};/*!
534
+ * ignore
535
+ */Gt._checkRequired=(e)=>e===!0||e===!1;Gt.checkRequired=wi.checkRequired;Gt.prototype.checkRequired=function(e){return this.constructor._checkRequired(e)};Object.defineProperty(Gt,"convertToTrue",{get:()=>cc.convertToTrue,set:(e)=>{cc.convertToTrue=e}});Object.defineProperty(Gt,"convertToFalse",{get:()=>cc.convertToFalse,set:(e)=>{cc.convertToFalse=e}});Gt.prototype.cast=function(e){let t;if(typeof this._castFunction==="function")t=this._castFunction;else if(typeof this.constructor.cast==="function")t=this.constructor.cast();else t=Gt.cast();try{return t(e)}catch(r){throw new aW("Boolean",e,this.path,r,this)}};var z3e={...wi.prototype.$conditionalHandlers};Object.defineProperty(Gt.prototype,"$conditionalHandlers",{enumerable:!1,value:z3e});Gt.prototype.castForQuery=function(e,t,r){let n;if(e!=null){if(n=V3e(this.$conditionalHandlers,e),n)return n.call(this,t);return this.applySetters(t,r)}try{return this.applySetters(t,r)}catch(s){if(s instanceof aW&&s.path===this.path&&this.$fullPath!=null)s.path=this.$fullPath;throw s}};Gt.prototype._castNullish=function(t){if(typeof t>"u")return t;let r=typeof this.constructor.cast==="function"?this.constructor.cast():Gt.cast();if(r==null)return t;if(r.convertToFalse instanceof Set&&r.convertToFalse.has(t))return!1;if(r.convertToTrue instanceof Set&&r.convertToTrue.has(t))return!0;return t};Gt.prototype.toJSONSchema=function(t){return this._createJSONSchemaTypeDefinition("boolean","bool",t)};Gt.prototype.autoEncryptionType=function(){return"bool"};/*!
536
+ * Module exports.
537
+ */cW.exports=Gt});var fW=g(function(jPe,hW){var W3e=As();class c4 extends W3e{}var K3e=vs();Object.defineProperty(c4.prototype,"subtype",K3e);/*!
538
+ * ignore
539
+ */hW.exports=c4});var pW=g(function(LPe,dW){/*!
540
+ * Module dependencies.
541
+ */var lc=Z0(),H3e=fW(),an=_r(),r2=xf(),i2=we(),G3e=yi(),l4=lc.Binary,s2=an.CastError;function zr(e,t,r,n){an.call(this,e,t,"Buffer",n)}zr.schemaName="Buffer";zr.defaultOptions={};/*!
542
+ * Inherits from SchemaType.
543
+ */zr.prototype=Object.create(an.prototype);zr.prototype.constructor=zr;zr.prototype.OptionsConstructor=H3e;/*!
544
+ * ignore
545
+ */zr._checkRequired=(e)=>!!e?.length;zr.set=an.set;zr.setters=[];zr.get=an.get;zr.checkRequired=an.checkRequired;zr.prototype.checkRequired=function(e,t){if(an._isRef(this,e,t,!0))return!!e;return this.constructor._checkRequired(e)};zr.prototype.cast=function(e,t,r,n,s){let i;if(an._isRef(this,e,t,r)){if(Buffer.isBuffer(e)&&e.isMongooseBuffer)return e;if(Buffer.isBuffer(e)){if(e=new lc(e,[this.path,t]),this.options.subtype!=null)e._subtype=this.options.subtype;return e}if(e instanceof l4){if(i=new lc(e.value(!0),[this.path,t]),typeof e.sub_type!=="number")throw new s2("Buffer",e,this.path,null,this);return i._subtype=e.sub_type,i}if(e==null||i2.isNonBuiltinObject(e))return this._castRef(e,t,r,s)}if(e?._id)e=e._id;if(Buffer.isBuffer(e)&&e.isMongooseBuffer)return e;if(Buffer.isBuffer(e)){if(e=new lc(e,[this.path,t]),this.options.subtype!=null)e._subtype=this.options.subtype;return e}if(e instanceof l4){if(i=new lc(e.value(!0),[this.path,t]),typeof e.sub_type!=="number")throw new s2("Buffer",e,this.path,null,this);return i._subtype=e.sub_type,i}if(e===null)return e;let o=typeof e;if(o==="string"||o==="number"||Array.isArray(e)||o==="object"&&e.type==="Buffer"&&Array.isArray(e.data)){if(o==="number")e=[e];if(i=new lc(e,[this.path,t]),this.options.subtype!=null)i._subtype=this.options.subtype;return i}if(i2.isPOJO(e)&&(e.$binary instanceof l4||typeof e.$binary==="string")){let u=this.cast(Buffer.from(e.$binary,"base64"));if(e.$type!=null)return u._subtype=e.$type,u}throw new s2("Buffer",e,this.path,null,this)};zr.prototype.subtype=function(e){return this.options.subtype=e,this};/*!
546
+ * ignore
547
+ */function n2(e,t){return this.castForQuery(null,e,t)}var Y3e={...an.prototype.$conditionalHandlers,$bitsAllClear:r2,$bitsAnyClear:r2,$bitsAllSet:r2,$bitsAnySet:r2,$gt:n2,$gte:n2,$lt:n2,$lte:n2};Object.defineProperty(zr.prototype,"$conditionalHandlers",{enumerable:!1,value:Y3e});zr.prototype.castForQuery=function(e,t,r){let n;if(e!=null){if(n=G3e(this.$conditionalHandlers,e),!n)throw Error("Can't use "+e+" with Buffer.");return n.call(this,t)}let s;try{s=this.applySetters(t,r)}catch(i){if(i instanceof s2&&i.path===this.path&&this.$fullPath!=null)i.path=this.$fullPath;throw i}return s?s.toObject({transform:!1,virtuals:!1}):s};zr.prototype.toJSONSchema=function(t){return this._createJSONSchemaTypeDefinition("string","binData",t)};zr.prototype.autoEncryptionType=function(){return"binData"};/*!
548
+ * Module exports.
549
+ */dW.exports=zr});var yW=g(function(UPe,mW){var Q3e=As();class Nf extends Q3e{}var h4=vs();Object.defineProperty(Nf.prototype,"min",h4);Object.defineProperty(Nf.prototype,"max",h4);Object.defineProperty(Nf.prototype,"expires",h4);/*!
550
+ * ignore
551
+ */mW.exports=Nf});var EW=g(function(VPe,gW){var F1=L("assert");gW.exports=function(t){if(t==null||t==="")return null;if(t instanceof Date)return F1.ok(!isNaN(t.valueOf())),t;let r;if(F1.ok(typeof t!=="boolean"),t instanceof Number||typeof t==="number")r=new Date(t);else if(typeof t==="string"&&!isNaN(Number(t))&&(Number(t)>=275761||Number(t)<-271820))r=new Date(Number(t));else if(typeof t.valueOf==="function")r=new Date(t.valueOf());else r=new Date(t);if(!isNaN(r.valueOf()))return r;F1.ok(!1)}});var OW=g(function(zPe,wW){/*!
552
+ * Module requirements.
553
+ */var u2=Rs(),J3e=yW(),Ln=_r(),X3e=EW(),Z3e=Rn(),_W=we(),e6e=yi(),AW=Ln.CastError;function Vt(e,t,r,n){Ln.call(this,e,t,"Date",n)}Vt.schemaName="Date";Vt.defaultOptions={};/*!
554
+ * Inherits from SchemaType.
555
+ */Vt.prototype=Object.create(Ln.prototype);Vt.prototype.constructor=Vt;Vt.prototype.OptionsConstructor=J3e;/*!
556
+ * ignore
557
+ */Vt._cast=X3e;Vt.set=Ln.set;Vt.setters=[];Vt.get=Ln.get;Vt.cast=function(t){if(arguments.length===0)return this._cast;if(t===!1)t=this._defaultCaster;return this._cast=t,this._cast};/*!
558
+ * ignore
559
+ */Vt._defaultCaster=(e)=>{if(e!=null&&!(e instanceof Date))throw Error();return e};Vt.prototype.expires=function(e){if(Z3e(this._index)!=="Object")this._index={};return this._index.expires=e,_W.expires(this._index),this};/*!
560
+ * ignore
561
+ */Vt._checkRequired=(e)=>e instanceof Date;Vt.checkRequired=Ln.checkRequired;Vt.prototype.checkRequired=function(e,t){if(typeof e==="object"&&Ln._isRef(this,e,t,!0))return e!=null;return(typeof this.constructor.checkRequired==="function"?this.constructor.checkRequired():Vt.checkRequired())(e)};Vt.prototype.min=function(e,t){if(this.minValidator)this.validators=this.validators.filter(function(r){return r.validator!==this.minValidator},this);if(e){let r=t||u2.messages.Date.min;if(typeof r==="string")r=r.replace(/{MIN}/,e===Date.now?"Date.now()":e.toString());let n=this;this.validators.push({validator:this.minValidator=function(s){let i=e;if(typeof e==="function"&&e!==Date.now)i=i.call(this);let o=i===Date.now?i():n.cast(i);return s===null||s.valueOf()>=o.valueOf()},message:r,type:"min",min:e})}return this};Vt.prototype.max=function(e,t){if(this.maxValidator)this.validators=this.validators.filter(function(r){return r.validator!==this.maxValidator},this);if(e){let r=t||u2.messages.Date.max;if(typeof r==="string")r=r.replace(/{MAX}/,e===Date.now?"Date.now()":e.toString());let n=this;this.validators.push({validator:this.maxValidator=function(s){let i=e;if(typeof i==="function"&&i!==Date.now)i=i.call(this);let o=i===Date.now?i():n.cast(i);return s===null||s.valueOf()<=o.valueOf()},message:r,type:"max",max:e})}return this};Vt.prototype.cast=function(e){let t;if(typeof this._castFunction==="function")t=this._castFunction;else if(typeof this.constructor.cast==="function")t=this.constructor.cast();else t=Vt.cast();try{return t(e)}catch(r){throw new AW("date",e,this.path,r,this)}};function o2(e){return this.cast(e)}var t6e={...Ln.prototype.$conditionalHandlers,$gt:o2,$gte:o2,$lt:o2,$lte:o2};Object.defineProperty(Vt.prototype,"$conditionalHandlers",{enumerable:!1,value:t6e});Vt.prototype.castForQuery=function(e,t,r){if(e==null)try{return this.applySetters(t,r)}catch(s){if(s instanceof AW&&s.path===this.path&&this.$fullPath!=null)s.path=this.$fullPath;throw s}let n=e6e(this.$conditionalHandlers,e);if(!n)throw Error("Can't use "+e+" with Date.");return n.call(this,t)};Vt.prototype.toJSONSchema=function(t){return this._createJSONSchemaTypeDefinition("string","date",t)};Vt.prototype.autoEncryptionType=function(){return"date"};/*!
562
+ * Module exports.
563
+ */wW.exports=Vt});var bW=g(function(WPe,CW){var Gi=U0(),SW=L("assert");CW.exports=function(t){if(t==null)return t;if(typeof t==="object"&&typeof t.$numberDecimal==="string")return Gi.fromString(t.$numberDecimal);if(t instanceof Gi)return t;if(typeof t==="string")return Gi.fromString(t);if(typeof Buffer==="function"&&Buffer.isBuffer(t))return new Gi(t);if(typeof Uint8Array==="function"&&t instanceof Uint8Array)return new Gi(t);if(typeof t==="number")return Gi.fromString(String(t));if(typeof t.valueOf==="function"&&typeof t.valueOf()==="string")return Gi.fromString(t.valueOf());SW.ok(!1)}});var TW=g(function(KPe,DW){/*!
564
+ * Module dependencies.
565
+ */var cn=_r(),r6e=cn.CastError,n6e=bW(),f4=vn();function br(e,t,r,n){cn.call(this,e,t,"Decimal128",n)}br.schemaName="Decimal128";br.defaultOptions={};/*!
566
+ * Inherits from SchemaType.
567
+ */br.prototype=Object.create(cn.prototype);br.prototype.constructor=br;/*!
568
+ * ignore
569
+ */br._cast=n6e;br.set=cn.set;br.setters=[];br.get=cn.get;br.cast=function(t){if(arguments.length===0)return this._cast;if(t===!1)t=this._defaultCaster;return this._cast=t,this._cast};/*!
570
+ * ignore
571
+ */br._defaultCaster=(e)=>{if(e!=null&&!f4(e,"Decimal128"))throw Error();return e};/*!
572
+ * ignore
573
+ */br._checkRequired=(e)=>f4(e,"Decimal128");br.checkRequired=cn.checkRequired;br.prototype.checkRequired=function(t,r){if(cn._isRef(this,t,r,!0))return!!t;return(typeof this.constructor.checkRequired==="function"?this.constructor.checkRequired():br.checkRequired())(t)};br.prototype.cast=function(e,t,r,n,s){if(cn._isRef(this,e,t,r)){if(f4(e,"Decimal128"))return e;return this._castRef(e,t,r,s)}let i;if(typeof this._castFunction==="function")i=this._castFunction;else if(typeof this.constructor.cast==="function")i=this.constructor.cast();else i=br.cast();try{return i(e)}catch(o){throw new r6e("Decimal128",e,this.path,o,this)}};/*!
574
+ * ignore
575
+ */function a2(e){return this.cast(e)}var s6e={...cn.prototype.$conditionalHandlers,$gt:a2,$gte:a2,$lt:a2,$lte:a2};Object.defineProperty(br.prototype,"$conditionalHandlers",{enumerable:!1,value:s6e});br.prototype.toJSONSchema=function(t){return this._createJSONSchemaTypeDefinition("string","decimal",t)};br.prototype.autoEncryptionType=function(){return"decimal"};/*!
576
+ * Module exports.
577
+ */DW.exports=br});var xW=g(function(HPe,MW){var i6e=As();class If extends i6e{}var d4=vs();Object.defineProperty(If.prototype,"_id",d4);Object.defineProperty(If.prototype,"minimize",d4);Object.defineProperty(If.prototype,"discriminators",d4);MW.exports=If});var FW=g(function(GPe,PW){var Un=zi();/*!
578
+ * ignore
579
+ */PW.exports=function(t){t.s.hooks.pre("save",!1,p4,null,!0),t.s.hooks.post("save",m4,null,!0),t.s.hooks.pre("save",y4),t.s.hooks.post("save",g4)};function p4(){if(this.$isSubdocument)return;let e=this.$getAllSubdocs({useCache:!0});if(!e.length)return;let t=this.$__.saveOptions;return Promise.all(e.map((r)=>r._execDocumentPreHooks("save",t,[t]))).then(()=>{if(this.$__.saveOptions)this.$__.saveOptions.__subdocs=null})}function m4(){if(this.$isSubdocument)return;let e=this.$getAllSubdocs({useCache:!0});if(!e.length)return;let t=this.$__.saveOptions,r=[];for(let n of e)r.push(n._execDocumentPostHooks("save",t));return Promise.all(r)}function y4(){let e=this.$__.removedSubdocs;if(!e?.length)return;let t=this.$__.saveOptions,r=[];for(let n of e)r.push(n._execDocumentPreHooks("deleteOne",t));return Promise.all(r)}function g4(){let e=this.$__.removedSubdocs;if(!e?.length)return;let t=this.$__.saveOptions,r=[];for(let n of e)r.push(n._execDocumentPostHooks("deleteOne",t));return this.$__.removedSubdocs=null,Promise.all(r)}p4[Un.builtInMiddleware]=!0;p4[Un.skipOnSubdocuments]=!0;m4[Un.builtInMiddleware]=!0;m4[Un.skipOnSubdocuments]=!0;y4[Un.builtInMiddleware]=!0;y4[Un.skipOnSubdocuments]=!0;g4[Un.builtInMiddleware]=!0;g4[Un.skipOnSubdocuments]=!0});var BW=g(function(YPe,A4){var o6e=le().objectIdSymbol,bt=zi(),c2=we();/*!
580
+ * ignore
581
+ */A4.exports=function(t){t.post("init",l2),t.pre("save",h2),t.post("save",f2),t.pre("deleteOne",{document:!0,query:!1},d2),t.pre("updateOne",{document:!0,query:!1},p2)};function l2(){return _4.call(this),this}function h2(){E4.call(this)}function f2(){_4.call(this)}function d2(){E4.call(this)}function p2(){E4.call(this)}/*!
582
+ * ignore
583
+ */function E4(){let e,t;if(this.$__.shardval){e=Object.keys(this.$__.shardval),t=e.length,this.$where=this.$where||{};for(let r=0;r<t;++r)this.$where[e[r]]=this.$__.shardval[e[r]]}}/*!
584
+ * ignore
585
+ */A4.exports.storeShard=_4;/*!
586
+ * ignore
587
+ */function _4(){let e=this.$__schema.options.shardKey||this.$__schema.options.shardkey;if(!c2.isPOJO(e))return;let t=this.$__.shardval={},r=Object.keys(e),n=r.length,s;for(let i=0;i<n;++i)if(s=this.$__getValue(r[i]),s==null)t[r[i]]=s;else if(c2.isMongooseObject(s))t[r[i]]=s.toObject({depopulate:!0,_isNested:!0});else if(s instanceof Date||s[o6e])t[r[i]]=s;else if(typeof s.valueOf==="function")t[r[i]]=s.valueOf();else t[r[i]]=s}l2[bt.builtInMiddleware]=!0;l2[bt.skipOnSubdocuments]=!0;l2[bt.requiresShardKey]=!0;h2[bt.builtInMiddleware]=!0;h2[bt.skipOnSubdocuments]=!0;h2[bt.requiresShardKey]=!0;f2[bt.builtInMiddleware]=!0;f2[bt.skipOnSubdocuments]=!0;f2[bt.requiresShardKey]=!0;d2[bt.builtInMiddleware]=!0;d2[bt.skipOnSubdocuments]=!0;d2[bt.requiresShardKey]=!0;p2[bt.builtInMiddleware]=!0;p2[bt.skipOnSubdocuments]=!0;p2[bt.requiresShardKey]=!0});var kW=g(function(QPe,vW){var B1=le().arrayAtomicsSymbol,m2=le().sessionNewDocuments,y2=zi(),N1=we();vW.exports=function(t){t.pre("save",IW),t.pre("deleteOne",{document:!0,query:!1},$W)};function IW(){RW(this)}function $W(){let e=RW(this);if(e!=null&&!Object.hasOwn(e,"isDeleted"))e.isDeleted=this.$isDeleted()}function RW(e){let t=e.$session();if(t==null)return null;if(t.transaction==null||t[m2]==null)return null;if(!t[m2].has(e)){let r={};if(e.isNew)r.isNew=!0;if(e.$__schema.options.versionKey)r.versionKey=e.get(e.$__schema.options.versionKey);r.modifiedPaths=new Set(Object.keys(e.$__.activePaths.getStatePaths("modify"))),r.atomics=u6e(e),t[m2].set(e,r)}return t[m2].get(e)}function u6e(e,t){let r=new Map;t=t||new Map;let n=Object.keys(e.$__.activePaths.init).concat(Object.keys(e.$__.activePaths.modify));for(let i of n){let o=e.$__getValue(i);if(Array.isArray(o)&&N1.isMongooseDocumentArray(o)&&o.length&&o[B1]!=null&&N1.hasOwnKeys(o[B1])){let u=t.get(i)||{};r.set(i,NW(u,o[B1]))}}let s=e.$__dirty();for(let i of s){let{path:o,value:u}=i;if(u?.[B1]!=null&&N1.hasOwnKeys(u[B1])){let a=t.get(o)||{};r.set(o,NW(a,u[B1]))}}return r}function NW(e,t){if(e=e||{},t.$pullAll!=null)e.$pullAll=(e.$pullAll||[]).concat(t.$pullAll);if(t.$push!=null)e.$push=e.$push||{},e.$push.$each=(e.$push.$each||[]).concat(t.$push.$each);if(t.$addToSet!=null)e.$addToSet=(e.$addToSet||[]).concat(t.$addToSet);if(t.$set!=null)e.$set=Array.isArray(t.$set)?[...t.$set]:Object.assign({},t.$set);return e}IW[y2.builtInMiddleware]=!0;$W[y2.builtInMiddleware]=!0});var w4=g(function(a6e){a6e.saveSubdocs=FW();a6e.sharding=BW();a6e.trackTransaction=kW()});var LW=g(function(XPe,jW){var qW=w4();jW.exports=function(t){for(let r of Object.values(qW))r(t,{deduplicate:!0});t.plugins=Object.values(qW).map((r)=>({fn:r,opts:{deduplicate:!0}})).concat(t.plugins)}});var WW=g(function(ZPe,zW){var f6e=J0(),VW=ma(),d6e=vn(),p6e=pa(),m6e=_r(),UW=Qa();zW.exports=function e(t,r,n,s){let i=Object.keys(r),o=0,u=i.length,a;if(n=n||"",s=s||new WeakSet,s.has(r))return;s.add(r);while(o<u){if(a=i[o++],!n){if(a==="discriminators"||a==="base"||a==="_applyDiscriminators"||a==="_userProvidedOptions"||a==="options"||a==="tree")continue}if(n==="tree"&&r?.instanceOfSchema)continue;if(VW.has(a))continue;if(a==="parentSchema")continue;if(t[a]==null)t[a]=r[a];else if(UW(r[a])){if(!UW(t[a]))t[a]={};if(r[a]!=null){if(r[a].$isSingleNested&&t[a].$isMongooseDocumentArray||r[a].$isMongooseDocumentArray&&t[a].$isSingleNested||r[a].$isMongooseDocumentArrayElement&&t[a].$isMongooseDocumentArrayElement)continue;else if(r[a].instanceOfSchema){if(t[a].instanceOfSchema)f6e(t[a],r[a].clone(),!0);else t[a]=r[a].clone();continue}else if(d6e(r[a],"ObjectId")){t[a]=new p6e(r[a]);continue}else if(r[a]instanceof m6e){if(t[a]==null)t[a]=r[a].clone();if(!r[a].$isMongooseDocumentArray&&!r[a].$isSingleNested)continue}}e(t[a],r[a],n?n+"."+a:a,s)}}if(r?.instanceOfSchema)t.tree=Object.assign({},r.tree,t.tree)}});var g2=g(function(eFe,GW){var KW=C1(),y6e=LW(),g6e=Zt(),E6e=uy().defineKey,_6e=gr(),A6e=Do(),I1=we(),w6e=WW(),HW={toJSON:!0,toObject:!0,_id:!0,id:!0,virtuals:!0,methods:!0,statics:!0,defaultSort:!0};function O6e(e,t){if(e.encryptionType()==null&&t.encryptionType()==null)return;let r=s(n(e),n(t));for(let i of r){if(e._hasEncryptedField(i)&&t._hasEncryptedField(i))throw Error(`encrypted fields cannot be declared on both the base schema and the child schema in a discriminator. path=${i}`);if(e._hasEncryptedField(i)||t._hasEncryptedField(i))throw Error(`encrypted fields cannot have the same path as a non-encrypted field for discriminators. path=${i}`)}function n(i){return[...Object.keys(i.paths),...Object.keys(i.singleNestedPaths)]}function*s(i,o){let u=new Set(i);for(let a of o)if(u.has(a))yield a}}/*!
588
+ * ignore
589
+ */GW.exports=function(t,r,n,s,i,o,u){if(!n?.instanceOfSchema)throw Error("You must pass a valid discriminator Schema");if(r==="__proto__")throw Error('Discriminator name "__proto__" is not allowed');if(o=o==null?!0:o,t.schema.discriminatorMapping&&!t.schema.discriminatorMapping.isRoot)throw Error('Discriminator "'+r+'" can only be a discriminator of the root model');if(i){let h=_6e(t.base,"options.applyPluginsToDiscriminators",!1)||!o;t.base._applyPlugins(n,{skipTopLevel:!h})}else if(!o)y6e(n);let a=t.schema.options.discriminatorKey,c=t.schema.path(a);if(c!=null){if(!I1.hasUserDefinedProperty(c.options,"select"))c.options.select=!0;c.options.$skipDiscriminatorCheck=!0}else{let h={};h[a]={default:void 0,select:!0,$skipDiscriminatorCheck:!0},h[a][t.schema.options.typeKey]=String,t.schema.add(h),E6e({prop:a,prototype:t.prototype,options:t.schema.options})}if(n.path(a)&&n.path(a).options.$skipDiscriminatorCheck!==!0)throw Error('Discriminator "'+r+'" cannot have field with name "'+a+'"');let l=r;if(typeof s==="string"&&s.length||s!=null)l=s;O6e(t.schema,n);function f(h,d){if(h._baseSchema=d,d.paths._id&&d.paths._id.options&&!d.paths._id.options.auto)h.remove("_id");let p=Object.keys(d.paths),m=[];for(let O of p){if(h.nested[O]){m.push(O);continue}if(O.indexOf(".")===-1)continue;let x=O.split(".").slice(0,-1),v="";for(let P of x)if(v+=(v.length?".":"")+P,h.paths[v]instanceof KW||h.singleNestedPaths[v]instanceof KW)m.push(O)}h.obj={...h.obj},w6e(h,d),h._gatherChildSchemas();for(let O of m)delete h.paths[O];h._defaultsCache=null,h._pathsWithTransforms=void 0,h._hasSelectedPaths=void 0,h.childSchemas.forEach((O)=>{O.model.prototype.$__setSchema(O.schema)});let E={};if(E[a]={default:l,select:!0,set:function(O){if(O===l||Array.isArray(l)&&I1.deepEqual(O,l))return l;throw Error(`Can't set discriminator key "`+a+'"')},$skipDiscriminatorCheck:!0},E[a][h.options.typeKey]=c?c.options[h.options.typeKey]:String,h.add(E),h.discriminatorMapping={key:a,value:l,isRoot:!1},d.options.collection)h.options.collection=d.options.collection;let y=h.options.toJSON,_=h.options.toObject,w=h.options._id,C=h.options.id,A=Object.keys(h.options);h.options.discriminatorKey=d.options.discriminatorKey;let M=h._userProvidedOptions;for(let O of A)if(!HW[O]){if(O in M&&!I1.deepEqual(h.options[O],d.options[O]))throw Error("Can't customize discriminator option "+O+" (can only modify "+Object.keys(HW).join(", ")+")")}h.options=g6e(d.options);for(let O of Object.keys(M))h.options[O]=M[O];if(y)h.options.toJSON=y;if(_)h.options.toObject=_;if(typeof w<"u")h.options._id=w;if(h.options.id=C,o)h.s.hooks=t.schema.s.hooks.merge(h.s.hooks);if(i)h.plugins=Array.prototype.slice.call(d.plugins);h.callQueue=d.callQueue.concat(h.callQueue),delete h._requiredpaths}if(f(n,t.schema),!t.discriminators)t.discriminators={};if(!t.schema.discriminatorMapping)t.schema.discriminatorMapping={key:a,value:null,isRoot:!0};if(!t.schema.discriminators)t.schema.discriminators={};if(t.schema.discriminators[r]=n,A6e(t.discriminators,r)&&!n.options.overwriteModels&&!u)throw Error('Discriminator with name "'+r+'" already exists');return n}});var E2=g(function(tFe,YW){var S6e=qs(),C6e=Ei();YW.exports=function(t,r,n){let s=t.schema.options.discriminatorKey,i=r?.[s];if(i==null)i=n;if(t.discriminators&&i!=null){let o=S6e(t.discriminators,i);if(o)t=o;else{let u=C6e(t.discriminators,i);if(u)t=u}}return t}});var O4=g(function(rFe,QW){var b6e=$A();QW.exports=function(t,r){if(r?._id==null)return t;if(t=t.clone(),!r._id)t.remove("_id"),t.options._id=!1;else if(!t.paths._id)b6e(t),t.options._id=!0;return t}});var C4=g(function(nFe,JW){/*!
590
+ * Module dependencies.
591
+ */var D6e=Le();class S4 extends D6e{constructor(e,t){let r=`Cannot create use schema for property "${e}" because the schema has the ${t} option enabled.`;super(r)}}Object.defineProperty(S4.prototype,"name",{value:"InvalidSchemaOptionError"});/*!
592
+ * exports
593
+ */JW.exports=S4});var T4=g(function(sFe,tK){/*!
594
+ * Module dependencies.
595
+ */var XW=kn(),b4=L("events").EventEmitter,T6e=ey(),M6e=xW(),Os=_r(),x6e=ny(),P6e=G0(),ZW=Pf().castToNumber,F6e=g2(),$1=n4(),D4=E2(),B6e=Ry(),N6e=O4(),I6e=Ui().internalToObjectOptions,$6e=tc(),A2=we(),R6e=C4(),v6e=yi(),_2;tK.exports=Wr;function Wr(e,t,r,n){if(e.options.timeseries)throw new R6e(t,"timeseries");let s=Wr.defaultOptions?._id;if(s!=null)r=r||{},r._id=s;e=N6e(e,r),this.Constructor=eK(e,null,r),this.Constructor.path=t,this.Constructor.prototype.$basePath=t,this.schema=e,this.$isSingleNested=!0,this.base=e.base,Os.call(this,t,r,"Embedded",n)}/*!
596
+ * ignore
597
+ */Wr.prototype=Object.create(Os.prototype);Wr.prototype.constructor=Wr;Wr.prototype.OptionsConstructor=M6e;/*!
598
+ * ignore
599
+ */function eK(e,t,r){_2||(_2=dy());let n=function(o,u,a){if(this.$__parent=a,_2.apply(this,arguments),a==null)return;this.$session(a.$session())};e.plugin(B6e,{deduplicate:!0});let s=t?.prototype??_2.prototype;n.prototype=Object.create(s),n.prototype.$__setSchema(e),n.prototype.constructor=n,n.prototype.$__schemaTypeOptions=r,n.$__required=r?.required,n.base=e.base,n.schema=e,n.$isSingleNested=!0,n.events=new b4,n.prototype.toBSON=function(){return this.toObject(I6e)};for(let i in e.methods)n.prototype[i]=e.methods[i];for(let i in e.statics)n[i]=e.statics[i];for(let i in b4.prototype)n[i]=b4.prototype[i];return n}/*!
600
+ * ignore
601
+ */var xo={...Os.prototype.$conditionalHandlers};xo.$geoWithin=function(t,r){return{$geometry:this.castForQuery(null,t.$geometry,r)}};/*!
602
+ * ignore
603
+ */xo.$near=xo.$nearSphere=$1.cast$near;xo.$within=xo.$geoWithin=$1.cast$within;xo.$geoIntersects=$1.cast$geoIntersects;xo.$minDistance=ZW;xo.$maxDistance=ZW;xo.$exists=P6e;Object.defineProperty(Wr.prototype,"$conditionalHandlers",{enumerable:!1,value:xo});Wr.prototype.cast=function(e,t,r,n,s){if(e?.$isSingleNested&&e.parent===t)return e;if(!r&&e!=null&&(typeof e!=="object"||Array.isArray(e)))throw new T6e(this.path,e);let i=this.schema.path(this.schema.options.discriminatorKey),o=i==null?null:i.getDefault(t),u=D4(this.Constructor,e,o),a,c=t?.$__?.selected,l=this.path,f=c==null?null:Object.keys(c).reduce((h,d)=>{if(d.startsWith(l+"."))h=h||{},h[d.substring(l.length+1)]=c[d];return h},null);if(r){if(a=new u(void 0,f,t,{defaults:!1}),delete a.$__.defaults,s.path!=null){let{path:d,...p}=s;s=p}a.$init(e,s);let h=$6e(f);x6e(a,f,h)}else{if(s=Object.assign({},s,{priorDoc:n}),A2.hasOwnKeys(e)===!1)return new u({},f,t,s);return new u(e,f,t,s)}return a};Wr.prototype.castForQuery=function(e,t,r,n){let s;if(e!=null){if(s=v6e(this.$conditionalHandlers,e),!s)throw Error("Can't use "+e);return s.call(this,t)}if(t==null)return t;let i=D4(this.Constructor,t);if(t instanceof i)return t;if(this.options.runSetters)t=this._applySetters(t,r);let o=n?.strict??void 0;try{t=new i(t,o)}catch(u){if(!(u instanceof XW))throw new XW("Embedded",t,this.path,u,this);throw u}return t};Wr.prototype.doValidate=async function(t,r,n){let s=D4(this.Constructor,t);if(t&&!(t instanceof s))t=new s(t,null,r?.$__!=null?r:null);if(n?.skipSchemaValidators){if(!t)return;return t.validate()}if(await Os.prototype.doValidate.call(this,t,r,n),t!=null)await t.validate()};Wr.prototype.doValidateSync=function(e,t,r){if(!r?.skipSchemaValidators){let n=Os.prototype.doValidateSync.call(this,e,t);if(n)return n}if(!e)return;return e.$__validateSync()};Wr.prototype.discriminator=function(e,t,r){r=r||{};let n=A2.isPOJO(r)?r.value:r,s=typeof r.clone==="boolean"?r.clone:!0;if(t.instanceOfSchema&&s)t=t.clone();if(t=F6e(this.Constructor,e,t,n,null,null,r.overwriteExisting),this.parentSchema!=null)this.parentSchema._hasSelectedPaths=!0;return this.Constructor.discriminators[e]=eK(t,this.Constructor),this.Constructor.discriminators[e]};/*!
604
+ * ignore
605
+ */Wr.defaultOptions={};Wr.set=Os.set;Wr.setters=[];Wr.get=Os.get;/*!
606
+ * ignore
607
+ */Wr.prototype.toJSON=function(){return{path:this.path,options:this.options}};/*!
608
+ * ignore
609
+ */Wr.prototype.clone=function(){let e=new this.constructor(this.schema,this.path,{...this.options,_skipApplyDiscriminators:!0},this.parentSchema);if(e.validators=this.validators.slice(),this.requiredValidator!==void 0)e.requiredValidator=this.requiredValidator;return e.Constructor.discriminators=Object.assign({},this.Constructor.discriminators),e._appliedDiscriminators=this._appliedDiscriminators,e};Wr.prototype.toJSONSchema=function(t){return{...this.schema.toJSONSchema(t),...this._createJSONSchemaTypeDefinition("object","object",t)}}});var M4=g(function(iFe,nK){/*!
610
+ * Module dependencies.
611
+ */var k6e=Le(),Si=_r(),w2=T4(),rK=E2();function Oi(e,t,r,n){if(this.$parentSchemaType=r?.$parentSchemaType,!this.$parentSchemaType)throw new k6e("Cannot create DocumentArrayElement schematype without a parent");delete r.$parentSchemaType,Si.call(this,e,r,"DocumentArrayElement",n),this.$isMongooseDocumentArrayElement=!0,this.Constructor=r?.Constructor,this.schema=t}Oi.schemaName="DocumentArrayElement";Oi.defaultOptions={};Oi.set=Si.set;Oi.get=Si.get;/*!
612
+ * Inherits from SchemaType.
613
+ */Oi.prototype=Object.create(Si.prototype);Oi.prototype.constructor=Oi;Oi.prototype.cast=function(...e){return this.$parentSchemaType.cast(...e)[0]};Oi.prototype.doValidate=async function(t,r,n){let s=rK(this.Constructor,t);if(t&&!(t instanceof s))t=new s(t,r,null,null,n?.index??null);if(n?.skipSubdocumentValidation){if(n.skipSchemaValidators)return;return Si.prototype.doValidate.call(this,t,r,n)}return w2.prototype.doValidate.call(this,t,r,n)};Oi.prototype.doValidateSync=function(t,r,n){let s=rK(this.Constructor,t);if(t&&!(t instanceof s))t=new s(t,r,null,null,n?.index??null);if(n?.skipSubdocumentValidation){if(n.skipSchemaValidators)return;return Si.prototype.doValidateSync.call(this,t,r,n)}return w2.prototype.doValidateSync.call(this,t,r,n)};Oi.prototype.clone=function(){let e=Object.assign({},this.options,{$parentSchemaType:this.$parentSchemaType,Constructor:this.Constructor}),t=new this.constructor(this.path,this.schema,e,this.parentSchema);if(t.validators=this.validators.slice(),this.requiredValidator!==void 0)t.requiredValidator=this.requiredValidator;return t};/*!
614
+ * Module exports.
615
+ */nK.exports=Oi});var iK=g(function(oFe,sK){var q6e=As();class $f extends q6e{}var x4=vs();Object.defineProperty($f.prototype,"excludeIndexes",x4);Object.defineProperty($f.prototype,"_id",x4);Object.defineProperty($f.prototype,"discriminators",x4);/*!
616
+ * ignore
617
+ */sK.exports=$f});var pK=g(function(uFe,dK){/*!
618
+ * Module dependencies.
619
+ */var j6e=qs(),oK=kn(),L6e=M4(),P4=L("events").EventEmitter,R1=Xy(),U6e=iK(),Po=_r(),uK=ac(),V6e=g2(),aK=O4(),z6e=cy(),W6e=T1(),Vn=we(),O2=E2(),K6e=Ry(),H6e=C4(),cK=le().arrayAtomicsSymbol,F4=le().arrayPathSymbol,hK=le().documentArrayParent,iu,hc;function or(e,t,r,n,s){if(t.options?.timeseries)throw new H6e(e,"timeseries");let i=or.defaultOptions?._id;if(i!=null)n=n||{},n._id=i;if(n?._id!=null)t=aK(t,n);else if(r?._id!=null)t=aK(t,r);let o=fK(t,r);o.prototype.$basePath=e,o.path=e;let u=this,a=new L6e(e+".$",t,{...n||{},$parentSchemaType:u,Constructor:o});R1.call(this,e,a,r,null,s),this.schema=t,this.schemaOptions=n||{},this.$isMongooseDocumentArray=!0,this.Constructor=o,o.base=t.base;let c=this.defaultValue;if(!("defaultValue"in this)||c!=null)this.default(function(){let l=c.call(this);if(l!=null&&!Array.isArray(l))l=[l];return l})}or.schemaName="DocumentArray";or.options={castNonArrays:!0};/*!
620
+ * Inherits from SchemaArray.
621
+ */or.prototype=Object.create(R1.prototype);or.prototype.constructor=or;or.prototype.OptionsConstructor=U6e;Object.defineProperty(or.prototype,"$conditionalHandlers",{enumerable:!1,value:{...R1.prototype.$conditionalHandlers}});/*!
622
+ * ignore
623
+ */function fK(e,t,r){hc||(hc=_1());function n(){hc.apply(this,arguments);let i=this[hK];if(i==null)return;this.$session(i.$session())}e.plugin(K6e,{deduplicate:!0});let s=r?.prototype??hc.prototype;n.prototype=Object.create(s),n.prototype.$__setSchema(e),n.schema=e,n.prototype.constructor=n,n.$isArraySubdocument=!0,n.events=new P4,n.base=e.base;for(let i in e.methods)n.prototype[i]=e.methods[i];for(let i in e.statics)n[i]=e.statics[i];for(let i in P4.prototype)n[i]=P4.prototype[i];return n.options=t,n}or.prototype.discriminator=function(e,t,r){if(typeof e==="function")e=Vn.getFunctionName(e);r=r||{};let n=Vn.isPOJO(r)?r.value:r,s=typeof r.clone==="boolean"?r.clone:!0;if(t.instanceOfSchema&&s)t=t.clone();if(t=V6e(this.Constructor,e,t,n,null,null,r?.overwriteExisting),this.parentSchema!=null)this.parentSchema._hasSelectedPaths=!0;let i=fK(t,null,this.Constructor);return i.baseCasterConstructor=this.Constructor,Object.defineProperty(i,"name",{value:e}),this.Constructor.discriminators[e]=i,this.Constructor.discriminators[e]};or.prototype.doValidate=async function(t,r,n){iu||(iu=sc());let s;try{await Po.prototype.doValidate.call(this,t,r)}catch(u){s=u}if(n?.updateValidator){if(s!=null)throw s;return}if(!Vn.isMongooseDocumentArray(t))t=new iu(t,this.path,r);let i=[];for(let u=0;u<t.length;++u){let a=t[u];if(a==null)continue;if(!(a instanceof hc)){let l=O2(this.Constructor,t[u]);a=t[u]=new l(a,t,void 0,void 0,u)}if(n?.validateModifiedOnly&&!a.$isNew&&!a.$isModified())continue;let c=a.$isNew&&n?.validateModifiedOnly?{...n,validateModifiedOnly:!1}:n;i.push(a.validate(null,c))}let o;try{await Promise.all(i)}catch(u){o=u}if(s!=null)throw s;if(o!=null)throw o};or.prototype.doValidateSync=function(e,t,r){let n=Po.prototype.doValidateSync.call(this,e,t),s=e?.length,i=n;if(!s)return i;for(let o=0,u=s;o<u;++o){let a=e[o];if(!a)continue;if(!(a instanceof hc)){let f=O2(this.Constructor,e[o]);a=e[o]=new f(a,e,void 0,void 0,o)}if(r?.validateModifiedOnly&&!a.$isNew&&!a.$isModified())continue;let c=a.$isNew&&r?.validateModifiedOnly?{...r,validateModifiedOnly:!1}:r,l=a.$__validateSync(c);if(l&&i==null)i=l}return i};/*!
624
+ * ignore
625
+ */or.prototype.getDefault=function(e,t,r){let n=typeof this.defaultValue==="function"?this.defaultValue.call(e):this.defaultValue;if(n==null)return n;if(r?.skipCast)return n;if(iu||(iu=sc()),!Array.isArray(n))n=[n];n=new iu(n,this.path,e);for(let s=0;s<n.length;++s){let o=new(O2(this.Constructor,n[s]))({},n,void 0,void 0,s);o.$init(n[s]),o.isNew=!0,Object.assign(o.$__.activePaths.default,o.$__.activePaths.init),o.$__.activePaths.init={},n[s]=o}return n};var G6e=Object.freeze({transform:!1,virtuals:!1}),lK=Object.freeze({skipId:!1,willInit:!0});or.prototype.cast=function(e,t,r,n,s){if(iu||(iu=sc()),e?.[F4]!=null&&e===n)return e;let i,o;s=s||{};let u=s.path||this.path;if(!Array.isArray(e)){let l=this.options.castNonArrays??or.options.castNonArrays;if(!r&&!l)throw new oK("DocumentArray",e,this.path,null,this);if(!!t&&r)t.markModified(u);return this.cast([e],t,r,n,s)}if(!s.skipDocumentArrayCast||Vn.isMongooseDocumentArray(e))e=new iu(e,u,t,this);if(n!=null)e[cK]=n[cK]||{};if(s.arrayPathIndex!=null)e[F4]=u+"."+s.arrayPathIndex;let a=Vn.isMongooseDocumentArray(e)?e.__array:e,c=a.length;for(let l=0;l<c;++l){if(!a[l])continue;let f=O2(this.Constructor,a[l]),h=z6e(a[l],!0);if(a[l]!==h)a[l]=h;if(a[l]instanceof hc){if(a[l][hK]!==t||a[l].__index!=null&&a[l].__index!==l)if(r){let d=new f(null,e,lK,i,l);a[l]=d.$init(a[l])}else{let d=new f(a[l],e,void 0,void 0,l);a[l]=d}if(a[l].__index==null)a[l].$setIndex(l)}else if(a[l]!=null)if(r){if(t)i||(i=Y6e(this,t.$__.selected,r));else i=!0;if(o=new f(null,e,lK,i,l),s.path!=null||s.arrayPathIndex!=null){let{path:d,arrayPathIndex:p,...m}=s;s=m}a[l]=o.$init(a[l],s)}else if(o=n?.[l],o?._doc!=null&&a[l]._id!=null&&Vn.deepEqual(a[l]._id,o._doc._id)&&Vn.deepEqual(o.toObject(G6e),a[l]))a[l]=o;else try{o=new f(a[l],e,void 0,void 0,l),a[l]=o}catch(d){throw new oK("embedded",a[l],e[F4],d,this)}}if(Vn.isMongooseDocumentArray(n)){for(let l=0;l<c;++l)if(a[l]!=null&&a[l]===n[l])a[l].__parentArray=e}return e};/*!
626
+ * ignore
627
+ */or.prototype.clone=function(){let e=Object.assign({},this.options),t=new this.constructor(this.path,this.schema,e,this.schemaOptions,this.parentSchema);if(t.validators=this.validators.slice(),this.requiredValidator!==void 0)t.requiredValidator=this.requiredValidator;return t.Constructor.discriminators=Object.assign({},this.Constructor.discriminators),t._appliedDiscriminators=this._appliedDiscriminators,t};/*!
628
+ * ignore
629
+ */or.prototype.applyGetters=function(e,t){return Po.prototype.applyGetters.call(this,e,t)};function Y6e(e,t,r){if(!(r&&t))return;let n=e.path+".",s=Object.keys(t),i=s.length,o={},u,a,c;while(i--)if(a=s[i],a.startsWith(n)){if(c=a.substring(n.length),c==="$")continue;if(c.startsWith("$."))c=c.substring(2);u||(u=!0),o[c]=t[a]}return u&&o||void 0}/*!
630
+ * ignore
631
+ */or.defaultOptions={};or.set=Po.set;or.setters=[];or.get=Po.get;/*!
632
+ * Handle casting $elemMatch operators
633
+ */or.prototype.$conditionalHandlers.$elemMatch=Q6e;function Q6e(e,t){let r=Object.keys(e),n=r.length;for(let a=0;a<n;++a){let c=r[a],l=e[c];if(W6e(c)&&l!=null)e[c]=this.castForQuery(c,l,t)}let s=this?.Constructor?.schema?.options?.discriminatorKey,i=this?.Constructor?.schema?.discriminators||{},o=s!=null&&e[s]!=null?j6e(i,e[s]):null;if(o!=null)return uK(o,e,null,this?.$$context);let u=this.Constructor.schema??t.schema;return uK(u,e,null,this?.$$context)}or.prototype.toJSONSchema=function(t){let r=this._createJSONSchemaTypeDefinition("object","object",{...t,_overrideRequired:!1});return{...this._createJSONSchemaTypeDefinition("array","array",t),items:{...r,...this.schema.toJSONSchema(t)}}};/*!
634
+ * Module exports.
635
+ */dK.exports=or});var yK=g(function(aFe,mK){var v1=L("assert"),k1=Se(),J6e=vn();mK.exports=function(t){if(t==null||t==="")return null;let r;if(J6e(t,"Long"))r=t.toNumber();else if(typeof t==="string")try{return r=k1.Double.fromString(t),r}catch{v1.ok(!1)}else if(typeof t==="object"){if(Array.isArray(t))v1.ok(!1);let n=t.valueOf()??t.toString();if(typeof n==="string")try{return r=k1.Double.fromString(n),r}catch{v1.ok(!1)}else r=Number(n)}else r=Number(t);return new k1.Double(r)}});var EK=g(function(cFe,gK){/*!
636
+ * Module dependencies.
637
+ */var X6e=kn(),Ci=_r(),Z6e=yK();function jr(e,t,r,n){Ci.call(this,e,t,"Double",n)}jr.schemaName="Double";jr.defaultOptions={};/*!
638
+ * Inherits from SchemaType.
639
+ */jr.prototype=Object.create(Ci.prototype);jr.prototype.constructor=jr;/*!
640
+ * ignore
641
+ */jr._cast=Z6e;jr.set=Ci.set;jr.setters=[];jr.get=Ci.get;/*!
642
+ * ignore
643
+ */jr._defaultCaster=(e)=>{if(e!=null){if(e._bsontype!=="Double")throw Error()}return e};jr.cast=function(t){if(arguments.length===0)return this._cast;if(t===!1)t=this._defaultCaster;return this._cast=t,this._cast};/*!
644
+ * ignore
645
+ */jr._checkRequired=(e)=>e!=null;jr.checkRequired=Ci.checkRequired;jr.prototype.checkRequired=function(e){return this.constructor._checkRequired(e)};jr.prototype.cast=function(e){let t;if(typeof this._castFunction==="function")t=this._castFunction;else if(typeof this.constructor.cast==="function")t=this.constructor.cast();else t=jr.cast();try{return t(e)}catch(r){throw new X6e("Double",e,this.path,r,this)}};/*!
646
+ * ignore
647
+ */function S2(e){return this.cast(e)}var eAe={...Ci.prototype.$conditionalHandlers,$gt:S2,$gte:S2,$lt:S2,$lte:S2};Object.defineProperty(jr.prototype,"$conditionalHandlers",{enumerable:!1,value:eAe});jr.prototype.toJSONSchema=function(t){return this._createJSONSchemaTypeDefinition("number","double",t)};jr.prototype.autoEncryptionType=function(){return"double"};/*!
648
+ * Module exports.
649
+ */gK.exports=jr});var AK=g(function(lFe,_K){var tAe=vn(),C2=L("assert");_K.exports=function(t){if(t==null)return t;if(t==="")return null;if(Array.isArray(t))C2.ok(!1);let r=tAe(t,"Long")?t.toNumber():Number(t),n=2147483647,s=-2147483648;if(r===(r|0)&&r>=s&&r<=n)return r;C2.ok(!1)}});var SK=g(function(hFe,OK){/*!
650
+ * Module dependencies.
651
+ */var wK=kn(),bi=_r(),rAe=AK(),b2=xf(),nAe=yi();function Dr(e,t,r,n){bi.call(this,e,t,"Int32",n)}Dr.schemaName="Int32";Dr.defaultOptions={};/*!
652
+ * Inherits from SchemaType.
653
+ */Dr.prototype=Object.create(bi.prototype);Dr.prototype.constructor=Dr;/*!
654
+ * ignore
655
+ */Dr._cast=rAe;Dr.set=bi.set;Dr.setters=[];Dr.get=bi.get;/*!
656
+ * ignore
657
+ */Dr._defaultCaster=(e)=>{if(e!=null){if(typeof e!=="number"||e!==(e|0)||e<-2147483648||e>2147483647)throw Error()}return e};Dr.cast=function(t){if(arguments.length===0)return this._cast;if(t===!1)t=this._defaultCaster;return this._cast=t,this._cast};/*!
658
+ * ignore
659
+ */Dr._checkRequired=(e)=>e!=null;Dr.checkRequired=bi.checkRequired;Dr.prototype.checkRequired=function(e){return this.constructor._checkRequired(e)};Dr.prototype.cast=function(e){let t;if(typeof this._castFunction==="function")t=this._castFunction;else if(typeof this.constructor.cast==="function")t=this.constructor.cast();else t=Dr.cast();try{return t(e)}catch(r){throw new wK("Int32",e,this.path,r,this)}};/*!
660
+ * ignore
661
+ */var sAe={...bi.prototype.$conditionalHandlers,$gt:D2,$gte:D2,$lt:D2,$lte:D2,$bitsAllClear:b2,$bitsAnyClear:b2,$bitsAllSet:b2,$bitsAnySet:b2};Object.defineProperty(Dr.prototype,"$conditionalHandlers",{enumerable:!1,value:sAe});/*!
662
+ * ignore
663
+ */function D2(e,t){return this.castForQuery(null,e,t)}Dr.prototype.castForQuery=function(e,t,r){let n;if(e!=null){if(n=nAe(this.$conditionalHandlers,e),n)return n.call(this,t);return this.applySetters(t,r)}try{return this.applySetters(t,r)}catch(s){if(s instanceof wK&&s.path===this.path&&this.$fullPath!=null)s.path=this.$fullPath;throw s}};Dr.prototype.toJSONSchema=function(t){return this._createJSONSchemaTypeDefinition("number","int",t)};Dr.prototype.autoEncryptionType=function(){return"int"};/*!
664
+ * Module exports.
665
+ */OK.exports=Dr});var bK=g(function(fFe,CK){var iAe=As();class B4 extends iAe{}var oAe=vs();Object.defineProperty(B4.prototype,"of",oAe);CK.exports=B4});var TK=g(function(dFe,DK){/*!
666
+ * ignore
667
+ */var N4=Wy(),uAe=bK(),I4=_r(),aAe=Le(),cAe=ic(),Di=we();class fc extends I4{constructor(e,t,r,n){super(e,t,"Map",n);this.$isSchemaMap=!0,this._createNestedSchemaType(n,e,t,r)}cast(e,t,r,n,s){if(e instanceof N4)return e;let i=s?.path??this.path;if(r){let o=new N4({},i,t,this.$__schemaType);if(e instanceof global.Map)for(let u of e.keys()){let a=e.get(u);if(a==null)a=o.$__schemaType._castNullish(a);else a=o.$__schemaType.cast(a,t,!0,null,{...s,path:i+"."+u});o.$init(u,a)}else for(let u of Object.keys(e)){let a=e[u];if(a==null)a=o.$__schemaType._castNullish(a);else a=o.$__schemaType.cast(a,t,!0,null,{...s,path:i+"."+u});o.$init(u,a)}return o}return new N4(e,i,t,this.$__schemaType)}clone(){let e=super.clone();if(this.$__schemaType!=null)e.$__schemaType=this.$__schemaType.clone();return e}getEmbeddedSchemaType(){return this.$__schemaType}toJSONSchema(e){let t=this.getEmbeddedSchemaType(),r=this._createJSONSchemaTypeDefinition("object","object",e);return r.additionalProperties=t.toJSONSchema(e),r}autoEncryptionType(){return"object"}}fc.set=I4.set;fc.schemaName="Map";fc.prototype.OptionsConstructor=uAe;fc.defaultOptions={};/*!
668
+ * ignore
669
+ */fc.prototype._createNestedSchemaType=function(t,r,n,s){let i=r+".$*",o={type:{}};if(Di.hasUserDefinedProperty(n,"of")){if(Di.isPOJO(n.of)&&Di.hasOwnKeys(n.of)&&!Di.hasUserDefinedProperty(n.of,t.options.typeKey))o={[t.options.typeKey]:new cAe(n.of)};else if(Di.isPOJO(n.of))o=Object.assign({},n.of);else o={[t.options.typeKey]:n.of};if(o[t.options.typeKey]&&o[t.options.typeKey].instanceOfSchema)o[t.options.typeKey].eachPath((c,l)=>{if(l.options.select===!0||l.options.select===!1)throw new aAe('Cannot use schema-level projections (`select: true` or `select: false`) within maps at path "'+r+"."+c+'"')});if(Di.hasUserDefinedProperty(n,"ref"))o.ref=n.ref}this.$__schemaType=t.interpretAsType(i,o,s)};DK.exports=fc});var PK=g(function(pFe,xK){var lAe=As();class T2 extends lAe{}var MK=vs();Object.defineProperty(T2.prototype,"auto",MK);Object.defineProperty(T2.prototype,"populate",MK);/*!
670
+ * ignore
671
+ */xK.exports=T2});var NK=g(function(mFe,BK){var FK=vn(),$4=pa();BK.exports=function(t){if(t==null)return t;if(FK(t,"ObjectId"))return t;if(t._id){if(FK(t._id,"ObjectId"))return t._id;if(t._id.toString instanceof Function)return new $4(t._id.toString())}if(t.toString instanceof Function)return new $4(t.toString());return new $4(t)}});var RK=g(function(yFe,$K){/*!
672
+ * Module dependencies.
673
+ */var hAe=PK(),ln=_r(),fAe=NK(),dAe=Rn(),v4=pa(),k4=vn(),x2=we(),pAe=ln.CastError,R4;function ur(e,t,r,n){let s=typeof e==="string"&&e.length===24&&/^[a-f0-9]+$/i.test(e),i=t?.suppressWarning;if((s||typeof e>"u")&&!i)x2.warn("mongoose: To create a new ObjectId please try `Mongoose.Types.ObjectId` instead of using `Mongoose.Schema.Types.ObjectId`. Set the `suppressWarning` option if you're trying to create a hex char path in your schema.");ln.call(this,e,t,"ObjectId",n)}ur.schemaName="ObjectId";ur.defaultOptions={};/*!
674
+ * Inherits from SchemaType.
675
+ */ur.prototype=Object.create(ln.prototype);ur.prototype.constructor=ur;ur.prototype.OptionsConstructor=hAe;ur.get=ln.get;ur.set=ln.set;ur.setters=[];ur.prototype.auto=function(e){if(e)this.default(IK),this.set(yAe);return this};/*!
676
+ * ignore
677
+ */ur._checkRequired=(e)=>k4(e,"ObjectId");/*!
678
+ * ignore
679
+ */ur._cast=fAe;ur.cast=function(t){if(arguments.length===0)return this._cast;if(t===!1)t=this._defaultCaster;return this._cast=t,this._cast};/*!
680
+ * ignore
681
+ */ur._defaultCaster=(e)=>{if(!k4(e,"ObjectId"))throw Error(e+" is not an instance of ObjectId");return e};ur.checkRequired=ln.checkRequired;ur.prototype.checkRequired=function(t,r){if(ln._isRef(this,t,r,!0))return!!t;return(typeof this.constructor.checkRequired==="function"?this.constructor.checkRequired():ur.checkRequired())(t)};ur.prototype.cast=function(e,t,r,n,s){if(!k4(e,"ObjectId")&&ln._isRef(this,e,t,r)){if((dAe(e)||"").toLowerCase()==="objectid")return new v4(e.toHexString());if(e==null||x2.isNonBuiltinObject(e))return this._castRef(e,t,r,s)}let i;if(typeof this._castFunction==="function")i=this._castFunction;else if(typeof this.constructor.cast==="function")i=this.constructor.cast();else i=ur.cast();try{return i(e)}catch(o){throw new pAe("ObjectId",e,this.path,o,this)}};/*!
682
+ * ignore
683
+ */function M2(e){return this.cast(e)}var mAe={...ln.prototype.$conditionalHandlers,$gt:M2,$gte:M2,$lt:M2,$lte:M2};Object.defineProperty(ur.prototype,"$conditionalHandlers",{enumerable:!1,value:mAe});/*!
684
+ * ignore
685
+ */function IK(){return new v4}IK.$runBeforeSetters=!0;function yAe(e){if(R4||(R4=bo()),this instanceof R4){if(e===void 0)return new v4}return e}ur.prototype.toJSONSchema=function(t){let r=this._createJSONSchemaTypeDefinition("string","objectId",t);if(!t?.useBsonType)r.pattern="^[A-Fa-f0-9]{24}$";return r};ur.prototype.autoEncryptionType=function(){return"objectId"};/*!
686
+ * Module exports.
687
+ */$K.exports=ur});var kK=g(function(gFe,vK){var gAe=As();class Ti extends gAe{}var Fo=vs();Object.defineProperty(Ti.prototype,"enum",Fo);Object.defineProperty(Ti.prototype,"match",Fo);Object.defineProperty(Ti.prototype,"lowercase",Fo);Object.defineProperty(Ti.prototype,"trim",Fo);Object.defineProperty(Ti.prototype,"uppercase",Fo);Object.defineProperty(Ti.prototype,"minLength",Fo);Object.defineProperty(Ti.prototype,"minlength",Fo);Object.defineProperty(Ti.prototype,"maxLength",Fo);Object.defineProperty(Ti.prototype,"maxlength",Fo);Object.defineProperty(Ti.prototype,"populate",Fo);/*!
688
+ * ignore
689
+ */vK.exports=Ti});var q4=g(function(EFe,LK){/*!
690
+ * Module dependencies.
691
+ */var hn=_r(),Ss=Rs(),EAe=kK(),_Ae=Hy(),P2=we(),AAe=vn(),wAe=yi(),jK=hn.CastError;function at(e,t,r,n){this.enumValues=[],this.regExp=null,hn.call(this,e,t,"String",n)}at.schemaName="String";at.defaultOptions={};/*!
692
+ * Inherits from SchemaType.
693
+ */at.prototype=Object.create(hn.prototype);at.prototype.constructor=at;Object.defineProperty(at.prototype,"OptionsConstructor",{configurable:!1,enumerable:!1,writable:!1,value:EAe});/*!
694
+ * ignore
695
+ */at._cast=_Ae;at.cast=function(t){if(arguments.length===0)return this._cast;if(t===!1)t=this._defaultCaster;return this._cast=t,this._cast};/*!
696
+ * ignore
697
+ */at._defaultCaster=(e)=>{if(e!=null&&typeof e!=="string")throw Error();return e};at.get=hn.get;at.set=hn.set;at.setters=[];/*!
698
+ * ignore
699
+ */at._checkRequired=(e)=>(e instanceof String||typeof e==="string")&&e.length;at.checkRequired=hn.checkRequired;at.prototype.enum=function(){if(this.enumValidator)this.validators=this.validators.filter(function(n){return n.validator!==this.enumValidator},this),this.enumValidator=!1;if(arguments[0]==null||arguments[0]===!1)return this.enumValues=[],delete this.options.enum,this;let e,t;if(P2.isObject(arguments[0]))if(Array.isArray(arguments[0].values))e=arguments[0].values,t=arguments[0].message;else e=P2.object.vals(arguments[0]),t=Ss.messages.String.enum;else e=arguments,t=Ss.messages.String.enum;for(let n of e)if(n!==void 0)this.enumValues.push(this.cast(n));let r=this.enumValues;return this.enumValidator=function(n){return n==null||~r.indexOf(n)},this.validators.push({validator:this.enumValidator,message:t,type:"enum",enumValues:r}),this};at.prototype.lowercase=function(e){if(arguments.length>0&&!e)return this;return this.set((t)=>{if(typeof t!=="string")t=this.cast(t);if(t)return t.toLowerCase();return t})};at.prototype.uppercase=function(e){if(arguments.length>0&&!e)return this;return this.set((t)=>{if(typeof t!=="string")t=this.cast(t);if(t)return t.toUpperCase();return t})};at.prototype.trim=function(e){if(arguments.length>0&&!e)return this;return this.set((t)=>{if(typeof t!=="string")t=this.cast(t);if(t)return t.trim();return t})};at.prototype.minlength=function(e,t){if(this.minlengthValidator)this.validators=this.validators.filter(function(r){return r.validator!==this.minlengthValidator},this);if(e!=null){let r=t||Ss.messages.String.minlength;if(typeof r==="string")r=r.replace(/{MINLENGTH}/,e);this.validators.push({validator:this.minlengthValidator=function(n){return n===null||n.length>=e},message:r,type:"minlength",minlength:e})}return this};at.prototype.minLength=at.prototype.minlength;at.prototype.maxlength=function(e,t){if(this.maxlengthValidator)this.validators=this.validators.filter(function(r){return r.validator!==this.maxlengthValidator},this);if(e!=null){let r=t||Ss.messages.String.maxlength;if(typeof r!=="function")r=r.replace(/{MAXLENGTH}/,e);this.validators.push({validator:this.maxlengthValidator=function(n){return n===null||n.length<=e},message:CAe(r),type:"maxlength",maxlength:e})}return this};at.prototype.maxLength=at.prototype.maxlength;at.prototype.match=function(t,r){let n=r||Ss.messages.String.match,s=function(i){if(!t)return!1;return t.lastIndex=0,i!=null&&i!==""?t.test(i):!0};return this.validators.push({validator:s,message:n,type:"regexp",regexp:t}),this};at.prototype.checkRequired=function(t,r){if(typeof t==="object"&&hn._isRef(this,t,r,!0))return t!=null;return(typeof this.constructor.checkRequired==="function"?this.constructor.checkRequired():at.checkRequired())(t)};at.prototype.cast=function(e,t,r,n,s){if(typeof e!=="string"&&hn._isRef(this,e,t,r))return this._castRef(e,t,r,s);let i;if(typeof this._castFunction==="function")i=this._castFunction;else if(typeof this.constructor.cast==="function")i=this.constructor.cast();else i=at.cast();try{return i(e)}catch{throw new jK("string",e,this.path,null,this)}};/*!
700
+ * ignore
701
+ */function Rf(e,t){return this.castForQuery(null,e,t)}/*!
702
+ * ignore
703
+ */function OAe(e,t){let r=this;if(!Array.isArray(e))return[this.castForQuery(null,e,t)];return e.map(function(n){return r.castForQuery(null,n,t)})}/*!
704
+ * ignore
705
+ */function qK(e){if(e==null)return this._castNullish(e);return this.cast(e,this)}var SAe={...hn.prototype.$conditionalHandlers,$all:OAe,$gt:Rf,$gte:Rf,$lt:Rf,$lte:Rf,$options:qK,$regex:function(t){if(Object.prototype.toString.call(t)==="[object RegExp]")return t;return qK.call(this,t)},$not:Rf};Object.defineProperty(at.prototype,"$conditionalHandlers",{enumerable:!1,value:SAe});at.prototype.castForQuery=function(e,t,r){let n;if(e!=null){if(n=wAe(this.$conditionalHandlers,e),!n)throw Error("Can't use "+e+" with String.");return n.call(this,t,r)}if(Object.prototype.toString.call(t)==="[object RegExp]"||AAe(t,"BSONRegExp"))return t;try{return this.applySetters(t,r)}catch(s){if(s instanceof jK&&s.path===this.path&&this.$fullPath!=null)s.path=this.$fullPath;throw s}};at.prototype.toJSONSchema=function(t){return this._addJSONSchemaEnum(this._createJSONSchemaTypeDefinition("string","string",t))};at.prototype.autoEncryptionType=function(){return"string"};/*!
706
+ * Module exports.
707
+ */LK.exports=at;function CAe(e){return function(t,r){if(typeof e==="function")return Ss.ValidatorError.prototype.formatMessage(e,t,r);if(typeof e==="string"&&typeof t.value==="string"&&t.value.length>30)t=Object.assign({},t,{value:t.value.slice(0,30)+"..."});return Ss.ValidatorError.prototype.formatMessage(e,t,r)}}});var UK=g(function(_Fe,U4){var j4=Se().UUID,L4=/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/i;U4.exports=function(t){if(t==null)return t;if(t instanceof j4)return t;if(typeof t==="string")if(L4.test(t))return new j4(t);else throw Error(`"${t}" is not a valid UUID string`);if(t.toString&&t.toString!==Object.prototype.toString){if(L4.test(t.toString()))return new j4(t.toString())}throw Error(`"${t}" cannot be casted to a UUID`)};U4.exports.UUID_FORMAT=L4});var KK=g(function(AFe,WK){/*!
708
+ * Module dependencies.
709
+ */var zn=_r(),VK=zn.CastError,z4=UK(),zK=we(),F2=xf(),bAe=yi(),DAe=z4.UUID_FORMAT;function TAe(e){let t;if(typeof e!=="string"&&e!=null)return t=e.toString("hex"),t.substring(0,8)+"-"+t.substring(8,12)+"-"+t.substring(12,16)+"-"+t.substring(16,20)+"-"+t.substring(20,32);return e}function Tr(e,t,r,n){zn.call(this,e,t,"UUID",n)}Tr.schemaName="UUID";Tr.defaultOptions={};/*!
710
+ * Inherits from SchemaType.
711
+ */Tr.prototype=Object.create(zn.prototype);Tr.prototype.constructor=Tr;/*!
712
+ * ignore
713
+ */Tr._cast=z4;Tr.get=zn.get;Tr.set=zn.set;Tr.setters=[];Tr.cast=function(t){if(arguments.length===0)return this._cast;if(t===!1)t=this._defaultCaster;return this._cast=t,this._cast};/*!
714
+ * ignore
715
+ */Tr._checkRequired=(e)=>e!=null;Tr.checkRequired=zn.checkRequired;Tr.prototype.checkRequired=function(t){if(Buffer.isBuffer(t))t=TAe(t);return t!=null&&DAe.test(t)};Tr.prototype.cast=function(e,t,r,n,s){if(zK.isNonBuiltinObject(e)&&zn._isRef(this,e,t,r))return this._castRef(e,t,r,s);let i;if(typeof this._castFunction==="function")i=this._castFunction;else if(typeof this.constructor.cast==="function")i=this.constructor.cast();else i=Tr.cast();try{return i(e)}catch(o){throw new VK(Tr.schemaName,e,this.path,o,this)}};/*!
716
+ * ignore
717
+ */function MAe(e){return this.cast(e)}/*!
718
+ * ignore
719
+ */function V4(e){return e.map((t)=>this.cast(t))}var xAe={...zn.prototype.$conditionalHandlers,$bitsAllClear:F2,$bitsAnyClear:F2,$bitsAllSet:F2,$bitsAnySet:F2,$all:V4,$in:V4,$ne:MAe,$nin:V4};Object.defineProperty(Tr.prototype,"$conditionalHandlers",{enumerable:!1,value:xAe});Tr.prototype.castForQuery=function(e,t,r){let n;if(e!=null){if(n=bAe(this.$conditionalHandlers,e),!n)throw Error("Can't use "+e+" with UUID.");return n.call(this,t,r)}try{return this.applySetters(t,r)}catch(s){if(s instanceof VK&&s.path===this.path&&this.$fullPath!=null)s.path=this.$fullPath;throw s}};Tr.prototype.toJSONSchema=function(t){return this._createJSONSchemaTypeDefinition("string","binData",t)};Tr.prototype.autoEncryptionType=function(){return"binData"};/*!
720
+ * Module exports.
721
+ */WK.exports=Tr});var GK=g(function(wFe,HK){var PAe=As();class W4 extends PAe{}var FAe=vs();Object.defineProperty(W4.prototype,"of",FAe);HK.exports=W4});var QK=g(function(OFe,YK){/*!
722
+ * ignore
723
+ */var BAe=GK(),NAe=_r(),q1=Symbol("firstValue");/*!
724
+ * ignore
725
+ */class vf extends NAe{constructor(e,t,r,n){super(e,t,"Union",n);if(!Array.isArray(t?.of)||t.of.length===0)throw Error("Union schema type requires an array of types");this.schemaTypes=t.of.map((s)=>n.interpretAsType(e,s,r)),this.$isSchemaUnion=!0}cast(e,t,r,n,s){let i=q1,o;for(let u=0;u<this.schemaTypes.length;++u)try{let a=this.schemaTypes[u].cast(e,t,r,n,s);if(a===e)return a;if(i===q1)i=a}catch(a){o=a}if(i!==q1)return i;throw o}applySetters(e,t,r,n,s){e=this._applySetters(e,t,r,n,s);let i=q1,o;for(let u=0;u<this.schemaTypes.length;++u)try{let a=this.schemaTypes[u]._applySetters(e,t,r,n,s);if(a==null)a=this.schemaTypes[u]._castNullish(a);else a=this.schemaTypes[u].cast(a,t,r,n,s);if(a===e)return a;if(i===q1)i=a}catch(a){o=a}if(i!==q1)return i;throw o}async doValidate(e,t,r){if(r&&r.skipSchemaValidators){if(e!=null&&typeof e.validate==="function")return e.validate();return}if(await super.doValidate(e,t,r),e!=null&&typeof e.validate==="function")await e.validate()}doValidateSync(e,t,r){if(!r||!r.skipSchemaValidators){let n=super.doValidateSync(e,t,r);if(n)return n}if(e!=null&&typeof e.$__validateSync==="function")return e.$__validateSync()}clone(){let e=super.clone();return e.schemaTypes=this.schemaTypes.map((t)=>t.clone()),e}toJSONSchema(e){let t=this.options.required&&typeof this.options.required!=="function",r={...e,_overrideRequired:!0},n=this.schemaTypes.map((s)=>s.toJSONSchema(r));if(t)return{anyOf:n};return{anyOf:[e?.useBsonType?{bsonType:"null"}:{type:"null"},...n]}}}vf.schemaName="Union";vf.defaultOptions={};vf.prototype.OptionsConstructor=BAe;YK.exports=vf});var Mf=g(function(IAe){/*!
726
+ * Module exports.
727
+ */IAe.Array=Xy();IAe.BigInt=uW();IAe.Boolean=lW();IAe.Buffer=pW();IAe.Date=OW();IAe.Decimal128=IAe.Decimal=TW();IAe.DocumentArray=pK();IAe.DocumentArrayElement=M4();IAe.Double=EK();IAe.Int32=SK();IAe.Map=TK();IAe.Mixed=C1();IAe.Number=e4();IAe.ObjectId=RK();IAe.String=q4();IAe.Subdocument=T4();IAe.UUID=KK();IAe.Union=QK();IAe.Oid=IAe.ObjectId;IAe.Object=IAe.Mixed;IAe.Bool=IAe.Boolean;IAe.ObjectID=IAe.ObjectId});var ic=g(function(Q4,fH){/*!
728
+ * Module dependencies.
729
+ */var e4e=L("events").EventEmitter,t4e=Ja(),Et=Le(),ZK=y6(),r4e=Hq(),G4=_r(),rH=As(),n4e=NA(),I2=$y(),nH=$A(),wn=Zt(),R2=gr(),s4e=Rn(),i4e=BV(),$2=kA(),o4e=Ry(),eH=gn(),u4e=qA(),a4e=J0(),Sa=ks(),c4e=vV(),l4e=YV(),j1=zi(),ye=we(),h4e=XV(),f4e=/\.\d+(\.|$)/,Ca,d4e=Of().queryMiddlewareFunctions,p4e=Of().documentMiddlewareFunctions,sH=d4e.concat(p4e).reduce((e,t)=>e.add(t),new Set),H4=ye.isPOJO,iH=0,m4e=/^\d+$/;function Y(e,t){if(!(this instanceof Y))return new Y(e,t);if(this.obj=e,this.paths={},this.aliases={},this.subpaths={},this.virtuals={},this.singleNestedPaths={},this.nested={},this.inherits={},this.callQueue=[],this._indexes=[],this._searchIndexes=[],this.methods=t?.methods||{},this.methodOptions={},this.statics=t?.statics||{},this.tree={},this.query=t?.query||{},this.childSchemas=[],this.plugins=[],this.$id=++iH,this.mapPaths=[],this.encryptedFields={},this.s={hooks:new t4e},this.options=this.defaultOptions(t),Array.isArray(e))for(let s of e)this.add(s);else if(e)this.add(e);if(t?.virtuals){let s=t.virtuals,i=Object.keys(s);for(let o of i){let u=s[o].options?s[o].options:void 0,a=this.virtual(o,u);if(s[o].get)a.get(s[o].get);if(s[o].set)a.set(s[o].set)}}let r=e?._id&&ye.isObject(e._id);if(!this.paths._id&&this.options._id&&!r)nH(this);this.setupTimestamp(this.options.timestamps)}function oH(e,t){for(let r of Object.keys(t)){let n=null;if(t[r]!=null)n=t[r];else{let i=R2(e.paths[r],"options");if(i==null)continue;n=i.alias}if(!n)continue;let s=e.paths[r].path;if(Array.isArray(n)){for(let i of n){if(typeof i!=="string")throw new Et("Invalid value for alias option on "+s+", got "+i);e.aliases[i]=s,e.virtual(i).get(function(o){return function(){if(typeof this.get==="function")return this.get(o);return this[o]}}(s)).set(function(o){return function(u){return this.$set(o,u)}}(s))}continue}if(typeof n!=="string")throw new Et("Invalid value for alias option on "+s+", got "+n);e.aliases[n]=s,e.virtual(n).get(function(i){return function(){if(typeof this.get==="function")return this.get(i);return this[i]}}(s)).set(function(i){return function(o){return this.$set(i,o)}}(s))}}/*!
730
+ * Inherit from EventEmitter.
731
+ */Y.prototype=Object.create(e4e.prototype);Y.prototype.constructor=Y;Y.prototype.instanceOfSchema=!0;/*!
732
+ * ignore
733
+ */Object.defineProperty(Y.prototype,"$schemaType",{configurable:!1,enumerable:!1,writable:!0});Object.defineProperty(Y.prototype,"childSchemas",{configurable:!1,enumerable:!0,writable:!0});Object.defineProperty(Y.prototype,"virtuals",{configurable:!1,enumerable:!0,writable:!0});Y.prototype.obj;Y.prototype.paths;Y.prototype.tree;Y.create=function(t,r){return new Y(t,r)};Y.prototype.clone=function(){let e=this._clone();return e.on("init",(t)=>this.emit("init",t)),e};/*!
734
+ * ignore
735
+ */Y.prototype._clone=function(t){t=t||(this.base==null?Y:this.base.Schema);let r=new t({},this._userProvidedOptions);r.base=this.base,r.obj=this.obj,r.options=wn(this.options),r.callQueue=this.callQueue.map(function(n){return n}),r.methods=wn(this.methods),r.methodOptions=wn(this.methodOptions),r.statics=wn(this.statics),r.query=wn(this.query),r.plugins=Array.prototype.slice.call(this.plugins),r._indexes=wn(this._indexes),r._searchIndexes=wn(this._searchIndexes),r.s.hooks=this.s.hooks.clone(),r.tree=wn(this.tree),r.paths=Object.fromEntries(Object.entries(this.paths).map(([n,s])=>[n,s.clone()])),r.nested=wn(this.nested),r.subpaths=wn(this.subpaths),r.mapPaths=[];for(let[n,s]of Object.entries(r.paths)){let i=n+".$*";if(!s.$isSchemaMap||!Object.hasOwn(r.paths,i))continue;r.paths[i]=s.$__schemaType,r.mapPaths.push(r.paths[i])}for(let n of Object.values(r.paths))if(n.$isSingleNested){let s=n.path;for(let i of Object.keys(n.schema.paths))r.singleNestedPaths[s+"."+i]=n.schema.paths[i];for(let i of Object.keys(n.schema.singleNestedPaths))r.singleNestedPaths[s+"."+i]=n.schema.singleNestedPaths[i];for(let i of Object.keys(n.schema.subpaths))r.singleNestedPaths[s+"."+i]=n.schema.subpaths[i];for(let i of Object.keys(n.schema.nested))r.singleNestedPaths[s+"."+i]="nested"}if(r._gatherChildSchemas(),r.virtuals=wn(this.virtuals),r.$globalPluginsApplied=this.$globalPluginsApplied,r.$isRootDiscriminator=this.$isRootDiscriminator,r.$implicitlyCreated=this.$implicitlyCreated,this.$timestamps!=null)r.$timestamps=Object.assign({},this.$timestamps);if(r.$id=++iH,r.$originalSchemaId=this.$id,this.discriminatorMapping!=null)r.discriminatorMapping=Object.assign({},this.discriminatorMapping);if(this.discriminators!=null)r.discriminators=Object.assign({},this.discriminators);if(this._applyDiscriminators!=null)r._applyDiscriminators=new Map(this._applyDiscriminators);return r.aliases=Object.assign({},this.aliases),r.encryptedFields=wn(this.encryptedFields),r};Y.prototype.pick=function(e,t){let r=new Y({},t||this.options);if(!Array.isArray(e))throw new Et('Schema#pick() only accepts an array argument, got "'+typeof e+'"');for(let n of e)if(this._hasEncryptedField(n)){let s=this.encryptedFields[n],i=this.path(n);r.add({[n]:{encrypt:s,[this.options.typeKey]:i}})}else if(this.nested[n])r.add({[n]:R2(this.tree,n)});else{let s=this.path(n);if(s==null)throw new Et("Path `"+n+"` is not in the schema");r.add({[n]:s})}if(!this._hasEncryptedFields())r.options.encryptionType=null;return r};Y.prototype.omit=function(e,t){let r=new Y(this,t||this.options);if(!Array.isArray(e))throw new Et('Schema#omit() only accepts an array argument, got "'+typeof e+'"');return r.remove(e),r};Y.prototype.defaultOptions=function(e){this._userProvidedOptions=e==null?{}:wn(e);let t=this.base?.options||{},r=t.strict??!0,n=t.strictQuery??!1,s=t.strictRead??!1,i=t.id??!0;if(e={strict:r,strictQuery:n,strictRead:s,bufferCommands:!0,capped:!1,versionKey:"__v",optimisticConcurrency:!1,minimize:!0,autoIndex:null,discriminatorKey:"__t",shardKey:null,read:null,validateBeforeSave:!0,validateModifiedOnly:!1,_id:!0,id:i,typeKey:"type",...e},e.strict??=r,e.strictQuery??=n,e.id??=i,e.versionKey&&typeof e.versionKey!=="string")throw new Et("`versionKey` must be falsy or string, got `"+typeof e.versionKey+"`");if(lH(e.defaultSort),typeof e.read==="string")e.read=$2(e.read);else if(Array.isArray(e.read)&&typeof e.read[0]==="string")e.read={mode:$2(e.read[0]),tags:e.read[1]};if(e.optimisticConcurrency&&!e.versionKey)throw new Et("Must set `versionKey` if using `optimisticConcurrency`");return e};Y.prototype.discriminator=function(e,t,r){return this._applyDiscriminators=this._applyDiscriminators||new Map,this._applyDiscriminators.set(e,{schema:t,options:r}),this};/*!
736
+ * Get the document middleware for this schema, filtering out any hooks that are specific to queries.
737
+ */Y.prototype._getDocumentMiddleware=function(t){let r=!!(this.options.shardKey||this.options.shardkey);return this.s.hooks.filter((n)=>{if(t&&n.fn[j1.skipOnSubdocuments])return!1;if(!r&&n.fn[j1.requiresShardKey])return!1;if(n.name==="updateOne"||n.name==="deleteOne")return!!n.document;if(n.name==="remove"||n.name==="init")return n.document==null||!!n.document;if(n.query!=null||n.document!=null)return n.document!==!1;return!0}).filter((n)=>{if(this.methods[n.name])return!n.fn[j1.builtInMiddleware];return!0})};/*!
738
+ * Get this schema's default toObject/toJSON options, including Mongoose global
739
+ * options.
740
+ */Y.prototype._defaultToObjectOptions=function(e){let t=e?"toJSON":"toObject";if(this._defaultToObjectOptionsMap&&t in this._defaultToObjectOptionsMap)return this._defaultToObjectOptionsMap[t];let r=this.base?.options?.[t]||{},n=this.options[t]||{},s=Object.assign({},r,n);return this._defaultToObjectOptionsMap=this._defaultToObjectOptionsMap||{},this._defaultToObjectOptionsMap[t]=ye.hasOwnKeys(s)?s:null,s};Y.prototype.encryptionType=function(e){if(arguments.length===0)return this.options.encryptionType;if(!(typeof e==="string"||e===null))throw new Et(`invalid \`encryptionType\`: ${e}`);this.options.encryptionType=e};Y.prototype.add=function(t,r){if(t instanceof Y||t?.instanceOfSchema)return a4e(this,t),this;if(t._id===!1&&r==null)this.options._id=!1;if(r=r||"",r==="__proto__."||r==="constructor."||r==="prototype.")return this;let n=Object.keys(t),s=this.options.typeKey;for(let o of n){if(ye.specialProperties.has(o))continue;let u=r+o,a=t[o];if(a==null)throw TypeError("Invalid value for schema path `"+u+'`, got value "'+a+'"');if(o==="_id"&&a===!1)continue;let c=!1;if(typeof a==="string"){let l=this.base?.Schema.Types??Y.Types,f=a.charAt(0).toUpperCase()+a.substring(1);c=l[f]!=null}if(o!=="_id"&&(typeof a!=="object"&&typeof a!=="function"&&!c||a==null))throw TypeError(`Invalid schema configuration: \`${a}\` is not a valid type at path \`${o}\`. See https://bit.ly/mongoose-schematypes for a list of valid schema types.`);if(a instanceof I2||(a.constructor?.name??null)==="VirtualType"){this.virtual(a);continue}if(Array.isArray(a)&&a.length===1&&a[0]==null)throw TypeError("Invalid value for schema Array path `"+u+'`, got value "'+a[0]+'"');if(!(H4(a)||a instanceof rH)){if(r)this.nested[r.substring(0,r.length-1)]=!0;if(this.path(r+o,a),!a[0]?.instanceOfSchema&&ye.isPOJO(a[0]?.discriminators)){let l=this.path(r+o);for(let f in a[0].discriminators)l.discriminator(f,a[0].discriminators[f])}}else if(ye.hasOwnKeys(a)===!1){if(r)this.nested[r.substring(0,r.length-1)]=!0;this.path(u,a)}else if(!a[s]||s==="type"&&H4(a.type)&&a.type.type)this.nested[u]=!0,this.add(a,u+".");else{let l=a[s];if(H4(l)&&ye.hasOwnKeys(l)){if(r)this.nested[r.substring(0,r.length-1)]=!0;let f={};if(this._userProvidedOptions.typeKey)f.typeKey=this._userProvidedOptions.typeKey;if(this._userProvidedOptions.strict!=null)f.strict=this._userProvidedOptions.strict;if(this._userProvidedOptions.toObject!=null)f.toObject=ye.omit(this._userProvidedOptions.toObject,["transform"]);if(this._userProvidedOptions.toJSON!=null)f.toJSON=ye.omit(this._userProvidedOptions.toJSON,["transform"]);let h=new Y(l,f);h.$implicitlyCreated=!0;let d=Object.assign({},a,{[s]:h});this.path(r+o,d)}else{if(r)this.nested[r.substring(0,r.length-1)]=!0;if(this.path(r+o,a),!a?.instanceOfSchema&&ye.isPOJO(a?.discriminators)){let f=this.path(r+o);for(let h in a.discriminators)f.discriminator(h,a.discriminators[h])}}}if(a.instanceOfSchema&&a.encryptionType()!=null){if(this.encryptionType()!=a.encryptionType())throw new Et("encryptionType of a nested schema must match the encryption type of the parent schema.");for(let[l,f]of Object.entries(a.encryptedFields)){let h=u+"."+l;this._addEncryptedField(h,f)}}else if(typeof a==="object"&&"encrypt"in a){let{encrypt:l}=a;if(this.encryptionType()==null)throw new Et("encryptionType must be provided");this._addEncryptedField(u,l)}else this._removeEncryptedField(u)}let i=Object.fromEntries(Object.entries(t).map(([o])=>[r+o,null]));return oH(this,i),this};Y.prototype._addEncryptedField=function(t,r){if(this.path(t).autoEncryptionType()==null)throw new Et(`Invalid BSON type for FLE field: '${t}'`);this.encryptedFields[t]=wn(r)};Y.prototype._removeEncryptedField=function(t){delete this.encryptedFields[t]};Y.prototype._hasEncryptedFields=function(){return ye.hasOwnKeys(this.encryptedFields)};Y.prototype._hasEncryptedField=function(t){return t in this.encryptedFields};Y.prototype._buildEncryptedFields=function(){return{fields:Object.entries(this.encryptedFields).map(([t,r])=>{let n=this.path(t).autoEncryptionType();return{path:t,bsonType:n,...r}})}};Y.prototype._buildSchemaMap=function(){function e(n,s,i){let o=0,u=n[o];for(;o<n.length-1;++o,u=n[o])s[u]=s[u]==null?{bsonType:"object",properties:{}}:s[u],s=s[u].properties;s[u]=i}let t=(n,[s,i])=>{let o=this.path(s).autoEncryptionType(),u=s.split("."),a={encrypt:{...i,bsonType:o}};return e(u,n,a),n};return{bsonType:"object",properties:Object.entries(this.encryptedFields).reduce(t,{})}};Y.prototype.alias=function(e,t){return oH(this,{[e]:t}),this};Y.prototype.removeIndex=function(t){if(arguments.length>1)throw new Et("removeIndex() takes only 1 argument");if(typeof t!=="object"&&typeof t!=="string")throw new Et("removeIndex() may only take either an object or a string as an argument");if(typeof t==="object"){for(let r=this._indexes.length-1;r>=0;--r)if(u4e(this._indexes[r][0],t))this._indexes.splice(r,1)}else for(let r=this._indexes.length-1;r>=0;--r)if(this._indexes[r][1]!=null&&this._indexes[r][1].name===t)this._indexes.splice(r,1);return this};Y.prototype.clearIndexes=function(){return this._indexes.length=0,this};Y.prototype.searchIndex=function(t){return this._searchIndexes.push(t),this};Y.reserved=Object.create(null);Y.prototype.reserved=Y.reserved;var An=Y.reserved;An.prototype=An.emit=An.listeners=An.removeListener=An.collection=An.errors=An.get=An.init=An.isModified=An.isNew=An.populated=An.remove=An.save=An.toObject=An.validate=1;An.collection=1;Y.prototype.path=function(e,t){if(t===void 0){if(Object.hasOwn(this.paths,e))return this.paths[e];let a=uH(e),c=y4e(this,e,a);if(c!=null)return c;let l=aH(this,e);if(l!=null)return l;if(c=this.hasMixedParent(a),c!=null)return c;return f4e.test(e)?g4e(this,e,a):void 0}let r=e.indexOf(".")===-1?[e]:e.split("."),n=r.pop();if(ye.specialProperties.has(n))throw new Et("Cannot set special property `"+n+"` on a schema");let s=r.length===0?n:r[0];if(Object.hasOwn(An,s)&&!this.options.suppressReservedKeysWarning){let a=`\`${s}\` is a reserved schema pathname and may break some functionality. You are allowed to use it, but use at your own risk. To disable this warning pass \`suppressReservedKeysWarning\` as a schema option.`;ye.warn(a)}if(typeof t==="object"&&ye.hasUserDefinedProperty(t,"ref"))h4e(t.ref,e);let i=this.tree,o="";for(let a of r){if(ye.specialProperties.has(a))throw new Et("Cannot set special property `"+a+"` on a schema");if(o=o+=(o.length>0?".":"")+a,!i[a])this.nested[o]=!0,i[a]={};if(typeof i[a]!=="object"){let c="Cannot set nested path `"+e+"`. Parent path `"+o+"` already set to type "+i[a].name+".";throw new Et(c)}i=i[a]}i[n]=wn(t),this.paths[e]=this.interpretAsType(e,t,this.options),this._defaultsCache=null,this._hasSelectedPaths=void 0;let u=this.paths[e];if(this.childSchemas=this.childSchemas.filter((a)=>a.path!==e),u.$isSchemaMap){let a=e+".$*";if(this.paths[a]=u.$__schemaType,this.mapPaths.push(this.paths[a]),u.$__schemaType.$isSingleNested)this.childSchemas.push({schema:u.$__schemaType.schema,model:u.$__schemaType.Constructor,path:e})}if(u.$isSingleNested){for(let a of Object.keys(u.schema.paths))this.singleNestedPaths[e+"."+a]=u.schema.paths[a];for(let a of Object.keys(u.schema.singleNestedPaths))this.singleNestedPaths[e+"."+a]=u.schema.singleNestedPaths[a];for(let a of Object.keys(u.schema.subpaths))this.singleNestedPaths[e+"."+a]=u.schema.subpaths[a];for(let a of Object.keys(u.schema.nested))this.singleNestedPaths[e+"."+a]="nested";Object.defineProperty(u.schema,"base",{configurable:!0,enumerable:!1,writable:!1,value:this.base}),u.Constructor.base=this.base,this.childSchemas.push({schema:u.schema,model:u.Constructor,path:e})}else if(u.$isMongooseDocumentArray)Object.defineProperty(u.schema,"base",{configurable:!0,enumerable:!1,writable:!1,value:this.base}),u.Constructor.base=this.base,this.childSchemas.push({schema:u.schema,model:u.Constructor,path:e});if(u.$isMongooseArray&&!u.$isMongooseDocumentArray){let a=e,c=u,l=[];while(c.$isMongooseArray)a=a+".$",c.embeddedSchemaType._arrayPath=a,c.embeddedSchemaType._arrayParentPath=e,c=c.embeddedSchemaType,this.subpaths[a]=c;for(let f of l)this.subpaths[f.path]=f}if(u.$isMongooseDocumentArray){for(let a of Object.keys(u.schema.paths)){let c=u.schema.paths[a];if(this.subpaths[e+"."+a]=c,typeof c==="object"&&c!=null&&c.$parentSchemaDocArray==null)c.$parentSchemaDocArray=u}for(let a of Object.keys(u.schema.subpaths)){let c=u.schema.subpaths[a];if(this.subpaths[e+"."+a]=c,typeof c==="object"&&c!=null&&c.$parentSchemaDocArray==null)c.$parentSchemaDocArray=u}for(let a of Object.keys(u.schema.singleNestedPaths)){let c=u.schema.singleNestedPaths[a];if(this.subpaths[e+"."+a]=c,typeof c==="object"&&c!=null&&c.$parentSchemaDocArray==null)c.$parentSchemaDocArray=u}}return this};/*!
741
+ * ignore
742
+ */Y.prototype._gatherChildSchemas=function(){let t=[];for(let r of Object.keys(this.paths)){if(typeof r!=="string")continue;let n=this.paths[r];if(n.$isMongooseDocumentArray||n.$isSingleNested)t.push({schema:n.schema,model:n.Constructor,path:r});else if(n.$isSchemaMap&&n.$__schemaType.$isSingleNested)t.push({schema:n.$__schemaType.schema,model:n.$__schemaType.Constructor,path:r})}return this.childSchemas=t,t};/*!
743
+ * ignore
744
+ */function y4e(e,t,r){if(Object.hasOwn(e.paths,t))return e.paths[t];if(Object.hasOwn(e.subpaths,r)){let n=e.subpaths[r];if(n==="nested")return;return n}if(Object.hasOwn(e.singleNestedPaths,r)&&typeof e.singleNestedPaths[r]==="object"){let n=e.singleNestedPaths[r];if(n==="nested")return;return n}return null}/*!
745
+ * ignore
746
+ */function uH(e){if(!/\.\d+/.test(e))return e;return e.replace(/\.\d+\./g,".$.").replace(/\.\d+$/,".$")}/*!
747
+ * ignore
748
+ */function aH(e,t){if(e.mapPaths.length===0)return null;for(let r of e.mapPaths){let n=r.path.replace(/\.\$\*/g,"");if(t===n||t.startsWith(n+".")&&t.slice(n.length+1).indexOf(".")===-1)return r;else if(r.schema&&t.startsWith(n+".")){let s=t.slice(n.length+1);return s=s.slice(s.indexOf(".")+1),r.schema.path(s)}else if(r.$isSchemaMap&&t.startsWith(n+".")){let s=t.slice(n.length+1);s=s.slice(s.indexOf(".")+1);let i=r.$__schemaType._presplitPath;if(s.indexOf(".")===-1&&i[i.length-1]==="$*")return r.$__schemaType;else if(s.indexOf(".")!==-1&&r.$__schemaType.schema&&i[i.length-1]==="$*")return r.$__schemaType.schema.path(s.slice(s.indexOf(".")+1))}}return null}Object.defineProperty(Y.prototype,"base",{configurable:!0,enumerable:!1,writable:!0,value:null});Y.prototype.interpretAsType=function(e,t,r){if(t instanceof G4){if(t.path===e)return t;let a=t.clone();return a.path=e,a}let n=this.base?.Schema.Types??Y.Types,s=this.base?.Types??b1();if(!ye.isPOJO(t)&&!(t instanceof rH)){if(ye.getFunctionName(t.constructor)!=="Object"){let c=t;t={},t[r.typeKey]=c}}let i=t[r.typeKey]&&(t[r.typeKey]instanceof Function||r.typeKey!=="type"||!t.type.type)?t[r.typeKey]:{};if(i instanceof G4){if(i.path===e)return i;let a=i.clone();return a.path=e,a}let o;if(ye.isPOJO(i)||i==="mixed")return new n.Mixed(e,t,null,this);if(Array.isArray(i)||i===Array||i==="array"||i===n.Array){let a=i===Array||i==="array"?t.cast||t.of:i[0];if(a?.instanceOfSchema){if(!(a instanceof Y))if(this.options._isMerging)a=new Y(a);else throw TypeError("Schema for array path `"+e+`\` is from a different copy of the Mongoose module. Please make sure you're using the same version of Mongoose everywhere with \`npm list mongoose\`. If you are still getting this error, please add \`new Schema()\` around the path: ${e}: new Schema(...)`);return new n.DocumentArray(e,a,t,null,this)}if(a&&a[r.typeKey]&&a[r.typeKey].instanceOfSchema){if(!(a[r.typeKey]instanceof Y))if(this.options._isMerging)a[r.typeKey]=new Y(a[r.typeKey]);else throw TypeError("Schema for array path `"+e+`\` is from a different copy of the Mongoose module. Please make sure you're using the same version of Mongoose everywhere with \`npm list mongoose\`. If you are still getting this error, please add \`new Schema()\` around the path: ${e}: new Schema(...)`);return new n.DocumentArray(e,a[r.typeKey],t,a,this)}if(typeof a<"u"){if(Array.isArray(a)||a.type===Array||a.type=="Array"){if(a?.type=="Array")a.type=Array;return new n.Array(e,this.interpretAsType(e,a,r),t,null,this)}}let c=a!=null&&a[r.typeKey]&&(r.typeKey!=="type"||!a.type.type)?a[r.typeKey]:a;if(typeof a==="string")a=n[a.charAt(0).toUpperCase()+a.substring(1)];else if(ye.isPOJO(c))if(ye.hasOwnKeys(c)){let l={minimize:r.minimize};if(r.typeKey)l.typeKey=r.typeKey;if(Object.hasOwn(r,"strict"))l.strict=r.strict;if(Object.hasOwn(r,"strictQuery"))l.strictQuery=r.strictQuery;if(Object.hasOwn(r,"toObject"))l.toObject=ye.omit(r.toObject,["transform"]);if(Object.hasOwn(r,"toJSON"))l.toJSON=ye.omit(r.toJSON,["transform"]);if(Object.hasOwn(this._userProvidedOptions,"_id"))l._id=this._userProvidedOptions._id;else if(Y.Types.DocumentArray.defaultOptions._id!=null)l._id=Y.Types.DocumentArray.defaultOptions._id;let f=new Y(c,l);return f.$implicitlyCreated=!0,new n.DocumentArray(e,f,t,null,this)}else return new n.Array(e,n.Mixed,t,null,this);if(a){if(i=a[r.typeKey]&&(r.typeKey!=="type"||!a.type.type)?a[r.typeKey]:a,Array.isArray(i))return new n.Array(e,this.interpretAsType(e,a,r),t,null,this);if(o=typeof i==="string"?i:i.schemaName||ye.getFunctionName(i),o==="ClockDate")o="Date";if(o===void 0)throw TypeError(`Invalid schema configuration: Could not determine the embedded type for array \`${e}\`. See https://mongoosejs.com/docs/guide.html#definition for more info on supported schema syntaxes.`);if(!Object.hasOwn(n,o))throw TypeError(`Invalid schema configuration: \`${o}\` is not a valid type within the array \`${e}\`.See https://bit.ly/mongoose-schematypes for a list of valid schema types.`);if(o==="Union"&&typeof a==="object")a.parentSchema=this}return new n.Array(e,a||n.Mixed,t,r,this)}if(i?.instanceOfSchema)return new n.Subdocument(i,e,t,this);if(Buffer.isBuffer(i))o="Buffer";else if(typeof i==="function"||typeof i==="object")o=i.schemaName||ye.getFunctionName(i);else if(i===s.ObjectId)o="ObjectId";else if(i===s.Decimal128)o="Decimal128";else o=i==null?""+i:i.toString();if(o)o=o.charAt(0).toUpperCase()+o.substring(1);if(o==="ObjectID")o="ObjectId";if(o==="ClockDate")o="Date";if(o===void 0)throw TypeError(`Invalid schema configuration: \`${e}\` schematype definition is invalid. See https://mongoosejs.com/docs/guide.html#definition for more info on supported schema syntaxes.`);if(n[o]==null)throw TypeError(`Invalid schema configuration: \`${o}\` is not a valid type at path \`${e}\`. See https://bit.ly/mongoose-schematypes for a list of valid schema types.`);return new n[o](e,t,r,this)};Y.prototype.eachPath=function(e){let t=Object.keys(this.paths),r=t.length;for(let n=0;n<r;++n)e(t[n],this.paths[t[n]]);return this};Y.prototype.requiredPaths=function(t){if(this._requiredpaths&&!t)return this._requiredpaths;let r=Object.keys(this.paths),n=r.length,s=[];while(n--){let i=r[n];if(this.paths[i].isRequired)s.push(i)}return this._requiredpaths=s,this._requiredpaths};Y.prototype.pathsWithTransforms=function(t){if(this._pathsWithTransforms!==void 0&&!t)return this._pathsWithTransforms;let r=Object.keys(this.paths),n=[];for(let s of r){let i=this.paths[s],o=i.options.transform??i.constructor?.defaultOptions?.transform,u=i.embeddedSchemaType?.options?.transform??i.embeddedSchemaType?.constructor?.defaultOptions?.transform;if(o||u)n.push(s)}return this._pathsWithTransforms=n.length?n:null,this._pathsWithTransforms};Y.prototype._getDefaultsCache=function(){if(this._defaultsCache==null)this._defaultsCache=new r4e(this);return this._defaultsCache};Y.prototype.indexedPaths=function(){if(this._indexedpaths)return this._indexedpaths;return this._indexedpaths=this.indexes(),this._indexedpaths};Y.prototype.pathType=function(e){if(Object.hasOwn(this.paths,e))return"real";if(Object.hasOwn(this.virtuals,e))return"virtual";if(Object.hasOwn(this.nested,e))return"nested";let t=uH(e);if(Object.hasOwn(this.subpaths,t)||Object.hasOwn(this.subpaths,e))return"real";let r=Object.hasOwn(this.singleNestedPaths,t)||Object.hasOwn(this.singleNestedPaths,e);if(r)return r==="nested"?"nested":"real";if(aH(this,e)!=null)return"real";if(/\.\d+\.|\.\d+$/.test(e))return cH(this,e,t);return"adhocOrUndefined"};Y.prototype.hasMixedParent=function(e){let t=e.split(/\./g);e="";for(let r=0;r<t.length;++r)if(e=r>0?e+"."+t[r]:t[r],Object.hasOwn(this.paths,e)&&this.paths[e]instanceof Ca.Mixed)return this.paths[e];return null};Y.prototype.setupTimestamp=function(e){return l4e(this,e)};function cH(e,t,r){let n=t.split(/\.(\d+)\.|\.(\d+)$/).filter(Boolean);if(n.length<2)return Object.hasOwn(e.paths,n[0])?e.paths[n[0]]:"adhocOrUndefined";let s=e.path(n[0]),i=!1;if(!s)return"adhocOrUndefined";let o=n.length-1;for(let u=1;u<n.length;++u){i=!1;let a=n[u];if(u===o&&s&&!/\D/.test(a)){if(s.$isMongooseDocumentArray)s=s.embeddedSchemaType;else if(s instanceof Ca.Array)s=s.embeddedSchemaType;else s=void 0;break}if(!/\D/.test(a)){if(s instanceof Ca.Array&&u!==o)s=s.embeddedSchemaType;continue}if(!s?.schema){s=void 0;break}i=s.schema.pathType(a)==="nested",s=s.schema.path(a)}if(e.subpaths[r]=s,s)return"real";if(i)return"nested";return"adhocOrUndefined"}/*!
749
+ * ignore
750
+ */function g4e(e,t,r){return cH(e,t,r),e.subpaths[r]}Y.prototype.queue=function(e,t){return this.callQueue.push([e,t]),this};Y.prototype.pre=function(e){if(e instanceof RegExp){let t=Array.prototype.slice.call(arguments,1);for(let r of sH)if(e.test(r))this.pre.apply(this,[r].concat(t));return this}if(Array.isArray(e)){let t=Array.prototype.slice.call(arguments,1);for(let r of e)this.pre.apply(this,[r].concat(t));return this}return this.s.hooks.pre.apply(this.s.hooks,arguments),this};Y.prototype.post=function(e){if(e instanceof RegExp){let t=Array.prototype.slice.call(arguments,1);for(let r of sH)if(e.test(r))this.post.apply(this,[r].concat(t));return this}if(Array.isArray(e)){let t=Array.prototype.slice.call(arguments,1);for(let r of e)this.post.apply(this,[r].concat(t));return this}return this.s.hooks.post.apply(this.s.hooks,arguments),this};Y.prototype.plugin=function(e,t){if(typeof e!=="function")throw new Et('First param to `schema.plugin()` must be a function, got "'+typeof e+'"');if(t?.deduplicate){for(let r of this.plugins)if(r.fn===e)return this}return this.plugins.push({fn:e,opts:t}),e(this,t),this};Y.prototype.queryHelper=function(t,r){if(typeof t!=="string")throw new Et('First param to `schema.queryHelper()` must be a string, got "'+typeof t+'"');if(typeof r!=="function")throw new Et('Second param to `schema.queryHelper()` must be a function, got "'+typeof r+'"');return this.query[t]=r,this};Y.prototype.method=function(e,t,r){if(typeof e!=="string")for(let n in e)this.methods[n]=e[n],this.methodOptions[n]=wn(r);else this.methods[e]=t,this.methodOptions[e]=wn(r);return this};Y.prototype.static=function(e,t){if(typeof e!=="string")for(let r in e)this.statics[r]=e[r];else this.statics[e]=t;return this};Y.prototype.index=function(e,t){if(e||(e={}),t||(t={}),t.expires)ye.expires(t);for(let r in e)if(this.aliases[r])e=ye.renameObjKey(e,r,this.aliases[r]);for(let r of Object.keys(e))if(e[r]==="ascending"||e[r]==="asc")e[r]=1;else if(e[r]==="descending"||e[r]==="desc")e[r]=-1;return this._indexes.push([e,t]),this};Y.prototype.set=function(e,t,r){if(arguments.length===1)return this.options[e];switch(e){case"read":if(typeof t==="string")this.options[e]={mode:$2(t),tags:r};else if(Array.isArray(t)&&typeof t[0]==="string")this.options[e]={mode:$2(t[0]),tags:t[1]};else this.options[e]=t;this._userProvidedOptions[e]=this.options[e];break;case"timestamps":this.setupTimestamp(t),this.options[e]=t,this._userProvidedOptions[e]=this.options[e];break;case"_id":if(this.options[e]=t,this._userProvidedOptions[e]=this.options[e],t&&!this.paths._id)nH(this);else if(!t&&this.paths._id!=null&&this.paths._id.auto)this.remove("_id");break;default:this.options[e]=t,this._userProvidedOptions[e]=this.options[e];break}if(e==="strict")kf(this,{strict:t});if(e==="strictQuery")kf(this,{strictQuery:t});if(e==="toObject")t={...t},delete t.transform,kf(this,{toObject:t});if(e==="toJSON")t={...t},delete t.transform,kf(this,{toJSON:t});return this};/*!
751
+ * Recursively set options on implicitly created schemas
752
+ */function kf(e,t){for(let{schema:r}of e.childSchemas){if(!r.$implicitlyCreated)continue;Object.assign(r.options,t),kf(r,t)}}Y.prototype.get=function(e){return this.options[e]};var E4e="2d 2dsphere hashed text".split(" ");Object.defineProperty(Y,"indexTypes",{get:function(){return E4e},set:function(){throw new Et("Cannot overwrite Schema.indexTypes")}});Y.prototype.indexes=function(){return i4e(this)};Y.prototype.virtual=function(e,t){if(e instanceof I2||s4e(e)==="VirtualType")return this.virtual(e.path,e.options);let r=e.split(".");for(let s of r)if(ye.specialProperties.has(s))throw new Et("Cannot set special property `"+s+"` on a schema");if(t=new n4e(t),ye.hasUserDefinedProperty(t,["ref","refPath"])){if(t.localField==null)throw new Et("Reference virtuals require `localField` option");if(t.foreignField==null)throw new Et("Reference virtuals require `foreignField` option");let s=this.virtual(e);if(s.options=t,this.pre("init",function(a,c){if(Sa.has(e,a)){let l=Sa.get(e,a);if(!this.$$populatedVirtuals)this.$$populatedVirtuals={};if(t.justOne||t.count)this.$$populatedVirtuals[e]=Array.isArray(l)?l[0]:l;else this.$$populatedVirtuals[e]=Array.isArray(l)?l:l==null?[]:[l];if(c?.hydratedPopulatedDocs&&!t.count){let f=s._getModelNamesForPopulate(this),h=this.$$populatedVirtuals[e];if(!Array.isArray(h)&&!eH(h)&&f?.length===1){let d=this.db.model(f[0]);this.$$populatedVirtuals[e]=d.hydrate(h)}else if(Array.isArray(h)&&f?.length===1){let d=this.db.model(f[0]);for(let m=0;m<h.length;++m)if(!eH(h[m]))h[m]=d.hydrate(h[m],null,{hydratedPopulatedDocs:!0});let p=t.foreignField;this.$populated(e,h.map((m)=>m==null?m:m.get(typeof p==="function"?p.call(m,m):p)),{populateModelSymbol:d})}}Sa.unset(e,a)}}),s.set(function(u){if(!this.$$populatedVirtuals)this.$$populatedVirtuals={};return c4e(this.$$populatedVirtuals,e,u,t)}),typeof t.get==="function")s.get(t.get);let i=e.split("."),o=i[0];for(let u=0;u<i.length-1;++u){if(this.paths[o]==null)continue;if(this.paths[o].$isMongooseDocumentArray||this.paths[o].$isSingleNested){let a=i.slice(u+1).join(".");this.paths[o].schema.virtual(a,t);break}else if(this.paths[o].$isSchemaMap){let a=i.slice(u+2).join(".");this.paths[o].$__schemaType.schema.virtual(a,t);break}o+="."+i[u+1]}return s}let n=this.virtuals;if(this.pathType(e)==="real")throw new Et('Virtual path "'+e+'" conflicts with a real path in the schema');if(n[e]=r.reduce(function(s,i,o){return s[i]||(s[i]=o===r.length-1?new I2(t,e):{}),s[i]},this.tree),t?.applyToArray&&r.length>1){let s=this.path(r.slice(0,-1).join("."));if(s?.$isMongooseArray)return s.virtual(r[r.length-1],t);else throw new Et(`Path "${s}" is not an array`)}return n[e]};Y.prototype.virtualpath=function(e){return Object.hasOwn(this.virtuals,e)?this.virtuals[e]:null};Y.prototype.remove=function(e){if(typeof e==="string")e=[e];if(Array.isArray(e))e.forEach(function(t){if(this.path(t)==null&&!this.nested[t])return;this._defaultsCache=null,this._hasSelectedPaths=void 0;for(let[r,n]of Object.entries(this.aliases))if(n===t||n.startsWith(t+".")){if(delete this.aliases[r],delete this.virtuals[r],R2(this.tree,r)instanceof I2)B2(this,r)}if(this.nested[t]){let r=Object.keys(this.paths).concat(Object.keys(this.nested));for(let n of r)if(n.startsWith(t+"."))delete this.paths[n],delete this.nested[n],B2(this,n);this.mapPaths=this.mapPaths.filter((n)=>!n.path.startsWith(t+".")),tH(this,t),delete this.nested[t],B2(this,t);return}delete this.paths[t];for(let r of Object.keys(this.paths))if(r.startsWith(t+"."))delete this.paths[r];this.mapPaths=this.mapPaths.filter((r)=>!r.path.startsWith(t+".")),tH(this,t),B2(this,t),this._removeEncryptedField(t)},this);return this};/*!
753
+ * ignore
754
+ */function tH(e,t){let r=t+".";for(let n of Object.keys(e.subpaths))if(n===t||n.startsWith(r))delete e.subpaths[n];for(let n of Object.keys(e.singleNestedPaths))if(n===t||n.startsWith(r))delete e.singleNestedPaths[n]}function B2(e,t){let r=t.split("."),n=r.pop(),s=e.tree;for(let i of r)if(s=s[i],s==null)return;delete s[n]}Y.prototype.removeVirtual=function(e){if(typeof e==="string")e=[e];if(Array.isArray(e)){for(let t of e)if(this.virtuals[t]==null)throw new Et(`Attempting to remove virtual "${t}" that does not exist.`);for(let t of e){if(Object.hasOwn(this.aliases,t)){let r=this.aliases[t];delete this.aliases[t];let n=R2(this.tree,r),s=n instanceof G4?n.options:n;for(let i of[this.paths[r]?.options,s])if(i?.alias===t)delete i.alias;else if(Array.isArray(i?.alias))i.alias=i.alias.filter((o)=>o!==t)}if(delete this.paths[t],delete this.virtuals[t],t.indexOf(".")!==-1)Sa.unset(t,this.tree);else delete this.tree[t]}}return this};Y.prototype.loadClass=function(e,t){if(e===Object.prototype||e===Function.prototype||Object.hasOwn(e.prototype,"$isMongooseModelPrototype")||Object.hasOwn(e.prototype,"$isMongooseDocumentPrototype"))return this;if(this.loadClass(Object.getPrototypeOf(e),t),!t)Object.getOwnPropertyNames(e).forEach(function(r){if(r.match(/^(length|name|prototype|constructor|__proto__)$/))return;let n=Object.getOwnPropertyDescriptor(e,r);if(Object.hasOwn(n,"value"))this.static(r,n.value)},this);return Object.getOwnPropertyNames(e.prototype).forEach(function(r){if(r.match(/^(constructor)$/))return;let n=Object.getOwnPropertyDescriptor(e.prototype,r);if(!t){if(typeof n.value==="function")this.method(r,n.value)}if(typeof n.get==="function"){if(this.virtuals[r])this.virtuals[r].getters=[];this.virtual(r).get(n.get)}if(typeof n.set==="function"){if(this.virtuals[r])this.virtuals[r].setters=[];this.virtual(r).set(n.set)}},this),this};/*!
755
+ * ignore
756
+ */Y.prototype._getSchema=function(e){let t=this,r=t.path(e),n=[];if(r)return r.$fullPath=e,r;function s(o,u){let a=o.length+1,c,l;while(a--)if(l=o.slice(0,a).join("."),c=u.path(l),c){if(n.push(l),c.embeddedSchemaType||c.Constructor){if(c.embeddedSchemaType instanceof Ca.Mixed)return c.embeddedSchemaType.$fullPath=n.join("."),c.embeddedSchemaType;if(a!==o.length){let f=c,h=a;while(h<o.length&&f.embeddedSchemaType&&(o[h]==="$"||N2(o[h])))f=f.embeddedSchemaType,++h;if(h===o.length)return f;if(c.schema){let d;if(o[a]==="$"||N2(o[a])){if(a+1===o.length)return c.embeddedSchemaType;if(d=s(o.slice(a+1),c.schema),d)d.$parentSchemaDocArray=d.$parentSchemaDocArray||(c.schema.$isSingleNested?null:c);return d}if(d=s(o.slice(a),c.schema),d)d.$parentSchemaDocArray=d.$parentSchemaDocArray||(c.schema.$isSingleNested?null:c);return d}}}else if(c.$isSchemaMap){if(a>=o.length)return c;if(a+1>=o.length)return c.$__schemaType;if(c.$__schemaType instanceof Ca.Mixed)return c.$__schemaType;if(c.$__schemaType.schema!=null)return s(o.slice(a+1),c.$__schemaType.schema)}return c.$fullPath=n.join("."),c}}let i=e.split(".");for(let o=0;o<i.length;++o){if(i[o]==="$"||N2(i[o]))i[o]="0";if(m4e.test(i[o]))i[o]="$"}return s(i,t)};/*!
757
+ * ignore
758
+ */Y.prototype._getPathType=function(e){let t=this;if(t.path(e))return"real";function n(s,i){let o=s.length+1,u,a;while(o--)if(a=s.slice(0,o).join("."),u=i.path(a),u){if(u.embeddedSchemaType||u.Constructor){if(u.embeddedSchemaType instanceof Ca.Mixed)return{schema:u,pathType:"mixed"};if(o!==s.length&&u.schema){if(s[o]==="$"||N2(s[o])){if(o===s.length-1)return{schema:u,pathType:"nested"};return n(s.slice(o+1),u.schema)}return n(s.slice(o),u.schema)}return{schema:u,pathType:u.$isSingleNested?"nested":"array"}}return{schema:u,pathType:"real"}}else if(o===s.length&&Object.hasOwn(i.nested,a))return{schema:i,pathType:"nested"};return{schema:u||i,pathType:"undefined"}}return n(e.split("."),t)};Y.prototype._transformDuplicateKeyError=function(t){if(!this._duplicateKeyErrorMessagesByPath)return t;if(t.code!==11000&&t.code!==11001)return t;if(t.keyPattern!=null){let r=t.keyPattern,n=Object.keys(r);if(n.length!==1)return t;let s=n[0];if(!Object.hasOwn(this._duplicateKeyErrorMessagesByPath,s))return t;return new Et(this._duplicateKeyErrorMessagesByPath[s],{cause:t})}return t};/*!
759
+ * ignore
760
+ */function N2(e){return e.startsWith("$[")&&e.endsWith("]")}Y.prototype._preCompile=function(){lH(this.options.defaultSort),this.plugin(o4e,{deduplicate:!0}),_4e(this),Y4(this,new Set),this._hasSelectedPaths=hH(this,[])};/*!
761
+ * Throws if `defaultSort` is not a valid value for the `defaultSort` schema option. Disallows `$meta` sorts,
762
+ * like `{ score: { $meta: 'textScore' } }`, because MongoDB throws on `$meta` sorts for queries without `$text`.
763
+ */function lH(e){if(!e)return;let t="`defaultSort` must not be empty, use `defaultSort: null` to disable the default sort";if(typeof e==="string"){if(e.trim()==="")throw new Et(t);return}if(typeof e!=="object")throw new Et("`defaultSort` must be falsy, string, object, array, or Map, got `"+typeof e+"`");let r=e instanceof Map?Array.from(e):Array.isArray(e)?e:Object.entries(e);if(r.length===0)throw new Et(t);for(let n of r){if(!Array.isArray(n))throw new Et("`defaultSort` array must be an array of [key, value] arrays, like `[['name', 1]]`");if(n[1]!=null&&Object.hasOwn(n[1],"$meta"))throw new Et("`defaultSort` does not support `$meta` sorts, got `$meta` for `"+n[0]+"`")}}/*!
764
+ * Clears caches that are derived from `schema.paths` on `schema` and all of its
765
+ * nested schemas, because nested schemas can change until the model is compiled.
766
+ */function Y4(e,t){if(t.has(e))return;t.add(e),e._defaultsCache=null,e._pathsWithTransforms=void 0;for(let{schema:r}of e.childSchemas)Y4(r,t);for(let r of Object.values(e.discriminators??{}))Y4(r,t)}/*!
767
+ * Returns true if any path in `schema`, including paths in nested schemas,
768
+ * has a schema-level `select` option. If not, `applyPaths()` can skip walking
769
+ * the schema on every query. Mirrors the paths that `applyPaths()` checks.
770
+ */function hH(e,t){if(t.includes(e))return!1;t.push(e);for(let r of Object.keys(e.paths)){let n=e.paths[r];if(n.$isSchemaMap||r.endsWith(".$*")){if(n.options?.select===!1)return!0;continue}if(typeof n.selected==="boolean")return!0;if(n.$isMongooseArray&&!n.$isMongooseDocumentArray&&typeof n.embeddedSchemaType?.selected==="boolean")return!0;if(n.schema&&hH(n.schema,t))return!0}return t.pop(),!1}/*!
771
+ * Build precomputed path tries for optimisticConcurrency include/exclude so
772
+ * that lookups at save time are a single trie walk that handles nested paths
773
+ * and map wildcards like `settings.$*`.
774
+ */function _4e(e){let t=e.options.optimisticConcurrency;if(!t||t===!0)return;if(Array.isArray(t))e.options._optimisticConcurrencyTrie=new ZK(t);else if(Array.isArray(t.exclude))e.options._optimisticConcurrencyExcludeTrie=new ZK(t.exclude)}Y.prototype.toJSONSchema=function(t){let r=t?.useBsonType??!1,n=r?{required:[],properties:{}}:{type:"object",required:[],properties:{}};for(let s of Object.keys(this.paths)){let i=this.paths[s];if(i._presplitPath.indexOf("$*")!==-1)continue;let o=i._presplitPath.length>1,u=n;if(o)for(let c=0;c<i._presplitPath.length-1;++c){let l=i._presplitPath[c];if(u.properties[l]==null)u.properties[l]=r?{bsonType:["object","null"],properties:{}}:{type:["object","null"],properties:{}};u=u.properties[l]}let a=i._presplitPath[i._presplitPath.length-1];if(s==="_id"){if(!u.required)u.required=[];u.required.push("_id")}else if(i.options.required&&typeof i.options.required!=="function"){if(!u.required)u.required=[];u.required.push(a)}u.properties[a]=i.toJSONSchema(t)}if(n.required.length===0)delete n.required;return n};/*!
775
+ * Module exports.
776
+ */fH.exports=Q4=Y;Y.Types=Ca=Mf();/*!
777
+ * ignore
778
+ */Q4.ObjectId=Ca.ObjectId});var v2=g(function(dH,pH){/*!
779
+ * Connection states
780
+ */var Bo=pH.exports=dH=Object.create(null);Bo[0]="disconnected";Bo[1]="connected";Bo[2]="connecting";Bo[3]="disconnecting";Bo[99]="uninitialized";Bo.disconnected=0;Bo.connected=1;Bo.connecting=2;Bo.disconnecting=3;Bo.uninitialized=99});var X4=g(function(bFe,mH){/*!
781
+ * Module dependencies.
782
+ */var A4e=Rs();class J4 extends A4e{constructor(e,t,r,n){let s=e.map((i)=>i.message).join(", ");if(s.length>200)s=s.slice(0,200)+"...";super(`${n} failed with ${e.length} Mongoose validation errors: ${s}`);this.validationErrors=e,this.results=t,this.rawResult=r,this.operation=n}}Object.defineProperty(J4.prototype,"name",{value:"MongooseBulkWriteError"});/*!
783
+ * exports
784
+ */mH.exports=J4});var gH=g(function(DFe,yH){/*!
785
+ * Module dependencies.
786
+ */var w4e=Le();class Z4 extends w4e{constructor(e,t){super(e);this.errors=t}}Object.defineProperty(Z4.prototype,"name",{value:"SyncIndexesError"});yH.exports=Z4});var ew=g(function(TFe,EH){EH.exports=function e(t,r,n,s){if(t[s])return;if(t[s]=!0,!n?.skipTopLevel){let a=null;for(let c of r){let l=c[1]==null?null:c[1].tags;if(!Array.isArray(l)){t.plugin(c[0],c[1]);continue}if(a=a||new Set(t.options.pluginTags||[]),!l.find((f)=>a.has(f)))continue;t.plugin(c[0],c[1])}}if(n=Object.assign({},n),delete n.skipTopLevel,n.applyPluginsToChildSchemas!==!1)for(let a of Object.keys(t.paths)){let c=t.paths[a];if(c.schema!=null)e(c.schema,r,n,s),c.Constructor.prototype.$__setSchema(c.schema)}let i=t.discriminators;if(i==null)return;let o=n.applyPluginsToDiscriminators,u=Object.keys(i);for(let a of u){let c=i[a];e(c,r,{skipTopLevel:!o},s)}}});var k2=g(function(O4e,tw){/*!
787
+ * ignore
788
+ */var _H=null;O4e.get=function(){return _H};O4e.set=function(e){_H=e}});var rw=g(function(MFe,AH){function b4e(){return{ok:1,nInserted:0,nUpserted:0,nMatched:0,nModified:0,nRemoved:0,upserted:[],writeErrors:[],insertedIds:[],writeConcernErrors:[]}}AH.exports=b4e});var OH=g(function(xFe,wH){var D4e=Le();class nw extends D4e{constructor(e,t){super(e);this.errors=t}}Object.defineProperty(nw.prototype,"name",{value:"CreateCollectionsError"});wH.exports=nw});var sw=g(function(x4e){/*!
789
+ * Module dependencies.
790
+ */var T4e=Se().Binary,SH=vn(),CH=cf(),M4e=Rs(),bH=L("util");x4e.flatten=DH;x4e.modifiedPaths=TH;/*!
791
+ * ignore
792
+ */function DH(e,t,r,n){let s;if(e&&CH(e)&&!Buffer.isBuffer(e))s=Object.keys(e.toObject({transform:!1,virtuals:!1})||{});else s=Object.keys(e||{});let i=s.length,o={};t=t?t+".":"";for(let u=0;u<i;++u){let a=s[u],c=e[a];o[t+a]=c;let l=n?.path?.(t+a),f=n?.nested?.[t+a];if(l?.instance==="Mixed")continue;if(MH(c)){if(r?.skipArrays&&Array.isArray(c))continue;let h=DH(c,t+a,r,n);for(let d in h)o[d]=h[d];if(Array.isArray(c))o[t+a]=c}if(f){let h=Object.keys(n.paths);for(let d of h)if(d.startsWith(t+a+".")&&!Object.hasOwn(o,d))o[d]=void 0}}return o}/*!
793
+ * ignore
794
+ */function TH(e,t,r,n=null){if(e==null||typeof e!=="object")return;if(n==null)n={raw:{update:e,path:t},trace:new WeakSet};if(n.trace.has(e))throw new M4e(`a circular reference in the update value, updateValue:
795
+ ${bH.inspect(n.raw.update,{showHidden:!1,depth:1})}
796
+ updatePath: '${n.raw.path}'`);n.trace.add(e);let s=Object.keys(e||{}),i=s.length;r=r||{},t=t?t+".":"";for(let o=0;o<i;++o){let u=s[o],a=e[u],c=t+u;if(r[c]=!0,!Buffer.isBuffer(a)&&CH(a))a=a.toObject({transform:!1,virtuals:!1});if(MH(a))TH(a,t+u,r,n)}return n.trace.delete(e),r}/*!
797
+ * ignore
798
+ */function MH(e){return e&&typeof e==="object"&&!(e instanceof Date)&&!SH(e,"ObjectId")&&(!Array.isArray(e)||e.length!==0)&&!(e instanceof Buffer)&&!SH(e,"Decimal128")&&!(e instanceof T4e)}});var FH=g(function(FFe,PH){var xH=sw().modifiedPaths;PH.exports=function(t){let r=Object.keys(t),n={},s={};for(let i of r){if(i.startsWith("$")){xH(t[i],"",n);continue}s[i]=t[i]}return xH(s,"",n),n}});var iw=g(function(BFe,BH){var B4e=FH();BH.exports=function(t){if(t==null)return{};let r=B4e(t);return Object.keys(r).reduce((n,s)=>{let i=s.match(/\$\[[^\]]+\]/g);if(i==null)return n;for(let o of i){let u=s.indexOf(o);if(u!==s.lastIndexOf(o))throw Error(`Path '${s}' contains the same array filter multiple times`);n[o.substring(2,o.length-1)]=s.substring(0,u-1).replace(/\$\[[^\]]+\]/g,"0")}return n},{})}});var $H=g(function(NFe,IH){var N4e=wf(),NH=gr(),I4e=Ei(),ow=GA(),$4e=iw();IH.exports=function(t,r,n,s,i){let o=s.indexOf(".")===-1?[s]:s.split("."),u=null,a="adhocOrUndefined";n=n||{},r=r||{};let c=Array.isArray(i?.arrayFilters)?i.arrayFilters:[],l=$4e(r),f=0;for(let h=0;h<o.length;++h){let d=o.slice(f,h+1).join("."),p=N4e(d);if(u=t.path(p),u==null)continue;if(a=t.pathType(p),(u.$isSingleNested||u.$isMongooseDocumentArrayElement)&&u.schema.discriminators!=null){let m=NH(u,"schema.options.discriminatorKey"),E=p+"."+m,y=E.replace(/\.\d+\./,"."),_=null;if(E in n)_=ow(n[E]);if(y in n)_=ow(n[y]);let w=p.replace(/\.\d+$/,"");if(u.$isMongooseDocumentArrayElement&&NH(n[w],"$elemMatch."+m)!=null)_=ow(n[w].$elemMatch[m]);let C=d+"."+m;if(C in r)_=r[C];if(E in r)_=r[E];for(let x of Object.keys(l)){let v=l[x]+"."+m,P=x+"."+m;if(v===y){let ge=c.find((Me)=>Object.hasOwn(Me,P));if(ge!=null)_=ge[P]}}if(_==null)continue;let M=I4e(u.Constructor.discriminators,_)?.schema;if(M==null)continue;let O=o.slice(h+1).join(".");if(u=M._getSchema(O),t=M,f=h+1,u!=null){a=M._getPathType(O);break}}}return{type:a,schematype:u}}});var vH=g(function(IFe,RH){var R4e=ga();RH.exports=function(t,r,n,s,i,o,u){if(!t?.options?.immutable)return!1;let a=t.options.immutable;if(typeof a==="function")a=a.call(u,u);if(!a)return!1;if(o?.overwriteImmutable)return!1;if(r===!1)return!1;if(r==="throw")throw new R4e(null,`Field ${i} is immutable and strict = 'throw'`);return delete n[s],!0}});var jH=g(function($Fe,qH){var v4e=gr();qH.exports=function(t,r,n){if(r==null)return;let s=Object.keys(r);for(let i of s){let o=i.startsWith("$");if(i==="$set"){let u=Object.keys(r[i]);for(let a of u)kH(t,r[i],a,r,n)}else if(!o)kH(t,r,i,r,n)}};function kH(e,t,r,n,s){let i=e.path(r);if(i==null)return;let o=v4e(i,"options.immutable",null);if(o==null)return;if(typeof o==="function")o=o.call(s,s);if(!o)return;n.$setOnInsert=n.$setOnInsert||{},n.$setOnInsert[r]=t[r],delete t[r]}});var uw=g(function(RFe,LH){var L1=ma();LH.exports=function(t,r,n){if(r.indexOf(".")===-1){if(L1.has(r))return;t[r]=n;return}let s=r.split("."),i=s.pop(),o=t;for(let u of s){if(L1.has(u))continue;if(!Object.hasOwn(o,u)&&u in o)return;if(o[u]==null)o[u]={};o=o[u]}if(!L1.has(i))o[i]=n}});var pw=g(function(vFe,JH){var qf=kn(),V1=Le(),UH=q4(),VH=ga(),k4e=Za(),hw=Cf(),q4e=ac(),j4e=Rn(),aw=qs(),cw=Ei(),lw=$H(),L4e=Do(),zH=vH(),WH=gn(),U4e=T1(),V4e=jH(),YH=zi().schemaMixedSymbol,z4e=uw(),fn=we(),{internalToObjectOptions:KH}=Ui(),fw=new Set(["$currentDate","$inc","$min","$max","$mul","$rename","$set","$setOnInsert","$unset","$addToSet","$pop","$pull","$push","$pullAll","$bit"]);JH.exports=function(t,r,n,s,i){if(r==null)return;if(n=n||{},Array.isArray(r)){let f=r.length;for(let h=0;h<f;++h){let d=Object.keys(r[h]);for(let p of d)r[h][p]=W4e(p,r[h][p])}return r}if(t!=null&&i!=null&&fn.hasUserDefinedProperty(i,t.options.discriminatorKey)&&typeof i[t.options.discriminatorKey]!=="object"&&t.discriminators!=null){let f=i[t.options.discriminatorKey],h=cw(s.model.discriminators,f);t=aw(t.discriminators,f)||h?.schema||t}else if(t!=null&&n.overwriteDiscriminatorKey&&fn.hasUserDefinedProperty(r,t.options.discriminatorKey)&&t.discriminators!=null){let f=r[t.options.discriminatorKey],h=cw(s.model.discriminators,f);t=aw(t.discriminators,f)||h?.schema||t}else if(t!=null&&n.overwriteDiscriminatorKey&&r.$set!=null&&fn.hasUserDefinedProperty(r.$set,t.options.discriminatorKey)&&t.discriminators!=null){let f=r.$set[t.options.discriminatorKey],h=cw(s.model.discriminators,f);t=aw(t.discriminators,f)||h?.schema||t}if(n.upsert&&!n.overwriteImmutable)V4e(t,r,s);if(WH(r)&&typeof r.toObject==="function")r=r.toObject(KH);let o=Object.keys(r),u=o.length,a={},c,l=!1;i=i||{};while(u--){let f=o[u];if(!fw.has(f)){if(!a.$set)if(r.$set)a.$set=r.$set;else a.$set={};if(a.$set[f]=r[f],o.splice(u,1),!~o.indexOf("$set"))o.push("$set")}else if(f==="$set"){if(!a.$set)a[f]=r[f]}else a[f]=r[f]}u=o.length;while(u--){let f=o[u];if(c=a[f],l=l||f.startsWith("$"),WH(c))c=c.toObject(KH),a[f]=c;if(c&&typeof c==="object"&&!Buffer.isBuffer(c)&&fw.has(f))QH(t,c,f,n,s,i);else{let h="Invalid atomic update value for "+f+". Expected an object, received "+typeof c;throw Error(h)}if(f.startsWith("$")&&fn.isEmptyObject(c))delete a[f]}if(fn.hasOwnKeys(a)===!1&&n.upsert&&fn.hasOwnKeys(i))return{$setOnInsert:{...i}};return a};/*!
799
+ * ignore
800
+ */function W4e(e,t){if(e==="$unset"){if(typeof t!=="string"&&(!Array.isArray(t)||t.find((r)=>typeof r!=="string")))throw new V1("Invalid $unset in pipeline, must be a string or an array of strings");return t}if(e==="$project"){if(t==null||typeof t!=="object")throw new V1("Invalid $project in pipeline, must be an object");return t}if(e==="$addFields"||e==="$set"){if(t==null||typeof t!=="object")throw new V1("Invalid "+e+" in pipeline, must be an object");return t}else if(e==="$replaceRoot"||e==="$replaceWith"){if(t==null||typeof t!=="object")throw new V1("Invalid "+e+" in pipeline, must be an object");return t}throw new V1('Invalid update pipeline operator: "'+e+'"')}function QH(e,t,r,n,s,i,o){let u=n.strict;o=o?o+".":"";let a=Object.keys(t),c=a.length,l=!1,f,h,d,p=null,m=u??e.options.strict;while(c--){h=a[c],d=t[h];let E=o+h,y=!o&&U4e(h),_=y?e._getSchema(E):null,w=y&&Object.hasOwn(e.nested,h);if(y&&_==null&&!w)throw new V1('Invalid update: Unexpected modifier "'+h+'" as a key in operator "'+r+'". Did you mean something like { '+r+": { fieldName: { "+h+": [...] } } }? Modifiers must appear under a valid field path.");if(r==="$pull"){if(!y)_=e._getSchema(E);if(f=_,f==null){let A=lw(e,t,i,o+h,n);if(A.schematype!=null)f=A.schematype}if(f?.schema!=null){try{t[h]=q4e(f.schema,t[h],n,s)}catch(A){if(A instanceof qf){p=ou(A,s,h,p);continue}else throw A}l=!0;continue}}let C=o?o+h:h;if(e.discriminatorMapping!=null&&C===e.options.discriminatorKey&&e.discriminatorMapping.value!==t[h]&&!n.overwriteDiscriminatorKey){if(m==="throw"){let A=Error(`Can't modify discriminator key "`+C+'" on discriminator model');p=ou(A,s,C,p);continue}else if(m){delete t[h];continue}}if(!y&&r!=="$pull")_=e._getSchema(E);if(f=_,j4e(d)==="Object"){if(f==null){let A=lw(e,t,i,o+h,n);if(A.schematype!=null)f=A.schematype}if(r!=="$setOnInsert"&&zH(f,u,t,h,o+h,n,s))continue;if(f&&(f.embeddedSchemaType||f.Constructor)&&r in dw)if("$each"in d){l=!0;try{t[h]={$each:U1(f,d.$each,r,h,s,o+h)}}catch(A){p=ou(A,s,h,p)}if(d.$slice!=null)t[h].$slice=d.$slice|0;if(d.$sort)t[h].$sort=d.$sort;if(d.$position!=null)t[h].$position=hw(d.$position)}else{if(f?.$isSingleNested){let A=u==null?f.schema.options.strict:u;try{t[h]=f.castForQuery(null,d,s,{strict:A})}catch(M){p=ou(M,s,h,p)}}else try{t[h]=U1(f,d,r,h,s,o+h)}catch(A){p=ou(A,s,h,p)}if(t[h]===void 0){delete t[h];continue}l=!0}else if(r==="$currentDate"||r in dw&&f){try{t[h]=U1(f,d,r,h,s,o+h)}catch(A){p=ou(A,s,h,p)}if(t[h]===void 0){delete t[h];continue}l=!0}else if(r==="$rename"){let A=new UH(`${o}${h}.$rename`);try{t[h]=U1(A,d,r,h,s,o+h)}catch(M){p=ou(M,s,h,p)}if(t[h]===void 0){delete t[h];continue}l=!0}else{let A=o+h,M=e._getPathType(A),O=u;if(M?.schema&&O==null)O=M.schema.options.strict;if(M.pathType==="undefined"){if(O==="throw")throw new VH(A);else if(O){delete t[h];continue}}l|=QH(e,d,r,n,s,i,o+h)||fn.isObject(d)&&fn.hasOwnKeys(d)===!1}}else{let A=!w&&f==null&&(h==="$each"||h==="$or"||h==="$and"||h==="$in"),M=A?o:E;if(A)f=e._getSchema(M);if(r!=="$setOnInsert"&&zH(f,u,t,h,o+h,n,s))continue;let O=e._getPathType(M);if(f==null){let P=lw(e,t,i,M,n);if(P.schematype!=null)f=P.schematype,O=P.type}let x=u;if(O?.schema&&u==null)x=O.schema.options.strict;if(x&&!f&&!/real|nested/.test(O.pathType))if(x==="throw"&&L4e(e.virtuals,M)==null)throw new VH(o+h);else delete t[h];else{if(r==="$rename"){try{if(t[h]==null)throw new qf("String",t[h],`${o}${h}.$rename`);let P=new UH(`${o}${h}.$rename`,null,null,e);t[h]=P.castForQuery(null,t[h],s)}catch(P){p=ou(P,s,h,p)}continue}try{if(o.length===0||h.indexOf(".")===-1)t[h]=U1(f,d,r,h,s,o+h);else if(x!==!1||f!=null)z4e(t,h,U1(f,d,r,h,s,o+h)),delete t[h]}catch(P){p=ou(P,s,h,p)}if(Array.isArray(t[h])&&(r==="$addToSet"||r==="$push")&&h!=="$each"){if(f&&f.embeddedSchemaType&&!f.embeddedSchemaType.$isMongooseArray&&!f.embeddedSchemaType[YH])t[h]={$each:t[h]}}if(t[h]===void 0){delete t[h];continue}l=!0}}}if(p!=null)throw p;return l}/*!
801
+ * ignore
802
+ */function ou(e,t,r,n){let s=t?.modelName!=null?t:t?.model;if(s!=null&&typeof e.setModel==="function")e.setModel(s);if(typeof t!=="object"||!t.options.multipleCastError)throw e;return n=n||new k4e,n.addError(r,e),n}var HH={$pop:1,$inc:1},K4e={$unset:1},dw={$push:1,$addToSet:1,$set:1,$setOnInsert:1};/*!
803
+ * ignore
804
+ */var GH={$set:1,$setOnInsert:1};function U1(e,t,r,n,s,i){if(!e){if(r in HH)try{return hw(t)}catch{throw new qf("number",t,i)}return t}if(e.$isMongooseArray&&r in dw&&(fn.isObject(t)||Array.isArray(t))&&!GH[r]){let u=0,a=e;while(a.$isMongooseArray)++u,a=a.embeddedSchemaType;let c=0,l=t;while(Array.isArray(l))++c,l=l[0];let f=u-c;while(c<u)t=[t],++c;let h=e.applySetters(Array.isArray(t)?t:[t],s);for(let d=0;d<f;++d)h=h[0];return h}if(r in K4e)return t;if(r in HH){if(t==null)throw new qf("number",t,e.path);if(r==="$inc")return e.castForQuery(null,t,s);try{return hw(t)}catch{throw new qf("number",t,e.path)}}if(r==="$currentDate"){if(typeof t==="object")return{$type:t.$type};return Boolean(t)}if(fw.has(n))return e.castForQuery(n,t,s);if(GH[r]){let u=t!=null&&e.$isMongooseArray&&e.$fullPath!=null&&!e.$fullPath.match(/\d+$/),a=e[YH]!=null;if(u||a)return e.applySetters(t,s);return e.castForQuery(null,t,s)}return e.castForQuery(null,t,s)}});var eG=g(function(kFe,ZH){var XH=T1();ZH.exports=function(t,r,n){if(!Object.keys(n).some(XH))return r.castForQuery(null,n,t);let i=Object.keys(n),o=i.length;while(o--){let u=i[o],a=n[u];if(u==="$not"){if(a&&r&&!r.embeddedSchemaType&&!r.Constructor){let c=Object.keys(a);if(c.length&&XH(c[0]))for(let l of Object.keys(a))a[l]=r.castForQuery(l,a[l],t);else n[u]=r.castForQuery(u,a,t);continue}}else n[u]=r.castForQuery(u,a,t)}return n}});var rG=g(function(qFe,tG){var H4e=qs(),G4e=/^\d+$/;tG.exports=function(t,r,n){let s=t.path(r);if(s!=null)return s;let i=r.split("."),o="",u=!1;for(let a of i){if(u&&G4e.test(a))continue;if(o=o.length===0?a:o+"."+a,s=t.path(o),s?.schema){if(t=s.schema,!u&&s.$isMongooseDocumentArray)u=!0;if(n&&n[o])t=H4e(t.discriminators,n[o])??t;o=""}else if(s?.instance==="Mixed")break}return s}});var yw=g(function(jFe,mw){var Y4e=qs(),Q4e=eG(),nG=wf(),J4e=Do(),sG=rG(),{logicalOperators:X4e}=Tf(),Z4e=iw(),iG=we();mw.exports=function(t){oG(t.options.arrayFilters,t.getUpdate(),t.schema,t.model,t._mongooseOptions,t)};function oG(e,t,r,n,s,i){if(!Array.isArray(e))return;let o=Z4e(t),u=r.options.strict;if(s.strict!=null)u=s.strict;if(n?.base.options.strictQuery!=null)u=n.base.options.strictQuery;if(r._userProvidedOptions.strictQuery!=null)u=r._userProvidedOptions.strictQuery;if(s.strictQuery!=null)u=s.strictQuery;uG(e,r,u,o,i)}mw.exports.castArrayFiltersForUpdate=oG;function uG(e,t,r,n,s){let i={};for(let o of e){if(o==null)throw Error(`Got null array filter in ${e}`);let u=Object.keys(o).filter((E)=>o[E]!=null);if(u.length===0)continue;let a=[];for(let E of u)if(X4e.has(E))uG(o[E],t,r,n,s);else if(E.charAt(0)!=="$")a.push(E);if(a.length===0)continue;let c=a[0],l=c.indexOf("."),f=l===-1?c:c.substring(0,l),h=J4e(n,f);if(h==null)continue;let d=nG(h),p=sG(t,d,i),m=p!=null?p.schema:null;if(m?.discriminators!=null&&o[f+"."+m.options.discriminatorKey])m=Y4e(m.discriminators,o[f+"."+m.options.discriminatorKey])||m,i[d]=o[f+"."+m.options.discriminatorKey];for(let E of a){if(n[E]===null)continue;if(iG.hasOwnKeys(n)===!1)continue;let y=E.indexOf("."),_=y===-1?null:E.substring(y),w;if(_==null||m==null)w=p;else _=nG(_),w=sG(m,_,i);if(w==null){if(!r)continue;let C=_==null?d+".0":d+".0"+_;throw Error(`Could not find path "${C}" in schema`)}if(typeof o[E]==="object")o[E]=Q4e(s,w,o[E]);else o[E]=w.castForQuery(null,o[E])}}}});var q2=g(function(LFe,aG){aG.exports=function(t,r,n){if(!n||!r?.upsert)return;if(r.overwrite){if(!jf(t,n))t[n]=0}else if(!jf(t,n)&&!jf(t?.$set,n)&&!jf(t?.$inc,n)&&!jf(t?.$setOnInsert,n)){if(!t.$setOnInsert)t.$setOnInsert={};t.$setOnInsert[n]=0}};function jf(e,t){if(e==null||typeof e!=="object")return!1;return Object.hasOwn(e,t)}});var gw=g(function(UFe,lG){var ewe=gr();lG.exports=function(e,t,r,n,s,i){let o=n?.setDefaultsOnInsert??s?.setDefaultsOnInsert??t.base.options.setDefaultsOnInsert;if(!n.upsert||o===!1)return r;let u=Object.keys(r||{}),a=Object.create(null),c={},l=u.length,f=!1;for(let p=0;p<l;++p)if(u[p].charAt(0)==="$"){f=!0;break}let h=Object.keys(e),d=h.length;for(let p=0;p<d;++p){let m=h[p],E=e[m];if(E&&typeof E==="object"){let w=Object.keys(E),C=w.length,A=!1;for(let M=0;M<C;++M)if(w[M].charAt(0)==="$"){A=!0;break}if(A)continue}if(a[m]=!0,m.indexOf(".")===-1)continue;let y=t.paths[m]?t.paths[m].splitPath():m.split("."),_=y[0];for(let w=1;w<y.length;++w)a[_]=!0,_+="."+y[w]}if(n?.overwrite&&!f)return r;return t.eachPath(function(p,m){if(m.path==="_id"&&m.options.auto)return;let E=m.getDefault(null,!0,{context:i});if(typeof E>"u")return;let y=m.splitPath();if(y.includes("$*"))return;if(twe(r,a,p,y,f))return;if(r=r||{},r.$setOnInsert=r.$setOnInsert||{},ewe(r,p)==null)r.$setOnInsert[p]=E;c[p]=E}),r};function twe(e,t,r,n,s){if(t[r])return!0;let i=n[0];for(let o=1;o<n.length;++o){if(t[i])return!0;i+="."+n[o]}if(s){for(let o in e)if(o.charAt(0)==="$"){if(cG(e[o],r,n))return!0}}else if(cG(e,r,n))return!0;return!1}function cG(e,t,r){if(e==null||typeof e!=="object")return!1;if(Object.hasOwn(e,t))return!0;let n=r[0];for(let i=1;i<r.length;++i){if(Object.hasOwn(e,n))return!0;n+="."+r[i]}let s=t+".";for(let i in e)if(i.startsWith(s))return!0;return!1}});var Ew=g(function(VFe,Mr){var rwe=Le(),nwe=Ei(),hG=LA(),fG=VA(),swe=ac(),dG=pw(),{castArrayFiltersForUpdate:pG}=yw(),j2=Zt(),mG=q2(),{inspect:iwe}=L("util"),yG=gw();Mr.exports=function(t,r,n){let s,i=t.schema.get("timestamps");if(typeof i?.currentTime==="function")s=i.currentTime();else s=t.base.now();if(r.insertOne)return(o)=>Mr.exports.castInsertOne(t,r.insertOne,n).then(()=>o(null),(u)=>o(u));else if(r.updateOne)return(o)=>{try{Mr.exports.castUpdateOne(t,r.updateOne,n,s),o(null)}catch(u){o(u)}};else if(r.updateMany)return(o)=>{try{Mr.exports.castUpdateMany(t,r.updateMany,n,s),o(null)}catch(u){o(u)}};else if(r.replaceOne)return(o)=>{Mr.exports.castReplaceOne(t,r.replaceOne,n).then(()=>o(null),(u)=>o(u))};else if(r.deleteOne)return(o)=>{try{Mr.exports.castDeleteOne(t,r.deleteOne),o(null)}catch(u){o(u)}};else if(r.deleteMany)return(o)=>{try{Mr.exports.castDeleteMany(t,r.deleteMany),o(null)}catch(u){o(u)}};else return(o)=>{let u=new rwe(`Invalid op passed to \`bulkWrite()\`: ${iwe(r)}`);o(u,null)}};Mr.exports.castInsertOne=async function(t,r,n){let s=z1(t,r.document),i=new s(r.document);if(s.schema.options.timestamps&&L2(r,n))i.initializeTimestamps();if(n.session!=null)i.$session(n.session);let o=s?.schema?.options?.versionKey;if(o&&i[o]==null)i[o]=0;if(r.document=i,n.skipValidation||r.skipValidation)return r;return await r.document.$validate(),r};Mr.exports.castUpdateOne=function(t,r,n,s){if(!r.filter)throw Error("Must provide a filter object.");if(!r.update)throw Error("Must provide an update object.");let i=z1(t,r.filter),o=i.schema,u=n.strict??i.schema.options.strict,a=j2(r.update);Uf(o,r.filter);let c=L2(r,n);if(i.schema.$timestamps!=null&&c){let h=i.schema.$timestamps.createdAt,d=i.schema.$timestamps.updatedAt;fG(s,h,d,a,{timestamps:r.timestamps,overwriteImmutable:r.overwriteImmutable},r.upsert)}if(c)hG(s,a,i.schema);let l=t.base.options.setDefaultsOnInsert;if((r.setDefaultsOnInsert??l)!==!1)yG(r.filter,i.schema,a,{setDefaultsOnInsert:!0,upsert:r.upsert});if(mG(a,r,i.schema.options.versionKey),r.filter=Lf(i,r.filter,{strict:u,upsert:r.upsert}),Array.isArray(r.arrayFilters))r.arrayFilters=j2(r.arrayFilters),pG(r.arrayFilters,a,o,i,n);return r.update=dG(i.schema,a,{strict:u,upsert:r.upsert,arrayFilters:r.arrayFilters,overwriteDiscriminatorKey:r.overwriteDiscriminatorKey,overwriteImmutable:r.overwriteImmutable},i,r.filter),r};Mr.exports.castUpdateMany=function(t,r,n,s){if(!r.filter)throw Error("Must provide a filter object.");if(!r.update)throw Error("Must provide an update object.");let i=z1(t,r.filter),o=i.schema,u=n.strict??i.schema.options.strict,a=j2(r.update),c=t.base.options.setDefaultsOnInsert;if((r.setDefaultsOnInsert??c)!==!1)yG(r.filter,i.schema,a,{setDefaultsOnInsert:!0,upsert:r.upsert});let f=L2(r,n);if(i.schema.$timestamps!=null&&f){let h=i.schema.$timestamps.createdAt,d=i.schema.$timestamps.updatedAt;fG(s,h,d,a,{timestamps:r.timestamps,overwriteImmutable:r.overwriteImmutable},r.upsert)}if(f)hG(s,a,i.schema);if(Uf(o,r.filter),mG(a,r,i.schema.options.versionKey),r.filter=Lf(i,r.filter,{strict:u,upsert:r.upsert}),Array.isArray(r.arrayFilters))r.arrayFilters=j2(r.arrayFilters),pG(r.arrayFilters,a,o,i,n);r.update=dG(i.schema,a,{strict:u,upsert:r.upsert,arrayFilters:r.arrayFilters,overwriteDiscriminatorKey:r.overwriteDiscriminatorKey,overwriteImmutable:r.overwriteImmutable},i,r.filter)};Mr.exports.castReplaceOne=async function(t,r,n){let s=z1(t,r.filter),i=s.schema,o=n.strict??s.schema.options.strict;Uf(i,r.filter),r.filter=Lf(s,r.filter,{strict:o,upsert:r.upsert});let u=new s(r.replacement,o,{skipId:!0});if(s.schema.options.timestamps&&L2(r,n))u.initializeTimestamps();if(n.session!=null)u.$session(n.session);let a=s?.schema?.options?.versionKey;if(a&&u[a]==null)u[a]=0;if(r.replacement=u,n.skipValidation||r.skipValidation){r.replacement=r.replacement.toBSON();return}await r.replacement.$validate(),r.replacement=r.replacement.toBSON()};Mr.exports.castDeleteOne=function(t,r){let n=z1(t,r.filter),s=n.schema;Uf(s,r.filter),r.filter=Lf(n,r.filter)};Mr.exports.castDeleteMany=function(t,r){let n=z1(t,r.filter),s=n.schema;Uf(s,r.filter),r.filter=Lf(n,r.filter)};Mr.exports.cast={insertOne:Mr.exports.castInsertOne,updateOne:Mr.exports.castUpdateOne,updateMany:Mr.exports.castUpdateMany,replaceOne:Mr.exports.castReplaceOne,deleteOne:Mr.exports.castDeleteOne,deleteMany:Mr.exports.castDeleteMany};function Lf(e,t,r){try{return swe(e.schema,t,r)}catch(n){if(typeof n.setModel==="function")n.setModel(e);throw n}}function Uf(e,t){if(e==null)return;if(e.discriminatorMapping&&!e.discriminatorMapping.isRoot)t[e.discriminatorMapping.key]=e.discriminatorMapping.value}function z1(e,t){let r=e.schema.options.discriminatorKey;if(t!=null&&Object.hasOwn(t,r))e=nwe(e.discriminators,t[r])||e;return e}function L2(e,t){let r=e.timestamps,n=t.timestamps;if(r!=null)return r;else if(n!=null)return n;return!0}});var _w=g(function(zFe,gG){gG.exports=function(t,r,n){return t.mongoose=t.mongoose||{},t.mongoose.validationErrors=r,t.mongoose.results=n,t}});var Ow=g(function(WFe,SG){/*!
805
+ * Module dependencies.
806
+ */var owe=d6(),ww=L("events").EventEmitter,uwe=ic(),Ze=v2(),EG=X4(),Dt=Rs(),awe=$6(),cwe=gH(),lwe=ew(),hwe=Zt(),wG=k2(),fwe=gr(),dwe=rw(),_G=Do(),pwe=Du(),W1=we(),mwe=OH(),ba=Ew(),{modelSymbol:U2}=le(),ywe=iA(),Aw=_w(),gwe=le().arrayAtomicsSymbol,Vf=le().sessionNewDocuments,Ewe=globalThis.Date,_we=["MONGODB-X509"];function de(e){if(this.base=e,this.collections={},this.models={},this.config={},this.replica=!1,this.options=null,this.otherDbs=[],this.relatedDbs={},this.states=Ze,this._readyState=Ze.disconnected,this._closeCalled=!1,this._hasOpened=!1,this.plugins=[],typeof e>"u"||!e.connections.length)this.id=0;else this.id=e.nextConnectionId;this._queue=[]}/*!
807
+ * Inherit from EventEmitter
808
+ */Object.setPrototypeOf(de.prototype,ww.prototype);Object.defineProperty(de.prototype,"readyState",{get:function(){if(this._readyState===Ze.connected&&this._lastHeartbeatAt!=null&&this.client?.topology?.s?.description?.type!=="LoadBalanced"&&typeof this.client?.topology?.s?.description?.heartbeatFrequencyMS==="number"&&Ewe.now()-this._lastHeartbeatAt>=this.client.topology.s.description.heartbeatFrequencyMS*2)return Ze.disconnected;return this._readyState},set:function(e){if(!(e in Ze))throw new Dt("Invalid connection state: "+e);if(this._readyState!==e){this._readyState=e;for(let t of this.otherDbs)t.readyState=e;if(Ze.connected===e)this._hasOpened=!0;this.emit(Ze[e])}}});de.prototype.get=function(t){if(Object.hasOwn(this.config,t))return this.config[t];return fwe(this.options,t)};de.prototype.set=function(t,r){if(Object.hasOwn(this.config,t))return this.config[t]=r,r;return this.options=this.options||{},this.options[t]=r,r};de.prototype.collections;de.prototype.name;de.prototype.models;de.prototype.id;Object.defineProperty(de.prototype,"plugins",{configurable:!1,enumerable:!0,writable:!0});Object.defineProperty(de.prototype,"host",{configurable:!0,enumerable:!0,writable:!0});Object.defineProperty(de.prototype,"port",{configurable:!0,enumerable:!0,writable:!0});Object.defineProperty(de.prototype,"user",{configurable:!0,enumerable:!0,writable:!0});Object.defineProperty(de.prototype,"pass",{configurable:!0,enumerable:!0,writable:!0});de.prototype.db;de.prototype.client;de.prototype.config;de.prototype.createCollection=async function(t,r){if(typeof r==="function"||arguments.length>=3&&typeof arguments[2]==="function")throw new Dt("Connection.prototype.createCollection() no longer accepts a callback");return await this._waitForConnect(),this.db.createCollection(t,r)};de.prototype.bulkWrite=async function(t,r){await this._waitForConnect(),r=r||{};let n=r.ordered==null?!0:r.ordered,s=this.base.transactionAsyncLocalStorage?.getStore();if((!r||!Object.hasOwn(r,"session"))&&s?.session!=null)r={...r,session:s.session};let i=this.base.now(),o=null;if(n){let u=[];for(let a of t){if(typeof a.model!=="string"&&!a.model?.[U2])throw new Dt("Must specify model in Connection.prototype.bulkWrite() operations");let c=a.model[U2]?a.model:this.model(a.model);if(a.name==null)throw new Dt("Must specify operation name in Connection.prototype.bulkWrite()");if(!Object.hasOwn(ba.cast,a.name))throw new Dt(`Unrecognized bulkWrite() operation name ${a.name}`);await ba.cast[a.name](c,a,r,i),u.push({...a,namespace:c.namespace()})}o=await this.client.bulkWrite(u,r)}else{let u=[],a=[],c=[],l=[],f=[];for(let d=0;d<t.length;++d){let p=t[d];if(typeof p.model!=="string"&&!p.model?.[U2]){let y=new Dt("Must specify model in Connection.prototype.bulkWrite() operations");c.push({index:d,error:y}),f[d]=y;continue}let m;try{m=p.model[U2]?p.model:this.model(p.model)}catch(y){c.push({index:d,error:y});continue}if(p.name==null){let y=new Dt("Must specify operation name in Connection.prototype.bulkWrite()");c.push({index:d,error:y}),f[d]=y;continue}if(!Object.hasOwn(ba.cast,p.name)){let y=new Dt(`Unrecognized bulkWrite() operation name ${p.name}`);c.push({index:d,error:y}),f[d]=y;continue}let E=null;try{E=ba.cast[p.name](m,p,r,i)}catch(y){c.push({index:d,error:y}),f[d]=y;continue}if(ywe(E))l.push(E.then(()=>{u.push({...p,namespace:m.namespace()}),a.push(d)},(y)=>{c.push({index:d,error:y}),f[d]=y}));else u.push({...p,namespace:m.namespace()}),a.push(d)}if(l.length>0)await Promise.all(l);if(c=c.sort((d,p)=>d.index-p.index).map((d)=>d.error),u.length===0){if(r.throwOnValidationError&&c.length)throw new EG(c,f,o,"bulkWrite");let p=new(this.base.driver.get()).BulkWriteResult(dwe(),!1);return Aw(p,c,f)}let h;[o,h]=await this.client.bulkWrite(u,r).then((d)=>[d,null]).catch((d)=>[null,d]);for(let d=0;d<a.length;++d)f[a[d]]=null;if(h){if(h.writeErrors?.forEach((d,p)=>{f[a[p]]=d}),c.length>0)Aw(h,c,f),h.mongoose=h.mongoose||{},h.mongoose.validationErrors=c;throw h}if(c.length>0)if(r.throwOnValidationError)throw new EG(c,f,o,"bulkWrite");else Aw(o,c,f)}return o};de.prototype.createCollections=async function(t={}){let r={},n={},{continueOnError:s}=t;delete t.continueOnError;for(let i of Object.values(this.models))try{r[i.modelName]=await i.createCollection({})}catch(o){if(!s){n[i.modelName]=o;break}else r[i.modelName]=o}if(!s&&W1.hasOwnKeys(n)){let i=Object.entries(n).map(([u,a])=>`${u}: ${a.message}`).join(", ");throw new mwe(i,n)}return r};de.prototype.withSession=async function(t){if(arguments.length===0)throw new Dt("Please provide an executor function");return await this.client.withSession(t)};de.prototype.startSession=async function(t){if(arguments.length>=2&&typeof arguments[1]==="function")throw new Dt("Connection.prototype.startSession() no longer accepts a callback");return await this._waitForConnect(),this.client.startSession(t)};de.prototype.transaction=function(t,r){return this.startSession().then((n)=>(n[Vf]=new Map,n.withTransaction(()=>Awe(t,n,this.base),r).then((s)=>(delete n[Vf],s)).catch((s)=>{throw delete n[Vf],s}).finally(()=>{n.endSession().catch(()=>{})})))};/*!
809
+ * Reset document state in between transaction retries re: gh-13698
810
+ */async function Awe(e,t,r){AG(t);try{return r.transactionAsyncLocalStorage==null?await e(t):await new Promise((s)=>{r.transactionAsyncLocalStorage.run({session:t},()=>s(e(t)))})}catch(n){throw AG(t),n}}/*!
811
+ * If transaction was aborted, we need to reset newly inserted documents' `isNew`.
812
+ */function AG(e){for(let t of e[Vf].keys()){let r=e[Vf].get(t);if(Object.hasOwn(r,"isNew"))t.$isNew=r.isNew;if(Object.hasOwn(r,"versionKey"))t.set(t.schema.options.versionKey,r.versionKey);if(Object.hasOwn(r,"isDeleted"))t.$isDeleted(r.isDeleted);for(let n of r.modifiedPaths)t.$__.activePaths.modify(n);for(let n of r.atomics.keys()){let s=t.$__getValue(n);if(s==null)continue;s[gwe]=r.atomics.get(n)}}}de.prototype.dropCollection=async function(t){if(arguments.length>=2&&typeof arguments[1]==="function")throw new Dt("Connection.prototype.dropCollection() no longer accepts a callback");return await this._waitForConnect(),this.db.dropCollection(t)};de.prototype._waitForConnect=async function(t){if((this.readyState===Ze.connecting||this.readyState===Ze.disconnected)&&this._shouldBufferCommands()){let r=this._getBufferTimeoutMS(),n=null,s=!1,i={},o=new Promise((u)=>{i.fn=u,this._queue.push(i)});if(t)await o;else await Promise.race([o,new Promise((u)=>{n=setTimeout(()=>{s=!0,u()},r)})]);if(s){let u=this._queue.indexOf(i);if(u!==-1)this._queue.splice(u,1);let a="Connection operation buffering timed out after "+r+"ms";throw new Dt(a)}else if(n!=null)clearTimeout(n)}};/*!
813
+ * Get the default buffer timeout for this connection
814
+ */de.prototype._getBufferTimeoutMS=function(){if(this.config.bufferTimeoutMS!=null)return this.config.bufferTimeoutMS;if(this.base?.get("bufferTimeoutMS")!=null)return this.base.get("bufferTimeoutMS");return 1e4};de.prototype.listCollections=async function(){return await this._waitForConnect(),await this.db.listCollections().toArray()};de.prototype.listDatabases=async function(){throw new Dt("listDatabases() not implemented by driver")};de.prototype.dropDatabase=async function(){if(arguments.length>=1&&typeof arguments[0]==="function")throw new Dt("Connection.prototype.dropDatabase() no longer accepts a callback");await this._waitForConnect();for(let t of Object.values(this.models))delete t.$init;return this.db.dropDatabase()};/*!
815
+ * ignore
816
+ */de.prototype._shouldBufferCommands=function(){if(this.config.bufferCommands!=null)return this.config.bufferCommands;if(this.base.get("bufferCommands")!=null)return this.base.get("bufferCommands");return!0};de.prototype.error=function(t,r){if(r)return r(t),null;if(this.listeners("error").length>0)this.emit("error",t);return Promise.reject(t)};de.prototype.onOpen=function(){this.readyState=Ze.connected,this._flushQueue();for(let e in this.collections)if(Object.hasOwn(this.collections,e))this.collections[e].onOpen();this.emit("open")};de.prototype._flushQueue=function(){let t=this._queue;this._queue=[];for(let r of t)r.fn.apply(r.ctx,r.args)};de.prototype.openUri=async function(t,r){if(this.readyState===Ze.connecting||this.readyState===Ze.connected){if(this._connectionString===t)return this}this._closeCalled=!1;let n=!1;if(r&&"_fireAndForget"in r)n=r._fireAndForget,delete r._fireAndForget;try{wwe.apply(arguments)}catch(s){if(n)throw s;throw this.$initialConnection=Promise.reject(s),s}this.$initialConnection=this.createClient(t,r).then(()=>this).catch((s)=>{if(this.readyState=Ze.disconnected,this.listeners("error").length>0)pwe(()=>this.emit("error",s));throw s});for(let s of Object.values(this.models))s.init().catch(function(){});if(n)return this;try{await this.$initialConnection}catch(s){throw OG(s)}return this};de.prototype.on=function(t,r){if(t==="error"&&this.$initialConnection)this.$initialConnection.catch(()=>{});return ww.prototype.on.call(this,t,r)};de.prototype.once=function(t,r){if(t==="error"&&this.$initialConnection)this.$initialConnection.catch(()=>{});return ww.prototype.once.call(this,t,r)};/*!
817
+ * ignore
818
+ */function wwe(e,t,r){if(typeof t==="function"&&r==null)throw new Dt("Connection.prototype.openUri() no longer accepts a callback");else if(typeof r==="function")throw new Dt("Connection.prototype.openUri() no longer accepts a callback")}/*!
819
+ * ignore
820
+ */function OG(e){if(e?.name==="MongoServerSelectionError"){let t=e;e=new awe,e.assimilateError(t)}return e}de.prototype.destroy=async function(t){if(typeof t==="function"||arguments.length===2&&typeof arguments[1]==="function")throw new Dt("Connection.prototype.destroy() no longer accepts a callback");if(t!=null&&typeof t==="object")this.$wasForceClosed=!!t.force;else this.$wasForceClosed=!!t;return this._close(t,!0)};de.prototype.close=async function(t){if(typeof t==="function"||arguments.length===2&&typeof arguments[1]==="function")throw new Dt("Connection.prototype.close() no longer accepts a callback");if(t!=null&&typeof t==="object")this.$wasForceClosed=!!t.force;else this.$wasForceClosed=!!t;if(this._lastHeartbeatAt!=null)this._lastHeartbeatAt=null;for(let r of Object.values(this.models))delete r.$init;return this._close(t,!1)};de.prototype._close=async function(t,r){let n=this,s=this._closeCalled;if(this._closeCalled=!0,this._destroyCalled=r,this.client!=null)this.client._closeCalled=!0,this.client._destroyCalled=r;let i=this;switch(this.readyState){case Ze.disconnected:if(r){let o=this.base.connections.indexOf(i);if(o!==-1)this.base.connections.splice(o,1)}if(!s)await this.doClose(t),this.onClose(t);break;case Ze.connected:if(this.readyState=Ze.disconnecting,await this.doClose(t),r){let o=n.base.connections.indexOf(i);if(o!==-1)this.base.connections.splice(o,1)}this.onClose(t);break;case Ze.connecting:return new Promise((o,u)=>{let a=()=>{if(this.removeListener("open",a),this.removeListener("error",a),r)this.destroy(t).then(o,u);else this.close(t).then(o,u)};this.once("open",a),this.once("error",a)});case Ze.disconnecting:return new Promise((o)=>{this.once("close",()=>{if(r&&this.base.connections.indexOf(i)!==-1)this.base.connections.splice(this.base.connections.indexOf(i),1);o()})})}return this};de.prototype.doClose=function(){throw new Dt("Connection#doClose unimplemented by driver")};de.prototype.onClose=function(t){this.readyState=Ze.disconnected;for(let n in this.collections)if(Object.hasOwn(this.collections,n))this.collections[n].onClose(t);this.emit("close",t);let r=typeof t==="object"&&t!==null?t.force:t;for(let n of this.otherDbs)this._destroyCalled?n.destroy({force:r,skipCloseClient:!0}):n.close({force:r,skipCloseClient:!0})};de.prototype.collection=function(e,t){let r={autoIndex:this.config.autoIndex??this.base.options.autoIndex,autoCreate:this.config.autoCreate??this.base.options.autoCreate,autoSearchIndex:this.config.autoSearchIndex??this.base.options.autoSearchIndex};t=Object.assign({},r,t?hwe(t):{}),t.$wasForceClosed=this.$wasForceClosed;let n=this.base?.__driver?.Collection||wG.get().Collection;if(!(e in this.collections))this.collections[e]=new n(e,this,t);return this.collections[e]};de.prototype.plugin=function(e,t){return this.plugins.push([e,t]),this};de.prototype.model=function(t,r,n,s){if(!(this instanceof de))throw new Dt("`connection.model()` should not be run with `new`. If you are doing `new db.model(foo)(bar)`, use `db.model(foo)(bar)` instead");let i;if(typeof t==="function")i=t,t=i.name;if(typeof r==="string")n=r,r=!1;if(W1.isObject(r)){if(!r.instanceOfSchema)r=new uwe(r);else if(!(r instanceof this.base.Schema))r=r._clone(this.base.Schema)}if(r&&!r.instanceOfSchema)throw new Dt("The 2nd parameter to `mongoose.model()` should be a schema or a POJO");let o={cache:!1,overwriteModels:this.base.options.overwriteModels},u=Object.assign(o,s,{connection:this}),a=_G(this.models,t);if(a&&!n&&u.overwriteModels!==!0){if(r?.instanceOfSchema&&r!==a.schema)throw new Dt.OverwriteModelError(t);return a}let c;if(r?.instanceOfSchema){if(lwe(r,this.plugins,null,"$connectionPluginsApplied"),c=this.base._model(i||t,r,n,u),!_G(this.models,t))this.models[t]=c;return c.init().catch(function(){}),c}if(a&&n)return c=a,r=c.prototype.schema,c.__subclass(this,r,n);if(arguments.length===1){if(c=a,!c)throw new Dt.MissingSchemaError(t);return c}if(!c)throw new Dt.MissingSchemaError(t);if(this===c.prototype.db&&(!n||n===c.collection.name)){if(!this.models[t])this.models[t]=c;return c}return this.models[t]=c.__subclass(this,r,n),this.models[t]};de.prototype.deleteModel=function(t){if(typeof t==="string"){let r=this.model(t);if(r==null)return this;let n=r.collection.name;delete this.models[t],delete this.collections[n],this.emit("deleteModel",r)}else if(t instanceof RegExp){let r=t,n=this.modelNames();for(let s of n)if(r.test(s))this.deleteModel(s)}else throw new Dt('First parameter to `deleteModel()` must be a string or regexp, got "'+t+'"');return this};de.prototype.watch=function(t,r){let n=this._waitForConnect().then(()=>this.db.watch(t,r));return new owe(n,t,r)};de.prototype.asPromise=async function(){try{return await this.$initialConnection,this}catch(t){throw OG(t)}};de.prototype.modelNames=function(){return Object.keys(this.models)};de.prototype.shouldAuthenticate=function(){return this.user!=null&&(this.pass!=null||this.authMechanismDoesNotRequirePassword())};de.prototype.authMechanismDoesNotRequirePassword=function(){if(this.options?.auth)return _we.indexOf(this.options.auth.authMechanism)>=0;return!0};de.prototype.optionsProvideAuthenticationData=function(t){return t&&t.user&&(t.pass||this.authMechanismDoesNotRequirePassword())};de.prototype.getClient=function(){return this.client};de.prototype.setClient=function(){throw new Dt("Connection#setClient not implemented by driver")};/*!
821
+ * Called internally by `openUri()` to create a MongoClient instance.
822
+ */de.prototype.createClient=function(){throw new Dt("Connection#createClient not implemented by driver")};de.prototype.syncIndexes=async function(t={}){let r={},n={},{continueOnError:s}=t;delete t.continueOnError;for(let i of Object.values(this.models))try{r[i.modelName]=await i.syncIndexes(t)}catch(o){if(!s){n[i.modelName]=o;break}else r[i.modelName]=o}if(!s&&W1.hasOwnKeys(n)){let i=Object.entries(n).map(([u,a])=>`${u}: ${a.message}`).join(", ");throw new cwe(i,n)}return r};/*!
823
+ * Module exports.
824
+ */de.STATES=Ze;SG.exports=de});var Sw=g(function(KFe,Owe){Owe.exports={name:"mongoose",description:"Mongoose MongoDB ODM",version:"9.13.2",author:"Guillermo Rauch <guillermo@learnboost.com>",keywords:["mongodb","document","model","schema","database","odm","data","datastore","query","nosql","orm","db"],type:"commonjs",license:"MIT",dependencies:{"@standard-schema/spec":"^1.1.0",kareem:"3.4.1",mongodb:"~7.9",mpath:"0.9.0",mquery:"6.0.1",ms:"2.1.3",sift:"17.1.4"},devDependencies:{"@ark/attest":"0.58.1","@eslint/js":"^9.39.3","@mongodb-js/mongodb-downloader":"^3.0.5","@types/node":"^20.19.0",acquit:"1.4.0","acquit-ignore":"0.2.2","acquit-require":"0.1.1",ajv:"8.20.0",c8:"12.0.0",cheerio:"1.2.0",dox:"1.0.0",eslint:"10.16.0","eslint-plugin-mocha-no-only":"1.2.0",express:"5.3.0","fs-extra":"~11.4.0",globals:"^17.4.0","highlight.js":"11.12.0",linkinator:"8.x","lodash.isequal":"4.5.0","lodash.isequalwith":"4.4.0","markdownlint-cli2":"0.24.2",marked:"18.3.0",mkdirp:"^3.0.1",mocha:"12.0.3",moment:"2.31.0","mongodb-client-encryption":"^7.2.0","mongodb-memory-server":"11.4.0","mongodb-runner":"^6.0.0",ncp:"^2.0.0",pug:"3.0.4",sinon:"22.1.0",tstyche:"^7.0.0",typescript:"5.9.3","typescript-eslint":"^8.31.1",uuid:"14.0.3",xss:"1.0.17"},directories:{lib:"./lib/mongoose"},scripts:{"docs:clean":"npm run docs:clean:stable","docs:clean:stable":"rm -rf index.html && rm -rf ./docs/*.html && rm -rf ./docs/api && rm -rf ./docs/tutorials/*.html && rm -rf ./docs/typescript/*.html && rm -rf ./docs/production/*.html && rm -rf ./docs/*.html && rm -rf ./docs/source/_docs && rm -rf ./tmp","docs:clean:5x":"rm -rf index.html && rm -rf ./docs/5.x && rm -rf ./docs/source/_docs && rm -rf ./tmp","docs:clean:6x":"rm -rf index.html && rm -rf ./docs/6.x && rm -rf ./docs/source/_docs && rm -rf ./tmp","docs:copy:tmp":"mkdirp ./tmp/docs/css && mkdirp ./tmp/docs/js && mkdirp ./tmp/docs/images && mkdirp ./tmp/docs/tutorials && mkdirp ./tmp/docs/typescript && mkdirp ./tmp/docs/production && mkdirp ./tmp/docs/api && ncp ./docs/css ./tmp/docs/css --filter=.css$ && ncp ./docs/js ./tmp/docs/js --filter=.js$ && ncp ./docs/images ./tmp/docs/images && ncp ./docs/tutorials ./tmp/docs/tutorials && ncp ./docs/typescript ./tmp/docs/typescript && ncp ./docs/production ./tmp/docs/production && ncp ./docs/api ./tmp/docs/api && cp index.html ./tmp && cp docs/*.html ./tmp/docs/","docs:copy:tmp:5x":"rm -rf ./docs/5.x && ncp ./tmp ./docs/5.x","docs:copy:tmp:6x":"rm -rf ./docs/6.x && ncp ./tmp ./docs/6.x","docs:generate":"node ./scripts/website.js","docs:generate:sponsorData":"node ./scripts/loadSponsorData.js","docs:test":"npm run docs:generate","docs:view":"node ./scripts/static.js","docs:prepare:publish:stable":"git checkout gh-pages && git merge master && env GENERATE_SEARCH=true npm run docs:generate","docs:prepare:publish:5x":"git checkout 5.x && git merge 5.x && npm run docs:clean:stable && npm run docs:generate && npm run docs:copy:tmp && git checkout gh-pages && npm run docs:copy:tmp:5x","docs:prepare:publish:6x":"git checkout 6.x && git merge 6.x && npm run docs:clean:stable && env DOCS_DEPLOY=true npm run docs:generate && mv ./docs/6.x ./tmp && git checkout gh-pages && npm run docs:copy:tmp:6x","docs:prepare:publish:7x":"env DOCS_DEPLOY=true npm run docs:generate && git checkout gh-pages && rm -rf ./docs/7.x && mv ./tmp ./docs/7.x","docs:prepare:publish:8x":"env DOCS_DEPLOY=true npm run docs:generate && git checkout gh-pages && rm -rf ./docs/8.x && mv ./tmp ./docs/8.x","docs:check-links":'linkinator http://127.0.0.1:8089 --silent --recurse --skip cdn.carbonads.com --skip m.servedby-buysellads.com --skip "127\\.0\\.0\\.1:8089/docs/\\d+.x"',"docs:update-mongodb-links":"node ./scripts/update-mongodb-links.js",checkLibCharset:"node ./scripts/checkLibCharset.js",lint:"eslint .","lint-js":"eslint . --ext .js --ext .cjs","lint-ts":"eslint . --ext .ts","lint-md":'markdownlint-cli2 "docs/**/*.md" "docs/*.md" "*.md"',release:"git pull && git push origin master --tags && npm publish","release-5x":"git pull origin 5.x && git push origin 5.x && git push origin 5.x --tags && npm publish --tag 5x","release-6x":"git pull origin 6.x && git push origin 6.x && git push origin 6.x --tags && npm publish --tag 6x",mongo:"node ./tools/repl.js","publish-7x":"npm publish --tag 7x","create-separate-require-instance":"rm -rf ./node_modules/mongoose-separate-require-instance && node ./scripts/create-tarball && tar -xzf mongoose.tgz -C ./node_modules && mv ./node_modules/package ./node_modules/mongoose-separate-require-instance",test:'mocha --exit --ignore "test/encryption/**/*.test.js" "./test/**/*.test.js"',"test:ci":"npm run test -- --reporter min --timeout 10000","test-deno":"deno run --allow-env --allow-read --allow-net --allow-run --allow-sys --allow-write ./test/deno.mjs","test-deno:ci":"npm run test-deno -- --reporter min","test-rs":'START_REPLICA_SET=1 mocha --timeout 30000 --exit --ignore "test/encryption/**/*.test.js" "./test/**/*.test.js"',"test-rs:ci":"npm run test-rs -- --reporter min","test:types":"tstyche","setup-test-encryption":"node scripts/setup-encryption-tests.js","test-encryption":"mocha --exit ./test/encryption/*.test.js","test-encryption:ci":"npm run test-encryption -- --reporter min",tdd:'mocha --watch --inspect --ignore "test/encryption/**/*.test.js" "./test/**/*.test.js" --watch-files lib/**/*.js test/**/*.js',"test-coverage":"c8 --reporter=html --reporter=text npm test","test-coverage:ci":"c8 --reporter=html --reporter=text npm run test:ci","ts-benchmark":"cd ./benchmarks/typescript/simple && npm install && npm run benchmark | node ../../../scripts/tsc-diagnostics-check","ts-benchmark:local":"node ./scripts/create-tarball && cd ./benchmarks/typescript/simple && rm -rf ./node_modules && npm install && npm run benchmark | node ../../../scripts/tsc-diagnostics-check","attest-benchmark":"node ./benchmarks/typescript/infer.bench.mts"},main:"./index.js",types:"./types/index.d.ts",engines:{node:">=20.19.0"},bugs:{url:"https://github.com/Automattic/mongoose/issues/new"},repository:{type:"git",url:"git://github.com/Automattic/mongoose.git"},homepage:"https://mongoosejs.com",config:{mongodbMemoryServer:{disablePostinstall:!0}},funding:{type:"opencollective",url:"https://opencollective.com/mongoose"}}});var bG=g(function(HFe,CG){var Swe=Zt(),Cwe=Rs();function bwe(e,t){let r=t?t:{},n=r.readPreference?xwe(r.readPreference):Pwe(e),s=Swe(r);return n&&n!=="primary"&&n!=="primaryPreferred"?Dwe(n,s):s}function Dwe(e,t){if(Twe(t)&&Mwe(e))Bwe();else return Fwe(t)}function Twe(e){let t=e.config?.autoIndex,{autoCreate:r,autoIndex:n}=e;return!!(t||r||n)}function Mwe(e){return e==="secondary"||e==="secondaryPreferred"}function xwe(e){return typeof e==="string"?e:e.mode}function Pwe(e){let r=/(?:&|\?)readPreference=(\w+)(?:&|$)/.exec(e);return r?r[1]:null}function Fwe(e){return e.config={autoIndex:!1},e.autoCreate=!1,e.autoIndex=!1,e}function Bwe(){throw new Cwe('MongoDB prohibits index creation on connections that read from non-primary replicas. Connections that set "readPreference" to "secondary" or "secondaryPreferred" may not opt-in to the following connection options: autoCreate, autoIndex')}CG.exports=bwe});var DG=g(function(Nwe){Nwe.setTimeout=setTimeout});var xG=g(function(YFe,MG){/*!
825
+ * Module dependencies.
826
+ */var V2=Ow(),dc=Rs(),wt=v2(),z2=qu(),TG=Sw(),$we=bG(),Rwe=DG().setTimeout,No=we(),vwe=ic(),kwe=globalThis.Date;function Yi(){V2.apply(this,arguments),this._listening=!1,this._lastHeartbeatAt=null}Yi.STATES=wt;/*!
827
+ * Inherits from Connection.
828
+ */Object.setPrototypeOf(Yi.prototype,V2.prototype);Yi.prototype.useDb=function(e,t){if(t=t||{},t.useCache&&this.relatedDbs[e])return this.relatedDbs[e];let r=new this.constructor;r.name=e,r.base=this.base,r.collections={},r.models={},r.replica=this.replica,r.config=Object.assign({},this.config,r.config),r.name=this.name,r.options=this.options,r._readyState=this._readyState,r._closeCalled=this._closeCalled,r._hasOpened=this._hasOpened,r._listening=!1,r._parent=this,r.host=this.host,r.port=this.port,r.user=this.user,r.pass=this.pass;let n=this;if(r.client=n.client,this.db&&this._readyState===wt.connected)s();else this._queue.push({fn:s});function s(){r.client=n.client,r.db=n.client.db(e),r._lastHeartbeatAt=n._lastHeartbeatAt,r.onOpen()}if(r.name=e,this.otherDbs.push(r),r.otherDbs.push(this),t?.useCache)this.relatedDbs[r.name]=r,r.relatedDbs=this.relatedDbs;return r};Yi.prototype.aggregate=function(t,r){return new this.base.Aggregate(null,this).append(t).option(r??{})};Yi.prototype.removeDb=function(t){let r=this.otherDbs.filter((n)=>n.name===t);if(!r.length)throw new dc(`No connections to database "${t}" found`);for(let n of r)n._closeCalled=!0,n._destroyCalled=!0,n._readyState=wt.disconnected,n.$wasForceClosed=!0;delete this.relatedDbs[t],this.otherDbs=this.otherDbs.filter((n)=>n.name!==t)};Yi.prototype.doClose=async function(t){if(this.client==null)return this;let r=!1;if(t!=null&&typeof t==="object")r=t.skipCloseClient,t=t.force;if(r)return this;return await this.client.close(t),await new Promise((n)=>Rwe(n,1)),this};Yi.prototype.listDatabases=async function(){return await this._waitForConnect(),await this.db.admin().listDatabases()};/*!
829
+ * ignore
830
+ */Yi.prototype.createClient=async function(t,r){if(typeof t!=="string")throw new dc(`The \`uri\` parameter to \`openUri()\` must be a string, got "${typeof t}". Make sure the first parameter to \`mongoose.connect()\` or \`mongoose.createConnection()\` is a string.`);if(this._destroyCalled)throw new dc("Connection has been closed and destroyed, and cannot be used for re-opening the connection. Please create a new connection with `mongoose.createConnection()` or `mongoose.connect()`.");if(this.readyState===wt.connecting||this.readyState===wt.connected){if(this._connectionString!==t)throw new dc("Can't call `openUri()` on an active connection with different connection strings. Make sure you aren't calling `mongoose.connect()` multiple times. See: https://mongoosejs.com/docs/connections.html#multiple_connections")}if(r=$we(t,r),r){let u=r.config?.autoIndex??r.autoIndex;if(u!=null)this.config.autoIndex=u!==!1,delete r.config,delete r.autoIndex;if("autoCreate"in r)this.config.autoCreate=!!r.autoCreate,delete r.autoCreate;if("sanitizeFilter"in r)this.config.sanitizeFilter=r.sanitizeFilter,delete r.sanitizeFilter;if("autoSearchIndex"in r)this.config.autoSearchIndex=r.autoSearchIndex,delete r.autoSearchIndex;if("bufferTimeoutMS"in r)this.config.bufferTimeoutMS=r.bufferTimeoutMS,delete r.bufferTimeoutMS;if(r.user||r.pass)r.auth=r.auth||{},r.auth.username=r.user,r.auth.password=r.pass,this.user=r.user,this.pass=r.pass;if(delete r.user,delete r.pass,r.bufferCommands!=null)this.config.bufferCommands=r.bufferCommands,delete r.bufferCommands}else r={};this._connectionOptions=r;let n=r.dbName;if(n!=null)this.$dbName=n;if(delete r.dbName,!No.hasUserDefinedProperty(r,"driverInfo"))r.driverInfo={name:"Mongoose",version:TG.version};let{schemaMap:s,encryptedFieldsMap:i}=this._buildEncryptionSchemas();if((No.hasOwnKeys(s)||No.hasOwnKeys(i))&&!r.autoEncryption)throw Error("Must provide `autoEncryption` when connecting with encrypted schemas.");if(No.hasOwnKeys(s))r.autoEncryption.schemaMap=s;if(No.hasOwnKeys(i))r.autoEncryption.encryptedFieldsMap=i;this.readyState=wt.connecting,this._connectionString=t;let o;try{o=new z2.MongoClient(t,r)}catch(u){throw this.readyState=wt.disconnected,u}this.client=o,o.setMaxListeners(0),await o.connect(),Cw(this,o,r,n);for(let u of this.otherDbs)Cw(u,o,{},u.name);return this};Yi.prototype._buildEncryptionSchemas=function(){let e={},t={},r=Object.values(this.models).filter((i)=>i.schema._hasEncryptedFields());for(let i of r){let{schema:o,collection:{collectionName:u}}=i,a=`${this.$dbName}.${u}`,c=o.encryptionType()==="csfle"?t:e;if(c[a]??=new vwe({},{encryptionType:o.encryptionType()}),o.discriminatorMapping&&!o.discriminatorMapping.isRoot){let f=o._baseSchema;o.eachPath((h)=>{if(f.path(h))return;if(!c[a]._hasEncryptedField(h))return;throw Error(`Cannot have duplicate keys in discriminators with encryption. key=${h}`)})}c[a].add(o)}let n=Object.fromEntries(Object.entries(t).map(([i,o])=>[i,o._buildSchemaMap()])),s=Object.fromEntries(Object.entries(e).map(([i,o])=>[i,o._buildEncryptedFields()]));return{schemaMap:n,encryptedFieldsMap:s}};/*!
831
+ * ignore
832
+ */Yi.prototype.setClient=function(t){if(!(t instanceof z2.MongoClient))throw new dc("Must call `setClient()` with an instance of MongoClient");if(this.readyState!==wt.disconnected)throw new dc("Cannot call `setClient()` on a connection that is already connected.");if(t.topology==null)throw new dc("Cannot call `setClient()` with a MongoClient that you have not called `connect()` on yet.");this._connectionString=t.s.url,Cw(this,t,{},t.s.options.dbName);for(let r of Object.values(this.models))r.init().catch(function(){});return this};/*!
833
+ * ignore
834
+ */function Cw(e,t,r,n){let s=n!=null?t.db(n):t.db();e.db=s,e.client=t,e.host=t?.s?.options?.hosts?.[0]?.host,e.port=t?.s?.options?.hosts?.[0]?.port,e.name=n!=null?n:s.databaseName,e._closeCalled=t._closeCalled;let i=()=>{if(e.readyState!==wt.connected)e.readyState=wt.connected,e.emit("reconnect"),e.emit("reconnected"),e.onOpen()},o=t?.topology?.description?.type||"";if(o==="Single")t.on("serverDescriptionChanged",(u)=>{if(u.newDescription.type==="Unknown")e.readyState=wt.disconnected;else i()});else if(o.startsWith("ReplicaSet"))t.on("topologyDescriptionChanged",(u)=>{let a=u.newDescription;if(e.readyState===wt.connected&&a.type!=="ReplicaSetWithPrimary")e.readyState=wt.disconnected;else if(e.readyState===wt.disconnected&&a.type==="ReplicaSetWithPrimary")i()});if(e._lastHeartbeatAt=null,t.on("serverHeartbeatSucceeded",()=>{e._lastHeartbeatAt=kwe.now();for(let u of e.otherDbs)u._lastHeartbeatAt=e._lastHeartbeatAt;if(e._queue.length>0&&e.readyState===wt.connected)e._flushQueue();for(let u of e.otherDbs)if(u._queue.length>0&&u.readyState===wt.connected)u._flushQueue();for(let u of Object.values(e.collections))if(u.buffer)u.onOpen()}),r.monitorCommands)t.on("commandStarted",(u)=>e.emit("commandStarted",u)),t.on("commandFailed",(u)=>e.emit("commandFailed",u)),t.on("commandSucceeded",(u)=>e.emit("commandSucceeded",u));e.onOpen();for(let u in e.collections)if(Object.hasOwn(e.collections,u))e.collections[u].onOpen()}/*!
835
+ * Module exports.
836
+ */MG.exports=Yi});var PG=g(function(qwe){/*!
837
+ * Module exports.
838
+ */qwe.BulkWriteResult=m8();qwe.Collection=vq();qwe.Connection=xG();qwe.ClientEncryption=qu().ClientEncryption});var BG=g(function(JFe,FG){/*!
839
+ * Valid mongoose options
840
+ */var zwe=Object.freeze(["allowDiskUse","applyPluginsToChildSchemas","applyPluginsToDiscriminators","autoCreate","autoIndex","autoSearchIndex","bufferCommands","bufferTimeoutMS","cloneSchemas","createInitialConnection","debug","forceRepopulate","id","maxTimeMS","objectIdGetter","overwriteModels","returnDocument","returnOriginal","runValidators","sanitizeFilter","sanitizeProjection","selectPopulatedPaths","setDefaultsOnInsert","strict","strictPopulate","strictQuery","strictRead","timestamps.createdAt.immutable","toJSON","toObject","transactionAsyncLocalStorage","translateAliases","updatePipeline"]);FG.exports=zwe});var IG=g(function(XFe,NG){/*!
841
+ * Module dependencies.
842
+ */var Wwe=Le();class bw extends Wwe{constructor(e){let t=e.map((r)=>r.message).join(", ");if(t.length>50)t=t.slice(0,50)+"...";super(`eachAsync() finished with ${e.length} errors: ${t}`);this.errors=e}}Object.defineProperty(bw.prototype,"name",{value:"EachAsyncMultiError"});/*!
843
+ * exports
844
+ */NG.exports=bw});var Tw=g(function(ZFe,RG){/*!
845
+ * Module dependencies.
846
+ */var Kwe=IG(),Dw=Du();RG.exports=async function(t,r,n){let s=n.parallel||1,{batchSize:i,signal:o,continueOnError:u}=n,a=[],c=Hwe(),l=!1;return new Promise((d,p)=>{if(o!=null){if(o.aborted)return d(null);o.addEventListener("abort",()=>(l=!0,d(null)),{once:!0})}if(i!=null){if(typeof i!=="number")throw TypeError("batchSize must be a number");else if(!Number.isInteger(i))throw TypeError("batchSize must be an integer");else if(i<1)throw TypeError("batchSize must be at least 1")}f((m,E)=>{if(m!=null)return p(m);d(E)})});function f(d){let p=0,m=0,E=null;for(let _=0;_<s;++_)c(y());function y(){let _=[],w=!1;return C;function C(A){if(w||l)return A();else if(E)return A();t(function(M,O){if(E!=null)return A();if(M!=null)if(M.name==="MongoCursorExhaustedError")O=null;else if(u)a.push(M);else return E=M,d(M),A();if(O==null){if(w=!0,p<=0){let P=u?$G(a):E;d(P)}else if(i&&_.length)h(_,m++,v);return A()}if(++p,Dw(()=>A()),i)_.push(O);if(i&&_.length!==i){Dw(()=>c(C));return}let x=i?_:O;function v(P){if(i)p-=_.length,_=[];else--p;if(P!=null)if(u)a.push(P);else return E=P,d(P);if((w||l)&&p<=0){let ge=u?$G(a):E;return d(ge)}Dw(()=>c(C))}h(x,m++,v)})}}}function h(d,p,m){let E;try{E=r(d,p)}catch(y){return m(y)}if(typeof E?.then==="function")E.then(function(){m(null)},function(y){m(y||Error("`eachAsync()` promise rejected without error"))});else m(null)}};function Hwe(){let e=[],t=null,r=0;return function(i){if(t===null&&e.length===0)return t=r++,i(n);e.push(i)};function n(){if(e.length!==0)t=r++,e.shift()(n);else t=null}}function $G(e){if(e.length===0)return null;return new Kwe(e)}});var Mw=g(function(eBe,vG){vG.exports=function(t){return new Promise((r)=>{let n=()=>{if(!t._initializationComplete)return;t.removeListener("cursor",n),t.removeListener("error",n),r()};t.on("cursor",n),t.on("error",n)})}});var K1=g(function(tBe,qG){var W2;try{W2=typeof process<"u"&&"getBuiltinModule"in process?process.getBuiltinModule("node:diagnostics_channel"):L("diagnostics_channel")}catch{}var Gwe=!!W2&&typeof W2.tracingChannel==="function";function Ywe(e){return!!e&&e.hasSubscribers!==!1}function kG(e){let t=Gwe?W2.tracingChannel(e):void 0;function r(n,s){if(!Ywe(t))return n();return t.tracePromise(n,s())}return{channel:t,trace:r}}qG.exports={createTracedChannel:kG,cursorNextChannel:kG("mongoose:cursor:next")}});var HG=g(function(rBe,KG){/*!
847
+ * Module dependencies.
848
+ */var zf=Le(),VG=L("stream").Readable,Qwe=Tw(),Jwe=Mw(),G2=pf(),zG=Ja(),xw=Du(),{once:Xwe}=L("events"),Y2=L("util"),{cursorNextChannel:Zwe}=K1(),{buildMiddlewareFilter:jG}=Jo();function Cs(e){VG.call(this,{autoDestroy:!0,objectMode:!0}),this.cursor=null,this._initializationComplete=!1,this.skipped=!1,this.query=e,this._closed=!1;let t=e.model;this._mongooseOptions={},this._transforms=[],this.model=t,this.options={},this._postMiddlewareFilter=null;let r=(s)=>{if(s!=null){if(this._initializationComplete=!0,s instanceof zG.skipWrappedFunction){let a=s.args[0];if(a!=null&&(!Array.isArray(a)||a.length)){let c=new zf('Cannot `skipMiddlewareFunction()` with a value when using `.find().cursor()`, value must be nullish or empty array, got "'+Y2.inspect(a)+'".');if(this._markError(c),this.listeners("error").length>0)this._errorEmitted=!0,this.emit("error",c);return}this.skipped=!0,this.emit("cursor",null);return}if(this._markError(s),this.listeners("error").length>0)this._errorEmitted=!0,this.emit("error",s);return}let i=null;try{i=e._optionsForExec()}catch(a){this._markError(a),this.listeners("error").length>0&&this.emit("error",a);return}let{middleware:o,...u}=i;if(Object.assign(this.options,u),Object.hasOwn(this.options,"middleware"))delete this.options.middleware;if(this._postMiddlewareFilter=jG(e.options,"post"),this._transforms=this._transforms.concat(e._transforms.slice()),this.options.transform)this._transforms.push(this.options.transform);if(this.options.batchSize)this.options._populateBatchSize=Math.min(this.options.batchSize,5000);if(e._mongooseOptions._asyncIterator)this._mongooseOptions._asyncIterator=!0;if(t.collection._shouldBufferCommands()&&t.collection.buffer)t.collection.queue.push([()=>LG(e,this)]);else LG(e,this)},n=jG(e.options,"pre");t.hooks.execPre("find",e,[],{filter:n}).then(()=>r(null)).catch((s)=>r(s))}Y2.inherits(Cs,VG);/*!
849
+ * ignore
850
+ */function LG(e,t){try{let r=e.model.collection.find(e._conditions,t.options);t.cursor=r,t._initializationComplete=!0,t.emit("cursor",r)}catch(r){if(t._initializationComplete=!0,t._markError(r),t.listeners("error").length>0)t._errorEmitted=!0,t.emit("error",t._error)}}Cs.prototype._read=function(){Q2(this,(e,t)=>{if(e)return this._errorEmitted=!0,this.emit("error",e);if(!t){this.push(null),this.cursor.close((r)=>{if(r)return this.emit("error",r)});return}this.push(t)})};Cs.prototype.getDriverCursor=async function(){if(this.cursor)return this.cursor;if(this._error)throw this._error;return await Xwe(this,"cursor"),this.cursor};Object.defineProperty(Cs.prototype,"map",{value:function(e){return this._transforms.push(e),this},enumerable:!0,configurable:!0,writable:!0});Cs.prototype._markError=function(e){return this._error=e,this};Cs.prototype.close=async function(){if(typeof arguments[0]==="function")throw new zf("QueryCursor.prototype.close() no longer accepts a callback");try{await this.cursor.close(),this._closed=!0,this.emit("close")}catch(t){if(this.listeners("error").length>0)this._errorEmitted=!0,this.emit("error",t);throw t}};Cs.prototype._destroy=function(t,r){let n=null;if(!this._initializationComplete)n=Jwe(this);else n=Promise.resolve();return n.then(()=>this.cursor?.close()).then(()=>{this._closed=!0;let s=!this._errorEmitted&&this.listeners("error").length>0;r(s?t:null)}).catch((s)=>{r(s)}),this};Cs.prototype.rewind=function(){return WG(this,()=>{this.cursor.rewind()}),this};Cs.prototype.next=async function(){if(typeof arguments[0]==="function")throw new zf("QueryCursor.prototype.next() no longer accepts a callback");if(this._closed)throw new zf("Cannot call `next()` on a closed cursor");let t=this;return Zwe.trace(function(){return new Promise((n,s)=>{Q2(t,function(i,o){if(i)return s(i);n(o)})})},()=>({operation:t.query.op||"find",collection:t.query.mongooseCollection.name,database:t.model.db?.name,serverAddress:t.model.db?.host,serverPort:t.model.db?.port,batchSize:t.options.batchSize||t.query.options?.batchSize,tailable:t.options.tailable||t.query.options?.tailable||!1,args:{filter:t.query.getFilter(),options:t.query._mongooseOptions}}))};Cs.prototype.eachAsync=function(e,t){if(typeof arguments[2]==="function")throw new zf("QueryCursor.prototype.eachAsync() no longer accepts a callback");if(typeof t==="function")t={};return t=t||{},Qwe((r)=>Q2(this,r),e,t)};Cs.prototype.options;Cs.prototype.addCursorFlag=function(e,t){return WG(this,()=>{this.cursor.addCursorFlag(e,t)}),this};if(Symbol.asyncIterator!=null)Cs.prototype[Symbol.asyncIterator]=function(){return this._mongooseOptions._asyncIterator=!0,this};function Q2(e,t){let r=t;if(r=function(n,s){if(n)return t(n);if(s===null)if(e._mongooseOptions._asyncIterator)return t(null,{done:!0});else return t(null,null);if(e._transforms.length&&s!==null)s=e._transforms.reduce(function(i,o){return o.call(e,i)},s);if(e._mongooseOptions._asyncIterator)return t(null,{value:s,done:!1});return t(null,s)},e._error)return xw(function(){r(e._error)});if(e.skipped)return xw(()=>r(null,null));if(e.cursor){if(e.query._mongooseOptions.populate&&!e._pop)e._pop=G2.preparePopulationOptionsMQ(e.query,e.query._mongooseOptions),e._pop.__noPromise=!0;if(e.query._mongooseOptions.populate&&e.options._populateBatchSize>1)if(e._batchDocs&&e._batchDocs.length)return K2(e,e._batchDocs.shift(),e._pop,r);else if(e._batchExhausted)return r(null,null);else{e._batchDocs=[],e.cursor.next().then((n)=>{H2.call({ctx:e,callback:r},null,n)},(n)=>{H2.call({ctx:e,callback:r},n)});return}else return e.cursor.next().then((n)=>{if(!n){r(null,null);return}if(!e.query._mongooseOptions.populate)return K2(e,n,null,r);K2(e,n,e._pop,(s,i)=>{if(s!=null)return r(s);e.query.model.populate(i,e._pop).then((o)=>r(null,o),(o)=>r(o))})},(n)=>{r(n)})}else e.once("error",t),e.once("cursor",function(n){if(e.removeListener("error",t),n==null){if(e.skipped)return t(null,null);return}Q2(e,t)})}/*!
851
+ * ignore
852
+ */function H2(e,t){if(e)return this.callback(e);if(!t)return this.ctx._batchExhausted=!0,UG.call(this);if(this.ctx._batchDocs.push(t),this.ctx._batchDocs.length<this.ctx.options._populateBatchSize)xw(()=>this.ctx.cursor.next().then((r)=>{H2.call(this,null,r)},(r)=>{H2.call(this,r)}));else UG.call(this)}/*!
853
+ * ignore
854
+ */function UG(){if(!this.ctx._batchDocs.length)return this.callback(null,null);this.ctx.query.model.populate(this.ctx._batchDocs,this.ctx._pop).then(()=>{K2(this.ctx,this.ctx._batchDocs.shift(),this.ctx._pop,this.callback)},(e)=>{this.callback(e)})}/*!
855
+ * ignore
856
+ */function K2(e,t,r,n){if(e.query._mongooseOptions.lean)return e.model.hooks.execPost("find",e.query,[[t]],{filter:e._postMiddlewareFilter}).then(()=>n(null,t),(a)=>n(a));let{model:s,_fields:i,_userProvidedFields:o,options:u}=e.query;G2.createModelAndInit(s,t,i,o,u,r,(a,c)=>{if(a!=null)return n(a);if(u.session!=null)c.$session(u.session);e.model.hooks.execPost("find",e.query,[[c]],{filter:e._postMiddlewareFilter}).then(()=>n(null,c),(l)=>n(l))})}/*!
857
+ * ignore
858
+ */function WG(e,t){if(e.cursor)return t();e.once("cursor",function(r){if(r==null)return;t()})}KG.exports=Cs});var Pw=g(function(nBe,YG){var H1=we();function eOe(e,t,r){GG(e,t,r,"maxTimeMS")}function tOe(e,t,r){GG(e,t,r,"allowDiskUse")}YG.exports={applyGlobalMaxTimeMS:eOe,applyGlobalDiskUse:tOe};function GG(e,t,r,n){if(H1.hasUserDefinedProperty(e,n))return;if(H1.hasUserDefinedProperty(t,n))e[n]=t[n];else if(H1.hasUserDefinedProperty(r,n))e[n]=r[n]}});var Fw=g(function(sBe,QG){QG.exports=function(t,r){if(r.readConcern!==void 0)return;if(r?.session?.transaction)return;let n=t.options?.readConcern?.level;if(n!=null)r.readConcern={level:n}}});var Bw=g(function(iBe,XG){var JG=we();XG.exports=function(t,r){if(r.writeConcern!=null)return;if(r?.session?.transaction)return;let n=t.options.writeConcern??{};if(JG.hasOwnKeys(n)){if(r.writeConcern={},!("w"in r)&&n.w!=null)r.writeConcern.w=n.w;if(!("j"in r)&&n.j!=null)r.writeConcern.j=n.j;if(!("wtimeout"in r)&&n.wtimeout!=null)r.writeConcern.wtimeout=n.wtimeout}else{if(!("w"in r)&&n.w!=null)r.w=n.w;if(!("j"in r)&&n.j!=null)r.j=n.j;if(!("wtimeout"in r)&&n.wtimeout!=null)r.wtimeout=n.wtimeout}}});var nY=g(function(oBe,rY){var ZG=Q0(),eY=Zt(),tY=ma();/*!
859
+ * Deep clone a query's `_mongooseOptions` so a cloned query doesn't share state with the
860
+ * original. `clone()` returns class instances as-is, so explicitly copy `PopulateOptions`,
861
+ * including nested populate: populate options are mutable, and executing a query writes
862
+ * per-execution state like `session` and `lean` into them.
863
+ */rY.exports=function(t){let{populate:r,...n}=t,s=eY(n);if(r!=null){s.populate={};for(let i of Object.keys(r)){if(tY.has(i))continue;s.populate[i]=Nw(r[i])}}return s};function Nw(e){if(Array.isArray(e))return e.map(Nw);if(e==null||typeof e!=="object")return e;let{populate:t,_docs:r,_childDocs:n,...s}=e,i=e instanceof ZG?new ZG(s):eY(s);if(t!==void 0)i.populate=Nw(t);return i}});var J2=g(function(uBe,sY){var rOe=E1(),nOe=Co();/*!
864
+ * ignore
865
+ */sY.exports=function e(t){if(t==null)return!1;let r=Object.keys(t),n=r.length;if(n===0)return!1;for(let s=0;s<n;++s){let i=r[s];if(i.startsWith("+"))continue;if(rOe(t[i])&&!!t[i])if(nOe(t[i]))return e(t[i]);else return!!t[i]}return!1}});var oY=g(function(aBe,iY){iY.exports=function(t,r){return t===r||r.startsWith(t+".")}});var lY=g(function(pc){/*!
866
+ * Module dependencies.
867
+ */var Iw=pc.specialProperties=["__proto__","constructor","prototype"],X2=pc.clone=function e(t,r){if(t===void 0||t===null)return t;if(Array.isArray(t))return pc.cloneArray(t,r);if(t.constructor){if(/ObjectI[dD]$/.test(t.constructor.name))return typeof t.clone=="function"?t.clone():new t.constructor(t.id);if(t.constructor.name==="ReadPreference")return new t.constructor(t.mode,e(t.tags,r));if(t._bsontype=="Binary"&&t.buffer&&t.value)return typeof t.clone=="function"?t.clone():new t.constructor(t.value(!0),t.sub_type);if(t.constructor.name==="Date"||t.constructor.name==="Function")return new t.constructor(+t);if(t.constructor.name==="RegExp")return new RegExp(t);if(t.constructor.name==="Buffer")return Buffer.from(t)}if(iOe(t))return pc.cloneObject(t,r);if(t.valueOf)return t.valueOf()};/*!
868
+ * ignore
869
+ */pc.cloneObject=function(t,r){let n=r&&r.minimize,s={},i=Object.keys(t),o=i.length,u=!1,a,c="",l=0;for(l=0;l<o;++l){if(c=i[l],Iw.indexOf(c)!==-1)continue;if(a=X2(t[c],r),!n||typeof a<"u")u||(u=!0),s[c]=a}return n?u&&s:s};pc.cloneArray=function(t,r){let n=[],s=t.length,i=0;for(;i<s;i++)n.push(X2(t[i],r));return n};pc.merge=function e(t,r){let n=Object.keys(r);for(let s of n){if(Iw.indexOf(s)!==-1)continue;if(!Object.prototype.hasOwnProperty.call(t,s)||typeof t[s]>"u")t[s]=r[s];else if(pc.isObject(r[s]))e(t[s],r[s]);else t[s]=r[s]}};pc.mergeClone=function e(t,r){let n=Object.keys(r);for(let s of n){if(Iw.indexOf(s)!==-1)continue;if(!Object.prototype.hasOwnProperty.call(t,s)||typeof t[s]>"u")t[s]=X2(r[s]);else if(pc.isObject(r[s]))e(t[s],r[s]);else t[s]=X2(r[s])}};pc.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";break}return t};pc.readConcern=function(t){if(typeof t==="string"){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";break}t={level:t}}return t};var sOe=Object.prototype.toString;pc.toString=function(e){return sOe.call(e)};var iOe=pc.isObject=function(e){return pc.toString(e)=="[object Object]"};pc.keys=Object.keys;pc.create=typeof Object.create=="function"?Object.create:oOe;function oOe(e){if(arguments.length>1)throw Error("Adding properties is not supported");function t(){}return t.prototype=e,new t}pc.inherits=function(e,t){e.prototype=pc.create(t.prototype),e.prototype.constructor=e};pc.isArgumentsObject=function(e){return Object.prototype.toString.call(e)==="[object Arguments]"}});var fY=g(function(hY){var er=hY;er.distinct=function(e){if(e._fields&&Object.keys(e._fields).length>0)return"field selection and slice";let t=Object.keys(er.distinct),r;return t.every(function(n){if(e.options[n])return r=n,!1;return!0}),r};er.distinct.select=er.distinct.slice=er.distinct.sort=er.distinct.limit=er.distinct.skip=er.distinct.batchSize=er.distinct.hint=er.distinct.tailable=!0;er.findOneAndUpdate=er.findOneAndDelete=function(e){let t=Object.keys(er.findOneAndUpdate),r;return t.every(function(n){if(e.options[n])return r=n,!1;return!0}),r};er.findOneAndUpdate.limit=er.findOneAndUpdate.skip=er.findOneAndUpdate.batchSize=er.findOneAndUpdate.tailable=!0;er.findOneAndReplace=function(e){let t=Object.keys(er.findOneAndUpdate),r;return t.every(function(n){if(e.options[n])return r=n,!1;return!0}),r};er.countDocuments=function(e){if(e._fields&&Object.keys(e._fields).length>0)return"field selection and slice";let t=Object.keys(er.countDocuments),r;return t.every(function(n){if(e.options[n])return r=n,!1;return!0}),r};er.countDocuments.slice=er.countDocuments.batchSize=er.countDocuments.tailable=!0});var Rw=g(function(dBe,dY){dBe.isNode=typeof process<"u"&&typeof dY=="object"&&typeof global=="object"&&typeof Buffer=="function"&&process.argv;dBe.isMongo=!dBe.isNode&&typeof printjson=="function"&&typeof ObjectId=="function"&&typeof rs=="function"&&typeof sh=="function";dBe.isBrowser=!dBe.isNode&&!dBe.isMongo&&typeof window<"u";dBe.type=dBe.isNode?"node":dBe.isMongo?"mongo":dBe.isBrowser?"browser":"unknown"});var Wf=g(function(mY,yY){var vw=["find","findOne","updateMany","updateOne","replaceOne","countDocuments","estimatedDocumentCount","distinct","findOneAndDelete","findOneAndReplace","findOneAndUpdate","aggregate","findCursor","deleteOne","deleteMany"];function kw(){}for(let e=0,t=vw.length;e<t;++e){let r=vw[e];kw.prototype[r]=gOe(r)}yY.exports=mY=kw;kw.methods=vw;function gOe(e){return function(){throw Error("collection."+e+" not implemented")}}});var AY=g(function(EY,_Y){var EOe=Wf();class gY extends EOe{constructor(e){super();this.collection=e,this.collectionName=e.collectionName}async find(e,t){return this.collection.find(e,t).toArray()}async findOne(e,t){return this.collection.findOne(e,t)}async countDocuments(e,t){return this.collection.countDocuments(e,t)}async estimatedDocumentCount(e,t){return this.collection.estimatedDocumentCount(e,t)}async distinct(e,t,r){return this.collection.distinct(e,t,r)}async updateMany(e,t,r){return this.collection.updateMany(e,t,r)}async updateOne(e,t,r){return this.collection.updateOne(e,t,r)}async replaceOne(e,t,r){return this.collection.replaceOne(e,t,r)}async deleteOne(e,t){return this.collection.deleteOne(e,t)}async deleteMany(e,t){return this.collection.deleteMany(e,t)}async findOneAndDelete(e,t){return this.collection.findOneAndDelete(e,t)}async findOneAndUpdate(e,t,r){return this.collection.findOneAndUpdate(e,t,r)}async findOneAndReplace(e,t,r){return this.collection.findOneAndReplace(e,t,r)}findCursor(e,t){return this.collection.find(e,t)}}_Y.exports=EY=gY});var OY=g(function(pBe,wY){var G1=Rw();if(G1.type=="unknown")throw Error("Unknown environment");wY.exports=G1.isNode?AY():G1.isMongo?Wf():Wf()});var Uw=g(function(bY,DY){var CY=L("assert"),eg=L("util"),te=lY(),uu=eg.debuglog("mquery");function j(e,t){if(!(this instanceof j))return new j(e,t);let r=this.constructor.prototype;if(this.op=r.op||void 0,this.options=Object.assign({},r.options),this._conditions=r._conditions?te.clone(r._conditions):{},this._fields=r._fields?te.clone(r._fields):void 0,this._updateDoc=r._updateDoc?te.clone(r._updateDoc):void 0,this._path=r._path||void 0,this._distinctDoc=r._distinctDoc||void 0,this._collection=r._collection||void 0,this._traceFunction=r._traceFunction||void 0,t)this.setOptions(t);if(e)this.find(e)}j.prototype.toConstructor=function(){function t(n,s){if(!(this instanceof t))return new t(n,s);j.call(this,n,s)}te.inherits(t,j);let r=t.prototype;return r.options={},r.setOptions(this.options),r.op=this.op,r._conditions=te.clone(this._conditions),r._fields=te.clone(this._fields),r._updateDoc=te.clone(this._updateDoc),r._path=this._path,r._distinctDoc=this._distinctDoc,r._collection=this._collection,r._traceFunction=this._traceFunction,t};j.prototype.setOptions=function(e){if(!(e&&te.isObject(e)))return this;let t=te.keys(e),r;for(let n=0;n<t.length;++n){if(r=t[n],te.specialProperties.indexOf(r)!==-1)continue;if(typeof this[r]=="function"){let s=Array.isArray(e[r])?e[r]:[e[r]];this[r].apply(this,s)}else this.options[r]=e[r]}return this};j.prototype.collection=function(t){return this._collection=new j.Collection(t),this};j.prototype.collation=function(e){return this.options.collation=e,this};j.prototype.$where=function(e){return this._conditions.$where=e,this};j.prototype.where=function(){if(!arguments.length)return this;if(!this.op)this.op="find";let e=typeof arguments[0];if(e=="string"){if(Kf(arguments[0]),this._path=arguments[0],arguments.length===2)this._conditions[this._path]=arguments[1];return this}if(e=="object"&&!Array.isArray(arguments[0]))return this.merge(arguments[0]);throw TypeError("path must be a string or object")};j.prototype.equals=function(t){this._ensurePath("equals");let r=this._path;return this._conditions[r]=t,this};j.prototype.eq=function(t){this._ensurePath("eq");let r=this._path;return this._conditions[r]=t,this};j.prototype.or=function(t){let r=this._conditions.$or||(this._conditions.$or=[]);if(!Array.isArray(t))t=[t];return r.push.apply(r,t),this};j.prototype.nor=function(t){let r=this._conditions.$nor||(this._conditions.$nor=[]);if(!Array.isArray(t))t=[t];return r.push.apply(r,t),this};j.prototype.and=function(t){let r=this._conditions.$and||(this._conditions.$and=[]);if(!Array.isArray(t))t=[t];return r.push.apply(r,t),this};/*!
870
+ * gt, gte, lt, lte, ne, in, nin, all, regex, size, maxDistance
871
+ *
872
+ * Thing.where('type').nin(array)
873
+ */"gt gte lt lte ne in nin all regex size maxDistance minDistance".split(" ").forEach(function(e){j.prototype[e]=function(){let t,r;if(arguments.length===1)this._ensurePath(e),r=arguments[0],t=this._path;else r=arguments[1],t=arguments[0];let n=au(this._conditions,t),s=n===null||typeof n==="object"?n:this._conditions[t]={};return s["$"+e]=r,this}});j.prototype.mod=function(){let e,t;if(arguments.length===1)this._ensurePath("mod"),e=arguments[0],t=this._path;else if(arguments.length===2&&!Array.isArray(arguments[1]))this._ensurePath("mod"),e=[arguments[0],arguments[1]],t=this._path;else if(arguments.length===3)e=[arguments[1],arguments[2]],t=arguments[0];else e=arguments[1],t=arguments[0];let r=au(this._conditions,t)||(this._conditions[t]={});return r.$mod=e,this};j.prototype.exists=function(){let e,t;if(arguments.length===0)this._ensurePath("exists"),e=this._path,t=!0;else if(arguments.length===1)if(typeof arguments[0]==="boolean")this._ensurePath("exists"),e=this._path,t=arguments[0];else e=arguments[0],t=!0;else if(arguments.length===2)e=arguments[0],t=arguments[1];let r=au(this._conditions,e)||(this._conditions[e]={});return r.$exists=t,this};j.prototype.elemMatch=function(){if(arguments[0]==null)throw TypeError("Invalid argument");let e,t,r;if(typeof arguments[0]==="function")this._ensurePath("elemMatch"),t=this._path,e=arguments[0];else if(te.isObject(arguments[0]))this._ensurePath("elemMatch"),t=this._path,r=arguments[0];else if(typeof arguments[1]==="function")t=arguments[0],e=arguments[1];else if(arguments[1]&&te.isObject(arguments[1]))t=arguments[0],r=arguments[1];else throw TypeError("Invalid argument");if(e)r=new j,e(r),r=r._conditions;let n=au(this._conditions,t)||(this._conditions[t]={});return n.$elemMatch=r,this};j.prototype.within=function(){if(this._ensurePath("within"),this._geoComparison="$geoWithin",arguments.length===0)return this;if(arguments.length===2)return this.box.apply(this,arguments);else if(2<arguments.length)return this.polygon.apply(this,arguments);let t=arguments[0];if(!t)throw TypeError("Invalid argument");if(t.center)return this.circle(t);if(t.box)return this.box.apply(this,t.box);if(t.polygon)return this.polygon.apply(this,t.polygon);if(t.type&&t.coordinates)return this.geometry(t);throw TypeError("Invalid argument")};j.prototype.box=function(){let e,t;if(arguments.length===3)e=arguments[0],t=[arguments[1],arguments[2]];else if(arguments.length===2)this._ensurePath("box"),e=this._path,t=[arguments[0],arguments[1]];else throw TypeError("Invalid argument");let r=au(this._conditions,e)||(this._conditions[e]={});return r[this._geoComparison||"$geoWithin"]={$box:t},this};j.prototype.polygon=function(){let e,t;if(typeof arguments[0]=="string")e=Array.from(arguments),t=e.shift();else this._ensurePath("polygon"),t=this._path,e=Array.from(arguments);let r=au(this._conditions,t)||(this._conditions[t]={});return r[this._geoComparison||"$geoWithin"]={$polygon:e},this};j.prototype.circle=function(){let e,t;if(arguments.length===1)this._ensurePath("circle"),e=this._path,t=arguments[0];else if(arguments.length===2)e=arguments[0],t=arguments[1];else throw TypeError("Invalid argument");if(!(("radius"in t)&&t.center))throw Error("center and radius are required");let r=au(this._conditions,e)||(this._conditions[e]={}),n=t.spherical?"$centerSphere":"$center",s=this._geoComparison||"$geoWithin";if(r[s]={},r[s][n]=[t.center,t.radius],"unique"in t)r[s].$uniqueDocs=!!t.unique;return this};j.prototype.near=function(){let t,r;if(this._geoComparison="$near",arguments.length===0)return this;else if(arguments.length===1)this._ensurePath("near"),t=this._path,r=arguments[0];else if(arguments.length===2)t=arguments[0],r=arguments[1];else throw TypeError("Invalid argument");if(!r.center)throw Error("center is required");let n=au(this._conditions,t)||(this._conditions[t]={}),s=r.spherical?"$nearSphere":"$near";if(Array.isArray(r.center)){n[s]=r.center;let i="maxDistance"in r?r.maxDistance:null;if(i!=null)n.$maxDistance=i;if(r.minDistance!=null)n.$minDistance=r.minDistance}else{if(r.center.type!="Point"||!Array.isArray(r.center.coordinates))throw Error(eg.format("Invalid GeoJSON specified for %s",s));if(n[s]={$geometry:r.center},"maxDistance"in r)n[s].$maxDistance=r.maxDistance;if("minDistance"in r)n[s].$minDistance=r.minDistance}return this};j.prototype.intersects=function(){if(this._ensurePath("intersects"),this._geoComparison="$geoIntersects",arguments.length===0)return this;let t=arguments[0];if(t!=null&&t.type&&t.coordinates)return this.geometry(t);throw TypeError("Invalid argument")};j.prototype.geometry=function(){if(!(this._geoComparison=="$within"||this._geoComparison=="$geoWithin"||this._geoComparison=="$near"||this._geoComparison=="$geoIntersects"))throw Error("geometry() must come after `within()`, `intersects()`, or `near()");let t,r;if(arguments.length===1)this._ensurePath("geometry"),r=this._path,t=arguments[0];else throw TypeError("Invalid argument");if(!(t.type&&Array.isArray(t.coordinates)))throw TypeError("Invalid argument");let n=au(this._conditions,r)||(this._conditions[r]={});return n[this._geoComparison]={$geometry:t},this};j.prototype.select=function(){let t=arguments[0];if(!t)return this;if(arguments.length!==1)throw Error("Invalid select: select only takes 1 argument");this._validate("select");let r=this._fields||(this._fields={}),n=typeof t,s,i;if((n=="string"||te.isArgumentsObject(t))&&typeof t.length=="number"||Array.isArray(t)){if(n=="string")t=t.split(/\s+/);for(s=0,i=t.length;s<i;++s){let o=t[s];if(!o)continue;let u=o[0]=="-"?0:1;if(u===0)o=o.substring(1);Kf(o),r[o]=u}return this}if(te.isObject(t)){let o=te.keys(t);for(s=0;s<o.length;++s){if(te.specialProperties.indexOf(o[s])!==-1)continue;r[o[s]]=t[o[s]]}return this}throw TypeError("Invalid select() argument. Must be string or object.")};j.prototype.slice=function(){if(arguments.length===0)return this;this._validate("slice");let e,t;if(arguments.length===1){let n=arguments[0];if(typeof n==="object"&&!Array.isArray(n)){let s=Object.keys(n),i=s.length;for(let o=0;o<i;++o){if(te.specialProperties.indexOf(s[o])!==-1)continue;this.slice(s[o],n[s[o]])}return this}this._ensurePath("slice"),e=this._path,t=arguments[0]}else if(arguments.length===2)if(typeof arguments[0]==="number")this._ensurePath("slice"),e=this._path,t=[arguments[0],arguments[1]];else e=arguments[0],t=arguments[1];else if(arguments.length===3)e=arguments[0],t=[arguments[1],arguments[2]];Kf(e);let r=this._fields||(this._fields={});return r[e]={$slice:t},this};j.prototype.sort=function(e){if(!e)return this;let t,r,n;this._validate("sort");let s=typeof e;if(Array.isArray(e)){r=e.length;for(t=0;t<e.length;++t){if(!Array.isArray(e[t]))throw Error("Invalid sort() argument, must be array of arrays");_Oe(this.options,e[t][0],e[t][1])}return this}if(arguments.length===1&&s=="string"){e=e.split(/\s+/),r=e.length;for(t=0;t<r;++t){if(n=e[t],!n)continue;let i=n[0]=="-"?-1:1;if(i===-1)n=n.substring(1);Kf(n),SY(this.options,n,i)}return this}if(te.isObject(e)){let i=te.keys(e);for(t=0;t<i.length;++t){if(n=i[t],te.specialProperties.indexOf(n)!==-1)continue;SY(this.options,n,e[n])}return this}if(typeof Map<"u"&&e instanceof Map)return AOe(this.options,e),this;throw TypeError("Invalid sort() argument. Must be a string, object, or array.")};/*!
874
+ * @ignore
875
+ */var qw={1:1,"-1":-1,asc:1,ascending:1,desc:-1,descending:-1};function SY(e,t,r){if(Array.isArray(e.sort))throw TypeError("Can't mix sort syntaxes. Use either array or object:\n- `.sort([['field', 1], ['test', -1]])`\n- `.sort({ field: 1, test: -1 })`");let n;if(r&&r.$meta){n=e.sort||(e.sort={}),n[t]={$meta:r.$meta};return}n=e.sort||(e.sort={});let s=String(r||1).toLowerCase();if(s=qw[s],!s)throw TypeError("Invalid sort value: { "+t+": "+r+" }");n[t]=s}function _Oe(e,t,r){if(e.sort=e.sort||[],!Array.isArray(e.sort))throw TypeError("Can't mix sort syntaxes. Use either array or object:\n- `.sort([['field', 1], ['test', -1]])`\n- `.sort({ field: 1, test: -1 })`");let n=String(r||1).toLowerCase();if(n=qw[n],!n)throw TypeError("Invalid sort value: [ "+t+", "+r+" ]");e.sort.push([t,n])}function AOe(e,t){if(e.sort=e.sort||new Map,!(e.sort instanceof Map))throw TypeError("Can't mix sort syntaxes. Use either array or object or map consistently");t.forEach(function(r,n){let s=String(r||1).toLowerCase();if(s=qw[s],!s)throw TypeError("Invalid sort value: < "+n+": "+r+" >");e.sort.set(n,s)})}/*!
876
+ * limit, skip, batchSize, comment
877
+ *
878
+ * Sets these associated options.
879
+ *
880
+ * query.comment('feed query');
881
+ */["limit","skip","batchSize","comment"].forEach(function(e){j.prototype[e]=function(t){return this._validate(e),this.options[e]=t,this}});j.prototype.maxTime=j.prototype.maxTimeMS=function(e){return this._validate("maxTime"),this.options.maxTimeMS=e,this};j.prototype.hint=function(){if(arguments.length===0)return this;this._validate("hint");let e=arguments[0];if(te.isObject(e)){let t=this.options.hint||(this.options.hint={});for(let r in e){if(te.specialProperties.indexOf(r)!==-1)continue;t[r]=e[r]}return this}if(typeof e==="string")return this.options.hint=e,this;throw TypeError("Invalid hint. "+e)};j.prototype.j=function(t){return this.options.j=t,this};j.prototype.slaveOk=function(e){return this.options.slaveOk=arguments.length?!!e:!0,this};j.prototype.read=j.prototype.setReadPreference=function(e){if(arguments.length>1&&!j.prototype.read.deprecationWarningIssued)console.error("Deprecation warning: 'tags' argument is not supported anymore in Query.read() method. Please use mongodb.ReadPreference object instead."),j.prototype.read.deprecationWarningIssued=!0;return this.options.readPreference=te.readPref(e),this};j.prototype.readConcern=j.prototype.r=function(e){return this.options.readConcern=te.readConcern(e),this};j.prototype.tailable=function(){return this._validate("tailable"),this.options.tailable=arguments.length?!!arguments[0]:!0,this};j.prototype.writeConcern=j.prototype.w=function(t){if(typeof t==="object"){if(typeof t.j<"u")this.options.j=t.j;if(typeof t.w<"u")this.options.w=t.w;if(typeof t.wtimeout<"u")this.options.wtimeout=t.wtimeout}else this.options.w=t==="m"?"majority":t;return this};j.prototype.wtimeout=j.prototype.wTimeout=function(t){return this.options.wtimeout=t,this};j.prototype.merge=function(e){if(!e)return this;if(!j.canMerge(e))throw TypeError("Invalid argument. Expected instanceof mquery or plain object");if(e instanceof j){if(e._conditions)te.merge(this._conditions,e._conditions);if(e._fields)this._fields||(this._fields={}),te.merge(this._fields,e._fields);if(e.options)this.options||(this.options={}),te.merge(this.options,e.options);if(e._updateDoc)this._updateDoc||(this._updateDoc={}),te.mergeClone(this._updateDoc,e._updateDoc);if(e._distinctDoc)this._distinctDoc=e._distinctDoc;return this}return te.merge(this._conditions,e),this};j.prototype.find=function(e){if(this.op="find",j.canMerge(e))this.merge(e);return this};j.prototype._find=async function(){let t=this._conditions,r=this._optionsForExec();if(this.$useProjection)r.projection=this._fieldsForExec();else r.fields=this._fieldsForExec();return uu("find",this._collection.collectionName,t,r),this._collection.find(t,r)};j.prototype.cursor=function(t){if(this.op){if(this.op!=="find")throw TypeError(".cursor only support .find method")}else this.find(t);let r=this._conditions,n=this._optionsForExec();if(this.$useProjection)n.projection=this._fieldsForExec();else n.fields=this._fieldsForExec();return uu("findCursor",this._collection.collectionName,r,n),this._collection.findCursor(r,n)};j.prototype.findOne=function(e){if(this.op="findOne",j.canMerge(e))this.merge(e);return this};j.prototype._findOne=async function(){let t=this._conditions,r=this._optionsForExec();if(this.$useProjection)r.projection=this._fieldsForExec();else r.fields=this._fieldsForExec();return uu("findOne",this._collection.collectionName,t,r),this._collection.findOne(t,r)};j.prototype.countDocuments=function(e){if(this.op="countDocuments",this._validate(),j.canMerge(e))this.merge(e);return this};j.prototype._countDocuments=async function(){let t=this._conditions,r=this._optionsForExec();return uu("countDocuments",this._collection.collectionName,t,r),this._collection.countDocuments(t,r)};j.prototype.estimatedDocumentCount=function(){return this.op="estimatedDocumentCount",this._validate(),this};j.prototype._estimatedDocumentCount=async function(){let t=this._conditions,r=this._optionsForExec();return uu("estimatedDocumentCount",this._collection.collectionName,t,r),this._collection.estimatedDocumentCount(t,r)};j.prototype.distinct=function(e,t){if(this.op="distinct",this._validate(),!t&&typeof e==="string")t=e,e=void 0;if(typeof t=="string")this._distinctDoc=t;if(j.canMerge(e))this.merge(e);return this};j.prototype._distinct=async function(){if(!this._distinctDoc)throw Error("No value for `distinct` has been declared");let t=this._conditions,r=this._optionsForExec();return this._collection.distinct(this._distinctDoc,t,r)};j.prototype.updateMany=function(t,r,n){return jw(this,"updateMany",t,r,n)};j.prototype._updateMany=async function(){return Lw(this,"updateMany")};j.prototype.updateOne=function(t,r,n){return jw(this,"updateOne",t,r,n)};j.prototype._updateOne=async function(){return Lw(this,"updateOne")};j.prototype.replaceOne=function(t,r,n){return this.setOptions({overwrite:!0}),jw(this,"replaceOne",t,r,n)};j.prototype._replaceOne=async function(){return Lw(this,"replaceOne")};/*!
882
+ * Internal helper for updateMany, updateOne
883
+ */function jw(e,t,r,n,s){if(e.op=t,j.canMerge(r))e.merge(r);if(n)e._mergeUpdate(n);if(te.isObject(s))e.setOptions(s);return e}async function Lw(e,t){let r=e._optionsForExec(),n=e._conditions,s=e._updateForExec();return uu(t,e._collection.collectionName,n,s,r),e._collection[t](n,s,r)}j.prototype.deleteOne=function(e){if(this.op="deleteOne",j.canMerge(e))this.merge(e);return this};j.prototype._deleteOne=async function(){let e=this._optionsForExec();delete e.justOne;let t=this._conditions;return uu("deleteOne",this._collection.collectionName,t,e),this._collection.deleteOne(t,e)};j.prototype.deleteMany=function(e){if(this.op="deleteMany",j.canMerge(e))this.merge(e);return this};j.prototype._deleteMany=async function(){let e=this._optionsForExec();delete e.justOne;let t=this._conditions;return this._collection.deleteMany(t,e)};j.prototype.findOneAndUpdate=function(e,t,r){if(this.op="findOneAndUpdate",this._validate(),j.canMerge(e))this.merge(e);if(t)this._mergeUpdate(t);return r&&this.setOptions(r),this};j.prototype._findOneAndUpdate=async function(){let e=this._conditions,t=this._updateForExec(),r=this._optionsForExec();return this._collection.findOneAndUpdate(e,t,r)};j.prototype.findOneAndReplace=function(e,t,r){if(this.op="findOneAndReplace",this._validate(),j.canMerge(e))this.merge(e);if(t)this._updateDoc=t,this.options=this.options||{},this.options.overwrite=!0;return r&&this.setOptions(r),this};j.prototype._findOneAndReplace=async function(){let e=this._conditions,t=this._updateForExec(),r=this._optionsForExec();return uu("findOneAndReplace",this._collection.collectionName,e,t,r),this._collection.findOneAndReplace(e,t,r)};j.prototype.findOneAndDelete=function(e,t){if(this.op="findOneAndDelete",this._validate(),j.canMerge(e))this.merge(e);return t&&this.setOptions(t),this};j.prototype._findOneAndDelete=async function(){let e=this._optionsForExec(),t=this._conditions;return uu("findOneAndDelete",this._collection.collectionName,t,e),this._collection.findOneAndDelete(t,e)};j.prototype.setTraceFunction=function(e){return this._traceFunction=e,this};j.prototype.exec=async function(t){if(typeof t==="string")this.op=t;CY.ok(this.op,"Missing query type: (find, etc)");let r="_"+this.op;if(typeof this[r]!=="function")throw TypeError(`this[${r}] is not a function`);return this[r]()};j.prototype.then=async function(e,t){return this.exec().then(e,t)};j.prototype.cursor=function(){if(this.op!="find")throw Error("cursor() is only available for find");let e=this._conditions,t=this._optionsForExec();if(this.$useProjection)t.projection=this._fieldsForExec();else t.fields=this._fieldsForExec();return this._collection.findCursor(e,t)};j.prototype.selected=function(){return!!(this._fields&&Object.keys(this._fields).length>0)};j.prototype.selectedInclusively=function(){if(!this._fields)return!1;let t=Object.keys(this._fields);if(t.length===0)return!1;for(let r=0;r<t.length;++r){let n=t[r];if(this._fields[n]===0)return!1;if(this._fields[n]&&typeof this._fields[n]==="object"&&this._fields[n].$meta)return!1}return!0};j.prototype.selectedExclusively=function(){if(!this._fields)return!1;let t=Object.keys(this._fields);if(t.length===0)return!1;for(let r=0;r<t.length;++r){let n=t[r];if(this._fields[n]===0)return!0}return!1};j.prototype._mergeUpdate=function(e){if(!this._updateDoc)this._updateDoc={};if(e instanceof j){if(e._updateDoc)te.mergeClone(this._updateDoc,e._updateDoc)}else te.mergeClone(this._updateDoc,e)};j.prototype._optionsForExec=function(){return te.clone(this.options)};j.prototype._fieldsForExec=function(){return te.clone(this._fields)};j.prototype._updateForExec=function(){let e=this._updateDoc==null?{}:te.clone(this._updateDoc),t=te.keys(e),r={};for(let n of t){if(this.options.overwrite){r[n]=e[n];continue}if(n[0]!=="$"){if(!r.$set)if(e.$set)r.$set=e.$set;else r.$set={};if(r.$set[n]=e[n],!~t.indexOf("$set"))t.push("$set")}else if(n==="$set"){if(!r.$set)r[n]=e[n]}else r[n]=e[n]}return this._compiledUpdate=r,r};j.prototype._ensurePath=function(e){if(!this._path){let t=e+"() must be used after where() when called with these arguments";throw Error(t)}};function au(e,t){return Kf(t),Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0}function Kf(e){if(e!=null&&te.specialProperties.indexOf(String(e))!==-1)throw Error("Cannot use `"+e+"` as a query path")}/*!
884
+ * Permissions
885
+ */j.permissions=fY();j._isPermitted=function(e,t){let r=j.permissions[t];if(!r)return!0;return r[e]!==!0};j.prototype._validate=function(e){let t,r;if(e===void 0){if(r=j.permissions[this.op],typeof r!="function")return!0;t=r(this)}else if(!j._isPermitted(e,this.op))t=e;if(t)throw Error(t+" cannot be used with "+this.op)};j.canMerge=function(e){return e instanceof j||te.isObject(e)};j.setGlobalTraceFunction=function(e){j.traceFunction=e};/*!
886
+ * Exports.
887
+ */j.utils=te;j.env=Rw();j.Collection=OY();j.BaseCollection=Wf();DY.exports=bY=j});var tg=g(function(mBe,TY){TY.exports=function(t,r){if(typeof t==="string")t=t.split(/\s+/);if(!Array.isArray(t)&&Object.prototype.toString.call(t)!=="[object Arguments]")return t;let s=t.length,i={};for(let o=0;o<s;++o){let u=t[o];if(!u)continue;let a=u.charAt(0)==="-"?0:1;if(!r&&a===0)u=u.slice(1);i[u]=a}return i}});var PY=g(function(yBe,xY){xY.exports=function(t,r){let n=r?.arrayFilters;if(!Array.isArray(n))return;let s=Object.keys(t).map((i)=>Object.keys(t[i])).reduce((i,o)=>i.concat(o),[]);r.arrayFilters=r.arrayFilters.filter((i)=>MY(i,s))};function MY(e,t){let r=Object.keys(e)[0];if(r==null)return!0;if(r==="$and"||r==="$or"){if(!Array.isArray(e[r]))return!1;return e[r].find((i)=>MY(i,t))!=null}let n=r.indexOf("."),s=n===-1?r:r.slice(0,n);return t.find((i)=>i.includes("$["+s+"]"))!=null}});var rg=g(function(gBe,FY){/*!
888
+ * ignore
889
+ */FY.exports=function(t){if(typeof t!=="object"||t===null)return!1;let r=Object.keys(t),n=r.length;for(let s=0;s<n;++s)if(r[s][0]==="$")return!0;return!1}});var Vw=g(function(EBe,BY){var wOe=Le(),OOe=rg(),{logicalOperators:SOe}=Tf(),{trustedSymbol:COe}=c1();BY.exports=function e(t){if(t==null||typeof t!=="object")return t;if(Array.isArray(t)){for(let n of t)e(n);return t}let r=Object.keys(t);for(let n of r){let s=t[n];if(s?.[COe])continue;if(SOe.has(n)){e(s);continue}else if(n[0]==="$")throw new wOe(n+" is not allowed with sanitizeFilter");if(OOe(s)){let i=Object.keys(s);if(i.length===1&&i[0]==="$eq")continue;t[n]={$eq:t[n]}}}return t}});var IY=g(function(_Be,NY){NY.exports=function(t){if(t==null)return;let r=Object.keys(t);for(let n=0;n<r.length;++n){let s=t[r[n]];if(typeof s==="string"){t[r[n]]=1;continue}if(s==null||typeof s!=="object")continue;let i=s.$slice;if(!(s.$meta==="textScore"||s.$elemMatch!=null||typeof i==="number"||Array.isArray(i)&&i.every((u)=>typeof u==="number")))t[r[n]]=1}}});var vY=g(function(ABe,RY){var bOe=tc(),DOe=J2();/*!
890
+ * ignore
891
+ */RY.exports=function(t,r,n){if(n==null)return;let s=Object.keys(n);if(r=r||{},DOe(t))for(let i of s){if(!$Y(r,i))t[i]=1;else if(r[i]===0)delete t[i];let o=n[i]?.refPath;if(typeof o==="string"){if(!$Y(r,o))t[o]=1;else if(r[o]===0)delete t[o]}}else if(bOe(t))for(let i of s){if(r[i]==null)delete t[i];let o=n[i]?.refPath;if(typeof o==="string"&&r[o]==null)delete t[o]}};/*!
892
+ * ignore
893
+ */function $Y(e,t){let r=t.split("."),n=r.length,s=r[0];for(let i=1;i<n;++i){if(e[s]!=null||e[s+".$"]!=null)return!0;s+="."+r[i]}return e[s]!=null||e[s+".$"]!=null}});var jY=g(function(wBe,qY){/*!
894
+ * Module dependencies.
895
+ */var TOe=wf(),kY=sw().flatten,MOe=gn();qY.exports=async function(t,r,n,s){let i=Object.keys(n||{}),o={},u={},a={},c={},l=i.length,f=!1,h,d;for(let A=0;A<l;++A)if(i[A].startsWith("$")){if(f=!0,i[A]==="$push"||i[A]==="$addToSet"){let v=Object.keys(n[i[A]]);for(let P=0;P<v.length;++P)if(h=n[i[A]][v[P]],h?.$each)c[v[P]]=(c[v[P]]||[]).concat(h.$each);else c[v[P]]=(c[v[P]]||[]).concat([h]);continue}let M=kY(n[i[A]],null,null,r),O=Object.keys(M),x=O.length;for(let v=0;v<x;++v){let P=TOe(O[v]);if(d=i[A],P.includes("$"))continue;if(d==="$set"||d==="$setOnInsert"||d==="$pull"||d==="$pullAll")u[P]=M[O[v]],a[P]=d==="$pull"||d==="$pullAll";else if(d==="$unset")u[P]=void 0;o[P]=!0}}if(!f)u=kY(n,null,null,r),o=Object.keys(u);let p=Object.keys(u),m=p.length,E=[],y=[],_=null,w=t;for(let A=0;A<m;++A){let M=u[p[A]],O=r._getSchema(p[A]);if(O==null)continue;if(O.instance==="Mixed"&&O.path!==p[A]&&POe(r,p[A]))continue;if(a[p[A]]&&O.$isMongooseArray)continue;if(M&&Array.isArray(M.$in))M.$in.forEach((x,v)=>{E.push(O.doValidate(x,w,{updateValidator:!0}).catch((P)=>{P.path=p[A]+".$in."+v,y.push(P)}))});else{if(_!=null&&xOe(_,p[A]))continue;if(O.$isMongooseDocumentArrayElement&&MOe(M))_??=new Set,_.add(p[A]),E.push(O.doValidate(M,w,{updateValidator:!0}).catch((x)=>{if(x.errors)for(let v of Object.keys(x.errors)){let P=x.errors[v];P.path=p[A]+"."+v,y.push(P)}else x.path=p[A],y.push(x)}));else{if(O.$isSingleNested)_??=new Set,_.add(p[A]);E.push(O.doValidate(M,w,{updateValidator:!0}).catch((x)=>{if(x)x.path=p[A],y.push(x)}))}}}let C=Object.keys(c);for(let A of C){let M=r._getSchema(A);if(M&&M.$isMongooseDocumentArray)E.push(M.doValidate(c[A],s?.context==="query"?t:null).catch((O)=>{O.path=A,y.push(O)}));else{M=r._getSchema(A+".0");for(let O of c[A])E.push(M.doValidate(O,s?.context==="query"?t:null,{updateValidator:!0}).catch((x)=>{x.path=A,y.push(x)}))}}return await Promise.all(E),y};/*!
896
+ * Returns true if `path` is underneath a path in `alreadyValidated`. Checks each
897
+ * ancestor of `path` with a Set lookup, so the cost depends on the depth of `path`
898
+ * rather than on the number of subdocuments validated so far.
899
+ */function xOe(e,t){for(let r=t.indexOf(".");r!==-1;r=t.indexOf(".",r+1))if(e.has(t.slice(0,r)))return!0;return!1}/*!
900
+ * Returns true if the parent of `path` is a Mixed path, so `path` is a key
901
+ * inside a Mixed value rather than a path in the schema.
902
+ */function POe(e,t){let r=t.lastIndexOf(".");if(r===-1)return!1;return e._getSchema(t.slice(0,r))?.instance==="Mixed"}});var og=g(function(OBe,ZY){/*!
903
+ * Module dependencies.
904
+ */var Hf=kn(),FOe=W0(),Gf=Ja(),ft=Le(),cu=ty(),zw=HG(),Yf=Za(),{applyGlobalMaxTimeMS:Qf,applyGlobalDiskUse:Jf}=Pw(),BOe=kA(),NOe=Fw(),IOe=Bw(),$Oe=ac(),ROe=yw(),ng=Cf(),vOe=pw(),bs=Zt(),Kw=nY(),kOe=q2(),VY=Ei(),Io=pf(),qOe=Ui().internalToObjectOptions,jOe=tc(),LOe=J2(),UOe=gn(),VOe=ly(),LY=oY(),{logicalOperators:zOe}=Tf(),sg=ks(),Xf=Uw(),WOe=tg(),Yw=PY(),KOe=Vw(),zY=IY(),{buildMiddlewareFilter:WY}=Jo(),HOe=vY(),Qw=gw(),Mi=ma(),GOe=jY(),xi=L("util"),X=we(),YOe=Of().queryMiddlewareFunctions,{createTracedChannel:QOe}=K1(),{trace:JOe}=QOe("mongoose:query"),XOe=new Set(["allowDiskUse","batchSize","collation","comment","explain","hint","j","lean","limit","maxTimeMS","populate","projection","read","select","skip","slice","sort","tailable","w","writeConcern","wtimeout"]),ZOe=new Set(["find","findOne","findOneAndDelete","findOneAndReplace","findOneAndUpdate"]),eSe=new Map([["countDocuments","_countDocuments"],["distinct","__distinct"],["estimatedDocumentCount","_estimatedDocumentCount"],["find","_find"],["findOne","_findOne"],["findOneAndReplace","_findOneAndReplace"],["findOneAndUpdate","_findOneAndUpdate"],["replaceOne","_replaceOne"],["updateMany","_updateMany"],["updateOne","_updateOne"],["deleteMany","_deleteMany"],["deleteOne","_deleteOne"],["findOneAndDelete","_findOneAndDelete"]]),W=Symbol("mongoose#Query#update");function q(e,t,r,n){if(!this._mongooseOptions)this._mongooseOptions={};t=t||{},this._transforms=[],this._hooks=new Gf,this._execCount=0;let s=Object.keys(t);for(let o of s)this._mongooseOptions[o]=t[o];if(n)this.mongooseCollection=n;if(r)this.model=r,this.schema=r.schema;if(this.model?._mapreduce)this.lean();if(Xf.call(this,null,t),n)this.collection(n);if(e)this.find(e);this.options=this.options||{},this.$useProjection=!0;let i=this?.schema?.options?.collation||null;if(i!=null)this.options.collation=i}function Hw(e){if(e==null)return!0;if(typeof e!=="object")return!0;for(let t of Object.keys(e)){let r=e[t];if(t==="$comment"||t==="$alwaysTrue")continue;if(!Array.isArray(r))return!1;if((t==="$and"||t==="$nor")&&r.every(Hw))continue;if(t==="$or"&&(r.length===0||r.some(Hw)))continue;return!1}return!0}function Da(e,t){if(t?.requireFilter&&Hw(e))throw new ft("Empty or invalid filter not allowed with requireFilter enabled")}/*!
905
+ * inherit mquery
906
+ */q.prototype=new Xf;q.prototype.constructor=q;Object.defineProperty(q.prototype,"_update",{configurable:!0,enumerable:!0,get:function(){return mc(this),this[W]},set:function(e){this[W]=e}});q.prototype.count=void 0;q.prototype.findOneAndRemove=void 0;q.base=Xf.prototype;/*!
907
+ * Overwrite mquery's `_distinct`, because Mongoose uses that name
908
+ * to store the field to apply distinct on.
909
+ */Object.defineProperty(q.prototype,"_distinct",{configurable:!0,writable:!0,enumerable:!0,value:void 0});q.prototype.toConstructor=function(){let t=this.model,r=this.mongooseCollection,n=function(o,u){if(!(this instanceof n))return new n(o,u);this._mongooseOptions=Kw(s._mongooseOptions),q.call(this,o,u||null,t,r)};xi.inherits(n,t.Query);let s=n.prototype;s.options={};let i=Object.assign({},this.options);if(i.sort!=null)s.sort(i.sort),delete i.sort;return s.setOptions(i),s.op=this.op,s._conditions=bs(this._conditions),s._fields=bs(this._fields),s[W]=bs(this[W],{flattenDecimals:!1}),s._path=this._path,s._distinct=this._distinct,s._collection=this._collection,s._mongooseOptions=Kw(this._mongooseOptions),n};q.prototype.clone=function(){let e=this.model,t=this.mongooseCollection,r=new this.model.Query({},{},e,t),n=Object.assign({},this.options);if(n.sort!=null)r.sort(n.sort),delete n.sort;return r.setOptions(n),r.op=this.op,r._conditions=bs(this._conditions),r._fields=bs(this._fields),r[W]=bs(this[W],{flattenDecimals:!1}),r._path=this._path,r._distinct=this._distinct,r._collection=this._collection,r._mongooseOptions=Kw(this._mongooseOptions),r};q.prototype.where=function(t){if(typeof t==="string"&&Mi.has(t))throw new ft(`Cannot use \`${t}\` as a query path`);return q.base.where.apply(this,arguments)};q.prototype.slice=function(...e){if(e.length===0)return this;this._validate("slice");let t,r;if(e.length===1){let s=e[0];if(typeof s==="object"&&!Array.isArray(s)){let i=Object.keys(s),o=i.length;for(let u=0;u<o;++u)this.slice(i[u],s[i[u]]);return this}this._ensurePath("slice"),t=this._path,r=e[0]}else if(e.length===2)if(typeof e[0]==="number")this._ensurePath("slice"),t=this._path,r=[e[0],e[1]];else t=e[0],r=e[1];else if(e.length===3)t=e[0],r=[e[1],e[2]];let n={};return n[t]={$slice:r},this.select(n),this};/*!
910
+ * ignore
911
+ */var tSe=new Set(YOe);q.prototype._validateOp=function(){if(this.op!=null&&!tSe.has(this.op))this.error(Error('Query has invalid `op`: "'+this.op+'"'));if(this.op!=="estimatedDocumentCount"&&this._conditions==null)throw new cu(this._conditions,"filter",this.op)};q.prototype.mod=function(){let e,t;if(arguments.length===1)this._ensurePath("mod"),e=arguments[0],t=this._path;else if(arguments.length===2&&!Array.isArray(arguments[1]))this._ensurePath("mod"),e=[arguments[0],arguments[1]],t=this._path;else if(arguments.length===3)e=[arguments[1],arguments[2]],t=arguments[0];else e=arguments[1],t=arguments[0];if(t!=null&&Mi.has(String(t)))throw new ft(`Cannot use \`${t}\` as a query path`);let r=Object.hasOwn(this._conditions,t)&&this._conditions[t]||(this._conditions[t]={});return r.$mod=e,this};q.prototype.limit=function(t){if(this._validate("limit"),typeof t==="string")try{t=ng(t)}catch{throw new Hf("Number",t,"limit")}return this.options.limit=t,this};q.prototype.skip=function(t){if(this._validate("skip"),typeof t==="string")try{t=ng(t)}catch{throw new Hf("Number",t,"skip")}return this.options.skip=t,this};q.prototype.projection=function(e){if(arguments.length===0)return this._fields;return this._fields={},this._userProvidedFields={},this.select(e),this._fields};q.prototype.select=function(){let t=arguments[0];if(!t)return this;if(arguments.length!==1)throw new ft("Invalid select: select only takes 1 argument");this._validate("select");let r=this._fields||(this._fields={}),n=this._userProvidedFields||(this._userProvidedFields={}),s=void 0;if(this.model!=null&&X.hasUserDefinedProperty(this.model.db.options,"sanitizeProjection"))s=this.model.db.options.sanitizeProjection;else if(this.model!=null&&X.hasUserDefinedProperty(this.model.base.options,"sanitizeProjection"))s=this.model.base.options.sanitizeProjection;else s=this._mongooseOptions.sanitizeProjection;function i(o){return typeof o==="string"&&s?o=1:o}if(t=WOe(t,!0),X.isObject(t)){if(Object.hasOwn(t,"__proto__"))t={...t},delete t.__proto__;if(this.selectedInclusively())Object.entries(t).forEach(([o,u])=>{if(u){if(r["-"+o]!=null)delete r["-"+o];r[o]=n[o]=i(u)}else Object.keys(n).forEach((a)=>{if(LY(o,a))delete r[a],delete n[a]})});else if(this.selectedExclusively())Object.entries(t).forEach(([o,u])=>{if(!u){if(r["+"+o]!=null)delete r["+"+o];r[o]=n[o]=i(u)}else Object.keys(n).forEach((a)=>{if(LY(o,a))delete r[a],delete n[a]})});else{let o=Object.keys(t);for(let u=0;u<o.length;++u){let a=t[o[u]],c=o[u];r[c]=i(a),n[c]=i(a)}}return this}throw TypeError("Invalid select() argument. Must be string or object.")};q.prototype.schemaLevelProjections=function(t){return this._mongooseOptions.schemaLevelProjections=t,this};q.prototype.sanitizeProjection=function(t){return this._mongooseOptions.sanitizeProjection=t,this};q.prototype.read=function(t,r){if(typeof t==="string")t=BOe(t),this.options.readPreference={mode:t,tags:r};else this.options.readPreference=t;return this};q.prototype.toString=function(){if(this.op==="count"||this.op==="countDocuments"||this.op==="find"||this.op==="findOne"||this.op==="deleteMany"||this.op==="deleteOne"||this.op==="findOneAndDelete"||this.op==="remove")return`${this.model.modelName}.${this.op}(${xi.inspect(this._conditions)})`;if(this.op==="distinct")return`${this.model.modelName}.distinct('${this._distinct}', ${xi.inspect(this._conditions)})`;if(this.op==="findOneAndReplace"||this.op==="findOneAndUpdate"||this.op==="replaceOne"||this.op==="update"||this.op==="updateMany"||this.op==="updateOne")return`${this.model.modelName}.${this.op}(${xi.inspect(this._conditions)}, ${xi.inspect(this[W])})`;return`${this.model.modelName}.${this.op}()`};q.prototype.session=function(t){if(t==null)delete this.options.session;return this.options.session=t,this};q.prototype.writeConcern=function(t){if(t==null)return delete this.options.writeConcern,this;return this.options.writeConcern=t,this};q.prototype.w=function(t){if(t==null)delete this.options.w;if(this.options.writeConcern!=null)this.options.writeConcern.w=t;else this.options.w=t;return this};q.prototype.j=function(t){if(t==null)delete this.options.j;if(this.options.writeConcern!=null)this.options.writeConcern.j=t;else this.options.j=t;return this};q.prototype.wtimeout=function(t){if(t==null)delete this.options.wtimeout;if(this.options.writeConcern!=null)this.options.writeConcern.wtimeout=t;else this.options.wtimeout=t;return this};q.prototype.getOptions=function(){return this.options};q.prototype.setOptions=function(e,t){if(t){if(this._mongooseOptions=e&&bs(e)||{},this.options=e||{},"populate"in e)this.populate(this._mongooseOptions);return this}if(e==null)return this;if(typeof e!=="object")throw new ft('Options must be an object, got "'+e+'"');if(e=Object.assign({},e),Array.isArray(e.populate)){let r=e.populate;delete e.populate;let n=r.length;for(let s=0;s<n;++s)this.populate(r[s])}if("cloneUpdate"in e)this._mongooseOptions.cloneUpdate=e.cloneUpdate,delete e.cloneUpdate;if("defaults"in e)this._mongooseOptions.defaults=e.defaults;if(e.lean==null&&this.schema&&"lean"in this.schema.options)this._mongooseOptions.lean=this.schema.options.lean;if("overwriteDiscriminatorKey"in e)this._mongooseOptions.overwriteDiscriminatorKey=e.overwriteDiscriminatorKey,delete e.overwriteDiscriminatorKey;if("overwriteImmutable"in e)this._mongooseOptions.overwriteImmutable=e.overwriteImmutable,delete e.overwriteImmutable;if("sanitizeFilter"in e)this._mongooseOptions.sanitizeFilter=e.sanitizeFilter,delete e.sanitizeFilter;if("sanitizeProjection"in e){if(e.sanitizeProjection&&!this._mongooseOptions.sanitizeProjection)zY(this._fields);this._mongooseOptions.sanitizeProjection=e.sanitizeProjection,delete e.sanitizeProjection}if("schemaLevelProjections"in e)this._mongooseOptions.schemaLevelProjections=e.schemaLevelProjections,delete e.schemaLevelProjections;if("setDefaultsOnInsert"in e)this._mongooseOptions.setDefaultsOnInsert=e.setDefaultsOnInsert,delete e.setDefaultsOnInsert;if("strict"in e)this._mongooseOptions.strict=e.strict,delete e.strict;if("strictQuery"in e)this._mongooseOptions.strictQuery=e.strictQuery,delete e.strictQuery;if("timestamps"in e)this._mongooseOptions.timestamps=e.timestamps,delete e.timestamps;if("translateAliases"in e)this._mongooseOptions.translateAliases=e.translateAliases,delete e.translateAliases;if("updatePipeline"in e)this._mongooseOptions.updatePipeline=e.updatePipeline,delete e.updatePipeline;if(typeof e.limit==="string")try{e.limit=ng(e.limit)}catch{throw new Hf("Number",e.limit,"limit")}if(typeof e.skip==="string")try{e.skip=ng(e.skip)}catch{throw new Hf("Number",e.skip,"skip")}for(let r of Object.keys(e))if(XOe.has(r)){let n=Array.isArray(e[r])?e[r]:[e[r]];this[r].apply(this,n)}else this.options[r]=e[r];return this};q.prototype.explain=function(t){if(arguments.length===0)this.options.explain=!0;else if(t===!1)delete this.options.explain;else this.options.explain=t;return this};q.prototype.allowDiskUse=function(e){if(arguments.length===0)this.options.allowDiskUse=!0;else if(e===!1)delete this.options.allowDiskUse;else this.options.allowDiskUse=e;return this};q.prototype.maxTimeMS=function(e){return this.options.maxTimeMS=e,this};q.prototype.getFilter=function(){return this._conditions};q.prototype.getQuery=function(){return this._conditions};q.prototype.setQuery=function(e){this._conditions=e};q.prototype.getUpdate=function(){return this._update};q.prototype.setUpdate=function(e,t){if(this[W]=t===!1?e:bs(e),t!=null)this._mongooseOptions.cloneUpdate=t;this._updateIsShared=!1};q.prototype._fieldsForExec=function(){if(this._fields==null)return null;if(X.hasOwnKeys(this._fields)===!1)return null;return bs(this._fields)};q.prototype._updateForExec=function(){let e=bs(this[W],{transform:!1,depopulate:!0}),t=Object.keys(e),r=t.length,n={};while(r--){let s=t[r];if(s[0]!=="$"){if(!n.$set)if(e.$set)n.$set=e.$set;else n.$set={};if(n.$set[s]=e[s],t.splice(r,1),!~t.indexOf("$set"))t.push("$set")}else if(s==="$set"){if(!n.$set)n[s]=e[s]}else n[s]=e[s]}return n};q.prototype._optionsForExec=function(e){let t=bs(this.options);if(delete t.populate,e=e||this.model,!e)return t;if(X.isEmptyObject(t.sort))delete t.sort;else if(t.sort==null&&!t.tailable&&ZOe.has(this.op)){let s=this.schema?.options.defaultSort;if(s&&!KY(this._conditions))t.sort=HY({},s)}NOe(e.schema,t),IOe(e.schema,t);let r=this.model?.db?.base.transactionAsyncLocalStorage?.getStore();if(!Object.hasOwn(this.options,"session")&&r?.session!=null)t.session=r.session;let n=e?.schema?.options?.read;if(!("readPreference"in t)&&n)t.readPreference=n;if(t.upsert!==void 0)t.upsert=!!t.upsert;if(t.writeConcern){if(t.j)t.writeConcern.j=t.j,delete t.j;if(t.w)t.writeConcern.w=t.w,delete t.w;if(t.wtimeout)t.writeConcern.wtimeout=t.wtimeout,delete t.wtimeout}if(this._applyPaths(),this._fields!=null){this._fields=this._castFields(this._fields);let s=this._fieldsForExec();if(s!=null)t.projection=s}return t};q.prototype.lean=function(e){return this._mongooseOptions.lean=arguments.length?e:!0,this};q.prototype.set=function(e,t){if(mc(this),typeof e==="object"){let n=Object.keys(e);for(let s of n)this.set(s,e[s]);return this}let r=this[W];if(r==null)r={},this[W]=r;if(e in r)delete r[e];return r.$set=r.$set||{},r.$set[e]=t,this};q.prototype.get=function(t){let r=this[W];if(r==null)return;let n=r.$set;if(n==null)return r[t];if(X.hasUserDefinedProperty(r,t))return r[t];if(X.hasUserDefinedProperty(n,t))return n[t];return};q.prototype.error=function(t){if(arguments.length===0)return this._error;return this._error=t,this};q.prototype._unsetCastError=function(){if(this._error==null||!(this._error instanceof Hf))return;return this.error(null)};q.prototype.mongooseOptions=function(e){if(arguments.length>0)this._mongooseOptions=e;return this._mongooseOptions};q.prototype._castConditions=function(){if(this.model?.db.config?.sanitizeFilter??this.model?.db.options?.sanitizeFilter??this.model?.base.options.sanitizeFilter??this._mongooseOptions.sanitizeFilter)KOe(this._conditions);try{this.cast(this.model),this._unsetCastError()}catch(t){this.error(t)}};/*!
912
+ * ignore
913
+ */function ig(e){try{ROe(e)}catch(t){e.error(t)}}q.prototype._find=async function(){if(this._applyTranslateAliases(),this._castConditions(),this.error()!=null)throw this.error();let t=this._mongooseOptions,r=this._userProvidedFields||{},n=this.model.db.options,s=this.model.base.options;Qf(this.options,n,s),Jf(this.options,n,s);let i={session:this?.options?.session||null,lean:t.lean||null};if(t.defaults!=null)i.defaults=t.defaults;let o=this._optionsForExec(),u=this._conditions,a=o.projection,c=await this.mongooseCollection.find(u,o);if(o.explain)return c.explain(o.explain);let l=await c.toArray();if(l.length===0)return l;if(!t.populate){let h=this.schema.options.versionKey;if(t.lean?.versionKey===!1&&h)l.forEach((d)=>{if(h in d)delete d[h]});return t.lean?YY(this.model.schema,l,null,i):this._completeMany(l,a,r,i)}let f=Io.preparePopulationOptionsMQ(this,t);if(this.options?._deferPopulate)return l=t.lean?l:await this._completeMany(l,a,r,i),this._deferredPopulate=f,l;if(t.lean)return this.model.populate(l,f);return l=await this._completeMany(l,a,r,i),await this.model.populate(l,f),l};q.prototype.find=function(e){if(typeof e==="function"||typeof arguments[1]==="function")throw new ft("Query.prototype.find() no longer accepts a callback");if(this.op="find",lu(e))this.merge(e),Zf(this);else if(e!=null)this.error(new cu(e,"filter","find"));return this};q.prototype.findAndCount=async function(){if(this.options.sort==null&&!this.schema?.options.defaultSort)throw new ft("Query.prototype.findAndCount() requires sort. Use `sort()` to set a sort order before calling `findAndCount()`.");if(X.isEmptyObject(this.options.sort))throw new ft("Query.prototype.findAndCount() does not allow an empty sort, like `sort(null)`. Remove the `sort()` call to use the schema's `defaultSort`.");if(this.options.limit==null)throw new ft("Query.prototype.findAndCount() requires limit. Use `limit()` to set a limit before calling `findAndCount()`.");this.op="find";let t=this.clone().countDocuments().skip(0).limit(null);return Promise.all([this.exec(),t.exec()])};q.prototype.merge=function(e){if(!e){if(e===null)this._conditions=null;return this}this._conditions=this._conditions??{};let t={overwrite:!0};if(e instanceof q){if(e._conditions){if(t.omit={},this._conditions&&this._conditions.$and&&e._conditions.$and)t.omit.$and=!0,this._conditions.$and=this._conditions.$and.concat(e._conditions.$and);if(this._conditions&&this._conditions.$or&&e._conditions.$or)t.omit.$or=!0,this._conditions.$or=this._conditions.$or.concat(e._conditions.$or);X.merge(this._conditions,e._conditions,t)}if(e._fields)this._fields||(this._fields={}),X.merge(this._fields,e._fields,t);if(e.options)this.options||(this.options={}),X.merge(this.options,e.options,t);if(e[W]!=null)mc(this),this[W]||(this[W]={}),X.mergeClone(this[W],e[W]);if(e._distinct)this._distinct=e._distinct;return X.merge(this._mongooseOptions,e._mongooseOptions),this}else if(this.model!=null&&e instanceof this.model.base.Types.ObjectId)return X.merge(this._conditions,{_id:e},t),this;else if(UOe(e))e=e.toObject(qOe);if(t.omit={},Array.isArray(e.$and)){if(t.omit.$and=!0,!this._conditions)this._conditions={};this._conditions.$and=(this._conditions.$and||[]).concat(e.$and.map((r)=>X.isPOJO(r)?X.merge({},r):r))}if(Array.isArray(e.$or)){if(t.omit.$or=!0,!this._conditions)this._conditions={};this._conditions.$or=(this._conditions.$or||[]).concat(e.$or.map((r)=>X.isPOJO(r)?X.merge({},r):r))}return X.merge(this._conditions,e,t),this};q.prototype.collation=function(e){if(this.options==null)this.options={};return this.options.collation=e,this};q.prototype._completeOne=function(e,t,r,n){if(!e&&!this.options.includeResultMetadata)return n(null,null);let s=this.model,i=this._userProvidedFields||{},o=this._mongooseOptions,u=this.options;if(!u.lean&&o.lean)u.lean=o.lean;if(u.explain)return n(null,e);if(!o.populate){let c=this.schema.options.versionKey;if(o.lean?.versionKey===!1&&c){if(c in e)delete e[c]}return o.lean?Gw(s.schema,e,null,t,u,n):UY(s,e,t,u,r,i,null,n)}let a=Io.preparePopulationOptionsMQ(this,this._mongooseOptions);if(o.lean)return s.populate(e,a).then((c)=>{Gw(s.schema,c,null,t,u,n)},(c)=>{n(c)});UY(s,e,t,u,r,i,[],(c,l)=>{if(c!=null)return n(c);s.populate(l,a).then((f)=>{n(null,f)},(f)=>{n(f)})})};q.prototype._completeMany=async function(t,r,n,s){let i=this.model;return Promise.all(t.map((o)=>new Promise((u,a)=>{let c=o;if(o=Io.createModel(i,o,r,n,s),s.session!=null)o.$session(s.session);o.$init(c,s,(l)=>{if(l!=null)return a(l);u(o)})})))};q.prototype._findOne=async function(){if(this._applyTranslateAliases(),this._castConditions(),this.error())throw this.error();let t=this.model.db.options,r=this.model.base.options;Qf(this.options,t,r),Jf(this.options,t,r);let n=this._optionsForExec(),s=await this.mongooseCollection.findOne(this._conditions,n);return new Promise((i,o)=>{this._completeOne(s,null,n.projection,(u,a)=>{if(u)return o(u);i(a)})})};q.prototype.findOne=function(e,t,r){if(typeof e==="function"||typeof t==="function"||typeof r==="function"||typeof arguments[3]==="function")throw new ft("Query.prototype.findOne() no longer accepts a callback");if(this.op="findOne",r)this.setOptions(r);if(t)this.select(t);if(lu(e))this.merge(e),Zf(this);else if(e!=null)this.error(new cu(e,"filter","findOne"));return this};q.prototype._countDocuments=async function(){if(this._applyTranslateAliases(),this._castConditions(),this.error())throw this.error();let t=this.model.db.options,r=this.model.base.options;Qf(this.options,t,r),Jf(this.options,t,r);let n=this._optionsForExec(),s=this._conditions;return this.mongooseCollection.countDocuments(s,n)};/*!
914
+ * If `translateAliases` option is set, call `Model.translateAliases()`
915
+ * on the following query properties: filter, projection, update, distinct.
916
+ */q.prototype._applyTranslateAliases=function(){let t=!1;if("translateAliases"in this._mongooseOptions)t=this._mongooseOptions.translateAliases;else if(this.model?.schema?._userProvidedOptions?.translateAliases!=null)t=this.model.schema._userProvidedOptions.translateAliases;else if(this.model?.base?.options?.translateAliases!=null)t=this.model.base.options.translateAliases;if(!t)return;if(this.model?.schema?.aliases&&X.hasOwnKeys(this.model.schema.aliases)){if(mc(this),this.model.translateAliases(this._conditions,!0),this.model.translateAliases(this._fields,!0),this.model.translateAliases(this[W],!0),this._distinct!=null&&this.model.schema.aliases[this._distinct]!=null)this._distinct=this.model.schema.aliases[this._distinct]}};q.prototype._estimatedDocumentCount=async function(){if(this.error())throw this.error();let t=this._optionsForExec();return this.mongooseCollection.estimatedDocumentCount(t)};q.prototype.estimatedDocumentCount=function(e){if(typeof e==="function"||typeof arguments[1]==="function")throw new ft("Query.prototype.estimatedDocumentCount() no longer accepts a callback");if(this.op="estimatedDocumentCount",e!=null)this.setOptions(e);return this};q.prototype.countDocuments=function(e,t){if(typeof e==="function"||typeof t==="function"||typeof arguments[2]==="function")throw new ft("Query.prototype.countDocuments() no longer accepts a callback");if(this.op="countDocuments",lu(e))this.merge(e);if(t!=null)this.setOptions(t);return this};q.prototype.__distinct=async function(){if(this._applyTranslateAliases(),this._castConditions(),this.error())throw this.error();let t=this.model.db.options,r=this.model.base.options;Qf(this.options,t,r),Jf(this.options,t,r);let n=this._optionsForExec();return this.mongooseCollection.distinct(this._distinct,this._conditions,n)};q.prototype.distinct=function(e,t,r){if(typeof e==="function"||typeof t==="function"||typeof r==="function"||typeof arguments[3]==="function")throw new ft("Query.prototype.distinct() no longer accepts a callback");if(this.op="distinct",lu(t))this.merge(t),Zf(this);else if(t!=null)this.error(new cu(t,"filter","distinct"));if(e!=null)this._distinct=e;if(r!=null)this.setOptions(r);return this};q.prototype.sort=function(e,t){if(arguments.length>2)throw new ft("sort() takes at most 2 arguments");if(t!=null&&typeof t!=="object")throw new ft("sort() options argument must be an object or nullish");if(this.options.sort==null)this.options.sort={};if(t?.override)this.options.sort={};return HY(this.options.sort,e),this};/*!
917
+ * Returns true if `filter` has a `$near` or `$nearSphere` condition, including within logical operators.
918
+ */function KY(e){for(let t of Object.keys(e)){let r=e[t];if(r==null||typeof r!=="object")continue;if(zOe.has(t)){if(Array.isArray(r)&&r.some((n)=>n!=null&&typeof n==="object"&&KY(n)))return!0}else if(Object.hasOwn(r,"$near")||Object.hasOwn(r,"$nearSphere"))return!0}return!1}/*!
919
+ * Add the keys from `arg`, which can be any value that `Query.prototype.sort()` accepts, to the `sort` object.
920
+ */function HY(e,t){if(typeof t==="string"){let r=t.indexOf(" ")===-1?[t]:t.split(" ");for(let n of r){let s=n[0]=="-"?-1:1;if(s===-1)n=n.slice(1);if(Mi.has(n))continue;e[n]=s}}else if(Array.isArray(t))for(let r of t){if(!Array.isArray(r))throw TypeError("Invalid sort() argument, must be array of arrays");let n=""+r[0];if(Mi.has(n))continue;e[n]=Ww(r[1],n)}else if(typeof t==="object"&&t!=null&&!(t instanceof Map))for(let r of Object.keys(t)){if(Mi.has(r))continue;e[r]=Ww(t[r],r)}else if(t instanceof Map)for(let r of t.keys()){if(r=""+r,Mi.has(r))continue;e[r]=Ww(t.get(r),r)}else if(t!=null)throw TypeError("Invalid sort() argument. Must be a string, object, array, or map.");return e}/*!
921
+ * Convert sort values
922
+ */function Ww(e,t){if(e===1||e==="asc"||e==="ascending")return 1;if(e===-1||e==="desc"||e==="descending")return-1;if(e!=null&&Object.hasOwn(e,"$meta")&&e.$meta!=null)return{$meta:e.$meta};throw TypeError("Invalid sort value: { "+t+": "+e+" }")}q.prototype.deleteOne=function(t,r){if(typeof t==="function"||typeof r==="function"||typeof arguments[2]==="function")throw new ft("Query.prototype.deleteOne() no longer accepts a callback");if(this.op="deleteOne",this.setOptions(r),lu(t))this.merge(t),Zf(this);else if(t!=null)this.error(new cu(t,"filter","deleteOne"));return this};q.prototype._deleteOne=async function(){if(this._applyTranslateAliases(),this._castConditions(),Da(this._conditions,this.options),this.error()!=null)throw this.error();let t=this._optionsForExec();return this.mongooseCollection.deleteOne(this._conditions,t)};q.prototype.deleteMany=function(e,t){if(typeof e==="function"||typeof t==="function"||typeof arguments[2]==="function")throw new ft("Query.prototype.deleteMany() no longer accepts a callback");if(this.setOptions(t),this.op="deleteMany",lu(e))this.merge(e),Zf(this);else if(e!=null)this.error(new cu(e,"filter","deleteMany"));return this};q.prototype._deleteMany=async function(){if(this._applyTranslateAliases(),this._castConditions(),Da(this._conditions,this.options),this.error()!=null)throw this.error();let t=this._optionsForExec();return this.mongooseCollection.deleteMany(this._conditions,t)};function UY(e,t,r,n,s,i,o,u){if(n.includeResultMetadata&&t==null)return a(null),null;Io.createModelAndInit(e,t,s,i,n,o,a);function a(c,l){if(c)return u(c);if(n.includeResultMetadata){if(t&&l){if(n.session!=null)l.$session(n.session);r.value=l}else r.value=null;return u(null,r)}if(n.session!=null)l.$session(n.session);u(null,l)}}function Zf(e){if(!e?.model?.schema)return;let t=e.model.schema;if(t?.discriminatorMapping&&!t.discriminatorMapping.isRoot)e._conditions[t.discriminatorMapping.key]=t.discriminatorMapping.value}q.prototype.findOneAndUpdate=function(e,t,r){if(typeof e==="function"||typeof t==="function"||typeof r==="function"||typeof arguments[3]==="function")throw new ft("Query.prototype.findOneAndUpdate() no longer accepts a callback");switch(this.op="findOneAndUpdate",this._validate(),arguments.length){case 2:r=void 0;break;case 1:t=e,e=r=void 0;break}if(lu(e))this.merge(e);else if(e!=null)this.error(new cu(e,"filter","findOneAndUpdate"));if(r=r?bs(r):{},r.projection)this.select(r.projection),delete r.projection;if(r.fields)this.select(r.fields),delete r.fields;let n=this?.model?.base?.options?.returnDocument,s=this?.model?.base?.options?.returnOriginal;if(r.new==null&&r.returnDocument==null&&r.returnOriginal==null){if(n!=null)r.returnDocument=n;else if(s!=null)r.returnOriginal=s}let i=this?.model?.base?.options?.updatePipeline;if(r.updatePipeline==null&&i!=null)r.updatePipeline=i;if(!r.updatePipeline&&Array.isArray(t))throw new ft("Cannot pass an array to query updates unless the `updatePipeline` option is set.");if(this.setOptions(r),t)if(this[W]==null||X.isEmptyObject(this[W]))this[W]=t,this._updateIsShared=!0;else this._mergeUpdate(t);return this};q.prototype._findOneAndUpdate=async function(){if(this._applyTranslateAliases(),this._castConditions(),Da(this._conditions,this.options),ig(this),this.error())throw this.error();let t=this.model.db.options,r=this.model.base.options;Qf(this.options,t,r),Jf(this.options,t,r);let n=this._optionsForExec(this.model);if(GY(n),this[W]=this._castUpdate(this[W]),this._updateIsShared=!1,kOe(this[W],n,this.schema.options.versionKey),this[W]=Qw(this._conditions,this.model.schema,this[W],n,this._mongooseOptions,this),!this[W]||X.hasOwnKeys(this[W])===!1)if(n.upsert){let u=bs(this[W]);delete u._id,this[W]={$set:u}}else return this._execCount=0,await this._findOne();else if(this[W]instanceof Error)throw this[W];else if(this[W].$set&&X.hasOwnKeys(this[W].$set)===!1)delete this[W].$set;if(ed(this,"runValidators",!1))await this.validate(this[W],n,!1);if(typeof this[W].toBSON==="function")this[W]=this[W].toBSON();let i=await this.mongooseCollection.findOneAndUpdate(this._conditions,this[W],n);for(let u of this._transforms)i=u(i);let o=!n.includeResultMetadata?i:i.value;return new Promise((u,a)=>{this._completeOne(o,i,n.projection,(c,l)=>{if(c)return a(c);u(l)})})};q.prototype.findOneAndDelete=function(e,t){if(typeof e==="function"||typeof t==="function"||typeof arguments[2]==="function")throw new ft("Query.prototype.findOneAndDelete() no longer accepts a callback");if(this.op="findOneAndDelete",this._validate(),lu(e))this.merge(e);return t&&this.setOptions(t),this};q.prototype._findOneAndDelete=async function(){if(this._applyTranslateAliases(),this._castConditions(),Da(this._conditions,this.options),this.error()!=null)throw this.error();let t=this.options.includeResultMetadata,r=this._conditions,n=this._optionsForExec(this.model),s=await this.mongooseCollection.findOneAndDelete(r,n);for(let o of this._transforms)s=o(s);let i=!t?s:s.value;return new Promise((o,u)=>{this._completeOne(i,s,n.projection,(a,c)=>{if(a)return u(a);o(c)})})};q.prototype.findOneAndReplace=function(e,t,r){if(typeof e==="function"||typeof t==="function"||typeof r==="function"||typeof arguments[4]==="function")throw new ft("Query.prototype.findOneAndReplace() no longer accepts a callback");if(this.op="findOneAndReplace",this._validate(),lu(e))this.merge(e);else if(e!=null)this.error(new cu(e,"filter","findOneAndReplace"));if(t!=null)this._mergeUpdate(t);r=r||{};let n=this?.model?.base?.options?.returnDocument,s=this?.model?.base?.options?.returnOriginal;if(r.new==null&&r.returnDocument==null&&r.returnOriginal==null){if(n!=null)r.returnDocument=n;else if(s!=null)r.returnOriginal=s}return this.setOptions(r),this};q.prototype._findOneAndReplace=async function(){if(this._applyTranslateAliases(),this._castConditions(),Da(this._conditions,this.options),this.error()!=null)throw this.error();let t=this._conditions,r=this._optionsForExec();GY(r);let n=this.options.includeResultMetadata,s={skipId:!0};if("strict"in this._mongooseOptions)s.strict=this._mongooseOptions.strict;let i=ed(this,"runValidators",!1);try{let a=new this.model(this[W],null,s);if(i)await a.validate();else if(a.$__.validationError)throw a.$__.validationError;this[W]=a.toBSON()}catch(a){if(a instanceof Yf)throw a;let c=new Yf;throw c.errors[a.path]=a,c}let o=await this.mongooseCollection.findOneAndReplace(t,this[W],r);for(let a of this._transforms)o=a(o);let u=!n?o:o.value;return new Promise((a,c)=>{this._completeOne(u,o,r.projection,(l,f)=>{if(l)return c(l);a(f)})})};q.prototype.findById=function(e,t,r){return this.findOne({_id:e},t,r)};q.prototype.findByIdAndUpdate=function(e,t,r){return this.findOneAndUpdate({_id:e},t,r)};q.prototype.findByIdAndDelete=function(e,t){return this.findOneAndDelete({_id:e},t)};function GY(e){if("new"in e){let t=e.new?"'after'":"'before'";X.warn("mongoose: the `new` option for `findOneAndUpdate()` and `findOneAndReplace()` is deprecated. Use `returnDocument: "+t+"` instead."),e.returnDocument=e.new?"after":"before",delete e.new}if("returnOriginal"in e){let t=e.returnOriginal?"'before'":"'after'";X.warn("mongoose: the `returnOriginal` option for `findOneAndUpdate()` and `findOneAndReplace()` is deprecated. Use `returnDocument: "+t+"` instead."),e.returnDocument=e.returnOriginal?"before":"after",delete e.returnOriginal}if(typeof e.returnDocument==="string")e.returnOriginal=e.returnDocument==="before"}function ed(e,t,r){let n=e._optionsForExec(e.model);if(t in n)return n[t];if(t in e.model.base.options)return e.model.base.options[t];return r}/*!
923
+ * ignore
924
+ */function Gw(e,t,r,n,s,i){if(s.lean&&typeof s.lean.transform==="function"){s.lean.transform(t);for(let o=0;o<e.childSchemas.length;o++){let u=r?r+"."+e.childSchemas[o].model.path:e.childSchemas[o].model.path,a=e.childSchemas[o].schema,c=sg.get(u,t);if(c==null)continue;if(Array.isArray(c))for(let l=0;l<c.length;l++)s.lean.transform(c[l]);else s.lean.transform(c);Gw(a,c,u,n,s)}if(i)return i(null,t);else return}if(s.includeResultMetadata)return i(null,n);return i(null,t)}/*!
925
+ * ignore
926
+ */function YY(e,t,r,n){if(n.lean&&typeof n.lean.transform==="function"){for(let s of t)n.lean.transform(s);for(let s=0;s<e.childSchemas.length;s++){let i=r?r+"."+e.childSchemas[s].model.path:e.childSchemas[s].model.path,o=e.childSchemas[s].schema,u=sg.get(i,t);if(u==null)continue;u=u.flat();for(let a=0;a<u.length;a++)n.lean.transform(u[a]);YY(o,u,i,n)}}return t}q.prototype._mergeUpdate=function(e){if(mc(this),!this._mongooseOptions.updatePipeline&&Array.isArray(e))throw new ft("Cannot pass an array to query updates unless the `updatePipeline` option is set.");if(!this[W])this[W]=Array.isArray(e)?[]:{};if(e==null||typeof e==="object"&&X.hasOwnKeys(e)===!1)return;if(e instanceof q){if(Array.isArray(this[W]))throw new ft(`Cannot mix array and object updates (current: ${Y1(this[W])}, incoming: ${Y1(e[W])})`);if(e[W])X.mergeClone(this[W],e[W])}else if(Array.isArray(e)){if(!Array.isArray(this[W]))if(this[W]==null||X.isEmptyObject(this[W]))this[W]=[];else throw new ft(`Cannot mix array and object updates (current: ${Y1(this[W])}, incoming: ${Y1(e)})`);this[W]=this[W].concat(e)}else{if(Array.isArray(this[W]))throw new ft(`Cannot mix array and object updates (current: ${Y1(this[W])}, incoming: ${Y1(e)})`);X.mergeClone(this[W],e)}};function Y1(e){let t=xi.inspect(e,{depth:2,maxArrayLength:5,breakLength:80,compact:!0});if(t.length>200)return`${t.slice(0,197)}...`;return t}q.prototype.validate=async function(t,r,n){if(typeof arguments[3]==="function")throw new ft("Query.prototype.validate() no longer accepts a callback");if(await JY(this,"validate"),n)await t.$validate();else{let s=await GOe(this,this.model.schema,t,r);if(s.length>0){let i=new Yf(null);for(let o of s)i.addError(o.path,o);throw i}}await QY(this,null,null,"validate")};q.prototype._updateMany=async function(){if(this._applyTranslateAliases(),this._castConditions(),Da(this._conditions,this.options),ig(this),this.error()!=null)throw this.error();let t=this._optionsForExec(this.model);if(mc(this),this[W]=this._castUpdate(this[W]),this[W]==null||X.hasOwnKeys(this[W])===!1)return{acknowledged:!1};if(Yw(this[W],t),this[W]=Qw(this._conditions,this.model.schema,this[W],t,this._mongooseOptions,this),ed(this,"runValidators",!1))await this.validate(this[W],t,!1);if(typeof this[W].toBSON==="function")this[W]=this[W].toBSON();return this.mongooseCollection.updateMany(this._conditions,this[W],t)};q.prototype._updateOne=async function(){if(this._applyTranslateAliases(),this._castConditions(),Da(this._conditions,this.options),ig(this),this.error()!=null)throw this.error();let t=this._optionsForExec(this.model);if(mc(this),this[W]=this._castUpdate(this[W]),this[W]==null||X.hasOwnKeys(this[W])===!1)return{acknowledged:!1};if(Yw(this[W],t),this[W]=Qw(this._conditions,this.model.schema,this[W],t,this._mongooseOptions,this),ed(this,"runValidators",!1))await this.validate(this[W],t,!1);if(typeof this[W].toBSON==="function")this[W]=this[W].toBSON();return this.mongooseCollection.updateOne(this._conditions,this[W],t)};q.prototype._replaceOne=async function(){if(this._applyTranslateAliases(),this._castConditions(),Da(this._conditions,this.options),ig(this),this.error()!=null)throw this.error();let t=this._optionsForExec(this.model),r={skipId:!0};if("strict"in this._mongooseOptions)r.strict=this._mongooseOptions.strict;let n=ed(this,"runValidators",!1);try{if(this[W]=new this.model(this[W],null,r),Yw(this[W],t),n)await this.validate(this[W],t,!0);else if(this[W].$__.validationError)throw this[W].$__.validationError;if(typeof this[W].toBSON==="function")this[W]=this[W].toBSON()}catch(s){if(s instanceof Yf)throw s;let i=new Yf;throw i.errors[s.path]=s,i}return this.mongooseCollection.replaceOne(this._conditions,this[W],t)};q.prototype.updateMany=function(e,t,r,n){if(typeof r==="function")n=r,r=void 0;else if(typeof t==="function")n=t,t=e,e={},r=void 0;else if(typeof e==="function")n=e,e=void 0,t=void 0,r=void 0;else if(typeof e==="object"&&!t&&!r&&!n)t=e,e=void 0,r=void 0,n=void 0;return Jw(this,"updateMany",e,t,r,n)};q.prototype.updateOne=function(e,t,r,n){if(typeof r==="function")n=r,r=void 0;else if(typeof t==="function")n=t,t=e,e={},r=void 0;else if(typeof e==="function")n=e,e=void 0,t=void 0,r=void 0;else if(typeof e==="object"&&!t&&!r&&!n)t=e,e=void 0,r=void 0,n=void 0;return Jw(this,"updateOne",e,t,r,n)};q.prototype.replaceOne=function(e,t,r,n){if(typeof r==="function")n=r,r=void 0;else if(typeof t==="function")n=t,t=e,e={},r=void 0;else if(typeof e==="function")n=e,e=void 0,t=void 0,r=void 0;else if(typeof e==="object"&&!t&&!r&&!n)t=e,e=void 0,r=void 0,n=void 0;return Jw(this,"replaceOne",e,t,r,n)};function Jw(e,t,r,n,s,i){if(e.op=t,n=n||{},!(r instanceof q)&&r!=null&&r.toString()!=="[object Object]")e.error(new cu(r,"filter",t));else e.merge(r);let o=e?.model?.base?.options?.updatePipeline;if(o!=null&&s?.updatePipeline==null)s=s||{},s.updatePipeline=o;if(!s?.updatePipeline&&Array.isArray(n))throw new ft("Cannot pass an array to query updates unless the `updatePipeline` option is set.");if(X.isObject(s))e.setOptions(s);if(e[W]==null||X.isEmptyObject(e[W]))e[W]=n,e._updateIsShared=!0;else e._mergeUpdate(n);if(i)return e.exec(i),e;return e}q.prototype.transform=function(e){return this._transforms.push(e),this};q.prototype.orFail=function(e){return this.transform((t)=>{switch(this.op){case"find":if(t.length===0)throw Q1(e,this);break;case"findOne":if(t==null)throw Q1(e,this);break;case"replaceOne":case"updateMany":case"updateOne":if(t?.matchedCount===0)throw Q1(e,this);break;case"findOneAndDelete":case"findOneAndUpdate":case"findOneAndReplace":if(this.options.includeResultMetadata&&t!=null&&t.value==null)throw Q1(e,this);if(!this.options.includeResultMetadata&&t==null)throw Q1(e,this);break;case"deleteMany":case"deleteOne":if(t.deletedCount===0)throw Q1(e,this);break;default:break}return t}),this};function Q1(e,t){if(typeof e==="function")e=e.call(t);if(e==null)e=new FOe(t.getQuery(),t.model.modelName);return e}q.prototype.isPathSelectedInclusive=function(e){return VOe(this._fields,e)};q.prototype.exec=async function(t){if(typeof t==="function"||arguments.length>=2&&typeof arguments[1]==="function")throw new ft("Query.prototype.exec() no longer accepts a callback");if(this._validateOp(),typeof t==="string")this.op=t;if(this.op==null)throw new ft("Query must have `op` before executing");if(this.model==null)throw new ft("Query must have an associated model before executing");let r=eSe.get(this.op);if(!r)throw new ft('Query has invalid `op`: "'+this.op+'"');if(this.options?.sort&&typeof this.options.sort==="object"&&Object.hasOwn(this.options.sort,""))throw new ft('Invalid field "" passed to sort()');if(this._execCount>0){let s=this.toString();if(s.length>60)s=s.slice(0,60)+"...";throw new ft("Query was already executed: "+s)}this._execCount++;let n=this;return JOe(async function(){let i=null;try{await n._hooks.execPre("exec",n,[])}catch(a){if(a instanceof Gf.skipWrappedFunction)i=a;else throw a}let o,u=null;try{await JY(n),o=i?i.args[0]:await n[r]();for(let a of n._transforms)o=a(o)}catch(a){if(a instanceof Gf.skipWrappedFunction)o=a.args[0];else u=a;u=n.model.schema._transformDuplicateKeyError(u)}return o=await QY(n,o,u),await n._hooks.execPost("exec",n,[]),o},()=>({operation:n.op,collection:n.mongooseCollection.name,database:n.model.db?.name,serverAddress:n.model.db?.host,serverPort:n.model.db?.port,args:{filter:n.getFilter(),fields:n._fields,options:n._mongooseOptions}}))};/*!
927
+ * ignore
928
+ */async function QY(e,t,r,n){if(e._queryMiddleware==null){if(r!=null)throw r;return t}let i={filter:WY(e.options,"post")};if(r)i.error=r;let[o]=await e._queryMiddleware.execPost(n||e.op,e,[t],i);return o}/*!
929
+ * ignore
930
+ */function JY(e,t){if(e._queryMiddleware==null)return;let r=WY(e.options,"pre");return e._queryMiddleware.execPre(t||e.op,e,[],{filter:r})}function mc(e){if(!e._updateIsShared)return;if(e.mongooseOptions().cloneUpdate===!1)return;e[W]=bs(e[W],{flattenDecimals:!1}),e._updateIsShared=!1}q.prototype.then=function(e,t){return this.exec().then(e,t)};q.prototype.catch=function(e){return this.exec().then(null,e)};q.prototype.finally=function(e){return this.exec().finally(e)};q.prototype[Symbol.toStringTag]=function(){return`Query { ${this.op} }`};q.prototype.pre=function(e){return this._hooks.pre("exec",e),this};q.prototype.post=function(e){return this._hooks.post("exec",e),this};q.prototype._castUpdate=function(t){let r=this.schema,n=r.options.discriminatorKey,s=r._baseSchema||r;if(this._mongooseOptions.overwriteDiscriminatorKey&&t[n]!=null&&s.discriminators){let o=Object.values(s.discriminators).find((u)=>u.discriminatorMapping.value===t[n]);if(o!=null)r=o}let i;if("upsert"in this.options)i=this.options.upsert;return vOe(r,t,{strict:this._mongooseOptions.strict,upsert:i,arrayFilters:this.options.arrayFilters,overwriteDiscriminatorKey:this._mongooseOptions.overwriteDiscriminatorKey,overwriteImmutable:this._mongooseOptions.overwriteImmutable},this,this._conditions)};q.prototype.populate=function(...e){if(!e.some(Boolean))return this;let t=X.populate.apply(null,e),r=this._mongooseOptions;if(r.lean!=null){let s=r.lean;for(let i of t)if(i?.options?.lean==null)i.options=i.options||{},i.options.lean=s}if(!X.isObject(r.populate))r.populate={};let n=r.populate;for(let s of t){let i=s.path;if(n[i]?.populate&&s.populate)s.populate=n[i].populate.concat(s.populate);n[s.path]=s}return this};q.prototype.getPopulatedPaths=function(){let t=this._mongooseOptions.populate||{},r=Object.keys(t);for(let n of Object.keys(t)){let s=t[n];if(!Array.isArray(s.populate))continue;XY(r,s.populate,n+".")}return r};/*!
931
+ * ignore
932
+ */function XY(e,t,r){for(let n of t){if(e.push(r+n.path),!Array.isArray(n.populate))continue;XY(e,n.populate,r+n.path+".")}}q.prototype.cast=function(e,t){t||(t=this._conditions),e=e||this.model;let r=e.schema.options.discriminatorKey;if(t!=null&&Object.hasOwn(t,r))e=VY(e.discriminators,t[r])||e;let n={upsert:this.options?.upsert};if("strict"in this._mongooseOptions)n.strict=this._mongooseOptions.strict;if("strictQuery"in this._mongooseOptions)n.strictQuery=this._mongooseOptions.strictQuery;n.sanitizeFilter=e.db.config?.sanitizeFilter??e.db.options?.sanitizeFilter??e.base.options.sanitizeFilter??this._mongooseOptions.sanitizeFilter;try{return $Oe(e.schema,t,n,this)}catch(s){if(typeof s.setModel==="function")s.setModel(e);throw s}};q.prototype._castFields=function(t){let r,n,s,i,o;if(t){s=Object.keys(t),n=[];for(let u=0;u<s.length;++u)if(i=s[u],t[i].$elemMatch)r||(r={}),r[i]=t[i],n.push(i)}if(r){o=this.cast(this.model,r);for(let u=0;u<n.length;++u)i=n[u],t[i]=o[i]}return t};q.prototype._applyPaths=function(){if(!this.model)return;this._fields=this._fields||{};let t=void 0;if(this.model!=null&&X.hasUserDefinedProperty(this.model.db.options,"sanitizeProjection"))t=this.model.db.options.sanitizeProjection;else if(this.model!=null&&X.hasUserDefinedProperty(this.model.base.options,"sanitizeProjection"))t=this.model.base.options.sanitizeProjection;else t=this._mongooseOptions.sanitizeProjection;if(t)zY(this._fields);if(this._mongooseOptions.schemaLevelProjections??!0){let s=this.model.schema,i=s.options.discriminatorKey;if(this._conditions!=null&&Object.hasOwn(this._conditions,i))s=VY(this.model.discriminators,this._conditions[i])?.schema??s;Io.applyPaths(this._fields,s,t)}let n=!0;if("selectPopulatedPaths"in this.model.base.options)n=this.model.base.options.selectPopulatedPaths;if("selectPopulatedPaths"in this.model.schema.options)n=this.model.schema.options.selectPopulatedPaths;if(n)HOe(this._fields,this._userProvidedFields,this._mongooseOptions.populate)};q.prototype.cursor=function(t){if(t)this.setOptions(t);try{this._castConditions()}catch(r){return new zw(this)._markError(r)}if(this.error())return new zw(this)._markError(this.error());return new zw(this)};q.prototype.tailable=function(e,t){if(typeof e?.constructor==="function"&&e.constructor.name==="Object")t=e,e=!0;if(e===void 0)e=!0;if(t&&typeof t==="object")for(let r of Object.keys(t))if(r==="awaitData"||r==="awaitdata")this.options.awaitData=!!t[r];else this.options[r]=t[r];return this.options.tailable=arguments.length?!!e:!0,this};q.prototype.near=function(){let e=[],t=this._mongooseOptions.nearSphere;if(arguments.length===1)if(Array.isArray(arguments[0]))e.push({center:arguments[0],spherical:t});else if(typeof arguments[0]==="string")e.push(arguments[0]);else if(X.isObject(arguments[0])){if(typeof arguments[0].spherical!=="boolean")arguments[0].spherical=t;e.push(arguments[0])}else throw TypeError("invalid argument");else if(arguments.length===2)if(typeof arguments[0]==="number"&&typeof arguments[1]==="number")e.push({center:[arguments[0],arguments[1]],spherical:t});else if(typeof arguments[0]==="string"&&Array.isArray(arguments[1]))e.push(arguments[0]),e.push({center:arguments[1],spherical:t});else if(typeof arguments[0]==="string"&&X.isObject(arguments[1])){if(e.push(arguments[0]),typeof arguments[1].spherical!=="boolean")arguments[1].spherical=t;e.push(arguments[1])}else throw TypeError("invalid argument");else if(arguments.length===3)if(typeof arguments[0]==="string"&&typeof arguments[1]==="number"&&typeof arguments[2]==="number")e.push(arguments[0]),e.push({center:[arguments[1],arguments[2]],spherical:t});else throw TypeError("invalid argument");else throw TypeError("invalid argument");return q.base.near.apply(this,e)};q.prototype.nearSphere=function(){return this._mongooseOptions.nearSphere=!0,this.near.apply(this,arguments),this};q.prototype[Symbol.asyncIterator]=function(){return this._mongooseOptions._asyncIterator=!0,this.cursor()};q.prototype.box=function(e,t){if(!Array.isArray(e)&&X.isObject(e))t=e.ur,e=e.ll;return q.base.box.call(this,e,t)};q.prototype.center=q.base.circle;q.prototype.centerSphere=function(){if(typeof arguments[0]?.constructor==="function"&&arguments[0].constructor.name==="Object")arguments[0].spherical=!0;if(typeof arguments[1]?.constructor==="function"&&arguments[1].constructor.name==="Object")arguments[1].spherical=!0;q.base.circle.apply(this,arguments)};q.prototype.selectedInclusively=function(){return LOe(this._fields)};q.prototype.selectedExclusively=function(){return jOe(this._fields)};q.prototype.model;function lu(e){return e instanceof q||X.isObject(e)||e===null}/*!
933
+ * Export
934
+ */ZY.exports=q});var iQ=g(function(SBe,sQ){/*!
935
+ * Module dependencies.
936
+ */var td=Le(),rQ=L("stream").Readable,rSe=Tw(),nSe=Mw(),sSe=Du(),nQ=Ja(),ug=L("util"),{cursorNextChannel:iSe}=K1(),{buildMiddlewareFilter:oSe}=Jo();function Ds(e){rQ.call(this,{autoDestroy:!0,objectMode:!0}),this.cursor=null,this._initializationComplete=!1,this.agg=e,this._transforms=[];let{_connection:t,_model:r}=e;if(delete e.options.cursor.useMongooseAggCursor,this._mongooseOptions={},t){let n=e.options||{};if(Object.hasOwn(n,"middleware")){let{middleware:s,...i}=n;n=i}this.cursor=t.db.aggregate(e._pipeline,n),this._initializationComplete=!0,setImmediate(()=>this.emit("cursor",this.cursor))}else uSe(r,this,e)}ug.inherits(Ds,rQ);/*!
937
+ * ignore
938
+ */function uSe(e,t,r){let n=oSe(r.options,"pre");e.hooks.execPre("aggregate",r,[],{filter:n}).then(()=>s(null),(i)=>s(i));function s(i){if(i!=null){aSe(t,i);return}if(typeof r.options?.cursor?.transform==="function")t._transforms.push(r.options.cursor.transform);if(e.collection._shouldBufferCommands()&&e.collection.buffer)e.collection.queue.push([()=>eQ(e,t,r)]);else eQ(e,t,r)}}/*!
939
+ * ignore
940
+ */function eQ(e,t,r){try{let n=r.options;if(Object.hasOwn(n,"middleware")){let{middleware:i,...o}=n;n=o}let s=e.collection.aggregate(r._pipeline,n);t.cursor=s,t._initializationComplete=!0,t.emit("cursor",s)}catch(n){if(t._initializationComplete=!0,t._markError(n),t.listeners("error").length>0)t._errorEmitted=!0,t.emit("error",t._error)}}function aSe(e,t){if(e._initializationComplete=!0,t instanceof nQ.skipWrappedFunction){let r=t.args[0];if(r!=null&&(!Array.isArray(r)||r.length)){let n=new td('Cannot `skipMiddlewareFunction()` with a value when using `.aggregate().cursor()`, value must be nullish or empty array, got "'+ug.inspect(r)+'".');if(e._markError(n),e.listeners("error").length>0)e._errorEmitted=!0,e.emit("error",n);return}e.emit("cursor",null);return}if(e._markError(t),e.listeners("error").length>0)e._errorEmitted=!0,e.emit("error",t)}Ds.prototype._read=function(){let e=this;ag(this,function(t,r){if(t)return e._errorEmitted=!0,e.emit("error",t);if(!r){e.push(null),e.cursor.close(function(n){if(n)return e.emit("error",n)});return}e.push(r)})};if(Symbol.asyncIterator!=null){let e="Mongoose does not support using async iterators with an existing aggregation cursor. See https://bit.ly/mongoose-async-iterate-aggregation";Ds.prototype[Symbol.asyncIterator]=function(){throw new td(e)}}Object.defineProperty(Ds.prototype,"map",{value:function(e){return this._transforms.push(e),this},enumerable:!0,configurable:!0,writable:!0});Ds.prototype._markError=function(e){return this._error=e,this};Ds.prototype.close=async function(){if(typeof arguments[0]==="function")throw new td("AggregationCursor.prototype.close() no longer accepts a callback");try{await this.cursor.close()}catch(t){if(this.listeners("error").length>0)this._errorEmitted=!0,this.emit("error",t);throw t}this.emit("close")};Ds.prototype._destroy=function(t,r){let n=null;if(!this._initializationComplete)n=nSe(this);else n=Promise.resolve();return n.then(()=>this.cursor?.close()).then(()=>{this._closed=!0;let s=!this._errorEmitted&&this.listeners("error").length>0;r(s?t:null)}).catch((s)=>{r(s)}),this};Ds.prototype.next=async function(){if(typeof arguments[0]==="function")throw new td("AggregationCursor.prototype.next() no longer accepts a callback");let t=this,r=this.agg._model;return iSe.trace(function(){return new Promise((s,i)=>{ag(t,(o,u)=>{if(o!=null)return i(o);s(u)})})},()=>({operation:"aggregate",collection:r?.collection?.name,database:r?.db?.name,serverAddress:r?.db?.host,serverPort:r?.db?.port,batchSize:t.agg.options?.cursor?.batchSize,tailable:!1,args:{pipeline:t.agg._pipeline,options:t.agg.options}}))};Ds.prototype.eachAsync=function(e,t){if(typeof arguments[2]==="function")throw new td("AggregationCursor.prototype.eachAsync() no longer accepts a callback");let r=this;if(typeof t==="function")t={};return t=t||{},rSe(function(n){return ag(r,n)},e,t)};if(Symbol.asyncIterator!=null)Ds.prototype[Symbol.asyncIterator]=function(){return this.transformNull()._transformForAsyncIterator()};/*!
941
+ * ignore
942
+ */Ds.prototype._transformForAsyncIterator=function(){if(this._transforms.indexOf(tQ)===-1)this.map(tQ);return this};/*!
943
+ * ignore
944
+ */Ds.prototype.transformNull=function(e){if(arguments.length===0)e=!0;return this._mongooseOptions.transformNull=e,this};/*!
945
+ * ignore
946
+ */function tQ(e){return e==null?{done:!0}:{value:e,done:!1}}Ds.prototype.addCursorFlag=function(e,t){let r=this;return cSe(this,function(){r.cursor.addCursorFlag(e,t)}),this};/*!
947
+ * ignore
948
+ */function cSe(e,t){if(e.cursor)return t();e.once("cursor",function(){t()})}function ag(e,t){let r=t;if(e._transforms.length)r=function(n,s){if(n||s===null&&!e._mongooseOptions.transformNull)return t(n,s);t(n,e._transforms.reduce(function(i,o){return o(i)},s))};if(e._error)return sSe(function(){r(e._error)});if(e.cursor)return e.cursor.next().then((n)=>{if(!n)return r(null,null);r(null,n)},(n)=>r(n));else e.once("error",t),e.once("cursor",function(){ag(e,t)})}sQ.exports=Ds});var Xw=g(function(CBe,oQ){oQ.exports=function(t,r,n){let s=r?.discriminatorMapping;if(n=n||"",s&&!s.isRoot){let i=t,o=(n.length>0?n+".":n)+s.key,u=s.value;if(i[0]!=null&&i[0].$match&&(i[0].$match[o]===void 0||i[0].$match[o]===u))i[0].$match[o]=u;else if(i[0]?.$geoNear)i[0].$geoNear.query=i[0].$geoNear.query||{},i[0].$geoNear.query[o]=u;else if(i[0]?.$search)if(i[1]?.$match!=null)i[1].$match[o]=i[1].$match[o]||u;else{let a={};a[o]=u,i.splice(1,0,{$match:a})}else{let a={};a[o]=u,i.unshift({$match:a})}}}});var aQ=g(function(bBe,uQ){uQ.exports=function e(t){if(!Array.isArray(t))return;for(let r of t){if(r==null)continue;let n=r.$group||r.$bucket||r.$bucketAuto;if(n!=null)for(let i of Object.keys(n))lSe(n[i]);let s=Object.keys(r)[0];if(s&&typeof r[s]==="object"){let i=r[s];for(let o of Object.keys(i))if(i[o]!=null&&i[o].$function!=null&&typeof i[o].$function.body==="function")i[o].$function.body=i[o].$function.body.toString()}if(r.$facet!=null)for(let i of Object.keys(r.$facet))e(r.$facet[i])}};function lSe(e){if(e==null||e.$accumulator==null)return;for(let t of["init","accumulate","merge","finalize"])if(typeof e.$accumulator[t]==="function")e.$accumulator[t]=String(e.$accumulator[t])}});var eO=g(function(DBe,fQ){/*!
949
+ * Module dependencies
950
+ */var hQ=iQ(),ns=Le(),lg=og(),{applyGlobalMaxTimeMS:hSe,applyGlobalDiskUse:fSe}=Pw(),dSe=Zt(),pSe=Rn(),Zw=Xw(),{buildMiddlewareFilter:cg}=Jo(),mSe=aQ(),J1=we(),{modelSymbol:ySe}=le(),{createTracedChannel:gSe}=K1(),{trace:cQ}=gSe("mongoose:aggregate"),ESe=lg.prototype.read,_Se=lg.prototype.readConcern,lQ=new Set(["$$DESCEND","$$PRUNE","$$KEEP"]);function He(e,t){if(this._pipeline=[],t==null||t[ySe])this._model=t;else this._connection=t;if(this.options={},arguments.length===1&&Array.isArray(e))this.append.apply(this,e)}He.prototype.options;He.prototype._optionsForExec=function(){let e=this.options||{},t=this.model()?.db?.base.transactionAsyncLocalStorage?.getStore();if(!Object.hasOwn(e,"session")&&t?.session!=null)e.session=t.session;return e};He.prototype.model=function(e){if(arguments.length===0)return this._model;if(this._model=e,e.schema!=null){if(this.options.readPreference==null&&e.schema.options.read!=null)this.options.readPreference=e.schema.options.read;if(this.options.collation==null&&e.schema.options.collation!=null)this.options.collation=e.schema.options.collation}return e};He.prototype.append=function(){let e=arguments.length===1&&Array.isArray(arguments[0])?arguments[0]:[...arguments];if(!e.every(ASe))throw new ns("Arguments must be aggregate pipeline operators");return this._pipeline=this._pipeline.concat(e),this};He.prototype.addFields=function(e){if(typeof e!=="object"||e===null||Array.isArray(e))throw new ns("Invalid addFields() argument. Must be an object");return this.append({$addFields:Object.assign({},e)})};He.prototype.project=function(e){let t={};if(typeof e==="object"&&!Array.isArray(e))Object.keys(e).forEach(function(r){if(r==="__proto__")return;t[r]=e[r]});else if(arguments.length===1&&typeof e==="string")e.split(/\s+/).forEach(function(r){if(!r)return;let n=r[0]==="-"?0:1;if(n===0)r=r.substring(1);t[r]=n});else throw new ns("Invalid project() argument. Must be string or object");return this.append({$project:t})};He.prototype.near=function(e){if(e==null)throw new ns("Aggregate `near()` must be called with non-nullish argument");if(e.near==null)throw new ns("Aggregate `near()` argument must have a `near` property");let t=Array.isArray(e.near)?e.near:e.near.coordinates;if(typeof e.near==="object"&&(!Array.isArray(t)||t.length<2||t.find((n)=>typeof n!=="number")))throw new ns(`Aggregate \`near()\` argument has invalid coordinates, got "${t}"`);let r={};return r.$geoNear=e,this.append(r)};/*!
951
+ * define methods
952
+ */"group match skip limit out densify fill".split(" ").forEach(function(e){He.prototype[e]=function(t){let r={};return r["$"+e]=t,this.append(r)}});He.prototype.unwind=function(){let e=[...arguments],t=[];for(let r of e)if(r&&typeof r==="object")t.push({$unwind:r});else if(typeof r==="string")t.push({$unwind:r[0]==="$"?r:"$"+r});else throw new ns('Invalid arg "'+r+'" to unwind(), must be string or object');return this.append.apply(this,t)};He.prototype.replaceRoot=function(e){let t;if(typeof e==="string")t=e.startsWith("$")?e:"$"+e;else t=e;return this.append({$replaceRoot:{newRoot:t}})};He.prototype.count=function(e){return this.append({$count:e})};He.prototype.sortByCount=function(e){if(e&&typeof e==="object")return this.append({$sortByCount:e});else if(typeof e==="string")return this.append({$sortByCount:e[0]==="$"?e:"$"+e});else throw TypeError('Invalid arg "'+e+'" to sortByCount(), must be string or object')};He.prototype.lookup=function(e){return this.append({$lookup:e})};He.prototype.graphLookup=function(e){let t={};if(e){if(!J1.isObject(e))throw TypeError("Invalid graphLookup() argument. Must be an object.");J1.mergeClone(t,e);let r=t.startWith;if(r&&typeof r==="string")t.startWith=t.startWith.startsWith("$")?t.startWith:"$"+t.startWith}return this.append({$graphLookup:t})};He.prototype.sample=function(e){return this.append({$sample:{size:e}})};He.prototype.sort=function(e){let t={};if(pSe(e)==="Object"){let r=["desc","descending",-1];Object.keys(e).forEach(function(n){if(e[n]instanceof Object&&e[n].$meta){t[n]=e[n];return}t[n]=r.indexOf(e[n])===-1?1:-1})}else if(arguments.length===1&&typeof e==="string")e.split(/\s+/).forEach(function(r){if(!r)return;let n=r[0]==="-"?-1:1;if(n===-1)r=r.substring(1);t[r]=n});else throw TypeError("Invalid sort() argument. Must be a string or object.");return this.append({$sort:t})};He.prototype.unionWith=function(e){return this.append({$unionWith:e})};He.prototype.read=function(e,t){return ESe.call(this,e,t),this};He.prototype.readConcern=function(e){return _Se.call(this,e),this};He.prototype.redact=function(e,t,r){if(arguments.length===3){if(typeof t==="string"&&!lQ.has(t)||typeof r==="string"&&!lQ.has(r))throw new ns("If thenExpr or elseExpr is string, it must be either $$DESCEND, $$PRUNE or $$KEEP");e={$cond:{if:e,then:t,else:r}}}else if(arguments.length!==1)throw TypeError("Invalid arguments");return this.append({$redact:e})};He.prototype.explain=async function(t){if(typeof t==="function"||typeof arguments[1]==="function")throw new ns("Aggregate.prototype.explain() no longer accepts a callback");let r=this._model;if(!this._pipeline.length)throw new ns("Aggregate has empty pipeline");Zw(this._pipeline,this._model.schema);let n=cg(this.options,"pre"),s=cg(this.options,"post"),{middleware:i,...o}=this.options??{};try{await r.hooks.execPre("aggregate",this,[],{filter:n})}catch(c){return await r.hooks.execPost("aggregate",this,[null],{error:c,filter:s})}let u=await r.collection.aggregate(this._pipeline,o);if(t==null)t=!0;let a=null;try{a=await u.explain(t)}catch(c){return await r.hooks.execPost("aggregate",this,[null],{error:c,filter:s})}return await r.hooks.execPost("aggregate",this,[a],{error:null,filter:s}),a};He.prototype.allowDiskUse=function(e){return this.options.allowDiskUse=e,this};He.prototype.hint=function(e){return this.options.hint=e,this};He.prototype.session=function(e){if(e==null)delete this.options.session;else this.options.session=e;return this};He.prototype.option=function(e){for(let t in e)this.options[t]=e[t];return this};He.prototype.cursor=function(e){if(this._optionsForExec(),J1.hasUserDefinedProperty(e,"middleware")){let{middleware:t,...r}=e;this.options.middleware=t,e=r}return this.options.cursor=e||{},new hQ(this)};He.prototype.collation=function(e){return this.options.collation=e,this};He.prototype.facet=function(e){return this.append({$facet:e})};He.prototype.search=function(e){return this.append({$search:e})};He.prototype.pipeline=function(){return this._pipeline};He.prototype.pipelineForUnionWith=function(){for(let t of this._pipeline)if(t?.$out!=null||t?.$merge!=null)throw new ns("Aggregate pipeline for $unionWith cannot include `$out` or `$merge` stages");return this._pipeline};He.prototype.exec=async function(){if(!this._model&&!this._connection)throw new ns("Aggregate not bound to any Model");if(typeof arguments[0]==="function")throw new ns("Aggregate.prototype.exec() no longer accepts a callback");if(this._connection){if(!this._pipeline.length)throw new ns("Aggregate has empty pipeline");this._optionsForExec();let s=this;return cQ(async function(){return await(await s._connection.client.db().aggregate(s._pipeline,s.options)).toArray()},()=>({operation:"aggregate",database:s._connection.name,serverAddress:s._connection.host,serverPort:s._connection.port,args:{pipeline:s._pipeline,options:s.options}}))}let t=this._model,r=this._model.collection;if(hSe(this.options,t.db.options,t.base.options),fSe(this.options,t.db.options,t.base.options),this._optionsForExec(),this.options?.cursor)return new hQ(this);Zw(this._pipeline,this._model.schema),mSe(this._pipeline);let n=this;return cQ(async function(){let i=cg(n.options,"pre"),o=cg(n.options,"post");try{await t.hooks.execPre("aggregate",n,[],{filter:i})}catch(l){return await t.hooks.execPost("aggregate",n,[null],{error:l,filter:o})}if(!n._pipeline.length)throw new ns("Aggregate has empty pipeline");let{middleware:u,...a}=dSe(n.options||{}),c;try{c=await(await r.aggregate(n._pipeline,a)).toArray()}catch(l){return await t.hooks.execPost("aggregate",n,[null],{error:l,filter:o})}return await t.hooks.execPost("aggregate",n,[c],{error:null,filter:o}),c},()=>({operation:"aggregate",collection:r.name,database:t.db?.name,serverAddress:t.db?.host,serverPort:t.db?.port,args:{pipeline:n._pipeline,options:n.options}}))};He.prototype.then=function(e,t){return this.exec().then(e,t)};He.prototype.catch=function(e){return this.exec().then(null,e)};He.prototype.finally=function(e){return this.exec().finally(e)};He.prototype[Symbol.asyncIterator]=function(){return this.cursor({useMongooseAggCursor:!0}).transformNull()._transformForAsyncIterator()};/*!
953
+ * Helpers
954
+ */function ASe(e){if(typeof e!=="object"||e===null)return!1;let t=Object.keys(e);return t.length===1&&t[0][0]==="$"}He._prepareDiscriminatorPipeline=Zw;/*!
955
+ * Exports
956
+ */fQ.exports=He});var pQ=g(function(TBe,dQ){var wSe=Zt();class tO{constructor(e){if(e==null)return;Object.assign(this,wSe(e))}}tO.prototype.__subdocs=null;dQ.exports=tO});var yQ=g(function(MBe,mQ){mQ.exports=function e(t,r){let n=Object.keys(r.paths),s=n.length;for(let i=0;i<s;++i){let o="",u=n[i],a=r.paths[u],c=a.splitPath(),l=c.length,f=t;for(let h=0;h<l;++h){if(f==null)break;let d=c[h];if(o+=(!o.length?"":".")+d,h===l-1){if(typeof f[d]<"u"){if(a.$isSingleNested)e(f[d],a.schema);else if(a.$isMongooseDocumentArray&&Array.isArray(f[d]))f[d].forEach((m)=>e(m,a.schema));break}let p=a.getDefault(t,!1,{skipCast:!0});if(typeof p<"u"){if(f[d]=p,a.$isSingleNested)e(p,a.schema);else if(a.$isMongooseDocumentArray&&Array.isArray(p))p.forEach((m)=>e(m,a.schema))}}else{if(f[d]==null)f[d]={};f=f[d]}}}}});var nO=g(function(xBe,gQ){gQ.exports=rO;function rO(e,t=new WeakSet,r=!1){if(t.has(e))return;t.add(e);for(let n of Object.keys(e.paths)){let s=e.paths[n];if(!s.schema)continue;if(rO(s.schema,t),!s.schema._applyDiscriminators)continue;if(s._appliedDiscriminators&&!r)continue;for(let i of s.schema._applyDiscriminators.keys()){let{schema:o,options:u}=s.schema._applyDiscriminators.get(i);rO(o,t),s.discriminator(i,o,r?{...u,overwriteExisting:!0}:u)}s._appliedDiscriminators=!0}}});var AQ=g(function(PBe,_Q){var{buildMiddlewareFilter:EQ,middlewareFiltersFromLastArg:OSe}=Jo();/*!
957
+ * ignore
958
+ */_Q.exports=rd;/*!
959
+ * ignore
960
+ */rd.middlewareFunctions=["deleteOne","remove","save","updateOne","validate","init"];/*!
961
+ * ignore
962
+ */var SSe=new Set(rd.middlewareFunctions.flatMap((e)=>[e,`$__${e}`]));function rd(e,t,r){r=r||{};let n={useErrorHandlers:!0,numCallbackParams:1,nullResultByDefault:!0,contextParameter:!0},s=r.decorateDoc?e:e.prototype;e.$appliedHooks=!0;for(let c of Object.keys(t.paths)){let l=t.paths[c],f=null,h=sO(l);if(h)f=h.childModel,l=h.type;else continue;if(f.$appliedHooks)continue;if(rd(f,l.schema,{...r,decorateDoc:!1,isChildSchema:!0}),f.discriminators!=null){let d=Object.keys(f.discriminators);for(let p of d)rd(f.discriminators[p],f.discriminators[p].schema,r)}}let i=t._getDocumentMiddleware(e.prototype.$isSubdocument);e._middleware=i;let o=s.$__init;if(i.hasHooks("init"))s.$__init=i.createWrapperSync("init",o,null,{...n,getOptions:(c)=>{let l=c[1];return{pre:{filter:EQ(l,"pre")},post:{filter:EQ(l,"post")}}}});else s.$__init=o;let u=Object.keys(t.methods),a=Object.assign({},n,{checkForPromise:!0});for(let c of u){if(SSe.has(c))continue;if(!i.hasHooks(c))continue;let l=s[c];s[`$__${c}`]=s[c];let f=l.supportsMiddlewareOption===!0?{...a,getOptions:OSe}:a;s[c]=i.createWrapper(c,l,null,f)}}function sO(e){if(e.$isSingleNested||e.$isMongooseDocumentArray)return{childModel:e.Constructor,type:e};if(e.instance==="Array"){let t=e.getEmbeddedSchemaType();if(t)return sO(t)}if(e.instance==="Map"){let t=e.getEmbeddedSchemaType();if(t)return sO(t)}return null}});var SQ=g(function(FBe,OQ){var CSe=gr(),wQ=we();OQ.exports=function e(t,r){let n=iO();function s(i,o){Object.defineProperty(t.prototype,i,{get:function(){let u={};for(let a in o.methods[i])u[a]=o.methods[i][a].bind(this);return u},configurable:!0})}for(let i of Object.keys(r.methods)){let o=r.methods[i];if(Object.hasOwn(r.tree,i))throw Error('You have a method and a property in your schema both named "'+i+'"');if(typeof o==="function"&&n.prototype[i]===o){delete r.methods[i];continue}if(r.reserved[i]&&!CSe(r,`methodOptions.${i}.suppressWarning`,!1))wQ.warn(`mongoose: the method name "${i}" is used by mongoose internally, overwriting it may cause bugs. If you're sure you know what you're doing, you can suppress this error by using \`schema.method('${i}', fn, { suppressWarning: true })\`.`);if(typeof o==="function")t.prototype[i]=o;else s(i,r)}t.$appliedMethods=!0;for(let i of Object.keys(r.paths)){let o=r.paths[i];if(o.$isSingleNested&&!o.Constructor.$appliedMethods)e(o.Constructor,o.schema);if(o.$isMongooseDocumentArray&&!o.Constructor.$appliedMethods)e(o.Constructor,o.schema)}}});var DQ=g(function(BBe,bQ){var CQ=H6(),bSe=tc(),DSe=J2(),dg=we().isPOJO;bQ.exports=function(t,r,n){if(r==null)return t;if(t==null)return t;let s=null;if(DSe(r))s=!1;else if(bSe(r))s=!0;if(s==null)return t;else if(s)return n=n||CQ(r),hg(t,r,n);else return n=n||CQ(r),fg(t,r,n)};function hg(e,t,r,n,s){if(e==null||typeof e!=="object")return e;if(Array.isArray(e))return e.map((o)=>hg(o,t,r,n,s));let i={...e};n=s?n||{}:t;for(let o of Object.keys(i)){let u=s?s+"."+o:o;if(Object.hasOwn(t,u)||Object.hasOwn(n,o))if(dg(t[u])||dg(n[o]))i[o]=hg(i[o],t,r,n[o],u);else delete i[o];else if(r[u])i[o]=hg(i[o],t,r,n[o],u)}return i}function fg(e,t,r,n,s){if(e==null||typeof e!=="object")return e;if(Array.isArray(e))return e.map((o)=>fg(o,t,r,n,s));let i={...e};n=s?n||{}:t;for(let o of Object.keys(i)){let u=s?s+"."+o:o;if(Object.hasOwn(t,u)||Object.hasOwn(n,o)){if(dg(t[u])||dg(n[o]))i[o]=fg(i[o],t,r,n[o],u);continue}else if(r[u])i[o]=fg(i[o],t,r,n[o],u);else delete i[o]}return i}});var MQ=g(function(NBe,TQ){TQ.exports=function(t){let r=!1;for(let n of Object.keys(t))if(t[n]==="text")r=!0;return r}});var PQ=g(function(IBe,xQ){var TSe=MQ();xQ.exports=function(t,r,n){if(TSe(t))return;if(Object.hasOwn(n,"collation")&&!Object.hasOwn(r,"collation"))r.collation=n.collation}});var BQ=g(function($Be,FQ){var{middlewareFiltersFromLastArg:MSe}=Jo(),{queryMiddlewareFunctions:xSe,aggregateMiddlewareFunctions:PSe,modelMiddlewareFunctions:FSe,documentMiddlewareFunctions:BSe}=Of(),NSe=Array.from(new Set([...xSe,...PSe,...FSe,...BSe]));FQ.exports=function(t,r,n){r=r.filter((s)=>{if(NSe.indexOf(s.name)!==-1)return!!s.model;return s.model!==!1});for(let s of Object.keys(n))if(r.hasHooks(s)){let i=t[s],o=i.supportsMiddlewareOption===!0?{getOptions:MSe}:void 0;t[s]=r.createWrapper(s,i,null,o)}}});var IQ=g(function(RBe,NQ){NQ.exports=function(t,r){for(let n in r.statics)t[n]=r.statics[n]}});var LQ=g(function(vBe,jQ){var $Q=vy(),RQ=ks(),vQ=we();jQ.exports=kQ;function kQ(e,t,r){if(t==null)return t;return ISe(e,t,r),qQ(e,t,r)}function ISe(e,t,r){for(let n of e.childSchemas){let s=n.model.path,i=n.schema;if(!s)continue;let o=RQ.get(s,t);if(o==null||Array.isArray(o)&&o.flat(1/0).length===0)continue;kQ(i,o,r)}}function qQ(e,t,r){if(t==null||typeof t!=="object")return;if(Array.isArray(t)){for(let u of t)qQ(e,u,r);return}if(e.discriminators&&vQ.hasOwnKeys(e.discriminators))for(let u of Object.keys(e.discriminators)){let a=e.discriminators[u],c=a.discriminatorMapping.key,l=a.discriminatorMapping.value;if(t[c]==l){e=a;break}}let n=$Q(e.options.timestamps,"createdAt"),s=$Q(e.options.timestamps,"updatedAt"),i=r?.currentTime,o=null;if(i!=null)o=i();else if(e.base?.now)o=e.base.now();else o=new Date;if(n&&t[n]==null&&!r?.isUpdate)t[n]=o;if(s)t[s]=o}});var KQ=g(function(kBe,WQ){var UQ=ks(),VQ=we();WQ.exports=zQ;function zQ(e,t,r){if(t==null)return t;let n=r,s=null;if(Array.isArray(r)){n=[],s=[];for(let i of r)if(i.length===1)s.push(i[0]);else n.push(i)}return $Se(e,t,n),oO(e,t,s)}function $Se(e,t,r){let n=!1;for(let s of e.childSchemas){let i=s.model.path,o=s.schema;if(!i)continue;let u=UQ.get(i,t);if(u==null||Array.isArray(u)&&u.flat(1/0).length===0)continue;let a=null;if(Array.isArray(r)){a=[];for(let c of r)if(c[0]==i)a.push(c.slice(1));if(a.length===0)continue}zQ(o,u,a),n=!0}if(r?.length&&!n)oO(e,t,r)}function oO(e,t,r){if(t==null||typeof t!=="object")return;if(Array.isArray(t)){for(let n of t)oO(e,n,r);return}if(e.discriminators&&VQ.hasOwnKeys(e.discriminators))for(let n of Object.keys(e.discriminators)){let s=e.discriminators[n],i=s.discriminatorMapping.key,o=s.discriminatorMapping.value;if(t[i]==o){e=s;break}}if(r==null)r=Object.keys(e.virtuals);for(let n of r){if(e.virtuals[n]==null)continue;let s=e.virtuals[n],i=Array.isArray(n)?n:n.indexOf(".")===-1?[n]:n.split("."),o=t;for(let c=0;c<i.length-1;++c)o[i[c]]=i[c]in o?o[i[c]]:{},o=o[i[c]];let u=s.applyGetters(o[i[i.length-1]],t);if((s.options?.ref||s.options?.refPath)&&u===void 0)if(s.options.justOne)u=null;else u=[];o[i[i.length-1]]=u}}});var pg=g(function(qBe,HQ){HQ.exports=function e(t){if(!(this instanceof e))return new e(t);return this.val=t,this}});var nd=g(function(jBe,GQ){/*!
963
+ * ignore
964
+ */GQ.exports=new WeakMap});var XQ=g(function(LBe,JQ){var RSe=Zt(),yg=nd(),vSe=le().modelSymbol,YQ=we();JQ.exports=QQ;var mg=Symbol("mongoose#assignRawDocsToIdStructure#hasArray");function QQ(e,t,r,n,s){let i=[],o=n.isVirtual&&n.justOne&&e.length>1?!1:n.sort&&e.length>1,u=n.$nullIfNotFound,a,c,l;if(YQ.isMongooseArray(e))e=e.__array;let f=0,h=e.length;if(o&&s&&n[mg]===void 0){n[mg]=!1;for(let d in r)if(Array.isArray(r[d])){n[mg]=!0;break}}for(f=0;f<h;++f){if(l=e[f],Array.isArray(l)){QQ(l,t,r,n,!0),i.push(l);continue}if(l===null&&o===!1){i.push(l);continue}if(c=String(l),a=t[c],n.clone&&a!=null)if(n.lean){let d=yg.get(a);a=RSe(a),yg.set(a,d)}else a=a.constructor.hydrate(a._doc);if(s)if(a)if(o){let d=r[c];if(n[mg])i.push(a);else i[d]=a}else i.push(a);else if(l?.[vSe]!=null)i.push(l);else i.push(n.retainNullValues||u?null:l);else i[f]=a||null}if(e.length=0,i.length)i.forEach(function(d,p){e[p]=d})}});var uO=g(function(UBe,ZQ){ZQ.exports=gg;/*!
965
+ * ignore
966
+ */function gg(e,t){if(e.virtuals[t])return{virtual:e.virtuals[t],path:void 0};let r=t.split("."),n="",s="";for(let i=0;i<r.length;++i){if(n+=(n.length>0?".":"")+r[i],e.virtuals[n]){if(i===r.length-1)return{virtual:e.virtuals[n],path:s};continue}if(e.nested[n])continue;if(e.paths[n]&&e.paths[n].schema){e=e.paths[n].schema;let o=r.slice(i+1).join(".");if(e.virtuals[o]){if(i===r.length-2)return{virtual:e.virtuals[o],nestedSchemaPath:[s,n].filter((u)=>!!u).join(".")};continue}if(i+1<r.length&&e.discriminators)for(let u of Object.keys(e.discriminators)){let a=gg(e.discriminators[u],o);if(a!=null){let c=[s,n,a.nestedSchemaPath].filter((l)=>!!l).join(".");return{virtual:a.virtual,nestedSchemaPath:c}}}s+=(s.length>0?".":"")+n,n="";continue}else if(e.paths[n]?.$isSchemaMap&&e.paths[n].$__schemaType?.schema){e=e.paths[n].$__schemaType.schema,++i;let o=r.slice(i+1).join(".");if(e.virtuals[o]){if(i===r.length-2)return{virtual:e.virtuals[o],nestedSchemaPath:[s,n,"$*"].filter((u)=>!!u).join(".")};continue}if(i+1<r.length&&e.discriminators)for(let u of Object.keys(e.discriminators)){let a=gg(e.discriminators[u],o);if(a!=null){let c=[s,n,a.nestedSchemaPath,"$*"].filter((l)=>!!l).join(".");return{virtual:a.virtual,nestedSchemaPath:c}}}s+=(s.length>0?".":"")+"$*"+n,n=""}if(e.discriminators)for(let o of Object.keys(e.discriminators)){let u=gg(e.discriminators[o],t);if(u)return u}return null}}});var tJ=g(function(Eg,eJ){(function(e,t){typeof Eg==="object"&&typeof eJ<"u"?t(Eg):typeof define==="function"&&define.amd?define(["exports"],t):(e=typeof globalThis<"u"?globalThis:e||self,t(e.sift={}))})(Eg,function(e){var t=function(S,b){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(D,R){D.__proto__=R}||function(D,R){for(var Q in R)if(Object.prototype.hasOwnProperty.call(R,Q))D[Q]=R[Q]},t(S,b)};function r(S,b){if(typeof b!=="function"&&b!==null)throw TypeError("Class extends value "+String(b)+" is not a constructor or null");t(S,b);function D(){this.constructor=S}S.prototype=b===null?Object.create(b):(D.prototype=b.prototype,new D)}typeof SuppressedError==="function"&&SuppressedError;var n=function(S){var b="[object "+S+"]";return function(D){return s(D)===b}},s=function(S){return Object.prototype.toString.call(S)},i=function(S){if(S instanceof Date)return S.getTime();else if(u(S))return S.map(i);else if(S&&typeof S.toJSON==="function")return S.toJSON();return S},o=function(S){return S==null?null:S},u=n("Array"),a=n("Object"),c=n("Function"),l=function(S,b){return S.hasOwnProperty(b)&&!c(S[b])},f=function(S,b){return Array.isArray(b)&&!(S in b)&&isNaN(Number(S))},h=function(S,b){var D=S[b],R=Object.prototype[b];return R===void 0||D!==R||Object.prototype.hasOwnProperty.call(S,b)?D:void 0},d=function(S){return S&&(S.constructor===Object||S.constructor===Array||S.constructor.toString()==="function Object() { [native code] }"||S.constructor.toString()==="function Array() { [native code] }")&&!h(S,"toJSON")},p=function(S,b){if(S==null&&S==b)return!0;if(S===b)return!0;if(Object.prototype.toString.call(S)!==Object.prototype.toString.call(b))return!1;if(u(S)){if(S.length!==b.length)return!1;for(var D=0,R=S.length;D<R;D++)if(!p(S[D],b[D]))return!1;return!0}else if(a(S)){if(Object.keys(S).length!==Object.keys(b).length)return!1;for(var Q in S){if(!Object.prototype.hasOwnProperty.call(S,Q))continue;if(!p(S[Q],b[Q]))return!1}return!0}return!1},m=function(S,b,D,R,Q,ce,pe){if(pe===void 0)pe=!0;var Ge=b[R];if(u(S)&&isNaN(Number(Ge))&&!l(S,Ge)){for(var Lr=0,xr=S.length;Lr<xr;Lr++)if(!m(S[Lr],b,D,R,Lr,S,pe))return!1}if(R===b.length||S==null)return D(S,Q,ce,R===0,R===b.length&&(R>0||pe));return m(S[Ge],b,D,R+1,Ge,S)},E=function(){function S(b,D,R,Q){this.params=b,this.owneryQuery=D,this.options=R,this.name=Q,this.init()}return S.prototype.init=function(){},S.prototype.reset=function(){this.done=!1,this.keep=!1},S}(),y=function(S){r(b,S);function b(D,R,Q,ce){var pe=S.call(this,D,R,Q)||this;return pe.children=ce,pe}return b.prototype.reset=function(){this.keep=!1,this.done=!1;for(var D=0,R=this.children.length;D<R;D++)this.children[D].reset()},b.prototype.childrenNext=function(D,R,Q,ce,pe){var Ge=!0,Lr=!0;for(var xr=0,ah=this.children.length;xr<ah;xr++){var Ni=this.children[xr];if(!Ni.done)Ni.next(D,R,Q,ce,pe);if(!Ni.keep)Lr=!1;if(Ni.done){if(!Ni.keep)break}else Ge=!1}this.done=Ge,this.keep=Lr},b}(E),_=function(S){r(b,S);function b(D,R,Q,ce,pe){var Ge=S.call(this,D,R,Q,ce)||this;return Ge.name=pe,Ge}return b}(y),w=function(S){r(b,S);function b(){var D=S!==null&&S.apply(this,arguments)||this;return D.propop=!0,D}return b.prototype.next=function(D,R,Q,ce,pe){this.childrenNext(D,R,Q,ce,pe)},b}(y),C=function(S){r(b,S);function b(D,R,Q,ce,pe){var Ge=S.call(this,R,Q,ce,pe)||this;return Ge.keyPath=D,Ge.propop=!0,Ge._nextNestedValue=function(Lr,xr,ah,Ni,KX){return Ge.childrenNext(Lr,xr,ah,Ni,KX),!Ge.done},Ge}return b.prototype.next=function(D,R,Q,ce,pe){m(D,this.keyPath,this._nextNestedValue,0,R,Q,pe!==!1)},b}(y),A=function(S,b){if(S instanceof Function)return S;if(S instanceof RegExp)return function(R){var Q=typeof R==="string"&&S.test(R);return S.lastIndex=0,Q};var D=i(S);return function(R){return b(D,i(R))}},M=function(S){r(b,S);function b(){var D=S!==null&&S.apply(this,arguments)||this;return D.propop=!0,D}return b.prototype.init=function(){this._test=A(this.params,this.options.compare)},b.prototype.next=function(D,R,Q){if(!Array.isArray(Q)||Q.hasOwnProperty(R)){if(this._test(D,R,Q))this.done=!0,this.keep=!0}},b}(E),O=function(S,b,D){return new M(S,b,D)},x=function(S){return function(b,D,R,Q){return S(b,D,R,Q)}},v=function(S){return x(function(b,D,R,Q){var ce=typeof i(b),pe=S(b);return new M(function(Ge){var Lr=o(Ge);return typeof i(Lr)===ce&&pe(Lr)},D,R,Q)})},P=function(S,b,D,R){var Q=R.operations[S];if(!Q)ge(S);return Q(b,D,R,S)},ge=function(S){throw Error("Unsupported operation: ".concat(S))},Me=function(S,b){for(var D in S){if(!Object.prototype.hasOwnProperty.call(S,D))continue;if(b.operations.hasOwnProperty(D)||D.charAt(0)==="$")return!0}return!1},oe=function(S,b,D,R,Q){if(Me(b,Q)){var ce=H(b,D,Q),pe=ce[0],Ge=ce[1];if(Ge.length)throw Error("Property queries must contain only operations, or exact objects.");return new C(S,b,R,Q,pe)}return new C(S,b,R,Q,[new M(b,R,Q)])},Yt=function(S,b,D){if(b===void 0)b=null;if(D===void 0)D={};var R=h(D,"compare"),Q=h(D,"operations"),ce={compare:R||p,operations:Object.assign({},Q||{})},pe=H(S,null,ce),Ge=pe[0],Lr=pe[1],xr=[];if(Ge.length)xr.push(new C([],S,b,ce,Ge));if(xr.push.apply(xr,Lr),xr.length===1)return xr[0];return new w(S,b,ce,xr)},H=function(S,b,D){var R=[],Q=[];if(!d(S))return R.push(new M(S,S,D)),[R,Q];for(var ce in S){if(!Object.prototype.hasOwnProperty.call(S,ce))continue;if(D.operations.hasOwnProperty(ce)){var pe=P(ce,S[ce],S,D);if(pe){if(!pe.propop&&b&&!D.operations[b])throw Error("Malformed query. ".concat(ce," cannot be matched against property."))}if(pe!=null)R.push(pe)}else if(ce.charAt(0)==="$")ge(ce);else Q.push(oe(ce.split("."),S[ce],ce,S,D))}return[R,Q]},Oe=function(S){return function(b,D,R){return S.reset(),S.next(b,D,R),S.keep}},ct=function(S,b){if(b===void 0)b={};return Oe(Yt(S,null,b))},ss=function(S){r(b,S);function b(){var D=S!==null&&S.apply(this,arguments)||this;return D.propop=!0,D}return b.prototype.init=function(){this._test=A(this.params,this.options.compare)},b.prototype.reset=function(){S.prototype.reset.call(this),this.keep=!0},b.prototype.next=function(D,R,Q){if(!f(R,Q)&&this._test(D))this.done=!0,this.keep=!1},b}(E),ze=function(S){r(b,S);function b(){var D=S!==null&&S.apply(this,arguments)||this;return D.propop=!0,D}return b.prototype.init=function(){if(!this.params||typeof this.params!=="object")throw Error("Malformed query. $elemMatch must by an object.");this._queryOperation=Yt(this.params,this.owneryQuery,this.options)},b.prototype.reset=function(){S.prototype.reset.call(this),this._queryOperation.reset()},b.prototype.next=function(D,R,Q){if(u(D)){for(var ce=0,pe=D.length;ce<pe;ce++){this._queryOperation.reset();var Ge=D[ce];this._queryOperation.next(Ge,ce,D,!1),this.keep=this.keep||this._queryOperation.keep}this.done=this.keep||!a(Q)}else this.done=!1,this.keep=!1},b}(E),On=function(S){r(b,S);function b(){var D=S!==null&&S.apply(this,arguments)||this;return D.propop=!0,D}return b.prototype.init=function(){this._queryOperation=Yt(this.params,this.owneryQuery,this.options)},b.prototype.reset=function(){S.prototype.reset.call(this),this._queryOperation.reset()},b.prototype.next=function(D,R,Q,ce,pe){this._queryOperation.next(D,R,Q,ce,pe),this.done=this._queryOperation.done,this.keep=!this._queryOperation.keep},b}(E),Ts=function(S){r(b,S);function b(){var D=S!==null&&S.apply(this,arguments)||this;return D.propop=!0,D}return b.prototype.init=function(){},b.prototype.next=function(D){if(u(D)&&D.length===this.params)this.done=!0,this.keep=!0},b}(E),Ms=function(S){if(S.length===0)throw Error("$and/$or/$nor must be a nonempty array")},du=function(S){r(b,S);function b(){var D=S!==null&&S.apply(this,arguments)||this;return D.propop=!1,D}return b.prototype.init=function(){var D=this;Ms(this.params),this._ops=this.params.map(function(R){return Yt(R,null,D.options)})},b.prototype.reset=function(){this.done=!1,this.keep=!1;for(var D=0,R=this._ops.length;D<R;D++)this._ops[D].reset()},b.prototype.next=function(D,R,Q,ce,pe){var Ge=!1,Lr=!1;for(var xr=0,ah=this._ops.length;xr<ah;xr++){var Ni=this._ops[xr];if(Ni.next(D,R,Q,ce,pe),Ni.keep){Ge=!0,Lr=Ni.keep;break}}this.keep=Lr,this.done=Ge},b}(E),kX=function(S){r(b,S);function b(){var D=S!==null&&S.apply(this,arguments)||this;return D.propop=!1,D}return b.prototype.next=function(D,R,Q,ce,pe){S.prototype.next.call(this,D,R,Q,ce,pe),this.keep=!this.keep},b}(du),$O=function(S){r(b,S);function b(){var D=S!==null&&S.apply(this,arguments)||this;return D.propop=!0,D}return b.prototype.init=function(){var D=this,R=Array.isArray(this.params)?this.params:[this.params];this._testers=R.map(function(Q){if(Me(Q,D.options))throw Error("cannot nest $ under ".concat(D.name.toLowerCase()));return A(Q,D.options.compare)})},b.prototype.next=function(D,R,Q){if(f(R,Q))return;var ce=!1,pe=!1;for(var Ge=0,Lr=this._testers.length;Ge<Lr;Ge++){var xr=this._testers[Ge];if(xr(D)){ce=!0,pe=!0;break}}this.keep=pe,this.done=ce},b}(E),qX=function(S){r(b,S);function b(D,R,Q,ce){var pe=S.call(this,D,R,Q,ce)||this;return pe.propop=!0,pe._in=new $O(D,R,Q,ce),pe}return b.prototype.next=function(D,R,Q,ce){if(this._in.next(D,R,Q),this._in.keep)this.keep=!1,this.done=!0},b.prototype.reset=function(){S.prototype.reset.call(this),this.keep=!0,this._in.reset()},b}(E),jX=function(S){r(b,S);function b(){var D=S!==null&&S.apply(this,arguments)||this;return D.propop=!0,D}return b.prototype.reset=function(){S.prototype.reset.call(this),this.keep=!this.params},b.prototype.next=function(D,R,Q,ce,pe){if(pe&&(Q==null?D!==void 0:Object.prototype.hasOwnProperty.call(Q,R)))this.done=!0,this.keep=Boolean(this.params)},b}(E),LX=function(S){r(b,S);function b(D,R,Q,ce){var pe=S.call(this,D,R,Q,D.map(function(Ge){return Yt(Ge,R,Q)}),ce)||this;return pe.propop=!1,Ms(D),pe}return b.prototype.next=function(D,R,Q,ce,pe){this.childrenNext(D,R,Q,ce,pe)},b}(_),UX=function(S){r(b,S);function b(D,R,Q,ce){var pe=S.call(this,D,R,Q,D.map(function(Ge){return Yt(Ge,R,Q)}),ce)||this;return pe.propop=!0,pe}return b.prototype.next=function(D,R,Q,ce,pe){this.childrenNext(D,R,Q,ce,pe)},b}(_),RO=function(S,b,D){return new M(S,b,D)},vO=function(S,b,D,R){return new ss(S,b,D,R)},kO=function(S,b,D,R){return new du(S,b,D,R)},qO=function(S,b,D,R){return new kX(S,b,D,R)},jO=function(S,b,D,R){return new ze(S,b,D,R)},LO=function(S,b,D,R){return new qX(S,b,D,R)},UO=function(S,b,D,R){return new $O(S,b,D,R)},VO=v(function(S){return function(b){return b!=null&&b<S}}),zO=v(function(S){return function(b){return b===S||b<=S}}),WO=v(function(S){return function(b){return b!=null&&b>S}}),KO=v(function(S){return function(b){return b===S||b>=S}}),HO=function(S,b,D){var R=S[0],Q=S[1];return new M(function(ce){return i(ce)%R===Q},b,D)},GO=function(S,b,D,R){return new jX(S,b,D,R)},YO=function(S,b,D){return new M(new RegExp(S,Object.prototype.hasOwnProperty.call(b,"$options")?b.$options:void 0),b,D)},QO=function(S,b,D,R){return new On(S,b,D,R)},JO={number:function(S){return typeof S==="number"},string:function(S){return typeof S==="string"},bool:function(S){return typeof S==="boolean"},array:function(S){return Array.isArray(S)},null:function(S){return S===null},timestamp:function(S){return S instanceof Date}},XO=function(S,b,D){return new M(function(R){if(typeof S==="string"){if(!Object.prototype.hasOwnProperty.call(JO,S))throw Error("Type alias does not exist");return JO[S](R)}return R!=null?R instanceof S||R.constructor===S:!1},b,D)},ZO=function(S,b,D,R){return new LX(S,b,D,R)},eS=function(S,b,D,R){return new UX(S,b,D,R)},tS=function(S,b,D){return new Ts(S,b,D,"$size")},rS=function(){return null},VX=function(){try{return Boolean(process.env.CSP_ENABLED)}catch(S){return!1}},nS=function(S,b,D){var R;if(c(S))R=S;else if(!VX())R=Function("obj","return "+S);else throw Error('In CSP mode, sift does not support strings in "$where" condition');return new M(function(Q){return R.bind(Q)(Q)},b,D)},zX=Object.freeze({__proto__:null,$Size:Ts,$all:eS,$and:ZO,$elemMatch:jO,$eq:RO,$exists:GO,$gt:WO,$gte:KO,$in:UO,$lt:VO,$lte:zO,$mod:HO,$ne:vO,$nin:LO,$nor:qO,$not:QO,$options:rS,$or:kO,$regex:YO,$size:tS,$type:XO,$where:nS}),sS=function(S,b,D){if(D===void 0)D={};return Yt(S,b,{compare:h(D,"compare"),operations:Object.assign({},zX,h(D,"operations")||{})})},WX=function(S,b){if(b===void 0)b={};var D=sS(S,null,b);return Oe(D)};e.$Size=Ts,e.$all=eS,e.$and=ZO,e.$elemMatch=jO,e.$eq=RO,e.$exists=GO,e.$gt=WO,e.$gte=KO,e.$in=UO,e.$lt=VO,e.$lte=zO,e.$mod=HO,e.$ne=vO,e.$nin=LO,e.$nor=qO,e.$not=QO,e.$options=rS,e.$or=kO,e.$regex=YO,e.$size=tS,e.$type=XO,e.$where=nS,e.EqualsOperation=M,e.createDefaultQueryOperation=sS,e.createEqualsOperation=O,e.createOperationTester=Oe,e.createQueryOperation=Yt,e.createQueryTester=ct,e.default=WX,Object.defineProperty(e,"__esModule",{value:!0})})});var nJ=g(function(VBe,aO){var rJ=tJ();aO.exports=rJ.default;Object.assign(aO.exports,rJ)});var aJ=g(function(zBe,uJ){var kSe=Wy(),qSe=pg(),jSe=XQ(),cO=gr(),LSe=a1(),USe=uO(),_g=nd(),id=gn(),sJ=By(),VSe=X6(),X1=ks(),iJ=nJ().default,Ta=we(),{populateModelSymbol:zSe}=le();uJ.exports=function(t){let r=Object.assign({},cO(t,"allOptions.options.options"),cO(t,"allOptions.options")),n=Object.assign({},t.options,r,{justOne:t.justOne,isVirtual:t.isVirtual});n.$nullIfNotFound=t.isVirtual;let s=t.populatedModel,i=[].concat(t.rawIds);t.allIds=[].concat(t.allIds),jSe(t.rawIds,t.rawDocs,t.rawOrder,n);let{docs:o,rawIds:u,options:a}=t,c=t.count&&t.isVirtual,l,f=0;function h(d){if(++f,c)return d;if(d instanceof qSe)return d.val;if(d===void 0)return d;let p=t.allIds[l];if(t.path.endsWith(".$*"))return sd(d,a,n,p);if(t.justOne===!0&&Array.isArray(d)){let m=[];for(let E of d){let y=_g.get(E);if(y==null||y===s)m.push(E)}while(d.length>m.length)Array.prototype.pop.apply(d,[]);for(let E=0;E<m.length;++E)d[E]=m[E];return sd(d[0],a,n,p)}else if(t.justOne===!1&&!Array.isArray(d))return sd([d],a,n,p);else if(t.justOne===!0&&!Array.isArray(d)&&Array.isArray(p))return sd(d,a,n,d==null?d:p[f-1]);return sd(d,a,n,p)}for(l=0;l<o.length;++l){f=0;let d=t.path.endsWith(".$*")?t.path.slice(0,-3):t.path,p=X1.get(d,o[l],sJ);if(p==null&&!USe(t.originalModel.schema,d))continue;let m;if(c)m=WSe(u[l]);else if(Array.isArray(t.match))m=Array.isArray(u[l])?u[l].filter((A)=>A==null||iJ(t.match[l])(A)):[u[l]].filter((A)=>A==null||iJ(t.match[l])(A))[0];else m=u[l];let E=t.originalModel.schema,y=id(o[l]),_=y?p instanceof Map:Ta.isPOJO(p);if(_=_&&cO(E._getSchema(d),"$isSchemaMap"),!t.isVirtual&&_){let A=p instanceof Map?Array.from(p.keys()):Object.keys(p);m=m.reduce((M,O,x)=>(M.set(A[x],O),M),new Map)}if(y&&Array.isArray(m)){for(let A of m)if(id(A))A.$__.parent=o[l]}else if(y&&id(m))m.$__.parent=o[l];if(t.isVirtual&&y){if(o[l].$populated(d,t.justOne?i[0]:i,t.allOptions),Array.isArray(m))m=m.map((A)=>A==null?void 0:A);X1.set(d,m,o[l],function(M,O,x){if(arguments.length>=3)return M[O]=x,M[O];if(M instanceof Map&&O==="$*")return[...M.values()];return M[O]},h,!1);continue}let w=d.split("."),C=o[l];for(let A=0;A<w.length-1;++A){if(Array.isArray(C)&&!Ta.isArrayIndex(w[A]))break;if(w[A]==="$*")break;if(C[w[A]]==null){let M=w.slice(0,A+1).join("."),O=E._getSchema(M);if(m==null&&O?.$isMongooseArray)break;C[w[A]]={}}if(C=C[w[A]],typeof C!=="object")break}if(y){if(t.allOptions.options[zSe]=t.allOptions.model,o[l].$populated(d,t.unpopulatedValues[l],t.allOptions.options),id(m))m.$__.wasPopulated={value:t.unpopulatedValues[l]};if(m instanceof Map&&!m.$isMongooseMap)m=new kSe(m,d,o[l],o[l].schema.path(d).$__schemaType)}if(X1.set(d,m,o[l],sJ,h,!1),y)VSe(o[l],[t.allOptions.options])}};function WSe(e){if(Array.isArray(e)){if(e.some((t)=>Array.isArray(t)||t===null))return e.map((t)=>{if(t==null)return 0;if(Array.isArray(t))return t.filter((r)=>r!=null).length;return 1});return e.filter((t)=>t!=null).length}return e==null?0:1}function sd(e,t,r,n){let s=typeof r.transform==="function",i=s?r.transform:(o)=>o;if(Array.isArray(e)){let o=[],u=e.length;for(let l=0;l<u;++l){let f=e[l],h=Array.isArray(n)?n[l]:n;if(!lO(f)&&(!r.retainNullValues||f!=null)&&!s)continue;else if(!r.retainNullValues&&f==null)continue;else if(s)f=i(lO(f)?f:null,h);if(oJ(f,t),o.push(f),t.originalLimit&&o.length>=t.originalLimit)break}let a=o.length;while(e.length>a)Array.prototype.pop.apply(e,[]);let c=0;if(Ta.isMongooseArray(e))for(c=0;c<a;++c)e.set(c,o[c],!0);else for(c=0;c<a;++c)e[c]=o[c];return e}if(lO(e)||Ta.isPOJO(e))return oJ(e,t),i(e,n);if(e instanceof Map)return e;if(r.justOne===!1)return[];return e==null?i(e,n):i(null,n)}function oJ(e,t){if(e!=null&&t.excludeId)if(typeof e.$__setValue==="function")delete e._doc._id;else delete e._id}function lO(e){if(e==null)return!1;return Array.isArray(e)||LSe(e,"$isMongooseMap")||id(e)||_g.has(e)}});var lJ=g(function(WBe,cJ){var KSe=Za();cJ.exports=function(t){if(t instanceof KSe)return Object.keys(t.errors).map((r)=>({message:t.errors[r].message,path:r.split(".").map((s)=>{let i=+s;return Number.isInteger(i)&&String(i)===s?i:s})}));return[{message:t.message}]}});var hO=g(function(KBe,dJ){var HSe=pg(),GSe=eA(),{trusted:Ag}=c1(),hJ=rg();dJ.exports=function(t,r,n,s,i){let o=YSe(r);if(n.size===1){let u=Array.from(n)[0],a=s.schema.path(u);if(u!=="_id"||!o._id)t=fJ(t,a,i),o[u]=Ag({$in:t});else if(u==="_id"&&o._id){let l=hJ(o[u])?o[u]:{$eq:o[u]};o[u]={...Ag({$in:t}),...l}}let c=GSe(u);for(let l=0;l<c.length-1;++l){let f=c[l];if(o[f]!=null&&o[f].$elemMatch!=null){o[f]={...o[f],$elemMatch:{...o[f].$elemMatch,[u.slice(f.length+1)]:Ag({$in:t})}},delete o[u];break}}}else{let u=[];if(Array.isArray(o.$or))o.$and=[{$or:o.$or},{$or:u}],delete o.$or;else o.$or=u;for(let a of n)if(a!=="_id"||!o._id){let c=s.schema.path(a);t=fJ(t,c,i),u.push({[a]:{$in:t}})}else if(a==="_id"&&o._id){let c=hJ(o[a])?o[a]:{$eq:o[a]};o[a]={...Ag({$in:t}),...c}}}return o};function fJ(e,t,r){if(e=e.filter((n)=>!(n instanceof HSe)),!r)return e;return e.filter((n)=>{try{return t.cast(n),!0}catch{return!1}})}function YSe(e){if(Array.isArray(e)){if(e.length>1)return{$or:[].concat(e.map((t)=>Object.assign({},t)))};return Object.assign({},e[0])}return Object.assign({},e)}});var mJ=g(function(HBe,pJ){pJ.exports=function(t,r,n){if(t.length===0)return n();let s=t.length,i=null;for(let o of t)r(o,function(u){if(i!=null)return;if(u!=null)return i=u,n(i);if(--s<=0)return n()})}});var EJ=g(function(GBe,gJ){/*!
967
+ * ignore
968
+ */var yJ=C1(),QSe=gr(),JSe=Ei(),XSe=gn(),wg=nd(),Pi=ks(),ZSe=le().populateModelSymbol;gJ.exports=function e(t,r,n,s,i){let o=r.path(s),u=n;if(o)return o;let a=r.discriminatorMapping?.key;if(a&&t!=null){if(n?.[a]!=null)r=JSe(t.discriminators,n[a])?.schema||r;else if(t.discriminators!=null)return Object.keys(t.discriminators).reduce((l,f)=>{let h=t.discriminators[f];return l.concat(e(h,h.schema,null,s))},[])}function c(l,f,h,d){let p=l.length+1,m,E;while(p--){if(E=l.slice(0,p).join("."),m=f.path(E),m==null)continue;if(m.embeddedSchemaType||m.schema){if(m.embeddedSchemaType instanceof yJ)return m.embeddedSchemaType;let w=null;if(m.schema?.discriminators!=null){let C=m.schema.discriminators,A=E+"."+m.schema.options.discriminatorKey,M=h?Pi.get(A,h)||[]:[];w=Object.keys(C).reduce(function(O,x){let v=C[x].discriminatorMapping.value;if(n==null||M.indexOf(x)!==-1||M.indexOf(v)!==-1)O.push(C[x]);return O},[])}if(p!==l.length&&m.schema){let C;if(l[p]==="$"){if(p+1===l.length)return m;if(C=c(l.slice(p+1),f,h?Pi.get(E,h):null,d.concat(l.slice(0,p))),C)C.$parentSchemaDocArray=C.$parentSchemaDocArray||(m.schema.$isSingleNested?null:m);return C}if(w!=null&&w.length>0){C=[];for(let A of w){let M=c(l.slice(p),A,h?Pi.get(E,h):null,d.concat(l.slice(0,p)));if(M!=null){if(M.$parentSchemaDocArray=M.$parentSchemaDocArray||(m.schema.$isSingleNested?null:m),M.$parentSchemaDocArray)C.$parentSchemaDocArray=M.$parentSchemaDocArray;C.push(M)}}return C}else{if(C=c(l.slice(p),m.schema,h?Pi.get(E,h):null,d.concat(l.slice(0,p))),C)C.$parentSchemaDocArray=C.$parentSchemaDocArray||(m.schema.$isSingleNested?null:m);return C}}else if(p!==l.length&&m.$isMongooseArray&&m.embeddedSchemaType.$isMongooseArray){let C=m;while(C.$isMongooseArray&&!C.$isMongooseDocumentArray)C=C.embeddedSchemaType;let A=c(l.slice(p),C.schema,null,d.concat(l.slice(0,p)));if(A!=null)return A;if(C.schema.discriminators){let M=[];for(let O of Object.keys(C.schema.discriminators)){let x=C.schema.discriminators[O]||C.schema,v=c(l.slice(p),x,null,d.concat(l.slice(0,p)));if(v!=null)M.push(v)}if(M.length>0)return M}}}else if(m.$isSchemaMap&&m.$__schemaType instanceof yJ)return m.$__schemaType;let y=d.concat([E]).join(".");if(XSe(u)&&u.$populated(y,!0)&&p<l.length){let w=u.$populated(y,!0).options[ZSe];if(w!=null)return c(l.slice(p),w.schema,h?Pi.get(E,h):null,d.concat(l.slice(0,p)))}let _=QSe(u,E);if(_!=null){let C=(Array.isArray(_)&&_.length>0?wg.get(_[0]):wg.get(_))?.schema??null;if(C!=null){let A=c(l.slice(p),C,h?Pi.get(E,h):null,d.concat(l.slice(0,p)));if(A!=null)return A.$parentSchemaDocArray=A.$parentSchemaDocArray||(C.$isSingleNested?null:C),A}}return m}}i=i||s.split(".");for(let l=0;l<i.length;++l)if(i[l]==="$")i[l]="0";return c(i,r,n,[])}});var DJ=g(function(YBe,bJ){var gO=Rs(),eCe=pg(),tCe=Zt(),Qi=gr(),rCe=qs(),nCe=Ei(),sCe=Rn(),wJ=Do(),_J=EJ(),iCe=uO(),od=gn(),EO=By(),$o=ks(),ud=IA(),_t=we(),pO=le().modelSymbol,fO=le().populateModelSymbol,mO=zi().schemaMixedSymbol,oCe=j6(),uCe=new RegExp("\\.\\d+(?=\\.|$)"),aCe=new RegExp("\\.\\d+(?=\\.|$)","g");bJ.exports=function(t,r,n){let s,i=r.length,o=[],u=n.model?.modelName||n.model,a,c,l,f,h={},d=t.schema;if(n._localModel!=null&&n._localModel.schema.nested[n.path])return[];let p=iCe(t.schema,n.path);if((p==null?null:p.virtual)!=null)return lCe(t,r,n,p);let E=d.paths[n.path]?.splitPath()??n.path.split("."),y=_J(t,d,null,n.path,E);if(y=Array.isArray(y)?y:[y].filter((C)=>C!=null),!(n.strictPopulate===!1||n.options?.strictPopulate===!1)&&y.length===0&&n._localModel!=null)return new oCe(n._fullPath||n.path);for(let C=0;C<i;C++){s=r[C];let A=null;if(od(s)&&s.populated(n.path)){if((n.forceRepopulate??s.constructor.base.options.forceRepopulate)===!1)continue}let M=od(s)?s.$__schema:d;if(a=_J(t,M,s,n.path,E),a!=null&&a.$isMongooseDocumentArray&&a.options.ref==null&&a.options.refPath==null)continue;if(a?.$parentSchemaDocArray&&Qi(n,"options.sort")!=null)return new gO("Cannot populate with `sort` on path "+n.path+" because it is a subproperty of a document array");l=null;let x=!1,v=null,P=null,ge=null;if(a?.instance==="Embedded"){if(a.options.ref){let ze={localField:n.path+"._id",foreignField:"_id",justOne:!0},On=w(s,a,u,t),Ts=$o.get(n.path,s),Ms=$o.get("_id",Ts);yO(t,o,h,On.modelNames,n,ze,Ms,s,P,Ts)}continue}if(Array.isArray(a)){let ze=a;for(let On of ze){let Ts,Ms;try{Ms=w(s,On,u,t),Ts=Ms.modelNames,x=x||Ms.isRefPath,v=v||Ms.refPath,A=Ms.justOne}catch(du){return du}if(x&&!Ms.isRefPath)continue;if(!Ts)continue;l=l||[],f=f||new Set;for(let du of Ts)if(f.has(du)===!1)f.add(du),l.push(du)}}else{try{let ze=w(s,a,u,t);if(l=ze.modelNames,x=ze.isRefPath,v=v||ze.refPath,A=ze.justOne,P=Qi(a,"options.populate",null),x)ge=l,l=Array.from(new Set(l))}catch(ze){return ze}if(!l)continue}let Me={},oe=n.path,Yt="_id";if("justOne"in n&&n.justOne!==void 0)A=n.justOne;else if(a&&!a[mO]){if(n.path.endsWith("."+a.path)||n.path===a.path)A=Array.isArray(a)?a.every((ze)=>!ze.$isMongooseArray):!a.$isMongooseArray}if(!l)continue;Me.isVirtual=!1,Me.justOne=A,Me.localField=oe,Me.foreignField=Yt;let H=SJ(s,oe,t,n,null,a),Oe=String(_t.getValue(Yt,s));n._docs[Oe]=Array.isArray(H)?H.slice():H;let ct=Qi(n,"match",null),ss=typeof ct==="function";if(ss)ct=ct.call(s,s);if(AO(ct),Me.match=ct,Me.hasMatchFunction=ss,Me.isRefPath=x,Me.modelNamesInOrder=ge,x){let ze=typeof v==="string"?v.replace(aCe,""):v;l=hCe(s,d,Me,n,ze,H)||l}try{yO(t,o,h,l,n,Me,H,s,P)}catch(ze){return ze}}return o;function w(C,A,M,O){let x,v=!1,P=null,ge=A;if(A?.instance==="Array")A=A.embeddedSchemaType;if(A?.$isSchemaMap)A=A.$__schemaType;let Me=A?.options?.ref;if(c=A?.options?.refPath,A!=null&&A[mO]&&!Me&&!c&&!M)return{modelNames:null};if(M)x=[M];else if(c!=null){if(typeof c==="function"){let oe=AJ(c,C,A,n.path,d,n._queryProjection);x=oe.modelNames,c=oe.refPath}else x=ud(c,C,n.path,d,n._queryProjection);v=!0}else{let oe,Yt,H,Oe,ct=O,ss=O.schema.options.discriminatorKey;if(!A&&ss&&(Oe=_t.getValue(ss,C))){let ze=nCe(O.discriminators,Oe)||O;if(ze!=null)ct=ze;else try{ct=_O(O.db,Oe)}catch(On){return On}if(H=ct.schema._getSchema(n.path),H?.embeddedSchemaType)H=H.embeddedSchemaType}else H=A;if(ge&&ge.path.endsWith(".$*"))P=!ge.$isMongooseArray&&!ge._arrayPath;else if(H!=null)P=!H.$isMongooseArray&&!H._arrayPath;if((oe=Qi(H,"options.ref"))!=null)if(H!=null&&typeof oe==="function"&&n.path.endsWith("."+H.path)){x=new Set;let ze=n.path.slice(0,n.path.length-H.path.length-1),On=$o.get(ze,C,EO),Ts=Array.isArray(On)?_t.array.flatten(On):On?[On]:[];for(let Ms of Ts)x.add(dO(oe,Ms));if(Ts.length===0)x=[dO(oe,C)];else x=Array.from(x)}else oe=dO(oe,C),x=[oe];else if((Yt=Qi(H,"options.refPath"))!=null)if(v=!0,typeof Yt==="function"){let ze=AJ(Yt,C,H,n.path,d,n._queryProjection);x=ze.modelNames,Yt=ze.refPath}else x=ud(Yt,C,n.path,d,n._queryProjection)}if(!x)if(n._localModel==null)x=[O.modelName];else return{modelNames:x,justOne:P,isRefPath:v,refPath:c};if(!Array.isArray(x))x=[x];return{modelNames:x,justOne:P,isRefPath:v,refPath:c}}};function AJ(e,t,r,n,s,i){let o=[],u=null,a=r?.path;if(a!=null&&n.length>a.length+1&&n.charAt(n.length-a.length-1)==="."&&n.slice(n.length-a.length)===a){let d=function(p,m,E){if(p==null)return;if(E>=f.length){h=!0;let A=m+"."+a,M=e.call(p,p,A);u=u||M,o.push(...cCe(M,t,n,A,s,i));return}let y=f[E],_=p?._doc??p;if(y==="$*"){if(_ instanceof Map){for(let[A,M]of _.entries())if(M!=null){let O=m.length===0?A:m+"."+A;d(M,O,E+1)}return}if(_!=null&&typeof _==="object")for(let A of Object.keys(_)){let M=_[A];if(M!=null){let O=m.length===0?A:m+"."+A;d(M,O,E+1)}}return}let w=_[y],C=m.length===0?y:m+"."+y;if(Array.isArray(w)){for(let A=0;A<w.length;++A)if(w[A]!=null)d(w[A],C+"."+A,E+1)}else if(w!=null)d(w,C,E+1)},l=n.slice(0,n.length-a.length-1),f=l.indexOf(".")===-1?[l]:l.split("."),h=!1;if(d(t,"",0),h)return{modelNames:o,refPath:u}}let c=e.call(t,t,n);return u=u||c,o.push(...ud(c,t,n,s,i)),{modelNames:o,refPath:u}}function cCe(e,t,r,n,s,i){let o=typeof e==="string"&&uCe.test(e)?r:n;try{return ud(e,t,o,s,i)}catch(u){if(o===n&&typeof u?.message==="string"&&u.message.startsWith("Could not normalize ref path"))return ud(e,t,r,s,i);throw u}}/*!
969
+ * ignore
970
+ */function lCe(e,t,r,n){let s=[],i={},o=n.virtual;for(let u of t){let a=null,c={},l,f=n.nestedSchemaPath?n.nestedSchemaPath+".":"";if(typeof r.localField==="string")l=r.localField;else if(typeof o.options.localField==="function")l=f+o.options.localField.call(u,u);else if(Array.isArray(o.options.localField))l=o.options.localField.map((_)=>f+_);else l=f+o.options.localField;if(c.count=o.options.count,o.options.skip!=null&&!Object.hasOwn(r,"skip"))r.skip=o.options.skip;if(o.options.limit!=null&&!Object.hasOwn(r,"limit"))r.limit=o.options.limit;if(o.options.perDocumentLimit!=null&&!Object.hasOwn(r,"perDocumentLimit"))r.perDocumentLimit=o.options.perDocumentLimit;let h=o.options.foreignField;if(!l||!h)return new gO(`Cannot populate virtual \`${r.path}\` on model \`${e.modelName}\`, because options \`localField\` and / or \`foreignField\` are missing`);if(typeof l==="function")l=l.call(u,u);if(typeof h==="function")h=h.call(u,u);c.isRefPath=!1;let d=null;if("justOne"in r&&r.justOne!==void 0)d=r.justOne;if(n.nestedSchemaPath&&typeof o.options.ref==="function"){let _=_t.getValue(n.nestedSchemaPath,u);a=Array.isArray(_)?_.flatMap((w)=>o._getModelNamesForPopulate(w)):o._getModelNamesForPopulate(_)}else a=o._getModelNamesForPopulate(u);if(o.options.refPath)d=!!o.options.justOne,c.isRefPath=!0;else if(o.options.ref)d=!!o.options.justOne;c.isVirtual=!0,c.virtual=o,c.justOne=d;let p=Qi(c,"virtual.options.match",null)||Qi(c,"virtual.options.options.match",null),m=Qi(r,"match",null)||p,E=typeof m==="function";if(E)m=m.call(u,u,c.virtual);if(Array.isArray(l)&&Array.isArray(h)&&l.length===h.length){m=Object.assign({},m);for(let _=1;_<l.length;++_)m[h[_]]=CJ($o.get(l[_],u,EO),e.schema),E=!0;l=l[0],h=h[0]}c.localField=l,c.foreignField=h,c.match=m,c.hasMatchFunction=E,AO(m);let y=SJ(u,l,e,r,o);try{yO(e,s,i,a,r,c,y,u)}catch(_){return _}}return s}/*!
971
+ * ignore
972
+ */function yO(e,t,r,n,s,i,o,u,a,c){let l=s.connection??e.db;if(c=c===void 0?o:c,Array.isArray(c))c=_t.cloneArrays(c);if(n==null)return;let f=_t.array.flatten(n),h=f.length;while(h--){let d=f[h];if(d==null)continue;let p;if(s.model&&s.model[pO])p=s.model;else if(d[pO])p=d,d=p.modelName;else try{p=_O(l,d)}catch(y){if(o!==void 0)throw y;p=null}let m=o,E=i.modelNamesInOrder||n;if(i.isRefPath&&Array.isArray(o)&&o.length===E.length)m=OJ(o,E,d);if(!wJ(r,d)){let y={model:p};if(i.isVirtual&&Qi(i.virtual,"options.options"))y.options=tCe(i.virtual.options.options);else if(a!=null)y.options=Object.assign({},a);_t.merge(y,s),s[fO]=p,y[fO]=p,r[d]={model:p,options:y,match:i.hasMatchFunction?[i.match]:i.match,docs:[u],ids:[m],allIds:[o],unpopulatedValues:[c],localField:new Set([i.localField]),foreignField:new Set([i.foreignField]),justOne:i.justOne,isVirtual:i.isVirtual,virtual:i.virtual,count:i.count,isRefPath:!!i.isRefPath,[fO]:p},t.push(r[d])}else if(r[d].localField.add(i.localField),r[d].foreignField.add(i.foreignField),r[d].docs.push(u),r[d].ids.push(m),r[d].allIds.push(o),r[d].unpopulatedValues.push(c),r[d].isRefPath=r[d].isRefPath||!!i.isRefPath,i.hasMatchFunction)r[d].match.push(i.match)}}function _O(e,t){if(wJ(e.models,t)==null&&e._parent!=null)return _O(e._parent,t);return e.model(t)}function OJ(e,t,r){if(!Array.isArray(t))return t===r?Array.isArray(e)?_t.array.flatten(e):[e]:[];if(Array.isArray(e)&&Array.isArray(t))return e.flatMap((n,s)=>OJ(n,t[s],r));return[]}/*!
973
+ * ignore
974
+ */function dO(e,t){if(typeof e==="function"&&!e[pO])return e.call(t,t);return e}/*!
975
+ * ignore
976
+ */function SJ(e,t,r,n,s,i){let o=r.schema._getPathType(t),u=o==="real"?r.schema.path(t):o.schema,a=u?.getters||[];t=u?.instance==="Embedded"?t+"._id":t;let c=Qi(n,"options",{}),l="getters"in c?c.getters:Qi(s,"options.getters",!1);if(a.length!==0&&l){let f=od(e)?e:r.hydrate(e),h=_t.getValue(t,e);if(Array.isArray(h)){let d=_t.getValue(t.split(".").slice(0,-1),f);return h.map((p,m)=>u.applyGetters(p,d[m]))}else return u.applyGetters(h,f)}else return CJ($o.get(t,e,EO),i)}function CJ(e,t){if(od(e))return e._doc._id;if(e?._id!=null&&!t?.$isSchemaMap)return e._id;if(Array.isArray(e)){let r=e.__array??e;for(let n=0;n<r.length;++n)if(od(r[n]))r[n]=r[n]._doc._id;if(_t.isMongooseArray(e)&&e.$schema())return e.$schema()._castForPopulate(e,e.$parent());return[].concat(e)}if(sCe(e)==="Object"&&t?.[mO]==null){let r=[];for(let n of Object.keys(e))r.push(e[n]);return r}if(e instanceof Map)return Array.from(e.values());return e}/*!
977
+ * ignore
978
+ */function hCe(e,t,r,n,s,i){if(!r.isRefPath||s==null)return;let o=s.split("."),u="",a=void 0;for(let c=0;c<o.length;++c){let l=o[c];u=u+(u.length===0?"":".")+l;let f=t.path(u);if(f!=null&&f.$isMongooseDocumentArray&&f.Constructor.discriminators!=null&&_t.hasOwnKeys(f.Constructor.discriminators)){let h=_t.getValue(u,e),d=n.path.substring(u.length+1),p=f.Constructor.schema.options.discriminatorKey;a=[];for(let m of h){let E=_t.getValue(p,m),_=rCe(f.Constructor.discriminators,E)?.schema;if(_==null)continue;let w=_.path(d);if(w==null||w.options.refPath==null){let A=_t.getValue(r.localField.substring(u.length+1),m);i.forEach((M,O)=>{if(M===A)i[O]=eCe(M)});continue}let C=_t.getValue(o.slice(c+1).join("."),m);a.push(C)}}}return a}function AO(e){if(e==null)return;if(typeof e!=="object")return;for(let t of Object.keys(e)){if(t==="$where")throw new gO("Cannot use $where filter with populate() match");if(e[t]!=null&&typeof e[t]==="object")AO(e[t])}}});var MJ=g(function(QBe,TJ){var fCe=gr();TJ.exports=function(t){if(Array.isArray(t)){let n=Object.keys(t[0]);return n.length===1&&n[0]==="_id"&&t[0]._id!=="hashed"}if(typeof t!=="object")return!1;let r=fCe(t,"key",{});return Object.keys(r).length===1&&Object.hasOwn(r,"_id")}});var BJ=g(function(JBe,FJ){var xJ=gr(),Og=we(),PJ=Object.freeze({locale:"simple"});FJ.exports=function(t,r,n){if(n.textIndexVersion!=null){delete n.key._fts,delete n.key._ftsx;let u={...n.weights,...n.key};if(Object.keys(u).length!==Object.keys(t).length)return!1;for(let a of Object.keys(u)){if(!(a in t))return!1;let c=u[a];if(c!==xJ(r,"weights."+a)&&!(c===1&&xJ(r,"weights."+a)==null))return!1}if(r.default_language!==n.default_language)return n.default_language==="english"&&r.default_language==null;return!0}let s=["unique","partialFilterExpression","sparse","expireAfterSeconds","collation"];for(let u of s){if(!(u in r)&&!(u in n))continue;if(u==="collation"){let a=r.collation??PJ,c=n.collation??PJ;for(let l of Object.keys(a))if(a[l]!==c[l])return!1}else if(!Og.deepEqual(r[u],n[u]))return!1}let i=Object.keys(t),o=Object.keys(n.key);if(i.length!==o.length)return!1;for(let u=0;u<i.length;++u){if(i[u]!==o[u])return!1;if(!Og.deepEqual(t[i[u]],n.key[o[u]]))return!1}return!0}});var IJ=g(function(XBe,NJ){NJ.exports=function(t,r){if(r.timeseries==null)return!1;let{timeField:n,metaField:s}=r.timeseries;if(typeof n!=="string"||typeof s!=="string")return!1;return Object.keys(t.key).length===2&&t.key[n]===1&&t.key[s]===1}});var kJ=g(function(ZBe,vJ){var dCe=rg();function pCe(e,t){return RJ({baseModelName:e.baseModelName,discriminatorMapping:e.schema.discriminatorMapping,indexes:t,indexesType:"schema"})}function mCe(e,t){return RJ({baseModelName:e.baseModelName,discriminatorMapping:e.schema.discriminatorMapping,indexes:t,indexesType:"db"})}vJ.exports={getRelatedSchemaIndexes:pCe,getRelatedDBIndexes:mCe};function RJ({baseModelName:e,discriminatorMapping:t,indexes:r,indexesType:n}){let s=t?.key,i=t?.value;if(!s)return r;if(Boolean(e))return r.filter((u)=>{let a=$J(u,n);return a&&a[s]===i});return r.filter((u)=>{let a=$J(u,n);return!a||!a[s]||dCe(a[s])&&!("$eq"in a[s])})}function $J(e,t){if(t==="schema")return e[1]?.partialFilterExpression;return e.partialFilterExpression}});var jJ=g(function(eNe,qJ){qJ.exports=yCe;/*!
979
+ * Run `fn` over every entry of `params` with at most `limit` calls in flight at
980
+ * a time, resolving to the results in input order. Currently only used by
981
+ * `Model.insertMany()` to bound how many documents validate concurrently.
982
+ */async function yCe(e,t,r){if(!(r>0))throw Error("Limit must be positive");let n=e.length;if(n===0)return[];let s=Array(n);if(r>=n){for(let l=0;l<n;++l)try{s[l]=t(e[l],l)}catch(f){s[l]=Promise.reject(f),s.length=l+1;break}return Promise.all(s)}let i=0,o=!1,u=null;function a(){if(i>=n||o)return;let l=i++,f;try{f=Promise.resolve(t(e[l],l))}catch(h){if(!o)o=!0,u=h;return}return f.then((h)=>(s[l]=h,a()),(h)=>{if(!o)o=!0,u=h})}let c=[];for(let l=0;l<r;++l)c.push(a());if(await Promise.all(c),o)throw u;return s}});var UJ=g(function(tNe,LJ){LJ.exports=function e(t,r,n){if(r==null)return;for(let s=0;s<r.length;++s)if(Array.isArray(r[s]))e(t,r[s],n+"."+s);else t.push(n+"."+s)}});var KJ=g(function(rNe,WJ){var VJ=gr(),gCe=gn(),Sg=ks(),zJ=tg();/*!
983
+ * ignore
984
+ */WJ.exports=function(t,r,n){let s=zJ(VJ(r,"select",null),!0)||zJ(VJ(r,"options.select",null),!0);if(s==null)return;for(let i of t){if(!Object.hasOwn(s,"-"+i))continue;for(let o of n)if(gCe(o))Sg.unset(i,o._doc);else Sg.unset(i,o)}}});var GJ=g(function(nNe,HJ){var ECe=hO(),_Ce=gr(),Z1=we();HJ.exports=wO;/*!
985
+ * If a single populate query would have more than this many elements in its `$in` filter,
986
+ * Mongoose splits the populate into a separate query per document to avoid going over
987
+ * MongoDB's 16 MB BSON size limit on queries. Overwritable for testing purposes. See gh-5890.
988
+ */wO.maxInFilterLength=50000;/*!
989
+ * Split a populate models-map entry into a separate query per document if either:
990
+ *
991
+ * 1. The `perDocumentLimit` option is set, so each document needs its own query with its
992
+ * own `limit` (gh-7318), or
993
+ * 2. A single populate query for `mod` would have too many elements in its `$in` filter
994
+ * (gh-5890). With multiple foreign fields, `createPopulateQueryFilter()` repeats the ids
995
+ * under `$or` once per foreign field, so the threshold counts one copy of `ids` per
996
+ * foreign field.
997
+ *
998
+ * Returns a list of `[mod, match, select, assignmentOpts]` params, one per document, for
999
+ * `_execPopulateQuery()`. Returns `null` if the populate query doesn't need to be split.
1000
+ * A `null` `match` means the document has no ids to query: `_execPopulateQuery()` skips
1001
+ * executing a query, and `_assign()` just sets the document's populated path to the
1002
+ * default value.
1003
+ *
1004
+ * Splitting on document boundaries means each document's populated value is the result of
1005
+ * exactly one query, so split entries can typically be assigned from only their own query's
1006
+ * results (`_assignFromOwnResults`) rather than scanning every populate query's results.
1007
+ * refPath is the exception: a single document's array can contain ids for multiple models,
1008
+ * so assigning refPath populate results relies on every query's results being available for
1009
+ * every document. refPath entries are therefore only split when `perDocumentLimit` requires
1010
+ * it, not to keep the `$in` filter small. A single document whose ids alone overflow the
1011
+ * BSON size limit cannot be split.
1012
+ */function wO(e,t,r,n){if(e.docs.length<=1)return null;let s=e.options.perDocumentLimit==null?_Ce(e.options,"options.perDocumentLimit",null):e.options.perDocumentLimit,i=t.length*e.foreignField.size;if(s==null&&(i<=wO.maxInFilterLength||e.isRefPath))return null;return e.docs.map((o,u)=>{let a={...e,docs:[o],ids:[e.ids[u]],allIds:[e.allIds[u]],unpopulatedValues:[e.unpopulatedValues[u]],match:Array.isArray(e.match)?[e.match[u]]:e.match,_assignFromOwnResults:!e.isRefPath},c=Z1.array.flatten(a.ids,ACe);c=Z1.array.unique(c);let l=c.length===0||c.every(Z1.isNullOrUndefined)?null:ECe(c,a.match,a.foreignField,a.model,a.options.skipInvalidIds);return[a,l,r,n]})}/*!
1013
+ * ignore
1014
+ */function ACe(e){return e!==void 0}});var iO=g(function(fX,dX){/*!
1015
+ * Module dependencies.
1016
+ */var wCe=eO(),OCe=d6(),Fi=bo(),{createTracedChannel:TO}=K1(),{trace:SCe}=TO("mongoose:model:save"),{trace:CCe}=TO("mongoose:model:insertMany"),{trace:bCe}=TO("mongoose:model:bulkWrite"),DCe=W0(),CO=L("events").EventEmitter,Ro=Ja(),bg=X4(),_e=Rs(),tX=ty(),TCe=P6(),yc=og(),MCe=pQ(),bO=ic(),Cg=Za(),rX=D6(),xCe=M6(),PCe=ny(),FCe=G6(),BCe=yQ(),NCe=nO(),ICe=AQ(),nX=SQ(),$Ce=DQ(),RCe=Fw(),sX=PQ(),vCe=BQ(),iX=IQ(),kCe=LQ(),oX=Bw(),qCe=KQ(),jCe=aJ(),LCe=Ew(),Ma=Zt(),UCe=lJ(),VCe=hO(),zCe=q2(),OO=rw(),uX=ay(),WCe=g2(),KCe=mJ(),cd=gr(),HCe=Do(),GCe=Rn(),ld=gn(),eh=qs(),th=Ei(),YCe=DJ(),YJ=Du(),MO=Ui().internalToObjectOptions,xO=MJ(),aX=BJ(),QCe=qA(),JCe=IJ(),{getRelatedDBIndexes:XCe,getRelatedSchemaIndexes:ZCe}=kJ(),PO=RA(),ebe=ly(),cX=nd(),tbe=jJ(),rbe=tg(),nbe=Xw(),lX=UJ(),sbe=KJ(),ibe=uw(),obe=tA(),ube=GJ(),{buildMiddlewareFilter:vo}=Jo(),Dg=L("util"),ue=we(),abe=Z6(),cbe=N6(),lbe=ey(),gc=_w(),Ec=Symbol("mongoose#Model#collection"),_c=Symbol("mongoose#Model#db"),{arrayAtomicsBackupSymbol:SO,arrayAtomicsSymbol:hbe,modelSymbol:hX}=le(),ad=Symbol("mongoose#Model#subclassed"),{VERSION_INC:Tg,VERSION_WHERE:QJ,VERSION_ALL:fbe}=Fi,dbe=Object.assign({},MO,{bson:!0});function z(e,t,r){if(t instanceof bO)throw TypeError("2nd argument to `Model` constructor must be a POJO or string, **not** a schema. Make sure you're calling `mongoose.model()`, not `mongoose.Model()`.");if(typeof e==="string")throw TypeError("First argument to `Model` constructor must be an object, **not** a string. Make sure you're calling `mongoose.model()`, not `mongoose.Model()`.");Fi.call(this,e,t,r)}Object.setPrototypeOf(z.prototype,Fi.prototype);z.prototype.$isMongooseModelPrototype=!0;z.prototype.db;z.useConnection=function(t){if(typeof t?.model!=="function"||typeof t.collection!=="function"||typeof t.base?.version!=="string")throw new _e("`useConnection()` requires a Mongoose connection.");if(this.db?.base?.version&&this.db?.base?.version!==t.base?.version)throw new _e(`The connection passed to \`useConnection()\` has a different version of Mongoose (${t.base?.version}) than the model you are using (${this.db?.base?.version}).`);if(this.db)delete this.db.models[this.modelName],delete this.prototype.db,delete this.prototype[_c],delete this.prototype.collection,delete this.prototype.$collection,delete this.prototype[Ec];this.db=t;let r=t.collection(this.collection.collectionName,t.options);return this.prototype.collection=r,this.prototype.$collection=r,this.prototype[Ec]=r,this.prototype.db=t,this.prototype[_c]=t,this.collection=r,this.$__collection=r,t.models[this.modelName]=this,this};z.prototype.collection;z.prototype.$__collection;z.prototype.modelName;z.prototype.$where;z.prototype.baseModelName;z.events;z._middleware;/*!
1017
+ * ignore
1018
+ */function DO(e,t){if(e.$where==null)return;for(let r of Object.keys(e.$where))t[r]=e.$where[r]}/*!
1019
+ * ignore
1020
+ */function pbe(e,t){let r={};if(oX(e.$__schema,t),typeof t.writeConcern<"u"){if(r.writeConcern={},"w"in t.writeConcern)r.writeConcern.w=t.writeConcern.w;if("j"in t.writeConcern)r.writeConcern.j=t.writeConcern.j;if("wtimeout"in t.writeConcern)r.writeConcern.wtimeout=t.writeConcern.wtimeout}else{if("w"in t)r.w=t.w;if("j"in t)r.j=t.j;if("wtimeout"in t)r.wtimeout=t.wtimeout}if("checkKeys"in t)r.checkKeys=t.checkKeys;let n=e.$session(),s=e[_c].base.transactionAsyncLocalStorage?.getStore();if(n!=null)r.session=n;else if(!Object.hasOwn(t,"session")&&s?.session!=null)r.session=s.session;return r}/*!
1021
+ * ignore
1022
+ */z.prototype.$__save=async function(t){try{if(t&&typeof t==="object"&&"validateBeforeSave"in t?!!t.validateBeforeSave:this.$__schema.options.validateBeforeSave){let c=t!=null&&typeof t==="object"&&Object.hasOwn(t,"validateModifiedOnly")?{validateModifiedOnly:t.validateModifiedOnly}:null;await this.$validate(c),this.$op="save"}await this._execDocumentPreHooks("save",t,[t])}catch(o){await this._execDocumentPostHooks("save",t,o);return}let r=null,n=null;try{let o=pbe(this,t);if(this.$isNew){let u=this.$__hasOnlyPrimitiveValues(),a=u?this.$__toObjectShallow():this.toObject(dbe);if((a||{})._id===void 0)throw new _e("document must have an _id before saving");this.$__version(!0,a),this.$__reset(),rh(this,!1,u),this.$__.inserting=!0,r=await this[Ec].insertOne(a,o).catch((c)=>{throw rh(this,!0,u),c})}else{this.$__.inserting=!1;let u=Array.isArray(t.pathsToSave)?t.pathsToSave:null,a=u!=null?new Set(u):null,c=this.$__delta(u,a),l=u!=null?c!=null?c[2]:this.$__dirty():null,f=u!=null?Object.keys(this.$__.activePaths.getStatePaths("default")).filter((h)=>!FCe(h,a,u)):null;if(c){n=this.$__where(c[0]),DO(this,n);let h=c[1];if(this.$__schema.options.minimize)for(let d of Object.values(h)){if(d==null)continue;for(let p of Object.keys(d)){if(d[p]==null||typeof d[p]!=="object")continue;if(!ue.isPOJO(d[p]))continue;if(abe(d[p]),ue.hasOwnKeys(d[p])===!1)delete d[p],h.$unset=h.$unset||{},h.$unset[p]=1}}this.$__.modifiedPaths=this.modifiedPaths(),this.$__reset(),mbe(this,l,f),rh(this,!1),r=await this[Ec].updateOne(n,h,o).catch((d)=>{throw this.$__undoReset(),d})}else{if(n=this.$__where(),DO(this,n),this.$__.version)this.$__version(n,c);RCe(this.$__schema,o),r=await this.constructor.collection.findOne(n,{...o,projection:{_id:1}}).then((h)=>({matchedCount:!h?0:1}))}}}catch(o){let u=this.$__schema._transformDuplicateKeyError(o);await this._execDocumentPostHooks("save",t,u);return}let s=0;if((t!=null?t.writeConcern!=null?t.writeConcern.w:t.w:0)!==0){if(r!=null)if(Array.isArray(r))s=r.length;else if(r.matchedCount!=null)s=r.matchedCount;else s=r;if(this.$__.version&&!this.$__.inserting){let u=Tg===(Tg&this.$__.version);this.$__.version=void 0;let a=this.$__schema.options.versionKey,c=this.$__getValue(a)||0;if(s<=0){this.$__undoReset();let l=this.$__.$versionError||new rX(this,c,this.$__.modifiedPaths);await this._execDocumentPostHooks("save",t,l);return}if(u)this.$__setValue(a,c+1)}if(r!=null&&s<=0){this.$__undoReset();let u=new DCe(n,this.constructor.modelName,s,r);await this._execDocumentPostHooks("save",t,u);return}}this.$__.saving=void 0,this.$__.savedState={},this.$emit("save",this,s),this.constructor.emit("save",this,s),await this._execDocumentPostHooks("save",t)};/*!
1023
+ * Restores $__.activePaths state and any atomics for paths that failed
1024
+ * to save.
1025
+ *
1026
+ * @param {Document} doc
1027
+ * @param {object[]} unsavedDirty
1028
+ * @param {string[]} unsavedDefaultPaths
1029
+ */function mbe(e,t,r){if(t==null)return;for(let n of t)if(e.$__.activePaths.modify(n.path),n.value?.[SO])n.value[hbe]=n.value[SO],n.value[SO]=null;for(let n of r)e.$__.activePaths.default(n)}/*!
1030
+ * ignore
1031
+ */function ybe(e,t,r){let n=e.$__schema.options.versionKey;if(!n)return null;let s=e.$__getValue(n)||0;return new rX(e,s,t.concat(r))}z.prototype.save=async function(t){if(typeof t==="function"||typeof arguments[1]==="function")throw new _e("Model.prototype.save() no longer accepts a callback");let r;if(this.$op="save",this.$__.saving)r=new xCe(this);else this.$__.saving=!0;if(t=new MCe(t),Object.hasOwn(t,"session"))this.$session(t.session);if(this.$__.timestamps!=null)t.timestamps=this.$__.timestamps;if(!this.$isNew)this.$__.$versionError=ybe(this,this.modifiedPaths(),Object.keys(this.$__.activePaths.getStatePaths("default")));if(r)throw this.$__handleReject(r),r;this.$__.saveOptions=t;let n=this;return SCe(async function(){try{await n.$__save(t)}catch(i){throw n.$__handleReject(i),i}finally{n.$__.saving=null,n.$__.saveOptions=null,n.$__.$versionError=null,n.$op=null}return n},()=>({operation:"save",collection:n.constructor.collection.name,database:n.constructor.db?.name,serverAddress:n.constructor.db?.host,serverPort:n.constructor.db?.port,args:{options:t}}))};z.prototype.$save=z.prototype.save;z.prototype.$__version=function(e,t){let r=this.$__schema.options.versionKey;if(e===!0){if(r)ibe(t,r,0),this.$__setValue(r,0);return}if(r===!1)return;if(!this.$__isSelected(r))return;if(QJ===(QJ&this.$__.version)){let n=this.$__getValue(r);if(n!=null)e[r]=n}if(Tg===(Tg&this.$__.version))if(cd(t.$set,r,null)!=null)++t.$set[r];else t.$inc=t.$inc||{},t.$inc[r]=1};z.prototype.increment=function(){return this.$__.version=fbe,this};z.prototype.$__where=function(t){if(t||(t={}),!t._id)t._id=this._doc._id;if(this._doc._id===void 0)throw new _e("No _id found on document!");return t};z.prototype.deleteOne=function(t){if(typeof t==="function"||typeof arguments[1]==="function")throw new _e("Model.prototype.deleteOne() no longer accepts a callback");if(!t)t={};if(Object.hasOwn(t,"session"))this.$session(t.session);let r=this,n=this.$__where(),s=r.constructor.deleteOne();if(this.$session()!=null){if(!("session"in s.options))s.options.session=this.$session()}let i=vo(t,"pre"),o=vo(t,"post");return s.pre(async function(){let a=await r.constructor._middleware.execPre("deleteOne",r,[r,t],{filter:i});if(a[0]!==r||a[1]!==t)throw new _e("Document deleteOne pre hooks cannot overwrite arguments");if(s.deleteOne(n,t),r.$where!=null)this.where(r.$where);return a}),s.pre(function(){return Promise.all(r.$getAllSubdocs().map((a)=>a.constructor._middleware.execPre("deleteOne",a,[a],{filter:i})))}),s.pre(function(){if(r.$__.isDeleted)throw new Ro.skipWrappedFunction}),s.post(function(){return Promise.all(r.$getAllSubdocs().map((a)=>a.constructor._middleware.execPost("deleteOne",a,[a],{filter:o})))}),s.post(function(){return r.constructor._middleware.execPost("deleteOne",r,[r],{filter:o})}),s.transform(function(a){if(a?.deletedCount>0)r.$isDeleted(!0);return a}),s};z.prototype.$model=function(t){if(arguments.length===0)return this.constructor;return this[_c].model(t)};z.prototype.model=z.prototype.$model;z.exists=function(t,r){if(ke(this,"exists"),typeof arguments[2]==="function")throw new _e("Model.exists() no longer accepts a callback");return this.findOne(t).select({_id:1}).sort(null).lean().setOptions(r)};z.discriminator=function(e,t,r){let n;if(typeof e==="function"){if(n=e,e=ue.getFunctionName(n),!(n.prototype instanceof z))throw new _e("The provided class "+e+" must extend Model")}r=r||{};let s=ue.isPOJO(r)?r.value:r,i=typeof r.clone==="boolean"?r.clone:!0,o=typeof r.mergePlugins==="boolean"?r.mergePlugins:!0,u=typeof r.overwriteModels==="boolean"?r.overwriteModels:!1;if(ke(this,"discriminator"),ue.isObject(t)&&!t.instanceOfSchema)t=new bO(t);if(t instanceof bO&&i)t=t.clone();if(t=WCe(this,e,t,s,o,r.mergeHooks,u),HCe(this.db.models,e)&&!t.options.overwriteModels&&!u)throw new TCe(e);t.$isRootDiscriminator=!0,t.$globalPluginsApplied=!0,n=this.db.model(n||e,t,this.$__collection.name),this.discriminators[e]=n;let a=this.discriminators[e];if(Object.setPrototypeOf(a.prototype,this.prototype),Object.defineProperty(a,"baseModelName",{value:this.modelName,configurable:!0,writable:!1}),nX(a,t),iX(a,t),this[ad]!=null)for(let c of this[ad])c.discriminators=c.discriminators||{},c.discriminators[e]=n.__subclass(n.db,t,c.collection.name);return a};function ke(e,t){if(e==null||e===global)throw new _e("`Model."+t+"()` cannot run without a model as `this`. Make sure you are calling `MyModel."+t+"()` where `MyModel` is a Mongoose model.");else if(e[hX]==null)throw new _e("`Model."+t+"()` cannot run without a model as `this`. Make sure you are not calling `new Model."+t+"()`")}/*!
1032
+ * Give the constructor the ability to emit events.
1033
+ */for(let e in CO.prototype)z[e]=CO.prototype[e];z.init=function(){if(ke(this,"init"),typeof arguments[0]==="function")throw new _e("Model.init() no longer accepts a callback");if(this.schema.emit("init",this),this.$init!=null)return this.$init;let t=this.db,r=async()=>{if(!ue.getOption("autoIndex",this.schema.options,t.config,t.base.options))return;return await this.ensureIndexes({_automatic:!0})},n=async()=>{if(!ue.getOption("autoSearchIndex",this.schema.options,t.config,t.base.options))return;return await this.createSearchIndexes()},s=async()=>{let u=ue.getOption("autoCreate",this.schema.options,t.config);if(u==null)await t._waitForConnect(!0),u=ue.getOption("autoCreate",this.schema.options,t.config,t.base.options);if(!u)return;return await this.createCollection()};this.$init=s().then(()=>r()).then(()=>n());let i=this.$init.catch,o=this;return this.$init.catch=function(){return o.$caught=!0,i.apply(o.$init,arguments)},this.$init};z.createCollection=async function(t){if(ke(this,"createCollection"),typeof arguments[0]==="function"||typeof arguments[1]==="function")throw new _e("Model.createCollection() no longer accepts a callback");let r=vo(t,"pre"),n=vo(t,"post");if(t?.middleware!=null){let{middleware:c,...l}=t;t=l}[t]=await this.hooks.execPre("createCollection",this,[t],{filter:r}).catch((c)=>{if(c instanceof Ro.skipWrappedFunction)return[c];throw c});let s=this?.schema?.options?.collectionOptions;if(s!=null)t=Object.assign({},s,t);let i=this?.schema?.options?.collation;if(i!=null)t=Object.assign({collation:i},t);let o=this?.schema?.options?.capped;if(o!=null){if(typeof o==="number")t=Object.assign({capped:!0,size:o},t);else if(typeof o==="object")t=Object.assign({capped:!0},o,t)}let u=this?.schema?.options?.timeseries;if(u!=null){if(t=Object.assign({timeseries:u},t),t.expireAfterSeconds!=null);else if(t.expires!=null)ue.expires(t);else if(this.schema.options.expireAfterSeconds!=null)t.expireAfterSeconds=this.schema.options.expireAfterSeconds;else if(this.schema.options.expires!=null)t.expires=this.schema.options.expires,ue.expires(t)}let a=this?.schema?.options?.clusteredIndex;if(a!=null)t=Object.assign({clusteredIndex:{...a,unique:!0}},t);try{if(!(t instanceof Ro.skipWrappedFunction))await this.db.createCollection(this.$__collection.collectionName,t)}catch(c){if(c!=null&&(c.name!=="MongoServerError"||c.code!==48))await this.hooks.execPost("createCollection",this,[null],{error:c,filter:n})}return await this.hooks.execPost("createCollection",this,[this.$__collection],{filter:n}),this.$__collection};z.syncIndexes=async function(t){if(ke(this,"syncIndexes"),typeof arguments[0]==="function"||typeof arguments[1]==="function")throw new _e("Model.syncIndexes() no longer accepts a callback");if(t?.autoCreate??this.schema.options?.autoCreate??this.db.config.autoCreate??this.db.base?.options?.autoCreate??!0)try{await this.createCollection()}catch(i){if(i!=null&&(i.name!=="MongoServerError"||i.code!==48))throw i}let n=await this.diffIndexes({indexOptionsToCreate:!0}),s=await this.cleanIndexes({...t,toDrop:n.toDrop});return await this.createIndexes({...t,toCreate:n.toCreate}),s};z.createSearchIndex=async function(t){return ke(this,"createSearchIndex"),await this.$__collection.createSearchIndex(t)};z.updateSearchIndex=async function(t,r){return ke(this,"updateSearchIndex"),await this.$__collection.updateSearchIndex(t,r)};z.dropSearchIndex=async function(t){return ke(this,"dropSearchIndex"),await this.$__collection.dropSearchIndex(t)};z.listSearchIndexes=async function(t){return ke(this,"listSearchIndexes"),await(await this.$__collection.listSearchIndexes(t)).toArray()};z.diffIndexes=async function(t){if(typeof arguments[0]==="function"||typeof arguments[1]==="function")throw new _e("Model.syncIndexes() no longer accepts a callback");let r=this,n=await r.listIndexes().catch((a)=>{if(a.codeName=="NamespaceNotFound")return;throw a});if(n===void 0)n=[];n=XCe(r,n);let s=r.schema,i=ZCe(r,s.indexes()),o=Ebe(s,i,n),u=gbe(s,i,n,o,t);return{toDrop:o,toCreate:u}};function gbe(e,t,r,n,s){let i=[],o=s?.indexOptionsToCreate??!1;for(let[u,a]of t){let c=!1,l=PO(e,Ma(a));for(let f of r){if(xO(f))continue;if(aX(u,l,f)&&!n.includes(f.name)){c=!0;break}}if(!c)if(o)i.push([u,a]);else i.push(u)}return i}function Ebe(e,t,r){let n=[];for(let s of r){let i=!1;if(xO(s))continue;if(JCe(s,e.options))continue;for(let[o,u]of t){let a=PO(e,Ma(u));if(sX(o,a,e.options),aX(o,a,s)){i=!0;break}}if(i)continue;n.push(s.name)}return n}z.cleanIndexes=async function(t){if(ke(this,"cleanIndexes"),typeof arguments[0]==="function"||typeof arguments[1]==="function")throw new _e("Model.cleanIndexes() no longer accepts a callback");let r=this;if(Array.isArray(t?.toDrop))return await JJ(t.toDrop,r,t);let n=await r.diffIndexes();return await JJ(n.toDrop,r,t)};async function JJ(e,t,r){if(e.length===0)return[];let n=t.$__collection;if(r?.hideIndexes)await Promise.all(e.map((s)=>t.db.db.command({collMod:n.collectionName,index:{name:s,hidden:!0}})));else await Promise.all(e.map((s)=>n.dropIndex(s)));return e}z.listIndexes=async function(){if(ke(this,"listIndexes"),typeof arguments[0]==="function")throw new _e("Model.listIndexes() no longer accepts a callback");if(this.$__collection.buffer)await new Promise((t)=>{this.$__collection.addQueue(t)});return this.$__collection.listIndexes().toArray()};z.ensureIndexes=async function(t){if(ke(this,"ensureIndexes"),typeof arguments[0]==="function"||typeof arguments[1]==="function")throw new _e("Model.ensureIndexes() no longer accepts a callback");await new Promise((r,n)=>{_be(this,t,(s)=>{if(s!=null)return n(s);r()})})};z.createIndexes=async function(t){if(ke(this,"createIndexes"),typeof arguments[0]==="function"||typeof arguments[1]==="function")throw new _e("Model.createIndexes() no longer accepts a callback");return this.ensureIndexes(t)};/*!
1034
+ * ignore
1035
+ */function _be(e,t,r){let n=Array.isArray(t?.toCreate)?t.toCreate:e.schema.indexes(),s;t=t||{};let i=function(h){if(h&&!e.$caught)e.emit("error",h);e.emit("index",h||s),r&&r(h||s)};for(let h of n)if(xO(h))ue.warn('mongoose: Cannot specify a custom index on `_id` for model name "'+e.modelName+'", MongoDB does not allow overwriting the default `_id` index. See https://bit.ly/mongodb-id-index');let o=[];for(let h of n){let d=h[0];if(h[1].name==null){for(let m of o)if(m[1].name==null&&QCe(m[0],d)){ue.warn("mongoose: Duplicate schema index on "+JSON.stringify(d)+' for model "'+e.modelName+'". This is often due to declaring an index using both "index: true" and "schema.index()". MongoDB will not create the duplicate index and options on the duplicate definition (such as expireAfterSeconds or unique) will not be applied. Please remove the duplicate index definition.');break}}o.push(h)}if(!n.length){YJ(function(){i()});return}let u=function(h,d,p,m){e.emit("index-single-done",h,d,p,m)},a=function(h,d){e.emit("index-single-start",h,d)},c=e.schema._baseSchema,l=c?c.indexes():[];YJ(function(){if(t._automatic&&!e.collection.collection)e.collection.addQueue(f,[]);else f()});function f(){if(t._automatic){if(e.schema.options.autoIndex===!1||e.schema.options.autoIndex==null&&e.db.config.autoIndex===!1)return i()}let h=n.shift();if(!h)return i();if(t._automatic&&h[1]._autoIndex===!1)return f();if(l.find((E)=>ue.deepEqual(E,h)))return f();let d=Ma(h[0]),p=Ma(h[1]);delete p._autoIndex,PO(e.schema,p),oX(e.schema,p),sX(d,p,e.schema.options),a(d,p);let m=null;try{m=e.collection.createIndex(d,p)}catch(E){if(!s)s=E;if(!e.$caught)e.emit("error",E);u(E,d,p),f();return}m.then((E)=>{u(null,d,p,E),f()},(E)=>{if(!s)s=E;if(!e.$caught)e.emit("error",E);u(E,d,p),f()})}}z.createSearchIndexes=async function(){ke(this,"createSearchIndexes");let t=[];for(let r of this.schema._searchIndexes)t.push(await this.createSearchIndex(r));return t};z.schema;z.db;z.collection;z.$__collection;z.base;z.discriminators;z.translateAliases=function(t,r){ke(this,"translateAliases");let n=(s,i)=>{let o,u=[],a=s.split("."),c=this.schema;for(let f in a){let h=a[f];if(c?.aliases[h]){if(o=c.aliases[h],r&&o in t)throw new _e(`Provided object has both field "${h}" and its alias "${o}"`);u.push(o)}else o=h,u.push(h);if(c?.paths[o])c=c.paths[o].schema;else c=null}let l=u.join(".");if(t instanceof Map)t.set(l,i);else t[l]=i;if(l!==s)if(t instanceof Map)t.delete(s);else delete t[s];return t};if(typeof t==="object"){if(t instanceof Map)for(let s of new Map(t))t=n(s[0],s[1]);else for(let s of Object.keys(t))if(t=n(s,t[s]),s[0]==="$")if(Array.isArray(t[s]))for(let i in t[s])t[s][i]=this.translateAliases(t[s][i]);else this.translateAliases(t[s]);return t}else return t};z.deleteOne=function(t,r){if(ke(this,"deleteOne"),typeof arguments[0]==="function"||typeof arguments[1]==="function"||typeof arguments[2]==="function")throw new _e("Model.prototype.deleteOne() no longer accepts a callback");let n=new this.Query({},{},this,this.$__collection);return n.setOptions(r),n.deleteOne(t)};z.deleteMany=function(t,r){if(ke(this,"deleteMany"),typeof arguments[0]==="function"||typeof arguments[1]==="function"||typeof arguments[2]==="function")throw new _e("Model.deleteMany() no longer accepts a callback");let n=new this.Query({},{},this,this.$__collection);return n.setOptions(r),n.deleteMany(t)};z.find=function(t,r,n){if(ke(this,"find"),typeof arguments[0]==="function"||typeof arguments[1]==="function"||typeof arguments[2]==="function"||typeof arguments[3]==="function")throw new _e("Model.find() no longer accepts a callback");let s=new this.Query({},{},this,this.$__collection);return s.select(r),s.setOptions(n),s.find(t)};z.findAndCount=async function(t,r,n){if(ke(this,"findAndCount"),n==null)throw new _e("Model.findAndCount() requires an `options` argument with `sort` and `limit`");let s=this.find(t,r,n);if(n.sort==null&&!this.schema.options.defaultSort)throw new _e("Model.findAndCount() requires `options.sort`");if(ue.isEmptyObject(s.options.sort))throw new _e("Model.findAndCount() does not allow an empty `options.sort`, like `sort: null`. Omit `options.sort` to use the schema's `defaultSort`.");if(n.limit==null)throw new _e("Model.findAndCount() requires `options.limit`");let i=s.clone().countDocuments().skip(0).limit(null);return Promise.all([s.exec(),i.exec()])};z.findById=function(t,r,n){if(ke(this,"findById"),typeof arguments[0]==="function"||typeof arguments[1]==="function"||typeof arguments[2]==="function")throw new _e("Model.findById() no longer accepts a callback");return this.findOne({_id:t},r,n)};z.findOne=function(t,r,n){if(ke(this,"findOne"),typeof arguments[0]==="function"||typeof arguments[1]==="function"||typeof arguments[2]==="function")throw new _e("Model.findOne() no longer accepts a callback");let s=new this.Query({},{},this,this.$__collection);return s.select(r),s.setOptions(n),s.findOne(t)};z.estimatedDocumentCount=function(t){return ke(this,"estimatedDocumentCount"),new this.Query({},{},this,this.$__collection).estimatedDocumentCount(t)};z.countDocuments=function(t,r){if(ke(this,"countDocuments"),typeof arguments[0]==="function"||typeof arguments[1]==="function"||typeof arguments[2]==="function")throw new _e("Model.countDocuments() no longer accepts a callback");let n=new this.Query({},{},this,this.$__collection);if(r!=null)n.setOptions(r);return n.countDocuments(t)};z.distinct=function(t,r,n){if(ke(this,"distinct"),typeof arguments[0]==="function"||typeof arguments[1]==="function"||typeof arguments[2]==="function")throw new _e("Model.distinct() no longer accepts a callback");let s=new this.Query({},{},this,this.$__collection);if(n!=null)s.setOptions(n);return s.distinct(t,r)};z.where=function(t,r){ke(this,"where");let n=new this.Query({},{},this,this.$__collection).find({});return n.where.apply(n,arguments)};z.$where=function(){ke(this,"$where");let t=new this.Query({},{},this,this.$__collection).find({});return t.$where.apply(t,arguments)};z.findOneAndUpdate=function(e,t,r){if(ke(this,"findOneAndUpdate"),typeof arguments[0]==="function"||typeof arguments[1]==="function"||typeof arguments[2]==="function"||typeof arguments[3]==="function")throw new _e("Model.findOneAndUpdate() no longer accepts a callback");let n;if(r)n=r.fields||r.projection;let s=new this.Query({},{},this,this.$__collection);return s.select(n),s.findOneAndUpdate(e,t,r)};z.findByIdAndUpdate=function(e,t,r){if(ke(this,"findByIdAndUpdate"),typeof arguments[0]==="function"||typeof arguments[1]==="function"||typeof arguments[2]==="function"||typeof arguments[3]==="function")throw new _e("Model.findByIdAndUpdate() no longer accepts a callback");if(e instanceof Fi)e=e._doc._id;return this.findOneAndUpdate.call(this,{_id:e},t,r)};z.findOneAndDelete=function(e,t){if(ke(this,"findOneAndDelete"),typeof arguments[0]==="function"||typeof arguments[1]==="function"||typeof arguments[2]==="function")throw new _e("Model.findOneAndDelete() no longer accepts a callback");let r;if(t)r=t.select,t.select=void 0;let n=new this.Query({},{},this,this.$__collection);return n.select(r),n.findOneAndDelete(e,t)};z.findByIdAndDelete=function(e,t){if(ke(this,"findByIdAndDelete"),typeof arguments[0]==="function"||typeof arguments[1]==="function"||typeof arguments[2]==="function")throw new _e("Model.findByIdAndDelete() no longer accepts a callback");return this.findOneAndDelete({_id:e},t)};z.findOneAndReplace=function(e,t,r){if(ke(this,"findOneAndReplace"),typeof arguments[0]==="function"||typeof arguments[1]==="function"||typeof arguments[2]==="function"||typeof arguments[3]==="function")throw new _e("Model.findOneAndReplace() no longer accepts a callback");let n;if(r)n=r.select,r.select=void 0;let s=new this.Query({},{},this,this.$__collection);return s.select(n),s.findOneAndReplace(e,t,r)};z.create=async function(t,r){if(typeof r==="function"||typeof arguments[2]==="function")throw new _e("Model.create() no longer accepts a callback");ke(this,"create");let n,s=this.schema.options.discriminatorKey;if(Array.isArray(t))n=t,r=r!=null&&typeof r==="object"?r:{};else{let u=arguments[arguments.length-1];if(r={},typeof u==="function"||typeof r==="function"||typeof arguments[2]==="function")throw new _e("Model.create() no longer accepts a callback");else if(n=[...arguments],n.length>1&&!u)n.pop();if(n.length===2&&n[0]!=null&&n[1]!=null&&n[0].session==null&&u&&GCe(u.session)==="ClientSession"&&!this.schema.path("session"))ue.warn("WARNING: to pass a `session` to `Model.create()` in Mongoose, you **must** pass an array as the first argument. See: https://mongoosejs.com/docs/api/model.html#Model.create()")}if(n.length===0)return Array.isArray(t)?[]:null;let i=[],o=typeof r.aggregateErrors==="boolean"?!r.aggregateErrors:!0;if(delete r.aggregateErrors,r.session&&!r.ordered&&n.length>1)throw new _e("Cannot call `create()` with a session and multiple documents unless `ordered: true` is set");if(!Array.isArray(t)&&n.length===1){let u=t,a=this.discriminators&&t[s]!=null?eh(this.discriminators,t[s])||th(this.discriminators,t[s]):this;if(a==null)throw new _e(`Discriminator "${t[s]}" not found for model "${this.modelName}"`);if(!(u instanceof a))u=new a(u);return await u.$save(r),u}if(r.ordered){for(let u=0;u<n.length;u++)try{let a=n[u],c=this.discriminators&&a[s]!=null?eh(this.discriminators,a[s])||th(this.discriminators,a[s]):this;if(c==null)throw new _e(`Discriminator "${a[s]}" not found for model "${this.modelName}"`);let l=a;if(!(l instanceof c))l=new c(l);await l.$save(r),i.push(l)}catch(a){if(!o)i.push(a);else throw a}return i}else if(!o)i=await Promise.allSettled(n.map(async(u)=>{let a=this.discriminators&&u[s]!=null?eh(this.discriminators,u[s])||th(this.discriminators,u[s]):this;if(a==null)throw new _e(`Discriminator "${u[s]}" not found for model "${this.modelName}"`);let c=u;if(!(c instanceof a))c=new a(c);return await c.$save(r),c})),i=i.map((u)=>u.status==="fulfilled"?u.value:u.reason);else{let u=null;if(i=await Promise.all(n.map(async(a)=>{let c=this.discriminators&&a[s]!=null?eh(this.discriminators,a[s])||th(this.discriminators,a[s]):this;if(c==null)throw new _e(`Discriminator "${a[s]}" not found for model "${this.modelName}"`);try{let l=a;if(!(l instanceof c))l=new c(l);return await l.$save(r),l}catch(l){if(!u)u=l}})),u)throw u}return i};z.insertOne=async function(t,r){if(ke(this,"insertOne"),t==null||typeof t!=="object")throw new tX(t,"doc","insertOne");let n=this.schema.options.discriminatorKey,s=this.discriminators&&t[n]!=null?eh(this.discriminators,t[n])||th(this.discriminators,t[n]):this;if(s==null)throw new _e(`Discriminator "${t[n]}" not found for model "${this.modelName}"`);if(!(t instanceof s))t=new s(t);return await t.$save(r)};z.watch=function(e,t){ke(this,"watch"),t=t||{};let r=t?.hydrate!==void 0?ue.omit(t,["hydrate"]):{...t};t.model=this,e=e||[],nbe(e,this.schema,"fullDocument");let n=this.db._waitForConnect().then(()=>this.$__collection.watch(e,r));return new OCe(n,e,t)};z.startSession=function(){return ke(this,"startSession"),this.db.startSession.apply(this.db,arguments)};z.insertMany=async function(t,r){if(ke(this,"insertMany"),typeof r==="function"||typeof arguments[2]==="function")throw new _e("Model.insertMany() no longer accepts a callback");let n=this;return CCe(function(){return Abe.call(n,t,r)},()=>({operation:"insertMany",collection:n.collection.name,database:n.db?.name,serverAddress:n.db?.host,serverPort:n.db?.port,args:{docs:t,options:r}}))};async function Abe(e,t){t=t||{};let r=this._middleware.hasHooks("insertMany"),n=r?vo(t,"pre"):null,s=r?vo(t,"post"):null;if(r)try{[e]=await this._middleware.execPre("insertMany",this,[e],{filter:n})}catch(O){await this._middleware.execPost("insertMany",this,[e],{error:O,filter:s})}let i=this,o=t.limit||1000,u=!!t.rawResult,a=t.ordered==null?!0:!!t.ordered,c=!!t.throwOnValidationError,l=!!t.lean,f=this.db.base.transactionAsyncLocalStorage?.getStore();if(!Object.hasOwn(t,"session")&&f?.session!=null)t={...t,session:f.session};if(!Array.isArray(e))e=[e];let h=[],d=a?null:Array(e.length),p=t.session;function m(O,x){if(l)return O;let v=!1;if(!(O instanceof i)){if(O!=null&&typeof O!=="object")return Promise.reject(new tX(O,"arr."+x,"insertMany"));O=new i(O),v=!0}if(p!=null)O.$session(p);return O.$validate(v?{_skipParallelValidateCheck:!0}:null).then(()=>O).catch((P)=>{if(a===!1){P.index=x,h.push(P),d[x]=P;return}throw P})}let E=await tbe(e,m,o),y={},_=[],w=l?_:[],C=i.schema.options.versionKey?i.schema.paths[i.schema.options.versionKey]?.splitPath():null,A=t.timestamps;for(let O=0;O<E.length;++O){let x=E[O];if(x==null)continue;if(y[_.length]=O,_.push(x),l)continue;if(C)x.$__setValue(C,0);if(A!==!1&&x.initializeTimestamps&&(!x.$__||x.$__.timestamps!==!1))x.initializeTimestamps(A);w.push(x.$__hasOnlyPrimitiveValues()?x.$__toObjectShallow():x.toObject(MO))}if(h.length>0&&a===!1)h.sort((O,x)=>O.index-x.index);if(_.length===0){if(c)throw new bg(h,d,null,"insertMany");if(u){let O={acknowledged:!0,insertedCount:0,insertedIds:{}};return gc(O,h,h),O}return[]}let M;try{M=await this.$__collection.insertMany(w,t)}catch(O){if(O.writeErrors==null&&O.result?.result?.writeErrors!=null)O.writeErrors=O.result.result.writeErrors;let x=O?.writeErrors,v=new Set((O?.writeErrors||[]).map((ge)=>ge.index));if(O.writeErrors!=null)for(let ge=0;ge<O.writeErrors.length;++ge){let Me=O.writeErrors[ge],oe=y[Me.index];if(Me.err!=null)Me.err.index=oe;if(!a)d[oe]=O.writeErrors[ge]}if(!a){for(let ge=0;ge<d.length;++ge)if(d[ge]===void 0)d[ge]=E[ge];O.results=d}let P=-1;if(O.insertedDocs=_.filter((ge,Me)=>{let oe=!x||v.has(Me);if(a){if(P>-1)return Me<P;if(oe)P=Me}return!oe}).map(function(Me){if(l)return Me;return Me.$__reset(!0),rh(Me,!1),Me}),u&&a===!1)gc(O,h,d);if(r)await this._middleware.execPost("insertMany",this,[e],{error:O,filter:s});else throw O}if(!l)for(let O of _){let x=O.$__hasOnlyPrimitiveValues();O.$__reset(!0,x),rh(O,!1,x)}if(a===!1&&c&&h.length>0){for(let O=0;O<d.length;++O)if(d[O]===void 0)d[O]=E[O];throw new bg(h,d,M,"insertMany")}if(u){if(a===!1){for(let O=0;O<d.length;++O)if(d[O]===void 0)d[O]=E[O];gc(M,h,d)}return M}if(t.populate!=null)return this.populate(_,t.populate).catch((O)=>{if(O!=null)O.insertedDocs=_;throw O});if(r){let[O]=await this._middleware.execPost("insertMany",this,[_],{filter:s});return O}return _}/*!
1036
+ * @param {Document} doc The document to set `$isNew` on.
1037
+ * @param {boolean} val The value to set `$isNew` to.
1038
+ * @param {boolean} [hasOnlyPrimitiveValues] Skip getting subdocs for performance if we know there are none.
1039
+ * @api private
1040
+ */function rh(e,t,r){if(e.$isNew=t,e.$emit("isNew",t),e.constructor.emit("isNew",t),r)return;let n=e.$getAllSubdocs({useCache:!0});for(let s of n)s.$isNew=t,s.$emit("isNew",t)}z.bulkWrite=async function(t,r){if(ke(this,"bulkWrite"),typeof r==="function"||typeof arguments[2]==="function")throw new _e("Model.bulkWrite() no longer accepts a callback");let n=this;return bCe(function(){return wbe.call(n,t,r)},()=>({operation:"bulkWrite",collection:n.collection.name,database:n.db?.name,serverAddress:n.db?.host,serverPort:n.db?.port,args:{ops:t,options:r}}))};async function wbe(e,t){t=t||{};let r=vo(t,"pre"),n=vo(t,"post");try{[e,t]=await this.hooks.execPre("bulkWrite",this,[e,t],{filter:r})}catch(a){if(a instanceof Ro.skipWrappedFunction)e=a;else await this.hooks.execPost("bulkWrite",this,[null],{error:a,filter:n})}if(e instanceof Ro.skipWrappedFunction)return e.args[0];let s=t.ordered==null?!0:t.ordered;if(e.length===0){let c=new(this.base.driver.get()).BulkWriteResult(OO(),!1);return c.n=0,gc(c,[],[]),c}let i=t?._skipCastBulkWrite?[]:e.map((a)=>LCe(this,a,t)),o=this.db.base.transactionAsyncLocalStorage?.getStore();if((!t||!Object.hasOwn(t,"session"))&&o?.session!=null)t={...t,session:o.session};let u=null;if(s){await new Promise((a,c)=>{KCe(i,(l,f)=>l(f),(l)=>{if(l)return c(l);a()})});try{u=await this.$__collection.bulkWrite(e,t)}catch(a){await this.hooks.execPost("bulkWrite",this,[null],{error:a,filter:n})}}else{let a=[],c=[],l=[];if(i.length>0)a=await Promise.all(e.map((p,m)=>{if(m>=i.length)return m;return new Promise((E)=>{i[m]((y)=>{if(y==null)E(m);else c.push({index:m,error:y}),l[m]=y;E()})})})),a=a.filter((p)=>p!=null);else a=e.map((p,m)=>m);c=c.sort((p,m)=>p.index-m.index).map((p)=>p.error);let f=a.sort((p,m)=>p-m).map((p)=>e[p]);if(f.length===0){if(t.throwOnValidationError&&c.length)throw new bg(c,l,u,"bulkWrite");let m=new(this.base.driver.get()).BulkWriteResult(OO(),!1);return m.result=OO(),gc(m,c,l),m}let h;[u,h]=await this.$__collection.bulkWrite(f,t).then((p)=>[p,null]).catch((p)=>[null,p]);let d={};if(h?.writeErrors)for(let p of h.writeErrors)d[p.err.index]=p;for(let p=0;p<a.length;++p)l[a[p]]=d[p]??null;if(h){if(c.length>0)gc(h,c,l);await this.hooks.execPost("bulkWrite",this,[null],{error:h,filter:n})}if(c.length>0)if(t.throwOnValidationError)throw new bg(c,l,u,"bulkWrite");else gc(u,c,l)}return await this.hooks.execPost("bulkWrite",this,[u],{filter:n}),u}z.bulkSave=async function(t,r){if(r=r||{},r.timestamps!=null)for(let h of t)h.$__.saveOptions=h.$__.saveOptions||{},h.$__.saveOptions.timestamps=r.timestamps;else for(let h of t)if(h.$__.timestamps!=null)h.$__.saveOptions=h.$__.saveOptions||{},h.$__.saveOptions.timestamps=h.$__.timestamps;if(Object.hasOwn(r,"session"))for(let h of t)h.$session(r.session);await Promise.all(t.map((h)=>Obe(h,r)));let n=[],s=this.buildBulkWriteOperations(t,r,n),i={skipValidation:!0,_skipCastBulkWrite:!0,...r},{bulkWriteResult:o,bulkWriteError:u}=await this.bulkWrite(s,i).then((h)=>({bulkWriteResult:h,bulkWriteError:null}),(h)=>({bulkWriteResult:null,bulkWriteError:h}));if(u!=null&&u.name!=="MongoBulkWriteError")throw u;let a=o?.matchedCount??0,c=o?.insertedCount??0;if(s.length>0&&a+c<s.length&&!u)throw new cbe(this.modelName,t,o);let l=u?.writeErrors||[],f=t;if(l.length>0)if(r.ordered!==!1)f=t.slice(0,n[l[0].index]);else{let h=t.length>=25?{}:null;if(h!=null)for(let d of l)h[n[d.index]]=!0;f=t.filter((d,p)=>h==null?!l.some((m)=>n[m.index]===p):!h[p])}if(await Promise.all(f.map((h)=>Sbe(h,r))),u!=null)throw u;return o};async function Obe(e,t){let r=vo(t,"pre"),[n]=await e.schema.s.hooks.execPre("save",e,[t],{filter:r});if(n!==t)throw new _e('Cannot overwrite options in pre("save") hook on bulkSave()')}async function Sbe(e,t){let r=e.$isNew;if(r)rh(e,!1);if(e.$__reset(),!r)e._applyVersionIncrement();let n=vo(t,"post");return e.schema.s.hooks.execPost("save",e,[e],{filter:n})}z.applyDefaults=function e(t){if(t==null)return t;if(ld(t)){PCe(t,t.$__.fields,t.$__.exclude);for(let r of t.$getAllSubdocs())e(r,r.$__.fields,r.$__.exclude);return t}return BCe(t,this.schema),t};z.applyVirtuals=function(t,r){if(t==null)return t;if(ld(t))return t;return qCe(this.schema,t,r),t};z.applyTimestamps=function(t,r){if(t==null)return t;if(ld(t))return t;return kCe(this.schema,t,r),t};z.castObject=function(t,r){r=r||{};let n={},s=this.schema,i=s.options.discriminatorKey;if(s.discriminators!=null&&t!=null&&t[i]!=null)s=uX(s,t[i])||s;let o=Object.keys(s.paths);for(let a of o){if(!s.path(a)?.$isMongooseArray)continue;let l=cd(t,a);lX(o,l,a)}let u=null;for(let a of o){let c=s.path(a);if(c==null)continue;let l=cd(t,a,void 0);if(l==null)continue;let f=a.indexOf(".")===-1?[a]:a.split("."),h=n;for(let d=0;d<f.length-1;++d){if(h[f[d]]==null)h[f[d]]=isNaN(f[d+1])?{}:[];h=h[f[d]]}if(c.$isMongooseDocumentArray){let d=c.options?.castNonArrays??c.constructor.options.castNonArrays;if(!Array.isArray(l)){if(!d){if(!r.ignoreCastErrors)u=u||new Cg,u.addError(a,new lbe(a,l))}else h[f[f.length-1]]=[z.castObject.call(c.Constructor,l)];continue}}if(c.$isSingleNested||c.$isMongooseDocumentArrayElement){try{l=z.castObject.call(c.Constructor,l)}catch(d){if(!r.ignoreCastErrors)u=u||new Cg,u.addError(a,d);continue}h[f[f.length-1]]=l;continue}try{l=c.cast(l),h[f[f.length-1]]=l}catch(d){if(!r.ignoreCastErrors)u=u||new Cg,u.addError(a,d);continue}}if(u!=null){if(this.modelName!=null)for(let a of Object.keys(u.errors)){let c=u.errors[a];if(typeof c.setModel==="function")c.setModel(this)}throw u}return n};z.buildBulkWriteOperations=function(t,r,n){if(!Array.isArray(t))throw new _e(`bulkSave expects an array of documents to be passed, received \`${t}\` instead`);return i(),t.map((o,u)=>{if(!r.skipValidation){if(!(o instanceof Fi))throw new _e(`documents.${u} was not a mongoose document, documents must be an array of mongoose documents (instanceof mongoose.Document).`);if(r.validateBeforeSave==null||r.validateBeforeSave){let f=o.$__validateSync();if(f!=null)throw f}}if(o.isNew){let f=o.$__schema.options.versionKey;if(f)o.$__setValue(f,0);let h={insertOne:{document:o}};return ue.injectTimestampsOption(h.insertOne,r.timestamps),n?.push(u),h}let c=o.$__delta();if(c!=null&&!ue.isEmptyObject(c[0])){let f=o.$__where(c[0]),h=c[1];DO(o,f);let d=this.schema.options.shardKey;if(d){let m=Object.keys(d),E=m.length;for(let y=0;y<E;++y)f[m[y]]=o[m[y]]}o.$__version(f,c);let p={updateOne:{filter:f,update:h}};return ue.injectTimestampsOption(p.updateOne,r.timestamps),n?.push(u),p}return null}).filter((o)=>o!==null);function i(){if(r=r||{},r.skipValidation==null)r.skipValidation=!1}};z.hydrate=function(t,r,n){if(ke(this,"hydrate"),n?.virtuals&&n?.hydratedPopulatedDocs===!1)throw new _e("Cannot set `hydratedPopulatedDocs` option to false if `virtuals` option is truthy because `virtuals: true` also sets populated virtuals");if(r!=null){if(ld(t))t=t.toObject(MO);r=rbe(r),t=$Ce(t,r)}let s=pf().createModel(this,t,r,r,n);return s.$init(t,n),s};z.updateMany=function(t,r,n){if(ke(this,"updateMany"),r==null)throw new _e("updateMany `update` parameter cannot be nullish");return FO(this,"updateMany",t,r,n)};z.updateOne=function(t,r,n){return ke(this,"updateOne"),FO(this,"updateOne",t,r,n)};z.replaceOne=function(t,r,n){ke(this,"replaceOne");let s=this?.schema?.options?.versionKey||null;if(s&&!r[s])r[s]=0;return FO(this,"replaceOne",t,r,n)};function FO(e,t,r,n,s){let i=new e.Query({},{},e,e.collection);if(r instanceof Fi)r=r.toObject();else r=Ma(r);s=typeof s==="function"?s:Ma(s);let o=e?.schema?.options?.versionKey??null;return zCe(n,s,o),i[t](r,n,s)}z.aggregate=function(t,r){if(ke(this,"aggregate"),typeof r==="function"||typeof arguments[2]==="function")throw new _e("Model.aggregate() no longer accepts a callback");let n=new wCe(t||[]);if(n.model(this),r!=null)n.option(r);return n};z.validate=async function(t,r,n){if(arguments.length<3||arguments.length===3&&typeof arguments[2]==="function")n=t;if(typeof n==="function"||typeof arguments[3]==="function")throw new _e("Model.validate() no longer accepts a callback");let s=this.schema,i=s.options.discriminatorKey;if(s.discriminators!=null&&t!=null&&t[i]!=null)s=uX(s,t[i])||s;let o=Object.keys(s.paths);if(r!=null){let c=typeof r==="string"?new Set(r.split(" ")):Array.isArray(r)?new Set(r):new Set(o);o=o.filter((l)=>{if(r.pathsToSkip){if(Array.isArray(r.pathsToSkip)){if(r.pathsToSkip.find((d)=>d==l))return!1}else if(typeof r.pathsToSkip=="string"){if(r.pathsToSkip.indexOf(" ")!==-1&&r.pathsToSkip.split(" ").includes(l))return!1;else if(r.pathsToSkip===l)return!1}}let f=l.split("."),h=f[0];for(let d of f.slice(1)){if(c.has(h))return!0;h+="."+d}return c.has(l)})}for(let c of o){let l=s.path(c);if(!l?.$isMongooseArray||l.$isMongooseDocumentArray)continue;let f=cd(t,c);lX(o,f,c)}let u=null;o=new Set(o);try{t=this.castObject(t)}catch(c){u=c;for(let l of Object.keys(u.errors||{}))o.delete(l)}let a=[];for(let c of o){let l=s.path(c);if(l==null)continue;let f=cd(t,c,void 0);a.push(l.doValidate(f,n,{path:c}).catch((h)=>{u=u||new Cg,u.addError(c,h)}))}if(await Promise.all(a),u!=null)throw u;return t};Object.defineProperty(z,"~standard",{configurable:!0,get(){return{version:1,vendor:"mongoose",validate:(e,t)=>this.validate(e,t?.libraryOptions).then((r)=>({value:r}),(r)=>({issues:UCe(r)}))}}});z.populate=async function(t,r){if(ke(this,"populate"),typeof r==="function"||typeof arguments[2]==="function")throw new _e("Model.populate() no longer accepts a callback");if(r=ue.populate(r),r.length===0)return t;if(r.find((n)=>n.ordered))for(let n of r)await XJ(this,t,n);else{let n=[];for(let s of r)n.push(XJ(this,t,s));await Promise.all(n)}return t};/*!
1041
+ * Populates `docs` for a single `populateOptions` instance.
1042
+ */var Cbe=/\s?-_id\s?/,bbe=/\s?-_id\s?/g;async function XJ(e,t,r){if(r.strictPopulate==null){if(r._localModel?.schema._userProvidedOptions.strictPopulate!=null)r.strictPopulate=r._localModel.schema._userProvidedOptions.strictPopulate;else if(r._localModel!=null&&e.base.options.strictPopulate!=null)r.strictPopulate=e.base.options.strictPopulate;else if(e.base.options.strictPopulate!=null)r.strictPopulate=e.base.options.strictPopulate}if(!Array.isArray(t))t=[t];if(t.length===0||t.every(ue.isNullOrUndefined))return;let n=YCe(e,t,r);if(n instanceof Error)throw n;let s=n.length,i=[];function o(f){return f!==void 0}let u=!1,a=[];for(let f=0;f<s;++f){let h=n[f],d=h.options.select,p=ue.array.flatten(h.ids,o);p=ue.array.unique(p);let m={};if(m.sort=h&&h.options&&h.options.options&&h.options.options.sort||void 0,m.excludeId=Cbe.test(d)||d&&d._id===0,h.options&&h.options.options&&h.options.options.lean&&h.options.options.lean.transform)h.options.options._leanTransform=h.options.options.lean.transform,h.options.options.lean=!0;if(p.length===0||p.every(ue.isNullOrUndefined)){eX(e,[],h,m);continue}if(u=!0,typeof r.foreignField==="string")h.foreignField.clear(),h.foreignField.add(r.foreignField);if(m.excludeId)if(typeof d==="string")d=d.replace(bbe," ");else if(Array.isArray(d))d=d.filter((_)=>_!=="-_id");else{let{_id:_,...w}=d;d=w}if(h.options.options?.limit!=null)m.originalLimit=h.options.options.limit;else if(h.options.limit!=null)m.originalLimit=h.options.limit;let E=ube(h,p,d,m);if(E!=null){a.push(...E);continue}let y=VCe(p,h.match,h.foreignField,h.model,h.options.skipInvalidIds);a.push([h,y,d,m])}if(!u){if(n.length!==0)return;if(r.populate!=null){let f=ue.populate(r.populate).map((h)=>Object.assign({},h,{path:r.path+"."+h.path}));return e.populate(t,f)}return}let c=new Map,l=[];if(r.ordered)for(let f=0;f<a.length;f++){let h=a[f],{docs:d,deferredPopulates:p}=await ZJ.apply(null,h);if(l.push(d),!h[0]._assignFromOwnResults)i=i.concat(d);if(p.length>0)c.set(f,p)}else{let f=[];for(let d of a)f.push(ZJ.apply(null,d));let h=await Promise.all(f);for(let d=0;d<h.length;d++){let{docs:p,deferredPopulates:m}=h[d];if(l.push(p),!a[d][0]._assignFromOwnResults)i=i.concat(p);if(m.length>0)c.set(d,m)}}for(let f=0;f<a.length;f++){let h=a[f],d=h[0],p=h[3],m=d._assignFromOwnResults?l[f]:i;for(let E of m)d.options._childDocs.push(E);eX(e,m,d,p)}if(c.size>0)for(let f=0;f<a.length;f++){let d=a[f][0];if(!Array.isArray(d.match))continue;let p=c.get(f);if(!p||p.length===0)continue;let m=[];for(let E of d.docs){let y=ld(E)?E.get(d.options.path):ue.getValue(d.options.path,E);if(Array.isArray(y))m.push(...y);else if(y!=null)m.push(y)}if(m.length>0)for(let E of p)await d.model.populate(m,E)}for(let f=0;f<a.length;f++){let h=a[f][0];sbe(h.foreignField,h.options,h._assignFromOwnResults?l[f]:i)}for(let f=0;f<a.length;f++){let h=a[f][0];if(h.options?.options?._leanTransform){let d=h._assignFromOwnResults?l[f]:i;for(let p of d)h.options.options._leanTransform(p)}}}/*!
1043
+ * ignore
1044
+ */function ZJ(e,t,r){if(t==null)return Promise.resolve({docs:[],deferredPopulates:[]});let n=Ma(e.options.populate),s={};if(e.options.skip!==void 0)s.skip=e.options.skip;if(e.options.limit!==void 0)s.limit=e.options.limit;if(e.options.perDocumentLimit!==void 0)s.perDocumentLimit=e.options.perDocumentLimit;if(Object.assign(s,e.options.options),s.readPreference==null&&e.options._inheritedReadPreference!=null)s.readPreference=e.options._inheritedReadPreference;if(s.readConcern==null&&e.options._inheritedReadConcern!=null)s.readConcern=e.options._inheritedReadConcern;if(e.count)delete s.skip,s.sort??={};if(s.perDocumentLimit!=null)s.limit=s.perDocumentLimit,delete s.perDocumentLimit;else if(s.limit!=null)s.limit=s.limit*e.ids.length;if(Array.isArray(e.match))s._deferPopulate=!0;let i=e.model.find(t,r,s);for(let u of e.foreignField)if(u!=="_id"&&i.selectedInclusively()&&!ebe(i._fields,u))i.select(u);if(e.count)for(let u of e.foreignField)i.select(u);let o=n&&Array.isArray(e.match);if(n){if(e.model.baseModelName!=null)if(Array.isArray(n))n.forEach((a)=>{a.strictPopulate=!1});else if(typeof n==="string")n={path:n,strictPopulate:!1};else n.strictPopulate=!1;let u=e.options._fullPath||e.options.path;if(Array.isArray(n)){for(let a of n)if(a._fullPath=u+"."+a.path,o&&a._localModel==null)a._localModel=e.model}else if(typeof n==="object"){if(n._fullPath=u+"."+n.path,o&&n._localModel==null)n._localModel=e.model}}if(n&&!o)i.populate(n);return i.exec().then((u)=>{for(let c of u)cX.set(c,e.model);let a=[];if(i._deferredPopulate)a.push(...i._deferredPopulate),delete i._deferredPopulate;if(o)n=ue.populate(n),obe(i,n),a.push(n);return{docs:u,deferredPopulates:a}})}/*!
1045
+ * ignore
1046
+ */function eX(e,t,r,n){let{options:s,isVirtual:i,justOne:o}=r,u,a=s&&s.options&&s.options.lean||!1,c=t.length,l={},f={},h,d,p=Ma(r.allIds);for(let m=0;m<c;m++){if(d=t[m],d==null)continue;for(let E of r.foreignField){if(u=ue.getValue(E,d),Array.isArray(u)){u=ue.array.unique(ue.array.flatten(u));for(let y of u){if(y instanceof Fi)y=y._doc._id;if(h=String(y),f[h])if(Array.isArray(f[h]))f[h].push(d),l[h].push(m);else f[h]=[f[h],d],l[h]=[l[h],m];else if(i&&!o)f[h]=[d],l[h]=[m];else f[h]=d,l[h]=m}}else{if(u instanceof Fi)u=u._doc._id;if(h=String(u),f[h]){if(Array.isArray(f[h]))f[h].push(d),l[h].push(m);else if(i||f[h].constructor!==d.constructor||(f[h]instanceof Fi?String(f[h]._doc._id):String(f[h]._id))!==(d instanceof Fi?String(d._doc._id):String(d._id)))f[h]=[f[h],d],l[h]=[l[h],m]}else f[h]=d,l[h]=m}if(!a)d.$__.wasPopulated=d.$__.wasPopulated||{value:u}}}jCe({originalModel:e,rawIds:r.isVirtual?p:r.allIds,allIds:p,unpopulatedValues:r.unpopulatedValues,foreignField:r.foreignField,rawDocs:f,rawOrder:l,docs:r.docs,path:s.path,options:n,justOne:r.justOne,isVirtual:r.isVirtual,allOptions:r,populatedModel:r.model,lean:a,virtual:r.virtual,count:r.count,match:r.match})}z.compile=function(t,r,n,s,i){if(r.options.versionKey!==!1&&!r.paths[r.options.versionKey]){let f={};f[r.options.versionKey]=Number,r.add(f)}let u;if(typeof t==="function"&&t.prototype instanceof z)u=t,t=u.name,r.loadClass(u,!1),u.prototype.$isMongooseModelPrototype=!0;else u=function f(h,d,p){if(f.hooks.execPreSync("createModel",h),!(this instanceof f))return new f(h,d,p);let m=f.schema.options.discriminatorKey;if(f.discriminators==null||h==null||h[m]==null){z.call(this,h,d,p);return}let E=eh(f.discriminators,h[m])||th(f.discriminators,h[m]);if(E!=null)return new E(h,d,p);z.call(this,h,d,p)};if(u.hooks=r.s.hooks.clone(),u.base=i,u.modelName=t,!(u.prototype instanceof z))Object.setPrototypeOf(u,z),Object.setPrototypeOf(u.prototype,z.prototype);u.model=function(h){return this.db.model(h)},u.db=s,u.prototype.db=s,u.prototype[_c]=s,u.discriminators=u.prototype.discriminators=void 0,u[hX]=!0,u.events=new CO,r._preCompile();let c={schemaUserProvidedOptions:r._userProvidedOptions||{},capped:r.options.capped,Promise:u.base.Promise,modelName:t};if(r.options.autoCreate!==void 0)c.autoCreate=r.options.autoCreate;let l=s.collection(n,c);return u.prototype.collection=l,u.prototype.$collection=l,u.prototype[Ec]=l,u.prototype.$__setSchema(r),nX(u,r),iX(u,r),ICe(u,r),vCe(u,r.s.hooks,r.statics),u.schema=u.prototype.$__schema,u.collection=l,u.$__collection=l,u.Query=function(){yc.apply(this,arguments)},Object.setPrototypeOf(u.Query.prototype,yc.prototype),u.Query.base=yc.base,u.Query.prototype.constructor=yc,u._applyQueryMiddleware(),Dbe(u,r.query),u};z.clientEncryption=function(){let t=this.base.driver.get().ClientEncryption;if(!t)throw new _e("The mongodb driver must be used to obtain a ClientEncryption object.");let r=this.collection?.conn?.client;if(!r)return null;let n=r.options.autoEncryption;if(!n)return null;let{keyVaultNamespace:s,keyVaultClient:i,kmsProviders:o,credentialProviders:u,proxyOptions:a,tlsOptions:c}=n;return new t(i??r,{keyVaultNamespace:s,kmsProviders:o,credentialProviders:u,proxyOptions:a,tlsOptions:c})};z.$__updateConnection=function(t){this.db=t,this.prototype.db=t,this.prototype[_c]=t;let r=t.collection(this.collection.collectionName,this.collection.opts);this.prototype.collection=r,this.prototype.$collection=r,this.prototype[Ec]=r,this.collection=r,this.$__collection=r};function Dbe(e,t){for(let r in t)e.Query.prototype[r]=t[r]}z.__subclass=function(t,r,n){let s=this,i=function l(f,h,d){if(!(this instanceof l))return new l(f,h,d);s.call(this,f,h,d)};if(Object.setPrototypeOf(i,s),Object.setPrototypeOf(i.prototype,s.prototype),i.db=t,i.prototype.db=t,i.prototype[_c]=t,s[ad]=s[ad]||[],s[ad].push(i),s.discriminators!=null){i.discriminators={};for(let l of Object.keys(s.discriminators))i.discriminators[l]=s.discriminators[l].__subclass(s.db,s.discriminators[l].schema,n)}let o=r&&typeof r!=="string"?r:s.prototype.$__schema,u=o.options||{},a=o._userProvidedOptions||{};if(!n)n=s.prototype.$__schema.get("collection")||ue.toCollectionName(s.modelName,this.base.pluralize());let c={schemaUserProvidedOptions:a,capped:o&&u.capped};return i.prototype.collection=t.collection(n,c),i.prototype.$collection=i.prototype.collection,i.prototype[Ec]=i.prototype.collection,i.collection=i.prototype.collection,i.$__collection=i.collection,i.init().catch(()=>{}),i};z.recompileSchema=function(){if(this.prototype.$__setSchema(this.schema),this.schema._applyDiscriminators!=null)for(let t of this.schema._applyDiscriminators.keys())this.discriminator(t,this.schema._applyDiscriminators.get(t));delete this.schema._defaultToObjectOptionsMap,NCe(this.schema,new WeakSet,!0),this.schema._preCompile()};z.inspect=function(){return`Model { ${this.modelName} }`};z.namespace=function(){return this.db.name+"."+this.collection.collectionName};if(Dg.inspect.custom)z[Dg.inspect.custom]=z.inspect;/*!
1047
+ * Applies query middleware from this model's schema to this model's
1048
+ * Query constructor.
1049
+ */z._applyQueryMiddleware=function(){let t=this.Query,r=this.schema.s.hooks.filter((n)=>{let s=Tbe(n);if(n.name==="validate")return!!s.query;if(n.name==="deleteOne"||n.name==="updateOne")return!!s.query||ue.hasOwnKeys(s)===!1;if(n.query!=null||n.document!=null)return!!n.query;return!0});t.prototype._queryMiddleware=r};function Tbe(e){let t={};if(Object.hasOwn(e,"query"))t.query=e.query;if(Object.hasOwn(e,"document"))t.document=e.document;return t}/*!
1050
+ * Module exports.
1051
+ */dX.exports=fX=z});var mX=g(function(hd,pX){pX.exports=Pbe;hd.pluralization=[[/human$/gi,"humans"],[/(m|wom)an$/gi,"$1en"],[/(pe)rson$/gi,"$1ople"],[/(child)$/gi,"$1ren"],[/^(ox)$/gi,"$1en"],[/(ax|test)is$/gi,"$1es"],[/(octop|cact|foc|fung|nucle)us$/gi,"$1i"],[/(alias|status|virus)$/gi,"$1es"],[/(bu)s$/gi,"$1ses"],[/(buffal|tomat|potat)o$/gi,"$1oes"],[/([ti])um$/gi,"$1a"],[/sis$/gi,"ses"],[/(?:([^f])fe|([lr])f)$/gi,"$1$2ves"],[/(hive)$/gi,"$1s"],[/([^aeiouy]|qu)y$/gi,"$1ies"],[/(x|ch|ss|sh)$/gi,"$1es"],[/(matr|vert|ind)ix|ex$/gi,"$1ices"],[/([m|l])ouse$/gi,"$1ice"],[/(kn|w|l)ife$/gi,"$1ives"],[/(quiz)$/gi,"$1zes"],[/^goose$/i,"geese"],[/s$/gi,"s"],[/([^a-z])$/,"$1"],[/$/gi,"s"]];var Mbe=hd.pluralization;hd.uncountables=["advice","energy","excretion","digestion","cooperation","health","justice","labour","machinery","equipment","information","pollution","sewage","paper","money","species","series","rain","rice","fish","sheep","moose","deer","news","expertise","status","media"];var xbe=hd.uncountables;function Pbe(e){let t;if(e=e.toLowerCase(),!~xbe.indexOf(e)){if(t=Mbe.filter(function(r){return e.match(r[0])}),t[0])return e.replace(t[0][0],t[0][1])}return e}});var AX=g(function(sNe,_X){/*!
1052
+ * Module requirements
1053
+ */var gX=Le(),Mg=L("util"),yX=O6();class xa extends gX{constructor(){super("");this.errors={}}toString(){return yX(this)}inspect(){return Object.assign(Error(this.message),this)}addError(e,t){if(t instanceof xa){let{errors:r}=t;for(let n of Object.keys(r))this.addError(n,r[n]);return}this.errors[e]=t,this.message=yX(this)}}if(Mg.inspect.custom)xa.prototype[Mg.inspect.custom]=xa.prototype.inspect;Object.defineProperty(xa.prototype,"toJSON",{enumerable:!1,writable:!1,configurable:!0,value:function(){return Object.assign({},this,{name:this.name,message:this.message})}});Object.defineProperty(xa.prototype,"name",{value:"SetOptionError"});class EX extends gX{constructor(e){super(`"${e}" is not a valid option to set`)}}xa.SetOptionInnerError=EX;/*!
1054
+ * Module exports
1055
+ */_X.exports=xa});var wX=g(function(){var xg=we();if(typeof jest<"u"&&!process.env.SUPPRESS_JEST_WARNINGS){if(typeof window<"u")xg.warn("Mongoose: looks like you're trying to test a Mongoose app with Jest's default jsdom test environment. Please make sure you read Mongoose's docs on configuring Jest to test Node.js apps: https://mongoosejs.com/docs/jest.html. Set the SUPPRESS_JEST_WARNINGS to true to hide this warning.");if(typeof setTimeout.clock?.Date==="function")xg.warn("Mongoose: looks like you're trying to test a Mongoose app with Jest's mock timers enabled. Please make sure you read Mongoose's docs on configuring Jest to test Node.js apps: https://mongoosejs.com/docs/jest.html. Set the SUPPRESS_JEST_WARNINGS to true to hide this warning.")}});var xX=g(function(TX,MX){/*!
1056
+ * Module dependencies.
1057
+ */var Fbe=bo(),Bbe=L("events").EventEmitter,nh=Ja(),Ls=ic(),Nbe=_r(),qo=Mf(),Ibe=$y(),ih=v2(),Pg=BG(),$be=b1(),Rbe=og(),OX=iO(),vbe=ew(),kbe=w4(),BO=k2(),qbe=mX(),ko=we(),SX=Sw(),jbe=ac(),Lbe=eO(),Ube=c1().trusted,Vbe=Vw(),zbe=vn(),Wbe=Do(),fu=Le(),hu=AX(),Kbe=nO(),CX=Symbol.for("mongoose:default"),bX=Symbol("mongoose:defaultConnection");wX();var Hbe=/^[0-9A-Fa-f]{24}$/,{AsyncLocalStorage:DX}=L("async_hooks");function re(e){if(this.connections=[],this.nextConnectionId=0,this.models={},this.events=new Bbe,this.__driver=BO.get(),this.options=Object.assign({pluralization:!0,autoIndex:!0,autoCreate:!0,autoSearchIndex:!1},e),(ko.getOption("createInitialConnection",this.options)??!0)&&this.__driver!=null)NO(this);if(this.options.pluralization)this._pluralize=qbe;if(!e?.[CX]){let r=this;this.Schema=function(){return this.base=r,Ls.apply(this,arguments)},this.Schema.prototype=Object.create(Ls.prototype),Object.assign(this.Schema,Ls),this.Schema.base=this,this.Schema.Types=Object.assign({},Ls.Types)}else for(let r of["Schema","model"])this[r]=re.prototype[r];if(this.Schema.prototype.base=this,e?.transactionAsyncLocalStorage)this.transactionAsyncLocalStorage=new DX;Object.defineProperty(this,"plugins",{configurable:!1,enumerable:!0,writable:!1,value:Object.values(kbe).map((r)=>[r,{deduplicate:!0}])})}re.prototype.cast=jbe;re.prototype.STATES=ih;re.prototype.ConnectionStates=ih;re.prototype.driver=BO;re.prototype.setDriver=function(t){let r=this instanceof re?this:Wn;if(r.__driver===t)return r;if(r.connections&&r.connections.find((o)=>o.readyState!==ih.disconnected))throw new fu("Cannot modify Mongoose driver if a connection is already open. Call `mongoose.disconnect()` before modifying the driver");if(r.__driver=t,Array.isArray(t.plugins)){for(let o of t.plugins)if(typeof o==="function")r.plugin(o)}if(t.SchemaTypes!=null)Object.assign(Wn.Schema.Types,t.SchemaTypes);let s=t.Connection,i=r.connections[0];if(r.connections=[new s(r)],r.connections[0].models=r.models,i==null)return r;for(let o of Object.values(r.models)){if(o.db!==i)continue;o.$__updateConnection(r.connections[0])}return r};re.prototype.set=function(t,r){let n=this instanceof re?this:Wn;if(t==null){let o=new hu;throw o.addError(String(t),new hu.SetOptionInnerError(String(t))),o}if(arguments.length===1&&typeof t!=="object"){if(Pg.indexOf(t)===-1){let o=new hu;throw o.addError(t,new hu.SetOptionInnerError(t)),o}return n.options[t]}let s={};if(arguments.length===2)s={[t]:r};if(arguments.length===1&&typeof t==="object")s=t;let i=void 0;for(let[o,u]of Object.entries(s)){if(Pg.indexOf(o)===-1){if(!i)i=new hu;i.addError(o,new hu.SetOptionInnerError(o));continue}if(n.options[o]=u,o==="objectIdGetter")if(u)Object.defineProperty(n.Types.ObjectId.prototype,"_id",{enumerable:!1,configurable:!0,get:function(){return this}});else delete n.Types.ObjectId.prototype._id;else if(o==="transactionAsyncLocalStorage"){if(u&&!n.transactionAsyncLocalStorage)n.transactionAsyncLocalStorage=new DX;else if(!u&&n.transactionAsyncLocalStorage)delete n.transactionAsyncLocalStorage}else if(o==="createInitialConnection"){if(u&&!n.connection)NO(n);else if(u===!1&&n.connection?.[bX]){if(n.connection.readyState===ih.disconnected&&ko.hasOwnKeys(n.connection.models)===!1)n.connections.shift()}}else if(o==="returnOriginal"){if(n.options.returnDocument!=null)throw new fu("Cannot set `returnOriginal` when `returnDocument` is already set. Use `returnDocument` instead.");ko.warn("Mongoose: the `returnOriginal` option for `mongoose.set()` is deprecated. Use `mongoose.set('returnDocument', "+(u===!0?"'before'":"'after'")+")` instead.")}else if(o==="returnDocument"){if(n.options.returnOriginal!=null)throw new fu("Cannot set `returnDocument` when `returnOriginal` is already set. Use `returnDocument` instead of `returnOriginal`.")}}if(i)throw i;return n};re.prototype.get=re.prototype.set;re.prototype.createConnection=function(t,r){let n=this instanceof re?this:Wn,i=new n.__driver.Connection(n);if(n.connections.push(i),n.nextConnectionId++,n.events.emit("createConnection",i),arguments.length>0)i.openUri(t,{...r,_fireAndForget:!0});return i};re.prototype.connect=async function(t,r){if(typeof r==="function"||arguments.length>=3&&typeof arguments[2]==="function")throw new fu("Mongoose.prototype.connect() no longer accepts a callback");let n=this instanceof re?this:Wn;if(n.connection==null)NO(n);return n.connection.openUri(t,r).then(()=>n)};re.prototype.disconnect=async function(){if(arguments.length>=1&&typeof arguments[0]==="function")throw new fu("Mongoose.prototype.disconnect() no longer accepts a callback");let t=this instanceof re?this:Wn;if(t.connections.length<=0)return;await Promise.all(t.connections.map((n)=>n.close()))};re.prototype.startSession=function(){let t=this instanceof re?this:Wn;return t.connection.startSession.apply(t.connection,arguments)};re.prototype.pluralize=function(t){let r=this instanceof re?this:Wn;if(arguments.length>0)r._pluralize=t;return r._pluralize};re.prototype.model=function(t,r,n,s){let i=this instanceof re?this:Wn;if(typeof r==="string")n=r,r=!1;if(arguments.length===1){let c=Wbe(i.models,t);if(!c)throw new i.Error.MissingSchemaError(t);return c}if(ko.isObject(r)&&!(r instanceof Ls))r=new Ls(r);if(r&&!(r instanceof Ls))throw new i.Error("The 2nd parameter to `mongoose.model()` should be a schema or a POJO");s=s||{};let o=r;if(r){if(i.get("cloneSchemas"))r=r.clone();i._applyPlugins(r)}let u=Object.hasOwn(i.options,"overwriteModels")?i.options.overwriteModels:s.overwriteModels;if(Object.hasOwn(i.models,t)&&s.cache!==!1&&u!==!0){if(o?.instanceOfSchema&&o!==i.models[t].schema)throw new i.Error.OverwriteModelError(t);if(n&&n!==i.models[t].collection.name){let c=i.models[t];return r=c.prototype.schema,c.__subclass(i.connection,r,n)}return i.models[t]}if(r==null)throw new i.Error.MissingSchemaError(t);let a=i._model(t,r,n,s);return i.connection.models[t]=a,i.models[t]=a,a};/*!
1058
+ * ignore
1059
+ */re.prototype._model=function(t,r,n,s){let i=this instanceof re?this:Wn,o;if(typeof t==="function"){if(o=t,t=o.name,!(o.prototype instanceof OX))throw new i.Error("The provided class "+t+" must extend Model")}if(t==="__proto__")throw new i.Error('Model name "__proto__" is not allowed');if(r){if(i.get("cloneSchemas"))r=r.clone();i._applyPlugins(r)}if(r==null||!("pluralization"in r.options))r.options.pluralization=i.options.pluralization;if(!n)n=r.get("collection")||ko.toCollectionName(t,i.pluralize());Kbe(r);let u=s.connection||i.connection;if(o=i.Model.compile(o||t,r,n,u,i),o.init().catch(function(){}),u.emit("model",o),r._applyDiscriminators!=null)for(let a of r._applyDiscriminators.keys()){let{schema:c,options:l}=r._applyDiscriminators.get(a);o.discriminator(a,c,l)}return o};re.prototype.deleteModel=function(t){let r=this instanceof re?this:Wn;return r.connection.deleteModel(t),delete r.models[t],r};re.prototype.modelNames=function(){let t=this instanceof re?this:Wn;return Object.keys(t.models)};re.prototype._applyPlugins=function(t,r){let n=this instanceof re?this:Wn;r=r||{},r.applyPluginsToDiscriminators=n.options?.applyPluginsToDiscriminators||!1,r.applyPluginsToChildSchemas=typeof n.options?.applyPluginsToChildSchemas==="boolean"?n.options.applyPluginsToChildSchemas:!0,vbe(t,n.plugins,r,"$globalPluginsApplied")};re.prototype.plugin=function(t,r){let n=this instanceof re?this:Wn;return n.plugins.push([t,r]),n};re.prototype.__defineGetter__("connection",function(){return this.connections[0]});re.prototype.__defineSetter__("connection",function(e){if(e instanceof this.__driver.Connection)this.connections[0]=e,this.models=e.models});re.prototype.connections;re.prototype.nextConnectionId;re.prototype.Aggregate=Lbe;re.prototype.BaseCollection=$E();Object.defineProperty(re.prototype,"Collection",{get:function(){return this.__driver.Collection},set:function(e){this.__driver.Collection=e}});Object.defineProperty(re.prototype,"Connection",{get:function(){return this.__driver.Connection},set:function(e){if(e===this.__driver.Connection)return;this.__driver.Connection=e}});re.prototype.BaseConnection=Ow();re.prototype.version=SX.version;re.prototype.Mongoose=re;re.prototype.Schema=Ls;re.prototype.SchemaType=Nbe;re.prototype.SchemaTypes=Ls.Types;re.prototype.VirtualType=Ibe;re.prototype.Types=$be;re.prototype.Query=Rbe;re.prototype.Model=OX;re.prototype.Document=Fbe;re.prototype.ObjectId=qo.ObjectId;re.prototype.isValidObjectId=function(t){return(this instanceof re?this:Wn).Types.ObjectId.isValid(t)};re.prototype.isObjectIdOrHexString=function(t){return zbe(t,"ObjectId")||typeof t==="string"&&Hbe.test(t)};re.prototype.syncIndexes=function(t){return(this instanceof re?this:Wn).connection.syncIndexes(t)};re.prototype.Decimal128=qo.Decimal128;re.prototype.Mixed=qo.Mixed;re.prototype.Date=qo.Date;re.prototype.Number=qo.Number;re.prototype.Error=fu;re.prototype.MongooseError=fu;re.prototype.now=function(){return new Date};re.prototype.CastError=fu.CastError;re.prototype.SchemaTypeOptions=As();re.prototype.mongo=null;re.prototype.mquery=Uw();re.prototype.sanitizeFilter=Vbe;re.prototype.trusted=Ube;re.prototype.skipMiddlewareFunction=nh.skipWrappedFunction;re.prototype.overwriteMiddlewareResult=nh.overwriteResult;re.prototype.overwriteMiddlewareArguments=nh.overwriteArguments;re.prototype.omitUndefined=KA();/*!
1060
+ * Create a new default connection (`mongoose.connection`) for a Mongoose instance.
1061
+ * No-op if there is already a default connection.
1062
+ */function NO(e){if(e.connection)return;let t=e.createConnection();t[bX]=!0,t.models=e.models}var Wn=MX.exports=TX=new re({[CX]:!0})});var BX=g(function(uNe,FX){/*!
1063
+ * Module dependencies.
1064
+ */var PX=PG();k2().set(PX);var fd=xX();fd.setDriver(PX);fd.Mongoose.prototype.mongo=qu();FX.exports=fd});var NX=g(function(aNe,Fe){var G=BX();Fe.exports=G;Fe.exports.default=G;Fe.exports.mongoose=G;Fe.exports.cast=G.cast;Fe.exports.STATES=G.STATES;Fe.exports.setDriver=G.setDriver;Fe.exports.set=G.set;Fe.exports.get=G.get;Fe.exports.createConnection=G.createConnection;Fe.exports.connect=G.connect;Fe.exports.disconnect=G.disconnect;Fe.exports.startSession=G.startSession;Fe.exports.pluralize=G.pluralize;Fe.exports.model=G.model;Fe.exports.deleteModel=G.deleteModel;Fe.exports.modelNames=G.modelNames;Fe.exports.plugin=G.plugin;Fe.exports.connections=G.connections;Fe.exports.version=G.version;Fe.exports.Aggregate=G.Aggregate;Fe.exports.Mongoose=G.Mongoose;Fe.exports.Schema=G.Schema;Fe.exports.SchemaType=G.SchemaType;Fe.exports.SchemaTypes=G.SchemaTypes;Fe.exports.VirtualType=G.VirtualType;Fe.exports.Types=G.Types;Fe.exports.Query=G.Query;Fe.exports.Model=G.Model;Fe.exports.Document=G.Document;Fe.exports.ObjectId=G.ObjectId;Fe.exports.isValidObjectId=G.isValidObjectId;Fe.exports.isObjectIdOrHexString=G.isObjectIdOrHexString;Fe.exports.syncIndexes=G.syncIndexes;Fe.exports.Decimal128=G.Decimal128;Fe.exports.Mixed=G.Mixed;Fe.exports.Date=G.Date;Fe.exports.Number=G.Number;Fe.exports.Error=G.Error;Fe.exports.MongooseError=G.MongooseError;Fe.exports.now=G.now;Fe.exports.CastError=G.CastError;Fe.exports.SchemaTypeOptions=G.SchemaTypeOptions;Fe.exports.mongo=G.mongo;Fe.exports.mquery=G.mquery;Fe.exports.sanitizeFilter=G.sanitizeFilter;Fe.exports.trusted=G.trusted;Fe.exports.skipMiddlewareFunction=G.skipMiddlewareFunction;Fe.exports.overwriteMiddlewareResult=G.overwriteMiddlewareResult});var RX=uS(US(),1);import{existsSync as Ybe}from"fs";import Qbe from"path";var Bi=uS(NX(),1);class oh extends Error{column;value;constructor(e,t){super(`Duplicate unique value: ${e} = ${t}`);this.name="DuplicateError",this.column=e,this.value=t}}class dd extends Error{column;constructor(e){super(`Missing required field: ${e}`);this.name="ValidationError",this.column=e}}class IO extends Error{constructor(){super(`File konfigurasi wajib \`noxium.config.ts\` tidak ditemukan.
1065
+ Silakan buat file tersebut di direktori root proyek Anda (misalnya: \`noxium.config.ts\`).
1066
+
1067
+ // noxium.config.ts
1068
+ export default function getConfig() {
1069
+ return {
1070
+ database: {
1071
+ type: "sqlite", // default minimal pakai SQLite
1072
+ sqlite: {
1073
+ path: "./data.db", // file database lokal
1074
+ },
1075
+ },
1076
+ };
1077
+ }
1078
+ `);this.name="RequiredConfigError"}}class Ac extends Error{constructor(e){super(e);this.name="InvalidConfigError"}}var Fg=(e)=>{if(!e)return"";if(typeof e==="string")return e;if(typeof e==="object"&&e!==null&&"_id"in e)return String(e._id);return String(e)},pd=(e,t)=>{if(!e)return e;let r={...e,id:Fg(e._id??e.id)};if(t)for(let[n,s]of Object.entries(t)){let i=r[n];if(i&&typeof i==="object"&&!Array.isArray(i)){let o={id:Fg(i._id??i.id)};for(let u of s)if(u in i)o[u]=i[u];r[n]=o,r.ownerId=o.id}else if(i)r[n]=Fg(i)}else if(r.owner&&typeof r.owner==="object")r.owner=Fg(r.owner._id??r.owner.id);return r};function IX(e,t,r){if(Bi.default.connection.readyState===0)Bi.default.connect(r.mongo.uri,{dbName:r.mongo.dbName??"test"});let n={};for(let[u,a]of Object.entries(t.fields)){let c={};if(a.type==="ref"){if(c.type=Bi.Schema.Types.ObjectId,a.ref)c.ref=a.ref}else if(a.type===Date)c.type=Date;else if(a.type===Number)c.type=Number;else if(a.type===Boolean)c.type=Boolean;else c.type=String;if(a.required)c.required=!0;if(a.unique)c.unique=!0;if(a.default!==void 0)c.default=a.default;if(a.lowercase)c.lowercase=!0;if(a.trim)c.trim=!0;n[u]=c}let s=new Bi.Schema(n,{timestamps:t.timestamps!==!1});if(t.ttl)s.index({[t.ttl.field]:1},{expireAfterSeconds:t.ttl.seconds});let i=Bi.default.models[e]||Bi.default.model(e,s),o=async(u)=>{if(!t.hooks?.afterFind||u.length===0)return;await t.hooks.afterFind(u)};return{async insert(u){try{let a=await i.create(u);return pd(a.toObject())}catch(a){if(a?.code===11000){let c=a.keyValue??a.keyPattern??{},l=Object.keys(c)[0]??"unknown";throw new oh(l,c[l])}if(a?.errors){let c=Object.keys(a.errors)[0]??"unknown";throw new dd(c)}throw a}},async update(u,a){if(!a)return null;let c={};if(typeof u==="object"&&u!==null){let f=Object.entries(u).filter(([,h])=>h!==void 0);if(f.length===0)return null;for(let[h,d]of f)if(h==="id")c._id=Bi.default.Types.ObjectId.isValid(String(d))?new Bi.default.Types.ObjectId(String(d)):d;else c[h]=d}else c._id=Bi.default.Types.ObjectId.isValid(String(u))?new Bi.default.Types.ObjectId(String(u)):u;let l=await i.findOneAndUpdate(c,{$set:a},{new:!0}).lean();return l?pd(l):null},async findAll(u){let a=i.find({});if(u?.populate)for(let[l,f]of Object.entries(u.populate))a=a.populate(l,f.join(" "));let c=await a.lean();return await o(c),c.map((l)=>pd(l,u?.populate))},async findUnique(u,a){let c=i.findOne(u);if(a?.populate)for(let[f,h]of Object.entries(a.populate))c=c.populate(f,h.join(" "));let l=await c.lean();if(!l)return null;return await o([l]),pd(l,a?.populate)},async findMany(u={},a){let c=i.find(u);if(a?.populate)for(let[f,h]of Object.entries(a.populate))c=c.populate(f,h.join(" "));let l=await c.lean();return await o(l),l.map((f)=>pd(f,a?.populate))},async deleteMany(u){let a=await i.deleteMany(u);return Number(a.deletedCount??0)}}}var Gbe=(e)=>{if(e===Number)return"REAL";if(e===Boolean)return"INTEGER";if(e===Date)return"INTEGER";return"TEXT"},uh=(e,t,r)=>{if(e===void 0||e===null)return null;if(t===Date)return e instanceof Date?e.getTime():new Date(e).getTime();if(t===Boolean)return e?1:0;if(typeof e==="string"){let n=r.trim?e.trim():e;if(r.lowercase)n=n.toLowerCase();return n}return e};function $X(e,t,r){let n=r.timestamps!==!1,s=["id TEXT PRIMARY KEY"];for(let[c,l]of Object.entries(r.fields)){let f=`${c} ${Gbe(l.type)}`;if(l.unique)f+=" UNIQUE";if(l.required)f+=" NOT NULL";if(l.default!==void 0){let h=typeof l.default==="string"?`'${l.default.replace(/'/g,"''")}'`:typeof l.default==="boolean"?l.default?1:0:l.default;f+=` DEFAULT ${h}`}s.push(f)}if(n){if(!("createdAt"in r.fields))s.push("createdAt INTEGER NOT NULL DEFAULT 0");if(!("updatedAt"in r.fields))s.push("updatedAt INTEGER NOT NULL DEFAULT 0")}e.exec(`CREATE TABLE IF NOT EXISTS ${t} (${s.join(", ")})`);let i=(c,l)=>{if(!c)return null;let f={id:String(c.id)};for(let[h,d]of Object.entries(r.fields)){let p=c[h];if(d.type===Date)f[h]=p!==null&&p!==void 0?new Date(Number(p)):null;else if(d.type===Boolean)f[h]=Boolean(p);else f[h]=p}if(n)f.createdAt=c.createdAt!==void 0?new Date(Number(c.createdAt)):new Date,f.updatedAt=c.updatedAt!==void 0?new Date(Number(c.updatedAt)):new Date;if(l)for(let[h,d]of Object.entries(l)){let p=c[`__pop_${h}_id`];if(p!==null&&p!==void 0){let m={id:String(p)};for(let E of d)m[E]=c[`__pop_${h}_${E}`];f[h]=m}}return f},o=(c,l)=>{let f=[];for(let h of c){let d=i(h,l);if(d!==null)f.push(d)}return f},u=async(c)=>{let l=Date.now();if(r.ttl){let f=l-r.ttl.seconds*1000;e.prepare(`DELETE FROM ${t} WHERE ${r.ttl.field} < ?`).run(f)}if(r.hooks?.afterFind){let f=o(c);await r.hooks.afterFind(f);for(let h of f)if(h&&h.__dirty){let{id:d,__dirty:p,...m}=h,E=Object.entries(m);if(E.length>0){let y=E.map(([w])=>`${w} = ?`).join(", "),_=E.map(([w,C])=>{let A=r.fields[w];if(A)return uh(C,A.type,A);if(C instanceof Date)return C.getTime();return C});e.prepare(`UPDATE ${t} SET ${y} WHERE id = ?`).run(..._,d)}}}},a=(c,l,f=!1)=>{let h=[],d=[];if(l?.populate)for(let[y,_]of Object.entries(l.populate)){let C=r.fields[y]?.ref??`${y}s`,A=`pop_${y}`;h.push(`LEFT JOIN ${C} ${A} ON ${A}.id = t.${y}`),d.push(`${A}.id AS __pop_${y}_id`);for(let M of _)d.push(`${A}.${M} AS __pop_${y}_${M}`)}let m=`SELECT ${["t.*",...d].join(", ")} FROM ${t} t ${h.join(" ")}`,E=[];if(c.length>0){let y=c.map(([_])=>`t.${_} = ?`);m+=` WHERE ${y.join(" AND ")}`;for(let[_,w]of c){let C=r.fields[_];E.push(C?uh(w,C.type,C):w)}}if(f)m+=" LIMIT 1";return{sql:m,params:E}};return{async insert(c){let l=Date.now(),f={id:c.id?String(c.id):crypto.randomUUID()};for(let[E,y]of Object.entries(r.fields)){let _=c[E]!==void 0?c[E]:y.default;if(y.required&&(_===void 0||_===null||_===""))throw new dd(E);if(_!==void 0)f[E]=uh(_,y.type,y)}if(n)f.createdAt=c.createdAt instanceof Date?c.createdAt.getTime():l,f.updatedAt=c.updatedAt instanceof Date?c.updatedAt.getTime():l;let h=Object.keys(f),d=h.map(()=>"?").join(", ");try{e.prepare(`INSERT INTO ${t} (${h.join(", ")}) VALUES (${d})`).run(...h.map((E)=>f[E]))}catch(E){let y=String(E?.message??"");if(y.includes("UNIQUE constraint failed")){let w=y.split("UNIQUE constraint failed: ")[1]?.split(".")[1]??Object.keys(r.fields).find((C)=>r.fields[C]?.unique)??"unknown";throw new oh(w,f[w])}throw E}let p=e.prepare(`SELECT * FROM ${t} WHERE id = ? LIMIT 1`).get(f.id),m=i(p);if(!m)throw Error(`Gagal mengambil data yang baru di-insert ke tabel ${t}.`);return m},async update(c,l){if(!l)return null;let f=Date.now(),h=typeof c==="object"&&c!==null?Object.entries(c).filter(([,y])=>y!==void 0):[["id",c]];if(h.length===0)return null;let d=[];for(let[y,_]of Object.entries(l)){if(y==="id"||_===void 0)continue;let w=r.fields[y];d.push([y,w?uh(_,w.type,w):_])}if(n)d.push(["updatedAt",f]);if(d.length===0)return null;let p=h.map(([y])=>`${y} = ?`).join(" AND "),m=h.map(([y,_])=>{let w=r.fields[y];return w?uh(_,w.type,w):_});try{let y=d.map(([_])=>`${_} = ?`).join(", ");e.prepare(`UPDATE ${t} SET ${y} WHERE ${p}`).run(...d.map(([,_])=>_),...m)}catch(y){let _=String(y?.message??"");if(_.includes("UNIQUE constraint failed")){let w=_.split("UNIQUE constraint failed: ")[1]?.split(".")[1]??"unknown";throw new oh(w,l[w])}throw y}let E=e.prepare(`SELECT * FROM ${t} WHERE ${p} LIMIT 1`).get(...m);return E?i(E):null},async findAll(c){let{sql:l,params:f}=a([],c,!1),h=e.prepare(l).all(...f);await u(h);let d=e.prepare(l).all(...f);return o(d,c?.populate)},async findUnique(c,l){let f=Object.entries(c),{sql:h,params:d}=a(f,l,!0),p=e.prepare(h).get(...d);if(!p)return null;await u([p]);let m=e.prepare(h).get(...d);return m?i(m,l?.populate):null},async findMany(c={},l){let f=Object.entries(c),{sql:h,params:d}=a(f,l,!1),p=e.prepare(h).all(...d);await u(p);let m=e.prepare(h).all(...d);return o(m,l?.populate)},async deleteMany(c){let l=Object.entries(c);if(l.length===0)return 0;let f=l.map(([p])=>`${p} = ?`),h=l.map(([p,m])=>{let E=r.fields[p];return E?uh(m,E.type,E):m}),d=e.prepare(`DELETE FROM ${t} WHERE ${f.join(" AND ")}`).run(...h);return Number(d.changes??0)}}}function Jbe(){let e=Qbe.resolve(process.cwd(),"noxium.config.ts");if(!Ybe(e))throw new IO;let t=L(e),r=t?.default??t,n=typeof r==="function"?r():r;if(!n?.database)throw new Ac("Konfigurasi `database` wajib ada di noxium.config.ts.");return n}class vX{config;models=new Map;constructor(e){this.config=e??Jbe();let t=this.config.schemas??{},r=this.config.database,n=null;if(r.type==="sqlite"){if(!r.sqlite?.path||r.sqlite.path.trim()==="")throw new Ac("Konfigurasi SQLite tidak valid: field `path` wajib diisi.");n=new RX.default(r.sqlite.path),n.pragma("journal_mode = WAL;")}else if(r.type==="mongo"){if(!r.mongo?.uri||r.mongo.uri.trim()==="")throw new Ac("Konfigurasi MongoDB tidak valid: field `uri` wajib diisi.")}else throw new Ac("Tipe database tidak dikenali.");for(let[s,i]of Object.entries(t)){let o=r.type==="sqlite"?$X(n,s,i):IX(s,i,r);this.models.set(s,o),this[s]=o}return new Proxy(this,{get(s,i,o){if(typeof i==="string"&&s.models.has(i))return s.models.get(i);return Reflect.get(s,i,o)}})}model(e){let t=this.models.get(String(e));if(!t)throw new Ac(`Model "${String(e)}" tidak terdaftar di schemas.`);return t}}var ANe=vX;export{oh as DuplicateError,Ac as InvalidConfigError,ANe as Noxium,IO as RequiredConfigError,dd as ValidationError};
1079
+
1080
+ //# debugId=132E107AC6288DC064756E2164756E21
1081
+ //# sourceMappingURL=noxium.mjs.map